@f-ewald/components 1.22.0 → 1.23.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 (45) hide show
  1. package/custom-elements.json +656 -9
  2. package/dist/address-autocomplete.d.ts +14 -0
  3. package/dist/address-autocomplete.d.ts.map +1 -1
  4. package/dist/address-autocomplete.js +205 -3
  5. package/dist/address-autocomplete.js.map +1 -1
  6. package/dist/autocomplete-input.d.ts +14 -0
  7. package/dist/autocomplete-input.d.ts.map +1 -1
  8. package/dist/autocomplete-input.js +205 -3
  9. package/dist/autocomplete-input.js.map +1 -1
  10. package/dist/dropdown-button.d.ts +22 -7
  11. package/dist/dropdown-button.d.ts.map +1 -1
  12. package/dist/dropdown-button.js +74 -15
  13. package/dist/dropdown-button.js.map +1 -1
  14. package/dist/form-field.d.ts +29 -1
  15. package/dist/form-field.d.ts.map +1 -1
  16. package/dist/form-field.js +376 -4
  17. package/dist/form-field.js.map +1 -1
  18. package/dist/icons.d.ts +1 -0
  19. package/dist/icons.d.ts.map +1 -1
  20. package/dist/icons.js +1 -0
  21. package/dist/icons.js.map +1 -1
  22. package/dist/index.d.ts +1 -1
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +1 -1
  25. package/dist/index.js.map +1 -1
  26. package/dist/text-area.d.ts +9 -0
  27. package/dist/text-area.d.ts.map +1 -1
  28. package/dist/text-area.js +123 -11
  29. package/dist/text-area.js.map +1 -1
  30. package/dist/timeline-entry.d.ts.map +1 -1
  31. package/dist/timeline-entry.js +32 -11
  32. package/dist/timeline-entry.js.map +1 -1
  33. package/dist/utils/form-field-control.d.ts +15 -0
  34. package/dist/utils/form-field-control.d.ts.map +1 -0
  35. package/dist/utils/form-field-control.js +7 -0
  36. package/dist/utils/form-field-control.js.map +1 -0
  37. package/docs/address-autocomplete.md +9 -0
  38. package/docs/autocomplete-input.md +9 -1
  39. package/docs/design-language.md +11 -0
  40. package/docs/dropdown-button.md +26 -6
  41. package/docs/form-field.md +18 -0
  42. package/docs/text-area.md +9 -1
  43. package/docs/timeline-entry.md +1 -0
  44. package/llms.txt +55 -19
  45. package/package.json +1 -1
