diff --git a/docs/installation.mdx b/docs/installation.mdx index d6b973226..eab62e809 100644 --- a/docs/installation.mdx +++ b/docs/installation.mdx @@ -40,6 +40,7 @@ Now the schema package. { name: 'Bootstrap3' }, { name: 'Bootstrap4' }, { name: 'Bootstrap5' }, + { name: 'Mantine' }, { name: 'AntD' }, { name: 'Unstyled' }, ]} diff --git a/package-lock.json b/package-lock.json index 17a3e4fac..9fc9c1b85 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,9 +12,12 @@ "@docusaurus/preset-classic": "2.1.0", "@emotion/react": "11.7.1", "@emotion/styled": "11.6.0", + "@mantine/core": "7.8.0", + "@mantine/dates": "7.8.0", "@material-ui/core": "4.11.2", "@material-ui/icons": "4.11.2", "@mui/material": "5.4.1", + "@tabler/icons-react": "3.2.0", "@testing-library/jest-dom": "5.16.5", "@testing-library/react": "12.1.5", "@testing-library/user-event": "14.4.3", @@ -65,6 +68,9 @@ "warning": "^4.0.0", "zod": "^3.0.0" }, + "devDependencies": { + "process": "^0.11.10" + }, "engines": { "npm": ">=7.0.0" } @@ -2034,11 +2040,11 @@ } }, "node_modules/@babel/runtime": { - "version": "7.19.4", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.19.4.tgz", - "integrity": "sha512-EXpLCrk55f+cYqmHsSR+yD/0gAIMxxA9QK9lnQWzhMCvt+YmoBN7Zx94s++Kv0+unHk39vxNO8t+CMA2WSS3wA==", + "version": "7.24.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.5.tgz", + "integrity": "sha512-Nms86NXrsaeU9vbBJKni6gXiEXZ4CVpYVzEjDH9Sb8vmZ3UljyA1GSOJl/6LGPO8EHLuSF9H+IxNXHPX8QHJ4g==", "dependencies": { - "regenerator-runtime": "^0.13.4" + "regenerator-runtime": "^0.14.0" }, "engines": { "node": ">=6.9.0" @@ -2056,6 +2062,11 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/runtime/node_modules/regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" + }, "node_modules/@babel/template": { "version": "7.18.10", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.18.10.tgz", @@ -3031,39 +3042,55 @@ } }, "node_modules/@emotion/babel-plugin": { - "version": "11.7.2", - "resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.7.2.tgz", - "integrity": "sha512-6mGSCWi9UzXut/ZAN6lGFu33wGR3SJisNl3c0tvlmb8XChH1b2SUvxvnOh7hvLpqyRdHHU9AiazV3Cwbk5SXKQ==", - "dependencies": { - "@babel/helper-module-imports": "^7.12.13", - "@babel/plugin-syntax-jsx": "^7.12.13", - "@babel/runtime": "^7.13.10", - "@emotion/hash": "^0.8.0", - "@emotion/memoize": "^0.7.5", - "@emotion/serialize": "^1.0.2", - "babel-plugin-macros": "^2.6.1", + "version": "11.11.0", + "resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.11.0.tgz", + "integrity": "sha512-m4HEDZleaaCH+XgDDsPF15Ht6wTLsgDTeR3WYj9Q/k76JtWhrJjcP4+/XlG8LGT/Rol9qUfOIztXeA84ATpqPQ==", + "dependencies": { + "@babel/helper-module-imports": "^7.16.7", + "@babel/runtime": "^7.18.3", + "@emotion/hash": "^0.9.1", + "@emotion/memoize": "^0.8.1", + "@emotion/serialize": "^1.1.2", + "babel-plugin-macros": "^3.1.0", "convert-source-map": "^1.5.0", "escape-string-regexp": "^4.0.0", "find-root": "^1.1.0", "source-map": "^0.5.7", - "stylis": "4.0.13" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" + "stylis": "4.2.0" } }, + "node_modules/@emotion/babel-plugin/node_modules/@emotion/hash": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.1.tgz", + "integrity": "sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ==" + }, + "node_modules/@emotion/babel-plugin/node_modules/@emotion/memoize": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.8.1.tgz", + "integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==" + }, "node_modules/@emotion/cache": { - "version": "11.7.1", - "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.7.1.tgz", - "integrity": "sha512-r65Zy4Iljb8oyjtLeCuBH8Qjiy107dOYC6SJq7g7GV5UCQWMObY4SJDPGFjiiVpPrOJ2hmJOoBiYTC7hwx9E2A==", + "version": "11.11.0", + "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.11.0.tgz", + "integrity": "sha512-P34z9ssTCBi3e9EI1ZsWpNHcfY1r09ZO0rZbRO2ob3ZQMnFI35jB536qoXbkdesr5EUhYi22anuEJuyxifaqAQ==", "dependencies": { - "@emotion/memoize": "^0.7.4", - "@emotion/sheet": "^1.1.0", - "@emotion/utils": "^1.0.0", - "@emotion/weak-memoize": "^0.2.5", - "stylis": "4.0.13" + "@emotion/memoize": "^0.8.1", + "@emotion/sheet": "^1.2.2", + "@emotion/utils": "^1.2.1", + "@emotion/weak-memoize": "^0.3.1", + "stylis": "4.2.0" } }, + "node_modules/@emotion/cache/node_modules/@emotion/memoize": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.8.1.tgz", + "integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==" + }, + "node_modules/@emotion/cache/node_modules/@emotion/weak-memoize": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.3.1.tgz", + "integrity": "sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww==" + }, "node_modules/@emotion/hash": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.8.0.tgz", @@ -3109,21 +3136,31 @@ } }, "node_modules/@emotion/serialize": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.0.2.tgz", - "integrity": "sha512-95MgNJ9+/ajxU7QIAruiOAdYNjxZX7G2mhgrtDWswA21VviYIRP1R5QilZ/bDY42xiKsaktP4egJb3QdYQZi1A==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.1.2.tgz", + "integrity": "sha512-zR6a/fkFP4EAcCMQtLOhIgpprZOwNmCldtpaISpvz348+DP4Mz8ZoKaGGCQpbzepNIUWbq4w6hNZkwDyKoS+HA==", "dependencies": { - "@emotion/hash": "^0.8.0", - "@emotion/memoize": "^0.7.4", - "@emotion/unitless": "^0.7.5", - "@emotion/utils": "^1.0.0", + "@emotion/hash": "^0.9.1", + "@emotion/memoize": "^0.8.1", + "@emotion/unitless": "^0.8.1", + "@emotion/utils": "^1.2.1", "csstype": "^3.0.2" } }, + "node_modules/@emotion/serialize/node_modules/@emotion/hash": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.1.tgz", + "integrity": "sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ==" + }, + "node_modules/@emotion/serialize/node_modules/@emotion/memoize": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.8.1.tgz", + "integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==" + }, "node_modules/@emotion/sheet": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.1.0.tgz", - "integrity": "sha512-u0AX4aSo25sMAygCuQTzS+HsImZFuS8llY8O7b9MDRzbJM0kVJlAz6KNDqcG7pOuQZJmj/8X/rAW+66kMnMW+g==" + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.2.2.tgz", + "integrity": "sha512-0QBtGvaqtWi+nx6doRwDdBIzhNdZrXUppvTM4dtZZWEGTXL/XE/yJxLMGlDT1Gt+UHH5IX1n+jkXyytE/av7OA==" }, "node_modules/@emotion/styled": { "version": "11.6.0", @@ -3151,14 +3188,14 @@ } }, "node_modules/@emotion/unitless": { - "version": "0.7.5", - "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.7.5.tgz", - "integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==" + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.8.1.tgz", + "integrity": "sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==" }, "node_modules/@emotion/utils": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-1.1.0.tgz", - "integrity": "sha512-iRLa/Y4Rs5H/f2nimczYmS5kFJEbpiVvgN3XVfZ022IYhuNA1IRSHEizcof88LtCTXtl9S2Cxt32KgaXEu72JQ==" + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-1.2.1.tgz", + "integrity": "sha512-Y2tGf3I+XVnajdItskUCn6LX+VUDmP6lTL4fcqsXAv43dnlbZiuW4MWQW38rW/BVWSE7Q/7+XQocmpnRYILUmg==" }, "node_modules/@emotion/weak-memoize": { "version": "0.2.5", @@ -3244,6 +3281,54 @@ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "peer": true }, + "node_modules/@floating-ui/core": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.6.2.tgz", + "integrity": "sha512-+2XpQV9LLZeanU4ZevzRnGFg2neDeKHgFLjP6YLW+tly0IvrhqT4u8enLGjLH3qeh85g19xY5rsAusfwTdn5lg==", + "dependencies": { + "@floating-ui/utils": "^0.2.0" + } + }, + "node_modules/@floating-ui/dom": { + "version": "1.6.5", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.5.tgz", + "integrity": "sha512-Nsdud2X65Dz+1RHjAIP0t8z5e2ff/IRbei6BqFrl1urT8sDVzM1HMQ+R0XcU5ceRfyO3I6ayeqIfh+6Wb8LGTw==", + "dependencies": { + "@floating-ui/core": "^1.0.0", + "@floating-ui/utils": "^0.2.0" + } + }, + "node_modules/@floating-ui/react": { + "version": "0.26.16", + "resolved": "https://registry.npmjs.org/@floating-ui/react/-/react-0.26.16.tgz", + "integrity": "sha512-HEf43zxZNAI/E781QIVpYSF3K2VH4TTYZpqecjdsFkjsaU1EbaWcM++kw0HXFffj7gDUcBFevX8s0rQGQpxkow==", + "dependencies": { + "@floating-ui/react-dom": "^2.1.0", + "@floating-ui/utils": "^0.2.0", + "tabbable": "^6.0.0" + }, + "peerDependencies": { + "react": ">=16.8.0", + "react-dom": ">=16.8.0" + } + }, + "node_modules/@floating-ui/react-dom": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.1.0.tgz", + "integrity": "sha512-lNzj5EQmEKn5FFKc04+zasr09h/uX8RtJRNj5gUXsSQIXHVWTVh+hVAg1vOMCexkX8EgvemMvIFpQfkosnVNyA==", + "dependencies": { + "@floating-ui/dom": "^1.0.0" + }, + "peerDependencies": { + "react": ">=16.8.0", + "react-dom": ">=16.8.0" + } + }, + "node_modules/@floating-ui/utils": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.2.tgz", + "integrity": "sha512-J4yDIIthosAsRZ5CPYP/jQvUAQtlZTTD/4suA08/FEnlxqW3sKS9iAhgsa9VYLZ6vDHn/ixJgIqRQPotoBjxIw==" + }, "node_modules/@gar/promisify": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", @@ -4982,6 +5067,75 @@ "win32" ] }, + "node_modules/@mantine/core": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@mantine/core/-/core-7.8.0.tgz", + "integrity": "sha512-19RKuNdJ/s8pZjy2w2rvTsl4ybi/XM6vf+Kc0WY7kpLFCvdG+/UxNi1MuJF8t2Zs0QSFeb/H5yZQNe0XPbegHw==", + "dependencies": { + "@floating-ui/react": "^0.26.9", + "clsx": "2.1.0", + "react-number-format": "^5.3.1", + "react-remove-scroll": "^2.5.7", + "react-textarea-autosize": "8.5.3", + "type-fest": "^4.12.0" + }, + "peerDependencies": { + "@mantine/hooks": "7.8.0", + "react": "^18.2.0", + "react-dom": "^18.2.0" + } + }, + "node_modules/@mantine/core/node_modules/clsx": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.0.tgz", + "integrity": "sha512-m3iNNWpd9rl3jvvcBnu70ylMdrXt8Vlq4HYadnU5fwcOtvkSQWPmj7amUcDT2qYI7risszBjI5AUIUox9D16pg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/@mantine/core/node_modules/type-fest": { + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.18.2.tgz", + "integrity": "sha512-+suCYpfJLAe4OXS6+PPXjW3urOS4IoP9waSiLuXfLgqZODKw/aWwASvzqE886wA0kQgGy0mIWyhd87VpqIy6Xg==", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@mantine/dates": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@mantine/dates/-/dates-7.8.0.tgz", + "integrity": "sha512-9jjiYMwP3jQOpOLKkjhp9uf2BGhtEbOnOzyAlpLOS0CJJlYtB0tO6dJ3JaogrOZ/Yfee7ZUBgouCG5EkR4/qtQ==", + "dependencies": { + "clsx": "2.1.0" + }, + "peerDependencies": { + "@mantine/core": "7.8.0", + "@mantine/hooks": "7.8.0", + "dayjs": ">=1.0.0", + "react": "^18.2.0", + "react-dom": "^18.2.0" + } + }, + "node_modules/@mantine/dates/node_modules/clsx": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.0.tgz", + "integrity": "sha512-m3iNNWpd9rl3jvvcBnu70ylMdrXt8Vlq4HYadnU5fwcOtvkSQWPmj7amUcDT2qYI7risszBjI5AUIUox9D16pg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/@mantine/hooks": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@mantine/hooks/-/hooks-7.8.0.tgz", + "integrity": "sha512-+70fkgjhVJeJ+nJqnburIM3UAsfvxat1Low9HMPobLbv64FIdB4Nzu5ct3qojNQ58r5sK01tg5UoFIJYslaVrg==", + "peer": true, + "peerDependencies": { + "react": "^18.2.0" + } + }, "node_modules/@material-ui/core": { "version": "4.11.2", "resolved": "https://registry.npmjs.org/@material-ui/core/-/core-4.11.2.tgz", @@ -8863,6 +9017,30 @@ "node": ">=6" } }, + "node_modules/@tabler/icons": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@tabler/icons/-/icons-3.2.0.tgz", + "integrity": "sha512-h8GQ2rtxgiSjltrVz4vcopAxTPSpUSUi5nBfJ09H3Bk4fJk6wZ/dVUjzhv/BHfDwGTkAxZBiYe/Q/T95cPeg5Q==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/codecalm" + } + }, + "node_modules/@tabler/icons-react": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@tabler/icons-react/-/icons-react-3.2.0.tgz", + "integrity": "sha512-b1mZT1XpZrzvbM+eFe1YbYbxkzgJ18tM4knZKqXh0gnHDZ6XVLIH3TzJZ3HZ7PTkUqZLZ7XcGae3qQVGburlBw==", + "dependencies": { + "@tabler/icons": "3.2.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/codecalm" + }, + "peerDependencies": { + "react": ">= 16" + } + }, "node_modules/@testing-library/dom": { "version": "8.20.0", "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-8.20.0.tgz", @@ -10574,28 +10752,17 @@ } }, "node_modules/babel-plugin-macros": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-2.8.0.tgz", - "integrity": "sha512-SEP5kJpfGYqYKpBrj5XU3ahw5p5GOHJ0U5ssOSQ/WBVdwkD2Dzlce95exQTs3jOVWPPKLBN2rlEWkCK7dSmLvg==", - "dependencies": { - "@babel/runtime": "^7.7.2", - "cosmiconfig": "^6.0.0", - "resolve": "^1.12.0" - } - }, - "node_modules/babel-plugin-macros/node_modules/cosmiconfig": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", - "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz", + "integrity": "sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==", "dependencies": { - "@types/parse-json": "^4.0.0", - "import-fresh": "^3.1.0", - "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.7.2" + "@babel/runtime": "^7.12.5", + "cosmiconfig": "^7.0.0", + "resolve": "^1.19.0" }, "engines": { - "node": ">=8" + "node": ">=10", + "npm": ">=6" } }, "node_modules/babel-plugin-polyfill-corejs2": { @@ -13261,6 +13428,11 @@ "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz", "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==" }, + "node_modules/detect-node-es": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/detect-node-es/-/detect-node-es-1.1.0.tgz", + "integrity": "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==" + }, "node_modules/detect-port": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/detect-port/-/detect-port-1.3.0.tgz", @@ -15405,6 +15577,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-nonce": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-nonce/-/get-nonce-1.0.1.tgz", + "integrity": "sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q==", + "engines": { + "node": ">=6" + } + }, "node_modules/get-own-enumerable-property-symbols": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz", @@ -23011,6 +23191,15 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "dev": true, + "engines": { + "node": ">= 0.6.0" + } + }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -24255,6 +24444,18 @@ "webpack": ">=4.41.1 || 5.x" } }, + "node_modules/react-number-format": { + "version": "5.3.4", + "resolved": "https://registry.npmjs.org/react-number-format/-/react-number-format-5.3.4.tgz", + "integrity": "sha512-2hHN5mbLuCDUx19bv0Q8wet67QqYK6xmtLQeY5xx+h7UXiMmRtaCwqko4mMPoKXLc6xAzwRrutg8XbTRlsfjRg==", + "dependencies": { + "prop-types": "^15.7.2" + }, + "peerDependencies": { + "react": "^0.14 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^0.14 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/react-refresh": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.9.0.tgz", @@ -24263,6 +24464,51 @@ "node": ">=0.10.0" } }, + "node_modules/react-remove-scroll": { + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.5.7.tgz", + "integrity": "sha512-FnrTWO4L7/Bhhf3CYBNArEG/yROV0tKmTv7/3h9QCFvH6sndeFf1wPqOcbFVu5VAulS5dV1wGT3GZZ/1GawqiA==", + "dependencies": { + "react-remove-scroll-bar": "^2.3.4", + "react-style-singleton": "^2.2.1", + "tslib": "^2.1.0", + "use-callback-ref": "^1.3.0", + "use-sidecar": "^1.1.2" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/react-remove-scroll-bar": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.4.tgz", + "integrity": "sha512-63C4YQBUt0m6ALadE9XV56hV8BgJWDmmTPY758iIJjfQKt2nYwoUrPk0LXRXcB/yIj82T1/Ixfdpdk68LwIB0A==", + "dependencies": { + "react-style-singleton": "^2.2.1", + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/react-router": { "version": "5.3.4", "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz", @@ -24341,6 +24587,28 @@ "react": "^16.0.0 || ^17.0.0" } }, + "node_modules/react-style-singleton": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/react-style-singleton/-/react-style-singleton-2.2.1.tgz", + "integrity": "sha512-ZWj0fHEMyWkHzKYUr2Bs/4zU6XLmq9HsgBURm7g5pAVfyn49DgUiNgY2d4lXRlYSiCif9YBGpQleewkcqddc7g==", + "dependencies": { + "get-nonce": "^1.0.0", + "invariant": "^2.2.4", + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/react-test-renderer": { "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-test-renderer/-/react-test-renderer-17.0.2.tgz", @@ -24356,11 +24624,11 @@ } }, "node_modules/react-textarea-autosize": { - "version": "8.3.4", - "resolved": "https://registry.npmjs.org/react-textarea-autosize/-/react-textarea-autosize-8.3.4.tgz", - "integrity": "sha512-CdtmP8Dc19xL8/R6sWvtknD/eCXkQr30dtvC4VmGInhRsfF8X/ihXCq6+9l9qbxmKRiq407/7z5fxE7cVWQNgQ==", + "version": "8.5.3", + "resolved": "https://registry.npmjs.org/react-textarea-autosize/-/react-textarea-autosize-8.5.3.tgz", + "integrity": "sha512-XT1024o2pqCuZSuBt9FwHlaDeNtVrtCXu0Rnz88t1jUGheCLa3PhjE1GH8Ctm2axEtvdCl5SUHYschyQ0L5QHQ==", "dependencies": { - "@babel/runtime": "^7.10.2", + "@babel/runtime": "^7.20.13", "use-composed-ref": "^1.3.0", "use-latest": "^1.2.1" }, @@ -26603,9 +26871,9 @@ } }, "node_modules/stylis": { - "version": "4.0.13", - "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.0.13.tgz", - "integrity": "sha512-xGPXiFVl4YED9Jh7Euv2V220mriG9u4B2TA6Ybjc1catrstKD2PpIdU3U0RKpkVBC2EhmL/F0sPCr9vrFTNRag==" + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.2.0.tgz", + "integrity": "sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==" }, "node_modules/sugarss": { "version": "2.0.0", @@ -26795,6 +27063,11 @@ "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==" }, + "node_modules/tabbable": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.2.0.tgz", + "integrity": "sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==" + }, "node_modules/table": { "version": "6.7.1", "resolved": "https://registry.npmjs.org/table/-/table-6.7.1.tgz", @@ -27853,6 +28126,26 @@ "node": ">=4" } }, + "node_modules/use-callback-ref": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/use-callback-ref/-/use-callback-ref-1.3.0.tgz", + "integrity": "sha512-3FT9PRuRdbB9HfXhEq35u4oZkvpJ5kuYbpqhCfmiZyReuRgpnhDlbr2ZEnnuS0RrJAPn6l23xjFg9kpDM+Ms7w==", + "dependencies": { + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/use-composed-ref": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/use-composed-ref/-/use-composed-ref-1.3.0.tgz", @@ -27890,6 +28183,27 @@ } } }, + "node_modules/use-sidecar": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/use-sidecar/-/use-sidecar-1.1.2.tgz", + "integrity": "sha512-epTbsLuzZ7lPClpz2TyryBfztm7m+28DlEv2ZCQ3MDr5ssiwyOwGH/e5F9CkfWjJ1t4clvI58yF822/GUkjjhw==", + "dependencies": { + "detect-node-es": "^1.1.0", + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "^16.9.0 || ^17.0.0 || ^18.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -30317,11 +30631,18 @@ } }, "@babel/runtime": { - "version": "7.19.4", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.19.4.tgz", - "integrity": "sha512-EXpLCrk55f+cYqmHsSR+yD/0gAIMxxA9QK9lnQWzhMCvt+YmoBN7Zx94s++Kv0+unHk39vxNO8t+CMA2WSS3wA==", + "version": "7.24.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.5.tgz", + "integrity": "sha512-Nms86NXrsaeU9vbBJKni6gXiEXZ4CVpYVzEjDH9Sb8vmZ3UljyA1GSOJl/6LGPO8EHLuSF9H+IxNXHPX8QHJ4g==", "requires": { - "regenerator-runtime": "^0.13.4" + "regenerator-runtime": "^0.14.0" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" + } } }, "@babel/runtime-corejs3": { @@ -31056,34 +31377,57 @@ } }, "@emotion/babel-plugin": { - "version": "11.7.2", - "resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.7.2.tgz", - "integrity": "sha512-6mGSCWi9UzXut/ZAN6lGFu33wGR3SJisNl3c0tvlmb8XChH1b2SUvxvnOh7hvLpqyRdHHU9AiazV3Cwbk5SXKQ==", - "requires": { - "@babel/helper-module-imports": "^7.12.13", - "@babel/plugin-syntax-jsx": "^7.12.13", - "@babel/runtime": "^7.13.10", - "@emotion/hash": "^0.8.0", - "@emotion/memoize": "^0.7.5", - "@emotion/serialize": "^1.0.2", - "babel-plugin-macros": "^2.6.1", + "version": "11.11.0", + "resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.11.0.tgz", + "integrity": "sha512-m4HEDZleaaCH+XgDDsPF15Ht6wTLsgDTeR3WYj9Q/k76JtWhrJjcP4+/XlG8LGT/Rol9qUfOIztXeA84ATpqPQ==", + "requires": { + "@babel/helper-module-imports": "^7.16.7", + "@babel/runtime": "^7.18.3", + "@emotion/hash": "^0.9.1", + "@emotion/memoize": "^0.8.1", + "@emotion/serialize": "^1.1.2", + "babel-plugin-macros": "^3.1.0", "convert-source-map": "^1.5.0", "escape-string-regexp": "^4.0.0", "find-root": "^1.1.0", "source-map": "^0.5.7", - "stylis": "4.0.13" + "stylis": "4.2.0" + }, + "dependencies": { + "@emotion/hash": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.1.tgz", + "integrity": "sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ==" + }, + "@emotion/memoize": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.8.1.tgz", + "integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==" + } } }, "@emotion/cache": { - "version": "11.7.1", - "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.7.1.tgz", - "integrity": "sha512-r65Zy4Iljb8oyjtLeCuBH8Qjiy107dOYC6SJq7g7GV5UCQWMObY4SJDPGFjiiVpPrOJ2hmJOoBiYTC7hwx9E2A==", + "version": "11.11.0", + "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.11.0.tgz", + "integrity": "sha512-P34z9ssTCBi3e9EI1ZsWpNHcfY1r09ZO0rZbRO2ob3ZQMnFI35jB536qoXbkdesr5EUhYi22anuEJuyxifaqAQ==", "requires": { - "@emotion/memoize": "^0.7.4", - "@emotion/sheet": "^1.1.0", - "@emotion/utils": "^1.0.0", - "@emotion/weak-memoize": "^0.2.5", - "stylis": "4.0.13" + "@emotion/memoize": "^0.8.1", + "@emotion/sheet": "^1.2.2", + "@emotion/utils": "^1.2.1", + "@emotion/weak-memoize": "^0.3.1", + "stylis": "4.2.0" + }, + "dependencies": { + "@emotion/memoize": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.8.1.tgz", + "integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==" + }, + "@emotion/weak-memoize": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.3.1.tgz", + "integrity": "sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww==" + } } }, "@emotion/hash": { @@ -31119,21 +31463,33 @@ } }, "@emotion/serialize": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.0.2.tgz", - "integrity": "sha512-95MgNJ9+/ajxU7QIAruiOAdYNjxZX7G2mhgrtDWswA21VviYIRP1R5QilZ/bDY42xiKsaktP4egJb3QdYQZi1A==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.1.2.tgz", + "integrity": "sha512-zR6a/fkFP4EAcCMQtLOhIgpprZOwNmCldtpaISpvz348+DP4Mz8ZoKaGGCQpbzepNIUWbq4w6hNZkwDyKoS+HA==", "requires": { - "@emotion/hash": "^0.8.0", - "@emotion/memoize": "^0.7.4", - "@emotion/unitless": "^0.7.5", - "@emotion/utils": "^1.0.0", + "@emotion/hash": "^0.9.1", + "@emotion/memoize": "^0.8.1", + "@emotion/unitless": "^0.8.1", + "@emotion/utils": "^1.2.1", "csstype": "^3.0.2" + }, + "dependencies": { + "@emotion/hash": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.1.tgz", + "integrity": "sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ==" + }, + "@emotion/memoize": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.8.1.tgz", + "integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==" + } } }, "@emotion/sheet": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.1.0.tgz", - "integrity": "sha512-u0AX4aSo25sMAygCuQTzS+HsImZFuS8llY8O7b9MDRzbJM0kVJlAz6KNDqcG7pOuQZJmj/8X/rAW+66kMnMW+g==" + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.2.2.tgz", + "integrity": "sha512-0QBtGvaqtWi+nx6doRwDdBIzhNdZrXUppvTM4dtZZWEGTXL/XE/yJxLMGlDT1Gt+UHH5IX1n+jkXyytE/av7OA==" }, "@emotion/styled": { "version": "11.6.0", @@ -31148,14 +31504,14 @@ } }, "@emotion/unitless": { - "version": "0.7.5", - "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.7.5.tgz", - "integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==" + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.8.1.tgz", + "integrity": "sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==" }, "@emotion/utils": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-1.1.0.tgz", - "integrity": "sha512-iRLa/Y4Rs5H/f2nimczYmS5kFJEbpiVvgN3XVfZ022IYhuNA1IRSHEizcof88LtCTXtl9S2Cxt32KgaXEu72JQ==" + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-1.2.1.tgz", + "integrity": "sha512-Y2tGf3I+XVnajdItskUCn6LX+VUDmP6lTL4fcqsXAv43dnlbZiuW4MWQW38rW/BVWSE7Q/7+XQocmpnRYILUmg==" }, "@emotion/weak-memoize": { "version": "0.2.5", @@ -31227,6 +31583,46 @@ } } }, + "@floating-ui/core": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.6.2.tgz", + "integrity": "sha512-+2XpQV9LLZeanU4ZevzRnGFg2neDeKHgFLjP6YLW+tly0IvrhqT4u8enLGjLH3qeh85g19xY5rsAusfwTdn5lg==", + "requires": { + "@floating-ui/utils": "^0.2.0" + } + }, + "@floating-ui/dom": { + "version": "1.6.5", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.5.tgz", + "integrity": "sha512-Nsdud2X65Dz+1RHjAIP0t8z5e2ff/IRbei6BqFrl1urT8sDVzM1HMQ+R0XcU5ceRfyO3I6ayeqIfh+6Wb8LGTw==", + "requires": { + "@floating-ui/core": "^1.0.0", + "@floating-ui/utils": "^0.2.0" + } + }, + "@floating-ui/react": { + "version": "0.26.16", + "resolved": "https://registry.npmjs.org/@floating-ui/react/-/react-0.26.16.tgz", + "integrity": "sha512-HEf43zxZNAI/E781QIVpYSF3K2VH4TTYZpqecjdsFkjsaU1EbaWcM++kw0HXFffj7gDUcBFevX8s0rQGQpxkow==", + "requires": { + "@floating-ui/react-dom": "^2.1.0", + "@floating-ui/utils": "^0.2.0", + "tabbable": "^6.0.0" + } + }, + "@floating-ui/react-dom": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.1.0.tgz", + "integrity": "sha512-lNzj5EQmEKn5FFKc04+zasr09h/uX8RtJRNj5gUXsSQIXHVWTVh+hVAg1vOMCexkX8EgvemMvIFpQfkosnVNyA==", + "requires": { + "@floating-ui/dom": "^1.0.0" + } + }, + "@floating-ui/utils": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.2.tgz", + "integrity": "sha512-J4yDIIthosAsRZ5CPYP/jQvUAQtlZTTD/4suA08/FEnlxqW3sKS9iAhgsa9VYLZ6vDHn/ixJgIqRQPotoBjxIw==" + }, "@gar/promisify": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", @@ -32598,6 +32994,53 @@ "integrity": "sha512-BJwkHlSUgtB+Ei52Ai32M1AOMerSlzyIGA/KC4dAGL+GGwVMdwG8HGCOA2TxP3KjhbgDPMYkv7bt/NmOmRIFng==", "optional": true }, + "@mantine/core": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@mantine/core/-/core-7.8.0.tgz", + "integrity": "sha512-19RKuNdJ/s8pZjy2w2rvTsl4ybi/XM6vf+Kc0WY7kpLFCvdG+/UxNi1MuJF8t2Zs0QSFeb/H5yZQNe0XPbegHw==", + "requires": { + "@floating-ui/react": "^0.26.9", + "clsx": "2.1.0", + "react-number-format": "^5.3.1", + "react-remove-scroll": "^2.5.7", + "react-textarea-autosize": "8.5.3", + "type-fest": "^4.12.0" + }, + "dependencies": { + "clsx": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.0.tgz", + "integrity": "sha512-m3iNNWpd9rl3jvvcBnu70ylMdrXt8Vlq4HYadnU5fwcOtvkSQWPmj7amUcDT2qYI7risszBjI5AUIUox9D16pg==" + }, + "type-fest": { + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.18.2.tgz", + "integrity": "sha512-+suCYpfJLAe4OXS6+PPXjW3urOS4IoP9waSiLuXfLgqZODKw/aWwASvzqE886wA0kQgGy0mIWyhd87VpqIy6Xg==" + } + } + }, + "@mantine/dates": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@mantine/dates/-/dates-7.8.0.tgz", + "integrity": "sha512-9jjiYMwP3jQOpOLKkjhp9uf2BGhtEbOnOzyAlpLOS0CJJlYtB0tO6dJ3JaogrOZ/Yfee7ZUBgouCG5EkR4/qtQ==", + "requires": { + "clsx": "2.1.0" + }, + "dependencies": { + "clsx": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.0.tgz", + "integrity": "sha512-m3iNNWpd9rl3jvvcBnu70ylMdrXt8Vlq4HYadnU5fwcOtvkSQWPmj7amUcDT2qYI7risszBjI5AUIUox9D16pg==" + } + } + }, + "@mantine/hooks": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@mantine/hooks/-/hooks-7.8.0.tgz", + "integrity": "sha512-+70fkgjhVJeJ+nJqnburIM3UAsfvxat1Low9HMPobLbv64FIdB4Nzu5ct3qojNQ58r5sK01tg5UoFIJYslaVrg==", + "peer": true, + "requires": {} + }, "@material-ui/core": { "version": "4.11.2", "resolved": "https://registry.npmjs.org/@material-ui/core/-/core-4.11.2.tgz", @@ -35077,6 +35520,19 @@ "defer-to-connect": "^1.0.1" } }, + "@tabler/icons": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@tabler/icons/-/icons-3.2.0.tgz", + "integrity": "sha512-h8GQ2rtxgiSjltrVz4vcopAxTPSpUSUi5nBfJ09H3Bk4fJk6wZ/dVUjzhv/BHfDwGTkAxZBiYe/Q/T95cPeg5Q==" + }, + "@tabler/icons-react": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@tabler/icons-react/-/icons-react-3.2.0.tgz", + "integrity": "sha512-b1mZT1XpZrzvbM+eFe1YbYbxkzgJ18tM4knZKqXh0gnHDZ6XVLIH3TzJZ3HZ7PTkUqZLZ7XcGae3qQVGburlBw==", + "requires": { + "@tabler/icons": "3.2.0" + } + }, "@testing-library/dom": { "version": "8.20.0", "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-8.20.0.tgz", @@ -36490,27 +36946,13 @@ } }, "babel-plugin-macros": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-2.8.0.tgz", - "integrity": "sha512-SEP5kJpfGYqYKpBrj5XU3ahw5p5GOHJ0U5ssOSQ/WBVdwkD2Dzlce95exQTs3jOVWPPKLBN2rlEWkCK7dSmLvg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz", + "integrity": "sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==", "requires": { - "@babel/runtime": "^7.7.2", - "cosmiconfig": "^6.0.0", - "resolve": "^1.12.0" - }, - "dependencies": { - "cosmiconfig": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", - "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", - "requires": { - "@types/parse-json": "^4.0.0", - "import-fresh": "^3.1.0", - "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.7.2" - } - } + "@babel/runtime": "^7.12.5", + "cosmiconfig": "^7.0.0", + "resolve": "^1.19.0" } }, "babel-plugin-polyfill-corejs2": { @@ -38426,6 +38868,11 @@ "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz", "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==" }, + "detect-node-es": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/detect-node-es/-/detect-node-es-1.1.0.tgz", + "integrity": "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==" + }, "detect-port": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/detect-port/-/detect-port-1.3.0.tgz", @@ -40055,6 +40502,11 @@ "has-symbols": "^1.0.3" } }, + "get-nonce": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-nonce/-/get-nonce-1.0.1.tgz", + "integrity": "sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q==" + }, "get-own-enumerable-property-symbols": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz", @@ -45524,6 +45976,12 @@ "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-2.0.1.tgz", "integrity": "sha512-Kcmo2FhfDTXdcbfDH76N7uBYHINxc/8GW7UAVuVP9I+Va3uHSerrnKV6dLooga/gh7GlgzuCCr/eoldnL1muGw==" }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "dev": true + }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -46431,11 +46889,40 @@ "@babel/runtime": "^7.10.3" } }, + "react-number-format": { + "version": "5.3.4", + "resolved": "https://registry.npmjs.org/react-number-format/-/react-number-format-5.3.4.tgz", + "integrity": "sha512-2hHN5mbLuCDUx19bv0Q8wet67QqYK6xmtLQeY5xx+h7UXiMmRtaCwqko4mMPoKXLc6xAzwRrutg8XbTRlsfjRg==", + "requires": { + "prop-types": "^15.7.2" + } + }, "react-refresh": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.9.0.tgz", "integrity": "sha512-Gvzk7OZpiqKSkxsQvO/mbTN1poglhmAV7gR/DdIrRrSMXraRQQlfikRJOr3Nb9GTMPC5kof948Zy6jJZIFtDvQ==" }, + "react-remove-scroll": { + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.5.7.tgz", + "integrity": "sha512-FnrTWO4L7/Bhhf3CYBNArEG/yROV0tKmTv7/3h9QCFvH6sndeFf1wPqOcbFVu5VAulS5dV1wGT3GZZ/1GawqiA==", + "requires": { + "react-remove-scroll-bar": "^2.3.4", + "react-style-singleton": "^2.2.1", + "tslib": "^2.1.0", + "use-callback-ref": "^1.3.0", + "use-sidecar": "^1.1.2" + } + }, + "react-remove-scroll-bar": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.4.tgz", + "integrity": "sha512-63C4YQBUt0m6ALadE9XV56hV8BgJWDmmTPY758iIJjfQKt2nYwoUrPk0LXRXcB/yIj82T1/Ixfdpdk68LwIB0A==", + "requires": { + "react-style-singleton": "^2.2.1", + "tslib": "^2.0.0" + } + }, "react-router": { "version": "5.3.4", "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz", @@ -46503,6 +46990,16 @@ "react-is": "^16.12.0 || ^17.0.0" } }, + "react-style-singleton": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/react-style-singleton/-/react-style-singleton-2.2.1.tgz", + "integrity": "sha512-ZWj0fHEMyWkHzKYUr2Bs/4zU6XLmq9HsgBURm7g5pAVfyn49DgUiNgY2d4lXRlYSiCif9YBGpQleewkcqddc7g==", + "requires": { + "get-nonce": "^1.0.0", + "invariant": "^2.2.4", + "tslib": "^2.0.0" + } + }, "react-test-renderer": { "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-test-renderer/-/react-test-renderer-17.0.2.tgz", @@ -46515,11 +47012,11 @@ } }, "react-textarea-autosize": { - "version": "8.3.4", - "resolved": "https://registry.npmjs.org/react-textarea-autosize/-/react-textarea-autosize-8.3.4.tgz", - "integrity": "sha512-CdtmP8Dc19xL8/R6sWvtknD/eCXkQr30dtvC4VmGInhRsfF8X/ihXCq6+9l9qbxmKRiq407/7z5fxE7cVWQNgQ==", + "version": "8.5.3", + "resolved": "https://registry.npmjs.org/react-textarea-autosize/-/react-textarea-autosize-8.5.3.tgz", + "integrity": "sha512-XT1024o2pqCuZSuBt9FwHlaDeNtVrtCXu0Rnz88t1jUGheCLa3PhjE1GH8Ctm2axEtvdCl5SUHYschyQ0L5QHQ==", "requires": { - "@babel/runtime": "^7.10.2", + "@babel/runtime": "^7.20.13", "use-composed-ref": "^1.3.0", "use-latest": "^1.2.1" } @@ -48219,9 +48716,9 @@ } }, "stylis": { - "version": "4.0.13", - "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.0.13.tgz", - "integrity": "sha512-xGPXiFVl4YED9Jh7Euv2V220mriG9u4B2TA6Ybjc1catrstKD2PpIdU3U0RKpkVBC2EhmL/F0sPCr9vrFTNRag==" + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.2.0.tgz", + "integrity": "sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==" }, "sugarss": { "version": "2.0.0", @@ -48360,6 +48857,11 @@ "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==" }, + "tabbable": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.2.0.tgz", + "integrity": "sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==" + }, "table": { "version": "6.7.1", "resolved": "https://registry.npmjs.org/table/-/table-6.7.1.tgz", @@ -49099,6 +49601,14 @@ "prepend-http": "^2.0.0" } }, + "use-callback-ref": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/use-callback-ref/-/use-callback-ref-1.3.0.tgz", + "integrity": "sha512-3FT9PRuRdbB9HfXhEq35u4oZkvpJ5kuYbpqhCfmiZyReuRgpnhDlbr2ZEnnuS0RrJAPn6l23xjFg9kpDM+Ms7w==", + "requires": { + "tslib": "^2.0.0" + } + }, "use-composed-ref": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/use-composed-ref/-/use-composed-ref-1.3.0.tgz", @@ -49119,6 +49629,15 @@ "use-isomorphic-layout-effect": "^1.1.1" } }, + "use-sidecar": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/use-sidecar/-/use-sidecar-1.1.2.tgz", + "integrity": "sha512-epTbsLuzZ7lPClpz2TyryBfztm7m+28DlEv2ZCQ3MDr5ssiwyOwGH/e5F9CkfWjJ1t4clvI58yF822/GUkjjhw==", + "requires": { + "detect-node-es": "^1.1.0", + "tslib": "^2.0.0" + } + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", diff --git a/package.json b/package.json index b957156df..511201ade 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,9 @@ "@docusaurus/preset-classic": "2.1.0", "@emotion/react": "11.7.1", "@emotion/styled": "11.6.0", + "@mantine/core": "7.8.0", + "@mantine/dates": "7.8.0", + "@tabler/icons-react": "3.2.0", "@material-ui/core": "4.11.2", "@material-ui/icons": "4.11.2", "@mui/material": "5.4.1", @@ -77,5 +80,8 @@ }, "engines": { "npm": ">=7.0.0" + }, + "devDependencies": { + "process": "^0.11.10" } } diff --git a/packages/uniforms-mantine/README.md b/packages/uniforms-mantine/README.md new file mode 100644 index 000000000..753013ae6 --- /dev/null +++ b/packages/uniforms-mantine/README.md @@ -0,0 +1,11 @@ +# uniforms-mantine + +> Mantine components for `uniforms`. + +## Install + +```sh +$ npm install uniforms-unstyled +``` + +For more in depth documentation see [uniforms.tools](https://uniforms.tools). diff --git a/packages/uniforms-mantine/__tests__/_createContext.ts b/packages/uniforms-mantine/__tests__/_createContext.ts new file mode 100644 index 000000000..e687bc994 --- /dev/null +++ b/packages/uniforms-mantine/__tests__/_createContext.ts @@ -0,0 +1,38 @@ +import { SimpleSchemaDefinition } from 'simpl-schema'; +import { Context, UnknownObject, randomIds, ChangedMap } from 'uniforms'; + +import createSchema from './_createSchema'; + +const randomId = randomIds(); + +export default function createContext( + schema?: SimpleSchemaDefinition, + context?: Partial>, + model = {} as Model, +): { context: Context } { + return { + context: { + changed: false, + changedMap: {} as ChangedMap, + error: null, + model, + name: [], + onChange() {}, + onSubmit() {}, + randomId, + submitted: false, + submitting: false, + validating: false, + ...context, + schema: createSchema(schema), + state: { + disabled: false, + readOnly: false, + showInlineError: false, + ...context?.state, + }, + // @ts-expect-error We don't have a true ref in tests. + formRef: null, + }, + }; +} diff --git a/packages/uniforms-mantine/__tests__/_createSchema.ts b/packages/uniforms-mantine/__tests__/_createSchema.ts new file mode 100644 index 000000000..6ac1ef72b --- /dev/null +++ b/packages/uniforms-mantine/__tests__/_createSchema.ts @@ -0,0 +1,6 @@ +import SimpleSchema, { SimpleSchemaDefinition } from 'simpl-schema'; +import { SimpleSchema2Bridge } from 'uniforms-bridge-simple-schema-2'; + +export default function createSchema(schema: SimpleSchemaDefinition = {}) { + return new SimpleSchema2Bridge({ schema: new SimpleSchema(schema) }); +} diff --git a/packages/uniforms-mantine/__tests__/index.ts b/packages/uniforms-mantine/__tests__/index.ts new file mode 100644 index 000000000..98de11a8e --- /dev/null +++ b/packages/uniforms-mantine/__tests__/index.ts @@ -0,0 +1,63 @@ +import * as theme from 'uniforms-unstyled'; +import * as suites from 'uniforms/__suites__'; + +it('exports everything', () => { + expect(theme).toEqual({ + AutoFields: expect.any(Function), + AutoField: expect.any(Function), + AutoForm: expect.any(Function), + BaseForm: expect.any(Function), + BoolField: expect.any(Function), + DateField: expect.any(Function), + ErrorField: expect.any(Function), + ErrorsField: expect.any(Function), + HiddenField: expect.any(Function), + ListAddField: expect.any(Function), + ListDelField: expect.any(Function), + ListField: expect.any(Function), + ListItemField: expect.any(Function), + LongTextField: expect.any(Function), + NestField: expect.any(Function), + NumField: expect.any(Function), + QuickForm: expect.any(Function), + RadioField: expect.any(Function), + SelectField: expect.any(Function), + SubmitField: expect.any(Function), + TextField: expect.any(Function), + ValidatedForm: expect.any(Function), + ValidatedQuickForm: expect.any(Function), + }); +}); + +describe('@RTL', () => { + suites.testAutoField(theme.AutoField, { + getDateField: screen => screen.getByLabelText('X'), + getSelectField: screen => screen.getByRole('combobox'), + }); + suites.testAutoForm(theme.AutoForm); + suites.testBaseForm(theme.BaseForm); + suites.testBoolField(theme.BoolField); + suites.testDateField(theme.DateField); + suites.testErrorField(theme.ErrorField); + suites.testErrorsField(theme.ErrorsField); + suites.testHiddenField(theme.HiddenField); + suites.testListAddField(theme.ListAddField); + suites.testListDelField(theme.ListDelField); + suites.testListField(theme.ListField, { + getListAddField: screen => screen.getByRole('button'), + }); + suites.testLongTextField(theme.LongTextField, { + skipShowInlineErrorTests: true, + }); + suites.testNestField(theme.NestField, { + skipShowInlineErrorTests: true, + skipErrorMessageTests: true, + }); + suites.testNumField(theme.NumField); + suites.testQuickForm(theme.QuickForm); + suites.testRadioField(theme.RadioField); + suites.testSubmitField(theme.SubmitField); + suites.testTextField(theme.TextField); + suites.testValidatedForm(theme.ValidatedForm); + suites.testValidatedQuickForm(theme.ValidatedQuickForm); +}); diff --git a/packages/uniforms-mantine/package.json b/packages/uniforms-mantine/package.json new file mode 100644 index 000000000..9f8f3d6cd --- /dev/null +++ b/packages/uniforms-mantine/package.json @@ -0,0 +1,40 @@ +{ + "name": "uniforms-mantine", + "version": "4.0.0-alpha.5", + "license": "MIT", + "main": "./cjs/index.js", + "module": "./esm/index.js", + "sideEffects": false, + "description": "Mantine components for uniforms.", + "repository": "https://github.com/vazco/uniforms/tree/master/packages/uniforms-mantine", + "bugs": "https://github.com/vazco/uniforms/issues", + "funding": "https://github.com/vazco/uniforms?sponsor=1", + "keywords": [ + "form", + "forms", + "meteor", + "react", + "react-component", + "schema", + "validation" + ], + "files": [ + "cjs/*.d.ts", + "cjs/*.js", + "esm/*.d.ts", + "esm/*.js", + "src/*.ts", + "src/*.tsx" + ], + "peerDependencies": { + "@tabler/icons-react": "^2.0.0", + "@mantine/core": "^7.0.0", + "react": "^18.0.0 || ^17.0.0 || ^16.8.0" + }, + "dependencies": { + "invariant": "^2.0.0", + "lodash": "^4.0.0", + "tslib": "^2.2.0", + "uniforms": "^4.0.0-alpha.5" + } +} diff --git a/packages/uniforms-mantine/src/AutoField.tsx b/packages/uniforms-mantine/src/AutoField.tsx new file mode 100644 index 000000000..806c6fd64 --- /dev/null +++ b/packages/uniforms-mantine/src/AutoField.tsx @@ -0,0 +1,33 @@ +import invariant from 'invariant'; +import { createAutoField } from 'uniforms'; +export { AutoFieldProps } from 'uniforms'; + +import BoolField from './BoolField'; +import ListField from './ListField'; +import NestField from './NestField'; +import NumField from './NumField'; +import SelectField from './SelectField'; +import TextField from './TextField'; + +const AutoField = createAutoField(props => { + if (props.allowedValues) { + return SelectField; + } + + switch (props.fieldType) { + case Array: + return ListField; + case Boolean: + return BoolField; + case Number: + return NumField; + case Object: + return NestField; + case String: + return TextField; + } + + return invariant(false, 'Unsupported field type: %s', props.fieldType); +}); + +export default AutoField; diff --git a/packages/uniforms-mantine/src/AutoFields.tsx b/packages/uniforms-mantine/src/AutoFields.tsx new file mode 100644 index 000000000..0e5797226 --- /dev/null +++ b/packages/uniforms-mantine/src/AutoFields.tsx @@ -0,0 +1,29 @@ +import { ComponentType, createElement } from 'react'; +import { useForm } from 'uniforms'; + +import AutoField from './AutoField'; + +export type AutoFieldsProps = { + autoField?: ComponentType<{ name: string }>; + element?: ComponentType | string; + fields?: string[]; + omitFields?: string[]; +}; + +export default function AutoFields({ + autoField = AutoField, + element = 'div', + fields, + omitFields = [], + ...props +}: AutoFieldsProps) { + const { schema } = useForm(); + + return createElement( + element, + props, + (fields ?? schema.getSubfields()) + .filter(field => !omitFields.includes(field)) + .map(field => createElement(autoField, { key: field, name: field })), + ); +} diff --git a/packages/uniforms-mantine/src/AutoForm.tsx b/packages/uniforms-mantine/src/AutoForm.tsx new file mode 100644 index 000000000..ea8321711 --- /dev/null +++ b/packages/uniforms-mantine/src/AutoForm.tsx @@ -0,0 +1,13 @@ +import { AutoForm } from 'uniforms'; + +import ValidatedQuickForm from './ValidatedQuickForm'; + +function Auto(parent: any) { + class _ extends AutoForm.Auto(parent) { + static Auto = Auto; + } + + return _ as unknown as AutoForm; +} + +export default Auto(ValidatedQuickForm); diff --git a/packages/uniforms-mantine/src/BaseForm.tsx b/packages/uniforms-mantine/src/BaseForm.tsx new file mode 100644 index 000000000..716b1305c --- /dev/null +++ b/packages/uniforms-mantine/src/BaseForm.tsx @@ -0,0 +1,13 @@ +import { BaseForm } from 'uniforms'; + +function Mantine(parent: any) { + class _ extends parent { + static Mantine = Mantine; + + static displayName = `Mantine${parent.displayName}`; + } + + return _ as unknown as typeof BaseForm; +} + +export default Mantine(BaseForm); diff --git a/packages/uniforms-mantine/src/BoolField.tsx b/packages/uniforms-mantine/src/BoolField.tsx new file mode 100644 index 000000000..77d6b571d --- /dev/null +++ b/packages/uniforms-mantine/src/BoolField.tsx @@ -0,0 +1,39 @@ +import { Checkbox, CheckboxProps } from '@mantine/core'; +import React, { Ref } from 'react'; +import { connectField, filterDOMProps, FieldProps } from 'uniforms'; + +export type BoolFieldProps = FieldProps< + boolean, + CheckboxProps, + { inputRef?: Ref } +>; + +function Bool({ + disabled, + showInlineError, + error, + errorMessage, + inputRef, + name, + onChange, + readOnly, + value, + label, + ...props +}: BoolFieldProps) { + return ( + (readOnly ? undefined : onChange(!value))} + ref={inputRef} + label={label} + {...filterDOMProps(props)} + /> + ); +} + +export default connectField(Bool, { kind: 'leaf' }); diff --git a/packages/uniforms-mantine/src/DateField.tsx b/packages/uniforms-mantine/src/DateField.tsx new file mode 100644 index 000000000..007c17385 --- /dev/null +++ b/packages/uniforms-mantine/src/DateField.tsx @@ -0,0 +1,75 @@ +import { DateInput, DateTimePicker, DateInputProps } from '@mantine/dates'; +import React, { RefObject } from 'react'; +import { connectField, filterDOMProps, FieldProps } from 'uniforms'; + +type DateFieldType = 'date' | 'datetime-local'; + +type DateFieldInputProps = Omit & { + inputRef?: RefObject; + max?: Date; + min?: Date; + type?: DateFieldType; +}; + +type DateFieldProps = FieldProps; + +function Date({ + disabled, + inputRef, + label, + max, + min, + name, + onChange, + placeholder, + readOnly, + value, + type = 'datetime-local', + ...props +}: DateFieldProps) { + if (type === 'date') { + return ( + + readOnly + ? undefined + : date === null + ? onChange(undefined) + : onChange(date) + } + placeholder={placeholder} + ref={inputRef as RefObject} + value={value} + {...filterDOMProps(props)} + /> + ); + } + + return ( + } + value={value} + onChange={(date: Date) => + readOnly + ? undefined + : date === null + ? onChange(undefined) + : onChange(date) + } + /> + ); +} + +export default connectField(Date, { kind: 'leaf' }); diff --git a/packages/uniforms-mantine/src/ErrorField.tsx b/packages/uniforms-mantine/src/ErrorField.tsx new file mode 100644 index 000000000..09269f604 --- /dev/null +++ b/packages/uniforms-mantine/src/ErrorField.tsx @@ -0,0 +1,23 @@ +import React, { HTMLProps } from 'react'; +import { Override, connectField, filterDOMProps } from 'uniforms'; + +type ErrorType = { + message: string; + code: number; +}; + +export type ErrorFieldProps = Override< + Omit, 'onChange'>, + { error?: ErrorType; errorMessage?: string } +>; + +function Error({ children, error, errorMessage, ...props }: ErrorFieldProps) { + return !error ? null : ( +
{children || errorMessage}
+ ); +} + +export default connectField(Error, { + initialValue: false, + kind: 'leaf', +}); diff --git a/packages/uniforms-mantine/src/ErrorsField.tsx b/packages/uniforms-mantine/src/ErrorsField.tsx new file mode 100644 index 000000000..8d7012164 --- /dev/null +++ b/packages/uniforms-mantine/src/ErrorsField.tsx @@ -0,0 +1,20 @@ +import { List } from '@mantine/core'; +import React, { HTMLProps } from 'react'; +import { filterDOMProps, useForm } from 'uniforms'; + +export type ErrorsFieldProps = HTMLProps; + +export default function ErrorsField(props: ErrorsFieldProps) { + const { error, schema } = useForm(); + return !error && !props.children ? null : ( +
+ {props.children} + + + {schema.getErrorMessages(error).map((message, index) => ( + {message} + ))} + +
+ ); +} diff --git a/packages/uniforms-mantine/src/HiddenField.tsx b/packages/uniforms-mantine/src/HiddenField.tsx new file mode 100644 index 000000000..4acce1e46 --- /dev/null +++ b/packages/uniforms-mantine/src/HiddenField.tsx @@ -0,0 +1,36 @@ +import { TextInput } from '@mantine/core'; +import React, { HTMLProps, Ref, useEffect } from 'react'; +import { Override, filterDOMProps, useField } from 'uniforms'; + +export type HiddenFieldProps = Override< + HTMLProps, + { + inputRef?: Ref; + name: string; + noDOM?: boolean; + value?: unknown; + } +>; + +export default function HiddenField({ value, ...rawProps }: HiddenFieldProps) { + const props = useField(rawProps.name, rawProps, { initialValue: false })[0]; + + useEffect(() => { + if (value !== undefined && value !== props.value) { + props.onChange(value); + } + }); + + return props.noDOM ? null : ( + + ); +} diff --git a/packages/uniforms-mantine/src/ListAddField.tsx b/packages/uniforms-mantine/src/ListAddField.tsx new file mode 100644 index 000000000..c0ae697b0 --- /dev/null +++ b/packages/uniforms-mantine/src/ListAddField.tsx @@ -0,0 +1,67 @@ +import { Button, ButtonProps } from '@mantine/core'; +import { IconSquarePlus } from '@tabler/icons-react'; +import cloneDeep from 'lodash/cloneDeep'; +import React from 'react'; +import { + FieldProps, + connectField, + filterDOMProps, + joinName, + useField, +} from 'uniforms'; + +export type ListAddFieldProps = FieldProps< + unknown, + ButtonProps, + { icon?: JSX.Element; reversed?: boolean } +>; + +function ListAdd({ + disabled, + icon = , + name, + readOnly, + size = 'sm', + value, + variant = 'outline', + reversed = false, + ...props +}: ListAddFieldProps) { + const nameParts = joinName(null, name); + const parentName = joinName(nameParts.slice(0, -1)); + const parent = useField<{ maxCount?: number }, unknown[]>( + parentName, + {}, + { absoluteName: true }, + )[0]; + + const limitNotReached = + !disabled && !(parent.maxCount! <= parent.value!.length); + + return ( + + ); +} + +export default connectField(ListAdd, { + initialValue: false, + kind: 'leaf', +}); diff --git a/packages/uniforms-mantine/src/ListDelField.tsx b/packages/uniforms-mantine/src/ListDelField.tsx new file mode 100644 index 000000000..80fda09aa --- /dev/null +++ b/packages/uniforms-mantine/src/ListDelField.tsx @@ -0,0 +1,51 @@ +import { ActionIcon, ActionIconProps } from '@mantine/core'; +import { IconTrash } from '@tabler/icons-react'; +import React from 'react'; +import { + FieldProps, + connectField, + filterDOMProps, + joinName, + useField, +} from 'uniforms'; + +export type ListDelFieldProps = FieldProps; + +function ListDel({ + disabled, + name, + readOnly, + icon = , + ...props +}: ListDelFieldProps) { + const nameParts = joinName(null, name); + const nameIndex = +nameParts[nameParts.length - 1]; + const parentName = joinName(nameParts.slice(0, -1)); + const parent = useField<{ minCount?: number }, unknown[]>( + parentName, + {}, + { absoluteName: true }, + )[0]; + + disabled ||= readOnly || parent.minCount! >= parent.value!.length; + + return ( + { + const value = parent.value!.slice(); + value.splice(nameIndex, 1); + parent.onChange(value); + }} + > + {icon} + + ); +} + +export default connectField(ListDel, { + initialValue: false, + kind: 'leaf', +}); diff --git a/packages/uniforms-mantine/src/ListField.tsx b/packages/uniforms-mantine/src/ListField.tsx new file mode 100644 index 000000000..d7e5fd75c --- /dev/null +++ b/packages/uniforms-mantine/src/ListField.tsx @@ -0,0 +1,69 @@ +import { Input, List as ListMantine, ListProps, Tooltip } from '@mantine/core'; +import React, { Children, cloneElement, isValidElement } from 'react'; +import { FieldProps, connectField, filterDOMProps } from 'uniforms'; + +import ListAddField from './ListAddField'; +import ListItemField from './ListItemField'; + +export type ListFieldProps = FieldProps< + unknown[], + ListProps, + { + itemProps?: object; + required?: boolean; + reversed?: boolean; + tooltip?: string; + children?: + | React.ReactElement<{ name?: string }> + | React.ReactElement<{ name?: string }>[]; + } +>; + +function List({ + children = , + error, + errorMessage, + itemProps, + label, + required, + showInlineError, + value, + tooltip, + ...props +}: ListFieldProps) { + return ( + + {label} + {tooltip && {tooltip}} + + ) : ( + label + ) + } + required={tooltip ? false : required} + error={showInlineError && !!error && errorMessage} + > + + {value?.map((item, itemIndex) => + Children.map(children, (child, childIndex) => + isValidElement(child) + ? cloneElement(child, { + key: `${itemIndex}-${childIndex}`, + name: child.props.name?.replace('$', '' + itemIndex), + ...itemProps, + }) + : child, + ), + )} + + + + ); +} + +export default connectField(List); diff --git a/packages/uniforms-mantine/src/ListItemField.tsx b/packages/uniforms-mantine/src/ListItemField.tsx new file mode 100644 index 000000000..63c2a2f51 --- /dev/null +++ b/packages/uniforms-mantine/src/ListItemField.tsx @@ -0,0 +1,31 @@ +import { List, Group, Box } from '@mantine/core'; +import React, { ReactNode } from 'react'; +import { connectField } from 'uniforms'; + +import AutoField from './AutoField'; +import ListDelField from './ListDelField'; + +export type ListItemFieldProps = { children?: ReactNode; value?: unknown }; + +function ListItem({ + children = , +}: ListItemFieldProps) { + return ( + + + {children} + + + + + + ); +} + +export default connectField(ListItem, { + initialValue: false, +}); diff --git a/packages/uniforms-mantine/src/LongTextField.tsx b/packages/uniforms-mantine/src/LongTextField.tsx new file mode 100644 index 000000000..9c714ed18 --- /dev/null +++ b/packages/uniforms-mantine/src/LongTextField.tsx @@ -0,0 +1,39 @@ +import { Textarea, TextareaProps } from '@mantine/core'; +import React, { ChangeEvent, Ref } from 'react'; +import { FieldProps, connectField, filterDOMProps } from 'uniforms'; + +export type LongTextFieldProps = FieldProps< + string, + TextareaProps, + { inputRef?: Ref } +>; + +function LongText({ + disabled, + inputRef, + label, + name, + onChange, + placeholder, + readOnly, + value, + ...props +}: LongTextFieldProps) { + return ( +