@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
@@ -8,6 +8,14 @@ category: agent
8
8
  version: 1
9
9
  description: Data table with sorting, selection, pagination, search, column resize, keyboard nav,
10
10
  cell types, and CSV export. CSS grid + ARIA grid roles.
11
+ # Per ADR-0027 — primitives that programmatically create other primitives
12
+ # do NOT auto-import them. Consumer (or demo shell) must explicitly import.
13
+ composes:
14
+ - check-ui
15
+ - icon-ui
16
+ - progress-ui
17
+ - pagination-ui
18
+ - badge-ui
11
19
  props:
12
20
  columns:
13
21
  description: Column definitions. Array of {key, label, type?, width?, minWidth?, maxWidth?, flex?, sortable?, resizable?, filterable?, pinned?, hidden?, accessor?, format?, render?, sortFn?, filterType?, meta?}. Alternative to declarative <col-def> children.
@@ -66,15 +74,67 @@ props:
66
74
  default: false
67
75
  events:
68
76
  cell-click:
69
- description: Fired when a data cell is clicked.
77
+ description: Fired when a data cell is clicked. detail carries the cell location + value.
78
+ detail:
79
+ key:
80
+ type: string
81
+ description: Column key.
82
+ row:
83
+ type: object
84
+ description: Row data object.
85
+ value:
86
+ description: Cell value (type depends on column).
87
+ dataIndex:
88
+ type: number
89
+ description: Row index in the underlying data array.
90
+ filter-change:
91
+ description: Fired when an interactive filter row applies / clears. detail.filters is the current filter map.
92
+ detail:
93
+ filters:
94
+ type: object
95
+ description: "Map of `{ [columnKey]: filterValue }` reflecting active filters."
70
96
  page:
71
97
  description: Fired when the user navigates to a different page.
98
+ detail:
99
+ page:
100
+ type: number
101
+ description: New active page index (1-based).
72
102
  resize:
73
103
  description: Fired when a column is resized via drag.
104
+ detail:
105
+ key:
106
+ type: string
107
+ description: Column key being resized.
108
+ width:
109
+ type: number
110
+ description: New column width in pixels.
111
+ row-expand:
112
+ description: Fired when an expandable row's chevron is activated. detail.index is the row position; detail.row is the row data.
113
+ detail:
114
+ index:
115
+ type: number
116
+ description: Row index in the underlying data array.
117
+ row:
118
+ type: object
119
+ description: Row data object.
74
120
  select:
75
- description: Fired when row selection changes.
121
+ description: Fired when row selection changes. detail.selected is an array of row indices or IDs.
122
+ detail:
123
+ selected:
124
+ type: array
125
+ description: Array of selected row indices or IDs (driven by [select-mode]).
76
126
  sort:
77
127
  description: Fired when sort state changes via header click.
128
+ detail:
129
+ key:
130
+ type: string
131
+ description: Column key being sorted.
132
+ dir:
133
+ type: string
134
+ description: Sort direction — "asc" / "desc" / null (cleared).
135
+ sortState:
136
+ type: array
137
+ description: Full sort state array (multi-column support).
78
138
  slots: {}
79
139
  states:
80
140
  - name: idle
