@adia-ai/web-components 0.4.7 → 0.4.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/README.md +39 -0
- package/USAGE.md +255 -2
- package/components/accordion/accordion.a2ui.json +3 -0
- package/components/accordion/accordion.d.ts +12 -2
- package/components/accordion/accordion.yaml +4 -0
- package/components/action-list/action-list.a2ui.json +18 -1
- package/components/action-list/action-list.d.ts +21 -2
- package/components/action-list/action-list.yaml +14 -0
- package/components/agent-artifact/agent-artifact.a2ui.json +11 -1
- package/components/agent-artifact/agent-artifact.d.ts +17 -2
- package/components/agent-artifact/agent-artifact.yaml +9 -0
- package/components/agent-feedback-bar/agent-feedback-bar.a2ui.json +10 -1
- package/components/agent-feedback-bar/agent-feedback-bar.d.ts +19 -2
- package/components/agent-feedback-bar/agent-feedback-bar.yaml +8 -0
- package/components/agent-questions/agent-questions.a2ui.json +14 -1
- package/components/agent-questions/agent-questions.d.ts +19 -2
- package/components/agent-questions/agent-questions.yaml +11 -0
- package/components/agent-reasoning/agent-reasoning.a2ui.json +29 -3
- package/components/agent-reasoning/agent-reasoning.d.ts +33 -2
- package/components/agent-reasoning/agent-reasoning.yaml +20 -0
- package/components/agent-suggestions/agent-suggestions.a2ui.json +18 -1
- package/components/agent-suggestions/agent-suggestions.d.ts +21 -2
- package/components/agent-suggestions/agent-suggestions.yaml +14 -0
- package/components/agent-trace/agent-trace.a2ui.json +8 -1
- package/components/agent-trace/agent-trace.d.ts +17 -2
- package/components/agent-trace/agent-trace.yaml +4 -0
- package/components/alert/alert.a2ui.json +1 -0
- package/components/alert/alert.d.ts +12 -2
- package/components/aside/aside.a2ui.json +1 -0
- package/components/avatar/avatar.a2ui.json +3 -0
- package/components/avatar/avatar.d.ts +3 -2
- package/components/avatar/avatar.yaml +4 -0
- package/components/badge/badge.a2ui.json +3 -0
- package/components/badge/badge.d.ts +3 -2
- package/components/badge/badge.yaml +4 -0
- package/components/block/block.a2ui.json +1 -0
- package/components/block/block.d.ts +3 -2
- package/components/breadcrumb/breadcrumb.a2ui.json +5 -0
- package/components/breadcrumb/breadcrumb.d.ts +3 -2
- package/components/breadcrumb/breadcrumb.yaml +6 -0
- package/components/button/button.a2ui.json +3 -0
- package/components/button/button.d.ts +12 -2
- package/components/button/button.yaml +5 -0
- package/components/calendar-picker/calendar-picker.a2ui.json +1 -0
- package/components/canvas/canvas.a2ui.json +1 -0
- package/components/canvas/canvas.d.ts +18 -2
- package/components/canvas/canvas.yaml +12 -0
- package/components/card/card.a2ui.json +1 -0
- package/components/card/card.d.ts +12 -2
- package/components/chart/chart.a2ui.json +4 -0
- package/components/chart/chart.d.ts +18 -2
- package/components/chart/chart.yaml +5 -0
- package/components/chart-legend/chart-legend.a2ui.json +19 -1
- package/components/chart-legend/chart-legend.d.ts +21 -2
- package/components/chart-legend/chart-legend.yaml +15 -0
- package/components/chat-thread/chat-thread.a2ui.json +12 -1
- package/components/chat-thread/chat-thread.d.ts +19 -2
- package/components/chat-thread/chat-thread.yaml +7 -0
- package/components/check/check.a2ui.json +1 -0
- package/components/code/code.a2ui.json +37 -7
- package/components/code/code.d.ts +30 -0
- package/components/code/code.yaml +29 -6
- package/components/col/col.a2ui.json +1 -0
- package/components/col/col.d.ts +3 -2
- package/components/color-picker/class.js +59 -1
- package/components/color-picker/color-picker.a2ui.json +37 -0
- package/components/color-picker/color-picker.d.ts +70 -8
- package/components/color-picker/color-picker.yaml +53 -0
- package/components/command/command.a2ui.json +12 -1
- package/components/command/command.d.ts +21 -2
- package/components/command/command.yaml +7 -0
- package/components/demo-toggle/demo-toggle.a2ui.json +8 -1
- package/components/demo-toggle/demo-toggle.d.ts +17 -2
- package/components/demo-toggle/demo-toggle.yaml +4 -0
- package/components/description-list/description-list.a2ui.json +1 -0
- package/components/description-list/description-list.d.ts +3 -2
- package/components/divider/divider.a2ui.json +1 -0
- package/components/divider/divider.d.ts +3 -2
- package/components/drawer/drawer.a2ui.json +1 -0
- package/components/drawer/drawer.d.ts +12 -2
- package/components/embed/embed.a2ui.json +1 -0
- package/components/embed/embed.d.ts +3 -2
- package/components/empty-state/empty-state.a2ui.json +3 -0
- package/components/empty-state/empty-state.d.ts +3 -2
- package/components/empty-state/empty-state.yaml +4 -0
- package/components/feed/feed.a2ui.json +9 -1
- package/components/feed/feed.d.ts +12 -2
- package/components/feed/feed.yaml +8 -1
- package/components/field/field.a2ui.json +1 -0
- package/components/field/field.d.ts +3 -2
- package/components/fields/fields.a2ui.json +1 -0
- package/components/fields/fields.d.ts +3 -2
- package/components/footer/footer.a2ui.json +1 -0
- package/components/grid/grid.a2ui.json +1 -0
- package/components/grid/grid.d.ts +3 -2
- package/components/header/header.a2ui.json +1 -0
- package/components/heatmap/heatmap.a2ui.json +12 -2
- package/components/heatmap/heatmap.d.ts +20 -2
- package/components/heatmap/heatmap.yaml +17 -2
- package/components/icon/icon.a2ui.json +1 -0
- package/components/icon/icon.d.ts +3 -2
- package/components/image/image.a2ui.json +3 -0
- package/components/image/image.d.ts +3 -2
- package/components/image/image.yaml +4 -0
- package/components/index.js +8 -0
- package/components/input/input.a2ui.json +4 -0
- package/components/input/input.yaml +6 -0
- package/components/inspector/inspector.a2ui.json +5 -0
- package/components/inspector/inspector.d.ts +3 -2
- package/components/inspector/inspector.yaml +6 -0
- package/components/kbd/kbd.a2ui.json +1 -0
- package/components/kbd/kbd.d.ts +3 -2
- package/components/link/link.a2ui.json +12 -1
- package/components/link/link.d.ts +19 -2
- package/components/link/link.yaml +7 -0
- package/components/list/list.a2ui.json +14 -1
- package/components/list/list.d.ts +19 -2
- package/components/list/list.yaml +11 -0
- package/components/menu/menu.a2ui.json +14 -1
- package/components/menu/menu.d.ts +19 -2
- package/components/menu/menu.yaml +11 -0
- package/components/modal/modal.a2ui.json +1 -0
- package/components/modal/modal.d.ts +12 -2
- package/components/nav/nav.a2ui.json +16 -1
- package/components/nav/nav.d.ts +21 -2
- package/components/nav/nav.yaml +10 -0
- package/components/nav-group/nav-group.a2ui.json +12 -1
- package/components/nav-group/nav-group.d.ts +19 -2
- package/components/nav-group/nav-group.yaml +7 -0
- package/components/nav-item/nav-item.a2ui.json +16 -1
- package/components/nav-item/nav-item.d.ts +21 -2
- package/components/nav-item/nav-item.yaml +10 -0
- package/components/noodles/noodles.a2ui.json +47 -2
- package/components/noodles/noodles.d.ts +42 -2
- package/components/noodles/noodles.yaml +32 -0
- package/components/option-card/option-card.a2ui.json +3 -0
- package/components/option-card/option-card.yaml +4 -0
- package/components/otp-input/otp-input.a2ui.json +15 -2
- package/components/otp-input/otp-input.d.ts +11 -0
- package/components/otp-input/otp-input.yaml +10 -2
- package/components/page/page.a2ui.json +1 -0
- package/components/page/page.d.ts +3 -2
- package/components/pagination/pagination.a2ui.json +8 -1
- package/components/pagination/pagination.d.ts +17 -2
- package/components/pagination/pagination.yaml +4 -0
- package/components/pane/pane.a2ui.json +8 -1
- package/components/pane/pane.d.ts +12 -2
- package/components/pane/pane.yaml +7 -1
- package/components/pipeline-status/pipeline-status.a2ui.json +1 -0
- package/components/pipeline-status/pipeline-status.d.ts +3 -2
- package/components/popover/popover.a2ui.json +1 -0
- package/components/popover/popover.d.ts +3 -2
- package/components/progress/progress.a2ui.json +1 -0
- package/components/progress/progress.d.ts +3 -2
- package/components/progress-row/progress-row.a2ui.json +3 -0
- package/components/progress-row/progress-row.d.ts +3 -2
- package/components/progress-row/progress-row.yaml +4 -0
- package/components/radio/radio.a2ui.json +1 -0
- package/components/range/range.a2ui.json +1 -0
- package/components/rating/rating.a2ui.json +1 -0
- package/components/richtext/richtext.a2ui.json +1 -0
- package/components/richtext/richtext.d.ts +3 -2
- package/components/row/row.a2ui.json +1 -0
- package/components/row/row.d.ts +12 -2
- package/components/search/search.a2ui.json +1 -0
- package/components/section/section.a2ui.json +1 -0
- package/components/segment/segment.a2ui.json +3 -0
- package/components/segment/segment.d.ts +3 -2
- package/components/segment/segment.yaml +4 -0
- package/components/segmented/segmented.a2ui.json +1 -0
- package/components/select/select.a2ui.json +3 -0
- package/components/select/select.yaml +4 -0
- package/components/skeleton/skeleton.a2ui.json +1 -0
- package/components/skeleton/skeleton.d.ts +3 -2
- package/components/slider/slider.a2ui.json +1 -0
- package/components/stack/stack.a2ui.json +1 -0
- package/components/stack/stack.d.ts +3 -2
- package/components/stat/stat.a2ui.json +1 -0
- package/components/step-progress/step-progress.a2ui.json +1 -0
- package/components/step-progress/step-progress.d.ts +3 -2
- package/components/stepper/stepper.a2ui.json +3 -0
- package/components/stepper/stepper.d.ts +3 -2
- package/components/stepper/stepper.yaml +4 -0
- package/components/stream/stream.a2ui.json +8 -1
- package/components/stream/stream.d.ts +21 -2
- package/components/stream/stream.yaml +4 -0
- package/components/swatch/class.js +362 -15
- package/components/swatch/swatch.a2ui.json +69 -1
- package/components/swatch/swatch.css +150 -0
- package/components/swatch/swatch.d.ts +46 -2
- package/components/swatch/swatch.yaml +67 -1
- package/components/swiper/swiper.a2ui.json +21 -2
- package/components/swiper/swiper.d.ts +28 -2
- package/components/swiper/swiper.yaml +15 -0
- package/components/switch/switch.a2ui.json +1 -0
- package/components/table/table.a2ui.json +87 -5
- package/components/table/table.d.ts +73 -2
- package/components/table/table.yaml +62 -2
- package/components/table-toolbar/table-toolbar.a2ui.json +12 -0
- package/components/table-toolbar/table-toolbar.d.ts +18 -2
- package/components/table-toolbar/table-toolbar.yaml +13 -0
- package/components/tabs/tabs.a2ui.json +10 -1
- package/components/tabs/tabs.d.ts +17 -2
- package/components/tabs/tabs.yaml +8 -0
- package/components/tag/tag.a2ui.json +12 -1
- package/components/tag/tag.d.ts +19 -2
- package/components/tag/tag.yaml +7 -0
- package/components/text/text.a2ui.json +1 -0
- package/components/text/text.d.ts +3 -2
- package/components/textarea/textarea.a2ui.json +1 -0
- package/components/timeline/timeline.a2ui.json +14 -1
- package/components/timeline/timeline.d.ts +17 -2
- package/components/timeline/timeline.yaml +11 -1
- package/components/toast/toast.a2ui.json +1 -0
- package/components/toast/toast.d.ts +12 -2
- package/components/toggle-group/toggle-group.a2ui.json +8 -1
- package/components/toggle-group/toggle-group.d.ts +17 -2
- package/components/toggle-group/toggle-group.yaml +4 -0
- package/components/toggle-scheme/toggle-scheme.a2ui.json +14 -1
- package/components/toggle-scheme/toggle-scheme.d.ts +19 -2
- package/components/toggle-scheme/toggle-scheme.yaml +11 -0
- package/components/toolbar/toolbar.a2ui.json +3 -0
- package/components/toolbar/toolbar.d.ts +3 -2
- package/components/toolbar/toolbar.yaml +4 -0
- package/components/tooltip/tooltip.a2ui.json +1 -0
- package/components/tooltip/tooltip.d.ts +3 -2
- package/components/tree/tree.a2ui.json +18 -1
- package/components/tree/tree.d.ts +21 -2
- package/components/tree/tree.yaml +14 -0
- package/components/upload/upload.a2ui.json +1 -0
- package/core/icons-phosphor.js +93 -0
- package/core/icons.js +92 -90
- package/core/index.js +5 -0
- package/index.d.ts +87 -79
- package/index.js +7 -0
- package/package.json +3 -2
|
@@ -1,30 +1,92 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `<color-picker-ui>` —
|
|
2
|
+
* `<color-picker-ui>` — OKLCH-native color picker with 2D area + H/C/L sliders.
|
|
3
|
+
*
|
|
4
|
+
* Form-associated (extends UIFormElement). The `[format]` attribute controls
|
|
5
|
+
* whether `value` is read/written as a `#rrggbb` hex string or an `oklch(L C H)`
|
|
6
|
+
* string, but the event detail always carries BOTH forms plus the parsed
|
|
7
|
+
* OKLCH channel scalars — consumers don't need to parse the string.
|
|
3
8
|
*
|
|
4
9
|
* @see https://ui-kit.exe.xyz/site/components/color-picker
|
|
5
10
|
*/
|
|
6
11
|
|
|
7
12
|
import { UIFormElement } from '../../core/form.js';
|
|
8
13
|
|
|
9
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Output format selected by the `[format]` attribute. Drives the shape of
|
|
16
|
+
* `value` (and the matching `detail.value` field). Both `hex` and `oklch`
|
|
17
|
+
* forms are always present on the event detail regardless of `[format]`.
|
|
18
|
+
*/
|
|
19
|
+
export type ColorFormat = 'hex' | 'oklch';
|
|
10
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Detail payload for both `change` (commit) and `input` (continuous drag)
|
|
23
|
+
* events. Carries parsed channel scalars + both string forms — `value`
|
|
24
|
+
* mirrors the picker's current `[format]`, while `hex` and `oklch` are
|
|
25
|
+
* always populated parallel views.
|
|
26
|
+
*/
|
|
11
27
|
export interface ColorPickerChangeEventDetail {
|
|
28
|
+
/** Format-respecting string. Equals `hex` when `[format="hex"]`; equals `oklch` when `[format="oklch"]`. */
|
|
12
29
|
value: string;
|
|
13
|
-
|
|
30
|
+
/** OKLCH lightness (0–1). */
|
|
31
|
+
l: number;
|
|
32
|
+
/** OKLCH chroma (0–~0.4). */
|
|
33
|
+
c: number;
|
|
34
|
+
/** OKLCH hue (0–360, degrees). */
|
|
35
|
+
h: number;
|
|
36
|
+
/** Hex string (`#rrggbb`). Gamut-mapped to sRGB. */
|
|
37
|
+
hex: string;
|
|
38
|
+
/** OKLCH string (`oklch(L C H)`, fixed precision). */
|
|
39
|
+
oklch: string;
|
|
14
40
|
}
|
|
15
41
|
export type ColorPickerChangeEvent = CustomEvent<ColorPickerChangeEventDetail>;
|
|
16
42
|
export type ColorPickerInputEvent = CustomEvent<ColorPickerChangeEventDetail>;
|
|
17
43
|
|
|
18
|
-
|
|
19
|
-
|
|
44
|
+
/**
|
|
45
|
+
* Axis-specific clamp record. Fires when a consumer-declared constraint
|
|
46
|
+
* (max-chroma / max-l / min-l / hue-drift-max) clamped a user-requested
|
|
47
|
+
* channel value to its in-bound equivalent.
|
|
48
|
+
*/
|
|
49
|
+
export interface ColorPickerClampRecord {
|
|
50
|
+
/** OKLCH axis that was clamped. */
|
|
51
|
+
axis: 'l' | 'c' | 'h';
|
|
52
|
+
/** Channel value the user requested before the clamp. */
|
|
53
|
+
requested: number;
|
|
54
|
+
/** Channel value the picker actually committed after the clamp. */
|
|
55
|
+
clamped: number;
|
|
56
|
+
/** Constraint prop that triggered the clamp. */
|
|
57
|
+
reason: 'max-l' | 'min-l' | 'max-chroma' | 'hue-drift-max';
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Detail payload for the `constraint-clamp` event — fired immediately
|
|
62
|
+
* before the corresponding `change` / `input` when one or more axes
|
|
63
|
+
* were clamped to fit the consumer's declared constraints. `clamps`
|
|
64
|
+
* is never empty.
|
|
65
|
+
*/
|
|
66
|
+
export interface ColorPickerConstraintClampEventDetail {
|
|
67
|
+
clamps: ColorPickerClampRecord[];
|
|
20
68
|
}
|
|
21
|
-
export type
|
|
69
|
+
export type ColorPickerConstraintClampEvent = CustomEvent<ColorPickerConstraintClampEventDetail>;
|
|
22
70
|
|
|
23
71
|
export class UIColorPicker extends UIFormElement {
|
|
72
|
+
/** Form field name. */
|
|
73
|
+
name: string;
|
|
74
|
+
/** Disables all interaction. */
|
|
75
|
+
disabled: boolean;
|
|
24
76
|
/** Current color as a string in the active `format`. */
|
|
25
77
|
value: string;
|
|
26
|
-
/** Output format
|
|
78
|
+
/** Output format — drives the shape of `value`. Detail always carries both `hex` and `oklch`. */
|
|
27
79
|
format: ColorFormat;
|
|
80
|
+
/** Clamp the OKLCH chroma channel to at most this value. `Infinity` = unconstrained. */
|
|
81
|
+
maxChroma: number;
|
|
82
|
+
/** Clamp the OKLCH lightness channel to at most this value (0..1). `1` = unconstrained. */
|
|
83
|
+
maxL: number;
|
|
84
|
+
/** Clamp the OKLCH lightness channel to at least this value (0..1). `0` = unconstrained. */
|
|
85
|
+
minL: number;
|
|
86
|
+
/** Maximum allowed signed-shortest-path hue drift in degrees from `baseHue`. `NaN` = unconstrained. */
|
|
87
|
+
hueDriftMax: number;
|
|
88
|
+
/** Reference hue (degrees) for the `hueDriftMax` constraint. `NaN` = use the picker's hue at first commit. */
|
|
89
|
+
baseHue: number;
|
|
28
90
|
|
|
29
91
|
addEventListener<K extends keyof HTMLElementEventMap>(
|
|
30
92
|
type: K,
|
|
@@ -33,5 +95,5 @@ export class UIColorPicker extends UIFormElement {
|
|
|
33
95
|
): void;
|
|
34
96
|
addEventListener(type: 'change', listener: (ev: ColorPickerChangeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
35
97
|
addEventListener(type: 'input', listener: (ev: ColorPickerInputEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
36
|
-
addEventListener(type: '
|
|
98
|
+
addEventListener(type: 'constraint-clamp', listener: (ev: ColorPickerConstraintClampEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
37
99
|
}
|
|
@@ -7,6 +7,10 @@ component: ColorPicker
|
|
|
7
7
|
category: input
|
|
8
8
|
version: 1
|
|
9
9
|
description: OKLCH-native color picker with 2D area and H/C/L sliders. Form-associated.
|
|
10
|
+
# Per ADR-0027 — primitives that programmatically create other primitives
|
|
11
|
+
# do NOT auto-import them. Consumer (or demo shell) must explicitly import.
|
|
12
|
+
composes:
|
|
13
|
+
- slider-ui
|
|
10
14
|
props:
|
|
11
15
|
name:
|
|
12
16
|
description: Form field name
|
|
@@ -28,11 +32,60 @@ props:
|
|
|
28
32
|
description: Current color as hex string
|
|
29
33
|
type: string
|
|
30
34
|
default: "#3b82f6"
|
|
35
|
+
maxChroma:
|
|
36
|
+
description: |
|
|
37
|
+
Generation constraint (v0.4.9 §99h, FEEDBACK-02 #7) — clamp the
|
|
38
|
+
OKLCH chroma channel to at most this value before commit. Out-of-
|
|
39
|
+
bound mutations round-trip to the nearest in-bound equivalent +
|
|
40
|
+
fire `constraint-clamp`. Default Infinity (no constraint).
|
|
41
|
+
type: number
|
|
42
|
+
default: Infinity
|
|
43
|
+
reflect: true
|
|
44
|
+
maxL:
|
|
45
|
+
description: Generation constraint — clamp OKLCH lightness to at most this value (0..1). Default 1 (no constraint).
|
|
46
|
+
type: number
|
|
47
|
+
default: 1
|
|
48
|
+
reflect: true
|
|
49
|
+
minL:
|
|
50
|
+
description: Generation constraint — clamp OKLCH lightness to at least this value (0..1). Default 0 (no constraint).
|
|
51
|
+
type: number
|
|
52
|
+
default: 0
|
|
53
|
+
reflect: true
|
|
54
|
+
hueDriftMax:
|
|
55
|
+
description: |
|
|
56
|
+
Generation constraint — maximum allowed signed-shortest-path hue
|
|
57
|
+
deviation (degrees) from [base-hue] (or the first-committed hue
|
|
58
|
+
if [base-hue] is unset). Default NaN (no constraint). Wrap-aware
|
|
59
|
+
so a drift of 350 degrees resolves as -10.
|
|
60
|
+
type: number
|
|
61
|
+
default: NaN
|
|
62
|
+
reflect: true
|
|
63
|
+
baseHue:
|
|
64
|
+
description: |
|
|
65
|
+
Reference hue (degrees) for the [hue-drift-max] constraint. Default
|
|
66
|
+
NaN — falls back to the picker's hue at first commit so the consumer
|
|
67
|
+
can pre-seed the picker and constrain drift from that initial value.
|
|
68
|
+
type: number
|
|
69
|
+
default: NaN
|
|
70
|
+
reflect: true
|
|
31
71
|
events:
|
|
32
72
|
change:
|
|
33
73
|
description: Fired on every color change
|
|
34
74
|
input:
|
|
35
75
|
description: Fired during continuous interaction (drag)
|
|
76
|
+
constraint-clamp:
|
|
77
|
+
description: |
|
|
78
|
+
Fired immediately before `change` / `input` when one or more
|
|
79
|
+
consumer-declared constraints (max-chroma / max-l / min-l /
|
|
80
|
+
hue-drift-max) clamped a channel away from the user-requested
|
|
81
|
+
value. detail.clamps is an array of axis-specific clamp records.
|
|
82
|
+
detail:
|
|
83
|
+
clamps:
|
|
84
|
+
type: array
|
|
85
|
+
description: |
|
|
86
|
+
Array of `{ axis, requested, clamped, reason }` objects. axis is
|
|
87
|
+
one of "l" / "c" / "h". reason names the triggering constraint
|
|
88
|
+
prop. Empty arrays are never emitted.
|
|
36
89
|
slots: {}
|
|
37
90
|
states:
|
|
38
91
|
- name: idle
|
|
@@ -34,12 +34,23 @@
|
|
|
34
34
|
"x-adiaui": {
|
|
35
35
|
"anti_patterns": [],
|
|
36
36
|
"category": "container",
|
|
37
|
+
"composes": [],
|
|
37
38
|
"events": {
|
|
38
39
|
"dismiss": {
|
|
39
40
|
"description": "Fired when Escape is pressed"
|
|
40
41
|
},
|
|
41
42
|
"select": {
|
|
42
|
-
"description": "Fired when an item is selected. Detail contains { value, label, item }."
|
|
43
|
+
"description": "Fired when an item is selected. Detail contains { value, label, item }.",
|
|
44
|
+
"detail": {
|
|
45
|
+
"label": {
|
|
46
|
+
"description": "Item label text.",
|
|
47
|
+
"type": "string"
|
|
48
|
+
},
|
|
49
|
+
"value": {
|
|
50
|
+
"description": "Item value attribute.",
|
|
51
|
+
"type": "string"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
43
54
|
}
|
|
44
55
|
},
|
|
45
56
|
"examples": [
|
|
@@ -5,15 +5,34 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
7
7
|
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
8
|
-
* run `npm run components`, then `npm run codegen:dts` to
|
|
9
|
-
* or hand-author this file fully if rich event types are
|
|
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.
|
|
10
11
|
*/
|
|
11
12
|
|
|
12
13
|
import { UIElement } from '../../core/element.js';
|
|
13
14
|
|
|
15
|
+
export type CommandDismissEvent = CustomEvent<unknown>;
|
|
16
|
+
export interface CommandSelectEventDetail {
|
|
17
|
+
/** Item label text. */
|
|
18
|
+
label: string;
|
|
19
|
+
/** Item value attribute. */
|
|
20
|
+
value: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type CommandSelectEvent = CustomEvent<CommandSelectEventDetail>;
|
|
24
|
+
|
|
14
25
|
export class UICommand extends UIElement {
|
|
15
26
|
/** Whether the command palette is visible */
|
|
16
27
|
open: boolean;
|
|
17
28
|
/** Placeholder text for the search input */
|
|
18
29
|
placeholder: string;
|
|
30
|
+
|
|
31
|
+
addEventListener<K extends keyof HTMLElementEventMap>(
|
|
32
|
+
type: K,
|
|
33
|
+
listener: (this: UICommand, ev: HTMLElementEventMap[K]) => unknown,
|
|
34
|
+
options?: boolean | AddEventListenerOptions,
|
|
35
|
+
): void;
|
|
36
|
+
addEventListener(type: 'dismiss', listener: (ev: CommandDismissEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
37
|
+
addEventListener(type: 'select', listener: (ev: CommandSelectEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
19
38
|
}
|
|
@@ -20,6 +20,13 @@ events:
|
|
|
20
20
|
description: Fired when Escape is pressed
|
|
21
21
|
select:
|
|
22
22
|
description: Fired when an item is selected. Detail contains { value, label, item }.
|
|
23
|
+
detail:
|
|
24
|
+
value:
|
|
25
|
+
type: string
|
|
26
|
+
description: Item value attribute.
|
|
27
|
+
label:
|
|
28
|
+
type: string
|
|
29
|
+
description: Item label text.
|
|
23
30
|
slots:
|
|
24
31
|
empty:
|
|
25
32
|
description: Empty state shown when no items match
|
|
@@ -53,9 +53,16 @@
|
|
|
53
53
|
"x-adiaui": {
|
|
54
54
|
"anti_patterns": [],
|
|
55
55
|
"category": "container",
|
|
56
|
+
"composes": [],
|
|
56
57
|
"events": {
|
|
57
58
|
"change": {
|
|
58
|
-
"description": "Fired when the toggle flips. detail contains { state }."
|
|
59
|
+
"description": "Fired when the toggle flips. detail contains { state }.",
|
|
60
|
+
"detail": {
|
|
61
|
+
"state": {
|
|
62
|
+
"description": "New toggle state.",
|
|
63
|
+
"type": "boolean"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
59
66
|
}
|
|
60
67
|
},
|
|
61
68
|
"examples": [
|
|
@@ -5,12 +5,20 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
7
7
|
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
8
|
-
* run `npm run components`, then `npm run codegen:dts` to
|
|
9
|
-
* or hand-author this file fully if rich event types are
|
|
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.
|
|
10
11
|
*/
|
|
11
12
|
|
|
12
13
|
import { UIElement } from '../../core/element.js';
|
|
13
14
|
|
|
15
|
+
export interface DemoToggleChangeEventDetail {
|
|
16
|
+
/** New toggle state. */
|
|
17
|
+
state: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type DemoToggleChangeEvent = CustomEvent<DemoToggleChangeEventDetail>;
|
|
21
|
+
|
|
14
22
|
export class UIDemoToggle extends UIElement {
|
|
15
23
|
/** Initial state when [state] is not set on connect ("on" | "off"). */
|
|
16
24
|
initial: 'on' | 'off';
|
|
@@ -20,4 +28,11 @@ export class UIDemoToggle extends UIElement {
|
|
|
20
28
|
labelOn: string;
|
|
21
29
|
/** Current toggle state ("on" | "off"). Reflected as data-state on the host. */
|
|
22
30
|
state: '' | 'on' | 'off';
|
|
31
|
+
|
|
32
|
+
addEventListener<K extends keyof HTMLElementEventMap>(
|
|
33
|
+
type: K,
|
|
34
|
+
listener: (this: UIDemoToggle, ev: HTMLElementEventMap[K]) => unknown,
|
|
35
|
+
options?: boolean | AddEventListenerOptions,
|
|
36
|
+
): void;
|
|
37
|
+
addEventListener(type: 'change', listener: (ev: DemoToggleChangeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
23
38
|
}
|
|
@@ -44,6 +44,10 @@ props:
|
|
|
44
44
|
events:
|
|
45
45
|
change:
|
|
46
46
|
description: Fired when the toggle flips. detail contains { state }.
|
|
47
|
+
detail:
|
|
48
|
+
state:
|
|
49
|
+
type: boolean
|
|
50
|
+
description: New toggle state.
|
|
47
51
|
slots:
|
|
48
52
|
bar:
|
|
49
53
|
description: Internal header bar (auto-stamped). Hosts the embedded switch + label.
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
7
7
|
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
8
|
-
* run `npm run components`, then `npm run codegen:dts` to
|
|
9
|
-
* or hand-author this file fully if rich event types are
|
|
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.
|
|
10
11
|
*/
|
|
11
12
|
|
|
12
13
|
import { UIElement } from '../../core/element.js';
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
7
7
|
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
8
|
-
* run `npm run components`, then `npm run codegen:dts` to
|
|
9
|
-
* or hand-author this file fully if rich event types are
|
|
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.
|
|
10
11
|
*/
|
|
11
12
|
|
|
12
13
|
import { UIElement } from '../../core/element.js';
|
|
@@ -5,12 +5,15 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
7
7
|
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
8
|
-
* run `npm run components`, then `npm run codegen:dts` to
|
|
9
|
-
* or hand-author this file fully if rich event types are
|
|
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.
|
|
10
11
|
*/
|
|
11
12
|
|
|
12
13
|
import { UIElement } from '../../core/element.js';
|
|
13
14
|
|
|
15
|
+
export type DrawerCloseEvent = CustomEvent<unknown>;
|
|
16
|
+
|
|
14
17
|
export class UIDrawer extends UIElement {
|
|
15
18
|
/** Controls visibility. When false, backdrop and panel are removed from DOM. */
|
|
16
19
|
open: boolean;
|
|
@@ -22,4 +25,11 @@ export class UIDrawer extends UIElement {
|
|
|
22
25
|
size: 'sm' | 'md' | 'lg';
|
|
23
26
|
/** Title text displayed in the drawer header */
|
|
24
27
|
text: string;
|
|
28
|
+
|
|
29
|
+
addEventListener<K extends keyof HTMLElementEventMap>(
|
|
30
|
+
type: K,
|
|
31
|
+
listener: (this: UIDrawer, ev: HTMLElementEventMap[K]) => unknown,
|
|
32
|
+
options?: boolean | AddEventListenerOptions,
|
|
33
|
+
): void;
|
|
34
|
+
addEventListener(type: 'close', listener: (ev: DrawerCloseEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
25
35
|
}
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
7
7
|
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
8
|
-
* run `npm run components`, then `npm run codegen:dts` to
|
|
9
|
-
* or hand-author this file fully if rich event types are
|
|
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.
|
|
10
11
|
*/
|
|
11
12
|
|
|
12
13
|
import { UIElement } from '../../core/element.js';
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
7
7
|
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
8
|
-
* run `npm run components`, then `npm run codegen:dts` to
|
|
9
|
-
* or hand-author this file fully if rich event types are
|
|
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.
|
|
10
11
|
*/
|
|
11
12
|
|
|
12
13
|
import { UIElement } from '../../core/element.js';
|
|
@@ -7,6 +7,10 @@ component: EmptyState
|
|
|
7
7
|
category: display
|
|
8
8
|
version: 1
|
|
9
9
|
description: Placeholder for empty views with icon, heading, description, and action slot.
|
|
10
|
+
# Per ADR-0027 — primitives that programmatically create other primitives
|
|
11
|
+
# do NOT auto-import them. Consumer (or demo shell) must explicitly import.
|
|
12
|
+
composes:
|
|
13
|
+
- icon-ui
|
|
10
14
|
props:
|
|
11
15
|
description:
|
|
12
16
|
description: Secondary descriptive text below the heading
|
|
@@ -43,7 +43,15 @@
|
|
|
43
43
|
"x-adiaui": {
|
|
44
44
|
"anti_patterns": [],
|
|
45
45
|
"category": "container",
|
|
46
|
-
"
|
|
46
|
+
"composes": [
|
|
47
|
+
"button-ui",
|
|
48
|
+
"feed-item-ui"
|
|
49
|
+
],
|
|
50
|
+
"events": {
|
|
51
|
+
"close": {
|
|
52
|
+
"description": "Fired on per-item dismissal (manual close, swipe, or auto-timeout). Bubbles."
|
|
53
|
+
}
|
|
54
|
+
},
|
|
47
55
|
"examples": [],
|
|
48
56
|
"keywords": [],
|
|
49
57
|
"name": "UIFeedContainer",
|
|
@@ -5,15 +5,25 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
7
7
|
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
8
|
-
* run `npm run components`, then `npm run codegen:dts` to
|
|
9
|
-
* or hand-author this file fully if rich event types are
|
|
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.
|
|
10
11
|
*/
|
|
11
12
|
|
|
12
13
|
import { UIElement } from '../../core/element.js';
|
|
13
14
|
|
|
15
|
+
export type FeedCloseEvent = CustomEvent<unknown>;
|
|
16
|
+
|
|
14
17
|
export class UIFeed extends UIElement {
|
|
15
18
|
/** Cap on simultaneously visible items per lane */
|
|
16
19
|
max: number;
|
|
17
20
|
/** Lane the feed renders into */
|
|
18
21
|
position: 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | 'inline';
|
|
22
|
+
|
|
23
|
+
addEventListener<K extends keyof HTMLElementEventMap>(
|
|
24
|
+
type: K,
|
|
25
|
+
listener: (this: UIFeed, ev: HTMLElementEventMap[K]) => unknown,
|
|
26
|
+
options?: boolean | AddEventListenerOptions,
|
|
27
|
+
): void;
|
|
28
|
+
addEventListener(type: 'close', listener: (ev: FeedCloseEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
19
29
|
}
|
|
@@ -11,6 +11,11 @@ description: >-
|
|
|
11
11
|
(SPEC-FEED-CHANNEL-001). Per-position singletons mounted lazily into
|
|
12
12
|
document.body via Popover API; consumers post via the static API
|
|
13
13
|
(`UIFeed.post()`) or the global 'feed' CustomEvent.
|
|
14
|
+
# Per ADR-0027 — primitives that programmatically create other primitives
|
|
15
|
+
# do NOT auto-import them. Consumer (or demo shell) must explicitly import.
|
|
16
|
+
composes:
|
|
17
|
+
- button-ui
|
|
18
|
+
- feed-item-ui
|
|
14
19
|
props:
|
|
15
20
|
position:
|
|
16
21
|
description: Lane the feed renders into
|
|
@@ -28,6 +33,8 @@ props:
|
|
|
28
33
|
description: Cap on simultaneously visible items per lane
|
|
29
34
|
type: number
|
|
30
35
|
default: 5
|
|
31
|
-
events:
|
|
36
|
+
events:
|
|
37
|
+
close:
|
|
38
|
+
description: Fired on per-item dismissal (manual close, swipe, or auto-timeout). Bubbles.
|
|
32
39
|
slots: {}
|
|
33
40
|
states: {}
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
7
7
|
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
8
|
-
* run `npm run components`, then `npm run codegen:dts` to
|
|
9
|
-
* or hand-author this file fully if rich event types are
|
|
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.
|
|
10
11
|
*/
|
|
11
12
|
|
|
12
13
|
import { UIElement } from '../../core/element.js';
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
7
7
|
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
8
|
-
* run `npm run components`, then `npm run codegen:dts` to
|
|
9
|
-
* or hand-author this file fully if rich event types are
|
|
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.
|
|
10
11
|
*/
|
|
11
12
|
|
|
12
13
|
import { UIElement } from '../../core/element.js';
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
7
7
|
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
8
|
-
* run `npm run components`, then `npm run codegen:dts` to
|
|
9
|
-
* or hand-author this file fully if rich event types are
|
|
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.
|
|
10
11
|
*/
|
|
11
12
|
|
|
12
13
|
import { UIElement } from '../../core/element.js';
|
|
@@ -84,12 +84,22 @@
|
|
|
84
84
|
"x-adiaui": {
|
|
85
85
|
"anti_patterns": [],
|
|
86
86
|
"category": "data-display",
|
|
87
|
+
"composes": [],
|
|
87
88
|
"events": {
|
|
88
89
|
"cell-click": {
|
|
89
|
-
"description": "Fired on cell
|
|
90
|
+
"description": "Fired on cell click. detail carries the cell's row + column indices + value."
|
|
90
91
|
},
|
|
91
92
|
"cell-hover": {
|
|
92
|
-
"description": "Fired on cell
|
|
93
|
+
"description": "Fired on cell hover. detail carries the cell's row + column indices + value."
|
|
94
|
+
},
|
|
95
|
+
"chart-hover": {
|
|
96
|
+
"description": "Canonical chart-hover shape — same detail as cell-hover. Re-emitted\nalongside cell-hover so consumers wiring a pointer-follow tooltip via\ntooltip-ui[follows=pointer] can listen for one event-name regardless\nof chart kind (chart-ui + heatmap-ui both emit it).\n"
|
|
97
|
+
},
|
|
98
|
+
"chart-leave": {
|
|
99
|
+
"description": "Signal-only counterpart to chart-hover. Fires when the pointer leaves\nthe heatmap grid. Detail-free — receivers should clear their hover\nstate on receipt.\n"
|
|
100
|
+
},
|
|
101
|
+
"chart-select": {
|
|
102
|
+
"description": "Canonical chart-select shape — same detail as cell-click. Re-emitted\nalongside cell-click for chart-kind-agnostic listeners.\n"
|
|
93
103
|
}
|
|
94
104
|
},
|
|
95
105
|
"examples": [
|