From 370d1b3baeec7fc53b76f4aaa4ef01f6fd15c53b Mon Sep 17 00:00:00 2001 From: Ayush Sehrawat Date: Thu, 21 Dec 2023 00:07:36 +0530 Subject: [PATCH] feat: added partial settings form --- frontend/package.json | 5 +- frontend/pnpm-lock.yaml | 98 +++++++------------ .../lib/components/ui/form/form-button.svelte | 9 ++ .../components/ui/form/form-checkbox.svelte | 26 +++++ .../ui/form/form-description.svelte | 16 +++ .../lib/components/ui/form/form-input.svelte | 28 ++++++ .../lib/components/ui/form/form-item.svelte | 12 +++ .../lib/components/ui/form/form-label.svelte | 21 ++++ .../ui/form/form-native-select.svelte | 26 +++++ .../ui/form/form-radio-group.svelte | 22 +++++ .../ui/form/form-select-trigger.svelte | 23 +++++ .../lib/components/ui/form/form-select.svelte | 20 ++++ .../lib/components/ui/form/form-switch.svelte | 24 +++++ .../components/ui/form/form-textarea.svelte | 32 ++++++ .../components/ui/form/form-validation.svelte | 14 +++ frontend/src/lib/components/ui/form/index.ts | 85 ++++++++++++++++ .../lib/components/ui/radio-group/index.ts | 15 +++ .../ui/radio-group/radio-group-item.svelte | 28 ++++++ .../ui/radio-group/radio-group.svelte | 18 ++++ .../src/lib/components/ui/switch/index.ts | 7 ++ .../lib/components/ui/switch/switch.svelte | 25 +++++ .../src/lib/components/ui/textarea/index.ts | 28 ++++++ .../components/ui/textarea/textarea.svelte | 31 ++++++ frontend/src/lib/schemas/setting.ts | 10 ++ frontend/src/routes/settings/+layout.svelte | 8 ++ .../src/routes/settings/about/+page.server.ts | 3 - .../routes/settings/general/+page.server.ts | 45 +++++++-- .../src/routes/settings/general/+page.svelte | 51 +++++++++- 28 files changed, 655 insertions(+), 75 deletions(-) create mode 100644 frontend/src/lib/components/ui/form/form-button.svelte create mode 100644 frontend/src/lib/components/ui/form/form-checkbox.svelte create mode 100644 frontend/src/lib/components/ui/form/form-description.svelte create mode 100644 frontend/src/lib/components/ui/form/form-input.svelte create mode 100644 frontend/src/lib/components/ui/form/form-item.svelte create mode 100644 frontend/src/lib/components/ui/form/form-label.svelte create mode 100644 frontend/src/lib/components/ui/form/form-native-select.svelte create mode 100644 frontend/src/lib/components/ui/form/form-radio-group.svelte create mode 100644 frontend/src/lib/components/ui/form/form-select-trigger.svelte create mode 100644 frontend/src/lib/components/ui/form/form-select.svelte create mode 100644 frontend/src/lib/components/ui/form/form-switch.svelte create mode 100644 frontend/src/lib/components/ui/form/form-textarea.svelte create mode 100644 frontend/src/lib/components/ui/form/form-validation.svelte create mode 100644 frontend/src/lib/components/ui/form/index.ts create mode 100644 frontend/src/lib/components/ui/radio-group/index.ts create mode 100644 frontend/src/lib/components/ui/radio-group/radio-group-item.svelte create mode 100644 frontend/src/lib/components/ui/radio-group/radio-group.svelte create mode 100644 frontend/src/lib/components/ui/switch/index.ts create mode 100644 frontend/src/lib/components/ui/switch/switch.svelte create mode 100644 frontend/src/lib/components/ui/textarea/index.ts create mode 100644 frontend/src/lib/components/ui/textarea/textarea.svelte create mode 100644 frontend/src/lib/schemas/setting.ts diff --git a/frontend/package.json b/frontend/package.json index 667c27f2..fc83c66b 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -40,11 +40,14 @@ "dependencies": { "bits-ui": "^0.11.8", "clsx": "^2.0.0", + "formsnap": "^0.4.1", "lucide-svelte": "^0.298.0", "luxon": "^3.4.4", "mode-watcher": "^0.1.2", "svelte-sonner": "^0.3.6", + "sveltekit-superforms": "^1.12.0", "tailwind-merge": "^2.1.0", - "tailwind-variants": "^0.1.18" + "tailwind-variants": "^0.1.18", + "zod": "^3.22.4" } } \ No newline at end of file diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml index 2f8b7635..423985d1 100644 --- a/frontend/pnpm-lock.yaml +++ b/frontend/pnpm-lock.yaml @@ -11,6 +11,9 @@ dependencies: clsx: specifier: ^2.0.0 version: 2.0.0 + formsnap: + specifier: ^0.4.1 + version: 0.4.1(svelte@4.2.8)(sveltekit-superforms@1.12.0)(zod@3.22.4) lucide-svelte: specifier: ^0.298.0 version: 0.298.0(svelte@4.2.8) @@ -23,12 +26,18 @@ dependencies: svelte-sonner: specifier: ^0.3.6 version: 0.3.6(svelte@4.2.8) + sveltekit-superforms: + specifier: ^1.12.0 + version: 1.12.0(@sveltejs/kit@2.0.1)(svelte@4.2.8)(zod@3.22.4) tailwind-merge: specifier: ^2.1.0 version: 2.1.0 tailwind-variants: specifier: ^0.1.18 version: 0.1.19(tailwindcss@3.4.0) + zod: + specifier: ^3.22.4 + version: 3.22.4 devDependencies: '@sveltejs/adapter-auto': @@ -129,7 +138,6 @@ packages: cpu: [arm64] os: [android] requiresBuild: true - dev: true optional: true /@esbuild/android-arm@0.19.9: @@ -138,7 +146,6 @@ packages: cpu: [arm] os: [android] requiresBuild: true - dev: true optional: true /@esbuild/android-x64@0.19.9: @@ -147,7 +154,6 @@ packages: cpu: [x64] os: [android] requiresBuild: true - dev: true optional: true /@esbuild/darwin-arm64@0.19.9: @@ -156,7 +162,6 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true - dev: true optional: true /@esbuild/darwin-x64@0.19.9: @@ -165,7 +170,6 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true - dev: true optional: true /@esbuild/freebsd-arm64@0.19.9: @@ -174,7 +178,6 @@ packages: cpu: [arm64] os: [freebsd] requiresBuild: true - dev: true optional: true /@esbuild/freebsd-x64@0.19.9: @@ -183,7 +186,6 @@ packages: cpu: [x64] os: [freebsd] requiresBuild: true - dev: true optional: true /@esbuild/linux-arm64@0.19.9: @@ -192,7 +194,6 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-arm@0.19.9: @@ -201,7 +202,6 @@ packages: cpu: [arm] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-ia32@0.19.9: @@ -210,7 +210,6 @@ packages: cpu: [ia32] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-loong64@0.19.9: @@ -219,7 +218,6 @@ packages: cpu: [loong64] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-mips64el@0.19.9: @@ -228,7 +226,6 @@ packages: cpu: [mips64el] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-ppc64@0.19.9: @@ -237,7 +234,6 @@ packages: cpu: [ppc64] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-riscv64@0.19.9: @@ -246,7 +242,6 @@ packages: cpu: [riscv64] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-s390x@0.19.9: @@ -255,7 +250,6 @@ packages: cpu: [s390x] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-x64@0.19.9: @@ -264,7 +258,6 @@ packages: cpu: [x64] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/netbsd-x64@0.19.9: @@ -273,7 +266,6 @@ packages: cpu: [x64] os: [netbsd] requiresBuild: true - dev: true optional: true /@esbuild/openbsd-x64@0.19.9: @@ -282,7 +274,6 @@ packages: cpu: [x64] os: [openbsd] requiresBuild: true - dev: true optional: true /@esbuild/sunos-x64@0.19.9: @@ -291,7 +282,6 @@ packages: cpu: [x64] os: [sunos] requiresBuild: true - dev: true optional: true /@esbuild/win32-arm64@0.19.9: @@ -300,7 +290,6 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true - dev: true optional: true /@esbuild/win32-ia32@0.19.9: @@ -309,7 +298,6 @@ packages: cpu: [ia32] os: [win32] requiresBuild: true - dev: true optional: true /@esbuild/win32-x64@0.19.9: @@ -318,7 +306,6 @@ packages: cpu: [x64] os: [win32] requiresBuild: true - dev: true optional: true /@eslint-community/eslint-utils@4.4.0(eslint@8.56.0): @@ -467,7 +454,6 @@ packages: /@polka/url@1.0.0-next.24: resolution: {integrity: sha512-2LuNTFBIO0m7kKIQvvPHN6UE63VjpmL9rnEEaOOaiSPbZK+zUOYIzBAWcED+3XYzhYsd/0mD57VdxAEqqV52CQ==} - dev: true /@rollup/plugin-commonjs@25.0.7(rollup@4.9.1): resolution: {integrity: sha512-nEvcR+LRjEjsaSsc4x3XZfCCvZIaSMenZu/OiwOKGN2UhQpAYI7ru7czFvyWbErlpoGjnSX3D5Ch5FcMA3kRWQ==} @@ -538,7 +524,6 @@ packages: cpu: [arm] os: [android] requiresBuild: true - dev: true optional: true /@rollup/rollup-android-arm64@4.9.1: @@ -546,7 +531,6 @@ packages: cpu: [arm64] os: [android] requiresBuild: true - dev: true optional: true /@rollup/rollup-darwin-arm64@4.9.1: @@ -554,7 +538,6 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true - dev: true optional: true /@rollup/rollup-darwin-x64@4.9.1: @@ -562,7 +545,6 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true - dev: true optional: true /@rollup/rollup-linux-arm-gnueabihf@4.9.1: @@ -570,7 +552,6 @@ packages: cpu: [arm] os: [linux] requiresBuild: true - dev: true optional: true /@rollup/rollup-linux-arm64-gnu@4.9.1: @@ -578,7 +559,6 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true - dev: true optional: true /@rollup/rollup-linux-arm64-musl@4.9.1: @@ -586,7 +566,6 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true - dev: true optional: true /@rollup/rollup-linux-riscv64-gnu@4.9.1: @@ -594,7 +573,6 @@ packages: cpu: [riscv64] os: [linux] requiresBuild: true - dev: true optional: true /@rollup/rollup-linux-x64-gnu@4.9.1: @@ -602,7 +580,6 @@ packages: cpu: [x64] os: [linux] requiresBuild: true - dev: true optional: true /@rollup/rollup-linux-x64-musl@4.9.1: @@ -610,7 +587,6 @@ packages: cpu: [x64] os: [linux] requiresBuild: true - dev: true optional: true /@rollup/rollup-win32-arm64-msvc@4.9.1: @@ -618,7 +594,6 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true - dev: true optional: true /@rollup/rollup-win32-ia32-msvc@4.9.1: @@ -626,7 +601,6 @@ packages: cpu: [ia32] os: [win32] requiresBuild: true - dev: true optional: true /@rollup/rollup-win32-x64-msvc@4.9.1: @@ -634,7 +608,6 @@ packages: cpu: [x64] os: [win32] requiresBuild: true - dev: true optional: true /@sinclair/typebox@0.27.8: @@ -686,7 +659,6 @@ packages: svelte: 4.2.8 tiny-glob: 0.2.9 vite: 5.0.10 - dev: true /@sveltejs/vite-plugin-svelte-inspector@2.0.0(@sveltejs/vite-plugin-svelte@3.0.1)(svelte@4.2.8)(vite@5.0.10): resolution: {integrity: sha512-gjr9ZFg1BSlIpfZ4PRewigrvYmHWbDrq2uvvPB1AmTWKuM+dI1JXQSUu2pIrYLb/QncyiIGkFDFKTwJ0XqQZZg==} @@ -702,7 +674,6 @@ packages: vite: 5.0.10 transitivePeerDependencies: - supports-color - dev: true /@sveltejs/vite-plugin-svelte@3.0.1(svelte@4.2.8)(vite@5.0.10): resolution: {integrity: sha512-CGURX6Ps+TkOovK6xV+Y2rn8JKa8ZPUHPZ/NKgCxAmgBrXReavzFl8aOSCj3kQ1xqT7yGJj53hjcV/gqwDAaWA==} @@ -722,7 +693,6 @@ packages: vitefu: 0.2.5(vite@5.0.10) transitivePeerDependencies: - supports-color - dev: true /@swc/helpers@0.5.3: resolution: {integrity: sha512-FaruWX6KdudYloq1AHD/4nU+UsMTdNE8CKyrseXWEcgjDAbvkwJg2QGPAnfIJLIWsjZOSPLOAykK6fuYp4vp4A==} @@ -732,7 +702,6 @@ packages: /@types/cookie@0.6.0: resolution: {integrity: sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==} - dev: true /@types/estree@1.0.5: resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} @@ -1180,7 +1149,6 @@ packages: /cookie@0.6.0: resolution: {integrity: sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==} engines: {node: '>= 0.6'} - dev: true /cross-spawn@7.0.3: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} @@ -1213,7 +1181,6 @@ packages: optional: true dependencies: ms: 2.1.2 - dev: true /deep-eql@4.1.3: resolution: {integrity: sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==} @@ -1229,7 +1196,6 @@ packages: /deepmerge@4.3.1: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} - dev: true /dequal@2.0.3: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} @@ -1242,7 +1208,6 @@ packages: /devalue@4.3.2: resolution: {integrity: sha512-KqFl6pOgOW+Y6wJgu80rHpo2/3H07vr8ntR9rkkFIRETewbf5GaYYcakYfiKz89K+sLsuPkQIZaXDMjUObZwWg==} - dev: true /didyoumean@1.2.2: resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==} @@ -1305,7 +1270,6 @@ packages: '@esbuild/win32-arm64': 0.19.9 '@esbuild/win32-ia32': 0.19.9 '@esbuild/win32-x64': 0.19.9 - dev: true /escalade@3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} @@ -1426,7 +1390,6 @@ packages: /esm-env@1.0.0: resolution: {integrity: sha512-Cf6VksWPsTuW01vU9Mk/3vRue91Zevka5SjyNf3nEpokFRuqt/KjUQoGAwq9qMmhpLTHmXzSIrFRw8zxWzmFBA==} - dev: true /espree@9.6.1: resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} @@ -1552,6 +1515,18 @@ packages: tabbable: 6.2.0 dev: false + /formsnap@0.4.1(svelte@4.2.8)(sveltekit-superforms@1.12.0)(zod@3.22.4): + resolution: {integrity: sha512-hUOaDKb+KoBi4PamJRnxRqIQW3msp2BKPqohoqjHUuBb+vgBrhoaz0WYEFkXG4bzVQS3JngG55m/zX5ciZTyeA==} + peerDependencies: + svelte: ^4.0.0 + sveltekit-superforms: ^1.7.1 + zod: ^3.22.2 + dependencies: + svelte: 4.2.8 + sveltekit-superforms: 1.12.0(@sveltejs/kit@2.0.1)(svelte@4.2.8)(zod@3.22.4) + zod: 3.22.4 + dev: false + /fraction.js@4.3.7: resolution: {integrity: sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==} dev: true @@ -1631,7 +1606,6 @@ packages: /globalyzer@0.1.0: resolution: {integrity: sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==} - dev: true /globby@11.1.0: resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} @@ -1647,7 +1621,6 @@ packages: /globrex@0.1.2: resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==} - dev: true /graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} @@ -1801,7 +1774,6 @@ packages: /kleur@4.1.5: resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==} engines: {node: '>=6'} - dev: true /known-css-properties@0.29.0: resolution: {integrity: sha512-Ne7wqW7/9Cz54PDt4I3tcV+hAyat8ypyOGzYRJQfdxnnjeWsTxt1cy8pjvvKeI5kfXuyvULyeeAvwvvtAX3ayQ==} @@ -1958,16 +1930,13 @@ packages: /mri@1.2.0: resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} engines: {node: '>=4'} - dev: true /mrmime@1.0.1: resolution: {integrity: sha512-hzzEagAgDyoU1Q6yg5uI+AorQgdvMCur3FcKf7NhMKWsaYg+RnbTyHRa/9IlLF9rf455MOCtcqqrQQ83pPP7Uw==} engines: {node: '>=10'} - dev: true /ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - dev: true /mz@2.7.0: resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} @@ -2389,7 +2358,6 @@ packages: '@rollup/rollup-win32-ia32-msvc': 4.9.1 '@rollup/rollup-win32-x64-msvc': 4.9.1 fsevents: 2.3.3 - dev: true /run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} @@ -2401,7 +2369,6 @@ packages: engines: {node: '>=6'} dependencies: mri: 1.2.0 - dev: true /sander@0.5.1: resolution: {integrity: sha512-3lVqBir7WuKDHGrKRDn/1Ye3kwpXaDOMsiRP1wd6wpZW56gJhsbp5RqQpA6JG/P+pkXizygnr1dKR8vzWaVsfA==} @@ -2422,7 +2389,6 @@ packages: /set-cookie-parser@2.6.0: resolution: {integrity: sha512-RVnVQxTXuerk653XfuliOxBP81Sf0+qfQE73LIYKcyMYHG94AuH0kgrQpRDuTZnSmjpysHmzxJXKNfa6PjFhyQ==} - dev: true /shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} @@ -2452,7 +2418,6 @@ packages: '@polka/url': 1.0.0-next.24 mrmime: 1.0.1 totalist: 3.0.1 - dev: true /slash@3.0.0: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} @@ -2586,7 +2551,6 @@ packages: svelte: ^3.19.0 || ^4.0.0 dependencies: svelte: 4.2.8 - dev: true /svelte-preprocess@5.1.2(postcss-load-config@4.0.2)(postcss@8.4.32)(svelte@4.2.8)(typescript@5.3.3): resolution: {integrity: sha512-XF0aliMAcYnP4hLETvB6HRAMnaL09ASYT1Z2I1Gwu0nz6xbdg/dSgAEthtFZJA4AKrNhFDFdmUDO+H9d/6xg5g==} @@ -2663,6 +2627,18 @@ packages: magic-string: 0.30.5 periscopic: 3.1.0 + /sveltekit-superforms@1.12.0(@sveltejs/kit@2.0.1)(svelte@4.2.8)(zod@3.22.4): + resolution: {integrity: sha512-yer9YKhfWsKsDIxXahFLuGuUel32gyi96qIdxTVFAOWXZM9ZaMEP7+FL2cMYRDg6Xqlrh5SQ9oQdkVYeLNG0eA==} + peerDependencies: + '@sveltejs/kit': 1.x || 2.x + svelte: 3.x || 4.x + zod: 3.x + dependencies: + '@sveltejs/kit': 2.0.1(@sveltejs/vite-plugin-svelte@3.0.1)(svelte@4.2.8)(vite@5.0.10) + svelte: 4.2.8 + zod: 3.22.4 + dev: false + /tabbable@6.2.0: resolution: {integrity: sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==} dev: false @@ -2737,7 +2713,6 @@ packages: dependencies: globalyzer: 0.1.0 globrex: 0.1.2 - dev: true /tinybench@2.5.1: resolution: {integrity: sha512-65NKvSuAVDP/n4CqH+a9w2kTlLReS9vhsAP06MWx+/89nMinJyB2icyl58RIcqCmIggpojIGeuJGhjU1aGMBSg==} @@ -2762,7 +2737,6 @@ packages: /totalist@3.0.1: resolution: {integrity: sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==} engines: {node: '>=6'} - dev: true /ts-api-utils@1.0.3(typescript@5.3.3): resolution: {integrity: sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==} @@ -2880,7 +2854,6 @@ packages: rollup: 4.9.1 optionalDependencies: fsevents: 2.3.3 - dev: true /vitefu@0.2.5(vite@5.0.10): resolution: {integrity: sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==} @@ -2891,7 +2864,6 @@ packages: optional: true dependencies: vite: 5.0.10 - dev: true /vitest@1.0.4: resolution: {integrity: sha512-s1GQHp/UOeWEo4+aXDOeFBJwFzL6mjycbQwwKWX2QcYfh/7tIerS59hWQ20mxzupTJluA2SdwiBuWwQHH67ckg==} @@ -2991,3 +2963,7 @@ packages: resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==} engines: {node: '>=12.20'} dev: true + + /zod@3.22.4: + resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==} + dev: false diff --git a/frontend/src/lib/components/ui/form/form-button.svelte b/frontend/src/lib/components/ui/form/form-button.svelte new file mode 100644 index 00000000..024f9dc5 --- /dev/null +++ b/frontend/src/lib/components/ui/form/form-button.svelte @@ -0,0 +1,9 @@ + + + + + diff --git a/frontend/src/lib/components/ui/form/form-checkbox.svelte b/frontend/src/lib/components/ui/form/form-checkbox.svelte new file mode 100644 index 00000000..46b91516 --- /dev/null +++ b/frontend/src/lib/components/ui/form/form-checkbox.svelte @@ -0,0 +1,26 @@ + + + { + onCheckedChange?.(v); + setValue(v); + }} + {...$$restProps} + on:click + on:keydown +/> + diff --git a/frontend/src/lib/components/ui/form/form-description.svelte b/frontend/src/lib/components/ui/form/form-description.svelte new file mode 100644 index 00000000..6efa0e5b --- /dev/null +++ b/frontend/src/lib/components/ui/form/form-description.svelte @@ -0,0 +1,16 @@ + + + + + diff --git a/frontend/src/lib/components/ui/form/form-input.svelte b/frontend/src/lib/components/ui/form/form-input.svelte new file mode 100644 index 00000000..224f44a4 --- /dev/null +++ b/frontend/src/lib/components/ui/form/form-input.svelte @@ -0,0 +1,28 @@ + + + diff --git a/frontend/src/lib/components/ui/form/form-item.svelte b/frontend/src/lib/components/ui/form/form-item.svelte new file mode 100644 index 00000000..0e5daa45 --- /dev/null +++ b/frontend/src/lib/components/ui/form/form-item.svelte @@ -0,0 +1,12 @@ + + +
+ +
diff --git a/frontend/src/lib/components/ui/form/form-label.svelte b/frontend/src/lib/components/ui/form/form-label.svelte new file mode 100644 index 00000000..96083e55 --- /dev/null +++ b/frontend/src/lib/components/ui/form/form-label.svelte @@ -0,0 +1,21 @@ + + + diff --git a/frontend/src/lib/components/ui/form/form-native-select.svelte b/frontend/src/lib/components/ui/form/form-native-select.svelte new file mode 100644 index 00000000..0443efbc --- /dev/null +++ b/frontend/src/lib/components/ui/form/form-native-select.svelte @@ -0,0 +1,26 @@ + + +
+ + + + +
diff --git a/frontend/src/lib/components/ui/form/form-radio-group.svelte b/frontend/src/lib/components/ui/form/form-radio-group.svelte new file mode 100644 index 00000000..91f6b801 --- /dev/null +++ b/frontend/src/lib/components/ui/form/form-radio-group.svelte @@ -0,0 +1,22 @@ + + + { + onValueChange?.(v); + setValue(v); + }} + {...$$restProps} +> + + + diff --git a/frontend/src/lib/components/ui/form/form-select-trigger.svelte b/frontend/src/lib/components/ui/form/form-select-trigger.svelte new file mode 100644 index 00000000..de71fbf3 --- /dev/null +++ b/frontend/src/lib/components/ui/form/form-select-trigger.svelte @@ -0,0 +1,23 @@ + + + + + + diff --git a/frontend/src/lib/components/ui/form/form-select.svelte b/frontend/src/lib/components/ui/form/form-select.svelte new file mode 100644 index 00000000..ff022bbd --- /dev/null +++ b/frontend/src/lib/components/ui/form/form-select.svelte @@ -0,0 +1,20 @@ + + + { + onSelectedChange?.(v); + setValue(v ? v.value : undefined); + }} + {...$$restProps} +> + + + diff --git a/frontend/src/lib/components/ui/form/form-switch.svelte b/frontend/src/lib/components/ui/form/form-switch.svelte new file mode 100644 index 00000000..8b909dca --- /dev/null +++ b/frontend/src/lib/components/ui/form/form-switch.svelte @@ -0,0 +1,24 @@ + + + { + onCheckedChange?.(v); + setValue(v); + }} + {...$$restProps} + on:click + on:keydown +/> + diff --git a/frontend/src/lib/components/ui/form/form-textarea.svelte b/frontend/src/lib/components/ui/form/form-textarea.svelte new file mode 100644 index 00000000..149d88fd --- /dev/null +++ b/frontend/src/lib/components/ui/form/form-textarea.svelte @@ -0,0 +1,32 @@ + + +