@f-ewald/components 1.37.4 → 1.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -1
- package/custom-elements.json +36 -3
- package/dist/calendar-day.js +1 -1
- package/dist/calendar-day.js.map +1 -1
- package/dist/calendar-month.d.ts.map +1 -1
- package/dist/calendar-month.js +33 -12
- package/dist/calendar-month.js.map +1 -1
- package/dist/distribution-chart.js +1 -1
- package/dist/distribution-chart.js.map +1 -1
- package/dist/dropdown-button.js +1 -1
- package/dist/dropdown-button.js.map +1 -1
- package/dist/form-select.js +1 -1
- package/dist/form-select.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/kanban-board.js +1 -1
- package/dist/kanban-board.js.map +1 -1
- package/dist/kanban-column.js +1 -1
- package/dist/kanban-column.js.map +1 -1
- package/dist/link-card.js +1 -1
- package/dist/link-card.js.map +1 -1
- package/dist/loading-dots.js +1 -1
- package/dist/loading-dots.js.map +1 -1
- package/dist/multi-select.js +1 -1
- package/dist/multi-select.js.map +1 -1
- package/dist/photo-gallery.js +3 -3
- package/dist/photo-gallery.js.map +1 -1
- package/dist/radio-pills.js +1 -1
- package/dist/radio-pills.js.map +1 -1
- package/dist/range-slider.js +5 -5
- package/dist/range-slider.js.map +1 -1
- package/dist/scroll-dots.js +1 -1
- package/dist/scroll-dots.js.map +1 -1
- package/dist/slide-panel.js +1 -1
- package/dist/slide-panel.js.map +1 -1
- package/dist/stat-meter.js +1 -1
- package/dist/stat-meter.js.map +1 -1
- package/dist/status-pill.js +1 -1
- package/dist/status-pill.js.map +1 -1
- package/dist/timeline-entry.js +2 -2
- package/dist/timeline-entry.js.map +1 -1
- package/dist/tokens.css +17 -1
- package/dist/tokens.d.ts +27 -0
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +54 -0
- package/dist/tokens.js.map +1 -1
- package/dist/ui-button.js +2 -2
- package/dist/ui-button.js.map +1 -1
- package/dist/user-avatar.js +2 -2
- package/dist/user-avatar.js.map +1 -1
- package/dist/utils/transport-controls.js +5 -5
- package/dist/utils/transport-controls.js.map +1 -1
- package/docs/calendar-day.md +1 -0
- package/docs/design-language.md +21 -4
- package/docs/distribution-chart.md +1 -0
- package/docs/dropdown-button.md +1 -0
- package/docs/form-select.md +1 -0
- package/docs/kanban-board.md +1 -0
- package/docs/kanban-column.md +1 -0
- package/docs/link-card.md +1 -0
- package/docs/loading-dots.md +1 -0
- package/docs/multi-select.md +1 -0
- package/docs/photo-gallery.md +1 -0
- package/docs/radio-pills.md +1 -0
- package/docs/range-slider.md +2 -0
- package/docs/scroll-dots.md +1 -0
- package/docs/slide-panel.md +1 -0
- package/docs/stat-meter.md +1 -0
- package/docs/status-pill.md +1 -0
- package/docs/timeline-entry.md +1 -0
- package/docs/ui-button.md +1 -0
- package/docs/user-avatar.md +1 -0
- package/llms.txt +25 -20
- package/package.json +1 -1
package/dist/multi-select.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multi-select.js","sourceRoot":"","sources":["../src/multi-select.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,UAAU,EACV,GAAG,EACH,IAAI,EACJ,OAAO,GAGR,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,IAAI,aAAa,GAAG,CAAC,CAAC;AAsBtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEI,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QAkZL,2CAA2C;QACX,YAAO,GAAwB,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B,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CAkrCvB","sourcesContent":["import {\n LitElement,\n css,\n html,\n nothing,\n type PropertyValues,\n type TemplateResult,\n} from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport { iconCheckCircle, iconChevronRight, iconX } from \"./icons.js\";\nimport { tokens } from \"./tokens.js\";\n\nlet instanceCount = 0;\n\n/**\n * Presentation variant of {@link MultiSelect}.\n *\n * - `\"dropdown\"` (default): a compact trigger that opens a listbox popover.\n * - `\"list\"`: a persistently visible, bordered list surface with no popover.\n */\nexport type MultiSelectVariant = \"dropdown\" | \"list\";\n\n/** A single selectable option. */\nexport interface MultiSelectOption {\n value: string;\n label: string;\n /** Optional pre-rendered icon template displayed before the label. */\n icon?: TemplateResult;\n /** Square icon size in pixels. Defaults to 16 when `icon` is set. */\n iconSize?: number;\n /** When true, the option can neither be selected nor removed via the UI. */\n disabled?: boolean;\n}\n\n/**\n * A form-associated multi-select: a trigger showing a compact summary of the\n * current selection, opening a multi-selectable listbox popover, with an\n * optional removable-chip list of the chosen values. A drop-in generic\n * replacement for a native `<select multiple>` — set `name` on the element\n * itself and each\n * selected value is submitted as a repeated `name=value` entry, matching native\n * multiple-select semantics; `new FormData(form).getAll(name)` and\n * `form.reset()` work unchanged.\n *\n * The trigger visually follows `form-select`: a `2rem` field showing the\n * `placeholder` when empty, the single selected label when one value is chosen,\n * and `N selected` when several are. Set `show-chips` to additionally render\n * the selected values as compact chips below the trigger, each with an\n * accessible `32px` remove control; chips are off by default and the region\n * reserves no space while nothing is selected. Like `form-select`, the host is\n * `display: block` and fills its container by default; constrain the host\n * (`multi-select { display: inline-block; }`) to shrink it to its content\n * instead.\n *\n * Set `searchable` to replace the button trigger with an editable combobox that\n * infix-filters the predefined options by case-insensitive label. Typed text is\n * only a query: `values` changes exclusively when options are toggled, and an\n * uncommitted query is discarded when the list closes.\n *\n * The `variant` chooses between two presentations, and `searchable` applies to\n * both:\n *\n * - `\"dropdown\"` (default) is the popover form described above: a compact\n * trigger (button, or search combobox when `searchable`) that opens a\n * multi-selectable listbox on demand, closes on outside click / Escape, and\n * shows a chevron.\n * - `\"list\"` renders the options as a persistently visible, bordered surface\n * with no popover, no chevron, and no `open` host state; it never registers\n * outside-click listeners. Its scroll viewport is sized to roughly\n * `visibleRows` `2rem` rows (see `visible-rows`). When not `searchable` the\n * `listbox` itself is focusable and drives Arrow/Home/End/Enter/Space keyboard\n * navigation via `aria-activedescendant`; when `searchable` a `2rem` search\n * field sits above the list and owns navigation, and Escape only clears the\n * query instead of hiding the list.\n *\n * @element multi-select\n * @fires change - Fired with `{ values: string[] }` (a copied array) when a\n * value is added or removed through the UI. Programmatic `values` assignments\n * do not fire it.\n */\n@customElement(\"multi-select\")\nexport class MultiSelect extends LitElement {\n static formAssociated = true;\n\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n position: relative;\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n font-size: var(--ui-font-size, 0.875rem);\n }\n .control {\n position: relative;\n }\n button.trigger {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 0.25rem;\n width: 100%;\n height: 2rem;\n box-sizing: border-box;\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n font-size: var(--ui-font-size, 0.875rem);\n font-weight: var(--ui-font-weight-medium, 500);\n line-height: var(--ui-line-height-tight, 1.25);\n color: var(--ui-text, #0f172a);\n background: var(--ui-surface, #ffffff);\n border: 1px solid var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius-sm, 0.25rem);\n padding: 0.5rem 0.75rem;\n cursor: pointer;\n }\n button.trigger:hover:not(:disabled) {\n background: var(--ui-surface-muted, #f8fafc);\n }\n button.trigger:disabled {\n cursor: not-allowed;\n opacity: 0.6;\n }\n button.trigger:focus-visible {\n outline: none;\n border-color: var(--ui-primary, #4f46e5);\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n .trigger-label {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .trigger-label.placeholder {\n color: var(--ui-text-muted, #64748b);\n }\n .search-trigger {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 0.25rem;\n width: 100%;\n height: 2rem;\n box-sizing: border-box;\n color: var(--ui-text, #0f172a);\n background: var(--ui-surface, #ffffff);\n border: 1px solid var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius-sm, 0.25rem);\n cursor: text;\n }\n .search-trigger:hover:not(.disabled) {\n background: var(--ui-surface-muted, #f8fafc);\n }\n .search-trigger:not(.disabled):focus-within {\n border-color: var(--ui-primary, #4f46e5);\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n .search-trigger.disabled {\n cursor: not-allowed;\n opacity: 0.6;\n }\n input.search-input {\n min-width: 0;\n flex: 1;\n box-sizing: border-box;\n padding: 0.5rem 0 0.5rem 0.75rem;\n color: inherit;\n background: transparent;\n border: 0;\n outline: 0;\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n font-size: var(--ui-font-size, 0.875rem);\n font-weight: var(--ui-font-weight-medium, 500);\n line-height: var(--ui-line-height-tight, 1.25);\n }\n input.search-input::placeholder {\n color: var(--ui-text-muted, #64748b);\n font-weight: var(--ui-font-weight-medium, 500);\n opacity: 1;\n }\n .chevron {\n display: flex;\n flex: 0 0 auto;\n margin-right: 0.75rem;\n color: var(--ui-text-muted, #64748b);\n pointer-events: none;\n transform: rotate(90deg);\n transition: transform 150ms ease;\n }\n button.trigger .chevron {\n margin-right: 0;\n }\n :host([open]) .chevron {\n transform: rotate(-90deg);\n }\n ul.options {\n position: absolute;\n top: 100%;\n left: 0;\n z-index: 10;\n min-width: 100%;\n max-height: 40vh;\n overflow-y: auto;\n scrollbar-gutter: stable;\n margin: 0.25rem 0 0;\n padding: 0.25rem 0;\n list-style: none;\n white-space: nowrap;\n color: var(--ui-text, #0f172a);\n background: var(--ui-surface, #ffffff);\n border: 1px solid var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius-sm, 0.25rem);\n box-shadow: var(--ui-shadow, 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1));\n }\n ul.options::-webkit-scrollbar {\n width: 0.75rem;\n }\n ul.options::-webkit-scrollbar-thumb {\n background: var(--ui-border, #e2e8f0);\n border: 0.25rem solid transparent;\n border-radius: 999px;\n background-clip: padding-box;\n }\n .list-control {\n display: flex;\n flex-direction: column;\n }\n .search-field {\n display: flex;\n align-items: center;\n width: 100%;\n height: 2rem;\n box-sizing: border-box;\n margin-bottom: 0.25rem;\n color: var(--ui-text, #0f172a);\n background: var(--ui-surface, #ffffff);\n border: 1px solid var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius-sm, 0.25rem);\n cursor: text;\n }\n .search-field:not(.disabled):focus-within {\n border-color: var(--ui-primary, #4f46e5);\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n .search-field.disabled {\n cursor: not-allowed;\n opacity: 0.6;\n }\n input.list-search {\n padding-right: 0.75rem;\n }\n ul.options.persistent {\n position: static;\n z-index: auto;\n min-width: 0;\n max-height: none;\n margin: 0;\n box-sizing: border-box;\n border-radius: var(--ui-radius, 0.5rem);\n box-shadow: none;\n }\n ul.options.persistent.disabled {\n cursor: not-allowed;\n opacity: 0.6;\n pointer-events: none;\n }\n ul.options.persistent:focus-visible {\n outline: none;\n border-color: var(--ui-primary, #4f46e5);\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n li {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 0.5rem 0.75rem;\n cursor: pointer;\n }\n li.active,\n li:hover:not([aria-disabled=\"true\"]) {\n background: var(--ui-surface-muted, #f8fafc);\n }\n li[aria-selected=\"true\"] {\n font-weight: var(--ui-font-weight-semibold, 600);\n color: var(--ui-primary, #4f46e5);\n }\n li[aria-disabled=\"true\"] {\n cursor: not-allowed;\n color: var(--ui-text-muted, #64748b);\n opacity: 0.6;\n }\n .check {\n display: inline-flex;\n flex: 0 0 auto;\n width: 14px;\n height: 14px;\n align-items: center;\n justify-content: center;\n color: var(--ui-primary, #4f46e5);\n }\n .check.hidden {\n visibility: hidden;\n }\n .check > svg {\n width: 100%;\n height: 100%;\n }\n .option-content {\n display: inline-flex;\n min-width: 0;\n flex: 1;\n align-items: center;\n gap: 0.5rem;\n }\n .option-icon {\n display: inline-flex;\n width: var(--multi-select-icon-size);\n height: var(--multi-select-icon-size);\n flex: 0 0 var(--multi-select-icon-size);\n align-items: center;\n justify-content: center;\n }\n .option-icon > svg {\n width: 100%;\n height: 100%;\n }\n .option-label {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n li.no-options {\n display: block;\n padding: 0.5rem 0.75rem;\n color: var(--ui-text-muted, #64748b);\n cursor: default;\n font-style: italic;\n }\n .chips {\n display: flex;\n flex-wrap: wrap;\n gap: 0.25rem;\n margin-top: 0.25rem;\n /* Pin the chips row to the control's resolved width (0 width +\n min-width 100%) so a long selected label ellipsizes instead of\n contributing its content width and widening the control. */\n width: 0;\n min-width: 100%;\n box-sizing: border-box;\n }\n .chip {\n display: inline-flex;\n align-items: center;\n gap: 0.25rem;\n max-width: 100%;\n box-sizing: border-box;\n padding-left: 0.5rem;\n color: var(--ui-text, #0f172a);\n background: var(--ui-surface-muted, #f8fafc);\n border: 1px solid var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius-sm, 0.25rem);\n }\n .chip-label {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: var(--ui-font-size-sm, 0.75rem);\n font-weight: var(--ui-font-weight-medium, 500);\n line-height: var(--ui-line-height-tight, 1.25);\n }\n .chip-remove {\n display: inline-flex;\n flex: 0 0 auto;\n width: 2rem;\n height: 2rem;\n align-items: center;\n justify-content: center;\n padding: 0;\n color: var(--ui-text-muted, #64748b);\n background: transparent;\n border: 0;\n border-radius: var(--ui-radius-sm, 0.25rem);\n cursor: pointer;\n }\n .chip-remove:hover:not(:disabled) {\n color: var(--ui-danger, #dc2626);\n }\n .chip-remove:disabled {\n cursor: not-allowed;\n opacity: 0.6;\n }\n .chip-remove:focus-visible {\n outline: none;\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n .chip-remove > svg {\n width: 18px;\n height: 18px;\n }\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n }\n @media (prefers-reduced-motion: reduce) {\n .chevron {\n transition: none;\n }\n }\n @media (forced-colors: active) {\n button.trigger:focus-visible,\n .search-trigger:not(.disabled):focus-within,\n .search-field:not(.disabled):focus-within,\n ul.options.persistent:focus-visible,\n .chip-remove:focus-visible {\n outline: 2px solid CanvasText;\n outline-offset: 2px;\n box-shadow: none;\n }\n button.trigger:disabled,\n .search-trigger.disabled,\n .search-field.disabled,\n ul.options.persistent.disabled,\n .chip-remove:disabled,\n li[aria-disabled=\"true\"] {\n color: GrayText;\n opacity: 1;\n }\n li.active,\n li:hover:not([aria-disabled=\"true\"]) {\n color: HighlightText;\n background: Highlight;\n }\n li[aria-selected=\"true\"] {\n color: Highlight;\n }\n li.active[aria-selected=\"true\"],\n li[aria-selected=\"true\"]:hover {\n color: HighlightText;\n }\n .chip {\n border-color: CanvasText;\n }\n }\n `,\n ];\n\n /** The full list of selectable options. */\n @property({ attribute: false }) options: MultiSelectOption[] = [];\n /**\n * The currently selected values. Programmatic assignments are deduplicated\n * while preserving order and never fire `change`.\n */\n @property({ attribute: false }) values: string[] = [];\n /** Form control name; each selected value submits under it. */\n @property() name = \"\";\n /** Accessible label applied to the trigger. */\n @property() label = \"\";\n /** Text shown on the trigger when nothing is selected. */\n @property() placeholder = \"Select options\";\n /** Disables the whole control, preventing the popover from opening. */\n @property({ type: Boolean }) disabled = false;\n /** Marks the control as required for native form validation. */\n @property({ type: Boolean }) required = false;\n /**\n * Enables editable, case-insensitive infix filtering by option label.\n * Typed text never becomes a selected value.\n */\n @property({ type: Boolean, reflect: true }) searchable = false;\n /** Maximum number of selectable values; `0` (default) means unlimited. */\n @property({ type: Number }) max = 0;\n /**\n * Presentation variant. `\"dropdown\"` (default) opens a popover listbox;\n * `\"list\"` renders a persistently visible, bordered list surface. Reflected\n * so consumers can style by `[variant=\"list\"]`.\n */\n @property({ reflect: true }) variant: MultiSelectVariant = \"dropdown\";\n /**\n * Number of `2rem` rows the `list` variant's scroll viewport shows before it\n * scrolls, mirroring a native `<select size>`. Normalized to an integer of at\n * least `1` (default `5`); ignored by the `dropdown` variant.\n */\n @property({ type: Number, attribute: \"visible-rows\" }) visibleRows = 5;\n /**\n * When true, the selected values are also rendered as removable chips below\n * the trigger, each with an accessible `32px` remove control. Off by default:\n * the trigger already summarizes the selection, and values can be toggled off\n * in the listbox. Applies to both variants.\n */\n @property({ type: Boolean, attribute: \"show-chips\" }) showChips = false;\n\n @state() private _open = false;\n @state() private _activeIndex = -1;\n @state() private _query: string | null = null;\n @state() private _formDisabled = false;\n\n #internals = this.attachInternals();\n #defaultValues: string[] | null = null;\n #listboxPointerDown = false;\n #suppressNextBlur = false;\n #restoringSearchFocus = false;\n #searchSelection: [number | null, number | null] | null = null;\n #isComposing = false;\n #compositionJustEnded = false;\n #compositionEndTimer: ReturnType<typeof setTimeout> | null = null;\n #blurTimer: ReturnType<typeof setTimeout> | null = null;\n readonly #listboxId = `multi-select-listbox-${++instanceCount}`;\n\n /** Whether the host or an ancestor fieldset currently disables the control. */\n get #isDisabled(): boolean {\n return this.disabled || this._formDisabled;\n }\n\n /** `visibleRows` normalized to a whole number of rows, at least `1`. */\n get #rows(): number {\n const raw = this.visibleRows;\n if (!Number.isFinite(raw)) return 5;\n const floored = Math.floor(raw);\n return floored < 1 ? 1 : floored;\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n window.removeEventListener(\"mousedown\", this.#onWindowMousedown, true);\n if (this.#blurTimer) clearTimeout(this.#blurTimer);\n if (this.#compositionEndTimer) clearTimeout(this.#compositionEndTimer);\n this.#blurTimer = null;\n this.#compositionEndTimer = null;\n this.#listboxPointerDown = false;\n this.#suppressNextBlur = false;\n this.#searchSelection = null;\n this.#isComposing = false;\n this.#compositionJustEnded = false;\n this.#close();\n }\n\n protected override willUpdate(changed: PropertyValues): void {\n if (!this.hasUpdated && this.#defaultValues === null) {\n this.#defaultValues = this.#dedupe(this.values);\n }\n if (changed.has(\"values\")) {\n const deduped = this.#dedupe(this.values);\n if (\n deduped.length !== this.values.length ||\n deduped.some((value, index) => value !== this.values[index])\n ) {\n this.values = deduped;\n }\n }\n if (\n (changed.has(\"disabled\") || changed.has(\"searchable\") || changed.has(\"variant\")) &&\n (this.#isDisabled || changed.has(\"searchable\") || changed.has(\"variant\"))\n ) {\n this.#close();\n }\n }\n\n protected override updated(changed: PropertyValues): void {\n if (changed.has(\"_open\")) {\n this.toggleAttribute(\"open\", this._open);\n if (this._open) {\n window.addEventListener(\"mousedown\", this.#onWindowMousedown, true);\n } else {\n window.removeEventListener(\"mousedown\", this.#onWindowMousedown, true);\n }\n }\n if (changed.has(\"values\") || changed.has(\"name\")) this.#syncFormValue();\n if (\n changed.has(\"values\") ||\n changed.has(\"required\") ||\n changed.has(\"disabled\") ||\n changed.has(\"_formDisabled\")\n ) {\n this.#syncValidity();\n }\n if (\n (changed.has(\"_activeIndex\") || changed.has(\"_query\") || changed.has(\"options\")) &&\n (this._open || this.variant === \"list\") &&\n this._activeIndex >= 0\n ) {\n this.renderRoot\n .querySelector<HTMLElement>(`#${this.#listboxId}-option-${this._activeIndex}`)\n ?.scrollIntoView({ block: \"nearest\", inline: \"nearest\" });\n }\n }\n\n /** Restores the selection captured at first render, per the form contract. */\n formResetCallback(): void {\n this.values = this.#defaultValues ? [...this.#defaultValues] : [];\n this.#close();\n }\n\n /** Mirrors an ancestor fieldset's disabled state and closes the popover. */\n formDisabledCallback(disabled: boolean): void {\n this._formDisabled = disabled;\n if (disabled) this.#close();\n }\n\n /** Restores the selection from the saved form state on navigation/autofill. */\n formStateRestoreCallback(state: string | File | FormData | null): void {\n if (typeof state !== \"string\") return;\n try {\n const parsed: unknown = JSON.parse(state);\n if (Array.isArray(parsed)) {\n this.values = parsed.filter((item): item is string => typeof item === \"string\");\n }\n } catch {\n /* ignore malformed restore state */\n }\n }\n\n #syncFormValue(): void {\n const values = this.values;\n if (!this.name || values.length === 0) {\n this.#internals.setFormValue(null);\n return;\n }\n const data = new FormData();\n for (const value of values) data.append(this.name, value);\n this.#internals.setFormValue(data, JSON.stringify(values));\n }\n\n #syncValidity(): void {\n const anchor = this.#anchorElement();\n if (this.#isDisabled) {\n this.#internals.setValidity({});\n return;\n }\n if (this.required && this.values.length === 0) {\n this.#internals.setValidity(\n { valueMissing: true },\n \"Please select at least one option.\",\n anchor ?? undefined,\n );\n } else {\n this.#internals.setValidity({});\n }\n }\n\n #anchorElement(): HTMLElement | null {\n return this.renderRoot.querySelector<HTMLElement>(\n \"button.trigger, input.search-input, ul.persistent\",\n );\n }\n\n #dedupe(values: readonly string[]): string[] {\n const seen = new Set<string>();\n const result: string[] = [];\n for (const value of values) {\n if (seen.has(value)) continue;\n seen.add(value);\n result.push(value);\n }\n return result;\n }\n\n /** First option matching `value`, so duplicate values resolve deterministically. */\n #optionByValue(value: string): MultiSelectOption | undefined {\n return this.options.find((option) => option.value === value);\n }\n\n #labelFor(value: string): string {\n return this.#optionByValue(value)?.label ?? value;\n }\n\n #summaryText(): string {\n if (this.values.length === 0) return this.placeholder;\n if (this.values.length === 1) return this.#labelFor(this.values[0]);\n return `${this.values.length} selected`;\n }\n\n #liveText(): string {\n if (this.values.length === 0) return \"No options selected\";\n if (this.values.length === 1) return `${this.#labelFor(this.values[0])} selected`;\n return `${this.values.length} options selected`;\n }\n\n #visibleOptions(): MultiSelectOption[] {\n if (!this.searchable || this._query === null) return this.options;\n const needle = this._query.trim().toLocaleLowerCase();\n if (!needle) return this.options;\n return this.options.filter((option) =>\n option.label.toLocaleLowerCase().includes(needle),\n );\n }\n\n /** Whether `value` is currently at the selection cap and cannot be added. */\n #atCap(value: string): boolean {\n return (\n this.max > 0 && this.values.length >= this.max && !this.values.includes(value)\n );\n }\n\n #isOptionDisabled(option: MultiSelectOption): boolean {\n return Boolean(option.disabled) || this.#atCap(option.value) || this.#isDisabled;\n }\n\n #toggleOption(option: MultiSelectOption): void {\n if (this.#isDisabled || option.disabled) return;\n if (this.values.includes(option.value)) {\n this.#commit(this.values.filter((value) => value !== option.value));\n return;\n }\n if (this.#atCap(option.value)) return;\n this.#commit([...this.values, option.value]);\n }\n\n #removeValue(value: string): void {\n if (this.#isDisabled) return;\n if (!this.values.includes(value)) return;\n this.#commit(this.values.filter((existing) => existing !== value));\n }\n\n #commit(next: string[]): void {\n this.values = this.#dedupe(next);\n this.dispatchEvent(\n new CustomEvent(\"change\", {\n detail: { values: [...this.values] },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n #onWindowMousedown = (e: MouseEvent): void => {\n if (!e.composedPath().includes(this)) this.#close();\n };\n\n #onFocusOut = (e: FocusEvent): void => {\n if (this.#listboxPointerDown || this.#suppressNextBlur) return;\n const next = e.relatedTarget;\n // Focus leaving to body/null (e.g. a pointer press on a non-focusable\n // element inside the component) is handled by the outside-mousedown\n // listener; only a genuine Tab-out to another element closes here.\n if (!(next instanceof Node)) return;\n if (this === next || this.renderRoot.contains(next)) return;\n this.#close();\n };\n\n #toggle(): void {\n if (this.#isDisabled) return;\n if (this._open) this.#close();\n else this.#open();\n }\n\n #open(): void {\n if (this.#isDisabled) return;\n this._query = null;\n this._open = true;\n this._activeIndex = this.#initialActiveIndex();\n }\n\n #close(): void {\n this._open = false;\n this._query = null;\n this._activeIndex = -1;\n this.#searchSelection = null;\n }\n\n #initialActiveIndex(): number {\n const options = this.#visibleOptions();\n if (options.length === 0) return -1;\n if (this._query !== null) return 0;\n const selectedIndex = options.findIndex((option) =>\n this.values.includes(option.value),\n );\n return selectedIndex >= 0 ? selectedIndex : 0;\n }\n\n #moveActive(delta: number): void {\n const options = this.#visibleOptions();\n if (options.length === 0) return;\n const n = options.length;\n this._activeIndex = (this._activeIndex + delta + n) % n;\n }\n\n #toggleActive(): void {\n const options = this.#visibleOptions();\n const option = options[this._activeIndex] ?? options[0];\n if (option) this.#toggleOption(option);\n }\n\n #onTriggerKeydown(e: KeyboardEvent): void {\n if (e.key === \"ArrowDown\" || e.key === \"ArrowUp\" || e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n if (!this._open) {\n this.#open();\n return;\n }\n if (e.key === \"ArrowDown\") this.#moveActive(1);\n else if (e.key === \"ArrowUp\") this.#moveActive(-1);\n else this.#toggleActive();\n } else if ((e.key === \"Home\" || e.key === \"End\") && this._open) {\n e.preventDefault();\n const options = this.#visibleOptions();\n this._activeIndex = e.key === \"Home\" ? 0 : options.length - 1;\n } else if (e.key === \"Escape\" && this._open) {\n e.preventDefault();\n this.#close();\n }\n }\n\n #onSearchFocus(e: FocusEvent): void {\n if (this.#isDisabled) return;\n if (this.#blurTimer) {\n clearTimeout(this.#blurTimer);\n this.#blurTimer = null;\n }\n if (!this._open) this.#open();\n if (!this.#restoringSearchFocus) (e.currentTarget as HTMLInputElement).select();\n }\n\n #onSearchClick(): void {\n if (!this._open) this.#open();\n }\n\n #onSearchMousedown(e: MouseEvent): void {\n if (e.button !== 0) e.preventDefault();\n }\n\n /** Seeds the active option when the persistent (non-searchable) list focuses. */\n #onListFocus(): void {\n if (this.#isDisabled || this.searchable) return;\n if (this._activeIndex < 0) this._activeIndex = this.#initialActiveIndex();\n }\n\n /** Keyboard navigation for the focusable, non-searchable persistent list. */\n #onListKeydown(e: KeyboardEvent): void {\n if (this.#isDisabled || this.searchable) return;\n if (e.key === \"ArrowDown\" || e.key === \"ArrowUp\") {\n e.preventDefault();\n if (this._activeIndex < 0) this._activeIndex = this.#initialActiveIndex();\n else this.#moveActive(e.key === \"ArrowDown\" ? 1 : -1);\n } else if (e.key === \"Home\" || e.key === \"End\") {\n e.preventDefault();\n const options = this.#visibleOptions();\n this._activeIndex = e.key === \"Home\" ? 0 : options.length - 1;\n } else if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n this.#toggleActive();\n }\n // Escape intentionally does nothing: the list is never hidden.\n }\n\n /** Infix-filters the persistent list as the searchable-list query changes. */\n #onListSearchInput(e: InputEvent): void {\n this._query = (e.currentTarget as HTMLInputElement).value;\n const options = this.#visibleOptions();\n this._activeIndex = options.length > 0 ? 0 : -1;\n }\n\n /** Keyboard navigation for the search field above a searchable persistent list. */\n #onListSearchKeydown(e: KeyboardEvent): void {\n if (e.isComposing || e.keyCode === 229 || this.#isComposing || this.#compositionJustEnded) {\n return;\n }\n if (e.key === \"ArrowDown\" || e.key === \"ArrowUp\") {\n e.preventDefault();\n this.#moveActive(e.key === \"ArrowDown\" ? 1 : -1);\n } else if (e.key === \"Home\" || e.key === \"End\") {\n e.preventDefault();\n const options = this.#visibleOptions();\n this._activeIndex = e.key === \"Home\" ? 0 : options.length - 1;\n } else if (e.key === \"Enter\") {\n e.preventDefault();\n this.#toggleActive();\n } else if (e.key === \"Escape\") {\n e.preventDefault();\n this._query = null;\n const options = this.#visibleOptions();\n this._activeIndex = options.length > 0 ? 0 : -1;\n } else if (\n e.key === \"Backspace\" &&\n (e.currentTarget as HTMLInputElement).value === \"\" &&\n this.values.length > 0\n ) {\n e.preventDefault();\n this.#removeValue(this.values[this.values.length - 1]);\n }\n }\n\n #onSearchInput(e: InputEvent): void {\n this._query = (e.currentTarget as HTMLInputElement).value;\n this._open = true;\n const options = this.#visibleOptions();\n this._activeIndex = options.length > 0 ? 0 : -1;\n }\n\n #onSearchKeydown(e: KeyboardEvent): void {\n if (e.isComposing || e.keyCode === 229 || this.#isComposing || this.#compositionJustEnded) {\n return;\n }\n if (e.key === \"ArrowDown\" || e.key === \"ArrowUp\") {\n e.preventDefault();\n if (!this._open) {\n this.#open();\n return;\n }\n this.#moveActive(e.key === \"ArrowDown\" ? 1 : -1);\n } else if ((e.key === \"Home\" || e.key === \"End\") && this._open) {\n e.preventDefault();\n const options = this.#visibleOptions();\n this._activeIndex = e.key === \"Home\" ? 0 : options.length - 1;\n } else if (e.key === \"Enter\" && this._open) {\n e.preventDefault();\n this.#toggleActive();\n } else if (e.key === \"Escape\" && this._open) {\n e.preventDefault();\n this.#close();\n } else if (\n e.key === \"Backspace\" &&\n (e.currentTarget as HTMLInputElement).value === \"\" &&\n this.values.length > 0\n ) {\n e.preventDefault();\n this.#removeValue(this.values[this.values.length - 1]);\n }\n }\n\n #onSearchBlur(): void {\n if (this.#blurTimer) clearTimeout(this.#blurTimer);\n this.#blurTimer = setTimeout(() => {\n this.#blurTimer = null;\n if (!this._open) return;\n if (!this.#listboxPointerDown && !this.#suppressNextBlur) this.#close();\n });\n }\n\n #focusSearchInput(e: MouseEvent): void {\n if (\n e.button !== 0 ||\n this.#isDisabled ||\n e.composedPath()[0] instanceof HTMLInputElement\n ) {\n return;\n }\n e.preventDefault();\n const input = this.renderRoot.querySelector<HTMLInputElement>(\"input.search-input\");\n if (!this._open) this.#open();\n input?.focus();\n input?.select();\n }\n\n #onCompositionStart(): void {\n if (this.#compositionEndTimer) clearTimeout(this.#compositionEndTimer);\n this.#compositionEndTimer = null;\n this.#compositionJustEnded = false;\n this.#isComposing = true;\n }\n\n #onCompositionEnd(): void {\n this.#isComposing = false;\n this.#compositionJustEnded = true;\n if (this.#compositionEndTimer) clearTimeout(this.#compositionEndTimer);\n this.#compositionEndTimer = setTimeout(() => {\n this.#compositionJustEnded = false;\n this.#compositionEndTimer = null;\n });\n }\n\n #onListboxMousedown(e: MouseEvent): void {\n if (e.button !== 0) return;\n this.#listboxPointerDown = true;\n this.#suppressNextBlur = true;\n const input = this.renderRoot.querySelector<HTMLInputElement>(\"input.search-input\");\n this.#searchSelection = input ? [input.selectionStart, input.selectionEnd] : null;\n window.addEventListener(\n \"mouseup\",\n () => {\n this.#listboxPointerDown = false;\n if (this._open) {\n const searchInput =\n this.renderRoot.querySelector<HTMLInputElement>(\"input.search-input\");\n if (searchInput) {\n this.#restoringSearchFocus = true;\n searchInput.focus({ preventScroll: true });\n this.#restoringSearchFocus = false;\n const [start, end] = this.#searchSelection ?? [null, null];\n if (start !== null && end !== null) searchInput.setSelectionRange(start, end);\n }\n }\n this.#searchSelection = null;\n setTimeout(() => {\n this.#suppressNextBlur = false;\n });\n },\n { capture: true, once: true },\n );\n }\n\n #onOptionMousedown(e: MouseEvent, option: MultiSelectOption): void {\n if (e.button !== 0) return;\n const optionElement = e.currentTarget as HTMLElement;\n const listbox = optionElement.parentElement;\n if (listbox) {\n const scrollbarWidth = listbox.offsetWidth - listbox.clientWidth;\n const bounds = listbox.getBoundingClientRect();\n const isRtl = getComputedStyle(listbox).direction === \"rtl\";\n const inScrollbarGutter = isRtl\n ? e.clientX <= bounds.left + scrollbarWidth\n : e.clientX >= bounds.right - scrollbarWidth;\n if (scrollbarWidth > 0 && inScrollbarGutter) return;\n }\n e.preventDefault();\n if (this.#isOptionDisabled(option)) return;\n this.#toggleOption(option);\n if (this.variant === \"list\" && !this.searchable && !this.#isDisabled) {\n this.renderRoot\n .querySelector<HTMLElement>(\"ul.persistent\")\n ?.focus({ preventScroll: true });\n }\n }\n\n #optionIconSize(option: MultiSelectOption): number {\n const size = option.iconSize ?? 16;\n return Number.isFinite(size) && size > 0 ? size : 16;\n }\n\n #renderOptionIcon(option: MultiSelectOption) {\n if (!option.icon) return nothing;\n return html`\n <span\n class=\"option-icon\"\n style=${`--multi-select-icon-size: ${this.#optionIconSize(option)}px`}\n aria-hidden=\"true\"\n >\n ${option.icon}\n </span>\n `;\n }\n\n /** The shared `<li role=\"option\">` items for both variants' listboxes. */\n private renderOptionItems(options: MultiSelectOption[]) {\n return html`\n ${options.map((option, index) => {\n const selected = this.values.includes(option.value);\n const disabled = this.#isOptionDisabled(option);\n return html`\n <li\n id=${`${this.#listboxId}-option-${index}`}\n role=\"option\"\n aria-selected=${selected}\n aria-disabled=${disabled ? \"true\" : nothing}\n class=${index === this._activeIndex ? \"active\" : \"\"}\n @mousedown=${(e: MouseEvent) => this.#onOptionMousedown(e, option)}\n >\n <span class=\"check ${selected ? \"\" : \"hidden\"}\" aria-hidden=\"true\">\n ${iconCheckCircle(14)}\n </span>\n <span class=\"option-content\">\n ${this.#renderOptionIcon(option)}\n <span class=\"option-label\">${option.label}</span>\n </span>\n </li>\n `;\n })}\n ${options.length === 0\n ? html`<li class=\"no-options\" role=\"presentation\">\n <span role=\"status\">No options found</span>\n </li>`\n : nothing}\n `;\n }\n\n private renderListbox() {\n if (!this._open) return nothing;\n const options = this.#visibleOptions();\n return html`\n <ul\n id=${this.#listboxId}\n class=\"options\"\n role=\"listbox\"\n aria-multiselectable=\"true\"\n aria-label=${this.label ? `${this.label} options` : \"Options\"}\n @mousedown=${(e: MouseEvent) => this.#onListboxMousedown(e)}\n >\n ${this.renderOptionItems(options)}\n </ul>\n `;\n }\n\n private renderChips() {\n if (!this.showChips || this.values.length === 0) return nothing;\n return html`\n <div class=\"chips\">\n ${this.values.map((value) => {\n const label = this.#labelFor(value);\n return html`\n <span class=\"chip\">\n <span class=\"chip-label\">${label}</span>\n <button\n type=\"button\"\n class=\"chip-remove\"\n aria-label=${`Remove ${label}`}\n ?disabled=${this.#isDisabled}\n @click=${() => this.#removeValue(value)}\n >\n ${iconX(18)}\n </button>\n </span>\n `;\n })}\n </div>\n `;\n }\n\n private renderSearchTrigger() {\n const activeDescendant =\n this._open && this._activeIndex >= 0\n ? `${this.#listboxId}-option-${this._activeIndex}`\n : nothing;\n return html`\n <div\n class=\"search-trigger ${this.#isDisabled ? \"disabled\" : \"\"}\"\n @mousedown=${(e: MouseEvent) => this.#focusSearchInput(e)}\n >\n <input\n type=\"text\"\n class=\"search-input\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n aria-expanded=${this._open}\n aria-controls=${this.#listboxId}\n aria-activedescendant=${activeDescendant}\n aria-label=${this.label || \"Select options\"}\n placeholder=${this.#summaryText()}\n autocomplete=\"off\"\n ?disabled=${this.#isDisabled}\n .value=${this._query ?? \"\"}\n @mousedown=${(e: MouseEvent) => this.#onSearchMousedown(e)}\n @focus=${(e: FocusEvent) => this.#onSearchFocus(e)}\n @click=${() => this.#onSearchClick()}\n @input=${(e: InputEvent) => this.#onSearchInput(e)}\n @compositionstart=${() => this.#onCompositionStart()}\n @compositionend=${() => this.#onCompositionEnd()}\n @keydown=${(e: KeyboardEvent) => this.#onSearchKeydown(e)}\n @blur=${() => this.#onSearchBlur()}\n />\n <span class=\"chevron\">${iconChevronRight(14)}</span>\n </div>\n `;\n }\n\n private renderButtonTrigger() {\n const activeDescendant =\n this._open && this._activeIndex >= 0\n ? `${this.#listboxId}-option-${this._activeIndex}`\n : nothing;\n const empty = this.values.length === 0;\n return html`\n <button\n type=\"button\"\n class=\"trigger\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n aria-expanded=${this._open}\n aria-controls=${this.#listboxId}\n aria-activedescendant=${activeDescendant}\n aria-label=${this.label || nothing}\n ?disabled=${this.#isDisabled}\n @click=${() => this.#toggle()}\n @keydown=${(e: KeyboardEvent) => this.#onTriggerKeydown(e)}\n >\n <span class=\"trigger-label ${empty ? \"placeholder\" : \"\"}\">${this.#summaryText()}</span>\n <span class=\"chevron\">${iconChevronRight(14)}</span>\n </button>\n `;\n }\n\n private renderListSearch() {\n const activeDescendant =\n this._activeIndex >= 0 ? `${this.#listboxId}-option-${this._activeIndex}` : nothing;\n return html`\n <div class=\"search-field ${this.#isDisabled ? \"disabled\" : \"\"}\">\n <input\n type=\"text\"\n class=\"search-input list-search\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n aria-expanded=\"true\"\n aria-controls=${this.#listboxId}\n aria-activedescendant=${activeDescendant}\n aria-label=${this.label || \"Select options\"}\n placeholder=${this.#summaryText()}\n autocomplete=\"off\"\n ?disabled=${this.#isDisabled}\n .value=${this._query ?? \"\"}\n @input=${(e: InputEvent) => this.#onListSearchInput(e)}\n @compositionstart=${() => this.#onCompositionStart()}\n @compositionend=${() => this.#onCompositionEnd()}\n @keydown=${(e: KeyboardEvent) => this.#onListSearchKeydown(e)}\n />\n </div>\n `;\n }\n\n private renderPersistentList() {\n const options = this.#visibleOptions();\n const focusable = !this.searchable && !this.#isDisabled;\n const activeDescendant =\n !this.searchable && this._activeIndex >= 0 && options.length > 0\n ? `${this.#listboxId}-option-${this._activeIndex}`\n : nothing;\n return html`\n <ul\n id=${this.#listboxId}\n class=\"options persistent ${this.#isDisabled ? \"disabled\" : \"\"}\"\n role=\"listbox\"\n aria-multiselectable=\"true\"\n aria-label=${this.label ? `${this.label} options` : \"Options\"}\n aria-disabled=${this.#isDisabled ? \"true\" : nothing}\n tabindex=${focusable ? \"0\" : nothing}\n aria-activedescendant=${activeDescendant}\n style=${`height: calc(${this.#rows} * 2rem + 0.5rem + 2px)`}\n @mousedown=${(e: MouseEvent) => this.#onListboxMousedown(e)}\n @focus=${() => this.#onListFocus()}\n @keydown=${(e: KeyboardEvent) => this.#onListKeydown(e)}\n >\n ${this.renderOptionItems(options)}\n </ul>\n `;\n }\n\n private renderListVariant() {\n return html`\n <div class=\"control list-control\">\n ${this.searchable ? this.renderListSearch() : nothing}\n ${this.renderPersistentList()}\n </div>\n ${this.renderChips()}\n <span class=\"sr-only\" aria-live=\"polite\">${this.#liveText()}</span>\n `;\n }\n\n override render() {\n if (this.variant === \"list\") return this.renderListVariant();\n return html`\n <div class=\"control\" @focusout=${(e: FocusEvent) => this.#onFocusOut(e)}>\n ${this.searchable ? this.renderSearchTrigger() : this.renderButtonTrigger()}\n ${this.renderListbox()}\n </div>\n ${this.renderChips()}\n <span class=\"sr-only\" aria-live=\"polite\">${this.#liveText()}</span>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"multi-select\": MultiSelect;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"multi-select.js","sourceRoot":"","sources":["../src/multi-select.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,UAAU,EACV,GAAG,EACH,IAAI,EACJ,OAAO,GAGR,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,IAAI,aAAa,GAAG,CAAC,CAAC;AAsBtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEI,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QAkZL,2CAA2C;QACX,YAAO,GAAwB,EAAE,CAAC;QAClE;;;WAGG;QAC6B,WAAM,GAAa,EAAE,CAAC;QACtD,+DAA+D;QACnD,SAAI,GAAG,EAAE,CAAC;QACtB,+CAA+C;QACnC,UAAK,GAAG,EAAE,CAAC;QACvB,0DAA0D;QAC9C,gBAAW,GAAG,gBAAgB,CAAC;QAC3C,uEAAuE;QAC1C,aAAQ,GAAG,KAAK,CAAC;QAC9C,gEAAgE;QACnC,aAAQ,GAAG,KAAK,CAAC;QAC9C;;;WAGG;QACyC,eAAU,GAAG,KAAK,CAAC;QAC/D,0EAA0E;QAC9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A/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;2CAAuB;AAE1C;IAAX,QAAQ,EAAE;yCAAW;AAEV;IAAX,QAAQ,EAAE;0CAAY;AAEX;IAAX,QAAQ,EAAE;gDAAgC;AAEd;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;6CAAkB;AAEjB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;6CAAkB;AAKF;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CAAoB;AAEnC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wCAAS;AAMP;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CAA0C;AAMf;IAAtD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;gDAAiB;AAOjB;IAArD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;8CAAmB;AAEvD;IAAhB,KAAK,EAAE;0CAAuB;AACd;IAAhB,KAAK,EAAE;iDAA2B;AAClB;IAAhB,KAAK,EAAE;2CAAsC;AAC7B;IAAhB,KAAK,EAAE;kDAA+B;AAjc5B,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CAkrCvB","sourcesContent":["import {\n LitElement,\n css,\n html,\n nothing,\n type PropertyValues,\n type TemplateResult,\n} from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport { iconCheckCircle, iconChevronRight, iconX } from \"./icons.js\";\nimport { tokens } from \"./tokens.js\";\n\nlet instanceCount = 0;\n\n/**\n * Presentation variant of {@link MultiSelect}.\n *\n * - `\"dropdown\"` (default): a compact trigger that opens a listbox popover.\n * - `\"list\"`: a persistently visible, bordered list surface with no popover.\n */\nexport type MultiSelectVariant = \"dropdown\" | \"list\";\n\n/** A single selectable option. */\nexport interface MultiSelectOption {\n value: string;\n label: string;\n /** Optional pre-rendered icon template displayed before the label. */\n icon?: TemplateResult;\n /** Square icon size in pixels. Defaults to 16 when `icon` is set. */\n iconSize?: number;\n /** When true, the option can neither be selected nor removed via the UI. */\n disabled?: boolean;\n}\n\n/**\n * A form-associated multi-select: a trigger showing a compact summary of the\n * current selection, opening a multi-selectable listbox popover, with an\n * optional removable-chip list of the chosen values. A drop-in generic\n * replacement for a native `<select multiple>` — set `name` on the element\n * itself and each\n * selected value is submitted as a repeated `name=value` entry, matching native\n * multiple-select semantics; `new FormData(form).getAll(name)` and\n * `form.reset()` work unchanged.\n *\n * The trigger visually follows `form-select`: a `2rem` field showing the\n * `placeholder` when empty, the single selected label when one value is chosen,\n * and `N selected` when several are. Set `show-chips` to additionally render\n * the selected values as compact chips below the trigger, each with an\n * accessible `32px` remove control; chips are off by default and the region\n * reserves no space while nothing is selected. Like `form-select`, the host is\n * `display: block` and fills its container by default; constrain the host\n * (`multi-select { display: inline-block; }`) to shrink it to its content\n * instead.\n *\n * Set `searchable` to replace the button trigger with an editable combobox that\n * infix-filters the predefined options by case-insensitive label. Typed text is\n * only a query: `values` changes exclusively when options are toggled, and an\n * uncommitted query is discarded when the list closes.\n *\n * The `variant` chooses between two presentations, and `searchable` applies to\n * both:\n *\n * - `\"dropdown\"` (default) is the popover form described above: a compact\n * trigger (button, or search combobox when `searchable`) that opens a\n * multi-selectable listbox on demand, closes on outside click / Escape, and\n * shows a chevron.\n * - `\"list\"` renders the options as a persistently visible, bordered surface\n * with no popover, no chevron, and no `open` host state; it never registers\n * outside-click listeners. Its scroll viewport is sized to roughly\n * `visibleRows` `2rem` rows (see `visible-rows`). When not `searchable` the\n * `listbox` itself is focusable and drives Arrow/Home/End/Enter/Space keyboard\n * navigation via `aria-activedescendant`; when `searchable` a `2rem` search\n * field sits above the list and owns navigation, and Escape only clears the\n * query instead of hiding the list.\n *\n * @element multi-select\n * @fires change - Fired with `{ values: string[] }` (a copied array) when a\n * value is added or removed through the UI. Programmatic `values` assignments\n * do not fire it.\n */\n@customElement(\"multi-select\")\nexport class MultiSelect extends LitElement {\n static formAssociated = true;\n\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n position: relative;\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n font-size: var(--ui-font-size, 0.875rem);\n }\n .control {\n position: relative;\n }\n button.trigger {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 0.25rem;\n width: 100%;\n height: 2rem;\n box-sizing: border-box;\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n font-size: var(--ui-font-size, 0.875rem);\n font-weight: var(--ui-font-weight-medium, 500);\n line-height: var(--ui-line-height-tight, 1.25);\n color: var(--ui-text, #0f172a);\n background: var(--ui-surface, #ffffff);\n border: 1px solid var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius-sm, 0.25rem);\n padding: 0.5rem 0.75rem;\n cursor: pointer;\n }\n button.trigger:hover:not(:disabled) {\n background: var(--ui-surface-muted, #f8fafc);\n }\n button.trigger:disabled {\n cursor: not-allowed;\n opacity: 0.6;\n }\n button.trigger:focus-visible {\n outline: none;\n border-color: var(--ui-primary, #4f46e5);\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n .trigger-label {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .trigger-label.placeholder {\n color: var(--ui-text-muted, #64748b);\n }\n .search-trigger {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 0.25rem;\n width: 100%;\n height: 2rem;\n box-sizing: border-box;\n color: var(--ui-text, #0f172a);\n background: var(--ui-surface, #ffffff);\n border: 1px solid var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius-sm, 0.25rem);\n cursor: text;\n }\n .search-trigger:hover:not(.disabled) {\n background: var(--ui-surface-muted, #f8fafc);\n }\n .search-trigger:not(.disabled):focus-within {\n border-color: var(--ui-primary, #4f46e5);\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n .search-trigger.disabled {\n cursor: not-allowed;\n opacity: 0.6;\n }\n input.search-input {\n min-width: 0;\n flex: 1;\n box-sizing: border-box;\n padding: 0.5rem 0 0.5rem 0.75rem;\n color: inherit;\n background: transparent;\n border: 0;\n outline: 0;\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n font-size: var(--ui-font-size, 0.875rem);\n font-weight: var(--ui-font-weight-medium, 500);\n line-height: var(--ui-line-height-tight, 1.25);\n }\n input.search-input::placeholder {\n color: var(--ui-text-muted, #64748b);\n font-weight: var(--ui-font-weight-medium, 500);\n opacity: 1;\n }\n .chevron {\n display: flex;\n flex: 0 0 auto;\n margin-right: 0.75rem;\n color: var(--ui-text-muted, #64748b);\n pointer-events: none;\n transform: rotate(90deg);\n transition: transform 150ms ease;\n }\n button.trigger .chevron {\n margin-right: 0;\n }\n :host([open]) .chevron {\n transform: rotate(-90deg);\n }\n ul.options {\n position: absolute;\n top: 100%;\n left: 0;\n z-index: 10;\n min-width: 100%;\n max-height: 40vh;\n overflow-y: auto;\n scrollbar-gutter: stable;\n margin: 0.25rem 0 0;\n padding: 0.25rem 0;\n list-style: none;\n white-space: nowrap;\n color: var(--ui-text, #0f172a);\n background: var(--ui-surface, #ffffff);\n border: 1px solid var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius-sm, 0.25rem);\n box-shadow: var(--ui-shadow, 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1));\n }\n ul.options::-webkit-scrollbar {\n width: 0.75rem;\n }\n ul.options::-webkit-scrollbar-thumb {\n background: var(--ui-border, #e2e8f0);\n border: 0.25rem solid transparent;\n border-radius: var(--ui-radius-pill, 9999px);\n background-clip: padding-box;\n }\n .list-control {\n display: flex;\n flex-direction: column;\n }\n .search-field {\n display: flex;\n align-items: center;\n width: 100%;\n height: 2rem;\n box-sizing: border-box;\n margin-bottom: 0.25rem;\n color: var(--ui-text, #0f172a);\n background: var(--ui-surface, #ffffff);\n border: 1px solid var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius-sm, 0.25rem);\n cursor: text;\n }\n .search-field:not(.disabled):focus-within {\n border-color: var(--ui-primary, #4f46e5);\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n .search-field.disabled {\n cursor: not-allowed;\n opacity: 0.6;\n }\n input.list-search {\n padding-right: 0.75rem;\n }\n ul.options.persistent {\n position: static;\n z-index: auto;\n min-width: 0;\n max-height: none;\n margin: 0;\n box-sizing: border-box;\n border-radius: var(--ui-radius, 0.5rem);\n box-shadow: none;\n }\n ul.options.persistent.disabled {\n cursor: not-allowed;\n opacity: 0.6;\n pointer-events: none;\n }\n ul.options.persistent:focus-visible {\n outline: none;\n border-color: var(--ui-primary, #4f46e5);\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n li {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 0.5rem 0.75rem;\n cursor: pointer;\n }\n li.active,\n li:hover:not([aria-disabled=\"true\"]) {\n background: var(--ui-surface-muted, #f8fafc);\n }\n li[aria-selected=\"true\"] {\n font-weight: var(--ui-font-weight-semibold, 600);\n color: var(--ui-primary, #4f46e5);\n }\n li[aria-disabled=\"true\"] {\n cursor: not-allowed;\n color: var(--ui-text-muted, #64748b);\n opacity: 0.6;\n }\n .check {\n display: inline-flex;\n flex: 0 0 auto;\n width: 14px;\n height: 14px;\n align-items: center;\n justify-content: center;\n color: var(--ui-primary, #4f46e5);\n }\n .check.hidden {\n visibility: hidden;\n }\n .check > svg {\n width: 100%;\n height: 100%;\n }\n .option-content {\n display: inline-flex;\n min-width: 0;\n flex: 1;\n align-items: center;\n gap: 0.5rem;\n }\n .option-icon {\n display: inline-flex;\n width: var(--multi-select-icon-size);\n height: var(--multi-select-icon-size);\n flex: 0 0 var(--multi-select-icon-size);\n align-items: center;\n justify-content: center;\n }\n .option-icon > svg {\n width: 100%;\n height: 100%;\n }\n .option-label {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n li.no-options {\n display: block;\n padding: 0.5rem 0.75rem;\n color: var(--ui-text-muted, #64748b);\n cursor: default;\n font-style: italic;\n }\n .chips {\n display: flex;\n flex-wrap: wrap;\n gap: 0.25rem;\n margin-top: 0.25rem;\n /* Pin the chips row to the control's resolved width (0 width +\n min-width 100%) so a long selected label ellipsizes instead of\n contributing its content width and widening the control. */\n width: 0;\n min-width: 100%;\n box-sizing: border-box;\n }\n .chip {\n display: inline-flex;\n align-items: center;\n gap: 0.25rem;\n max-width: 100%;\n box-sizing: border-box;\n padding-left: 0.5rem;\n color: var(--ui-text, #0f172a);\n background: var(--ui-surface-muted, #f8fafc);\n border: 1px solid var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius-sm, 0.25rem);\n }\n .chip-label {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: var(--ui-font-size-sm, 0.75rem);\n font-weight: var(--ui-font-weight-medium, 500);\n line-height: var(--ui-line-height-tight, 1.25);\n }\n .chip-remove {\n display: inline-flex;\n flex: 0 0 auto;\n width: 2rem;\n height: 2rem;\n align-items: center;\n justify-content: center;\n padding: 0;\n color: var(--ui-text-muted, #64748b);\n background: transparent;\n border: 0;\n border-radius: var(--ui-radius-sm, 0.25rem);\n cursor: pointer;\n }\n .chip-remove:hover:not(:disabled) {\n color: var(--ui-danger, #dc2626);\n }\n .chip-remove:disabled {\n cursor: not-allowed;\n opacity: 0.6;\n }\n .chip-remove:focus-visible {\n outline: none;\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n .chip-remove > svg {\n width: 18px;\n height: 18px;\n }\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n }\n @media (prefers-reduced-motion: reduce) {\n .chevron {\n transition: none;\n }\n }\n @media (forced-colors: active) {\n button.trigger:focus-visible,\n .search-trigger:not(.disabled):focus-within,\n .search-field:not(.disabled):focus-within,\n ul.options.persistent:focus-visible,\n .chip-remove:focus-visible {\n outline: 2px solid CanvasText;\n outline-offset: 2px;\n box-shadow: none;\n }\n button.trigger:disabled,\n .search-trigger.disabled,\n .search-field.disabled,\n ul.options.persistent.disabled,\n .chip-remove:disabled,\n li[aria-disabled=\"true\"] {\n color: GrayText;\n opacity: 1;\n }\n li.active,\n li:hover:not([aria-disabled=\"true\"]) {\n color: HighlightText;\n background: Highlight;\n }\n li[aria-selected=\"true\"] {\n color: Highlight;\n }\n li.active[aria-selected=\"true\"],\n li[aria-selected=\"true\"]:hover {\n color: HighlightText;\n }\n .chip {\n border-color: CanvasText;\n }\n }\n `,\n ];\n\n /** The full list of selectable options. */\n @property({ attribute: false }) options: MultiSelectOption[] = [];\n /**\n * The currently selected values. Programmatic assignments are deduplicated\n * while preserving order and never fire `change`.\n */\n @property({ attribute: false }) values: string[] = [];\n /** Form control name; each selected value submits under it. */\n @property() name = \"\";\n /** Accessible label applied to the trigger. */\n @property() label = \"\";\n /** Text shown on the trigger when nothing is selected. */\n @property() placeholder = \"Select options\";\n /** Disables the whole control, preventing the popover from opening. */\n @property({ type: Boolean }) disabled = false;\n /** Marks the control as required for native form validation. */\n @property({ type: Boolean }) required = false;\n /**\n * Enables editable, case-insensitive infix filtering by option label.\n * Typed text never becomes a selected value.\n */\n @property({ type: Boolean, reflect: true }) searchable = false;\n /** Maximum number of selectable values; `0` (default) means unlimited. */\n @property({ type: Number }) max = 0;\n /**\n * Presentation variant. `\"dropdown\"` (default) opens a popover listbox;\n * `\"list\"` renders a persistently visible, bordered list surface. Reflected\n * so consumers can style by `[variant=\"list\"]`.\n */\n @property({ reflect: true }) variant: MultiSelectVariant = \"dropdown\";\n /**\n * Number of `2rem` rows the `list` variant's scroll viewport shows before it\n * scrolls, mirroring a native `<select size>`. Normalized to an integer of at\n * least `1` (default `5`); ignored by the `dropdown` variant.\n */\n @property({ type: Number, attribute: \"visible-rows\" }) visibleRows = 5;\n /**\n * When true, the selected values are also rendered as removable chips below\n * the trigger, each with an accessible `32px` remove control. Off by default:\n * the trigger already summarizes the selection, and values can be toggled off\n * in the listbox. Applies to both variants.\n */\n @property({ type: Boolean, attribute: \"show-chips\" }) showChips = false;\n\n @state() private _open = false;\n @state() private _activeIndex = -1;\n @state() private _query: string | null = null;\n @state() private _formDisabled = false;\n\n #internals = this.attachInternals();\n #defaultValues: string[] | null = null;\n #listboxPointerDown = false;\n #suppressNextBlur = false;\n #restoringSearchFocus = false;\n #searchSelection: [number | null, number | null] | null = null;\n #isComposing = false;\n #compositionJustEnded = false;\n #compositionEndTimer: ReturnType<typeof setTimeout> | null = null;\n #blurTimer: ReturnType<typeof setTimeout> | null = null;\n readonly #listboxId = `multi-select-listbox-${++instanceCount}`;\n\n /** Whether the host or an ancestor fieldset currently disables the control. */\n get #isDisabled(): boolean {\n return this.disabled || this._formDisabled;\n }\n\n /** `visibleRows` normalized to a whole number of rows, at least `1`. */\n get #rows(): number {\n const raw = this.visibleRows;\n if (!Number.isFinite(raw)) return 5;\n const floored = Math.floor(raw);\n return floored < 1 ? 1 : floored;\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n window.removeEventListener(\"mousedown\", this.#onWindowMousedown, true);\n if (this.#blurTimer) clearTimeout(this.#blurTimer);\n if (this.#compositionEndTimer) clearTimeout(this.#compositionEndTimer);\n this.#blurTimer = null;\n this.#compositionEndTimer = null;\n this.#listboxPointerDown = false;\n this.#suppressNextBlur = false;\n this.#searchSelection = null;\n this.#isComposing = false;\n this.#compositionJustEnded = false;\n this.#close();\n }\n\n protected override willUpdate(changed: PropertyValues): void {\n if (!this.hasUpdated && this.#defaultValues === null) {\n this.#defaultValues = this.#dedupe(this.values);\n }\n if (changed.has(\"values\")) {\n const deduped = this.#dedupe(this.values);\n if (\n deduped.length !== this.values.length ||\n deduped.some((value, index) => value !== this.values[index])\n ) {\n this.values = deduped;\n }\n }\n if (\n (changed.has(\"disabled\") || changed.has(\"searchable\") || changed.has(\"variant\")) &&\n (this.#isDisabled || changed.has(\"searchable\") || changed.has(\"variant\"))\n ) {\n this.#close();\n }\n }\n\n protected override updated(changed: PropertyValues): void {\n if (changed.has(\"_open\")) {\n this.toggleAttribute(\"open\", this._open);\n if (this._open) {\n window.addEventListener(\"mousedown\", this.#onWindowMousedown, true);\n } else {\n window.removeEventListener(\"mousedown\", this.#onWindowMousedown, true);\n }\n }\n if (changed.has(\"values\") || changed.has(\"name\")) this.#syncFormValue();\n if (\n changed.has(\"values\") ||\n changed.has(\"required\") ||\n changed.has(\"disabled\") ||\n changed.has(\"_formDisabled\")\n ) {\n this.#syncValidity();\n }\n if (\n (changed.has(\"_activeIndex\") || changed.has(\"_query\") || changed.has(\"options\")) &&\n (this._open || this.variant === \"list\") &&\n this._activeIndex >= 0\n ) {\n this.renderRoot\n .querySelector<HTMLElement>(`#${this.#listboxId}-option-${this._activeIndex}`)\n ?.scrollIntoView({ block: \"nearest\", inline: \"nearest\" });\n }\n }\n\n /** Restores the selection captured at first render, per the form contract. */\n formResetCallback(): void {\n this.values = this.#defaultValues ? [...this.#defaultValues] : [];\n this.#close();\n }\n\n /** Mirrors an ancestor fieldset's disabled state and closes the popover. */\n formDisabledCallback(disabled: boolean): void {\n this._formDisabled = disabled;\n if (disabled) this.#close();\n }\n\n /** Restores the selection from the saved form state on navigation/autofill. */\n formStateRestoreCallback(state: string | File | FormData | null): void {\n if (typeof state !== \"string\") return;\n try {\n const parsed: unknown = JSON.parse(state);\n if (Array.isArray(parsed)) {\n this.values = parsed.filter((item): item is string => typeof item === \"string\");\n }\n } catch {\n /* ignore malformed restore state */\n }\n }\n\n #syncFormValue(): void {\n const values = this.values;\n if (!this.name || values.length === 0) {\n this.#internals.setFormValue(null);\n return;\n }\n const data = new FormData();\n for (const value of values) data.append(this.name, value);\n this.#internals.setFormValue(data, JSON.stringify(values));\n }\n\n #syncValidity(): void {\n const anchor = this.#anchorElement();\n if (this.#isDisabled) {\n this.#internals.setValidity({});\n return;\n }\n if (this.required && this.values.length === 0) {\n this.#internals.setValidity(\n { valueMissing: true },\n \"Please select at least one option.\",\n anchor ?? undefined,\n );\n } else {\n this.#internals.setValidity({});\n }\n }\n\n #anchorElement(): HTMLElement | null {\n return this.renderRoot.querySelector<HTMLElement>(\n \"button.trigger, input.search-input, ul.persistent\",\n );\n }\n\n #dedupe(values: readonly string[]): string[] {\n const seen = new Set<string>();\n const result: string[] = [];\n for (const value of values) {\n if (seen.has(value)) continue;\n seen.add(value);\n result.push(value);\n }\n return result;\n }\n\n /** First option matching `value`, so duplicate values resolve deterministically. */\n #optionByValue(value: string): MultiSelectOption | undefined {\n return this.options.find((option) => option.value === value);\n }\n\n #labelFor(value: string): string {\n return this.#optionByValue(value)?.label ?? value;\n }\n\n #summaryText(): string {\n if (this.values.length === 0) return this.placeholder;\n if (this.values.length === 1) return this.#labelFor(this.values[0]);\n return `${this.values.length} selected`;\n }\n\n #liveText(): string {\n if (this.values.length === 0) return \"No options selected\";\n if (this.values.length === 1) return `${this.#labelFor(this.values[0])} selected`;\n return `${this.values.length} options selected`;\n }\n\n #visibleOptions(): MultiSelectOption[] {\n if (!this.searchable || this._query === null) return this.options;\n const needle = this._query.trim().toLocaleLowerCase();\n if (!needle) return this.options;\n return this.options.filter((option) =>\n option.label.toLocaleLowerCase().includes(needle),\n );\n }\n\n /** Whether `value` is currently at the selection cap and cannot be added. */\n #atCap(value: string): boolean {\n return (\n this.max > 0 && this.values.length >= this.max && !this.values.includes(value)\n );\n }\n\n #isOptionDisabled(option: MultiSelectOption): boolean {\n return Boolean(option.disabled) || this.#atCap(option.value) || this.#isDisabled;\n }\n\n #toggleOption(option: MultiSelectOption): void {\n if (this.#isDisabled || option.disabled) return;\n if (this.values.includes(option.value)) {\n this.#commit(this.values.filter((value) => value !== option.value));\n return;\n }\n if (this.#atCap(option.value)) return;\n this.#commit([...this.values, option.value]);\n }\n\n #removeValue(value: string): void {\n if (this.#isDisabled) return;\n if (!this.values.includes(value)) return;\n this.#commit(this.values.filter((existing) => existing !== value));\n }\n\n #commit(next: string[]): void {\n this.values = this.#dedupe(next);\n this.dispatchEvent(\n new CustomEvent(\"change\", {\n detail: { values: [...this.values] },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n #onWindowMousedown = (e: MouseEvent): void => {\n if (!e.composedPath().includes(this)) this.#close();\n };\n\n #onFocusOut = (e: FocusEvent): void => {\n if (this.#listboxPointerDown || this.#suppressNextBlur) return;\n const next = e.relatedTarget;\n // Focus leaving to body/null (e.g. a pointer press on a non-focusable\n // element inside the component) is handled by the outside-mousedown\n // listener; only a genuine Tab-out to another element closes here.\n if (!(next instanceof Node)) return;\n if (this === next || this.renderRoot.contains(next)) return;\n this.#close();\n };\n\n #toggle(): void {\n if (this.#isDisabled) return;\n if (this._open) this.#close();\n else this.#open();\n }\n\n #open(): void {\n if (this.#isDisabled) return;\n this._query = null;\n this._open = true;\n this._activeIndex = this.#initialActiveIndex();\n }\n\n #close(): void {\n this._open = false;\n this._query = null;\n this._activeIndex = -1;\n this.#searchSelection = null;\n }\n\n #initialActiveIndex(): number {\n const options = this.#visibleOptions();\n if (options.length === 0) return -1;\n if (this._query !== null) return 0;\n const selectedIndex = options.findIndex((option) =>\n this.values.includes(option.value),\n );\n return selectedIndex >= 0 ? selectedIndex : 0;\n }\n\n #moveActive(delta: number): void {\n const options = this.#visibleOptions();\n if (options.length === 0) return;\n const n = options.length;\n this._activeIndex = (this._activeIndex + delta + n) % n;\n }\n\n #toggleActive(): void {\n const options = this.#visibleOptions();\n const option = options[this._activeIndex] ?? options[0];\n if (option) this.#toggleOption(option);\n }\n\n #onTriggerKeydown(e: KeyboardEvent): void {\n if (e.key === \"ArrowDown\" || e.key === \"ArrowUp\" || e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n if (!this._open) {\n this.#open();\n return;\n }\n if (e.key === \"ArrowDown\") this.#moveActive(1);\n else if (e.key === \"ArrowUp\") this.#moveActive(-1);\n else this.#toggleActive();\n } else if ((e.key === \"Home\" || e.key === \"End\") && this._open) {\n e.preventDefault();\n const options = this.#visibleOptions();\n this._activeIndex = e.key === \"Home\" ? 0 : options.length - 1;\n } else if (e.key === \"Escape\" && this._open) {\n e.preventDefault();\n this.#close();\n }\n }\n\n #onSearchFocus(e: FocusEvent): void {\n if (this.#isDisabled) return;\n if (this.#blurTimer) {\n clearTimeout(this.#blurTimer);\n this.#blurTimer = null;\n }\n if (!this._open) this.#open();\n if (!this.#restoringSearchFocus) (e.currentTarget as HTMLInputElement).select();\n }\n\n #onSearchClick(): void {\n if (!this._open) this.#open();\n }\n\n #onSearchMousedown(e: MouseEvent): void {\n if (e.button !== 0) e.preventDefault();\n }\n\n /** Seeds the active option when the persistent (non-searchable) list focuses. */\n #onListFocus(): void {\n if (this.#isDisabled || this.searchable) return;\n if (this._activeIndex < 0) this._activeIndex = this.#initialActiveIndex();\n }\n\n /** Keyboard navigation for the focusable, non-searchable persistent list. */\n #onListKeydown(e: KeyboardEvent): void {\n if (this.#isDisabled || this.searchable) return;\n if (e.key === \"ArrowDown\" || e.key === \"ArrowUp\") {\n e.preventDefault();\n if (this._activeIndex < 0) this._activeIndex = this.#initialActiveIndex();\n else this.#moveActive(e.key === \"ArrowDown\" ? 1 : -1);\n } else if (e.key === \"Home\" || e.key === \"End\") {\n e.preventDefault();\n const options = this.#visibleOptions();\n this._activeIndex = e.key === \"Home\" ? 0 : options.length - 1;\n } else if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n this.#toggleActive();\n }\n // Escape intentionally does nothing: the list is never hidden.\n }\n\n /** Infix-filters the persistent list as the searchable-list query changes. */\n #onListSearchInput(e: InputEvent): void {\n this._query = (e.currentTarget as HTMLInputElement).value;\n const options = this.#visibleOptions();\n this._activeIndex = options.length > 0 ? 0 : -1;\n }\n\n /** Keyboard navigation for the search field above a searchable persistent list. */\n #onListSearchKeydown(e: KeyboardEvent): void {\n if (e.isComposing || e.keyCode === 229 || this.#isComposing || this.#compositionJustEnded) {\n return;\n }\n if (e.key === \"ArrowDown\" || e.key === \"ArrowUp\") {\n e.preventDefault();\n this.#moveActive(e.key === \"ArrowDown\" ? 1 : -1);\n } else if (e.key === \"Home\" || e.key === \"End\") {\n e.preventDefault();\n const options = this.#visibleOptions();\n this._activeIndex = e.key === \"Home\" ? 0 : options.length - 1;\n } else if (e.key === \"Enter\") {\n e.preventDefault();\n this.#toggleActive();\n } else if (e.key === \"Escape\") {\n e.preventDefault();\n this._query = null;\n const options = this.#visibleOptions();\n this._activeIndex = options.length > 0 ? 0 : -1;\n } else if (\n e.key === \"Backspace\" &&\n (e.currentTarget as HTMLInputElement).value === \"\" &&\n this.values.length > 0\n ) {\n e.preventDefault();\n this.#removeValue(this.values[this.values.length - 1]);\n }\n }\n\n #onSearchInput(e: InputEvent): void {\n this._query = (e.currentTarget as HTMLInputElement).value;\n this._open = true;\n const options = this.#visibleOptions();\n this._activeIndex = options.length > 0 ? 0 : -1;\n }\n\n #onSearchKeydown(e: KeyboardEvent): void {\n if (e.isComposing || e.keyCode === 229 || this.#isComposing || this.#compositionJustEnded) {\n return;\n }\n if (e.key === \"ArrowDown\" || e.key === \"ArrowUp\") {\n e.preventDefault();\n if (!this._open) {\n this.#open();\n return;\n }\n this.#moveActive(e.key === \"ArrowDown\" ? 1 : -1);\n } else if ((e.key === \"Home\" || e.key === \"End\") && this._open) {\n e.preventDefault();\n const options = this.#visibleOptions();\n this._activeIndex = e.key === \"Home\" ? 0 : options.length - 1;\n } else if (e.key === \"Enter\" && this._open) {\n e.preventDefault();\n this.#toggleActive();\n } else if (e.key === \"Escape\" && this._open) {\n e.preventDefault();\n this.#close();\n } else if (\n e.key === \"Backspace\" &&\n (e.currentTarget as HTMLInputElement).value === \"\" &&\n this.values.length > 0\n ) {\n e.preventDefault();\n this.#removeValue(this.values[this.values.length - 1]);\n }\n }\n\n #onSearchBlur(): void {\n if (this.#blurTimer) clearTimeout(this.#blurTimer);\n this.#blurTimer = setTimeout(() => {\n this.#blurTimer = null;\n if (!this._open) return;\n if (!this.#listboxPointerDown && !this.#suppressNextBlur) this.#close();\n });\n }\n\n #focusSearchInput(e: MouseEvent): void {\n if (\n e.button !== 0 ||\n this.#isDisabled ||\n e.composedPath()[0] instanceof HTMLInputElement\n ) {\n return;\n }\n e.preventDefault();\n const input = this.renderRoot.querySelector<HTMLInputElement>(\"input.search-input\");\n if (!this._open) this.#open();\n input?.focus();\n input?.select();\n }\n\n #onCompositionStart(): void {\n if (this.#compositionEndTimer) clearTimeout(this.#compositionEndTimer);\n this.#compositionEndTimer = null;\n this.#compositionJustEnded = false;\n this.#isComposing = true;\n }\n\n #onCompositionEnd(): void {\n this.#isComposing = false;\n this.#compositionJustEnded = true;\n if (this.#compositionEndTimer) clearTimeout(this.#compositionEndTimer);\n this.#compositionEndTimer = setTimeout(() => {\n this.#compositionJustEnded = false;\n this.#compositionEndTimer = null;\n });\n }\n\n #onListboxMousedown(e: MouseEvent): void {\n if (e.button !== 0) return;\n this.#listboxPointerDown = true;\n this.#suppressNextBlur = true;\n const input = this.renderRoot.querySelector<HTMLInputElement>(\"input.search-input\");\n this.#searchSelection = input ? [input.selectionStart, input.selectionEnd] : null;\n window.addEventListener(\n \"mouseup\",\n () => {\n this.#listboxPointerDown = false;\n if (this._open) {\n const searchInput =\n this.renderRoot.querySelector<HTMLInputElement>(\"input.search-input\");\n if (searchInput) {\n this.#restoringSearchFocus = true;\n searchInput.focus({ preventScroll: true });\n this.#restoringSearchFocus = false;\n const [start, end] = this.#searchSelection ?? [null, null];\n if (start !== null && end !== null) searchInput.setSelectionRange(start, end);\n }\n }\n this.#searchSelection = null;\n setTimeout(() => {\n this.#suppressNextBlur = false;\n });\n },\n { capture: true, once: true },\n );\n }\n\n #onOptionMousedown(e: MouseEvent, option: MultiSelectOption): void {\n if (e.button !== 0) return;\n const optionElement = e.currentTarget as HTMLElement;\n const listbox = optionElement.parentElement;\n if (listbox) {\n const scrollbarWidth = listbox.offsetWidth - listbox.clientWidth;\n const bounds = listbox.getBoundingClientRect();\n const isRtl = getComputedStyle(listbox).direction === \"rtl\";\n const inScrollbarGutter = isRtl\n ? e.clientX <= bounds.left + scrollbarWidth\n : e.clientX >= bounds.right - scrollbarWidth;\n if (scrollbarWidth > 0 && inScrollbarGutter) return;\n }\n e.preventDefault();\n if (this.#isOptionDisabled(option)) return;\n this.#toggleOption(option);\n if (this.variant === \"list\" && !this.searchable && !this.#isDisabled) {\n this.renderRoot\n .querySelector<HTMLElement>(\"ul.persistent\")\n ?.focus({ preventScroll: true });\n }\n }\n\n #optionIconSize(option: MultiSelectOption): number {\n const size = option.iconSize ?? 16;\n return Number.isFinite(size) && size > 0 ? size : 16;\n }\n\n #renderOptionIcon(option: MultiSelectOption) {\n if (!option.icon) return nothing;\n return html`\n <span\n class=\"option-icon\"\n style=${`--multi-select-icon-size: ${this.#optionIconSize(option)}px`}\n aria-hidden=\"true\"\n >\n ${option.icon}\n </span>\n `;\n }\n\n /** The shared `<li role=\"option\">` items for both variants' listboxes. */\n private renderOptionItems(options: MultiSelectOption[]) {\n return html`\n ${options.map((option, index) => {\n const selected = this.values.includes(option.value);\n const disabled = this.#isOptionDisabled(option);\n return html`\n <li\n id=${`${this.#listboxId}-option-${index}`}\n role=\"option\"\n aria-selected=${selected}\n aria-disabled=${disabled ? \"true\" : nothing}\n class=${index === this._activeIndex ? \"active\" : \"\"}\n @mousedown=${(e: MouseEvent) => this.#onOptionMousedown(e, option)}\n >\n <span class=\"check ${selected ? \"\" : \"hidden\"}\" aria-hidden=\"true\">\n ${iconCheckCircle(14)}\n </span>\n <span class=\"option-content\">\n ${this.#renderOptionIcon(option)}\n <span class=\"option-label\">${option.label}</span>\n </span>\n </li>\n `;\n })}\n ${options.length === 0\n ? html`<li class=\"no-options\" role=\"presentation\">\n <span role=\"status\">No options found</span>\n </li>`\n : nothing}\n `;\n }\n\n private renderListbox() {\n if (!this._open) return nothing;\n const options = this.#visibleOptions();\n return html`\n <ul\n id=${this.#listboxId}\n class=\"options\"\n role=\"listbox\"\n aria-multiselectable=\"true\"\n aria-label=${this.label ? `${this.label} options` : \"Options\"}\n @mousedown=${(e: MouseEvent) => this.#onListboxMousedown(e)}\n >\n ${this.renderOptionItems(options)}\n </ul>\n `;\n }\n\n private renderChips() {\n if (!this.showChips || this.values.length === 0) return nothing;\n return html`\n <div class=\"chips\">\n ${this.values.map((value) => {\n const label = this.#labelFor(value);\n return html`\n <span class=\"chip\">\n <span class=\"chip-label\">${label}</span>\n <button\n type=\"button\"\n class=\"chip-remove\"\n aria-label=${`Remove ${label}`}\n ?disabled=${this.#isDisabled}\n @click=${() => this.#removeValue(value)}\n >\n ${iconX(18)}\n </button>\n </span>\n `;\n })}\n </div>\n `;\n }\n\n private renderSearchTrigger() {\n const activeDescendant =\n this._open && this._activeIndex >= 0\n ? `${this.#listboxId}-option-${this._activeIndex}`\n : nothing;\n return html`\n <div\n class=\"search-trigger ${this.#isDisabled ? \"disabled\" : \"\"}\"\n @mousedown=${(e: MouseEvent) => this.#focusSearchInput(e)}\n >\n <input\n type=\"text\"\n class=\"search-input\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n aria-expanded=${this._open}\n aria-controls=${this.#listboxId}\n aria-activedescendant=${activeDescendant}\n aria-label=${this.label || \"Select options\"}\n placeholder=${this.#summaryText()}\n autocomplete=\"off\"\n ?disabled=${this.#isDisabled}\n .value=${this._query ?? \"\"}\n @mousedown=${(e: MouseEvent) => this.#onSearchMousedown(e)}\n @focus=${(e: FocusEvent) => this.#onSearchFocus(e)}\n @click=${() => this.#onSearchClick()}\n @input=${(e: InputEvent) => this.#onSearchInput(e)}\n @compositionstart=${() => this.#onCompositionStart()}\n @compositionend=${() => this.#onCompositionEnd()}\n @keydown=${(e: KeyboardEvent) => this.#onSearchKeydown(e)}\n @blur=${() => this.#onSearchBlur()}\n />\n <span class=\"chevron\">${iconChevronRight(14)}</span>\n </div>\n `;\n }\n\n private renderButtonTrigger() {\n const activeDescendant =\n this._open && this._activeIndex >= 0\n ? `${this.#listboxId}-option-${this._activeIndex}`\n : nothing;\n const empty = this.values.length === 0;\n return html`\n <button\n type=\"button\"\n class=\"trigger\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n aria-expanded=${this._open}\n aria-controls=${this.#listboxId}\n aria-activedescendant=${activeDescendant}\n aria-label=${this.label || nothing}\n ?disabled=${this.#isDisabled}\n @click=${() => this.#toggle()}\n @keydown=${(e: KeyboardEvent) => this.#onTriggerKeydown(e)}\n >\n <span class=\"trigger-label ${empty ? \"placeholder\" : \"\"}\">${this.#summaryText()}</span>\n <span class=\"chevron\">${iconChevronRight(14)}</span>\n </button>\n `;\n }\n\n private renderListSearch() {\n const activeDescendant =\n this._activeIndex >= 0 ? `${this.#listboxId}-option-${this._activeIndex}` : nothing;\n return html`\n <div class=\"search-field ${this.#isDisabled ? \"disabled\" : \"\"}\">\n <input\n type=\"text\"\n class=\"search-input list-search\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n aria-expanded=\"true\"\n aria-controls=${this.#listboxId}\n aria-activedescendant=${activeDescendant}\n aria-label=${this.label || \"Select options\"}\n placeholder=${this.#summaryText()}\n autocomplete=\"off\"\n ?disabled=${this.#isDisabled}\n .value=${this._query ?? \"\"}\n @input=${(e: InputEvent) => this.#onListSearchInput(e)}\n @compositionstart=${() => this.#onCompositionStart()}\n @compositionend=${() => this.#onCompositionEnd()}\n @keydown=${(e: KeyboardEvent) => this.#onListSearchKeydown(e)}\n />\n </div>\n `;\n }\n\n private renderPersistentList() {\n const options = this.#visibleOptions();\n const focusable = !this.searchable && !this.#isDisabled;\n const activeDescendant =\n !this.searchable && this._activeIndex >= 0 && options.length > 0\n ? `${this.#listboxId}-option-${this._activeIndex}`\n : nothing;\n return html`\n <ul\n id=${this.#listboxId}\n class=\"options persistent ${this.#isDisabled ? \"disabled\" : \"\"}\"\n role=\"listbox\"\n aria-multiselectable=\"true\"\n aria-label=${this.label ? `${this.label} options` : \"Options\"}\n aria-disabled=${this.#isDisabled ? \"true\" : nothing}\n tabindex=${focusable ? \"0\" : nothing}\n aria-activedescendant=${activeDescendant}\n style=${`height: calc(${this.#rows} * 2rem + 0.5rem + 2px)`}\n @mousedown=${(e: MouseEvent) => this.#onListboxMousedown(e)}\n @focus=${() => this.#onListFocus()}\n @keydown=${(e: KeyboardEvent) => this.#onListKeydown(e)}\n >\n ${this.renderOptionItems(options)}\n </ul>\n `;\n }\n\n private renderListVariant() {\n return html`\n <div class=\"control list-control\">\n ${this.searchable ? this.renderListSearch() : nothing}\n ${this.renderPersistentList()}\n </div>\n ${this.renderChips()}\n <span class=\"sr-only\" aria-live=\"polite\">${this.#liveText()}</span>\n `;\n }\n\n override render() {\n if (this.variant === \"list\") return this.renderListVariant();\n return html`\n <div class=\"control\" @focusout=${(e: FocusEvent) => this.#onFocusOut(e)}>\n ${this.searchable ? this.renderSearchTrigger() : this.renderButtonTrigger()}\n ${this.renderListbox()}\n </div>\n ${this.renderChips()}\n <span class=\"sr-only\" aria-live=\"polite\">${this.#liveText()}</span>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"multi-select\": MultiSelect;\n }\n}\n"]}
|
package/dist/photo-gallery.js
CHANGED
|
@@ -161,7 +161,7 @@ let PhotoGallery = class PhotoGallery extends LitElement {
|
|
|
161
161
|
padding: 0;
|
|
162
162
|
color: var(--ui-on-accent, #ffffff);
|
|
163
163
|
background: var(--ui-overlay, rgb(15 23 42 / 0.45));
|
|
164
|
-
border-radius: 9999px;
|
|
164
|
+
border-radius: var(--ui-radius-pill, 9999px);
|
|
165
165
|
pointer-events: auto;
|
|
166
166
|
}
|
|
167
167
|
.arrow-button:hover {
|
|
@@ -199,7 +199,7 @@ let PhotoGallery = class PhotoGallery extends LitElement {
|
|
|
199
199
|
height: 2rem;
|
|
200
200
|
padding: 0;
|
|
201
201
|
background: transparent;
|
|
202
|
-
border-radius: 9999px;
|
|
202
|
+
border-radius: var(--ui-radius-pill, 9999px);
|
|
203
203
|
}
|
|
204
204
|
.indicator::before {
|
|
205
205
|
position: absolute;
|
|
@@ -208,7 +208,7 @@ let PhotoGallery = class PhotoGallery extends LitElement {
|
|
|
208
208
|
width: 0.625rem;
|
|
209
209
|
height: 0.625rem;
|
|
210
210
|
background: var(--ui-border, #e2e8f0);
|
|
211
|
-
border-radius: 9999px;
|
|
211
|
+
border-radius: var(--ui-radius-pill, 9999px);
|
|
212
212
|
content: "";
|
|
213
213
|
transform: translate(-50%, -50%);
|
|
214
214
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"photo-gallery.js","sourceRoot":"","sources":["../src/photo-gallery.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1F,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAGvD,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,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OAAO,eAAe;gBACvD,CAAC,CAAC,OAAO;;gBAEX,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC;aAChC;YACH,CAAC,CAAC,OAAO;4BACS,IAAI,CAAC,iBAAiB;;KAE7C,CAAC;IACJ,CAAC;CACF,CAAA;AAppBC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDACrD;AAGW;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAAW;AAItC;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;kDAClD;AAIpB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;iDACnC;AAIpB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;oDACnC;AAIvB;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,uBAAuB,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;yDACnD;AAI3B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CAC5B;AAIf;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;iDACjB;AAIvB;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;+CACK;AAG1B;IADhB,qBAAqB,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC;mDACL;AAGvC;IADP,KAAK,EAAE;oDACqC;AAGrC;IADP,KAAK,EAAE;mDACkB;AA3Cf,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CAupBxB","sourcesContent":["import { LitElement, css, html, nothing, type PropertyValues } from \"lit\";\nimport { customElement, property, queryAssignedElements, state } from \"lit/decorators.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { styleMap } from \"lit/directives/style-map.js\";\nimport type { GalleryItemVariant } from \"./gallery-item-variant.js\";\nimport { GalleryItem } from \"./gallery-item.js\";\nimport { iconChevronLeft, iconChevronRight } from \"./icons.js\";\nimport { tokens } from \"./tokens.js\";\n\nexport type PhotoGalleryObjectFit = \"cover\" | \"contain\";\nexport type PhotoGalleryChangeReason =\n | \"autoplay\"\n | \"indicator\"\n | \"items\"\n | \"keyboard\"\n | \"next\"\n | \"previous\"\n | \"programmatic\"\n | \"swipe\";\n\nexport interface PhotoGallerySlideChangeDetail {\n previousIndex: number;\n currentIndex: number;\n item: GalleryItem;\n reason: PhotoGalleryChangeReason;\n}\n\nconst transitionDurationMs = 250;\nconst swipeThresholdPx = 40;\nconst booleanAttribute = {\n fromAttribute(value: string | null): boolean {\n return value !== null && value !== \"false\";\n },\n};\n\n/**\n * Responsive, accessible image carousel composed from declarative\n * `gallery-item` children.\n *\n * The image viewport keeps a fixed `aspect-ratio`, and the caption row is\n * reserved for every slide whenever any slide has a caption, so the carousel's\n * total height stays constant as it cycles — it never shifts the page below it.\n *\n * @element photo-gallery\n * @slot - `gallery-item` elements rendered as slides.\n * @fires slide-change - The active image changed.\n */\n@customElement(\"photo-gallery\")\nexport class PhotoGallery extends LitElement {\n /** Zero-based active image index. */\n @property({ type: Number, attribute: \"current-index\", reflect: true })\n currentIndex = 0;\n\n /** Autoplay interval in milliseconds. Set to zero to disable autoplay. */\n @property({ type: Number }) delay = 0;\n\n /** Whether previous and next buttons are shown. */\n @property({ attribute: \"show-controls\", converter: booleanAttribute })\n showControls = true;\n\n /** Whether a current/total counter is shown. */\n @property({ type: Boolean, attribute: \"show-counter\" })\n showCounter = false;\n\n /** Whether clickable slide indicators are shown. */\n @property({ type: Boolean, attribute: \"show-indicators\" })\n showIndicators = false;\n\n /** Whether autoplay includes a built-in pause/play control. */\n @property({ attribute: \"show-autoplay-control\", converter: booleanAttribute })\n showAutoplayControl = true;\n\n /** Whether autoplay is explicitly paused. */\n @property({ type: Boolean, reflect: true })\n paused = false;\n\n /** CSS aspect ratio used by the image viewport. */\n @property({ attribute: \"aspect-ratio\" })\n aspectRatio = \"16 / 9\";\n\n /** How images fit within the stable viewport. */\n @property({ attribute: \"object-fit\" })\n objectFit: PhotoGalleryObjectFit = \"cover\";\n\n @queryAssignedElements({ selector: \"gallery-item\" })\n private readonly _galleryItems!: GalleryItem[];\n\n @state()\n private _previousIndex: number | null = null;\n\n @state()\n private _itemsVersion = 0;\n\n private _autoplayTimer?: number;\n private _transitionTimer?: number;\n private _metadataObserver?: MutationObserver;\n private _hovered = false;\n private _focusWithin = false;\n private _nextChangeReason: PhotoGalleryChangeReason | null = null;\n private _pendingChange?: PhotoGallerySlideChangeDetail;\n private _pointerStart?: { id: number; x: number; y: number };\n private _itemsChanged = false;\n private _activeItem?: GalleryItem;\n private _renderedIndex = 0;\n\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n color: var(--ui-text, #0f172a);\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n font-size: var(--ui-font-size, 0.875rem);\n }\n .gallery {\n outline: none;\n }\n figure {\n margin: 0;\n }\n .viewport {\n position: relative;\n overflow: hidden;\n aspect-ratio: var(--photo-gallery-aspect-ratio, 16 / 9);\n border-radius: var(--ui-radius, 0.5rem);\n background: var(--ui-surface-muted, #f8fafc);\n touch-action: pan-y;\n user-select: none;\n }\n .gallery:focus-visible .viewport {\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n .slides {\n display: grid;\n width: 100%;\n height: 100%;\n }\n picture {\n grid-area: 1 / 1;\n display: block;\n width: 100%;\n height: 100%;\n }\n picture img {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: var(--photo-gallery-object-fit, cover);\n }\n .entering {\n z-index: 2;\n animation: gallery-fade-in 250ms ease both;\n }\n .leaving {\n z-index: 1;\n pointer-events: none;\n animation: gallery-fade-out 250ms ease both;\n }\n .arrow-controls {\n position: absolute;\n z-index: 3;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0.5rem;\n pointer-events: none;\n }\n button {\n border: 0;\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n cursor: pointer;\n }\n button:focus-visible {\n outline: none;\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n .arrow-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 2rem;\n height: 2rem;\n padding: 0;\n color: var(--ui-on-accent, #ffffff);\n background: var(--ui-overlay, rgb(15 23 42 / 0.45));\n border-radius: 9999px;\n pointer-events: auto;\n }\n .arrow-button:hover {\n background: color-mix(in srgb, var(--ui-text, #0f172a) 70%, transparent);\n }\n figcaption {\n padding: 0.5rem 0.25rem 0;\n min-height: 1lh;\n line-height: var(--ui-line-height-normal, 1.5);\n color: var(--ui-text-muted, #64748b);\n }\n .footer {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 0.75rem;\n min-height: 2rem;\n padding-top: 0.5rem;\n }\n .counter {\n color: var(--ui-text-muted, #64748b);\n font-size: var(--ui-font-size-sm, 0.75rem);\n white-space: nowrap;\n }\n .indicators {\n display: flex;\n flex: 1 1 auto;\n align-items: center;\n justify-content: center;\n gap: 0.25rem;\n }\n .indicator {\n position: relative;\n width: 2rem;\n height: 2rem;\n padding: 0;\n background: transparent;\n border-radius: 9999px;\n }\n .indicator::before {\n position: absolute;\n top: 50%;\n left: 50%;\n width: 0.625rem;\n height: 0.625rem;\n background: var(--ui-border, #e2e8f0);\n border-radius: 9999px;\n content: \"\";\n transform: translate(-50%, -50%);\n }\n .indicator[aria-current=\"true\"]::before {\n background: var(--ui-primary, #4f46e5);\n }\n .autoplay-button {\n height: 2rem;\n box-sizing: border-box;\n padding: 0.25rem 0.5rem;\n color: var(--ui-text, #0f172a);\n background: var(--ui-surface-muted, #f8fafc);\n border: 1px solid var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius-sm, 0.25rem);\n font-size: var(--ui-font-size-sm, 0.75rem);\n line-height: var(--ui-line-height-tight, 1.25);\n white-space: nowrap;\n }\n .autoplay-button:hover {\n background: var(--ui-surface, #ffffff);\n }\n slot {\n display: none;\n }\n @keyframes gallery-fade-in {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n @keyframes gallery-fade-out {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n .entering,\n .leaving {\n animation: none;\n }\n }\n `,\n ];\n\n /** Starts observers and autoplay integration when the element connects. */\n override connectedCallback(): void {\n super.connectedCallback();\n this._metadataObserver ??= new MutationObserver(() => this._handleMetadataChange());\n this._metadataObserver.observe(this, {\n attributes: true,\n attributeFilter: [\"alt\", \"caption\", \"media\", \"src\", \"srcset\"],\n childList: true,\n subtree: true,\n });\n document.addEventListener(\"visibilitychange\", this._handleVisibilityChange);\n }\n\n /** Releases timers and observers when the element disconnects. */\n override disconnectedCallback(): void {\n this._clearAutoplay();\n this._clearTransition();\n this._metadataObserver?.disconnect();\n document.removeEventListener(\"visibilitychange\", this._handleVisibilityChange);\n super.disconnectedCallback();\n }\n\n /** Normalizes external index changes before rendering. */\n protected override willUpdate(changed: PropertyValues<this>): void {\n if (!changed.has(\"currentIndex\")) return;\n\n const normalized = this._normalizeIndex(this.currentIndex);\n if (normalized !== this.currentIndex) {\n this.currentIndex = normalized;\n }\n\n const previousValue = changed.get(\"currentIndex\");\n if (previousValue === undefined || this._galleryItems.length === 0) {\n this._nextChangeReason = null;\n return;\n }\n\n const previousIndex = this._normalizeIndex(Number(previousValue));\n if (previousIndex === normalized) {\n this._nextChangeReason = null;\n return;\n }\n\n const reason = this._nextChangeReason ?? \"programmatic\";\n this._previousIndex = reason === \"items\" ? null : previousIndex;\n this._pendingChange = {\n previousIndex,\n currentIndex: normalized,\n item: this._galleryItems[normalized],\n reason,\n };\n this._nextChangeReason = null;\n }\n\n /** Emits completed changes and keeps autoplay synchronized with properties. */\n protected override updated(changed: PropertyValues<this>): void {\n if (this._pendingChange) {\n this.dispatchEvent(\n new CustomEvent<PhotoGallerySlideChangeDetail>(\"slide-change\", {\n bubbles: true,\n composed: true,\n detail: this._pendingChange,\n }),\n );\n this._pendingChange = undefined;\n this._scheduleTransitionCleanup();\n }\n\n if (changed.has(\"currentIndex\") || changed.has(\"delay\") || changed.has(\"paused\") || this._itemsChanged) {\n this._itemsChanged = false;\n this._restartAutoplay();\n }\n this._activeItem = this._galleryItems[this.currentIndex];\n this._renderedIndex = this.currentIndex;\n }\n\n /** Wraps any requested index into the current item range. */\n private _normalizeIndex(index: number): number {\n const count = this._galleryItems.length;\n if (count === 0 || !Number.isFinite(index)) return 0;\n return ((Math.trunc(index) % count) + count) % count;\n }\n\n /** Returns responsive variants declared directly under an item. */\n private _variantsFor(item: GalleryItem): GalleryItemVariant[] {\n return Array.from(item.children).filter(\n (child): child is GalleryItemVariant => child.tagName.toLowerCase() === \"gallery-item-variant\",\n );\n }\n\n /** Changes slides through the shared state and event path. */\n private _goTo(index: number, reason: PhotoGalleryChangeReason): void {\n const normalized = this._normalizeIndex(index);\n if (this._galleryItems.length < 2 || normalized === this.currentIndex) {\n this._restartAutoplay();\n return;\n }\n\n this._nextChangeReason = reason;\n this.currentIndex = normalized;\n }\n\n /** Moves to the previous image. */\n private _showPrevious(reason: PhotoGalleryChangeReason = \"previous\"): void {\n this._goTo(this.currentIndex - 1, reason);\n }\n\n /** Moves to the next image. */\n private _showNext(reason: PhotoGalleryChangeReason = \"next\"): void {\n this._goTo(this.currentIndex + 1, reason);\n }\n\n /** Toggles explicit autoplay pause state. */\n private _togglePaused(): void {\n this.paused = !this.paused;\n }\n\n /** Clears and conditionally schedules the next autoplay advance. */\n private _restartAutoplay(): void {\n this._clearAutoplay();\n if (!this._canAutoplay()) return;\n\n this._autoplayTimer = window.setTimeout(() => {\n this._showNext(\"autoplay\");\n }, this.delay);\n }\n\n /** Reports whether autoplay may currently schedule a transition. */\n private _canAutoplay(): boolean {\n return (\n this.delay > 0 &&\n this._galleryItems.length > 1 &&\n !this.paused &&\n !this._hovered &&\n !this._focusWithin &&\n !document.hidden\n );\n }\n\n /** Clears the pending autoplay timeout. */\n private _clearAutoplay(): void {\n if (this._autoplayTimer === undefined) return;\n window.clearTimeout(this._autoplayTimer);\n this._autoplayTimer = undefined;\n }\n\n /** Removes the outgoing crossfade layer after the animation completes. */\n private _scheduleTransitionCleanup(): void {\n this._clearTransition();\n this._transitionTimer = window.setTimeout(() => {\n this._previousIndex = null;\n this._transitionTimer = undefined;\n }, transitionDurationMs);\n }\n\n /** Clears pending transition cleanup. */\n private _clearTransition(): void {\n if (this._transitionTimer === undefined) return;\n window.clearTimeout(this._transitionTimer);\n this._transitionTimer = undefined;\n }\n\n /** Refreshes item metadata and clamps the active index after light-DOM changes. */\n private _handleMetadataChange(): void {\n this._itemsChanged = true;\n this._itemsVersion += 1;\n const preserveActiveItem = this.currentIndex === this._renderedIndex;\n const preservedIndex =\n preserveActiveItem && this._activeItem ? this._galleryItems.indexOf(this._activeItem) : -1;\n const normalized = preservedIndex >= 0 ? preservedIndex : this._normalizeIndex(this.currentIndex);\n if (normalized === this.currentIndex) {\n const item = this._galleryItems[normalized];\n const activeItemRemoved = Boolean(this._activeItem && !this._galleryItems.includes(this._activeItem));\n if (item && activeItemRemoved) {\n this._previousIndex = null;\n this._pendingChange = {\n previousIndex: this._renderedIndex,\n currentIndex: normalized,\n item,\n reason: \"items\",\n };\n }\n return;\n }\n this._nextChangeReason = \"items\";\n this.currentIndex = normalized;\n }\n\n /** Refreshes item state after the default slot changes. */\n private _handleSlotChange(): void {\n this._handleMetadataChange();\n }\n\n /** Temporarily pauses autoplay while the pointer is over the gallery. */\n private _handleMouseEnter(): void {\n this._hovered = true;\n this._restartAutoplay();\n }\n\n /** Resumes autoplay with a fresh delay after hover ends. */\n private _handleMouseLeave(): void {\n this._hovered = false;\n this._restartAutoplay();\n }\n\n /** Temporarily pauses autoplay while focus is inside the gallery. */\n private _handleFocusIn(): void {\n this._focusWithin = true;\n this._restartAutoplay();\n }\n\n /** Resumes autoplay with a fresh delay after focus leaves the gallery. */\n private _handleFocusOut(): void {\n queueMicrotask(() => {\n this._focusWithin = this.matches(\":focus-within\");\n this._restartAutoplay();\n });\n }\n\n /** Pauses or resumes scheduling when page visibility changes. */\n private readonly _handleVisibilityChange = (): void => {\n this._restartAutoplay();\n };\n\n /** Handles Left and Right arrow keyboard navigation. */\n private _handleKeyDown(event: KeyboardEvent): void {\n if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n this._showPrevious(\"keyboard\");\n return;\n }\n if (event.key === \"ArrowRight\") {\n event.preventDefault();\n this._showNext(\"keyboard\");\n }\n }\n\n /** Records the starting point of a primary pointer gesture. */\n private _handlePointerDown(event: PointerEvent): void {\n if (!event.isPrimary || event.button !== 0) return;\n if (event.composedPath().some((target) => target instanceof HTMLButtonElement)) return;\n this._pointerStart = { id: event.pointerId, x: event.clientX, y: event.clientY };\n (event.currentTarget as HTMLElement).setPointerCapture(event.pointerId);\n }\n\n /** Converts a sufficiently horizontal pointer gesture into navigation. */\n private _handlePointerUp(event: PointerEvent): void {\n const start = this._pointerStart;\n this._pointerStart = undefined;\n if (!start || start.id !== event.pointerId) return;\n\n const deltaX = event.clientX - start.x;\n const deltaY = event.clientY - start.y;\n if (Math.abs(deltaX) < swipeThresholdPx || Math.abs(deltaX) <= Math.abs(deltaY)) return;\n\n event.preventDefault();\n if (deltaX < 0) {\n this._showNext(\"swipe\");\n return;\n }\n this._showPrevious(\"swipe\");\n }\n\n /** Cancels an incomplete pointer gesture. */\n private _handlePointerCancel(): void {\n this._pointerStart = undefined;\n }\n\n /** Renders one responsive image layer for the crossfade stack. */\n private _renderPicture(index: number, state: \"current\" | \"previous\") {\n const item = this._galleryItems[index];\n if (!item) return nothing;\n\n const isPrevious = state === \"previous\";\n const transitionClass = this._previousIndex === null ? \"\" : isPrevious ? \"leaving\" : \"entering\";\n return html`\n <picture class=${transitionClass} aria-hidden=${isPrevious ? \"true\" : nothing}>\n ${this._variantsFor(item)\n .filter((variant) => variant.srcset)\n .map(\n (variant) =>\n html`<source media=${ifDefined(variant.media || undefined)} srcset=${variant.srcset} />`,\n )}\n <img src=${item.src} alt=${isPrevious ? \"\" : item.alt} draggable=\"false\" />\n </picture>\n `;\n }\n\n /** Renders enabled counter, indicator, and autoplay controls. */\n private _renderFooter(itemCount: number) {\n const showIndicators = this.showIndicators && itemCount > 1;\n const showAutoplay = this.showAutoplayControl && this.delay > 0 && itemCount > 1;\n if (!this.showCounter && !showIndicators && !showAutoplay) return nothing;\n\n return html`\n <div class=\"footer\">\n ${this.showCounter\n ? html`<span class=\"counter\">${this.currentIndex + 1} / ${itemCount}</span>`\n : nothing}\n ${showIndicators\n ? html`\n <div class=\"indicators\" role=\"group\" aria-label=\"Choose image\">\n ${this._galleryItems.map(\n (_item, index) => html`\n <button\n class=\"indicator\"\n type=\"button\"\n aria-label=\"Show image ${index + 1} of ${itemCount}\"\n aria-current=${String(index === this.currentIndex)}\n @click=${() => this._goTo(index, \"indicator\")}\n ></button>\n `,\n )}\n </div>\n `\n : nothing}\n ${showAutoplay\n ? html`\n <button\n class=\"autoplay-button\"\n type=\"button\"\n aria-label=${this.paused ? \"Resume slideshow\" : \"Pause slideshow\"}\n @click=${this._togglePaused}\n >\n ${this.paused ? \"Play\" : \"Pause\"}\n </button>\n `\n : nothing}\n </div>\n `;\n }\n\n /** Renders the active image, navigation, caption, and hidden metadata slot. */\n protected override render() {\n const itemCount = this._galleryItems.length;\n const currentItem = this._galleryItems[this.currentIndex];\n // Reserve the caption row for every slide as soon as any slide has a\n // caption, so the gallery's total height stays constant while it cycles\n // (a slide without a caption no longer collapses the box and shifts the\n // page below it).\n const hasCaptions = this._galleryItems.some((item) => item.caption);\n const objectFit: PhotoGalleryObjectFit = this.objectFit === \"contain\" ? \"contain\" : \"cover\";\n const viewportStyles = {\n \"--photo-gallery-aspect-ratio\": this.aspectRatio.trim() || \"16 / 9\",\n \"--photo-gallery-object-fit\": objectFit,\n };\n\n return html`\n <div\n class=\"gallery\"\n role=\"region\"\n aria-roledescription=\"carousel\"\n aria-label=\"Photo gallery\"\n tabindex=\"0\"\n @keydown=${this._handleKeyDown}\n @mouseenter=${this._handleMouseEnter}\n @mouseleave=${this._handleMouseLeave}\n @focusin=${this._handleFocusIn}\n @focusout=${this._handleFocusOut}\n >\n ${currentItem\n ? html`\n <figure>\n <div\n class=\"viewport\"\n style=${styleMap(viewportStyles)}\n @pointerdown=${this._handlePointerDown}\n @pointerup=${this._handlePointerUp}\n @pointercancel=${this._handlePointerCancel}\n >\n <div class=\"slides\">\n ${this._previousIndex === null\n ? nothing\n : this._renderPicture(this._previousIndex, \"previous\")}\n ${this._renderPicture(this.currentIndex, \"current\")}\n </div>\n ${this.showControls && itemCount > 1\n ? html`\n <div class=\"arrow-controls\">\n <button\n class=\"arrow-button previous\"\n type=\"button\"\n aria-label=\"Previous image\"\n @click=${() => this._showPrevious()}\n >\n ${iconChevronLeft(18)}\n </button>\n <button\n class=\"arrow-button next\"\n type=\"button\"\n aria-label=\"Next image\"\n @click=${() => this._showNext()}\n >\n ${iconChevronRight(18)}\n </button>\n </div>\n `\n : nothing}\n </div>\n ${hasCaptions\n ? html`<figcaption>${currentItem.caption}</figcaption>`\n : nothing}\n </figure>\n ${this._renderFooter(itemCount)}\n `\n : nothing}\n <slot @slotchange=${this._handleSlotChange}></slot>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"photo-gallery\": PhotoGallery;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"photo-gall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,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;iDACjB;AAIvB;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;+CACK;AAG1B;IADhB,qBAAqB,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC;mDACL;AAGvC;IADP,KAAK,EAAE;oDACqC;AAGrC;IADP,KAAK,EAAE;mDACkB;AA3Cf,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CAupBxB","sourcesContent":["import { LitElement, css, html, nothing, type PropertyValues } from \"lit\";\nimport { customElement, property, queryAssignedElements, state } from \"lit/decorators.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { styleMap } from \"lit/directives/style-map.js\";\nimport type { GalleryItemVariant } from \"./gallery-item-variant.js\";\nimport { GalleryItem } from \"./gallery-item.js\";\nimport { iconChevronLeft, iconChevronRight } from \"./icons.js\";\nimport { tokens } from \"./tokens.js\";\n\nexport type PhotoGalleryObjectFit = \"cover\" | \"contain\";\nexport type PhotoGalleryChangeReason =\n | \"autoplay\"\n | \"indicator\"\n | \"items\"\n | \"keyboard\"\n | \"next\"\n | \"previous\"\n | \"programmatic\"\n | \"swipe\";\n\nexport interface PhotoGallerySlideChangeDetail {\n previousIndex: number;\n currentIndex: number;\n item: GalleryItem;\n reason: PhotoGalleryChangeReason;\n}\n\nconst transitionDurationMs = 250;\nconst swipeThresholdPx = 40;\nconst booleanAttribute = {\n fromAttribute(value: string | null): boolean {\n return value !== null && value !== \"false\";\n },\n};\n\n/**\n * Responsive, accessible image carousel composed from declarative\n * `gallery-item` children.\n *\n * The image viewport keeps a fixed `aspect-ratio`, and the caption row is\n * reserved for every slide whenever any slide has a caption, so the carousel's\n * total height stays constant as it cycles — it never shifts the page below it.\n *\n * @element photo-gallery\n * @slot - `gallery-item` elements rendered as slides.\n * @fires slide-change - The active image changed.\n */\n@customElement(\"photo-gallery\")\nexport class PhotoGallery extends LitElement {\n /** Zero-based active image index. */\n @property({ type: Number, attribute: \"current-index\", reflect: true })\n currentIndex = 0;\n\n /** Autoplay interval in milliseconds. Set to zero to disable autoplay. */\n @property({ type: Number }) delay = 0;\n\n /** Whether previous and next buttons are shown. */\n @property({ attribute: \"show-controls\", converter: booleanAttribute })\n showControls = true;\n\n /** Whether a current/total counter is shown. */\n @property({ type: Boolean, attribute: \"show-counter\" })\n showCounter = false;\n\n /** Whether clickable slide indicators are shown. */\n @property({ type: Boolean, attribute: \"show-indicators\" })\n showIndicators = false;\n\n /** Whether autoplay includes a built-in pause/play control. */\n @property({ attribute: \"show-autoplay-control\", converter: booleanAttribute })\n showAutoplayControl = true;\n\n /** Whether autoplay is explicitly paused. */\n @property({ type: Boolean, reflect: true })\n paused = false;\n\n /** CSS aspect ratio used by the image viewport. */\n @property({ attribute: \"aspect-ratio\" })\n aspectRatio = \"16 / 9\";\n\n /** How images fit within the stable viewport. */\n @property({ attribute: \"object-fit\" })\n objectFit: PhotoGalleryObjectFit = \"cover\";\n\n @queryAssignedElements({ selector: \"gallery-item\" })\n private readonly _galleryItems!: GalleryItem[];\n\n @state()\n private _previousIndex: number | null = null;\n\n @state()\n private _itemsVersion = 0;\n\n private _autoplayTimer?: number;\n private _transitionTimer?: number;\n private _metadataObserver?: MutationObserver;\n private _hovered = false;\n private _focusWithin = false;\n private _nextChangeReason: PhotoGalleryChangeReason | null = null;\n private _pendingChange?: PhotoGallerySlideChangeDetail;\n private _pointerStart?: { id: number; x: number; y: number };\n private _itemsChanged = false;\n private _activeItem?: GalleryItem;\n private _renderedIndex = 0;\n\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n color: var(--ui-text, #0f172a);\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n font-size: var(--ui-font-size, 0.875rem);\n }\n .gallery {\n outline: none;\n }\n figure {\n margin: 0;\n }\n .viewport {\n position: relative;\n overflow: hidden;\n aspect-ratio: var(--photo-gallery-aspect-ratio, 16 / 9);\n border-radius: var(--ui-radius, 0.5rem);\n background: var(--ui-surface-muted, #f8fafc);\n touch-action: pan-y;\n user-select: none;\n }\n .gallery:focus-visible .viewport {\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n .slides {\n display: grid;\n width: 100%;\n height: 100%;\n }\n picture {\n grid-area: 1 / 1;\n display: block;\n width: 100%;\n height: 100%;\n }\n picture img {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: var(--photo-gallery-object-fit, cover);\n }\n .entering {\n z-index: 2;\n animation: gallery-fade-in 250ms ease both;\n }\n .leaving {\n z-index: 1;\n pointer-events: none;\n animation: gallery-fade-out 250ms ease both;\n }\n .arrow-controls {\n position: absolute;\n z-index: 3;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0.5rem;\n pointer-events: none;\n }\n button {\n border: 0;\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n cursor: pointer;\n }\n button:focus-visible {\n outline: none;\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n .arrow-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 2rem;\n height: 2rem;\n padding: 0;\n color: var(--ui-on-accent, #ffffff);\n background: var(--ui-overlay, rgb(15 23 42 / 0.45));\n border-radius: var(--ui-radius-pill, 9999px);\n pointer-events: auto;\n }\n .arrow-button:hover {\n background: color-mix(in srgb, var(--ui-text, #0f172a) 70%, transparent);\n }\n figcaption {\n padding: 0.5rem 0.25rem 0;\n min-height: 1lh;\n line-height: var(--ui-line-height-normal, 1.5);\n color: var(--ui-text-muted, #64748b);\n }\n .footer {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 0.75rem;\n min-height: 2rem;\n padding-top: 0.5rem;\n }\n .counter {\n color: var(--ui-text-muted, #64748b);\n font-size: var(--ui-font-size-sm, 0.75rem);\n white-space: nowrap;\n }\n .indicators {\n display: flex;\n flex: 1 1 auto;\n align-items: center;\n justify-content: center;\n gap: 0.25rem;\n }\n .indicator {\n position: relative;\n width: 2rem;\n height: 2rem;\n padding: 0;\n background: transparent;\n border-radius: var(--ui-radius-pill, 9999px);\n }\n .indicator::before {\n position: absolute;\n top: 50%;\n left: 50%;\n width: 0.625rem;\n height: 0.625rem;\n background: var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius-pill, 9999px);\n content: \"\";\n transform: translate(-50%, -50%);\n }\n .indicator[aria-current=\"true\"]::before {\n background: var(--ui-primary, #4f46e5);\n }\n .autoplay-button {\n height: 2rem;\n box-sizing: border-box;\n padding: 0.25rem 0.5rem;\n color: var(--ui-text, #0f172a);\n background: var(--ui-surface-muted, #f8fafc);\n border: 1px solid var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius-sm, 0.25rem);\n font-size: var(--ui-font-size-sm, 0.75rem);\n line-height: var(--ui-line-height-tight, 1.25);\n white-space: nowrap;\n }\n .autoplay-button:hover {\n background: var(--ui-surface, #ffffff);\n }\n slot {\n display: none;\n }\n @keyframes gallery-fade-in {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n @keyframes gallery-fade-out {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n .entering,\n .leaving {\n animation: none;\n }\n }\n `,\n ];\n\n /** Starts observers and autoplay integration when the element connects. */\n override connectedCallback(): void {\n super.connectedCallback();\n this._metadataObserver ??= new MutationObserver(() => this._handleMetadataChange());\n this._metadataObserver.observe(this, {\n attributes: true,\n attributeFilter: [\"alt\", \"caption\", \"media\", \"src\", \"srcset\"],\n childList: true,\n subtree: true,\n });\n document.addEventListener(\"visibilitychange\", this._handleVisibilityChange);\n }\n\n /** Releases timers and observers when the element disconnects. */\n override disconnectedCallback(): void {\n this._clearAutoplay();\n this._clearTransition();\n this._metadataObserver?.disconnect();\n document.removeEventListener(\"visibilitychange\", this._handleVisibilityChange);\n super.disconnectedCallback();\n }\n\n /** Normalizes external index changes before rendering. */\n protected override willUpdate(changed: PropertyValues<this>): void {\n if (!changed.has(\"currentIndex\")) return;\n\n const normalized = this._normalizeIndex(this.currentIndex);\n if (normalized !== this.currentIndex) {\n this.currentIndex = normalized;\n }\n\n const previousValue = changed.get(\"currentIndex\");\n if (previousValue === undefined || this._galleryItems.length === 0) {\n this._nextChangeReason = null;\n return;\n }\n\n const previousIndex = this._normalizeIndex(Number(previousValue));\n if (previousIndex === normalized) {\n this._nextChangeReason = null;\n return;\n }\n\n const reason = this._nextChangeReason ?? \"programmatic\";\n this._previousIndex = reason === \"items\" ? null : previousIndex;\n this._pendingChange = {\n previousIndex,\n currentIndex: normalized,\n item: this._galleryItems[normalized],\n reason,\n };\n this._nextChangeReason = null;\n }\n\n /** Emits completed changes and keeps autoplay synchronized with properties. */\n protected override updated(changed: PropertyValues<this>): void {\n if (this._pendingChange) {\n this.dispatchEvent(\n new CustomEvent<PhotoGallerySlideChangeDetail>(\"slide-change\", {\n bubbles: true,\n composed: true,\n detail: this._pendingChange,\n }),\n );\n this._pendingChange = undefined;\n this._scheduleTransitionCleanup();\n }\n\n if (changed.has(\"currentIndex\") || changed.has(\"delay\") || changed.has(\"paused\") || this._itemsChanged) {\n this._itemsChanged = false;\n this._restartAutoplay();\n }\n this._activeItem = this._galleryItems[this.currentIndex];\n this._renderedIndex = this.currentIndex;\n }\n\n /** Wraps any requested index into the current item range. */\n private _normalizeIndex(index: number): number {\n const count = this._galleryItems.length;\n if (count === 0 || !Number.isFinite(index)) return 0;\n return ((Math.trunc(index) % count) + count) % count;\n }\n\n /** Returns responsive variants declared directly under an item. */\n private _variantsFor(item: GalleryItem): GalleryItemVariant[] {\n return Array.from(item.children).filter(\n (child): child is GalleryItemVariant => child.tagName.toLowerCase() === \"gallery-item-variant\",\n );\n }\n\n /** Changes slides through the shared state and event path. */\n private _goTo(index: number, reason: PhotoGalleryChangeReason): void {\n const normalized = this._normalizeIndex(index);\n if (this._galleryItems.length < 2 || normalized === this.currentIndex) {\n this._restartAutoplay();\n return;\n }\n\n this._nextChangeReason = reason;\n this.currentIndex = normalized;\n }\n\n /** Moves to the previous image. */\n private _showPrevious(reason: PhotoGalleryChangeReason = \"previous\"): void {\n this._goTo(this.currentIndex - 1, reason);\n }\n\n /** Moves to the next image. */\n private _showNext(reason: PhotoGalleryChangeReason = \"next\"): void {\n this._goTo(this.currentIndex + 1, reason);\n }\n\n /** Toggles explicit autoplay pause state. */\n private _togglePaused(): void {\n this.paused = !this.paused;\n }\n\n /** Clears and conditionally schedules the next autoplay advance. */\n private _restartAutoplay(): void {\n this._clearAutoplay();\n if (!this._canAutoplay()) return;\n\n this._autoplayTimer = window.setTimeout(() => {\n this._showNext(\"autoplay\");\n }, this.delay);\n }\n\n /** Reports whether autoplay may currently schedule a transition. */\n private _canAutoplay(): boolean {\n return (\n this.delay > 0 &&\n this._galleryItems.length > 1 &&\n !this.paused &&\n !this._hovered &&\n !this._focusWithin &&\n !document.hidden\n );\n }\n\n /** Clears the pending autoplay timeout. */\n private _clearAutoplay(): void {\n if (this._autoplayTimer === undefined) return;\n window.clearTimeout(this._autoplayTimer);\n this._autoplayTimer = undefined;\n }\n\n /** Removes the outgoing crossfade layer after the animation completes. */\n private _scheduleTransitionCleanup(): void {\n this._clearTransition();\n this._transitionTimer = window.setTimeout(() => {\n this._previousIndex = null;\n this._transitionTimer = undefined;\n }, transitionDurationMs);\n }\n\n /** Clears pending transition cleanup. */\n private _clearTransition(): void {\n if (this._transitionTimer === undefined) return;\n window.clearTimeout(this._transitionTimer);\n this._transitionTimer = undefined;\n }\n\n /** Refreshes item metadata and clamps the active index after light-DOM changes. */\n private _handleMetadataChange(): void {\n this._itemsChanged = true;\n this._itemsVersion += 1;\n const preserveActiveItem = this.currentIndex === this._renderedIndex;\n const preservedIndex =\n preserveActiveItem && this._activeItem ? this._galleryItems.indexOf(this._activeItem) : -1;\n const normalized = preservedIndex >= 0 ? preservedIndex : this._normalizeIndex(this.currentIndex);\n if (normalized === this.currentIndex) {\n const item = this._galleryItems[normalized];\n const activeItemRemoved = Boolean(this._activeItem && !this._galleryItems.includes(this._activeItem));\n if (item && activeItemRemoved) {\n this._previousIndex = null;\n this._pendingChange = {\n previousIndex: this._renderedIndex,\n currentIndex: normalized,\n item,\n reason: \"items\",\n };\n }\n return;\n }\n this._nextChangeReason = \"items\";\n this.currentIndex = normalized;\n }\n\n /** Refreshes item state after the default slot changes. */\n private _handleSlotChange(): void {\n this._handleMetadataChange();\n }\n\n /** Temporarily pauses autoplay while the pointer is over the gallery. */\n private _handleMouseEnter(): void {\n this._hovered = true;\n this._restartAutoplay();\n }\n\n /** Resumes autoplay with a fresh delay after hover ends. */\n private _handleMouseLeave(): void {\n this._hovered = false;\n this._restartAutoplay();\n }\n\n /** Temporarily pauses autoplay while focus is inside the gallery. */\n private _handleFocusIn(): void {\n this._focusWithin = true;\n this._restartAutoplay();\n }\n\n /** Resumes autoplay with a fresh delay after focus leaves the gallery. */\n private _handleFocusOut(): void {\n queueMicrotask(() => {\n this._focusWithin = this.matches(\":focus-within\");\n this._restartAutoplay();\n });\n }\n\n /** Pauses or resumes scheduling when page visibility changes. */\n private readonly _handleVisibilityChange = (): void => {\n this._restartAutoplay();\n };\n\n /** Handles Left and Right arrow keyboard navigation. */\n private _handleKeyDown(event: KeyboardEvent): void {\n if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n this._showPrevious(\"keyboard\");\n return;\n }\n if (event.key === \"ArrowRight\") {\n event.preventDefault();\n this._showNext(\"keyboard\");\n }\n }\n\n /** Records the starting point of a primary pointer gesture. */\n private _handlePointerDown(event: PointerEvent): void {\n if (!event.isPrimary || event.button !== 0) return;\n if (event.composedPath().some((target) => target instanceof HTMLButtonElement)) return;\n this._pointerStart = { id: event.pointerId, x: event.clientX, y: event.clientY };\n (event.currentTarget as HTMLElement).setPointerCapture(event.pointerId);\n }\n\n /** Converts a sufficiently horizontal pointer gesture into navigation. */\n private _handlePointerUp(event: PointerEvent): void {\n const start = this._pointerStart;\n this._pointerStart = undefined;\n if (!start || start.id !== event.pointerId) return;\n\n const deltaX = event.clientX - start.x;\n const deltaY = event.clientY - start.y;\n if (Math.abs(deltaX) < swipeThresholdPx || Math.abs(deltaX) <= Math.abs(deltaY)) return;\n\n event.preventDefault();\n if (deltaX < 0) {\n this._showNext(\"swipe\");\n return;\n }\n this._showPrevious(\"swipe\");\n }\n\n /** Cancels an incomplete pointer gesture. */\n private _handlePointerCancel(): void {\n this._pointerStart = undefined;\n }\n\n /** Renders one responsive image layer for the crossfade stack. */\n private _renderPicture(index: number, state: \"current\" | \"previous\") {\n const item = this._galleryItems[index];\n if (!item) return nothing;\n\n const isPrevious = state === \"previous\";\n const transitionClass = this._previousIndex === null ? \"\" : isPrevious ? \"leaving\" : \"entering\";\n return html`\n <picture class=${transitionClass} aria-hidden=${isPrevious ? \"true\" : nothing}>\n ${this._variantsFor(item)\n .filter((variant) => variant.srcset)\n .map(\n (variant) =>\n html`<source media=${ifDefined(variant.media || undefined)} srcset=${variant.srcset} />`,\n )}\n <img src=${item.src} alt=${isPrevious ? \"\" : item.alt} draggable=\"false\" />\n </picture>\n `;\n }\n\n /** Renders enabled counter, indicator, and autoplay controls. */\n private _renderFooter(itemCount: number) {\n const showIndicators = this.showIndicators && itemCount > 1;\n const showAutoplay = this.showAutoplayControl && this.delay > 0 && itemCount > 1;\n if (!this.showCounter && !showIndicators && !showAutoplay) return nothing;\n\n return html`\n <div class=\"footer\">\n ${this.showCounter\n ? html`<span class=\"counter\">${this.currentIndex + 1} / ${itemCount}</span>`\n : nothing}\n ${showIndicators\n ? html`\n <div class=\"indicators\" role=\"group\" aria-label=\"Choose image\">\n ${this._galleryItems.map(\n (_item, index) => html`\n <button\n class=\"indicator\"\n type=\"button\"\n aria-label=\"Show image ${index + 1} of ${itemCount}\"\n aria-current=${String(index === this.currentIndex)}\n @click=${() => this._goTo(index, \"indicator\")}\n ></button>\n `,\n )}\n </div>\n `\n : nothing}\n ${showAutoplay\n ? html`\n <button\n class=\"autoplay-button\"\n type=\"button\"\n aria-label=${this.paused ? \"Resume slideshow\" : \"Pause slideshow\"}\n @click=${this._togglePaused}\n >\n ${this.paused ? \"Play\" : \"Pause\"}\n </button>\n `\n : nothing}\n </div>\n `;\n }\n\n /** Renders the active image, navigation, caption, and hidden metadata slot. */\n protected override render() {\n const itemCount = this._galleryItems.length;\n const currentItem = this._galleryItems[this.currentIndex];\n // Reserve the caption row for every slide as soon as any slide has a\n // caption, so the gallery's total height stays constant while it cycles\n // (a slide without a caption no longer collapses the box and shifts the\n // page below it).\n const hasCaptions = this._galleryItems.some((item) => item.caption);\n const objectFit: PhotoGalleryObjectFit = this.objectFit === \"contain\" ? \"contain\" : \"cover\";\n const viewportStyles = {\n \"--photo-gallery-aspect-ratio\": this.aspectRatio.trim() || \"16 / 9\",\n \"--photo-gallery-object-fit\": objectFit,\n };\n\n return html`\n <div\n class=\"gallery\"\n role=\"region\"\n aria-roledescription=\"carousel\"\n aria-label=\"Photo gallery\"\n tabindex=\"0\"\n @keydown=${this._handleKeyDown}\n @mouseenter=${this._handleMouseEnter}\n @mouseleave=${this._handleMouseLeave}\n @focusin=${this._handleFocusIn}\n @focusout=${this._handleFocusOut}\n >\n ${currentItem\n ? html`\n <figure>\n <div\n class=\"viewport\"\n style=${styleMap(viewportStyles)}\n @pointerdown=${this._handlePointerDown}\n @pointerup=${this._handlePointerUp}\n @pointercancel=${this._handlePointerCancel}\n >\n <div class=\"slides\">\n ${this._previousIndex === null\n ? nothing\n : this._renderPicture(this._previousIndex, \"previous\")}\n ${this._renderPicture(this.currentIndex, \"current\")}\n </div>\n ${this.showControls && itemCount > 1\n ? html`\n <div class=\"arrow-controls\">\n <button\n class=\"arrow-button previous\"\n type=\"button\"\n aria-label=\"Previous image\"\n @click=${() => this._showPrevious()}\n >\n ${iconChevronLeft(18)}\n </button>\n <button\n class=\"arrow-button next\"\n type=\"button\"\n aria-label=\"Next image\"\n @click=${() => this._showNext()}\n >\n ${iconChevronRight(18)}\n </button>\n </div>\n `\n : nothing}\n </div>\n ${hasCaptions\n ? html`<figcaption>${currentItem.caption}</figcaption>`\n : nothing}\n </figure>\n ${this._renderFooter(itemCount)}\n `\n : nothing}\n <slot @slotchange=${this._handleSlotChange}></slot>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"photo-gallery\": PhotoGallery;\n }\n}\n"]}
|
package/dist/radio-pills.js
CHANGED
|
@@ -55,7 +55,7 @@ let RadioPills = class RadioPills extends LitElement {
|
|
|
55
55
|
box-sizing: border-box;
|
|
56
56
|
padding: 0.25rem 0.5rem;
|
|
57
57
|
border: 1px solid var(--ui-border, #e2e8f0);
|
|
58
|
-
border-radius:
|
|
58
|
+
border-radius: var(--ui-radius-pill, 9999px);
|
|
59
59
|
cursor: pointer;
|
|
60
60
|
font-family: var(
|
|
61
61
|
--ui-font,
|
package/dist/radio-pills.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-pills.js","sourceRoot":"","sources":["../src/radio-pills.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAOrC,IAAI,aAAa,GAAG,CAAC,CAAC;AAEtB;;;;;;;;;;;;;;;GAeG;AAEI,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,UAAU;IAAnC;;QA+EL,wCAAwC;QACR,YAAO,GAAsB,EAAE,CAAC;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AkB;AApFnC,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CAoHtB","sourcesContent":["import { LitElement, css, html } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { repeat } from \"lit/directives/repeat.js\";\nimport { tokens } from \"./tokens.js\";\n\nexport interface RadioPillOption {\n value: string;\n label: string;\n}\n\nlet instanceCount = 0;\n\n/**\n * Single-select group of compact pill-shaped options — for many short,\n * same-shaped choices (a basemap style, a unit toggle). For a handful of\n * choices where a description matters, use `radio-cards` instead. Wraps\n * native radio inputs for keyboard/a11y and fires `change` rather than\n * relying on form submission.\n *\n * The selected pill's border/radio dot read `--ui-button-accent` (a solid\n * stand-in, since `border-color`/`accent-color` can't render a gradient),\n * and its background reads the shared `--ui-button-secondary-surface-muted`\n * plus `--ui-button-highlight`, so a gradient theme tints it consistently\n * with `button-group`/`pagination-nav`'s equivalents.\n *\n * @element radio-pills\n * @fires change - A pill was selected; detail: { value }.\n */\n@customElement(\"radio-pills\")\nexport class RadioPills extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n }\n .options {\n display: flex;\n flex-wrap: wrap;\n gap: 0.5rem;\n }\n .pill {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n min-height: 2rem;\n box-sizing: border-box;\n padding: 0.25rem 0.5rem;\n border: 1px solid var(--ui-border, #e2e8f0);\n border-radius:
|
|
1
|
+
{"version":3,"file":"radio-pills.js","sourceRoot":"","sources":["../src/radio-pills.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAOrC,IAAI,aAAa,GAAG,CAAC,CAAC;AAEtB;;;;;;;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EAAE,CAAC;2CAAiC;AAEpD;IAAX,QAAQ,EAAE;yCAAY;AAEM;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;4CAAkB;AApFnC,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CAoHtB","sourcesContent":["import { LitElement, css, html } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { repeat } from \"lit/directives/repeat.js\";\nimport { tokens } from \"./tokens.js\";\n\nexport interface RadioPillOption {\n value: string;\n label: string;\n}\n\nlet instanceCount = 0;\n\n/**\n * Single-select group of compact pill-shaped options — for many short,\n * same-shaped choices (a basemap style, a unit toggle). For a handful of\n * choices where a description matters, use `radio-cards` instead. Wraps\n * native radio inputs for keyboard/a11y and fires `change` rather than\n * relying on form submission.\n *\n * The selected pill's border/radio dot read `--ui-button-accent` (a solid\n * stand-in, since `border-color`/`accent-color` can't render a gradient),\n * and its background reads the shared `--ui-button-secondary-surface-muted`\n * plus `--ui-button-highlight`, so a gradient theme tints it consistently\n * with `button-group`/`pagination-nav`'s equivalents.\n *\n * @element radio-pills\n * @fires change - A pill was selected; detail: { value }.\n */\n@customElement(\"radio-pills\")\nexport class RadioPills extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n }\n .options {\n display: flex;\n flex-wrap: wrap;\n gap: 0.5rem;\n }\n .pill {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n min-height: 2rem;\n box-sizing: border-box;\n padding: 0.25rem 0.5rem;\n border: 1px solid var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius-pill, 9999px);\n cursor: pointer;\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n font-size: var(--ui-font-size-sm, 0.75rem);\n line-height: var(--ui-line-height-tight, 1.25);\n color: var(--ui-text, #0f172a);\n }\n .pill:has(input:checked) {\n border-color: var(--ui-button-accent, var(--ui-primary, #4f46e5));\n background: var(--ui-button-secondary-surface-muted, var(--ui-surface-muted, #f8fafc));\n box-shadow: var(--ui-button-highlight, 0 0 0 0 transparent);\n }\n .pill input {\n width: 1rem;\n height: 1rem;\n accent-color: var(--ui-button-accent, var(--ui-primary, #4f46e5));\n cursor: pointer;\n margin: 0;\n }\n .pill:has(input:focus-visible) {\n outline: none;\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n .pill:has(input:checked):has(input:focus-visible) {\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35)), var(--ui-button-highlight, 0 0 0 0 transparent);\n }\n .pill:has(input:disabled) {\n cursor: not-allowed;\n opacity: 0.6;\n }\n .pill:has(input:disabled) input {\n cursor: not-allowed;\n }\n @media (forced-colors: active) {\n .pill:has(input:focus-visible) {\n outline: 2px solid CanvasText;\n outline-offset: 2px;\n box-shadow: none;\n }\n .pill:has(input:checked) {\n border-color: Highlight;\n }\n .pill:has(input:disabled) {\n color: GrayText;\n opacity: 1;\n }\n }\n `,\n ];\n\n /** Options to render, one pill each. */\n @property({ attribute: false }) options: RadioPillOption[] = [];\n /** Currently selected value. */\n @property() value = \"\";\n /** Disables every native radio in the group. */\n @property({ type: Boolean }) disabled = false;\n\n readonly #name = `radio-pills-${++instanceCount}`;\n\n private _onChange(value: string) {\n if (this.disabled) return;\n this.value = value;\n this.dispatchEvent(new CustomEvent(\"change\", { detail: { value }, bubbles: true, composed: true }));\n }\n\n override render() {\n return html`\n <div class=\"options\">\n ${repeat(\n this.options,\n (opt) => opt.value,\n (opt) => html`\n <label class=\"pill\">\n <input\n type=\"radio\"\n name=${this.#name}\n ?checked=${this.value === opt.value}\n ?disabled=${this.disabled}\n @change=${() => this._onChange(opt.value)}\n />\n <span>${opt.label}</span>\n </label>\n `,\n )}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"radio-pills\": RadioPills;\n }\n}\n"]}
|