From 8c68211748e51eee65fe9258fa6f9041ff671299 Mon Sep 17 00:00:00 2001 From: Bohdan Kulinich Date: Wed, 7 Jun 2023 14:30:34 +0300 Subject: [PATCH 1/3] Revert "Revert "[WIP] feat: bump ts version and add new eslint config"" --- .github/workflows/main.yml | 8 +- package-lock.json | 1363 +++++++++++++-------- package.json | 9 +- pages/tooltip.mdx | 28 +- src/.eslintrc.json | 60 +- src/Accordion/Accordion.tsx | 4 +- src/Accordion/AccordionCollapsible.tsx | 42 +- src/Accordion/AccordionTrigger.tsx | 8 +- src/Banner/Banner.tsx | 9 +- src/Breadcrumbs/Breadcrumbs.tsx | 3 +- src/Button/Button.tsx | 6 +- src/Clipboard/Clipboard.tsx | 31 +- src/DatePicker/DatePicker.tsx | 293 ++--- src/Dialog/Dialog.tsx | 20 +- src/DialogActions/DialogActions.tsx | 3 +- src/DialogContent/DialogContent.tsx | 3 +- src/DialogIcon/DialogIcon.tsx | 3 +- src/DialogIcon/DialogIconBackdrop.js | 7 +- src/Dropdown/Dropdown.tsx | 12 +- src/DropdownItem/DropdownItem.tsx | 18 +- src/ExternalLink/ExternalLink.tsx | 3 +- src/FormRow/FormRow.tsx | 8 +- src/Grid/Grid.tsx | 19 +- src/GridCell/GridCell.tsx | 4 +- src/GridRow/GridRow.tsx | 4 +- src/Hint/Hint.tsx | 8 +- src/Icons/jsx/AccountIcon.tsx | 24 +- src/Icons/jsx/BackIcon.tsx | 52 +- src/Icons/jsx/BlockIcon.tsx | 20 +- src/Icons/jsx/BusinessIcon.tsx | 26 +- src/Icons/jsx/CancelIcon.tsx | 42 +- src/Icons/jsx/CheckCircle.tsx | 22 +- src/Icons/jsx/CheckIcon.tsx | 38 +- src/Icons/jsx/CloseIcon.tsx | 42 +- src/Icons/jsx/CopyIcon.tsx | 24 +- src/Icons/jsx/DeviceActiveIcon.tsx | 20 +- src/Icons/jsx/DeviceIcon.tsx | 20 +- src/Icons/jsx/DownloadIcon.tsx | 18 +- src/Icons/jsx/DropdownIcon.tsx | 18 +- src/Icons/jsx/ErrorIcon.tsx | 52 +- src/Icons/jsx/ExternalIcon.tsx | 24 +- src/Icons/jsx/HelpIcon.tsx | 54 +- src/Icons/jsx/InfoIcon.tsx | 54 +- src/Icons/jsx/LanguageDe.tsx | 26 +- src/Icons/jsx/LanguageEn.tsx | 46 +- src/Icons/jsx/LanguageEs.tsx | 24 +- src/Icons/jsx/LanguageFr.tsx | 26 +- src/Icons/jsx/LanguageIt.tsx | 26 +- src/Icons/jsx/LanguageJa.tsx | 31 +- src/Icons/jsx/LanguageKo.tsx | 116 +- src/Icons/jsx/LanguageNl.tsx | 26 +- src/Icons/jsx/LanguagePl.tsx | 24 +- src/Icons/jsx/LanguagePt.tsx | 97 +- src/Icons/jsx/LanguageTr.tsx | 46 +- src/Icons/jsx/LanguageUk.tsx | 24 +- src/Icons/jsx/LanguageZh.tsx | 30 +- src/Icons/jsx/LightBulbIcon.tsx | 18 +- src/Icons/jsx/MacpawText.tsx | 46 +- src/Icons/jsx/MenuIcon.tsx | 52 +- src/Icons/jsx/MoreIcon.tsx | 20 +- src/Icons/jsx/NotificationIcon.tsx | 20 +- src/Icons/jsx/PauseIcon.tsx | 24 +- src/Icons/jsx/PawIcon.tsx | 21 +- src/Icons/jsx/PaymentAmex.tsx | 57 +- src/Icons/jsx/PaymentCard.tsx | 58 +- src/Icons/jsx/PaymentDinersClub.tsx | 107 +- src/Icons/jsx/PaymentDiscover.tsx | 168 +-- src/Icons/jsx/PaymentJcb.tsx | 233 ++-- src/Icons/jsx/PaymentMada.tsx | 78 +- src/Icons/jsx/PaymentMaestro.tsx | 109 +- src/Icons/jsx/PaymentMaster.tsx | 85 +- src/Icons/jsx/PaymentPaypal.tsx | 151 +-- src/Icons/jsx/PaymentUnionPay.tsx | 162 +-- src/Icons/jsx/PaymentVisa.tsx | 55 +- src/Icons/jsx/PlayIcon.tsx | 18 +- src/Icons/jsx/PlusIcon.tsx | 30 +- src/Icons/jsx/Refresh.tsx | 18 +- src/Icons/jsx/RefreshingIcon.tsx | 50 +- src/Icons/jsx/SearchIcon.tsx | 52 +- src/Icons/jsx/SettingsIcon.tsx | 54 +- src/Icons/jsx/StoreIcon.tsx | 52 +- src/Icons/jsx/UserIcon.tsx | 54 +- src/Icons/jsx/WarningIcon.tsx | 52 +- src/Input/Input.tsx | 59 +- src/Label/Label.tsx | 7 +- src/LanguageIcon/LanguageIcon.tsx | 55 +- src/LanguageSwitcher/LanguageSwitcher.tsx | 73 +- src/Loader/Loader.tsx | 3 +- src/MacPawLogo/MacPawLogo.tsx | 4 +- src/Multiselect/Multiselect.tsx | 44 +- src/Notification/Notification.tsx | 15 +- src/Pagination/NextComponent.tsx | 30 + src/Pagination/Pagination.tsx | 71 +- src/Pagination/PrevComponent.tsx | 30 + src/Panel/Panel.tsx | 14 +- src/Password/Password.tsx | 20 +- src/Payment/Payment.tsx | 53 +- src/Radio/Radio.tsx | 7 +- src/Select/Select.tsx | 25 +- src/Table/Table.tsx | 3 +- src/TableRow/TableRow.tsx | 3 +- src/Tabs/Tab.tsx | 4 +- src/Tabs/TabContext.tsx | 9 +- src/Tabs/TabList.tsx | 7 +- src/Tag/Tag.tsx | 1 - src/TagInput/TagInput.tsx | 58 +- src/TagList/TagList.tsx | 2 +- src/Tooltip/Tooltip.tsx | 24 +- src/Tooltip/useTooltip.hook.ts | 44 +- src/global.d.ts | 7 + src/helpers.ts | 22 +- 111 files changed, 2633 insertions(+), 2973 deletions(-) create mode 100644 src/Pagination/NextComponent.tsx create mode 100644 src/Pagination/PrevComponent.tsx create mode 100644 src/global.d.ts diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4aa92e9..b5effb2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest continue-on-error: false steps: - - name: Checkout + - name: Checkout uses: actions/checkout@v2 - name: Setup node @@ -21,7 +21,7 @@ jobs: node-version: '16.x' registry-url: 'https://registry.npmjs.org' cache: 'npm' - + - name: Install dependencies run: npm i env: @@ -47,7 +47,7 @@ jobs: uses: actions/download-artifact@v2 with: name: ui-kit-artifact - + - name: Unpack artifact run: tar xf artifact.tar.gz @@ -67,7 +67,7 @@ jobs: - name: Unpack artifact run: tar xf artifact.tar.gz - + - name: Run typescript compile run: yarn tsc --noEmit diff --git a/package-lock.json b/package-lock.json index 5a41dd3..7ffa6b2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@macpaw/macpaw-ui", - "version": "4.10.3", + "version": "4.11.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@macpaw/macpaw-ui", - "version": "4.10.3", + "version": "4.11.0", "license": "MIT", "dependencies": { "@floating-ui/react": "^0.24.1", @@ -17,8 +17,9 @@ }, "devDependencies": { "@babel/runtime": "^7.18.3", - "@macpaw/eslint-config-react": "^2.0.1", - "@macpaw/eslint-config-typescript": "^2.0.1", + "@macpaw/eslint-config-prettier": "^1.1.0", + "@macpaw/eslint-config-react": "^3.1.0", + "@macpaw/eslint-config-typescript": "^3.1.0", "@mdx-js/loader": "^2.1.1", "@mdx-js/react": "^2.3.0", "@next/mdx": "^12.1.6", @@ -36,7 +37,7 @@ "react": "^18.1.0", "react-dom": "^18.1.0", "sass": "^1.52.1", - "typescript": "^4.7.2" + "typescript": "^5.0.4" }, "engines": { "node": ">= 16" @@ -444,6 +445,42 @@ "kuler": "^2.0.0" } }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", + "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.5.1.tgz", + "integrity": "sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, "node_modules/@eslint/eslintrc": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", @@ -515,17 +552,17 @@ "integrity": "sha512-EvYTiXet5XqweYGClEmpu3BoxmsQ4hkj3QaYA6qEnigCWffTP3vNRwBReTdrwDwo7OoJ3wM8Uoe9Uk4n+d4hfg==" }, "node_modules/@floating-ui/dom": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.2.8.tgz", - "integrity": "sha512-XLwhYV90MxiHDq6S0rzFZj00fnDM+A1R9jhSioZoMsa7G0Q0i+Q4x40ajR8FHSdYDE1bgjG45mIWe6jtv9UPmg==", + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.2.9.tgz", + "integrity": "sha512-sosQxsqgxMNkV3C+3UqTS6LxP7isRLwX8WMepp843Rb3/b0Wz8+MdUkxJksByip3C2WwLugLHN1b4ibn//zKwQ==", "dependencies": { "@floating-ui/core": "^1.2.6" } }, "node_modules/@floating-ui/react": { - "version": "0.24.1", - "resolved": "https://registry.npmjs.org/@floating-ui/react/-/react-0.24.1.tgz", - "integrity": "sha512-qjCKUZDEz/4bnJmu4gn66TqsoX912/re8JGEi3pXazsphmyh327l0UpTgpBAT3WkNbnzAH7Adt3wKlLMNtfupw==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@floating-ui/react/-/react-0.24.2.tgz", + "integrity": "sha512-8sdLmcC85J6M2H0AL8yOQuiWD4T0gNMSLpuJjmXyEA6ndfmxXR0hwKFkczB4xRNFhKbwoQeuh8z561HE2vOdZw==", "dependencies": { "@floating-ui/react-dom": "^2.0.0", "aria-hidden": "^1.1.3", @@ -628,9 +665,9 @@ } }, "node_modules/@macpaw/eslint-config-base": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@macpaw/eslint-config-base/-/eslint-config-base-2.0.1.tgz", - "integrity": "sha512-shMAciK8ocMiJChss1mL2D4rOxcCjzFOXiQeBjdmsO5hi0ads/uZNWuUS4TZh93mZEyR+rNc54g9HXPCGx9eEg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@macpaw/eslint-config-base/-/eslint-config-base-3.0.0.tgz", + "integrity": "sha512-N42UES8JUzzhSawkez8ihkxJHB/GwLC1vFB7hENVETvXE44eu9fXBu/26kMI7kdr6dNNKx39BDiFly0xaJwFWg==", "dev": true, "dependencies": { "eslint-plugin-import": "^2.26.0" @@ -639,13 +676,28 @@ "eslint": "^8.0.0" } }, + "node_modules/@macpaw/eslint-config-prettier": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@macpaw/eslint-config-prettier/-/eslint-config-prettier-1.1.0.tgz", + "integrity": "sha512-GIN0UX4QQ+q6BK0R3SyIrv7Kqq/DVsVp2yICfwLUXmkkiR+eYjn7KEBUxSG7lq8lsQl2yhGzXtmtDJ0a7DyHMg==", + "dev": true, + "dependencies": { + "@macpaw/eslint-config-base": "3.0.0", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-prettier": "^4.2.1" + }, + "peerDependencies": { + "eslint": "^8.0.0", + "prettier": "^2.7.1" + } + }, "node_modules/@macpaw/eslint-config-react": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@macpaw/eslint-config-react/-/eslint-config-react-2.0.1.tgz", - "integrity": "sha512-mFeZVMC08cBZ60ahzaSGcwfC6BXVRw+AngqIPGor+ICgoLNdXv/xFmJrY8wJ1+d2AOLLdAtCaTcZYpM5Z/L+yA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@macpaw/eslint-config-react/-/eslint-config-react-3.1.0.tgz", + "integrity": "sha512-1LYfkU7opVZZSea+lM62Dc/3cFBxGAz5+2jydQsAcmMfwYjMMGkMjux4/ljiknDsTgM9mMsyca7b5ohU9J6xvA==", "dev": true, "dependencies": { - "@macpaw/eslint-config-base": "2.0.1", + "@macpaw/eslint-config-base": "3.0.0", "eslint-plugin-jsx-a11y": "^6.5.1", "eslint-plugin-react": "^7.30.0", "eslint-plugin-react-hooks": "^4.5.0" @@ -655,18 +707,18 @@ } }, "node_modules/@macpaw/eslint-config-typescript": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@macpaw/eslint-config-typescript/-/eslint-config-typescript-2.0.1.tgz", - "integrity": "sha512-36A7ZZLhJ0XuLAXFkRe45hkY339sGx7v8ciJkXELs14+eYsrgZs7/3wbhUtdW4/Y9nQUby+lmIV/G6GTfTEkLQ==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@macpaw/eslint-config-typescript/-/eslint-config-typescript-3.1.0.tgz", + "integrity": "sha512-9iM6Os58WJDANH1Eum3XKENh9xKMc6fZwGxqFugWnhHhMYlqFDrg6/M/t8/46XW6LEyMUXhqu60ItPiFZb2UiA==", "dev": true, "dependencies": { - "@macpaw/eslint-config-base": "2.0.1", - "@typescript-eslint/eslint-plugin": "^5.26.0", - "@typescript-eslint/parser": "^5.26.0" + "@macpaw/eslint-config-base": "^3.0.0", + "@typescript-eslint/eslint-plugin": "^5.59.7", + "@typescript-eslint/parser": "^5.59.7" }, "peerDependencies": { "eslint": "^8.0.0", - "typescript": "^4.0.0" + "typescript": "^4.0.0 || ^5.0.0" } }, "node_modules/@mdx-js/loader": { @@ -1483,6 +1535,12 @@ "integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==", "dev": true }, + "node_modules/@types/semver": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.0.tgz", + "integrity": "sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==", + "dev": true + }, "node_modules/@types/unist": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.6.tgz", @@ -1490,18 +1548,19 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.26.0.tgz", - "integrity": "sha512-oGCmo0PqnRZZndr+KwvvAUvD3kNE4AfyoGCwOZpoCncSh4MVD06JTE8XQa2u9u+NX5CsyZMBTEc2C72zx38eYA==", + "version": "5.59.8", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.8.tgz", + "integrity": "sha512-JDMOmhXteJ4WVKOiHXGCoB96ADWg9q7efPWHRViT/f09bA8XOMLAVHHju3l0MkZnG1izaWXYmgvQcUjTRcpShQ==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.26.0", - "@typescript-eslint/type-utils": "5.26.0", - "@typescript-eslint/utils": "5.26.0", + "@eslint-community/regexpp": "^4.4.0", + "@typescript-eslint/scope-manager": "5.59.8", + "@typescript-eslint/type-utils": "5.59.8", + "@typescript-eslint/utils": "5.59.8", "debug": "^4.3.4", - "functional-red-black-tree": "^1.0.1", + "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", - "regexpp": "^3.2.0", + "natural-compare-lite": "^1.4.0", "semver": "^7.3.7", "tsutils": "^3.21.0" }, @@ -1523,9 +1582,9 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz", + "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -1538,14 +1597,14 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.26.0.tgz", - "integrity": "sha512-n/IzU87ttzIdnAH5vQ4BBDnLPly7rC5VnjN3m0xBG82HK6rhRxnCb3w/GyWbNDghPd+NktJqB/wl6+YkzZ5T5Q==", + "version": "5.59.8", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.8.tgz", + "integrity": "sha512-AnR19RjJcpjoeGojmwZtCwBX/RidqDZtzcbG3xHrmz0aHHoOcbWnpDllenRDmDvsV0RQ6+tbb09/kyc+UT9Orw==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.26.0", - "@typescript-eslint/types": "5.26.0", - "@typescript-eslint/typescript-estree": "5.26.0", + "@typescript-eslint/scope-manager": "5.59.8", + "@typescript-eslint/types": "5.59.8", + "@typescript-eslint/typescript-estree": "5.59.8", "debug": "^4.3.4" }, "engines": { @@ -1565,13 +1624,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.26.0.tgz", - "integrity": "sha512-gVzTJUESuTwiju/7NiTb4c5oqod8xt5GhMbExKsCTp6adU3mya6AGJ4Pl9xC7x2DX9UYFsjImC0mA62BCY22Iw==", + "version": "5.59.8", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.8.tgz", + "integrity": "sha512-/w08ndCYI8gxGf+9zKf1vtx/16y8MHrZs5/tnjHhMLNSixuNcJavSX4wAiPf4aS5x41Es9YPCn44MIe4cxIlig==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.26.0", - "@typescript-eslint/visitor-keys": "5.26.0" + "@typescript-eslint/types": "5.59.8", + "@typescript-eslint/visitor-keys": "5.59.8" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1582,12 +1641,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.26.0.tgz", - "integrity": "sha512-7ccbUVWGLmcRDSA1+ADkDBl5fP87EJt0fnijsMFTVHXKGduYMgienC/i3QwoVhDADUAPoytgjbZbCOMj4TY55A==", + "version": "5.59.8", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.8.tgz", + "integrity": "sha512-+5M518uEIHFBy3FnyqZUF3BMP+AXnYn4oyH8RF012+e7/msMY98FhGL5SrN29NQ9xDgvqCgYnsOiKp1VjZ/fpA==", "dev": true, "dependencies": { - "@typescript-eslint/utils": "5.26.0", + "@typescript-eslint/typescript-estree": "5.59.8", + "@typescript-eslint/utils": "5.59.8", "debug": "^4.3.4", "tsutils": "^3.21.0" }, @@ -1608,9 +1668,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.26.0.tgz", - "integrity": "sha512-8794JZFE1RN4XaExLWLI2oSXsVImNkl79PzTOOWt9h0UHROwJedNOD2IJyfL0NbddFllcktGIO2aOu10avQQyA==", + "version": "5.59.8", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.8.tgz", + "integrity": "sha512-+uWuOhBTj/L6awoWIg0BlWy0u9TyFpCHrAuQ5bNfxDaZ1Ppb3mx6tUigc74LHcbHpOHuOTOJrBoAnhdHdaea1w==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1621,13 +1681,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.26.0.tgz", - "integrity": "sha512-EyGpw6eQDsfD6jIqmXP3rU5oHScZ51tL/cZgFbFBvWuCwrIptl+oueUZzSmLtxFuSOQ9vDcJIs+279gnJkfd1w==", + "version": "5.59.8", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.8.tgz", + "integrity": "sha512-Jy/lPSDJGNow14vYu6IrW790p7HIf/SOV1Bb6lZ7NUkLc2iB2Z9elESmsaUtLw8kVqogSbtLH9tut5GCX1RLDg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.26.0", - "@typescript-eslint/visitor-keys": "5.26.0", + "@typescript-eslint/types": "5.59.8", + "@typescript-eslint/visitor-keys": "5.59.8", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -1648,9 +1708,9 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz", + "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -1663,17 +1723,19 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.26.0.tgz", - "integrity": "sha512-PJFwcTq2Pt4AMOKfe3zQOdez6InIDOjUJJD3v3LyEtxHGVVRK3Vo7Dd923t/4M9hSH2q2CLvcTdxlLPjcIk3eg==", + "version": "5.59.8", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.8.tgz", + "integrity": "sha512-Tr65630KysnNn9f9G7ROF3w1b5/7f6QVCJ+WK9nhIocWmx9F+TmCAcglF26Vm7z8KCTwoKcNEBZrhlklla3CKg==", "dev": true, "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.26.0", - "@typescript-eslint/types": "5.26.0", - "@typescript-eslint/typescript-estree": "5.26.0", + "@types/semver": "^7.3.12", + "@typescript-eslint/scope-manager": "5.59.8", + "@typescript-eslint/types": "5.59.8", + "@typescript-eslint/typescript-estree": "5.59.8", "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0" + "semver": "^7.3.7" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1686,13 +1748,28 @@ "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/@typescript-eslint/utils/node_modules/semver": { + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz", + "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.26.0.tgz", - "integrity": "sha512-wei+ffqHanYDOQgg/fS6Hcar6wAWv0CUPQ3TZzOWd2BLfgP539rb49bwua8WRAs7R6kOSLn82rfEu2ro6Llt8Q==", + "version": "5.59.8", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.8.tgz", + "integrity": "sha512-pJhi2ms0x0xgloT7xYabil3SGGlojNNKjK/q6dB3Ey0uJLMjK2UDGJvHieiyJVW/7C3KI+Z4Q3pEHkm4ejA+xQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.26.0", + "@typescript-eslint/types": "5.59.8", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -1704,12 +1781,15 @@ } }, "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", + "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/@webassemblyjs/ast": { @@ -2019,11 +2099,6 @@ "node": ">=10" } }, - "node_modules/aria-hidden/node_modules/tslib": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.2.tgz", - "integrity": "sha512-5svOrSA2w3iGFDs1HibEVBGbDrAY82bFQ3HZ3ixB+88nsbsWQoKqDRb5UBYAUPEzbBn6dAp5gRNXglySbx1MlA==" - }, "node_modules/aria-query": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-4.2.2.tgz", @@ -2037,16 +2112,29 @@ "node": ">=6.0" } }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", + "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "is-array-buffer": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/array-includes": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.5.tgz", - "integrity": "sha512-iSDYZMMyTPkiFasVqfuAQnWAYcvO/SeBSCGKePoEthjp4LEMTe4uLc7b025o4jAZpHhihh8xPo99TNWUWWkGDQ==", + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.6.tgz", + "integrity": "sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", - "es-abstract": "^1.19.5", - "get-intrinsic": "^1.1.1", + "es-abstract": "^1.20.4", + "get-intrinsic": "^1.1.3", "is-string": "^1.0.7" }, "engines": { @@ -2066,14 +2154,14 @@ } }, "node_modules/array.prototype.flat": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.0.tgz", - "integrity": "sha512-12IUEkHsAhA4DY5s0FPgNXIdc8VRSqD9Zp78a5au9abH/SOBrsp082JOWFNTjkMozh8mqcdiKuaLGhPeYztxSw==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz", + "integrity": "sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", "es-shim-unscopables": "^1.0.0" }, "engines": { @@ -2084,14 +2172,14 @@ } }, "node_modules/array.prototype.flatmap": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.0.tgz", - "integrity": "sha512-PZC9/8TKAIxcWKdyeb77EzULHPrIX/tIZebLJUQOMR1OwYosT8yggdfWScfTBCDj5utONvOuPQQumYsU2ULbkg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz", + "integrity": "sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", "es-shim-unscopables": "^1.0.0" }, "engines": { @@ -2940,34 +3028,45 @@ } }, "node_modules/es-abstract": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.1.tgz", - "integrity": "sha512-WEm2oBhfoI2sImeM4OF2zE2V3BYdSF+KnSi9Sidz51fQHd7+JuF8Xgcj9/0o+OWeIeIS/MiuNnlruQrJf16GQA==", + "version": "1.21.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.21.2.tgz", + "integrity": "sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg==", "dev": true, "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", + "es-set-tostringtag": "^2.0.1", "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", "function.prototype.name": "^1.1.5", - "get-intrinsic": "^1.1.1", + "get-intrinsic": "^1.2.0", "get-symbol-description": "^1.0.0", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", "has": "^1.0.3", "has-property-descriptors": "^1.0.0", + "has-proto": "^1.0.1", "has-symbols": "^1.0.3", - "internal-slot": "^1.0.3", - "is-callable": "^1.2.4", + "internal-slot": "^1.0.5", + "is-array-buffer": "^3.0.2", + "is-callable": "^1.2.7", "is-negative-zero": "^2.0.2", "is-regex": "^1.1.4", "is-shared-array-buffer": "^1.0.2", "is-string": "^1.0.7", + "is-typed-array": "^1.1.10", "is-weakref": "^1.0.2", - "object-inspect": "^1.12.0", + "object-inspect": "^1.12.3", "object-keys": "^1.1.1", - "object.assign": "^4.1.2", + "object.assign": "^4.1.4", "regexp.prototype.flags": "^1.4.3", - "string.prototype.trimend": "^1.0.5", - "string.prototype.trimstart": "^1.0.5", - "unbox-primitive": "^1.0.2" + "safe-regex-test": "^1.0.0", + "string.prototype.trim": "^1.2.7", + "string.prototype.trimend": "^1.0.6", + "string.prototype.trimstart": "^1.0.6", + "typed-array-length": "^1.0.4", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.9" }, "engines": { "node": ">= 0.4" @@ -2983,6 +3082,20 @@ "dev": true, "peer": true }, + "node_modules/es-set-tostringtag": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", + "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3", + "has": "^1.0.3", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-shim-unscopables": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", @@ -3079,14 +3192,27 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint-config-prettier": { + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.8.0.tgz", + "integrity": "sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA==", + "dev": true, + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, "node_modules/eslint-import-resolver-node": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz", - "integrity": "sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==", + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.7.tgz", + "integrity": "sha512-gozW2blMLJCeFpBwugLTGyvVjNoeo1knonXAcatC6bjPBZitotxdWf7Gimr25N4c0AAOo4eOUfaG82IJPDpqCA==", "dev": true, "dependencies": { "debug": "^3.2.7", - "resolve": "^1.20.0" + "is-core-module": "^2.11.0", + "resolve": "^1.22.1" } }, "node_modules/eslint-import-resolver-node/node_modules/debug": { @@ -3099,16 +3225,20 @@ } }, "node_modules/eslint-module-utils": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz", - "integrity": "sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", + "integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==", "dev": true, "dependencies": { - "debug": "^3.2.7", - "find-up": "^2.1.0" + "debug": "^3.2.7" }, "engines": { "node": ">=4" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } } }, "node_modules/eslint-module-utils/node_modules/debug": { @@ -3121,23 +3251,25 @@ } }, "node_modules/eslint-plugin-import": { - "version": "2.26.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz", - "integrity": "sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==", + "version": "2.27.5", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.27.5.tgz", + "integrity": "sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==", "dev": true, "dependencies": { - "array-includes": "^3.1.4", - "array.prototype.flat": "^1.2.5", - "debug": "^2.6.9", + "array-includes": "^3.1.6", + "array.prototype.flat": "^1.3.1", + "array.prototype.flatmap": "^1.3.1", + "debug": "^3.2.7", "doctrine": "^2.1.0", - "eslint-import-resolver-node": "^0.3.6", - "eslint-module-utils": "^2.7.3", + "eslint-import-resolver-node": "^0.3.7", + "eslint-module-utils": "^2.7.4", "has": "^1.0.3", - "is-core-module": "^2.8.1", + "is-core-module": "^2.11.0", "is-glob": "^4.0.3", "minimatch": "^3.1.2", - "object.values": "^1.1.5", - "resolve": "^1.22.0", + "object.values": "^1.1.6", + "resolve": "^1.22.1", + "semver": "^6.3.0", "tsconfig-paths": "^3.14.1" }, "engines": { @@ -3148,12 +3280,12 @@ } }, "node_modules/eslint-plugin-import/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, "dependencies": { - "ms": "2.0.0" + "ms": "^2.1.1" } }, "node_modules/eslint-plugin-import/node_modules/doctrine": { @@ -3168,29 +3300,6 @@ "node": ">=0.10.0" } }, - "node_modules/eslint-plugin-import/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "node_modules/eslint-plugin-import/node_modules/resolve": { - "version": "1.22.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", - "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", - "dev": true, - "dependencies": { - "is-core-module": "^2.8.1", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/eslint-plugin-jsx-a11y": { "version": "6.5.1", "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.5.1.tgz", @@ -3217,6 +3326,27 @@ "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8" } }, + "node_modules/eslint-plugin-prettier": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", + "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==", + "dev": true, + "dependencies": { + "prettier-linter-helpers": "^1.0.0" + }, + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "eslint": ">=7.28.0", + "prettier": ">=2.0.0" + }, + "peerDependenciesMeta": { + "eslint-config-prettier": { + "optional": true + } + } + }, "node_modules/eslint-plugin-react": { "version": "7.30.0", "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.30.0.tgz", @@ -3599,6 +3729,12 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, + "node_modules/fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "dev": true + }, "node_modules/fast-glob": { "version": "3.2.11", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", @@ -3672,18 +3808,6 @@ "node": ">=8" } }, - "node_modules/find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", - "dev": true, - "dependencies": { - "locate-path": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/flat-cache": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", @@ -3873,6 +3997,21 @@ "node": ">=4" } }, + "node_modules/globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dev": true, + "dependencies": { + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/globby": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", @@ -3912,6 +4051,12 @@ "dev": true, "peer": true }, + "node_modules/grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "dev": true + }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -3954,6 +4099,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", @@ -4086,12 +4243,12 @@ "dev": true }, "node_modules/internal-slot": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", - "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", + "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", "dev": true, "dependencies": { - "get-intrinsic": "^1.1.0", + "get-intrinsic": "^1.2.0", "has": "^1.0.3", "side-channel": "^1.0.4" }, @@ -4139,6 +4296,20 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-array-buffer": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", + "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.0", + "is-typed-array": "^1.1.10" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -4186,9 +4357,9 @@ } }, "node_modules/is-callable": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", - "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true, "engines": { "node": ">= 0.4" @@ -4198,9 +4369,9 @@ } }, "node_modules/is-core-module": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", - "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz", + "integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==", "dev": true, "dependencies": { "has": "^1.0.3" @@ -4606,19 +4777,6 @@ "node": ">=6.11.5" } }, - "node_modules/locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", - "dev": true, - "dependencies": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/lodash.debounce": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", @@ -5555,10 +5713,13 @@ } }, "node_modules/minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", - "dev": true + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/mri": { "version": "1.2.0", @@ -5593,6 +5754,12 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, + "node_modules/natural-compare-lite": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", + "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", + "dev": true + }, "node_modules/neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", @@ -5686,9 +5853,9 @@ } }, "node_modules/object-inspect": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", - "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -5704,14 +5871,14 @@ } }, "node_modules/object.assign": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", - "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", + "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "has-symbols": "^1.0.1", + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "has-symbols": "^1.0.3", "object-keys": "^1.1.1" }, "engines": { @@ -5766,14 +5933,14 @@ } }, "node_modules/object.values": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.5.tgz", - "integrity": "sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.6.tgz", + "integrity": "sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1" + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" }, "engines": { "node": ">= 0.4" @@ -5817,39 +5984,6 @@ "node": ">= 0.8.0" } }, - "node_modules/p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "dependencies": { - "p-limit": "^1.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/p-locate/node_modules/p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "dependencies": { - "p-try": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/p-locate/node_modules/p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -5900,15 +6034,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -6012,6 +6137,18 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "dependencies": { + "fast-diff": "^1.1.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/prism-react-renderer": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/prism-react-renderer/-/prism-react-renderer-1.3.3.tgz", @@ -6280,13 +6417,17 @@ } }, "node_modules/resolve": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", - "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", + "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", "dev": true, "dependencies": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" + "is-core-module": "^2.11.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -6367,6 +6508,20 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, + "node_modules/safe-regex-test": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", + "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "is-regex": "^1.1.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/sass": { "version": "1.52.1", "resolved": "https://registry.npmjs.org/sass/-/sass-1.52.1.tgz", @@ -6618,29 +6773,46 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/string.prototype.trim": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz", + "integrity": "sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/string.prototype.trimend": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz", - "integrity": "sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", + "integrity": "sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", - "es-abstract": "^1.19.5" + "es-abstract": "^1.20.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimstart": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz", - "integrity": "sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz", + "integrity": "sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", - "es-abstract": "^1.19.5" + "es-abstract": "^1.20.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -6675,7 +6847,7 @@ "node_modules/strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true, "engines": { "node": ">=4" @@ -6917,13 +7089,13 @@ } }, "node_modules/tsconfig-paths": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", - "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz", + "integrity": "sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==", "dev": true, "dependencies": { "@types/json5": "^0.0.29", - "json5": "^1.0.1", + "json5": "^1.0.2", "minimist": "^1.2.6", "strip-bom": "^3.0.0" } @@ -6941,10 +7113,9 @@ } }, "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.2.tgz", + "integrity": "sha512-5svOrSA2w3iGFDs1HibEVBGbDrAY82bFQ3HZ3ixB+88nsbsWQoKqDRb5UBYAUPEzbBn6dAp5gRNXglySbx1MlA==" }, "node_modules/tsutils": { "version": "3.21.0", @@ -6961,6 +7132,12 @@ "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" } }, + "node_modules/tsutils/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -6973,17 +7150,31 @@ "node": ">= 0.8.0" } }, + "node_modules/typed-array-length": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", + "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "is-typed-array": "^1.1.9" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/typescript": { - "version": "4.7.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.2.tgz", - "integrity": "sha512-Mamb1iX2FDUpcTRzltPxgWMKy3fhg0TN378ylbktPGPK/99KbDtMQ4W1hwgsbPAsG3a0xKa1vmw4VKZQbkvz5A==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", + "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=12.20" } }, "node_modules/unbox-primitive": { @@ -7938,6 +8129,29 @@ "kuler": "^2.0.0" } }, + "@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^3.3.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", + "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", + "dev": true + } + } + }, + "@eslint-community/regexpp": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.5.1.tgz", + "integrity": "sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ==", + "dev": true + }, "@eslint/eslintrc": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", @@ -7993,17 +8207,17 @@ "integrity": "sha512-EvYTiXet5XqweYGClEmpu3BoxmsQ4hkj3QaYA6qEnigCWffTP3vNRwBReTdrwDwo7OoJ3wM8Uoe9Uk4n+d4hfg==" }, "@floating-ui/dom": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.2.8.tgz", - "integrity": "sha512-XLwhYV90MxiHDq6S0rzFZj00fnDM+A1R9jhSioZoMsa7G0Q0i+Q4x40ajR8FHSdYDE1bgjG45mIWe6jtv9UPmg==", + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.2.9.tgz", + "integrity": "sha512-sosQxsqgxMNkV3C+3UqTS6LxP7isRLwX8WMepp843Rb3/b0Wz8+MdUkxJksByip3C2WwLugLHN1b4ibn//zKwQ==", "requires": { "@floating-ui/core": "^1.2.6" } }, "@floating-ui/react": { - "version": "0.24.1", - "resolved": "https://registry.npmjs.org/@floating-ui/react/-/react-0.24.1.tgz", - "integrity": "sha512-qjCKUZDEz/4bnJmu4gn66TqsoX912/re8JGEi3pXazsphmyh327l0UpTgpBAT3WkNbnzAH7Adt3wKlLMNtfupw==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@floating-ui/react/-/react-0.24.2.tgz", + "integrity": "sha512-8sdLmcC85J6M2H0AL8yOQuiWD4T0gNMSLpuJjmXyEA6ndfmxXR0hwKFkczB4xRNFhKbwoQeuh8z561HE2vOdZw==", "requires": { "@floating-ui/react-dom": "^2.0.0", "aria-hidden": "^1.1.3", @@ -8086,35 +8300,46 @@ } }, "@macpaw/eslint-config-base": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@macpaw/eslint-config-base/-/eslint-config-base-2.0.1.tgz", - "integrity": "sha512-shMAciK8ocMiJChss1mL2D4rOxcCjzFOXiQeBjdmsO5hi0ads/uZNWuUS4TZh93mZEyR+rNc54g9HXPCGx9eEg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@macpaw/eslint-config-base/-/eslint-config-base-3.0.0.tgz", + "integrity": "sha512-N42UES8JUzzhSawkez8ihkxJHB/GwLC1vFB7hENVETvXE44eu9fXBu/26kMI7kdr6dNNKx39BDiFly0xaJwFWg==", "dev": true, "requires": { "eslint-plugin-import": "^2.26.0" } }, + "@macpaw/eslint-config-prettier": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@macpaw/eslint-config-prettier/-/eslint-config-prettier-1.1.0.tgz", + "integrity": "sha512-GIN0UX4QQ+q6BK0R3SyIrv7Kqq/DVsVp2yICfwLUXmkkiR+eYjn7KEBUxSG7lq8lsQl2yhGzXtmtDJ0a7DyHMg==", + "dev": true, + "requires": { + "@macpaw/eslint-config-base": "3.0.0", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-prettier": "^4.2.1" + } + }, "@macpaw/eslint-config-react": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@macpaw/eslint-config-react/-/eslint-config-react-2.0.1.tgz", - "integrity": "sha512-mFeZVMC08cBZ60ahzaSGcwfC6BXVRw+AngqIPGor+ICgoLNdXv/xFmJrY8wJ1+d2AOLLdAtCaTcZYpM5Z/L+yA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@macpaw/eslint-config-react/-/eslint-config-react-3.1.0.tgz", + "integrity": "sha512-1LYfkU7opVZZSea+lM62Dc/3cFBxGAz5+2jydQsAcmMfwYjMMGkMjux4/ljiknDsTgM9mMsyca7b5ohU9J6xvA==", "dev": true, "requires": { - "@macpaw/eslint-config-base": "2.0.1", + "@macpaw/eslint-config-base": "3.0.0", "eslint-plugin-jsx-a11y": "^6.5.1", "eslint-plugin-react": "^7.30.0", "eslint-plugin-react-hooks": "^4.5.0" } }, "@macpaw/eslint-config-typescript": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@macpaw/eslint-config-typescript/-/eslint-config-typescript-2.0.1.tgz", - "integrity": "sha512-36A7ZZLhJ0XuLAXFkRe45hkY339sGx7v8ciJkXELs14+eYsrgZs7/3wbhUtdW4/Y9nQUby+lmIV/G6GTfTEkLQ==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@macpaw/eslint-config-typescript/-/eslint-config-typescript-3.1.0.tgz", + "integrity": "sha512-9iM6Os58WJDANH1Eum3XKENh9xKMc6fZwGxqFugWnhHhMYlqFDrg6/M/t8/46XW6LEyMUXhqu60ItPiFZb2UiA==", "dev": true, "requires": { - "@macpaw/eslint-config-base": "2.0.1", - "@typescript-eslint/eslint-plugin": "^5.26.0", - "@typescript-eslint/parser": "^5.26.0" + "@macpaw/eslint-config-base": "^3.0.0", + "@typescript-eslint/eslint-plugin": "^5.59.7", + "@typescript-eslint/parser": "^5.59.7" } }, "@mdx-js/loader": { @@ -8646,6 +8871,12 @@ "integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==", "dev": true }, + "@types/semver": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.0.tgz", + "integrity": "sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==", + "dev": true + }, "@types/unist": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.6.tgz", @@ -8653,26 +8884,27 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "5.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.26.0.tgz", - "integrity": "sha512-oGCmo0PqnRZZndr+KwvvAUvD3kNE4AfyoGCwOZpoCncSh4MVD06JTE8XQa2u9u+NX5CsyZMBTEc2C72zx38eYA==", + "version": "5.59.8", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.8.tgz", + "integrity": "sha512-JDMOmhXteJ4WVKOiHXGCoB96ADWg9q7efPWHRViT/f09bA8XOMLAVHHju3l0MkZnG1izaWXYmgvQcUjTRcpShQ==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.26.0", - "@typescript-eslint/type-utils": "5.26.0", - "@typescript-eslint/utils": "5.26.0", + "@eslint-community/regexpp": "^4.4.0", + "@typescript-eslint/scope-manager": "5.59.8", + "@typescript-eslint/type-utils": "5.59.8", + "@typescript-eslint/utils": "5.59.8", "debug": "^4.3.4", - "functional-red-black-tree": "^1.0.1", + "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", - "regexpp": "^3.2.0", + "natural-compare-lite": "^1.4.0", "semver": "^7.3.7", "tsutils": "^3.21.0" }, "dependencies": { "semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz", + "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -8681,52 +8913,53 @@ } }, "@typescript-eslint/parser": { - "version": "5.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.26.0.tgz", - "integrity": "sha512-n/IzU87ttzIdnAH5vQ4BBDnLPly7rC5VnjN3m0xBG82HK6rhRxnCb3w/GyWbNDghPd+NktJqB/wl6+YkzZ5T5Q==", + "version": "5.59.8", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.8.tgz", + "integrity": "sha512-AnR19RjJcpjoeGojmwZtCwBX/RidqDZtzcbG3xHrmz0aHHoOcbWnpDllenRDmDvsV0RQ6+tbb09/kyc+UT9Orw==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.26.0", - "@typescript-eslint/types": "5.26.0", - "@typescript-eslint/typescript-estree": "5.26.0", + "@typescript-eslint/scope-manager": "5.59.8", + "@typescript-eslint/types": "5.59.8", + "@typescript-eslint/typescript-estree": "5.59.8", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "5.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.26.0.tgz", - "integrity": "sha512-gVzTJUESuTwiju/7NiTb4c5oqod8xt5GhMbExKsCTp6adU3mya6AGJ4Pl9xC7x2DX9UYFsjImC0mA62BCY22Iw==", + "version": "5.59.8", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.8.tgz", + "integrity": "sha512-/w08ndCYI8gxGf+9zKf1vtx/16y8MHrZs5/tnjHhMLNSixuNcJavSX4wAiPf4aS5x41Es9YPCn44MIe4cxIlig==", "dev": true, "requires": { - "@typescript-eslint/types": "5.26.0", - "@typescript-eslint/visitor-keys": "5.26.0" + "@typescript-eslint/types": "5.59.8", + "@typescript-eslint/visitor-keys": "5.59.8" } }, "@typescript-eslint/type-utils": { - "version": "5.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.26.0.tgz", - "integrity": "sha512-7ccbUVWGLmcRDSA1+ADkDBl5fP87EJt0fnijsMFTVHXKGduYMgienC/i3QwoVhDADUAPoytgjbZbCOMj4TY55A==", + "version": "5.59.8", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.8.tgz", + "integrity": "sha512-+5M518uEIHFBy3FnyqZUF3BMP+AXnYn4oyH8RF012+e7/msMY98FhGL5SrN29NQ9xDgvqCgYnsOiKp1VjZ/fpA==", "dev": true, "requires": { - "@typescript-eslint/utils": "5.26.0", + "@typescript-eslint/typescript-estree": "5.59.8", + "@typescript-eslint/utils": "5.59.8", "debug": "^4.3.4", "tsutils": "^3.21.0" } }, "@typescript-eslint/types": { - "version": "5.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.26.0.tgz", - "integrity": "sha512-8794JZFE1RN4XaExLWLI2oSXsVImNkl79PzTOOWt9h0UHROwJedNOD2IJyfL0NbddFllcktGIO2aOu10avQQyA==", + "version": "5.59.8", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.8.tgz", + "integrity": "sha512-+uWuOhBTj/L6awoWIg0BlWy0u9TyFpCHrAuQ5bNfxDaZ1Ppb3mx6tUigc74LHcbHpOHuOTOJrBoAnhdHdaea1w==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.26.0.tgz", - "integrity": "sha512-EyGpw6eQDsfD6jIqmXP3rU5oHScZ51tL/cZgFbFBvWuCwrIptl+oueUZzSmLtxFuSOQ9vDcJIs+279gnJkfd1w==", + "version": "5.59.8", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.8.tgz", + "integrity": "sha512-Jy/lPSDJGNow14vYu6IrW790p7HIf/SOV1Bb6lZ7NUkLc2iB2Z9elESmsaUtLw8kVqogSbtLH9tut5GCX1RLDg==", "dev": true, "requires": { - "@typescript-eslint/types": "5.26.0", - "@typescript-eslint/visitor-keys": "5.26.0", + "@typescript-eslint/types": "5.59.8", + "@typescript-eslint/visitor-keys": "5.59.8", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -8735,9 +8968,9 @@ }, "dependencies": { "semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz", + "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -8746,33 +8979,46 @@ } }, "@typescript-eslint/utils": { - "version": "5.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.26.0.tgz", - "integrity": "sha512-PJFwcTq2Pt4AMOKfe3zQOdez6InIDOjUJJD3v3LyEtxHGVVRK3Vo7Dd923t/4M9hSH2q2CLvcTdxlLPjcIk3eg==", + "version": "5.59.8", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.8.tgz", + "integrity": "sha512-Tr65630KysnNn9f9G7ROF3w1b5/7f6QVCJ+WK9nhIocWmx9F+TmCAcglF26Vm7z8KCTwoKcNEBZrhlklla3CKg==", "dev": true, "requires": { + "@eslint-community/eslint-utils": "^4.2.0", "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.26.0", - "@typescript-eslint/types": "5.26.0", - "@typescript-eslint/typescript-estree": "5.26.0", + "@types/semver": "^7.3.12", + "@typescript-eslint/scope-manager": "5.59.8", + "@typescript-eslint/types": "5.59.8", + "@typescript-eslint/typescript-estree": "5.59.8", "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0" + "semver": "^7.3.7" + }, + "dependencies": { + "semver": { + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz", + "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } } }, "@typescript-eslint/visitor-keys": { - "version": "5.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.26.0.tgz", - "integrity": "sha512-wei+ffqHanYDOQgg/fS6Hcar6wAWv0CUPQ3TZzOWd2BLfgP539rb49bwua8WRAs7R6kOSLn82rfEu2ro6Llt8Q==", + "version": "5.59.8", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.8.tgz", + "integrity": "sha512-pJhi2ms0x0xgloT7xYabil3SGGlojNNKjK/q6dB3Ey0uJLMjK2UDGJvHieiyJVW/7C3KI+Z4Q3pEHkm4ejA+xQ==", "dev": true, "requires": { - "@typescript-eslint/types": "5.26.0", + "@typescript-eslint/types": "5.59.8", "eslint-visitor-keys": "^3.3.0" }, "dependencies": { "eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", + "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", "dev": true } } @@ -9047,13 +9293,6 @@ "integrity": "sha512-xcLxITLe2HYa1cnYnwCjkOO1PqUHQpozB8x9AR0OgWN2woOBi5kSDVxKfd0b7sb1hw5qFeJhXm9H1nu3xSfLeQ==", "requires": { "tslib": "^2.0.0" - }, - "dependencies": { - "tslib": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.2.tgz", - "integrity": "sha512-5svOrSA2w3iGFDs1HibEVBGbDrAY82bFQ3HZ3ixB+88nsbsWQoKqDRb5UBYAUPEzbBn6dAp5gRNXglySbx1MlA==" - } } }, "aria-query": { @@ -9066,16 +9305,26 @@ "@babel/runtime-corejs3": "^7.10.2" } }, + "array-buffer-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", + "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "is-array-buffer": "^3.0.1" + } + }, "array-includes": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.5.tgz", - "integrity": "sha512-iSDYZMMyTPkiFasVqfuAQnWAYcvO/SeBSCGKePoEthjp4LEMTe4uLc7b025o4jAZpHhihh8xPo99TNWUWWkGDQ==", + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.6.tgz", + "integrity": "sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw==", "dev": true, "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", - "es-abstract": "^1.19.5", - "get-intrinsic": "^1.1.1", + "es-abstract": "^1.20.4", + "get-intrinsic": "^1.1.3", "is-string": "^1.0.7" } }, @@ -9086,26 +9335,26 @@ "dev": true }, "array.prototype.flat": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.0.tgz", - "integrity": "sha512-12IUEkHsAhA4DY5s0FPgNXIdc8VRSqD9Zp78a5au9abH/SOBrsp082JOWFNTjkMozh8mqcdiKuaLGhPeYztxSw==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz", + "integrity": "sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==", "dev": true, "requires": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", "es-shim-unscopables": "^1.0.0" } }, "array.prototype.flatmap": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.0.tgz", - "integrity": "sha512-PZC9/8TKAIxcWKdyeb77EzULHPrIX/tIZebLJUQOMR1OwYosT8yggdfWScfTBCDj5utONvOuPQQumYsU2ULbkg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz", + "integrity": "sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ==", "dev": true, "requires": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", "es-shim-unscopables": "^1.0.0" } }, @@ -9718,34 +9967,45 @@ } }, "es-abstract": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.1.tgz", - "integrity": "sha512-WEm2oBhfoI2sImeM4OF2zE2V3BYdSF+KnSi9Sidz51fQHd7+JuF8Xgcj9/0o+OWeIeIS/MiuNnlruQrJf16GQA==", + "version": "1.21.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.21.2.tgz", + "integrity": "sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg==", "dev": true, "requires": { + "array-buffer-byte-length": "^1.0.0", + "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", + "es-set-tostringtag": "^2.0.1", "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", "function.prototype.name": "^1.1.5", - "get-intrinsic": "^1.1.1", + "get-intrinsic": "^1.2.0", "get-symbol-description": "^1.0.0", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", "has": "^1.0.3", "has-property-descriptors": "^1.0.0", + "has-proto": "^1.0.1", "has-symbols": "^1.0.3", - "internal-slot": "^1.0.3", - "is-callable": "^1.2.4", + "internal-slot": "^1.0.5", + "is-array-buffer": "^3.0.2", + "is-callable": "^1.2.7", "is-negative-zero": "^2.0.2", "is-regex": "^1.1.4", "is-shared-array-buffer": "^1.0.2", "is-string": "^1.0.7", + "is-typed-array": "^1.1.10", "is-weakref": "^1.0.2", - "object-inspect": "^1.12.0", + "object-inspect": "^1.12.3", "object-keys": "^1.1.1", - "object.assign": "^4.1.2", + "object.assign": "^4.1.4", "regexp.prototype.flags": "^1.4.3", - "string.prototype.trimend": "^1.0.5", - "string.prototype.trimstart": "^1.0.5", - "unbox-primitive": "^1.0.2" + "safe-regex-test": "^1.0.0", + "string.prototype.trim": "^1.2.7", + "string.prototype.trimend": "^1.0.6", + "string.prototype.trimstart": "^1.0.6", + "typed-array-length": "^1.0.4", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.9" } }, "es-module-lexer": { @@ -9755,6 +10015,17 @@ "dev": true, "peer": true }, + "es-set-tostringtag": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", + "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.3", + "has": "^1.0.3", + "has-tostringtag": "^1.0.0" + } + }, "es-shim-unscopables": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", @@ -9899,14 +10170,22 @@ } } }, + "eslint-config-prettier": { + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.8.0.tgz", + "integrity": "sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA==", + "dev": true, + "requires": {} + }, "eslint-import-resolver-node": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz", - "integrity": "sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==", + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.7.tgz", + "integrity": "sha512-gozW2blMLJCeFpBwugLTGyvVjNoeo1knonXAcatC6bjPBZitotxdWf7Gimr25N4c0AAOo4eOUfaG82IJPDpqCA==", "dev": true, "requires": { "debug": "^3.2.7", - "resolve": "^1.20.0" + "is-core-module": "^2.11.0", + "resolve": "^1.22.1" }, "dependencies": { "debug": { @@ -9921,13 +10200,12 @@ } }, "eslint-module-utils": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz", - "integrity": "sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", + "integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==", "dev": true, "requires": { - "debug": "^3.2.7", - "find-up": "^2.1.0" + "debug": "^3.2.7" }, "dependencies": { "debug": { @@ -9942,33 +10220,35 @@ } }, "eslint-plugin-import": { - "version": "2.26.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz", - "integrity": "sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==", + "version": "2.27.5", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.27.5.tgz", + "integrity": "sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==", "dev": true, "requires": { - "array-includes": "^3.1.4", - "array.prototype.flat": "^1.2.5", - "debug": "^2.6.9", + "array-includes": "^3.1.6", + "array.prototype.flat": "^1.3.1", + "array.prototype.flatmap": "^1.3.1", + "debug": "^3.2.7", "doctrine": "^2.1.0", - "eslint-import-resolver-node": "^0.3.6", - "eslint-module-utils": "^2.7.3", + "eslint-import-resolver-node": "^0.3.7", + "eslint-module-utils": "^2.7.4", "has": "^1.0.3", - "is-core-module": "^2.8.1", + "is-core-module": "^2.11.0", "is-glob": "^4.0.3", "minimatch": "^3.1.2", - "object.values": "^1.1.5", - "resolve": "^1.22.0", + "object.values": "^1.1.6", + "resolve": "^1.22.1", + "semver": "^6.3.0", "tsconfig-paths": "^3.14.1" }, "dependencies": { "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } }, "doctrine": { @@ -9979,23 +10259,6 @@ "requires": { "esutils": "^2.0.2" } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "resolve": { - "version": "1.22.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", - "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", - "dev": true, - "requires": { - "is-core-module": "^2.8.1", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - } } } }, @@ -10019,6 +10282,15 @@ "minimatch": "^3.0.4" } }, + "eslint-plugin-prettier": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", + "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==", + "dev": true, + "requires": { + "prettier-linter-helpers": "^1.0.0" + } + }, "eslint-plugin-react": { "version": "7.30.0", "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.30.0.tgz", @@ -10233,6 +10505,12 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, + "fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "dev": true + }, "fast-glob": { "version": "3.2.11", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", @@ -10297,15 +10575,6 @@ "to-regex-range": "^5.0.1" } }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, "flat-cache": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", @@ -10449,6 +10718,15 @@ "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true }, + "globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3" + } + }, "globby": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", @@ -10479,6 +10757,12 @@ "dev": true, "peer": true }, + "grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "dev": true + }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -10509,6 +10793,12 @@ "get-intrinsic": "^1.1.1" } }, + "has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "dev": true + }, "has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", @@ -10609,12 +10899,12 @@ "dev": true }, "internal-slot": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", - "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", + "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", "dev": true, "requires": { - "get-intrinsic": "^1.1.0", + "get-intrinsic": "^1.2.0", "has": "^1.0.3", "side-channel": "^1.0.4" } @@ -10645,6 +10935,17 @@ "has-tostringtag": "^1.0.0" } }, + "is-array-buffer": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", + "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.0", + "is-typed-array": "^1.1.10" + } + }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -10680,15 +10981,15 @@ } }, "is-callable": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", - "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true }, "is-core-module": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", - "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz", + "integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==", "dev": true, "requires": { "has": "^1.0.3" @@ -10974,16 +11275,6 @@ "dev": true, "peer": true }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, "lodash.debounce": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", @@ -11588,9 +11879,9 @@ } }, "minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true }, "mri": { @@ -11617,6 +11908,12 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, + "natural-compare-lite": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", + "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", + "dev": true + }, "neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", @@ -11675,9 +11972,9 @@ "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" }, "object-inspect": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", - "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", "dev": true }, "object-keys": { @@ -11687,14 +11984,14 @@ "dev": true }, "object.assign": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", - "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", + "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", "dev": true, "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "has-symbols": "^1.0.1", + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "has-symbols": "^1.0.3", "object-keys": "^1.1.1" } }, @@ -11731,14 +12028,14 @@ } }, "object.values": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.5.tgz", - "integrity": "sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.6.tgz", + "integrity": "sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw==", "dev": true, "requires": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1" + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" } }, "once": { @@ -11773,32 +12070,6 @@ "word-wrap": "^1.2.3" } }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - }, - "dependencies": { - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - } - } - }, "parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -11836,12 +12107,6 @@ "lines-and-columns": "^1.1.6" } }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -11911,6 +12176,15 @@ "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", "dev": true }, + "prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "requires": { + "fast-diff": "^1.1.2" + } + }, "prism-react-renderer": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/prism-react-renderer/-/prism-react-renderer-1.3.3.tgz", @@ -12100,13 +12374,14 @@ "dev": true }, "resolve": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", - "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", + "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", "dev": true, "requires": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" + "is-core-module": "^2.11.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" } }, "resolve-from": { @@ -12154,6 +12429,17 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, + "safe-regex-test": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", + "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "is-regex": "^1.1.4" + } + }, "sass": { "version": "1.52.1", "resolved": "https://registry.npmjs.org/sass/-/sass-1.52.1.tgz", @@ -12349,26 +12635,37 @@ "side-channel": "^1.0.4" } }, + "string.prototype.trim": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz", + "integrity": "sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + } + }, "string.prototype.trimend": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz", - "integrity": "sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", + "integrity": "sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==", "dev": true, "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", - "es-abstract": "^1.19.5" + "es-abstract": "^1.20.4" } }, "string.prototype.trimstart": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz", - "integrity": "sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz", + "integrity": "sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==", "dev": true, "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", - "es-abstract": "^1.19.5" + "es-abstract": "^1.20.4" } }, "stringify-entities": { @@ -12393,7 +12690,7 @@ "strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true }, "strip-json-comments": { @@ -12558,13 +12855,13 @@ "dev": true }, "tsconfig-paths": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", - "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz", + "integrity": "sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==", "dev": true, "requires": { "@types/json5": "^0.0.29", - "json5": "^1.0.1", + "json5": "^1.0.2", "minimist": "^1.2.6", "strip-bom": "^3.0.0" }, @@ -12581,10 +12878,9 @@ } }, "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.2.tgz", + "integrity": "sha512-5svOrSA2w3iGFDs1HibEVBGbDrAY82bFQ3HZ3ixB+88nsbsWQoKqDRb5UBYAUPEzbBn6dAp5gRNXglySbx1MlA==" }, "tsutils": { "version": "3.21.0", @@ -12593,6 +12889,14 @@ "dev": true, "requires": { "tslib": "^1.8.1" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + } } }, "type-check": { @@ -12604,10 +12908,21 @@ "prelude-ls": "^1.2.1" } }, + "typed-array-length": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", + "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "is-typed-array": "^1.1.9" + } + }, "typescript": { - "version": "4.7.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.2.tgz", - "integrity": "sha512-Mamb1iX2FDUpcTRzltPxgWMKy3fhg0TN378ylbktPGPK/99KbDtMQ4W1hwgsbPAsG3a0xKa1vmw4VKZQbkvz5A==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", + "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", "dev": true }, "unbox-primitive": { diff --git a/package.json b/package.json index 1373a5d..a45eb8a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@macpaw/macpaw-ui", - "version": "4.10.6", + "version": "4.11.0", "main": "lib/ui.js", "scripts": { "dev": "next -p 1234", @@ -35,8 +35,9 @@ }, "devDependencies": { "@babel/runtime": "^7.18.3", - "@macpaw/eslint-config-react": "^2.0.1", - "@macpaw/eslint-config-typescript": "^2.0.1", + "@macpaw/eslint-config-react": "^3.1.0", + "@macpaw/eslint-config-typescript": "^3.1.0", + "@macpaw/eslint-config-prettier": "^1.1.0", "@mdx-js/loader": "^2.1.1", "@mdx-js/react": "^2.3.0", "@next/mdx": "^12.1.6", @@ -54,7 +55,7 @@ "react": "^18.1.0", "react-dom": "^18.1.0", "sass": "^1.52.1", - "typescript": "^4.7.2" + "typescript": "^5.0.4" }, "files": [ "src", diff --git a/pages/tooltip.mdx b/pages/tooltip.mdx index 787567e..f106727 100644 --- a/pages/tooltip.mdx +++ b/pages/tooltip.mdx @@ -77,7 +77,7 @@ import { Tooltip, Button, Grid, GridRow, GridCell } from '../src/ui'; ## Tooltip with max width - ``` - ``` - { - { - + ); }; @@ -162,7 +162,7 @@ const tooltipBehaviorTitle = isVisible ? 'always visible' : 'normal' - { const [isHidden, setIsHidden] = useState(false); @@ -188,7 +188,7 @@ export const HiddenTooltip = () => { - { - + ); }; @@ -212,7 +212,7 @@ const tooltipBehaviorTitle = isHidden ? 'always hidden' : 'normal'; - { - { - + ); }; @@ -263,7 +263,7 @@ const tooltipBehaviorTitle = isVisible ? 'always visible' : 'always hidden'; -> = (props) => { const onToggle = (key: string | null) => { setActiveKey(key); - if (onChange) { - onChange(key); - } + if (onChange) onChange(key); }; return {children}; diff --git a/src/Accordion/AccordionCollapsible.tsx b/src/Accordion/AccordionCollapsible.tsx index ae038b3..1a4ada8 100644 --- a/src/Accordion/AccordionCollapsible.tsx +++ b/src/Accordion/AccordionCollapsible.tsx @@ -6,11 +6,13 @@ export interface AccordionCollapsible extends HTMLAttributes { sectionKey: string; } +const TIMEOUT = 20; + const AccordionCollapsible: React.FC> = (props) => { const timeout = 300; const { sectionKey, children, ...other } = props; const [isExpanded, setIsExpanded] = useState(false); - const nodeRef = useRef(null); + const nodeRef = useRef(null as unknown as HTMLDivElement); const { activeKey } = useContext(AccordionContext); useEffect(() => { @@ -25,46 +27,40 @@ const AccordionCollapsible: React.FC { if (nodeRef.current) { nodeRef.current.style.height = `${0}px`; nodeRef.current.style.visibility = 'visible'; } - } + }; - function onEntering() { - if (nodeRef.current) { - nodeRef.current.style.height = `${nodeRef.current.scrollHeight}px`; - } - } + const onEntering = () => { + if (nodeRef.current) nodeRef.current.style.height = `${nodeRef.current.scrollHeight}px`; + }; - function onEntered() { + const onEntered = () => { if (nodeRef.current) { nodeRef.current.style.height = 'auto'; nodeRef.current.style.overflow = 'visible'; } - } + }; - function onExit() { + const onExit = () => { if (nodeRef.current) { nodeRef.current.style.overflow = 'hidden'; nodeRef.current.style.height = `${nodeRef.current.clientHeight}px`; } - } + }; - function onExiting() { + const onExiting = () => { setTimeout(() => { - if (nodeRef.current) { - nodeRef.current.style.height = `${0}px`; - } - }, 20); - } + if (nodeRef.current) nodeRef.current.style.height = `${0}px`; + }, TIMEOUT); + }; - function onExited() { - if (nodeRef.current) { - nodeRef.current.style.visibility = 'hidden'; - } - } + const onExited = () => { + if (nodeRef.current) nodeRef.current.style.visibility = 'hidden'; + }; return ( > = (p const { activeKey, onToggle } = useContext(AccordionContext); const onTrigger = (event: React.SyntheticEvent) => { onToggle(sectionKey === activeKey ? null : sectionKey); - if (onClick) { - onClick(event); - } + if (onClick) onClick(event); }; return ( @@ -22,9 +20,7 @@ const AccordionTrigger: React.FC> = (p tabIndex={0} onClick={onTrigger} onKeyPress={(event: React.KeyboardEvent) => { - if (event.which === 13) { - onTrigger(event); - } + if (event.key === 'Enter') onTrigger(event); }} {...other} > diff --git a/src/Banner/Banner.tsx b/src/Banner/Banner.tsx index c7ef596..2799476 100644 --- a/src/Banner/Banner.tsx +++ b/src/Banner/Banner.tsx @@ -8,14 +8,7 @@ export interface BannerProps extends HTMLAttributes { } const Banner: FC> = (props) => { - const { - className, - children, - type, - icon, - action, - ...other - } = props; + const { className, children, type, icon, action, ...other } = props; const classNames = cx('banner', className, { '-secondary': type === 'secondary', diff --git a/src/Breadcrumbs/Breadcrumbs.tsx b/src/Breadcrumbs/Breadcrumbs.tsx index ef2cef0..303bc8a 100644 --- a/src/Breadcrumbs/Breadcrumbs.tsx +++ b/src/Breadcrumbs/Breadcrumbs.tsx @@ -1,8 +1,7 @@ import React, { FC, HTMLAttributes } from 'react'; import cx from 'clsx'; -export interface BreadcrumbsProps extends HTMLAttributes { -} +export interface BreadcrumbsProps extends HTMLAttributes {} const Breadcrumbs: FC> = (props) => { const { className, children, ...other } = props; diff --git a/src/Button/Button.tsx b/src/Button/Button.tsx index deff94b..d1c9879 100644 --- a/src/Button/Button.tsx +++ b/src/Button/Button.tsx @@ -48,13 +48,11 @@ const Button = forwardRef((props, ref) => { '-icon': icon, }); - const componentProps: any = {}; + const componentProps: ObjectLiteral = {}; let Component = component as ElementType; - if (Component === 'button' && other.href) { - Component = 'a'; - } + if (Component === 'button' && other.href) Component = 'a'; if (Component === 'button') { componentProps.type = type; diff --git a/src/Clipboard/Clipboard.tsx b/src/Clipboard/Clipboard.tsx index 2e1e9ae..358e113 100644 --- a/src/Clipboard/Clipboard.tsx +++ b/src/Clipboard/Clipboard.tsx @@ -9,29 +9,44 @@ interface ClipboardProps { onCopyEvent?: (value: InputValueType) => void; } +const TIMEOUT = 1600; + const Clipboard: React.FC = ({ copy, element, onCopyEvent }) => { const [canBeCopied, setCanBeCopied] = useState(true); const timerRef = useRef(); useEffect(() => { - if (!canBeCopied) timerRef.current = setTimeout(() => setCanBeCopied(true), 1600); + if (!canBeCopied) timerRef.current = setTimeout(() => setCanBeCopied(true), TIMEOUT); return () => clearTimeout(timerRef.current as NodeJS.Timeout); }, [canBeCopied]); const iconHandler = () => { if (element.current?.value) { - onCopyEvent?.(element.current?.value); - navigator.clipboard.writeText(element.current?.value); + onCopyEvent?.(element.current?.value as string); + navigator.clipboard.writeText(element.current?.value as string); setCanBeCopied(false); } }; - const CopyButton = () => ; - - const CopyIcon = () => (copy ? : ); - - return
{canBeCopied ? : }
; + const CopyButton = () => ( + + ); + + const CopyIcon = () => + copy ? ( + + + + ) : ( + + ); + + return ( +
{canBeCopied ? : }
+ ); }; export default Clipboard; diff --git a/src/DatePicker/DatePicker.tsx b/src/DatePicker/DatePicker.tsx index 0e58183..d3da00c 100644 --- a/src/DatePicker/DatePicker.tsx +++ b/src/DatePicker/DatePicker.tsx @@ -19,6 +19,8 @@ const BOTTOM_OFFSET = 320; export type PossibleDateType = Date | Date[] | DateRange | undefined; +export type DaySelectionMode = 'single' | 'multiple' | 'range' | 'default'; + interface NavigationSelectableProps { captionLayout: 'dropdown' | 'buttons'; } @@ -29,7 +31,7 @@ interface NavigationDisabledProps { export type NavigationProps = NavigationSelectableProps | NavigationDisabledProps; -export interface DatePickerCommonProps extends Omit, 'onChange' | 'value'> { +export interface DatePickerCommonProps extends Omit, 'onChange' | 'value'> { value?: PossibleDateType; error?: InputError; className?: string; @@ -62,166 +64,175 @@ export interface DatePickerRangeMultipleProps extends DatePickerCommonProps { } export interface DatePickerRangeRangeProps extends DatePickerCommonProps { - selectionMode: 'range'; + selectionMode: 'range'; onChange?: (date: DateRange | undefined) => void; formatter?: (date: DateRange[]) => string; } -export type DatePickerProps = DatePickerRangeSingleProps | DatePickerRangeMultipleProps | DatePickerRangeRangeProps - -const DatePicker = forwardRef(({ - label, - placeholder = '', - value: initialValue, - error: externalError, - disabled, - scale, - className, - calendarClassName, - closeOnSelect = true, - openSite = 'auto', - dateFormat = 'P', - formatter, - defaultMonth, - fromYear, - toYear, - fromDate, - toDate, - selectionMode = 'single', - navigation, - onChange, - ...restProps -}, ref) => { - const [value, setValue] = useState(initialValue); - const [isOpenOnTop, setIsOpenOnTop] = useState(openSite === 'top'); - const [isActive, setIsActive] = useState(false); - const [error, setError] = useState(''); - const wrapperRef = useRef(null); - - const errorMessage = error || externalError; - - const wrapperClassNames = cx('date-picker', className); - const calendarClassNames = cx('calendar', calendarClassName, { - 'site-top': isOpenOnTop && openSite !== 'center', - 'site-bottom': !isOpenOnTop && openSite !== 'center', - 'site-center': openSite === 'center', - }); - - const navigationProps: NavigationProps | null = useMemo(() => { - switch (navigation) { - case 'disabled': - return { disableNavigation: true }; - case 'dropdown': - return { captionLayout: 'dropdown' }; - case 'pagination': - return { captionLayout: 'buttons' }; - default: - return null; - } - }, [navigation]); - - const formattedValue = useMemo(() => { - if (!value) return ''; - - if (formatter) return formatter(value as any); - - try { - if (value instanceof Date) return format(value, dateFormat); - if (Array.isArray(value)) return value.map((dateItem) => format(dateItem, dateFormat)); - if (typeof value === 'object') { - const formattedFrom = value.from ? format(value.from, dateFormat) : ''; - const formattedTo = value.to ? format(value.to, dateFormat) : ''; - - if (!formattedFrom && formattedTo) return ''; - - return `${formattedFrom} - ${formattedTo}`; +export type DatePickerProps = DatePickerRangeSingleProps | DatePickerRangeMultipleProps | DatePickerRangeRangeProps; + +const DatePicker = forwardRef( + ( + { + label, + placeholder = '', + value: initialValue, + error: externalError, + disabled, + scale, + className, + calendarClassName, + closeOnSelect = true, + openSite = 'auto', + dateFormat = 'P', + formatter, + defaultMonth, + fromYear, + toYear, + fromDate, + toDate, + selectionMode = 'single', + navigation, + onChange, + ...restProps + }, + ref, + ) => { + const [value, setValue] = useState(initialValue); + const [isOpenOnTop, setIsOpenOnTop] = useState(openSite === 'top'); + const [isActive, setIsActive] = useState(false); + const [error, setError] = useState(''); + const wrapperRef = useRef(null as unknown as HTMLDivElement); + + const errorMessage = error || externalError; + + const wrapperClassNames = cx('date-picker', className); + const calendarClassNames = cx('calendar', calendarClassName, { + 'site-top': isOpenOnTop && openSite !== 'center', + 'site-bottom': !isOpenOnTop && openSite !== 'center', + 'site-center': openSite === 'center', + }); + + const navigationProps: NavigationProps | null = useMemo(() => { + switch (navigation) { + case 'disabled': + return { disableNavigation: true }; + case 'dropdown': + return { captionLayout: 'dropdown' }; + case 'pagination': + return { captionLayout: 'buttons' }; + default: + return null; } + }, [navigation]); - return ''; - } catch (error) { - setError((error as Error)?.message ?? 'Formatting error.'); - - return ''; - } - }, [value, placeholder, formatter]); + // eslint-disable-next-line complexity + const formattedValue = useMemo(() => { + if (!value) return ''; - const calculateOpenSite = (e: ReactMouseEvent): void => { - if (openSite !== 'auto') return; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + if (formatter) return formatter(value as any); - setIsOpenOnTop(window.innerHeight - e.clientY <= BOTTOM_OFFSET); - }; + try { + if (value instanceof Date) return format(value, dateFormat as string); + if (Array.isArray(value)) return value.map((dateItem) => format(dateItem, dateFormat as string)); + if (typeof value === 'object') { + const formattedFrom = value.from ? format(value.from, dateFormat as string) : ''; + const formattedTo = value.to ? format(value.to, dateFormat as string) : ''; - const handleInputClick = (e: ReactMouseEvent) => { - calculateOpenSite(e); - setIsActive((prevIsActive) => !prevIsActive); - }; + if (!formattedFrom && formattedTo) return ''; - const handleClose = () => { - setIsActive(false); - }; + return `${formattedFrom} - ${formattedTo}`; + } - const handleSelectDate = (date: PossibleDateType) => { - setValue(date); + return ''; + } catch (currentError) { + setError((currentError as Error)?.message ?? 'Formatting error.'); - onChange?.(date as any); + return ''; + } + }, [value, placeholder, formatter]); - if (closeOnSelect) handleClose(); - }; + const calculateOpenSite = (e: ReactMouseEvent): void => { + if (openSite !== 'auto') return; - useEffect(() => { - const { current: wrapper } = wrapperRef; + setIsOpenOnTop(window.innerHeight - e.clientY <= BOTTOM_OFFSET); + }; - const listener = (event: MouseEvent | TouchEvent): void => { - if (!wrapper || wrapper.contains(event.target as Node)) return; + const handleInputClick = (e: ReactMouseEvent) => { + calculateOpenSite(e); + setIsActive((prevIsActive) => !prevIsActive); + }; - handleClose(); + const handleClose = () => { + setIsActive(false); }; - document.addEventListener('mousedown', listener); - document.addEventListener('touchstart', listener); + const handleSelectDate = (date: PossibleDateType) => { + setValue(date); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + onChange?.(date as any); - return (): void => { - document.removeEventListener('mousedown', listener); - document.removeEventListener('touchstart', listener); + if (closeOnSelect) handleClose(); }; - }, []); - - useEffect(() => { - setValue(initialValue); - }, [initialValue]); - - return ( -
- {}} - onClick={handleInputClick} - ref={ref} - {...restProps} - /> - {isActive && ( - { + const { current: wrapper } = wrapperRef; + + const listener = (event: MouseEvent | TouchEvent): void => { + if (!wrapper || wrapper.contains(event.target as Node)) return; + + handleClose(); + }; + + document.addEventListener('mousedown', listener); + document.addEventListener('touchstart', listener); + + return (): void => { + document.removeEventListener('mousedown', listener); + document.removeEventListener('touchstart', listener); + }; + }, []); + + useEffect(() => { + setValue(initialValue); + }, [initialValue]); + + return ( +
+ {}} + onClick={handleInputClick} + ref={ref} + {...restProps} /> - )} -
- ); -}); + {isActive && ( + + )} +
+ ); + }, +); export default DatePicker; diff --git a/src/Dialog/Dialog.tsx b/src/Dialog/Dialog.tsx index 5f1ba0d..88c06d4 100644 --- a/src/Dialog/Dialog.tsx +++ b/src/Dialog/Dialog.tsx @@ -24,24 +24,18 @@ const Dialog: FC> = (props) => { const dialogClassName = cx('dialog', className); - function keyListener(event: KeyboardEvent) { - if (event.keyCode === 27) { - onRequestClose(); - } - } + const keyListener = (event: KeyboardEvent) => { + if (event.key === 'Escape') onRequestClose(); + }; - function overlayClickListener() { - if (!shouldCloseOnOverlayClick) { - return; - } + const overlayClickListener = () => { + if (!shouldCloseOnOverlayClick) return; onRequestClose(); - } + }; useEffect(() => { - if (shouldCloseOnEsc) { - document.addEventListener('keydown', keyListener); - } + if (shouldCloseOnEsc) document.addEventListener('keydown', keyListener); return () => { document.removeEventListener('keydown', keyListener); diff --git a/src/DialogActions/DialogActions.tsx b/src/DialogActions/DialogActions.tsx index 6eeae7f..b1ed2df 100644 --- a/src/DialogActions/DialogActions.tsx +++ b/src/DialogActions/DialogActions.tsx @@ -1,8 +1,7 @@ import React, { FC, HTMLAttributes } from 'react'; import cx from 'clsx'; -export interface DialogActionsProps extends HTMLAttributes { -} +export interface DialogActionsProps extends HTMLAttributes {} const DialogActions: FC> = (props) => { const { className, children, ...other } = props; diff --git a/src/DialogContent/DialogContent.tsx b/src/DialogContent/DialogContent.tsx index 998ac8d..b75e585 100644 --- a/src/DialogContent/DialogContent.tsx +++ b/src/DialogContent/DialogContent.tsx @@ -1,8 +1,7 @@ import React, { FC, HTMLAttributes } from 'react'; import cx from 'clsx'; -export interface DialogContentProps extends HTMLAttributes { -} +export interface DialogContentProps extends HTMLAttributes {} const DialogContent: FC> = (props) => { const { children, className, ...other } = props; diff --git a/src/DialogIcon/DialogIcon.tsx b/src/DialogIcon/DialogIcon.tsx index 961f62f..4621764 100644 --- a/src/DialogIcon/DialogIcon.tsx +++ b/src/DialogIcon/DialogIcon.tsx @@ -2,8 +2,7 @@ import React, { FC, HTMLAttributes } from 'react'; import cx from 'clsx'; import DialogIconBackdrop from './DialogIconBackdrop'; -export interface DialogIconProps extends HTMLAttributes { -} +export interface DialogIconProps extends HTMLAttributes {} const DialogIcon: FC> = (props) => { const { className, children, ...other } = props; diff --git a/src/DialogIcon/DialogIconBackdrop.js b/src/DialogIcon/DialogIconBackdrop.js index 852c833..1e99802 100644 --- a/src/DialogIcon/DialogIconBackdrop.js +++ b/src/DialogIcon/DialogIconBackdrop.js @@ -27,7 +27,12 @@ const DialogIconBackdrop = ({ className }) => ( - + > = (props) => { const { className, children, trigger, position, onOpen, onClose, ...other } = props; const [isOpen, setIsOpen] = useState(false); - const rootRef = useRef(null); - const menuRef = useRef(null); + const rootRef = useRef(null as unknown as HTMLDivElement); + const menuRef = useRef(null as unknown as HTMLDivElement); const triggerClone = React.cloneElement(trigger, { onClick: () => { setIsOpen(!isOpen); @@ -39,6 +39,7 @@ const DropDown: React.FC> = (props) => { const clickOnRoot = rootRef.current.contains(event.target as Node); const clickOnMenu = menuRef.current.contains(event.target as Node); // do not handle if click is on trigger + if (clickOnRoot && !clickOnMenu) return; if (clickOnRoot && clickOnMenu) { @@ -58,11 +59,8 @@ const DropDown: React.FC> = (props) => { }, []); useEffect(() => { - if (isOpen && onOpen) { - onOpen(); - } else if (onClose) { - onClose(); - } + if (isOpen && onOpen) onOpen(); + else if (onClose) onClose(); }, [isOpen, onClose, onOpen]); return ( diff --git a/src/DropdownItem/DropdownItem.tsx b/src/DropdownItem/DropdownItem.tsx index 6d3e28a..d1afa7c 100644 --- a/src/DropdownItem/DropdownItem.tsx +++ b/src/DropdownItem/DropdownItem.tsx @@ -1,5 +1,5 @@ -import cx from 'clsx'; import React, { ButtonHTMLAttributes, ElementType, ReactNode } from 'react'; +import cx from 'clsx'; export interface DropdownItem extends ButtonHTMLAttributes { component?: ReactNode; @@ -11,23 +11,13 @@ export interface DropdownItem extends ButtonHTMLAttributes { } const DropdownItem: React.FC> = (props) => { - const { - children, - component = 'button', - className, attention, - withoutAction, - separator, - ...other } = props; + const { children, component = 'button', className, attention, withoutAction, separator, ...other } = props; let Component = component as ElementType; - if (Component === 'button' && other?.href) { - Component = 'a'; - } + if (Component === 'button' && other?.href) Component = 'a'; - if (withoutAction || separator) { - Component = 'div'; - } + if (withoutAction || separator) Component = 'div'; const classNames = cx('dropdownItem', className, { '-attention': attention, diff --git a/src/ExternalLink/ExternalLink.tsx b/src/ExternalLink/ExternalLink.tsx index 93fcc23..239db1f 100644 --- a/src/ExternalLink/ExternalLink.tsx +++ b/src/ExternalLink/ExternalLink.tsx @@ -1,7 +1,6 @@ import React, { AnchorHTMLAttributes } from 'react'; -export interface ExternalLinkProps extends AnchorHTMLAttributes { -} +export interface ExternalLinkProps extends AnchorHTMLAttributes {} const ExternalLink: React.FC> = (props) => { const { children, ...other } = props; diff --git a/src/FormRow/FormRow.tsx b/src/FormRow/FormRow.tsx index 4941e4e..8cdceea 100644 --- a/src/FormRow/FormRow.tsx +++ b/src/FormRow/FormRow.tsx @@ -7,13 +7,7 @@ export interface FormRowProps extends HTMLAttributes { } const FormRow: FC> = (props) => { - const { - children, - asList, - split, - className, - ...other - } = props; + const { children, asList, split, className, ...other } = props; return (
diff --git a/src/Grid/Grid.tsx b/src/Grid/Grid.tsx index 4742663..cbb3c4b 100644 --- a/src/Grid/Grid.tsx +++ b/src/Grid/Grid.tsx @@ -1,5 +1,5 @@ import React, { ElementType, ReactNode } from 'react'; -import Panel, { PanelProps } from '../Panel/Panel'; +import Panel, { PanelProps } from '../Panel/Panel'; interface Grid extends PanelProps { icon?: ReactNode; @@ -9,26 +9,17 @@ interface Grid extends PanelProps { } const Grid: React.FC> = (props) => { - const { - icon, - action, - notification, - children, - className, - component, - ...other - } = props; + const { icon, action, notification, children, className, component, ...other } = props; let gridClassNames = 'grid'; + if (className) gridClassNames += ` ${className}`; - const Component = component ? component as ElementType : Panel; + const Component = component ? (component as ElementType) : Panel; return (
{icon &&
{icon}
} -
- {children} -
+
{children}
{action}
{notification &&
{notification}
} diff --git a/src/GridCell/GridCell.tsx b/src/GridCell/GridCell.tsx index 8bb0638..b010d53 100644 --- a/src/GridCell/GridCell.tsx +++ b/src/GridCell/GridCell.tsx @@ -8,9 +8,7 @@ const GridCell: React.FC> = (props) => { const { type, ...other } = props; const Component = other.children ? 'div' : 'span'; // component type is important for zebra style - return ( - - ); + return ; }; export default GridCell; diff --git a/src/GridRow/GridRow.tsx b/src/GridRow/GridRow.tsx index 6f633aa..a44b946 100644 --- a/src/GridRow/GridRow.tsx +++ b/src/GridRow/GridRow.tsx @@ -1,7 +1,5 @@ import React from 'react'; -const GridRow: React.FC> = (props) => ( -
-); +const GridRow: React.FC> = (props) =>
; export default GridRow; diff --git a/src/Hint/Hint.tsx b/src/Hint/Hint.tsx index 983f4c0..0b9225e 100644 --- a/src/Hint/Hint.tsx +++ b/src/Hint/Hint.tsx @@ -7,13 +7,7 @@ export interface HintProps extends HTMLAttributes { } const Hint: FC> = (props) => { - const { - large, - children, - error, - className, - ...other - } = props; + const { large, children, error, className, ...other } = props; const hintClassName = cx('hint', className, { '-large': large, diff --git a/src/Icons/jsx/AccountIcon.tsx b/src/Icons/jsx/AccountIcon.tsx index d32e519..00fec6b 100644 --- a/src/Icons/jsx/AccountIcon.tsx +++ b/src/Icons/jsx/AccountIcon.tsx @@ -1,20 +1,12 @@ import * as React from 'react'; -function SvgAccountIcon(props: React.SVGProps) { - return ( - - - - ); -} +const SvgAccountIcon = (props: React.SVGProps) => ( + + + +); export default SvgAccountIcon; diff --git a/src/Icons/jsx/BackIcon.tsx b/src/Icons/jsx/BackIcon.tsx index e911ef5..d5ead75 100644 --- a/src/Icons/jsx/BackIcon.tsx +++ b/src/Icons/jsx/BackIcon.tsx @@ -1,32 +1,30 @@ import * as React from 'react'; -function SvgBackIcon(props: React.SVGProps) { - return ( - - - - - - - - - - - - +const SvgBackIcon = (props: React.SVGProps) => ( + + + + + + + + + + + - - ); -} + + +); export default SvgBackIcon; diff --git a/src/Icons/jsx/BlockIcon.tsx b/src/Icons/jsx/BlockIcon.tsx index 53676a1..b531791 100644 --- a/src/Icons/jsx/BlockIcon.tsx +++ b/src/Icons/jsx/BlockIcon.tsx @@ -1,18 +1,10 @@ import * as React from 'react'; -function SvgBlockIcon(props: React.SVGProps) { - return ( - - - - - ); -} +const SvgBlockIcon = (props: React.SVGProps) => ( + + + + +); export default SvgBlockIcon; diff --git a/src/Icons/jsx/BusinessIcon.tsx b/src/Icons/jsx/BusinessIcon.tsx index 84441a0..9a163a2 100644 --- a/src/Icons/jsx/BusinessIcon.tsx +++ b/src/Icons/jsx/BusinessIcon.tsx @@ -1,21 +1,13 @@ import * as React from 'react'; -function SvgBusinessIcon(props: React.SVGProps) { - return ( - - - - ); -} +const SvgBusinessIcon = (props: React.SVGProps) => ( + + + +); export default SvgBusinessIcon; diff --git a/src/Icons/jsx/CancelIcon.tsx b/src/Icons/jsx/CancelIcon.tsx index f180671..ee2801a 100644 --- a/src/Icons/jsx/CancelIcon.tsx +++ b/src/Icons/jsx/CancelIcon.tsx @@ -1,37 +1,13 @@ import * as React from 'react'; -function SvgCancelIcon(props: React.SVGProps) { - return ( - - - - - - - - ); -} +const SvgCancelIcon = (props: React.SVGProps) => ( + + + + + + + +); export default SvgCancelIcon; diff --git a/src/Icons/jsx/CheckCircle.tsx b/src/Icons/jsx/CheckCircle.tsx index 209964b..7f851e4 100644 --- a/src/Icons/jsx/CheckCircle.tsx +++ b/src/Icons/jsx/CheckCircle.tsx @@ -1,17 +1,13 @@ import * as React from 'react'; -function SvgCheckCircle(props: React.SVGProps) { - return ( - - - - ); -} +const SvgCheckCircle = (props: React.SVGProps) => ( + + + +); export default SvgCheckCircle; diff --git a/src/Icons/jsx/CheckIcon.tsx b/src/Icons/jsx/CheckIcon.tsx index 624c40e..9fbcb91 100644 --- a/src/Icons/jsx/CheckIcon.tsx +++ b/src/Icons/jsx/CheckIcon.tsx @@ -1,34 +1,12 @@ import * as React from 'react'; -function SvgCheckIcon(props: React.SVGProps) { - return ( - - - - - - - ); -} +const SvgCheckIcon = (props: React.SVGProps) => ( + + + + + + +); export default SvgCheckIcon; diff --git a/src/Icons/jsx/CloseIcon.tsx b/src/Icons/jsx/CloseIcon.tsx index a4459e3..71791e0 100644 --- a/src/Icons/jsx/CloseIcon.tsx +++ b/src/Icons/jsx/CloseIcon.tsx @@ -1,37 +1,13 @@ import * as React from 'react'; -function SvgCloseIcon(props: React.SVGProps) { - return ( - - - - - - - - ); -} +const SvgCloseIcon = (props: React.SVGProps) => ( + + + + + + + +); export default SvgCloseIcon; diff --git a/src/Icons/jsx/CopyIcon.tsx b/src/Icons/jsx/CopyIcon.tsx index 4bedfdc..b62debb 100644 --- a/src/Icons/jsx/CopyIcon.tsx +++ b/src/Icons/jsx/CopyIcon.tsx @@ -1,20 +1,12 @@ import * as React from 'react'; -function SvgCopyIcon(props: React.SVGProps) { - return ( - - - - ); -} +const SvgCopyIcon = (props: React.SVGProps) => ( + + + +); export default SvgCopyIcon; diff --git a/src/Icons/jsx/DeviceActiveIcon.tsx b/src/Icons/jsx/DeviceActiveIcon.tsx index d9b1934..11ae92f 100644 --- a/src/Icons/jsx/DeviceActiveIcon.tsx +++ b/src/Icons/jsx/DeviceActiveIcon.tsx @@ -1,18 +1,10 @@ import * as React from 'react'; -function SvgDeviceActiveIcon(props: React.SVGProps) { - return ( - - - - - ); -} +const SvgDeviceActiveIcon = (props: React.SVGProps) => ( + + + + +); export default SvgDeviceActiveIcon; diff --git a/src/Icons/jsx/DeviceIcon.tsx b/src/Icons/jsx/DeviceIcon.tsx index 56187c0..66b88f6 100644 --- a/src/Icons/jsx/DeviceIcon.tsx +++ b/src/Icons/jsx/DeviceIcon.tsx @@ -1,18 +1,10 @@ import * as React from 'react'; -function SvgDeviceIcon(props: React.SVGProps) { - return ( - - - - - ); -} +const SvgDeviceIcon = (props: React.SVGProps) => ( + + + + +); export default SvgDeviceIcon; diff --git a/src/Icons/jsx/DownloadIcon.tsx b/src/Icons/jsx/DownloadIcon.tsx index c206a09..7ff5589 100644 --- a/src/Icons/jsx/DownloadIcon.tsx +++ b/src/Icons/jsx/DownloadIcon.tsx @@ -1,17 +1,9 @@ import * as React from 'react'; -function SvgDownloadIcon(props: React.SVGProps) { - return ( - - - - ); -} +const SvgDownloadIcon = (props: React.SVGProps) => ( + + + +); export default SvgDownloadIcon; diff --git a/src/Icons/jsx/DropdownIcon.tsx b/src/Icons/jsx/DropdownIcon.tsx index 85c0f52..ae81893 100644 --- a/src/Icons/jsx/DropdownIcon.tsx +++ b/src/Icons/jsx/DropdownIcon.tsx @@ -1,17 +1,9 @@ import * as React from 'react'; -function SvgDropdownIcon(props: React.SVGProps) { - return ( - - - - ); -} +const SvgDropdownIcon = (props: React.SVGProps) => ( + + + +); export default SvgDropdownIcon; diff --git a/src/Icons/jsx/ErrorIcon.tsx b/src/Icons/jsx/ErrorIcon.tsx index b284d52..9b04a06 100644 --- a/src/Icons/jsx/ErrorIcon.tsx +++ b/src/Icons/jsx/ErrorIcon.tsx @@ -1,32 +1,30 @@ import * as React from 'react'; -function SvgErrorIcon(props: React.SVGProps) { - return ( - - - - - - - - - - - - +const SvgErrorIcon = (props: React.SVGProps) => ( + + + + + + + + + + + - - ); -} + + +); export default SvgErrorIcon; diff --git a/src/Icons/jsx/ExternalIcon.tsx b/src/Icons/jsx/ExternalIcon.tsx index 7a3a52d..96e2e94 100644 --- a/src/Icons/jsx/ExternalIcon.tsx +++ b/src/Icons/jsx/ExternalIcon.tsx @@ -1,20 +1,12 @@ import * as React from 'react'; -function SvgExternalIcon(props: React.SVGProps) { - return ( - - - - ); -} +const SvgExternalIcon = (props: React.SVGProps) => ( + + + +); export default SvgExternalIcon; diff --git a/src/Icons/jsx/HelpIcon.tsx b/src/Icons/jsx/HelpIcon.tsx index 59944e9..2129127 100644 --- a/src/Icons/jsx/HelpIcon.tsx +++ b/src/Icons/jsx/HelpIcon.tsx @@ -1,34 +1,32 @@ import * as React from 'react'; -function SvgHelpIcon(props: React.SVGProps) { - return ( - - - - - - - - - - - - - +const SvgHelpIcon = (props: React.SVGProps) => ( + + + + + + + + + + + + - - ); -} + + +); export default SvgHelpIcon; diff --git a/src/Icons/jsx/InfoIcon.tsx b/src/Icons/jsx/InfoIcon.tsx index 0970385..9c7dbfd 100644 --- a/src/Icons/jsx/InfoIcon.tsx +++ b/src/Icons/jsx/InfoIcon.tsx @@ -1,34 +1,32 @@ import * as React from 'react'; -function SvgInfoIcon(props: React.SVGProps) { - return ( - - - - - - - - - - - - - +const SvgInfoIcon = (props: React.SVGProps) => ( + + + + + + + + + + + + - - ); -} + + +); export default SvgInfoIcon; diff --git a/src/Icons/jsx/LanguageDe.tsx b/src/Icons/jsx/LanguageDe.tsx index 48605e5..2056f5f 100644 --- a/src/Icons/jsx/LanguageDe.tsx +++ b/src/Icons/jsx/LanguageDe.tsx @@ -1,21 +1,13 @@ import * as React from 'react'; -function SvgLanguageDe(props: React.SVGProps) { - return ( - - - - - - - - ); -} +const SvgLanguageDe = (props: React.SVGProps) => ( + + + + + + + +); export default SvgLanguageDe; diff --git a/src/Icons/jsx/LanguageEn.tsx b/src/Icons/jsx/LanguageEn.tsx index cd950c9..8b58e2a 100644 --- a/src/Icons/jsx/LanguageEn.tsx +++ b/src/Icons/jsx/LanguageEn.tsx @@ -1,31 +1,23 @@ import * as React from 'react'; -function SvgLanguageEn(props: React.SVGProps) { - return ( - - - - - - - - - ); -} +const SvgLanguageEn = (props: React.SVGProps) => ( + + + + + + + + +); export default SvgLanguageEn; diff --git a/src/Icons/jsx/LanguageEs.tsx b/src/Icons/jsx/LanguageEs.tsx index 38db5d3..919265a 100644 --- a/src/Icons/jsx/LanguageEs.tsx +++ b/src/Icons/jsx/LanguageEs.tsx @@ -1,20 +1,12 @@ import * as React from 'react'; -function SvgLanguageEs(props: React.SVGProps) { - return ( - - - - - - - ); -} +const SvgLanguageEs = (props: React.SVGProps) => ( + + + + + + +); export default SvgLanguageEs; diff --git a/src/Icons/jsx/LanguageFr.tsx b/src/Icons/jsx/LanguageFr.tsx index f3c20a9..1cfa647 100644 --- a/src/Icons/jsx/LanguageFr.tsx +++ b/src/Icons/jsx/LanguageFr.tsx @@ -1,21 +1,13 @@ import * as React from 'react'; -function SvgLanguageFr(props: React.SVGProps) { - return ( - - - - - - - - ); -} +const SvgLanguageFr = (props: React.SVGProps) => ( + + + + + + + +); export default SvgLanguageFr; diff --git a/src/Icons/jsx/LanguageIt.tsx b/src/Icons/jsx/LanguageIt.tsx index 6f1dd96..0cb5612 100644 --- a/src/Icons/jsx/LanguageIt.tsx +++ b/src/Icons/jsx/LanguageIt.tsx @@ -1,21 +1,13 @@ import * as React from 'react'; -function SvgLanguageIt(props: React.SVGProps) { - return ( - - - - - - - - ); -} +const SvgLanguageIt = (props: React.SVGProps) => ( + + + + + + + +); export default SvgLanguageIt; diff --git a/src/Icons/jsx/LanguageJa.tsx b/src/Icons/jsx/LanguageJa.tsx index 9d1b8f7..f49a3c3 100644 --- a/src/Icons/jsx/LanguageJa.tsx +++ b/src/Icons/jsx/LanguageJa.tsx @@ -1,27 +1,12 @@ import * as React from 'react'; -function SvgLanguageJa(props: React.SVGProps) { - return ( - - - - - - - ); -} +const SvgLanguageJa = (props: React.SVGProps) => ( + + + + + + +); export default SvgLanguageJa; diff --git a/src/Icons/jsx/LanguageKo.tsx b/src/Icons/jsx/LanguageKo.tsx index 4c9c382..826efb3 100644 --- a/src/Icons/jsx/LanguageKo.tsx +++ b/src/Icons/jsx/LanguageKo.tsx @@ -1,75 +1,49 @@ import * as React from 'react'; -function SvgLanguageKo(props: React.SVGProps) { - return ( - - - - - - - - - - - - - - - - - - - - ); -} +const SvgLanguageKo = (props: React.SVGProps) => ( + + + + + + + + + + + + + + + + + + + +); export default SvgLanguageKo; diff --git a/src/Icons/jsx/LanguageNl.tsx b/src/Icons/jsx/LanguageNl.tsx index d03f006..8338872 100644 --- a/src/Icons/jsx/LanguageNl.tsx +++ b/src/Icons/jsx/LanguageNl.tsx @@ -1,21 +1,13 @@ import * as React from 'react'; -function SvgLanguageNl(props: React.SVGProps) { - return ( - - - - - - - - ); -} +const SvgLanguageNl = (props: React.SVGProps) => ( + + + + + + + +); export default SvgLanguageNl; diff --git a/src/Icons/jsx/LanguagePl.tsx b/src/Icons/jsx/LanguagePl.tsx index 6a4c216..1609b82 100644 --- a/src/Icons/jsx/LanguagePl.tsx +++ b/src/Icons/jsx/LanguagePl.tsx @@ -1,20 +1,12 @@ import * as React from 'react'; -function SvgLanguagePl(props: React.SVGProps) { - return ( - - - - - - - ); -} +const SvgLanguagePl = (props: React.SVGProps) => ( + + + + + + +); export default SvgLanguagePl; diff --git a/src/Icons/jsx/LanguagePt.tsx b/src/Icons/jsx/LanguagePt.tsx index b9fbd9e..a72a2f2 100644 --- a/src/Icons/jsx/LanguagePt.tsx +++ b/src/Icons/jsx/LanguagePt.tsx @@ -1,58 +1,47 @@ import * as React from 'react'; -function SvgLanguagePt(props: React.SVGProps) { - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ); -} +const SvgLanguagePt = (props: React.SVGProps) => ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +); export default SvgLanguagePt; diff --git a/src/Icons/jsx/LanguageTr.tsx b/src/Icons/jsx/LanguageTr.tsx index df7aef7..ba49edc 100644 --- a/src/Icons/jsx/LanguageTr.tsx +++ b/src/Icons/jsx/LanguageTr.tsx @@ -1,31 +1,23 @@ import * as React from 'react'; -function SvgLanguageTr(props: React.SVGProps) { - return ( - - - - - - - - - ); -} +const SvgLanguageTr = (props: React.SVGProps) => ( + + + + + + + + +); export default SvgLanguageTr; diff --git a/src/Icons/jsx/LanguageUk.tsx b/src/Icons/jsx/LanguageUk.tsx index ab2a16e..67f6a0c 100644 --- a/src/Icons/jsx/LanguageUk.tsx +++ b/src/Icons/jsx/LanguageUk.tsx @@ -1,20 +1,12 @@ import * as React from 'react'; -function SvgLanguageUk(props: React.SVGProps) { - return ( - - - - - - - ); -} +const SvgLanguageUk = (props: React.SVGProps) => ( + + + + + + +); export default SvgLanguageUk; diff --git a/src/Icons/jsx/LanguageZh.tsx b/src/Icons/jsx/LanguageZh.tsx index 961b5a3..a734c76 100644 --- a/src/Icons/jsx/LanguageZh.tsx +++ b/src/Icons/jsx/LanguageZh.tsx @@ -1,23 +1,15 @@ import * as React from 'react'; -function SvgLanguageZh(props: React.SVGProps) { - return ( - - - - - - - ); -} +const SvgLanguageZh = (props: React.SVGProps) => ( + + + + + + +); export default SvgLanguageZh; diff --git a/src/Icons/jsx/LightBulbIcon.tsx b/src/Icons/jsx/LightBulbIcon.tsx index 592b826..036f5fc 100644 --- a/src/Icons/jsx/LightBulbIcon.tsx +++ b/src/Icons/jsx/LightBulbIcon.tsx @@ -1,17 +1,9 @@ import * as React from 'react'; -function SvgLightBulbIcon(props: React.SVGProps) { - return ( - - - - ); -} +const SvgLightBulbIcon = (props: React.SVGProps) => ( + + + +); export default SvgLightBulbIcon; diff --git a/src/Icons/jsx/MacpawText.tsx b/src/Icons/jsx/MacpawText.tsx index 579337b..b2b12db 100644 --- a/src/Icons/jsx/MacpawText.tsx +++ b/src/Icons/jsx/MacpawText.tsx @@ -1,22 +1,32 @@ import * as React from 'react'; -function SvgMacpawText(props: React.SVGProps) { - return ( - - - - - - - - - ); -} +const SvgMacpawText = (props: React.SVGProps) => ( + + + + + + + + +); export default SvgMacpawText; diff --git a/src/Icons/jsx/MenuIcon.tsx b/src/Icons/jsx/MenuIcon.tsx index 5d1af05..795bf9f 100644 --- a/src/Icons/jsx/MenuIcon.tsx +++ b/src/Icons/jsx/MenuIcon.tsx @@ -1,32 +1,30 @@ import * as React from 'react'; -function SvgMenuIcon(props: React.SVGProps) { - return ( - - - - - - - - - - - - +const SvgMenuIcon = (props: React.SVGProps) => ( + + + + + + + + + + + - - ); -} + + +); export default SvgMenuIcon; diff --git a/src/Icons/jsx/MoreIcon.tsx b/src/Icons/jsx/MoreIcon.tsx index 9a42bed..4ba1d14 100644 --- a/src/Icons/jsx/MoreIcon.tsx +++ b/src/Icons/jsx/MoreIcon.tsx @@ -1,18 +1,10 @@ import * as React from 'react'; -function SvgMoreIcon(props: React.SVGProps) { - return ( - - - - - ); -} +const SvgMoreIcon = (props: React.SVGProps) => ( + + + + +); export default SvgMoreIcon; diff --git a/src/Icons/jsx/NotificationIcon.tsx b/src/Icons/jsx/NotificationIcon.tsx index 890f1f2..2530b37 100644 --- a/src/Icons/jsx/NotificationIcon.tsx +++ b/src/Icons/jsx/NotificationIcon.tsx @@ -1,18 +1,10 @@ import * as React from 'react'; -function SvgNotificationIcon(props: React.SVGProps) { - return ( - - - - - ); -} +const SvgNotificationIcon = (props: React.SVGProps) => ( + + + + +); export default SvgNotificationIcon; diff --git a/src/Icons/jsx/PauseIcon.tsx b/src/Icons/jsx/PauseIcon.tsx index 6422240..1438d72 100644 --- a/src/Icons/jsx/PauseIcon.tsx +++ b/src/Icons/jsx/PauseIcon.tsx @@ -1,20 +1,12 @@ import * as React from 'react'; -function SvgPauseIcon(props: React.SVGProps) { - return ( - - - - - - - ); -} +const SvgPauseIcon = (props: React.SVGProps) => ( + + + + + + +); export default SvgPauseIcon; diff --git a/src/Icons/jsx/PawIcon.tsx b/src/Icons/jsx/PawIcon.tsx index 5b6eb0b..4c02428 100644 --- a/src/Icons/jsx/PawIcon.tsx +++ b/src/Icons/jsx/PawIcon.tsx @@ -1,17 +1,12 @@ import * as React from 'react'; -function SvgPawIcon(props: React.SVGProps) { - return ( - - - - ); -} +const SvgPawIcon = (props: React.SVGProps) => ( + + + +); export default SvgPawIcon; diff --git a/src/Icons/jsx/PaymentAmex.tsx b/src/Icons/jsx/PaymentAmex.tsx index 1f846e8..2673b45 100644 --- a/src/Icons/jsx/PaymentAmex.tsx +++ b/src/Icons/jsx/PaymentAmex.tsx @@ -1,43 +1,22 @@ import * as React from 'react'; -function SvgPaymentAmex(props: React.SVGProps) { - return ( - - - - - - - - - - - - - ); -} +const SvgPaymentAmex = (props: React.SVGProps) => ( + + + + + + + + + + + + +); export default SvgPaymentAmex; diff --git a/src/Icons/jsx/PaymentCard.tsx b/src/Icons/jsx/PaymentCard.tsx index 96615fc..34c8aab 100644 --- a/src/Icons/jsx/PaymentCard.tsx +++ b/src/Icons/jsx/PaymentCard.tsx @@ -1,43 +1,23 @@ import * as React from 'react'; -function SvgPaymentCard(props: React.SVGProps) { - return ( - - - - - - - - - - - - - - - - - - ); -} +const SvgPaymentCard = (props: React.SVGProps) => ( + + + + + + + + + + + + + + + + + +); export default SvgPaymentCard; diff --git a/src/Icons/jsx/PaymentDinersClub.tsx b/src/Icons/jsx/PaymentDinersClub.tsx index 447942d..d1009f3 100644 --- a/src/Icons/jsx/PaymentDinersClub.tsx +++ b/src/Icons/jsx/PaymentDinersClub.tsx @@ -1,73 +1,46 @@ import * as React from 'react'; -function SvgPaymentDinersClub(props: React.SVGProps) { - return ( - - - - - - - - - - - ) => ( + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - ); -} + + +); export default SvgPaymentDinersClub; diff --git a/src/Icons/jsx/PaymentDiscover.tsx b/src/Icons/jsx/PaymentDiscover.tsx index 8fc892c..a7dbaf2 100644 --- a/src/Icons/jsx/PaymentDiscover.tsx +++ b/src/Icons/jsx/PaymentDiscover.tsx @@ -1,116 +1,66 @@ import * as React from 'react'; -function SvgPaymentDiscover(props: React.SVGProps) { - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +const SvgPaymentDiscover = (props: React.SVGProps) => ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - ); -} + + + +); export default SvgPaymentDiscover; diff --git a/src/Icons/jsx/PaymentJcb.tsx b/src/Icons/jsx/PaymentJcb.tsx index a3db90b..da12fc2 100644 --- a/src/Icons/jsx/PaymentJcb.tsx +++ b/src/Icons/jsx/PaymentJcb.tsx @@ -1,151 +1,94 @@ import * as React from 'react'; -function SvgPaymentJcb(props: React.SVGProps) { - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ) => ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - ); -} + + +); export default SvgPaymentJcb; diff --git a/src/Icons/jsx/PaymentMada.tsx b/src/Icons/jsx/PaymentMada.tsx index df471d9..98d367e 100644 --- a/src/Icons/jsx/PaymentMada.tsx +++ b/src/Icons/jsx/PaymentMada.tsx @@ -1,31 +1,55 @@ import * as React from 'react'; -function SvgPaymentMada(props: React.SVGProps) { - return ( - - - - - - - - - - - - - - - - - ); -} +const SvgPaymentMada = (props: React.SVGProps) => ( + + + + + + + + + + + + + + + + + +); export default SvgPaymentMada; diff --git a/src/Icons/jsx/PaymentMaestro.tsx b/src/Icons/jsx/PaymentMaestro.tsx index cecd119..c95362f 100644 --- a/src/Icons/jsx/PaymentMaestro.tsx +++ b/src/Icons/jsx/PaymentMaestro.tsx @@ -1,74 +1,47 @@ import * as React from 'react'; -function SvgPaymentMaestro(props: React.SVGProps) { - return ( - - - - - - - - - - - ) => ( + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - ); -} + + +); export default SvgPaymentMaestro; diff --git a/src/Icons/jsx/PaymentMaster.tsx b/src/Icons/jsx/PaymentMaster.tsx index fcb8552..b77e018 100644 --- a/src/Icons/jsx/PaymentMaster.tsx +++ b/src/Icons/jsx/PaymentMaster.tsx @@ -1,57 +1,36 @@ import * as React from 'react'; -function SvgPaymentMaster(props: React.SVGProps) { - return ( - - - - - - - - - - - - - - - - - ); -} +const SvgPaymentMaster = (props: React.SVGProps) => ( + + + + + + + + + + + + + + + + +); export default SvgPaymentMaster; diff --git a/src/Icons/jsx/PaymentPaypal.tsx b/src/Icons/jsx/PaymentPaypal.tsx index b9dbfe2..db4526f 100644 --- a/src/Icons/jsx/PaymentPaypal.tsx +++ b/src/Icons/jsx/PaymentPaypal.tsx @@ -1,101 +1,58 @@ import * as React from 'react'; -function SvgPaymentPaypal(props: React.SVGProps) { - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ); -} +const SvgPaymentPaypal = (props: React.SVGProps) => ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +); export default SvgPaymentPaypal; diff --git a/src/Icons/jsx/PaymentUnionPay.tsx b/src/Icons/jsx/PaymentUnionPay.tsx index 0428698..9fb2b77 100644 --- a/src/Icons/jsx/PaymentUnionPay.tsx +++ b/src/Icons/jsx/PaymentUnionPay.tsx @@ -1,110 +1,74 @@ import * as React from 'react'; -function SvgPaymentUnionPay(props: React.SVGProps) { - return ( - - - - - - - - - - - - - - - - - - +const SvgPaymentUnionPay = (props: React.SVGProps) => ( + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + - - - - - - ); -} + + +); export default SvgPaymentUnionPay; diff --git a/src/Icons/jsx/PaymentVisa.tsx b/src/Icons/jsx/PaymentVisa.tsx index 5442a00..0689cc1 100644 --- a/src/Icons/jsx/PaymentVisa.tsx +++ b/src/Icons/jsx/PaymentVisa.tsx @@ -1,42 +1,21 @@ import * as React from 'react'; -function SvgPaymentVisa(props: React.SVGProps) { - return ( - - - - - - - - - - - - - ); -} +const SvgPaymentVisa = (props: React.SVGProps) => ( + + + + + + + + + + + + +); export default SvgPaymentVisa; diff --git a/src/Icons/jsx/PlayIcon.tsx b/src/Icons/jsx/PlayIcon.tsx index 1c3dfdb..9d13e92 100644 --- a/src/Icons/jsx/PlayIcon.tsx +++ b/src/Icons/jsx/PlayIcon.tsx @@ -1,17 +1,9 @@ import * as React from 'react'; -function SvgPlayIcon(props: React.SVGProps) { - return ( - - - - ); -} +const SvgPlayIcon = (props: React.SVGProps) => ( + + + +); export default SvgPlayIcon; diff --git a/src/Icons/jsx/PlusIcon.tsx b/src/Icons/jsx/PlusIcon.tsx index 58acc73..109f979 100644 --- a/src/Icons/jsx/PlusIcon.tsx +++ b/src/Icons/jsx/PlusIcon.tsx @@ -1,23 +1,15 @@ import * as React from 'react'; -function SvgPlusIcon(props: React.SVGProps) { - return ( - - - - - - - ); -} +const SvgPlusIcon = (props: React.SVGProps) => ( + + + + + + +); export default SvgPlusIcon; diff --git a/src/Icons/jsx/Refresh.tsx b/src/Icons/jsx/Refresh.tsx index f37be97..3a42a8f 100644 --- a/src/Icons/jsx/Refresh.tsx +++ b/src/Icons/jsx/Refresh.tsx @@ -1,17 +1,9 @@ import * as React from 'react'; -function SvgRefresh(props: React.SVGProps) { - return ( - - - - ); -} +const SvgRefresh = (props: React.SVGProps) => ( + + + +); export default SvgRefresh; diff --git a/src/Icons/jsx/RefreshingIcon.tsx b/src/Icons/jsx/RefreshingIcon.tsx index cd1567b..b2fb316 100644 --- a/src/Icons/jsx/RefreshingIcon.tsx +++ b/src/Icons/jsx/RefreshingIcon.tsx @@ -1,33 +1,25 @@ import * as React from 'react'; -function SvgRefreshingIcon(props: React.SVGProps) { - return ( - - - - - - - - ); -} +const SvgRefreshingIcon = (props: React.SVGProps) => ( + + + + + + + +); export default SvgRefreshingIcon; diff --git a/src/Icons/jsx/SearchIcon.tsx b/src/Icons/jsx/SearchIcon.tsx index dd179a5..e4b2c71 100644 --- a/src/Icons/jsx/SearchIcon.tsx +++ b/src/Icons/jsx/SearchIcon.tsx @@ -1,32 +1,30 @@ import * as React from 'react'; -function SvgSearchIcon(props: React.SVGProps) { - return ( - - - - - - - - - - - - +const SvgSearchIcon = (props: React.SVGProps) => ( + + + + + + + + + + + - - ); -} + + +); export default SvgSearchIcon; diff --git a/src/Icons/jsx/SettingsIcon.tsx b/src/Icons/jsx/SettingsIcon.tsx index 25c01b6..f44da87 100644 --- a/src/Icons/jsx/SettingsIcon.tsx +++ b/src/Icons/jsx/SettingsIcon.tsx @@ -1,34 +1,32 @@ import * as React from 'react'; -function SvgSettingsIcon(props: React.SVGProps) { - return ( - - - - - - - - - - - - - +const SvgSettingsIcon = (props: React.SVGProps) => ( + + + + + + + + + + + + - - ); -} + + +); export default SvgSettingsIcon; diff --git a/src/Icons/jsx/StoreIcon.tsx b/src/Icons/jsx/StoreIcon.tsx index 4b90126..5d5e54d 100644 --- a/src/Icons/jsx/StoreIcon.tsx +++ b/src/Icons/jsx/StoreIcon.tsx @@ -1,32 +1,30 @@ import * as React from 'react'; -function SvgStoreIcon(props: React.SVGProps) { - return ( - - - - - - - - - - - - +const SvgStoreIcon = (props: React.SVGProps) => ( + + + + + + + + + + + - - ); -} + + +); export default SvgStoreIcon; diff --git a/src/Icons/jsx/UserIcon.tsx b/src/Icons/jsx/UserIcon.tsx index f0f8680..e9cb423 100644 --- a/src/Icons/jsx/UserIcon.tsx +++ b/src/Icons/jsx/UserIcon.tsx @@ -1,34 +1,32 @@ import * as React from 'react'; -function SvgUserIcon(props: React.SVGProps) { - return ( - - - - - - - - - - - - - +const SvgUserIcon = (props: React.SVGProps) => ( + + + + + + + + + + + + - - ); -} + + +); export default SvgUserIcon; diff --git a/src/Icons/jsx/WarningIcon.tsx b/src/Icons/jsx/WarningIcon.tsx index a73dd21..4221947 100644 --- a/src/Icons/jsx/WarningIcon.tsx +++ b/src/Icons/jsx/WarningIcon.tsx @@ -1,32 +1,30 @@ import * as React from 'react'; -function SvgWarningIcon(props: React.SVGProps) { - return ( - - - - - - - - - - - - +const SvgWarningIcon = (props: React.SVGProps) => ( + + + + + + + + + + + - - ); -} + + +); export default SvgWarningIcon; diff --git a/src/Input/Input.tsx b/src/Input/Input.tsx index 0167e1d..d8930d8 100644 --- a/src/Input/Input.tsx +++ b/src/Input/Input.tsx @@ -9,11 +9,10 @@ import React, { KeyboardEvent, } from 'react'; import cx from 'clsx'; -import Hint from '../Hint/Hint'; import Clipboard from '../Clipboard/Clipboard'; -import { Error as InputError, InputValueType } from '../types'; import { isAutofill } from '../helpers'; - +import Hint from '../Hint/Hint'; +import { Error as InputError, InputValueType } from '../types'; export interface InputProps extends Omit, 'onChange'> { scale?: 'medium' | 'small' | 'big'; @@ -26,13 +25,15 @@ export interface InputProps extends Omit, currency?: string; formatOnEvent?: 'blur' | 'input'; format?: (value: InputValueType) => InputValueType; - onChange?: (value:InputValueType, event?: React.ChangeEvent) => void; + onChange?: (value: InputValueType, event?: React.ChangeEvent) => void; onCopyEvent?: (value: InputValueType) => void; onAutofill?: () => void; clipboard?: boolean | string | React.ReactElement; } +const CURRENCY_MAX_LEAGTH = 3; +// eslint-disable-next-line complexity const Input = forwardRef((props, ref) => { const { type = 'text', @@ -65,9 +66,9 @@ const Input = forwardRef((props, ref) => { '-big': scale === 'big', }); - const Component = multiline ? 'textarea' : 'input' as ElementType; + const Component = multiline ? 'textarea' : ('input' as ElementType); const showHintError = error && typeof error !== 'boolean'; - const inputValue = !isDirtyRef.current ? (format?.(value ?? '') ?? value) : value; + const inputValue = !isDirtyRef.current ? format?.(value ?? '') ?? value : value; const inputClassNames = cx(className, { '-with-action': action, '-with-currency': currency, @@ -75,18 +76,14 @@ const Input = forwardRef((props, ref) => { '-with-clipboard': clipboard, }); - const componentProps: any = { + const componentProps: ObjectLiteral = { className: inputClassNames, ...(Component === 'input' && { type }), }; - if (currency && currency.length > 3) { - throw Error('currency characters must not exceed 3'); - } + if (currency && currency.length > CURRENCY_MAX_LEAGTH) throw Error('currency characters must not exceed 3'); - if (action && currency) { - throw Error('action and currency cannot be set at the same time'); - } + if (action && currency) throw Error('action and currency cannot be set at the same time'); const setRef = (element: HTMLInputElement) => { if (typeof ref === 'function') ref(element); @@ -98,16 +95,15 @@ const Input = forwardRef((props, ref) => { const handleChange = (event: React.ChangeEvent) => { if (!isDirtyRef.current) isDirtyRef.current = true; - const inputValue = (event.target as HTMLInputElement).value; - onChange?.(inputValue, event); + const currentInputValue = (event.target as HTMLInputElement).value; + + onChange?.(currentInputValue, event); }; const handleKeyUp = (event: KeyboardEvent) => { const isAutofillDetected = isAutofill(event); - if (isAutofillDetected) { - onAutofill?.(); - } + if (isAutofillDetected) onAutofill?.(); }; useEffect(() => { @@ -116,8 +112,9 @@ const Input = forwardRef((props, ref) => { if (!formatOnEvent || !input) return () => {}; const handleFormatOnEvent = (event: InputEvent | FocusEvent) => { - const inputValue = (event.target as HTMLInputElement).value; - onChange?.(format?.(inputValue) ?? inputValue); + const currentInputValue = (event.target as HTMLInputElement).value; + + onChange?.(format?.(currentInputValue) ?? currentInputValue); }; input.addEventListener(formatOnEvent, handleFormatOnEvent as EventListener); @@ -129,7 +126,12 @@ const Input = forwardRef((props, ref) => { return ( ); }); diff --git a/src/Label/Label.tsx b/src/Label/Label.tsx index b006fce..aea7d92 100644 --- a/src/Label/Label.tsx +++ b/src/Label/Label.tsx @@ -1,14 +1,15 @@ import React, { FC, HTMLAttributes } from 'react'; import cx from 'clsx'; -export interface LabelProps extends HTMLAttributes { -} +export interface LabelProps extends HTMLAttributes {} const Label: FC> = (props) => { const { className, children, ...other } = props; return ( -
{children}
+
+ {children} +
); }; diff --git a/src/LanguageIcon/LanguageIcon.tsx b/src/LanguageIcon/LanguageIcon.tsx index 745260d..c87320a 100644 --- a/src/LanguageIcon/LanguageIcon.tsx +++ b/src/LanguageIcon/LanguageIcon.tsx @@ -13,45 +13,32 @@ import LanguageTr from '../Icons/jsx/LanguageTr'; import LanguageUk from '../Icons/jsx/LanguageUk'; import LanguageZh from '../Icons/jsx/LanguageZh'; +const LanguageIcons = { + en: LanguageEn, + de: LanguageDe, + es: LanguageEs, + fr: LanguageFr, + it: LanguageIt, + ja: LanguageJa, + ko: LanguageKo, + nl: LanguageNl, + pl: LanguagePl, + pt: LanguagePt, + tr: LanguageTr, + uk: LanguageUk, + zh: LanguageZh, +}; + export interface LanguageIconProps extends HTMLAttributes { - language?: string; + language?: keyof typeof LanguageIcons; } -const LanguageIcon: FC> = ( - props, -) => { +const LanguageIcon: FC> = (props) => { const { language, ...other } = props; - switch (language) { - case 'en': - return ; - case 'de': - return ; - case 'es': - return ; - case 'fr': - return ; - case 'it': - return ; - case 'ja': - return ; - case 'ko': - return ; - case 'nl': - return ; - case 'pl': - return ; - case 'pt': - return ; - case 'tr': - return ; - case 'uk': - return ; - case 'zh': - return ; - default: - return ; - } + const Component = language ? LanguageIcons[language] : LanguageEn; + + return ; }; export default LanguageIcon; diff --git a/src/LanguageSwitcher/LanguageSwitcher.tsx b/src/LanguageSwitcher/LanguageSwitcher.tsx index f90d2f1..671956a 100644 --- a/src/LanguageSwitcher/LanguageSwitcher.tsx +++ b/src/LanguageSwitcher/LanguageSwitcher.tsx @@ -1,61 +1,42 @@ import React, { FC, HTMLAttributes } from 'react'; import cx from 'clsx'; -import LanguageIcon from '../LanguageIcon/LanguageIcon'; import DropdownIcon from '../Icons/jsx/DropdownIcon'; +import LanguageIcon from '../LanguageIcon/LanguageIcon'; + +const LocaleNames = { + en: 'English', + de: 'Deutsch', + es: 'Español', + fr: 'Français', + it: 'Italiano', + ja: '日本語', + ko: '한국어', + nl: 'Dutch', + pl: 'Polski', + pt: 'Português do Brasil', + tr: 'Turkish', + uk: 'Українська', + zh: '繁體中文', +}; + +export type SupportedLocale = keyof typeof LocaleNames; -const getLocaleName = (locale: string) => { - switch (locale) { - case 'en': - return 'English'; - case 'de': - return 'Deutsch'; - case 'es': - return 'Español'; - case 'fr': - return 'Français'; - case 'it': - return 'Italiano'; - case 'ja': - return '日本語'; - case 'ko': - return '한국어'; - case 'nl': - return 'Dutch'; - case 'pl': - return 'Polski'; - case 'pt': - return 'Português do Brasil'; - case 'tr': - return 'Turkish'; - case 'uk': - return 'Українська'; - case 'zh': - return '繁體中文'; - default: - return ''; - } +const getLocaleName = (locale: SupportedLocale) => { + return LocaleNames[locale] || ''; }; -export interface LanguageSwitcherProps - extends HTMLAttributes { - currentLanguage: string; - availableLanguages: string[]; +export interface LanguageSwitcherProps extends HTMLAttributes { + currentLanguage: SupportedLocale; + availableLanguages: SupportedLocale[]; } -const LanguageSwitcher: FC> = ( - props, -) => { +const LanguageSwitcher: FC> = (props) => { const { currentLanguage, availableLanguages, className, ...other } = props; return (
- -
- {getLocaleName(currentLanguage)} -
+ +
{getLocaleName(currentLanguage)}
- {showHintError && {error}} + {showHintError && ( + + {error} + + )} ); }; diff --git a/src/Notification/Notification.tsx b/src/Notification/Notification.tsx index 6468dd6..b4b3519 100644 --- a/src/Notification/Notification.tsx +++ b/src/Notification/Notification.tsx @@ -1,9 +1,9 @@ import React, { FC } from 'react'; import { ToastContainer, toast, cssTransition } from 'react-toastify'; import Button from '../Button/Button'; -import CloseIcon from '../Icons/jsx/CloseIcon'; -import CheckIcon from '../Icons/jsx/CheckIcon'; import BlockIcon from '../Icons/jsx/BlockIcon'; +import CheckIcon from '../Icons/jsx/CheckIcon'; +import CloseIcon from '../Icons/jsx/CloseIcon'; type NotificationType = 'success' | 'error'; @@ -34,17 +34,12 @@ const Notification: FC> = ({ type, childre ); const NotificationsContainer: FC> = () => ( - + ); export default NotificationsContainer; -export function notify(text: string | React.ReactNode, type: NotificationType) { +export const notify = (text: string | React.ReactNode, type: NotificationType) => { toast({text}, { draggable: true, draggablePercent: 60, @@ -54,4 +49,4 @@ export function notify(text: string | React.ReactNode, type: NotificationType) { }); return null; -} +}; diff --git a/src/Pagination/NextComponent.tsx b/src/Pagination/NextComponent.tsx new file mode 100644 index 0000000..7064c11 --- /dev/null +++ b/src/Pagination/NextComponent.tsx @@ -0,0 +1,30 @@ +import React, { DetailedReactHTMLElement, FC } from 'react'; +import cx from 'clsx'; +import BackIcon from '../Icons/jsx/BackIcon'; + +export interface NextComponentProps { + currentPage: number; + maxPage: number; + renderItem: (n: number) => DetailedReactHTMLElement<{ children: JSX.Element; className: string }, HTMLElement>; + nextLabel: string; +} + +const NextComponent: FC = ({ currentPage, maxPage, renderItem, nextLabel }) => { + const isEnabled = currentPage < maxPage; + const element = isEnabled ? renderItem(currentPage + 1) : React.createElement('div'); + + return React.cloneElement( + element as DetailedReactHTMLElement<{ children: JSX.Element; className: string }, HTMLElement>, + { + className: cx('pagination-nav', '-next', !isEnabled && '-disabled'), + children: ( + <> + {nextLabel} + + + ), + }, + ); +}; + +export default NextComponent; diff --git a/src/Pagination/Pagination.tsx b/src/Pagination/Pagination.tsx index f1d6d33..12302ab 100644 --- a/src/Pagination/Pagination.tsx +++ b/src/Pagination/Pagination.tsx @@ -1,30 +1,29 @@ -import React, { FC, HTMLAttributes, ReactElement } from 'react'; +import React, { DetailedReactHTMLElement, FC, HTMLAttributes } from 'react'; import cx from 'clsx'; -import BackIcon from '../Icons/jsx/BackIcon'; +import NextComponent from './NextComponent'; +import PrevComponent from './PrevComponent'; export interface PaginationProps extends HTMLAttributes { - renderItem: (n: number) => JSX.Element; + renderItem: (n: number) => DetailedReactHTMLElement<{ children: JSX.Element; className: string }, HTMLElement>; maxPage: number; currentPage: number; nextLabel?: string; prevLabel?: string; } +const getPageNumbersCapacity = (maxPage: number) => { + // eslint-disable-next-line @typescript-eslint/no-magic-numbers + return maxPage < 7 ? maxPage : 7; +}; + const Pagination: FC> = (props) => { - const { - className, - currentPage, - maxPage, - renderItem, - prevLabel = 'Previous', - nextLabel = 'Next', - ...other - } = props; + const { className, currentPage, maxPage, renderItem, prevLabel = 'Previous', nextLabel = 'Next', ...other } = props; const minPage = 1; const rangeValue = -1; - const pageNumbersCapacity = maxPage < 7 ? maxPage : 7; + const pageNumbersCapacity = getPageNumbersCapacity(maxPage); const pageNumbers = [currentPage]; + // eslint-disable-next-line @typescript-eslint/no-magic-numbers if (maxPage < 2) return null; if (maxPage < currentPage) { @@ -50,55 +49,29 @@ const Pagination: FC> = (props) => { /* insert right range */ if (pageNumbers[pageNumbersCapacity - 1] !== maxPage) { pageNumbers[pageNumbersCapacity - 1] = maxPage; + // eslint-disable-next-line @typescript-eslint/no-magic-numbers pageNumbers[pageNumbersCapacity - 2] = rangeValue; } - function PrevComponent() { - const isEnabled = currentPage > minPage; - const element = isEnabled ? renderItem(currentPage - 1) : React.createElement('div'); - - return React.cloneElement(element as ReactElement, { - className: cx('pagination-nav', '-prev', !isEnabled && '-disabled'), - children: ( - <> - - {prevLabel} - - ), - }); - } - - function NextComponent() { - const isEnabled = currentPage < maxPage; - const element = isEnabled ? renderItem(currentPage + 1) : React.createElement('div'); - - return React.cloneElement(element as ReactElement, { - className: cx('pagination-nav', '-next', !isEnabled && '-disabled'), - children: ( - <> - {nextLabel} - - - ), - }); - } - return (
- + {pageNumbers.map((n, index) => { const key = `${n}-${index}`; - if (n === rangeValue) { - return
...
; - } + if (n === rangeValue) + return ( +
+ ... +
+ ); return React.cloneElement(renderItem(n), { key, - className: cx('pagination-page', (currentPage === n) && '-active'), + className: cx('pagination-page', currentPage === n && '-active'), }); })} - +
); }; diff --git a/src/Pagination/PrevComponent.tsx b/src/Pagination/PrevComponent.tsx new file mode 100644 index 0000000..9230a31 --- /dev/null +++ b/src/Pagination/PrevComponent.tsx @@ -0,0 +1,30 @@ +import React, { DetailedReactHTMLElement, FC } from 'react'; +import cx from 'clsx'; +import BackIcon from '../Icons/jsx/BackIcon'; + +export interface PrevComponentProps { + currentPage: number; + minPage: number; + renderItem: (n: number) => DetailedReactHTMLElement<{ children: JSX.Element; className: string }, HTMLElement>; + prevLabel: string; +} + +const PrevComponent: FC = ({ currentPage, minPage, renderItem, prevLabel }) => { + const isEnabled = currentPage > minPage; + const element = isEnabled ? renderItem(currentPage - 1) : React.createElement('div'); + + return React.cloneElement( + element as DetailedReactHTMLElement<{ children: JSX.Element; className: string }, HTMLElement>, + { + className: cx('pagination-nav', '-prev', !isEnabled && '-disabled'), + children: ( + <> + + {prevLabel} + + ), + }, + ); +}; + +export default PrevComponent; diff --git a/src/Panel/Panel.tsx b/src/Panel/Panel.tsx index 026408f..8db5dfd 100644 --- a/src/Panel/Panel.tsx +++ b/src/Panel/Panel.tsx @@ -9,18 +9,14 @@ export interface PanelProps extends HTMLAttributes> = (props) => { - const { - className, - outline, - children, - component = 'div', - ...other - } = props; + const { className, outline, children, component = 'div', ...other } = props; - const Component = other.href ? 'a' : component as ElementType; + const Component = other.href ? 'a' : (component as ElementType); return ( - {children} + + {children} + ); }; diff --git a/src/Password/Password.tsx b/src/Password/Password.tsx index f4bf4c3..120c9a2 100644 --- a/src/Password/Password.tsx +++ b/src/Password/Password.tsx @@ -1,6 +1,6 @@ import React, { FC, InputHTMLAttributes, ReactNode, useState } from 'react'; -import Input from '../Input/Input'; import Button from '../Button/Button'; +import Input from '../Input/Input'; import { Error, InputValueType } from '../types'; export interface PasswordProps extends Omit, 'onChange'> { @@ -10,12 +10,10 @@ export interface PasswordProps extends Omit string; onToggle?: () => void; - onChange?:(value: InputValueType, event?: React.ChangeEvent) => void; + onChange?: (value: InputValueType, event?: React.ChangeEvent) => void; } -function i18nToggleDefault(isPasswordVisible: boolean) { - return isPasswordVisible ? 'Hide' : 'Show'; -} +const i18nToggleDefault = (isPasswordVisible: boolean) => (isPasswordVisible ? 'Hide' : 'Show'); const Password: FC> = (props) => { const { withToggle, i18nToggle = i18nToggleDefault, onToggle, ...other } = props; @@ -30,11 +28,13 @@ const Password: FC> = (props) => { - {i18nToggle(passwordVisible)} - - )} + action={ + withToggle && ( + + ) + } /> ); }; diff --git a/src/Payment/Payment.tsx b/src/Payment/Payment.tsx index d68fddf..816e6dc 100644 --- a/src/Payment/Payment.tsx +++ b/src/Payment/Payment.tsx @@ -4,9 +4,9 @@ import Card from '../Icons/jsx/PaymentCard'; import DinersClub from '../Icons/jsx/PaymentDinersClub'; import Discover from '../Icons/jsx/PaymentDiscover'; import JCB from '../Icons/jsx/PaymentJcb'; +import Mada from '../Icons/jsx/PaymentMada'; import Maestro from '../Icons/jsx/PaymentMaestro'; import Master from '../Icons/jsx/PaymentMaster'; -import Mada from '../Icons/jsx/PaymentMada'; import PayPal from '../Icons/jsx/PaymentPaypal'; import UnionPay from '../Icons/jsx/PaymentUnionPay'; import Visa from '../Icons/jsx/PaymentVisa'; @@ -22,43 +22,36 @@ const CardType = { Mada: 'mada', DinersClub: 'diners_club', UnionPay: 'unionpay', - 'Union_Pay': 'union_pay', + // eslint-disable-next-line camelcase + Union_Pay: 'union_pay', Paypal: 'paypal', }; +const PaymentComponents = { + [CardType.Master]: Master, + [CardType.Mastercard]: Master, + [CardType.Paypal]: PayPal, + [CardType.Amex]: Amex, + [CardType.DinersClub]: DinersClub, + [CardType.Discover]: Discover, + [CardType.JCB]: JCB, + [CardType.Maestro]: Maestro, + [CardType.UnionPay]: UnionPay, + [CardType.Union_Pay]: UnionPay, + [CardType.Visa]: Visa, + [CardType.Mada]: Mada, +}; + export interface PaymentProps extends HTMLAttributes { type?: typeof CardType[keyof typeof CardType]; } -const Payment: FC> = (props) => { - const { type, ...other } = props; +const Payment: FC> = ({ type, ...other }) => { + const Component = type ? PaymentComponents[type] : null; + + if (Component) return ; - switch (type) { - case CardType.Paypal: - return ; - case CardType.Amex: - return ; - case CardType.DinersClub: - return ; - case CardType.Discover: - return ; - case CardType.JCB: - return ; - case CardType.Maestro: - return ; - case CardType.UnionPay: - case CardType.Union_Pay: - return ; - case CardType.Visa: - return ; - case CardType.Master: - case CardType.Mastercard: - return ; - case CardType.Mada: - return ; - default: - return ; - } + return ; }; export default Payment; diff --git a/src/Radio/Radio.tsx b/src/Radio/Radio.tsx index c2fda05..6c6a3ae 100644 --- a/src/Radio/Radio.tsx +++ b/src/Radio/Radio.tsx @@ -6,12 +6,7 @@ export interface RadioProps extends InputHTMLAttributes { } const Radio: FC> = (props) => { - const { - className, - error, - children, - ...other - } = props; + const { className, error, children, ...other } = props; return (
); }; -export default TabList; +export default TabList; diff --git a/src/Tag/Tag.tsx b/src/Tag/Tag.tsx index f589045..433950c 100644 --- a/src/Tag/Tag.tsx +++ b/src/Tag/Tag.tsx @@ -35,5 +35,4 @@ const Tag: FC> = ({ ); }; - export default Tag; diff --git a/src/TagInput/TagInput.tsx b/src/TagInput/TagInput.tsx index 16319f5..258eea2 100644 --- a/src/TagInput/TagInput.tsx +++ b/src/TagInput/TagInput.tsx @@ -1,17 +1,11 @@ /* eslint-disable react-hooks/exhaustive-deps */ -import React, { - ReactNode, - ChangeEvent, - KeyboardEvent, - ClipboardEvent, - useEffect, -} from 'react'; +import React, { ReactNode, ChangeEvent, KeyboardEvent, ClipboardEvent, useEffect } from 'react'; import cx from 'clsx'; +import { uniqId, isAutofill } from '../helpers'; import Hint from '../Hint/Hint'; import Tag, { TagProps } from '../Tag/Tag'; import TagList from '../TagList/TagList'; import { Error } from '../types'; -import { uniqId, isAutofill } from '../helpers'; export interface TagInputListItem { id: string; @@ -95,7 +89,7 @@ const TagInput: React.FC> = ({ }; const handleRemoveTag = (tagId: string) => { - onChange(tags.filter(({ id }) => tagId !== id)); + onChange(tags.filter(({ id: currentId }) => tagId !== currentId)); }; const handleAddTag = async () => { @@ -108,15 +102,18 @@ const TagInput: React.FC> = ({ if (!isUniqueTag) return; - onChange([...tags, { - id: uniqId(), - value, - }]); + onChange([ + ...tags, + { + id: uniqId(), + value, + }, + ]); }; const handleKeyDown = async (event: KeyboardEvent) => { - const isAddEvent = addKeyCodes.includes(event.code); - const isRemoveEvent = removeKeyCodes.includes(event.code) && !value && tags.length; + const isAddEvent = addKeyCodes?.includes(event.code); + const isRemoveEvent = removeKeyCodes?.includes(event.code) && !value && tags.length; if (isAddEvent) { event.preventDefault(); @@ -138,15 +135,11 @@ const TagInput: React.FC> = ({ await handleAddTag(); } - if (isAutofillDetected) { - onAutofill?.(); - } + if (isAutofillDetected) onAutofill?.(); }; const handleBlur = async () => { - if (value && isHandleOnBlur) { - await handleAddTag(); - } + if (value && isHandleOnBlur) await handleAddTag(); onBlur?.(); }; @@ -156,8 +149,8 @@ const TagInput: React.FC> = ({ const clipboardItems = event.clipboardData .getData('text') - .split(clipboardSeparator) - .map((value: string) => value.trim()) + .split(clipboardSeparator as RegExp | string) + .map((currentValue: string) => currentValue.trim()) .filter(Boolean); if (clipboardItems.length === 1) return; @@ -197,17 +190,20 @@ const TagInput: React.FC> = ({ ); }; diff --git a/src/TagList/TagList.tsx b/src/TagList/TagList.tsx index 69a4b28..05488bd 100644 --- a/src/TagList/TagList.tsx +++ b/src/TagList/TagList.tsx @@ -5,7 +5,7 @@ export interface TagListProps extends HTMLAttributes> = ({ className, children, as: Element = 'div', ...other }) => ( +const TagList: FC> = ({ className, children, as: Element = 'div', ...other }) => ( {children} diff --git a/src/Tooltip/Tooltip.tsx b/src/Tooltip/Tooltip.tsx index d11521e..3e82bd9 100644 --- a/src/Tooltip/Tooltip.tsx +++ b/src/Tooltip/Tooltip.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useRef, useState } from 'react'; -import cx from 'clsx'; import { FloatingArrow, Placement } from '@floating-ui/react'; +import cx from 'clsx'; import useTooltip from './useTooltip.hook'; interface Tooltip { @@ -21,35 +21,21 @@ const Tooltip: React.FC> = ({ forceHide, openOnClick = false, }) => { - const messageStyles = maxWidth - ? ({ width: maxWidth } as React.CSSProperties) - : {}; + const messageStyles = maxWidth ? ({ width: maxWidth } as React.CSSProperties) : {}; const arrowRef = useRef(null); const [isOpen, setIsOpen] = useState(false); - const { - setReference, - setFloating, - getReferenceProps, - getFloatingProps, - getArrowPosition, - floatingStyles, - context, - } = useTooltip({ isForce: Boolean(forceShow || forceHide), arrowRef, openOnClick, position, isOpen, setIsOpen }); + const { setReference, setFloating, getReferenceProps, getFloatingProps, getArrowPosition, floatingStyles, context } = + useTooltip({ isForce: Boolean(forceShow || forceHide), arrowRef, openOnClick, position, isOpen, setIsOpen }); useEffect(() => { setIsOpen(Boolean(forceShow && !forceHide)); }, [forceShow, forceHide]); - return ( <> -
+
{children}
{isOpen && ( diff --git a/src/Tooltip/useTooltip.hook.ts b/src/Tooltip/useTooltip.hook.ts index 7a0f0d1..7ae6079 100644 --- a/src/Tooltip/useTooltip.hook.ts +++ b/src/Tooltip/useTooltip.hook.ts @@ -28,7 +28,7 @@ interface useTooltipProps { setIsOpen: React.Dispatch>; } -interface useTooltip extends Partial { +interface useTooltip extends Partial { setReference: (node: ReferenceType | null) => void; setFloating: (node: HTMLElement | null) => void; getReferenceProps: (userProps?: HTMLProps | undefined) => Record; @@ -38,13 +38,19 @@ interface useTooltip extends Partial { } const useTooltip = ({ isForce, arrowRef, openOnClick, position, isOpen, setIsOpen }: useTooltipProps): useTooltip => { - - const { middlewareData, refs: { setReference, setFloating }, floatingStyles, context } = useFloating({ + const { + middlewareData, + refs: { setReference, setFloating }, + floatingStyles, + context, + } = useFloating({ open: isOpen, + // eslint-disable-next-line no-undefined onOpenChange: isForce ? undefined : setIsOpen, placement: position, whileElementsMounted: autoUpdate, middleware: [ + // eslint-disable-next-line @typescript-eslint/no-magic-numbers offset(8), arrow({ element: arrowRef, @@ -69,34 +75,30 @@ const useTooltip = ({ isForce, arrowRef, openOnClick, position, isOpen, setIsOpe }), }); - const { getReferenceProps, getFloatingProps } = useInteractions([ - hover, - focus, - openOnClick ? click : undefined, - ]); + // eslint-disable-next-line no-undefined + const { getReferenceProps, getFloatingProps } = useInteractions([hover, focus, openOnClick ? click : undefined]); const getArrowPosition = useMemo(() => { - const shiftPosition - = middlewareData?.shift?.y || middlewareData?.shift?.x || 0; - const arrowPosition - = middlewareData?.arrow?.y || middlewareData?.arrow?.x || 0; + const shiftPosition = middlewareData?.shift?.y || middlewareData?.shift?.x || 0; + const arrowPosition = middlewareData?.arrow?.y || middlewareData?.arrow?.x || 0; const coordinates = arrowPosition - shiftPosition; + // eslint-disable-next-line @typescript-eslint/no-magic-numbers const overflowSize = (arrowPosition * 2) / shiftPosition; const positionOnOverflow = `${middlewareData?.shift?.x ? '85' : '59'}%`; + // eslint-disable-next-line no-nested-ternary,@typescript-eslint/no-magic-numbers return coordinates < 10 - ? 10 - : middlewareData?.flip?.overflows?.[0] - && overflowSize > -3 - && shiftPosition < 0 - ? positionOnOverflow - : coordinates; + ? // eslint-disable-next-line @typescript-eslint/no-magic-numbers + 10 + : // eslint-disable-next-line @typescript-eslint/no-magic-numbers + middlewareData?.flip?.overflows?.[0] && overflowSize > -3 && shiftPosition < 0 + ? positionOnOverflow + : coordinates; }, [middlewareData.shift, middlewareData.arrow, middlewareData.flip]); - - return ({ + return { setReference, setFloating, getReferenceProps, @@ -104,7 +106,7 @@ const useTooltip = ({ isForce, arrowRef, openOnClick, position, isOpen, setIsOpe getArrowPosition, floatingStyles: { ...floatingStyles, ...styles }, context, - }); + }; }; export default useTooltip; diff --git a/src/global.d.ts b/src/global.d.ts new file mode 100644 index 0000000..8a5e169 --- /dev/null +++ b/src/global.d.ts @@ -0,0 +1,7 @@ +declare global { + interface ObjectLiteral { + [key: string]: unknown; + } +} + +export {}; diff --git a/src/helpers.ts b/src/helpers.ts index 1141864..b40bdaf 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -1,17 +1,27 @@ import { KeyboardEvent } from 'react'; -// eslint-disable-next-line import/prefer-default-export export const uniqId = () => { + // eslint-disable-next-line @typescript-eslint/no-magic-numbers const array = new Uint32Array(10); window.crypto.getRandomValues(array); return ( - Date.now().toString(36) - + Array.from(array) - .map((number) => number.toString(36)) + ( + Date.now() + // eslint-disable-next-line @typescript-eslint/no-magic-numbers + .toString(36) + + Array.from(array) + .map((number) => + number + // eslint-disable-next-line @typescript-eslint/no-magic-numbers + .toString(36), + ) .join('') - ).replace(/\./g, ''); + ).replace(/\./g, '') + ); }; -export const isAutofill = (e: KeyboardEvent) => e.key === 'Unidentified' && e.code === undefined && e.view === undefined; +export const isAutofill = (e: KeyboardEvent) => + // eslint-disable-next-line no-undefined + e.key === 'Unidentified' && e.code === undefined && e.view === undefined; From 3a68419ce3b45c5b4e10dfb2b5067fab1c0ebb30 Mon Sep 17 00:00:00 2001 From: Bohdan Kulinich Date: Wed, 7 Jun 2023 14:46:09 +0300 Subject: [PATCH 2/3] fix: manually fix ts errors --- src/Multiselect/Multiselect.tsx | 2 +- src/Pagination/NextComponent.tsx | 26 ++++++++++++-------------- src/Pagination/Pagination.tsx | 5 +++-- src/Pagination/PrevComponent.tsx | 26 ++++++++++++-------------- 4 files changed, 28 insertions(+), 31 deletions(-) diff --git a/src/Multiselect/Multiselect.tsx b/src/Multiselect/Multiselect.tsx index 3bfea83..3a23730 100644 --- a/src/Multiselect/Multiselect.tsx +++ b/src/Multiselect/Multiselect.tsx @@ -6,7 +6,7 @@ import Tag from '../Tag/Tag'; import TagList from '../TagList/TagList'; import { Error } from '../types'; -export interface MultiselectProps { +export interface MultiselectProps extends ObjectLiteral { className?: string; placeholder?: string; scale?: 'medium'; diff --git a/src/Pagination/NextComponent.tsx b/src/Pagination/NextComponent.tsx index 7064c11..f0eb8dd 100644 --- a/src/Pagination/NextComponent.tsx +++ b/src/Pagination/NextComponent.tsx @@ -1,11 +1,11 @@ -import React, { DetailedReactHTMLElement, FC } from 'react'; +import React, { FC } from 'react'; import cx from 'clsx'; import BackIcon from '../Icons/jsx/BackIcon'; export interface NextComponentProps { currentPage: number; maxPage: number; - renderItem: (n: number) => DetailedReactHTMLElement<{ children: JSX.Element; className: string }, HTMLElement>; + renderItem: (n: number) => JSX.Element; nextLabel: string; } @@ -13,18 +13,16 @@ const NextComponent: FC = ({ currentPage, maxPage, renderIte const isEnabled = currentPage < maxPage; const element = isEnabled ? renderItem(currentPage + 1) : React.createElement('div'); - return React.cloneElement( - element as DetailedReactHTMLElement<{ children: JSX.Element; className: string }, HTMLElement>, - { - className: cx('pagination-nav', '-next', !isEnabled && '-disabled'), - children: ( - <> - {nextLabel} - - - ), - }, - ); + // @ts-ignore + return React.cloneElement(element as JSX.Element, { + className: cx('pagination-nav', '-next', !isEnabled && '-disabled'), + children: ( + <> + {nextLabel} + + + ), + }); }; export default NextComponent; diff --git a/src/Pagination/Pagination.tsx b/src/Pagination/Pagination.tsx index 12302ab..b278e10 100644 --- a/src/Pagination/Pagination.tsx +++ b/src/Pagination/Pagination.tsx @@ -1,10 +1,10 @@ -import React, { DetailedReactHTMLElement, FC, HTMLAttributes } from 'react'; +import React, { FC, HTMLAttributes } from 'react'; import cx from 'clsx'; import NextComponent from './NextComponent'; import PrevComponent from './PrevComponent'; export interface PaginationProps extends HTMLAttributes { - renderItem: (n: number) => DetailedReactHTMLElement<{ children: JSX.Element; className: string }, HTMLElement>; + renderItem: (n: number) => JSX.Element; maxPage: number; currentPage: number; nextLabel?: string; @@ -66,6 +66,7 @@ const Pagination: FC> = (props) => {
); + // @ts-ignore return React.cloneElement(renderItem(n), { key, className: cx('pagination-page', currentPage === n && '-active'), diff --git a/src/Pagination/PrevComponent.tsx b/src/Pagination/PrevComponent.tsx index 9230a31..e746704 100644 --- a/src/Pagination/PrevComponent.tsx +++ b/src/Pagination/PrevComponent.tsx @@ -1,11 +1,11 @@ -import React, { DetailedReactHTMLElement, FC } from 'react'; +import React, { FC } from 'react'; import cx from 'clsx'; import BackIcon from '../Icons/jsx/BackIcon'; export interface PrevComponentProps { currentPage: number; minPage: number; - renderItem: (n: number) => DetailedReactHTMLElement<{ children: JSX.Element; className: string }, HTMLElement>; + renderItem: (n: number) => JSX.Element; prevLabel: string; } @@ -13,18 +13,16 @@ const PrevComponent: FC = ({ currentPage, minPage, renderIte const isEnabled = currentPage > minPage; const element = isEnabled ? renderItem(currentPage - 1) : React.createElement('div'); - return React.cloneElement( - element as DetailedReactHTMLElement<{ children: JSX.Element; className: string }, HTMLElement>, - { - className: cx('pagination-nav', '-prev', !isEnabled && '-disabled'), - children: ( - <> - - {prevLabel} - - ), - }, - ); + // @ts-ignore + return React.cloneElement(element as JSX.Element, { + className: cx('pagination-nav', '-prev', !isEnabled && '-disabled'), + children: ( + <> + + {prevLabel} + + ), + }); }; export default PrevComponent; From 286b1f638de3992d9f0a14db21af6fa9743c261d Mon Sep 17 00:00:00 2001 From: Bohdan Kulinich Date: Fri, 9 Jun 2023 09:26:29 +0300 Subject: [PATCH 3/3] chore: update version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7ffa6b2..baa345a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@macpaw/macpaw-ui", - "version": "4.11.0", + "version": "4.12.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@macpaw/macpaw-ui", - "version": "4.11.0", + "version": "4.12.0", "license": "MIT", "dependencies": { "@floating-ui/react": "^0.24.1", diff --git a/package.json b/package.json index a45eb8a..65eb25b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@macpaw/macpaw-ui", - "version": "4.11.0", + "version": "4.12.0", "main": "lib/ui.js", "scripts": { "dev": "next -p 1234",