diff --git a/bun.lockb b/bun.lockb index 898ecdf..4301cd5 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 9729ade..d0c6c09 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "devDependencies": { "@sveltejs/kit": "^1.20.4", "autoprefixer": "^10.4.14", + "bun-types": "^1.0.11", "drizzle-kit": "^0.20.1", "postcss": "^8.4.24", "postcss-load-config": "^4.0.1", @@ -29,13 +30,16 @@ }, "type": "module", "dependencies": { - "bits-ui": "^0.9.1", + "bits-ui": "^0.9.4", "clsx": "^2.0.0", "drizzle-orm": "^0.29.0", + "formsnap": "^0.4.1", "lucide-svelte": "^0.292.0", "mode-watcher": "^0.0.7", "postgres": "^3.4.3", + "sveltekit-superforms": "^1.10.1", "tailwind-merge": "^2.0.0", - "tailwind-variants": "^0.1.18" + "tailwind-variants": "^0.1.18", + "zod": "^3.22.4" } } diff --git a/src/app.postcss b/src/app.postcss index 8a04b2b..7e575cf 100644 --- a/src/app.postcss +++ b/src/app.postcss @@ -1,78 +1,78 @@ @tailwind base; @tailwind components; @tailwind utilities; - + @layer base { - :root { - --background: 0 0% 100%; - --foreground: 240 10% 3.9%; - - --muted: 240 4.8% 95.9%; - --muted-foreground: 240 3.8% 46.1%; - - --popover: 0 0% 100%; - --popover-foreground: 240 10% 3.9%; - - --card: 0 0% 100%; - --card-foreground: 240 10% 3.9%; - - --border: 240 5.9% 90%; - --input: 240 5.9% 90%; - - --primary: 240 5.9% 10%; - --primary-foreground: 0 0% 98%; - - --secondary: 240 4.8% 95.9%; - --secondary-foreground: 240 5.9% 10%; - - --accent: 240 4.8% 95.9%; - --accent-foreground: 240 5.9% 10%; - - --destructive: 0 84.2% 60.2%; - --destructive-foreground: 0 0% 98%; - - --ring: 240 10% 3.9%; - - --radius: 0.5rem; - } - - .dark { - --background: 240 10% 3.9%; - --foreground: 0 0% 98%; - - --muted: 240 3.7% 15.9%; - --muted-foreground: 240 5% 64.9%; - - --popover: 240 10% 3.9%; - --popover-foreground: 0 0% 98%; - - --card: 240 10% 3.9%; - --card-foreground: 0 0% 98%; - - --border: 240 3.7% 15.9%; - --input: 240 3.7% 15.9%; - - --primary: 0 0% 98%; - --primary-foreground: 240 5.9% 10%; - - --secondary: 240 3.7% 15.9%; - --secondary-foreground: 0 0% 98%; - - --accent: 240 3.7% 15.9%; - --accent-foreground: 0 0% 98%; - - --destructive: 0 62.8% 30.6%; - --destructive-foreground: 0 0% 98%; - - --ring: 240 4.9% 83.9%; - } + :root { + --background: 0 0% 100%; + --foreground: 240 10% 3.9%; + + --muted: 240 4.8% 95.9%; + --muted-foreground: 240 3.8% 46.1%; + + --popover: 0 0% 100%; + --popover-foreground: 240 10% 3.9%; + + --card: 0 0% 100%; + --card-foreground: 240 10% 3.9%; + + --border: 240 5.9% 90%; + --input: 240 5.9% 90%; + + --primary: 240 5.9% 10%; + --primary-foreground: 0 0% 98%; + + --secondary: 240 4.8% 95.9%; + --secondary-foreground: 240 5.9% 10%; + + --accent: 240 4.8% 95.9%; + --accent-foreground: 240 5.9% 10%; + + --destructive: 0 84.2% 60.2%; + --destructive-foreground: 0 0% 98%; + + --ring: 240 10% 3.9%; + + --radius: 0.5rem; + } + + .dark { + --background: 240 10% 3.9%; + --foreground: 0 0% 98%; + + --muted: 240 3.7% 15.9%; + --muted-foreground: 240 5% 64.9%; + + --popover: 240 10% 3.9%; + --popover-foreground: 0 0% 98%; + + --card: 240 10% 3.9%; + --card-foreground: 0 0% 98%; + + --border: 240 3.7% 15.9%; + --input: 240 3.7% 15.9%; + + --primary: 0 0% 98%; + --primary-foreground: 240 5.9% 10%; + + --secondary: 240 3.7% 15.9%; + --secondary-foreground: 0 0% 98%; + + --accent: 240 3.7% 15.9%; + --accent-foreground: 0 0% 98%; + + --destructive: #f31260; + --destructive-foreground: 0 0% 98%; + + --ring: 240 4.9% 83.9%; + } } - + @layer base { - * { - @apply border-border; - } - body { - @apply bg-background text-foreground; - } -} \ No newline at end of file + * { + @apply border-border; + } + body { + @apply bg-background text-foreground; + } +} diff --git a/src/lib/components/ui/checkbox/checkbox.svelte b/src/lib/components/ui/checkbox/checkbox.svelte new file mode 100644 index 0000000..ac9d767 --- /dev/null +++ b/src/lib/components/ui/checkbox/checkbox.svelte @@ -0,0 +1,34 @@ + + + + + {#if isChecked} + + {:else if isIndeterminate} + + {/if} + + diff --git a/src/lib/components/ui/checkbox/index.ts b/src/lib/components/ui/checkbox/index.ts new file mode 100644 index 0000000..5fba5a4 --- /dev/null +++ b/src/lib/components/ui/checkbox/index.ts @@ -0,0 +1,6 @@ +import Root from "./checkbox.svelte"; +export { + Root, + // + Root as Checkbox +}; diff --git a/src/lib/components/ui/form/form-button.svelte b/src/lib/components/ui/form/form-button.svelte new file mode 100644 index 0000000..024f9dc --- /dev/null +++ b/src/lib/components/ui/form/form-button.svelte @@ -0,0 +1,9 @@ + + + + + diff --git a/src/lib/components/ui/form/form-checkbox.svelte b/src/lib/components/ui/form/form-checkbox.svelte new file mode 100644 index 0000000..46b9151 --- /dev/null +++ b/src/lib/components/ui/form/form-checkbox.svelte @@ -0,0 +1,26 @@ + + + { + onCheckedChange?.(v); + setValue(v); + }} + {...$$restProps} + on:click + on:keydown +/> + diff --git a/src/lib/components/ui/form/form-description.svelte b/src/lib/components/ui/form/form-description.svelte new file mode 100644 index 0000000..6efa0e5 --- /dev/null +++ b/src/lib/components/ui/form/form-description.svelte @@ -0,0 +1,16 @@ + + + + + diff --git a/src/lib/components/ui/form/form-input.svelte b/src/lib/components/ui/form/form-input.svelte new file mode 100644 index 0000000..224f44a --- /dev/null +++ b/src/lib/components/ui/form/form-input.svelte @@ -0,0 +1,28 @@ + + + diff --git a/src/lib/components/ui/form/form-item.svelte b/src/lib/components/ui/form/form-item.svelte new file mode 100644 index 0000000..0e5daa4 --- /dev/null +++ b/src/lib/components/ui/form/form-item.svelte @@ -0,0 +1,12 @@ + + +
+ +
diff --git a/src/lib/components/ui/form/form-label.svelte b/src/lib/components/ui/form/form-label.svelte new file mode 100644 index 0000000..96083e5 --- /dev/null +++ b/src/lib/components/ui/form/form-label.svelte @@ -0,0 +1,21 @@ + + + diff --git a/src/lib/components/ui/form/form-native-select.svelte b/src/lib/components/ui/form/form-native-select.svelte new file mode 100644 index 0000000..af2a1c4 --- /dev/null +++ b/src/lib/components/ui/form/form-native-select.svelte @@ -0,0 +1,24 @@ + + + + + + diff --git a/src/lib/components/ui/form/form-radio-group.svelte b/src/lib/components/ui/form/form-radio-group.svelte new file mode 100644 index 0000000..91f6b80 --- /dev/null +++ b/src/lib/components/ui/form/form-radio-group.svelte @@ -0,0 +1,22 @@ + + + { + onValueChange?.(v); + setValue(v); + }} + {...$$restProps} +> + + + diff --git a/src/lib/components/ui/form/form-select-trigger.svelte b/src/lib/components/ui/form/form-select-trigger.svelte new file mode 100644 index 0000000..5950967 --- /dev/null +++ b/src/lib/components/ui/form/form-select-trigger.svelte @@ -0,0 +1,17 @@ + + + + + + diff --git a/src/lib/components/ui/form/form-select.svelte b/src/lib/components/ui/form/form-select.svelte new file mode 100644 index 0000000..f747b6b --- /dev/null +++ b/src/lib/components/ui/form/form-select.svelte @@ -0,0 +1,20 @@ + + + { + onSelectedChange?.(v); + setValue(v ? v.value : undefined); + }} + {...$$restProps} +> + + + diff --git a/src/lib/components/ui/form/form-switch.svelte b/src/lib/components/ui/form/form-switch.svelte new file mode 100644 index 0000000..8b909dc --- /dev/null +++ b/src/lib/components/ui/form/form-switch.svelte @@ -0,0 +1,24 @@ + + + { + onCheckedChange?.(v); + setValue(v); + }} + {...$$restProps} + on:click + on:keydown +/> + diff --git a/src/lib/components/ui/form/form-textarea.svelte b/src/lib/components/ui/form/form-textarea.svelte new file mode 100644 index 0000000..149d88f --- /dev/null +++ b/src/lib/components/ui/form/form-textarea.svelte @@ -0,0 +1,32 @@ + + +