{# Search-select fragment — debounced search with dropdown results, Alpine state #} {# Contract: ~/.claude/skills/ux-architect/components/widget-search-select.md (UX-028) #} {# ARIA combobox pattern (ARIA 1.2 — input with popup listbox variant). #} {# Resolve initial value for edit mode: ref objects have display names #} {% set init_id = "" %} {% set init_display = "" %} {% if value is mapping %} {% set init_id = value.get("id", "") %} {% set init_display = value.get("name") or value.get("title") or value.get("label") or value.get("email") or value.get("id", "") %} {% elif value %} {% set init_id = value %} {% set init_display = value %} {% endif %}
{# Hidden input — form submission carrier #} {# Visible search input with HTMX debounced search — ARIA combobox role #} {# Loading indicator — HTMX toggles htmx-indicator visibility automatically #} {# Dropdown results container — HTMX swap target #}
{# Empty state shown before any search #}
Type at least {{ field.source.min_chars }} characters to search...