@adia-ai/web-components 0.5.7 → 0.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/USAGE.md +218 -0
- package/components/accordion/accordion.d.ts +22 -1
- package/components/action-list/action-list.d.ts +14 -1
- package/components/agent-artifact/agent-artifact.d.ts +1 -1
- package/components/agent-feedback-bar/agent-feedback-bar.d.ts +1 -1
- package/components/agent-questions/agent-questions.d.ts +1 -1
- package/components/agent-reasoning/agent-reasoning.d.ts +1 -1
- package/components/agent-suggestions/agent-suggestions.d.ts +1 -1
- package/components/agent-trace/agent-trace.d.ts +1 -1
- package/components/alert/alert.d.ts +1 -1
- package/components/avatar/avatar.d.ts +8 -1
- package/components/badge/badge.d.ts +1 -1
- package/components/block/block.d.ts +1 -1
- package/components/breadcrumb/breadcrumb.d.ts +1 -1
- package/components/button/button.d.ts +1 -1
- package/components/canvas/canvas.d.ts +1 -1
- package/components/card/card.d.ts +1 -1
- package/components/chart/chart.d.ts +1 -1
- package/components/chart-legend/chart-legend.d.ts +1 -1
- package/components/chat-thread/chat-thread.d.ts +40 -1
- package/components/code/code.css +1 -1
- package/components/col/col.a2ui.json +4 -4
- package/components/col/col.d.ts +2 -2
- package/components/col/col.yaml +2 -2
- package/components/command/command.d.ts +1 -1
- package/components/demo-toggle/demo-toggle.a2ui.json +3 -1
- package/components/demo-toggle/demo-toggle.d.ts +1 -1
- package/components/demo-toggle/demo-toggle.yaml +2 -0
- package/components/description-list/description-list.d.ts +1 -1
- package/components/divider/divider.d.ts +1 -1
- package/components/drawer/drawer.d.ts +1 -1
- package/components/embed/embed.d.ts +1 -1
- package/components/empty-state/class.js +10 -4
- package/components/empty-state/empty-state.a2ui.json +5 -0
- package/components/empty-state/empty-state.css +36 -0
- package/components/empty-state/empty-state.d.ts +6 -1
- package/components/empty-state/empty-state.test.js +77 -0
- package/components/empty-state/empty-state.yaml +9 -0
- package/components/feed/feed.css +2 -2
- package/components/feed/feed.d.ts +29 -5
- package/components/field/field.d.ts +1 -1
- package/components/fields/fields.a2ui.json +3 -1
- package/components/fields/fields.d.ts +1 -1
- package/components/fields/fields.yaml +2 -0
- package/components/grid/grid.d.ts +1 -1
- package/components/heatmap/heatmap.d.ts +1 -1
- package/components/icon/icon.d.ts +1 -1
- package/components/image/image.d.ts +1 -1
- package/components/input/class.js +2 -1
- package/components/input/input.a2ui.json +5 -0
- package/components/input/input.test.js +99 -0
- package/components/input/input.yaml +14 -0
- package/components/inspector/inspector.d.ts +1 -1
- package/components/kbd/kbd.d.ts +1 -1
- package/components/link/link.d.ts +1 -1
- package/components/list/list.d.ts +10 -1
- package/components/menu/menu-divider.a2ui.json +41 -0
- package/components/menu/menu-divider.yaml +15 -0
- package/components/menu/menu-item.a2ui.json +77 -0
- package/components/menu/menu-item.yaml +45 -0
- package/components/menu/menu.d.ts +17 -1
- package/components/modal/modal.d.ts +1 -1
- package/components/nav/nav.a2ui.json +6 -1
- package/components/nav/nav.css +1 -1
- package/components/nav/nav.d.ts +1 -1
- package/components/nav/nav.yaml +6 -0
- package/components/nav-group/nav-group.a2ui.json +5 -1
- package/components/nav-group/nav-group.css +1 -1
- package/components/nav-group/nav-group.d.ts +1 -1
- package/components/nav-group/nav-group.yaml +5 -0
- package/components/nav-item/nav-item.a2ui.json +4 -1
- package/components/nav-item/nav-item.css +1 -1
- package/components/nav-item/nav-item.d.ts +1 -1
- package/components/nav-item/nav-item.yaml +4 -0
- package/components/noodles/noodles.d.ts +1 -1
- package/components/page/page.d.ts +1 -1
- package/components/pagination/pagination.d.ts +1 -1
- package/components/pane/pane.d.ts +1 -1
- package/components/pipeline-status/pipeline-status.d.ts +1 -1
- package/components/popover/popover.d.ts +1 -1
- package/components/progress/progress.d.ts +1 -1
- package/components/progress-row/progress-row.d.ts +1 -1
- package/components/range/range.css +1 -1
- package/components/richtext/richtext.a2ui.json +4 -4
- package/components/richtext/richtext.d.ts +2 -2
- package/components/richtext/richtext.yaml +2 -2
- package/components/row/row.d.ts +1 -1
- package/components/segment/segment.d.ts +1 -1
- package/components/select/class.js +28 -0
- package/components/select/select.css +1 -1
- package/components/select/select.yaml +28 -0
- package/components/skeleton/skeleton.d.ts +1 -1
- package/components/slider/class.js +20 -50
- package/components/slider/slider.css +1 -1
- package/components/stack/stack.d.ts +1 -1
- package/components/step-progress/step-progress.d.ts +1 -1
- package/components/stepper/stepper-item.a2ui.json +74 -0
- package/components/stepper/stepper-item.yaml +45 -0
- package/components/stepper/stepper.d.ts +13 -1
- package/components/stream/stream.d.ts +1 -1
- package/components/swatch/swatch.css +1 -1
- package/components/swatch/swatch.d.ts +1 -1
- package/components/swiper/swiper.d.ts +1 -1
- package/components/switch/switch.css +1 -1
- package/components/table/table.d.ts +1 -1
- package/components/table-toolbar/table-toolbar.d.ts +1 -1
- package/components/tabs/tabs.d.ts +12 -1
- package/components/tag/tag.d.ts +1 -1
- package/components/text/text.d.ts +1 -1
- package/components/textarea/class.js +7 -1
- package/components/textarea/textarea.a2ui.json +5 -0
- package/components/textarea/textarea.yaml +14 -0
- package/components/timeline/timeline.d.ts +20 -1
- package/components/toast/class.js +9 -0
- package/components/toast/toast.d.ts +9 -5
- package/components/toast/toast.yaml +16 -0
- package/components/toggle-group/toggle-group.d.ts +12 -1
- package/components/toggle-group/toggle-option.a2ui.json +61 -0
- package/components/toggle-group/toggle-option.yaml +33 -0
- package/components/toggle-scheme/toggle-scheme.d.ts +1 -1
- package/components/toolbar/toolbar-group.a2ui.json +41 -0
- package/components/toolbar/toolbar-group.yaml +16 -0
- package/components/toolbar/toolbar.d.ts +4 -1
- package/components/tooltip/tooltip.css +2 -2
- package/components/tooltip/tooltip.d.ts +1 -1
- package/components/tree/tree.css +1 -1
- package/components/tree/tree.d.ts +18 -1
- package/core/form.js +93 -0
- package/core/signals.d.ts +28 -0
- package/index.d.ts +2 -2
- package/package.json +1 -1
- package/styles/colors/semantics.css +6 -0
- package/styles/tokens.css +3 -0
- package/styles/typography.css +5 -1
|
@@ -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)
|
|
46
|
-
// `input`
|
|
47
|
-
// shader compile, large list reflow). When > 0,
|
|
48
|
-
// visual feedback are immediate but `input`
|
|
49
|
-
//
|
|
50
|
-
//
|
|
51
|
-
//
|
|
52
|
-
//
|
|
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
|
-
|
|
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
|
-
// §
|
|
175
|
-
//
|
|
176
|
-
//
|
|
177
|
-
//
|
|
178
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
-
// §
|
|
260
|
-
|
|
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-
|
|
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-
|
|
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-
|
|
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
|
+
}
|
package/components/tag/tag.d.ts
CHANGED
|
@@ -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.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @see https://ui-kit.exe.xyz/site/components/text
|
|
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.
|
|
@@ -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
|
-
|
|
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,
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @see https://ui-kit.exe.xyz/site/components/toast
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
6
|
+
* HAND-AUTHORED (not codegen'd) per §246 (v0.5.9) — the yaml
|
|
7
|
+
* `props:`/`events:` shape can't express the imperative `static show()`
|
|
8
|
+
* API the runtime ships. `dts-codegen.mjs` keeps this file in its
|
|
9
|
+
* `HAND_AUTHORED_DTS` skip list so subsequent builds preserve the
|
|
10
|
+
* static-method signature.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import { UIElement } from '../../core/element.js';
|
|
@@ -49,6 +49,10 @@ export class UIToast extends UIElement {
|
|
|
49
49
|
* alternative to declarative `<toast-ui>`. Returns a `UIToastFeedHandle`
|
|
50
50
|
* for programmatic dismiss / update.
|
|
51
51
|
*
|
|
52
|
+
* §224 (v0.5.9): the spawned `<feed-ui>` container is stamped with
|
|
53
|
+
* `data-spawned-by="toast"` for DOM-query distinction from user-authored
|
|
54
|
+
* `<feed-ui>` containers.
|
|
55
|
+
*
|
|
52
56
|
* Legacy alias `variant: 'error'` is auto-mapped to `variant: 'danger'`.
|
|
53
57
|
*
|
|
54
58
|
* @example
|
|
@@ -44,6 +44,22 @@ props:
|
|
|
44
44
|
- muted
|
|
45
45
|
- neutral
|
|
46
46
|
events: {}
|
|
47
|
+
usage: |-
|
|
48
|
+
§224 (v0.5.9): `UIToast.show()` routes through `UIFeed.post()` — the
|
|
49
|
+
spawned DOM element is a `<feed-ui>` container with `<feed-item-ui>`
|
|
50
|
+
children. The container carries `data-spawned-by="toast"` so DOM-query
|
|
51
|
+
consumers (Playwright, devtools, instrumentation) can distinguish
|
|
52
|
+
toast-spawned feeds from user-authored ones:
|
|
53
|
+
|
|
54
|
+
```js
|
|
55
|
+
UIToast.show({ text: 'Saved.', variant: 'success' });
|
|
56
|
+
|
|
57
|
+
// Distinguish toast-spawned <feed-ui> in tests / devtools:
|
|
58
|
+
document.querySelector('feed-ui[data-spawned-by="toast"]');
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The marker is set once at container-creation time + per-position (a
|
|
62
|
+
single `<feed-ui>` instance serves all toasts for a given position).
|
|
47
63
|
slots: {}
|
|
48
64
|
states:
|
|
49
65
|
- name: idle
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @see https://ui-kit.exe.xyz/site/components/toggle-group
|
|
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,14 @@ export class UIToggleGroup extends UIElement {
|
|
|
32
32
|
): void;
|
|
33
33
|
addEventListener(type: 'change', listener: (ev: ToggleGroupChangeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
34
34
|
}
|
|
35
|
+
|
|
36
|
+
export class UIToggleOption extends UIElement {
|
|
37
|
+
/** Disabled state — blocks pointer + keyboard activation. */
|
|
38
|
+
disabled: boolean;
|
|
39
|
+
/** Optional Phosphor icon name; renders as a leading icon. */
|
|
40
|
+
icon: string;
|
|
41
|
+
/** Visible label text. */
|
|
42
|
+
text: string;
|
|
43
|
+
/** Stable identifier matched against the parent group's `value`. */
|
|
44
|
+
value: string;
|
|
45
|
+
}
|