@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.
Files changed (236) hide show
  1. package/README.md +39 -0
  2. package/USAGE.md +255 -2
  3. package/components/accordion/accordion.a2ui.json +3 -0
  4. package/components/accordion/accordion.d.ts +12 -2
  5. package/components/accordion/accordion.yaml +4 -0
  6. package/components/action-list/action-list.a2ui.json +18 -1
  7. package/components/action-list/action-list.d.ts +21 -2
  8. package/components/action-list/action-list.yaml +14 -0
  9. package/components/agent-artifact/agent-artifact.a2ui.json +11 -1
  10. package/components/agent-artifact/agent-artifact.d.ts +17 -2
  11. package/components/agent-artifact/agent-artifact.yaml +9 -0
  12. package/components/agent-feedback-bar/agent-feedback-bar.a2ui.json +10 -1
  13. package/components/agent-feedback-bar/agent-feedback-bar.d.ts +19 -2
  14. package/components/agent-feedback-bar/agent-feedback-bar.yaml +8 -0
  15. package/components/agent-questions/agent-questions.a2ui.json +14 -1
  16. package/components/agent-questions/agent-questions.d.ts +19 -2
  17. package/components/agent-questions/agent-questions.yaml +11 -0
  18. package/components/agent-reasoning/agent-reasoning.a2ui.json +29 -3
  19. package/components/agent-reasoning/agent-reasoning.d.ts +33 -2
  20. package/components/agent-reasoning/agent-reasoning.yaml +20 -0
  21. package/components/agent-suggestions/agent-suggestions.a2ui.json +18 -1
  22. package/components/agent-suggestions/agent-suggestions.d.ts +21 -2
  23. package/components/agent-suggestions/agent-suggestions.yaml +14 -0
  24. package/components/agent-trace/agent-trace.a2ui.json +8 -1
  25. package/components/agent-trace/agent-trace.d.ts +17 -2
  26. package/components/agent-trace/agent-trace.yaml +4 -0
  27. package/components/alert/alert.a2ui.json +1 -0
  28. package/components/alert/alert.d.ts +12 -2
  29. package/components/aside/aside.a2ui.json +1 -0
  30. package/components/avatar/avatar.a2ui.json +3 -0
  31. package/components/avatar/avatar.d.ts +3 -2
  32. package/components/avatar/avatar.yaml +4 -0
  33. package/components/badge/badge.a2ui.json +3 -0
  34. package/components/badge/badge.d.ts +3 -2
  35. package/components/badge/badge.yaml +4 -0
  36. package/components/block/block.a2ui.json +1 -0
  37. package/components/block/block.d.ts +3 -2
  38. package/components/breadcrumb/breadcrumb.a2ui.json +5 -0
  39. package/components/breadcrumb/breadcrumb.d.ts +3 -2
  40. package/components/breadcrumb/breadcrumb.yaml +6 -0
  41. package/components/button/button.a2ui.json +3 -0
  42. package/components/button/button.d.ts +12 -2
  43. package/components/button/button.yaml +5 -0
  44. package/components/calendar-picker/calendar-picker.a2ui.json +1 -0
  45. package/components/canvas/canvas.a2ui.json +1 -0
  46. package/components/canvas/canvas.d.ts +18 -2
  47. package/components/canvas/canvas.yaml +12 -0
  48. package/components/card/card.a2ui.json +1 -0
  49. package/components/card/card.d.ts +12 -2
  50. package/components/chart/chart.a2ui.json +4 -0
  51. package/components/chart/chart.d.ts +18 -2
  52. package/components/chart/chart.yaml +5 -0
  53. package/components/chart-legend/chart-legend.a2ui.json +19 -1
  54. package/components/chart-legend/chart-legend.d.ts +21 -2
  55. package/components/chart-legend/chart-legend.yaml +15 -0
  56. package/components/chat-thread/chat-thread.a2ui.json +12 -1
  57. package/components/chat-thread/chat-thread.d.ts +19 -2
  58. package/components/chat-thread/chat-thread.yaml +7 -0
  59. package/components/check/check.a2ui.json +1 -0
  60. package/components/code/code.a2ui.json +37 -7
  61. package/components/code/code.d.ts +30 -0
  62. package/components/code/code.yaml +29 -6
  63. package/components/col/col.a2ui.json +1 -0
  64. package/components/col/col.d.ts +3 -2
  65. package/components/color-picker/class.js +59 -1
  66. package/components/color-picker/color-picker.a2ui.json +37 -0
  67. package/components/color-picker/color-picker.d.ts +70 -8
  68. package/components/color-picker/color-picker.yaml +53 -0
  69. package/components/command/command.a2ui.json +12 -1
  70. package/components/command/command.d.ts +21 -2
  71. package/components/command/command.yaml +7 -0
  72. package/components/demo-toggle/demo-toggle.a2ui.json +8 -1
  73. package/components/demo-toggle/demo-toggle.d.ts +17 -2
  74. package/components/demo-toggle/demo-toggle.yaml +4 -0
  75. package/components/description-list/description-list.a2ui.json +1 -0
  76. package/components/description-list/description-list.d.ts +3 -2
  77. package/components/divider/divider.a2ui.json +1 -0
  78. package/components/divider/divider.d.ts +3 -2
  79. package/components/drawer/drawer.a2ui.json +1 -0
  80. package/components/drawer/drawer.d.ts +12 -2
  81. package/components/embed/embed.a2ui.json +1 -0
  82. package/components/embed/embed.d.ts +3 -2
  83. package/components/empty-state/empty-state.a2ui.json +3 -0
  84. package/components/empty-state/empty-state.d.ts +3 -2
  85. package/components/empty-state/empty-state.yaml +4 -0
  86. package/components/feed/feed.a2ui.json +9 -1
  87. package/components/feed/feed.d.ts +12 -2
  88. package/components/feed/feed.yaml +8 -1
  89. package/components/field/field.a2ui.json +1 -0
  90. package/components/field/field.d.ts +3 -2
  91. package/components/fields/fields.a2ui.json +1 -0
  92. package/components/fields/fields.d.ts +3 -2
  93. package/components/footer/footer.a2ui.json +1 -0
  94. package/components/grid/grid.a2ui.json +1 -0
  95. package/components/grid/grid.d.ts +3 -2
  96. package/components/header/header.a2ui.json +1 -0
  97. package/components/heatmap/heatmap.a2ui.json +12 -2
  98. package/components/heatmap/heatmap.d.ts +20 -2
  99. package/components/heatmap/heatmap.yaml +17 -2
  100. package/components/icon/icon.a2ui.json +1 -0
  101. package/components/icon/icon.d.ts +3 -2
  102. package/components/image/image.a2ui.json +3 -0
  103. package/components/image/image.d.ts +3 -2
  104. package/components/image/image.yaml +4 -0
  105. package/components/index.js +8 -0
  106. package/components/input/input.a2ui.json +4 -0
  107. package/components/input/input.yaml +6 -0
  108. package/components/inspector/inspector.a2ui.json +5 -0
  109. package/components/inspector/inspector.d.ts +3 -2
  110. package/components/inspector/inspector.yaml +6 -0
  111. package/components/kbd/kbd.a2ui.json +1 -0
  112. package/components/kbd/kbd.d.ts +3 -2
  113. package/components/link/link.a2ui.json +12 -1
  114. package/components/link/link.d.ts +19 -2
  115. package/components/link/link.yaml +7 -0
  116. package/components/list/list.a2ui.json +14 -1
  117. package/components/list/list.d.ts +19 -2
  118. package/components/list/list.yaml +11 -0
  119. package/components/menu/menu.a2ui.json +14 -1
  120. package/components/menu/menu.d.ts +19 -2
  121. package/components/menu/menu.yaml +11 -0
  122. package/components/modal/modal.a2ui.json +1 -0
  123. package/components/modal/modal.d.ts +12 -2
  124. package/components/nav/nav.a2ui.json +16 -1
  125. package/components/nav/nav.d.ts +21 -2
  126. package/components/nav/nav.yaml +10 -0
  127. package/components/nav-group/nav-group.a2ui.json +12 -1
  128. package/components/nav-group/nav-group.d.ts +19 -2
  129. package/components/nav-group/nav-group.yaml +7 -0
  130. package/components/nav-item/nav-item.a2ui.json +16 -1
  131. package/components/nav-item/nav-item.d.ts +21 -2
  132. package/components/nav-item/nav-item.yaml +10 -0
  133. package/components/noodles/noodles.a2ui.json +47 -2
  134. package/components/noodles/noodles.d.ts +42 -2
  135. package/components/noodles/noodles.yaml +32 -0
  136. package/components/option-card/option-card.a2ui.json +3 -0
  137. package/components/option-card/option-card.yaml +4 -0
  138. package/components/otp-input/otp-input.a2ui.json +15 -2
  139. package/components/otp-input/otp-input.d.ts +11 -0
  140. package/components/otp-input/otp-input.yaml +10 -2
  141. package/components/page/page.a2ui.json +1 -0
  142. package/components/page/page.d.ts +3 -2
  143. package/components/pagination/pagination.a2ui.json +8 -1
  144. package/components/pagination/pagination.d.ts +17 -2
  145. package/components/pagination/pagination.yaml +4 -0
  146. package/components/pane/pane.a2ui.json +8 -1
  147. package/components/pane/pane.d.ts +12 -2
  148. package/components/pane/pane.yaml +7 -1
  149. package/components/pipeline-status/pipeline-status.a2ui.json +1 -0
  150. package/components/pipeline-status/pipeline-status.d.ts +3 -2
  151. package/components/popover/popover.a2ui.json +1 -0
  152. package/components/popover/popover.d.ts +3 -2
  153. package/components/progress/progress.a2ui.json +1 -0
  154. package/components/progress/progress.d.ts +3 -2
  155. package/components/progress-row/progress-row.a2ui.json +3 -0
  156. package/components/progress-row/progress-row.d.ts +3 -2
  157. package/components/progress-row/progress-row.yaml +4 -0
  158. package/components/radio/radio.a2ui.json +1 -0
  159. package/components/range/range.a2ui.json +1 -0
  160. package/components/rating/rating.a2ui.json +1 -0
  161. package/components/richtext/richtext.a2ui.json +1 -0
  162. package/components/richtext/richtext.d.ts +3 -2
  163. package/components/row/row.a2ui.json +1 -0
  164. package/components/row/row.d.ts +12 -2
  165. package/components/search/search.a2ui.json +1 -0
  166. package/components/section/section.a2ui.json +1 -0
  167. package/components/segment/segment.a2ui.json +3 -0
  168. package/components/segment/segment.d.ts +3 -2
  169. package/components/segment/segment.yaml +4 -0
  170. package/components/segmented/segmented.a2ui.json +1 -0
  171. package/components/select/select.a2ui.json +3 -0
  172. package/components/select/select.yaml +4 -0
  173. package/components/skeleton/skeleton.a2ui.json +1 -0
  174. package/components/skeleton/skeleton.d.ts +3 -2
  175. package/components/slider/slider.a2ui.json +1 -0
  176. package/components/stack/stack.a2ui.json +1 -0
  177. package/components/stack/stack.d.ts +3 -2
  178. package/components/stat/stat.a2ui.json +1 -0
  179. package/components/step-progress/step-progress.a2ui.json +1 -0
  180. package/components/step-progress/step-progress.d.ts +3 -2
  181. package/components/stepper/stepper.a2ui.json +3 -0
  182. package/components/stepper/stepper.d.ts +3 -2
  183. package/components/stepper/stepper.yaml +4 -0
  184. package/components/stream/stream.a2ui.json +8 -1
  185. package/components/stream/stream.d.ts +21 -2
  186. package/components/stream/stream.yaml +4 -0
  187. package/components/swatch/class.js +362 -15
  188. package/components/swatch/swatch.a2ui.json +69 -1
  189. package/components/swatch/swatch.css +150 -0
  190. package/components/swatch/swatch.d.ts +46 -2
  191. package/components/swatch/swatch.yaml +67 -1
  192. package/components/swiper/swiper.a2ui.json +21 -2
  193. package/components/swiper/swiper.d.ts +28 -2
  194. package/components/swiper/swiper.yaml +15 -0
  195. package/components/switch/switch.a2ui.json +1 -0
  196. package/components/table/table.a2ui.json +87 -5
  197. package/components/table/table.d.ts +73 -2
  198. package/components/table/table.yaml +62 -2
  199. package/components/table-toolbar/table-toolbar.a2ui.json +12 -0
  200. package/components/table-toolbar/table-toolbar.d.ts +18 -2
  201. package/components/table-toolbar/table-toolbar.yaml +13 -0
  202. package/components/tabs/tabs.a2ui.json +10 -1
  203. package/components/tabs/tabs.d.ts +17 -2
  204. package/components/tabs/tabs.yaml +8 -0
  205. package/components/tag/tag.a2ui.json +12 -1
  206. package/components/tag/tag.d.ts +19 -2
  207. package/components/tag/tag.yaml +7 -0
  208. package/components/text/text.a2ui.json +1 -0
  209. package/components/text/text.d.ts +3 -2
  210. package/components/textarea/textarea.a2ui.json +1 -0
  211. package/components/timeline/timeline.a2ui.json +14 -1
  212. package/components/timeline/timeline.d.ts +17 -2
  213. package/components/timeline/timeline.yaml +11 -1
  214. package/components/toast/toast.a2ui.json +1 -0
  215. package/components/toast/toast.d.ts +12 -2
  216. package/components/toggle-group/toggle-group.a2ui.json +8 -1
  217. package/components/toggle-group/toggle-group.d.ts +17 -2
  218. package/components/toggle-group/toggle-group.yaml +4 -0
  219. package/components/toggle-scheme/toggle-scheme.a2ui.json +14 -1
  220. package/components/toggle-scheme/toggle-scheme.d.ts +19 -2
  221. package/components/toggle-scheme/toggle-scheme.yaml +11 -0
  222. package/components/toolbar/toolbar.a2ui.json +3 -0
  223. package/components/toolbar/toolbar.d.ts +3 -2
  224. package/components/toolbar/toolbar.yaml +4 -0
  225. package/components/tooltip/tooltip.a2ui.json +1 -0
  226. package/components/tooltip/tooltip.d.ts +3 -2
  227. package/components/tree/tree.a2ui.json +18 -1
  228. package/components/tree/tree.d.ts +21 -2
  229. package/components/tree/tree.yaml +14 -0
  230. package/components/upload/upload.a2ui.json +1 -0
  231. package/core/icons-phosphor.js +93 -0
  232. package/core/icons.js +92 -90
  233. package/core/index.js +5 -0
  234. package/index.d.ts +87 -79
  235. package/index.js +7 -0
  236. package/package.json +3 -2
