@adia-ai/web-components 0.0.28 → 0.0.33

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 (349) hide show
  1. package/README.md +4 -8
  2. package/a2ui/index.js +1 -1
  3. package/components/accordion/accordion.a2ui.json +1 -1
  4. package/components/accordion/accordion.js +6 -6
  5. package/components/accordion/accordion.yaml +1 -1
  6. package/components/action-list/action-list.a2ui.json +1 -1
  7. package/components/action-list/action-list.js +6 -6
  8. package/components/action-list/action-list.yaml +1 -1
  9. package/components/agent-artifact/agent-artifact.a2ui.json +1 -1
  10. package/components/agent-artifact/agent-artifact.js +4 -4
  11. package/components/agent-artifact/agent-artifact.yaml +1 -1
  12. package/components/agent-feedback-bar/agent-feedback-bar.a2ui.json +1 -1
  13. package/components/agent-feedback-bar/agent-feedback-bar.js +4 -4
  14. package/components/agent-feedback-bar/agent-feedback-bar.yaml +1 -1
  15. package/components/agent-questions/agent-questions.a2ui.json +1 -1
  16. package/components/agent-questions/agent-questions.js +4 -4
  17. package/components/agent-questions/agent-questions.yaml +1 -1
  18. package/components/agent-reasoning/agent-reasoning.a2ui.json +3 -3
  19. package/components/agent-reasoning/agent-reasoning.js +4 -4
  20. package/components/agent-reasoning/agent-reasoning.yaml +3 -3
  21. package/components/agent-suggestions/agent-suggestions.a2ui.json +1 -1
  22. package/components/agent-suggestions/agent-suggestions.js +4 -4
  23. package/components/agent-suggestions/agent-suggestions.yaml +1 -1
  24. package/components/agent-trace/agent-trace.a2ui.json +1 -1
  25. package/components/agent-trace/agent-trace.js +4 -4
  26. package/components/agent-trace/agent-trace.yaml +1 -1
  27. package/components/alert/alert.a2ui.json +1 -1
  28. package/components/alert/alert.js +4 -4
  29. package/components/alert/alert.yaml +1 -1
  30. package/components/aside/aside.a2ui.json +1 -1
  31. package/components/aside/aside.yaml +1 -1
  32. package/components/avatar/avatar.a2ui.json +1 -1
  33. package/components/avatar/avatar.js +8 -8
  34. package/components/avatar/avatar.yaml +1 -1
  35. package/components/badge/badge.a2ui.json +1 -1
  36. package/components/badge/badge.js +4 -4
  37. package/components/badge/badge.yaml +1 -1
  38. package/components/block/block.a2ui.json +1 -1
  39. package/components/block/block.js +4 -4
  40. package/components/block/block.yaml +1 -1
  41. package/components/breadcrumb/breadcrumb.a2ui.json +1 -1
  42. package/components/breadcrumb/breadcrumb.js +4 -4
  43. package/components/breadcrumb/breadcrumb.yaml +1 -1
  44. package/components/button/button.a2ui.json +1 -1
  45. package/components/button/button.js +4 -4
  46. package/components/button/button.yaml +1 -1
  47. package/components/calendar-picker/calendar-picker.a2ui.json +1 -1
  48. package/components/calendar-picker/calendar-picker.js +6 -6
  49. package/components/calendar-picker/calendar-picker.yaml +1 -1
  50. package/components/canvas/canvas.a2ui.json +1 -1
  51. package/components/canvas/canvas.js +5 -5
  52. package/components/canvas/canvas.yaml +1 -1
  53. package/components/card/card.a2ui.json +1 -1
  54. package/components/card/card.js +4 -4
  55. package/components/card/card.yaml +1 -1
  56. package/components/chart/chart.a2ui.json +1 -1
  57. package/components/chart/chart.js +5 -5
  58. package/components/chart/chart.yaml +1 -1
  59. package/components/chart-legend/chart-legend.a2ui.json +1 -1
  60. package/components/chart-legend/chart-legend.js +7 -7
  61. package/components/chart-legend/chart-legend.yaml +1 -1
  62. package/components/{chat → chat-thread}/chat-input.js +5 -5
  63. package/components/{chat/chat.a2ui.json → chat-thread/chat-thread.a2ui.json} +6 -6
  64. package/components/{chat/chat.css → chat-thread/chat-thread.css} +2 -2
  65. package/components/{chat/chat.js → chat-thread/chat-thread.js} +7 -7
  66. package/components/{chat/chat.yaml → chat-thread/chat-thread.yaml} +4 -4
  67. package/components/check/check.a2ui.json +1 -1
  68. package/components/check/check.js +5 -5
  69. package/components/check/check.yaml +1 -1
  70. package/components/code/code.a2ui.json +1 -1
  71. package/components/code/code.js +4 -4
  72. package/components/code/code.yaml +1 -1
  73. package/components/col/col.a2ui.json +1 -1
  74. package/components/col/col.js +4 -4
  75. package/components/col/col.yaml +1 -1
  76. package/components/color-picker/color-picker.a2ui.json +1 -1
  77. package/components/color-picker/color-picker.js +6 -6
  78. package/components/color-picker/color-picker.yaml +1 -1
  79. package/components/command/command.a2ui.json +1 -1
  80. package/components/command/command.js +5 -5
  81. package/components/command/command.yaml +1 -1
  82. package/components/description-list/description-list.a2ui.json +1 -1
  83. package/components/description-list/description-list.js +4 -4
  84. package/components/description-list/description-list.yaml +1 -1
  85. package/components/divider/divider.a2ui.json +1 -1
  86. package/components/divider/divider.js +4 -4
  87. package/components/divider/divider.yaml +1 -1
  88. package/components/drawer/drawer.a2ui.json +1 -1
  89. package/components/drawer/drawer.js +4 -4
  90. package/components/drawer/drawer.yaml +1 -1
  91. package/components/embed/embed.a2ui.json +1 -1
  92. package/components/embed/embed.js +4 -4
  93. package/components/embed/embed.yaml +1 -1
  94. package/components/empty-state/empty-state.a2ui.json +1 -1
  95. package/components/empty-state/empty-state.js +4 -4
  96. package/components/empty-state/empty-state.yaml +1 -1
  97. package/components/feed/feed-item.yaml +2 -2
  98. package/components/feed/feed.a2ui.json +2 -2
  99. package/components/feed/feed.css +21 -3
  100. package/components/feed/feed.js +140 -31
  101. package/components/feed/feed.yaml +2 -2
  102. package/components/field/field.a2ui.json +1 -1
  103. package/components/field/field.js +10 -10
  104. package/components/field/field.yaml +2 -2
  105. package/components/footer/footer.a2ui.json +1 -1
  106. package/components/footer/footer.yaml +1 -1
  107. package/components/grid/grid.a2ui.json +1 -1
  108. package/components/grid/grid.js +4 -4
  109. package/components/grid/grid.yaml +1 -1
  110. package/components/header/header.a2ui.json +1 -1
  111. package/components/header/header.yaml +1 -1
  112. package/components/heatmap/heatmap.a2ui.json +1 -1
  113. package/components/heatmap/heatmap.js +4 -4
  114. package/components/heatmap/heatmap.yaml +1 -1
  115. package/components/icon/icon.a2ui.json +1 -1
  116. package/components/icon/icon.js +4 -4
  117. package/components/icon/icon.yaml +1 -1
  118. package/components/image/image.a2ui.json +1 -1
  119. package/components/image/image.js +4 -4
  120. package/components/image/image.yaml +1 -1
  121. package/components/index.js +88 -85
  122. package/components/input/input.a2ui.json +1 -1
  123. package/components/input/input.js +7 -7
  124. package/components/input/input.yaml +1 -1
  125. package/components/inspector/inspector.a2ui.json +1 -1
  126. package/components/inspector/inspector.js +4 -4
  127. package/components/inspector/inspector.yaml +1 -1
  128. package/components/kbd/kbd.a2ui.json +1 -1
  129. package/components/kbd/kbd.js +4 -4
  130. package/components/kbd/kbd.yaml +1 -1
  131. package/components/list/list.a2ui.json +1 -1
  132. package/components/list/list.js +6 -6
  133. package/components/list/list.yaml +1 -1
  134. package/components/menu/menu.a2ui.json +1 -1
  135. package/components/menu/menu.js +8 -8
  136. package/components/menu/menu.yaml +1 -1
  137. package/components/modal/modal.a2ui.json +1 -1
  138. package/components/modal/modal.js +4 -4
  139. package/components/modal/modal.yaml +1 -1
  140. package/components/nav/nav.a2ui.json +98 -0
  141. package/components/nav/nav.css +133 -0
  142. package/components/nav/nav.js +140 -0
  143. package/components/nav/nav.test.js +428 -0
  144. package/components/nav/nav.yaml +114 -0
  145. package/components/nav-group/nav-group.a2ui.json +100 -0
  146. package/{patterns/app-nav-group/app-nav-group.css → components/nav-group/nav-group.css} +71 -18
  147. package/{patterns/app-nav-group/app-nav-group.js → components/nav-group/nav-group.js} +51 -25
  148. package/components/nav-group/nav-group.yaml +69 -0
  149. package/components/nav-item/nav-item.a2ui.json +106 -0
  150. package/{patterns/app-nav-item/app-nav-item.css → components/nav-item/nav-item.css} +42 -10
  151. package/components/nav-item/nav-item.js +76 -0
  152. package/components/nav-item/nav-item.yaml +73 -0
  153. package/components/noodles/noodles.a2ui.json +1 -1
  154. package/components/noodles/noodles.js +4 -4
  155. package/components/noodles/noodles.yaml +1 -1
  156. package/components/option-card/option-card.a2ui.json +1 -1
  157. package/components/option-card/option-card.js +6 -6
  158. package/components/option-card/option-card.yaml +1 -1
  159. package/components/otp-input/otp-input.a2ui.json +1 -1
  160. package/components/otp-input/otp-input.js +5 -5
  161. package/components/otp-input/otp-input.yaml +1 -1
  162. package/components/page/page.a2ui.json +3 -3
  163. package/components/page/page.js +4 -4
  164. package/components/page/page.yaml +3 -3
  165. package/components/pagination/pagination.a2ui.json +1 -1
  166. package/components/pagination/pagination.js +4 -4
  167. package/components/pagination/pagination.yaml +1 -1
  168. package/components/pane/pane.a2ui.json +1 -1
  169. package/components/pane/pane.js +4 -4
  170. package/components/pane/pane.yaml +1 -1
  171. package/components/pipeline-status/pipeline-status.a2ui.json +1 -1
  172. package/components/pipeline-status/pipeline-status.js +4 -4
  173. package/components/pipeline-status/pipeline-status.yaml +1 -1
  174. package/components/popover/popover.a2ui.json +1 -1
  175. package/components/popover/popover.js +4 -4
  176. package/components/popover/popover.yaml +1 -1
  177. package/components/progress/progress.a2ui.json +1 -1
  178. package/components/progress/progress.js +4 -4
  179. package/components/progress/progress.yaml +1 -1
  180. package/components/progress-row/progress-row.a2ui.json +1 -1
  181. package/components/progress-row/progress-row.js +4 -4
  182. package/components/progress-row/progress-row.yaml +1 -1
  183. package/components/radio/radio.a2ui.json +1 -1
  184. package/components/radio/radio.js +5 -5
  185. package/components/radio/radio.yaml +1 -1
  186. package/components/range/range.a2ui.json +1 -1
  187. package/components/range/range.js +7 -7
  188. package/components/range/range.yaml +1 -1
  189. package/components/rating/rating.a2ui.json +1 -1
  190. package/components/rating/rating.js +6 -6
  191. package/components/rating/rating.yaml +1 -1
  192. package/components/richtext/richtext.a2ui.json +1 -1
  193. package/components/richtext/richtext.js +4 -4
  194. package/components/richtext/richtext.yaml +1 -1
  195. package/components/row/row.a2ui.json +1 -1
  196. package/components/row/row.js +4 -4
  197. package/components/row/row.yaml +1 -1
  198. package/components/search/search.a2ui.json +1 -1
  199. package/components/search/search.js +5 -5
  200. package/components/search/search.yaml +1 -1
  201. package/components/section/section.a2ui.json +1 -1
  202. package/components/section/section.yaml +1 -1
  203. package/components/segment/segment.a2ui.json +1 -1
  204. package/components/segment/segment.js +4 -4
  205. package/components/segment/segment.yaml +1 -1
  206. package/components/segmented/segmented.a2ui.json +1 -1
  207. package/components/segmented/segmented.css +6 -0
  208. package/components/segmented/segmented.js +7 -7
  209. package/components/segmented/segmented.yaml +1 -1
  210. package/components/select/select.a2ui.json +1 -1
  211. package/components/select/select.js +5 -5
  212. package/components/select/select.yaml +1 -1
  213. package/components/skeleton/skeleton.a2ui.json +1 -1
  214. package/components/skeleton/skeleton.js +4 -4
  215. package/components/skeleton/skeleton.yaml +1 -1
  216. package/components/slider/slider.a2ui.json +1 -1
  217. package/components/slider/slider.js +7 -7
  218. package/components/slider/slider.yaml +1 -1
  219. package/components/stack/stack.a2ui.json +1 -1
  220. package/components/stack/stack.js +4 -4
  221. package/components/stack/stack.yaml +1 -1
  222. package/components/stat/stat.a2ui.json +1 -1
  223. package/components/stat/stat.js +4 -4
  224. package/components/stat/stat.yaml +1 -1
  225. package/components/stepper/stepper.a2ui.json +1 -1
  226. package/components/stepper/stepper.js +6 -6
  227. package/components/stepper/stepper.yaml +1 -1
  228. package/components/stream/stream.a2ui.json +1 -1
  229. package/components/stream/stream.js +4 -4
  230. package/components/stream/stream.yaml +1 -1
  231. package/components/swatch/swatch.a2ui.json +1 -1
  232. package/components/swatch/swatch.js +4 -4
  233. package/components/swatch/swatch.yaml +1 -1
  234. package/components/swiper/swiper.a2ui.json +1 -1
  235. package/components/swiper/swiper.js +4 -4
  236. package/components/swiper/swiper.yaml +1 -1
  237. package/components/switch/switch.a2ui.json +1 -1
  238. package/components/switch/switch.js +5 -5
  239. package/components/switch/switch.yaml +1 -1
  240. package/components/table/table.a2ui.json +1 -1
  241. package/components/table/table.js +4 -4
  242. package/components/table/table.yaml +1 -1
  243. package/components/table-toolbar/table-toolbar.a2ui.json +1 -1
  244. package/components/table-toolbar/table-toolbar.js +4 -4
  245. package/components/table-toolbar/table-toolbar.yaml +1 -1
  246. package/components/tabs/tab.js +4 -4
  247. package/components/tabs/tabs.a2ui.json +1 -1
  248. package/components/tabs/tabs.js +5 -5
  249. package/components/tabs/tabs.yaml +1 -1
  250. package/components/tag/tag.a2ui.json +1 -1
  251. package/components/tag/tag.js +4 -4
  252. package/components/tag/tag.yaml +1 -1
  253. package/components/text/text.a2ui.json +1 -1
  254. package/components/text/text.js +4 -4
  255. package/components/text/text.yaml +1 -1
  256. package/components/textarea/textarea.a2ui.json +1 -1
  257. package/components/textarea/textarea.js +5 -5
  258. package/components/textarea/textarea.yaml +1 -1
  259. package/components/timeline/timeline.a2ui.json +1 -1
  260. package/components/timeline/timeline.js +6 -6
  261. package/components/timeline/timeline.yaml +1 -1
  262. package/components/toast/toast.a2ui.json +1 -1
  263. package/components/toast/toast.js +54 -184
  264. package/components/toast/toast.yaml +1 -1
  265. package/components/toggle-group/toggle-group.a2ui.json +1 -1
  266. package/components/toggle-group/toggle-group.js +6 -6
  267. package/components/toggle-group/toggle-group.yaml +1 -1
  268. package/components/toolbar/toolbar.a2ui.json +1 -1
  269. package/components/toolbar/toolbar.js +6 -6
  270. package/components/toolbar/toolbar.yaml +1 -1
  271. package/components/tooltip/tooltip.a2ui.json +1 -1
  272. package/components/tooltip/tooltip.js +7 -7
  273. package/components/tooltip/tooltip.yaml +1 -1
  274. package/components/tree/tree.a2ui.json +1 -1
  275. package/components/tree/tree.js +6 -6
  276. package/components/tree/tree.yaml +1 -1
  277. package/components/upload/upload.a2ui.json +1 -1
  278. package/components/upload/upload.js +6 -6
  279. package/components/upload/upload.yaml +1 -1
  280. package/core/element.js +4 -4
  281. package/core/element.test.js +18 -18
  282. package/core/form.js +9 -9
  283. package/core/index.js +2 -2
  284. package/core/provider.js +7 -7
  285. package/core/template.js +1 -1
  286. package/index.css +3 -2
  287. package/index.js +17 -7
  288. package/package.json +1 -5
  289. package/styles/components.css +10 -6
  290. package/styles/resets.css +1 -1
  291. package/traits/define.js +2 -2
  292. package/patterns/a2ui-root/a2ui-root.a2ui.json +0 -125
  293. package/patterns/a2ui-root/a2ui-root.js +0 -191
  294. package/patterns/a2ui-root/a2ui-root.yaml +0 -87
  295. package/patterns/adia-chat/adia-chat.a2ui.json +0 -149
  296. package/patterns/adia-chat/adia-chat.css +0 -10
  297. package/patterns/adia-chat/adia-chat.js +0 -297
  298. package/patterns/adia-chat/adia-chat.yaml +0 -118
  299. package/patterns/adia-chat/css/adia-chat.empty.css +0 -12
  300. package/patterns/adia-chat/css/adia-chat.layout.css +0 -60
  301. package/patterns/adia-chat/css/adia-chat.markdown.css +0 -74
  302. package/patterns/adia-chat/css/adia-chat.messages.css +0 -87
  303. package/patterns/adia-chat/css/adia-chat.streaming.css +0 -30
  304. package/patterns/adia-chat/css/adia-chat.tokens.css +0 -95
  305. package/patterns/adia-editor/adia-editor.a2ui.json +0 -73
  306. package/patterns/adia-editor/adia-editor.css +0 -6
  307. package/patterns/adia-editor/adia-editor.js +0 -56
  308. package/patterns/adia-editor/adia-editor.yaml +0 -59
  309. package/patterns/adia-editor/css/adia-editor.layout.css +0 -171
  310. package/patterns/adia-editor/css/adia-editor.tokens.css +0 -28
  311. package/patterns/app-nav/app-nav.a2ui.json +0 -89
  312. package/patterns/app-nav/app-nav.css +0 -92
  313. package/patterns/app-nav/app-nav.js +0 -112
  314. package/patterns/app-nav/app-nav.yaml +0 -54
  315. package/patterns/app-nav-group/app-nav-group.a2ui.json +0 -82
  316. package/patterns/app-nav-group/app-nav-group.yaml +0 -59
  317. package/patterns/app-nav-item/app-nav-item.a2ui.json +0 -83
  318. package/patterns/app-nav-item/app-nav-item.js +0 -42
  319. package/patterns/app-nav-item/app-nav-item.yaml +0 -62
  320. package/patterns/app-shell/app-shell.a2ui.json +0 -129
  321. package/patterns/app-shell/app-shell.css +0 -14
  322. package/patterns/app-shell/app-shell.js +0 -251
  323. package/patterns/app-shell/app-shell.yaml +0 -89
  324. package/patterns/app-shell/css/app-shell.collapsed.css +0 -86
  325. package/patterns/app-shell/css/app-shell.helpers.css +0 -42
  326. package/patterns/app-shell/css/app-shell.main.css +0 -172
  327. package/patterns/app-shell/css/app-shell.shell.css +0 -44
  328. package/patterns/app-shell/css/app-shell.sidebar.css +0 -161
  329. package/patterns/app-shell/css/app-shell.templates.css +0 -214
  330. package/patterns/app-shell/css/app-shell.tokens.css +0 -119
  331. package/patterns/gen-ui/gen-ui.a2ui.json +0 -72
  332. package/patterns/gen-ui/gen-ui.css +0 -83
  333. package/patterns/gen-ui/gen-ui.js +0 -136
  334. package/patterns/gen-ui/gen-ui.yaml +0 -43
  335. package/patterns/index.js +0 -11
  336. package/patterns/section-nav/section-nav.a2ui.json +0 -91
  337. package/patterns/section-nav/section-nav.css +0 -60
  338. package/patterns/section-nav/section-nav.js +0 -42
  339. package/patterns/section-nav/section-nav.yaml +0 -58
  340. package/patterns/section-nav-group/section-nav-group.a2ui.json +0 -95
  341. package/patterns/section-nav-group/section-nav-group.css +0 -74
  342. package/patterns/section-nav-group/section-nav-group.js +0 -84
  343. package/patterns/section-nav-group/section-nav-group.yaml +0 -66
  344. package/patterns/section-nav-item/section-nav-item.a2ui.json +0 -97
  345. package/patterns/section-nav-item/section-nav-item.css +0 -106
  346. package/patterns/section-nav-item/section-nav-item.js +0 -66
  347. package/patterns/section-nav-item/section-nav-item.yaml +0 -70
  348. package/styles/layouts/admin.css +0 -7
  349. /package/components/{chat → chat-thread}/chat-input.css +0 -0
