@adia-ai/web-components 0.5.8 → 0.5.10

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 (127) hide show
  1. package/USAGE.md +253 -0
  2. package/components/accordion/accordion.d.ts +22 -1
  3. package/components/action-list/action-list.d.ts +14 -1
  4. package/components/agent-artifact/agent-artifact.d.ts +1 -1
  5. package/components/agent-feedback-bar/agent-feedback-bar.d.ts +1 -1
  6. package/components/agent-questions/agent-questions.d.ts +1 -1
  7. package/components/agent-reasoning/agent-reasoning.d.ts +1 -1
  8. package/components/agent-suggestions/agent-suggestions.d.ts +1 -1
  9. package/components/agent-trace/agent-trace.d.ts +1 -1
  10. package/components/alert/alert.d.ts +1 -1
  11. package/components/avatar/avatar.d.ts +8 -1
  12. package/components/badge/badge.d.ts +1 -1
  13. package/components/block/block.d.ts +1 -1
  14. package/components/breadcrumb/breadcrumb.d.ts +1 -1
  15. package/components/button/button.d.ts +1 -1
  16. package/components/canvas/canvas.d.ts +1 -1
  17. package/components/card/card.d.ts +1 -1
  18. package/components/chart/chart.d.ts +1 -1
  19. package/components/chart-legend/chart-legend.d.ts +1 -1
  20. package/components/chat-thread/chat-thread.d.ts +40 -1
  21. package/components/code/code.css +1 -1
  22. package/components/col/col.a2ui.json +4 -4
  23. package/components/col/col.d.ts +2 -2
  24. package/components/col/col.yaml +2 -2
  25. package/components/command/command.d.ts +1 -1
  26. package/components/demo-toggle/demo-toggle.d.ts +1 -1
  27. package/components/description-list/description-list.d.ts +1 -1
  28. package/components/divider/divider.d.ts +1 -1
  29. package/components/drawer/drawer.d.ts +1 -1
  30. package/components/embed/embed.d.ts +1 -1
  31. package/components/empty-state/class.js +10 -4
  32. package/components/empty-state/empty-state.a2ui.json +5 -0
  33. package/components/empty-state/empty-state.css +36 -0
  34. package/components/empty-state/empty-state.d.ts +6 -1
  35. package/components/empty-state/empty-state.test.js +77 -0
  36. package/components/empty-state/empty-state.yaml +9 -0
  37. package/components/feed/feed.css +1 -1
  38. package/components/feed/feed.d.ts +106 -13
  39. package/components/field/field.d.ts +1 -1
  40. package/components/fields/fields.d.ts +1 -1
  41. package/components/grid/grid.d.ts +1 -1
  42. package/components/heatmap/heatmap.d.ts +1 -1
  43. package/components/icon/icon.d.ts +1 -1
  44. package/components/image/image.d.ts +1 -1
  45. package/components/input/class.js +2 -1
  46. package/components/input/input.a2ui.json +5 -0
  47. package/components/input/input.d.ts +14 -0
  48. package/components/input/input.test.js +99 -0
  49. package/components/input/input.yaml +14 -0
  50. package/components/inspector/inspector.d.ts +1 -1
  51. package/components/kbd/kbd.d.ts +1 -1
  52. package/components/link/link.d.ts +1 -1
  53. package/components/list/list.d.ts +10 -1
  54. package/components/menu/menu-divider.a2ui.json +41 -0
  55. package/components/menu/menu-divider.yaml +15 -0
  56. package/components/menu/menu-item.a2ui.json +77 -0
  57. package/components/menu/menu-item.yaml +45 -0
  58. package/components/menu/menu.d.ts +17 -1
  59. package/components/modal/modal.d.ts +1 -1
  60. package/components/nav/nav.css +1 -1
  61. package/components/nav/nav.d.ts +1 -1
  62. package/components/nav-group/nav-group.d.ts +1 -1
  63. package/components/nav-item/nav-item.d.ts +1 -1
  64. package/components/noodles/noodles.d.ts +1 -1
  65. package/components/page/page.d.ts +1 -1
  66. package/components/pagination/pagination.d.ts +1 -1
  67. package/components/pane/pane.d.ts +1 -1
  68. package/components/pipeline-status/pipeline-status.d.ts +1 -1
  69. package/components/popover/popover.d.ts +1 -1
  70. package/components/progress/progress.d.ts +1 -1
  71. package/components/progress-row/progress-row.d.ts +1 -1
  72. package/components/range/range.css +1 -1
  73. package/components/rating/rating.d.ts +8 -0
  74. package/components/richtext/richtext.a2ui.json +4 -4
  75. package/components/richtext/richtext.d.ts +2 -2
  76. package/components/richtext/richtext.yaml +2 -2
  77. package/components/row/row.d.ts +1 -1
  78. package/components/segment/segment.d.ts +1 -1
  79. package/components/select/class.js +28 -0
  80. package/components/select/select.css +1 -1
  81. package/components/select/select.d.ts +14 -0
  82. package/components/select/select.yaml +28 -0
  83. package/components/skeleton/skeleton.d.ts +1 -1
  84. package/components/slider/class.js +20 -50
  85. package/components/slider/slider.css +1 -1
  86. package/components/stack/stack.d.ts +1 -1
  87. package/components/step-progress/step-progress.d.ts +1 -1
  88. package/components/stepper/stepper-item.a2ui.json +74 -0
  89. package/components/stepper/stepper-item.yaml +45 -0
  90. package/components/stepper/stepper.d.ts +13 -1
  91. package/components/stream/stream.d.ts +1 -1
  92. package/components/swatch/swatch.css +1 -1
  93. package/components/swatch/swatch.d.ts +1 -1
  94. package/components/swiper/swiper.d.ts +1 -1
  95. package/components/switch/switch.css +1 -1
  96. package/components/table/table.d.ts +1 -1
  97. package/components/table-toolbar/table-toolbar.d.ts +1 -1
  98. package/components/tabs/tabs.d.ts +12 -1
  99. package/components/tag/tag.d.ts +1 -1
  100. package/components/text/text.d.ts +64 -13
  101. package/components/text/text.test.js +8 -2
  102. package/components/textarea/class.js +7 -1
  103. package/components/textarea/textarea.a2ui.json +5 -0
  104. package/components/textarea/textarea.yaml +14 -0
  105. package/components/timeline/timeline.d.ts +20 -1
  106. package/components/toast/class.js +9 -0
  107. package/components/toast/toast.d.ts +9 -5
  108. package/components/toast/toast.yaml +16 -0
  109. package/components/toggle-group/toggle-group.d.ts +12 -1
  110. package/components/toggle-group/toggle-option.a2ui.json +61 -0
  111. package/components/toggle-group/toggle-option.yaml +33 -0
  112. package/components/toggle-scheme/toggle-scheme.d.ts +1 -1
  113. package/components/toolbar/toolbar-group.a2ui.json +41 -0
  114. package/components/toolbar/toolbar-group.yaml +16 -0
  115. package/components/toolbar/toolbar.d.ts +4 -1
  116. package/components/tooltip/tooltip.css +2 -2
  117. package/components/tooltip/tooltip.d.ts +1 -1
  118. package/components/tree/tree.css +1 -1
  119. package/components/tree/tree.d.ts +18 -1
  120. package/core/form.d.ts +35 -0
  121. package/core/form.js +93 -0
  122. package/core/signals.d.ts +28 -0
  123. package/index.d.ts +2 -2
  124. package/package.json +1 -1
  125. package/styles/colors/semantics.css +6 -0
  126. package/styles/tokens.css +3 -0
  127. package/styles/typography.css +2 -0