@@ -1,30 +1,92 @@
1
1
  /**
2
- * `<color-picker-ui>` — Color picker with hex / rgb / hsl / oklch formats.
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
- export type ColorFormat = 'hex' | 'rgb' | 'hsl' | 'oklch';
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
- format: ColorFormat;
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
- export interface ColorPickerFormatChangeEventDetail {
19
- format: ColorFormat;
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 ColorPickerFormatChangeEvent = CustomEvent<ColorPickerFormatChangeEventDetail>;
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: 'format-change', listener: (ev: ColorPickerFormatChangeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
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 regenerate;
9
- * or hand-author this file fully if rich event types are needed.
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 regenerate;
9
- * or hand-author this file fully if rich event types are needed.
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.
@@ -47,6 +47,7 @@
47
47
  "x-adiaui": {
48
48
  "anti_patterns": [],
49
49
  "category": "display",
50
+ "composes": [],
50
51
  "events": {},
51
52
  "examples": [],
52
53
  "keywords": [
@@ -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 regenerate;
9
- * or hand-author this file fully if rich event types are needed.
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';
@@ -34,6 +34,7 @@
34
34
  "x-adiaui": {
35
35
  "anti_patterns": [],
36
36
  "category": "display",
37
+ "composes": [],
37
38
  "events": {},
38
39
  "examples": [
39
40
  {
@@ -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 regenerate;
9
- * or hand-author this file fully if rich event types are needed.
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';
@@ -60,6 +60,7 @@
60
60
  "x-adiaui": {
61
61
  "anti_patterns": [],
62
62
  "category": "container",
63
+ "composes": [],
63
64
  "events": {
64
65
  "close": {
65
66
  "description": "Fired when the drawer is dismissed via close button or backdrop click"
@@ -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 regenerate;
9
- * or hand-author this file fully if rich event types are needed.
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
  }
@@ -44,6 +44,7 @@
44
44
  "x-adiaui": {
45
45
  "anti_patterns": [],
46
46
  "category": "agent",
47
+ "composes": [],
47
48
  "events": {},
48
49
  "examples": [
49
50
  {
@@ -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 regenerate;
9
- * or hand-author this file fully if rich event types are needed.
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';
@@ -39,6 +39,9 @@
39
39
  "x-adiaui": {
40
40
  "anti_patterns": [],
41
41
  "category": "display",
42
+ "composes": [
43
+ "icon-ui"
44
+ ],
42
45
  "events": {},
43
46
  "examples": [
44
47
  {
@@ -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 regenerate;
9
- * or hand-author this file fully if rich event types are needed.
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
- "events": {},
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 regenerate;
9
- * or hand-author this file fully if rich event types are needed.
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: {}
@@ -57,6 +57,7 @@
57
57
  }
58
58
  ],
59
59
  "category": "form",
60
+ "composes": [],
60
61
  "events": {},
61
62
  "examples": [
62
63
  {
@@ -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 regenerate;
9
- * or hand-author this file fully if rich event types are needed.
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';
@@ -43,6 +43,7 @@
43
43
  }
44
44
  ],
45
45
  "category": "form",
46
+ "composes": [],
46
47
  "events": {},
47
48
  "examples": [
48
49
  {
@@ -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 regenerate;
9
- * or hand-author this file fully if rich event types are needed.
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';
@@ -35,6 +35,7 @@
35
35
  "x-adiaui": {
36
36
  "anti_patterns": [],
37
37
  "category": "container",
38
+ "composes": [],
38
39
  "events": {},
39
40
  "examples": [
40
41
  {
@@ -44,6 +44,7 @@
44
44
  "x-adiaui": {
45
45
  "anti_patterns": [],
46
46
  "category": "layout",
47
+ "composes": [],
47
48
  "events": {},
48
49
  "examples": [
49
50
  {
@@ -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 regenerate;
9
- * or hand-author this file fully if rich event types are needed.
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';
@@ -29,6 +29,7 @@
29
29
  "x-adiaui": {
30
30
  "anti_patterns": [],
31
31
  "category": "container",
32
+ "composes": [],
32
33
  "events": {},
33
34
  "examples": [
34
35
  {
@@ -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-click."
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-hover."
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": [