diff --git a/client/src/lib/ui/DateRangePicker.svelte b/client/src/lib/ui/DateRangePicker.svelte index 05b6a57..ff7f6a0 100644 --- a/client/src/lib/ui/DateRangePicker.svelte +++ b/client/src/lib/ui/DateRangePicker.svelte @@ -42,7 +42,7 @@
-
+
{#each ['start', 'end'] as const as type} {#snippet children({ segments })} @@ -72,7 +72,7 @@ {/each}
diff --git a/client/src/lib/ui/Select.svelte b/client/src/lib/ui/Select.svelte index ed3121f..3dbfd8a 100644 --- a/client/src/lib/ui/Select.svelte +++ b/client/src/lib/ui/Select.svelte @@ -2,19 +2,20 @@ import { cn } from '$lib/utils'; import { Check, ChevronsDown, ChevronsUp, ChevronsUpDown, X } from '@lucide/svelte'; import { Select } from 'bits-ui'; + import { fade } from 'svelte/transition'; let { value = $bindable('10'), placeholder = 'Select an item', items = [], - defaultValue = '', + defaultValue = '', className, onchange }: { value?: string; placeholder?: string; items: { value: string; label: string; disabled?: boolean }[]; - defaultValue?: string; + defaultValue?: string; className?: string; onchange?: (e: string) => void; } = $props(); @@ -30,42 +31,53 @@ > {selectedLabel} - - - - - - {#each items as item, i (i + item.value)} - - {#snippet children({ selected })} - {item.label} - {#if selected} -
- -
- {/if} - {/snippet} -
- {/each} -
- - - + + {#snippet child({ wrapperProps, props, open })} + {#if open} +
+
+ + + + + {#each items as item, i (i + item.value)} + + {#snippet children({ selected })} + {item.label} + {#if selected} +
+ +
+ {/if} + {/snippet} +
+ {/each} +
+ + + +
+
+ {/if} + {/snippet}
@@ -74,7 +86,7 @@ type="button" onclick={() => { value = defaultValue; - onchange?.(value); + onchange?.(value); }} >