rename ComboboxItem -> ComboboxOption

This commit is contained in:
Elijah Duffy
2025-07-04 02:32:06 -07:00
parent 12a79f0680
commit cc27f0599c
4 changed files with 31 additions and 25 deletions

View File

@@ -20,7 +20,7 @@
<script lang="ts">
import type { ClassValue } from 'svelte/elements';
import Combobox, { type ComboboxItem } from './Combobox.svelte';
import Combobox, { type ComboboxOption } from './Combobox.svelte';
interface Props {
label?: string;
@@ -64,7 +64,7 @@
return a.timeZone.localeCompare(b.timeZone);
});
const options: ComboboxItem[] = sortedTimeZones.map((timeZone) => {
const options: ComboboxOption[] = sortedTimeZones.map((timeZone) => {
const infotext = [...new Set([timeZone.short, timeZone.offset])]
.filter((item) => item !== undefined)
.join(' · ');
@@ -82,10 +82,10 @@
acc[option.value] = option;
return acc;
},
{} as Record<string, ComboboxItem>
{} as Record<string, ComboboxOption>
);
let timezone = $state<ComboboxItem | undefined>(
let timezone = $state<ComboboxOption | undefined>(
optionsMap[Intl.DateTimeFormat().resolvedOptions().timeZone]
);
@@ -106,6 +106,6 @@
class={classValue}
/>
{#snippet timezoneLabel(item: ComboboxItem)}
{#snippet timezoneLabel(item: ComboboxOption)}
{@html wbr(item.label ?? 'Missing label')}
{/snippet}