diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index 74156cf..c47a2c6 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -21,7 +21,6 @@ "test:storybook:start": "start-server-and-test 'pnpm run storybook:start' 6006 'pnpm run test:storybook'" }, "dependencies": { - "@headlessui/react": "^1.7.8", "@portabletext/react": "^1.0.6", "@sanity/client": "^3.3.6", "@sanity/dashboard": "^3.1.3", diff --git a/packages/nextjs/views/ModalFiltersMobile.tsx b/packages/nextjs/views/ModalFiltersMobile.tsx index 84b2b6b..77a067a 100644 --- a/packages/nextjs/views/ModalFiltersMobile.tsx +++ b/packages/nextjs/views/ModalFiltersMobile.tsx @@ -1,6 +1,5 @@ -import { Button } from "shared-ui"; +import { Button, Modal } from "shared-ui"; import React from "react"; -import { Modal } from "components/Modal"; import { ProductFilters } from "components/ProductFilters/ProductFilters"; import { CategoryFilterItem, FlavourFilterItem, StyleFilterItem } from "utils/groqTypes/ProductList"; diff --git a/packages/nextjs/components/Modal.tsx b/packages/shared-ui/components/Modal.tsx similarity index 100% rename from packages/nextjs/components/Modal.tsx rename to packages/shared-ui/components/Modal.tsx diff --git a/packages/shared-ui/index.ts b/packages/shared-ui/index.ts index 47601b2..dccc1b4 100644 --- a/packages/shared-ui/index.ts +++ b/packages/shared-ui/index.ts @@ -7,4 +7,5 @@ export * from "./components/Bread.icon"; export * from "./components/FeaturedQuote"; export * from "./components/FadeInOut"; export * from "./components/Select"; +export * from "./components/Modal"; export * from "./components/WeDontSellBreadBanner"; diff --git a/packages/shared-ui/package.json b/packages/shared-ui/package.json index d26f25d..924a4d5 100644 --- a/packages/shared-ui/package.json +++ b/packages/shared-ui/package.json @@ -16,6 +16,7 @@ "test:storybook:start": "start-server-and-test 'pnpm run storybook:start' 6006 'pnpm run test:storybook'" }, "dependencies": { + "@headlessui/react": "^1.7.8", "@tailwindcss/typography": "^0.5.4", "classnames": "^2.3.2", "framer-motion": "^7.4.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e294381..4422e5d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -283,6 +283,9 @@ importers: packages/shared-ui: dependencies: + '@headlessui/react': + specifier: ^1.7.8 + version: 1.7.8(react-dom@18.2.0)(react@18.2.0) '@tailwindcss/typography': specifier: ^0.5.4 version: 0.5.4(tailwindcss@3.1.8) @@ -383,7 +386,7 @@ packages: '@babel/traverse': 7.22.15 '@babel/types': 7.22.15 convert-source-map: 1.8.0 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -468,7 +471,7 @@ packages: '@babel/core': 7.22.15 '@babel/helper-compilation-targets': 7.22.15 '@babel/helper-plugin-utils': 7.22.5 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) lodash.debounce: 4.0.8 resolve: 1.22.6 transitivePeerDependencies: @@ -1780,6 +1783,23 @@ packages: '@babel/parser': 7.22.16 '@babel/types': 7.22.15 + /@babel/traverse@7.20.13: + resolution: {integrity: sha512-kMJXfF0T6DIS9E8cgdLCSAL+cuCK+YEZHWiLK0SXpTo8YRj5lpJu3CDNKiIBCne4m9hhTIqUg6SYTAI39tAiVQ==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.22.13 + '@babel/generator': 7.22.15 + '@babel/helper-environment-visitor': 7.22.5 + '@babel/helper-function-name': 7.22.5 + '@babel/helper-hoist-variables': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + '@babel/parser': 7.22.16 + '@babel/types': 7.22.15 + debug: 4.3.4(supports-color@8.1.1) + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + /@babel/traverse@7.20.13(supports-color@5.5.0): resolution: {integrity: sha512-kMJXfF0T6DIS9E8cgdLCSAL+cuCK+YEZHWiLK0SXpTo8YRj5lpJu3CDNKiIBCne4m9hhTIqUg6SYTAI39tAiVQ==} engines: {node: '>=6.9.0'} @@ -1796,6 +1816,7 @@ packages: globals: 11.12.0 transitivePeerDependencies: - supports-color + dev: false /@babel/traverse@7.22.15: resolution: {integrity: sha512-DdHPwvJY0sEeN4xJU5uRLmZjgMMDIvMPniLuYzUVXj/GGzysPl0/fwt44JBkyUIzGJPV8QgHMcQdQ34XFuKTYQ==} @@ -1809,7 +1830,7 @@ packages: '@babel/helper-split-export-declaration': 7.22.6 '@babel/parser': 7.22.16 '@babel/types': 7.22.15 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -2427,7 +2448,7 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) espree: 9.4.0 globals: 13.19.0 ignore: 5.2.0 @@ -2444,7 +2465,7 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) espree: 9.4.1 globals: 13.19.0 ignore: 5.2.4 @@ -2536,7 +2557,7 @@ packages: engines: {node: '>=10.10.0'} dependencies: '@humanwhocodes/object-schema': 1.2.1 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -2547,7 +2568,7 @@ packages: engines: {node: '>=10.10.0'} dependencies: '@humanwhocodes/object-schema': 1.2.1 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -3183,7 +3204,7 @@ packages: '@open-draft/until': 1.0.3 '@types/debug': 4.1.7 '@xmldom/xmldom': 0.7.5 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) headers-polyfill: 3.1.0 outvariant: 1.3.0 strict-event-emitter: 0.2.6 @@ -3987,7 +4008,7 @@ packages: engines: {node: '>=14.18.0'} hasBin: true dependencies: - '@babel/traverse': 7.20.13(supports-color@5.5.0) + '@babel/traverse': 7.20.13 '@vercel/frameworks': 1.3.4 '@vercel/fs-detectors': 3.8.9 chalk: 4.1.2 @@ -5361,7 +5382,7 @@ packages: typescript: '>= 4.x' webpack: '>= 4' dependencies: - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) endent: 2.1.0 find-cache-dir: 3.3.2 flat-cache: 3.0.4 @@ -6297,7 +6318,7 @@ packages: '@typescript-eslint/scope-manager': 5.48.1 '@typescript-eslint/type-utils': 5.48.1(eslint@8.31.0)(typescript@4.9.4) '@typescript-eslint/utils': 5.48.1(eslint@8.31.0)(typescript@4.9.4) - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) eslint: 8.31.0 ignore: 5.2.4 natural-compare-lite: 1.4.0 @@ -6322,7 +6343,7 @@ packages: '@typescript-eslint/scope-manager': 5.36.1 '@typescript-eslint/types': 5.36.1 '@typescript-eslint/typescript-estree': 5.36.1(typescript@4.9.4) - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) eslint: 8.23.0 typescript: 4.9.4 transitivePeerDependencies: @@ -6342,7 +6363,7 @@ packages: '@typescript-eslint/scope-manager': 5.48.1 '@typescript-eslint/types': 5.48.1 '@typescript-eslint/typescript-estree': 5.48.1(typescript@4.9.4) - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) eslint: 8.31.0 typescript: 4.9.4 transitivePeerDependencies: @@ -6377,7 +6398,7 @@ packages: dependencies: '@typescript-eslint/typescript-estree': 5.48.1(typescript@4.9.4) '@typescript-eslint/utils': 5.48.1(eslint@8.31.0)(typescript@4.9.4) - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) eslint: 8.31.0 tsutils: 3.21.0(typescript@4.9.4) typescript: 4.9.4 @@ -6406,7 +6427,7 @@ packages: dependencies: '@typescript-eslint/types': 5.36.1 '@typescript-eslint/visitor-keys': 5.36.1 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) globby: 11.1.0 is-glob: 4.0.3 semver: 7.5.4 @@ -6427,7 +6448,7 @@ packages: dependencies: '@typescript-eslint/types': 5.48.1 '@typescript-eslint/visitor-keys': 5.48.1 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) globby: 11.1.0 is-glob: 4.0.3 semver: 7.5.4 @@ -6843,7 +6864,7 @@ packages: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} engines: {node: '>= 6.0.0'} dependencies: - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -8714,6 +8735,7 @@ packages: dependencies: ms: 2.1.2 supports-color: 5.5.0 + dev: false /debug@4.3.4(supports-color@8.1.1): resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} @@ -8726,7 +8748,6 @@ packages: dependencies: ms: 2.1.2 supports-color: 8.1.1 - dev: true /decamelize@1.2.0: resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} @@ -8908,7 +8929,7 @@ packages: hasBin: true dependencies: address: 1.2.2 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) transitivePeerDependencies: - supports-color dev: true @@ -9378,7 +9399,7 @@ packages: peerDependencies: esbuild: '>=0.12 <1' dependencies: - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) esbuild: 0.16.17 transitivePeerDependencies: - supports-color @@ -9388,7 +9409,7 @@ packages: peerDependencies: esbuild: '>=0.12 <1' dependencies: - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) esbuild: 0.18.20 transitivePeerDependencies: - supports-color @@ -9554,7 +9575,7 @@ packages: eslint: '*' eslint-plugin-import: '*' dependencies: - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) eslint: 8.23.0 eslint-plugin-import: 2.26.0(@typescript-eslint/parser@5.36.1)(eslint-import-resolver-typescript@2.7.1)(eslint@8.23.0) glob: 7.2.3 @@ -9771,7 +9792,7 @@ packages: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.1.1 @@ -9819,7 +9840,7 @@ packages: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.1.1 @@ -10346,7 +10367,7 @@ packages: dependencies: chalk: 4.1.2 commander: 5.1.0 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) transitivePeerDependencies: - supports-color dev: true @@ -10457,7 +10478,7 @@ packages: debug: optional: true dependencies: - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) /for-each@0.3.3: resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} @@ -10768,7 +10789,7 @@ packages: resolution: {integrity: sha512-83P2+3V/3E+KSdlHnGlOr4vCrlV8wDsT580AyJkMtkK/8LtZc0TOCI9bjQXH1sgYnmQTzCoPoPaOAE+a8JZqLQ==} engines: {node: '>=14.0.0'} dependencies: - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) decompress-response: 7.0.0 follow-redirects: 1.15.2(debug@4.3.4) into-stream: 6.0.0 @@ -11371,7 +11392,7 @@ packages: dependencies: '@tootallnate/once': 2.0.0 agent-base: 6.0.2 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -11427,7 +11448,7 @@ packages: engines: {node: '>= 6.0.0'} dependencies: agent-base: 5.1.1 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) transitivePeerDependencies: - supports-color dev: true @@ -11437,7 +11458,7 @@ packages: engines: {node: '>= 6'} dependencies: agent-base: 6.0.2 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -12115,7 +12136,7 @@ packages: resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==} engines: {node: '>=10'} dependencies: - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) istanbul-lib-coverage: 3.2.0 source-map: 0.6.1 transitivePeerDependencies: @@ -13403,7 +13424,7 @@ packages: cli-truncate: 3.1.0 colorette: 2.0.19 commander: 9.5.0 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) execa: 6.1.0 lilconfig: 2.0.6 listr2: 5.0.6 @@ -15316,7 +15337,7 @@ packages: engines: {node: '>=8.16.0'} dependencies: '@types/mime-types': 2.1.1 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) extract-zip: 1.7.0 https-proxy-agent: 4.0.0 mime: 2.6.0 @@ -16682,7 +16703,7 @@ packages: arg: 5.0.2 bluebird: 3.7.2 check-more-types: 2.24.0 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) execa: 5.1.1 lazy-ass: 1.6.0 ps-tree: 1.2.0 @@ -16700,7 +16721,7 @@ packages: arg: 5.0.2 bluebird: 3.7.2 check-more-types: 2.24.0 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) execa: 5.1.1 lazy-ass: 1.6.0 ps-tree: 1.2.0 @@ -17459,7 +17480,7 @@ packages: bundle-require: 4.0.2(esbuild@0.18.20) cac: 6.7.14 chokidar: 3.5.3 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) esbuild: 0.18.20 execa: 5.1.1 globby: 11.1.0 @@ -17983,7 +18004,7 @@ packages: dependencies: chalk: 2.4.2 commander: 3.0.2 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.4(supports-color@8.1.1) transitivePeerDependencies: - supports-color dev: true