import{type PropertyValues,type TemplateResult}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import{type GemstoneKey}from'../../../theme/gemstones.js';import type{LyraSize}from'../../../internal/variants.js';export interface SwatchPickerItem{ /** The option's value -- reported in `lr-change` and matched against `value`. */ readonly value:string; /** The swatch's fill color. Invalid CSS colors and `url()` paint servers are ignored. */ readonly color:string; /** The swatch's nonblank accessible name; also used as its native `title` tooltip. Rows with * an empty or whitespace-only label are omitted. */ readonly label:string; /** Optional decorative custom shape rendered in place of the plain filled circle -- e.g. a gem * or other brand-specific glyph. Its rendered subtree is inert and aria-hidden. A * `currentColor`-based SVG (fill or stroke) picks up `color` automatically via the swatch's * `color` CSS property, matching ``'s `LyraSegmentedItem.icon` field. */ readonly icon?:unknown; /** Canonical gemstone to render automatically in `mode="gemstone"`. An explicit `icon` still * wins, so a consumer can customize one option without leaving gemstone mode. */ readonly gemstone?:GemstoneKey;}export type LyraSwatchPickerMode='swatch'|'gemstone';export interface LyraSwatchPickerEventMap{'lr-change':CustomEvent<{value:string;}>;'lr-activate':CustomEvent<{value:string;}>;} /** * `` -- a single-select picker over a small, fixed set of color swatches with * the WAI-ARIA APG `radiogroup` contract built in: `role="radiogroup"`/`role="radio"`, roving * tabindex, automatic activation (click or arrow-key move both select immediately, like a native * radio group), cyclic Arrow/Home/End navigation. Distinct from ``'s freeform * native color input -- this picks exactly one of N designer-chosen named colors, the shape apps * otherwise hand-roll as a row of round accent-color buttons. * * `mode="gemstone"` uses the shared faceted gemstone glyph for items carrying a `gemstone` * key and opts into the gemstone glow/shine defaults. The checked swatch's automatic glyph is * themed by the exact same `gemstoneSelectedGlyphStyles` stylesheet exported from * `theme/gemstones.js`, included here in `static styles` and applied through the same * `data-lr-gemstone-selected` attribute documented on that export -- so a glyph rendered anywhere * else on the page (for example a header trigger showing the current selection) can reach the * identical halo/shine by consuming that export directly, and the two can never drift apart. An * explicit `icon` override on a `mode="gemstone"` item is a consumer-authored shape, not that * shared glyph, so it keeps this picker's own generic selected-icon shine instead (see * `--lr-swatch-picker-gemstone-selected-blur`/`-shine-duration` below). The `items` array controls * display order and `value` still controls the initial selection. Live option reorders preserve * focus by option identity; removing the focused option moves focus to the nearest surviving * swatch without changing the controlled `value` or emitting `lr-change`. * * `disabled` locks the whole picker: every swatch renders as a real `disabled` `