@@ -42,16 +42,17 @@ export class UISlider extends UIFormElement {
42
42
  step: { type: Number, default: 1, reflect: true },
43
43
  label: { type: String, default: '', reflect: true },
44
44
  suffix: { type: String, default: '', reflect: true },
45
- // §184 (v0.5.5, FEEDBACK-08 §4): declarative debounce for the
46
- // `input` event when driving expensive computation (palette regen,
47
- // shader compile, large list reflow). When > 0, value updates +
48
- // visual feedback are immediate but `input` event emission is
49
- // debounced only the FINAL value in the throttle window dispatches.
50
- // `change` fires unthrottled on pointerup / track click / keyboard;
51
- // any pending `input` flushes BEFORE `change` so consumers always
52
- // see input→input→…→input→change ordering. throttle="0" (default)
45
+ // §184 (v0.5.5, FEEDBACK-08 §4) §220 (v0.5.9, FEEDBACK-14 §3):
46
+ // declarative trailing-debounce on `input` for expensive consumers
47
+ // (palette regen, shader compile, large list reflow). When > 0,
48
+ // value updates + visual feedback are immediate but `input` is
49
+ // collapsed across the window. `change` fires unthrottled on
50
+ // pointerup / track click / keyboard; any pending `input` flushes
51
+ // BEFORE `change` so consumers always see
52
+ // input→input→…→input→change ordering. throttle="0" (default)
53
53
  // preserves the pre-§184 every-pointer-move-fires-input behavior.
54
- throttle: { type: Number, default: 0, reflect: true },
54
+ // The mechanism graduated to UIFormElement at v0.5.9 §220 — slider
55
+ // delegates via scheduleThrottledInput() + flushPendingInput().
55
56
  };
56
57
 
57
58
  static template = () => null;
