From f1592185e9a2d519262f22b8cfc308056e5fb517 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20=C5=BBuraw?= <9116238+krzysztofzuraw@users.noreply.github.com> Date: Wed, 4 Oct 2023 13:25:07 +0200 Subject: [PATCH] feat: remove not needed pkgs --- README.md | 38 +- package.json | 18 +- pnpm-lock.yaml | 557 +----------------- .../Combobox/Common/ComboboxWrapper.tsx | 4 +- .../Combobox/Common/useCombobox.tsx | 2 +- .../Dynamic/DynamicCombobox.stories.tsx | 39 +- .../ExperimentalFilters.stories.tsx | 99 +--- .../Multiselect/Common/Adornment.tsx | 6 +- .../Multiselect/Common/MultiselectWrapper.tsx | 2 +- .../Multiselect/Common/useMultiselect.tsx | 2 +- .../Dynamic/DynamicMultiselect.stories.tsx | 37 +- src/components/Select/SelectWrapper.tsx | 2 +- src/components/Select/useSelect.tsx | 2 +- src/theme/reset.css.ts | 5 + vite.config.ts | 3 +- 15 files changed, 69 insertions(+), 747 deletions(-) diff --git a/README.md b/README.md index f1e0f7bb..e99eea33 100644 --- a/README.md +++ b/README.md @@ -17,24 +17,18 @@ Official React UI components kit for [Saleor](https://saleor.io/) — an open-so npm i @saleor/macaw-ui ``` -Note that this package still bundles the old version of MacawUI so it still depends on the following Material-UI v4 packages: @material-ui/core, @material-ui/icons and @material-ui/lab. If your project doesn't have them installed and you're not using npm v7 with [automatically installed peer dependencies](https://github.blog/2020-10-13-presenting-v7-0-0-of-the-npm-cli/) then you'll need to install them manually: - -```sh -npm i @material-ui/core @material-ui/icons @material-ui/lab -``` - ## Usage You need to import the styles into your app. You can do it in your main entry point, for example `index.`tsx`: ```tsx -import "@saleor/macaw-ui/next/style"; +import "@saleor/macaw-ui/style"; ``` Next, you need to add the `ThemeProvider` to your app. It will provide the theme to the components: ```tsx -import { ThemeProvider } from "@saleor/macaw-ui/next"; +import { ThemeProvider } from "@saleor/macaw-ui"; const App = () => ( @@ -45,23 +39,10 @@ const App = () => ( ### Usage with Next.js -As mentioned above, we still bundle the old version of MacawUI so you need to add the following to your `next.config.js`: - -```js -/** @type {import('next').NextConfig} */ -module.exports = { - experimental: { - esmExternals: false, - }, -}; -``` - -It tells Next.js not to use ESM exports for external modules. This is needed because MacawUI dependencies (Material-UI v4) are still using CommonJS exports. - If you need to render styles on the server we recommend that you use `getCSSVariables` helper to get the CSS variables that can be injected in `_document.tsx`: ```tsx -import { getCSSVariables } from "@saleor/macaw-ui/next"; +import { getCSSVariables } from "@saleor/macaw-ui"; import Document, { Head, Html, Main, NextScript } from "next/document"; const css = getCSSVariables("defaultLight"); // or "defaultDark" @@ -81,16 +62,6 @@ export default class AppDocument extends Document { } ``` -If you are using Next.js in version 13 and you got this error: - -``` -NonErrorEmittedError: (Emitted value instead of an instance of Error) ReferenceError: $RefreshReg$ is not defined -``` - -Try to change `sprinkles` imports from `@saleor/macaw-ui/next` to `@saleor/macaw-ui/next/theme`. - -[Reference](https://github.com/vanilla-extract-css/vanilla-extract/issues/1043) - ### Usage with form libraries #### React Hook Form @@ -98,7 +69,7 @@ Try to change `sprinkles` imports from `@saleor/macaw-ui/next` to `@saleor/macaw You need to wrap the MacawUI component with [`Controller`](https://react-hook-form.com/api/usecontroller/controller/). For example: ```tsx -import { Input } from "@saleor/macaw-ui/next"; +import { Input } from "@saleor/macaw-ui"; =16.8.0" - react-dom: ">=16.8.0" - dependencies: - "@floating-ui/dom": 0.5.4 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - use-isomorphic-layout-effect: 1.1.2(@types/react@18.0.0)(react@18.2.0) - transitivePeerDependencies: - - "@types/react" - dev: false - /@floating-ui/react-dom@2.0.2(react-dom@18.2.0)(react@18.2.0): resolution: { @@ -3099,16 +3027,6 @@ packages: engines: { node: ">=6.0.0" } dev: true - /@jridgewell/source-map@0.3.5: - resolution: - { - integrity: sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==, - } - dependencies: - "@jridgewell/gen-mapping": 0.3.3 - "@jridgewell/trace-mapping": 0.3.18 - dev: true - /@jridgewell/sourcemap-codec@1.4.14: resolution: { @@ -5733,26 +5651,6 @@ packages: } dev: true - /@types/eslint-scope@3.7.4: - resolution: - { - integrity: sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==, - } - dependencies: - "@types/eslint": 8.44.1 - "@types/estree": 1.0.1 - dev: true - - /@types/eslint@8.44.1: - resolution: - { - integrity: sha512-XpNDc4Z5Tb4x+SW1MriMVeIsMoONHCkWFMkR/aPJbzEsxqHy+4Glu/BqTdPrApfDeMaXbtNh6bseNgl5KaWrSg==, - } - dependencies: - "@types/estree": 1.0.1 - "@types/json-schema": 7.0.12 - dev: true - /@types/estree@0.0.51: resolution: { @@ -5880,15 +5778,6 @@ packages: } dev: true - /@types/lodash-es@4.17.8: - resolution: - { - integrity: sha512-euY3XQcZmIzSy7YH5+Unb3b2X12Wtk54YWINBvvGQ5SmMvwb11JQskGsfkH/5HXK77Kr8GF0wkVDIxzAisWtog==, - } - dependencies: - "@types/lodash": 4.14.196 - dev: true - /@types/lodash@4.14.196: resolution: { @@ -6646,171 +6535,6 @@ packages: - typescript dev: true - /@webassemblyjs/ast@1.11.6: - resolution: - { - integrity: sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q==, - } - dependencies: - "@webassemblyjs/helper-numbers": 1.11.6 - "@webassemblyjs/helper-wasm-bytecode": 1.11.6 - dev: true - - /@webassemblyjs/floating-point-hex-parser@1.11.6: - resolution: - { - integrity: sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==, - } - dev: true - - /@webassemblyjs/helper-api-error@1.11.6: - resolution: - { - integrity: sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==, - } - dev: true - - /@webassemblyjs/helper-buffer@1.11.6: - resolution: - { - integrity: sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA==, - } - dev: true - - /@webassemblyjs/helper-numbers@1.11.6: - resolution: - { - integrity: sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==, - } - dependencies: - "@webassemblyjs/floating-point-hex-parser": 1.11.6 - "@webassemblyjs/helper-api-error": 1.11.6 - "@xtuc/long": 4.2.2 - dev: true - - /@webassemblyjs/helper-wasm-bytecode@1.11.6: - resolution: - { - integrity: sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==, - } - dev: true - - /@webassemblyjs/helper-wasm-section@1.11.6: - resolution: - { - integrity: sha512-LPpZbSOwTpEC2cgn4hTydySy1Ke+XEu+ETXuoyvuyezHO3Kjdu90KK95Sh9xTbmjrCsUwvWwCOQQNta37VrS9g==, - } - dependencies: - "@webassemblyjs/ast": 1.11.6 - "@webassemblyjs/helper-buffer": 1.11.6 - "@webassemblyjs/helper-wasm-bytecode": 1.11.6 - "@webassemblyjs/wasm-gen": 1.11.6 - dev: true - - /@webassemblyjs/ieee754@1.11.6: - resolution: - { - integrity: sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==, - } - dependencies: - "@xtuc/ieee754": 1.2.0 - dev: true - - /@webassemblyjs/leb128@1.11.6: - resolution: - { - integrity: sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==, - } - dependencies: - "@xtuc/long": 4.2.2 - dev: true - - /@webassemblyjs/utf8@1.11.6: - resolution: - { - integrity: sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==, - } - dev: true - - /@webassemblyjs/wasm-edit@1.11.6: - resolution: - { - integrity: sha512-Ybn2I6fnfIGuCR+Faaz7YcvtBKxvoLV3Lebn1tM4o/IAJzmi9AWYIPWpyBfU8cC+JxAO57bk4+zdsTjJR+VTOw==, - } - dependencies: - "@webassemblyjs/ast": 1.11.6 - "@webassemblyjs/helper-buffer": 1.11.6 - "@webassemblyjs/helper-wasm-bytecode": 1.11.6 - "@webassemblyjs/helper-wasm-section": 1.11.6 - "@webassemblyjs/wasm-gen": 1.11.6 - "@webassemblyjs/wasm-opt": 1.11.6 - "@webassemblyjs/wasm-parser": 1.11.6 - "@webassemblyjs/wast-printer": 1.11.6 - dev: true - - /@webassemblyjs/wasm-gen@1.11.6: - resolution: - { - integrity: sha512-3XOqkZP/y6B4F0PBAXvI1/bky7GryoogUtfwExeP/v7Nzwo1QLcq5oQmpKlftZLbT+ERUOAZVQjuNVak6UXjPA==, - } - dependencies: - "@webassemblyjs/ast": 1.11.6 - "@webassemblyjs/helper-wasm-bytecode": 1.11.6 - "@webassemblyjs/ieee754": 1.11.6 - "@webassemblyjs/leb128": 1.11.6 - "@webassemblyjs/utf8": 1.11.6 - dev: true - - /@webassemblyjs/wasm-opt@1.11.6: - resolution: - { - integrity: sha512-cOrKuLRE7PCe6AsOVl7WasYf3wbSo4CeOk6PkrjS7g57MFfVUF9u6ysQBBODX0LdgSvQqRiGz3CXvIDKcPNy4g==, - } - dependencies: - "@webassemblyjs/ast": 1.11.6 - "@webassemblyjs/helper-buffer": 1.11.6 - "@webassemblyjs/wasm-gen": 1.11.6 - "@webassemblyjs/wasm-parser": 1.11.6 - dev: true - - /@webassemblyjs/wasm-parser@1.11.6: - resolution: - { - integrity: sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ==, - } - dependencies: - "@webassemblyjs/ast": 1.11.6 - "@webassemblyjs/helper-api-error": 1.11.6 - "@webassemblyjs/helper-wasm-bytecode": 1.11.6 - "@webassemblyjs/ieee754": 1.11.6 - "@webassemblyjs/leb128": 1.11.6 - "@webassemblyjs/utf8": 1.11.6 - dev: true - - /@webassemblyjs/wast-printer@1.11.6: - resolution: - { - integrity: sha512-JM7AhRcE+yW2GWYaKeHL5vt4xqee5N2WcezptmgyhNS+ScggqcT1OtXykhAb13Sn5Yas0j2uv9tHgrjwvzAP4A==, - } - dependencies: - "@webassemblyjs/ast": 1.11.6 - "@xtuc/long": 4.2.2 - dev: true - - /@xtuc/ieee754@1.2.0: - resolution: - { - integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==, - } - dev: true - - /@xtuc/long@4.2.2: - resolution: - { - integrity: sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==, - } - dev: true - /@yarnpkg/esbuild-plugin-pnp@3.0.0-rc.15(esbuild@0.18.17): resolution: { @@ -6875,17 +6599,6 @@ packages: negotiator: 0.6.3 dev: true - /acorn-import-assertions@1.9.0(acorn@8.10.0): - resolution: - { - integrity: sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==, - } - peerDependencies: - acorn: ^8 - dependencies: - acorn: 8.10.0 - dev: true - /acorn-jsx@5.3.2(acorn@7.4.1): resolution: { @@ -7006,17 +6719,6 @@ packages: integrity: sha512-hCOfMzbFx5IDutmWLAt6MZwOUjIfSM9G9FyVxytmE4Rs/5YDPWQrD/+IR1w+FweD9H2oOZEnv36TmkjhNURBVA==, } - /ajv-keywords@3.5.2(ajv@6.12.6): - resolution: - { - integrity: sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==, - } - peerDependencies: - ajv: ^6.9.1 - dependencies: - ajv: 6.12.6 - dev: true - /ajv@6.12.6: resolution: { @@ -7974,14 +7676,6 @@ packages: hasBin: true dev: true - /chrome-trace-event@1.0.3: - resolution: - { - integrity: sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==, - } - engines: { node: ">=6.0" } - dev: true - /ci-info@3.8.0: resolution: { @@ -8119,14 +7813,6 @@ packages: engines: { node: ">=0.8" } dev: true - /clsx@1.2.1: - resolution: - { - integrity: sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==, - } - engines: { node: ">=6" } - dev: false - /color-convert@1.9.3: resolution: { @@ -8261,13 +7947,6 @@ packages: - supports-color dev: true - /compute-scroll-into-view@1.0.20: - resolution: - { - integrity: sha512-UCB0ioiyj8CRjtrvaceBLqqhZCVP+1B8+NWQhmdsm0VXOJtobBCf1dBQmebCCo34qZmUwZfIH2MZLqNHazrfjg==, - } - dev: false - /compute-scroll-into-view@2.0.4: resolution: { @@ -9211,22 +8890,6 @@ packages: engines: { node: ">=12" } dev: true - /downshift@6.1.12(react@18.2.0): - resolution: - { - integrity: sha512-7XB/iaSJVS4T8wGFT3WRXmSF1UlBHAA40DshZtkrIscIN+VC+Lh363skLxFTvJwtNgHxAMDGEHT4xsyQFWL+UA==, - } - peerDependencies: - react: ">=16.12.0" - dependencies: - "@babel/runtime": 7.22.6 - compute-scroll-into-view: 1.0.20 - prop-types: 15.8.1 - react: 18.2.0 - react-is: 17.0.2 - tslib: 2.6.1 - dev: false - /downshift@7.6.0(react@18.2.0): resolution: { @@ -9434,13 +9097,6 @@ packages: } dev: true - /es-module-lexer@1.3.0: - resolution: - { - integrity: sha512-vZK7T0N2CBmBOixhmjdqx2gWVbFZ4DXZ/NyRMZVlJXPa7CyFS+/a4QQsDGDQy9ZfEzxFuNEsMLeQJnKP2p5/JA==, - } - dev: true - /es-set-tostringtag@2.0.1: resolution: { @@ -10003,14 +9659,6 @@ packages: require-like: 0.1.2 dev: true - /events@3.3.0: - resolution: - { - integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==, - } - engines: { node: ">=0.8.x" } - dev: true - /execa@5.1.1: resolution: { @@ -10065,13 +9713,6 @@ packages: strip-final-newline: 3.0.0 dev: true - /exenv@1.2.2: - resolution: - { - integrity: sha512-Z+ktTxTwv9ILfgKCk32OX3n/doe+OcLTRtqK9pcL+JsP3J1/VW8Uvl4ZjLlKqeW4rzK4oesDOGMEMRIZqtP4Iw==, - } - dev: false - /expect@29.6.2: resolution: { @@ -12231,18 +11872,6 @@ packages: picomatch: 2.3.1 dev: true - /jest-worker@27.5.1: - resolution: - { - integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==, - } - engines: { node: ">= 10.13.0" } - dependencies: - "@types/node": 20.4.7 - merge-stream: 2.0.0 - supports-color: 8.1.1 - dev: true - /jest-worker@29.6.2: resolution: { @@ -12646,14 +12275,6 @@ packages: strip-bom: 3.0.0 dev: true - /loader-runner@4.3.0: - resolution: - { - integrity: sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==, - } - engines: { node: ">=6.11.5" } - dev: true - /local-pkg@0.4.3: resolution: { @@ -12704,13 +12325,6 @@ packages: p-locate: 5.0.0 dev: true - /lodash-es@4.17.21: - resolution: - { - integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==, - } - dev: false - /lodash.camelcase@4.3.0: resolution: { @@ -14712,15 +14326,6 @@ packages: } dev: true - /randombytes@2.1.0: - resolution: - { - integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==, - } - dependencies: - safe-buffer: 5.2.1 - dev: true - /range-parser@1.2.1: resolution: { @@ -14829,30 +14434,6 @@ packages: react-is: 18.1.0 dev: true - /react-from-dom@0.6.2(react@18.2.0): - resolution: - { - integrity: sha512-qvWWTL/4xw4k/Dywd41RBpLQUSq97csuv15qrxN+izNeLYlD9wn5W8LspbfYe5CWbaSdkZ72BsaYBPQf2x4VbQ==, - } - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - dependencies: - react: 18.2.0 - dev: false - - /react-inlinesvg@3.0.2(react@18.2.0): - resolution: - { - integrity: sha512-BEzkpMGQwEY68fgaouY7ZWvAUPb8jbj7dE9iDbWZxstDhMuz9qfpxNgvGSENKcDMdpq/XHduSk/LAmNKin4nKw==, - } - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - dependencies: - exenv: 1.2.2 - react: 18.2.0 - react-from-dom: 0.6.2(react@18.2.0) - dev: false - /react-inspector@6.0.2(react@18.2.0): resolution: { @@ -15603,18 +15184,6 @@ packages: dependencies: loose-envify: 1.4.0 - /schema-utils@3.3.0: - resolution: - { - integrity: sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==, - } - engines: { node: ">= 10.13.0" } - dependencies: - "@types/json-schema": 7.0.12 - ajv: 6.12.6 - ajv-keywords: 3.5.2(ajv@6.12.6) - dev: true - /semver-diff@4.0.0: resolution: { @@ -15698,15 +15267,6 @@ packages: - supports-color dev: true - /serialize-javascript@6.0.1: - resolution: - { - integrity: sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==, - } - dependencies: - randombytes: 2.1.0 - dev: true - /serve-favicon@2.5.0: resolution: { @@ -16467,48 +16027,6 @@ packages: unique-string: 2.0.0 dev: true - /terser-webpack-plugin@5.3.9(esbuild@0.18.17)(webpack@5.88.2): - resolution: - { - integrity: sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==, - } - engines: { node: ">= 10.13.0" } - peerDependencies: - "@swc/core": "*" - esbuild: "*" - uglify-js: "*" - webpack: ^5.1.0 - peerDependenciesMeta: - "@swc/core": - optional: true - esbuild: - optional: true - uglify-js: - optional: true - dependencies: - "@jridgewell/trace-mapping": 0.3.18 - esbuild: 0.18.17 - jest-worker: 27.5.1 - schema-utils: 3.3.0 - serialize-javascript: 6.0.1 - terser: 5.19.2 - webpack: 5.88.2(esbuild@0.18.17) - dev: true - - /terser@5.19.2: - resolution: - { - integrity: sha512-qC5+dmecKJA4cpYxRa5aVkKehYsQKc+AHeKl0Oe62aYjBL8ZA33tTljktDHJSaxxMnbI5ZYw+o/S2DxxLu8OfA==, - } - engines: { node: ">=10" } - hasBin: true - dependencies: - "@jridgewell/source-map": 0.3.5 - acorn: 8.10.0 - commander: 2.20.3 - source-map-support: 0.5.21 - dev: true - /test-exclude@6.0.0: resolution: { @@ -17210,22 +16728,6 @@ packages: react: 18.2.0 tslib: 2.6.1 - /use-isomorphic-layout-effect@1.1.2(@types/react@18.0.0)(react@18.2.0): - resolution: - { - integrity: sha512-49L8yCO3iGT/ZF9QttjwLF/ZD9Iwto5LnH5LmEdk/6cFmXddqi2ulF0edxTwjj+7mqvpVVGQWvbXZdn32wRSHA==, - } - peerDependencies: - "@types/react": "*" - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - "@types/react": - optional: true - dependencies: - "@types/react": 18.0.0 - react: 18.2.0 - dev: false - /use-resize-observer@9.1.0(react-dom@18.2.0)(react@18.2.0): resolution: { @@ -17628,49 +17130,6 @@ packages: } dev: true - /webpack@5.88.2(esbuild@0.18.17): - resolution: - { - integrity: sha512-JmcgNZ1iKj+aiR0OvTYtWQqJwq37Pf683dY9bVORwVbUrDhLhdn/PlO2sHsFHPkj7sHNQF3JwaAkp49V+Sq1tQ==, - } - engines: { node: ">=10.13.0" } - hasBin: true - peerDependencies: - webpack-cli: "*" - peerDependenciesMeta: - webpack-cli: - optional: true - dependencies: - "@types/eslint-scope": 3.7.4 - "@types/estree": 1.0.1 - "@webassemblyjs/ast": 1.11.6 - "@webassemblyjs/wasm-edit": 1.11.6 - "@webassemblyjs/wasm-parser": 1.11.6 - acorn: 8.10.0 - acorn-import-assertions: 1.9.0(acorn@8.10.0) - browserslist: 4.21.10 - chrome-trace-event: 1.0.3 - enhanced-resolve: 5.15.0 - es-module-lexer: 1.3.0 - eslint-scope: 5.1.1 - events: 3.3.0 - glob-to-regexp: 0.4.1 - graceful-fs: 4.2.11 - json-parse-even-better-errors: 2.3.1 - loader-runner: 4.3.0 - mime-types: 2.1.35 - neo-async: 2.6.2 - schema-utils: 3.3.0 - tapable: 2.2.1 - terser-webpack-plugin: 5.3.9(esbuild@0.18.17)(webpack@5.88.2) - watchpack: 2.4.0 - webpack-sources: 3.2.3 - transitivePeerDependencies: - - "@swc/core" - - esbuild - - uglify-js - dev: true - /whatwg-encoding@2.0.0: resolution: { @@ -18091,7 +17550,3 @@ packages: optionalDependencies: commander: 9.5.0 dev: true - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false diff --git a/src/components/Combobox/Common/ComboboxWrapper.tsx b/src/components/Combobox/Common/ComboboxWrapper.tsx index 1d8cc861..01593b37 100644 --- a/src/components/Combobox/Common/ComboboxWrapper.tsx +++ b/src/components/Combobox/Common/ComboboxWrapper.tsx @@ -1,14 +1,14 @@ /* Do not expose this file, it's for internal purposes only. */ -import { UseComboboxPropGetters } from "downshift7"; +import { UseComboboxPropGetters } from "downshift"; import { ReactNode, forwardRef } from "react"; import { classNames } from "~/utils"; import { sprinkles } from "~/theme"; import { LabelVariants, labelRecipe, spanRecipe } from "../../BaseInput"; -import { toggleIconStyle, Option } from "../../BaseSelect"; +import { Option, toggleIconStyle } from "../../BaseSelect"; import { Box } from "../../Box"; import { ArrowDownIcon } from "../../Icons"; diff --git a/src/components/Combobox/Common/useCombobox.tsx b/src/components/Combobox/Common/useCombobox.tsx index 2b160b84..175a7341 100644 --- a/src/components/Combobox/Common/useCombobox.tsx +++ b/src/components/Combobox/Common/useCombobox.tsx @@ -2,7 +2,7 @@ import { GetPropsCommonOptions, UseComboboxGetInputPropsOptions, useCombobox as useDownshiftCombobox, -} from "downshift7"; +} from "downshift"; import { FocusEvent, useState } from "react"; import { Option, SingleChangeHandler } from "~/components/BaseSelect"; diff --git a/src/components/Combobox/Dynamic/DynamicCombobox.stories.tsx b/src/components/Combobox/Dynamic/DynamicCombobox.stories.tsx index de6a59fb..12cd4b79 100644 --- a/src/components/Combobox/Dynamic/DynamicCombobox.stories.tsx +++ b/src/components/Combobox/Dynamic/DynamicCombobox.stories.tsx @@ -1,6 +1,5 @@ -import { useRef, useState } from "react"; import { Meta } from "@storybook/react"; -import { debounce } from "lodash-es"; +import { useState } from "react"; import { DynamicCombobox } from ".."; import { Box, Option } from "../.."; @@ -55,21 +54,21 @@ export const Default = () => { setLoading(false); } - const debouncedSearch = useRef( - debounce(async (criteria) => { - const res = await search( - `https://swapi.dev/api/people/?search=${criteria}` - ); - - setNextUrl(res.next); - setOptions( - res.results.map((result: { name: string }) => ({ - value: result.name, - label: result.name, - })) - ); - }, 300) - ).current; + // const debouncedSearch = useRef( + // debounce(async (criteria) => { + // const res = await search( + // `https://swapi.dev/api/people/?search=${criteria}` + // ); + + // setNextUrl(res.next); + // setOptions( + // res.results.map((result: { name: string }) => ({ + // value: result.name, + // label: result.name, + // })) + // ); + // }, 300) + // ).current; return ( { onScrollEnd={() => { loadMore(); }} - onInputValueChange={(inputValue) => { - debouncedSearch(inputValue); - }} + // onInputValueChange={(inputValue) => { + // debouncedSearch(inputValue); + // }} /> ); }; diff --git a/src/components/ExperimentalFilters/ExperimentalFilters.stories.tsx b/src/components/ExperimentalFilters/ExperimentalFilters.stories.tsx index 43464c36..74aa96a8 100644 --- a/src/components/ExperimentalFilters/ExperimentalFilters.stories.tsx +++ b/src/components/ExperimentalFilters/ExperimentalFilters.stories.tsx @@ -1,6 +1,5 @@ import { Meta } from "@storybook/react"; -import { clone, setWith } from "lodash-es"; -import { ReactNode, useState } from "react"; +import { ReactNode } from "react"; import { Box, @@ -159,103 +158,13 @@ const Template = ({ }; export const Default = () => { - const [rows, setRows] = useState(defaultValue); - return (