/** Size variant of a `compsych-dropdown` (40 / 48 / 56px). Controls trigger height, padding, and font size. */ export type DropdownSize = 'sm' | 'md' | 'lg'; /** Placement of the label relative to the trigger. `'top'` stacks it above (default); `'left'` sets it beside the trigger. */ export type DropdownLabelPosition = 'top' | 'left'; /** A single selectable option in a `compsych-dropdown`. */ export interface DropdownOption { /** Value written to the bound form control / emitted by `valueChange`. */ value: string; /** Text shown for the option in the panel and, when selected, in the trigger. */ label: string; /** Prevents the option from being selected or focused. */ disabled?: boolean; /** Optional secondary text shown after the label (drops to its own line when the row wraps). */ supportingText?: string; /** Retones the option's label to `sys-error` (e.g. a destructive choice). */ error?: boolean; /** * Per-option Lucide icon name, assigned from the design system's Icon Mapping * (use → glyph). Overrides the dropdown's `optionsLeadingIcon` default for this row. */ icon?: string; /** * Raw, **trusted** SVG markup for a non-Lucide icon (e.g. a country flag from an * icon pack) rendered in place of `icon`. Takes precedence over `icon`. The string * is sanitized-bypassed and scaled to 20px wide, so only pass static/trusted SVG — * never untrusted user input. */ iconSvg?: string; } /** ARIA contract for a standalone `compsych-dropdown-menu`: an action `menu` or a select `listbox`. */ export type DropdownMenuKind = 'menu' | 'listbox'; /** A single row in a standalone `compsych-dropdown-menu`. */ export interface DropdownMenuItem { /** Stable id emitted on select and matched against the listbox selection. Falls back to `label`. */ id?: string; /** Row text. */ label: string; /** Optional secondary text shown after the label (drops to its own line when the row wraps). */ supportingText?: string; /** Prevents the row from being chosen or focused. */ disabled?: boolean; /** Retones the row's label to `sys-error` (e.g. a destructive action). */ error?: boolean; /** * Per-row Lucide icon name, assigned from the design system's Icon Mapping * (use → glyph). Overrides the menu's `leadingIcon` default for this row. */ icon?: string; }