@@ -62,11 +63,6 @@ export class UISlider extends UIFormElement {
62
63
  #trackEl = null;
63
64
  #thumbEl = null;
64
65
  #dragging = false;
65
- // §184 (v0.5.5, FEEDBACK-08 §4): debounce timer for the `input`
66
- // event. When `throttle > 0`, #setValue stores a pending dispatch
67
- // here + restarts the timer on every value change. Flushed before
68
- // any `change` event so input always precedes change.
69
- #inputTimer = null;
70
66
 
71
67
  get #pct() {
72
68
  const range = this.max - this.min;
@@ -171,34 +167,11 @@ export class UISlider extends UIFormElement {
171
167
  #setValue(v) {
172
168
  if (v === this.value) return;
173
169
  this.value = v;
174
- // §184: when throttle > 0, debounce the `input` dispatch.
175
- // The value update + UI is still immediate; only event emission is
176
- // accumulated. Same value can dispatch input multiple times across
177
- // pointer moves, but the throttle collapses them to one trailing
178
- // emission at quiet+throttle ms.
179
- const t = Number(this.throttle) || 0;
180
- if (t > 0) {
181
- if (this.#inputTimer != null) clearTimeout(this.#inputTimer);
182
- this.#inputTimer = setTimeout(() => {
183
- this.#inputTimer = null;
184
- this.dispatchEvent(new CustomEvent('input', { bubbles: true, detail: { value: this.value } }));
185
- }, t);
186
- return;
187
- }
188
- this.dispatchEvent(new CustomEvent('input', { bubbles: true, detail: { value: this.value } }));
189
- }
190
-
191
- /**
192
- * §184: flush any pending throttled `input` dispatch synchronously.
193
- * Called before `change` so consumers see the trailing input event
194
- * BEFORE the change commit. No-op when no timer is pending.
195
- */
196
- #flushInput() {
197
- if (this.#inputTimer != null) {
198
- clearTimeout(this.#inputTimer);
199
- this.#inputTimer = null;
200
- this.dispatchEvent(new CustomEvent('input', { bubbles: true, detail: { value: this.value } }));
201
- }
170
+ // §220 (v0.5.9): delegate to UIFormElement's shared throttle helper.
171
+ // When `this.throttle > 0`, the dispatch is trailing-debounced
172
+ // (collapses pointer-move bursts to one emission). When 0, fires
173
+ // synchronously.
174
+ this.scheduleThrottledInput();
202
175
  }
203
176
 
204
177
  #onPointerDown = (e) => {
@@ -220,14 +193,14 @@ export class UISlider extends UIFormElement {
220
193
  this.#thumbEl.releasePointerCapture(e.pointerId);
221
194
  this.#thumbEl.removeEventListener('pointermove', this.#onPointerMove);
222
195
  this.#thumbEl.removeEventListener('pointerup', this.#onPointerUp);
223
- this.#flushInput(); // §184: pending throttled input fires before change
196
+ this.flushPendingInput(); // §220 (was §184 #flushInput): pending throttled input fires before change
224
197
  this.dispatchEvent(new CustomEvent('change', { bubbles: true, detail: { value: this.value } }));
225
198
  };
226
199
 
227
200
  #onTrackClick = (e) => {
228
201
  if (this.disabled || e.target === this.#thumbEl) return;
229
202
  this.#setValue(this.#valueFromX(e.clientX));
230
- this.#flushInput(); // §184: ensure trailing input precedes change
203
+ this.flushPendingInput(); // §220 (was §184 #flushInput): ensure trailing input precedes change
231
204
  this.dispatchEvent(new CustomEvent('change', { bubbles: true, detail: { value: this.value } }));
232
205
  };
233
206
 
@@ -245,7 +218,7 @@ export class UISlider extends UIFormElement {
245
218
  }
246
219
  e.preventDefault();
247
220
  this.#setValue(this.#snap(v));
248
- this.#flushInput(); // §184: trailing input fires before change
221
+ this.flushPendingInput(); // §220 (was §184 #flushInput): trailing input fires before change
249
222
  this.dispatchEvent(new CustomEvent('change', { bubbles: true, detail: { value: this.value } }));
250
223
  };
251
224
 
