@adia-ai/web-components 0.0.1

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 (468) hide show
  1. package/README.md +195 -0
  2. package/a2ui/dockables/action.js +152 -0
  3. package/a2ui/dockables/base.js +30 -0
  4. package/a2ui/dockables/controller.js +97 -0
  5. package/a2ui/dockables/data-source.js +103 -0
  6. package/a2ui/dockables/index.js +6 -0
  7. package/a2ui/dockables/lifecycle.js +84 -0
  8. package/a2ui/dockables/provider.js +59 -0
  9. package/a2ui/index.js +19 -0
  10. package/a2ui/manifest-runtime.js +226 -0
  11. package/a2ui/registry.js +200 -0
  12. package/a2ui/renderer.js +361 -0
  13. package/a2ui/root.js +152 -0
  14. package/a2ui/stream.js +243 -0
  15. package/a2ui/surface-manifest.js +294 -0
  16. package/a2ui/surface.js +222 -0
  17. package/a2ui/wire-factory.js +134 -0
  18. package/a2ui/wiring-engine.js +209 -0
  19. package/a2ui/wiring-registry.js +342 -0
  20. package/components/accordion/accordion.a2ui.json +129 -0
  21. package/components/accordion/accordion.css +133 -0
  22. package/components/accordion/accordion.js +125 -0
  23. package/components/accordion/accordion.yaml +527 -0
  24. package/components/action-list/action-list.a2ui.json +64 -0
  25. package/components/action-list/action-list.css +115 -0
  26. package/components/action-list/action-list.js +149 -0
  27. package/components/action-list/action-list.yaml +56 -0
  28. package/components/agent-artifact/agent-artifact.a2ui.json +99 -0
  29. package/components/agent-artifact/agent-artifact.css +94 -0
  30. package/components/agent-artifact/agent-artifact.js +169 -0
  31. package/components/agent-artifact/agent-artifact.yaml +71 -0
  32. package/components/agent-feedback-bar/agent-feedback-bar.a2ui.json +91 -0
  33. package/components/agent-feedback-bar/agent-feedback-bar.css +33 -0
  34. package/components/agent-feedback-bar/agent-feedback-bar.js +152 -0
  35. package/components/agent-feedback-bar/agent-feedback-bar.yaml +65 -0
  36. package/components/agent-questions/agent-questions.a2ui.json +89 -0
  37. package/components/agent-questions/agent-questions.css +146 -0
  38. package/components/agent-questions/agent-questions.js +189 -0
  39. package/components/agent-questions/agent-questions.yaml +63 -0
  40. package/components/agent-reasoning/agent-reasoning.a2ui.json +100 -0
  41. package/components/agent-reasoning/agent-reasoning.css +273 -0
  42. package/components/agent-reasoning/agent-reasoning.js +469 -0
  43. package/components/agent-reasoning/agent-reasoning.yaml +70 -0
  44. package/components/agent-suggestions/agent-suggestions.a2ui.json +87 -0
  45. package/components/agent-suggestions/agent-suggestions.css +18 -0
  46. package/components/agent-suggestions/agent-suggestions.js +87 -0
  47. package/components/agent-suggestions/agent-suggestions.yaml +59 -0
  48. package/components/agent-trace/agent-trace.a2ui.json +78 -0
  49. package/components/agent-trace/agent-trace.css +275 -0
  50. package/components/agent-trace/agent-trace.js +216 -0
  51. package/components/agent-trace/agent-trace.yaml +53 -0
  52. package/components/alert/alert.a2ui.json +211 -0
  53. package/components/alert/alert.css +88 -0
  54. package/components/alert/alert.js +96 -0
  55. package/components/alert/alert.yaml +205 -0
  56. package/components/avatar/avatar.a2ui.json +215 -0
  57. package/components/avatar/avatar.css +159 -0
  58. package/components/avatar/avatar.js +157 -0
  59. package/components/avatar/avatar.yaml +559 -0
  60. package/components/badge/badge.a2ui.json +169 -0
  61. package/components/badge/badge.css +78 -0
  62. package/components/badge/badge.js +53 -0
  63. package/components/badge/badge.yaml +612 -0
  64. package/components/block/block.a2ui.json +135 -0
  65. package/components/block/block.css +29 -0
  66. package/components/block/block.js +23 -0
  67. package/components/block/block.yaml +115 -0
  68. package/components/breadcrumb/breadcrumb.a2ui.json +86 -0
  69. package/components/breadcrumb/breadcrumb.css +78 -0
  70. package/components/breadcrumb/breadcrumb.js +44 -0
  71. package/components/breadcrumb/breadcrumb.yaml +84 -0
  72. package/components/button/button.a2ui.json +172 -0
  73. package/components/button/button.css +168 -0
  74. package/components/button/button.js +60 -0
  75. package/components/button/button.yaml +120 -0
  76. package/components/calendar-picker/calendar-picker.a2ui.json +139 -0
  77. package/components/calendar-picker/calendar-picker.css +321 -0
  78. package/components/calendar-picker/calendar-picker.js +324 -0
  79. package/components/calendar-picker/calendar-picker.yaml +243 -0
  80. package/components/canvas/canvas.a2ui.json +75 -0
  81. package/components/canvas/canvas.css +52 -0
  82. package/components/canvas/canvas.js +179 -0
  83. package/components/canvas/canvas.yaml +62 -0
  84. package/components/card/card.a2ui.json +276 -0
  85. package/components/card/card.css +362 -0
  86. package/components/card/card.js +58 -0
  87. package/components/card/card.yaml +527 -0
  88. package/components/chart/chart.a2ui.json +298 -0
  89. package/components/chart/chart.css +512 -0
  90. package/components/chart/chart.js +1075 -0
  91. package/components/chart/chart.yaml +540 -0
  92. package/components/chat/chat-input.css +141 -0
  93. package/components/chat/chat-input.js +242 -0
  94. package/components/chat/chat.a2ui.json +181 -0
  95. package/components/chat/chat.css +193 -0
  96. package/components/chat/chat.js +155 -0
  97. package/components/chat/chat.yaml +230 -0
  98. package/components/check/check.a2ui.json +134 -0
  99. package/components/check/check.css +126 -0
  100. package/components/check/check.js +58 -0
  101. package/components/check/check.yaml +109 -0
  102. package/components/code/code.a2ui.json +153 -0
  103. package/components/code/code.css +133 -0
  104. package/components/code/code.js +114 -0
  105. package/components/code/code.yaml +163 -0
  106. package/components/col/col.a2ui.json +104 -0
  107. package/components/col/col.css +36 -0
  108. package/components/col/col.js +19 -0
  109. package/components/col/col.yaml +364 -0
  110. package/components/color-picker/color-picker.a2ui.json +100 -0
  111. package/components/color-picker/color-picker.css +182 -0
  112. package/components/color-picker/color-picker.js +537 -0
  113. package/components/color-picker/color-picker.yaml +105 -0
  114. package/components/command/command.a2ui.json +221 -0
  115. package/components/command/command.css +251 -0
  116. package/components/command/command.js +284 -0
  117. package/components/command/command.yaml +186 -0
  118. package/components/description-list/description-list.a2ui.json +89 -0
  119. package/components/description-list/description-list.css +70 -0
  120. package/components/description-list/description-list.js +75 -0
  121. package/components/description-list/description-list.yaml +59 -0
  122. package/components/divider/divider.a2ui.json +126 -0
  123. package/components/divider/divider.css +102 -0
  124. package/components/divider/divider.js +47 -0
  125. package/components/divider/divider.yaml +366 -0
  126. package/components/drawer/drawer.a2ui.json +199 -0
  127. package/components/drawer/drawer.css +342 -0
  128. package/components/drawer/drawer.js +263 -0
  129. package/components/drawer/drawer.yaml +366 -0
  130. package/components/embed/embed.a2ui.json +150 -0
  131. package/components/embed/embed.css +28 -0
  132. package/components/embed/embed.js +63 -0
  133. package/components/embed/embed.yaml +224 -0
  134. package/components/empty-state/empty-state.a2ui.json +133 -0
  135. package/components/empty-state/empty-state.css +58 -0
  136. package/components/empty-state/empty-state.js +87 -0
  137. package/components/empty-state/empty-state.yaml +314 -0
  138. package/components/footer/footer.a2ui.json +79 -0
  139. package/components/footer/footer.yaml +239 -0
  140. package/components/grid/grid.a2ui.json +171 -0
  141. package/components/grid/grid.css +37 -0
  142. package/components/grid/grid.js +21 -0
  143. package/components/grid/grid.yaml +577 -0
  144. package/components/header/header.a2ui.json +76 -0
  145. package/components/header/header.yaml +336 -0
  146. package/components/heatmap/heatmap.a2ui.json +150 -0
  147. package/components/heatmap/heatmap.css +146 -0
  148. package/components/heatmap/heatmap.js +246 -0
  149. package/components/heatmap/heatmap.yaml +131 -0
  150. package/components/icon/icon.a2ui.json +79 -0
  151. package/components/icon/icon.css +20 -0
  152. package/components/icon/icon.js +26 -0
  153. package/components/icon/icon.yaml +233 -0
  154. package/components/image/image.a2ui.json +261 -0
  155. package/components/image/image.css +76 -0
  156. package/components/image/image.js +102 -0
  157. package/components/image/image.yaml +477 -0
  158. package/components/index.js +85 -0
  159. package/components/input/input.a2ui.json +284 -0
  160. package/components/input/input.css +162 -0
  161. package/components/input/input.js +148 -0
  162. package/components/input/input.yaml +496 -0
  163. package/components/inspector/inspector.a2ui.json +67 -0
  164. package/components/inspector/inspector.css +31 -0
  165. package/components/inspector/inspector.js +133 -0
  166. package/components/inspector/inspector.yaml +58 -0
  167. package/components/kbd/kbd.a2ui.json +96 -0
  168. package/components/kbd/kbd.css +62 -0
  169. package/components/kbd/kbd.js +24 -0
  170. package/components/kbd/kbd.yaml +213 -0
  171. package/components/list/list.a2ui.json +145 -0
  172. package/components/list/list.css +103 -0
  173. package/components/list/list.js +236 -0
  174. package/components/list/list.yaml +122 -0
  175. package/components/menu/menu.a2ui.json +146 -0
  176. package/components/menu/menu.css +146 -0
  177. package/components/menu/menu.js +296 -0
  178. package/components/menu/menu.yaml +123 -0
  179. package/components/modal/modal.a2ui.json +136 -0
  180. package/components/modal/modal.css +153 -0
  181. package/components/modal/modal.js +181 -0
  182. package/components/modal/modal.yaml +114 -0
  183. package/components/noodles/noodles.a2ui.json +145 -0
  184. package/components/noodles/noodles.css +118 -0
  185. package/components/noodles/noodles.js +470 -0
  186. package/components/noodles/noodles.yaml +123 -0
  187. package/components/otp-input/otp-input.a2ui.json +104 -0
  188. package/components/otp-input/otp-input.css +78 -0
  189. package/components/otp-input/otp-input.js +170 -0
  190. package/components/otp-input/otp-input.yaml +218 -0
  191. package/components/pagination/pagination.a2ui.json +122 -0
  192. package/components/pagination/pagination.css +162 -0
  193. package/components/pagination/pagination.js +185 -0
  194. package/components/pagination/pagination.yaml +165 -0
  195. package/components/pane/pane.a2ui.json +94 -0
  196. package/components/pane/pane.css +166 -0
  197. package/components/pane/pane.js +140 -0
  198. package/components/pane/pane.yaml +197 -0
  199. package/components/pipeline-status/pipeline-status.a2ui.json +90 -0
  200. package/components/pipeline-status/pipeline-status.css +162 -0
  201. package/components/pipeline-status/pipeline-status.js +176 -0
  202. package/components/pipeline-status/pipeline-status.yaml +99 -0
  203. package/components/popover/popover.a2ui.json +181 -0
  204. package/components/popover/popover.css +57 -0
  205. package/components/popover/popover.js +170 -0
  206. package/components/popover/popover.yaml +257 -0
  207. package/components/progress/progress.a2ui.json +199 -0
  208. package/components/progress/progress.css +88 -0
  209. package/components/progress/progress.js +64 -0
  210. package/components/progress/progress.yaml +342 -0
  211. package/components/progress-row/progress-row.a2ui.json +100 -0
  212. package/components/progress-row/progress-row.css +57 -0
  213. package/components/progress-row/progress-row.js +92 -0
  214. package/components/progress-row/progress-row.yaml +87 -0
  215. package/components/radio/radio.a2ui.json +232 -0
  216. package/components/radio/radio.css +102 -0
  217. package/components/radio/radio.js +73 -0
  218. package/components/radio/radio.yaml +248 -0
  219. package/components/range/range.a2ui.json +151 -0
  220. package/components/range/range.css +148 -0
  221. package/components/range/range.js +177 -0
  222. package/components/range/range.yaml +188 -0
  223. package/components/rating/rating.a2ui.json +105 -0
  224. package/components/rating/rating.css +92 -0
  225. package/components/rating/rating.js +138 -0
  226. package/components/rating/rating.yaml +74 -0
  227. package/components/richtext/richtext.a2ui.json +82 -0
  228. package/components/richtext/richtext.css +225 -0
  229. package/components/richtext/richtext.js +74 -0
  230. package/components/richtext/richtext.yaml +89 -0
  231. package/components/row/row.a2ui.json +102 -0
  232. package/components/row/row.css +51 -0
  233. package/components/row/row.js +39 -0
  234. package/components/row/row.yaml +358 -0
  235. package/components/search/search.a2ui.json +186 -0
  236. package/components/search/search.css +28 -0
  237. package/components/search/search.js +124 -0
  238. package/components/search/search.yaml +154 -0
  239. package/components/section/section.a2ui.json +78 -0
  240. package/components/section/section.yaml +338 -0
  241. package/components/segment/segment.a2ui.json +100 -0
  242. package/components/segment/segment.css +81 -0
  243. package/components/segment/segment.js +32 -0
  244. package/components/segment/segment.yaml +216 -0
  245. package/components/segmented/segmented.a2ui.json +106 -0
  246. package/components/segmented/segmented.css +67 -0
  247. package/components/segmented/segmented.js +149 -0
  248. package/components/segmented/segmented.yaml +91 -0
  249. package/components/select/select.a2ui.json +203 -0
  250. package/components/select/select.css +277 -0
  251. package/components/select/select.js +388 -0
  252. package/components/select/select.yaml +375 -0
  253. package/components/skeleton/skeleton.a2ui.json +120 -0
  254. package/components/skeleton/skeleton.css +47 -0
  255. package/components/skeleton/skeleton.js +43 -0
  256. package/components/skeleton/skeleton.yaml +153 -0
  257. package/components/slider/slider.a2ui.json +162 -0
  258. package/components/slider/slider.css +137 -0
  259. package/components/slider/slider.js +162 -0
  260. package/components/slider/slider.yaml +299 -0
  261. package/components/stack/stack.a2ui.json +62 -0
  262. package/components/stack/stack.css +28 -0
  263. package/components/stack/stack.js +18 -0
  264. package/components/stack/stack.yaml +54 -0
  265. package/components/stat/stat.a2ui.json +246 -0
  266. package/components/stat/stat.css +101 -0
  267. package/components/stat/stat.js +91 -0
  268. package/components/stat/stat.yaml +206 -0
  269. package/components/stepper/stepper.a2ui.json +77 -0
  270. package/components/stepper/stepper.css +243 -0
  271. package/components/stepper/stepper.js +118 -0
  272. package/components/stepper/stepper.yaml +73 -0
  273. package/components/stream/stream.a2ui.json +98 -0
  274. package/components/stream/stream.css +37 -0
  275. package/components/stream/stream.js +99 -0
  276. package/components/stream/stream.yaml +87 -0
  277. package/components/swiper/swiper.a2ui.json +140 -0
  278. package/components/swiper/swiper.css +267 -0
  279. package/components/swiper/swiper.js +285 -0
  280. package/components/swiper/swiper.yaml +268 -0
  281. package/components/switch/switch.a2ui.json +134 -0
  282. package/components/switch/switch.css +104 -0
  283. package/components/switch/switch.js +53 -0
  284. package/components/switch/switch.yaml +322 -0
  285. package/components/table/cell-types.js +296 -0
  286. package/components/table/table.a2ui.json +458 -0
  287. package/components/table/table.css +531 -0
  288. package/components/table/table.js +1392 -0
  289. package/components/table/table.yaml +528 -0
  290. package/components/tabs/tab.js +34 -0
  291. package/components/tabs/tabs.a2ui.json +174 -0
  292. package/components/tabs/tabs.css +162 -0
  293. package/components/tabs/tabs.js +226 -0
  294. package/components/tabs/tabs.yaml +255 -0
  295. package/components/tag/tag.a2ui.json +148 -0
  296. package/components/tag/tag.css +118 -0
  297. package/components/tag/tag.js +88 -0
  298. package/components/tag/tag.yaml +125 -0
  299. package/components/text/text.a2ui.json +99 -0
  300. package/components/text/text.css +65 -0
  301. package/components/text/text.js +35 -0
  302. package/components/text/text.yaml +360 -0
  303. package/components/textarea/textarea.a2ui.json +91 -0
  304. package/components/textarea/textarea.css +93 -0
  305. package/components/textarea/textarea.js +114 -0
  306. package/components/textarea/textarea.yaml +79 -0
  307. package/components/timeline/timeline.a2ui.json +82 -0
  308. package/components/timeline/timeline.css +389 -0
  309. package/components/timeline/timeline.js +171 -0
  310. package/components/timeline/timeline.yaml +185 -0
  311. package/components/toast/toast.a2ui.json +199 -0
  312. package/components/toast/toast.css +211 -0
  313. package/components/toast/toast.js +146 -0
  314. package/components/toast/toast.yaml +184 -0
  315. package/components/toggle-group/toggle-group.a2ui.json +126 -0
  316. package/components/toggle-group/toggle-group.css +102 -0
  317. package/components/toggle-group/toggle-group.js +147 -0
  318. package/components/toggle-group/toggle-group.yaml +98 -0
  319. package/components/toolbar/toolbar.a2ui.json +131 -0
  320. package/components/toolbar/toolbar.css +132 -0
  321. package/components/toolbar/toolbar.js +366 -0
  322. package/components/toolbar/toolbar.yaml +238 -0
  323. package/components/tooltip/tooltip.a2ui.json +148 -0
  324. package/components/tooltip/tooltip.css +39 -0
  325. package/components/tooltip/tooltip.js +96 -0
  326. package/components/tooltip/tooltip.yaml +201 -0
  327. package/components/tree/tree.a2ui.json +119 -0
  328. package/components/tree/tree.css +133 -0
  329. package/components/tree/tree.js +253 -0
  330. package/components/tree/tree.yaml +92 -0
  331. package/components/upload/upload.a2ui.json +185 -0
  332. package/components/upload/upload.css +115 -0
  333. package/components/upload/upload.js +189 -0
  334. package/components/upload/upload.yaml +302 -0
  335. package/core/anchor.js +187 -0
  336. package/core/controller.js +182 -0
  337. package/core/element.js +257 -0
  338. package/core/form.js +217 -0
  339. package/core/icons.js +180 -0
  340. package/core/markdown.js +95 -0
  341. package/core/polyfills.js +23 -0
  342. package/core/provider.js +262 -0
  343. package/core/signals.js +113 -0
  344. package/core/template.js +226 -0
  345. package/core/transport.js +77 -0
  346. package/package.json +38 -0
  347. package/patterns/adia-chat/adia-chat.a2ui.json +149 -0
  348. package/patterns/adia-chat/adia-chat.css +10 -0
  349. package/patterns/adia-chat/adia-chat.js +297 -0
  350. package/patterns/adia-chat/adia-chat.yaml +118 -0
  351. package/patterns/adia-chat/css/adia-chat.empty.css +12 -0
  352. package/patterns/adia-chat/css/adia-chat.layout.css +60 -0
  353. package/patterns/adia-chat/css/adia-chat.markdown.css +74 -0
  354. package/patterns/adia-chat/css/adia-chat.messages.css +87 -0
  355. package/patterns/adia-chat/css/adia-chat.streaming.css +30 -0
  356. package/patterns/adia-chat/css/adia-chat.tokens.css +95 -0
  357. package/patterns/adia-chat/index.html +93 -0
  358. package/patterns/adia-editor/adia-editor.a2ui.json +58 -0
  359. package/patterns/adia-editor/adia-editor.css +6 -0
  360. package/patterns/adia-editor/adia-editor.js +56 -0
  361. package/patterns/adia-editor/adia-editor.yaml +36 -0
  362. package/patterns/adia-editor/css/adia-editor.layout.css +86 -0
  363. package/patterns/adia-editor/css/adia-editor.tokens.css +28 -0
  364. package/patterns/adia-editor/index.html +179 -0
  365. package/patterns/app-nav/app-nav.a2ui.json +89 -0
  366. package/patterns/app-nav/app-nav.css +92 -0
  367. package/patterns/app-nav/app-nav.js +99 -0
  368. package/patterns/app-nav/app-nav.yaml +54 -0
  369. package/patterns/app-nav-group/app-nav-group.a2ui.json +82 -0
  370. package/patterns/app-nav-group/app-nav-group.css +261 -0
  371. package/patterns/app-nav-group/app-nav-group.js +116 -0
  372. package/patterns/app-nav-group/app-nav-group.yaml +59 -0
  373. package/patterns/app-nav-item/app-nav-item.a2ui.json +83 -0
  374. package/patterns/app-nav-item/app-nav-item.css +156 -0
  375. package/patterns/app-nav-item/app-nav-item.js +42 -0
  376. package/patterns/app-nav-item/app-nav-item.yaml +62 -0
  377. package/patterns/app-shell/app-shell.a2ui.json +114 -0
  378. package/patterns/app-shell/app-shell.css +14 -0
  379. package/patterns/app-shell/app-shell.js +251 -0
  380. package/patterns/app-shell/app-shell.yaml +66 -0
  381. package/patterns/app-shell/css/app-shell.collapsed.css +86 -0
  382. package/patterns/app-shell/css/app-shell.helpers.css +42 -0
  383. package/patterns/app-shell/css/app-shell.main.css +58 -0
  384. package/patterns/app-shell/css/app-shell.shell.css +44 -0
  385. package/patterns/app-shell/css/app-shell.sidebar.css +116 -0
  386. package/patterns/app-shell/css/app-shell.templates.css +214 -0
  387. package/patterns/app-shell/css/app-shell.tokens.css +116 -0
  388. package/patterns/app-shell/index.html +112 -0
  389. package/patterns/gen-ui/gen-ui.a2ui.json +72 -0
  390. package/patterns/gen-ui/gen-ui.css +83 -0
  391. package/patterns/gen-ui/gen-ui.js +136 -0
  392. package/patterns/gen-ui/gen-ui.yaml +43 -0
  393. package/patterns/index.js +10 -0
  394. package/patterns/section-nav/section-nav.a2ui.json +91 -0
  395. package/patterns/section-nav/section-nav.css +59 -0
  396. package/patterns/section-nav/section-nav.js +42 -0
  397. package/patterns/section-nav/section-nav.yaml +58 -0
  398. package/patterns/section-nav-group/section-nav-group.a2ui.json +95 -0
  399. package/patterns/section-nav-group/section-nav-group.css +74 -0
  400. package/patterns/section-nav-group/section-nav-group.js +84 -0
  401. package/patterns/section-nav-group/section-nav-group.yaml +66 -0
  402. package/patterns/section-nav-item/section-nav-item.a2ui.json +97 -0
  403. package/patterns/section-nav-item/section-nav-item.css +96 -0
  404. package/patterns/section-nav-item/section-nav-item.js +66 -0
  405. package/patterns/section-nav-item/section-nav-item.yaml +70 -0
  406. package/styles/colors/index.css +6 -0
  407. package/styles/colors/parameters.css +52 -0
  408. package/styles/colors/primitives-accent.css +89 -0
  409. package/styles/colors/primitives-brand.css +89 -0
  410. package/styles/colors/primitives-danger.css +89 -0
  411. package/styles/colors/primitives-info.css +89 -0
  412. package/styles/colors/primitives-neutral.css +91 -0
  413. package/styles/colors/primitives-shared.css +57 -0
  414. package/styles/colors/primitives-success.css +89 -0
  415. package/styles/colors/primitives-warning.css +89 -0
  416. package/styles/colors/primitives.css +17 -0
  417. package/styles/colors/scrims.css +182 -0
  418. package/styles/colors/semantics.css +595 -0
  419. package/styles/colors/surfaces.css +43 -0
  420. package/styles/fonts.css +99 -0
  421. package/styles/layouts/admin.css +7 -0
  422. package/styles/prose.css +186 -0
  423. package/styles/styles.css +193 -0
  424. package/styles/themes.css +155 -0
  425. package/styles/tokens.css +304 -0
  426. package/styles/typography.css +853 -0
  427. package/traits/active-state.js +24 -0
  428. package/traits/anchor-positioning.js +66 -0
  429. package/traits/attention-pulse.js +30 -0
  430. package/traits/confetti-burst.js +65 -0
  431. package/traits/confetti.js +57 -0
  432. package/traits/count-up.js +42 -0
  433. package/traits/define.js +76 -0
  434. package/traits/dirty-state.js +38 -0
  435. package/traits/drag-ghost.js +38 -0
  436. package/traits/draggable.js +73 -0
  437. package/traits/fade-presence.js +52 -0
  438. package/traits/focus-trap.js +63 -0
  439. package/traits/focusable.js +38 -0
  440. package/traits/glow-focus.js +33 -0
  441. package/traits/gradient-shift.js +32 -0
  442. package/traits/haptic-feedback.js +28 -0
  443. package/traits/hotkey.js +62 -0
  444. package/traits/hoverable.js +26 -0
  445. package/traits/index.js +55 -0
  446. package/traits/inertia-drag.js +133 -0
  447. package/traits/intersection-observer.js +33 -0
  448. package/traits/keyboard-nav.js +36 -0
  449. package/traits/magnetic-hover.js +37 -0
  450. package/traits/noise-texture.js +30 -0
  451. package/traits/parallax.js +42 -0
  452. package/traits/portal.js +27 -0
  453. package/traits/pressable.js +75 -0
  454. package/traits/resizable.js +100 -0
  455. package/traits/resize-observer.js +31 -0
  456. package/traits/ripple.js +53 -0
  457. package/traits/roving-tabindex.js +67 -0
  458. package/traits/scale-press.js +43 -0
  459. package/traits/scroll-lock.js +27 -0
  460. package/traits/shimmer-loading.js +44 -0
  461. package/traits/snap-to-grid.js +28 -0
  462. package/traits/sound-feedback.js +30 -0
  463. package/traits/spring-animate.js +56 -0
  464. package/traits/tilt-hover.js +37 -0
  465. package/traits/tossable.js +178 -0
  466. package/traits/typeahead.js +63 -0
  467. package/traits/typewriter.js +35 -0
  468. package/traits/validation.js +118 -0