@@ -1,39 +1,32 @@
1
1
  /**
2
- * <toast-ui> — Notification popup wired through a shared top-layer
3
- * messaging channel.
2
+ * <toast-ui> — Thin facade over `<feed-ui>` / `UIFeed.post()`.
4
3
  *
5
- * All toasts declarative AND imperative route through one
6
- * lazily-mounted `[data-toast-container][data-toast-position]` per
7
- * position. Per-position singletons; consumers can post from anywhere
8
- * without holding a reference to the toast component:
4
+ * Phase 4 of `docs/specs/feed-channel.md` (SPEC-FEED-CHANNEL-001)
5
+ * toast-ui no longer owns its own per-position container. Both
6
+ * declarative `<toast-ui>` and imperative `UIToast.show()` paths
7
+ * route through `UIFeed`. The element exists for back-compat:
8
+ * authoring `<toast-ui text="…">` still produces a feed item.
9
9
  *
10
- * // Imperative API
11
- * AdiaToast.show({ text: 'Saved!', variant: 'success' });
10
+ * // Imperative API (delegates to UIFeed.post)
11
+ * UIToast.show({ text: 'Saved!', variant: 'success' });
12
12
  *
13
- * // Global event channel — same shape, dispatched on `window`.
14
- * // Any code (other components, integration scripts) can post
15
- * // without importing AdiaToast.
13
+ * // Global event channel — same shape, same delegation.
16
14
  * window.dispatchEvent(new CustomEvent('toast', {
17
15
  * detail: { text: 'Saved!', variant: 'success' }
18
16
  * }));
19
17
  *
20
- * // Declarative — auto-routes to the per-position container on
21
- * // connect. No need to author <toast-ui> inside the container.
18
+ * // Declarative — auto-posts and removes self on connect.
22
19
  * <toast-ui text="Saved!" variant="success"></toast-ui>
23
20
  *
24
- * Events:
25
- * close fired after the toast finishes its exit animation
21
+ * The legacy `[data-toast-container]` per-position-Map plumbing was
22
+ * retired in this migration; the lane infrastructure now lives in
23
+ * `<feed-ui>` (see ../feed/feed.js).
26
24
  */