@@ -256,11 +229,8 @@ export class UISlider extends UIFormElement {
256
229
  this.#thumbEl?.removeEventListener('pointermove', this.#onPointerMove);
257
230
  this.#thumbEl?.removeEventListener('pointerup', this.#onPointerUp);
258
231
  this.removeEventListener('keydown', this.#onKey);
259
- // §184: drop any pending throttle timer (no flush element is gone)
260
- if (this.#inputTimer != null) {
261
- clearTimeout(this.#inputTimer);
262
- this.#inputTimer = null;
263
- }
232
+ // §220 (v0.5.9): UIFormElement.disconnected() auto-drops the pending
233
+ // throttled input dispatch via super.disconnected().
264
234
  this.#trackEl = null;
265
235
  this.#thumbEl = null;
266
236
  }
@@ -143,7 +143,7 @@
143
143
  [slot="hint"] {
144
144
  display: block;
145
145
  margin-top: var(--slider-hint-mt, var(--a-space-1));
146
- font-size: var(--slider-hint-size, var(--a-fine-size));
146
+ font-size: var(--slider-hint-size, var(--a-ui-xs));
147
147
  color: var(--slider-hint-fg, var(--a-fg-muted));
148
148
  line-height: var(--slider-hint-lh, 1.4);
149
149
  }
@@ -4,7 +4,7 @@
4
4
  * @see https://ui-kit.exe.xyz/site/components/stack
5
5
  *
6
6
  * Type declarations generated by scripts/build/dts-codegen.mjs from
7
- * the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
7
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
8
8
  * run `npm run build:components`, then `npm run codegen:dts` to
9
9
  * regenerate; or hand-author this file fully if rich event types are
10
10
  * needed beyond what the yaml `events:` block can express.
@@ -10,7 +10,7 @@ primitive.
10
10
  * @see https://ui-kit.exe.xyz/site/components/step-progress
11
11
  *
12
12
  * Type declarations generated by scripts/build/dts-codegen.mjs from
13
- * the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
13
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
14
14
  * run `npm run build:components`, then `npm run codegen:dts` to
15
15
  * regenerate; or hand-author this file fully if rich event types are
16
16
  * needed beyond what the yaml `events:` block can express.
@@ -0,0 +1,74 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://adiaui.dev/a2ui/v0_9/components/StepperItem.json",
4
+ "title": "StepperItem",
5
+ "description": "Child of `<stepper-ui>`. One stage in a multi-step flow with status (idle | active | completed | error) + optional icon + description.",
6
+ "type": "object",
7
+ "allOf": [
8
+ {
9
+ "$ref": "common_types.json#/$defs/ComponentCommon"
10
+ },
11
+ {
12
+ "$ref": "common_types.json#/$defs/CatalogComponentCommon"
13
+ }
14
+ ],
15
+ "properties": {
16
+ "description": {
17
+ "description": "Secondary description line under the label.",
18
+ "type": "string",
19
+ "default": ""
20
+ },
21
+ "component": {
22
+ "const": "StepperItem"
23
+ },
24
+ "icon": {
25
+ "description": "Optional leading Phosphor icon name; overrides the auto-stamped numeric badge.",
26
+ "type": "string",
27
+ "default": ""
28
+ },
29
+ "status": {
30
+ "description": "Canonical stage-progress state. Mutually exclusive (prevents the\n`active && completed` footgun the prior multi-Boolean shape allowed).",
31
+ "type": "string",
32
+ "enum": [
33
+ "idle",
34
+ "active",
35
+ "completed",
36
+ "error"
37
+ ],
38
+ "default": "idle"
39
+ },
40
+ "text": {
41
+ "description": "Stage label.",
42
+ "type": "string",
43
+ "default": ""
44
+ }
45
+ },
46
+ "required": [
47
+ "component"
48
+ ],
49
+ "unevaluatedProperties": false,
50
+ "x-adiaui": {
51
+ "anti_patterns": [],
52
+ "category": "navigation",
53
+ "composes": [],
54
+ "events": {},
55
+ "examples": [],
56
+ "keywords": [],
57
+ "name": "UIStepperItem",
58
+ "related": [],
59
+ "slots": {
60
+ "description": {
61
+ "description": "Custom description content; falls through to `[description]` prop if not slotted."
62
+ },
63
+ "label": {
64
+ "description": "Custom label content; falls through to `[text]` prop if not slotted."
65
+ }
66
+ },
67
+ "states": [],
68
+ "synonyms": {},
69
+ "tag": "stepper-item-ui",
70
+ "tokens": {},
71
+ "traits": [],
72
+ "version": 1
73
+ }
74
+ }
@@ -0,0 +1,45 @@
1
+ # Edit this file; run `npm run build:components` to regenerate a2ui.json.
2
+ #
3
+ # §228 (v0.5.9): authored to close the §229 baseline class-export-undeclared
4
+ # drift for UIStepperItem. Ships as a sibling class in stepper/class.js
5
+ # + is registered alongside UIStepper.
6
+
7
+ # Child component of <stepper-ui>. Surface only inside that parent.
8
+ $schema: ../../../../scripts/schemas/component.yaml.schema.json
9
+ name: UIStepperItem
10
+ tag: stepper-item-ui
11
+ component: StepperItem
12
+ category: navigation
13
+ version: 1
14
+ description: |-
15
+ Child of `<stepper-ui>`. One stage in a multi-step flow with status (idle | active | completed | error) + optional icon + description.
16
+
17
+ props:
18
+ text:
19
+ description: Stage label.
20
+ type: string
21
+ default: ""
22
+ description:
23
+ description: Secondary description line under the label.
24
+ type: string
25
+ default: ""
26
+ icon:
27
+ description: Optional leading Phosphor icon name; overrides the auto-stamped numeric badge.
28
+ type: string
29
+ default: ""
30
+ status:
31
+ description: |-
32
+ Canonical stage-progress state. Mutually exclusive (prevents the
33
+ `active && completed` footgun the prior multi-Boolean shape allowed).
34
+ type: string
35
+ default: idle
36
+ enum:
37
+ - idle
38
+ - active
39
+ - completed
40
+ - error
41
+ slots:
42
+ label:
43
+ description: Custom label content; falls through to `[text]` prop if not slotted.
44
+ description:
45
+ description: Custom description content; falls through to `[description]` prop if not slotted.
@@ -4,7 +4,7 @@
4
4
  * @see https://ui-kit.exe.xyz/site/components/stepper
5
5
  *
6
6
  * Type declarations generated by scripts/build/dts-codegen.mjs from
7
- * the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
7
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
8
8
  * run `npm run build:components`, then `npm run codegen:dts` to
9
9
  * regenerate; or hand-author this file fully if rich event types are
10
10
  * needed beyond what the yaml `events:` block can express.
@@ -18,3 +18,15 @@ export class UIStepper extends UIElement {
18
18
  /** Current step index (0-based). */
19
19
  step: number;
20
20
  }
21
+
22
+ export class UIStepperItem extends UIElement {
23
+ /** Secondary description line under the label. */
24
+ description: string;
25
+ /** Optional leading Phosphor icon name; overrides the auto-stamped numeric badge. */
26
+ icon: string;
27
+ /** Canonical stage-progress state. Mutually exclusive (prevents the
28
+ `active && completed` footgun the prior multi-Boolean shape allowed). */
29
+ status: 'idle' | 'active' | 'completed' | 'error';
30
+ /** Stage label. */
31
+ text: string;
32
+ }
@@ -4,7 +4,7 @@
4
4
  * @see https://ui-kit.exe.xyz/site/components/stream
5
5
  *
6
6
  * Type declarations generated by scripts/build/dts-codegen.mjs from
7
- * the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
7
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
8
8
  * run `npm run build:components`, then `npm run codegen:dts` to
9
9
  * regenerate; or hand-author this file fully if rich event types are
10
10
  * needed beyond what the yaml `events:` block can express.
@@ -261,7 +261,7 @@
261
261
  border-radius: var(--a-radius-xs);
262
262
  transition: color 100ms ease-out, background 100ms ease-out;
263
263
  }
