diff --git a/src/lib/components/ui/select/Select.svelte b/src/lib/components/ui/select/Select.svelte new file mode 100644 index 0000000..8b2ca43 --- /dev/null +++ b/src/lib/components/ui/select/Select.svelte @@ -0,0 +1,15 @@ + + + + {@render children?.()} + diff --git a/src/lib/components/ui/select/SelectContent.svelte b/src/lib/components/ui/select/SelectContent.svelte new file mode 100644 index 0000000..1fe8d76 --- /dev/null +++ b/src/lib/components/ui/select/SelectContent.svelte @@ -0,0 +1,54 @@ + + + + + up + + {#each items as { value, label, disabled } (value)} + + {label} + + {/each} + + down + + + + diff --git a/src/lib/components/ui/select/SelectTrigger.svelte b/src/lib/components/ui/select/SelectTrigger.svelte new file mode 100644 index 0000000..713b46f --- /dev/null +++ b/src/lib/components/ui/select/SelectTrigger.svelte @@ -0,0 +1,17 @@ + + + + {@render children?.()} + diff --git a/src/lib/components/ui/select/index.ts b/src/lib/components/ui/select/index.ts new file mode 100644 index 0000000..96bfb56 --- /dev/null +++ b/src/lib/components/ui/select/index.ts @@ -0,0 +1,3 @@ +export { default as Select } from './Select.svelte'; +export { default as SelectTrigger } from './SelectTrigger.svelte'; +export { default as SelectContent } from './SelectContent.svelte'; diff --git a/src/routes/layout.css b/src/routes/layout.css index 421361e..80ce3db 100644 --- a/src/routes/layout.css +++ b/src/routes/layout.css @@ -1,4 +1,5 @@ @import "tailwindcss"; +@import "../styles/select-motion.css"; @plugin "@tailwindcss/forms"; @plugin "daisyui" { logs: false; diff --git a/src/styles/select-motion.css b/src/styles/select-motion.css new file mode 100644 index 0000000..dd39b22 --- /dev/null +++ b/src/styles/select-motion.css @@ -0,0 +1,13 @@ +@layer components { + .select-motion { + @apply transition-all duration-200 ease-out will-change-transform; + } + + .select-motion[data-state="open"] { + @apply pointer-events-auto translate-y-0 scale-100 opacity-100; + } + + .select-motion[data-state="closed"] { + @apply pointer-events-none -translate-y-2 scale-95 opacity-0; + } +}