finish custom class and improved options overhaul

This commit is contained in:
Elijah Duffy
2025-07-03 14:45:23 -07:00
parent c54002f5fa
commit 02311a0e7b
16 changed files with 170 additions and 131 deletions

View File

@@ -18,21 +18,27 @@
</script>
<script lang="ts">
import ExpandableCombobox, { type ComboboxItem } from './Combobox.svelte';
import type { ClassValue } from 'svelte/elements';
import Combobox, { type ComboboxItem } from './Combobox.svelte';
interface Props {
label?: string;
name?: string;
value?: string;
invalidMessage?: string;
required?: boolean;
class?: ClassValue | null | undefined;
}
let {
label,
name,
value = $bindable(''),
invalidMessage,
required
}: {
label?: string;
name: string;
value?: string;
invalidMessage?: string;
required?: boolean;
} = $props();
invalidMessage = 'Please select a timezone',
required,
class: classValue
}: Props = $props();
const sortedTimeZones = Intl.supportedValuesOf('timeZone')
.map((timeZone) => {
@@ -88,7 +94,7 @@
});
</script>
<ExpandableCombobox
<Combobox
{label}
{name}
{invalidMessage}
@@ -97,6 +103,7 @@
{options}
matchWidth
placeholder="Select a timezone"
class={classValue}
/>
{#snippet timezoneLabel(item: ComboboxItem)}