= 0 && s.highlighted < shown.length ? optionId(s.highlighted) : undefined}
placeholder="Search fonts"
value={s.query}
{disabled}
oninput={(e) => model.setQuery((e.currentTarget as HTMLInputElement).value)}
onkeydown={onKeydown}
style={field}
/>
{#if showCategories}
{/if}
{#if shown.length === 0}
- {s.loading ? 'Loading…' : 'No fonts match'}
{/if}
{#each shown as font, i (font.family)}
{@const selected = font.family.toLowerCase() === s.value.family.toLowerCase()}
{@const highlighted = i === s.highlighted}
- e.preventDefault()}
onmouseenter={() => model.setHighlight(i)}
onclick={() => model.selectFamily(font.family)}
onkeydown={() => {}}
style="display:flex;justify-content:space-between;align-items:baseline;gap:8px;padding:5px 8px;border-radius:4px;cursor:pointer;background:{selected
? 'var(--pixerate-font-picker-selected, #2f3b57)'
: highlighted
? 'var(--pixerate-font-picker-hover, #2a3040)'
: 'transparent'};"
>
{font.family}
{FONT_CATEGORY_LABELS[font.category]}
{/each}
{#if showWeight}
{/if}
{@render children?.()}
{#if showPreview}
{s.previewText}
{/if}
{status}