27
25
 
28
- import { AdiaElement, html } from '../../core/element.js';
29
-
30
- class AdiaToast extends AdiaElement {
31
- #timer = null;
32
- #removing = false;
33
- #closeTimer = null;
34
- #openRaf = null;
35
- #routed = false;
26
+ import { UIElement, html } from '../../core/element.js';
27
+ import { UIFeed } from '../feed/feed.js';
36
28
 
29
+ class UIToast extends UIElement {
37
30
  static properties = {
38
31
  text: { type: String, default: '', reflect: true },
39
32
  variant: { type: String, default: 'info', reflect: true },
@@ -41,185 +34,62 @@ class AdiaToast extends AdiaElement {
41
34
  position: { type: String, default: 'bottom-right', reflect: true },
42
35
  };
43
36
 
44
- static parts = {
45
- message: '<div slot="message"></div>',
46
- close: '<button-ui slot="close" icon="x" variant="ghost" size="sm" aria-label="Dismiss"></button-ui>',
47
- };
48
-
49
37
  static template = () => html``;
50
38
 
51
- #onPress = (e) => {
52
- if (e.target.closest('[slot="close"]')) this.dismiss();
53
- };
54
-
55
39
  connected() {
56
- this.addEventListener('press', this.#onPress);
57
-
58
- // Route declarative <toast-ui> instances into the shared per-position
59
- // container so authored toasts share the same lane as imperatively-
60
- // posted ones (no overlap, consistent stacking). Skipped if we're
61
- // already inside a container (re-entrant connect after reparent).
62
- if (!this.#routed && !this.parentElement?.matches?.('[data-toast-container]')) {
63
- this.#routed = true;
64
- const container = AdiaToast.#getContainer(this.position || 'bottom-right');
65
- if (this.parentElement !== container) container.appendChild(this);
66
- }
67
- }
68
-
69
- #getDuration() {
70
- const raw = getComputedStyle(this).getPropertyValue('--toast-duration').trim();
71
- return parseFloat(raw) || 200;
72
- }
73
-
74
- render() {
75
- const message = this.ensure('message');
76
- message.textContent = this.text;
77
-
78
- const close = this.ensure('close');
79
- if (close.parentElement !== this) this.appendChild(close);
80
-
81
- this.setAttribute('role', 'status');
82
- this.setAttribute('aria-live', 'polite');
83
-
84
- // Schedule auto-open animation
85
- if (!this.hasAttribute('data-open') && !this.#removing) {
86
- this.#openRaf = requestAnimationFrame(() => {
87
- this.#openRaf = null;
88
- this.setAttribute('data-open', '');
89
- });
90
- }
91
-
92
- // Schedule auto-dismiss
93
- this.#scheduleAutoDismiss();
94
- }
95
-
96
- #scheduleAutoDismiss() {
97
- if (this.#timer) clearTimeout(this.#timer);
98
- if (this.duration > 0) {
99
- this.#timer = setTimeout(() => this.dismiss(), this.duration);
100
- }
101
- }
102
-
103
- dismiss() {
104
- if (this.#removing) return;
105
- this.#removing = true;
106
- if (this.#timer) { clearTimeout(this.#timer); this.#timer = null; }
107
-
108
- this.removeAttribute('data-open');
109
- this.setAttribute('data-closing', '');
110
-
111
- this.#closeTimer = setTimeout(() => {
112
- this.#closeTimer = null;
113
- this.removeAttribute('data-closing');
114
- const container = this.parentElement;
115
- this.dispatchEvent(new Event('close', { bubbles: true }));
116
- this.remove();
117
- /* If the lane is now empty, hide its popover and remove the
118
- container — keeps document.body free of leaked containers. */
119
- if (container?.matches?.('[data-toast-container]')) {
120
- AdiaToast.#releaseContainerIfEmpty(container);
121
- }
122
- }, this.#getDuration());
123
- }
124
-
125
- disconnected() {
126
- this.removeEventListener('press', this.#onPress);
127
- if (this.#timer) { clearTimeout(this.#timer); this.#timer = null; }
128
- if (this.#closeTimer) { clearTimeout(this.#closeTimer); this.#closeTimer = null; }
129
- if (this.#openRaf != null) { cancelAnimationFrame(this.#openRaf); this.#openRaf = null; }
40
+ /* Declarative path: post into UIFeed and remove self. The
41
+ element is fire-and-forget — its only job is to forward the
42
+ authored attributes to the feed, then dissolve. Re-entrant
43
+ guard keeps this safe under HMR / dev-mode re-attachment. */
44
+ if (this.__routedToFeed) return;
45
+ this.__routedToFeed = true;
46
+ UIFeed.post({
47
+ text: this.text,
48
+ variant: this.variant === 'error' ? 'danger' : this.variant,
49
+ duration: this.duration,
50
+ position: this.position,
51
+ });
52
+ /* Schedule removal so the calling code can read the attributes
53
+ if it inspected this element on the same microtask. */
54
+ queueMicrotask(() => { try { this.remove(); } catch { /* noop */ } });
130
55
  }
131
56
 
132
57
  /**
133
- * Static conveniencecreates a toast, appends to body, auto-removes.
58
+ * Static facadedelegates to UIFeed.post(). Kept for back-compat
59
+ * with consumer code shaped like `customElements.get('toast-ui').show(...)`
60
+ * or `UIToast.show(...)`. New code should call UIFeed.post()
61
+ * directly.
62
+ *
134
63
  * @param {Object} opts
135
64
  * @param {string} opts.text
136
- * @param {string} [opts.variant='info']
65
+ * @param {string} [opts.variant='info'] — `error` aliases to `danger`.
137
66
  * @param {number} [opts.duration=4000]
138
67
  * @param {string} [opts.position='bottom-right']
139
- * @returns {AdiaToast}
140
- */
141
- static #containers = new Map();
142
-
143
- /**
144
- * Get (or lazily create) the per-position lane. Each lane is a manual
145
- * Popover-API container — `[popover="manual"]` puts it in the browser's
146
- * top-layer, above ALL page content with no z-index wars, and the
147
- * native popover stack lets multiple lanes coexist (e.g. one toast in
148
- * top-right + another in bottom-center) without collision.
149
- *
150
- * `popover="manual"` (not `auto`) — toasts must NOT light-dismiss on
151
- * outside click; they auto-fade by their own duration timer.
152
- *
153
- * Falls back gracefully if the Popover API is unsupported (Safari < 17 /
154
- * Firefox < 125): the lane still renders as a `position: fixed` div via
155
- * the CSS `[data-toast-container]` rules. Browser baseline (Chromium
156
- * 125+, Safari 18.0+, Firefox 129+) all support `[popover]`.
68
+ * @returns {{id:string|null, dismiss:function, update:function}} FeedHandle.
157
69
  */
158
- static #getContainer(position) {
159
- let el = AdiaToast.#containers.get(position);
160
- if (el && el.isConnected) return el;
161
- el = document.createElement('div');
162
- el.setAttribute('data-toast-container', position);
163
- /* `manual` = no light-dismiss; container stays open until we
164
- explicitly hidePopover() it when its last toast leaves. */
165
- if ('popover' in HTMLElement.prototype) {
166
- el.setAttribute('popover', 'manual');
167
- }
168
- document.body.appendChild(el);
169
- /* Show the popover so the lane lifts into the top-layer. Wrapped in
170
- try/catch because some test rigs (happy-dom) don't ship the API. */
171
- try { el.showPopover?.(); } catch { /* graceful fallback to fixed */ }
172
- AdiaToast.#containers.set(position, el);
173
- return el;
70
+ static show(opts = {}) {
71
+ const { text, variant = 'info', duration = 4000, position = 'bottom-right' } = opts;
72
+ return UIFeed.post({
73
+ text,
74
+ variant: variant === 'error' ? 'danger' : variant,
75
+ duration,
76
+ position,
77
+ });
174
78
  }
175
-
176
- /**
177
- * Tear down the per-position lane when its last toast has been
178
- * dismissed. Keeps `document.body` clean — addresses the audit's L-B4
179
- * "container leak" finding (toasts permanently leaving DIVs in body).
180
- */
181
- static #releaseContainerIfEmpty(container) {
182
- if (!container) return;
183
- if (container.children.length > 0) return;
184
- try { container.hidePopover?.(); } catch { /* noop */ }
185
- container.remove();
186
- /* Clear from the singleton map so the next post() rebuilds. */
187
- for (const [pos, el] of AdiaToast.#containers) {
188
- if (el === container) AdiaToast.#containers.delete(pos);
189
- }
190
- }
191
-
192
- static show({ text, variant = 'info', duration = 4000, position = 'bottom-right' } = {}) {
193
- /* `error` is a documented alias of `danger` (Phase 6 variant table). */
194
- if (variant === 'error') variant = 'danger';
195
- const container = AdiaToast.#getContainer(position);
196
- const toast = document.createElement('toast-ui');
197
- toast.text = text;
198
- toast.variant = variant;
199
- toast.duration = duration;
200
- toast.position = position;
201
- container.appendChild(toast);
202
- return toast;
203
- }
204
-
205
79
  }
206
80
 
207
- /* Install the global 'toast' CustomEvent listener once, at module load,
208
- so any code can post into the channel without importing AdiaToast
209
- directly:
210
-
211
- window.dispatchEvent(new CustomEvent('toast', {
212
- detail: { text: 'Saved!', variant: 'success' }
213
- }));
214
-
215
- Idempotent — guarded by a window flag so HMR / re-imports are safe. */
81
+ /* Idempotent install of the global 'toast' CustomEvent listener.
82
+ Same shape as the historical channel code that posts via
83
+ `window.dispatchEvent(new CustomEvent('toast', {detail:{…}}))`
84
+ keeps working. The listener delegates to UIToast.show(), which
85
+ delegates to UIFeed.post(). */
216
86
  if (typeof window !== 'undefined' && !window.__adiaToastListenerInstalled) {
217
87
  window.__adiaToastListenerInstalled = true;
218
88
  window.addEventListener('toast', (e) => {
219
- if (e?.detail && typeof e.detail === 'object') AdiaToast.show(e.detail);
89
+ if (e?.detail && typeof e.detail === 'object') UIToast.show(e.detail);
220
90
  });
221
91
  }
222
92
 
223
- customElements.define('toast-ui', AdiaToast);
93
+ customElements.define('toast-ui', UIToast);
224
94
 
225
- export { AdiaToast };
95
+ export { UIToast };
@@ -1,7 +1,7 @@
1
1
  # Generated by scripts/migrate-yamls-to-v1.mjs — migrated to v1 contract.
2
2
  # Edit this file; run `npm run build:components` to regenerate a2ui.json.
3
3
  $schema: ../../../../scripts/schemas/component.yaml.schema.json
4
- name: AdiaToast
4
+ name: UIToast
5
5
  tag: toast-ui
6
6
  component: Toast
7
7
  category: container
@@ -52,7 +52,7 @@
52
52
  "toggle",
53
53
  "group"
54
54
  ],
55
- "name": "AdiaToggleGroup",
55
+ "name": "UIToggleGroup",
56
56
  "related": [],
57
57
  "slots": {
58
58
  "default": {
@@ -12,7 +12,7 @@
12
12
  * single — restrict to one active option at a time (default false: multi-select)
13
13
  */
14
14
 
15
- import { AdiaElement } from '../../core/element.js';
15
+ import { UIElement } from '../../core/element.js';
16
16
 
17
17
  // ── Toggle Option ──
18
18
  //
@@ -22,7 +22,7 @@ import { AdiaElement } from '../../core/element.js';
22
22
  // group's comma-separated `value` list. Consistent with native `<option>`
23
23
  // inside `<select>`.
24
24
 
25
- class AdiaToggleOption extends AdiaElement {
25
+ class UIToggleOption extends UIElement {
26
26
  static properties = {
27
27
  value: { type: String, default: '', reflect: true },
28
28
  text: { type: String, default: '', reflect: true },
@@ -59,11 +59,11 @@ class AdiaToggleOption extends AdiaElement {
59
59
  this.#stamped = false;
60
60
  }
61
61
  }
62
- customElements.define('toggle-option-ui', AdiaToggleOption);
62
+ customElements.define('toggle-option-ui', UIToggleOption);
63
63
 
64
64
  // ── Toggle Group ──
65
65
 
66
- class AdiaToggleGroup extends AdiaElement {
66
+ class UIToggleGroup extends UIElement {
67
67
  static properties = {
68
68
  value: { type: String, default: '', reflect: true },
69
69
  single: { type: Boolean, default: false, reflect: true },
@@ -142,6 +142,6 @@ class AdiaToggleGroup extends AdiaElement {
142
142
  this.#bound = false;
143
143
  }
144
144
  }
145
- customElements.define('toggle-group-ui', AdiaToggleGroup);
145
+ customElements.define('toggle-group-ui', UIToggleGroup);
146
146
 
147
- export { AdiaToggleGroup, AdiaToggleOption };
147
+ export { UIToggleGroup, UIToggleOption };
@@ -1,7 +1,7 @@
1
1
  # Generated by scripts/migrate-yamls-to-v1.mjs — migrated to v1 contract.
2
2
  # Edit this file; run `npm run build:components` to regenerate a2ui.json.
3
3
  $schema: ../../../../scripts/schemas/component.yaml.schema.json
4
- name: AdiaToggleGroup
4
+ name: UIToggleGroup
5
5
  tag: toggle-group-ui
6
6
  component: ToggleGroup
7
7
  category: navigation
@@ -63,7 +63,7 @@
63
63
  "buttons",
64
64
  "actions"
65
65
  ],
66
- "name": "AdiaToolbar",
66
+ "name": "UIToolbar",
67
67
  "related": [
68
68
  "button",
69
69
  "divider"
@@ -20,7 +20,7 @@
20
20
  * Platform: Popover API (top-layer) + CSS Anchor Positioning via @core/anchor.js.
21
21
  */
22
22
 
23
- import { AdiaElement } from '../../core/element.js';
23
+ import { UIElement } from '../../core/element.js';
24
24
  import { anchorPopover } from '../../core/anchor.js';
25
25
 
26
26
  const SPILLOVER_ATTR = 'data-toolbar-spillover';
@@ -32,7 +32,7 @@ const SPILLOVER_MENU_ATTR = 'data-toolbar-spillover-menu';
32
32
  touch the toolbar's right edge. */
33
33
  const OVERFLOW_BUFFER = 8;
34
34
 
35
- class AdiaToolbar extends AdiaElement {
35
+ class UIToolbar extends UIElement {
36
36
  static properties = {
37
37
  gap: { type: String, default: 'sm', reflect: true },
38
38
  align: { type: String, default: 'start', reflect: true },
@@ -322,20 +322,20 @@ class AdiaToolbar extends AdiaElement {
322
322
  }
323
323
  }
324
324
  }
325
- customElements.define('toolbar-ui', AdiaToolbar);
325
+ customElements.define('toolbar-ui', UIToolbar);
326
326
 
327
327
  /**
328
328
  * <toolbar-group-ui> — atomic group within a toolbar.
329
329
  * Its children are displayed together with matching gap and, during overflow,
330
330
  * are moved to the spillover menu as a single unit.
331
331
  */
332
- class AdiaToolbarGroup extends AdiaElement {
332
+ class UIToolbarGroup extends UIElement {
333
333
  static template = () => null;
334
334
  connected() {
335
335
  this.setAttribute('role', 'group');
336
336
  }
337
337
  }
338
- customElements.define('toolbar-group-ui', AdiaToolbarGroup);
338
+ customElements.define('toolbar-group-ui', UIToolbarGroup);
339
339
 
340
340
  function isDivider(el) {
341
341
  return el?.tagName && el.tagName.toLowerCase() === 'divider-ui';
@@ -381,4 +381,4 @@ function outerWidth(el) {
381
381
  return r.width + ml + mr;
382
382
  }
383
383
 
384
- export { AdiaToolbar, AdiaToolbarGroup };
384
+ export { UIToolbar, UIToolbarGroup };
@@ -1,7 +1,7 @@
1
1
  # Generated by scripts/migrate-yamls-to-v1.mjs — migrated to v1 contract.
2
2
  # Edit this file; run `npm run build:components` to regenerate a2ui.json.
3
3
  $schema: ../../../../scripts/schemas/component.yaml.schema.json
4
- name: AdiaToolbar
4
+ name: UIToolbar
5
5
  tag: toolbar-ui
6
6
  component: Toolbar
7
7
  category: layout
@@ -93,7 +93,7 @@
93
93
  "hint",
94
94
  "popover"
95
95
  ],
96
- "name": "AdiaTooltip",
96
+ "name": "UITooltip",
97
97
  "related": [
98
98
  "button"
99
99
  ],
@@ -18,10 +18,10 @@
18
18
  * No click interaction — hover/focus only.
19
19
  */
20
20
 
21
- import { AdiaElement } from '../../core/element.js';
21
+ import { UIElement } from '../../core/element.js';
22
22
  import { anchorPopover } from '../../core/anchor.js';
23
23
 
24
- class AdiaTooltip extends AdiaElement {
24
+ class UITooltip extends UIElement {
25
25
  static properties = {
26
26
  text: { type: String, default: '', reflect: true },
27
27
  placement: { type: String, default: 'top', reflect: true },
@@ -128,10 +128,10 @@ class AdiaTooltip extends AdiaElement {
128
128
  this.#target = (root && root.getElementById) ? root.getElementById(this.for) : document.getElementById(this.for);
129
129
  if (!this.#target) {
130
130
  // Warn once per (element, id) pair
131
- if (!AdiaTooltip._warnedMissing) AdiaTooltip._warnedMissing = new WeakSet();
132
- if (!AdiaTooltip._warnedMissing.has(this)) {
131
+ if (!UITooltip._warnedMissing) UITooltip._warnedMissing = new WeakSet();
132
+ if (!UITooltip._warnedMissing.has(this)) {
133
133
  console.warn(`[tooltip-ui] follows="pointer" [for="${this.for}"] did not resolve to an element.`);
134
- AdiaTooltip._warnedMissing.add(this);
134
+ UITooltip._warnedMissing.add(this);
135
135
  }
136
136
  return;
137
137
  }
@@ -284,6 +284,6 @@ class AdiaTooltip extends AdiaElement {
284
284
  .replace(/"/g, '&quot;');
285
285
  }
286
286
  }
287
- customElements.define('tooltip-ui', AdiaTooltip);
287
+ customElements.define('tooltip-ui', UITooltip);
288
288
 
289
- export { AdiaTooltip };
289
+ export { UITooltip };
@@ -1,7 +1,7 @@
1
1
  # Generated by scripts/migrate-yamls-to-v1.mjs — migrated to v1 contract.
2
2
  # Edit this file; run `npm run build:components` to regenerate a2ui.json.
3
3
  $schema: ../../../../scripts/schemas/component.yaml.schema.json
4
- name: AdiaTooltip
4
+ name: UITooltip
5
5
  tag: tooltip-ui
6
6
  component: Tooltip
7
7
  category: container
@@ -40,7 +40,7 @@
40
40
  "tree",
41
41
  "folder"
42
42
  ],
43
- "name": "AdiaTree",
43
+ "name": "UITree",
44
44
  "related": [],
45
45
  "slots": {
46
46
  "default (tree-item-ui children)": {
@@ -19,9 +19,9 @@
19
19
  * tree-select — fired on tree-ui when an item is selected (detail: { item, text, value })
20
20
  */
21
21
 
22
- import { AdiaElement } from '../../core/element.js';
22
+ import { UIElement } from '../../core/element.js';
23
23
 
24
- class AdiaTree extends AdiaElement {
24
+ class UITree extends UIElement {
25
25
  static template = () => null;
26
26
 
27
27
  connected() {
@@ -144,7 +144,7 @@ class AdiaTree extends AdiaElement {
144
144
  this.removeEventListener('keydown', this.#onKey);
145
145
  }
146
146
  }
147
- customElements.define('tree-ui', AdiaTree);
147
+ customElements.define('tree-ui', UITree);
148
148
 
149
149
 
150
150
  /**
@@ -163,7 +163,7 @@ customElements.define('tree-ui', AdiaTree);
163
163
  * actions — right-aligned action icons (eye, lock, etc.)
164
164
  * children — nested tree-item-ns (auto-detected)
165
165
  */
166
- class AdiaTreeItem extends AdiaElement {
166
+ class UITreeItem extends UIElement {
167
167
  static properties = {
168
168
  text: { type: String, default: '', reflect: true },
169
169
  icon: { type: String, default: '', reflect: true },
@@ -248,6 +248,6 @@ class AdiaTreeItem extends AdiaElement {
248
248
  if (textEl && this.text) textEl.textContent = this.text;
249
249
  }
250
250
  }
251
- customElements.define('tree-item-ui', AdiaTreeItem);
251
+ customElements.define('tree-item-ui', UITreeItem);
252
252
 
253
- export { AdiaTree, AdiaTreeItem };
253
+ export { UITree, UITreeItem };
@@ -1,7 +1,7 @@
1
1
  # Generated by scripts/migrate-yamls-to-v1.mjs — migrated to v1 contract.
2
2
  # Edit this file; run `npm run build:components` to regenerate a2ui.json.
3
3
  $schema: ../../../../scripts/schemas/component.yaml.schema.json
4
- name: AdiaTree
4
+ name: UITree
5
5
  tag: tree-ui
6
6
  component: Tree
7
7
  category: data
@@ -91,7 +91,7 @@
91
91
  "file-manager",
92
92
  "files"
93
93
  ],
94
- "name": "AdiaUpload",
94
+ "name": "UIUpload",
95
95
  "related": [
96
96
  "progress",
97
97
  "button",
@@ -1,14 +1,14 @@
1
1
  /**
2
2
  * <upload-ui> — File upload with drag-and-drop.
3
3
  * Uses showOpenFilePicker (modern) with <input type="file"> fallback.
4
- * Form-associated via AdiaFormElement + ElementInternals.
4
+ * Form-associated via UIFormElement + ElementInternals.
5
5
  */
6
6
 
7
- import { AdiaFormElement } from '../../core/form.js';
7
+ import { UIFormElement } from '../../core/form.js';
8
8
 
9
- class AdiaUpload extends AdiaFormElement {
9
+ class UIUpload extends UIFormElement {
10
10
  static properties = {
11
- ...AdiaFormElement.properties,
11
+ ...UIFormElement.properties,
12
12
  label: { type: String, default: '', reflect: true },
13
13
  accept: { type: String, default: '', reflect: true },
14
14
  multiple: { type: Boolean, default: false, reflect: true },
@@ -184,6 +184,6 @@ class AdiaUpload extends AdiaFormElement {
184
184
  this.#dropzoneEl = null;
185
185
  }
186
186
  }
187
- customElements.define('upload-ui', AdiaUpload);
187
+ customElements.define('upload-ui', UIUpload);
188
188
 
189
- export { AdiaUpload };
189
+ export { UIUpload };
@@ -1,7 +1,7 @@
1
1
  # Generated by scripts/migrate-yamls-to-v1.mjs — migrated to v1 contract.
2
2
  # Edit this file; run `npm run build:components` to regenerate a2ui.json.
3
3
  $schema: ../../../../scripts/schemas/component.yaml.schema.json
4
- name: AdiaUpload
4
+ name: UIUpload
5
5
  tag: upload-ui
6
6
  component: Upload
7
7
  category: input
package/core/element.js CHANGED
@@ -2,12 +2,12 @@
2
2
  * AdiaUI Core — Light DOM web component base class.
3
3
  *
4
4
  * Re-exports reactivity and rendering for backward compatibility:
5
- * import { AdiaElement, signal, computed, effect, html, repeat } from './element.js';
5
+ * import { UIElement, signal, computed, effect, html, repeat } from './element.js';
6
6
  *
7
7
  * Or import each layer directly:
8
8
  * import { signal, computed, effect } from './signals.js';
9
9
  * import { html, css, repeat } from './template.js';
10
- * import { AdiaElement } from './element.js';
10
+ * import { UIElement } from './element.js';
11
11
  */
12
12
 
13
13
  // Re-export reactivity primitives
@@ -16,7 +16,7 @@ export { signal, computed, effect, batch, untracked, isSignal } from './signals.
16
16
  // Re-export rendering
17
17
  export { html, css, repeat } from './template.js';
18
18
 
19
- // Internal imports for AdiaElement
19
+ // Internal imports for UIElement
20
20
  import { signal, computed, effect, untracked } from './signals.js';
21
21
  import { stamp, disposeParts, KEY_MAP } from './template.js';
22
22
 
@@ -79,7 +79,7 @@ function prepareParts(ctor) {
79
79
  }
80
80
  }
81
81
 
82
- export class AdiaElement extends HTMLElement {
82
+ export class UIElement extends HTMLElement {
83
83
  static get properties() { return {}; }
84
84
  static get traits() { return []; }
85
85
  static get observedAttributes() {