From adb812280d7c175778bcb4331403f058ee0af469 Mon Sep 17 00:00:00 2001 From: RustamRu Date: Sun, 19 Jan 2025 15:29:58 +0300 Subject: [PATCH] feat: create order stubs (#65) --- locales/en.json | 5 +- locales/ru.json | 5 +- package-lock.json | 1302 ++--------------- package.json | 2 +- src/api/index.ts | 1 + src/api/landing.ts | 25 - src/api/landing.tsx | 107 ++ src/api/types.ts | 22 + .../form/car-body/car-body-select.tsx | 4 +- src/components/order-form/form/helper.ts | 51 - src/components/order-form/form/index.ts | 1 + src/components/order-form/form/order-form.tsx | 17 +- src/components/order-form/form/types.ts | 7 + .../order-view/details/order-details.tsx | 22 +- .../LandingThemeProvider.tsx | 21 +- src/containers/LandingThemeProvider/index.ts | 2 +- .../LandingThemeProvider/toast-options.ts | 8 + src/models/api/index.ts | 2 +- src/models/api/order-view.ts | 14 - src/models/api/order.ts | 18 + src/models/common.ts | 1 + src/models/landing/car.ts | 2 +- src/models/landing/order.ts | 14 +- src/models/landing/washing.ts | 8 +- src/pages/order-create/helper.ts | 29 + src/pages/order-create/index.tsx | 69 +- src/pages/order-view/helper.tsx | 40 - src/pages/order-view/index.tsx | 87 +- stubs/json/landing-order-view/1-success.json | 21 +- 29 files changed, 540 insertions(+), 1367 deletions(-) create mode 100644 src/api/index.ts delete mode 100644 src/api/landing.ts create mode 100644 src/api/landing.tsx create mode 100644 src/api/types.ts create mode 100644 src/containers/LandingThemeProvider/toast-options.ts delete mode 100644 src/models/api/order-view.ts create mode 100644 src/models/api/order.ts create mode 100644 src/models/common.ts create mode 100644 src/pages/order-create/helper.ts delete mode 100644 src/pages/order-view/helper.tsx diff --git a/locales/en.json b/locales/en.json index a185c8c..22ad871 100644 --- a/locales/en.json +++ b/locales/en.json @@ -39,9 +39,10 @@ "dry-wash.order-create.car-body-select.options.sports-car" : "Sports-car", "dry-wash.order-create.car-body-select.options.other": "Other", "dry-wash.order-create.form.submit-button.label": "Submit", + "dry-wash.order-create.create-order-query.success.title": "The order is successfully created", + "dry-wash.order-create.create-order-query.error.title": "Failed to create an order", "dry-wash.order-view.title": "Your order", - "dry-wash.order-view.error.title": "Error", - "dry-wash.order-view.fetch.error": "Failed to fetch the details of order #{{number}}", + "dry-wash.order-view.get-order-query.error.title": "Failed to fetch the details of order #{{number}}", "dry-wash.order-view.details.title": "Order #{{number}}", "dry-wash.order-view.details.owner": "Owner", "dry-wash.order-view.details.car": "Car", diff --git a/locales/ru.json b/locales/ru.json index 06c21ff..6ff912a 100644 --- a/locales/ru.json +++ b/locales/ru.json @@ -78,9 +78,10 @@ "dry-wash.order-create.car-body-select.options.sports-car": "Спорткар", "dry-wash.order-create.car-body-select.options.other": "Другой", "dry-wash.order-create.form.submit-button.label": "Отправить", + "dry-wash.order-create.create-order-query.success.title": "Заказ успешно создан", + "dry-wash.order-create.create-order-query.error.title": "Не удалось создать заказ", "dry-wash.order-view.title": "Ваш заказ", - "dry-wash.order-view.error.title": "Ошибка", - "dry-wash.order-view.fetch.error": "Не удалось загрузить детали заказа №{{number}}", + "dry-wash.order-view.get-order-query.error.title": "Не удалось загрузить детали заказа №{{number}}", "dry-wash.order-view.details.title": "Заказ №{{number}}", "dry-wash.order-view.details.owner": "Владелец", "dry-wash.order-view.details.car": "Автомобиль", diff --git a/package-lock.json b/package-lock.json index 2dc8437..7ed9811 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@brojs/cli": "^1.6.3", "@chakra-ui/icons": "^2.2.4", - "@chakra-ui/react": "^2.4.2", + "@chakra-ui/react": "^2.10.5", "@emotion/react": "^11.4.1", "@emotion/styled": "^11.3.0", "@fontsource/open-sans": "^5.1.0", @@ -1771,281 +1771,27 @@ "webpack-merge": "5.7.2" } }, - "node_modules/@chakra-ui/accordion": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@chakra-ui/accordion/-/accordion-2.1.4.tgz", - "integrity": "sha512-PQFW6kr+Bdru0DjKA8akC4BAz1VAJisLgo4TsJwjPO2gTS0zr99C+3bBs9uoDnjSJAf18/Q5zdXv11adA8n2XA==", - "dependencies": { - "@chakra-ui/descendant": "3.0.11", - "@chakra-ui/icon": "3.0.13", - "@chakra-ui/react-context": "2.0.5", - "@chakra-ui/react-use-controllable-state": "2.0.6", - "@chakra-ui/react-use-merge-refs": "2.0.5", - "@chakra-ui/transition": "2.0.12" - }, - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "framer-motion": ">=4.0.0", - "react": ">=18" - } - }, - "node_modules/@chakra-ui/alert": { - "version": "2.0.13", - "resolved": "https://registry.npmjs.org/@chakra-ui/alert/-/alert-2.0.13.tgz", - "integrity": "sha512-7LqPv6EUBte4XM/Q2qBFIT5o4BC0dSlni9BHOH2BgAc5B1NF+pBAMDTUH7JNBiN7RHTV7EHAIWDziiX/NK28+Q==", - "dependencies": { - "@chakra-ui/icon": "3.0.13", - "@chakra-ui/react-context": "2.0.5", - "@chakra-ui/spinner": "2.0.11" - }, - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "react": ">=18" - } - }, "node_modules/@chakra-ui/anatomy": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@chakra-ui/anatomy/-/anatomy-2.1.0.tgz", - "integrity": "sha512-E3jMPGqKuGTbt7mKtc8g/MOOenw2c4wqRC1vOypyFgmC8wsewdY+DJJNENF3atXAK7p5VMBKQfZ7ipNlHnDAwA==" - }, - "node_modules/@chakra-ui/avatar": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@chakra-ui/avatar/-/avatar-2.2.1.tgz", - "integrity": "sha512-sgiogfLM8vas8QJTt7AJI4XxNXYdViCWj+xYJwyOwUN93dWKImqqx3O2ihCXoXTIqQWg1rcEgoJ5CxCg6rQaQQ==", - "dependencies": { - "@chakra-ui/image": "2.0.12", - "@chakra-ui/react-children-utils": "2.0.4", - "@chakra-ui/react-context": "2.0.5" - }, - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "react": ">=18" - } - }, - "node_modules/@chakra-ui/breadcrumb": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@chakra-ui/breadcrumb/-/breadcrumb-2.1.1.tgz", - "integrity": "sha512-OSa+F9qJ1xmF0zVxC1GU46OWbbhGf0kurHioSB729d+tRw/OMzmqrrfCJ7KVUUN8NEnTZXT5FIgokMvHGEt+Hg==", - "dependencies": { - "@chakra-ui/react-children-utils": "2.0.4", - "@chakra-ui/react-context": "2.0.5" - }, - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "react": ">=18" - } - }, - "node_modules/@chakra-ui/breakpoint-utils": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@chakra-ui/breakpoint-utils/-/breakpoint-utils-2.0.5.tgz", - "integrity": "sha512-8uhrckMwoR/powlAhxiFZPM0s8vn0B2yEyEaRcwpy5NmRAJSTEotC2WkSyQl/Cjysx9scredumB5g+fBX7IqGQ==" - }, - "node_modules/@chakra-ui/button": { - "version": "2.0.13", - "resolved": "https://registry.npmjs.org/@chakra-ui/button/-/button-2.0.13.tgz", - "integrity": "sha512-T9W/zHpHZVcbx/BMg0JIXCgRycut/eYoTYee/E+eBxyPCH45n308AsYU2bZ8TgZxUwbYNRgMp4qRL/KHUQDv5g==", - "dependencies": { - "@chakra-ui/react-context": "2.0.5", - "@chakra-ui/react-use-merge-refs": "2.0.5", - "@chakra-ui/spinner": "2.0.11" - }, - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "react": ">=18" - } - }, - "node_modules/@chakra-ui/card": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@chakra-ui/card/-/card-2.1.1.tgz", - "integrity": "sha512-vvmfuNn6gkfv6bGcXQe6kvWHspziPZgYnnffiEjPaZYtaf98WRszpjyPbFv0oQR/2H1RSE1oaTqa/J1rHrzw3A==", - "dependencies": { - "@chakra-ui/react-context": "2.0.5" - }, - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "react": ">=18" - } - }, - "node_modules/@chakra-ui/checkbox": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/@chakra-ui/checkbox/-/checkbox-2.2.5.tgz", - "integrity": "sha512-7fNH+Q2nB2uMSnYAPtYxnuwZ1MOJqblZHa/ScfZ/fjiPDyEae1m068ZP/l9yJ5zlawYMTkp83m/JVcu5QFYurA==", - "dependencies": { - "@chakra-ui/form-control": "2.0.13", - "@chakra-ui/react-context": "2.0.5", - "@chakra-ui/react-types": "2.0.5", - "@chakra-ui/react-use-callback-ref": "2.0.5", - "@chakra-ui/react-use-controllable-state": "2.0.6", - "@chakra-ui/react-use-merge-refs": "2.0.5", - "@chakra-ui/react-use-safe-layout-effect": "2.0.3", - "@chakra-ui/react-use-update-effect": "2.0.5", - "@chakra-ui/visually-hidden": "2.0.13", - "@zag-js/focus-visible": "0.1.0" - }, - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "react": ">=18" - } - }, - "node_modules/@chakra-ui/clickable": { - "version": "2.0.11", - "resolved": "https://registry.npmjs.org/@chakra-ui/clickable/-/clickable-2.0.11.tgz", - "integrity": "sha512-5Y2dl5cxNgOxHbjxyxsL6Vdze4wUUvwsMCCW3kXwgz2OUI2y5UsBZNcvhNJx3RchJEd0fylMKiKoKmnZMHN2aw==", - "dependencies": { - "@chakra-ui/react-use-merge-refs": "2.0.5" - }, - "peerDependencies": { - "react": ">=18" - } - }, - "node_modules/@chakra-ui/close-button": { - "version": "2.0.13", - "resolved": "https://registry.npmjs.org/@chakra-ui/close-button/-/close-button-2.0.13.tgz", - "integrity": "sha512-ZI/3p84FPlW0xoDCZYqsnIvR6bTc2d/TlhwyTHsDDxq9ZOWp9c2JicVn6WTdWGdshk8itnZZdG50IcnizGnimA==", - "dependencies": { - "@chakra-ui/icon": "3.0.13" - }, - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "react": ">=18" - } - }, - "node_modules/@chakra-ui/color-mode": { - "version": "2.1.10", - "resolved": "https://registry.npmjs.org/@chakra-ui/color-mode/-/color-mode-2.1.10.tgz", - "integrity": "sha512-aUPouOUPn7IPm1v00/9AIkRuNrkCwJlbjVL1kJzLzxijYjbHvEHPxntITt+JWjtXPT8xdOq6mexLYCOGA67JwQ==", - "dependencies": { - "@chakra-ui/react-use-safe-layout-effect": "2.0.3" - }, - "peerDependencies": { - "react": ">=18" - } - }, - "node_modules/@chakra-ui/control-box": { - "version": "2.0.11", - "resolved": "https://registry.npmjs.org/@chakra-ui/control-box/-/control-box-2.0.11.tgz", - "integrity": "sha512-UJb4vqq+/FPuwTCuaPeHa2lwtk6u7eFvLuwDCST2e/sBWGJC1R+1/Il5pHccnWs09FWxyZ9v/Oxkg/CG3jZR4Q==", - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "react": ">=18" - } - }, - "node_modules/@chakra-ui/counter": { - "version": "2.0.11", - "resolved": "https://registry.npmjs.org/@chakra-ui/counter/-/counter-2.0.11.tgz", - "integrity": "sha512-1YRt/jom+m3iWw9J9trcM6rAHDvD4lwThiO9raxUK7BRsYUhnPZvsMpcXU1Moax218C4rRpbI9KfPLaig0m1xQ==", - "dependencies": { - "@chakra-ui/number-utils": "2.0.5", - "@chakra-ui/react-use-callback-ref": "2.0.5" - }, - "peerDependencies": { - "react": ">=18" - } - }, - "node_modules/@chakra-ui/css-reset": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/@chakra-ui/css-reset/-/css-reset-2.0.10.tgz", - "integrity": "sha512-FwHOfw2P4ckbpSahDZef2KoxcvHPUg09jlicWdp24/MjdsOO5PAB/apm2UBvQflY4WAJyOqYaOdnXFlR6nF4cQ==", - "peerDependencies": { - "@emotion/react": ">=10.0.35", - "react": ">=18" - } - }, - "node_modules/@chakra-ui/descendant": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/@chakra-ui/descendant/-/descendant-3.0.11.tgz", - "integrity": "sha512-sNLI6NS6uUgrvYS6Imhoc1YlI6bck6pfxMBJcnXVSfdIjD6XjCmeY2YgzrtDS+o+J8bB3YJeIAG/vsVy5USE5Q==", - "dependencies": { - "@chakra-ui/react-context": "2.0.5", - "@chakra-ui/react-use-merge-refs": "2.0.5" - }, - "peerDependencies": { - "react": ">=18" - } - }, - "node_modules/@chakra-ui/dom-utils": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@chakra-ui/dom-utils/-/dom-utils-2.0.4.tgz", - "integrity": "sha512-P936+WKinz5fgHzfwiUQjE/t7NC8bU89Tceim4tbn8CIm/9b+CsHX64eNw4vyJqRwt78TXQK7aGBIbS18R0q5Q==" - }, - "node_modules/@chakra-ui/editable": { - "version": "2.0.16", - "resolved": "https://registry.npmjs.org/@chakra-ui/editable/-/editable-2.0.16.tgz", - "integrity": "sha512-kIFPufzIlViNv7qi2PxxWWBvjLb+3IP5hUGmqOA9qcYz5TAdqblQqDClm0iajlIDNUFWnS4h056o8jKsQ42a5A==", - "dependencies": { - "@chakra-ui/react-context": "2.0.5", - "@chakra-ui/react-types": "2.0.5", - "@chakra-ui/react-use-callback-ref": "2.0.5", - "@chakra-ui/react-use-controllable-state": "2.0.6", - "@chakra-ui/react-use-focus-on-pointer-down": "2.0.4", - "@chakra-ui/react-use-merge-refs": "2.0.5", - "@chakra-ui/react-use-safe-layout-effect": "2.0.3", - "@chakra-ui/react-use-update-effect": "2.0.5", - "@chakra-ui/shared-utils": "2.0.3" - }, - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "react": ">=18" - } - }, - "node_modules/@chakra-ui/event-utils": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@chakra-ui/event-utils/-/event-utils-2.0.6.tgz", - "integrity": "sha512-ZIoqUbgJ5TcCbZRchMv4n7rOl1JL04doMebED88LO5mux36iVP9er/nnOY4Oke1bANKKURMrQf5VTT9hoYeA7A==" - }, - "node_modules/@chakra-ui/focus-lock": { - "version": "2.0.13", - "resolved": "https://registry.npmjs.org/@chakra-ui/focus-lock/-/focus-lock-2.0.13.tgz", - "integrity": "sha512-AVSJt+3Ukia/m9TCZZgyWvTY7pw88jArivWVJ2gySGYYIs6z/FJMnlwbCVldV2afS0g3cYaii7aARb/WrlG34Q==", - "dependencies": { - "@chakra-ui/dom-utils": "2.0.4", - "react-focus-lock": "^2.9.1" - }, - "peerDependencies": { - "react": ">=18" - } - }, - "node_modules/@chakra-ui/form-control": { - "version": "2.0.13", - "resolved": "https://registry.npmjs.org/@chakra-ui/form-control/-/form-control-2.0.13.tgz", - "integrity": "sha512-J964JlgrxP+LP3kYmLk1ttbl73u6ghT+JQDjEjkEUc8lSS9Iv4u9XkRDQHuz2t2y0KHjQdH12PUfUfBqcITbYw==", - "dependencies": { - "@chakra-ui/icon": "3.0.13", - "@chakra-ui/react-context": "2.0.5", - "@chakra-ui/react-types": "2.0.5", - "@chakra-ui/react-use-merge-refs": "2.0.5" - }, - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "react": ">=18" - } + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@chakra-ui/anatomy/-/anatomy-2.3.5.tgz", + "integrity": "sha512-3im33cUOxCbISjaBlINE2u8BOwJSCdzpjCX0H+0JxK2xz26UaVA5xeI3NYHUoxDnr/QIrgfrllGxS0szYwOcyg==", + "license": "MIT" }, "node_modules/@chakra-ui/hooks": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@chakra-ui/hooks/-/hooks-2.1.2.tgz", - "integrity": "sha512-/vDBOqqnho9q++lay0ZcvnH8VuE0wT2OkZj+qDwFwjiHAtGPVxHCSpu9KC8BIHME5TlWjyO6riVyUCb2e2ip6w==", + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/@chakra-ui/hooks/-/hooks-2.4.3.tgz", + "integrity": "sha512-Sr2zsoTZw3p7HbrUy4aLpTIkE2XXUelAUgg3NGwMzrmx75bE0qVyiuuTFOuyEzGxYVV2Fe8QtcKKilm6RwzTGg==", + "license": "MIT", "dependencies": { - "@chakra-ui/react-utils": "2.0.9", - "@chakra-ui/utils": "2.0.12", - "compute-scroll-into-view": "1.0.14", - "copy-to-clipboard": "3.3.1" + "@chakra-ui/utils": "2.2.3", + "@zag-js/element-size": "0.31.1", + "copy-to-clipboard": "3.3.3", + "framesync": "6.1.2" }, "peerDependencies": { "react": ">=18" } }, - "node_modules/@chakra-ui/icon": { - "version": "3.0.13", - "resolved": "https://registry.npmjs.org/@chakra-ui/icon/-/icon-3.0.13.tgz", - "integrity": "sha512-RaDLC4psd8qyInY2RX4AlYRfpLBNw3VsMih17BFf8EESVhBXNJcYy7Q9eMV/K4NvZfZT42vuVqGVNFmkG89lBQ==", - "dependencies": { - "@chakra-ui/shared-utils": "2.0.3" - }, - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "react": ">=18" - } - }, "node_modules/@chakra-ui/icons": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/@chakra-ui/icons/-/icons-2.2.4.tgz", @@ -2055,818 +1801,80 @@ "react": ">=18" } }, - "node_modules/@chakra-ui/image": { - "version": "2.0.12", - "resolved": "https://registry.npmjs.org/@chakra-ui/image/-/image-2.0.12.tgz", - "integrity": "sha512-uclFhs0+wq2qujGu8Wk4eEWITA3iZZQTitGiFSEkO9Ws5VUH+Gqtn3mUilH0orubrI5srJsXAmjVTuVwge1KJQ==", - "dependencies": { - "@chakra-ui/react-use-safe-layout-effect": "2.0.3" - }, - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "react": ">=18" - } - }, - "node_modules/@chakra-ui/input": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/@chakra-ui/input/-/input-2.0.14.tgz", - "integrity": "sha512-CkSrUJeKWogOSt2pUf2vVv5s0bUVcAi4/XGj1JVCCfyIX6a6h1m8R69MShTPxPiQ0Mdebq5ATrW/aZQQXZzRGQ==", - "dependencies": { - "@chakra-ui/form-control": "2.0.13", - "@chakra-ui/object-utils": "2.0.5", - "@chakra-ui/react-children-utils": "2.0.4", - "@chakra-ui/react-context": "2.0.5", - "@chakra-ui/shared-utils": "2.0.3" - }, - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "react": ">=18" - } - }, - "node_modules/@chakra-ui/layout": { - "version": "2.1.11", - "resolved": "https://registry.npmjs.org/@chakra-ui/layout/-/layout-2.1.11.tgz", - "integrity": "sha512-UP19V8EeI/DEODbWrZlqC0sg248bpFaWpMiM/+g9Bsxs9aof3yexpMD/7gb0yrfbIrkdvSBrcQeqxXGzbfoopw==", - "dependencies": { - "@chakra-ui/breakpoint-utils": "2.0.5", - "@chakra-ui/icon": "3.0.13", - "@chakra-ui/object-utils": "2.0.5", - "@chakra-ui/react-children-utils": "2.0.4", - "@chakra-ui/react-context": "2.0.5", - "@chakra-ui/shared-utils": "2.0.3" - }, - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "react": ">=18" - } - }, - "node_modules/@chakra-ui/lazy-utils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@chakra-ui/lazy-utils/-/lazy-utils-2.0.3.tgz", - "integrity": "sha512-SQ5I5rJrcHpVUcEftHLOh8UyeY+06R8Gv3k2RjcpvM6mb2Gktlz/4xl2GcUh3LWydgGQDW/7Rse5rQhKWgzmcg==" - }, - "node_modules/@chakra-ui/live-region": { - "version": "2.0.11", - "resolved": "https://registry.npmjs.org/@chakra-ui/live-region/-/live-region-2.0.11.tgz", - "integrity": "sha512-ltObaKQekP75GCCbN+vt1/mGABSCaRdQELmotHTBc5AioA3iyCDHH69ev+frzEwLvKFqo+RomAdAAgqBIMJ02Q==", - "peerDependencies": { - "react": ">=18" - } - }, - "node_modules/@chakra-ui/media-query": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/@chakra-ui/media-query/-/media-query-3.2.8.tgz", - "integrity": "sha512-djmEg/eJ5Qrjn7SArTqjsvlwF6mNeMuiawrTwnU+0EKq9Pq/wVSb7VaIhxdQYJLA/DbRhE/KPMogw1LNVKa4Rw==", - "dependencies": { - "@chakra-ui/breakpoint-utils": "2.0.5", - "@chakra-ui/react-env": "2.0.11" - }, - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "react": ">=18" - } - }, - "node_modules/@chakra-ui/menu": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@chakra-ui/menu/-/menu-2.1.5.tgz", - "integrity": "sha512-2UusrQtxHcqcO9n/0YobNN3RJC8yAZU6oJbRPuvsQ9IL89scEWCTIxXEYrnIjeh/5zikcSEDGo9zM9Udg/XcsA==", - "dependencies": { - "@chakra-ui/clickable": "2.0.11", - "@chakra-ui/descendant": "3.0.11", - "@chakra-ui/lazy-utils": "2.0.3", - "@chakra-ui/popper": "3.0.10", - "@chakra-ui/react-children-utils": "2.0.4", - "@chakra-ui/react-context": "2.0.5", - "@chakra-ui/react-use-animation-state": "2.0.6", - "@chakra-ui/react-use-controllable-state": "2.0.6", - "@chakra-ui/react-use-disclosure": "2.0.6", - "@chakra-ui/react-use-focus-effect": "2.0.7", - "@chakra-ui/react-use-merge-refs": "2.0.5", - "@chakra-ui/react-use-outside-click": "2.0.5", - "@chakra-ui/react-use-update-effect": "2.0.5", - "@chakra-ui/transition": "2.0.12" - }, - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "framer-motion": ">=4.0.0", - "react": ">=18" - } - }, - "node_modules/@chakra-ui/modal": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/@chakra-ui/modal/-/modal-2.2.4.tgz", - "integrity": "sha512-K2cafyNI0b4OSAB55qIXt5DLZqj7E1G0+Fza02ZOBZpgTCNQyDtc0KzdVMJZ9ryxKd16LUk5UmKHugY/VpHEWQ==", - "dependencies": { - "@chakra-ui/close-button": "2.0.13", - "@chakra-ui/focus-lock": "2.0.13", - "@chakra-ui/portal": "2.0.11", - "@chakra-ui/react-context": "2.0.5", - "@chakra-ui/react-types": "2.0.5", - "@chakra-ui/react-use-merge-refs": "2.0.5", - "@chakra-ui/transition": "2.0.12", - "aria-hidden": "^1.1.1", - "react-remove-scroll": "^2.5.4" - }, - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "framer-motion": ">=4.0.0", - "react": ">=18", - "react-dom": ">=18" - } - }, - "node_modules/@chakra-ui/number-input": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/@chakra-ui/number-input/-/number-input-2.0.14.tgz", - "integrity": "sha512-IARUAbP4pn1gP5fY2dK4wtbR3ONjzHgTjH4Zj3ErZvdu/yTURLaZmlb6UGHwgqjWLyioactZ/+n4Njj5CRjs8w==", - "dependencies": { - "@chakra-ui/counter": "2.0.11", - "@chakra-ui/form-control": "2.0.13", - "@chakra-ui/icon": "3.0.13", - "@chakra-ui/react-context": "2.0.5", - "@chakra-ui/react-types": "2.0.5", - "@chakra-ui/react-use-callback-ref": "2.0.5", - "@chakra-ui/react-use-event-listener": "2.0.5", - "@chakra-ui/react-use-interval": "2.0.3", - "@chakra-ui/react-use-merge-refs": "2.0.5", - "@chakra-ui/react-use-safe-layout-effect": "2.0.3", - "@chakra-ui/react-use-update-effect": "2.0.5" - }, - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "react": ">=18" - } - }, - "node_modules/@chakra-ui/number-utils": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@chakra-ui/number-utils/-/number-utils-2.0.5.tgz", - "integrity": "sha512-Thhohnlqze0i5HBJO9xkfOPq1rv3ji/hNPf2xh1fh4hxrNzdm3HCkz0c6lyRQwGuVoeltEHysYZLH/uWLFTCSQ==" - }, - "node_modules/@chakra-ui/object-utils": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@chakra-ui/object-utils/-/object-utils-2.0.5.tgz", - "integrity": "sha512-/rIMoYI3c2uLtFIrnTFOPRAI8StUuu335WszqKM0KAW1lwG9H6uSbxqlpZT1Pxi/VQqZKfheGiMQOx5lfTmM/A==" - }, - "node_modules/@chakra-ui/pin-input": { - "version": "2.0.16", - "resolved": "https://registry.npmjs.org/@chakra-ui/pin-input/-/pin-input-2.0.16.tgz", - "integrity": "sha512-51cioNYpBSgi9/jq6CrzoDvo8fpMwFXu3SaFRbKO47s9Dz/OAW0MpjyabTfSpwOv0xKZE+ayrYGJopCzZSWXPg==", - "dependencies": { - "@chakra-ui/descendant": "3.0.11", - "@chakra-ui/react-children-utils": "2.0.4", - "@chakra-ui/react-context": "2.0.5", - "@chakra-ui/react-use-controllable-state": "2.0.6", - "@chakra-ui/react-use-merge-refs": "2.0.5" - }, - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "react": ">=18" - } - }, - "node_modules/@chakra-ui/popover": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@chakra-ui/popover/-/popover-2.1.4.tgz", - "integrity": "sha512-NXVtyMxYzDKzzQph/+GFRSM3tEj3gNvlCX/xGRsCOt9I446zJ1InCd/boXQKAc813coEN9McSOjNWgo+NCBD+Q==", - "dependencies": { - "@chakra-ui/close-button": "2.0.13", - "@chakra-ui/lazy-utils": "2.0.3", - "@chakra-ui/popper": "3.0.10", - "@chakra-ui/react-context": "2.0.5", - "@chakra-ui/react-types": "2.0.5", - "@chakra-ui/react-use-animation-state": "2.0.6", - "@chakra-ui/react-use-disclosure": "2.0.6", - "@chakra-ui/react-use-focus-effect": "2.0.7", - "@chakra-ui/react-use-focus-on-pointer-down": "2.0.4", - "@chakra-ui/react-use-merge-refs": "2.0.5" - }, - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "framer-motion": ">=4.0.0", - "react": ">=18" - } - }, - "node_modules/@chakra-ui/popper": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/@chakra-ui/popper/-/popper-3.0.10.tgz", - "integrity": "sha512-6LacbBGX0piHWY/DYxOGCTTFAoRGRHpGIRzTgfNy8jxw4f+rukaVudd4Pc2fwjCTdobJKM8nGNYIYNv9/Dmq9Q==", - "dependencies": { - "@chakra-ui/react-types": "2.0.5", - "@chakra-ui/react-use-merge-refs": "2.0.5", - "@popperjs/core": "^2.9.3" - }, - "peerDependencies": { - "react": ">=18" - } - }, - "node_modules/@chakra-ui/portal": { - "version": "2.0.11", - "resolved": "https://registry.npmjs.org/@chakra-ui/portal/-/portal-2.0.11.tgz", - "integrity": "sha512-Css61i4WKzKO8ou1aGjBzcsXMy9LnfnpkOFfvaNCpUUNEd6c47z6+FhZNq7Gc38PGNjSfMLAd4LmH+H0ZanYIA==", - "dependencies": { - "@chakra-ui/react-context": "2.0.5", - "@chakra-ui/react-use-safe-layout-effect": "2.0.3" - }, - "peerDependencies": { - "react": ">=18", - "react-dom": ">=18" - } - }, - "node_modules/@chakra-ui/progress": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@chakra-ui/progress/-/progress-2.1.1.tgz", - "integrity": "sha512-ddAXaYGNObGqH1stRAYxkdospf6J4CDOhB0uyw9BeHRSsYkCUQWkUBd/melJuZeGHEH2ItF9T7FZ4JhcepP3GA==", - "dependencies": { - "@chakra-ui/react-context": "2.0.5" - }, - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "react": ">=18" - } - }, - "node_modules/@chakra-ui/provider": { - "version": "2.0.24", - "resolved": "https://registry.npmjs.org/@chakra-ui/provider/-/provider-2.0.24.tgz", - "integrity": "sha512-32+DGfoXAOUOXwjLstdGQ+k/YoCwdFxWbwnEAp7WleislYsMcl0JeINDAbvksQH0piBty77swTuWfUU5cIox7g==", - "dependencies": { - "@chakra-ui/css-reset": "2.0.10", - "@chakra-ui/portal": "2.0.11", - "@chakra-ui/react-env": "2.0.11", - "@chakra-ui/system": "2.3.4", - "@chakra-ui/utils": "2.0.12" - }, - "peerDependencies": { - "@emotion/react": "^11.0.0", - "@emotion/styled": "^11.0.0", - "react": ">=18", - "react-dom": ">=18" - } - }, - "node_modules/@chakra-ui/radio": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/@chakra-ui/radio/-/radio-2.0.14.tgz", - "integrity": "sha512-e/hY1g92Xdu5d5A27NFfa1+ccE2q/A5H7sc/M7p0fId6KO33Dst25Hy+HThtqnYN0Y3Om58fiXEKo5SsdtvSfA==", - "dependencies": { - "@chakra-ui/form-control": "2.0.13", - "@chakra-ui/react-context": "2.0.5", - "@chakra-ui/react-types": "2.0.5", - "@chakra-ui/react-use-merge-refs": "2.0.5", - "@zag-js/focus-visible": "0.1.0" - }, - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "react": ">=18" - } - }, "node_modules/@chakra-ui/react": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/@chakra-ui/react/-/react-2.4.2.tgz", - "integrity": "sha512-lPDCCuY3S7XSeIK+P+ypGIL+lFqEZQt8H3Iyq4coblULMsj8skdSUqaoQ4I9fGgOi1koTPe4OlXb+rmqwQQ9MQ==", + "version": "2.10.5", + "resolved": "https://registry.npmjs.org/@chakra-ui/react/-/react-2.10.5.tgz", + "integrity": "sha512-wCetfxT1iXWNmAwSLF1d0zyTQOQYswA3YJcw05grY1XEngO6956PScRB0Or5ZQJ6rGMcz5pcUhVgrb3q7AE+gQ==", + "license": "MIT", "dependencies": { - "@chakra-ui/accordion": "2.1.4", - "@chakra-ui/alert": "2.0.13", - "@chakra-ui/avatar": "2.2.1", - "@chakra-ui/breadcrumb": "2.1.1", - "@chakra-ui/button": "2.0.13", - "@chakra-ui/card": "2.1.1", - "@chakra-ui/checkbox": "2.2.5", - "@chakra-ui/close-button": "2.0.13", - "@chakra-ui/control-box": "2.0.11", - "@chakra-ui/counter": "2.0.11", - "@chakra-ui/css-reset": "2.0.10", - "@chakra-ui/editable": "2.0.16", - "@chakra-ui/form-control": "2.0.13", - "@chakra-ui/hooks": "2.1.2", - "@chakra-ui/icon": "3.0.13", - "@chakra-ui/image": "2.0.12", - "@chakra-ui/input": "2.0.14", - "@chakra-ui/layout": "2.1.11", - "@chakra-ui/live-region": "2.0.11", - "@chakra-ui/media-query": "3.2.8", - "@chakra-ui/menu": "2.1.5", - "@chakra-ui/modal": "2.2.4", - "@chakra-ui/number-input": "2.0.14", - "@chakra-ui/pin-input": "2.0.16", - "@chakra-ui/popover": "2.1.4", - "@chakra-ui/popper": "3.0.10", - "@chakra-ui/portal": "2.0.11", - "@chakra-ui/progress": "2.1.1", - "@chakra-ui/provider": "2.0.24", - "@chakra-ui/radio": "2.0.14", - "@chakra-ui/react-env": "2.0.11", - "@chakra-ui/select": "2.0.14", - "@chakra-ui/skeleton": "2.0.18", - "@chakra-ui/slider": "2.0.14", - "@chakra-ui/spinner": "2.0.11", - "@chakra-ui/stat": "2.0.13", - "@chakra-ui/styled-system": "2.4.0", - "@chakra-ui/switch": "2.0.17", - "@chakra-ui/system": "2.3.4", - "@chakra-ui/table": "2.0.12", - "@chakra-ui/tabs": "2.1.5", - "@chakra-ui/tag": "2.0.13", - "@chakra-ui/textarea": "2.0.14", - "@chakra-ui/theme": "2.2.2", - "@chakra-ui/theme-utils": "2.0.5", - "@chakra-ui/toast": "4.0.4", - "@chakra-ui/tooltip": "2.2.2", - "@chakra-ui/transition": "2.0.12", - "@chakra-ui/utils": "2.0.12", - "@chakra-ui/visually-hidden": "2.0.13" + "@chakra-ui/hooks": "2.4.3", + "@chakra-ui/styled-system": "2.12.1", + "@chakra-ui/theme": "3.4.7", + "@chakra-ui/utils": "2.2.3", + "@popperjs/core": "^2.11.8", + "@zag-js/focus-visible": "^0.31.1", + "aria-hidden": "^1.2.3", + "react-fast-compare": "3.2.2", + "react-focus-lock": "^2.9.6", + "react-remove-scroll": "^2.5.7" }, "peerDependencies": { - "@emotion/react": "^11.0.0", - "@emotion/styled": "^11.0.0", + "@emotion/react": ">=11", + "@emotion/styled": ">=11", "framer-motion": ">=4.0.0", "react": ">=18", "react-dom": ">=18" } }, - "node_modules/@chakra-ui/react-children-utils": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@chakra-ui/react-children-utils/-/react-children-utils-2.0.4.tgz", - "integrity": "sha512-qsKUEfK/AhDbMexWo5JhmdlkxLg5WEw2dFh4XorvU1/dTYsRfP6cjFfO8zE+X3F0ZFNsgKz6rbN5oU349GLEFw==", - "peerDependencies": { - "react": ">=18" - } - }, - "node_modules/@chakra-ui/react-context": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@chakra-ui/react-context/-/react-context-2.0.5.tgz", - "integrity": "sha512-WYS0VBl5Q3/kNShQ26BP+Q0OGMeTQWco3hSiJWvO2wYLY7N1BLq6dKs8vyKHZfpwKh2YL2bQeAObi+vSkXp6tQ==", - "peerDependencies": { - "react": ">=18" - } - }, - "node_modules/@chakra-ui/react-env": { - "version": "2.0.11", - "resolved": "https://registry.npmjs.org/@chakra-ui/react-env/-/react-env-2.0.11.tgz", - "integrity": "sha512-rPwUHReSWh7rbCw0HePa8Pvc+Q82fUFvVjHTIbXKnE6d+01cCE7j4f1NLeRD9pStKPI6sIZm9xTGvOCzl8F8iw==", - "peerDependencies": { - "react": ">=18" - } - }, - "node_modules/@chakra-ui/react-types": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@chakra-ui/react-types/-/react-types-2.0.5.tgz", - "integrity": "sha512-GApp+R/VjS1UV5ms5irrij5LOIgUM0dqSVHagyEFEz88LRKkqMD9RuO577ZsVd4Gn0ULsacVJCUA0HtNUBJNzA==", - "peerDependencies": { - "react": ">=18" - } - }, - "node_modules/@chakra-ui/react-use-animation-state": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@chakra-ui/react-use-animation-state/-/react-use-animation-state-2.0.6.tgz", - "integrity": "sha512-M2kUzZkSBgDpfvnffh3kTsMIM3Dvn+CTMqy9zfY97NL4P3LAWL1MuFtKdlKfQ8hs/QpwS/ew8CTmCtaywn4sKg==", - "dependencies": { - "@chakra-ui/dom-utils": "2.0.4", - "@chakra-ui/react-use-event-listener": "2.0.5" - }, - "peerDependencies": { - "react": ">=18" - } - }, - "node_modules/@chakra-ui/react-use-callback-ref": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@chakra-ui/react-use-callback-ref/-/react-use-callback-ref-2.0.5.tgz", - "integrity": "sha512-vKnXleD2PzB0nGabY35fRtklMid4z7cecbMG0fkasNNsgWmrQcXJOuEKUUVCynL6FBU6gBnpKFi5Aqj6x+K4tw==", - "peerDependencies": { - "react": ">=18" - } - }, - "node_modules/@chakra-ui/react-use-controllable-state": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@chakra-ui/react-use-controllable-state/-/react-use-controllable-state-2.0.6.tgz", - "integrity": "sha512-7WuKrhQkpSRoiI5PKBvuIsO46IIP0wsRQgXtStSaIXv+FIvIJl9cxQXTbmZ5q1Ds641QdAUKx4+6v0K/zoZEHg==", - "dependencies": { - "@chakra-ui/react-use-callback-ref": "2.0.5" - }, - "peerDependencies": { - "react": ">=18" - } - }, - "node_modules/@chakra-ui/react-use-disclosure": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@chakra-ui/react-use-disclosure/-/react-use-disclosure-2.0.6.tgz", - "integrity": "sha512-4UPePL+OcCY37KZ585iLjg8i6J0sjpLm7iZG3PUwmb97oKHVHq6DpmWIM0VfSjcT6AbSqyGcd5BXZQBgwt8HWQ==", - "dependencies": { - "@chakra-ui/react-use-callback-ref": "2.0.5" - }, - "peerDependencies": { - "react": ">=18" - } - }, - "node_modules/@chakra-ui/react-use-event-listener": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@chakra-ui/react-use-event-listener/-/react-use-event-listener-2.0.5.tgz", - "integrity": "sha512-etLBphMigxy/cm7Yg22y29gQ8u/K3PniR5ADZX7WVX61Cgsa8ciCqjTE9sTtlJQWAQySbWxt9+mjlT5zaf+6Zw==", - "dependencies": { - "@chakra-ui/react-use-callback-ref": "2.0.5" - }, - "peerDependencies": { - "react": ">=18" - } - }, - "node_modules/@chakra-ui/react-use-focus-effect": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/@chakra-ui/react-use-focus-effect/-/react-use-focus-effect-2.0.7.tgz", - "integrity": "sha512-wI8OUNwfbkusajLac8QtjfSyNmsNu1D5pANmnSHIntHhui6Jwv75Pxx7RgmBEnfBEpleBndhR9E75iCjPLhZ/A==", - "dependencies": { - "@chakra-ui/dom-utils": "2.0.4", - "@chakra-ui/react-use-event-listener": "2.0.5", - "@chakra-ui/react-use-safe-layout-effect": "2.0.3", - "@chakra-ui/react-use-update-effect": "2.0.5" - }, - "peerDependencies": { - "react": ">=18" - } - }, - "node_modules/@chakra-ui/react-use-focus-on-pointer-down": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@chakra-ui/react-use-focus-on-pointer-down/-/react-use-focus-on-pointer-down-2.0.4.tgz", - "integrity": "sha512-L3YKouIi77QbXH9mSLGEFzJbJDhyrPlcRcuu+TSC7mYaK9E+3Ap+RVSAVxj+CfQz7hCWpikPecKDuspIPWlyuA==", - "dependencies": { - "@chakra-ui/react-use-event-listener": "2.0.5" - }, - "peerDependencies": { - "react": ">=18" - } - }, - "node_modules/@chakra-ui/react-use-interval": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@chakra-ui/react-use-interval/-/react-use-interval-2.0.3.tgz", - "integrity": "sha512-Orbij5c5QkL4NuFyU4mfY/nyRckNBgoGe9ic8574VVNJIXfassevZk0WB+lvqBn5XZeLf2Tj+OGJrg4j4H9wzw==", - "dependencies": { - "@chakra-ui/react-use-callback-ref": "2.0.5" - }, - "peerDependencies": { - "react": ">=18" - } - }, - "node_modules/@chakra-ui/react-use-latest-ref": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@chakra-ui/react-use-latest-ref/-/react-use-latest-ref-2.0.3.tgz", - "integrity": "sha512-exNSQD4rPclDSmNwtcChUCJ4NuC2UJ4amyNGBqwSjyaK5jNHk2kkM7rZ6I0I8ul+26lvrXlSuhyv6c2PFwbFQQ==", - "peerDependencies": { - "react": ">=18" - } - }, - "node_modules/@chakra-ui/react-use-merge-refs": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@chakra-ui/react-use-merge-refs/-/react-use-merge-refs-2.0.5.tgz", - "integrity": "sha512-uc+MozBZ8asaUpO8SWcK6D4svRPACN63jv5uosUkXJR+05jQJkUofkfQbf2HeGVbrWCr0XZsftLIm4Mt/QMoVw==", - "peerDependencies": { - "react": ">=18" - } - }, - "node_modules/@chakra-ui/react-use-outside-click": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@chakra-ui/react-use-outside-click/-/react-use-outside-click-2.0.5.tgz", - "integrity": "sha512-WmtXUeVaMtxP9aUGGG+GQaDeUn/Bvf8TI3EU5mE1+TtqLHxyA9wtvQurynrogvpilLaBADwn/JeBeqs2wHpvqA==", - "dependencies": { - "@chakra-ui/react-use-callback-ref": "2.0.5" - }, - "peerDependencies": { - "react": ">=18" - } - }, - "node_modules/@chakra-ui/react-use-pan-event": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@chakra-ui/react-use-pan-event/-/react-use-pan-event-2.0.6.tgz", - "integrity": "sha512-Vtgl3c+Mj4hdehFRFIgruQVXctwnG1590Ein1FiU8sVnlqO6bpug6Z+B14xBa+F+X0aK+DxnhkJFyWI93Pks2g==", - "dependencies": { - "@chakra-ui/event-utils": "2.0.6", - "@chakra-ui/react-use-latest-ref": "2.0.3", - "framesync": "5.3.0" - }, - "peerDependencies": { - "react": ">=18" - } - }, - "node_modules/@chakra-ui/react-use-previous": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@chakra-ui/react-use-previous/-/react-use-previous-2.0.3.tgz", - "integrity": "sha512-A2ODOa0rm2HM4aqXfxxI0zPLcn5Q7iBEjRyfIQhb+EH+d2OFuj3L2slVoIpp6e/km3Xzv2d+u/WbjgTzdQ3d0w==", - "peerDependencies": { - "react": ">=18" - } - }, - "node_modules/@chakra-ui/react-use-safe-layout-effect": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@chakra-ui/react-use-safe-layout-effect/-/react-use-safe-layout-effect-2.0.3.tgz", - "integrity": "sha512-dlTvQURzmdfyBbNdydgO4Wy2/HV8aJN8LszTtyb5vRZsyaslDM/ftcxo8E8QjHwRLD/V1Epb/A8731QfimfVaQ==", - "peerDependencies": { - "react": ">=18" - } - }, - "node_modules/@chakra-ui/react-use-size": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@chakra-ui/react-use-size/-/react-use-size-2.0.5.tgz", - "integrity": "sha512-4arAApdiXk5uv5ZeFKltEUCs5h3yD9dp6gTIaXbAdq+/ENK3jMWTwlqzNbJtCyhwoOFrblLSdBrssBMIsNQfZQ==", - "dependencies": { - "@zag-js/element-size": "0.1.0" - }, - "peerDependencies": { - "react": ">=18" - } - }, - "node_modules/@chakra-ui/react-use-timeout": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@chakra-ui/react-use-timeout/-/react-use-timeout-2.0.3.tgz", - "integrity": "sha512-rBBUkZSQq3nJQ8fuMkgZNY2Sgg4vKiKNp05GxAwlT7TitOfVZyoTriqQpqz296bWlmkICTZxlqCWfE5fWpsTsg==", - "dependencies": { - "@chakra-ui/react-use-callback-ref": "2.0.5" - }, - "peerDependencies": { - "react": ">=18" - } - }, - "node_modules/@chakra-ui/react-use-update-effect": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@chakra-ui/react-use-update-effect/-/react-use-update-effect-2.0.5.tgz", - "integrity": "sha512-y9tCMr1yuDl8ATYdh64Gv8kge5xE1DMykqPDZw++OoBsTaWr3rx40wblA8NIWuSyJe5ErtKP2OeglvJkYhryJQ==", - "peerDependencies": { - "react": ">=18" - } - }, - "node_modules/@chakra-ui/react-utils": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@chakra-ui/react-utils/-/react-utils-2.0.9.tgz", - "integrity": "sha512-nlwPBVlQmcl1PiLzZWyrT3FSnt3vKSkBMzQ0EF4SJWA/nOIqTvmffb5DCzCqPzgQaE/Da1Xgus+JufFGM8GLCQ==", - "dependencies": { - "@chakra-ui/utils": "2.0.12" - }, - "peerDependencies": { - "react": ">=18" - } - }, - "node_modules/@chakra-ui/select": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/@chakra-ui/select/-/select-2.0.14.tgz", - "integrity": "sha512-fvVGxAtLaIXGOMicrzSa6imMw5h26S1ar3xyNmXgR40dbpTPHmtQJkbHBf9FwwQXgSgKWgBzsztw5iDHCpPVzA==", - "dependencies": { - "@chakra-ui/form-control": "2.0.13" - }, - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "react": ">=18" - } - }, - "node_modules/@chakra-ui/shared-utils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@chakra-ui/shared-utils/-/shared-utils-2.0.3.tgz", - "integrity": "sha512-pCU+SUGdXzjAuUiUT8mriekL3tJVfNdwSTIaNeip7k/SWDzivrKGMwAFBxd3XVTDevtVusndkO4GJuQ3yILzDg==" - }, - "node_modules/@chakra-ui/skeleton": { - "version": "2.0.18", - "resolved": "https://registry.npmjs.org/@chakra-ui/skeleton/-/skeleton-2.0.18.tgz", - "integrity": "sha512-qjcD8BgVx4kL8Lmb8EvmmDGM2ICl6CqhVE2LShJrgG7PDM6Rt6rYM617kqLurLYZjbJUiwgf9VXWifS0IpT31Q==", - "dependencies": { - "@chakra-ui/media-query": "3.2.8", - "@chakra-ui/react-use-previous": "2.0.3" - }, - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "react": ">=18" - } - }, - "node_modules/@chakra-ui/slider": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/@chakra-ui/slider/-/slider-2.0.14.tgz", - "integrity": "sha512-z4Q5rWtYVTdFgBVvR6aUhSMg3CQuAgjJGHvLHEGDCUjYCuBXrb3SmWyvv03uKyjSbwRyKqSsvAnSCxtmHODt/w==", - "dependencies": { - "@chakra-ui/number-utils": "2.0.5", - "@chakra-ui/react-context": "2.0.5", - "@chakra-ui/react-types": "2.0.5", - "@chakra-ui/react-use-callback-ref": "2.0.5", - "@chakra-ui/react-use-controllable-state": "2.0.6", - "@chakra-ui/react-use-latest-ref": "2.0.3", - "@chakra-ui/react-use-merge-refs": "2.0.5", - "@chakra-ui/react-use-pan-event": "2.0.6", - "@chakra-ui/react-use-size": "2.0.5", - "@chakra-ui/react-use-update-effect": "2.0.5" - }, - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "react": ">=18" - } - }, - "node_modules/@chakra-ui/spinner": { - "version": "2.0.11", - "resolved": "https://registry.npmjs.org/@chakra-ui/spinner/-/spinner-2.0.11.tgz", - "integrity": "sha512-piO2ghWdJzQy/+89mDza7xLhPnW7pA+ADNbgCb1vmriInWedS41IBKe+pSPz4IidjCbFu7xwKE0AerFIbrocCA==", - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "react": ">=18" - } - }, - "node_modules/@chakra-ui/stat": { - "version": "2.0.13", - "resolved": "https://registry.npmjs.org/@chakra-ui/stat/-/stat-2.0.13.tgz", - "integrity": "sha512-6XeuE/7w0BjyCHSxMbsf6/rNOOs8BSit1NS7g7+Jd/40Pc/SKlNWLd3kxXPid4eT3RwyNIdMPtm30OActr9nqQ==", - "dependencies": { - "@chakra-ui/icon": "3.0.13", - "@chakra-ui/react-context": "2.0.5" - }, - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "react": ">=18" - } - }, "node_modules/@chakra-ui/styled-system": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@chakra-ui/styled-system/-/styled-system-2.4.0.tgz", - "integrity": "sha512-G4HpbFERq4C1cBwKNDNkpCiliOICLXjYwKI/e/6hxNY+GlPxt8BCzz3uhd3vmEoG2vRM4qjidlVjphhWsf6vRQ==", + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/@chakra-ui/styled-system/-/styled-system-2.12.1.tgz", + "integrity": "sha512-DQph1nDiCPtgze7nDe0a36530ByXb5VpPosKGyWMvKocVeZJcDtYG6XM0+V5a0wKuFBXsViBBRIFUTiUesJAcg==", + "license": "MIT", "dependencies": { - "csstype": "^3.0.11", - "lodash.mergewith": "4.6.2" - } - }, - "node_modules/@chakra-ui/switch": { - "version": "2.0.17", - "resolved": "https://registry.npmjs.org/@chakra-ui/switch/-/switch-2.0.17.tgz", - "integrity": "sha512-BQabfC6qYi5xBJvEFPzKq0yl6fTtTNNEHTid5r7h0PWcCnAiHwQJTpQRpxp+AjK569LMLtTXReTZvNBrzEwOrA==", - "dependencies": { - "@chakra-ui/checkbox": "2.2.5" - }, - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "framer-motion": ">=4.0.0", - "react": ">=18" - } - }, - "node_modules/@chakra-ui/system": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/@chakra-ui/system/-/system-2.3.4.tgz", - "integrity": "sha512-/2m8hFfFzOMO2OlwHxTWqINOBJMjxWwU5V/AcB7C0qS51Dcj9c7kupilM6QdqiOLLdMS7mIVRSYr8jn8gMw9fA==", - "dependencies": { - "@chakra-ui/color-mode": "2.1.10", - "@chakra-ui/react-utils": "2.0.9", - "@chakra-ui/styled-system": "2.4.0", - "@chakra-ui/theme-utils": "2.0.5", - "@chakra-ui/utils": "2.0.12", - "react-fast-compare": "3.2.0" - }, - "peerDependencies": { - "@emotion/react": "^11.0.0", - "@emotion/styled": "^11.0.0", - "react": ">=18" - } - }, - "node_modules/@chakra-ui/table": { - "version": "2.0.12", - "resolved": "https://registry.npmjs.org/@chakra-ui/table/-/table-2.0.12.tgz", - "integrity": "sha512-TSxzpfrOoB+9LTdNTMnaQC6OTsp36TlCRxJ1+1nAiCmlk+m+FiNzTQsmBalDDhc29rm+6AdRsxSPsjGWB8YVwg==", - "dependencies": { - "@chakra-ui/react-context": "2.0.5" - }, - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "react": ">=18" - } - }, - "node_modules/@chakra-ui/tabs": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@chakra-ui/tabs/-/tabs-2.1.5.tgz", - "integrity": "sha512-XmnKDclAJe0FoW4tdC8AlnZpPN5fcj92l4r2sqiL9WyYVEM71hDxZueETIph/GTtfMelG7Z8e5vBHP4rh1RT5g==", - "dependencies": { - "@chakra-ui/clickable": "2.0.11", - "@chakra-ui/descendant": "3.0.11", - "@chakra-ui/lazy-utils": "2.0.3", - "@chakra-ui/react-children-utils": "2.0.4", - "@chakra-ui/react-context": "2.0.5", - "@chakra-ui/react-use-controllable-state": "2.0.6", - "@chakra-ui/react-use-merge-refs": "2.0.5", - "@chakra-ui/react-use-safe-layout-effect": "2.0.3" - }, - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "react": ">=18" - } - }, - "node_modules/@chakra-ui/tag": { - "version": "2.0.13", - "resolved": "https://registry.npmjs.org/@chakra-ui/tag/-/tag-2.0.13.tgz", - "integrity": "sha512-W1urf+tvGMt6J3cc31HudybYSl+B5jYUP5DJxzXM9p+n3JrvXWAo4D6LmpLBHY5zT2mNne14JF1rVeRcG4Rtdg==", - "dependencies": { - "@chakra-ui/icon": "3.0.13", - "@chakra-ui/react-context": "2.0.5" - }, - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "react": ">=18" - } - }, - "node_modules/@chakra-ui/textarea": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/@chakra-ui/textarea/-/textarea-2.0.14.tgz", - "integrity": "sha512-r8hF1rCi+GseLtY/IGeVWXFN0Uve2b820UQumRj4qxj7PsPqw1hFg7Cecbbb9zwF38K/m+D3IdwFeJzI1MtgRA==", - "dependencies": { - "@chakra-ui/form-control": "2.0.13" - }, - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "react": ">=18" + "@chakra-ui/utils": "2.2.3", + "csstype": "^3.1.2" } }, "node_modules/@chakra-ui/theme": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/@chakra-ui/theme/-/theme-2.2.2.tgz", - "integrity": "sha512-7DlOQiXmnaqYyqXwqmfFSCWGkUonuqmNC5mmUCwxI435KgHNCaE2bIm6DI7N2NcIcuVcfc8Vn0UqrDoGU3zJBg==", + "version": "3.4.7", + "resolved": "https://registry.npmjs.org/@chakra-ui/theme/-/theme-3.4.7.tgz", + "integrity": "sha512-pfewthgZTFNUYeUwGvhPQO/FTIyf375cFV1AT8N1y0aJiw4KDe7YTGm7p0aFy4AwAjH2ydMgeEx/lua4tx8qyQ==", + "license": "MIT", "dependencies": { - "@chakra-ui/anatomy": "2.1.0", - "@chakra-ui/theme-tools": "2.0.14" + "@chakra-ui/anatomy": "2.3.5", + "@chakra-ui/theme-tools": "2.2.7", + "@chakra-ui/utils": "2.2.3" }, "peerDependencies": { - "@chakra-ui/styled-system": ">=2.0.0" + "@chakra-ui/styled-system": ">=2.8.0" } }, "node_modules/@chakra-ui/theme-tools": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/@chakra-ui/theme-tools/-/theme-tools-2.0.14.tgz", - "integrity": "sha512-lVcDmq5pyU0QbsIFKjt/iVUFDap7di2QHvPvGChA1YSjtg1PtuUi+BxEXWzp3Nfgw/N4rMvlBs+S0ynJypdwbg==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/@chakra-ui/theme-tools/-/theme-tools-2.2.7.tgz", + "integrity": "sha512-K/VJd0QcnKik7m+qZTkggqNLep6+MPUu8IP5TUpHsnSM5R/RVjsJIR7gO8IZVAIMIGLLTIhGshHxeMekqv6LcQ==", + "license": "MIT", "dependencies": { - "@chakra-ui/anatomy": "2.1.0", - "color2k": "^2.0.0" + "@chakra-ui/anatomy": "2.3.5", + "@chakra-ui/utils": "2.2.3", + "color2k": "^2.0.2" }, "peerDependencies": { "@chakra-ui/styled-system": ">=2.0.0" } }, - "node_modules/@chakra-ui/theme-utils": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@chakra-ui/theme-utils/-/theme-utils-2.0.5.tgz", - "integrity": "sha512-QQowSM8fvQlTmT0w9wtqUlWOB4i+9eA7P4XRm4bfhBMZ7XpK4ctV95sPeGqaXVccsz5m0q1AuGWa+j6eMCbrrg==", - "dependencies": { - "@chakra-ui/styled-system": "2.4.0", - "@chakra-ui/theme": "2.2.2", - "lodash.mergewith": "4.6.2" - } - }, - "node_modules/@chakra-ui/toast": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@chakra-ui/toast/-/toast-4.0.4.tgz", - "integrity": "sha512-Gv52UQ4fJtziL9Qg0Yterb76C1GgzViryPDf2dxSzTlnCcKIbY4ktEhehyFBjDXYoGkFb47NZUEyhy+u8p3GUA==", - "dependencies": { - "@chakra-ui/alert": "2.0.13", - "@chakra-ui/close-button": "2.0.13", - "@chakra-ui/portal": "2.0.11", - "@chakra-ui/react-use-timeout": "2.0.3", - "@chakra-ui/react-use-update-effect": "2.0.5", - "@chakra-ui/styled-system": "2.4.0", - "@chakra-ui/theme": "2.2.2" - }, - "peerDependencies": { - "@chakra-ui/system": "2.3.4", - "framer-motion": ">=4.0.0", - "react": ">=18", - "react-dom": ">=18" - } - }, - "node_modules/@chakra-ui/tooltip": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/@chakra-ui/tooltip/-/tooltip-2.2.2.tgz", - "integrity": "sha512-WDgQVEMHdsyUpKG9Nogy2FKLBgfdJG7hTSrSbH1WLvHsPkpPLknL4i5Z/pCvpa4A7SzTa6ps350mxtJ054MeMg==", - "dependencies": { - "@chakra-ui/popper": "3.0.10", - "@chakra-ui/portal": "2.0.11", - "@chakra-ui/react-types": "2.0.5", - "@chakra-ui/react-use-disclosure": "2.0.6", - "@chakra-ui/react-use-event-listener": "2.0.5", - "@chakra-ui/react-use-merge-refs": "2.0.5" - }, - "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "framer-motion": ">=4.0.0", - "react": ">=18", - "react-dom": ">=18" - } - }, - "node_modules/@chakra-ui/transition": { - "version": "2.0.12", - "resolved": "https://registry.npmjs.org/@chakra-ui/transition/-/transition-2.0.12.tgz", - "integrity": "sha512-ff6eU+m08ccYfCkk0hKfY/XlmGxCrfbBgsKgV4mirZ4SKUL1GVye8CYuHwWQlBJo+8s0yIpsTNxAuX4n/cW9/w==", - "peerDependencies": { - "framer-motion": ">=4.0.0", - "react": ">=18" - } - }, "node_modules/@chakra-ui/utils": { - "version": "2.0.12", - "resolved": "https://registry.npmjs.org/@chakra-ui/utils/-/utils-2.0.12.tgz", - "integrity": "sha512-1Z1MgsrfMQhNejSdrPJk8v5J4gCefHo+1wBmPPHTz5bGEbAAbZ13aXAfXy8w0eFy0Nvnawn0EHW7Oynp/MdH+Q==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/@chakra-ui/utils/-/utils-2.2.3.tgz", + "integrity": "sha512-cldoCQuexZ6e07/9hWHKD4l1QXXlM1Nax9tuQOBvVf/EgwNZt3nZu8zZRDFlhAOKCTQDkmpLTTu+eXXjChNQOw==", + "license": "MIT", "dependencies": { - "@types/lodash.mergewith": "4.6.6", - "css-box-model": "1.2.1", - "framesync": "5.3.0", + "@types/lodash.mergewith": "4.6.9", "lodash.mergewith": "4.6.2" - } - }, - "node_modules/@chakra-ui/visually-hidden": { - "version": "2.0.13", - "resolved": "https://registry.npmjs.org/@chakra-ui/visually-hidden/-/visually-hidden-2.0.13.tgz", - "integrity": "sha512-sDEeeEjLfID333EC46NdCbhK2HyMXlpl5HzcJjuwWIpyVz4E1gKQ9hlwpq6grijvmzeSywQ5D3tTwUrvZck4KQ==", + }, "peerDependencies": { - "@chakra-ui/system": ">=2.0.0", - "react": ">=18" + "react": ">=16.8.0" } }, "node_modules/@emotion/babel-plugin": { @@ -3625,6 +2633,7 @@ "version": "2.11.8", "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", + "license": "MIT", "funding": { "type": "opencollective", "url": "https://opencollective.com/popperjs" @@ -3736,14 +2745,16 @@ "license": "MIT" }, "node_modules/@types/lodash": { - "version": "4.17.13", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.13.tgz", - "integrity": "sha512-lfx+dftrEZcdBPczf9d0Qv0x+j/rfNCMuC6OcfXmO8gkfeNAY88PgKUbvG56whcN23gc27yenwF6oJZXGFpYxg==" + "version": "4.17.14", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.14.tgz", + "integrity": "sha512-jsxagdikDiDBeIRaPYtArcT8my4tN1og7MtMRquFT3XNA6axxyHDRUemqDz/taRDdOUn0GnGHRCuff4q48sW9A==", + "license": "MIT" }, "node_modules/@types/lodash.mergewith": { - "version": "4.6.6", - "resolved": "https://registry.npmjs.org/@types/lodash.mergewith/-/lodash.mergewith-4.6.6.tgz", - "integrity": "sha512-RY/8IaVENjG19rxTZu9Nukqh0W2UrYgmBj5sdns4hWRZaV8PqR7wIKHFKzvOTjo4zVRV7sVI+yFhAJql12Kfqg==", + "version": "4.6.9", + "resolved": "https://registry.npmjs.org/@types/lodash.mergewith/-/lodash.mergewith-4.6.9.tgz", + "integrity": "sha512-fgkoCAOF47K7sxrQ7Mlud2TH023itugZs2bUg8h/KzT+BnZNrR2jAOmaokbLunHNnobXVWOezAeNn/lZqwxkcw==", + "license": "MIT", "dependencies": { "@types/lodash": "*" } @@ -4283,15 +3294,26 @@ "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", "license": "Apache-2.0" }, + "node_modules/@zag-js/dom-query": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@zag-js/dom-query/-/dom-query-0.31.1.tgz", + "integrity": "sha512-oiuohEXAXhBxpzzNm9k2VHGEOLC1SXlXSbRPcfBZ9so5NRQUA++zCE7cyQJqGLTZR0t3itFLlZqDbYEXRrefwg==", + "license": "MIT" + }, "node_modules/@zag-js/element-size": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@zag-js/element-size/-/element-size-0.1.0.tgz", - "integrity": "sha512-QF8wp0+V8++z+FHXiIw93+zudtubYszOtYbNgK39fg3pi+nCZtuSm4L1jC5QZMatNZ83MfOzyNCfgUubapagJQ==" + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@zag-js/element-size/-/element-size-0.31.1.tgz", + "integrity": "sha512-4T3yvn5NqqAjhlP326Fv+w9RqMIBbNN9H72g5q2ohwzhSgSfZzrKtjL4rs9axY/cw9UfMfXjRjEE98e5CMq7WQ==", + "license": "MIT" }, "node_modules/@zag-js/focus-visible": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@zag-js/focus-visible/-/focus-visible-0.1.0.tgz", - "integrity": "sha512-PeaBcTmdZWcFf7n1aM+oiOdZc+sy14qi0emPIeUuGMTjbP0xLGrZu43kdpHnWSXy7/r4Ubp/vlg50MCV8+9Isg==" + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@zag-js/focus-visible/-/focus-visible-0.31.1.tgz", + "integrity": "sha512-dbLksz7FEwyFoANbpIlNnd3bVm0clQSUsnP8yUVQucStZPsuWjCrhL2jlAbGNrTrahX96ntUMXHb/sM68TibFg==", + "license": "MIT", + "dependencies": { + "@zag-js/dom-query": "0.31.1" + } }, "node_modules/accepts": { "version": "1.3.8", @@ -4438,6 +3460,7 @@ "version": "1.2.4", "resolved": "https://registry.npmjs.org/aria-hidden/-/aria-hidden-1.2.4.tgz", "integrity": "sha512-y+CcFFwelSXpLZk/7fMB2mUbGtX9lKycf1MWJ7CaTIERyitVlyQx6C+sxcROU2BAJ24OiZyK+8wj2i8AlBoS3A==", + "license": "MIT", "dependencies": { "tslib": "^2.0.0" }, @@ -5016,7 +4039,8 @@ "node_modules/color2k": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/color2k/-/color2k-2.0.3.tgz", - "integrity": "sha512-zW190nQTIoXcGCaU08DvVNFTmQhUpnJfVuAKfWqUQkflXKpaDdpaYoM0iluLS9lgJNHyBF58KKA2FBEwkD7wog==" + "integrity": "sha512-zW190nQTIoXcGCaU08DvVNFTmQhUpnJfVuAKfWqUQkflXKpaDdpaYoM0iluLS9lgJNHyBF58KKA2FBEwkD7wog==", + "license": "MIT" }, "node_modules/colorette": { "version": "2.0.20", @@ -5049,11 +4073,6 @@ "integrity": "sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==", "license": "ISC" }, - "node_modules/compute-scroll-into-view": { - "version": "1.0.14", - "resolved": "https://registry.npmjs.org/compute-scroll-into-view/-/compute-scroll-into-view-1.0.14.tgz", - "integrity": "sha512-mKDjINe3tc6hGelUMNDzuhorIUZ7kS7BwyY0r2wQd2HOH2tRuJykiC06iSEX8y1TuhNzvz4GcJnK16mM2J1NMQ==" - }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -5148,9 +4167,10 @@ } }, "node_modules/copy-to-clipboard": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/copy-to-clipboard/-/copy-to-clipboard-3.3.1.tgz", - "integrity": "sha512-i13qo6kIHTTpCm8/Wup+0b1mVWETvu2kIMzKoK8FpkLkFxlt0znUAHcMzox+T8sPlqtZXq3CulEjQHsYiGFJUw==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/copy-to-clipboard/-/copy-to-clipboard-3.3.3.tgz", + "integrity": "sha512-2KV8NhB5JqC3ky0r9PMCAZKbUHSwtEo4CwCs0KXgruG43gX5PMqDEBbVU4OUzw2MuAWUfsuFmWvEKG5QRfSnJA==", + "license": "MIT", "dependencies": { "toggle-selection": "^1.0.6" } @@ -5235,14 +4255,6 @@ "node": ">= 8" } }, - "node_modules/css-box-model": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/css-box-model/-/css-box-model-1.2.1.tgz", - "integrity": "sha512-a7Vr4Q/kd/aw96bnJG332W9V9LkJO69JRcaCYDUqjp6/z0w6VcZjgAcTbgFxEPfBgdnAwlh3iwu+hLopa+flJw==", - "dependencies": { - "tiny-invariant": "^1.0.6" - } - }, "node_modules/css-loader": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-7.1.2.tgz", @@ -5512,7 +4524,8 @@ "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==" + "integrity": "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==", + "license": "MIT" }, "node_modules/detect-port-alt": { "version": "1.1.6", @@ -6703,9 +5716,10 @@ "license": "ISC" }, "node_modules/focus-lock": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/focus-lock/-/focus-lock-1.3.5.tgz", - "integrity": "sha512-QFaHbhv9WPUeLYBDe/PAuLKJ4Dd9OPvKs9xZBr3yLXnUrDNaVXKu2baDBXe3naPY30hgHYSsf2JW4jzas2mDEQ==", + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/focus-lock/-/focus-lock-1.3.6.tgz", + "integrity": "sha512-Ik/6OCk9RQQ0T5Xw+hKNLWrjSMtv51dD4GRmJjbD5a58TIEpI5a5iXagKVl3Z5UuyslMCA8Xwnu76jQob62Yhg==", + "license": "MIT", "dependencies": { "tslib": "^2.0.3" }, @@ -6978,13 +5992,20 @@ } }, "node_modules/framesync": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/framesync/-/framesync-5.3.0.tgz", - "integrity": "sha512-oc5m68HDO/tuK2blj7ZcdEBRx3p1PjrgHazL8GYEpvULhrtGIFbQArN6cQS2QhW8mitffaB+VYzMjDqBxxQeoA==", + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/framesync/-/framesync-6.1.2.tgz", + "integrity": "sha512-jBTqhX6KaQVDyus8muwZbBeGGP0XgujBRbQ7gM7BRdS3CadCZIHiawyzYLnafYcvZIh5j8WE7cxZKFn7dXhu9g==", + "license": "MIT", "dependencies": { - "tslib": "^2.1.0" + "tslib": "2.4.0" } }, + "node_modules/framesync/node_modules/tslib": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", + "license": "0BSD" + }, "node_modules/fresh": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", @@ -7087,6 +6108,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/get-nonce/-/get-nonce-1.0.1.tgz", "integrity": "sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q==", + "license": "MIT", "engines": { "node": ">=6" } @@ -7631,14 +6653,6 @@ "node": ">= 0.4" } }, - "node_modules/invariant": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", - "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", - "dependencies": { - "loose-envify": "^1.0.0" - } - }, "node_modules/ipaddr.js": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", @@ -8408,7 +7422,8 @@ "node_modules/lodash.mergewith": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz", - "integrity": "sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==" + "integrity": "sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==", + "license": "MIT" }, "node_modules/loose-envify": { "version": "1.4.0", @@ -9395,14 +8410,15 @@ } }, "node_modules/react-clientside-effect": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/react-clientside-effect/-/react-clientside-effect-1.2.6.tgz", - "integrity": "sha512-XGGGRQAKY+q25Lz9a/4EPqom7WRjz3z9R2k4jhVKA/puQFH/5Nt27vFZYql4m4NVNdUvX8PS3O7r/Zzm7cjUlg==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/react-clientside-effect/-/react-clientside-effect-1.2.7.tgz", + "integrity": "sha512-gce9m0Pk/xYYMEojRI9bgvqQAkl6hm7ozQvqWPyQx+kULiatdHgkNM1QG4DQRx5N9BAzWSCJmt9mMV8/KsdgVg==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.12.13" }, "peerDependencies": { - "react": "^15.3.0 || ^16.0.0 || ^17.0.0 || ^18.0.0" + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" } }, "node_modules/react-dev-utils": { @@ -9622,14 +8638,16 @@ "license": "MIT" }, "node_modules/react-fast-compare": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-3.2.0.tgz", - "integrity": "sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA==" + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-3.2.2.tgz", + "integrity": "sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ==", + "license": "MIT" }, "node_modules/react-focus-lock": { - "version": "2.13.2", - "resolved": "https://registry.npmjs.org/react-focus-lock/-/react-focus-lock-2.13.2.tgz", - "integrity": "sha512-T/7bsofxYqnod2xadvuwjGKHOoL5GH7/EIPI5UyEvaU/c2CcphvGI371opFtuY/SYdbMsNiuF4HsHQ50nA/TKQ==", + "version": "2.13.5", + "resolved": "https://registry.npmjs.org/react-focus-lock/-/react-focus-lock-2.13.5.tgz", + "integrity": "sha512-HjHuZFFk2+j6ZT3LDQpyqffue541HrxUG/OFchCEwis9nstgNg0rREVRAxHBcB1lHJ5Fsxtx1qya/5xFwxDb4g==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.0.0", "focus-lock": "^1.3.5", @@ -9639,8 +8657,8 @@ "use-sidecar": "^1.1.2" }, "peerDependencies": { - "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + "@types/react": "*", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "peerDependenciesMeta": { "@types/react": { @@ -9718,22 +8736,23 @@ } }, "node_modules/react-remove-scroll": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.6.0.tgz", - "integrity": "sha512-I2U4JVEsQenxDAKaVa3VZ/JeJZe0/2DxPWL8Tj8yLKctQJQiZM52pn/GWFpSp8dftjM3pSAHVJZscAnC/y+ySQ==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.6.2.tgz", + "integrity": "sha512-KmONPx5fnlXYJQqC62Q+lwIeAk64ws/cUw6omIumRzMRPqgnYqhSSti99nbj0Ry13bv7dF+BKn7NB+OqkdZGTw==", + "license": "MIT", "dependencies": { - "react-remove-scroll-bar": "^2.3.6", + "react-remove-scroll-bar": "^2.3.7", "react-style-singleton": "^2.2.1", "tslib": "^2.1.0", - "use-callback-ref": "^1.3.0", + "use-callback-ref": "^1.3.3", "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" + "@types/react": "*", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "peerDependenciesMeta": { "@types/react": { @@ -9742,19 +8761,20 @@ } }, "node_modules/react-remove-scroll-bar": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.6.tgz", - "integrity": "sha512-DtSYaao4mBmX+HDo5YWYdBWQwYIQQshUV/dVxFxK+KM26Wjwp1gZ6rv6OC3oujI6Bfu6Xyg3TwK533AQutsn/g==", + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.8.tgz", + "integrity": "sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q==", + "license": "MIT", "dependencies": { - "react-style-singleton": "^2.2.1", + "react-style-singleton": "^2.2.2", "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" + "@types/react": "*", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" }, "peerDependenciesMeta": { "@types/react": { @@ -9793,20 +8813,20 @@ } }, "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==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/react-style-singleton/-/react-style-singleton-2.2.3.tgz", + "integrity": "sha512-b6jSvxvVnyptAiLjbkWLE/lOnR4lfTtDAl+eUC7RZy+QQWc6wRzIV2CE6xBuMmDxc2qIihtDCZD5NPOFl7fRBQ==", + "license": "MIT", "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" + "@types/react": "*", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "peerDependenciesMeta": { "@types/react": { @@ -10772,11 +9792,6 @@ "tslib": "^2" } }, - "node_modules/tiny-invariant": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", - "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==" - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -10791,7 +9806,8 @@ "node_modules/toggle-selection": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/toggle-selection/-/toggle-selection-1.0.6.tgz", - "integrity": "sha512-BiZS+C1OS8g/q2RRbJmy59xpyghNBqrr6k5L/uKBGRsTfxmu3ffiRnd8mlGPUVayg8pvfi5urfnu8TU7DVOkLQ==" + "integrity": "sha512-BiZS+C1OS8g/q2RRbJmy59xpyghNBqrr6k5L/uKBGRsTfxmu3ffiRnd8mlGPUVayg8pvfi5urfnu8TU7DVOkLQ==", + "license": "MIT" }, "node_modules/toidentifier": { "version": "1.0.1", @@ -11191,9 +10207,10 @@ } }, "node_modules/use-callback-ref": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/use-callback-ref/-/use-callback-ref-1.3.2.tgz", - "integrity": "sha512-elOQwe6Q8gqZgDA8mrh44qRTQqpIHDcZ3hXTLjBe1i4ph8XpNJnO+aQf3NaG+lriLopI4HMx9VjQLfPQ6vhnoA==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/use-callback-ref/-/use-callback-ref-1.3.3.tgz", + "integrity": "sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg==", + "license": "MIT", "dependencies": { "tslib": "^2.0.0" }, @@ -11201,8 +10218,8 @@ "node": ">=10" }, "peerDependencies": { - "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + "@types/react": "*", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "peerDependenciesMeta": { "@types/react": { @@ -11211,9 +10228,10 @@ } }, "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==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/use-sidecar/-/use-sidecar-1.1.3.tgz", + "integrity": "sha512-Fedw0aZvkhynoPYlA5WXrMCAMm+nSWdZt6lzJQ7Ok8S6Q+VsHmHpRWndVRJ8Be0ZbkfPc5LRYH+5XrzXcEeLRQ==", + "license": "MIT", "dependencies": { "detect-node-es": "^1.1.0", "tslib": "^2.0.0" @@ -11222,8 +10240,8 @@ "node": ">=10" }, "peerDependencies": { - "@types/react": "^16.9.0 || ^17.0.0 || ^18.0.0", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + "@types/react": "*", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "peerDependenciesMeta": { "@types/react": { diff --git a/package.json b/package.json index 3342dba..cde405f 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "dependencies": { "@brojs/cli": "^1.6.3", "@chakra-ui/icons": "^2.2.4", - "@chakra-ui/react": "^2.4.2", + "@chakra-ui/react": "^2.10.5", "@emotion/react": "^11.4.1", "@emotion/styled": "^11.3.0", "@fontsource/open-sans": "^5.1.0", diff --git a/src/api/index.ts b/src/api/index.ts new file mode 100644 index 0000000..c8f65fc --- /dev/null +++ b/src/api/index.ts @@ -0,0 +1 @@ +export * from './landing'; \ No newline at end of file diff --git a/src/api/landing.ts b/src/api/landing.ts deleted file mode 100644 index 1ea8bf4..0000000 --- a/src/api/landing.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { getConfigValue } from '@brojs/cli'; - -import { Order } from '../models/landing'; - -enum LandingEndpoints { - ORDER_VIEW = '/order' -} - -const LandingService = () => { - const endpoint = getConfigValue('dry-wash.api'); - - const fetchOrder = async (orderId: Order.Id) => { - const response = await fetch(`${endpoint}${LandingEndpoints.ORDER_VIEW}/${orderId}`); - - if (!response.ok) { - throw new Error(`Failed to fetch order: ${response.status}`); - } - - return await response.json(); - }; - - return { fetchOrder }; -}; - -export { LandingService, LandingEndpoints }; diff --git a/src/api/landing.tsx b/src/api/landing.tsx new file mode 100644 index 0000000..7348167 --- /dev/null +++ b/src/api/landing.tsx @@ -0,0 +1,107 @@ +import { getConfigValue } from '@brojs/cli'; +import { useEffect, useState } from 'react'; + +import { CreateOrder, GetOrder } from '../models/api'; + +import { QueryState, Trigger } from './types'; + +enum LandingEndpoints { + ORDER = '/order', + ORDER_CREATE = '/order/create', +} + +const endpoint = getConfigValue('dry-wash.api'); + +const useCreateOrderMutation = (): [ + Trigger['data']>, + QueryState, +] => { + const [isLoading, setIsLoading] = useState['isLoading']>(false); + const [isSuccess, setIsSuccess] = useState['isSuccess']>(); + const [data, setData] = useState['data']>(); + const [isError, setIsError] = useState['isError']>(); + const [error, setError] = useState['error']>(); + + const createOrder = async ({ body }: CreateOrder.Params) => { + setIsLoading(true); + + try { + const response = await fetch( + `${endpoint}${LandingEndpoints.ORDER_CREATE}`, + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify(body), + }, + ); + + if (!response.ok) { + const errorResponseObject = + (await response.json()) as QueryState['error']; + setIsError(true); + setError(errorResponseObject); + throw errorResponseObject; + } + + const dataResponseObject = + (await response.json()) as QueryState['data']; + setIsSuccess(true); + setData(dataResponseObject); + + return dataResponseObject; + } catch (error) { + setIsError(true); + setError(error); + throw error; + } finally { + setIsLoading(false); + } + }; + + return [createOrder, { isLoading, isSuccess, data, isError, error }]; +}; + +const useGetOrderQuery = ({ + orderId, +}: GetOrder.Params): QueryState => { + const [isLoading, setIsLoading] = useState['isLoading']>(true); + const [isSuccess, setIsSuccess] = useState['isSuccess']>(); + const [data, setData] = useState['data']>(); + const [isError, setIsError] = useState['isError']>(); + const [error, setError] = useState['error']>(); + + useEffect(() => { + (async () => { + try { + const response = await fetch( + `${endpoint}${LandingEndpoints.ORDER}/${orderId}`, + ); + + if (!response.ok) { + const errorResponseObject = + (await response.json()) as QueryState['error']; + setIsError(true); + setError(errorResponseObject); + throw errorResponseObject; + } + + const dataResponseObject = + (await response.json()) as QueryState['data']; + setIsSuccess(true); + setData(dataResponseObject); + } catch (error) { + setIsError(true); + setError(error); + throw error; + } finally { + setIsLoading(false); + } + })(); + }, []); + + return { isLoading, isSuccess, data, isError, error }; +}; + +export { useCreateOrderMutation, useGetOrderQuery }; diff --git a/src/api/types.ts b/src/api/types.ts new file mode 100644 index 0000000..98d4848 --- /dev/null +++ b/src/api/types.ts @@ -0,0 +1,22 @@ +export type QueryData = { + success: true; + body: D; +}; + +export type QueryErrorData = { + success: false; + error: string; +}; + +export type QueryState = { + isLoading: boolean; + isSuccess: boolean; + data: QueryData; + isError: boolean; + error: { + status: number; + data: QueryErrorData; + }; +}; + +export type Trigger = (params: P) => Promise; diff --git a/src/components/order-form/form/car-body/car-body-select.tsx b/src/components/order-form/form/car-body/car-body-select.tsx index 309958f..ddc873f 100644 --- a/src/components/order-form/form/car-body/car-body-select.tsx +++ b/src/components/order-form/form/car-body/car-body-select.tsx @@ -18,7 +18,9 @@ import { CarBodySelectOption } from './types'; export const CarBodySelect = forwardRef( function CarBodySelect(props, ref) { - const [selected, setSelected] = useState>({}); + const initialOption = carBodySelectOptions.find(({ value }) => value === Number(props.value)); + const [selected, setSelected] = useState>(initialOption); + const handleOptionClick = (option: CarBodySelectOption) => { setSelected(option); // eslint-disable-next-line @typescript-eslint/ban-ts-comment diff --git a/src/components/order-form/form/helper.ts b/src/components/order-form/form/helper.ts index 63ea809..37e2bb7 100644 --- a/src/components/order-form/form/helper.ts +++ b/src/components/order-form/form/helper.ts @@ -1,9 +1,4 @@ import { useTranslation } from "react-i18next"; -import { getConfigValue } from '@brojs/cli'; -import { InputProps, SelectProps } from "@chakra-ui/react"; -import dayjs from "dayjs"; - -import { Order } from "../../../models/landing"; import { FormFieldProps } from "./field"; import { OrderFormValues } from "./types"; @@ -31,50 +26,4 @@ export const useGetValidationRules = () => { validate: (value: string) => isValidCarNumber(value) || t('car-number-field.invalid') }, } satisfies Record; -}; - -const removeAllSpaces = (str: string) => str.replace(/\s+/g, ''); - -const getValidCarBodyStyle = (fieldValue: string) => { - const carBodyAsNumber = Number(fieldValue); - return Number.isNaN(carBodyAsNumber) ? undefined : carBodyAsNumber; -}; - -export const formatFormValues = ({ phone, carNumber, carBody, carColor, carLocation, availableDatetimeBegin, availableDatetimeEnd }: OrderFormValues): Order.Create => { - return { - customer: { - phone - }, - car: { - number: removeAllSpaces(carNumber), - body: getValidCarBodyStyle(carBody), - color: carColor - }, - washing: { - location: carLocation, - begin: dayjs(availableDatetimeBegin).toISOString(), - end: dayjs(availableDatetimeEnd).toISOString(), - } - }; -}; - -const endpoint = getConfigValue('dry-wash.api'); - -export const onSubmit = async (values: OrderFormValues) => { - const response = await fetch(`${endpoint}/order/create`, { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - body: JSON.stringify(formatFormValues(values)), - }); - - if (!response.ok) { - throw new Error(`Failed to create order: ${response.status}`); - } - - return await response.json(); -}; - -export const inputCommonStyles: Partial = { }; \ No newline at end of file diff --git a/src/components/order-form/form/index.ts b/src/components/order-form/form/index.ts index c445fce..8d0176f 100644 --- a/src/components/order-form/form/index.ts +++ b/src/components/order-form/form/index.ts @@ -1 +1,2 @@ +export type { OrderFormValues, OrderFormProps } from './types'; export { OrderForm } from './order-form'; \ No newline at end of file diff --git a/src/components/order-form/form/order-form.tsx b/src/components/order-form/form/order-form.tsx index b368af6..988cbbb 100644 --- a/src/components/order-form/form/order-form.tsx +++ b/src/components/order-form/form/order-form.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import React from 'react'; import { useForm } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; import { Box, Flex, FormControl, FormLabel, VStack } from '@chakra-ui/react'; @@ -7,14 +7,19 @@ import { CarBodySelect } from './car-body'; import { CarColorInput } from './car-color'; import { CarNumberInput } from './car-number'; import { FormInputField, FormControllerField } from './field'; -import { OrderFormValues } from './types'; +import { OrderFormProps, OrderFormValues } from './types'; import { PhoneInput } from './phone'; import { SubmitButton } from './submit'; -import { defaultValues, onSubmit, useGetValidationRules } from './helper'; +import { defaultValues, useGetValidationRules } from './helper'; import { DateTimeInput } from './date-time'; -import { LocationInput, MapComponent, StringLocation, YMapsProvider } from './location'; +import { + LocationInput, + MapComponent, + StringLocation, + YMapsProvider, +} from './location'; -export const OrderForm: FC = () => { +export const OrderForm = ({ onSubmit, loading }: OrderFormProps) => { const { handleSubmit, control, @@ -123,7 +128,7 @@ export const OrderForm: FC = () => { }} /> - + ); diff --git a/src/components/order-form/form/types.ts b/src/components/order-form/form/types.ts index 9746d54..0285c60 100644 --- a/src/components/order-form/form/types.ts +++ b/src/components/order-form/form/types.ts @@ -1,3 +1,5 @@ +import { SubmitHandler } from "react-hook-form"; + export type OrderFormValues = { phone: string; carNumber: string; @@ -6,4 +8,9 @@ export type OrderFormValues = { carLocation: string; availableDatetimeBegin: string; availableDatetimeEnd: string; +}; + +export type OrderFormProps = { + onSubmit: SubmitHandler; + loading: boolean; }; \ No newline at end of file diff --git a/src/components/order-view/details/order-details.tsx b/src/components/order-view/details/order-details.tsx index 515c567..5343fdf 100644 --- a/src/components/order-view/details/order-details.tsx +++ b/src/components/order-view/details/order-details.tsx @@ -17,7 +17,19 @@ import { carBodySelectOptions } from '../../order-form/form/car-body/helper'; import { OrderStatus } from './status'; -type OrderDetailsProps = Order.View; +type OrderDetailsProps = Pick< + Order.View, + | 'id' + | 'status' + | 'phone' + | 'carNumber' + | 'carBody' + | 'carColor' + | 'location' + | 'startWashTime' + | 'endWashTime' + | 'created' +>; export const OrderDetails: FC = ({ id, @@ -27,8 +39,8 @@ export const OrderDetails: FC = ({ carBody, carColor, location, - datetimeBegin, - datetimeEnd, + startWashTime, + endWashTime, }) => { const { t } = useTranslation('~', { keyPrefix: 'dry-wash.order-view.details', @@ -75,8 +87,8 @@ export const OrderDetails: FC = ({ { label: t('datetime-range'), value: [ - formatDatetime(datetimeBegin), - formatDatetime(datetimeEnd), + formatDatetime(startWashTime), + formatDatetime(endWashTime), ].join(' - '), }, ].map(({ label, value }, i) => ( diff --git a/src/containers/LandingThemeProvider/LandingThemeProvider.tsx b/src/containers/LandingThemeProvider/LandingThemeProvider.tsx index 12483f0..3755d03 100644 --- a/src/containers/LandingThemeProvider/LandingThemeProvider.tsx +++ b/src/containers/LandingThemeProvider/LandingThemeProvider.tsx @@ -1,14 +1,31 @@ -import React, { FC, PropsWithChildren } from 'react'; +import React, { ComponentType, FC, PropsWithChildren } from 'react'; import { ChakraProvider } from '@chakra-ui/react'; import { default as landingTheme } from './theme-config'; import Fonts from './Fonts'; +import { toastOptions } from './toast-options'; export const LandingThemeProvider: FC = ({ children }) => { return ( - + {children} ); }; + +export function withLandingThemeProvider(WrappedComponent: ComponentType) { + const displayName = WrappedComponent.displayName || WrappedComponent.name || 'Component'; + + const ComponentWithLandingThemeProvider = (props: T) => { + return ( + + + + ); + }; + + ComponentWithLandingThemeProvider.displayName = `withLandingThemeProvider(${displayName})`; + + return ComponentWithLandingThemeProvider; +} diff --git a/src/containers/LandingThemeProvider/index.ts b/src/containers/LandingThemeProvider/index.ts index b68aca1..3dc890b 100644 --- a/src/containers/LandingThemeProvider/index.ts +++ b/src/containers/LandingThemeProvider/index.ts @@ -1 +1 @@ -export { LandingThemeProvider } from './LandingThemeProvider'; \ No newline at end of file +export { LandingThemeProvider, withLandingThemeProvider } from './LandingThemeProvider'; \ No newline at end of file diff --git a/src/containers/LandingThemeProvider/toast-options.ts b/src/containers/LandingThemeProvider/toast-options.ts new file mode 100644 index 0000000..3bd5294 --- /dev/null +++ b/src/containers/LandingThemeProvider/toast-options.ts @@ -0,0 +1,8 @@ +import { ToastProviderProps } from "@chakra-ui/react"; + +export const toastOptions: ToastProviderProps = { + defaultOptions: { + position: 'top-right', + isClosable: true, + } +}; \ No newline at end of file diff --git a/src/models/api/index.ts b/src/models/api/index.ts index e27d5ad..f57351e 100644 --- a/src/models/api/index.ts +++ b/src/models/api/index.ts @@ -1 +1 @@ -export * from './order-view'; \ No newline at end of file +export * from './order'; \ No newline at end of file diff --git a/src/models/api/order-view.ts b/src/models/api/order-view.ts deleted file mode 100644 index 0c33f0c..0000000 --- a/src/models/api/order-view.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Order } from "../landing"; - -export type FetchOrderQueryResponse = { - id: string; - orderDate: string; - carNumber: string; - carBody: number; - carColor?: string; - startWashTime: string; - endWashTime: string; - status: Order.Status; - phone: string; - location: string; -}; \ No newline at end of file diff --git a/src/models/api/order.ts b/src/models/api/order.ts new file mode 100644 index 0000000..b22283b --- /dev/null +++ b/src/models/api/order.ts @@ -0,0 +1,18 @@ +/* eslint-disable @typescript-eslint/no-namespace */ +import { Order } from "../landing"; + +export namespace CreateOrder { + export type Response = { + id: Order.Id + }; + export type Params = { + body: Order.Create + }; +}; + +export namespace GetOrder { + export type Response = Order.View; + export type Params = { + orderId: Order.Id + }; +}; \ No newline at end of file diff --git a/src/models/common.ts b/src/models/common.ts new file mode 100644 index 0000000..99fb844 --- /dev/null +++ b/src/models/common.ts @@ -0,0 +1 @@ +export type IsoDate = string; // YYYY-MM-DDThh:mm:ss.mmmZ \ No newline at end of file diff --git a/src/models/landing/car.ts b/src/models/landing/car.ts index 9058a85..971cc78 100644 --- a/src/models/landing/car.ts +++ b/src/models/landing/car.ts @@ -1,4 +1,4 @@ -export type RegistrationNumber = string; // А012ВЕ +export type RegistrationNumber = string; // А012ВЕ16 export type Color = string; // #000000 diff --git a/src/models/landing/order.ts b/src/models/landing/order.ts index 8a8eeef..58db543 100644 --- a/src/models/landing/order.ts +++ b/src/models/landing/order.ts @@ -1,3 +1,5 @@ +import { IsoDate } from "../common"; + import { Car, Customer, Washing } from "."; export type Id = string; @@ -25,14 +27,16 @@ export type Create = { }; export type View = { - id: Id; - orderDate: string, - status: Status, phone: Customer.PhoneNumber; carNumber: Car.RegistrationNumber; carBody: Car.BodyStyle; carColor?: Car.Color; location: Washing.Location; - datetimeBegin: Washing.AvailableBeginDateTime; - datetimeEnd: Washing.AvailableEndDateTime; + startWashTime: Washing.AvailableBeginDateTime; + endWashTime: Washing.AvailableEndDateTime; + status: Status, + notes: string; + created: IsoDate; + updated: IsoDate; + id: Id; }; \ No newline at end of file diff --git a/src/models/landing/washing.ts b/src/models/landing/washing.ts index c61c638..61c8b7a 100644 --- a/src/models/landing/washing.ts +++ b/src/models/landing/washing.ts @@ -1,5 +1,7 @@ -export type Location = string; // ? +import { IsoDate } from "../common"; -export type AvailableBeginDateTime = string; // YYYY-MM-DDThh:mm +export type Location = string; // 55.754364, 48.743295 Университетская улица, 1, Иннополис, Верхнеуслонский район, Республика Татарстан (Татарстан), 420500 -export type AvailableEndDateTime = string; // YYYY-MM-DDThh:mm \ No newline at end of file +export type AvailableBeginDateTime = IsoDate; + +export type AvailableEndDateTime = IsoDate; \ No newline at end of file diff --git a/src/pages/order-create/helper.ts b/src/pages/order-create/helper.ts new file mode 100644 index 0000000..d3c3f2e --- /dev/null +++ b/src/pages/order-create/helper.ts @@ -0,0 +1,29 @@ +import dayjs from "dayjs"; + +import { Order } from "../../models/landing"; +import { OrderFormValues } from "../../components/order-form"; + +const removeAllSpaces = (str: string) => str.replace(/\s+/g, ''); + +const getValidCarBodyStyle = (fieldValue: string) => { + const carBodyAsNumber = Number(fieldValue); + return Number.isNaN(carBodyAsNumber) ? undefined : carBodyAsNumber; +}; + +export const formatFormValues = ({ phone, carNumber, carBody, carColor, carLocation, availableDatetimeBegin, availableDatetimeEnd }: OrderFormValues): Order.Create => { + return { + customer: { + phone + }, + car: { + number: removeAllSpaces(carNumber), + body: getValidCarBodyStyle(carBody), + color: carColor + }, + washing: { + location: carLocation, + begin: dayjs(availableDatetimeBegin).toISOString(), + end: dayjs(availableDatetimeEnd).toISOString(), + } + }; +}; \ No newline at end of file diff --git a/src/pages/order-create/index.tsx b/src/pages/order-create/index.tsx index e4dd2ad..4b91eb1 100644 --- a/src/pages/order-create/index.tsx +++ b/src/pages/order-create/index.tsx @@ -1,32 +1,63 @@ import React, { FC } from 'react'; import { useTranslation } from 'react-i18next'; -import { Container, Heading, VStack } from '@chakra-ui/react'; +import { Container, Heading, useToast, VStack } from '@chakra-ui/react'; +import { useNavigate } from 'react-router-dom'; -import { LandingThemeProvider } from '../../containers'; -import { OrderForm } from '../../components/order-form'; +import { withLandingThemeProvider } from '../../containers'; +import { OrderForm, OrderFormProps } from '../../components/order-form'; +import { useCreateOrderMutation } from '../../api'; +import { URLs } from '../../__data__/urls'; + +import { formatFormValues } from './helper'; const Page: FC = () => { const { t } = useTranslation('~', { keyPrefix: 'dry-wash.order-create', }); + const [createOrder, createOrderMutation] = useCreateOrderMutation(); + + const toast = useToast(); + const navigate = useNavigate(); + + const onOrderFormSubmit: OrderFormProps['onSubmit'] = (values) => { + createOrder({ body: formatFormValues(values) }) + .then(({ body: { id: orderId } }) => { + navigate({ pathname: URLs.orderView.getUrl(orderId) }); + toast({ + status: 'success', + title: t('create-order-query.success.title'), + }); + }) + .catch(({ error: errorMessage }) => { + toast({ + status: 'error', + title: t('create-order-query.error.title'), + description: errorMessage, + }); + }); + }; + return ( - - - - {t('title')} - - - - + + + + {t('title')} + + + + ); }; -export default Page; \ No newline at end of file +export default withLandingThemeProvider(Page); diff --git a/src/pages/order-view/helper.tsx b/src/pages/order-view/helper.tsx deleted file mode 100644 index 13f9513..0000000 --- a/src/pages/order-view/helper.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import { useEffect, useState } from 'react'; - -import { LandingService } from '../../api/landing'; -import { Order } from '../../models/landing'; -import { FetchOrderQueryResponse } from '../../models/api'; - -export const useFetchOrderDetails = ({ - orderId, -}: { - orderId: Order.View['id']; -}) => { - const { fetchOrder } = LandingService(); - - const [data, setData] = useState(); - const [isLoading, setIsLoading] = useState(false); - const [error, setError] = useState(null); - - useEffect(() => { - const fetchData = async () => { - setIsLoading(true); - - try { - const data = await fetchOrder(orderId); - setData(data.body); - } catch (error) { - setError(error.message); - } finally { - setIsLoading(false); - } - }; - - fetchData(); - }, []); - - return { - isLoading, - data, - error, - }; -}; diff --git a/src/pages/order-view/index.tsx b/src/pages/order-view/index.tsx index 5ac4bd0..c2b007d 100644 --- a/src/pages/order-view/index.tsx +++ b/src/pages/order-view/index.tsx @@ -1,36 +1,32 @@ -import React, { FC, useEffect } from 'react'; -import { HStack, Spinner, useToast } from '@chakra-ui/react'; +import React, { FC } from 'react'; +import { Alert, AlertDescription, AlertIcon, AlertTitle, HStack, Spinner } from '@chakra-ui/react'; import { useTranslation } from 'react-i18next'; import { Container, Heading, VStack } from '@chakra-ui/react'; import { useParams } from 'react-router-dom'; -import { LandingThemeProvider } from '../../containers'; +import { + LandingThemeProvider, + withLandingThemeProvider, +} from '../../containers'; import { OrderDetails } from '../../components/order-view'; - -import { useFetchOrderDetails } from './helper'; +import { Order } from '../../models/landing'; +import { useGetOrderQuery } from '../../api'; const Page: FC = () => { const { t } = useTranslation('~', { keyPrefix: 'dry-wash.order-view', }); - const { orderId } = useParams(); - - const { isLoading, data, error } = useFetchOrderDetails({ orderId }); - - const toast = useToast(); - useEffect(() => { - if (error) { - toast({ - title: t('error.title'), - description: t('fetch.error'), - status: 'error', - duration: 5000, - isClosable: true, - position: 'bottom-right', - }); - } - }, [error]); + const { orderId } = useParams(); + const { + isLoading, + isSuccess, + data: { body: order } = {}, + isError, + error, + } = useGetOrderQuery({ + orderId, + }); return ( @@ -51,20 +47,37 @@ const Page: FC = () => { ) : ( - data && ( - - ) + <> + <> + {isSuccess && ( + + )} + + <> + {isError && ( + + + + {t('get-order-query.error.title', { + number: orderId, + })} + + {error.data?.error} + + )} + + )} @@ -72,4 +85,4 @@ const Page: FC = () => { ); }; -export default Page; +export default withLandingThemeProvider(Page); diff --git a/stubs/json/landing-order-view/1-success.json b/stubs/json/landing-order-view/1-success.json index 4e09761..bd5f926 100644 --- a/stubs/json/landing-order-view/1-success.json +++ b/stubs/json/landing-order-view/1-success.json @@ -1,14 +1,17 @@ { "success": true, "body": { - "id": "order1", - "orderDate": "2024-11-24T08:41:46.366Z", - "status": "progress", - "carNumber": "A123BC", - "carBody": 1, - "startWashTime": "2024-11-24T10:30:00.000Z", - "endWashTime": "2024-11-24T16:30:00.000Z", - "phone": "79001234563", - "location": "55.754364, 48.743295 Университетская улица, 1, Иннополис, Верхнеуслонский район, Республика Татарстан (Татарстан), 420500" + "phone": "+79876543210", + "carNumber": "А123АА16", + "carBody": 2, + "carColor": "#ffffff", + "startWashTime": "2025-01-19T14:03:00.000Z", + "endWashTime": "2025-01-19T14:03:00.000Z", + "location": "55.793833888711006,49.19037910644527 Республика Татарстан (Татарстан), Казань, жилой район Седьмое Небо", + "status": "progress", + "notes": "", + "created": "2025-01-19T14:04:02.985Z", + "updated": "2025-01-19T14:04:02.987Z", + "id": "678d06527d78ec30be2679d8" } } \ No newline at end of file