@f-ewald/components 1.23.0 → 1.24.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.
Files changed (97) hide show
  1. package/README.md +7 -1
  2. package/custom-elements.json +1966 -643
  3. package/dist/address-autocomplete.d.ts.map +1 -1
  4. package/dist/address-autocomplete.js +7 -3
  5. package/dist/address-autocomplete.js.map +1 -1
  6. package/dist/audio-player.d.ts +53 -0
  7. package/dist/audio-player.d.ts.map +1 -0
  8. package/dist/audio-player.js +267 -0
  9. package/dist/audio-player.js.map +1 -0
  10. package/dist/autocomplete-input.d.ts.map +1 -1
  11. package/dist/autocomplete-input.js +7 -3
  12. package/dist/autocomplete-input.js.map +1 -1
  13. package/dist/button-group.d.ts +12 -1
  14. package/dist/button-group.d.ts.map +1 -1
  15. package/dist/button-group.js +35 -3
  16. package/dist/button-group.js.map +1 -1
  17. package/dist/comment-composer.d.ts +54 -0
  18. package/dist/comment-composer.d.ts.map +1 -0
  19. package/dist/comment-composer.js +244 -0
  20. package/dist/comment-composer.js.map +1 -0
  21. package/dist/confirm-dialog.d.ts +4 -1
  22. package/dist/confirm-dialog.d.ts.map +1 -1
  23. package/dist/confirm-dialog.js +47 -9
  24. package/dist/confirm-dialog.js.map +1 -1
  25. package/dist/dropdown-button.d.ts +4 -1
  26. package/dist/dropdown-button.d.ts.map +1 -1
  27. package/dist/dropdown-button.js +29 -3
  28. package/dist/dropdown-button.js.map +1 -1
  29. package/dist/icons.d.ts +65 -0
  30. package/dist/icons.d.ts.map +1 -1
  31. package/dist/icons.js +65 -0
  32. package/dist/icons.js.map +1 -1
  33. package/dist/index.d.ts +4 -1
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +4 -1
  36. package/dist/index.js.map +1 -1
  37. package/dist/mcp-server.js +39 -0
  38. package/dist/mcp-server.js.map +1 -1
  39. package/dist/page-header.d.ts +8 -3
  40. package/dist/page-header.d.ts.map +1 -1
  41. package/dist/page-header.js +33 -12
  42. package/dist/page-header.js.map +1 -1
  43. package/dist/pagination-nav.d.ts +7 -0
  44. package/dist/pagination-nav.d.ts.map +1 -1
  45. package/dist/pagination-nav.js +19 -4
  46. package/dist/pagination-nav.js.map +1 -1
  47. package/dist/radio-cards.d.ts +6 -0
  48. package/dist/radio-cards.d.ts.map +1 -1
  49. package/dist/radio-cards.js +13 -3
  50. package/dist/radio-cards.js.map +1 -1
  51. package/dist/radio-pills.d.ts +6 -0
  52. package/dist/radio-pills.d.ts.map +1 -1
  53. package/dist/radio-pills.js +13 -3
  54. package/dist/radio-pills.js.map +1 -1
  55. package/dist/range-slider.d.ts.map +1 -1
  56. package/dist/range-slider.js +11 -7
  57. package/dist/range-slider.js.map +1 -1
  58. package/dist/reveal-button.d.ts +5 -1
  59. package/dist/reveal-button.d.ts.map +1 -1
  60. package/dist/reveal-button.js +26 -4
  61. package/dist/reveal-button.js.map +1 -1
  62. package/dist/tokens.css +17 -0
  63. package/dist/tokens.d.ts.map +1 -1
  64. package/dist/tokens.js +56 -0
  65. package/dist/tokens.js.map +1 -1
  66. package/dist/ui-button.d.ts +16 -0
  67. package/dist/ui-button.d.ts.map +1 -1
  68. package/dist/ui-button.js +48 -7
  69. package/dist/ui-button.js.map +1 -1
  70. package/dist/utils/duration.d.ts +8 -0
  71. package/dist/utils/duration.d.ts.map +1 -1
  72. package/dist/utils/duration.js +18 -0
  73. package/dist/utils/duration.js.map +1 -1
  74. package/dist/utils/transport-controls.d.ts +11 -0
  75. package/dist/utils/transport-controls.d.ts.map +1 -0
  76. package/dist/utils/transport-controls.js +113 -0
  77. package/dist/utils/transport-controls.js.map +1 -0
  78. package/dist/video-player.d.ts +60 -0
  79. package/dist/video-player.d.ts.map +1 -0
  80. package/dist/video-player.js +324 -0
  81. package/dist/video-player.js.map +1 -0
  82. package/docs/audio-player.md +60 -0
  83. package/docs/button-group.md +18 -1
  84. package/docs/comment-composer.md +68 -0
  85. package/docs/confirm-dialog.md +19 -1
  86. package/docs/dropdown-button.md +10 -1
  87. package/docs/icons.md +75 -0
  88. package/docs/page-header.md +11 -4
  89. package/docs/pagination-nav.md +14 -0
  90. package/docs/radio-cards.md +9 -0
  91. package/docs/radio-pills.md +9 -0
  92. package/docs/range-slider.md +3 -0
  93. package/docs/reveal-button.md +11 -1
  94. package/docs/ui-button.md +32 -0
  95. package/docs/video-player.md +59 -0
  96. package/llms.txt +224 -23
  97. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"autocomplete-input.js","sourceRoot":"","sources":["../src/autocomplete-input.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EACL,gBAAgB,GAEjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,IAAI,aAAa,GAAG,CAAC,CAAC;AAQtB;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEI,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,UAAU;IAA1C;;QAiNL,mFAAmF;QACvE,UAAK,GAAG,EAAE,CAAC;QACvB,sDAAsD;QAC1C,gBAAW,GAAG,EAAE,CAAC;QAC7B,8DAA8D;QACjC,aAAQ,GAAG,KAAK,CAAC;QAC9C,0DAA0D;QACd,aAAQ,GAAG,KAAK,CAAC;QAC7D,oEAAoE;QACxB,cAAS,GAAG,KAAK,CAAC;QAC9D,uEAAuE;QAC3D,aAAQ,GAAG,EAAE,CAAC;QAC1B,wEAAwE;QAChC,eAAU,GAAG,GAAG,CAAC;QACzD,uEAAuE;QAC3C,a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AAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;mDAAkB;AAEjB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;oDAAmB;AAElD;IAAX,QAAQ,EAAE;mDAAe;AAEc;IAAvC,QAAQ,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;qDAAkB;AAE7B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAAgB;AAEU;IAApD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;oDAAe;AAMnC;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;kDAA6C;AAE3D;IAAhB,KAAK,EAAE;uDAAiD;AACxC;IAAhB,KAAK,EAAE;gDAAuB;AACd;IAAhB,KAAK,EAAE;uDAA2B;AAClB;IAAhB,KAAK,EAAE;wDAA+B;AACtB;IAAhB,KAAK,EAAE;2DAAgE;AAEhD;IAAvB,KAAK,CAAC,OAAO,CAAC;iDAAmC;AAhPvC,iBAAiB;IAD7B,aAAa,CAAC,oBAAoB,CAAC;GACvB,iBAAiB,CA0jB7B","sourcesContent":["import { LitElement, css, html, nothing, type PropertyValues } from \"lit\";\nimport { customElement, property, query, state } from \"lit/decorators.js\";\nimport { iconX } from \"./icons.js\";\nimport { tokens } from \"./tokens.js\";\nimport {\n formFieldControl,\n type FormFieldControlConfig,\n} from \"./utils/form-field-control.js\";\nimport { submitWithDefaultButton } from \"./utils/form.js\";\n\nlet instanceCount = 0;\n\n/** A single autocomplete candidate: an opaque `key` plus its display `value`. */\nexport interface AutocompleteOption {\n key: string;\n value: string;\n}\n\n/**\n * Generic form-associated text input with a suggestion dropdown, for any\n * \"type to filter a list of `{key, value}` options\" use case. Works as a\n * drop-in replacement for a plain `<input>` inside a `<form>`: set `name` on\n * the element itself and consumers keep reading\n * `new FormData(form).get(name)` and calling `form.reset()` unchanged — the\n * submitted value is the picked option's `value`, while `key` is available\n * via the `option-select` event and the `selectedOption` getter for cases\n * that need the underlying id rather than the display text.\n *\n * Supports two suggestion sources:\n * - **API**: set `endpoint` to a URL that, given a `?<query-param>=<text>`\n * query string, responds with a JSON array of `{key, value}` objects.\n * Requests are debounced as the user types.\n * - **Local array**: set `options` to a fixed `AutocompleteOption[]` and the\n * component filters it client-side instead of making any network\n * request. Useful for small/fixed lists, offline use, or tests. Takes\n * priority over `endpoint` whenever it's non-null.\n *\n * Set `clearable` to show an in-field clear action whenever a value is\n * present.\n *\n * @element autocomplete-input\n * @fires option-select - An option was picked; detail: AutocompleteOption.\n * @fires input - Native-compatible input event fired while editing or clearing.\n */\n@customElement(\"autocomplete-input\")\nexport class AutocompleteInput extends LitElement {\n static formAssociated = true;\n\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n position: relative;\n }\n .field-shell {\n position: relative;\n }\n input {\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 background: var(--ui-surface, #ffffff);\n padding: 0.5rem 0.75rem;\n border: 1px solid var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius-sm, 0.25rem);\n width: 100%;\n height: 2rem;\n box-sizing: border-box;\n }\n .field-shell.clearable input {\n padding-right: 2rem;\n }\n .clear-button {\n position: absolute;\n top: 0;\n right: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 2rem;\n height: 2rem;\n padding: 0;\n border: 0;\n border-radius: var(--ui-radius-sm, 0.25rem);\n color: var(--ui-text-muted, #64748b);\n background: transparent;\n cursor: pointer;\n line-height: 0;\n }\n .clear-button:hover {\n color: var(--ui-text, #0f172a);\n background: var(--ui-surface-muted, #f8fafc);\n }\n .clear-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 .floating-label {\n position: absolute;\n top: 50%;\n left: 0.75rem;\n right: 0.75rem;\n z-index: 1;\n display: flex;\n align-items: baseline;\n gap: 0.25rem;\n overflow: hidden;\n transform: translateY(-50%);\n color: var(--ui-text-muted, #64748b);\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 font-weight: var(--ui-font-weight-regular, 400);\n line-height: var(--ui-line-height-tight, 1.25);\n white-space: nowrap;\n text-overflow: ellipsis;\n cursor: text;\n transition:\n top 150ms ease,\n transform 150ms ease,\n font-size 150ms ease;\n }\n .field-shell.clearable .floating-label {\n right: 2rem;\n }\n .field-shell.floating input {\n height: 3rem;\n padding-top: 1.25rem;\n padding-bottom: 0.25rem;\n }\n .field-shell.floating .clear-button {\n top: 0.5rem;\n }\n .field-shell.floating.has-value .floating-label,\n .field-shell.floating:focus-within .floating-label {\n top: 0.25rem;\n transform: none;\n font-size: var(--ui-font-size-xs, 0.6875rem);\n }\n .field-shell.floating:not(.has-value):not(:focus-within) input::placeholder {\n opacity: 0;\n }\n .field-shell.disabled .floating-label {\n cursor: not-allowed;\n opacity: 0.6;\n }\n .required-mark {\n flex: 0 0 auto;\n color: var(--ui-danger, #dc2626);\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 input:disabled {\n cursor: not-allowed;\n opacity: 0.6;\n }\n input: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 .suggestions {\n position: absolute;\n top: 100%;\n left: 0;\n right: 0;\n z-index: 10;\n max-height: 40vh;\n overflow-y: auto;\n margin: 0.25rem 0 0;\n padding: 0.25rem 0;\n list-style: none;\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 .suggestion {\n padding: 0.5rem 0.75rem;\n font-size: var(--ui-font-size-sm, 0.75rem);\n cursor: pointer;\n }\n .suggestion.active,\n .suggestion:hover {\n background: var(--ui-surface-muted, #f8fafc);\n }\n .no-suggestions {\n padding: 0.5rem 0.75rem;\n color: var(--ui-text-muted, #64748b);\n font-size: var(--ui-font-size-sm, 0.75rem);\n font-style: italic;\n }\n @media (forced-colors: active) {\n input:focus-visible {\n outline: 2px solid CanvasText;\n outline-offset: 2px;\n box-shadow: none;\n }\n input:disabled {\n color: GrayText;\n opacity: 1;\n }\n .clear-button:focus-visible {\n outline: 2px solid CanvasText;\n outline-offset: -2px;\n box-shadow: none;\n }\n .field-shell.disabled .floating-label {\n color: GrayText;\n opacity: 1;\n }\n .suggestion.active,\n .suggestion:hover {\n color: HighlightText;\n background: Highlight;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n .floating-label {\n transition: none;\n }\n }\n `,\n ];\n\n /** Current input value; also the form-associated value submitted with the form. */\n @property() value = \"\";\n /** Placeholder text shown when the input is empty. */\n @property() placeholder = \"\";\n /** Marks the input as required for native form validation. */\n @property({ type: Boolean }) required = false;\n /** Disables the input and closes its suggestion popup. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n /** Shows an in-field clear action while the control has a value. */\n @property({ type: Boolean, reflect: true }) clearable = false;\n /** API endpoint queried in API mode. Ignored when `options` is set. */\n @property() endpoint = \"\";\n /** Query string parameter name the current input text is sent under. */\n @property({ attribute: \"query-param\" }) queryParam = \"q\";\n /** Debounce delay (ms) before firing a request/filter after typing. */\n @property({ type: Number }) debounce = 300;\n /** Minimum query length before suggestions are shown. */\n @property({ type: Number, attribute: \"min-length\" }) minLength = 3;\n /**\n * Fixed candidate list to filter locally instead of fetching from\n * `endpoint`. When set (non-null), no network request is ever made —\n * this takes priority over the API mode.\n */\n @property({ attribute: false }) options: AutocompleteOption[] | null = null;\n\n @state() private _suggestions: AutocompleteOption[] = [];\n @state() private _open = false;\n @state() private _activeIndex = -1;\n @state() private _formDisabled = false;\n @state() private _formFieldConfig: FormFieldControlConfig | null = null;\n\n @query(\"input\") private _input?: HTMLInputElement;\n\n #internals = this.attachInternals();\n #lastPicked: AutocompleteOption | null = null;\n #debounceTimer: ReturnType<typeof setTimeout> | null = null;\n #abortController: AbortController | null = null;\n #isComposing = false;\n #compositionJustEnded = false;\n #compositionEndTimer: ReturnType<typeof setTimeout> | null = null;\n readonly #inputId = `autocomplete-input-field-${++instanceCount}`;\n readonly #listboxId = `autocomplete-input-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 /** Last-picked option, or null once the input diverges from it. */\n get selectedOption(): AutocompleteOption | null {\n if (this.#lastPicked && this.#lastPicked.value === this.value) return this.#lastPicked;\n return null;\n }\n\n /**\n * Applies or clears label configuration supplied by a wrapping `form-field`.\n * @private\n */\n [formFieldControl](config: FormFieldControlConfig | null): void {\n this._formFieldConfig = config;\n }\n\n protected override willUpdate(changed: PropertyValues) {\n if (changed.has(\"disabled\") && this.#isDisabled) {\n if (this.#debounceTimer) clearTimeout(this.#debounceTimer);\n this.#resetComposition();\n this.#abortController?.abort();\n this._open = false;\n this._activeIndex = -1;\n }\n }\n\n protected override updated(changed: PropertyValues) {\n if (changed.has(\"value\")) this.#internals.setFormValue(this.value);\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n if (this.#debounceTimer) clearTimeout(this.#debounceTimer);\n this.#resetComposition();\n this.#abortController?.abort();\n }\n\n /** Resets to empty on `form.reset()`, per the form-associated custom element contract. */\n formResetCallback() {\n this.value = \"\";\n this._suggestions = [];\n this._open = false;\n this.#lastPicked = null;\n }\n\n /** Mirrors ancestor fieldset disabled state onto the native input. */\n formDisabledCallback(disabled: boolean) {\n this._formDisabled = disabled;\n if (!disabled) return;\n if (this.#debounceTimer) clearTimeout(this.#debounceTimer);\n this.#resetComposition();\n this.#abortController?.abort();\n this._open = false;\n this._activeIndex = -1;\n }\n\n private onInput(e: InputEvent) {\n if (this.#isDisabled) return;\n this.value = (e.target as HTMLInputElement).value;\n this.#lastPicked = null;\n this.#scheduleFetch(this.value);\n }\n\n #scheduleFetch(query: string) {\n if (this.#isDisabled) return;\n if (this.#debounceTimer) clearTimeout(this.#debounceTimer);\n if (query.trim().length < this.minLength) {\n this._suggestions = [];\n this._open = false;\n this._activeIndex = -1;\n return;\n }\n if (this.options) {\n // Local mode: filtering is synchronous and cheap, but keep the same\n // debounce as the API mode so the UX doesn't shift between sources.\n this.#debounceTimer = setTimeout(() => this.#filterLocalOptions(query), this.debounce);\n return;\n }\n this.#debounceTimer = setTimeout(() => void this.#fetchOptions(query), this.debounce);\n }\n\n /** Filters the locally-supplied `options` list for `query`, case-insensitively. */\n #filterLocalOptions(query: string) {\n const needle = query.trim().toLowerCase();\n this._suggestions = (this.options ?? [])\n .filter((o) => o.value.toLowerCase().includes(needle))\n .slice(0, 5);\n this._activeIndex = -1;\n this._open = !this.#isDisabled;\n }\n\n /** Fetches options for `query` from `endpoint`, cancelling any request still in flight. */\n async #fetchOptions(query: string) {\n this.#abortController?.abort();\n const controller = new AbortController();\n this.#abortController = controller;\n try {\n const res = await fetch(this.#buildUrl(query), { signal: controller.signal });\n if (!res.ok) throw new Error(`autocomplete request failed: ${res.status}`);\n if (this.#isDisabled) return;\n this._suggestions = ((await res.json()) as AutocompleteOption[]).slice(0, 5);\n this._activeIndex = -1;\n this._open = true;\n } catch {\n // Aborted (superseded by newer keystroke) or a network failure while\n // typing — fail silently and just close the list.\n if (!controller.signal.aborted) {\n this._suggestions = [];\n this._open = false;\n }\n }\n }\n\n #buildUrl(query: string): string {\n const params = new URLSearchParams({ [this.queryParam]: query });\n return `${this.endpoint}?${params.toString()}`;\n }\n\n private onKeydown(e: KeyboardEvent) {\n if (this.#isDisabled) return;\n if (e.isComposing || e.keyCode === 229 || this.#isComposing || this.#compositionJustEnded) {\n return;\n }\n if (e.key === \"ArrowDown\") this.#moveActive(1, e);\n else if (e.key === \"ArrowUp\") this.#moveActive(-1, e);\n else if (e.key === \"Enter\") this.#handleEnter(e);\n else if (e.key === \"Escape\") this.#handleEscape(e);\n }\n\n #moveActive(delta: number, e: KeyboardEvent) {\n if (!this._open || this._suggestions.length === 0) return;\n e.preventDefault();\n const n = this._suggestions.length;\n this._activeIndex = (this._activeIndex + delta + n) % n;\n }\n\n #handleEnter(e: KeyboardEvent) {\n const pick = this._suggestions[this._activeIndex] ?? this._suggestions[0];\n if (this._open && pick) {\n e.preventDefault();\n this.#selectOption(pick);\n return;\n }\n if (this.#internals.form) {\n const form = this.#internals.form;\n window.setTimeout(() => {\n if (!e.defaultPrevented && form.isConnected) submitWithDefaultButton(form);\n });\n }\n }\n\n #handleEscape(e: KeyboardEvent) {\n if (!this._open) return;\n e.preventDefault();\n this._open = false;\n }\n\n private onBlur() {\n this._open = false;\n }\n\n private onCompositionStart(): void {\n if (this.#compositionEndTimer) clearTimeout(this.#compositionEndTimer);\n this.#compositionEndTimer = null;\n this.#compositionJustEnded = false;\n this.#isComposing = true;\n }\n\n private 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 /** Clears composition state when the control can no longer receive keys. */\n #resetComposition(): void {\n if (this.#compositionEndTimer) clearTimeout(this.#compositionEndTimer);\n this.#compositionEndTimer = null;\n this.#isComposing = false;\n this.#compositionJustEnded = false;\n }\n\n #selectOption(o: AutocompleteOption) {\n this.value = o.value;\n this.#lastPicked = o;\n this._open = false;\n this._suggestions = [];\n this.dispatchEvent(new CustomEvent<AutocompleteOption>(\"option-select\", { detail: o, bubbles: true, composed: true }));\n }\n\n /** Clears the field and all pending autocomplete state, then restores input focus. */\n #clear(): void {\n if (this.#isDisabled || !this.value) return;\n if (this.#debounceTimer) clearTimeout(this.#debounceTimer);\n this.#debounceTimer = null;\n this.#abortController?.abort();\n this.#abortController = null;\n this.#resetComposition();\n this.value = \"\";\n this.#lastPicked = null;\n this._suggestions = [];\n this._activeIndex = -1;\n this._open = false;\n this.#internals.setFormValue(\"\");\n this.dispatchEvent(\n new InputEvent(\"input\", {\n bubbles: true,\n composed: true,\n inputType: \"deleteContentBackward\",\n }),\n );\n this._input?.focus({ preventScroll: true });\n }\n\n /** Selects on mousedown (not click) so it wins over the input's blur, which closes the list. */\n #onSuggestionMousedown(e: MouseEvent, o: AutocompleteOption) {\n e.preventDefault();\n this.#selectOption(o);\n }\n\n private renderSuggestions() {\n if (!this._open || this.#isDisabled) return nothing;\n return html`\n <ul id=${this.#listboxId} class=\"suggestions\" role=\"listbox\" aria-label=\"Suggestions\">\n ${this._suggestions.map(\n (o, i) => html`\n <li\n id=${`${this.#listboxId}-option-${i}`}\n role=\"option\"\n aria-selected=${i === this._activeIndex}\n class=\"suggestion ${i === this._activeIndex ? \"active\" : \"\"}\"\n @mousedown=${(e: MouseEvent) => this.#onSuggestionMousedown(e, o)}\n >\n ${o.value}\n </li>\n `,\n )}\n ${this._suggestions.length === 0\n ? html`<li class=\"no-suggestions\" role=\"presentation\">\n <span role=\"status\">No suggestions found</span>\n </li>`\n : nothing}\n </ul>\n `;\n }\n\n override render() {\n const activeDescendant =\n this._open && !this.#isDisabled && this._activeIndex >= 0\n ? `${this.#listboxId}-option-${this._activeIndex}`\n : nothing;\n const expanded = this._open && !this.#isDisabled;\n const floating =\n Boolean(this._formFieldConfig?.floating) && Boolean(this._formFieldConfig?.label);\n const showClear = this.clearable && Boolean(this.value) && !this.#isDisabled;\n return html`\n <div\n class=\"field-shell ${this.clearable ? \"clearable\" : \"\"} ${floating\n ? \"floating\"\n : \"\"} ${this.value ? \"has-value\" : \"\"} ${this.#isDisabled ? \"disabled\" : \"\"}\"\n >\n ${floating\n ? html`\n <label class=\"floating-label\" for=${this.#inputId}>\n <span>${this._formFieldConfig!.label}</span>\n ${this._formFieldConfig!.required\n ? html`\n <span class=\"required-mark\" aria-hidden=\"true\">*</span>\n <span class=\"sr-only\"> (required)</span>\n `\n : nothing}\n </label>\n `\n : nothing}\n <input\n id=${this.#inputId}\n type=\"text\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-expanded=${expanded}\n aria-controls=${this.#listboxId}\n aria-activedescendant=${activeDescendant}\n .value=${this.value}\n placeholder=${this.placeholder}\n ?required=${this.required}\n ?disabled=${this.#isDisabled}\n autocomplete=\"off\"\n @input=${this.onInput}\n @compositionstart=${this.onCompositionStart}\n @compositionend=${this.onCompositionEnd}\n @keydown=${this.onKeydown}\n @blur=${this.onBlur}\n />\n ${showClear\n ? html`\n <button\n type=\"button\"\n class=\"clear-button\"\n aria-label=\"Clear input\"\n title=\"Clear input\"\n @mousedown=${(event: MouseEvent) => event.preventDefault()}\n @click=${() => this.#clear()}\n >\n ${iconX(18)}\n </button>\n `\n : nothing}\n ${this.renderSuggestions()}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"autocomplete-input\": AutocompleteInput;\n }\n}\n"]}
