@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
@@ -5,12 +5,22 @@
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 AgentQuestionsQuestionsAnswerEventDetail {
16
+ /** The full selected option object. */
17
+ option: Record<string, unknown>;
18
+ /** Array of selected option IDs. */
19
+ selected: unknown[];
20
+ }
21
+
22
+ export type AgentQuestionsQuestionsAnswerEvent = CustomEvent<AgentQuestionsQuestionsAnswerEventDetail>;
23
+
14
24
  export class UIAgentQuestions extends UIElement {
15
25
  /** Helper text. */
16
26
  helper: string;
@@ -20,4 +30,11 @@ export class UIAgentQuestions extends UIElement {
20
30
  question: string;
21
31
  /** Submit button label (multi mode). */
22
32
  submitLabel: string;
33
+
34
+ addEventListener<K extends keyof HTMLElementEventMap>(
35
+ type: K,
36
+ listener: (this: UIAgentQuestions, ev: HTMLElementEventMap[K]) => unknown,
37
+ options?: boolean | AddEventListenerOptions,
38
+ ): void;
39
+ addEventListener(type: 'questions-answer', listener: (ev: AgentQuestionsQuestionsAnswerEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
23
40
  }
@@ -7,6 +7,10 @@ component: AgentQuestions
7
7
  category: agent
8
8
  version: 1
9
9
  description: Multi-choice clarifying-question cards.
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
+ - button-ui
10
14
  props:
11
15
  helper:
12
16
  description: Helper text.
@@ -28,6 +32,13 @@ props:
28
32
  events:
29
33
  questions-answer:
30
34
  description: "Fired on questions-answer."
35
+ detail:
36
+ selected:
37
+ type: array
38
+ description: Array of selected option IDs.
39
+ option:
40
+ type: object
41
+ description: The full selected option object.
31
42
  slots:
32
43
  default:
33
44
  description: "Default slot — primary child content."
@@ -50,15 +50,41 @@
50
50
  "x-adiaui": {
51
51
  "anti_patterns": [],
52
52
  "category": "agent",
53
+ "composes": [
54
+ "timeline-ui",
55
+ "timeline-item-ui"
56
+ ],
53
57
  "events": {
54
58
  "reasoning-finish": {
55
- "description": "Fired on reasoning-finish."
59
+ "description": "Fired on reasoning-finish.",
60
+ "detail": {
61
+ "status": {
62
+ "description": "Whether reasoning was resolved.",
63
+ "type": "boolean"
64
+ },
65
+ "summary": {
66
+ "description": "Summary label text rendered after finish.",
67
+ "type": "string"
68
+ }
69
+ }
56
70
  },
57
71
  "reasoning-step-toggle": {
58
- "description": "Fired on reasoning-step-toggle."
72
+ "description": "Fired on reasoning-step-toggle.",
73
+ "detail": {
74
+ "stepId": {
75
+ "description": "ID of the toggled reasoning step (matches data-step-id).",
76
+ "type": "string"
77
+ }
78
+ }
59
79
  },
60
80
  "reasoning-toggle": {
61
- "description": "Fired on reasoning-toggle."
81
+ "description": "Fired on reasoning-toggle.",
82
+ "detail": {
83
+ "collapsed": {
84
+ "description": "Whether the reasoning section is now collapsed.",
85
+ "type": "boolean"
86
+ }
87
+ }
62
88
  }
63
89
  },
64
90
  "examples": [
@@ -5,12 +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 interface AgentReasoningReasoningFinishEventDetail {
16
+ /** Whether reasoning was resolved. */
17
+ status: boolean;
18
+ /** Summary label text rendered after finish. */
19
+ summary: string;
20
+ }
21
+
22
+ export type AgentReasoningReasoningFinishEvent = CustomEvent<AgentReasoningReasoningFinishEventDetail>;
23
+ export interface AgentReasoningReasoningStepToggleEventDetail {
24
+ /** ID of the toggled reasoning step (matches data-step-id). */
25
+ stepId: string;
26
+ }
27
+
28
+ export type AgentReasoningReasoningStepToggleEvent = CustomEvent<AgentReasoningReasoningStepToggleEventDetail>;
29
+ export interface AgentReasoningReasoningToggleEventDetail {
30
+ /** Whether the reasoning section is now collapsed. */
31
+ collapsed: boolean;
32
+ }
33
+
34
+ export type AgentReasoningReasoningToggleEvent = CustomEvent<AgentReasoningReasoningToggleEventDetail>;
35
+
14
36
  export class UIAgentReasoning extends UIElement {
15
37
  /** Start collapsed. */
16
38
  collapsed: boolean;
@@ -20,4 +42,13 @@ export class UIAgentReasoning extends UIElement {
20
42
  noAutocollapse: boolean;
21
43
  /** Drives the status icon — idle, active (spinner), done (check), error (warning). */
22
44
  status: 'idle' | 'active' | 'done' | 'error';
45
+
46
+ addEventListener<K extends keyof HTMLElementEventMap>(
47
+ type: K,
48
+ listener: (this: UIAgentReasoning, ev: HTMLElementEventMap[K]) => unknown,
49
+ options?: boolean | AddEventListenerOptions,
50
+ ): void;
51
+ addEventListener(type: 'reasoning-finish', listener: (ev: AgentReasoningReasoningFinishEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
52
+ addEventListener(type: 'reasoning-step-toggle', listener: (ev: AgentReasoningReasoningStepToggleEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
53
+ addEventListener(type: 'reasoning-toggle', listener: (ev: AgentReasoningReasoningToggleEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
23
54
  }
@@ -7,6 +7,11 @@ component: AgentReasoning
7
7
  category: agent
8
8
  version: 1
9
9
  description: Agent inner monologue + pipeline viewer with steps, thoughts, plans, and iterations.
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
+ - timeline-ui
14
+ - timeline-item-ui
10
15
  props:
11
16
  noAutocollapse:
12
17
  description: Disable auto-collapse after finish().
@@ -30,10 +35,25 @@ props:
30
35
  events:
31
36
  reasoning-finish:
32
37
  description: "Fired on reasoning-finish."
38
+ detail:
39
+ summary:
40
+ type: string
41
+ description: Summary label text rendered after finish.
42
+ status:
43
+ type: boolean
44
+ description: Whether reasoning was resolved.
33
45
  reasoning-step-toggle:
34
46
  description: "Fired on reasoning-step-toggle."
47
+ detail:
48
+ stepId:
49
+ type: string
50
+ description: ID of the toggled reasoning step (matches data-step-id).
35
51
  reasoning-toggle:
36
52
  description: "Fired on reasoning-toggle."
53
+ detail:
54
+ collapsed:
55
+ type: boolean
56
+ description: Whether the reasoning section is now collapsed.
37
57
  slots:
38
58
  default:
39
59
  description: "Default slot — primary child content."
@@ -39,9 +39,26 @@
39
39
  "x-adiaui": {
40
40
  "anti_patterns": [],
41
41
  "category": "agent",
42
+ "composes": [
43
+ "button-ui"
44
+ ],
42
45
  "events": {
43
46
  "suggestion-select": {
44
- "description": "Fired on suggestion-select."
47
+ "description": "Fired on suggestion-select.",
48
+ "detail": {
49
+ "index": {
50
+ "description": "Index of the selected suggestion.",
51
+ "type": "number"
52
+ },
53
+ "label": {
54
+ "description": "Suggestion label text.",
55
+ "type": "string"
56
+ },
57
+ "prompt": {
58
+ "description": "Suggestion prompt content.",
59
+ "type": "string"
60
+ }
61
+ }
45
62
  }
46
63
  },
47
64
  "examples": [
@@ -5,12 +5,24 @@
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 AgentSuggestionsSuggestionSelectEventDetail {
16
+ /** Index of the selected suggestion. */
17
+ index: number;
18
+ /** Suggestion label text. */
19
+ label: string;
20
+ /** Suggestion prompt content. */
21
+ prompt: string;
22
+ }
23
+
24
+ export type AgentSuggestionsSuggestionSelectEvent = CustomEvent<AgentSuggestionsSuggestionSelectEventDetail>;
25
+
14
26
  export class UIAgentSuggestions extends UIElement {
15
27
  /** Disable all chips. */
16
28
  disabled: boolean;
@@ -18,4 +30,11 @@ export class UIAgentSuggestions extends UIElement {
18
30
  size: string;
19
31
  /** outline | ghost | subtle */
20
32
  variant: string;
33
+
34
+ addEventListener<K extends keyof HTMLElementEventMap>(
35
+ type: K,
36
+ listener: (this: UIAgentSuggestions, ev: HTMLElementEventMap[K]) => unknown,
37
+ options?: boolean | AddEventListenerOptions,
38
+ ): void;
39
+ addEventListener(type: 'suggestion-select', listener: (ev: AgentSuggestionsSuggestionSelectEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
21
40
  }
@@ -7,6 +7,10 @@ component: AgentSuggestions
7
7
  category: agent
8
8
  version: 1
9
9
  description: Row of follow-up suggestion chips.
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
+ - button-ui
10
14
  props:
11
15
  disabled:
12
16
  description: Disable all chips.
@@ -24,6 +28,16 @@ props:
24
28
  events:
25
29
  suggestion-select:
26
30
  description: "Fired on suggestion-select."
31
+ detail:
32
+ label:
33
+ type: string
34
+ description: Suggestion label text.
35
+ prompt:
36
+ type: string
37
+ description: Suggestion prompt content.
38
+ index:
39
+ type: number
40
+ description: Index of the selected suggestion.
27
41
  slots:
28
42
  default:
29
43
  description: "Default slot — primary child content."
@@ -34,9 +34,16 @@
34
34
  "x-adiaui": {
35
35
  "anti_patterns": [],
36
36
  "category": "agent",
37
+ "composes": [],
37
38
  "events": {
38
39
  "trace-toggle": {
39
- "description": "Fired on trace-toggle."
40
+ "description": "Fired on trace-toggle.",
41
+ "detail": {
42
+ "collapsed": {
43
+ "description": "Whether the trace is now collapsed.",
44
+ "type": "boolean"
45
+ }
46
+ }
40
47
  }
41
48
  },
42
49
  "examples": [
@@ -5,15 +5,30 @@
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 AgentTraceTraceToggleEventDetail {
16
+ /** Whether the trace is now collapsed. */
17
+ collapsed: boolean;
18
+ }
19
+
20
+ export type AgentTraceTraceToggleEvent = CustomEvent<AgentTraceTraceToggleEventDetail>;
21
+
14
22
  export class UIAgentTrace extends UIElement {
15
23
  /** Hide the trace body. Default-visible disclosure (matches the agent-* family — agent-reasoning, agent-artifact). Set to opt out. */
16
24
  collapsed: boolean;
17
25
  /** Fallback summary label. */
18
26
  label: string;
27
+
28
+ addEventListener<K extends keyof HTMLElementEventMap>(
29
+ type: K,
30
+ listener: (this: UIAgentTrace, ev: HTMLElementEventMap[K]) => unknown,
31
+ options?: boolean | AddEventListenerOptions,
32
+ ): void;
33
+ addEventListener(type: 'trace-toggle', listener: (ev: AgentTraceTraceToggleEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
19
34
  }
@@ -20,6 +20,10 @@ props:
20
20
  events:
21
21
  trace-toggle:
22
22
  description: "Fired on trace-toggle."
23
+ detail:
24
+ collapsed:
25
+ type: boolean
26
+ description: Whether the trace is now collapsed.
23
27
  slots:
24
28
  default:
25
29
  description: "Default slot — primary child content."
@@ -68,6 +68,7 @@
68
68
  "x-adiaui": {
69
69
  "anti_patterns": [],
70
70
  "category": "container",
71
+ "composes": [],
71
72
  "events": {
72
73
  "close": {
73
74
  "description": "Fired when the close button is clicked"
@@ -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 AlertCloseEvent = CustomEvent<unknown>;
16
+
14
17
  export class UIAlert extends UIElement {
15
18
  /** Bold headline rendered as the first line of the alert content. Pair with [description] for the canonical "banner" pattern (headline + body). When [title] or [description] is set, the [text] prop is ignored. */
16
19
  title: string;
@@ -26,4 +29,11 @@ export class UIAlert extends UIElement {
26
29
  text: string;
27
30
  /** Semantic color variant. */
28
31
  variant: 'default' | 'info' | 'success' | 'warning' | 'danger' | 'muted' | 'neutral';
32
+
33
+ addEventListener<K extends keyof HTMLElementEventMap>(
34
+ type: K,
35
+ listener: (this: UIAlert, ev: HTMLElementEventMap[K]) => unknown,
36
+ options?: boolean | AddEventListenerOptions,
37
+ ): void;
38
+ addEventListener(type: 'close', listener: (ev: AlertCloseEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
29
39
  }
@@ -40,6 +40,7 @@
40
40
  "x-adiaui": {
41
41
  "anti_patterns": [],
42
42
  "category": "container",
43
+ "composes": [],
43
44
  "events": {},
44
45
  "examples": [
45
46
  {
@@ -69,6 +69,9 @@
69
69
  "x-adiaui": {
70
70
  "anti_patterns": [],
71
71
  "category": "display",
72
+ "composes": [
73
+ "icon-ui"
74
+ ],
72
75
  "events": {},
73
76
  "examples": [
74
77
  {
@@ -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: Avatar
7
7
  category: display
8
8
  version: 1
9
9
  description: Avatar with image → initials → empty fallback chain.
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
  text:
12
16
  description: Display string (full name or initials). Initials derive from spaces — first letter of each word, max 2.
@@ -78,6 +78,9 @@
78
78
  "x-adiaui": {
79
79
  "anti_patterns": [],
80
80
  "category": "display",
81
+ "composes": [
82
+ "icon-ui"
83
+ ],
81
84
  "events": {},
82
85
  "examples": [
83
86
  {
@@ -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: Badge
7
7
  category: display
8
8
  version: 1
9
9
  description: Inline pill-shaped badge/tag. Text rendered via CSS attr().
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
  icon:
12
16
  description: Optional leading icon (any registered name). Use icon="dot" for chart-legend /
@@ -50,6 +50,7 @@
50
50
  "x-adiaui": {
51
51
  "anti_patterns": [],
52
52
  "category": "layout",
53
+ "composes": [],
53
54
  "events": {},
54
55
  "examples": [
55
56
  {
@@ -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';
@@ -44,6 +44,11 @@
44
44
  "x-adiaui": {
45
45
  "anti_patterns": [],
46
46
  "category": "navigation",
47
+ "composes": [
48
+ "menu-ui",
49
+ "button-ui",
50
+ "menu-item-ui"
51
+ ],
47
52
  "events": {},
48
53
  "examples": [
49
54
  {
@@ -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,12 @@ component: Breadcrumb
7
7
  category: navigation
8
8
  version: 1
9
9
  description: Breadcrumb trail with auto-inserted separators. Supports a leading icon (first child) and an overflow popover that collapses middle crumbs into a `…` menu.
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
+ - menu-ui
14
+ - button-ui
15
+ - menu-item-ui
10
16
  props:
11
17
  separator:
12
18
  description: Character or string rendered between breadcrumb items via CSS ::before.
@@ -98,6 +98,9 @@
98
98
  "x-adiaui": {
99
99
  "anti_patterns": [],
100
100
  "category": "action",
101
+ "composes": [
102
+ "icon-ui"
103
+ ],
101
104
  "events": {
102
105
  "press": {
103
106
  "description": "Fired on complete press (pointer up or Enter/Space)"
@@ -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 ButtonPressEvent = CustomEvent<unknown>;
16
+
14
17
  export class UIButton extends UIElement {
15
18
  /** HTML button type (button, submit, reset) */
16
19
  type: string;
@@ -31,4 +34,11 @@ export class UIButton extends UIElement {
31
34
  /** Visual style — `solid` (default fill), `outline`, `ghost`. `default` / `primary` are aliases of `solid`. Style is independent of semantic intent — to express destructive / success / info / warning intent, set [color="…"] alongside.
32
35
  For **inline navigation** (Terms of Service, Privacy Policy, footer links, "Sign in" / "Sign up" cross-page affordances) use `<link-ui>` instead — it carries proper `<a href>` semantics, keyboard handling (Enter only, no Space), middle-click open-new-tab, and screen-reader announces "link" instead of "button". Mixing navigation and action affordances under the same primitive is a category error fixed at this junction. */
33
36
  variant: 'default' | 'solid' | 'outline' | 'ghost' | 'primary' | 'secondary' | 'soft' | 'current';
37
+
38
+ addEventListener<K extends keyof HTMLElementEventMap>(
39
+ type: K,
40
+ listener: (this: UIButton, ev: HTMLElementEventMap[K]) => unknown,
41
+ options?: boolean | AddEventListenerOptions,
42
+ ): void;
43
+ addEventListener(type: 'press', listener: (ev: ButtonPressEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
34
44
  }
@@ -7,6 +7,11 @@ component: Button
7
7
  category: action
8
8
  version: 1
9
9
  description: Clickable button with text, icon, and variant support. Supports submit type for forms.
10
+ # Per ADR-0027 — primitives that programmatically create other primitives
11
+ # in their render() do NOT auto-import them. Consumer (or demo shell) must
12
+ # explicitly import each composed primitive.
13
+ composes:
14
+ - icon-ui # created via document.createElement('icon-ui') when [icon] is set
10
15
  props:
11
16
  aria-label:
12
17
  description: Accessible label for screen readers. Auto-set from `text` when text is non-empty; meaningful override for icon-only buttons.
@@ -79,6 +79,7 @@
79
79
  "x-adiaui": {
80
80
  "anti_patterns": [],
81
81
  "category": "input",
82
+ "composes": [],
82
83
  "events": {
83
84
  "change": {
84
85
  "description": "Fired when a date is selected"
@@ -29,6 +29,7 @@
29
29
  "x-adiaui": {
30
30
  "anti_patterns": [],
31
31
  "category": "agent",
32
+ "composes": [],
32
33
  "events": {
33
34
  "canvas-interaction": {
34
35
  "description": "Fired on canvas-interaction."
@@ -5,13 +5,29 @@
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 CanvasInteractionEvent = CustomEvent<unknown>;
16
+ export type CanvasChangeEvent = CustomEvent<unknown>;
17
+ export type CanvasClickEvent = CustomEvent<unknown>;
18
+ export type CanvasInputEvent = CustomEvent<unknown>;
19
+
14
20
  export class UICanvas extends UIElement {
15
21
  /** Component property: theme. */
16
22
  theme: string;
23
+
24
+ addEventListener<K extends keyof HTMLElementEventMap>(
25
+ type: K,
26
+ listener: (this: UICanvas, ev: HTMLElementEventMap[K]) => unknown,
27
+ options?: boolean | AddEventListenerOptions,
28
+ ): void;
29
+ addEventListener(type: 'canvas-interaction', listener: (ev: CanvasInteractionEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
30
+ addEventListener(type: 'change', listener: (ev: CanvasChangeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
31
+ addEventListener(type: 'click', listener: (ev: CanvasClickEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
32
+ addEventListener(type: 'input', listener: (ev: CanvasInputEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
17
33
  }