264
- :scope > [data-copy]:hover { color: var(--a-fg); background: var(--a-bg-2); }
264
+ :scope > [data-copy]:hover { color: var(--a-fg); background: var(--a-bg-muted); }
265
265
  :scope > [data-copy]:focus-visible {
266
266
  outline: var(--swatch-select-ring-width) solid var(--swatch-select-ring);
267
267
  outline-offset: 1px;
@@ -9,7 +9,7 @@ spacing demo pages.
9
9
  * @see https://ui-kit.exe.xyz/site/components/swatch
10
10
  *
11
11
  * Type declarations generated by scripts/build/dts-codegen.mjs from
12
- * the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
12
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
13
13
  * run `npm run build:components`, then `npm run codegen:dts` to
14
14
  * regenerate; or hand-author this file fully if rich event types are
15
15
  * needed beyond what the yaml `events:` block can express.
@@ -4,7 +4,7 @@
4
4
  * @see https://ui-kit.exe.xyz/site/components/swiper
5
5
  *
6
6
  * Type declarations generated by scripts/build/dts-codegen.mjs from
7
- * the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
7
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
8
8
  * run `npm run build:components`, then `npm run codegen:dts` to
9
9
  * regenerate; or hand-author this file fully if rich event types are
10
10
  * needed beyond what the yaml `events:` block can express.
@@ -110,7 +110,7 @@ switch-ui[checked] [slot="thumb"] {
110
110
  [slot="hint"] {
111
111
  display: block;
112
112
  margin-top: var(--switch-hint-mt, var(--a-space-1));
113
- font-size: var(--switch-hint-size, var(--a-fine-size));
113
+ font-size: var(--switch-hint-size, var(--a-ui-xs));
114
114
  color: var(--switch-hint-fg, var(--a-fg-muted));
115
115
  line-height: var(--switch-hint-lh, 1.4);
116
116
  }
@@ -4,7 +4,7 @@
4
4
  * @see https://ui-kit.exe.xyz/site/components/table
5
5
  *
6
6
  * Type declarations generated by scripts/build/dts-codegen.mjs from
7
- * the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
7
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
8
8
  * run `npm run build:components`, then `npm run codegen:dts` to
9
9
  * regenerate; or hand-author this file fully if rich event types are
10
10
  * needed beyond what the yaml `events:` block can express.
@@ -4,7 +4,7 @@
4
4
  * @see https://ui-kit.exe.xyz/site/components/table-toolbar
5
5
  *
6
6
  * Type declarations generated by scripts/build/dts-codegen.mjs from
7
- * the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
7
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
8
8
  * run `npm run build:components`, then `npm run codegen:dts` to
9
9
  * regenerate; or hand-author this file fully if rich event types are
10
10
  * needed beyond what the yaml `events:` block can express.
@@ -4,7 +4,7 @@
4
4
  * @see https://ui-kit.exe.xyz/site/components/tabs
5
5
  *
6
6
  * Type declarations generated by scripts/build/dts-codegen.mjs from
7
- * the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
7
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
8
8
  * run `npm run build:components`, then `npm run codegen:dts` to
9
9
  * regenerate; or hand-author this file fully if rich event types are
10
10
  * needed beyond what the yaml `events:` block can express.
@@ -34,3 +34,14 @@ export class UITabs extends UIElement {
34
34
  ): void;
35
35
  addEventListener(type: 'change', listener: (ev: TabsChangeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
36
36
  }
37
+
38
+ export class UITab extends UIElement {
39
+ /** Whether the tab is selectable. */
40
+ disabled: boolean;
41
+ /** Optional leading icon name (Phosphor) for the tab button. */
42
+ icon: string;
43
+ /** Tab button label (rendered by parent <tabs-ui>). */
44
+ text: string;
45
+ /** Stable id for the tab. Parent uses this to coordinate active state. */
46
+ value: string;
47
+ }
@@ -4,7 +4,7 @@
4
4
  * @see https://ui-kit.exe.xyz/site/components/tag
5
5
  *
6
6
  * Type declarations generated by scripts/build/dts-codegen.mjs from
7
- * the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
7
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
8
8
  * run `npm run build:components`, then `npm run codegen:dts` to
9
9
  * regenerate; or hand-author this file fully if rich event types are
10
10
  * needed beyond what the yaml `events:` block can express.
@@ -1,26 +1,77 @@
1
1
  /**
2
- * `<text-ui>` — Typography wrapper that applies role tokens. Supports truncation and line clamping.
2
+ * `<text-ui>` — Typography wrapper that applies role tokens. Supports
3
+ * truncation and line clamping.
3
4
  *
4
5
  * @see https://ui-kit.exe.xyz/site/components/text
5
6
  *
6
- * Type declarations generated by scripts/build/dts-codegen.mjs from
7
- * the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
8
- * run `npm run build:components`, then `npm run codegen:dts` to
9
- * regenerate; or hand-author this file fully if rich event types are
10
- * needed beyond what the yaml `events:` block can express.
7
+ * HAND-AUTHORED (not codegen'd) per §247 (v0.5.10) — the yaml `enum:` schema
8
+ * carries variant names but not per-value descriptions; codegen emits a
9
+ * single property-level JSDoc and loses the per-variant disambiguation that
10
+ * the §221k chooser guide documents. Hand-authored .d.ts carries per-variant
11
+ * JSDoc inline so IDE hover surfaces the disambiguation at authoring time.
12
+ * Also carries the FB-23 §2 ARIA-role disclaimer on the property doc.
13
+ * `dts-codegen.mjs` keeps this file in its `HAND_AUTHORED_DTS` skip list.
11
14
  */
12
15
 
13
16
  import { UIElement } from '../../core/element.js';
14
17
 
18
+ /**
19
+ * Typography variants — visual rank from `display` (largest, hero) to
20
+ * `code` (inline monospace). Pick by intent, not by visual size — every
21
+ * variant has a distinct typographic role per §221k chooser guide.
22
+ *
23
+ * See `packages/web-components/USAGE.md` "v0.5.9 — Consumer-feedback
24
+ * discoverability sweep" §221k for the picker heuristics.
25
+ */
26
+ export type UITextVariant =
27
+ /** Default body copy. 14px / regular. Paragraphs, multi-line content, running prose. */
28
+ | 'body'
29
+ /** Top-level hero / brand display. Tallest visual rank. Use for page-level hero one-liners. */
30
+ | 'display'
31
+ /** Page title (visual rank H1). Largest under display. Use at the top of an authoritative page or dialog. */
32
+ | 'title'
33
+ /** Major page heading (visual rank H2). 16-18px / bold. Use for major sub-section dividers. */
34
+ | 'heading'
35
+ /** Sub-landmark within a section (visual rank H3). 14px / semibold. Use for card titles within a section. */
36
+ | 'subsection'
37
+ /** Inline form-group / navlist heading (visual rank H4). Small-cap. Use for form group labels, nav list headings. */
38
+ | 'section'
39
+ /** Annotation under a primary line — smaller + muted. Use for image captions, footnotes. */
40
+ | 'caption'
41
+ /** Form-control label (above an `<input-ui>` / `<select-ui>` etc). UI-sized + medium-weight. Use for field labels bound to form controls. */
42
+ | 'label'
43
+ /** Eyebrow text above a `title`. UPPERCASE + small + tracking. Use for content eyebrows (NOT form labels — use `label` for those). */
44
+ | 'kicker'
45
+ /** Sub-title under a `title`. One-line lead, slightly larger than body. Use for the lead sentence after a title. */
46
+ | 'deck'
47
+ /** Numeric KPI / big-number stat. Bold + large. Use for dashboard metric numbers. */
48
+ | 'metric'
49
+ /** Inline monospace code reference. Use for `\`code\`` inline within prose. */
50
+ | 'code';
51
+
15
52
  export class UIText extends UIElement {
16
- /** Multi-line clamp count (0 = no clamp) */
17
- lines: number;
18
- /** When true, applies stronger emphasis (heavier weight + accent color). Styled via :scope[strong] in text.css. Use instead of variant=heading when you want a single emphasized word inline in body copy. */
53
+ /**
54
+ * Typography variant — sets design-role tokens (size / weight / tracking /
55
+ * color / leading) per the L0 typography token family.
56
+ *
57
+ * **PRESENTATIONAL-ONLY (§247, FB-23 §2).** `<text-ui variant="heading">`
58
+ * does NOT set `role="heading"` + `aria-level` on the host. Document-outline
59
+ * assistive technology will treat the element as `role="generic"`. For
60
+ * **semantic** headings (screen-reader heading-navigation, document
61
+ * outline), wrap with native `<h1>`-`<h6>` OR add
62
+ * `role="heading" aria-level="N"` on the host element directly.
63
+ *
64
+ * For visual-only labels (eyebrows, kickers, captions, deck), the
65
+ * presentational default is correct. The §221k chooser guide in USAGE.md
66
+ * documents the picker heuristics.
67
+ */
68
+ variant: UITextVariant;
69
+ /** When true, applies stronger emphasis (heavier weight + accent color). Styled via `:scope[strong]` in text.css. Use instead of `variant="heading"` when you want a single emphasized word inline in body copy. */
19
70
  strong: boolean;
20
- /** Display text content. The main payload field for Text components extracted from HTML. */
21
- textContent: string;
22
71
  /** Single-line truncation with ellipsis. Ignored when `lines` is set. */
23
72
  truncate: boolean;
24
- /** Typography variant sets role tokens (size/weight/tracking/color). */
25
- variant: 'body' | 'heading' | 'title' | 'subsection' | 'display' | 'caption' | 'label' | 'kicker' | 'deck' | 'section' | 'metric' | 'code';
73
+ /** Multi-line clamp count (0 = no clamp). Sets `--_text-lines` for `-webkit-line-clamp`. */
74
+ lines: number;
75
+ /** Display text content. The main payload field for Text components extracted from HTML. */
76
+ textContent: string;
26
77
  }
@@ -91,9 +91,15 @@ describe('text-ui §210 — variant enum vs CSS rule completeness', () => {
91
91
  // ── a2ui.json enum and .d.ts union and CSS rules are mutually consistent ──
92
92
  it('a2ui.json variant enum matches .d.ts union and CSS rules 1:1', () => {
93
93
  const a2uiVariants = TEXT_A2UI.properties.variant.enum;
94
+ // §247b (v0.5.10): text.d.ts was hand-authored to use a named type alias
95
+ // `UITextVariant` instead of an inline union (per-variant JSDoc + ARIA-role
96
+ // disclaimer). Match either the type-alias body OR an inline union; both
97
+ // forms expose the same set of string-literal members.
98
+ const dtsAliasMatch = TEXT_DTS.match(/export\s+type\s+UITextVariant\s*=\s*((?:[\s\S]*?))(?:;|\n\n)/);
94
99
  const dtsUnionMatch = TEXT_DTS.match(/variant:\s*((?:'[^']+'\s*\|?\s*)+);/);
95
- expect(dtsUnionMatch).toBeTruthy();
96
- const dtsVariants = [...dtsUnionMatch[1].matchAll(/'([^']+)'/g)].map(m => m[1]);
100
+ const variantsSource = dtsAliasMatch?.[1] ?? dtsUnionMatch?.[1];
101
+ expect(variantsSource).toBeTruthy();
102
+ const dtsVariants = [...variantsSource.matchAll(/'([^']+)'/g)].map(m => m[1]);
97
103
 
98
104
  expect(a2uiVariants.sort()).toEqual(dtsVariants.sort());
99
105
  expect(a2uiVariants.sort()).toEqual([...documentedVariants].sort());
@@ -90,18 +90,24 @@ export class UITextarea extends UIFormElement {
90
90
  this.value = text;
91
91
  this.#textEl.toggleAttribute('data-empty', !text);
92
92
  this.syncValue(text);
93
- this.dispatchEvent(new CustomEvent('input', { bubbles: true, detail: { value: this.value } }));
93
+ // §220 (v0.5.9, FEEDBACK-14 §3): trailing-debounce when `throttle > 0`.
94
+ this.scheduleThrottledInput();
94
95
  };
95
96
 
96
97
  #onKeydown = (e) => {
97
98
  // Enter without shift submits; shift+enter inserts newline
98
99
  if (e.key === 'Enter' && !e.shiftKey) {
99
100
  e.preventDefault();
101
+ // §220: flush any pending throttled input before submit so listeners
102
+ // observe the latest value.
103
+ this.flushPendingInput();
100
104
  this.dispatchEvent(new Event('submit', { bubbles: true }));
101
105
  }
102
106
  };
103
107
 
104
108
  #onBlur = () => {
109
+ // §220: trailing `input` precedes `change`.
110
+ this.flushPendingInput();
105
111
  this.dispatchEvent(new CustomEvent('change', { bubbles: true, detail: { value: this.value } }));
106
112
  };
107
113
 
@@ -51,6 +51,11 @@
51
51
  "description": "Number of visible text rows (sets min-height).",
52
52
  "type": "number",
53
53
  "default": 3
54
+ },
55
+ "throttle": {
56
+ "description": "§220 (v0.5.9, FEEDBACK-14 §3). Trailing-debounce on the `input`\nevent in milliseconds. When > 0, value mutates immediately + the UI\nstays responsive, but `input` dispatch is collapsed so only the\nfinal value in the throttle window emits. Useful for expensive\n`input`-driven computation (autosave preview, server-side\nautocomplete, large-doc reflow). `change` fires unthrottled on blur\n/ Enter; any pending `input` flushes before `change` so consumers\nsee input→input→…→input→change ordering. Default 0 preserves\nsynchronous emission.",
57
+ "type": "number",
58
+ "default": 0
54
59
  }
55
60
  },
56
61
  "required": [
@@ -37,6 +37,20 @@ props:
37
37
  description: Number of visible text rows (sets min-height).
38
38
  type: number
39
39
  default: 3
40
+ throttle:
41
+ description: |-
42
+ §220 (v0.5.9, FEEDBACK-14 §3). Trailing-debounce on the `input`
43
+ event in milliseconds. When > 0, value mutates immediately + the UI
44
+ stays responsive, but `input` dispatch is collapsed so only the
45
+ final value in the throttle window emits. Useful for expensive
46
+ `input`-driven computation (autosave preview, server-side
47
+ autocomplete, large-doc reflow). `change` fires unthrottled on blur
48
+ / Enter; any pending `input` flushes before `change` so consumers
49
+ see input→input→…→input→change ordering. Default 0 preserves
50
+ synchronous emission.
51
+ type: number
52
+ default: 0
53
+ reflect: true
40
54
  events:
41
55
  change:
42
56
  description: Fired when the textarea loses focus after a value change.
@@ -4,7 +4,7 @@
4
4
  * @see https://ui-kit.exe.xyz/site/components/timeline
5
5
  *
6
6
  * Type declarations generated by scripts/build/dts-codegen.mjs from
7
- * the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
7
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
8
8
  * run `npm run build:components`, then `npm run codegen:dts` to
9
9
  * regenerate; or hand-author this file fully if rich event types are
10
10
  * needed beyond what the yaml `events:` block can express.
@@ -32,3 +32,22 @@ export class UITimeline extends UIElement {
32
32
  ): void;
33
33
  addEventListener(type: 'timeline-toggle', listener: (ev: TimelineToggleEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
34
34
  }
35
+
36
+ export class UITimelineItem extends UIElement {
37
+ /** Subtitle below the label. */
38
+ description: string;
39
+ /** Elapsed time (e.g. "1.2s", "340ms"). */
40
+ duration: string;
41
+ /** Optional leading icon name (Phosphor). */
42
+ icon: string;
43
+ /** Show a spinner instead of the icon while status=pending. */
44
+ spinner: boolean;
45
+ /** Lifecycle state (idle | pending | done | failed). */
46
+ status: string;
47
+ /** Primary step label. */
48
+ text: string;
49
+ /** Absolute timestamp (HH:MM or ISO). */
50
+ time: string;
51
+ /** Visual variant (default | accent | success | warning | danger). */
52
+ variant: string;
53
+ }
@@ -82,6 +82,15 @@ export class UIToast extends UIElement {
82
82
  */
83
83
  static show(opts = {}) {
84
84
  const { text, variant = 'info', duration = 4000, position = 'bottom-right' } = opts;
85
+ // §224 (v0.5.9, FEEDBACK-10 §2): mark the spawned feed container so
86
+ // DOM-query consumers (Playwright, devtools, instrumentation) can
87
+ // distinguish toast-spawned <feed-ui> from user-authored ones. The marker
88
+ // is set once at container-creation time; subsequent posts to the same
89
+ // container don't re-stamp (idempotent).
90
+ const container = UIFeed.get(position);
91
+ if (container && !container.hasAttribute('data-spawned-by')) {
92
+ container.setAttribute('data-spawned-by', 'toast');
93
+ }
85
94
  return UIFeed.post({
86
95
  text,
87
96
  variant: variant === 'error' ? 'danger' : variant,