1
+ {"version":3,"file":"autocomplete-input.js","sourceRoot":"","sources":["../src/autocomplete-input.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,Q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AE,SAAS,EAAE,KAAK,EAAE,CAAC;kDAA6C;AAE3D;IAAhB,KAAK,EAAE;uDAAiD;AACxC;IAAhB,KAAK,EAAE;gDAAuB;AACd;IAAhB,KAAK,EAAE;uDAA2B;AAClB;IAAhB,KAAK,EAAE;wDAA+B;AACtB;IAAhB,KAAK,EAAE;2DAAgE;AAEhD;IAAvB,KAAK,CAAC,OAAO,CAAC;iDAAmC;AApPvC,iBAAiB;IAD7B,aAAa,CAAC,oBAAoB,CAAC;GACvB,iBAAiB,CA8jB7B","sourcesContent":["import { LitElement, css, html, nothing, type PropertyValues } from \"lit\";\nimport { customElement, property, query, state } from \"lit/decorators.js\";\nimport { iconX } from \"./icons.js\";\nimport { tokens } from \"./tokens.js\";\nimport {\n formFieldControl,\n type FormFieldControlConfig,\n} from \"./utils/form-field-control.js\";\nimport { submitWithDefaultButton } from \"./utils/form.js\";\n\nlet instanceCount = 0;\n\n/** A single autocomplete candidate: an opaque `key` plus its display `value`. */\nexport interface AutocompleteOption {\n key: string;\n value: string;\n}\n\n/**\n * Generic form-associated text input with a suggestion dropdown, for any\n * \"type to filter a list of `{key, value}` options\" use case. Works as a\n * drop-in replacement for a plain `<input>` inside a `<form>`: set `name` on\n * the element itself and consumers keep reading\n * `new FormData(form).get(name)` and calling `form.reset()` unchanged — the\n * submitted value is the picked option's `value`, while `key` is available\n * via the `option-select` event and the `selectedOption` getter for cases\n * that need the underlying id rather than the display text.\n *\n * Supports two suggestion sources:\n * - **API**: set `endpoint` to a URL that, given a `?<query-param>=<text>`\n * query string, responds with a JSON array of `{key, value}` objects.\n * Requests are debounced as the user types.\n * - **Local array**: set `options` to a fixed `AutocompleteOption[]` and the\n * component filters it client-side instead of making any network\n * request. Useful for small/fixed lists, offline use, or tests. Takes\n * priority over `endpoint` whenever it's non-null.\n *\n * Set `clearable` to show an in-field clear action whenever a value is\n * present.\n *\n * @element autocomplete-input\n * @fires option-select - An option was picked; detail: AutocompleteOption.\n * @fires input - Native-compatible input event fired while editing or clearing.\n */\n@customElement(\"autocomplete-input\")\nexport class AutocompleteInput extends LitElement {\n static formAssociated = true;\n\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n position: relative;\n }\n .field-shell {\n position: relative;\n }\n input {\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 background: var(--ui-surface, #ffffff);\n padding: 0.5rem 0.75rem;\n border: 1px solid var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius-sm, 0.25rem);\n width: 100%;\n height: 2rem;\n box-sizing: border-box;\n }\n .field-shell.clearable input {\n padding-right: 2rem;\n }\n .clear-button {\n position: absolute;\n top: 0;\n right: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n width: 2rem;\n height: 2rem;\n /* Insets the hover/focus background by the input's 1px border so it\n stays fully inside the field instead of painting over the border. */\n padding: 1px;\n background-clip: content-box;\n border: 0;\n border-radius: var(--ui-radius-sm, 0.25rem);\n color: var(--ui-text-muted, #64748b);\n background-color: transparent;\n cursor: pointer;\n line-height: 0;\n }\n .clear-button:hover {\n color: var(--ui-text, #0f172a);\n background-color: var(--ui-surface-muted, #f8fafc);\n }\n .clear-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 .floating-label {\n position: absolute;\n top: 50%;\n left: 0.75rem;\n right: 0.75rem;\n z-index: 1;\n display: flex;\n align-items: baseline;\n gap: 0.25rem;\n overflow: hidden;\n transform: translateY(-50%);\n color: var(--ui-text-muted, #64748b);\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 font-weight: var(--ui-font-weight-regular, 400);\n line-height: var(--ui-line-height-tight, 1.25);\n white-space: nowrap;\n text-overflow: ellipsis;\n cursor: text;\n transition:\n top 150ms ease,\n transform 150ms ease,\n font-size 150ms ease;\n }\n .field-shell.clearable .floating-label {\n right: 2rem;\n }\n .field-shell.floating input {\n height: 3rem;\n padding-top: 1.25rem;\n padding-bottom: 0.25rem;\n }\n .field-shell.floating .clear-button {\n top: 0.5rem;\n }\n .field-shell.floating.has-value .floating-label,\n .field-shell.floating:focus-within .floating-label {\n top: 0.25rem;\n transform: none;\n font-size: var(--ui-font-size-xs, 0.6875rem);\n }\n .field-shell.floating:not(.has-value):not(:focus-within) input::placeholder {\n opacity: 0;\n }\n .field-shell.disabled .floating-label {\n cursor: not-allowed;\n opacity: 0.6;\n }\n .required-mark {\n flex: 0 0 auto;\n color: var(--ui-danger, #dc2626);\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 input:disabled {\n cursor: not-allowed;\n opacity: 0.6;\n }\n input: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 .suggestions {\n position: absolute;\n top: 100%;\n left: 0;\n right: 0;\n z-index: 10;\n max-height: 40vh;\n overflow-y: auto;\n margin: 0.25rem 0 0;\n padding: 0.25rem 0;\n list-style: none;\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 .suggestion {\n padding: 0.5rem 0.75rem;\n font-size: var(--ui-font-size-sm, 0.75rem);\n cursor: pointer;\n }\n .suggestion.active,\n .suggestion:hover {\n background: var(--ui-surface-muted, #f8fafc);\n }\n .no-suggestions {\n padding: 0.5rem 0.75rem;\n color: var(--ui-text-muted, #64748b);\n font-size: var(--ui-font-size-sm, 0.75rem);\n font-style: italic;\n }\n @media (forced-colors: active) {\n input:focus-visible {\n outline: 2px solid CanvasText;\n outline-offset: 2px;\n box-shadow: none;\n }\n input:disabled {\n color: GrayText;\n opacity: 1;\n }\n .clear-button:focus-visible {\n outline: 2px solid CanvasText;\n outline-offset: -2px;\n box-shadow: none;\n }\n .field-shell.disabled .floating-label {\n color: GrayText;\n opacity: 1;\n }\n .suggestion.active,\n .suggestion:hover {\n color: HighlightText;\n background: Highlight;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n .floating-label {\n transition: none;\n }\n }\n `,\n ];\n\n /** Current input value; also the form-associated value submitted with the form. */\n @property() value = \"\";\n /** Placeholder text shown when the input is empty. */\n @property() placeholder = \"\";\n /** Marks the input as required for native form validation. */\n @property({ type: Boolean }) required = false;\n /** Disables the input and closes its suggestion popup. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n /** Shows an in-field clear action while the control has a value. */\n @property({ type: Boolean, reflect: true }) clearable = false;\n /** API endpoint queried in API mode. Ignored when `options` is set. */\n @property() endpoint = \"\";\n /** Query string parameter name the current input text is sent under. */\n @property({ attribute: \"query-param\" }) queryParam = \"q\";\n /** Debounce delay (ms) before firing a request/filter after typing. */\n @property({ type: Number }) debounce = 300;\n /** Minimum query length before suggestions are shown. */\n @property({ type: Number, attribute: \"min-length\" }) minLength = 3;\n /**\n * Fixed candidate list to filter locally instead of fetching from\n * `endpoint`. When set (non-null), no network request is ever made —\n * this takes priority over the API mode.\n */\n @property({ attribute: false }) options: AutocompleteOption[] | null = null;\n\n @state() private _suggestions: AutocompleteOption[] = [];\n @state() private _open = false;\n @state() private _activeIndex = -1;\n @state() private _formDisabled = false;\n @state() private _formFieldConfig: FormFieldControlConfig | null = null;\n\n @query(\"input\") private _input?: HTMLInputElement;\n\n #internals = this.attachInternals();\n #lastPicked: AutocompleteOption | null = null;\n #debounceTimer: ReturnType<typeof setTimeout> | null = null;\n #abortController: AbortController | null = null;\n #isComposing = false;\n #compositionJustEnded = false;\n #compositionEndTimer: ReturnType<typeof setTimeout> | null = null;\n readonly #inputId = `autocomplete-input-field-${++instanceCount}`;\n readonly #listboxId = `autocomplete-input-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 /** Last-picked option, or null once the input diverges from it. */\n get selectedOption(): AutocompleteOption | null {\n if (this.#lastPicked && this.#lastPicked.value === this.value) return this.#lastPicked;\n return null;\n }\n\n /**\n * Applies or clears label configuration supplied by a wrapping `form-field`.\n * @private\n */\n [formFieldControl](config: FormFieldControlConfig | null): void {\n this._formFieldConfig = config;\n }\n\n protected override willUpdate(changed: PropertyValues) {\n if (changed.has(\"disabled\") && this.#isDisabled) {\n if (this.#debounceTimer) clearTimeout(this.#debounceTimer);\n this.#resetComposition();\n this.#abortController?.abort();\n this._open = false;\n this._activeIndex = -1;\n }\n }\n\n protected override updated(changed: PropertyValues) {\n if (changed.has(\"value\")) this.#internals.setFormValue(this.value);\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n if (this.#debounceTimer) clearTimeout(this.#debounceTimer);\n this.#resetComposition();\n this.#abortController?.abort();\n }\n\n /** Resets to empty on `form.reset()`, per the form-associated custom element contract. */\n formResetCallback() {\n this.value = \"\";\n this._suggestions = [];\n this._open = false;\n this.#lastPicked = null;\n }\n\n /** Mirrors ancestor fieldset disabled state onto the native input. */\n formDisabledCallback(disabled: boolean) {\n this._formDisabled = disabled;\n if (!disabled) return;\n if (this.#debounceTimer) clearTimeout(this.#debounceTimer);\n this.#resetComposition();\n this.#abortController?.abort();\n this._open = false;\n this._activeIndex = -1;\n }\n\n private onInput(e: InputEvent) {\n if (this.#isDisabled) return;\n this.value = (e.target as HTMLInputElement).value;\n this.#lastPicked = null;\n this.#scheduleFetch(this.value);\n }\n\n #scheduleFetch(query: string) {\n if (this.#isDisabled) return;\n if (this.#debounceTimer) clearTimeout(this.#debounceTimer);\n if (query.trim().length < this.minLength) {\n this._suggestions = [];\n this._open = false;\n this._activeIndex = -1;\n return;\n }\n if (this.options) {\n // Local mode: filtering is synchronous and cheap, but keep the same\n // debounce as the API mode so the UX doesn't shift between sources.\n this.#debounceTimer = setTimeout(() => this.#filterLocalOptions(query), this.debounce);\n return;\n }\n this.#debounceTimer = setTimeout(() => void this.#fetchOptions(query), this.debounce);\n }\n\n /** Filters the locally-supplied `options` list for `query`, case-insensitively. */\n #filterLocalOptions(query: string) {\n const needle = query.trim().toLowerCase();\n this._suggestions = (this.options ?? [])\n .filter((o) => o.value.toLowerCase().includes(needle))\n .slice(0, 5);\n this._activeIndex = -1;\n this._open = !this.#isDisabled;\n }\n\n /** Fetches options for `query` from `endpoint`, cancelling any request still in flight. */\n async #fetchOptions(query: string) {\n this.#abortController?.abort();\n const controller = new AbortController();\n this.#abortController = controller;\n try {\n const res = await fetch(this.#buildUrl(query), { signal: controller.signal });\n if (!res.ok) throw new Error(`autocomplete request failed: ${res.status}`);\n if (this.#isDisabled) return;\n this._suggestions = ((await res.json()) as AutocompleteOption[]).slice(0, 5);\n this._activeIndex = -1;\n this._open = true;\n } catch {\n // Aborted (superseded by newer keystroke) or a network failure while\n // typing — fail silently and just close the list.\n if (!controller.signal.aborted) {\n this._suggestions = [];\n this._open = false;\n }\n }\n }\n\n #buildUrl(query: string): string {\n const params = new URLSearchParams({ [this.queryParam]: query });\n return `${this.endpoint}?${params.toString()}`;\n }\n\n private onKeydown(e: KeyboardEvent) {\n if (this.#isDisabled) return;\n if (e.isComposing || e.keyCode === 229 || this.#isComposing || this.#compositionJustEnded) {\n return;\n }\n if (e.key === \"ArrowDown\") this.#moveActive(1, e);\n else if (e.key === \"ArrowUp\") this.#moveActive(-1, e);\n else if (e.key === \"Enter\") this.#handleEnter(e);\n else if (e.key === \"Escape\") this.#handleEscape(e);\n }\n\n #moveActive(delta: number, e: KeyboardEvent) {\n if (!this._open || this._suggestions.length === 0) return;\n e.preventDefault();\n const n = this._suggestions.length;\n this._activeIndex = (this._activeIndex + delta + n) % n;\n }\n\n #handleEnter(e: KeyboardEvent) {\n const pick = this._suggestions[this._activeIndex] ?? this._suggestions[0];\n if (this._open && pick) {\n e.preventDefault();\n this.#selectOption(pick);\n return;\n }\n if (this.#internals.form) {\n const form = this.#internals.form;\n window.setTimeout(() => {\n if (!e.defaultPrevented && form.isConnected) submitWithDefaultButton(form);\n });\n }\n }\n\n #handleEscape(e: KeyboardEvent) {\n if (!this._open) return;\n e.preventDefault();\n this._open = false;\n }\n\n private onBlur() {\n this._open = false;\n }\n\n private onCompositionStart(): void {\n if (this.#compositionEndTimer) clearTimeout(this.#compositionEndTimer);\n this.#compositionEndTimer = null;\n this.#compositionJustEnded = false;\n this.#isComposing = true;\n }\n\n private 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 /** Clears composition state when the control can no longer receive keys. */\n #resetComposition(): void {\n if (this.#compositionEndTimer) clearTimeout(this.#compositionEndTimer);\n this.#compositionEndTimer = null;\n this.#isComposing = false;\n this.#compositionJustEnded = false;\n }\n\n #selectOption(o: AutocompleteOption) {\n this.value = o.value;\n this.#lastPicked = o;\n this._open = false;\n this._suggestions = [];\n this.dispatchEvent(new CustomEvent<AutocompleteOption>(\"option-select\", { detail: o, bubbles: true, composed: true }));\n }\n\n /** Clears the field and all pending autocomplete state, then restores input focus. */\n #clear(): void {\n if (this.#isDisabled || !this.value) return;\n if (this.#debounceTimer) clearTimeout(this.#debounceTimer);\n this.#debounceTimer = null;\n this.#abortController?.abort();\n this.#abortController = null;\n this.#resetComposition();\n this.value = \"\";\n this.#lastPicked = null;\n this._suggestions = [];\n this._activeIndex = -1;\n this._open = false;\n this.#internals.setFormValue(\"\");\n this.dispatchEvent(\n new InputEvent(\"input\", {\n bubbles: true,\n composed: true,\n inputType: \"deleteContentBackward\",\n }),\n );\n this._input?.focus({ preventScroll: true });\n }\n\n /** Selects on mousedown (not click) so it wins over the input's blur, which closes the list. */\n #onSuggestionMousedown(e: MouseEvent, o: AutocompleteOption) {\n e.preventDefault();\n this.#selectOption(o);\n }\n\n private renderSuggestions() {\n if (!this._open || this.#isDisabled) return nothing;\n return html`\n <ul id=${this.#listboxId} class=\"suggestions\" role=\"listbox\" aria-label=\"Suggestions\">\n ${this._suggestions.map(\n (o, i) => html`\n <li\n id=${`${this.#listboxId}-option-${i}`}\n role=\"option\"\n aria-selected=${i === this._activeIndex}\n class=\"suggestion ${i === this._activeIndex ? \"active\" : \"\"}\"\n @mousedown=${(e: MouseEvent) => this.#onSuggestionMousedown(e, o)}\n >\n ${o.value}\n </li>\n `,\n )}\n ${this._suggestions.length === 0\n ? html`<li class=\"no-suggestions\" role=\"presentation\">\n <span role=\"status\">No suggestions found</span>\n </li>`\n : nothing}\n </ul>\n `;\n }\n\n override render() {\n const activeDescendant =\n this._open && !this.#isDisabled && this._activeIndex >= 0\n ? `${this.#listboxId}-option-${this._activeIndex}`\n : nothing;\n const expanded = this._open && !this.#isDisabled;\n const floating =\n Boolean(this._formFieldConfig?.floating) && Boolean(this._formFieldConfig?.label);\n const showClear = this.clearable && Boolean(this.value) && !this.#isDisabled;\n return html`\n <div\n class=\"field-shell ${this.clearable ? \"clearable\" : \"\"} ${floating\n ? \"floating\"\n : \"\"} ${this.value ? \"has-value\" : \"\"} ${this.#isDisabled ? \"disabled\" : \"\"}\"\n >\n ${floating\n ? html`\n <label class=\"floating-label\" for=${this.#inputId}>\n <span>${this._formFieldConfig!.label}</span>\n ${this._formFieldConfig!.required\n ? html`\n <span class=\"required-mark\" aria-hidden=\"true\">*</span>\n <span class=\"sr-only\"> (required)</span>\n `\n : nothing}\n </label>\n `\n : nothing}\n <input\n id=${this.#inputId}\n type=\"text\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-expanded=${expanded}\n aria-controls=${this.#listboxId}\n aria-activedescendant=${activeDescendant}\n .value=${this.value}\n placeholder=${this.placeholder}\n ?required=${this.required}\n ?disabled=${this.#isDisabled}\n autocomplete=\"off\"\n @input=${this.onInput}\n @compositionstart=${this.onCompositionStart}\n @compositionend=${this.onCompositionEnd}\n @keydown=${this.onKeydown}\n @blur=${this.onBlur}\n />\n ${showClear\n ? html`\n <button\n type=\"button\"\n class=\"clear-button\"\n aria-label=\"Clear input\"\n title=\"Clear input\"\n @mousedown=${(event: MouseEvent) => event.preventDefault()}\n @click=${() => this.#clear()}\n >\n ${iconX(18)}\n </button>\n `\n : nothing}\n ${this.renderSuggestions()}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"autocomplete-input\": AutocompleteInput;\n }\n}\n"]}
@@ -13,7 +13,16 @@ export interface ButtonGroupOption {
13
13
  * option should read as visually "pressed," not just checked. For many
14
14
  * short, individually pill-shaped choices, use `radio-pills` instead. Wraps
15
15
  * native radio inputs for keyboard/a11y and fires `change` rather than
16
- * relying on form submission.
16
+ * relying on form submission. Set `size="sm"` for a compact strip one step
17
+ * below the default, matching `ui-button`'s `sm` size.
18
+ *
19
+ * The checked segment reads `--ui-button-background`/`-hover`/`-active`,
20
+ * same as `ui-button`'s `primary` variant. Unchecked segments are treated as
21
+ * `ui-button`'s `secondary` variant: they read the shared
22
+ * `--ui-button-secondary-background`/`-active` (rest/pressed) so a gradient
23
+ * theme applies consistently, but use the shared `--ui-button-secondary-surface-muted`
24
+ * (also used by `pagination-nav`) for hover, since — unlike `secondary` — an
25
+ * unchecked segment already paints `--ui-surface-muted` on hover by default.
17
26
  *
18
27
  * @element button-group
19
28
  * @fires change - A segment was selected; detail: { value }.
@@ -29,6 +38,8 @@ export declare class ButtonGroup extends LitElement {
29
38
  disabled: boolean;
30
39
  /** Hides labels visually (icons only) while keeping them as the accessible name. */
31
40
  iconOnly: boolean;
41
+ /** Size — `sm` reduces segment height/padding/font-size one step below the default. */
42
+ size: "sm" | "md";
32
43
  private _onChange;
33
44
  render(): TemplateResult<1>;
34
45
  }
@@ -1 +1 @@
1
- {"version":3,"file":"button-group.d.ts","sourceRoot":"","sources":["../src/button-group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAKrD,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB;AAID;;;;;;;;;;;GAWG;AACH,qBACa,WAAY,SAAQ,UAAU;;IACzC,OAAgB,MAAM,4BA4GpB;IAEF,2CAA2C;IACX,OAAO,EAAE,iBAAiB,EAAE,CAAM;IAClE,gCAAgC;IACpB,KAAK,SAAM;IACvB,gDAAgD;IACnB,QAAQ,UAAS;IAC9C,oFAAoF;IAChB,QAAQ,UAAS;IAIrF,OAAO,CAAC,SAAS;IAQR,MAAM,sBAwBd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,WAAW,CAAC;KAC7B;CACF"}
1
+ {"version":3,"file":"button-group.d.ts","sourceRoot":"","sources":["../src/button-group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAKrD,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB;AAID;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBACa,WAAY,SAAQ,UAAU;;IACzC,OAAgB,MAAM,4BA8HpB;IAEF,2CAA2C;IACX,OAAO,EAAE,iBAAiB,EAAE,CAAM;IAClE,gCAAgC;IACpB,KAAK,SAAM;IACvB,gDAAgD;IACnB,QAAQ,UAAS;IAC9C,oFAAoF;IAChB,QAAQ,UAAS;IACrF,uFAAuF;IAC1D,IAAI,EAAE,IAAI,GAAG,IAAI,CAAQ;IAItD,OAAO,CAAC,SAAS;IAQR,MAAM,sBAwBd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,WAAW,CAAC;KAC7B;CACF"}
@@ -16,7 +16,16 @@ let instanceCount = 0;
16
16
  * option should read as visually "pressed," not just checked. For many
17
17
  * short, individually pill-shaped choices, use `radio-pills` instead. Wraps
18
18
  * native radio inputs for keyboard/a11y and fires `change` rather than
19
- * relying on form submission.
19
+ * relying on form submission. Set `size="sm"` for a compact strip one step
20
+ * below the default, matching `ui-button`'s `sm` size.
21
+ *
22
+ * The checked segment reads `--ui-button-background`/`-hover`/`-active`,
23
+ * same as `ui-button`'s `primary` variant. Unchecked segments are treated as
24
+ * `ui-button`'s `secondary` variant: they read the shared
25
+ * `--ui-button-secondary-background`/`-active` (rest/pressed) so a gradient
26
+ * theme applies consistently, but use the shared `--ui-button-secondary-surface-muted`
27
+ * (also used by `pagination-nav`) for hover, since — unlike `secondary` — an
28
+ * unchecked segment already paints `--ui-surface-muted` on hover by default.
20
29
  *
21
30
  * @element button-group
22
31
  * @fires change - A segment was selected; detail: { value }.
@@ -32,6 +41,8 @@ let ButtonGroup = class ButtonGroup extends LitElement {
32
41
  this.disabled = false;
33
42
  /** Hides labels visually (icons only) while keeping them as the accessible name. */
34
43
  this.iconOnly = false;
44
+ /** Size — `sm` reduces segment height/padding/font-size one step below the default. */
45
+ this.size = "md";
35
46
  this.#name = `button-group-${++instanceCount}`;
36
47
  }
37
48
  static { this.styles = [
@@ -73,6 +84,8 @@ let ButtonGroup = class ButtonGroup extends LitElement {
73
84
  line-height: var(--ui-line-height-tight, 1.25);
74
85
  color: var(--ui-text, #0f172a);
75
86
  white-space: nowrap;
87
+ background: var(--ui-button-secondary-background, none);
88
+ box-shadow: var(--ui-button-highlight, 0 0 0 0 transparent);
76
89
  }
77
90
  .segment:first-child {
78
91
  border-left: none;
@@ -84,11 +97,16 @@ let ButtonGroup = class ButtonGroup extends LitElement {
84
97
  border-bottom-right-radius: var(--ui-radius-sm, 0.25rem);
85
98
  }
86
99
  .segment:has(input:checked) {
87
- background: var(--ui-primary, #4f46e5);
100
+ background: var(--ui-button-background, var(--ui-primary, #4f46e5));
88
101
  color: var(--ui-on-accent, #ffffff);
102
+ text-shadow: var(--ui-button-text-shadow, none);
89
103
  }
90
104
  .segment:not(:has(input:checked)):hover {
91
- background: var(--ui-surface-muted, #f8fafc);
105
+ background: var(--ui-button-secondary-surface-muted, var(--ui-surface-muted, #f8fafc));
106
+ }
107
+ .segment:not(:has(input:checked)):active {
108
+ background: var(--ui-button-secondary-background-active, var(--ui-button-secondary-background, none));
109
+ box-shadow: none;
92
110
  }
93
111
  .segment input {
94
112
  /* Fills the whole segment (not visually-hidden-offscreen) so a real
@@ -108,6 +126,9 @@ let ButtonGroup = class ButtonGroup extends LitElement {
108
126
  outline: none;
109
127
  box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));
110
128
  }
129
+ .segment:has(input:focus-visible):not(:active) {
130
+ 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);
131
+ }
111
132
  .segment:has(input:disabled) {
112
133
  cursor: not-allowed;
113
134
  opacity: 0.6;
@@ -115,6 +136,14 @@ let ButtonGroup = class ButtonGroup extends LitElement {
115
136
  :host([icon-only]) .segment {
116
137
  padding: 0.5rem;
117
138
  }
139
+ :host([size="sm"]) .segment {
140
+ height: 1.5rem;
141
+ padding: 0.25rem 0.5rem;
142
+ font-size: var(--ui-font-size-xs, 0.6875rem);
143
+ }
144
+ :host([icon-only][size="sm"]) .segment {
145
+ padding: 0.25rem;
146
+ }
118
147
  .sr-only {
119
148
  position: absolute;
120
149
  width: 1px;
@@ -184,6 +213,9 @@ __decorate([
184
213
  __decorate([
185
214
  property({ type: Boolean, reflect: true, attribute: "icon-only" })
186
215
  ], ButtonGroup.prototype, "iconOnly", void 0);
216
+ __decorate([
217
+ property({ reflect: true })
218
+ ], ButtonGroup.prototype, "size", void 0);
187
219
  ButtonGroup = __decorate([
188
220
  customElement("button-group")
189
221
  ], ButtonGroup);
@@ -1 +1 @@
1
- {"version":3,"file":"button-group.js","sourceRoot":"","sources":["../src/button-group.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,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;AASrC,IAAI,aAAa,GAAG,CAAC,CAAC;AAEtB;;;;;;;;;;;GAWG;AAEI,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QA+GL,2CAA2C;QACX,YAAO,GAAwB,EAAE,CAAC;QAClE,gCAAgC;QACpB,UAAK,GAAG,EAAE,CAAC;QACvB,gDAAgD;QACnB,aAAQ,GAAG,KAAK,CAAC;QAC9C,oFAAoF;QAChB,aAAQ,GAAG,KAAK,CAAC;QAE5E,UAAK,GAAG,gBAAgB,EAAE,aAAa,EAAE,CAAC;IAmCrD,CAAC;aA1JiB,WAAM,GAAG;QACvB,MAAM;QACN,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;6CAAkB;AAEsB;IAAnE,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;6CAAkB;AAtH1E,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CA2JvB","sourcesContent":["import type { TemplateResult } from \"lit\";\nimport { LitElement, css, html, nothing } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { repeat } from \"lit/directives/repeat.js\";\nimport { tokens } from \"./tokens.js\";\n\nexport interface ButtonGroupOption {\n value: string;\n label: string;\n /** Optional pre-rendered icon template displayed before the label. */\n icon?: TemplateResult;\n}\n\nlet instanceCount = 0;\n\n/**\n * Single-select segmented control — a strip of buttons joined into one\n * shared-border shape, for a small, persistent set of mutually exclusive\n * choices (a view switcher, a theme picker) where the *currently selected*\n * option should read as visually \"pressed,\" not just checked. For many\n * short, individually pill-shaped choices, use `radio-pills` instead. Wraps\n * native radio inputs for keyboard/a11y and fires `change` rather than\n * relying on form submission.\n *\n * @element button-group\n * @fires change - A segment was selected; detail: { value }.\n */\n@customElement(\"button-group\")\nexport class ButtonGroup extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: inline-block;\n }\n .group {\n display: flex;\n border: 1px solid var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius-sm, 0.25rem);\n overflow: hidden;\n }\n .segment {\n position: relative;\n display: flex;\n flex: 1 1 auto;\n align-items: center;\n justify-content: center;\n gap: 0.25rem;\n height: 2rem;\n box-sizing: border-box;\n padding: 0.5rem 0.75rem;\n border-left: 1px solid var(--ui-border, #e2e8f0);\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 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 white-space: nowrap;\n }\n .segment:first-child {\n border-left: none;\n border-top-left-radius: var(--ui-radius-sm, 0.25rem);\n border-bottom-left-radius: var(--ui-radius-sm, 0.25rem);\n }\n .segment:last-child {\n border-top-right-radius: var(--ui-radius-sm, 0.25rem);\n border-bottom-right-radius: var(--ui-radius-sm, 0.25rem);\n }\n .segment:has(input:checked) {\n background: var(--ui-primary, #4f46e5);\n color: var(--ui-on-accent, #ffffff);\n }\n .segment:not(:has(input:checked)):hover {\n background: var(--ui-surface-muted, #f8fafc);\n }\n .segment input {\n /* Fills the whole segment (not visually-hidden-offscreen) so a real\n click anywhere in the segment — including a test driver clicking\n the input by its accessible role — lands on the input itself,\n not just via native <label> click delegation. */\n position: absolute;\n inset: 0;\n margin: 0;\n opacity: 0;\n cursor: pointer;\n }\n /* Clipped by the group's own overflow:hidden unless promoted above its\n neighbors — the focus ring needs a stacking context of its own. */\n .segment:has(input:focus-visible) {\n z-index: 1;\n outline: none;\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n .segment:has(input:disabled) {\n cursor: not-allowed;\n opacity: 0.6;\n }\n :host([icon-only]) .segment {\n padding: 0.5rem;\n }\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n @media (forced-colors: active) {\n .segment:has(input:focus-visible) {\n outline: 2px solid CanvasText;\n outline-offset: 2px;\n box-shadow: none;\n }\n .segment:has(input:checked) {\n background: Highlight;\n color: HighlightText;\n }\n .segment:has(input:disabled) {\n color: GrayText;\n opacity: 1;\n }\n }\n `,\n ];\n\n /** Options to render, one segment each. */\n @property({ attribute: false }) options: ButtonGroupOption[] = [];\n /** Currently selected value. */\n @property() value = \"\";\n /** Disables every native radio in the group. */\n @property({ type: Boolean }) disabled = false;\n /** Hides labels visually (icons only) while keeping them as the accessible name. */\n @property({ type: Boolean, reflect: true, attribute: \"icon-only\" }) iconOnly = false;\n\n readonly #name = `button-group-${++instanceCount}`;\n\n private _onChange(value: string) {\n if (this.disabled) return;\n this.value = value;\n this.dispatchEvent(\n new CustomEvent(\"change\", { detail: { value }, bubbles: true, composed: true }),\n );\n }\n\n override render() {\n return html`\n <div class=\"group\">\n ${repeat(\n this.options,\n (opt) => opt.value,\n (opt) => html`\n <label class=\"segment\">\n <input\n type=\"radio\"\n name=${this.#name}\n ?checked=${this.value === opt.value}\n ?disabled=${this.disabled}\n aria-label=${this.iconOnly ? opt.label : nothing}\n title=${this.iconOnly ? opt.label : nothing}\n @change=${() => this._onChange(opt.value)}\n />\n ${opt.icon ?? nothing}\n <span class=${this.iconOnly ? \"sr-only\" : \"\"}>${opt.label}</span>\n </label>\n `,\n )}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"button-group\": ButtonGroup;\n }\n}\n"]}
1
+ {"version":3,"file":"button-group.js","sourceRoot":"","sources":["../src/button-group.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,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;AASrC,IAAI,aAAa,GAAG,CAAC,CAAC;AAEtB;;;;;;;;;;;;;;;;;;;;GAoBG;AAEI,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QAiIL,2CAA2C;QACX,YAAO,GAAwB,EAAE,CAAC;QAClE,gCAAgC;QACpB,UAAK,GAAG,EAAE,CAAC;QACvB,gDAAgD;QACnB,aAAQ,GAAG,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AAC;;gBAEzC,GAAG,CAAC,IAAI,IAAI,OAAO;4BACP,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,KAAK;;WAE5D,CACF;;KAEJ,CAAC;IACJ,CAAC;CACF,CAAA;AA7CiC;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;4CAAmC;AAEtD;IAAX,QAAQ,EAAE;0CAAY;AAEM;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;6CAAkB;AAEsB;IAAnE,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;6CAAkB;AAExD;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCAA0B;AA1I3C,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CA+KvB","sourcesContent":["import type { TemplateResult } from \"lit\";\nimport { LitElement, css, html, nothing } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { repeat } from \"lit/directives/repeat.js\";\nimport { tokens } from \"./tokens.js\";\n\nexport interface ButtonGroupOption {\n value: string;\n label: string;\n /** Optional pre-rendered icon template displayed before the label. */\n icon?: TemplateResult;\n}\n\nlet instanceCount = 0;\n\n/**\n * Single-select segmented control — a strip of buttons joined into one\n * shared-border shape, for a small, persistent set of mutually exclusive\n * choices (a view switcher, a theme picker) where the *currently selected*\n * option should read as visually \"pressed,\" not just checked. For many\n * short, individually pill-shaped choices, use `radio-pills` instead. Wraps\n * native radio inputs for keyboard/a11y and fires `change` rather than\n * relying on form submission. Set `size=\"sm\"` for a compact strip one step\n * below the default, matching `ui-button`'s `sm` size.\n *\n * The checked segment reads `--ui-button-background`/`-hover`/`-active`,\n * same as `ui-button`'s `primary` variant. Unchecked segments are treated as\n * `ui-button`'s `secondary` variant: they read the shared\n * `--ui-button-secondary-background`/`-active` (rest/pressed) so a gradient\n * theme applies consistently, but use the shared `--ui-button-secondary-surface-muted`\n * (also used by `pagination-nav`) for hover, since — unlike `secondary` — an\n * unchecked segment already paints `--ui-surface-muted` on hover by default.\n *\n * @element button-group\n * @fires change - A segment was selected; detail: { value }.\n */\n@customElement(\"button-group\")\nexport class ButtonGroup extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: inline-block;\n }\n .group {\n display: flex;\n border: 1px solid var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius-sm, 0.25rem);\n overflow: hidden;\n }\n .segment {\n position: relative;\n display: flex;\n flex: 1 1 auto;\n align-items: center;\n justify-content: center;\n gap: 0.25rem;\n height: 2rem;\n box-sizing: border-box;\n padding: 0.5rem 0.75rem;\n border-left: 1px solid var(--ui-border, #e2e8f0);\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 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 white-space: nowrap;\n background: var(--ui-button-secondary-background, none);\n box-shadow: var(--ui-button-highlight, 0 0 0 0 transparent);\n }\n .segment:first-child {\n border-left: none;\n border-top-left-radius: var(--ui-radius-sm, 0.25rem);\n border-bottom-left-radius: var(--ui-radius-sm, 0.25rem);\n }\n .segment:last-child {\n border-top-right-radius: var(--ui-radius-sm, 0.25rem);\n border-bottom-right-radius: var(--ui-radius-sm, 0.25rem);\n }\n .segment:has(input:checked) {\n background: var(--ui-button-background, var(--ui-primary, #4f46e5));\n color: var(--ui-on-accent, #ffffff);\n text-shadow: var(--ui-button-text-shadow, none);\n }\n .segment:not(:has(input:checked)):hover {\n background: var(--ui-button-secondary-surface-muted, var(--ui-surface-muted, #f8fafc));\n }\n .segment:not(:has(input:checked)):active {\n background: var(--ui-button-secondary-background-active, var(--ui-button-secondary-background, none));\n box-shadow: none;\n }\n .segment input {\n /* Fills the whole segment (not visually-hidden-offscreen) so a real\n click anywhere in the segment — including a test driver clicking\n the input by its accessible role — lands on the input itself,\n not just via native <label> click delegation. */\n position: absolute;\n inset: 0;\n margin: 0;\n opacity: 0;\n cursor: pointer;\n }\n /* Clipped by the group's own overflow:hidden unless promoted above its\n neighbors — the focus ring needs a stacking context of its own. */\n .segment:has(input:focus-visible) {\n z-index: 1;\n outline: none;\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n .segment:has(input:focus-visible):not(:active) {\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 .segment:has(input:disabled) {\n cursor: not-allowed;\n opacity: 0.6;\n }\n :host([icon-only]) .segment {\n padding: 0.5rem;\n }\n :host([size=\"sm\"]) .segment {\n height: 1.5rem;\n padding: 0.25rem 0.5rem;\n font-size: var(--ui-font-size-xs, 0.6875rem);\n }\n :host([icon-only][size=\"sm\"]) .segment {\n padding: 0.25rem;\n }\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n @media (forced-colors: active) {\n .segment:has(input:focus-visible) {\n outline: 2px solid CanvasText;\n outline-offset: 2px;\n box-shadow: none;\n }\n .segment:has(input:checked) {\n background: Highlight;\n color: HighlightText;\n }\n .segment:has(input:disabled) {\n color: GrayText;\n opacity: 1;\n }\n }\n `,\n ];\n\n /** Options to render, one segment each. */\n @property({ attribute: false }) options: ButtonGroupOption[] = [];\n /** Currently selected value. */\n @property() value = \"\";\n /** Disables every native radio in the group. */\n @property({ type: Boolean }) disabled = false;\n /** Hides labels visually (icons only) while keeping them as the accessible name. */\n @property({ type: Boolean, reflect: true, attribute: \"icon-only\" }) iconOnly = false;\n /** Size — `sm` reduces segment height/padding/font-size one step below the default. */\n @property({ reflect: true }) size: \"sm\" | \"md\" = \"md\";\n\n readonly #name = `button-group-${++instanceCount}`;\n\n private _onChange(value: string) {\n if (this.disabled) return;\n this.value = value;\n this.dispatchEvent(\n new CustomEvent(\"change\", { detail: { value }, bubbles: true, composed: true }),\n );\n }\n\n override render() {\n return html`\n <div class=\"group\">\n ${repeat(\n this.options,\n (opt) => opt.value,\n (opt) => html`\n <label class=\"segment\">\n <input\n type=\"radio\"\n name=${this.#name}\n ?checked=${this.value === opt.value}\n ?disabled=${this.disabled}\n aria-label=${this.iconOnly ? opt.label : nothing}\n title=${this.iconOnly ? opt.label : nothing}\n @change=${() => this._onChange(opt.value)}\n />\n ${opt.icon ?? nothing}\n <span class=${this.iconOnly ? \"sr-only\" : \"\"}>${opt.label}</span>\n </label>\n `,\n )}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"button-group\": ButtonGroup;\n }\n}\n"]}
@@ -0,0 +1,54 @@
1
+ import { LitElement } from "lit";
2
+ import "./form-actions.js";
3
+ import "./ui-button.js";
4
+ /**
5
+ * GitHub/Slack-style comment composer: a one-line text field that expands
6
+ * into a multi-line textarea with a bottom-right Cancel/Submit footer
7
+ * (`form-actions`) as soon as it's focused or clicked. Submitting fires
8
+ * `submit` with the trimmed value, then clears the field and collapses back
9
+ * to one line — it's meant for posting one comment at a time, not editing a
10
+ * persistent value in place (see `editable-text` for that). Canceling (the
11
+ * Cancel button or `Escape`) discards the draft and collapses without
12
+ * firing `submit`. Clicking away (blur) does neither — the composer stays
13
+ * expanded until the user explicitly submits or cancels. `Cmd`/`Ctrl`+`Enter`
14
+ * submits from the textarea, matching `editable-text`'s multiline shortcut.
15
+ * Purely token-styled (no bespoke colors), so it's themeable via the same
16
+ * `--ui-*` custom properties as every other value-entry field.
17
+ *
18
+ * @element comment-composer
19
+ * @fires submit - User submitted a non-empty comment; detail: `{ value: string }`.
20
+ * @fires cancel - User discarded the draft via the Cancel button or `Escape`.
21
+ */
22
+ export declare class CommentComposer extends LitElement {
23
+ static styles: import("lit").CSSResult[];
24
+ /** Committed value shown in the collapsed one-line field. */
25
+ value: string;
26
+ /** Placeholder text shown when empty. */
27
+ placeholder: string;
28
+ /** Accessible name applied to the input/textarea. */
29
+ label: string;
30
+ /** Visible row count once expanded. */
31
+ rows: number;
32
+ /** Label for the primary submit button. */
33
+ submitLabel: string;
34
+ /** Label for the secondary cancel button. */
35
+ cancelLabel: string;
36
+ /** Disables the field entirely. */
37
+ disabled: boolean;
38
+ private _expanded;
39
+ private _draft;
40
+ private _textarea?;
41
+ private _expand;
42
+ private _onInput;
43
+ private _cancel;
44
+ private _submit;
45
+ private _onKeydown;
46
+ protected updated(changed: Map<string, unknown>): void;
47
+ render(): import("lit-html").TemplateResult<1>;
48
+ }
49
+ declare global {
50
+ interface HTMLElementTagNameMap {
51
+ "comment-composer": CommentComposer;
52
+ }
53
+ }
54
+ //# sourceMappingURL=comment-composer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comment-composer.d.ts","sourceRoot":"","sources":["../src/comment-composer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C,OAAO,mBAAmB,CAAC;AAC3B,OAAO,gBAAgB,CAAC;AAExB;;;;;;;;;;;;;;;;;GAiBG;AACH,qBACa,eAAgB,SAAQ,UAAU;IAC7C,OAAgB,MAAM,4BAkEpB;IAEF,6DAA6D;IACjD,KAAK,SAAM;IACvB,yCAAyC;IAC7B,WAAW,SAAoB;IAC3C,qDAAqD;IACzC,KAAK,SAAa;IAC9B,uCAAuC;IACX,IAAI,SAAK;IACrC,2CAA2C;IACF,WAAW,SAAY;IAChE,6CAA6C;IACJ,WAAW,SAAY;IAChE,mCAAmC;IACN,QAAQ,UAAS;IAErC,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,MAAM,CAAM;IAEV,OAAO,CAAC,SAAS,CAAC,CAAsB;IAE3D,OAAO,CAAC,OAAO;IAMf,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,OAAO;IAMf,OAAO,CAAC,OAAO;IAWf,OAAO,CAAC,UAAU;IAUlB,UAAmB,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAQ9D;IAEQ,MAAM,yCAgDd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,eAAe,CAAC;KACrC;CACF"}
@@ -0,0 +1,244 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { LitElement, css, html } from "lit";
8
+ import { customElement, property, query, state } from "lit/decorators.js";
9
+ import { tokens } from "./tokens.js";
10
+ import "./form-actions.js";
11
+ import "./ui-button.js";
12
+ /**
13
+ * GitHub/Slack-style comment composer: a one-line text field that expands
14
+ * into a multi-line textarea with a bottom-right Cancel/Submit footer
15
+ * (`form-actions`) as soon as it's focused or clicked. Submitting fires
16
+ * `submit` with the trimmed value, then clears the field and collapses back
17
+ * to one line — it's meant for posting one comment at a time, not editing a
18
+ * persistent value in place (see `editable-text` for that). Canceling (the
19
+ * Cancel button or `Escape`) discards the draft and collapses without
20
+ * firing `submit`. Clicking away (blur) does neither — the composer stays
21
+ * expanded until the user explicitly submits or cancels. `Cmd`/`Ctrl`+`Enter`
22
+ * submits from the textarea, matching `editable-text`'s multiline shortcut.
23
+ * Purely token-styled (no bespoke colors), so it's themeable via the same
24
+ * `--ui-*` custom properties as every other value-entry field.
25
+ *
26
+ * @element comment-composer
27
+ * @fires submit - User submitted a non-empty comment; detail: `{ value: string }`.
28
+ * @fires cancel - User discarded the draft via the Cancel button or `Escape`.
29
+ */
30
+ let CommentComposer = class CommentComposer extends LitElement {
31
+ constructor() {
32
+ super(...arguments);
33
+ /** Committed value shown in the collapsed one-line field. */
34
+ this.value = "";
35
+ /** Placeholder text shown when empty. */
36
+ this.placeholder = "Add a comment…";
37
+ /** Accessible name applied to the input/textarea. */
38
+ this.label = "Comment";
39
+ /** Visible row count once expanded. */
40
+ this.rows = 4;
41
+ /** Label for the primary submit button. */
42
+ this.submitLabel = "Submit";
43
+ /** Label for the secondary cancel button. */
44
+ this.cancelLabel = "Cancel";
45
+ /** Disables the field entirely. */
46
+ this.disabled = false;
47
+ this._expanded = false;
48
+ this._draft = "";
49
+ }
50
+ static { this.styles = [
51
+ tokens,
52
+ css `
53
+ :host {
54
+ display: block;
55
+ }
56
+ .shell {
57
+ border: 1px solid var(--ui-border, #e2e8f0);
58
+ border-radius: var(--ui-radius-sm, 0.25rem);
59
+ background: var(--ui-surface, #ffffff);
60
+ }
61
+ .shell.expanded {
62
+ border-radius: var(--ui-radius, 0.5rem);
63
+ }
64
+ input,
65
+ textarea {
66
+ display: block;
67
+ box-sizing: border-box;
68
+ width: 100%;
69
+ border: 0;
70
+ background: none;
71
+ color: var(--ui-text, #0f172a);
72
+ font-family: var(
73
+ --ui-font,
74
+ ui-sans-serif,
75
+ system-ui,
76
+ sans-serif,
77
+ "Apple Color Emoji",
78
+ "Segoe UI Emoji",
79
+ "Segoe UI Symbol",
80
+ "Noto Color Emoji"
81
+ );
82
+ font-size: var(--ui-font-size, 0.875rem);
83
+ line-height: var(--ui-line-height-normal, 1.5);
84
+ padding: 0.5rem 0.75rem;
85
+ outline: none;
86
+ }
87
+ textarea {
88
+ resize: none;
89
+ }
90
+ input:focus-visible,
91
+ .shell:not(.expanded):focus-within {
92
+ box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));
93
+ border-radius: var(--ui-radius-sm, 0.25rem);
94
+ }
95
+ textarea:focus-visible {
96
+ outline: none;
97
+ }
98
+ .footer {
99
+ display: flex;
100
+ justify-content: flex-end;
101
+ padding: 0.5rem 0.75rem 0.75rem;
102
+ }
103
+ input:disabled,
104
+ textarea:disabled {
105
+ cursor: not-allowed;
106
+ opacity: 0.6;
107
+ }
108
+ @media (forced-colors: active) {
109
+ .shell:not(.expanded):focus-within {
110
+ outline: 2px solid CanvasText;
111
+ outline-offset: 2px;
112
+ box-shadow: none;
113
+ }
114
+ }
115
+ `,
116
+ ]; }
117
+ _expand() {
118
+ if (this.disabled || this._expanded)
119
+ return;
120
+ this._draft = this.value;
121
+ this._expanded = true;
122
+ }
123
+ _onInput(e) {
124
+ this._draft = e.target.value;
125
+ }
126
+ _cancel() {
127
+ this._draft = this.value;
128
+ this._expanded = false;
129
+ this.dispatchEvent(new CustomEvent("cancel", { bubbles: true, composed: true }));
130
+ }
131
+ _submit() {
132
+ const trimmed = this._draft.trim();
133
+ if (trimmed === "")
134
+ return;
135
+ this.value = "";
136
+ this._draft = "";
137
+ this._expanded = false;
138
+ this.dispatchEvent(new CustomEvent("submit", { detail: { value: trimmed }, bubbles: true, composed: true }));
139
+ }
140
+ _onKeydown(e) {
141
+ if (e.key === "Escape") {
142
+ e.preventDefault();
143
+ this._cancel();
144
+ }
145
+ else if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
146
+ e.preventDefault();
147
+ this._submit();
148
+ }
149
+ }
150
+ updated(changed) {
151
+ if (changed.has("_expanded") && this._expanded) {
152
+ const field = this._textarea;
153
+ if (!field)
154
+ return;
155
+ field.focus();
156
+ const end = field.value.length;
157
+ field.setSelectionRange(end, end);
158
+ }
159
+ }
160
+ render() {
161
+ const canSubmit = this._draft.trim() !== "";
162
+ return html `
163
+ <div class="shell ${this._expanded ? "expanded" : ""}">
164
+ ${this._expanded
165
+ ? html `
166
+ <textarea
167
+ rows=${this.rows}
168
+ .value=${this._draft}
169
+ placeholder=${this.placeholder}
170
+ aria-label=${this.label}
171
+ ?disabled=${this.disabled}
172
+ @input=${this._onInput}
173
+ @keydown=${this._onKeydown}
174
+ ></textarea>
175
+ <div class="footer">
176
+ <form-actions>
177
+ <ui-button
178
+ slot="secondary"
179
+ variant="secondary"
180
+ size="sm"
181
+ @click=${this._cancel}
182
+ >${this.cancelLabel}</ui-button
183
+ >
184
+ <ui-button
185
+ slot="primary"
186
+ variant="primary"
187
+ size="sm"
188
+ ?disabled=${!canSubmit}
189
+ @click=${this._submit}
190
+ >${this.submitLabel}</ui-button
191
+ >
192
+ </form-actions>
193
+ </div>
194
+ `
195
+ : html `
196
+ <input
197
+ type="text"
198
+ .value=${this.value}
199
+ placeholder=${this.placeholder}
200
+ aria-label=${this.label}
201
+ ?disabled=${this.disabled}
202
+ @focus=${this._expand}
203
+ @click=${this._expand}
204
+ />
205
+ `}
206
+ </div>
207
+ `;
208
+ }
209
+ };
210
+ __decorate([
211
+ property()
212
+ ], CommentComposer.prototype, "value", void 0);
213
+ __decorate([
214
+ property()
215
+ ], CommentComposer.prototype, "placeholder", void 0);
216
+ __decorate([
217
+ property()
218
+ ], CommentComposer.prototype, "label", void 0);
219
+ __decorate([
220
+ property({ type: Number })
221
+ ], CommentComposer.prototype, "rows", void 0);
222
+ __decorate([
223
+ property({ attribute: "submit-label" })
224
+ ], CommentComposer.prototype, "submitLabel", void 0);
225
+ __decorate([
226
+ property({ attribute: "cancel-label" })
227
+ ], CommentComposer.prototype, "cancelLabel", void 0);
228
+ __decorate([
229
+ property({ type: Boolean })
230
+ ], CommentComposer.prototype, "disabled", void 0);
231
+ __decorate([
232
+ state()
233
+ ], CommentComposer.prototype, "_expanded", void 0);
234
+ __decorate([
235
+ state()
236
+ ], CommentComposer.prototype, "_draft", void 0);
237
+ __decorate([
238
+ query("textarea")
239
+ ], CommentComposer.prototype, "_textarea", void 0);
240
+ CommentComposer = __decorate([
241
+ customElement("comment-composer")
242
+ ], CommentComposer);
243
+ export { CommentComposer };
244
+ //# sourceMappingURL=comment-composer.js.map