@@ -137,11 +137,20 @@ let TimelineEntry = class TimelineEntry extends LitElement {
137
137
  .spinner {
138
138
  position: absolute;
139
139
  top: 0.125rem;
140
- left: 50%;
140
+ left: 0;
141
+ display: block;
141
142
  width: 0.75rem;
142
143
  height: 0.75rem;
143
- transform: translateX(-50%);
144
- animation: spin 0.8s linear infinite;
144
+ border-radius: 9999px;
145
+ /* Opaque backing so the connecting line is masked exactly like it is
146
+ behind the solid .dot, instead of showing through the ring's
147
+ hollow center and corners. */
148
+ background: var(--ui-surface, #ffffff);
149
+ }
150
+ .spinner svg {
151
+ display: block;
152
+ width: 100%;
153
+ height: 100%;
145
154
  }
146
155
  .spinner-track {
147
156
  fill: none;
@@ -153,19 +162,29 @@ let TimelineEntry = class TimelineEntry extends LitElement {
153
162
  stroke: var(--ui-text-muted, #64748b);
154
163
  stroke-width: 3;
155
164
  stroke-linecap: round;
156
- stroke-dasharray: 42 100;
165
+ /* r=9 gives a 56.55-unit circumference. Keeping the dash and gap
166
+ total equal to that circumference makes the fixed-length arc loop
167
+ seamlessly while its dash offset advances around the static ring. */
168
+ stroke-dasharray: 42.41 14.14;
169
+ animation: spinner-orbit 0.8s linear infinite;
157
170
  }
158
- @keyframes spin {
171
+ @keyframes spinner-orbit {
172
+ from {
173
+ stroke-dashoffset: 0;
174
+ }
159
175
  to {
160
- transform: rotate(360deg);
176
+ stroke-dashoffset: -56.55;
161
177
  }
162
178
  }
163
179
  @media (prefers-reduced-motion: reduce) {
164
- .spinner {
180
+ .spinner-arc {
165
181
  animation: none;
166
182
  }
167
183
  }
168
184
  @media (forced-colors: active) {
185
+ .spinner {
186
+ background: Canvas;
187
+ }
169
188
  .spinner-track {
170
189
  stroke: GrayText;
171
190
  }
@@ -243,10 +262,12 @@ let TimelineEntry = class TimelineEntry extends LitElement {
243
262
  <span class="line line-bottom"></span>
244
263
  ${this.running
245
264
  ? html `
246
- <svg class="spinner" viewBox="0 0 24 24">
247
- <circle class="spinner-track" cx="12" cy="12" r="9"></circle>
248
- <circle class="spinner-arc" cx="12" cy="12" r="9"></circle>
249
- </svg>
265
+ <span class="spinner">
266
+ <svg viewBox="0 0 24 24">
267
+ <circle class="spinner-track" cx="12" cy="12" r="9"></circle>
268
+ <circle class="spinner-arc" cx="12" cy="12" r="9"></circle>
269
+ </svg>
270
+ </span>
250
271
  `
251
272
  : html `<span class="dot ${this.color}"></span>`}
252
273
  </div>
@@ -1 +1 @@
1
- {"version":3,"file":"timeline-entry.js","sourceRoot":"","sources":["../src/timeline-entry.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEI,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU;IAAtC;;QACL,uEAAuE;QAC3D,aAAQ,GAAkB,IAAI,CAAC;QAE3C;;;WAGG;QACS,UAAK,GAAoB,SAAS,CAAC;QAE/C;;;WAGG;QACyC,YAAO,GAAG,KAAK,CAAC;QAE5D;;;;WAIG;QACyC,YAAO,GAAG,KAAK,CAAC;QAE5D,gEAAgE;QAC/C,iBAAY,GAAG,KAAK,CAAC;IAiNxC,CAAC;aA/MiB,WAAM,GAAG;QACvB,MAAM;QACN,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmKF;KACF,AAtKqB,CAsKpB;IAEO,iBAAiB;QACxB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC;YAAE,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACxE,CAAC;IAED,6EAA6E;IACrE,qBAAqB,CAAC,KAAY;QACxC,IAAI,CAAC,YAAY,GAAI,KAAK,CAAC,MAA0B,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IACpG,CAAC;IAEQ,MAAM;QACb,OAAO,IAAI,CAAA;;;;;YAKH,IAAI,CAAC,OAAO;YACZ,CAAC,CAAC,IAAI,CAAA;;;;;eAKH;YACH,CAAC,CAAC,IAAI,CAAA,oBAAoB,IAAI,CAAC,KAAK,WAAW;;;;oCAIvB,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO;kDAClB,IAAI,CAAC,qBAAqB;;cAE9D,IAAI,CAAC,QAAQ;YACb,CAAC,CAAC,IAAI,CAAA,wCAAwC,IAAI,CAAC,QAAQ,mBAAmB;YAC9E,CAAC,CAAC,OAAO;;;;;KAKlB,CAAC;IACJ,CAAC;CACF,CAAA;AAvOa;IAAX,QAAQ,EAAE;+CAAgC;AAM/B;IAAX,QAAQ,EAAE;4CAAoC;AAMH;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CAAiB;AAOhB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CAAiB;AAG3C;IAAhB,KAAK,EAAE;mDAA8B;AAxB3B,aAAa;IADzB,aAAa,CAAC,gBAAgB,CAAC;GACnB,aAAa,CAyOzB","sourcesContent":["import { LitElement, css, html, nothing } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport \"./relative-time.js\";\nimport { tokens } from \"./tokens.js\";\nimport type { StatusPillColor } from \"./status-pill.js\";\n\n/**\n * One event on a `timeline-container`: a dot on the vertical line, an optional\n * headline, a relative timestamp (\"3 hours ago\"), and freely nested content.\n * The connecting line is drawn here — its segment above the dot is hidden on\n * the first entry and the segment below is hidden on the last, so the line caps\n * exactly at the first and last dots. Only meaningful inside a\n * `timeline-container`; demonstrated through it.\n *\n * `datetime` is the entry's one timestamp. A nested element that has its own\n * timestamp prop (e.g. `chat-message`'s `timestamp`) should leave it unset —\n * setting both renders the same time twice.\n *\n * The dot's `color` types the entry using the shared status-pill palette —\n * `primary` by default, plus `neutral`, `info`, `success`, `warning`, and\n * `danger`.\n *\n * Set `compact` for dense, one-line system-status entries: it tightens the\n * vertical spacing and renders the content smaller and muted.\n *\n * Set `running` to replace the dot with an animated gray ring spinner,\n * indicating the entry represents in-progress work; `color` has no visible\n * effect while `running` is set.\n *\n * @element timeline-entry\n * @slot headline - Optional headline/title for the event.\n * @slot - The event content; nest any elements here.\n */\n@customElement(\"timeline-entry\")\nexport class TimelineEntry extends LitElement {\n /** ISO 8601 or SQLite datetime string, rendered as a relative time. */\n @property() datetime: string | null = null;\n\n /**\n * Visual type of the entry's dot, from the shared status-pill palette:\n * `primary` (default), `neutral`, `info`, `success`, `warning`, or `danger`.\n */\n @property() color: StatusPillColor = \"primary\";\n\n /**\n * Dense, one-line presentation for system-status entries: tighter vertical\n * spacing and smaller, muted content.\n */\n @property({ type: Boolean, reflect: true }) compact = false;\n\n /**\n * Shows an animated ring spinner in place of the dot, indicating the entry\n * represents in-progress work. Overrides `color` while set — the spinner\n * always uses the muted/gray palette.\n */\n @property({ type: Boolean, reflect: true }) running = false;\n\n /** Whether the headline slot currently has assigned content. */\n @state() private _hasHeadline = false;\n\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\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 }\n .entry {\n display: flex;\n gap: 0.75rem;\n }\n .rail {\n position: relative;\n flex: 0 0 auto;\n width: 0.75rem;\n }\n .line {\n position: absolute;\n left: 50%;\n width: 2px;\n transform: translateX(-50%);\n background: var(--ui-border, #e2e8f0);\n }\n .line-top {\n top: 0;\n height: 0.5rem;\n }\n .line-bottom {\n top: 0.5rem;\n bottom: 0;\n }\n .dot {\n position: absolute;\n top: 0.125rem;\n left: 50%;\n width: 0.75rem;\n height: 0.75rem;\n transform: translateX(-50%);\n border-radius: 9999px;\n /* Same lighter-on-top token gradient as map-circle/user-avatar; the\n base color is swapped per the color property via the private\n --_dot var. */\n background: linear-gradient(\n to bottom,\n color-mix(in srgb, var(--_dot, var(--ui-primary, #4f46e5)) 70%, #ffffff) 0%,\n color-mix(in srgb, var(--_dot, var(--ui-primary, #4f46e5)) 70%, #000000) 100%\n );\n }\n .dot.neutral {\n --_dot: var(--ui-text-muted, #64748b);\n }\n .dot.info {\n --_dot: var(--ui-info, #0ea5e9);\n }\n .dot.primary {\n --_dot: var(--ui-primary, #4f46e5);\n }\n .dot.success {\n --_dot: var(--ui-success, #16a34a);\n }\n .dot.warning {\n --_dot: var(--ui-warning, #d97706);\n }\n .dot.danger {\n --_dot: var(--ui-danger, #dc2626);\n }\n .spinner {\n position: absolute;\n top: 0.125rem;\n left: 50%;\n width: 0.75rem;\n height: 0.75rem;\n transform: translateX(-50%);\n animation: spin 0.8s linear infinite;\n }\n .spinner-track {\n fill: none;\n stroke: color-mix(in srgb, var(--ui-text-muted, #64748b) 25%, transparent);\n stroke-width: 3;\n }\n .spinner-arc {\n fill: none;\n stroke: var(--ui-text-muted, #64748b);\n stroke-width: 3;\n stroke-linecap: round;\n stroke-dasharray: 42 100;\n }\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n @media (prefers-reduced-motion: reduce) {\n .spinner {\n animation: none;\n }\n }\n @media (forced-colors: active) {\n .spinner-track {\n stroke: GrayText;\n }\n .spinner-arc {\n stroke: CanvasText;\n }\n }\n :host(:first-child) .line-top {\n display: none;\n }\n :host(:last-child) .line-bottom {\n display: none;\n }\n .body {\n flex: 1 1 auto;\n min-width: 0;\n padding-bottom: 1.5rem;\n }\n :host(:last-child) .body {\n padding-bottom: 0;\n }\n .head {\n display: flex;\n align-items: baseline;\n gap: 0.5rem;\n flex-wrap: wrap;\n }\n .headline {\n font-weight: var(--ui-font-weight-semibold, 600);\n font-size: var(--ui-font-size, 0.875rem);\n line-height: var(--ui-line-height-tight, 1.25);\n color: var(--ui-text, #0f172a);\n }\n .headline.empty {\n display: none;\n }\n .time {\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-muted, #64748b);\n }\n .content {\n margin-top: 0.25rem;\n font-size: var(--ui-font-size, 0.875rem);\n line-height: var(--ui-line-height-normal, 1.5);\n color: var(--ui-text, #0f172a);\n }\n :host([compact]) .body {\n padding-bottom: 0.5rem;\n }\n :host([compact]:last-child) .body {\n padding-bottom: 0;\n }\n :host([compact]) .content {\n margin-top: 0.125rem;\n font-size: var(--ui-font-size-sm, 0.75rem);\n color: var(--ui-text-muted, #64748b);\n }\n `,\n ];\n\n override connectedCallback(): void {\n super.connectedCallback();\n if (!this.hasAttribute(\"role\")) this.setAttribute(\"role\", \"listitem\");\n }\n\n /** Collapses the headline when nothing is slotted so the time sits alone. */\n private _onHeadlineSlotChange(event: Event): void {\n this._hasHeadline = (event.target as HTMLSlotElement).assignedNodes({ flatten: true }).length > 0;\n }\n\n override render() {\n return html`\n <div class=\"entry\">\n <div class=\"rail\" aria-hidden=\"true\">\n <span class=\"line line-top\"></span>\n <span class=\"line line-bottom\"></span>\n ${this.running\n ? html`\n <svg class=\"spinner\" viewBox=\"0 0 24 24\">\n <circle class=\"spinner-track\" cx=\"12\" cy=\"12\" r=\"9\"></circle>\n <circle class=\"spinner-arc\" cx=\"12\" cy=\"12\" r=\"9\"></circle>\n </svg>\n `\n : html`<span class=\"dot ${this.color}\"></span>`}\n </div>\n <div class=\"body\">\n <div class=\"head\">\n <span class=\"headline ${this._hasHeadline ? \"\" : \"empty\"}\">\n <slot name=\"headline\" @slotchange=${this._onHeadlineSlotChange}></slot>\n </span>\n ${this.datetime\n ? html`<relative-time class=\"time\" datetime=${this.datetime}></relative-time>`\n : nothing}\n </div>\n <div class=\"content\"><slot></slot></div>\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"timeline-entry\": TimelineEntry;\n }\n}\n"]}
1
+ {"version":3,"file":"timeline-entry.js","sourceRoot":"","sources":["../src/timeline-entry.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEI,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU;IAAtC;;QACL,uEAAuE;QAC3D,aAAQ,GAAkB,IAAI,CAAC;QAE3C;;;WAGG;QACS,UAAK,GAAoB,SAAS,CAAC;QAE/C;;;WAGG;QACyC,YAAO,GAAG,KAAK,CAAC;QAE5D;;;;WAIG;QACyC,YAAO,GAAG,KAAK,CAAC;QAE5D,gEAAgE;QAC/C,iBAAY,GAAG,KAAK,CAAC;IAsOxC,CAAC;aApOiB,WAAM,GAAG;QACvB,MAAM;QACN,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAsLF;KACF,AAzLqB,CAyLpB;IAEO,iBAAiB;QACxB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC;YAAE,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACxE,CAAC;IAED,6EAA6E;IACrE,qBAAqB,CAAC,KAAY;QACxC,IAAI,CAAC,YAAY,GAAI,KAAK,CAAC,MAA0B,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IACpG,CAAC;IAEQ,MAAM;QACb,OAAO,IAAI,CAAA;;;;;YAKH,IAAI,CAAC,OAAO;YACZ,CAAC,CAAC,IAAI,CAAA;;;;;;;eAOH;YACH,CAAC,CAAC,IAAI,CAAA,oBAAoB,IAAI,CAAC,KAAK,WAAW;;;;oCAIvB,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO;kDAClB,IAAI,CAAC,qBAAqB;;cAE9D,IAAI,CAAC,QAAQ;YACb,CAAC,CAAC,IAAI,CAAA,wCAAwC,IAAI,CAAC,QAAQ,mBAAmB;YAC9E,CAAC,CAAC,OAAO;;;;;KAKlB,CAAC;IACJ,CAAC;CACF,CAAA;AA5Pa;IAAX,QAAQ,EAAE;+CAAgC;AAM/B;IAAX,QAAQ,EAAE;4CAAoC;AAMH;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CAAiB;AAOhB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CAAiB;AAG3C;IAAhB,KAAK,EAAE;mDAA8B;AAxB3B,aAAa;IADzB,aAAa,CAAC,gBAAgB,CAAC;GACnB,aAAa,CA8PzB","sourcesContent":["import { LitElement, css, html, nothing } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport \"./relative-time.js\";\nimport { tokens } from \"./tokens.js\";\nimport type { StatusPillColor } from \"./status-pill.js\";\n\n/**\n * One event on a `timeline-container`: a dot on the vertical line, an optional\n * headline, a relative timestamp (\"3 hours ago\"), and freely nested content.\n * The connecting line is drawn here — its segment above the dot is hidden on\n * the first entry and the segment below is hidden on the last, so the line caps\n * exactly at the first and last dots. Only meaningful inside a\n * `timeline-container`; demonstrated through it.\n *\n * `datetime` is the entry's one timestamp. A nested element that has its own\n * timestamp prop (e.g. `chat-message`'s `timestamp`) should leave it unset —\n * setting both renders the same time twice.\n *\n * The dot's `color` types the entry using the shared status-pill palette —\n * `primary` by default, plus `neutral`, `info`, `success`, `warning`, and\n * `danger`.\n *\n * Set `compact` for dense, one-line system-status entries: it tightens the\n * vertical spacing and renders the content smaller and muted.\n *\n * Set `running` to replace the dot with an animated gray ring spinner,\n * indicating the entry represents in-progress work; `color` has no visible\n * effect while `running` is set.\n *\n * @element timeline-entry\n * @slot headline - Optional headline/title for the event.\n * @slot - The event content; nest any elements here.\n */\n@customElement(\"timeline-entry\")\nexport class TimelineEntry extends LitElement {\n /** ISO 8601 or SQLite datetime string, rendered as a relative time. */\n @property() datetime: string | null = null;\n\n /**\n * Visual type of the entry's dot, from the shared status-pill palette:\n * `primary` (default), `neutral`, `info`, `success`, `warning`, or `danger`.\n */\n @property() color: StatusPillColor = \"primary\";\n\n /**\n * Dense, one-line presentation for system-status entries: tighter vertical\n * spacing and smaller, muted content.\n */\n @property({ type: Boolean, reflect: true }) compact = false;\n\n /**\n * Shows an animated ring spinner in place of the dot, indicating the entry\n * represents in-progress work. Overrides `color` while set — the spinner\n * always uses the muted/gray palette.\n */\n @property({ type: Boolean, reflect: true }) running = false;\n\n /** Whether the headline slot currently has assigned content. */\n @state() private _hasHeadline = false;\n\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\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 }\n .entry {\n display: flex;\n gap: 0.75rem;\n }\n .rail {\n position: relative;\n flex: 0 0 auto;\n width: 0.75rem;\n }\n .line {\n position: absolute;\n left: 50%;\n width: 2px;\n transform: translateX(-50%);\n background: var(--ui-border, #e2e8f0);\n }\n .line-top {\n top: 0;\n height: 0.5rem;\n }\n .line-bottom {\n top: 0.5rem;\n bottom: 0;\n }\n .dot {\n position: absolute;\n top: 0.125rem;\n left: 50%;\n width: 0.75rem;\n height: 0.75rem;\n transform: translateX(-50%);\n border-radius: 9999px;\n /* Same lighter-on-top token gradient as map-circle/user-avatar; the\n base color is swapped per the color property via the private\n --_dot var. */\n background: linear-gradient(\n to bottom,\n color-mix(in srgb, var(--_dot, var(--ui-primary, #4f46e5)) 70%, #ffffff) 0%,\n color-mix(in srgb, var(--_dot, var(--ui-primary, #4f46e5)) 70%, #000000) 100%\n );\n }\n .dot.neutral {\n --_dot: var(--ui-text-muted, #64748b);\n }\n .dot.info {\n --_dot: var(--ui-info, #0ea5e9);\n }\n .dot.primary {\n --_dot: var(--ui-primary, #4f46e5);\n }\n .dot.success {\n --_dot: var(--ui-success, #16a34a);\n }\n .dot.warning {\n --_dot: var(--ui-warning, #d97706);\n }\n .dot.danger {\n --_dot: var(--ui-danger, #dc2626);\n }\n .spinner {\n position: absolute;\n top: 0.125rem;\n left: 0;\n display: block;\n width: 0.75rem;\n height: 0.75rem;\n border-radius: 9999px;\n /* Opaque backing so the connecting line is masked exactly like it is\n behind the solid .dot, instead of showing through the ring's\n hollow center and corners. */\n background: var(--ui-surface, #ffffff);\n }\n .spinner svg {\n display: block;\n width: 100%;\n height: 100%;\n }\n .spinner-track {\n fill: none;\n stroke: color-mix(in srgb, var(--ui-text-muted, #64748b) 25%, transparent);\n stroke-width: 3;\n }\n .spinner-arc {\n fill: none;\n stroke: var(--ui-text-muted, #64748b);\n stroke-width: 3;\n stroke-linecap: round;\n /* r=9 gives a 56.55-unit circumference. Keeping the dash and gap\n total equal to that circumference makes the fixed-length arc loop\n seamlessly while its dash offset advances around the static ring. */\n stroke-dasharray: 42.41 14.14;\n animation: spinner-orbit 0.8s linear infinite;\n }\n @keyframes spinner-orbit {\n from {\n stroke-dashoffset: 0;\n }\n to {\n stroke-dashoffset: -56.55;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n .spinner-arc {\n animation: none;\n }\n }\n @media (forced-colors: active) {\n .spinner {\n background: Canvas;\n }\n .spinner-track {\n stroke: GrayText;\n }\n .spinner-arc {\n stroke: CanvasText;\n }\n }\n :host(:first-child) .line-top {\n display: none;\n }\n :host(:last-child) .line-bottom {\n display: none;\n }\n .body {\n flex: 1 1 auto;\n min-width: 0;\n padding-bottom: 1.5rem;\n }\n :host(:last-child) .body {\n padding-bottom: 0;\n }\n .head {\n display: flex;\n align-items: baseline;\n gap: 0.5rem;\n flex-wrap: wrap;\n }\n .headline {\n font-weight: var(--ui-font-weight-semibold, 600);\n font-size: var(--ui-font-size, 0.875rem);\n line-height: var(--ui-line-height-tight, 1.25);\n color: var(--ui-text, #0f172a);\n }\n .headline.empty {\n display: none;\n }\n .time {\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-muted, #64748b);\n }\n .content {\n margin-top: 0.25rem;\n font-size: var(--ui-font-size, 0.875rem);\n line-height: var(--ui-line-height-normal, 1.5);\n color: var(--ui-text, #0f172a);\n }\n :host([compact]) .body {\n padding-bottom: 0.5rem;\n }\n :host([compact]:last-child) .body {\n padding-bottom: 0;\n }\n :host([compact]) .content {\n margin-top: 0.125rem;\n font-size: var(--ui-font-size-sm, 0.75rem);\n color: var(--ui-text-muted, #64748b);\n }\n `,\n ];\n\n override connectedCallback(): void {\n super.connectedCallback();\n if (!this.hasAttribute(\"role\")) this.setAttribute(\"role\", \"listitem\");\n }\n\n /** Collapses the headline when nothing is slotted so the time sits alone. */\n private _onHeadlineSlotChange(event: Event): void {\n this._hasHeadline = (event.target as HTMLSlotElement).assignedNodes({ flatten: true }).length > 0;\n }\n\n override render() {\n return html`\n <div class=\"entry\">\n <div class=\"rail\" aria-hidden=\"true\">\n <span class=\"line line-top\"></span>\n <span class=\"line line-bottom\"></span>\n ${this.running\n ? html`\n <span class=\"spinner\">\n <svg viewBox=\"0 0 24 24\">\n <circle class=\"spinner-track\" cx=\"12\" cy=\"12\" r=\"9\"></circle>\n <circle class=\"spinner-arc\" cx=\"12\" cy=\"12\" r=\"9\"></circle>\n </svg>\n </span>\n `\n : html`<span class=\"dot ${this.color}\"></span>`}\n </div>\n <div class=\"body\">\n <div class=\"head\">\n <span class=\"headline ${this._hasHeadline ? \"\" : \"empty\"}\">\n <slot name=\"headline\" @slotchange=${this._onHeadlineSlotChange}></slot>\n </span>\n ${this.datetime\n ? html`<relative-time class=\"time\" datetime=${this.datetime}></relative-time>`\n : nothing}\n </div>\n <div class=\"content\"><slot></slot></div>\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"timeline-entry\": TimelineEntry;\n }\n}\n"]}
@@ -0,0 +1,15 @@
1
+ /** Configuration supplied by `form-field` to a supported text control. */
2
+ export interface FormFieldControlConfig {
3
+ label: string;
4
+ required: boolean;
5
+ floating: boolean;
6
+ }
7
+ /** Internal protocol key used to configure controls across their shadow boundary. */
8
+ export declare const formFieldControl: unique symbol;
9
+ /** A text control that can render label configuration supplied by `form-field`. */
10
+ export interface FormFieldControl extends HTMLElement {
11
+ [formFieldControl](config: FormFieldControlConfig | null): void;
12
+ }
13
+ /** Returns whether an assigned element implements the internal form-field protocol. */
14
+ export declare function supportsFormFieldControl(element: Element): element is FormFieldControl;
15
+ //# sourceMappingURL=form-field-control.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-field-control.d.ts","sourceRoot":"","sources":["../../src/utils/form-field-control.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,qFAAqF;AACrF,eAAO,MAAM,gBAAgB,eAA+B,CAAC;AAE7D,mFAAmF;AACnF,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,CAAC,gBAAgB,CAAC,CAAC,MAAM,EAAE,sBAAsB,GAAG,IAAI,GAAG,IAAI,CAAC;CACjE;AAED,uFAAuF;AACvF,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,gBAAgB,CAEtF"}
@@ -0,0 +1,7 @@
1
+ /** Internal protocol key used to configure controls across their shadow boundary. */
2
+ export const formFieldControl = Symbol("form-field-control");
3
+ /** Returns whether an assigned element implements the internal form-field protocol. */
4
+ export function supportsFormFieldControl(element) {
5
+ return element instanceof HTMLElement && formFieldControl in element;
6
+ }
7
+ //# sourceMappingURL=form-field-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-field-control.js","sourceRoot":"","sources":["../../src/utils/form-field-control.ts"],"names":[],"mappings":"AAOA,qFAAqF;AACrF,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAO7D,uFAAuF;AACvF,MAAM,UAAU,wBAAwB,CAAC,OAAgB;IACvD,OAAO,OAAO,YAAY,WAAW,IAAI,gBAAgB,IAAI,OAAO,CAAC;AACvE,CAAC","sourcesContent":["/** Configuration supplied by `form-field` to a supported text control. */\nexport interface FormFieldControlConfig {\n label: string;\n required: boolean;\n floating: boolean;\n}\n\n/** Internal protocol key used to configure controls across their shadow boundary. */\nexport const formFieldControl = Symbol(\"form-field-control\");\n\n/** A text control that can render label configuration supplied by `form-field`. */\nexport interface FormFieldControl extends HTMLElement {\n [formFieldControl](config: FormFieldControlConfig | null): void;\n}\n\n/** Returns whether an assigned element implements the internal form-field protocol. */\nexport function supportsFormFieldControl(element: Element): element is FormFieldControl {\n return element instanceof HTMLElement && formFieldControl in element;\n}\n"]}
@@ -13,6 +13,9 @@ Supports two suggestion sources:
13
13
  request. Useful for small/fixed address lists, offline use, or tests.
14
14
  Takes priority over `endpoint` whenever it's non-null.
15
15
 
16
+ Set `clearable` to show an in-field clear action whenever a value is
17
+ present.
18
+
16
19
  ## Install
17
20
 
18
21
  ```js
@@ -23,6 +26,7 @@ import "@f-ewald/components/address-autocomplete.js";
23
26
 
24
27
  ```html
25
28
  <address-autocomplete
29
+ clearable
26
30
  placeholder="Start typing an address…"
27
31
  access-token="pk.your-mapbox-token"
28
32
  ></address-autocomplete>
@@ -36,6 +40,7 @@ import "@f-ewald/components/address-autocomplete.js";
36
40
  | `placeholder` | `placeholder` | `string` | `""` | Placeholder text shown when the input is empty. |
37
41
  | `required` | `required` | `boolean` | `false` | Marks the input as required for native form validation. |
38
42
  | `disabled` | `disabled` | `boolean` | `false` | Disables the input and closes its suggestion popup. |
43
+ | `clearable` | `clearable` | `boolean` | `false` | Shows an in-field clear action while the control has a value. |
39
44
  | `types` | `types` | `string` | `"address"` | Mapbox `types` param, e.g. "address" or "address,poi". |
40
45
  | `endpoint` | `endpoint` | `string` | `"https://api.mapbox.com/search/geocode/v6/forward"` | Geocoding endpoint URL. Defaults to the Mapbox Geocoding v6 forward URL. |
41
46
  | `accessToken` | `access-token` | `string` | `""` | Mapbox access token. Required for requests to succeed. |
@@ -51,6 +56,7 @@ import "@f-ewald/components/address-autocomplete.js";
51
56
  | Event | Description |
52
57
  | --- | --- |
53
58
  | `address-select` | A suggestion was picked; detail: AddressSuggestion. |
59
+ | `input` | Native-compatible input event fired while editing or clearing. |
54
60
 
55
61
  ## Slots
56
62
 
@@ -61,9 +67,12 @@ _None._
61
67
  | Custom property |
62
68
  | --- |
63
69
  | `--ui-border` |
70
+ | `--ui-danger` |
64
71
  | `--ui-focus-ring` |
65
72
  | `--ui-font` |
66
73
  | `--ui-font-size-sm` |
74
+ | `--ui-font-size-xs` |
75
+ | `--ui-font-weight-regular` |
67
76
  | `--ui-line-height-tight` |
68
77
  | `--ui-primary` |
69
78
  | `--ui-radius-sm` |
@@ -18,6 +18,9 @@ Supports two suggestion sources:
18
18
  request. Useful for small/fixed lists, offline use, or tests. Takes
19
19
  priority over `endpoint` whenever it's non-null.
20
20
 
21
+ Set `clearable` to show an in-field clear action whenever a value is
22
+ present.
23
+
21
24
  ## Install
22
25
 
23
26
  ```js
@@ -28,7 +31,7 @@ import "@f-ewald/components/autocomplete-input.js";
28
31
 
29
32
  ```html
30
33
  <form>
31
- <autocomplete-input name="language" placeholder="Start typing a language…"></autocomplete-input>
34
+ <autocomplete-input clearable name="language" placeholder="Start typing a language…"></autocomplete-input>
32
35
  </form>
33
36
  <script type="module">
34
37
  // Local mode: filters client-side, no network request.
@@ -50,6 +53,7 @@ import "@f-ewald/components/autocomplete-input.js";
50
53
  | `placeholder` | `placeholder` | `string` | `""` | Placeholder text shown when the input is empty. |
51
54
  | `required` | `required` | `boolean` | `false` | Marks the input as required for native form validation. |
52
55
  | `disabled` | `disabled` | `boolean` | `false` | Disables the input and closes its suggestion popup. |
56
+ | `clearable` | `clearable` | `boolean` | `false` | Shows an in-field clear action while the control has a value. |
53
57
  | `endpoint` | `endpoint` | `string` | `""` | API endpoint queried in API mode. Ignored when `options` is set. |
54
58
  | `queryParam` | `query-param` | `string` | `"q"` | Query string parameter name the current input text is sent under. |
55
59
  | `debounce` | `debounce` | `number` | `300` | Debounce delay (ms) before firing a request/filter after typing. |
@@ -62,6 +66,7 @@ import "@f-ewald/components/autocomplete-input.js";
62
66
  | Event | Description |
63
67
  | --- | --- |
64
68
  | `option-select` | An option was picked; detail: AutocompleteOption. |
69
+ | `input` | Native-compatible input event fired while editing or clearing. |
65
70
 
66
71
  ## Slots
67
72
 
@@ -72,9 +77,12 @@ _None._
72
77
  | Custom property |
73
78
  | --- |
74
79
  | `--ui-border` |
80
+ | `--ui-danger` |
75
81
  | `--ui-focus-ring` |
76
82
  | `--ui-font` |
77
83
  | `--ui-font-size-sm` |
84
+ | `--ui-font-size-xs` |
85
+ | `--ui-font-weight-regular` |
78
86
  | `--ui-line-height-tight` |
79
87
  | `--ui-primary` |
80
88
  | `--ui-radius-sm` |
@@ -84,6 +84,15 @@ literal values are migrated onto them.
84
84
 
85
85
  - Standard interactive controls share a single `2rem` height; padding is
86
86
  applied by role (inline text, icon-only, standalone) rather than ad hoc.
87
+ - An autocomplete's opt-in in-field clear action remains a `2rem` target with
88
+ an 18px standalone icon. It overlays reserved trailing input padding, so
89
+ enabling or showing it never changes the field's outer dimensions.
90
+ - `form-field[floating-label]` is the explicit text-field exception: supported
91
+ single-line controls grow to `3rem` so an `--ui-font-size-xs` label and the
92
+ entered value remain distinct. Empty, unfocused labels rest at the normal
93
+ placeholder position; focus or content floats the label to the top-left.
94
+ Native and package text areas reserve equivalent top space but retain their
95
+ row-driven height. Unsupported controls keep the normal external label.
87
96
  - Icons are `14px` inline (next to text) and `18px` standalone; icon-only tap
88
97
  targets are `32px`.
89
98
  - Control corners use `--ui-radius-sm` (4px); enclosing surfaces use
@@ -118,6 +127,8 @@ literal values are migrated onto them.
118
127
  duration.
119
128
  - Nonessential transitions and animations must be removed under
120
129
  `prefers-reduced-motion: reduce`.
130
+ - Floating-label position/type transitions use the normal 120–250ms range and
131
+ become instantaneous under reduced motion.
121
132
  - Progress spinners may become static indicators in reduced motion.
122
133
  - Components driven by timers must clean up on disconnect.
123
134
 
@@ -1,9 +1,16 @@
1
1
  # `<dropdown-button>`
2
2
 
3
- A primary-styled button with a label and chevron that opens an anchored
4
- menu of actions — essentially `form-select` minus "current value"
5
- semantics: a menu, not a select. Use for a set of mutually exclusive
6
- next-step actions (e.g. a failed task's Retry / Close / Backlog).
3
+ A button that opens an anchored menu of actions — essentially `form-select`
4
+ minus "current value" semantics: a menu, not a select. Use for a set of
5
+ mutually exclusive next-step actions (e.g. a failed task's Retry / Close /
6
+ Backlog, or a table row's overflow actions).
7
+
8
+ Three trigger presentations share one base: `text` (the default — a
9
+ primary-filled button with a label and a rotating chevron), `text-icon`
10
+ (the same, with `icon` ahead of the label), and `icon` (a borderless,
11
+ square, low-emphasis icon target in the style of `icon-button` — the
12
+ classic "three-dot"/overflow menu, where `label` becomes the accessible
13
+ name rather than visible text).
7
14
 
8
15
  ## Install
9
16
 
@@ -15,14 +22,22 @@ import "@f-ewald/components/dropdown-button.js";
15
22
 
16
23
  ```html
17
24
  <dropdown-button label="Resolve…"></dropdown-button>
25
+ <dropdown-button variant="icon" label="Row actions"></dropdown-button>
18
26
  <script type="module">
27
+ import { iconEllipsisVertical } from "@f-ewald/components/icons.js";
28
+
19
29
  const dropdown = document.querySelector("dropdown-button");
20
30
  dropdown.options = [
21
31
  { value: "retry", label: "Retry" },
22
32
  { value: "close", label: "Close" },
23
- { value: "backlog", label: "Backlog" },
33
+ { value: "delete", label: "Delete", danger: true },
24
34
  ];
25
35
  dropdown.addEventListener("select", (e) => console.log(e.detail.value));
36
+
37
+ // Icon-only overflow ("three dot") menu — label becomes the accessible name.
38
+ const kebab = document.querySelector('dropdown-button[variant="icon"]');
39
+ kebab.icon = iconEllipsisVertical(16);
40
+ kebab.options = [{ value: "delete", label: "Delete", danger: true }];
26
41
  </script>
27
42
  ```
28
43
 
@@ -30,9 +45,11 @@ import "@f-ewald/components/dropdown-button.js";
30
45
 
31
46
  | Property | Attribute | Type | Default | Description |
32
47
  | --- | --- | --- | --- | --- |
33
- | `label` | `label` | `string` | `""` | The trigger button's label. |
48
+ | `label` | `label` | `string` | `""` | The trigger button's label. In the `icon` variant it is the accessible name instead of visible text. |
34
49
  | `options` | _(JS property only)_ | `DropdownOption[]` | `[]` | The menu's actions. |
35
50
  | `disabled` | `disabled` | `boolean` | `false` | Disables the trigger, preventing the menu from opening. |
51
+ | `variant` | `variant` | `DropdownButtonVariant` | `"text"` | Trigger presentation: label only, icon only, or icon + label. |
52
+ | `icon` | _(JS property only)_ | `TemplateResult | null` | `null` | Icon template rendered by the `icon` and `text-icon` variants. |
36
53
 
37
54
  ## Events
38
55
 
@@ -49,6 +66,8 @@ _None._
49
66
  | Custom property |
50
67
  | --- |
51
68
  | `--ui-border` |
69
+ | `--ui-danger` |
70
+ | `--ui-danger-hover` |
52
71
  | `--ui-focus-ring` |
53
72
  | `--ui-font` |
54
73
  | `--ui-font-size-sm` |
@@ -62,3 +81,4 @@ _None._
62
81
  | `--ui-surface` |
63
82
  | `--ui-surface-muted` |
64
83
  | `--ui-text` |
84
+ | `--ui-text-muted` |
@@ -6,6 +6,11 @@ form. Purely presentational — composes whatever control is slotted
6
6
  (`form-select`, `multi-select`, `autocomplete-input`, `ui-checkbox`, etc.)
7
7
  without intercepting its events or value.
8
8
 
9
+ Set `floating-label` for supported text controls (`input`, `textarea`,
10
+ `autocomplete-input`, `address-autocomplete`, and `text-area`). The label
11
+ then rests inside an empty field and moves to a smaller top-left position
12
+ while focused or non-empty. Other controls keep the external label.
13
+
9
14
  The label wraps the default slot for a best-effort visual/click
10
15
  association only: every existing value-entry control encapsulates its
11
16
  real `<input>` inside its own shadow DOM, so there is no light-DOM `id` a
@@ -30,6 +35,12 @@ import "@f-ewald/components/form-field.js";
30
35
  <form-field label="Terms" required error="You must accept to continue">
31
36
  <ui-checkbox label="I agree to the terms"></ui-checkbox>
32
37
  </form-field>
38
+ <form-field floating-label label="Email">
39
+ <input type="email" placeholder="name@example.com" />
40
+ </form-field>
41
+ <form-field floating-label label="Language">
42
+ <autocomplete-input clearable placeholder="Start typing…"></autocomplete-input>
43
+ </form-field>
33
44
  ```
34
45
 
35
46
  ## Attributes / properties
@@ -40,6 +51,7 @@ import "@f-ewald/components/form-field.js";
40
51
  | `hint` | `hint` | `string` | `""` | Optional helper text shown below the control when there's no `error`. |
41
52
  | `error` | `error` | `string` | `""` | Optional error text; replaces the `hint` display when non-empty. |
42
53
  | `required` | `required` | `boolean` | `false` | Shows a required indicator next to the label. |
54
+ | `floatingLabel` | `floating-label` | `boolean` | `false` | Moves labels inside supported text controls until they receive focus or content. |
43
55
 
44
56
  ## Events
45
57
 
@@ -53,11 +65,17 @@ _None._
53
65
 
54
66
  | Custom property |
55
67
  | --- |
68
+ | `--ui-border` |
56
69
  | `--ui-danger` |
70
+ | `--ui-focus-ring` |
57
71
  | `--ui-font` |
58
72
  | `--ui-font-size-sm` |
59
73
  | `--ui-font-size-xs` |
60
74
  | `--ui-font-weight-medium` |
75
+ | `--ui-font-weight-regular` |
61
76
  | `--ui-line-height-tight` |
77
+ | `--ui-primary` |
78
+ | `--ui-radius-sm` |
79
+ | `--ui-surface` |
62
80
  | `--ui-text` |
63
81
  | `--ui-text-muted` |
package/docs/text-area.md CHANGED
@@ -5,6 +5,7 @@ Plain multi-line text field — a thin, tokenized wrapper around a native
5
5
  (autocomplete-input, form-select, ...). Not a rich editor; use `readonly`
6
6
  to display pre-formatted text (e.g. an error message) that the user can
7
7
  still select and copy, typically paired with `<copy-link-button>`.
8
+ Supports `form-field`'s opt-in floating-label mode when slotted inside it.
8
9
 
9
10
  ## Install
10
11
 
@@ -15,7 +16,9 @@ import "@f-ewald/components/text-area.js";
15
16
  ## Usage
16
17
 
17
18
  ```html
18
- <text-area placeholder="Describe the issue…" rows="4"></text-area>
19
+ <form-field floating-label label="Description">
20
+ <text-area placeholder="Describe the issue…" rows="4"></text-area>
21
+ </form-field>
19
22
  <text-area readonly value="Error code: 429 - No deployments available for selected model."></text-area>
20
23
  ```
21
24
 
@@ -45,12 +48,17 @@ _None._
45
48
  | Custom property |
46
49
  | --- |
47
50
  | `--ui-border` |
51
+ | `--ui-danger` |
48
52
  | `--ui-focus-ring` |
49
53
  | `--ui-font` |
50
54
  | `--ui-font-size-sm` |
55
+ | `--ui-font-size-xs` |
56
+ | `--ui-font-weight-regular` |
51
57
  | `--ui-line-height-normal` |
58
+ | `--ui-line-height-tight` |
52
59
  | `--ui-primary` |
53
60
  | `--ui-radius-sm` |
54
61
  | `--ui-surface` |
55
62
  | `--ui-surface-muted` |
56
63
  | `--ui-text` |
64
+ | `--ui-text-muted` |
@@ -69,6 +69,7 @@ _None._
69
69
  | `--ui-line-height-tight` |
70
70
  | `--ui-primary` |
71
71
  | `--ui-success` |
72
+ | `--ui-surface` |
72
73
  | `--ui-text` |
73
74
  | `--ui-text-muted` |
74
75
  | `--ui-warning` |
package/llms.txt CHANGED
@@ -56,15 +56,19 @@ Supports two suggestion sources:
56
56
  request. Useful for small/fixed address lists, offline use, or tests.
57
57
  Takes priority over `endpoint` whenever it's non-null.
58
58
 
59
+ Set `clearable` to show an in-field clear action whenever a value is
60
+ present.
61
+
59
62
  Import: `import "@f-ewald/components/address-autocomplete.js";`
60
63
 
61
- Properties: `value` (attribute `value`) : string, default ""; `placeholder` (attribute `placeholder`) : string, default ""; `required` (attribute `required`) : boolean, default false; `disabled` (attribute `disabled`) : boolean, default false; `types` (attribute `types`) : string, default "address"; `endpoint` (attribute `endpoint`) : string, default "https://api.mapbox.com/search/geocode/v6/forward"; `accessToken` (attribute `access-token`) : string, default ""; `bbox` (attribute `bbox`) : string, default ""; `proximity` (attribute `proximity`) : string, default ""; `debounce` (attribute `debounce`) : number, default 300; `minLength` (attribute `min-length`) : number, default 3; `suggestions` (JS property only) : AddressSuggestion[] | null, default null; `selectedSuggestion` (JS property only) : AddressSuggestion | null, default —
62
- Events: `address-select`
63
- CSS custom properties: `--ui-border`, `--ui-focus-ring`, `--ui-font`, `--ui-font-size-sm`, `--ui-line-height-tight`, `--ui-primary`, `--ui-radius-sm`, `--ui-shadow`, `--ui-surface`, `--ui-surface-muted`, `--ui-text`, `--ui-text-muted`
64
+ Properties: `value` (attribute `value`) : string, default ""; `placeholder` (attribute `placeholder`) : string, default ""; `required` (attribute `required`) : boolean, default false; `disabled` (attribute `disabled`) : boolean, default false; `clearable` (attribute `clearable`) : boolean, default false; `types` (attribute `types`) : string, default "address"; `endpoint` (attribute `endpoint`) : string, default "https://api.mapbox.com/search/geocode/v6/forward"; `accessToken` (attribute `access-token`) : string, default ""; `bbox` (attribute `bbox`) : string, default ""; `proximity` (attribute `proximity`) : string, default ""; `debounce` (attribute `debounce`) : number, default 300; `minLength` (attribute `min-length`) : number, default 3; `suggestions` (JS property only) : AddressSuggestion[] | null, default null; `selectedSuggestion` (JS property only) : AddressSuggestion | null, default —
65
+ Events: `address-select`, `input`
66
+ CSS custom properties: `--ui-border`, `--ui-danger`, `--ui-focus-ring`, `--ui-font`, `--ui-font-size-sm`, `--ui-font-size-xs`, `--ui-font-weight-regular`, `--ui-line-height-tight`, `--ui-primary`, `--ui-radius-sm`, `--ui-shadow`, `--ui-surface`, `--ui-surface-muted`, `--ui-text`, `--ui-text-muted`
64
67
 
65
68
  Example:
66
69
  ```html
67
70
  <address-autocomplete
71
+ clearable
68
72
  placeholder="Start typing an address…"
69
73
  access-token="pk.your-mapbox-token"
70
74
  ></address-autocomplete>
@@ -220,16 +224,19 @@ Supports two suggestion sources:
220
224
  request. Useful for small/fixed lists, offline use, or tests. Takes
221
225
  priority over `endpoint` whenever it's non-null.
222
226
 
227
+ Set `clearable` to show an in-field clear action whenever a value is
228
+ present.
229
+
223
230
  Import: `import "@f-ewald/components/autocomplete-input.js";`
224
231
 
225
- Properties: `value` (attribute `value`) : string, default ""; `placeholder` (attribute `placeholder`) : string, default ""; `required` (attribute `required`) : boolean, default false; `disabled` (attribute `disabled`) : boolean, default false; `endpoint` (attribute `endpoint`) : string, default ""; `queryParam` (attribute `query-param`) : string, default "q"; `debounce` (attribute `debounce`) : number, default 300; `minLength` (attribute `min-length`) : number, default 3; `options` (JS property only) : AutocompleteOption[] | null, default null; `selectedOption` (JS property only) : AutocompleteOption | null, default —
226
- Events: `option-select`
227
- CSS custom properties: `--ui-border`, `--ui-focus-ring`, `--ui-font`, `--ui-font-size-sm`, `--ui-line-height-tight`, `--ui-primary`, `--ui-radius-sm`, `--ui-shadow`, `--ui-surface`, `--ui-surface-muted`, `--ui-text`, `--ui-text-muted`
232
+ Properties: `value` (attribute `value`) : string, default ""; `placeholder` (attribute `placeholder`) : string, default ""; `required` (attribute `required`) : boolean, default false; `disabled` (attribute `disabled`) : boolean, default false; `clearable` (attribute `clearable`) : boolean, default false; `endpoint` (attribute `endpoint`) : string, default ""; `queryParam` (attribute `query-param`) : string, default "q"; `debounce` (attribute `debounce`) : number, default 300; `minLength` (attribute `min-length`) : number, default 3; `options` (JS property only) : AutocompleteOption[] | null, default null; `selectedOption` (JS property only) : AutocompleteOption | null, default —
233
+ Events: `option-select`, `input`
234
+ CSS custom properties: `--ui-border`, `--ui-danger`, `--ui-focus-ring`, `--ui-font`, `--ui-font-size-sm`, `--ui-font-size-xs`, `--ui-font-weight-regular`, `--ui-line-height-tight`, `--ui-primary`, `--ui-radius-sm`, `--ui-shadow`, `--ui-surface`, `--ui-surface-muted`, `--ui-text`, `--ui-text-muted`
228
235
 
229
236
  Example:
230
237
  ```html
231
238
  <form>
232
- <autocomplete-input name="language" placeholder="Start typing a language…"></autocomplete-input>
239
+ <autocomplete-input clearable name="language" placeholder="Start typing a language…"></autocomplete-input>
233
240
  </form>
234
241
  <script type="module">
235
242
  // Local mode: filters client-side, no network request.
@@ -568,28 +575,43 @@ Example:
568
575
 
569
576
  ## <dropdown-button>
570
577
 
571
- A primary-styled button with a label and chevron that opens an anchored
572
- menu of actions — essentially `form-select` minus "current value"
573
- semantics: a menu, not a select. Use for a set of mutually exclusive
574
- next-step actions (e.g. a failed task's Retry / Close / Backlog).
578
+ A button that opens an anchored menu of actions — essentially `form-select`
579
+ minus "current value" semantics: a menu, not a select. Use for a set of
580
+ mutually exclusive next-step actions (e.g. a failed task's Retry / Close /
581
+ Backlog, or a table row's overflow actions).
582
+
583
+ Three trigger presentations share one base: `text` (the default — a
584
+ primary-filled button with a label and a rotating chevron), `text-icon`
585
+ (the same, with `icon` ahead of the label), and `icon` (a borderless,
586
+ square, low-emphasis icon target in the style of `icon-button` — the
587
+ classic "three-dot"/overflow menu, where `label` becomes the accessible
588
+ name rather than visible text).
575
589
 
576
590
  Import: `import "@f-ewald/components/dropdown-button.js";`
577
591
 
578
- Properties: `label` (attribute `label`) : string, default ""; `options` (JS property only) : DropdownOption[], default []; `disabled` (attribute `disabled`) : boolean, default false
592
+ Properties: `label` (attribute `label`) : string, default ""; `options` (JS property only) : DropdownOption[], default []; `disabled` (attribute `disabled`) : boolean, default false; `variant` (attribute `variant`) : DropdownButtonVariant, default "text"; `icon` (JS property only) : TemplateResult | null, default null
579
593
  Events: `select`
580
- CSS custom properties: `--ui-border`, `--ui-focus-ring`, `--ui-font`, `--ui-font-size-sm`, `--ui-font-weight-medium`, `--ui-line-height-tight`, `--ui-on-accent`, `--ui-primary`, `--ui-primary-hover`, `--ui-radius-sm`, `--ui-shadow`, `--ui-surface`, `--ui-surface-muted`, `--ui-text`
594
+ CSS custom properties: `--ui-border`, `--ui-danger`, `--ui-danger-hover`, `--ui-focus-ring`, `--ui-font`, `--ui-font-size-sm`, `--ui-font-weight-medium`, `--ui-line-height-tight`, `--ui-on-accent`, `--ui-primary`, `--ui-primary-hover`, `--ui-radius-sm`, `--ui-shadow`, `--ui-surface`, `--ui-surface-muted`, `--ui-text`, `--ui-text-muted`
581
595
 
582
596
  Example:
583
597
  ```html
584
598
  <dropdown-button label="Resolve…"></dropdown-button>
599
+ <dropdown-button variant="icon" label="Row actions"></dropdown-button>
585
600
  <script type="module">
601
+ import { iconEllipsisVertical } from "@f-ewald/components/icons.js";
602
+
586
603
  const dropdown = document.querySelector("dropdown-button");
587
604
  dropdown.options = [
588
605
  { value: "retry", label: "Retry" },
589
606
  { value: "close", label: "Close" },
590
- { value: "backlog", label: "Backlog" },
607
+ { value: "delete", label: "Delete", danger: true },
591
608
  ];
592
609
  dropdown.addEventListener("select", (e) => console.log(e.detail.value));
610
+
611
+ // Icon-only overflow ("three dot") menu — label becomes the accessible name.
612
+ const kebab = document.querySelector('dropdown-button[variant="icon"]');
613
+ kebab.icon = iconEllipsisVertical(16);
614
+ kebab.options = [{ value: "delete", label: "Delete", danger: true }];
593
615
  </script>
594
616
  ```
595
617
 
@@ -647,6 +669,11 @@ form. Purely presentational — composes whatever control is slotted
647
669
  (`form-select`, `multi-select`, `autocomplete-input`, `ui-checkbox`, etc.)
648
670
  without intercepting its events or value.
649
671
 
672
+ Set `floating-label` for supported text controls (`input`, `textarea`,
673
+ `autocomplete-input`, `address-autocomplete`, and `text-area`). The label
674
+ then rests inside an empty field and moves to a smaller top-left position
675
+ while focused or non-empty. Other controls keep the external label.
676
+
650
677
  The label wraps the default slot for a best-effort visual/click
651
678
  association only: every existing value-entry control encapsulates its
652
679
  real `<input>` inside its own shadow DOM, so there is no light-DOM `id` a
@@ -658,9 +685,9 @@ shadow-encapsulated input for the same reason. The error message uses
658
685
 
659
686
  Import: `import "@f-ewald/components/form-field.js";`
660
687
 
661
- Properties: `label` (attribute `label`) : string, default ""; `hint` (attribute `hint`) : string, default ""; `error` (attribute `error`) : string, default ""; `required` (attribute `required`) : boolean, default false
688
+ Properties: `label` (attribute `label`) : string, default ""; `hint` (attribute `hint`) : string, default ""; `error` (attribute `error`) : string, default ""; `required` (attribute `required`) : boolean, default false; `floatingLabel` (attribute `floating-label`) : boolean, default false
662
689
  Events: none
663
- CSS custom properties: `--ui-danger`, `--ui-font`, `--ui-font-size-sm`, `--ui-font-size-xs`, `--ui-font-weight-medium`, `--ui-line-height-tight`, `--ui-text`, `--ui-text-muted`
690
+ CSS custom properties: `--ui-border`, `--ui-danger`, `--ui-focus-ring`, `--ui-font`, `--ui-font-size-sm`, `--ui-font-size-xs`, `--ui-font-weight-medium`, `--ui-font-weight-regular`, `--ui-line-height-tight`, `--ui-primary`, `--ui-radius-sm`, `--ui-surface`, `--ui-text`, `--ui-text-muted`
664
691
 
665
692
  Example:
666
693
  ```html
@@ -670,6 +697,12 @@ Example:
670
697
  <form-field label="Terms" required error="You must accept to continue">
671
698
  <ui-checkbox label="I agree to the terms"></ui-checkbox>
672
699
  </form-field>
700
+ <form-field floating-label label="Email">
701
+ <input type="email" placeholder="name@example.com" />
702
+ </form-field>
703
+ <form-field floating-label label="Language">
704
+ <autocomplete-input clearable placeholder="Start typing…"></autocomplete-input>
705
+ </form-field>
673
706
  ```
674
707
 
675
708
  ## <form-select>
@@ -1795,16 +1828,19 @@ Plain multi-line text field — a thin, tokenized wrapper around a native
1795
1828
  (autocomplete-input, form-select, ...). Not a rich editor; use `readonly`
1796
1829
  to display pre-formatted text (e.g. an error message) that the user can
1797
1830
  still select and copy, typically paired with `<copy-link-button>`.
1831
+ Supports `form-field`'s opt-in floating-label mode when slotted inside it.
1798
1832
 
1799
1833
  Import: `import "@f-ewald/components/text-area.js";`
1800
1834
 
1801
1835
  Properties: `value` (attribute `value`) : string, default ""; `rows` (attribute `rows`) : number, default 4; `placeholder` (attribute `placeholder`) : string, default ""; `readonly` (attribute `readonly`) : boolean, default false; `disabled` (attribute `disabled`) : boolean, default false
1802
1836
  Events: `input`, `change`
1803
- CSS custom properties: `--ui-border`, `--ui-focus-ring`, `--ui-font`, `--ui-font-size-sm`, `--ui-line-height-normal`, `--ui-primary`, `--ui-radius-sm`, `--ui-surface`, `--ui-surface-muted`, `--ui-text`
1837
+ CSS custom properties: `--ui-border`, `--ui-danger`, `--ui-focus-ring`, `--ui-font`, `--ui-font-size-sm`, `--ui-font-size-xs`, `--ui-font-weight-regular`, `--ui-line-height-normal`, `--ui-line-height-tight`, `--ui-primary`, `--ui-radius-sm`, `--ui-surface`, `--ui-surface-muted`, `--ui-text`, `--ui-text-muted`
1804
1838
 
1805
1839
  Example:
1806
1840
  ```html
1807
- <text-area placeholder="Describe the issue…" rows="4"></text-area>
1841
+ <form-field floating-label label="Description">
1842
+ <text-area placeholder="Describe the issue…" rows="4"></text-area>
1843
+ </form-field>
1808
1844
  <text-area readonly value="Error code: 429 - No deployments available for selected model."></text-area>
1809
1845
  ```
1810
1846
 
@@ -1904,7 +1940,7 @@ Import: `import "@f-ewald/components/timeline-entry.js";`
1904
1940
 
1905
1941
  Properties: `datetime` (attribute `datetime`) : string | null, default null; `color` (attribute `color`) : StatusPillColor, default "primary"; `compact` (attribute `compact`) : boolean, default false; `running` (attribute `running`) : boolean, default false
1906
1942
  Events: none
1907
- CSS custom properties: `--ui-border`, `--ui-danger`, `--ui-font`, `--ui-font-size`, `--ui-font-size-sm`, `--ui-font-weight-semibold`, `--ui-info`, `--ui-line-height-normal`, `--ui-line-height-tight`, `--ui-primary`, `--ui-success`, `--ui-text`, `--ui-text-muted`, `--ui-warning`
1943
+ CSS custom properties: `--ui-border`, `--ui-danger`, `--ui-font`, `--ui-font-size`, `--ui-font-size-sm`, `--ui-font-weight-semibold`, `--ui-info`, `--ui-line-height-normal`, `--ui-line-height-tight`, `--ui-primary`, `--ui-success`, `--ui-surface`, `--ui-text`, `--ui-text-muted`, `--ui-warning`
1908
1944
 
1909
1945
  Example:
1910
1946
  ```html
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@f-ewald/components",
3
3
  "private": false,
4
- "version": "1.22.0",
4
+ "version": "1.23.0",
5
5
  "description": "A collection of universally usable web components for various tasks.",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",