diff --git a/.eslintrc.json b/.eslintrc.json index 026a332..ba55e9d 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -29,5 +29,5 @@ "prettier", "simple-import-sort" ], - "rules": {} + "rules": { "@typescript-eslint/ban-ts-comment": "off" } } diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 65171da..73e7fff 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,4 +34,4 @@ jobs: with: node-version: ${{ matrix.node-version }} - run: npm install - # - run: npm test + - run: npm test diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e7b9033..c7b582e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -32,7 +32,7 @@ jobs: with: node-version: 18 - run: npm install - # - run: npm test + - run: npm test publish: name: Publish package to npmjs @@ -46,9 +46,9 @@ jobs: registry-url: 'https://registry.npmjs.org' - run: git config --global user.email "ross@bsoltec.com" - run: git config --global user.name "Ross Chiu" - - run: npm install + - run: npm ci + - run: npm version patch - run: npm run build - - run: npm version patch --no-git-tag-version - run: npm publish . && git push --tags && git push && echo \"Successfully released version $npm_package_version!\" env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/package-lock.json b/package-lock.json index 471b539..46efe5c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,10 +12,10 @@ "@babel/core": "^7.17.5", "@commitlint/cli": "^17.4.2", "@commitlint/config-conventional": "^17.4.2", - "@rollup/plugin-commonjs": "^25.0.1", - "@rollup/plugin-json": "^6.0.0", - "@rollup/plugin-node-resolve": "^15.1.0", - "@rollup/plugin-replace": "^5.0.2", + "@rollup/plugin-commonjs": "^25.0.7", + "@rollup/plugin-json": "^6.0.1", + "@rollup/plugin-node-resolve": "^15.2.3", + "@rollup/plugin-replace": "^5.0.5", "@storybook/addon-essentials": "^7.5.3", "@storybook/addon-interactions": "^7.5.3", "@storybook/addon-links": "^7.5.3", @@ -32,8 +32,9 @@ "@typescript-eslint/eslint-plugin": "^5.12.1", "@typescript-eslint/parser": "^5.12.1", "@vitejs/plugin-react": "^3.0.1", + "axios": "^1.6.2", "cz-conventional-changelog": "3.3.0", - "eslint": "^8.53.0", + "eslint": "^8.54.0", "eslint-config-airbnb": "^19.0.4", "eslint-config-prettier": "^9.0.0", "eslint-plugin-import": "^2.29.0", @@ -69,8 +70,8 @@ "i18next-browser-languagedetector": "^7.2.0", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-i18next": "^13.4.1", - "react-icons": "^4.11.0" + "react-i18next": "^13.5.0", + "react-icons": "^4.12.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -101,7 +102,8 @@ }, "node_modules/@ark-ui/react": { "version": "0.6.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@ark-ui/react/-/react-0.6.0.tgz", + "integrity": "sha512-9LqN0fnFgaTc0Slp6tRZvkLverp0/O/Ps3Ffq5x1KvH46DMi5KMs7EGGULXgjzZCln3RVzVjIEK/jzm5aSmyKg==", "peer": true, "dependencies": { "@zag-js/accordion": "0.10.2", @@ -4463,9 +4465,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.53.0.tgz", - "integrity": "sha512-Kn7K8dx/5U6+cT1yEhpX1w4PCSg0M+XyRILPgvwcEBjerFWCwQj5sbr3/VmxqV0JGHCBCzyd6LxypEuehypY1w==", + "version": "8.54.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.54.0.tgz", + "integrity": "sha512-ut5V+D+fOoWPgGGNj83GGjnntO39xDy6DWxO0wb7Jp3DcMX0TfIqdzHF85VTQkerdyGmuuMD9AKAo5KiNlf/AQ==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -4486,11 +4488,12 @@ } }, "node_modules/@floating-ui/dom": { - "version": "1.2.9", - "license": "MIT", - "peer": true, + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.5.3.tgz", + "integrity": "sha512-ClAbQnEqJAKCJOEbbLo5IUlZHkNszqhuxS4fHAVxRPXPya6Ysf2G8KypnYcOTpx6I8xcgF9bbHb6g/2KpbV8qA==", "dependencies": { - "@floating-ui/core": "^1.2.6" + "@floating-ui/core": "^1.4.2", + "@floating-ui/utils": "^0.1.3" } }, "node_modules/@floating-ui/react-dom": { @@ -4506,16 +4509,6 @@ "react-dom": ">=16.8.0" } }, - "node_modules/@floating-ui/react-dom/node_modules/@floating-ui/dom": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.5.3.tgz", - "integrity": "sha512-ClAbQnEqJAKCJOEbbLo5IUlZHkNszqhuxS4fHAVxRPXPya6Ysf2G8KypnYcOTpx6I8xcgF9bbHb6g/2KpbV8qA==", - "dev": true, - "dependencies": { - "@floating-ui/core": "^1.4.2", - "@floating-ui/utils": "^0.1.3" - } - }, "node_modules/@floating-ui/utils": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.1.6.tgz", @@ -4554,11 +4547,12 @@ "dev": true }, "node_modules/@internationalized/date": { - "version": "3.2.0", - "license": "Apache-2.0", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/@internationalized/date/-/date-3.5.0.tgz", + "integrity": "sha512-nw0Q+oRkizBWMioseI8+2TeUPEyopJVz5YxoYVzR0W1v+2YytiYah7s/ot35F149q/xAg4F1gT/6eTd+tsUpFQ==", "peer": true, "dependencies": { - "@swc/helpers": "^0.4.14" + "@swc/helpers": "^0.5.0" } }, "node_modules/@isaacs/cliui": { @@ -6397,22 +6391,23 @@ } }, "node_modules/@rollup/plugin-commonjs": { - "version": "25.0.2", + "version": "25.0.7", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-25.0.7.tgz", + "integrity": "sha512-nEvcR+LRjEjsaSsc4x3XZfCCvZIaSMenZu/OiwOKGN2UhQpAYI7ru7czFvyWbErlpoGjnSX3D5Ch5FcMA3kRWQ==", "dev": true, - "license": "MIT", "dependencies": { "@rollup/pluginutils": "^5.0.1", "commondir": "^1.0.1", "estree-walker": "^2.0.2", "glob": "^8.0.3", "is-reference": "1.2.1", - "magic-string": "^0.27.0" + "magic-string": "^0.30.3" }, "engines": { "node": ">=14.0.0" }, "peerDependencies": { - "rollup": "^2.68.0||^3.0.0" + "rollup": "^2.68.0||^3.0.0||^4.0.0" }, "peerDependenciesMeta": { "rollup": { @@ -6420,10 +6415,23 @@ } } }, + "node_modules/@rollup/plugin-commonjs/node_modules/magic-string": { + "version": "0.30.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.5.tgz", + "integrity": "sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==", + "dev": true, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/@rollup/plugin-json": { - "version": "6.0.0", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-6.0.1.tgz", + "integrity": "sha512-RgVfl5hWMkxN1h/uZj8FVESvPuBJ/uf6ly6GTj0GONnkfoBN5KC0MSz+PN2OLDgYXMhtG0mWpTrkiOjoxAIevw==", "dev": true, - "license": "MIT", "dependencies": { "@rollup/pluginutils": "^5.0.1" }, @@ -6431,7 +6439,7 @@ "node": ">=14.0.0" }, "peerDependencies": { - "rollup": "^1.20.0||^2.0.0||^3.0.0" + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" }, "peerDependenciesMeta": { "rollup": { @@ -6440,9 +6448,10 @@ } }, "node_modules/@rollup/plugin-node-resolve": { - "version": "15.1.0", + "version": "15.2.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.2.3.tgz", + "integrity": "sha512-j/lym8nf5E21LwBT4Df1VD6hRO2L2iwUeUmP7litikRsVp1H6NWx20NEp0Y7su+7XGc476GnXXc4kFeZNGmaSQ==", "dev": true, - "license": "MIT", "dependencies": { "@rollup/pluginutils": "^5.0.1", "@types/resolve": "1.20.2", @@ -6455,7 +6464,7 @@ "node": ">=14.0.0" }, "peerDependencies": { - "rollup": "^2.78.0||^3.0.0" + "rollup": "^2.78.0||^3.0.0||^4.0.0" }, "peerDependenciesMeta": { "rollup": { @@ -6464,18 +6473,19 @@ } }, "node_modules/@rollup/plugin-replace": { - "version": "5.0.2", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-5.0.5.tgz", + "integrity": "sha512-rYO4fOi8lMaTg/z5Jb+hKnrHHVn8j2lwkqwyS4kTRhKyWOLf2wST2sWXr4WzWiTcoHTp2sTjqUbqIj2E39slKQ==", "dev": true, - "license": "MIT", "dependencies": { "@rollup/pluginutils": "^5.0.1", - "magic-string": "^0.27.0" + "magic-string": "^0.30.3" }, "engines": { "node": ">=14.0.0" }, "peerDependencies": { - "rollup": "^1.20.0||^2.0.0||^3.0.0" + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" }, "peerDependenciesMeta": { "rollup": { @@ -6483,6 +6493,18 @@ } } }, + "node_modules/@rollup/plugin-replace/node_modules/magic-string": { + "version": "0.30.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.5.tgz", + "integrity": "sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==", + "dev": true, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/@rollup/pluginutils": { "version": "5.0.2", "dev": true, @@ -8431,8 +8453,9 @@ } }, "node_modules/@swc/helpers": { - "version": "0.4.14", - "license": "MIT", + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.3.tgz", + "integrity": "sha512-FaruWX6KdudYloq1AHD/4nU+UsMTdNE8CKyrseXWEcgjDAbvkwJg2QGPAnfIJLIWsjZOSPLOAykK6fuYp4vp4A==", "peer": true, "dependencies": { "tslib": "^2.4.0" @@ -9474,7 +9497,8 @@ }, "node_modules/@zag-js/accordion": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/accordion/-/accordion-0.10.2.tgz", + "integrity": "sha512-iOAS7v+UFQZPgvknZkIgEKnWJfONNro3KRH8JtqiLnRftHofPvOhsLD1L2gE6MNXf8Gfz/N7BKBeiuKrfjplUQ==", "peer": true, "dependencies": { "@zag-js/anatomy": "0.10.2", @@ -9487,12 +9511,14 @@ }, "node_modules/@zag-js/anatomy": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/anatomy/-/anatomy-0.10.2.tgz", + "integrity": "sha512-hXJO047Bx1ilIQIlY4yk4f7QM7hFWg5p6DC4zZBsQf2A/FmDikGcOvqYhM4NM5Zuw8Rp4RF8aSU2qWONqAo8kA==", "peer": true }, "node_modules/@zag-js/aria-hidden": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/aria-hidden/-/aria-hidden-0.10.2.tgz", + "integrity": "sha512-2e7ITwdxpsH4+TKgib0GLv1HGWx8k9MJbzpv03MknQvQUOgZVyXsFUh0BQWoTpOLcZTlifD+NX7Dle4PCaAiSg==", "peer": true, "dependencies": { "@zag-js/dom-query": "0.10.2" @@ -9500,7 +9526,8 @@ }, "node_modules/@zag-js/auto-resize": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/auto-resize/-/auto-resize-0.10.2.tgz", + "integrity": "sha512-Xht+ewhx3C29bX+crescDfaJPjMTNRJAZ5oHNbW/SUXAVW+B5OxQiaIA7uAuqDflkgQKye65lXz8H/CsrPMgag==", "peer": true, "dependencies": { "@zag-js/dom-query": "0.10.2" @@ -9508,7 +9535,8 @@ }, "node_modules/@zag-js/avatar": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/avatar/-/avatar-0.10.2.tgz", + "integrity": "sha512-WHHABOmMOHhk4+eLUw0wb5MQ4SqYMCHIvTVwCstILHvT+FbuMhss3QJIWmNuZR9cF9hftVHJDm/2duLsefjkrw==", "peer": true, "dependencies": { "@zag-js/anatomy": "0.10.2", @@ -9521,7 +9549,8 @@ }, "node_modules/@zag-js/carousel": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/carousel/-/carousel-0.10.2.tgz", + "integrity": "sha512-VHdSYwP1mTRwvpQtfZLUygH/lLjv8iDrxYXhcI3IwXyW7AQ+jYXE5jYYk0HiSmkOKnGUMthL1SVz802jgKctpg==", "peer": true, "dependencies": { "@zag-js/anatomy": "0.10.2", @@ -9533,7 +9562,8 @@ }, "node_modules/@zag-js/checkbox": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/checkbox/-/checkbox-0.10.2.tgz", + "integrity": "sha512-lPPTmBVln76BeYY+u9wEcdjmhjVt/udddRwHO7AqfdNnBOnkQ+ITsngic480IIM5ZVAtBf+ApwSpI/w0vUmirw==", "peer": true, "dependencies": { "@zag-js/anatomy": "0.10.2", @@ -9547,7 +9577,8 @@ }, "node_modules/@zag-js/color-picker": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/color-picker/-/color-picker-0.10.2.tgz", + "integrity": "sha512-VdnmjfevCDQp8o0zgSGY+kIJjDrs7tllHecCyzpTUj3vbZ1CCesVfIBfS1kB3/8VZ1ykvC5Kw5HbNP7qB7A7cg==", "peer": true, "dependencies": { "@zag-js/anatomy": "0.10.2", @@ -9563,12 +9594,14 @@ }, "node_modules/@zag-js/color-utils": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/color-utils/-/color-utils-0.10.2.tgz", + "integrity": "sha512-0RelI8RijMy6O6E8ijjEDTv9pyfiaTkmDLOlrx3rMhbOW8Yg90ZQAOReVMkqUWPjdssJuMj+NgrL4Gi0yFs1MA==", "peer": true }, "node_modules/@zag-js/combobox": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/combobox/-/combobox-0.10.2.tgz", + "integrity": "sha512-gRikh2aMhM8rj8+3X219ynLOJ4SFtw6zdHiYVPlNpCzKrSDmNJdEKM3U5z6sVls+EDMBq0If8l7PRUw/Oqsw+g==", "peer": true, "dependencies": { "@zag-js/anatomy": "0.10.2", @@ -9586,7 +9619,8 @@ }, "node_modules/@zag-js/core": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/core/-/core-0.10.2.tgz", + "integrity": "sha512-p9ctX27Dik2PYUPE66O2sJwesGsmlV6FbMSbGfc/lteZiQHkFxulOTs1kiFxUDfjFgbsHDu4a0QwBmNrHH25Uw==", "peer": true, "dependencies": { "@zag-js/store": "0.10.2", @@ -9595,7 +9629,8 @@ }, "node_modules/@zag-js/date-picker": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/date-picker/-/date-picker-0.10.2.tgz", + "integrity": "sha512-XxqroNGoWM/Fdca/P0Ul98HsOUOck/+tQIQ4janMogYmlg7+BURpuyVmctDPH7/kUGDBpd0E6kWpnTPxQjuoXQ==", "peer": true, "dependencies": { "@internationalized/date": "^3.2.0", @@ -9614,7 +9649,8 @@ }, "node_modules/@zag-js/date-utils": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/date-utils/-/date-utils-0.10.2.tgz", + "integrity": "sha512-FdRnBTcbAdrVmijUmUjW6JQUftCoy7zkhMuWYgEFDDn+w+uYIWFRe728dnrITGG1ScdnBKIEzSyhp/55MmPKbg==", "peer": true, "peerDependencies": { "@internationalized/date": ">=3.0.0" @@ -9622,7 +9658,8 @@ }, "node_modules/@zag-js/dialog": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/dialog/-/dialog-0.10.2.tgz", + "integrity": "sha512-HQafVppC4Erz/Y4Sz0Qrc+Z15QcngvMQT6uI4abu434f1FRzvqv12m5zWwH5ALcXEWu1KCUx/Hmg13cTkplJ0w==", "peer": true, "dependencies": { "@zag-js/anatomy": "0.10.2", @@ -9638,7 +9675,8 @@ }, "node_modules/@zag-js/dismissable": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/dismissable/-/dismissable-0.10.2.tgz", + "integrity": "sha512-PLucaqXBCyner2CIfOaFLYPd/PeHCpIcbmdahg/ZNHClGo3+J8pQLJzOJpJ6q8VxpBbNdGb+VJ7WTbw9ZDZyRA==", "peer": true, "dependencies": { "@zag-js/dom-event": "0.10.2", @@ -9649,7 +9687,8 @@ }, "node_modules/@zag-js/dom-event": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/dom-event/-/dom-event-0.10.2.tgz", + "integrity": "sha512-W44npN40fufpser5SBGLhXo+0AyDSEX+ySP2gBX2uIaPxRa/GZJGt8lWJf/tVRx6XOCa8eZtLvHrYRcJ6mWqWg==", "peer": true, "dependencies": { "@zag-js/text-selection": "0.10.2", @@ -9658,12 +9697,14 @@ }, "node_modules/@zag-js/dom-query": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/dom-query/-/dom-query-0.10.2.tgz", + "integrity": "sha512-gsQztWG54tkxzFvteUxWa017oDz4qJj1okCMMQ1s0mGkK4N7HY5AzAx8zMJoVYwZPmlBKOgCwJTbGB/1mUBaqg==", "peer": true }, "node_modules/@zag-js/editable": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/editable/-/editable-0.10.2.tgz", + "integrity": "sha512-u3GjA0RaQaETTQ0CbW6BxUh+5kUrhNvfa0FK2jiHszKzwirdyxqBufuT1qss7V2fLy45c+QNsIrAnPqnotaIpQ==", "peer": true, "dependencies": { "@zag-js/anatomy": "0.10.2", @@ -9678,7 +9719,8 @@ }, "node_modules/@zag-js/element-rect": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/element-rect/-/element-rect-0.10.2.tgz", + "integrity": "sha512-7r7tFqH04JbshAaYExn3RjW0+uScImNpWBa87s3vfohar6lfCPLX7MvUZ+WiaA2KgLFGVnE4rrYXCnDkOeW5/A==", "peer": true }, "node_modules/@zag-js/element-size": { @@ -9704,7 +9746,8 @@ }, "node_modules/@zag-js/form-utils": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/form-utils/-/form-utils-0.10.2.tgz", + "integrity": "sha512-lMce2u8EXpAQWzEsfIgIdHhbygYvWZQy/5Vwv6tRt7hQd076iJX+DWXTkawlwPREwNm/pn7Dy7SETyX7qeAkRw==", "peer": true, "dependencies": { "@zag-js/mutation-observer": "0.10.2" @@ -9712,7 +9755,8 @@ }, "node_modules/@zag-js/hover-card": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/hover-card/-/hover-card-0.10.2.tgz", + "integrity": "sha512-myiq3y+WFMTxkAtr0jqjmbqS7g9PGD/+FvA+fduCcqv7+3xutrpAOzLG524Me2Wcc+yXtTndiTjZMNpvaCkOPA==", "peer": true, "dependencies": { "@zag-js/anatomy": "0.10.2", @@ -9726,7 +9770,8 @@ }, "node_modules/@zag-js/interact-outside": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/interact-outside/-/interact-outside-0.10.2.tgz", + "integrity": "sha512-j+5lFvWlp0tm/oKcN4Vxe0jQogp27IkkMVzt1aVseH/LzA0qqUiKyZ2bQyzehTh8cEsc9cgP9TLZD897WatTCw==", "peer": true, "dependencies": { "@zag-js/dom-event": "0.10.2", @@ -9737,7 +9782,8 @@ }, "node_modules/@zag-js/live-region": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/live-region/-/live-region-0.10.2.tgz", + "integrity": "sha512-rULwxLqPAyiJPaEpqDyh6T45GF/D/eQWHNHJSpPzCk+Dkn6qAnMAEMT4HalazgUSsViURVhyDXaPBt7dsT5Lkw==", "peer": true, "dependencies": { "@zag-js/visually-hidden": "0.10.2" @@ -9745,7 +9791,8 @@ }, "node_modules/@zag-js/menu": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/menu/-/menu-0.10.2.tgz", + "integrity": "sha512-ypj05A+DhvgCUldifeVrpwxP4lTz8BYaqUmQAHfNzYjRiLAxPZU4cHZaxaLTZPyr90Bh8JaSQwB0GlbC2AhAKA==", "peer": true, "dependencies": { "@zag-js/anatomy": "0.10.2", @@ -9761,12 +9808,14 @@ }, "node_modules/@zag-js/mutation-observer": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/mutation-observer/-/mutation-observer-0.10.2.tgz", + "integrity": "sha512-D2nCn8m7LexaPjVLLvlKzGLxJidH6LlMrhEyQt8BmUtpQf/u9dF21c+L72SrrLleiDv1Ke7us6HYj4xhSA/aTg==", "peer": true }, "node_modules/@zag-js/number-input": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/number-input/-/number-input-0.10.2.tgz", + "integrity": "sha512-Vl/aWemrdjTvyRxhsl40oUTxgnS0jrNyTKQRSkyhqI2Bp1afXrmoexReKQ2HrhtZMEE6Q9hAMzUISDYBAl7n8Q==", "peer": true, "dependencies": { "@zag-js/anatomy": "0.10.2", @@ -9782,17 +9831,20 @@ }, "node_modules/@zag-js/number-utils": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/number-utils/-/number-utils-0.10.2.tgz", + "integrity": "sha512-a18LQlteigmlirYh8xRDO732U5r5cbJHspPwSmWQEVeQVwXmeGtJXlCWULvg2Zm2u4Zpdzdoo4o3kX7+yWZIHg==", "peer": true }, "node_modules/@zag-js/numeric-range": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/numeric-range/-/numeric-range-0.10.2.tgz", + "integrity": "sha512-zeFjzF/+QYVpJ07kYWgYfmfrXB/0GUVofSM3SEv+dBGLtdCAShl5o+/JQlvOFIqyAiydhftdo9hAwl6DoO/0og==", "peer": true }, "node_modules/@zag-js/pagination": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/pagination/-/pagination-0.10.2.tgz", + "integrity": "sha512-rTDcTpGXQXc7KPoA9rRdgNG2F9ZWDQ7IgkKpdeYV41sdg2XL/1F08o/jvVDnqt2NE3u5krCLrRzMTZxdvBgRkg==", "peer": true, "dependencies": { "@zag-js/anatomy": "0.10.2", @@ -9804,7 +9856,8 @@ }, "node_modules/@zag-js/pin-input": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/pin-input/-/pin-input-0.10.2.tgz", + "integrity": "sha512-vzW1i4bewJ10sWwOzemMAiwwV/I9irOADiGxpNtnu1Pwlc9rh6JjrD1UkaFrQhKQlr5nGPoVTxxbelZy1IKgTw==", "peer": true, "dependencies": { "@zag-js/anatomy": "0.10.2", @@ -9819,7 +9872,8 @@ }, "node_modules/@zag-js/popover": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/popover/-/popover-0.10.2.tgz", + "integrity": "sha512-xAjARtlFFCApFANi7Ti3yKBaecNVgjoxA4Uya0kPYgBrfOQcxAFxYaM14Adigi4gsrz8+7n34MOqHJZHdTNBQA==", "peer": true, "dependencies": { "@zag-js/anatomy": "0.10.2", @@ -9837,7 +9891,8 @@ }, "node_modules/@zag-js/popper": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/popper/-/popper-0.10.2.tgz", + "integrity": "sha512-UckgTCwa+fNv3VQNKImO8EhkPoJBB5gQz2K4CQ5CEyFuiubQQpQRL/p/QGvivaIKmZ5kfQnl2SVechoiiMSpTg==", "peer": true, "dependencies": { "@floating-ui/dom": "1.2.9", @@ -9846,9 +9901,19 @@ "@zag-js/utils": "0.10.2" } }, + "node_modules/@zag-js/popper/node_modules/@floating-ui/dom": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.2.9.tgz", + "integrity": "sha512-sosQxsqgxMNkV3C+3UqTS6LxP7isRLwX8WMepp843Rb3/b0Wz8+MdUkxJksByip3C2WwLugLHN1b4ibn//zKwQ==", + "peer": true, + "dependencies": { + "@floating-ui/core": "^1.2.6" + } + }, "node_modules/@zag-js/pressable": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/pressable/-/pressable-0.10.2.tgz", + "integrity": "sha512-ZZv1HoMMLXkbcff/3Skmo+disJ1MyvWsQdWhdmfs0rpy5QoQ9AEtV3h4yiASD5HE01cxh8gLCOge5XwoHOyD3g==", "peer": true, "dependencies": { "@zag-js/anatomy": "0.10.2", @@ -9862,7 +9927,8 @@ }, "node_modules/@zag-js/radio-group": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/radio-group/-/radio-group-0.10.2.tgz", + "integrity": "sha512-3FyHWFG55v7kmhvoIV2K6QPVhePi7yBfl0F+mCESKJxJxEq/hYeN/4sLuzW2lBb7WNi+2vytopmcBKBCqLK4kw==", "peer": true, "dependencies": { "@zag-js/anatomy": "0.10.2", @@ -9877,7 +9943,8 @@ }, "node_modules/@zag-js/range-slider": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/range-slider/-/range-slider-0.10.2.tgz", + "integrity": "sha512-xjugLcu+1l0vG57Z+rTXE8iToeHiL8hs0Chth94NTBy4b6xh5c4sgxyaWd3S4lD7ZVejIIqYJq4XCL+IBFqzpA==", "peer": true, "dependencies": { "@zag-js/anatomy": "0.10.2", @@ -9894,12 +9961,14 @@ }, "node_modules/@zag-js/range-slider/node_modules/@zag-js/element-size": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/element-size/-/element-size-0.10.2.tgz", + "integrity": "sha512-HeGbw0gPKC0S+hg9BjgHpgBdTt/o+nk7ydswbBqElP/VBMSVias8mzMlxX6dBmaUrvjox//wQBWLnZQRf5U/zw==", "peer": true }, "node_modules/@zag-js/rating-group": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/rating-group/-/rating-group-0.10.2.tgz", + "integrity": "sha512-nAW6zDBgduc6m1PGsttWg6xVCWHg6FiJc/6lNRustG7ncx9qcboWxFaePxPDMTMZ6qaxX8r/QIVwagtTHcG5PQ==", "peer": true, "dependencies": { "@zag-js/anatomy": "0.10.2", @@ -9913,7 +9982,8 @@ }, "node_modules/@zag-js/react": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/react/-/react-0.10.2.tgz", + "integrity": "sha512-D4kjnYg897C7kA7uhXZMyMGQM7iWDiddmnyeLnZUFTDILX6uEYx7epQgeAQ0gmeRw2Un1ZNaKylM8IqlvqXzhg==", "peer": true, "dependencies": { "@zag-js/core": "0.10.2", @@ -9928,12 +9998,14 @@ }, "node_modules/@zag-js/rect-utils": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/rect-utils/-/rect-utils-0.10.2.tgz", + "integrity": "sha512-rie7sO39T0bsTRO6CWL5bFpKbhoTEd+8apVuQIBDRof2GGU7RGePKV3BQA5q5gQ4nIG6zXIZ9k6HD+syQ4ivOA==", "peer": true }, "node_modules/@zag-js/remove-scroll": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/remove-scroll/-/remove-scroll-0.10.2.tgz", + "integrity": "sha512-PJispN7PmzbOqmhd6VFQXprLDUd5QHx9X4o8TJF0vvD1D7oNSLVzwhGUZc5QeSB1xNuIisjGs0clNoZF8z8FUA==", "peer": true, "dependencies": { "@zag-js/dom-query": "0.10.2" @@ -9941,7 +10013,8 @@ }, "node_modules/@zag-js/select": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/select/-/select-0.10.2.tgz", + "integrity": "sha512-Sbd11o2wv30FN9hCDD6W//9VRGwHsUI+sv1vwBhQBVd9tF9Fmj1yP/L6TV5wT+Ctsls+Vy9Js/eczPx771p9kg==", "peer": true, "dependencies": { "@zag-js/anatomy": "0.10.2", @@ -9960,7 +10033,8 @@ }, "node_modules/@zag-js/slider": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/slider/-/slider-0.10.2.tgz", + "integrity": "sha512-q5CQu4pM2X/xv9D9lBwziM5dyxE5HiDL7h/H0Wq0uzUbGHGDprHP1oHb8xDtB8Kbf7qOoJH6b6yMB+WVPy7ChQ==", "peer": true, "dependencies": { "@zag-js/anatomy": "0.10.2", @@ -9976,12 +10050,14 @@ }, "node_modules/@zag-js/slider/node_modules/@zag-js/element-size": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/element-size/-/element-size-0.10.2.tgz", + "integrity": "sha512-HeGbw0gPKC0S+hg9BjgHpgBdTt/o+nk7ydswbBqElP/VBMSVias8mzMlxX6dBmaUrvjox//wQBWLnZQRf5U/zw==", "peer": true }, "node_modules/@zag-js/splitter": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/splitter/-/splitter-0.10.2.tgz", + "integrity": "sha512-p2RMuJ0K5vXjZS1oQdrZxAj5duh/VaNBS6pURnqqgVjO4dODrt8OFT9kjKA9othhhPd0p8/roCS5OYb1scHjgA==", "peer": true, "dependencies": { "@zag-js/anatomy": "0.10.2", @@ -9995,7 +10071,8 @@ }, "node_modules/@zag-js/store": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/store/-/store-0.10.2.tgz", + "integrity": "sha512-GUTViqs+v8Pkn96ooqjMZbMtywFEtOogbz5/3qJJoPAjFFtFGxjycQRZOB1mg4a52lK0Uh4BQ1x1atG06EkLaw==", "peer": true, "dependencies": { "proxy-compare": "2.5.1" @@ -10003,7 +10080,8 @@ }, "node_modules/@zag-js/switch": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/switch/-/switch-0.10.2.tgz", + "integrity": "sha512-XRWDumrrGnB8n6+a2CmDfk2iuaKTVbeg31hqMESUDPX7xju43gRdVKYK898Ya/tdzEy5F82+fjtcdTYckdotXg==", "peer": true, "dependencies": { "@zag-js/anatomy": "0.10.2", @@ -10017,7 +10095,8 @@ }, "node_modules/@zag-js/tabbable": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/tabbable/-/tabbable-0.10.2.tgz", + "integrity": "sha512-f887/rLBzRdZQmU2U5+z/4zcotcvlaA1BHvR5G7lG4WDLSLWdyNoKGO7dkV3jskNfAKvzoJFnh1HoD2lBQB6tw==", "peer": true, "dependencies": { "@zag-js/dom-query": "0.10.2" @@ -10025,7 +10104,8 @@ }, "node_modules/@zag-js/tabs": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/tabs/-/tabs-0.10.2.tgz", + "integrity": "sha512-Zlg+Emh5KY5NBWB9JTWe5cdFPw2rRqLdnwyRz+GNJffAYREszeccDFz29Jumob98gbNmW2KO0Jn3nj8wrKVseg==", "peer": true, "dependencies": { "@zag-js/anatomy": "0.10.2", @@ -10040,7 +10120,8 @@ }, "node_modules/@zag-js/tags-input": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/tags-input/-/tags-input-0.10.2.tgz", + "integrity": "sha512-0HIUJ6F2M65VzVEk9QAIo1BL8VQ9lNpVetHZLA2i2zChaho+pGSVrUXKZVW3xvRfXsu55woaQSskeipeUjMxoQ==", "peer": true, "dependencies": { "@zag-js/anatomy": "0.10.2", @@ -10057,7 +10138,8 @@ }, "node_modules/@zag-js/text-selection": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/text-selection/-/text-selection-0.10.2.tgz", + "integrity": "sha512-XPhowW6odc5jZ9Lzolh1KiqeQbNkXQwMFU8t5/gh15xC0Bds/ueksnhWJgYrr9DBWIkCi2MyXMM5hmKqBRIepg==", "peer": true, "dependencies": { "@zag-js/dom-query": "0.10.2" @@ -10065,7 +10147,8 @@ }, "node_modules/@zag-js/toast": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/toast/-/toast-0.10.2.tgz", + "integrity": "sha512-K6xSYnnHqo0pSGjw/x9l/+kO/T8AfSU4MZCTNFcdR9v1XSASdIxuGTo3bx/CsgW6XLkbWbWTco8r9wW3Pn1nhw==", "peer": true, "dependencies": { "@zag-js/anatomy": "0.10.2", @@ -10078,7 +10161,8 @@ }, "node_modules/@zag-js/tooltip": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/tooltip/-/tooltip-0.10.2.tgz", + "integrity": "sha512-MAsJb0qhIVqAr+Vb8IH5ycN52MWVcnT706+R7yAVYjQNd285Ah5CZ8e4fOaSPn2QW6K5ntpwvcjx5+Ndb9LCwQ==", "peer": true, "dependencies": { "@zag-js/anatomy": "0.10.2", @@ -10093,7 +10177,8 @@ }, "node_modules/@zag-js/transition": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/transition/-/transition-0.10.2.tgz", + "integrity": "sha512-peFEE+1xQs4iggCFenJmDXq3O/+C1Cwq91A+5Xb+paNBXDq/cn+QI/aqjO/nuMlTRWxe0lQkbeAoPCyQ9XCQ5Q==", "peer": true, "dependencies": { "@zag-js/core": "0.10.2", @@ -10104,7 +10189,8 @@ }, "node_modules/@zag-js/types": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/types/-/types-0.10.2.tgz", + "integrity": "sha512-a5VK1VfsYfvJs2JzLFMcM3yLf2NU+WQLql5ChV5qa9M2CLyUH+czgwKvjFFrSsvUWYSdVJyTxFEZI9sfNnQg/Q==", "peer": true, "dependencies": { "csstype": "3.1.2" @@ -10112,12 +10198,14 @@ }, "node_modules/@zag-js/utils": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/utils/-/utils-0.10.2.tgz", + "integrity": "sha512-CRxtBtPyNE9tjFnwxGZsU8Gr4kLAb1JhhpRv9yJKVs2aQp03+//USP0nn98L8qy3rIy7kVZtUL6+NosB3pkebA==", "peer": true }, "node_modules/@zag-js/visually-hidden": { "version": "0.10.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@zag-js/visually-hidden/-/visually-hidden-0.10.2.tgz", + "integrity": "sha512-xPGGRqWLHNDTeniWiiVxZeE8iIPRtramM8yWTYm7ewDjJuyvmBq52zOzv8vwJy7N2QsQbMiMAtfpo8DbIAxknA==", "peer": true }, "node_modules/abab": { @@ -10535,6 +10623,17 @@ "node": ">=4" } }, + "node_modules/axios": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz", + "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==", + "dev": true, + "dependencies": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "node_modules/axobject-query": { "version": "3.2.1", "dev": true, @@ -13218,15 +13317,15 @@ } }, "node_modules/eslint": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.53.0.tgz", - "integrity": "sha512-N4VuiPjXDUa4xVeV/GC/RV3hQW9Nw+Y463lkWaKKXKYMvmRiRDAtfpuPFLN+E1/6ZhyR8J2ig+eVREnYgUsiag==", + "version": "8.54.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.54.0.tgz", + "integrity": "sha512-NY0DfAkM8BIZDVl6PgSa1ttZbx3xHgJzSNJKYcQglem6CppHyMhRIQkBVSSMaSRnLhig3jsDbEzOjwCVt4AmmA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.3", - "@eslint/js": "8.53.0", + "@eslint/js": "8.54.0", "@humanwhocodes/config-array": "^0.11.13", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -14289,12 +14388,33 @@ }, "node_modules/focus-trap": { "version": "7.4.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/focus-trap/-/focus-trap-7.4.3.tgz", + "integrity": "sha512-BgSSbK4GPnS2VbtZ50VtOv1Sti6DIkj3+LkVjiWMNjLeAp1SH1UlLx3ULu/DCu4vq5R4/uvTm+zrvsMsuYmGLg==", "peer": true, "dependencies": { "tabbable": "^6.1.2" } }, + "node_modules/follow-redirects": { + "version": "1.15.3", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz", + "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, "node_modules/for-each": { "version": "0.3.3", "dev": true, @@ -18530,7 +18650,8 @@ }, "node_modules/klona": { "version": "2.0.6", - "license": "MIT", + "resolved": "https://registry.npmjs.org/klona/-/klona-2.0.6.tgz", + "integrity": "sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA==", "peer": true, "engines": { "node": ">= 8" @@ -20169,7 +20290,8 @@ }, "node_modules/proxy-compare": { "version": "2.5.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/proxy-compare/-/proxy-compare-2.5.1.tgz", + "integrity": "sha512-oyfc0Tx87Cpwva5ZXezSp5V9vht1c7dZBhvuV/y3ctkgMVUmiAGDVeeB0dKhGSyT0v1ZTEQYpe/RXlBVBNuCLA==", "peer": true }, "node_modules/proxy-from-env": { @@ -20565,9 +20687,9 @@ } }, "node_modules/react-i18next": { - "version": "13.4.1", - "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-13.4.1.tgz", - "integrity": "sha512-z02JvLbt6Gavbuhr4CBOI6vasLypo+JSLvMgUOGeOMPv1g6spngfAb9jWAPwvuavPlKYU4dro9yRduflwyBeyA==", + "version": "13.5.0", + "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-13.5.0.tgz", + "integrity": "sha512-CFJ5NDGJ2MUyBohEHxljOq/39NQ972rh1ajnadG9BjTk+UXbHLq4z5DKEbEQBDoIhUmmbuS/fIMJKo6VOax1HA==", "peer": true, "dependencies": { "@babel/runtime": "^7.22.5", @@ -22006,8 +22128,9 @@ } }, "node_modules/tabbable": { - "version": "6.1.2", - "license": "MIT", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.2.0.tgz", + "integrity": "sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==", "peer": true }, "node_modules/tar": { diff --git a/package.json b/package.json index 227f69b..02973a9 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,6 @@ "format": "prettier --config ./.prettierrc -w 'src/**/*.{tsx,ts}' && git update-index --again", "pretest": "npm run lint:fix", "test": "jest --colors --passWithNoTests", - "posttest": "npx http-server coverage/lcov-report", "test:watch": "npm run test --collectCoverage=false --watch", "cz": "cz", "storybook": "storybook dev -p 6006", @@ -34,17 +33,17 @@ "i18next-browser-languagedetector": "^7.2.0", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-i18next": "^13.4.1", - "react-icons": "^4.11.0" + "react-i18next": "^13.5.0", + "react-icons": "^4.12.0" }, "devDependencies": { "@babel/core": "^7.17.5", "@commitlint/cli": "^17.4.2", "@commitlint/config-conventional": "^17.4.2", - "@rollup/plugin-commonjs": "^25.0.1", - "@rollup/plugin-json": "^6.0.0", - "@rollup/plugin-node-resolve": "^15.1.0", - "@rollup/plugin-replace": "^5.0.2", + "@rollup/plugin-commonjs": "^25.0.7", + "@rollup/plugin-json": "^6.0.1", + "@rollup/plugin-node-resolve": "^15.2.3", + "@rollup/plugin-replace": "^5.0.5", "@storybook/addon-essentials": "^7.5.3", "@storybook/addon-interactions": "^7.5.3", "@storybook/addon-links": "^7.5.3", @@ -61,8 +60,9 @@ "@typescript-eslint/eslint-plugin": "^5.12.1", "@typescript-eslint/parser": "^5.12.1", "@vitejs/plugin-react": "^3.0.1", + "axios": "^1.6.2", "cz-conventional-changelog": "3.3.0", - "eslint": "^8.53.0", + "eslint": "^8.54.0", "eslint-config-airbnb": "^19.0.4", "eslint-config-prettier": "^9.0.0", "eslint-plugin-import": "^2.29.0", diff --git a/src/App.tsx b/src/App.tsx index 5461905..7fdc39d 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,8 +1,18 @@ -import React from 'react'; -import { Box } from '@chakra-ui/react'; +import React, { ReactElement, useState } from 'react'; +import axios from 'axios'; +import { + Avatar, + Badge, + Box, + HStack, + IconButton, + Text, + Center, + Checkbox, +} from '@chakra-ui/react'; +import { FiEdit2, FiTrash2 } from 'react-icons/fi'; import DataTable from './components/DataTable'; -import ThemeToggleButton from './components/globalpartials/ThemeToggleButton'; import Table from './components/Table'; import Header from './components/Header'; import TableTitle from './components/functionalcomponents/TableTitle'; @@ -10,33 +20,245 @@ import GlobalSearch from './components/functionalcomponents/GlobalSearch'; import Footer from './components/Footer'; import Pagination from './components/footercomponents/Pagination'; import SelectedNumber from './components/footercomponents/SelectedNumber'; -import columns from './components/ProvideByConsumer/Columns'; import PageSizeControl from './components/footercomponents/PageSizeControl'; import TableHeader from './components/bodycomponents/TableHeader'; import TableBody from './components/bodycomponents/TableBody'; -function App({ size = '400px' }): JSX.Element { +import ColumnSearch from './components/bodycomponents/ColumnSearch'; +import DropdownFilter from './components/bodycomponents/DropdownFilter'; + +const App = ({ + height = '400px', + tableTitle = 'Member', + columns = [], + arrowIcons = [], + isColumnResizable = false, + paginationComponent = null, + globalSearchComponent = null, + loadingComponent = null, + errorComponent = null, + apiUrl = 'http://localhost:8081/api/g/subaream/all', + pageSizes = [5, 10, 15, 20, 25, 30], + extraSortFilters = [], // [{ id: 'hub_id', desc: true }] + extraFieldFilters = {}, // { is_active: 1 } + axiosRef = axios, +}: { + height?: string; + tableTitle?: string; + columns?: Array; + arrowIcons?: Array | null; + isColumnResizable?: boolean; + paginationComponent?: ReactElement | null; + globalSearchComponent?: ReactElement | null; + loadingComponent?: ReactElement | null; + errorComponent?: ReactElement | null; + apiUrl?: string; + pageSizes?: Array; + extraSortFilters?: Array; + extraFieldFilters?: any; + axiosRef?: any; +}) => { + const [isAllChecked, setAllChecked] = useState(false); + const [selectedIds, setSelectedIds] = useState>([]); + const [allIds, setIds] = useState>([131, 133, 143, 144, 145]); + const [id, setId] = useState(''); + + // Toggle "All" checkbox + const toggleAllChecked = () => { + setAllChecked((pre) => { + if (pre) { + setSelectedIds([]); + } else { + setSelectedIds(allIds); + } + + return !pre; + }); + }; + + // Toggle row checkboxes + const onCheckboxChange = (e: any, id: number) => { + if (e.target.checked) { + setSelectedIds((pre: Array) => { + const newSelectedIds = [...pre, id]; + checkIfAllChecked(newSelectedIds); + return newSelectedIds; + }); + } else { + setSelectedIds((pre) => { + const newSelectedIds = pre.filter((itemId) => itemId !== id); + checkIfAllChecked(newSelectedIds); + return newSelectedIds; + }); + } + }; + + const onSingleCheckboxChange = (e:any, id: number) => { + if (e.target.checked) setId(id); + else setId('') + }; + + const checkIfAllChecked = (ids: Array) => { + setAllChecked(allIds.length === ids.length); + }; + return (
- Member - + {tableTitle ? {tableTitle} : null} + {globalSearchComponent ? globalSearchComponent : }
- - - +
{ + return ( +
+ +
+ ); + }, + id: 'select', + accessorKey: '', + size: 1, + cell: ({ row }) => ( +
+ onCheckboxChange(e, row.original.id)} + /> +
+ ), + }, + { + header: '', + id: 'select', + accessorKey: '', + size: 1, + cell: ({ row }) => ( +
+ onSingleCheckboxChange(e, row.original.id)} + /> +
+ ), + }, + { + header: 'Name', + accessorKey: 'name', + id: 'name', + cell: ({ row }) => ( + + + + {row.original.name} + + + ), + size: 200, + Filter: ColumnSearch, + }, + { + header: 'Status', + accessorKey: 'is_active', + id: 'is_active', + cell: ({ row }) => ( + + {row.original.is_active === 1 ? 'Active' : 'Inactive'} + + ), + size: 200, + Filter: DropdownFilter, + }, + { + header: 'Description', + accessorKey: 'description', + id: 'description', + cell: ({ row }) => ( + + {row.original.description === null + ? '' + : row.original.description} + + ), + Filter: ColumnSearch, + size: 200, + }, + { + header: 'Hub ID', + accessorKey: 'hub_id', + id: 'hub_id', + cell: ({ row }) => ( + {row.original.hub_id} + ), + size: 200, + Filter: DropdownFilter, + }, + { + header: 'BU ID', + accessorKey: 'bu_id', + id: 'bu_id', + cell: ({ row }) => ( + {row.original.bu_id} + ), + size: 400, + Filter: ColumnSearch, + }, + { + header: '', + accessorKey: 'actions', + id: 'actions', + cell: () => ( + + } + variant="tertiary" + aria-label="Delete Column" + /> + } + variant="tertiary" + aria-label="Edit Column" + /> + + ), + size: 200, + }, + ]} + apiUrl={apiUrl} + extraSortFilters={extraSortFilters} + extraFieldFilters={extraFieldFilters} + LoadingComponent={loadingComponent} + ErrorComponent={errorComponent} + axios={axiosRef} + > + +
-
- - - - -
+ {paginationComponent ? ( + paginationComponent + ) : ( +
+ + + + +
+ )}
-
); -} +}; export default App; diff --git a/src/Data/Api.ts b/src/Data/Api.ts index a97cae8..fc1b9db 100644 --- a/src/Data/Api.ts +++ b/src/Data/Api.ts @@ -31,23 +31,79 @@ export const getSubareaBySearechKey = async ( //Function to get filtered data by several filter export const getFilteredData = async ( - filterTerm: FilterInterface + filterTerm?: + | FilterInterface + | { + offset: 1; + rows: 10; + field: ''; + sort: ''; + searchTerm: ''; + individualSearchTerm: object; + }, + apiUrl?: string | null, + extraSortFilters?: Array | null, + extraFieldFilters?: Array, + axios?: any ): Promise => { + let paramStr = ''; + const offset = + filterTerm?.offset === 0 + ? 0 + : (filterTerm ? filterTerm.offset - 1 : 0) * + (filterTerm ? filterTerm.rows : 0); + + if (filterTerm?.field?.length || extraSortFilters?.length) { + const field = filterTerm?.field ? filterTerm.field.split(',') : []; + const sortyByDir = filterTerm?.sort ? filterTerm.sort.split(',') : []; + if (extraSortFilters?.length) + extraSortFilters.forEach((srt) => { + field.push(srt.id); + sortyByDir.push(srt.desc ? 'desc' : 'asc'); + }); + paramStr = `&sorting={"field":"${field}","sort":"${sortyByDir}"}`; + } + + if (filterTerm?.searchTerm?.trim?.().length) { + paramStr = `${paramStr}&searching=${encodeURIComponent( + filterTerm.searchTerm + )}`; + } + + if ( + Object.keys({ ...filterTerm?.individualSearchTerm, ...extraFieldFilters }) + .length > 0 + ) { + paramStr = `${paramStr}&where=${JSON.stringify({ + ...filterTerm?.individualSearchTerm, + ...extraFieldFilters, + })}`; + } + try { - const url = `${API_URL}/api/g/subarea/all?pagination={"offset":${ - filterTerm.offset === 0 ? 0 : filterTerm.offset - 1 - },"rows":${filterTerm.rows}}&sorting={"field":"${ - filterTerm.field - }","sort":"${filterTerm.sort}"}${ - Object.keys(filterTerm.individualSearchTerm).length > 0 - ? `&where=${JSON.stringify(filterTerm.individualSearchTerm)}` - : '' - }&searching=${filterTerm.searchTerm}`; - const response = await fetch(url); - const data = await response.json(); - return data; - } catch (error) { - console.error(error); - throw new Error('Error fetching subarea by filter keys'); + const url = `${apiUrl}?pagination={"offset":${offset},"rows":${filterTerm?.rows}}${paramStr}`; + const response = await axios.get(url); + const data = response.data; + return { + ...data, + data, + ok: true, + status: response.status, + }; + } catch (error: any) { + console.log( + 'DataTableServer Error: ', + error?.response?.data, + error?.response?.status + ); + return { + count: 0, + filterCount: 0, + dropOptions: [], + results: [], + ok: false, + status: error?.response?.status || error?.message, + message: error?.response?.data || error?.message, + }; } }; diff --git a/src/DataTableServer.tsx b/src/DataTableServer.tsx new file mode 100644 index 0000000..bb39cd2 --- /dev/null +++ b/src/DataTableServer.tsx @@ -0,0 +1,85 @@ +import React, { ReactElement } from 'react'; +import axios from 'axios'; +import { Box } from '@chakra-ui/react'; + +import DataTable from './components/DataTable'; +import Table from './components/Table'; +import Header from './components/Header'; +import TableTitle from './components/functionalcomponents/TableTitle'; +import GlobalSearch from './components/functionalcomponents/GlobalSearch'; +import Footer from './components/Footer'; +import Pagination from './components/footercomponents/Pagination'; +import SelectedNumber from './components/footercomponents/SelectedNumber'; +import PageSizeControl from './components/footercomponents/PageSizeControl'; +import TableHeader from './components/bodycomponents/TableHeader'; +import TableBody from './components/bodycomponents/TableBody'; + +const DataTableServer = ({ + height = '400px', + tableTitle = 'Member', + columns = [], + // arrowIcons = [], + isColumnResizable = false, + paginationComponent = null, + globalSearchComponent = null, + loadingComponent = null, + errorComponent = null, + apiUrl = '', + pageSizes = [5, 10, 15, 20, 25, 30], + extraSortFilters = [], + extraFieldFilters = {}, + axiosRef = axios, +}: { + height: string; + tableTitle: string; + columns: Array; + // arrowIcons: Array | null; + isColumnResizable: boolean; + paginationComponent: ReactElement | null; + globalSearchComponent: ReactElement | null; + loadingComponent: ReactElement | null; + errorComponent: ReactElement | null; + apiUrl: string; + pageSizes: Array; + extraSortFilters: Array; + extraFieldFilters: any; + axiosRef: any; +}) => { + return ( + + +
+ {tableTitle ? {tableTitle} : null} + {globalSearchComponent ? globalSearchComponent : } +
+ + + +
+ {paginationComponent ? ( + paginationComponent + ) : ( +
+ + + + +
+ )} +
+
+ ); +}; + +export default DataTableServer; diff --git a/src/components/DataTable.tsx b/src/components/DataTable.tsx index eda2da0..e8ba93f 100644 --- a/src/components/DataTable.tsx +++ b/src/components/DataTable.tsx @@ -17,6 +17,7 @@ const DataTable = ({ children }: Props) => { const [totalCount, setTotalCount] = useState(0); const [tableWidth, setTableWidth] = useState(0); const [isLoading, setIsLoading] = useState(false); + const [error, setError] = useState(''); const [filterTerm, setFilterTerm] = useState({ offset: 1, rows: 10, @@ -62,6 +63,8 @@ const DataTable = ({ children }: Props) => { setSelectedRows, isLoading, setIsLoading, + error, + setError }} > {children} diff --git a/src/components/ProvideByConsumer/Columns.tsx b/src/components/ProvideByConsumer/Columns.tsx index fd3236a..7c881a0 100644 --- a/src/components/ProvideByConsumer/Columns.tsx +++ b/src/components/ProvideByConsumer/Columns.tsx @@ -1,3 +1,4 @@ +import React from 'react' import { Avatar, Badge, Box, HStack, IconButton, Text } from '@chakra-ui/react'; import { FiEdit2, FiTrash2 } from 'react-icons/fi'; @@ -46,7 +47,7 @@ const columns: ColumnType[] = [ ), size: 200, - Filter: () => , + Filter: () => ColumnSearch, }, { header: 'Status', @@ -61,17 +62,7 @@ const columns: ColumnType[] = [ ), size: 200, - Filter: () => ( - - ), + Filter: DropdownFilter, }, { header: 'Description', @@ -82,7 +73,7 @@ const columns: ColumnType[] = [ {row.original.description === null ? '' : row.original.description} ), - Filter: () => , + Filter: () => ColumnSearch, size: 200, }, { @@ -91,18 +82,7 @@ const columns: ColumnType[] = [ id: 'hub_id', cell: ({ row }) => {row.original.hub_id}, size: 200, - Filter: () => ( - - ), + Filter: DropdownFilter, }, { header: 'BU ID', @@ -110,7 +90,7 @@ const columns: ColumnType[] = [ id: 'bu_id', cell: ({ row }) => {row.original.bu_id}, size: 400, - Filter: () => , + Filter: () => ColumnSearch, }, { header: '', diff --git a/src/components/Table.tsx b/src/components/Table.tsx index c66507e..32d2cf8 100644 --- a/src/components/Table.tsx +++ b/src/components/Table.tsx @@ -1,4 +1,6 @@ -import React, { useContext, useEffect, useState } from 'react'; +// @ts-nocheck + +import React, { ReactElement, useContext, useEffect, useState } from 'react'; import { Box, Table as TableControl } from '@chakra-ui/react'; import { useReactTable, @@ -15,12 +17,29 @@ import { import { ColumnType, DataInterface } from '../const/types'; import { getFilteredData } from '../Data/Api'; +export interface Option { + key: string; + value: string; +} + const Table = ({ columns, + apiUrl, + extraSortFilters, + extraFieldFilters, + axios, + LoadingComponent, + ErrorComponent, children, }: { - columns: ColumnType[]; - children: React.ReactElement | React.ReactElement[]; + columns?: ColumnType[] | []; + apiUrl?: string | null; + extraSortFilters?: Array; + extraFieldFilters?: any; + axios?: any; + LoadingComponent?: ReactElement | null; + ErrorComponent?: ReactElement | null; + children: ReactElement | ReactElement[]; }) => { const { filterTerm, setFilterTerm } = useContext(FilterContext); const { @@ -28,7 +47,10 @@ const Table = ({ setTotalCount, selectedRows, setSelectedRows, + // isLoading, setIsLoading, + error, + setError, } = useContext(TableStatusContext); const saveSeletedRows = ( @@ -65,7 +87,7 @@ const Table = ({ return obj; }; - const [rowSelection, setRowSelection] = React.useState( + const [rowSelection, setRowSelection] = useState( readSelectedRows(selectedRows) ); @@ -75,8 +97,8 @@ const Table = ({ const columnResizeMode: ColumnResizeMode = 'onChange'; const [sorting, setSorting] = useState([]); - const [data, setData] = useState([]); + const [dropOptions, setDropOptions] = useState([]); useEffect(() => { const fields: string[] = []; @@ -95,11 +117,21 @@ const Table = ({ useEffect(() => { const fetchSubareas = async () => { setIsLoading(true); - const res = await getFilteredData(filterTerm); + const res = await getFilteredData( + filterTerm, + apiUrl, + extraSortFilters, + extraFieldFilters, + axios + ); setIsLoading(false); - if (res) { + if (res && !res.ok) { + setError(res?.message); + } + if (res && res.ok) { setTotalCount(res.filterCount); setData(res.results); + setDropOptions(res.dropOptions || []); } }; fetchSubareas(); @@ -108,7 +140,7 @@ const Table = ({ const tableInstance = useReactTable({ data, - columns, + columns: columns || [], state: { sorting, rowSelection, @@ -131,6 +163,14 @@ const Table = ({ } }, [tableInstance.getCenterTotalSize(), window.innerWidth]); + console.log('LoadingComponent=', LoadingComponent) + + // if (isLoading) { + // return LoadingComponent ? : null; + // } + + if (error && ErrorComponent) return ErrorComponent; + return ( {Array.isArray(children) ? React.Children.map(children, (child: React.ReactElement) => { - return React.cloneElement(child, { tableInstance }); + return React.cloneElement(child, { + tableInstance: { ...tableInstance, dropOptions: dropOptions }, + }); }) - : React.cloneElement(children, { tableInstance })} + : React.cloneElement(children, { + tableInstance: { ...tableInstance, dropOptions: dropOptions }, + })} ); diff --git a/src/components/bodycomponents/ColumnSearch.tsx b/src/components/bodycomponents/ColumnSearch.tsx index 5f208f0..b28658b 100644 --- a/src/components/bodycomponents/ColumnSearch.tsx +++ b/src/components/bodycomponents/ColumnSearch.tsx @@ -14,7 +14,7 @@ import { TableStatusContext, } from '../globalpartials/GlobalContext'; -const ColumnSearch = ({ id }: { id: string }) => { +const ColumnSearch = ({ column: { id } }: { column: { id: string } }) => { const { t } = useTranslation(); const { filterTerm, setFilterTerm } = useContext(FilterContext); const { isLoading } = useContext(TableStatusContext); @@ -46,6 +46,25 @@ const ColumnSearch = ({ id }: { id: string }) => { } }; + const onSearchClick = () => { + if (inputValues === '') { + const getObj = filterTerm.individualSearchTerm; + delete getObj[id]; + setFilterTerm({ + ...filterTerm, + individualSearchTerm: getObj, + }); + } else { + setFilterTerm({ + ...filterTerm, + individualSearchTerm: { + ...filterTerm.individualSearchTerm, + [id]: inputValues, + }, + }); + } + }; + return ( @@ -55,24 +74,7 @@ const ColumnSearch = ({ id }: { id: string }) => { color="fg.muted" boxSize="5" cursor="pointer" - onClick={() => { - if (inputValues === '') { - const getObj = filterTerm.individualSearchTerm; - delete getObj[id]; - setFilterTerm({ - ...filterTerm, - individualSearchTerm: getObj, - }); - } else { - setFilterTerm({ - ...filterTerm, - individualSearchTerm: { - ...filterTerm.individualSearchTerm, - [id]: inputValues, - }, - }); - } - }} + onClick={onSearchClick} /> ) : ( diff --git a/src/components/bodycomponents/DropdownFilter.tsx b/src/components/bodycomponents/DropdownFilter.tsx index 0439bc1..b19aba9 100644 --- a/src/components/bodycomponents/DropdownFilter.tsx +++ b/src/components/bodycomponents/DropdownFilter.tsx @@ -1,3 +1,5 @@ +// @ts-nocheck + import React, { useContext, useState } from 'react'; import { Select } from 'chakra-react-select'; @@ -5,9 +7,23 @@ import { FilterContext, TableStatusContext, } from '../globalpartials/GlobalContext'; -import { DropDownProps, Option } from '../../const/types'; +import { Option } from '../../const/types'; + +export interface DropOption { + key: string; + value: [{ value: string; label: string }]; +} -const DropdownFilter = ({ id, label, options }: DropDownProps) => { +const DropdownFilter = ({ + column: { + id, + columnDef: { header }, + }, + dropOptions, +}: { + column: { id: string | number; columnDef: { header: string } }; + dropOptions: DropOption[]; +}) => { const [optionValue, setOptionValue] = useState