@@ -73,6 +73,18 @@
73
73
  "x-adiaui": {
74
74
  "anti_patterns": [],
75
75
  "category": "agent",
76
+ "composes": [
77
+ "text-ui",
78
+ "badge-ui",
79
+ "search-ui",
80
+ "button-ui",
81
+ "field-ui",
82
+ "select-ui",
83
+ "input-ui",
84
+ "menu-item-ui",
85
+ "icon-ui",
86
+ "check-ui"
87
+ ],
76
88
  "events": {
77
89
  "columns-change": {
78
90
  "description": "Column visibility changed. Detail: { hiddenColumns }."
@@ -5,12 +5,18 @@
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 TableToolbarColumnsChangeEvent = CustomEvent<unknown>;
16
+ export type TableToolbarFilterChangeEvent = CustomEvent<unknown>;
17
+ export type TableToolbarSearchEvent = CustomEvent<unknown>;
18
+ export type TableToolbarSortChangeEvent = CustomEvent<unknown>;
19
+
14
20
  export class UITableToolbar extends UIElement {
15
21
  /** Optional count badge value shown next to the title. When unset, falls back to the row count of the bound table. */
16
22
  count: string;
@@ -30,4 +36,14 @@ export class UITableToolbar extends UIElement {
30
36
  text: string;
31
37
  /** Toolbar visual variant. `default` renders bare on parent surface; `card` adds the same chrome as a card-ui header. */
32
38
  variant: 'default' | 'card';
39
+
40
+ addEventListener<K extends keyof HTMLElementEventMap>(
41
+ type: K,
42
+ listener: (this: UITableToolbar, ev: HTMLElementEventMap[K]) => unknown,
43
+ options?: boolean | AddEventListenerOptions,
44
+ ): void;
45
+ addEventListener(type: 'columns-change', listener: (ev: TableToolbarColumnsChangeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
46
+ addEventListener(type: 'filter-change', listener: (ev: TableToolbarFilterChangeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
47
+ addEventListener(type: 'search', listener: (ev: TableToolbarSearchEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
48
+ addEventListener(type: 'sort-change', listener: (ev: TableToolbarSortChangeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
33
49
  }
@@ -15,6 +15,19 @@ description: >-
15
15
  column descriptor's `filter` field overrides the auto-detect: `'select'`
16
16
  forces multi-select even on high-cardinality columns; `'text'` forces a
17
17
  contains input even on small enums.
18
+ # Per ADR-0027 — primitives that programmatically create other primitives
19
+ # do NOT auto-import them. Consumer (or demo shell) must explicitly import.
20
+ composes:
21
+ - text-ui
22
+ - badge-ui
23
+ - search-ui
24
+ - button-ui
25
+ - field-ui
26
+ - select-ui
27
+ - input-ui
28
+ - menu-item-ui
29
+ - icon-ui
30
+ - check-ui
18
31
  props:
19
32
  for:
20
33
  description: id-ref of the table-ui to control. Falls back to the first sibling table-ui within the same parent when omitted.
@@ -46,9 +46,18 @@
46
46
  "x-adiaui": {
47
47
  "anti_patterns": [],
48
48
  "category": "container",
49
+ "composes": [
50
+ "icon-ui"
51
+ ],
49
52
  "events": {
50
53
  "change": {
51
- "description": "Fired when the value changes (on blur for inputs, on selection for pickers)."
54
+ "description": "Fired when the value changes (on blur for inputs, on selection for pickers).",
55
+ "detail": {
56
+ "value": {
57
+ "description": "New active tab value.",
58
+ "type": "string"
59
+ }
60
+ }
52
61
  }
53
62
  },
54
63
  "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 TabsChangeEventDetail {
16
+ /** New active tab value. */
17
+ value: string;
18
+ }
19
+
20
+ export type TabsChangeEvent = CustomEvent<TabsChangeEventDetail>;
21
+
14
22
  export class UITabs extends UIElement {
15
23
  /** Tab strip orientation. Set to 'vertical' for vertical layout; empty/omitted for horizontal. */
16
24
  orientation: string;
@@ -18,4 +26,11 @@ export class UITabs extends UIElement {
18
26
  value: string;
19
27
  /** Visual variant — default underline strip, `pills` for filled pill tabs, `underline` (explicit). */
20
28
  variant: 'default' | 'pills' | 'underline' | 'segmented' | 'bordered';
29
+
30
+ addEventListener<K extends keyof HTMLElementEventMap>(
31
+ type: K,
32
+ listener: (this: UITabs, ev: HTMLElementEventMap[K]) => unknown,
33
+ options?: boolean | AddEventListenerOptions,
34
+ ): void;
35
+ addEventListener(type: 'change', listener: (ev: TabsChangeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
21
36
  }
@@ -7,6 +7,10 @@ component: Tabs
7
7
  category: container
8
8
  version: 1
9
9
  description: Tabbed panel switcher. Renders button strip from child tab-ui elements.
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
  orientation:
12
16
  description: Tab strip orientation. Set to 'vertical' for vertical layout; empty/omitted for horizontal.
@@ -25,6 +29,10 @@ props:
25
29
  events:
26
30
  change:
27
31
  description: "Fired when the value changes (on blur for inputs, on selection for pickers)."
32
+ detail:
33
+ value:
34
+ type: string
35
+ description: New active tab value.
28
36
  slots:
29
37
  default:
30
38
  description: Child tab-ui elements that form the tab strip
@@ -64,9 +64,20 @@
64
64
  "x-adiaui": {
65
65
  "anti_patterns": [],
66
66
  "category": "display",
67
+ "composes": [],
67
68
  "events": {
68
69
  "remove": {
69
- "description": "Fired when the dismiss button is activated."
70
+ "description": "Fired when the dismiss button is activated.",
71
+ "detail": {
72
+ "text": {
73
+ "description": "Tag text content.",
74
+ "type": "string"
75
+ },
76
+ "value": {
77
+ "description": "Tag value (same as text).",
78
+ "type": "string"
79
+ }
80
+ }
70
81
  }
71
82
  },
72
83
  "examples": [
@@ -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 TagRemoveEventDetail {
16
+ /** Tag text content. */
17
+ text: string;
18
+ /** Tag value (same as text). */
19
+ value: string;
20
+ }
21
+
22
+ export type TagRemoveEvent = CustomEvent<TagRemoveEventDetail>;
23
+
14
24
  export class UITag extends UIElement {
15
25
  /** Disables interaction and dims the tag. */
16
26
  disabled: boolean;
@@ -24,4 +34,11 @@ export class UITag extends UIElement {
24
34
  textContent: string;
25
35
  /** Semantic variant — `default | info | success | warning | danger`. */
26
36
  variant: 'default' | 'info' | 'success' | 'warning' | 'danger';
37
+
38
+ addEventListener<K extends keyof HTMLElementEventMap>(
39
+ type: K,
40
+ listener: (this: UITag, ev: HTMLElementEventMap[K]) => unknown,
41
+ options?: boolean | AddEventListenerOptions,
42
+ ): void;
43
+ addEventListener(type: 'remove', listener: (ev: TagRemoveEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
27
44
  }
@@ -45,6 +45,13 @@ props:
45
45
  events:
46
46
  remove:
47
47
  description: Fired when the dismiss button is activated.
48
+ detail:
49
+ text:
50
+ type: string
51
+ description: Tag text content.
52
+ value:
53
+ type: string
54
+ description: Tag value (same as text).
48
55
  slots: {}
49
56
  states:
50
57
  - name: idle
@@ -69,6 +69,7 @@
69
69
  "x-adiaui": {
70
70
  "anti_patterns": [],
71
71
  "category": "display",
72
+ "composes": [],
72
73
  "events": {},
73
74
  "examples": [
74
75
  {
@@ -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": "layout",
63
+ "composes": [],
63
64
  "events": {
64
65
  "change": {
65
66
  "description": "Fired when the textarea loses focus after a value change."
@@ -42,7 +42,20 @@
42
42
  "x-adiaui": {
43
43
  "anti_patterns": [],
44
44
  "category": "display",
45
- "events": {},
45
+ "composes": [
46
+ "icon-ui"
47
+ ],
48
+ "events": {
49
+ "timeline-toggle": {
50
+ "description": "Fired when a collapsible timeline item is expanded or collapsed. detail.expanded carries the new open state.",
51
+ "detail": {
52
+ "expanded": {
53
+ "description": "New open state of the toggled item after the press.",
54
+ "type": "boolean"
55
+ }
56
+ }
57
+ }
58
+ },
46
59
  "examples": [
47
60
  {
48
61
  "description": "Order tracking card with a timeline showing order status milestones from placed to delivered.",
@@ -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 TimelineToggleEventDetail {
16
+ /** New open state of the toggled item after the press. */
17
+ expanded: boolean;
18
+ }
19
+
20
+ export type TimelineToggleEvent = CustomEvent<TimelineToggleEventDetail>;
21
+
14
22
  export class UITimeline extends UIElement {
15
23
  /** Layout direction */
16
24
  orientation: 'vertical' | 'horizontal';
17
25
  /** Rail size preset — use `sm` for agent-reasoning/pipeline views; `md` is the default. */
18
26
  size: 'sm' | 'md';
27
+
28
+ addEventListener<K extends keyof HTMLElementEventMap>(
29
+ type: K,
30
+ listener: (this: UITimeline, ev: HTMLElementEventMap[K]) => unknown,
31
+ options?: boolean | AddEventListenerOptions,
32
+ ): void;
33
+ addEventListener(type: 'timeline-toggle', listener: (ev: TimelineToggleEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
19
34
  }
@@ -7,6 +7,10 @@ component: Timeline
7
7
  category: display
8
8
  version: 1
9
9
  description: "Timeline and step wizard. Two modes: timeline (per-item state) and steps (parent-driven)."
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
  orientation:
12
16
  description: Layout direction
@@ -21,7 +25,13 @@ props:
21
25
  default: md
22
26
  reflect: true
23
27
  enum: [sm, md]
24
- events: {}
28
+ events:
29
+ timeline-toggle:
30
+ description: Fired when a collapsible timeline item is expanded or collapsed. detail.expanded carries the new open state.
31
+ detail:
32
+ expanded:
33
+ type: boolean
34
+ description: New open state of the toggled item after the press.
25
35
  slots:
26
36
  default:
27
37
  description: Accepts <timeline-item-ui> children.
@@ -62,6 +62,7 @@
62
62
  "x-adiaui": {
63
63
  "anti_patterns": [],
64
64
  "category": "container",
65
+ "composes": [],
65
66
  "events": {
66
67
  "close": {
67
68
  "description": "Fired when the toast is dismissed via click or auto-timeout"
@@ -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 ToastCloseEvent = CustomEvent<unknown>;
16
+
14
17
  export class UIToast extends UIElement {
15
18
  /** Auto-dismiss time in milliseconds. 0 disables auto-dismiss. */
16
19
  duration: number;
@@ -20,4 +23,11 @@ export class UIToast extends UIElement {
20
23
  text: string;
21
24
  /** Semantic variant — `default | info | success | warning | danger`. `primary` and `muted` are style hints; canonical "neutral but interesting" tone is `info`. */
22
25
  variant: 'default' | 'info' | 'success' | 'warning' | 'danger' | 'primary' | 'muted' | 'neutral';
26
+
27
+ addEventListener<K extends keyof HTMLElementEventMap>(
28
+ type: K,
29
+ listener: (this: UIToast, ev: HTMLElementEventMap[K]) => unknown,
30
+ options?: boolean | AddEventListenerOptions,
31
+ ): void;
32
+ addEventListener(type: 'close', listener: (ev: ToastCloseEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
23
33
  }
@@ -34,9 +34,16 @@
34
34
  "x-adiaui": {
35
35
  "anti_patterns": [],
36
36
  "category": "navigation",
37
+ "composes": [],
37
38
  "events": {
38
39
  "change": {
39
- "description": "Fired when selection changes. detail: { value }"
40
+ "description": "Fired when selection changes. detail: { value }",
41
+ "detail": {
42
+ "value": {
43
+ "description": "New toggle-group value.",
44
+ "type": "string"
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 ToggleGroupChangeEventDetail {
16
+ /** New toggle-group value. */
17
+ value: string;
18
+ }
19
+
20
+ export type ToggleGroupChangeEvent = CustomEvent<ToggleGroupChangeEventDetail>;
21
+
14
22
  export class UIToggleGroup extends UIElement {
15
23
  /** When true, restrict to one active option (single-select). */
16
24
  single: boolean;
17
25
  /** Comma-separated selected values */
18
26
  value: string;
27
+
28
+ addEventListener<K extends keyof HTMLElementEventMap>(
29
+ type: K,
30
+ listener: (this: UIToggleGroup, ev: HTMLElementEventMap[K]) => unknown,
31
+ options?: boolean | AddEventListenerOptions,
32
+ ): void;
33
+ addEventListener(type: 'change', listener: (ev: ToggleGroupChangeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
19
34
  }
@@ -19,6 +19,10 @@ props:
19
19
  events:
20
20
  change:
21
21
  description: "Fired when selection changes. detail: { value }"
22
+ detail:
23
+ value:
24
+ type: string
25
+ description: New toggle-group value.
22
26
  slots:
23
27
  default:
24
28
  description: "Default slot — primary child content."
@@ -124,9 +124,22 @@
124
124
  "x-adiaui": {
125
125
  "anti_patterns": [],
126
126
  "category": "control",
127
+ "composes": [
128
+ "button-ui"
129
+ ],
127
130
  "events": {
128
131
  "scheme-change": {
129
- "description": "Fired when the active scheme changes. detail contains { scheme: \"light\" | \"dark\", source: \"press\" | \"media\" | \"programmatic\" }."
132
+ "description": "Fired when the active scheme changes. detail contains { scheme: \"light\" | \"dark\", source: \"press\" | \"media\" | \"programmatic\" }.",
133
+ "detail": {
134
+ "scheme": {
135
+ "description": "Active color scheme (\"light\" or \"dark\").",
136
+ "type": "string"
137
+ },
138
+ "source": {
139
+ "description": "Change source — \"press\" / \"media\" / \"programmatic\".",
140
+ "type": "string"
141
+ }
142
+ }
130
143
  }
131
144
  },
132
145
  "examples": [
@@ -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 ToggleSchemeSchemeChangeEventDetail {
16
+ /** Active color scheme ("light" or "dark"). */
17
+ scheme: string;
18
+ /** Change source — "press" / "media" / "programmatic". */
19
+ source: string;
20
+ }
21
+
22
+ export type ToggleSchemeSchemeChangeEvent = CustomEvent<ToggleSchemeSchemeChangeEventDetail>;
23
+
14
24
  export class UIToggleScheme extends UIElement {
15
25
  /** Resolved scheme ("light" | "dark"). Read-only; mutate via .setScheme() or .toggle(). */
16
26
  activeScheme: '' | 'light' | 'dark';
@@ -38,4 +48,11 @@ export class UIToggleScheme extends UIElement {
38
48
  target: string;
39
49
  /** Visual style forwarded to the internal <button-ui>. Defaults to "ghost" (matches app practice). */
40
50
  variant: 'default' | 'solid' | 'outline' | 'ghost' | 'primary' | 'secondary' | 'soft';
51
+
52
+ addEventListener<K extends keyof HTMLElementEventMap>(
53
+ type: K,
54
+ listener: (this: UIToggleScheme, ev: HTMLElementEventMap[K]) => unknown,
55
+ options?: boolean | AddEventListenerOptions,
56
+ ): void;
57
+ addEventListener(type: 'scheme-change', listener: (ev: ToggleSchemeSchemeChangeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
41
58
  }
@@ -13,6 +13,10 @@ description: >-
13
13
  <theme-panel>), and the moon/sun icon swap. Replaces the hand-wired
14
14
  `<button-ui id="theme-toggle">` + `applyScheme()` pattern previously
15
15
  duplicated across apps/genui, apps/construct-canvas, playgrounds/chat.
16
+ # Per ADR-0027 — primitives that programmatically create other primitives
17
+ # do NOT auto-import them. Consumer (or demo shell) must explicitly import.
18
+ composes:
19
+ - button-ui
16
20
  props:
17
21
  scheme:
18
22
  description: Initial scheme — "auto" follows prefers-color-scheme; "light" / "dark" force.
@@ -120,6 +124,13 @@ events:
120
124
  description: >-
121
125
  Fired when the active scheme changes. detail contains
122
126
  { scheme: "light" | "dark", source: "press" | "media" | "programmatic" }.
127
+ detail:
128
+ scheme:
129
+ type: string
130
+ description: Active color scheme ("light" or "dark").
131
+ source:
132
+ type: string
133
+ description: Change source — "press" / "media" / "programmatic".
123
134
  slots: {}
124
135
  states:
125
136
  - name: idle
@@ -48,6 +48,9 @@
48
48
  "x-adiaui": {
49
49
  "anti_patterns": [],
50
50
  "category": "layout",
51
+ "composes": [
52
+ "button-ui"
53
+ ],
51
54
  "events": {},
52
55
  "examples": [
53
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';
@@ -8,6 +8,10 @@ category: layout
8
8
  version: 1
9
9
  description: Horizontal action bar with automatic overflow. Items that don't fit move to a spillover
10
10
  popover menu.
11
+ # Per ADR-0027 — primitives that programmatically create other primitives
12
+ # do NOT auto-import them. Consumer (or demo shell) must explicitly import.
13
+ composes:
14
+ - button-ui
11
15
  props:
12
16
  bordered:
13
17
  description: Adds a border around the toolbar for visual separation from surrounding content.