@@ -0,0 +1,366 @@
1
+ /**
2
+ * <toolbar-ui>
3
+ * <toolbar-group-ui>
4
+ * <button-ui icon="text-bold" variant="ghost" size="sm"></button-ui>
5
+ * <button-ui icon="text-italic" variant="ghost" size="sm"></button-ui>
6
+ * </toolbar-group-ui>
7
+ * <divider-ui vertical></divider-ui>
8
+ * <toolbar-group-ui>
9
+ * <button-ui icon="text-align-left" variant="ghost" size="sm"></button-ui>
10
+ * </toolbar-group-ui>
11
+ * </toolbar-ui>
12
+ *
13
+ * Horizontal action bar with automatic overflow:
14
+ * • ResizeObserver measures available width.
15
+ * • Items that don't fit are moved (from the end) into a spillover popover.
16
+ * • `toolbar-group-ui` wraps siblings so they move as an atomic unit
17
+ * (no half-group split between visible bar and overflow menu).
18
+ * • Trailing dividers are trimmed. Dividers are not moved to the menu.
19
+ *
20
+ * Platform: Popover API (top-layer) + CSS Anchor Positioning via @core/anchor.js.
21
+ */
22
+
23
+ import { AdiaElement } from '@core/element.js';
24
+ import { anchorPopover } from '@core/anchor.js';
25
+
26
+ const SPILLOVER_ATTR = 'data-toolbar-spillover';
27
+ const SPILLOVER_MENU_ATTR = 'data-toolbar-spillover-menu';
28
+
29
+ /* Headroom kept free at the right edge before an item starts spilling over.
30
+ A non-zero value makes overflow more responsive — items move to the menu
31
+ while there's still breathing room, instead of waiting until they actually
32
+ touch the toolbar's right edge. */
33
+ const OVERFLOW_BUFFER = 8;
34
+
35
+ class AdiaToolbar extends AdiaElement {
36
+ static properties = {
37
+ gap: { type: String, default: 'sm', reflect: true },
38
+ align: { type: String, default: 'start', reflect: true },
39
+ overflow: { type: String, default: 'menu', reflect: true }, // menu | none
40
+ };
41
+
42
+ static template = () => null;
43
+
44
+ #ro = null;
45
+ #mo = null;
46
+ #trigger = null;
47
+ #popover = null;
48
+ #spilloverCleanup = null;
49
+ #measuring = false;
50
+ #reflowQueued = false;
51
+
52
+ connected() {
53
+ this.setAttribute('role', 'toolbar');
54
+ this.#ensureSpillover();
55
+ this.#ro = new ResizeObserver(() => this.#queueReflow());
56
+ this.#ro.observe(this);
57
+ this.#mo = new MutationObserver(() => {
58
+ if (this.#measuring) return;
59
+ this.#queueReflow();
60
+ });
61
+ this.#moObserve();
62
+ this.#queueReflow();
63
+ }
64
+
65
+ disconnected() {
66
+ this.#ro?.disconnect();
67
+ this.#mo?.disconnect();
68
+ this.#closeSpillover();
69
+ this.#ro = null;
70
+ this.#mo = null;
71
+ this.#trigger = null;
72
+ this.#popover = null;
73
+ }
74
+
75
+ // ── Spillover infrastructure ──
76
+
77
+ #ensureSpillover() {
78
+ if (this.#trigger) return;
79
+
80
+ const trigger = document.createElement('button-ui');
81
+ trigger.setAttribute('icon', 'dots-three');
82
+ trigger.setAttribute('variant', 'ghost');
83
+ trigger.setAttribute('size', 'sm');
84
+ trigger.setAttribute(SPILLOVER_ATTR, '');
85
+ trigger.setAttribute('aria-label', 'More actions');
86
+ trigger.setAttribute('aria-haspopup', 'menu');
87
+ trigger.hidden = true;
88
+
89
+ const popover = document.createElement('div');
90
+ popover.setAttribute(SPILLOVER_MENU_ATTR, '');
91
+ popover.setAttribute('popover', 'manual');
92
+ popover.setAttribute('role', 'menu');
93
+
94
+ trigger.addEventListener('click', this.#onTriggerClick);
95
+ popover.addEventListener('click', this.#onMenuClick);
96
+ popover.addEventListener('toggle', this.#onToggle);
97
+
98
+ this.appendChild(trigger);
99
+ this.appendChild(popover);
100
+
101
+ this.#trigger = trigger;
102
+ this.#popover = popover;
103
+ }
104
+
105
+ #openSpillover() {
106
+ const menu = this.#popover;
107
+ if (!menu || menu.matches(':popover-open')) return;
108
+ menu.showPopover?.();
109
+ this.#spilloverCleanup?.();
110
+ this.#spilloverCleanup = anchorPopover(this.#trigger, menu, {
111
+ placement: 'bottom-end',
112
+ gap: 4,
113
+ });
114
+ requestAnimationFrame(() => {
115
+ document.addEventListener('pointerdown', this.#onOutside, true);
116
+ document.addEventListener('keydown', this.#onKey, true);
117
+ });
118
+ }
119
+
120
+ #closeSpillover() {
121
+ this.#spilloverCleanup?.();
122
+ this.#spilloverCleanup = null;
123
+ if (this.#popover?.matches(':popover-open')) this.#popover.hidePopover?.();
124
+ document.removeEventListener('pointerdown', this.#onOutside, true);
125
+ document.removeEventListener('keydown', this.#onKey, true);
126
+ }
127
+
128
+ #onTriggerClick = (e) => {
129
+ e.stopPropagation();
130
+ if (this.#popover?.matches(':popover-open')) this.#closeSpillover();
131
+ else this.#openSpillover();
132
+ };
133
+
134
+ #onMenuClick = (e) => {
135
+ // Only auto-close after a "terminal" action (button-ui press). Composite
136
+ // controls inside the menu — select-ui, segmented-ui, etc. — manage their
137
+ // own state; clicking them must not dismiss the spillover.
138
+ const btn = e.target.closest('button-ui');
139
+ if (!btn) return;
140
+ if (btn.matches(`[${SPILLOVER_ATTR}]`)) return;
141
+ queueMicrotask(() => this.#closeSpillover());
142
+ };
143
+
144
+ #onOutside = (e) => {
145
+ if (this.#trigger?.contains(e.target)) return;
146
+ if (this.#popover?.contains(e.target)) return;
147
+ // Ignore clicks inside any other open popover (e.g., a select-ui dropdown
148
+ // launched from a select inside our spillover, which lives in the top
149
+ // layer outside the spillover popover's DOM subtree).
150
+ const path = e.composedPath?.() || [];
151
+ for (const node of path) {
152
+ if (node === document) break;
153
+ if (node?.nodeType === 1 && node.hasAttribute?.('popover')) return;
154
+ }
155
+ this.#closeSpillover();
156
+ };
157
+
158
+ #onKey = (e) => {
159
+ if (e.key === 'Escape') {
160
+ e.stopPropagation();
161
+ this.#closeSpillover();
162
+ this.#trigger?.focus?.({ preventScroll: true });
163
+ }
164
+ };
165
+
166
+ #onToggle = (e) => {
167
+ if (e.newState === 'closed') {
168
+ // Keep listeners cleaned up if closed externally.
169
+ this.#spilloverCleanup?.();
170
+ this.#spilloverCleanup = null;
171
+ document.removeEventListener('pointerdown', this.#onOutside, true);
172
+ document.removeEventListener('keydown', this.#onKey, true);
173
+ }
174
+ };
175
+
176
+ // ── Reflow / overflow ──
177
+
178
+ #queueReflow() {
179
+ if (this.#reflowQueued) return;
180
+ this.#reflowQueued = true;
181
+ requestAnimationFrame(() => {
182
+ this.#reflowQueued = false;
183
+ this.#reflow();
184
+ });
185
+ }
186
+
187
+ #moObserve() {
188
+ this.#mo?.observe(this, { childList: true });
189
+ }
190
+
191
+ #moPause() {
192
+ // MutationObserver delivers records asynchronously, so the #measuring
193
+ // flag alone doesn't stop self-triggered reflows — by the time the
194
+ // observer's microtask fires, the flag has already been cleared. We must
195
+ // physically disconnect during reflow, flush any pending records the
196
+ // observer had already queued, then reconnect on the next microtask.
197
+ if (!this.#mo) return;
198
+ this.#mo.disconnect();
199
+ this.#mo.takeRecords();
200
+ }
201
+
202
+ #reflow() {
203
+ if (!this.isConnected) return;
204
+ const trigger = this.#trigger;
205
+ const popover = this.#popover;
206
+ if (!trigger || !popover) return;
207
+
208
+ this.#measuring = true;
209
+ this.#moPause();
210
+ try {
211
+ // 1. Move everything from the popover back into the toolbar (before the trigger).
212
+ // Strip injected spillover labels so the buttons measure as icon-only again.
213
+ while (popover.firstChild) {
214
+ stripSpilloverLabels(popover.firstChild);
215
+ this.insertBefore(popover.firstChild, trigger);
216
+ }
217
+
218
+ // Stamp the original DOM order on each item the first time we see it.
219
+ // (Items moved to the popover and back must restore their original slot —
220
+ // otherwise dividers end up clumped next to dividers and groups split.)
221
+ let idx = 0;
222
+ for (const el of this.children) {
223
+ if (el === trigger || el === popover) continue;
224
+ if (el.dataset.toolbarOrder == null) el.dataset.toolbarOrder = String(idx);
225
+ idx += 1;
226
+ }
227
+
228
+ // Sort items back into their original order before measurement.
229
+ const ordered = Array.from(this.children)
230
+ .filter(c => c !== trigger && c !== popover)
231
+ .sort((a, b) => Number(a.dataset.toolbarOrder) - Number(b.dataset.toolbarOrder));
232
+ for (const el of ordered) this.insertBefore(el, trigger);
233
+
234
+ const all = ordered;
235
+ for (const el of all) el.hidden = false;
236
+ trigger.hidden = true;
237
+
238
+ // 2. Measure.
239
+ const style = getComputedStyle(this);
240
+ const padL = parseFloat(style.paddingLeft) || 0;
241
+ const padR = parseFloat(style.paddingRight) || 0;
242
+ const gap = parseFloat(style.columnGap || style.gap) || 0;
243
+ const available = this.clientWidth - padL - padR;
244
+
245
+ // Include horizontal margins — components like divider-ui add their own
246
+ // margin-inline which getBoundingClientRect() does NOT include but flex
247
+ // layout DOES count toward the row width.
248
+ const widths = all.map(el => outerWidth(el));
249
+ const total = widths.reduce((a, w) => a + w, 0) + Math.max(0, all.length - 1) * gap;
250
+
251
+ // Reserve OVERFLOW_BUFFER worth of headroom — start spilling sooner
252
+ // rather than waiting until items literally touch the right edge.
253
+ const fitsCleanly = total <= available - OVERFLOW_BUFFER;
254
+
255
+ if (this.overflow === 'none' || fitsCleanly) {
256
+ return;
257
+ }
258
+
259
+ // 3. Need to move some items out. Reserve trigger width + buffer.
260
+ trigger.hidden = false;
261
+ const triggerW = outerWidth(trigger);
262
+
263
+ let fitIdx = all.length;
264
+ let running = total;
265
+ // Drop items from the end (and subtract their width + preceding gap)
266
+ // until visible items + trigger fit with buffer headroom.
267
+ while (fitIdx > 0) {
268
+ const wWithTrigger = running + gap + triggerW;
269
+ if (wWithTrigger <= available - OVERFLOW_BUFFER) break;
270
+ fitIdx -= 1;
271
+ running -= widths[fitIdx];
272
+ if (fitIdx > 0) running -= gap;
273
+ }
274
+
275
+ // 4. Trim trailing dividers from visible section.
276
+ while (fitIdx > 0 && isDivider(all[fitIdx - 1])) fitIdx -= 1;
277
+
278
+ // 5. Move overflowed items into popover (skip dividers entirely).
279
+ const toMove = all.slice(fitIdx);
280
+ for (const el of toMove) {
281
+ if (isDivider(el)) {
282
+ el.hidden = true;
283
+ continue;
284
+ }
285
+ // Inject derived labels on icon-only buttons so the spillover row
286
+ // shows "Bold" instead of just an unlabeled icon.
287
+ applySpilloverLabels(el);
288
+ popover.appendChild(el);
289
+ }
290
+
291
+ // 6. If nothing actually ended up in the popover (e.g. only a divider overflowed),
292
+ // hide the trigger again.
293
+ if (!popover.firstElementChild) {
294
+ trigger.hidden = true;
295
+ }
296
+ } finally {
297
+ this.#measuring = false;
298
+ // Drop any mutation records our reflow produced before reconnecting,
299
+ // otherwise they'd fire as soon as we observe() again and loop forever.
300
+ queueMicrotask(() => {
301
+ this.#mo?.takeRecords();
302
+ this.#moObserve();
303
+ });
304
+ }
305
+ }
306
+ }
307
+ customElements.define('toolbar-ui', AdiaToolbar);
308
+
309
+ /**
310
+ * <toolbar-group-ui> — atomic group within a toolbar.
311
+ * Its children are displayed together with matching gap and, during overflow,
312
+ * are moved to the spillover menu as a single unit.
313
+ */
314
+ class AdiaToolbarGroup extends AdiaElement {
315
+ static template = () => null;
316
+ connected() {
317
+ this.setAttribute('role', 'group');
318
+ }
319
+ }
320
+ customElements.define('toolbar-group-ui', AdiaToolbarGroup);
321
+
322
+ function isDivider(el) {
323
+ return el?.tagName && el.tagName.toLowerCase() === 'divider-ui';
324
+ }
325
+
326
+ const SPILLOVER_LABEL_FLAG = 'data-toolbar-spillover-label';
327
+
328
+ function humanizeIcon(name) {
329
+ if (!name) return '';
330
+ return name
331
+ .split('-')
332
+ .filter(Boolean)
333
+ .map(w => w[0].toUpperCase() + w.slice(1))
334
+ .join(' ');
335
+ }
336
+
337
+ function applySpilloverLabels(root) {
338
+ const buttons = root.matches?.('button-ui') ? [root] : Array.from(root.querySelectorAll?.('button-ui') || []);
339
+ for (const btn of buttons) {
340
+ if (btn.hasAttribute(SPILLOVER_LABEL_FLAG)) continue;
341
+ if (btn.getAttribute('text')) continue; // user-provided text, leave alone
342
+ const label = btn.getAttribute('aria-label') || humanizeIcon(btn.getAttribute('icon'));
343
+ if (!label) continue;
344
+ btn.setAttribute(SPILLOVER_LABEL_FLAG, '');
345
+ btn.setAttribute('text', label);
346
+ }
347
+ }
348
+
349
+ function stripSpilloverLabels(root) {
350
+ const buttons = root.matches?.('button-ui') ? [root] : Array.from(root.querySelectorAll?.('button-ui') || []);
351
+ for (const btn of buttons) {
352
+ if (!btn.hasAttribute(SPILLOVER_LABEL_FLAG)) continue;
353
+ btn.removeAttribute(SPILLOVER_LABEL_FLAG);
354
+ btn.removeAttribute('text');
355
+ }
356
+ }
357
+
358
+ function outerWidth(el) {
359
+ const r = el.getBoundingClientRect();
360
+ const cs = getComputedStyle(el);
361
+ const ml = parseFloat(cs.marginLeft) || 0;
362
+ const mr = parseFloat(cs.marginRight) || 0;
363
+ return r.width + ml + mr;
364
+ }
365
+
366
+ export { AdiaToolbar, AdiaToolbarGroup };
@@ -0,0 +1,238 @@
1
+ # Generated by scripts/migrate-yamls-to-v1.mjs — migrated to v1 contract.
2
+ # Edit this file; run `npm run build:components` to regenerate a2ui.json.
3
+ $schema: ../../../../scripts/schemas/component.yaml.schema.json
4
+ name: AdiaToolbar
5
+ tag: toolbar-ui
6
+ component: Toolbar
7
+ category: layout
8
+ version: 1
9
+ description: Horizontal action bar with automatic overflow. Items that don't fit move to a spillover
10
+ popover menu.
11
+ props:
12
+ bordered:
13
+ description: Adds a border around the toolbar for visual separation from surrounding content.
14
+ type: boolean
15
+ default: false
16
+ reflect: true
17
+ vertical:
18
+ description: Stack items vertically (alias for orientation="vertical").
19
+ type: boolean
20
+ default: false
21
+ reflect: true
22
+ align:
23
+ description: Item alignment
24
+ type: string
25
+ default: start
26
+ gap:
27
+ description: Gap between items
28
+ type: string
29
+ default: sm
30
+ orientation:
31
+ description: Layout direction. Vertical mode disables overflow.
32
+ type: string
33
+ default: horizontal
34
+ enum:
35
+ - horizontal
36
+ - vertical
37
+ overflow:
38
+ description: Overflow behavior
39
+ type: string
40
+ default: menu
41
+ enum:
42
+ - menu
43
+ - none
44
+ variant:
45
+ description: Visual style. Transparent removes background, border, and padding.
46
+ type: string
47
+ default: ""
48
+ enum:
49
+ - ""
50
+ - transparent
51
+ events: {}
52
+ slots: {}
53
+ states:
54
+ - name: idle
55
+ description: Default, ready for interaction.
56
+ traits: []
57
+ tokens: {}
58
+ a2ui:
59
+ rules: []
60
+ anti_patterns: []
61
+ examples:
62
+ - name: toolbar-buttons
63
+ description: Toolbar with grouped icon buttons for text formatting, alignment, and undo/redo actions
64
+ separated by dividers.
65
+ a2ui: >-
66
+ [
67
+ {
68
+ "id": "root",
69
+ "component": "Toolbar",
70
+ "attrs": {
71
+ "aria-label": "Text formatting"
72
+ },
73
+ "children": [
74
+ "format-group",
75
+ "div1",
76
+ "align-group",
77
+ "div2",
78
+ "history-group"
79
+ ]
80
+ },
81
+ {
82
+ "id": "format-group",
83
+ "component": "Row",
84
+ "attrs": {
85
+ "gap": "xs"
86
+ },
87
+ "children": [
88
+ "btn-bold",
89
+ "btn-italic",
90
+ "btn-underline"
91
+ ]
92
+ },
93
+ {
94
+ "id": "btn-bold",
95
+ "component": "Button",
96
+ "attrs": {
97
+ "variant": "ghost",
98
+ "icon": "bold",
99
+ "aria-label": "Bold",
100
+ "size": "sm"
101
+ }
102
+ },
103
+ {
104
+ "id": "btn-italic",
105
+ "component": "Button",
106
+ "attrs": {
107
+ "variant": "ghost",
108
+ "icon": "italic",
109
+ "aria-label": "Italic",
110
+ "size": "sm"
111
+ }
112
+ },
113
+ {
114
+ "id": "btn-underline",
115
+ "component": "Button",
116
+ "attrs": {
117
+ "variant": "ghost",
118
+ "icon": "underline",
119
+ "aria-label": "Underline",
120
+ "size": "sm"
121
+ }
122
+ },
123
+ {
124
+ "id": "div1",
125
+ "component": "Divider",
126
+ "attrs": {
127
+ "orientation": "vertical"
128
+ }
129
+ },
130
+ {
131
+ "id": "align-group",
132
+ "component": "Row",
133
+ "attrs": {
134
+ "gap": "xs"
135
+ },
136
+ "children": [
137
+ "btn-align-left",
138
+ "btn-align-center",
139
+ "btn-align-right"
140
+ ]
141
+ },
142
+ {
143
+ "id": "btn-align-left",
144
+ "component": "Button",
145
+ "attrs": {
146
+ "variant": "ghost",
147
+ "icon": "align-left",
148
+ "aria-label": "Align left",
149
+ "size": "sm"
150
+ }
151
+ },
152
+ {
153
+ "id": "btn-align-center",
154
+ "component": "Button",
155
+ "attrs": {
156
+ "variant": "ghost",
157
+ "icon": "align-center",
158
+ "aria-label": "Align center",
159
+ "size": "sm"
160
+ }
161
+ },
162
+ {
163
+ "id": "btn-align-right",
164
+ "component": "Button",
165
+ "attrs": {
166
+ "variant": "ghost",
167
+ "icon": "align-right",
168
+ "aria-label": "Align right",
169
+ "size": "sm"
170
+ }
171
+ },
172
+ {
173
+ "id": "div2",
174
+ "component": "Divider",
175
+ "attrs": {
176
+ "orientation": "vertical"
177
+ }
178
+ },
179
+ {
180
+ "id": "history-group",
181
+ "component": "Row",
182
+ "attrs": {
183
+ "gap": "xs"
184
+ },
185
+ "children": [
186
+ "btn-undo",
187
+ "btn-redo"
188
+ ]
189
+ },
190
+ {
191
+ "id": "btn-undo",
192
+ "component": "Button",
193
+ "attrs": {
194
+ "variant": "ghost",
195
+ "icon": "undo",
196
+ "aria-label": "Undo",
197
+ "size": "sm"
198
+ }
199
+ },
200
+ {
201
+ "id": "btn-redo",
202
+ "component": "Button",
203
+ "attrs": {
204
+ "variant": "ghost",
205
+ "icon": "redo",
206
+ "aria-label": "Redo",
207
+ "size": "sm"
208
+ }
209
+ }
210
+ ]
211
+ keywords:
212
+ - toolbar
213
+ - action-bar
214
+ - button-group
215
+ - buttons
216
+ - actions
217
+ synonyms:
218
+ action-bar:
219
+ - toolbar
220
+ - button
221
+ actions:
222
+ - toolbar
223
+ - button
224
+ - popover
225
+ button-group:
226
+ - toolbar
227
+ - button
228
+ - segmented
229
+ buttons:
230
+ - toolbar
231
+ - button
232
+ - tooltip
233
+ toolbar:
234
+ - toolbar
235
+ - button
236
+ related:
237
+ - button
238
+ - divider