diff --git a/.github/dependabot.yml b/.github/dependabot.yml index c632f306..ae0fd988 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -25,10 +25,6 @@ updates: - "@types/react" - "react" - "react-dom" - tailwind: - patterns: - - "@tailwindcss/*" - - "tailwindcss" testing-library: patterns: - "@testing-library/*" diff --git a/.npmignore b/.npmignore index 232d8c2b..e00738a2 100644 --- a/.npmignore +++ b/.npmignore @@ -8,5 +8,4 @@ tests/ .* webpack.* jest.config.js -tailwind.config.js tsconfig.json diff --git a/demo/App.tsx b/demo/App.tsx index 477c87d2..60dcab25 100644 --- a/demo/App.tsx +++ b/demo/App.tsx @@ -5,11 +5,11 @@ import { DemoPage } from "./DemoPage"; export const App = () => { return ( -
+
diff --git a/demo/Demo.tsx b/demo/Demo.tsx index 0e50a3c8..df2d069e 100644 --- a/demo/Demo.tsx +++ b/demo/Demo.tsx @@ -29,52 +29,48 @@ export const Demo = () => { }); return ( -
-
-
- {!isGeolocationAvailable ? ( -
Your browser does not support Geolocation.
- ) : !isGeolocationEnabled ? ( -
Geolocation is not enabled.
- ) : coords ? ( -
- You are at{" "} - - {formatDegrees(coords.latitude, false)} +
+
+ {!isGeolocationAvailable ? ( +
Your browser does not support Geolocation.
+ ) : !isGeolocationEnabled ? ( +
Geolocation is not enabled.
+ ) : coords ? ( +
+ You are at{" "} + + {formatDegrees(coords.latitude, false)} + + ,{" "} + + {formatDegrees(coords.longitude, true)} + + {coords.altitude ? ( + + , approximately {coords.altitude} meters above + sea level - ,{" "} - - {formatDegrees(coords.longitude, true)} - - {coords.altitude ? ( - - , approximately {coords.altitude} meters - above sea level - - ) : null} - . -
- ) : ( -
Getting the location data…
- )} - {!!positionError && ( -
-
- Last position error: -
{JSON.stringify(positionError)}
-
- )} -
-
-
- + ) : null} + . +
+ ) : ( +
Getting the location data…
+ )} + {!!positionError && ( +
+
+ Last position error: +
{JSON.stringify(positionError)}
+
+ )}
+
); }; diff --git a/demo/DemoPage.tsx b/demo/DemoPage.tsx index b1cddfd9..121a937e 100644 --- a/demo/DemoPage.tsx +++ b/demo/DemoPage.tsx @@ -3,52 +3,37 @@ import { Demo } from "./Demo"; export const DemoPage = () => { return ( -
-

react-geolocated

+
+

react-geolocated

React.js hook for using{" "} - + Geolocation API

-

Elevator pitch

+

Elevator pitch

react-geolocated is a{" "} - + configurable {" "} - React Hook that makes using the Geolocation API - easy, abstracting away some browser-specific quirks (differences - on how they handle permissions for example). + React Hook that makes using the Geolocation API easy, + abstracting away some browser-specific quirks (differences on + how they handle permissions for example).

-

Demo

+

Demo

The{" "} - + demo source code {" "} is available on{" "} - + GitHub , as well as the{" "} - + README {" "} with configuration options and other details. diff --git a/demo/index.css b/demo/index.css index f1d8c73c..b8c4e10e 100644 --- a/demo/index.css +++ b/demo/index.css @@ -1 +1,70 @@ -@import "tailwindcss"; +/* Grayscale Design palette: https://grayscale.design/app?lums=98.10,96.40,90.10,83.30,75.60,65.80,52.60,37.40,15.20,12.80,6.40,3.20&palettes=&filters=&names=&labels= */ +:root { + --grayscale-50: rgb(253, 253, 253); + --grayscale-100: rgb(251, 251, 251); + --grayscale-200: rgb(244, 244, 244); + --grayscale-300: rgb(235, 235, 235); + --grayscale-400: rgb(225, 225, 225); + --grayscale-500: rgb(212, 212, 212); + --grayscale-600: rgb(192, 192, 192); + --grayscale-700: rgb(165, 165, 165); + --grayscale-800: rgb(109, 109, 109); + --grayscale-900: rgb(100, 100, 100); + --grayscale-1000: rgb(72, 72, 72); + --grayscale-1100: rgb(50, 50, 50); +} + +body { + background-color: var(--grayscale-1100); + color: var(--grayscale-300); + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + padding: 0; + margin: 0; +} + +.main { + + a { + color: var(--grayscale-300); + text-decoration: underline; + } + + a:hover { + color: var(--grayscale-600); + text-decoration: none; + } +} + +.article { + background-color: var(--grayscale-900); + max-width: 40rem; + margin: 0 auto; + padding: 1rem; +} + +.demo { + background-color: var(--grayscale-300); + padding: 1rem; + margin: 1rem 0; + color: var(--grayscale-1100); + border-radius: 0.5rem; +} + +.demo-data { + margin: 1rem; + font-weight: bold; +} + +.get-position { + background-color: var(--grayscale-1000); + color: var(--grayscale-300); + cursor: pointer; + border: none; + border-radius: 0.5rem; + margin: 1rem; + padding: 0.5rem; +} + +.get-position:hover { + background-color: var(--grayscale-800); +} diff --git a/demo/index.html b/demo/index.html index 8a4fce3b..2ac91bdb 100644 --- a/demo/index.html +++ b/demo/index.html @@ -1,12 +1,12 @@ - - - react-geolocated - - - - -

- + + + react-geolocated + + + + +
+ diff --git a/package-lock.json b/package-lock.json index 17138970..2e44882a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "devDependencies": { "@eslint/js": "^10.0.1", - "@tailwindcss/postcss": "^4.0.9", + "@tailwindcss/postcss": "^4.3.0", "@testing-library/jest-dom": "^6.0.0", "@testing-library/react": "^16.0.0", "@types/jest": "^29.2.1", @@ -30,7 +30,6 @@ "react-github-corner": "^2.1.0", "rimraf": "^6.0.1", "semantic-release": "^25.0.1", - "tailwindcss": "^4.0.9", "ts-jest": "^29.0.3", "typescript": "5.8.3", "typescript-eslint": "^8.25.0" @@ -98,6 +97,7 @@ "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz", "integrity": "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -4427,6 +4427,9 @@ "arm64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -4444,6 +4447,9 @@ "arm64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -4461,6 +4467,9 @@ "x64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -4478,6 +4487,9 @@ "x64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -4517,72 +4529,6 @@ "node": ">=14.0.0" } }, - "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/core": { - "version": "1.10.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@emnapi/wasi-threads": "1.2.1", - "tslib": "^2.4.0" - } - }, - "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/runtime": { - "version": "1.10.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, - "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/wasi-threads": { - "version": "1.2.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, - "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@napi-rs/wasm-runtime": { - "version": "1.1.4", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@tybys/wasm-util": "^0.10.1" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Brooooooklyn" - }, - "peerDependencies": { - "@emnapi/core": "^1.7.1", - "@emnapi/runtime": "^1.7.1" - } - }, - "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@tybys/wasm-util": { - "version": "0.10.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, - "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/tslib": { - "version": "2.8.1", - "dev": true, - "inBundle": true, - "license": "0BSD", - "optional": true - }, "node_modules/@tailwindcss/oxide-win32-arm64-msvc": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.3.0.tgz", @@ -6365,9 +6311,9 @@ "license": "MIT" }, "node_modules/enhanced-resolve": { - "version": "5.21.2", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.21.2.tgz", - "integrity": "sha512-xe9vQb5kReirPUxgQrXA3ihgbCqssmTiM7cOZ+Gzu+VeGWgpV98lLZvp0dl4yriyAePcewxGUs9UpKD8PET9KQ==", + "version": "5.22.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.22.1.tgz", + "integrity": "sha512-6QEuw3zoX1SJQc7b87aBXke/no+mG2bTBgw29gWMQonLmpEkWoCAVkl+M49e48AZlWzxiDzDZzYdp6kobcyLww==", "dev": true, "license": "MIT", "dependencies": { @@ -8922,9 +8868,9 @@ } }, "node_modules/jiti": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.6.1.tgz", - "integrity": "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.7.0.tgz", + "integrity": "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==", "dev": true, "license": "MIT", "bin": { diff --git a/package.json b/package.json index 47a7f0f4..9f74a608 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ }, "devDependencies": { "@eslint/js": "^10.0.1", - "@tailwindcss/postcss": "^4.0.9", + "@tailwindcss/postcss": "^4.3.0", "@testing-library/jest-dom": "^6.0.0", "@testing-library/react": "^16.0.0", "@types/jest": "^29.2.1", @@ -79,7 +79,6 @@ "react-github-corner": "^2.1.0", "rimraf": "^6.0.1", "semantic-release": "^25.0.1", - "tailwindcss": "^4.0.9", "ts-jest": "^29.0.3", "typescript": "5.8.3", "typescript-eslint": "^8.25.0" diff --git a/tailwind.config.js b/tailwind.config.js deleted file mode 100644 index 0f2bdc40..00000000 --- a/tailwind.config.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - content: ["./demo/**/*.{html,js,ts,jsx,tsx}"], - theme: { - extend: {}, - }, - plugins: [], -};