diff --git a/web/routes/uix/components/search-field/+page.svelte b/web/routes/uix/components/search-field/+page.svelte index 7cae0d23f..41b223a96 100644 --- a/web/routes/uix/components/search-field/+page.svelte +++ b/web/routes/uix/components/search-field/+page.svelte @@ -38,6 +38,53 @@ const partsList = $derived([...compiled.parts.byKebab.values()]); const events = $derived([...compiled.actions.byName.values()]); const isEmpty = $derived(value.length === 0); + + // Demo dataset for the live search panel. + const components: { name: string; group: string }[] = [ + { name: 'Accordion', group: 'Disclosure' }, + { name: 'Avatar', group: 'Media' }, + { name: 'Breadcrumb', group: 'Navigation' }, + { name: 'Button', group: 'Action' }, + { name: 'Calendar', group: 'Forms' }, + { name: 'Checkbox', group: 'Forms' }, + { name: 'Collapsible', group: 'Disclosure' }, + { name: 'Color picker', group: 'Forms' }, + { name: 'Combobox', group: 'Forms' }, + { name: 'Date picker', group: 'Forms' }, + { name: 'Dialog', group: 'Overlay' }, + { name: 'Drawer', group: 'Overlay' }, + { name: 'Editable', group: 'Forms' }, + { name: 'Field', group: 'Forms' }, + { name: 'File upload', group: 'Forms' }, + { name: 'Icon', group: 'Media' }, + { name: 'Meter', group: 'Status' }, + { name: 'Number field', group: 'Forms' }, + { name: 'Pagination', group: 'Navigation' }, + { name: 'Popover', group: 'Overlay' }, + { name: 'Progress', group: 'Status' }, + { name: 'Radio group', group: 'Forms' }, + { name: 'Rating group', group: 'Forms' }, + { name: 'Search field', group: 'Forms' }, + { name: 'Select', group: 'Forms' }, + { name: 'Slider', group: 'Forms' }, + { name: 'Switch', group: 'Forms' }, + { name: 'Tabs', group: 'Disclosure' }, + { name: 'Tag group', group: 'Forms' }, + { name: 'Time picker', group: 'Forms' }, + { name: 'Toast', group: 'Overlay' }, + { name: 'Toggle', group: 'Action' }, + { name: 'Toolbar', group: 'Action' }, + { name: 'Tooltip', group: 'Overlay' } + ]; + + // Filter matches name OR group, case-insensitive. + const results = $derived.by(() => { + const q = value.trim().toLowerCase(); + if (!q) return components; + return components.filter( + (c) => c.name.toLowerCase().includes(q) || c.group.toLowerCase().includes(q) + ); + }); const variants: SearchFieldVariant[] = ['surface', 'outline', 'ghost']; const colors: SearchFieldColor[] = [ 'primary', @@ -170,6 +217,31 @@ + + + +
+ results + {results.length} / {components.length} +
@@ -561,3 +633,51 @@ {/if}
+ +