@adea-ai/ui 0.152.4 → 0.153.0

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 (892) hide show
  1. package/README.md +469 -580
  2. package/dist/components/composites/account-menu/account-menu.d.ts +5 -0
  3. package/dist/components/composites/account-menu/account-menu.d.ts.map +1 -1
  4. package/dist/components/composites/account-menu/account-menu.js +37 -13
  5. package/dist/components/composites/account-menu/account-menu.js.map +1 -1
  6. package/dist/components/composites/action-button/action-button.d.ts +2 -1
  7. package/dist/components/composites/action-button/action-button.d.ts.map +1 -1
  8. package/dist/components/composites/action-button/action-button.js +92 -66
  9. package/dist/components/composites/action-button/action-button.js.map +1 -1
  10. package/dist/components/composites/appearance-editor/accent-swatch-groups.d.ts +3 -3
  11. package/dist/components/composites/appearance-editor/accent-swatch-groups.js +1 -1
  12. package/dist/components/composites/appearance-editor/accent-swatch-groups.js.map +1 -1
  13. package/dist/components/composites/appearance-editor/appearance-choices.d.ts +1 -1
  14. package/dist/components/composites/appearance-editor/appearance-choices.js +1 -1
  15. package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
  16. package/dist/components/composites/appearance-editor/appearance-editor.d.ts.map +1 -1
  17. package/dist/components/composites/appearance-editor/appearance-editor.js +57 -57
  18. package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
  19. package/dist/components/composites/appearance-editor/appearance-rows.d.ts.map +1 -1
  20. package/dist/components/composites/appearance-editor/appearance-rows.js +9 -9
  21. package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
  22. package/dist/components/composites/appearance-editor/appearance-types.d.ts +7 -7
  23. package/dist/components/composites/appearance-editor/theme-preview.d.ts +1 -1
  24. package/dist/components/composites/appearance-editor/theme-preview.js +1 -1
  25. package/dist/components/composites/appearance-editor/theme-preview.js.map +1 -1
  26. package/dist/components/composites/catalog-browser/catalog-browser.d.ts.map +1 -1
  27. package/dist/components/composites/catalog-browser/catalog-browser.js +6 -10
  28. package/dist/components/composites/catalog-browser/catalog-browser.js.map +1 -1
  29. package/dist/components/composites/catalog-browser/catalog-detail.d.ts.map +1 -1
  30. package/dist/components/composites/catalog-browser/catalog-detail.js +36 -36
  31. package/dist/components/composites/catalog-browser/catalog-detail.js.map +1 -1
  32. package/dist/components/composites/chain-of-thought/chain-of-thought.d.ts +4 -4
  33. package/dist/components/composites/chain-of-thought/chain-of-thought.js.map +1 -1
  34. package/dist/components/composites/chat/chat.d.ts.map +1 -1
  35. package/dist/components/composites/chat/chat.js +33 -37
  36. package/dist/components/composites/chat/chat.js.map +1 -1
  37. package/dist/components/composites/checkpoint/checkpoint-model.d.ts +3 -3
  38. package/dist/components/composites/checkpoint/checkpoint-model.js +2 -2
  39. package/dist/components/composites/checkpoint/checkpoint-model.js.map +1 -1
  40. package/dist/components/composites/checkpoint/checkpoint.d.ts +2 -2
  41. package/dist/components/composites/checkpoint/checkpoint.js.map +1 -1
  42. package/dist/components/composites/confirmation/confirmation.d.ts.map +1 -1
  43. package/dist/components/composites/confirmation/confirmation.js +1 -1
  44. package/dist/components/composites/confirmation/confirmation.js.map +1 -1
  45. package/dist/components/composites/context/context.d.ts +2 -2
  46. package/dist/components/composites/context/context.js.map +1 -1
  47. package/dist/components/composites/file-tree/build-file-tree.d.ts +1 -1
  48. package/dist/components/composites/file-tree/build-file-tree.js +1 -1
  49. package/dist/components/composites/file-tree/build-file-tree.js.map +1 -1
  50. package/dist/components/composites/file-tree/file-tree.d.ts.map +1 -1
  51. package/dist/components/composites/file-tree/file-tree.js +7 -3
  52. package/dist/components/composites/file-tree/file-tree.js.map +1 -1
  53. package/dist/components/composites/icon-picker/icon-picker.js +1 -3
  54. package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
  55. package/dist/components/composites/inline-citation/citation.d.ts +1 -1
  56. package/dist/components/composites/inline-citation/citation.js +1 -1
  57. package/dist/components/composites/inline-citation/citation.js.map +1 -1
  58. package/dist/components/composites/inline-citation/inline-citation.d.ts +2 -2
  59. package/dist/components/composites/inline-citation/inline-citation.js.map +1 -1
  60. package/dist/components/composites/list-row/list-row-control.d.ts.map +1 -1
  61. package/dist/components/composites/list-row/list-row-control.js +22 -22
  62. package/dist/components/composites/list-row/list-row-control.js.map +1 -1
  63. package/dist/components/composites/list-row/list-row.d.ts +5 -0
  64. package/dist/components/composites/list-row/list-row.d.ts.map +1 -1
  65. package/dist/components/composites/list-row/list-row.js +75 -83
  66. package/dist/components/composites/list-row/list-row.js.map +1 -1
  67. package/dist/components/composites/message-scroller/message-scroller.d.ts +1 -1
  68. package/dist/components/composites/message-scroller/message-scroller.js.map +1 -1
  69. package/dist/components/composites/model-selector/model-selector.d.ts +4 -4
  70. package/dist/components/composites/model-selector/model-selector.js.map +1 -1
  71. package/dist/components/composites/model-selector/models.d.ts +2 -2
  72. package/dist/components/composites/model-selector/models.js +1 -1
  73. package/dist/components/composites/model-selector/models.js.map +1 -1
  74. package/dist/components/composites/plan/plan.d.ts.map +1 -1
  75. package/dist/components/composites/plan/plan.js +17 -15
  76. package/dist/components/composites/plan/plan.js.map +1 -1
  77. package/dist/components/composites/queue/queue.d.ts.map +1 -1
  78. package/dist/components/composites/queue/queue.js +5 -7
  79. package/dist/components/composites/queue/queue.js.map +1 -1
  80. package/dist/components/composites/reasoning/reasoning.d.ts +4 -4
  81. package/dist/components/composites/reasoning/reasoning.js +4 -4
  82. package/dist/components/composites/reasoning/reasoning.js.map +1 -1
  83. package/dist/components/composites/settings/settings-navigation.d.ts.map +1 -1
  84. package/dist/components/composites/settings/settings-navigation.js +63 -14
  85. package/dist/components/composites/settings/settings-navigation.js.map +1 -1
  86. package/dist/components/composites/settings/settings.d.ts.map +1 -1
  87. package/dist/components/composites/settings/settings.js +32 -32
  88. package/dist/components/composites/settings/settings.js.map +1 -1
  89. package/dist/components/composites/sources/source.d.ts +1 -1
  90. package/dist/components/composites/sources/source.js.map +1 -1
  91. package/dist/components/composites/sources/sources.d.ts +2 -2
  92. package/dist/components/composites/sources/sources.js.map +1 -1
  93. package/dist/components/composites/stack-trace/parse-stack-trace.d.ts +3 -3
  94. package/dist/components/composites/stack-trace/parse-stack-trace.js +4 -4
  95. package/dist/components/composites/stack-trace/parse-stack-trace.js.map +1 -1
  96. package/dist/components/composites/stack-trace/stack-trace.d.ts +3 -3
  97. package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
  98. package/dist/components/composites/stat/stat.d.ts.map +1 -1
  99. package/dist/components/composites/stat/stat.js +14 -16
  100. package/dist/components/composites/stat/stat.js.map +1 -1
  101. package/dist/components/composites/subagent/subagent.d.ts.map +1 -1
  102. package/dist/components/composites/subagent/subagent.js +6 -4
  103. package/dist/components/composites/subagent/subagent.js.map +1 -1
  104. package/dist/components/composites/task/task.d.ts +1 -1
  105. package/dist/components/composites/task/task.js.map +1 -1
  106. package/dist/components/composites/terminal/ansi.d.ts +3 -3
  107. package/dist/components/composites/terminal/ansi.js.map +1 -1
  108. package/dist/components/composites/terminal/terminal-model.d.ts +3 -3
  109. package/dist/components/composites/terminal/terminal-model.d.ts.map +1 -1
  110. package/dist/components/composites/terminal/terminal-model.js +1 -1
  111. package/dist/components/composites/terminal/terminal-model.js.map +1 -1
  112. package/dist/components/composites/terminal/terminal.d.ts.map +1 -1
  113. package/dist/components/composites/terminal/terminal.js +24 -11
  114. package/dist/components/composites/terminal/terminal.js.map +1 -1
  115. package/dist/components/composites/test-results/test-results-model.d.ts +4 -4
  116. package/dist/components/composites/test-results/test-results-model.js +2 -2
  117. package/dist/components/composites/test-results/test-results-model.js.map +1 -1
  118. package/dist/components/composites/test-results/test-results.d.ts +1 -1
  119. package/dist/components/composites/test-results/test-results.js.map +1 -1
  120. package/dist/components/composites/tool/tool.d.ts +4 -4
  121. package/dist/components/composites/tool/tool.js.map +1 -1
  122. package/dist/components/composites/tree/tree.d.ts +1 -1
  123. package/dist/components/composites/tree/tree.d.ts.map +1 -1
  124. package/dist/components/composites/tree/tree.js +25 -18
  125. package/dist/components/composites/tree/tree.js.map +1 -1
  126. package/dist/components/composites/update-dialog/channel-control.d.ts +10 -4
  127. package/dist/components/composites/update-dialog/channel-control.d.ts.map +1 -1
  128. package/dist/components/composites/update-dialog/channel-control.js +14 -19
  129. package/dist/components/composites/update-dialog/channel-control.js.map +1 -1
  130. package/dist/components/composites/update-dialog/index.d.ts +1 -1
  131. package/dist/components/composites/update-dialog/index.d.ts.map +1 -1
  132. package/dist/components/composites/update-dialog/update-dialog.js +4 -5
  133. package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
  134. package/dist/components/composites/workspace-mark/workspace-mark.d.ts.map +1 -1
  135. package/dist/components/composites/workspace-mark/workspace-mark.js +19 -20
  136. package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
  137. package/dist/components/conversation/busy-send-button.d.ts.map +1 -1
  138. package/dist/components/conversation/busy-send-button.js +18 -20
  139. package/dist/components/conversation/busy-send-button.js.map +1 -1
  140. package/dist/components/conversation/composer-menu.d.ts +3 -3
  141. package/dist/components/conversation/composer-menu.js +3 -3
  142. package/dist/components/conversation/composer-menu.js.map +1 -1
  143. package/dist/components/conversation/conversation-avatar.js +2 -4
  144. package/dist/components/conversation/conversation-avatar.js.map +1 -1
  145. package/dist/components/conversation/conversation-pane.d.ts.map +1 -1
  146. package/dist/components/conversation/conversation-pane.js +6 -5
  147. package/dist/components/conversation/conversation-pane.js.map +1 -1
  148. package/dist/components/conversation/conversation-surface.js +3 -7
  149. package/dist/components/conversation/conversation-surface.js.map +1 -1
  150. package/dist/components/conversation/internal/chat-composer-shell.d.ts.map +1 -1
  151. package/dist/components/conversation/internal/chat-composer-shell.js +76 -76
  152. package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
  153. package/dist/components/conversation/message-composer.d.ts.map +1 -1
  154. package/dist/components/conversation/message-composer.js +32 -38
  155. package/dist/components/conversation/message-composer.js.map +1 -1
  156. package/dist/components/conversation/message-row.d.ts.map +1 -1
  157. package/dist/components/conversation/message-row.js +79 -73
  158. package/dist/components/conversation/message-row.js.map +1 -1
  159. package/dist/components/conversation/scroll-follow-core.d.ts +7 -7
  160. package/dist/components/conversation/scroll-follow-core.js +4 -4
  161. package/dist/components/conversation/scroll-follow-core.js.map +1 -1
  162. package/dist/components/conversation/scroll-follow.d.ts.map +1 -1
  163. package/dist/components/conversation/scroll-follow.js +19 -4
  164. package/dist/components/conversation/scroll-follow.js.map +1 -1
  165. package/dist/components/conversation/thread-panel.d.ts.map +1 -1
  166. package/dist/components/conversation/thread-panel.js +23 -23
  167. package/dist/components/conversation/thread-panel.js.map +1 -1
  168. package/dist/components/conversation/transcript-composition.d.ts.map +1 -1
  169. package/dist/components/conversation/transcript-composition.js +2 -2
  170. package/dist/components/conversation/transcript-composition.js.map +1 -1
  171. package/dist/components/layout/app-shell/app-shell.d.ts +1 -1
  172. package/dist/components/layout/app-shell/app-shell.js +1 -1
  173. package/dist/components/layout/app-shell/app-shell.js.map +1 -1
  174. package/dist/components/layout/app-shell/skip-link.d.ts.map +1 -1
  175. package/dist/components/layout/app-shell/skip-link.js +4 -6
  176. package/dist/components/layout/app-shell/skip-link.js.map +1 -1
  177. package/dist/components/layout/page/page.d.ts.map +1 -1
  178. package/dist/components/layout/page/page.js +17 -17
  179. package/dist/components/layout/page/page.js.map +1 -1
  180. package/dist/components/layout/panel/panel.js +2 -4
  181. package/dist/components/layout/panel/panel.js.map +1 -1
  182. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.d.ts.map +1 -1
  183. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js +16 -1
  184. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -1
  185. package/dist/components/layout/side-rail/side-rail-context.d.ts +1 -1
  186. package/dist/components/layout/side-rail/side-rail-context.js.map +1 -1
  187. package/dist/components/layout/side-rail/side-rail.d.ts.map +1 -1
  188. package/dist/components/layout/side-rail/side-rail.js +35 -34
  189. package/dist/components/layout/side-rail/side-rail.js.map +1 -1
  190. package/dist/components/layout/sidebar-nav/sidebar-nav.d.ts.map +1 -1
  191. package/dist/components/layout/sidebar-nav/sidebar-nav.js +23 -23
  192. package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
  193. package/dist/components/layout/split-layout/resize-controller-core-retry.d.ts.map +1 -1
  194. package/dist/components/layout/split-layout/resize-controller-core-retry.js +25 -7
  195. package/dist/components/layout/split-layout/resize-controller-core-retry.js.map +1 -1
  196. package/dist/components/layout/split-layout/resize-controller-core.d.ts.map +1 -1
  197. package/dist/components/layout/split-layout/resize-controller-core.js +25 -7
  198. package/dist/components/layout/split-layout/resize-controller-core.js.map +1 -1
  199. package/dist/components/layout/split-layout/split-layout.d.ts.map +1 -1
  200. package/dist/components/layout/split-layout/split-layout.js +2 -2
  201. package/dist/components/layout/split-layout/split-layout.js.map +1 -1
  202. package/dist/components/layout/status-bar/status-bar.d.ts +1 -1
  203. package/dist/components/layout/status-bar/status-bar.js +1 -1
  204. package/dist/components/layout/status-bar/status-bar.js.map +1 -1
  205. package/dist/components/layout/top-bar/top-bar.d.ts.map +1 -1
  206. package/dist/components/layout/top-bar/top-bar.js +7 -7
  207. package/dist/components/layout/top-bar/top-bar.js.map +1 -1
  208. package/dist/components/motion/presence.d.ts +2 -2
  209. package/dist/components/motion/presence.js.map +1 -1
  210. package/dist/components/theme/appearance-panel.d.ts +5 -5
  211. package/dist/components/theme/appearance-panel.js.map +1 -1
  212. package/dist/components/theme/lazy.d.ts +1 -1
  213. package/dist/components/theme/lazy.js.map +1 -1
  214. package/dist/components/theme/theme-catalogue-source.d.ts +2 -2
  215. package/dist/components/theme/theme-catalogue-source.js +2 -2
  216. package/dist/components/theme/theme-catalogue-source.js.map +1 -1
  217. package/dist/components/theme/theme-context.d.ts +2 -2
  218. package/dist/components/theme/theme-context.js +3 -3
  219. package/dist/components/theme/theme-context.js.map +1 -1
  220. package/dist/components/theme/theme-document.d.ts.map +1 -1
  221. package/dist/components/theme/theme-document.js +14 -9
  222. package/dist/components/theme/theme-document.js.map +1 -1
  223. package/dist/components/theme/theme-picker.d.ts +5 -5
  224. package/dist/components/theme/theme-picker.js.map +1 -1
  225. package/dist/components/theme/theme-provider-value.d.ts +0 -6
  226. package/dist/components/theme/theme-provider-value.d.ts.map +1 -1
  227. package/dist/components/theme/theme-provider-value.js +9 -3
  228. package/dist/components/theme/theme-provider-value.js.map +1 -1
  229. package/dist/components/theme/theme-script.d.ts +14 -0
  230. package/dist/components/theme/theme-script.d.ts.map +1 -1
  231. package/dist/components/theme/theme-script.js +1 -0
  232. package/dist/components/theme/theme-script.js.map +1 -1
  233. package/dist/components/theme/theme-state.d.ts +7 -7
  234. package/dist/components/theme/theme-state.js.map +1 -1
  235. package/dist/components/theme/theme-toggle.d.ts +1 -1
  236. package/dist/components/theme/theme-toggle.js.map +1 -1
  237. package/dist/components/ui/alert/alert.d.ts.map +1 -1
  238. package/dist/components/ui/alert/alert.js +4 -3
  239. package/dist/components/ui/alert/alert.js.map +1 -1
  240. package/dist/components/ui/alert-dialog/alert-dialog.d.ts +1 -1
  241. package/dist/components/ui/alert-dialog/alert-dialog.js +3 -3
  242. package/dist/components/ui/alert-dialog/alert-dialog.js.map +1 -1
  243. package/dist/components/ui/badge/badge.d.ts +1 -1
  244. package/dist/components/ui/badge/badge.js +2 -2
  245. package/dist/components/ui/badge/badge.js.map +1 -1
  246. package/dist/components/ui/board/board.d.ts.map +1 -1
  247. package/dist/components/ui/board/board.js +10 -6
  248. package/dist/components/ui/board/board.js.map +1 -1
  249. package/dist/components/ui/bubble/bubble.d.ts.map +1 -1
  250. package/dist/components/ui/bubble/bubble.js +6 -4
  251. package/dist/components/ui/bubble/bubble.js.map +1 -1
  252. package/dist/components/ui/button/button.js +2 -2
  253. package/dist/components/ui/button/button.js.map +1 -1
  254. package/dist/components/ui/button-group/button-group.d.ts +1 -1
  255. package/dist/components/ui/button-group/button-group.js +1 -1
  256. package/dist/components/ui/button-group/button-group.js.map +1 -1
  257. package/dist/components/ui/calendar/calendar.js +6 -6
  258. package/dist/components/ui/calendar/calendar.js.map +1 -1
  259. package/dist/components/ui/callout/callout.d.ts +4 -4
  260. package/dist/components/ui/callout/callout.js +4 -4
  261. package/dist/components/ui/callout/callout.js.map +1 -1
  262. package/dist/components/ui/card/card.d.ts +2 -2
  263. package/dist/components/ui/card/card.js +2 -2
  264. package/dist/components/ui/card/card.js.map +1 -1
  265. package/dist/components/ui/carousel/carousel.d.ts +4 -4
  266. package/dist/components/ui/carousel/carousel.d.ts.map +1 -1
  267. package/dist/components/ui/carousel/carousel.js.map +1 -1
  268. package/dist/components/ui/chart/chart-options.d.ts +7 -7
  269. package/dist/components/ui/chart/chart-options.js +9 -9
  270. package/dist/components/ui/chart/chart-options.js.map +1 -1
  271. package/dist/components/ui/chart/chart.d.ts.map +1 -1
  272. package/dist/components/ui/chart/chart.js +16 -7
  273. package/dist/components/ui/chart/chart.js.map +1 -1
  274. package/dist/components/ui/checkbox/checkbox.d.ts.map +1 -1
  275. package/dist/components/ui/checkbox/checkbox.js +8 -6
  276. package/dist/components/ui/checkbox/checkbox.js.map +1 -1
  277. package/dist/components/ui/code-block/code-block.d.ts.map +1 -1
  278. package/dist/components/ui/code-block/code-block.js +8 -6
  279. package/dist/components/ui/code-block/code-block.js.map +1 -1
  280. package/dist/components/ui/command/command.d.ts +4 -4
  281. package/dist/components/ui/command/command.js +4 -4
  282. package/dist/components/ui/command/command.js.map +1 -1
  283. package/dist/components/ui/context-menu/context-menu.d.ts +1 -1
  284. package/dist/components/ui/context-menu/context-menu.js.map +1 -1
  285. package/dist/components/ui/detail-panel/detail-panel.d.ts.map +1 -1
  286. package/dist/components/ui/detail-panel/detail-panel.js +13 -13
  287. package/dist/components/ui/detail-panel/detail-panel.js.map +1 -1
  288. package/dist/components/ui/dialog/dialog-layer.d.ts +0 -4
  289. package/dist/components/ui/dialog/dialog-layer.d.ts.map +1 -1
  290. package/dist/components/ui/dialog/dialog-layer.js +17 -1
  291. package/dist/components/ui/dialog/dialog-layer.js.map +1 -1
  292. package/dist/components/ui/dialog/dialog.d.ts.map +1 -1
  293. package/dist/components/ui/dialog/dialog.js +4 -3
  294. package/dist/components/ui/dialog/dialog.js.map +1 -1
  295. package/dist/components/ui/diff-block/diff-block.d.ts +6 -6
  296. package/dist/components/ui/diff-block/diff-block.js +3 -3
  297. package/dist/components/ui/diff-block/diff-block.js.map +1 -1
  298. package/dist/components/ui/drawer/drawer.d.ts +3 -3
  299. package/dist/components/ui/drawer/drawer.js +2 -2
  300. package/dist/components/ui/drawer/drawer.js.map +1 -1
  301. package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +5 -5
  302. package/dist/components/ui/dropdown-menu/dropdown-menu.js +3 -3
  303. package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
  304. package/dist/components/ui/dropdown-menu/menu-parts.d.ts +3 -3
  305. package/dist/components/ui/dropdown-menu/menu-parts.js +1 -1
  306. package/dist/components/ui/dropdown-menu/menu-parts.js.map +1 -1
  307. package/dist/components/ui/empty/empty-state.d.ts.map +1 -1
  308. package/dist/components/ui/empty/empty-state.js +33 -36
  309. package/dist/components/ui/empty/empty-state.js.map +1 -1
  310. package/dist/components/ui/empty/empty.d.ts +1 -1
  311. package/dist/components/ui/empty/empty.js +1 -1
  312. package/dist/components/ui/empty/empty.js.map +1 -1
  313. package/dist/components/ui/entity-icon/entity-icon.d.ts.map +1 -1
  314. package/dist/components/ui/entity-icon/entity-icon.js +7 -7
  315. package/dist/components/ui/entity-icon/entity-icon.js.map +1 -1
  316. package/dist/components/ui/field/field.d.ts.map +1 -1
  317. package/dist/components/ui/field/field.js +15 -15
  318. package/dist/components/ui/field/field.js.map +1 -1
  319. package/dist/components/ui/field/number-field.d.ts +1 -1
  320. package/dist/components/ui/field/number-field.js +1 -1
  321. package/dist/components/ui/field/number-field.js.map +1 -1
  322. package/dist/components/ui/hover-card/hover-card.d.ts +1 -1
  323. package/dist/components/ui/hover-card/hover-card.js.map +1 -1
  324. package/dist/components/ui/input-group/input-group.d.ts +1 -1
  325. package/dist/components/ui/input-group/input-group.js.map +1 -1
  326. package/dist/components/ui/input-otp/input-otp.d.ts +1 -1
  327. package/dist/components/ui/input-otp/input-otp.js.map +1 -1
  328. package/dist/components/ui/item/item.d.ts.map +1 -1
  329. package/dist/components/ui/item/item.js +26 -26
  330. package/dist/components/ui/item/item.js.map +1 -1
  331. package/dist/components/ui/kbd/kbd.d.ts +2 -2
  332. package/dist/components/ui/kbd/kbd.js +2 -2
  333. package/dist/components/ui/kbd/kbd.js.map +1 -1
  334. package/dist/components/ui/kbd/platform-modifier.d.ts +3 -3
  335. package/dist/components/ui/kbd/platform-modifier.js +3 -3
  336. package/dist/components/ui/kbd/platform-modifier.js.map +1 -1
  337. package/dist/components/ui/label/label.d.ts +1 -1
  338. package/dist/components/ui/label/label.js +1 -1
  339. package/dist/components/ui/label/label.js.map +1 -1
  340. package/dist/components/ui/marker/marker.d.ts.map +1 -1
  341. package/dist/components/ui/marker/marker.js +17 -19
  342. package/dist/components/ui/marker/marker.js.map +1 -1
  343. package/dist/components/ui/menubar/menubar.d.ts +2 -2
  344. package/dist/components/ui/menubar/menubar.js +1 -1
  345. package/dist/components/ui/menubar/menubar.js.map +1 -1
  346. package/dist/components/ui/message/message.d.ts.map +1 -1
  347. package/dist/components/ui/message/message.js +16 -18
  348. package/dist/components/ui/message/message.js.map +1 -1
  349. package/dist/components/ui/modal-dialog/modal-dialog.d.ts.map +1 -1
  350. package/dist/components/ui/modal-dialog/modal-dialog.js +7 -11
  351. package/dist/components/ui/modal-dialog/modal-dialog.js.map +1 -1
  352. package/dist/components/ui/native-select/native-select.d.ts +1 -1
  353. package/dist/components/ui/native-select/native-select.js.map +1 -1
  354. package/dist/components/ui/navigation-menu/navigation-menu.d.ts.map +1 -1
  355. package/dist/components/ui/navigation-menu/navigation-menu.js +5 -4
  356. package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -1
  357. package/dist/components/ui/pagination/pagination.js +2 -4
  358. package/dist/components/ui/pagination/pagination.js.map +1 -1
  359. package/dist/components/ui/popover/popover.d.ts.map +1 -1
  360. package/dist/components/ui/popover/popover.js +11 -4
  361. package/dist/components/ui/popover/popover.js.map +1 -1
  362. package/dist/components/ui/progress/progress.d.ts.map +1 -1
  363. package/dist/components/ui/progress/progress.js +6 -8
  364. package/dist/components/ui/progress/progress.js.map +1 -1
  365. package/dist/components/ui/questionnaire/questionnaire.d.ts.map +1 -1
  366. package/dist/components/ui/questionnaire/questionnaire.js +73 -73
  367. package/dist/components/ui/questionnaire/questionnaire.js.map +1 -1
  368. package/dist/components/ui/radio-group/radio-group.d.ts.map +1 -1
  369. package/dist/components/ui/radio-group/radio-group.js +12 -6
  370. package/dist/components/ui/radio-group/radio-group.js.map +1 -1
  371. package/dist/components/ui/resizable/resizable.d.ts +2 -2
  372. package/dist/components/ui/resizable/resizable.js +3 -3
  373. package/dist/components/ui/resizable/resizable.js.map +1 -1
  374. package/dist/components/ui/select/select.d.ts +3 -3
  375. package/dist/components/ui/select/select.js +1 -1
  376. package/dist/components/ui/select/select.js.map +1 -1
  377. package/dist/components/ui/sheet/sheet.d.ts.map +1 -1
  378. package/dist/components/ui/sheet/sheet.js +4 -3
  379. package/dist/components/ui/sheet/sheet.js.map +1 -1
  380. package/dist/components/ui/skeleton/skeleton.d.ts +1 -1
  381. package/dist/components/ui/skeleton/skeleton.js +1 -1
  382. package/dist/components/ui/skeleton/skeleton.js.map +1 -1
  383. package/dist/components/ui/slider/slider.d.ts +1 -1
  384. package/dist/components/ui/slider/slider.js.map +1 -1
  385. package/dist/components/ui/spinner/spinner.d.ts +1 -1
  386. package/dist/components/ui/spinner/spinner.js +1 -1
  387. package/dist/components/ui/spinner/spinner.js.map +1 -1
  388. package/dist/components/ui/status-chip/status-chip.d.ts +13 -13
  389. package/dist/components/ui/status-chip/status-chip.d.ts.map +1 -1
  390. package/dist/components/ui/status-chip/status-chip.js +11 -11
  391. package/dist/components/ui/status-chip/status-chip.js.map +1 -1
  392. package/dist/components/ui/switch/switch.d.ts.map +1 -1
  393. package/dist/components/ui/switch/switch.js +8 -6
  394. package/dist/components/ui/switch/switch.js.map +1 -1
  395. package/dist/components/ui/tabs/tabs.d.ts +4 -4
  396. package/dist/components/ui/tabs/tabs.js +4 -4
  397. package/dist/components/ui/tabs/tabs.js.map +1 -1
  398. package/dist/components/ui/textarea/textarea.d.ts +1 -1
  399. package/dist/components/ui/textarea/textarea.js +1 -1
  400. package/dist/components/ui/textarea/textarea.js.map +1 -1
  401. package/dist/components/ui/toast/toast.d.ts.map +1 -1
  402. package/dist/components/ui/toast/toast.js +13 -15
  403. package/dist/components/ui/toast/toast.js.map +1 -1
  404. package/dist/components/ui/toggle/toggle.d.ts +1 -1
  405. package/dist/components/ui/toggle/toggle.js +1 -1
  406. package/dist/components/ui/toggle/toggle.js.map +1 -1
  407. package/dist/components/ui/tooltip/deferred-tooltip.d.ts +51 -0
  408. package/dist/components/ui/tooltip/deferred-tooltip.d.ts.map +1 -0
  409. package/dist/components/ui/tooltip/deferred-tooltip.js +103 -0
  410. package/dist/components/ui/tooltip/deferred-tooltip.js.map +1 -0
  411. package/dist/components/ui/tooltip/index.d.ts +1 -0
  412. package/dist/components/ui/tooltip/index.d.ts.map +1 -1
  413. package/dist/components/ui/tooltip/index.js +3 -1
  414. package/dist/components/ui/tooltip/tooltip.d.ts.map +1 -1
  415. package/dist/components/ui/tooltip/tooltip.js +6 -5
  416. package/dist/components/ui/tooltip/tooltip.js.map +1 -1
  417. package/dist/components/ui/trace/trace.d.ts.map +1 -1
  418. package/dist/components/ui/trace/trace.js +17 -17
  419. package/dist/components/ui/trace/trace.js.map +1 -1
  420. package/dist/components/ui/typography/typography.d.ts +3 -3
  421. package/dist/components/ui/typography/typography.js +5 -5
  422. package/dist/components/ui/typography/typography.js.map +1 -1
  423. package/dist/index.d.ts +1 -0
  424. package/dist/index.d.ts.map +1 -1
  425. package/dist/index.js +5 -3
  426. package/dist/lib/accent-presets.d.ts +1 -1
  427. package/dist/lib/accent-presets.js.map +1 -1
  428. package/dist/lib/accent-roles.d.ts +2 -2
  429. package/dist/lib/accent-roles.js +2 -2
  430. package/dist/lib/accent-roles.js.map +1 -1
  431. package/dist/lib/appearance-font-settings.d.ts.map +1 -1
  432. package/dist/lib/appearance-font-settings.js +15 -7
  433. package/dist/lib/appearance-font-settings.js.map +1 -1
  434. package/dist/lib/create-poll.d.ts +39 -0
  435. package/dist/lib/create-poll.d.ts.map +1 -0
  436. package/dist/lib/create-poll.js +116 -0
  437. package/dist/lib/create-poll.js.map +1 -0
  438. package/dist/lib/font-zoom.d.ts +1 -1
  439. package/dist/lib/font-zoom.js +1 -1
  440. package/dist/lib/font-zoom.js.map +1 -1
  441. package/dist/lib/keyed-rows.d.ts +2 -1
  442. package/dist/lib/keyed-rows.d.ts.map +1 -1
  443. package/dist/lib/keyed-rows.js +3 -2
  444. package/dist/lib/keyed-rows.js.map +1 -1
  445. package/dist/lib/overlay.d.ts +5 -5
  446. package/dist/lib/overlay.js +5 -5
  447. package/dist/lib/overlay.js.map +1 -1
  448. package/dist/lib/preference-store.d.ts +2 -2
  449. package/dist/lib/preference-store.js +2 -2
  450. package/dist/lib/preference-store.js.map +1 -1
  451. package/dist/lib/safe-script.d.ts +2 -2
  452. package/dist/lib/safe-script.js +2 -2
  453. package/dist/lib/safe-script.js.map +1 -1
  454. package/dist/lib/scroll-geometry.d.ts +1 -1
  455. package/dist/lib/scroll-geometry.js +1 -1
  456. package/dist/lib/scroll-geometry.js.map +1 -1
  457. package/dist/lib/text.d.ts +1 -1
  458. package/dist/lib/text.js +1 -1
  459. package/dist/lib/text.js.map +1 -1
  460. package/dist/lib/theme-accents.js +3 -3
  461. package/dist/lib/theme-accents.js.map +1 -1
  462. package/dist/lib/theme-css.js.map +1 -1
  463. package/dist/lib/theme-defaults.d.ts +4 -4
  464. package/dist/lib/theme-defaults.js +4 -4
  465. package/dist/lib/theme-defaults.js.map +1 -1
  466. package/dist/lib/theme-engine-light.js.map +1 -1
  467. package/dist/lib/theme-engine.d.ts +2 -2
  468. package/dist/lib/theme-engine.js +2 -2
  469. package/dist/lib/theme-engine.js.map +1 -1
  470. package/dist/lib/theme-projection.d.ts +1 -1
  471. package/dist/lib/theme-projection.js +2 -2
  472. package/dist/lib/theme-projection.js.map +1 -1
  473. package/dist/lib/theme-records.d.ts +2 -2
  474. package/dist/lib/theme-records.js +2 -2
  475. package/dist/lib/theme-records.js.map +1 -1
  476. package/dist/lib/theme-types.d.ts +1 -1
  477. package/dist/lib/theme-types.js.map +1 -1
  478. package/dist/lib/themes.d.ts +13 -13
  479. package/dist/lib/themes.js +13 -13
  480. package/dist/lib/themes.js.map +1 -1
  481. package/dist/lib/tokens.d.ts +2 -2
  482. package/dist/lib/tokens.js +1 -1
  483. package/dist/lib/tokens.js.map +1 -1
  484. package/dist/lib/tooltip-focus-gate.d.ts +2 -2
  485. package/dist/lib/tooltip-focus-gate.js +2 -2
  486. package/dist/lib/tooltip-focus-gate.js.map +1 -1
  487. package/dist/lib/utils.d.ts +1 -1
  488. package/dist/lib/utils.js +1 -1
  489. package/dist/lib/utils.js.map +1 -1
  490. package/dist/lib/variants.d.ts +4 -4
  491. package/dist/lib/variants.js +1 -1
  492. package/dist/lib/variants.js.map +1 -1
  493. package/dist/lib/version-notes.d.ts +4 -4
  494. package/dist/lib/version-notes.js +4 -4
  495. package/dist/lib/version-notes.js.map +1 -1
  496. package/dist/lint.js.map +1 -1
  497. package/dist/r/account-menu.json +1 -0
  498. package/dist/r/lib.json +5 -0
  499. package/dist/r/registry.json +11 -0
  500. package/dist/r/src/components/composites/account-menu/account-menu.tsx +22 -2
  501. package/dist/r/src/components/composites/action-button/action-button.tsx +124 -78
  502. package/dist/r/src/components/composites/appearance-editor/accent-swatch-groups.tsx +3 -3
  503. package/dist/r/src/components/composites/appearance-editor/appearance-choices.tsx +3 -3
  504. package/dist/r/src/components/composites/appearance-editor/appearance-editor.tsx +15 -9
  505. package/dist/r/src/components/composites/appearance-editor/appearance-rows.tsx +3 -1
  506. package/dist/r/src/components/composites/appearance-editor/appearance-types.ts +7 -7
  507. package/dist/r/src/components/composites/appearance-editor/theme-preview.tsx +1 -1
  508. package/dist/r/src/components/composites/catalog-browser/catalog-browser.tsx +6 -2
  509. package/dist/r/src/components/composites/catalog-browser/catalog-detail.tsx +15 -6
  510. package/dist/r/src/components/composites/chain-of-thought/chain-of-thought.tsx +4 -4
  511. package/dist/r/src/components/composites/chat/chat.tsx +15 -9
  512. package/dist/r/src/components/composites/checkpoint/checkpoint-model.ts +3 -3
  513. package/dist/r/src/components/composites/checkpoint/checkpoint.tsx +2 -2
  514. package/dist/r/src/components/composites/confirmation/confirmation.tsx +8 -4
  515. package/dist/r/src/components/composites/context/context.tsx +2 -2
  516. package/dist/r/src/components/composites/file-tree/build-file-tree.ts +1 -1
  517. package/dist/r/src/components/composites/file-tree/file-tree.tsx +16 -2
  518. package/dist/r/src/components/composites/icon-picker/icon-picker.tsx +1 -1
  519. package/dist/r/src/components/composites/inline-citation/citation.ts +1 -1
  520. package/dist/r/src/components/composites/inline-citation/inline-citation.tsx +2 -2
  521. package/dist/r/src/components/composites/list-row/list-row-control.tsx +31 -22
  522. package/dist/r/src/components/composites/list-row/list-row.tsx +69 -73
  523. package/dist/r/src/components/composites/message-scroller/message-scroller.tsx +1 -1
  524. package/dist/r/src/components/composites/model-selector/model-selector.tsx +4 -4
  525. package/dist/r/src/components/composites/model-selector/models.ts +2 -2
  526. package/dist/r/src/components/composites/plan/plan.tsx +19 -11
  527. package/dist/r/src/components/composites/queue/queue.tsx +5 -3
  528. package/dist/r/src/components/composites/reasoning/reasoning.tsx +4 -4
  529. package/dist/r/src/components/composites/settings/settings-navigation.tsx +57 -17
  530. package/dist/r/src/components/composites/settings/settings.tsx +14 -6
  531. package/dist/r/src/components/composites/sources/source.ts +1 -1
  532. package/dist/r/src/components/composites/sources/sources.tsx +2 -2
  533. package/dist/r/src/components/composites/stack-trace/parse-stack-trace.ts +7 -7
  534. package/dist/r/src/components/composites/stack-trace/stack-trace.tsx +3 -3
  535. package/dist/r/src/components/composites/stat/stat.tsx +20 -16
  536. package/dist/r/src/components/composites/subagent/subagent.tsx +6 -4
  537. package/dist/r/src/components/composites/task/task.tsx +1 -1
  538. package/dist/r/src/components/composites/terminal/ansi.ts +3 -3
  539. package/dist/r/src/components/composites/terminal/terminal-model.ts +3 -3
  540. package/dist/r/src/components/composites/terminal/terminal.tsx +24 -12
  541. package/dist/r/src/components/composites/test-results/test-results-model.ts +4 -4
  542. package/dist/r/src/components/composites/test-results/test-results.tsx +1 -1
  543. package/dist/r/src/components/composites/tool/tool.tsx +4 -4
  544. package/dist/r/src/components/composites/tree/tree.tsx +31 -15
  545. package/dist/r/src/components/composites/update-dialog/channel-control.tsx +17 -8
  546. package/dist/r/src/components/composites/update-dialog/index.ts +1 -0
  547. package/dist/r/src/components/composites/update-dialog/update-dialog.tsx +7 -7
  548. package/dist/r/src/components/composites/workspace-mark/workspace-mark.tsx +15 -12
  549. package/dist/r/src/components/conversation/busy-send-button.tsx +6 -2
  550. package/dist/r/src/components/conversation/composer-menu.tsx +3 -3
  551. package/dist/r/src/components/conversation/conversation-avatar.tsx +1 -1
  552. package/dist/r/src/components/conversation/conversation-pane.tsx +8 -5
  553. package/dist/r/src/components/conversation/conversation-surface.tsx +2 -2
  554. package/dist/r/src/components/conversation/internal/chat-composer-shell.tsx +18 -12
  555. package/dist/r/src/components/conversation/message-composer.tsx +4 -6
  556. package/dist/r/src/components/conversation/message-row.tsx +34 -26
  557. package/dist/r/src/components/conversation/scroll-follow-core.ts +8 -8
  558. package/dist/r/src/components/conversation/scroll-follow.ts +24 -8
  559. package/dist/r/src/components/conversation/thread-panel.tsx +7 -3
  560. package/dist/r/src/components/conversation/transcript-composition.tsx +4 -2
  561. package/dist/r/src/components/layout/app-shell/app-shell.tsx +1 -1
  562. package/dist/r/src/components/layout/app-shell/skip-link.tsx +3 -2
  563. package/dist/r/src/components/layout/page/page.tsx +15 -11
  564. package/dist/r/src/components/layout/panel/panel.tsx +1 -1
  565. package/dist/r/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +21 -1
  566. package/dist/r/src/components/layout/side-rail/side-rail-context.ts +1 -1
  567. package/dist/r/src/components/layout/side-rail/side-rail.tsx +38 -22
  568. package/dist/r/src/components/layout/sidebar-nav/sidebar-nav.tsx +22 -16
  569. package/dist/r/src/components/layout/split-layout/resize-controller-core-retry.tsx +25 -7
  570. package/dist/r/src/components/layout/split-layout/resize-controller-core.tsx +25 -7
  571. package/dist/r/src/components/layout/split-layout/split-layout.tsx +6 -2
  572. package/dist/r/src/components/layout/status-bar/status-bar.tsx +1 -1
  573. package/dist/r/src/components/layout/top-bar/top-bar.tsx +8 -6
  574. package/dist/r/src/components/motion/presence.tsx +2 -2
  575. package/dist/r/src/components/theme/appearance-panel.tsx +5 -5
  576. package/dist/r/src/components/theme/lazy.ts +1 -1
  577. package/dist/r/src/components/theme/theme-catalogue-source.ts +2 -2
  578. package/dist/r/src/components/theme/theme-context.ts +3 -3
  579. package/dist/r/src/components/theme/theme-document.ts +22 -11
  580. package/dist/r/src/components/theme/theme-picker.tsx +5 -5
  581. package/dist/r/src/components/theme/theme-provider-value.ts +15 -3
  582. package/dist/r/src/components/theme/theme-script.ts +20 -0
  583. package/dist/r/src/components/theme/theme-state.ts +7 -7
  584. package/dist/r/src/components/theme/theme-toggle.tsx +1 -1
  585. package/dist/r/src/components/ui/alert/alert.tsx +4 -3
  586. package/dist/r/src/components/ui/alert-dialog/alert-dialog.tsx +4 -4
  587. package/dist/r/src/components/ui/badge/badge.tsx +2 -2
  588. package/dist/r/src/components/ui/board/board.tsx +17 -5
  589. package/dist/r/src/components/ui/bubble/bubble.tsx +6 -4
  590. package/dist/r/src/components/ui/button/button.tsx +2 -2
  591. package/dist/r/src/components/ui/button-group/button-group.tsx +1 -1
  592. package/dist/r/src/components/ui/calendar/calendar.tsx +2 -2
  593. package/dist/r/src/components/ui/callout/callout.tsx +4 -4
  594. package/dist/r/src/components/ui/card/card.tsx +2 -2
  595. package/dist/r/src/components/ui/carousel/carousel.tsx +6 -6
  596. package/dist/r/src/components/ui/chart/chart-options.ts +9 -9
  597. package/dist/r/src/components/ui/chart/chart.tsx +14 -1
  598. package/dist/r/src/components/ui/checkbox/checkbox.tsx +9 -6
  599. package/dist/r/src/components/ui/code-block/code-block.tsx +14 -7
  600. package/dist/r/src/components/ui/command/command.tsx +7 -7
  601. package/dist/r/src/components/ui/context-menu/context-menu.tsx +1 -1
  602. package/dist/r/src/components/ui/detail-panel/detail-panel.tsx +5 -3
  603. package/dist/r/src/components/ui/dialog/dialog-layer.tsx +27 -1
  604. package/dist/r/src/components/ui/dialog/dialog.tsx +4 -3
  605. package/dist/r/src/components/ui/diff-block/diff-block.tsx +6 -6
  606. package/dist/r/src/components/ui/drawer/drawer.tsx +3 -3
  607. package/dist/r/src/components/ui/dropdown-menu/dropdown-menu.tsx +6 -6
  608. package/dist/r/src/components/ui/dropdown-menu/menu-parts.tsx +5 -5
  609. package/dist/r/src/components/ui/empty/empty-state.tsx +23 -18
  610. package/dist/r/src/components/ui/empty/empty.tsx +1 -1
  611. package/dist/r/src/components/ui/entity-icon/entity-icon.tsx +5 -1
  612. package/dist/r/src/components/ui/field/field.tsx +15 -7
  613. package/dist/r/src/components/ui/field/number-field.tsx +1 -1
  614. package/dist/r/src/components/ui/hover-card/hover-card.tsx +1 -1
  615. package/dist/r/src/components/ui/input-group/input-group.tsx +1 -1
  616. package/dist/r/src/components/ui/input-otp/input-otp.tsx +1 -1
  617. package/dist/r/src/components/ui/item/item.tsx +24 -18
  618. package/dist/r/src/components/ui/kbd/kbd.tsx +2 -2
  619. package/dist/r/src/components/ui/kbd/platform-modifier.ts +3 -3
  620. package/dist/r/src/components/ui/label/label.tsx +1 -1
  621. package/dist/r/src/components/ui/marker/marker.tsx +9 -5
  622. package/dist/r/src/components/ui/menubar/menubar.tsx +2 -2
  623. package/dist/r/src/components/ui/message/message.tsx +14 -13
  624. package/dist/r/src/components/ui/modal-dialog/modal-dialog.tsx +9 -5
  625. package/dist/r/src/components/ui/native-select/native-select.tsx +1 -1
  626. package/dist/r/src/components/ui/navigation-menu/navigation-menu.tsx +5 -4
  627. package/dist/r/src/components/ui/pagination/pagination.tsx +1 -1
  628. package/dist/r/src/components/ui/popover/popover.tsx +4 -2
  629. package/dist/r/src/components/ui/progress/progress.tsx +5 -3
  630. package/dist/r/src/components/ui/questionnaire/questionnaire.tsx +10 -5
  631. package/dist/r/src/components/ui/radio-group/radio-group.tsx +9 -6
  632. package/dist/r/src/components/ui/resizable/resizable.tsx +5 -5
  633. package/dist/r/src/components/ui/select/select.tsx +4 -4
  634. package/dist/r/src/components/ui/sheet/sheet.tsx +4 -3
  635. package/dist/r/src/components/ui/skeleton/skeleton.tsx +1 -1
  636. package/dist/r/src/components/ui/slider/slider.tsx +1 -1
  637. package/dist/r/src/components/ui/spinner/spinner.tsx +1 -1
  638. package/dist/r/src/components/ui/status-chip/status-chip.tsx +13 -13
  639. package/dist/r/src/components/ui/switch/switch.tsx +9 -6
  640. package/dist/r/src/components/ui/tabs/tabs.tsx +4 -4
  641. package/dist/r/src/components/ui/textarea/textarea.tsx +1 -1
  642. package/dist/r/src/components/ui/toast/toast.tsx +6 -4
  643. package/dist/r/src/components/ui/toggle/toggle.tsx +1 -1
  644. package/dist/r/src/components/ui/tooltip/deferred-tooltip.tsx +131 -0
  645. package/dist/r/src/components/ui/tooltip/index.ts +1 -0
  646. package/dist/r/src/components/ui/tooltip/tooltip.tsx +6 -4
  647. package/dist/r/src/components/ui/trace/trace.tsx +13 -9
  648. package/dist/r/src/components/ui/typography/typography.tsx +5 -5
  649. package/dist/r/src/lib/accent-presets.ts +1 -1
  650. package/dist/r/src/lib/accent-roles.ts +2 -2
  651. package/dist/r/src/lib/appearance-font-settings.ts +18 -7
  652. package/dist/r/src/lib/create-poll.ts +150 -0
  653. package/dist/r/src/lib/font-zoom.ts +3 -3
  654. package/dist/r/src/lib/keyed-rows.ts +3 -2
  655. package/dist/r/src/lib/overlay.ts +5 -5
  656. package/dist/r/src/lib/preference-store.ts +2 -2
  657. package/dist/r/src/lib/safe-script.ts +2 -2
  658. package/dist/r/src/lib/scroll-geometry.ts +1 -1
  659. package/dist/r/src/lib/text.ts +1 -1
  660. package/dist/r/src/lib/theme-accents.ts +3 -3
  661. package/dist/r/src/lib/theme-css.ts +2 -2
  662. package/dist/r/src/lib/theme-defaults.ts +4 -4
  663. package/dist/r/src/lib/theme-engine-light.ts +2 -2
  664. package/dist/r/src/lib/theme-engine.ts +2 -2
  665. package/dist/r/src/lib/theme-projection.ts +2 -2
  666. package/dist/r/src/lib/theme-records.ts +2 -2
  667. package/dist/r/src/lib/theme-types.ts +1 -1
  668. package/dist/r/src/lib/themes.ts +14 -14
  669. package/dist/r/src/lib/tokens.ts +2 -2
  670. package/dist/r/src/lib/tooltip-focus-gate.ts +11 -11
  671. package/dist/r/src/lib/utils.ts +1 -1
  672. package/dist/r/src/lib/variants.ts +4 -4
  673. package/dist/r/src/lib/version-notes.ts +4 -4
  674. package/dist/r/src/styles/base.css +12 -43
  675. package/dist/r/src/styles/fonts.css +1 -1
  676. package/dist/r/src/styles/theme.css +35 -35
  677. package/dist/r/tooltip.json +5 -0
  678. package/package.json +2 -1
  679. package/registry.json +11 -0
  680. package/src/components/composites/account-menu/account-menu.tsx +22 -2
  681. package/src/components/composites/action-button/action-button.tsx +124 -78
  682. package/src/components/composites/appearance-editor/accent-swatch-groups.tsx +3 -3
  683. package/src/components/composites/appearance-editor/appearance-choices.tsx +3 -3
  684. package/src/components/composites/appearance-editor/appearance-editor.tsx +15 -9
  685. package/src/components/composites/appearance-editor/appearance-rows.tsx +3 -1
  686. package/src/components/composites/appearance-editor/appearance-types.ts +7 -7
  687. package/src/components/composites/appearance-editor/theme-preview.tsx +1 -1
  688. package/src/components/composites/catalog-browser/catalog-browser.tsx +6 -2
  689. package/src/components/composites/catalog-browser/catalog-detail.tsx +15 -6
  690. package/src/components/composites/chain-of-thought/chain-of-thought.tsx +4 -4
  691. package/src/components/composites/chat/chat.tsx +15 -9
  692. package/src/components/composites/checkpoint/checkpoint-model.ts +3 -3
  693. package/src/components/composites/checkpoint/checkpoint.tsx +2 -2
  694. package/src/components/composites/confirmation/confirmation.tsx +8 -4
  695. package/src/components/composites/context/context.tsx +2 -2
  696. package/src/components/composites/file-tree/build-file-tree.ts +1 -1
  697. package/src/components/composites/file-tree/file-tree.tsx +16 -2
  698. package/src/components/composites/icon-picker/icon-picker.tsx +1 -1
  699. package/src/components/composites/inline-citation/citation.ts +1 -1
  700. package/src/components/composites/inline-citation/inline-citation.tsx +2 -2
  701. package/src/components/composites/list-row/list-row-control.tsx +31 -22
  702. package/src/components/composites/list-row/list-row.tsx +69 -73
  703. package/src/components/composites/message-scroller/message-scroller.tsx +1 -1
  704. package/src/components/composites/model-selector/model-selector.tsx +4 -4
  705. package/src/components/composites/model-selector/models.ts +2 -2
  706. package/src/components/composites/plan/plan.tsx +19 -11
  707. package/src/components/composites/queue/queue.tsx +5 -3
  708. package/src/components/composites/reasoning/reasoning.tsx +4 -4
  709. package/src/components/composites/settings/settings-navigation.tsx +57 -17
  710. package/src/components/composites/settings/settings.tsx +14 -6
  711. package/src/components/composites/sources/source.ts +1 -1
  712. package/src/components/composites/sources/sources.tsx +2 -2
  713. package/src/components/composites/stack-trace/parse-stack-trace.ts +7 -7
  714. package/src/components/composites/stack-trace/stack-trace.tsx +3 -3
  715. package/src/components/composites/stat/stat.tsx +20 -16
  716. package/src/components/composites/subagent/subagent.tsx +6 -4
  717. package/src/components/composites/task/task.tsx +1 -1
  718. package/src/components/composites/terminal/ansi.ts +3 -3
  719. package/src/components/composites/terminal/terminal-model.ts +3 -3
  720. package/src/components/composites/terminal/terminal.tsx +24 -12
  721. package/src/components/composites/test-results/test-results-model.ts +4 -4
  722. package/src/components/composites/test-results/test-results.tsx +1 -1
  723. package/src/components/composites/tool/tool.tsx +4 -4
  724. package/src/components/composites/tree/tree.tsx +31 -15
  725. package/src/components/composites/update-dialog/channel-control.tsx +17 -8
  726. package/src/components/composites/update-dialog/index.ts +1 -0
  727. package/src/components/composites/update-dialog/update-dialog.tsx +7 -7
  728. package/src/components/composites/workspace-mark/workspace-mark.tsx +15 -12
  729. package/src/components/conversation/busy-send-button.tsx +6 -2
  730. package/src/components/conversation/composer-menu.tsx +3 -3
  731. package/src/components/conversation/conversation-avatar.tsx +1 -1
  732. package/src/components/conversation/conversation-pane.tsx +8 -5
  733. package/src/components/conversation/conversation-surface.tsx +2 -2
  734. package/src/components/conversation/internal/chat-composer-shell.tsx +18 -12
  735. package/src/components/conversation/message-composer.tsx +4 -6
  736. package/src/components/conversation/message-row.tsx +34 -26
  737. package/src/components/conversation/scroll-follow-core.ts +8 -8
  738. package/src/components/conversation/scroll-follow.ts +24 -8
  739. package/src/components/conversation/thread-panel.tsx +7 -3
  740. package/src/components/conversation/transcript-composition.tsx +4 -2
  741. package/src/components/layout/app-shell/app-shell.tsx +1 -1
  742. package/src/components/layout/app-shell/skip-link.tsx +3 -2
  743. package/src/components/layout/page/page.tsx +15 -11
  744. package/src/components/layout/panel/panel.tsx +1 -1
  745. package/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +21 -1
  746. package/src/components/layout/side-rail/side-rail-context.ts +1 -1
  747. package/src/components/layout/side-rail/side-rail.tsx +38 -22
  748. package/src/components/layout/sidebar-nav/sidebar-nav.tsx +22 -16
  749. package/src/components/layout/split-layout/resize-controller-core-retry.tsx +25 -7
  750. package/src/components/layout/split-layout/resize-controller-core.tsx +25 -7
  751. package/src/components/layout/split-layout/split-layout.tsx +6 -2
  752. package/src/components/layout/status-bar/status-bar.tsx +1 -1
  753. package/src/components/layout/top-bar/top-bar.tsx +8 -6
  754. package/src/components/motion/presence.tsx +2 -2
  755. package/src/components/theme/appearance-panel.tsx +5 -5
  756. package/src/components/theme/lazy.ts +1 -1
  757. package/src/components/theme/theme-catalogue-source.ts +2 -2
  758. package/src/components/theme/theme-context.ts +3 -3
  759. package/src/components/theme/theme-document.ts +22 -11
  760. package/src/components/theme/theme-picker.tsx +5 -5
  761. package/src/components/theme/theme-provider-value.ts +15 -3
  762. package/src/components/theme/theme-script.ts +20 -0
  763. package/src/components/theme/theme-state.ts +7 -7
  764. package/src/components/theme/theme-toggle.tsx +1 -1
  765. package/src/components/ui/alert/alert.tsx +4 -3
  766. package/src/components/ui/alert-dialog/alert-dialog.tsx +4 -4
  767. package/src/components/ui/badge/badge.tsx +2 -2
  768. package/src/components/ui/board/board.tsx +17 -5
  769. package/src/components/ui/bubble/bubble.tsx +6 -4
  770. package/src/components/ui/button/button.tsx +2 -2
  771. package/src/components/ui/button-group/button-group.tsx +1 -1
  772. package/src/components/ui/calendar/calendar.tsx +2 -2
  773. package/src/components/ui/callout/callout.tsx +4 -4
  774. package/src/components/ui/card/card.tsx +2 -2
  775. package/src/components/ui/carousel/carousel.tsx +6 -6
  776. package/src/components/ui/chart/chart-options.ts +9 -9
  777. package/src/components/ui/chart/chart.tsx +14 -1
  778. package/src/components/ui/checkbox/checkbox.tsx +9 -6
  779. package/src/components/ui/code-block/code-block.tsx +14 -7
  780. package/src/components/ui/command/command.tsx +7 -7
  781. package/src/components/ui/context-menu/context-menu.tsx +1 -1
  782. package/src/components/ui/detail-panel/detail-panel.tsx +5 -3
  783. package/src/components/ui/dialog/dialog-layer.tsx +27 -1
  784. package/src/components/ui/dialog/dialog.tsx +4 -3
  785. package/src/components/ui/diff-block/diff-block.tsx +6 -6
  786. package/src/components/ui/drawer/drawer.tsx +3 -3
  787. package/src/components/ui/dropdown-menu/dropdown-menu.tsx +6 -6
  788. package/src/components/ui/dropdown-menu/menu-parts.tsx +5 -5
  789. package/src/components/ui/empty/empty-state.tsx +23 -18
  790. package/src/components/ui/empty/empty.tsx +1 -1
  791. package/src/components/ui/entity-icon/entity-icon.tsx +5 -1
  792. package/src/components/ui/field/field.tsx +15 -7
  793. package/src/components/ui/field/number-field.tsx +1 -1
  794. package/src/components/ui/hover-card/hover-card.tsx +1 -1
  795. package/src/components/ui/input-group/input-group.tsx +1 -1
  796. package/src/components/ui/input-otp/input-otp.tsx +1 -1
  797. package/src/components/ui/item/item.tsx +24 -18
  798. package/src/components/ui/kbd/kbd.tsx +2 -2
  799. package/src/components/ui/kbd/platform-modifier.ts +3 -3
  800. package/src/components/ui/label/label.tsx +1 -1
  801. package/src/components/ui/marker/marker.tsx +9 -5
  802. package/src/components/ui/menubar/menubar.tsx +2 -2
  803. package/src/components/ui/message/message.tsx +14 -13
  804. package/src/components/ui/modal-dialog/modal-dialog.tsx +9 -5
  805. package/src/components/ui/native-select/native-select.tsx +1 -1
  806. package/src/components/ui/navigation-menu/navigation-menu.tsx +5 -4
  807. package/src/components/ui/pagination/pagination.tsx +1 -1
  808. package/src/components/ui/popover/popover.tsx +4 -2
  809. package/src/components/ui/progress/progress.tsx +5 -3
  810. package/src/components/ui/questionnaire/questionnaire.tsx +10 -5
  811. package/src/components/ui/radio-group/radio-group.tsx +9 -6
  812. package/src/components/ui/resizable/resizable.tsx +5 -5
  813. package/src/components/ui/select/select.tsx +4 -4
  814. package/src/components/ui/sheet/sheet.tsx +4 -3
  815. package/src/components/ui/skeleton/skeleton.tsx +1 -1
  816. package/src/components/ui/slider/slider.tsx +1 -1
  817. package/src/components/ui/spinner/spinner.tsx +1 -1
  818. package/src/components/ui/status-chip/status-chip.tsx +13 -13
  819. package/src/components/ui/switch/switch.tsx +9 -6
  820. package/src/components/ui/tabs/tabs.tsx +4 -4
  821. package/src/components/ui/textarea/textarea.tsx +1 -1
  822. package/src/components/ui/toast/toast.tsx +6 -4
  823. package/src/components/ui/toggle/toggle.tsx +1 -1
  824. package/src/components/ui/tooltip/deferred-tooltip.tsx +131 -0
  825. package/src/components/ui/tooltip/index.ts +1 -0
  826. package/src/components/ui/tooltip/tooltip.tsx +6 -4
  827. package/src/components/ui/trace/trace.tsx +13 -9
  828. package/src/components/ui/typography/typography.tsx +5 -5
  829. package/src/index.ts +1 -0
  830. package/src/lib/accent-presets.ts +1 -1
  831. package/src/lib/accent-roles.ts +2 -2
  832. package/src/lib/appearance-font-settings.ts +18 -7
  833. package/src/lib/create-poll.ts +150 -0
  834. package/src/lib/font-zoom.ts +3 -3
  835. package/src/lib/keyed-rows.ts +3 -2
  836. package/src/lib/overlay.ts +5 -5
  837. package/src/lib/preference-store.ts +2 -2
  838. package/src/lib/safe-script.ts +2 -2
  839. package/src/lib/scroll-geometry.ts +1 -1
  840. package/src/lib/text.ts +1 -1
  841. package/src/lib/theme-accents.ts +3 -3
  842. package/src/lib/theme-css.ts +2 -2
  843. package/src/lib/theme-defaults.ts +4 -4
  844. package/src/lib/theme-engine-light.ts +2 -2
  845. package/src/lib/theme-engine.ts +2 -2
  846. package/src/lib/theme-projection.ts +2 -2
  847. package/src/lib/theme-records.ts +2 -2
  848. package/src/lib/theme-types.ts +1 -1
  849. package/src/lib/themes.ts +14 -14
  850. package/src/lib/tokens.ts +2 -2
  851. package/src/lib/tooltip-focus-gate.ts +11 -11
  852. package/src/lib/utils.ts +1 -1
  853. package/src/lib/variants.ts +4 -4
  854. package/src/lib/version-notes.ts +4 -4
  855. package/src/lint/index.ts +1 -1
  856. package/src/styles/base.css +12 -43
  857. package/src/styles/fonts.css +1 -1
  858. package/src/styles/theme.css +35 -35
  859. package/src/styles/themes/aardvark-blue.css +98 -0
  860. package/src/styles/themes/aardvark-ink.css +98 -0
  861. package/src/styles/themes/adea-dark-colorblind.css +98 -0
  862. package/src/styles/themes/adea-dark-high-contrast.css +98 -0
  863. package/src/styles/themes/adea-dark.css +47 -0
  864. package/src/styles/themes/adea-light-colorblind.css +141 -0
  865. package/src/styles/themes/adea-light-high-contrast.css +141 -0
  866. package/src/styles/themes/adea-light.css +47 -0
  867. package/src/styles/themes/ayu-light.css +141 -0
  868. package/src/styles/themes/ayu-mirage.css +98 -0
  869. package/src/styles/themes/ayu.css +98 -0
  870. package/src/styles/themes/catppuccin-frappe.css +98 -0
  871. package/src/styles/themes/catppuccin-latte.css +141 -0
  872. package/src/styles/themes/catppuccin-macchiato.css +98 -0
  873. package/src/styles/themes/catppuccin-mocha.css +98 -0
  874. package/src/styles/themes/dracula.css +98 -0
  875. package/src/styles/themes/everforest-dark.css +98 -0
  876. package/src/styles/themes/everforest-light.css +141 -0
  877. package/src/styles/themes/gruvbox-dark.css +98 -0
  878. package/src/styles/themes/gruvbox-light.css +141 -0
  879. package/src/styles/themes/kanagawa.css +98 -0
  880. package/src/styles/themes/monokai.css +98 -0
  881. package/src/styles/themes/nord-light.css +141 -0
  882. package/src/styles/themes/nord.css +98 -0
  883. package/src/styles/themes/one-dark.css +98 -0
  884. package/src/styles/themes/rosepine-dawn.css +141 -0
  885. package/src/styles/themes/rosepine-moon.css +98 -0
  886. package/src/styles/themes/rosepine.css +98 -0
  887. package/src/styles/themes/solarized-dark.css +98 -0
  888. package/src/styles/themes/solarized-light.css +141 -0
  889. package/src/styles/themes/tokyonight-day.css +141 -0
  890. package/src/styles/themes/tokyonight-night.css +98 -0
  891. package/src/styles/themes/tokyonight-storm.css +98 -0
  892. package/src/styles/themes/vesper.css +98 -0
@@ -1 +1 @@
1
- {"version":3,"file":"theme-script.js","names":["literal"],"sources":["../../../src/components/theme/theme-script.ts"],"sourcesContent":["/*\n * Copyright (c) 2026 Wing\n * Licensed under the MIT License.\n *\n * The options form is rewritten from Adea's accepted port of Zeron's preference\n * store (`appearanceThemeScript` in `packages/ui/src/components/appearance.ts`,\n * https://github.com/zeronsh/zeron) so the boot script reads the document the shared\n * persistence writes. See NOTICE.\n */\nimport { fontSettingsBootstrapScript } from '#lib/appearance-font-settings'\nimport { CUSTOM_ACCENT_PATTERN, isCustomAccent } from '#lib/accent-roles'\nimport { accents } from '#lib/accent-presets'\nimport { safeScriptStringLiteral as literal } from '#lib/safe-script'\nimport { THEME_ACCENT_PREFIX } from '#lib/theme-accents'\nimport { DEFAULT_THEME_STORAGE_KEY, THEME_INDEX, defaultThemeIdFor } from '#lib/theme-defaults'\nimport {\n REDUCED_TRANSPARENCY_QUERY,\n resolveSurface,\n surfaceAlpha,\n themeSurfaces,\n type SurfaceEnvironment,\n} from '#lib/theme-surface'\nimport type { ThemeTokenProjection } from '@adea-ai/themes/theme-token-projection'\nimport type { ThemeStorageSchema } from './theme-persistence'\n\nexport { safeScriptStringLiteral as inlineScriptLiteral } from '#lib/safe-script'\n\n/** A stored-record path that can supply an absent projection source token. */\nexport type ThemeTokenProjectionFallback = Readonly<{\n /** The CSS custom property to fill only when the stored token map omits it. */\n token: string\n /** Own-property path from the stored library record to a string value. */\n path: readonly string[]\n}>\n\n/**\n * Options for the host-shaped no-flash script: the document's {@link ThemeStorageSchema}\n * plus what the script paints from it.\n */\nexport type ThemeScriptOptions = ThemeStorageSchema & {\n /**\n * The accent painted when the document has none, an unrecognised one, or the\n * legacy `theme` spelling — the host's default (adea: `violet`). Without it those\n * cases paint no `data-accent`, which is what the provider writes for `theme`.\n * Setting it means the `[data-accent]` block of the default preset paints on the\n * first frame instead of after hydration.\n */\n defaultAccent?: string\n /**\n * Also resolve the surface axis (`data-surface`, `data-reduce-transparency`,\n * `--surface-alpha`) from the document and the operating system's Reduce\n * Transparency setting. A `translucent` preference resolves to `frosted`: the\n * host's translucency capability is not known until the provider mounts, and the\n * provider re-resolves it then. Match the provider's `surface` prop.\n */\n surface?: boolean\n /**\n * Accepted so a host can pass the provider's `palette` prop through; the script is\n * the same either way. A catalogue variant's palette is the host stylesheet's job\n * (`stylesheet`) or the provider's, at mount (`inline`), and a stored theme's own\n * tokens are written inline in both.\n */\n palette?: 'inline' | 'stylesheet'\n /** The only `version` of the library document read. Default `1`. */\n libraryVersion?: number\n}\n\n/**\n * The no-flash script.\n *\n * Rendered inline in `<head>` before any stylesheet that matters. Without it a dark\n * preference paints the light theme first and then swaps, which is the flash every\n * themed application has to solve and the one thing a provider cannot do from\n * inside the body.\n *\n * ## The string form\n *\n * `themeScript('key')` serves a provider that stores an unversioned\n * `localStorage[key]` document. Deliberately tiny and dependency-free: it reads the\n * stored preference, resolves `system`, and sets the class. It does not apply the\n * variant's roles — the default theme in `theme.css` covers the first paint, and the\n * provider writes the rest on mount. Its output is a compatibility surface (a\n * consumer may have it in a snapshot), so it does not change.\n *\n * ## The options form\n *\n * `themeScript({ key, ... })` serves a host with a versioned document (see\n * `createVersionedPersistence`) and writes what the provider will write, so mounting\n * repaints nothing:\n *\n * - `class=\"dark\"`, `color-scheme`, `data-theme`, `data-appearance` and, for a\n * compact document, `data-density`;\n * - `data-accent`: a preset id as stored, `custom` for a `#rrggbb` (never the hex\n * itself, which is the worst possible attribute content), `defaultAccent` when the\n * document has none, nothing for a theme-derived `ansi-*` accent (it has no\n * stylesheet block; the provider paints it inline);\n * - the theme: the stored id when the catalogue or the stored library holds it, else\n * the default of the resolved appearance, exactly as the provider resolves it. A\n * library theme's own tokens are written inline, so an imported theme paints on the\n * first frame;\n * - the surface axis, when `surface` is set;\n * - the font settings, guarded to the document's `version`.\n *\n * The document's `version`, when the schema names one, must match exactly. The legacy\n * key is read only while the main key is absent: an unreadable main document is not\n * \"no preference\", so it does not resurrect an older value.\n *\n * The script reads values out of `localStorage` and writes them to `dataset` and\n * `style`, which are *property* assignments rather than code: a stored id, accent or\n * token can set an attribute and cannot execute. The values that reach the source as\n * text (keys, ids, the default accent) go through `inlineScriptLiteral`\n * (`safeScriptStringLiteral`) for the reason documented there.\n *\n * The script cannot import the policy it applies, so it carries the policy's tables\n * instead: the catalogue ids, the default pair, the preset ids, the custom-accent\n * grammar, the theme-accent prefix and the surface outcomes, all read from the modules\n * the provider uses.\n */\nexport function themeScript(storageKey?: string): string\nexport function themeScript(options: ThemeScriptOptions): string\nexport function themeScript(\n input: string | ThemeScriptOptions = DEFAULT_THEME_STORAGE_KEY\n): string {\n if (typeof input === 'string') return stringFormScript(input)\n return optionsFormScript(input)\n}\n\n/** Internal hook for the opt-in script entry, which supplies its generated browser bundle. */\nexport function themeScriptWithProjection(\n options: ThemeScriptOptions & {\n tokenProjectionFallbacks?: readonly ThemeTokenProjectionFallback[]\n },\n tokenProjection: ThemeTokenProjection,\n projectionBundle: string,\n projectionFallbackScript: string\n): string {\n return optionsFormScript(\n options,\n tokenProjection,\n projectionBundle,\n projectionFallbackScript,\n options.tokenProjectionFallbacks\n )\n}\n\nfunction stringFormScript(storageKey: string): string {\n const script = `(function(){try{var s=localStorage.getItem(${literal(storageKey)});var p=s?JSON.parse(s):{};var a=p.appearance||'system';var d=a==='dark'||(a==='system'&&window.matchMedia('(prefers-color-scheme: dark)').matches);var r=document.documentElement;if(d)r.classList.add('dark');r.style.colorScheme=d?'dark':'light';if(p.accent&&p.accent!=='theme')r.dataset.accent=p.accent;if(p.density==='compact')r.dataset.density='compact';}catch(e){}})();`\n return `${script}${fontSettingsBootstrapScript(storageKey)}`\n}\n\n/** What the surface axis paints before the provider knows the host's capability. */\nfunction bootSurfaces(): { preferred: Record<string, string>; reduced: string } {\n const environment: SurfaceEnvironment = {\n osReducedTransparency: false,\n userReducedTransparency: false,\n nativeTranslucency: false,\n }\n return {\n preferred: Object.fromEntries(\n themeSurfaces.map((surface) => [surface, resolveSurface(surface, environment)])\n ),\n reduced: resolveSurface('opaque', { ...environment, osReducedTransparency: true }),\n }\n}\n\nfunction optionsFormScript(\n options: ThemeScriptOptions,\n projection?: ThemeTokenProjection,\n projectionBundle?: string,\n projectionFallbackScript = '',\n projectionFallbacks?: readonly ThemeTokenProjectionFallback[]\n): string {\n const field = options.appearanceField ?? 'appearance'\n const versionGuard =\n options.version === undefined ? '' : `&&x.version===${Number(options.version)}`\n const presets = accents.map((preset) => literal(preset.id))\n const defaultAccent =\n options.defaultAccent === undefined\n ? ''\n : isCustomAccent(options.defaultAccent)\n ? 'custom'\n : options.defaultAccent\n const canProjectTokens =\n options.libraryKey !== undefined &&\n projection &&\n projection.length > 0 &&\n projectionBundle !== undefined\n const hasProjectionFallbacks = canProjectTokens && !!projectionFallbacks?.length\n const tokenProjection = canProjectTokens\n ? `var projectTokens=${projectionBundle};var tokenProjection=JSON.parse(${literal(JSON.stringify(projection))});${\n hasProjectionFallbacks\n ? `var tokenProjectionFallbacks=JSON.parse(${literal(JSON.stringify(projectionFallbacks))});`\n : ''\n }`\n : ''\n const projectionFallbackCode = hasProjectionFallbacks ? projectionFallbackScript : ''\n\n const parts: string[] = []\n parts.push(\n `(function(){try{`,\n `var r=document.documentElement,s=r.style;`,\n `var q=function(m){try{return window.matchMedia(m).matches}catch(e){return false}};`,\n `var get=function(k){try{return localStorage.getItem(k)}catch(e){return null}};`,\n // The main document. `raw !== null` rather than truthiness: an empty string is a\n // stored (corrupt) value, so it does not fall through to the legacy key.\n `var raw=get(${literal(options.key)}),doc=null,legacy=null;`,\n `if(raw!==null){try{var x=JSON.parse(raw);if(x&&typeof x==='object'&&!Array.isArray(x)${versionGuard})doc=x}catch(e){}}`\n )\n if (options.legacyAppearanceKey !== undefined) {\n parts.push(`else legacy=get(${literal(options.legacyAppearanceKey)});`)\n }\n parts.push(\n `var m=doc?doc[${literal(field)}]:legacy;`,\n `var mode=m==='light'||m==='dark'?m:'system';`,\n `var dark=mode==='dark'||(mode==='system'&&q('(prefers-color-scheme: dark)'));`,\n `var fallback=dark?${literal(defaultThemeIdFor('dark'))}:${literal(defaultThemeIdFor('light'))};`,\n `var want=doc?(dark?doc.darkThemeId:doc.lightThemeId):null;`,\n `if(typeof want!=='string')want=fallback;`,\n `var ids=[${THEME_INDEX.map(([id]) => literal(id)).join(',')}];`,\n `var id=ids.indexOf(want)!==-1?want:null,tokens=null${hasProjectionFallbacks ? ',storedTheme=null' : ''};`\n )\n if (options.libraryKey !== undefined) {\n parts.push(\n `if(id===null){try{var lib=JSON.parse(get(${literal(options.libraryKey)})||'null');`,\n `if(lib&&typeof lib==='object'&&lib.version===${Number(options.libraryVersion ?? 1)}&&Array.isArray(lib.themes)){`,\n `for(var i=0;i!==lib.themes.length;i++){var t=lib.themes[i];`,\n `if(t&&t.id===want&&t.flatTokens&&typeof t.flatTokens==='object'){id=want;tokens=t.flatTokens;${hasProjectionFallbacks ? 'storedTheme=t;' : ''}break}}}}catch(e){}}`\n )\n }\n if (options.libraryKey !== undefined && tokenProjection) parts.push(tokenProjection)\n parts.push(\n `if(id===null)id=fallback;`,\n `r.classList.toggle('dark',dark);`,\n `s.colorScheme=dark?'dark':'light';`,\n `r.dataset.theme=id;`,\n `r.dataset.appearance=dark?'dark':'light';`\n )\n if (options.libraryKey !== undefined) {\n parts.push(\n `if(tokens){if(typeof projectTokens==='function'){${projectionFallbackCode}tokens=projectTokens(tokens,tokenProjection)}for(var n in tokens){if(Object.prototype.hasOwnProperty.call(tokens,n)&&n.slice(0,2)==='--'&&typeof tokens[n]==='string')s.setProperty(n,tokens[n])}}`\n )\n }\n parts.push(\n `var a=doc&&typeof doc.accent==='string'?doc.accent:'';`,\n `var accent=[${presets.join(',')}].indexOf(a)!==-1?a:${CUSTOM_ACCENT_PATTERN}.test(a)?'custom':a.slice(0,${THEME_ACCENT_PREFIX.length})===${literal(THEME_ACCENT_PREFIX)}?'':${literal(defaultAccent)};`,\n `if(accent)r.dataset.accent=accent;`,\n `if(doc&&doc.density==='compact')r.dataset.density='compact';`\n )\n if (options.surface) {\n const surfaces = bootSurfaces()\n parts.push(\n `var reduce=q(${literal(REDUCED_TRANSPARENCY_QUERY)})||!!(doc&&doc.reduceTransparency===true);`,\n `var surfaces=${JSON.stringify(surfaces.preferred)};`,\n `var surface=reduce?${literal(surfaces.reduced)}:doc&&typeof doc.surface==='string'&&Object.prototype.hasOwnProperty.call(surfaces,doc.surface)?surfaces[doc.surface]:surfaces.opaque;`,\n `r.dataset.surface=surface;`,\n `r.dataset.reduceTransparency=reduce?'true':'false';`,\n `s.setProperty('--surface-alpha',${JSON.stringify(surfaceAlpha)}[surface]);`\n )\n }\n parts.push(`}catch(e){}})();`)\n\n return `${parts.join('')}${fontSettingsBootstrapScript(options.key, options.version)}`\n}\n"],"mappings":";;;;;;;;;AAwHA,SAAgB,YACd,QAAqC,2BAC7B;CACR,IAAI,OAAO,UAAU,UAAU,OAAO,iBAAiB,KAAK;CAC5D,OAAO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E,YAClE;CACF;CACA,MAAM,KAAK,kBAAkB;CAE7B,OAAO,GAAG,MAAM,KAAK,EAAE,IAAI,4BAA4B,QAAQ,KAAK,QAAQ,OAAO;AACrF"}
1
+ {"version":3,"file":"theme-script.js","names":["literal"],"sources":["../../../src/components/theme/theme-script.ts"],"sourcesContent":["/*\n * Copyright (c) 2026 Wing\n * Licensed under the MIT License.\n *\n * The options form is rewritten from Adea's accepted port of Zeron's preference\n * store (`appearanceThemeScript` in `packages/ui/src/components/appearance.ts`,\n * https://github.com/zeronsh/zeron) so the boot script reads the document the shared\n * persistence writes. See NOTICE.\n */\nimport { fontSettingsBootstrapScript } from '#lib/appearance-font-settings'\nimport { CUSTOM_ACCENT_PATTERN, isCustomAccent } from '#lib/accent-roles'\nimport { accents } from '#lib/accent-presets'\nimport { safeScriptStringLiteral as literal } from '#lib/safe-script'\nimport { THEME_ACCENT_PREFIX } from '#lib/theme-accents'\nimport { DEFAULT_THEME_STORAGE_KEY, THEME_INDEX, defaultThemeIdFor } from '#lib/theme-defaults'\nimport {\n REDUCED_TRANSPARENCY_QUERY,\n resolveSurface,\n surfaceAlpha,\n themeSurfaces,\n type SurfaceEnvironment,\n} from '#lib/theme-surface'\nimport type { ThemeTokenProjection } from '@adea-ai/themes/theme-token-projection'\nimport type { ThemeStorageSchema } from './theme-persistence'\n\nexport { safeScriptStringLiteral as inlineScriptLiteral } from '#lib/safe-script'\n\n/** A stored-record path that can supply an absent projection source token. */\nexport type ThemeTokenProjectionFallback = Readonly<{\n /** The CSS custom property to fill only when the stored token map omits it. */\n token: string\n /** Own-property path from the stored library record to a string value. */\n path: readonly string[]\n}>\n\n/**\n * Options for the host-shaped no-flash script: the document's {@link ThemeStorageSchema}\n * plus what the script paints from it.\n */\nexport type ThemeScriptOptions = ThemeStorageSchema & {\n /**\n * The accent painted when the document has none, an unrecognised one, or the\n * legacy `theme` spelling — the host's default (adea: `violet`). Without it those\n * cases paint no `data-accent`, which is what the provider writes for `theme`.\n * Setting it means the `[data-accent]` block of the default preset paints on the\n * first frame instead of after hydration.\n */\n defaultAccent?: string\n /**\n * Also resolve the surface axis (`data-surface`, `data-reduce-transparency`,\n * `--surface-alpha`) from the document and the operating system's Reduce\n * Transparency setting. A `translucent` preference resolves to `frosted`: the\n * host's translucency capability is not known until the provider mounts, and the\n * provider re-resolves it then. Match the provider's `surface` prop.\n */\n surface?: boolean\n /**\n * Accepted so a host can pass the provider's `palette` prop through; the script is\n * the same either way. A catalogue variant's palette is the host stylesheet's job\n * (`stylesheet`) or the provider's, at mount (`inline`), and a stored theme's own\n * tokens are written inline in both.\n */\n palette?: 'inline' | 'stylesheet'\n /** The only `version` of the library document read. Default `1`. */\n libraryVersion?: number\n /**\n * Load only the resolved catalogue theme's stylesheet instead of bundling\n * `theme-variants.css`: a URL template with `{id}` where the theme id goes, for\n * the files the package ships as `@adea-ai/ui/themes/<id>.css` (copied to where\n * the host serves them). The script adds one `<link rel=\"stylesheet\"\n * blocking=\"render\">` to `<head>`, so the first frame still waits for the palette\n * it chose and no other theme's rules are fetched or parsed. A theme read from\n * the stored library is written inline as before and loads no sheet.\n *\n * Pair it with `palette=\"inline\"` on the provider: the sheet covers the first\n * paint, and the provider writes the same values when it mounts, so a later\n * switch needs no sheet.\n */\n stylesheetHref?: string\n}\n\n/**\n * The no-flash script.\n *\n * Rendered inline in `<head>` before any stylesheet that matters. Without it a dark\n * preference paints the light theme first and then swaps, which is the flash every\n * themed application has to solve and the one thing a provider cannot do from\n * inside the body.\n *\n * ## The string form\n *\n * `themeScript('key')` serves a provider that stores an unversioned\n * `localStorage[key]` document. Deliberately tiny and dependency-free: it reads the\n * stored preference, resolves `system`, and sets the class. It does not apply the\n * variant's roles — the default theme in `theme.css` covers the first paint, and the\n * provider writes the rest on mount. Its output is a compatibility surface (a\n * consumer may have it in a snapshot), so it does not change.\n *\n * ## The options form\n *\n * `themeScript({ key, ... })` serves a host with a versioned document (see\n * `createVersionedPersistence`) and writes what the provider will write, so mounting\n * repaints nothing:\n *\n * - `class=\"dark\"`, `color-scheme`, `data-theme`, `data-appearance` and, for a\n * compact document, `data-density`;\n * - `data-accent`: a preset id as stored, `custom` for a `#rrggbb` (never the hex\n * itself, which is the worst possible attribute content), `defaultAccent` when the\n * document has none, nothing for a theme-derived `ansi-*` accent (it has no\n * stylesheet block; the provider paints it inline);\n * - the theme: the stored id when the catalogue or the stored library holds it, else\n * the default of the resolved appearance, exactly as the provider resolves it. A\n * library theme's own tokens are written inline, so an imported theme paints on the\n * first frame;\n * - the surface axis, when `surface` is set;\n * - the font settings, guarded to the document's `version`.\n *\n * The document's `version`, when the schema names one, must match exactly. The legacy\n * key is read only while the main key is absent: an unreadable main document is not\n * \"no preference\", so it does not resurrect an older value.\n *\n * The script reads values out of `localStorage` and writes them to `dataset` and\n * `style`, which are *property* assignments rather than code: a stored id, accent or\n * token can set an attribute and cannot execute. The values that reach the source as\n * text (keys, ids, the default accent) go through `inlineScriptLiteral`\n * (`safeScriptStringLiteral`) for the reason documented there.\n *\n * The script cannot import the policy it applies, so it carries the policy's tables\n * instead: the catalogue ids, the default pair, the preset ids, the custom-accent\n * grammar, the theme-accent prefix and the surface outcomes, all read from the modules\n * the provider uses.\n */\nexport function themeScript(storageKey?: string): string\nexport function themeScript(options: ThemeScriptOptions): string\nexport function themeScript(\n input: string | ThemeScriptOptions = DEFAULT_THEME_STORAGE_KEY\n): string {\n if (typeof input === 'string') return stringFormScript(input)\n return optionsFormScript(input)\n}\n\n/** Internal hook for the opt-in script entry, which supplies its generated browser bundle. */\nexport function themeScriptWithProjection(\n options: ThemeScriptOptions & {\n tokenProjectionFallbacks?: readonly ThemeTokenProjectionFallback[]\n },\n tokenProjection: ThemeTokenProjection,\n projectionBundle: string,\n projectionFallbackScript: string\n): string {\n return optionsFormScript(\n options,\n tokenProjection,\n projectionBundle,\n projectionFallbackScript,\n options.tokenProjectionFallbacks\n )\n}\n\nfunction stringFormScript(storageKey: string): string {\n const script = `(function(){try{var s=localStorage.getItem(${literal(storageKey)});var p=s?JSON.parse(s):{};var a=p.appearance||'system';var d=a==='dark'||(a==='system'&&window.matchMedia('(prefers-color-scheme: dark)').matches);var r=document.documentElement;if(d)r.classList.add('dark');r.style.colorScheme=d?'dark':'light';if(p.accent&&p.accent!=='theme')r.dataset.accent=p.accent;if(p.density==='compact')r.dataset.density='compact';}catch(e){}})();`\n return `${script}${fontSettingsBootstrapScript(storageKey)}`\n}\n\n/** What the surface axis paints before the provider knows the host's capability. */\nfunction bootSurfaces(): { preferred: Record<string, string>; reduced: string } {\n const environment: SurfaceEnvironment = {\n osReducedTransparency: false,\n userReducedTransparency: false,\n nativeTranslucency: false,\n }\n return {\n preferred: Object.fromEntries(\n themeSurfaces.map((surface) => [surface, resolveSurface(surface, environment)])\n ),\n reduced: resolveSurface('opaque', { ...environment, osReducedTransparency: true }),\n }\n}\n\nfunction optionsFormScript(\n options: ThemeScriptOptions,\n projection?: ThemeTokenProjection,\n projectionBundle?: string,\n projectionFallbackScript = '',\n projectionFallbacks?: readonly ThemeTokenProjectionFallback[]\n): string {\n const field = options.appearanceField ?? 'appearance'\n const versionGuard =\n options.version === undefined ? '' : `&&x.version===${Number(options.version)}`\n const presets = accents.map((preset) => literal(preset.id))\n const defaultAccent =\n options.defaultAccent === undefined\n ? ''\n : isCustomAccent(options.defaultAccent)\n ? 'custom'\n : options.defaultAccent\n const canProjectTokens =\n options.libraryKey !== undefined &&\n projection &&\n projection.length > 0 &&\n projectionBundle !== undefined\n const hasProjectionFallbacks = canProjectTokens && !!projectionFallbacks?.length\n const tokenProjection = canProjectTokens\n ? `var projectTokens=${projectionBundle};var tokenProjection=JSON.parse(${literal(JSON.stringify(projection))});${\n hasProjectionFallbacks\n ? `var tokenProjectionFallbacks=JSON.parse(${literal(JSON.stringify(projectionFallbacks))});`\n : ''\n }`\n : ''\n const projectionFallbackCode = hasProjectionFallbacks ? projectionFallbackScript : ''\n\n const parts: string[] = []\n parts.push(\n `(function(){try{`,\n `var r=document.documentElement,s=r.style;`,\n `var q=function(m){try{return window.matchMedia(m).matches}catch(e){return false}};`,\n `var get=function(k){try{return localStorage.getItem(k)}catch(e){return null}};`,\n // The main document. `raw !== null` rather than truthiness: an empty string is a\n // stored (corrupt) value, so it does not fall through to the legacy key.\n `var raw=get(${literal(options.key)}),doc=null,legacy=null;`,\n `if(raw!==null){try{var x=JSON.parse(raw);if(x&&typeof x==='object'&&!Array.isArray(x)${versionGuard})doc=x}catch(e){}}`\n )\n if (options.legacyAppearanceKey !== undefined) {\n parts.push(`else legacy=get(${literal(options.legacyAppearanceKey)});`)\n }\n parts.push(\n `var m=doc?doc[${literal(field)}]:legacy;`,\n `var mode=m==='light'||m==='dark'?m:'system';`,\n `var dark=mode==='dark'||(mode==='system'&&q('(prefers-color-scheme: dark)'));`,\n `var fallback=dark?${literal(defaultThemeIdFor('dark'))}:${literal(defaultThemeIdFor('light'))};`,\n `var want=doc?(dark?doc.darkThemeId:doc.lightThemeId):null;`,\n `if(typeof want!=='string')want=fallback;`,\n `var ids=[${THEME_INDEX.map(([id]) => literal(id)).join(',')}];`,\n `var id=ids.indexOf(want)!==-1?want:null,tokens=null${hasProjectionFallbacks ? ',storedTheme=null' : ''};`\n )\n if (options.libraryKey !== undefined) {\n parts.push(\n `if(id===null){try{var lib=JSON.parse(get(${literal(options.libraryKey)})||'null');`,\n `if(lib&&typeof lib==='object'&&lib.version===${Number(options.libraryVersion ?? 1)}&&Array.isArray(lib.themes)){`,\n `for(var i=0;i!==lib.themes.length;i++){var t=lib.themes[i];`,\n `if(t&&t.id===want&&t.flatTokens&&typeof t.flatTokens==='object'){id=want;tokens=t.flatTokens;${hasProjectionFallbacks ? 'storedTheme=t;' : ''}break}}}}catch(e){}}`\n )\n }\n if (options.libraryKey !== undefined && tokenProjection) parts.push(tokenProjection)\n parts.push(\n `if(id===null)id=fallback;`,\n `r.classList.toggle('dark',dark);`,\n `s.colorScheme=dark?'dark':'light';`,\n `r.dataset.theme=id;`,\n `r.dataset.appearance=dark?'dark':'light';`\n )\n if (options.stylesheetHref !== undefined) {\n // Only a catalogue id names a shipped sheet; `tokens` marks a library theme.\n parts.push(\n `if(!tokens&&ids.indexOf(id)!==-1){var l=document.createElement('link');l.rel='stylesheet';l.setAttribute('blocking','render');l.setAttribute('data-theme-stylesheet',id);l.href=${literal(options.stylesheetHref)}.split('{id}').join(id);(document.head||r).appendChild(l)}`\n )\n }\n if (options.libraryKey !== undefined) {\n parts.push(\n `if(tokens){if(typeof projectTokens==='function'){${projectionFallbackCode}tokens=projectTokens(tokens,tokenProjection)}for(var n in tokens){if(Object.prototype.hasOwnProperty.call(tokens,n)&&n.slice(0,2)==='--'&&typeof tokens[n]==='string')s.setProperty(n,tokens[n])}}`\n )\n }\n parts.push(\n `var a=doc&&typeof doc.accent==='string'?doc.accent:'';`,\n `var accent=[${presets.join(',')}].indexOf(a)!==-1?a:${CUSTOM_ACCENT_PATTERN}.test(a)?'custom':a.slice(0,${THEME_ACCENT_PREFIX.length})===${literal(THEME_ACCENT_PREFIX)}?'':${literal(defaultAccent)};`,\n `if(accent)r.dataset.accent=accent;`,\n `if(doc&&doc.density==='compact')r.dataset.density='compact';`\n )\n if (options.surface) {\n const surfaces = bootSurfaces()\n parts.push(\n `var reduce=q(${literal(REDUCED_TRANSPARENCY_QUERY)})||!!(doc&&doc.reduceTransparency===true);`,\n `var surfaces=${JSON.stringify(surfaces.preferred)};`,\n `var surface=reduce?${literal(surfaces.reduced)}:doc&&typeof doc.surface==='string'&&Object.prototype.hasOwnProperty.call(surfaces,doc.surface)?surfaces[doc.surface]:surfaces.opaque;`,\n `r.dataset.surface=surface;`,\n `r.dataset.reduceTransparency=reduce?'true':'false';`,\n `s.setProperty('--surface-alpha',${JSON.stringify(surfaceAlpha)}[surface]);`\n )\n }\n parts.push(`}catch(e){}})();`)\n\n return `${parts.join('')}${fontSettingsBootstrapScript(options.key, options.version)}`\n}\n"],"mappings":";;;;;;;;;AAsIA,SAAgB,YACd,QAAqC,2BAC7B;CACR,IA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0BAA0B,EAAE,6CACpD,gBAAgB,KAAK,UAAU,SAAS,SAAS,EAAE,IACnD,sBAAsBA,wBAAQ,SAAS,OAAO,EAAE,yIAChD,8BACA,uDACA,mCAAmC,KAAK,UAAU,YAAY,EAAE,YAClE;CACF;CACA,MAAM,KAAK,kBAAkB;CAE7B,OAAO,GAAG,MAAM,KAAK,EAAE,IAAI,4BAA4B,QAAQ,KAAK,QAAQ,OAAO;AACrF"}
@@ -18,13 +18,13 @@ import type { ThemeAppearance, ThemeVariant } from '#lib/theme-types';
18
18
  /**
19
19
  * Four independent choices, and keeping them independent is the point:
20
20
  *
21
- * - **appearance** — light, dark, or follow the system.
22
- * - **a theme per appearance** — so a user can run Catppuccin Mocha by night and
21
+ * - **appearance**: light, dark, or follow the system.
22
+ * - **a theme per appearance**: so a user can run Catppuccin Mocha by night and
23
23
  * Solarized Light by day without re-choosing when the system flips.
24
- * - **an accent** — adea's six presets, or one of the accents the selected theme
24
+ * - **an accent**: adea's six presets, or one of the accents the selected theme
25
25
  * pair carries itself (`ansi-blue`…), which re-colour the interactive roles on
26
26
  * top of whichever theme is active.
27
- * - **fonts** — separate family and size choices for UI, content and code.
27
+ * - **fonts**: separate family and size choices for UI, content and code.
28
28
  */
29
29
  export type ThemeSelection = {
30
30
  /** `system` follows `prefers-color-scheme` and updates when it changes. */
@@ -70,8 +70,8 @@ export type ThemeSelection = {
70
70
  /**
71
71
  * How opaque elevated panels are. Written to `<html>` only when the provider's
72
72
  * `surface` prop is on or this is set; absent, a host paints no surface axis at
73
- * all. Resolved against the OS and the host's capability before it is painted —
74
- * see `resolveSurface` — so the value stored is a preference, never the outcome.
73
+ * all. Resolved against the OS and the host's capability before it is painted,
74
+ * see `resolveSurface`, so the value stored is a preference, never the outcome.
75
75
  */
76
76
  surface?: ThemeSurface;
77
77
  /**
@@ -147,7 +147,7 @@ export type ThemeContextValue = {
147
147
  /**
148
148
  * The roles `accent` paints over `variantId` (default: the variant in use), held
149
149
  * to the provider's `accentContrastFloor`, for an element-scoped override with
150
- * `paintAccentRoles` — a workspace that carries its own colour. `undefined` for
150
+ * `paintAccentRoles`, a workspace that carries its own colour. `undefined` for
151
151
  * `null`, for `theme`, for an id that resolves to nothing, and for a variant the
152
152
  * registry does not hold: each means "keep the inherited accent".
153
153
  */
@@ -1 +1 @@
1
- {"version":3,"file":"theme-state.js","names":[],"sources":["../../../src/components/theme/theme-state.ts"],"sourcesContent":["import {\n DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS,\n normalizeAppearanceEditorFontSettings,\n type AppearanceEditorFontSettings,\n} from '#lib/appearance-font-settings'\nimport type { AccentPreset } from '@adea-ai/themes'\nimport { normalizeCustomAccent, type AccentRoles } from '#lib/accent-roles'\nimport { stepAppearanceFontSizes, type FontZoomIntent } from '#lib/font-zoom'\nimport { DEFAULT_FONT_ID } from '#lib/font-catalog'\nimport type { ThemeSurface } from '#lib/theme-surface'\nimport { THEME_DEFAULT_ID, defaultThemePair, resolveVariant } from '#lib/theme-defaults'\nimport type { ThemeEngine } from '#lib/theme-engine'\nimport type { ThemeAppearance, ThemeVariant } from '#lib/theme-types'\n\n/**\n * The pure half of the theme provider: what a selection is, how two selections\n * merge, and what a selection resolves to.\n *\n * Nothing here touches the document, storage or a signal, so each rule can be\n * tested by calling it. `ThemeProvider` owns the reactivity and wires these to it;\n * `theme-document.ts` owns the writes; `theme-persistence.ts` owns the store. Every\n * question only the catalogue can answer goes through the {@link ThemeEngine} a caller\n * passes, so nothing here imports the catalogue.\n */\n\n/**\n * Four independent choices, and keeping them independent is the point:\n *\n * - **appearance** — light, dark, or follow the system.\n * - **a theme per appearance** — so a user can run Catppuccin Mocha by night and\n * Solarized Light by day without re-choosing when the system flips.\n * - **an accent** — adea's six presets, or one of the accents the selected theme\n * pair carries itself (`ansi-blue`…), which re-colour the interactive roles on\n * top of whichever theme is active.\n * - **fonts** — separate family and size choices for UI, content and code.\n */\nexport type ThemeSelection = {\n /** `system` follows `prefers-color-scheme` and updates when it changes. */\n appearance: ThemeAppearance | 'system'\n /** The variant to use when the resolved appearance is light. */\n lightThemeId: string\n /** The variant to use when the resolved appearance is dark. */\n darkThemeId: string\n /**\n * An `accentPresets` id, a theme accent id from `themeAccents()` (`ansi-blue`…),\n * `theme` for the variant's own primary, or a custom colour as `#rrggbb`. A theme\n * accent the current pair does not offer falls back to the variant's own primary.\n *\n * A custom colour is stored lower case and is raised to the contrast floor when it\n * is painted, never when it is stored: the selection keeps what the user chose.\n * Anything else that is not an id is dropped at paint, not rejected here.\n */\n accent: string\n /** UI-family alias for consumers of the original single-font preference. */\n font: string\n /** UI, content and code font settings. Omitted legacy records are migrated from `font`. */\n fonts?: AppearanceEditorFontSettings\n /**\n * `comfortable` is the system's default geometry; `compact` moves the control\n * ladder down one rung.\n *\n * Optional, and defaulted on read, so a preference stored before density existed\n * keeps working and `ThemeSelection` stays assignable without it.\n */\n density?: ThemeDensity\n /**\n * The terminal either follows the interface theme (`theme`, or absent) or is pinned\n * to another theme's terminal palette by that theme's id. The pin is written over\n * the interface variant's own `--terminal-*` properties, so a light interface can\n * carry a dark terminal.\n *\n * An id the registry does not hold paints the interface palette and stays in the\n * selection, the same rule as an unknown theme id.\n *\n * Optional and not defaulted: see {@link defaultThemeSelection}.\n */\n terminalThemeId?: string\n /**\n * How opaque elevated panels are. Written to `<html>` only when the provider's\n * `surface` prop is on or this is set; absent, a host paints no surface axis at\n * all. Resolved against the OS and the host's capability before it is painted —\n * see `resolveSurface` — so the value stored is a preference, never the outcome.\n */\n surface?: ThemeSurface\n /**\n * The user's own Reduce Transparency switch, which forces the `opaque` surface the\n * same way the operating system's setting does.\n */\n reduceTransparency?: boolean\n}\n\n/**\n * The two density rungs.\n *\n * `comfortable` is the geometry in `theme.css`, so it is the absence of an\n * attribute rather than a value: a document that ships no `data-density` at all\n * renders correctly, which is what keeps this additive.\n */\nexport type ThemeDensity = 'comfortable' | 'compact'\n\n/**\n * Deliberately lists only the fields every consumer has always had. A field added\n * to {@link ThemeSelection} later gets no default here: `JSON.stringify` drops an\n * `undefined`, so a store written by a consumer that never sets the field stays\n * byte-identical to what it was before the field existed.\n */\nexport const defaultThemeSelection: ThemeSelection = {\n appearance: 'system',\n ...defaultThemePair,\n accent: THEME_DEFAULT_ID,\n font: DEFAULT_FONT_ID,\n fonts: DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS,\n density: 'comfortable',\n}\n\n/**\n * A stored selection's density, defaulted.\n *\n * The stored value is read through here rather than trusted, because a preference\n * written before density existed has no `density` key and a hand-edited store may\n * hold anything.\n */\nexport function resolvedDensity(selection: ThemeSelection): ThemeDensity {\n return selection.density === 'compact' ? 'compact' : 'comfortable'\n}\n\nexport type ThemeContextValue = {\n /** The preference as stored. A {@link ThemeContextValue.preview} does not change it. */\n selection: () => ThemeSelection\n /** What the preference resolves to right now, after `system`. */\n resolvedAppearance: () => ThemeAppearance\n /**\n * The appearance currently shown by the provider, including an active preview.\n * Optional for compatibility with values supplied by an older copy of the UI\n * package or by a host-owned context mock; providers always expose it.\n */\n shownAppearance?: () => ThemeAppearance\n /** The variant in use. */\n variant: () => ThemeVariant\n /** Update part of the preference. */\n setSelection: (patch: Partial<ThemeSelection>) => void\n /**\n * The built-in catalogue, so a picker does not import it separately. A plain\n * array: {@link ThemeContextValue.allThemes} is the one that follows a host's\n * extra themes. Under the lazy provider it holds only the default pair until\n * {@link ThemeContextValue.catalogueReady}; read it again afterwards.\n */\n themes: readonly ThemeVariant[]\n /**\n * The accents the selected light/dark pair carries, offered beside the presets.\n * Follows the selection: a different theme pair may offer different slots.\n */\n themeAccents: () => readonly AccentPreset[]\n /**\n * The built-in catalogue followed by the provider's `themes` prop. Reactive when\n * that prop is a function that reads signals.\n */\n allThemes: () => readonly ThemeVariant[]\n /**\n * Paint the document from `draft` laid over the stored selection, without\n * persisting it or changing what {@link ThemeContextValue.selection} returns.\n * `undefined` ends the preview. A {@link ThemeContextValue.setSelection} ends it\n * too, because the committed selection is then what should be showing.\n */\n preview: (draft: Partial<ThemeSelection> | undefined) => void\n /** True while a {@link ThemeContextValue.preview} draft is on the document. */\n previewing: () => boolean\n /**\n * The roles `accent` paints over `variantId` (default: the variant in use), held\n * to the provider's `accentContrastFloor`, for an element-scoped override with\n * `paintAccentRoles` — a workspace that carries its own colour. `undefined` for\n * `null`, for `theme`, for an id that resolves to nothing, and for a variant the\n * registry does not hold: each means \"keep the inherited accent\".\n */\n accentRolesFor: (accent: string | null, variantId?: string) => AccentRoles | undefined\n /**\n * The surface the committed selection paints, after Reduce Transparency and the\n * host's translucency capability. `opaque` when the axis is off. Follows the\n * committed selection, not a preview, like {@link ThemeContextValue.variant}.\n */\n effectiveSurface: () => ThemeSurface\n /**\n * True while the operating system or the selection's `reduceTransparency` forces\n * opaque surfaces. Always false when the surface axis is off, because nothing is\n * then listening to the operating system.\n */\n reduceTransparencyActive: () => boolean\n /**\n * Step the three text sizes together, or put them back to the defaults: what the\n * `fontZoom` prop's chords do, for a host that binds its own keys or a menu. Goes\n * through {@link ThemeContextValue.setSelection}, so it persists and ends a preview.\n */\n zoomFonts: (intent: FontZoomIntent) => void\n /**\n * True when `themes`, `allThemes()` and the variants they resolve are backed by the\n * whole catalogue. Always true under `ThemeProvider`. Under the lazy provider\n * (`@adea-ai/ui/components/theme/lazy`) it turns true once the catalogue has loaded,\n * and until then only the default light and dark themes are available: a stored\n * theme beyond them resolves to its appearance's default (the document keeps painting\n * what the stylesheet gave it) until `catalogueReady()` is true. Absent on a context\n * a host builds itself, where it should be read as true.\n */\n catalogueReady?: () => boolean\n /**\n * Start loading the whole catalogue (idempotent) and resolve when it is available.\n * `AppearancePanel` calls it when it mounts; a host's own picker or settings page\n * should too. A no-op under `ThemeProvider`, whose catalogue is already loaded.\n */\n loadCatalogue?: () => Promise<void>\n}\n\n/** A selection with the `undefined` keys of a patch left out. */\nfunction definedOnly<T extends object>(value: T): Partial<T> {\n return Object.fromEntries(\n Object.entries(value).filter(([, entry]) => entry !== undefined)\n ) as Partial<T>\n}\n\n/** Keep the deprecated single-font view synchronized with the UI axis. */\nexport function mergeThemeSelection(\n base: ThemeSelection,\n patch: Partial<ThemeSelection>\n): ThemeSelection {\n const merged = { ...base, ...patch }\n let fonts: AppearanceEditorFontSettings\n\n if (patch.fonts !== undefined) {\n fonts = normalizeAppearanceEditorFontSettings(patch.fonts).settings\n } else if (patch.font !== undefined) {\n const currentFonts = normalizeAppearanceEditorFontSettings(base.fonts, base.font).settings\n fonts = normalizeAppearanceEditorFontSettings({\n ...currentFonts,\n ui: { ...currentFonts.ui, family: patch.font },\n }).settings\n } else {\n fonts = normalizeAppearanceEditorFontSettings(merged.fonts, merged.font).settings\n }\n\n return {\n ...merged,\n // One spelling for a custom colour, so equal choices compare and store equal.\n accent: normalizeCustomAccent(merged.accent) ?? merged.accent,\n fonts,\n font: fonts.ui.family,\n }\n}\n\n/**\n * The selection a provider starts from: the defaults, then whatever the store\n * returned, then `initial`.\n *\n * `initial` wins over the store on every mount. That precedence is part of the\n * contract Cortana relies on (its `initial` pins `appearance` and `font`), and it\n * is why the store's answer is only the middle layer. A store that returned\n * nothing, or threw, or answered with explicit `undefined`s, leaves the defaults\n * standing for those fields.\n */\nexport function initialThemeSelection(\n stored: Partial<ThemeSelection> | undefined,\n initial: Partial<ThemeSelection> | undefined\n): ThemeSelection {\n const base = mergeThemeSelection(defaultThemeSelection, definedOnly(stored ?? {}))\n return mergeThemeSelection(base, initial ?? {})\n}\n\n/** `system` resolved against what the operating system reports. */\nexport function resolveAppearance(\n preference: ThemeSelection['appearance'],\n system: ThemeAppearance\n): ThemeAppearance {\n return preference === 'system' ? system : preference\n}\n\n/** The theme id the selection names for a resolved appearance. */\nexport function selectedThemeId(selection: ThemeSelection, appearance: ThemeAppearance): string {\n return appearance === 'dark' ? selection.darkThemeId : selection.lightThemeId\n}\n\n/**\n * What a selection paints: the resolved appearance and the variant for it.\n *\n * An id the registry does not hold resolves to the appearance's default rather than\n * being rewritten (see `resolveVariant`), so the selection a host stores is never\n * changed by being unresolvable.\n */\nexport function resolveThemeState(\n selection: ThemeSelection,\n system: ThemeAppearance,\n registry: readonly ThemeVariant[]\n): { appearance: ThemeAppearance; variant: ThemeVariant } {\n const appearance = resolveAppearance(selection.appearance, system)\n return {\n appearance,\n variant: resolveVariant(registry, selectedThemeId(selection, appearance), appearance),\n }\n}\n\n/**\n * The variant whose terminal palette is pinned, or `undefined` when the terminal\n * follows the interface theme.\n *\n * `theme`, an absent id and an id the registry does not hold all mean the interface\n * palette: a terminal must never resolve to a blank or half-painted palette because a\n * theme was deleted after it was pinned.\n */\nexport function resolveTerminalVariant(\n terminalThemeId: string | undefined,\n registry: readonly ThemeVariant[]\n): ThemeVariant | undefined {\n if (terminalThemeId === undefined || terminalThemeId === THEME_DEFAULT_ID) return undefined\n return registry.find((candidate) => candidate.id === terminalThemeId)\n}\n\n/**\n * The font settings a zoom chord asks for: one pixel up or down on every axis, or\n * the defaults for `reset`.\n */\nexport function zoomedFontSettings(\n selection: ThemeSelection,\n intent: FontZoomIntent\n): AppearanceEditorFontSettings {\n if (intent === 'reset') return { ...DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS }\n return stepAppearanceFontSizes(selection.fonts, intent === 'in' ? 1 : -1)\n}\n\n/**\n * The registry a provider resolves against: the catalogue, then the host's extras.\n *\n * The catalogue wins an id collision, because it is listed first and `resolveVariant`\n * takes the first match: a host's variant can add a theme but cannot shadow one.\n */\nexport function mergeRegistry(\n builtin: readonly ThemeVariant[],\n extra: readonly ThemeVariant[] | undefined\n): readonly ThemeVariant[] {\n return extra && extra.length > 0 ? [...builtin, ...extra] : builtin\n}\n\n/**\n * The roles an accent paints over a variant, for {@link ThemeContextValue.accentRolesFor}.\n *\n * Resolved against the committed selection's theme pair, so an `ansi-*` accent means\n * the same colour here as it does on `<html>`.\n */\nexport function accentRolesForState(\n engine: Pick<ThemeEngine, 'accentRolesForSelection'>,\n accent: string | null,\n variantId: string | undefined,\n state: {\n selection: ThemeSelection\n variant: ThemeVariant\n registry: readonly ThemeVariant[]\n accentContrastFloor?: number\n }\n): AccentRoles | undefined {\n if (accent === null) return undefined\n const variant =\n variantId === undefined\n ? state.variant\n : state.registry.find((candidate) => candidate.id === variantId)\n if (!variant) return undefined\n return engine.accentRolesForSelection(accent, variant.appearance, state.selection, {\n background: variant.colors.background,\n floor: state.accentContrastFloor,\n variantId: variant.id,\n })\n}\n"],"mappings":";;;;;;;;;;;;AA0GA,IAAa,wBAAwC;CACnD,YAAY;CACZ,GAAG;CACH,QAAQ;CACR,MAAM;CACN,OAAO;CACP,SAAS;AACX;;;;;;;;AASA,SAAgB,gBAAgB,WAAyC;CACvE,OAAO,UAAU,YAAY,YAAY,YAAY;AACvD;;AAwFA,SAAS,YAA8B,OAAsB;CAC3D,OAAO,OAAO,YACZ,OAAO,QAAQ,KAAK,CAAC,CAAC,QAAQ,GAAG,WAAW,UAAU,KAAA,CAAS,CACjE;AACF;;AAGA,SAAgB,oBACd,MACA,OACgB;CAChB,MAAM,SAAS;EAAE,GAAG;EAAM,GAAG;CAAM;CACnC,IAAI;CAEJ,IAAI,MAAM,UAAU,KAAA,GAClB,QAAQ,sCAAsC,MAAM,KAAK,CAAC,CAAC;MACtD,IAAI,MAAM,SAAS,KAAA,GAAW;EACnC,MAAM,eAAe,sCAAsC,KAAK,OAAO,KAAK,IAAI,CAAC,CAAC;EAClF,QAAQ,sCAAsC;GAC5C,GAAG;GACH,IAAI;IAAE,GAAG,aAAa;IAAI,QAAQ,MAAM;GAAK;EAC/C,CAAC,CAAC,CAAC;CACL,OACE,QAAQ,sCAAsC,OAAO,OAAO,OAAO,IAAI,CAAC,CAAC;CAG3E,OAAO;EACL,GAAG;EAEH,QAAQ,sBAAsB,OAAO,MAAM,KAAK,OAAO;EACvD;EACA,MAAM,MAAM,GAAG;CACjB;AACF;;;;;;;;;;;AAYA,SAAgB,sBACd,QACA,SACgB;CAEhB,OAAO,oBADM,oBAAoB,uBAAuB,YAAY,UAAU,CAAC,CAAC,CACrD,GAAM,WAAW,CAAC,CAAC;AAChD;;AAGA,SAAgB,kBACd,YACA,QACiB;CACjB,OAAO,eAAe,WAAW,SAAS;AAC5C;;AAGA,SAAgB,gBAAgB,WAA2B,YAAqC;CAC9F,OAAO,eAAe,SAAS,UAAU,cAAc,UAAU;AACnE;;;;;;;;AASA,SAAgB,kBACd,WACA,QACA,UACwD;CACxD,MAAM,aAAa,kBAAkB,UAAU,YAAY,MAAM;CACjE,OAAO;EACL;EACA,SAAS,eAAe,UAAU,gBAAgB,WAAW,UAAU,GAAG,UAAU;CACtF;AACF;;;;;;;;;AAUA,SAAgB,uBACd,iBACA,UAC0B;CAC1B,IAAI,oBAAoB,KAAA,KAAa,oBAAA,SAAsC,OAAO,KAAA;CAClF,OAAO,SAAS,MAAM,cAAc,UAAU,OAAO,eAAe;AACtE;;;;;AAMA,SAAgB,mBACd,WACA,QAC8B;CAC9B,IAAI,WAAW,SAAS,OAAO,EAAE,GAAG,wCAAwC;CAC5E,OAAO,wBAAwB,UAAU,OAAO,WAAW,OAAO,IAAI,EAAE;AAC1E;;;;;;;AAQA,SAAgB,cACd,SACA,OACyB;CACzB,OAAO,SAAS,MAAM,SAAS,IAAI,CAAC,GAAG,SAAS,GAAG,KAAK,IAAI;AAC9D;;;;;;;AAQA,SAAgB,oBACd,QACA,QACA,WACA,OAMyB;CACzB,IAAI,WAAW,MAAM,OAAO,KAAA;CAC5B,MAAM,UACJ,cAAc,KAAA,IACV,MAAM,UACN,MAAM,SAAS,MAAM,cAAc,UAAU,OAAO,SAAS;CACnE,IAAI,CAAC,SAAS,OAAO,KAAA;CACrB,OAAO,OAAO,wBAAwB,QAAQ,QAAQ,YAAY,MAAM,WAAW;EACjF,YAAY,QAAQ,OAAO;EAC3B,OAAO,MAAM;EACb,WAAW,QAAQ;CACrB,CAAC;AACH"}
1
+ {"version":3,"file":"theme-state.js","names":[],"sources":["../../../src/components/theme/theme-state.ts"],"sourcesContent":["import {\n DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS,\n normalizeAppearanceEditorFontSettings,\n type AppearanceEditorFontSettings,\n} from '#lib/appearance-font-settings'\nimport type { AccentPreset } from '@adea-ai/themes'\nimport { normalizeCustomAccent, type AccentRoles } from '#lib/accent-roles'\nimport { stepAppearanceFontSizes, type FontZoomIntent } from '#lib/font-zoom'\nimport { DEFAULT_FONT_ID } from '#lib/font-catalog'\nimport type { ThemeSurface } from '#lib/theme-surface'\nimport { THEME_DEFAULT_ID, defaultThemePair, resolveVariant } from '#lib/theme-defaults'\nimport type { ThemeEngine } from '#lib/theme-engine'\nimport type { ThemeAppearance, ThemeVariant } from '#lib/theme-types'\n\n/**\n * The pure half of the theme provider: what a selection is, how two selections\n * merge, and what a selection resolves to.\n *\n * Nothing here touches the document, storage or a signal, so each rule can be\n * tested by calling it. `ThemeProvider` owns the reactivity and wires these to it;\n * `theme-document.ts` owns the writes; `theme-persistence.ts` owns the store. Every\n * question only the catalogue can answer goes through the {@link ThemeEngine} a caller\n * passes, so nothing here imports the catalogue.\n */\n\n/**\n * Four independent choices, and keeping them independent is the point:\n *\n * - **appearance**: light, dark, or follow the system.\n * - **a theme per appearance**: so a user can run Catppuccin Mocha by night and\n * Solarized Light by day without re-choosing when the system flips.\n * - **an accent**: adea's six presets, or one of the accents the selected theme\n * pair carries itself (`ansi-blue`…), which re-colour the interactive roles on\n * top of whichever theme is active.\n * - **fonts**: separate family and size choices for UI, content and code.\n */\nexport type ThemeSelection = {\n /** `system` follows `prefers-color-scheme` and updates when it changes. */\n appearance: ThemeAppearance | 'system'\n /** The variant to use when the resolved appearance is light. */\n lightThemeId: string\n /** The variant to use when the resolved appearance is dark. */\n darkThemeId: string\n /**\n * An `accentPresets` id, a theme accent id from `themeAccents()` (`ansi-blue`…),\n * `theme` for the variant's own primary, or a custom colour as `#rrggbb`. A theme\n * accent the current pair does not offer falls back to the variant's own primary.\n *\n * A custom colour is stored lower case and is raised to the contrast floor when it\n * is painted, never when it is stored: the selection keeps what the user chose.\n * Anything else that is not an id is dropped at paint, not rejected here.\n */\n accent: string\n /** UI-family alias for consumers of the original single-font preference. */\n font: string\n /** UI, content and code font settings. Omitted legacy records are migrated from `font`. */\n fonts?: AppearanceEditorFontSettings\n /**\n * `comfortable` is the system's default geometry; `compact` moves the control\n * ladder down one rung.\n *\n * Optional, and defaulted on read, so a preference stored before density existed\n * keeps working and `ThemeSelection` stays assignable without it.\n */\n density?: ThemeDensity\n /**\n * The terminal either follows the interface theme (`theme`, or absent) or is pinned\n * to another theme's terminal palette by that theme's id. The pin is written over\n * the interface variant's own `--terminal-*` properties, so a light interface can\n * carry a dark terminal.\n *\n * An id the registry does not hold paints the interface palette and stays in the\n * selection, the same rule as an unknown theme id.\n *\n * Optional and not defaulted: see {@link defaultThemeSelection}.\n */\n terminalThemeId?: string\n /**\n * How opaque elevated panels are. Written to `<html>` only when the provider's\n * `surface` prop is on or this is set; absent, a host paints no surface axis at\n * all. Resolved against the OS and the host's capability before it is painted,\n * see `resolveSurface`, so the value stored is a preference, never the outcome.\n */\n surface?: ThemeSurface\n /**\n * The user's own Reduce Transparency switch, which forces the `opaque` surface the\n * same way the operating system's setting does.\n */\n reduceTransparency?: boolean\n}\n\n/**\n * The two density rungs.\n *\n * `comfortable` is the geometry in `theme.css`, so it is the absence of an\n * attribute rather than a value: a document that ships no `data-density` at all\n * renders correctly, which is what keeps this additive.\n */\nexport type ThemeDensity = 'comfortable' | 'compact'\n\n/**\n * Deliberately lists only the fields every consumer has always had. A field added\n * to {@link ThemeSelection} later gets no default here: `JSON.stringify` drops an\n * `undefined`, so a store written by a consumer that never sets the field stays\n * byte-identical to what it was before the field existed.\n */\nexport const defaultThemeSelection: ThemeSelection = {\n appearance: 'system',\n ...defaultThemePair,\n accent: THEME_DEFAULT_ID,\n font: DEFAULT_FONT_ID,\n fonts: DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS,\n density: 'comfortable',\n}\n\n/**\n * A stored selection's density, defaulted.\n *\n * The stored value is read through here rather than trusted, because a preference\n * written before density existed has no `density` key and a hand-edited store may\n * hold anything.\n */\nexport function resolvedDensity(selection: ThemeSelection): ThemeDensity {\n return selection.density === 'compact' ? 'compact' : 'comfortable'\n}\n\nexport type ThemeContextValue = {\n /** The preference as stored. A {@link ThemeContextValue.preview} does not change it. */\n selection: () => ThemeSelection\n /** What the preference resolves to right now, after `system`. */\n resolvedAppearance: () => ThemeAppearance\n /**\n * The appearance currently shown by the provider, including an active preview.\n * Optional for compatibility with values supplied by an older copy of the UI\n * package or by a host-owned context mock; providers always expose it.\n */\n shownAppearance?: () => ThemeAppearance\n /** The variant in use. */\n variant: () => ThemeVariant\n /** Update part of the preference. */\n setSelection: (patch: Partial<ThemeSelection>) => void\n /**\n * The built-in catalogue, so a picker does not import it separately. A plain\n * array: {@link ThemeContextValue.allThemes} is the one that follows a host's\n * extra themes. Under the lazy provider it holds only the default pair until\n * {@link ThemeContextValue.catalogueReady}; read it again afterwards.\n */\n themes: readonly ThemeVariant[]\n /**\n * The accents the selected light/dark pair carries, offered beside the presets.\n * Follows the selection: a different theme pair may offer different slots.\n */\n themeAccents: () => readonly AccentPreset[]\n /**\n * The built-in catalogue followed by the provider's `themes` prop. Reactive when\n * that prop is a function that reads signals.\n */\n allThemes: () => readonly ThemeVariant[]\n /**\n * Paint the document from `draft` laid over the stored selection, without\n * persisting it or changing what {@link ThemeContextValue.selection} returns.\n * `undefined` ends the preview. A {@link ThemeContextValue.setSelection} ends it\n * too, because the committed selection is then what should be showing.\n */\n preview: (draft: Partial<ThemeSelection> | undefined) => void\n /** True while a {@link ThemeContextValue.preview} draft is on the document. */\n previewing: () => boolean\n /**\n * The roles `accent` paints over `variantId` (default: the variant in use), held\n * to the provider's `accentContrastFloor`, for an element-scoped override with\n * `paintAccentRoles`, a workspace that carries its own colour. `undefined` for\n * `null`, for `theme`, for an id that resolves to nothing, and for a variant the\n * registry does not hold: each means \"keep the inherited accent\".\n */\n accentRolesFor: (accent: string | null, variantId?: string) => AccentRoles | undefined\n /**\n * The surface the committed selection paints, after Reduce Transparency and the\n * host's translucency capability. `opaque` when the axis is off. Follows the\n * committed selection, not a preview, like {@link ThemeContextValue.variant}.\n */\n effectiveSurface: () => ThemeSurface\n /**\n * True while the operating system or the selection's `reduceTransparency` forces\n * opaque surfaces. Always false when the surface axis is off, because nothing is\n * then listening to the operating system.\n */\n reduceTransparencyActive: () => boolean\n /**\n * Step the three text sizes together, or put them back to the defaults: what the\n * `fontZoom` prop's chords do, for a host that binds its own keys or a menu. Goes\n * through {@link ThemeContextValue.setSelection}, so it persists and ends a preview.\n */\n zoomFonts: (intent: FontZoomIntent) => void\n /**\n * True when `themes`, `allThemes()` and the variants they resolve are backed by the\n * whole catalogue. Always true under `ThemeProvider`. Under the lazy provider\n * (`@adea-ai/ui/components/theme/lazy`) it turns true once the catalogue has loaded,\n * and until then only the default light and dark themes are available: a stored\n * theme beyond them resolves to its appearance's default (the document keeps painting\n * what the stylesheet gave it) until `catalogueReady()` is true. Absent on a context\n * a host builds itself, where it should be read as true.\n */\n catalogueReady?: () => boolean\n /**\n * Start loading the whole catalogue (idempotent) and resolve when it is available.\n * `AppearancePanel` calls it when it mounts; a host's own picker or settings page\n * should too. A no-op under `ThemeProvider`, whose catalogue is already loaded.\n */\n loadCatalogue?: () => Promise<void>\n}\n\n/** A selection with the `undefined` keys of a patch left out. */\nfunction definedOnly<T extends object>(value: T): Partial<T> {\n return Object.fromEntries(\n Object.entries(value).filter(([, entry]) => entry !== undefined)\n ) as Partial<T>\n}\n\n/** Keep the deprecated single-font view synchronized with the UI axis. */\nexport function mergeThemeSelection(\n base: ThemeSelection,\n patch: Partial<ThemeSelection>\n): ThemeSelection {\n const merged = { ...base, ...patch }\n let fonts: AppearanceEditorFontSettings\n\n if (patch.fonts !== undefined) {\n fonts = normalizeAppearanceEditorFontSettings(patch.fonts).settings\n } else if (patch.font !== undefined) {\n const currentFonts = normalizeAppearanceEditorFontSettings(base.fonts, base.font).settings\n fonts = normalizeAppearanceEditorFontSettings({\n ...currentFonts,\n ui: { ...currentFonts.ui, family: patch.font },\n }).settings\n } else {\n fonts = normalizeAppearanceEditorFontSettings(merged.fonts, merged.font).settings\n }\n\n return {\n ...merged,\n // One spelling for a custom colour, so equal choices compare and store equal.\n accent: normalizeCustomAccent(merged.accent) ?? merged.accent,\n fonts,\n font: fonts.ui.family,\n }\n}\n\n/**\n * The selection a provider starts from: the defaults, then whatever the store\n * returned, then `initial`.\n *\n * `initial` wins over the store on every mount. That precedence is part of the\n * contract Cortana relies on (its `initial` pins `appearance` and `font`), and it\n * is why the store's answer is only the middle layer. A store that returned\n * nothing, or threw, or answered with explicit `undefined`s, leaves the defaults\n * standing for those fields.\n */\nexport function initialThemeSelection(\n stored: Partial<ThemeSelection> | undefined,\n initial: Partial<ThemeSelection> | undefined\n): ThemeSelection {\n const base = mergeThemeSelection(defaultThemeSelection, definedOnly(stored ?? {}))\n return mergeThemeSelection(base, initial ?? {})\n}\n\n/** `system` resolved against what the operating system reports. */\nexport function resolveAppearance(\n preference: ThemeSelection['appearance'],\n system: ThemeAppearance\n): ThemeAppearance {\n return preference === 'system' ? system : preference\n}\n\n/** The theme id the selection names for a resolved appearance. */\nexport function selectedThemeId(selection: ThemeSelection, appearance: ThemeAppearance): string {\n return appearance === 'dark' ? selection.darkThemeId : selection.lightThemeId\n}\n\n/**\n * What a selection paints: the resolved appearance and the variant for it.\n *\n * An id the registry does not hold resolves to the appearance's default rather than\n * being rewritten (see `resolveVariant`), so the selection a host stores is never\n * changed by being unresolvable.\n */\nexport function resolveThemeState(\n selection: ThemeSelection,\n system: ThemeAppearance,\n registry: readonly ThemeVariant[]\n): { appearance: ThemeAppearance; variant: ThemeVariant } {\n const appearance = resolveAppearance(selection.appearance, system)\n return {\n appearance,\n variant: resolveVariant(registry, selectedThemeId(selection, appearance), appearance),\n }\n}\n\n/**\n * The variant whose terminal palette is pinned, or `undefined` when the terminal\n * follows the interface theme.\n *\n * `theme`, an absent id and an id the registry does not hold all mean the interface\n * palette: a terminal must never resolve to a blank or half-painted palette because a\n * theme was deleted after it was pinned.\n */\nexport function resolveTerminalVariant(\n terminalThemeId: string | undefined,\n registry: readonly ThemeVariant[]\n): ThemeVariant | undefined {\n if (terminalThemeId === undefined || terminalThemeId === THEME_DEFAULT_ID) return undefined\n return registry.find((candidate) => candidate.id === terminalThemeId)\n}\n\n/**\n * The font settings a zoom chord asks for: one pixel up or down on every axis, or\n * the defaults for `reset`.\n */\nexport function zoomedFontSettings(\n selection: ThemeSelection,\n intent: FontZoomIntent\n): AppearanceEditorFontSettings {\n if (intent === 'reset') return { ...DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS }\n return stepAppearanceFontSizes(selection.fonts, intent === 'in' ? 1 : -1)\n}\n\n/**\n * The registry a provider resolves against: the catalogue, then the host's extras.\n *\n * The catalogue wins an id collision, because it is listed first and `resolveVariant`\n * takes the first match: a host's variant can add a theme but cannot shadow one.\n */\nexport function mergeRegistry(\n builtin: readonly ThemeVariant[],\n extra: readonly ThemeVariant[] | undefined\n): readonly ThemeVariant[] {\n return extra && extra.length > 0 ? [...builtin, ...extra] : builtin\n}\n\n/**\n * The roles an accent paints over a variant, for {@link ThemeContextValue.accentRolesFor}.\n *\n * Resolved against the committed selection's theme pair, so an `ansi-*` accent means\n * the same colour here as it does on `<html>`.\n */\nexport function accentRolesForState(\n engine: Pick<ThemeEngine, 'accentRolesForSelection'>,\n accent: string | null,\n variantId: string | undefined,\n state: {\n selection: ThemeSelection\n variant: ThemeVariant\n registry: readonly ThemeVariant[]\n accentContrastFloor?: number\n }\n): AccentRoles | undefined {\n if (accent === null) return undefined\n const variant =\n variantId === undefined\n ? state.variant\n : state.registry.find((candidate) => candidate.id === variantId)\n if (!variant) return undefined\n return engine.accentRolesForSelection(accent, variant.appearance, state.selection, {\n background: variant.colors.background,\n floor: state.accentContrastFloor,\n variantId: variant.id,\n })\n}\n"],"mappings":";;;;;;;;;;;;AA0GA,IAAa,wBAAwC;CACnD,YAAY;CACZ,GAAG;CACH,QAAQ;CACR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UAAU,GAAG,UAAU;CACtF;AACF;;;;;;;;;AAUA,SAAgB,uBACd,iBACA,UAC0B;CAC1B,IAAI,oBAAoB,KAAA,KAAa,oBAAA,SAAsC,OAAO,KAAA;CAClF,OAAO,SAAS,MAAM,cAAc,UAAU,OAAO,eAAe;AACtE;;;;;AAMA,SAAgB,mBACd,WACA,QAC8B;CAC9B,IAAI,WAAW,SAAS,OAAO,EAAE,GAAG,wCAAwC;CAC5E,OAAO,wBAAwB,UAAU,OAAO,WAAW,OAAO,IAAI,EAAE;AAC1E;;;;;;;AAQA,SAAgB,cACd,SACA,OACyB;CACzB,OAAO,SAAS,MAAM,SAAS,IAAI,CAAC,GAAG,SAAS,GAAG,KAAK,IAAI;AAC9D;;;;;;;AAQA,SAAgB,oBACd,QACA,QACA,WACA,OAMyB;CACzB,IAAI,WAAW,MAAM,OAAO,KAAA;CAC5B,MAAM,UACJ,cAAc,KAAA,IACV,MAAM,UACN,MAAM,SAAS,MAAM,cAAc,UAAU,OAAO,SAAS;CACnE,IAAI,CAAC,SAAS,OAAO,KAAA;CACrB,OAAO,OAAO,wBAAwB,QAAQ,QAAQ,YAAY,MAAM,WAAW;EACjF,YAAY,QAAQ,OAAO;EAC3B,OAAO,MAAM;EACb,WAAW,QAAQ;CACrB,CAAC;AACH"}
@@ -4,7 +4,7 @@ import { ToggleGroup } from '../ui/toggle-group';
4
4
  * ThemeToggle.
5
5
  *
6
6
  * Three states, not two: light, dark, and follow the system. A two-state switch is
7
- * the common mistake — it forces a choice on someone who wanted the application to
7
+ * the common mistake, it forces a choice on someone who wanted the application to
8
8
  * track their OS, and it has no way to say "I have not decided", so the first click
9
9
  * silently overrides a system preference the user set deliberately.
10
10
  *
@@ -1 +1 @@
1
- {"version":3,"file":"theme-toggle.js","names":["Monitor","Moon","Sun","For","splitProps","cn","ToggleGroup","ToggleGroupItem","useTheme","withLabels","APPEARANCES","value","label","icon","ThemeToggle","props","local","rest","selection","setSelection","_$createComponent","_$mergeProps","attached","appearance","onChange","class","children","each","variant","size","_$memo","_el$","_tmpl$","_$insert"],"sources":["../../../src/components/theme/theme-toggle.tsx"],"sourcesContent":["import { Monitor, Moon, Sun } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { For, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { ToggleGroup, ToggleGroupItem } from '../ui/toggle-group'\nimport { useTheme } from './theme-context'\n\n/**\n * ThemeToggle.\n *\n * Three states, not two: light, dark, and follow the system. A two-state switch is\n * the common mistake — it forces a choice on someone who wanted the application to\n * track their OS, and it has no way to say \"I have not decided\", so the first click\n * silently overrides a system preference the user set deliberately.\n *\n * The icons carry the state and the accessible name comes from the label, so the\n * control is usable without seeing which glyph is lit.\n */\nexport type ThemeToggleProps = Omit<ComponentProps<typeof ToggleGroup>, 'children'> & {\n /** Draw labels beside the icons. Off by default: a toolbar wants icons. */\n withLabels?: boolean\n}\n\nconst APPEARANCES = [\n { value: 'light', label: 'Light', icon: Sun },\n { value: 'dark', label: 'Dark', icon: Moon },\n { value: 'system', label: 'System', icon: Monitor },\n] as const\n\nexport function ThemeToggle(props: ThemeToggleProps) {\n const [local, rest] = splitProps(props, ['class', 'withLabels'])\n const { selection, setSelection } = useTheme()\n\n return (\n <ToggleGroup\n attached\n value={selection().appearance}\n onChange={(value: string | null) => {\n // A toggle group reports the pressed value or null; null would leave the\n // appearance unset, so a re-press keeps the current one.\n if (typeof value === 'string') {\n setSelection({ appearance: value as 'light' | 'dark' | 'system' })\n }\n }}\n aria-label=\"Appearance\"\n class={cn(local.class)}\n {...rest}\n >\n <For each={APPEARANCES}>\n {(appearance) => (\n <ToggleGroupItem\n value={appearance.value}\n variant=\"outline\"\n size={local.withLabels ? 'sm' : 'icon-sm'}\n aria-label={appearance.label}\n >\n <appearance.icon />\n {local.withLabels ? <span>{appearance.label}</span> : null}\n </ToggleGroupItem>\n )}\n </For>\n </ToggleGroup>\n )\n}\n"],"mappings":";;;;;;;;AAuBA,IAAMU,cAAc;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itProps","cn","ToggleGroup","ToggleGroupItem","useTheme","withLabels","APPEARANCES","value","label","icon","ThemeToggle","props","local","rest","selection","setSelection","_$createComponent","_$mergeProps","attached","appearance","onChange","class","children","each","variant","size","_$memo","_el$","_tmpl$","_$insert"],"sources":["../../../src/components/theme/theme-toggle.tsx"],"sourcesContent":["import { Monitor, Moon, Sun } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { For, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { ToggleGroup, ToggleGroupItem } from '../ui/toggle-group'\nimport { useTheme } from './theme-context'\n\n/**\n * ThemeToggle.\n *\n * Three states, not two: light, dark, and follow the system. A two-state switch is\n * the common mistake, it forces a choice on someone who wanted the application to\n * track their OS, and it has no way to say \"I have not decided\", so the first click\n * silently overrides a system preference the user set deliberately.\n *\n * The icons carry the state and the accessible name comes from the label, so the\n * control is usable without seeing which glyph is lit.\n */\nexport type ThemeToggleProps = Omit<ComponentProps<typeof ToggleGroup>, 'children'> & {\n /** Draw labels beside the icons. Off by default: a toolbar wants icons. */\n withLabels?: boolean\n}\n\nconst APPEARANCES = [\n { value: 'light', label: 'Light', icon: Sun },\n { value: 'dark', label: 'Dark', icon: Moon },\n { value: 'system', label: 'System', icon: Monitor },\n] as const\n\nexport function ThemeToggle(props: ThemeToggleProps) {\n const [local, rest] = splitProps(props, ['class', 'withLabels'])\n const { selection, setSelection } = useTheme()\n\n return (\n <ToggleGroup\n attached\n value={selection().appearance}\n onChange={(value: string | null) => {\n // A toggle group reports the pressed value or null; null would leave the\n // appearance unset, so a re-press keeps the current one.\n if (typeof value === 'string') {\n setSelection({ appearance: value as 'light' | 'dark' | 'system' })\n }\n }}\n aria-label=\"Appearance\"\n class={cn(local.class)}\n {...rest}\n >\n <For each={APPEARANCES}>\n {(appearance) => (\n <ToggleGroupItem\n value={appearance.value}\n variant=\"outline\"\n size={local.withLabels ? 'sm' : 'icon-sm'}\n aria-label={appearance.label}\n >\n <appearance.icon />\n {local.with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AAA;GAAA,CAAA;EAE7D,CAAA;CAAA,EAAA,CAAA,CAAA;AAIT"}
@@ -1 +1 @@
1
- {"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/alert/alert.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAGnD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAGtD;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,aAAa;;8EAclB,CAAA;AAkBD,KAAK,iBAAiB,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,CAAA;AAE3D,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC,KAAK,CAAC,GAC5C,iBAAiB,GAAG;IAClB,yEAAyE;IACzE,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,IAAI,CAAA;CAC1B,CAAA;AAEH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,eAuBtC;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,eAStD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,eAS5D;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,eASvD;AAED,OAAO,EAAE,aAAa,EAAE,CAAA"}
1
+ {"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/alert/alert.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAGnD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAGtD;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,aAAa;;8EAclB,CAAA;AAkBD,KAAK,iBAAiB,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,CAAA;AAE3D,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC,KAAK,CAAC,GAC5C,iBAAiB,GAAG;IAClB,yEAAyE;IACzE,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,IAAI,CAAA;CAC1B,CAAA;AAEH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,eAwBtC;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,eAStD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,eAS5D;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,eASvD;AAED,OAAO,EAAE,aAAa,EAAE,CAAA"}
@@ -2,7 +2,7 @@ import { cva } from "../../../lib/variants.js";
2
2
  import { cn } from "../../../lib/utils.js";
3
3
  import { Dynamic, className, createComponent, effect, insert, memo, mergeProps, spread, template } from "solid-js/web";
4
4
  import { AlertCircle, CheckCircle2, Info, TriangleAlert } from "lucide-solid";
5
- import { splitProps } from "solid-js";
5
+ import { children, splitProps } from "solid-js";
6
6
  // src/components/ui/alert/alert.tsx
7
7
  var _tmpl$ = /*#__PURE__*/ template(`<div data-slot=alert role=alert>`);
8
8
  var _tmpl$2 = /*#__PURE__*/ template(`<span data-slot=alert-icon>`);
@@ -54,16 +54,17 @@ function Alert(props) {
54
54
  "children"
55
55
  ]);
56
56
  const tone = () => local.variant ?? "default";
57
+ const icon = children(() => local.icon);
57
58
  return (() => {
58
59
  var _el$ = _tmpl$();
59
60
  spread(_el$, mergeProps({ get ["class"]() {
60
61
  return cn(alertVariants({ variant: local.variant }), local.class);
61
62
  } }, rest), false, true);
62
63
  insert(_el$, (() => {
63
- var _c$ = memo(() => local.icon === null);
64
+ var _c$ = memo(() => icon() === null);
64
65
  return () => _c$() ? null : (() => {
65
66
  var _el$2 = _tmpl$2();
66
- insert(_el$2, () => local.icon ?? createComponent(Dynamic, { get component() {
67
+ insert(_el$2, () => icon() ?? createComponent(Dynamic, { get component() {
67
68
  return alertIcons[tone()];
68
69
  } }));
69
70
  effect(() => className(_el$2, cn("row-span-2 pt-0.5 [&_svg]:size-4", alertIconTones[tone()])));
@@ -1 +1 @@
1
- {"version":3,"file":"alert.js","names":["AlertCircle","CheckCircle2","Info","TriangleAlert","splitProps","Dynamic","cva","cn","alertVariants","variants","variant","default","destructive","success","warning","info","defaultVariants","alertIcons","alertIconTones","icon","Alert","props","local","rest","tone","_el$","_tmpl$","_$spread","_$mergeProps","class","_$insert","_c$","_$memo","_el$2","_tmpl$2","_$createComponent","component","_$effect","_$className","children","AlertTitle","_el$3","_tmpl$3","AlertDescription","_el$4","_tmpl$4","AlertAction","_el$5","_tmpl$5"],"sources":["../../../../src/components/ui/alert/alert.tsx"],"sourcesContent":["import { AlertCircle, CheckCircle2, Info, TriangleAlert } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { Dynamic } from 'solid-js/web'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\n\n/**\n * Alert.\n *\n * A message about the whole surface it sits in — a form's validation summary,\n * a failed sync banner, a permission notice. It is deliberately not a dialog:\n * an alert that must be dismissed before the user can continue is a Dialog.\n *\n * The glyph follows the tone rather than being passed in, so an alert cannot\n * be given a green checkmark on a destructive fill. A caller that genuinely\n * needs a different icon passes `icon`; `icon={null}` removes it. Text stays on\n * the body foreground over the tinted status surface, while the glyph and edge\n * carry the status hue.\n */\nconst alertVariants = cva(\n 'relative grid w-full grid-cols-[auto_1fr] items-start gap-x-3 gap-y-1 rounded-lg border px-3 py-2.5 text-sm',\n {\n variants: {\n variant: {\n default: 'bg-card text-card-foreground border-border',\n destructive: 'bg-destructive-subtle text-foreground border-destructive/30',\n success: 'bg-success-subtle text-foreground border-success/30',\n warning: 'bg-warning-subtle text-foreground border-warning/30',\n info: 'bg-info-subtle text-foreground border-info/30',\n },\n },\n defaultVariants: { variant: 'default' },\n }\n)\n\nconst alertIcons = {\n default: Info,\n destructive: AlertCircle,\n success: CheckCircle2,\n warning: TriangleAlert,\n info: Info,\n} as const\n\nconst alertIconTones = {\n default: 'text-muted-foreground',\n destructive: 'text-destructive',\n success: 'text-success',\n warning: 'text-warning',\n info: 'text-info',\n} as const\n\ntype AlertVariantProps = VariantProps<typeof alertVariants>\n\nexport type AlertProps = ComponentProps<'div'> &\n AlertVariantProps & {\n /** Replace the tone's glyph with your own element. `null` removes it. */\n icon?: JSX.Element | null\n }\n\nexport function Alert(props: AlertProps) {\n const [local, rest] = splitProps(props, ['class', 'variant', 'icon', 'children'])\n\n const tone = () => local.variant ?? 'default'\n\n return (\n <div\n data-slot=\"alert\"\n role=\"alert\"\n class={cn(alertVariants({ variant: local.variant }), local.class)}\n {...rest}\n >\n {local.icon === null ? null : (\n <span\n data-slot=\"alert-icon\"\n class={cn('row-span-2 pt-0.5 [&_svg]:size-4', alertIconTones[tone()])}\n >\n {local.icon ?? <Dynamic component={alertIcons[tone()]} />}\n </span>\n )}\n {local.children}\n </div>\n )\n}\n\nexport function AlertTitle(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"alert-title\"\n class={cn('col-start-2 font-medium tracking-tight', local.class)}\n {...rest}\n />\n )\n}\n\nexport function AlertDescription(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"alert-description\"\n class={cn('col-start-2 text-sm [&_p]:leading-relaxed', local.class)}\n {...rest}\n />\n )\n}\n\n/**\n * The alert's own actions — a Retry, an Open settings, a Cancel — on a row\n * under the text, aligned with the title rather than the glyph. Buttons here\n * are `size=\"xs\" variant=\"outline\"` by convention, so an alert's action reads\n * as part of the message rather than as the page's primary action.\n */\nexport function AlertAction(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"alert-action\"\n class={cn('col-start-2 mt-1 flex flex-wrap items-center gap-2', local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A;EAAA,OAAAd;CAAA,EAAA,CAAA;AAGrB;AAEA,SAAgBe,WAAWnB,OAA8B;CACvD,MAAM,CAACC,OAAOC,QAAQnB,WAAWiB,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAoB,QAAAC,QAAA;EAAAf,OAAAc,OAAAb,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWrB,GAAG,0CAA0Ce,MAAMO,KAAK;EAAC,EAAA,GAC5DN,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAkB;CAAA,EAAA,CAAA;AAGd;AAEA,SAAgBE,iBAAiBtB,OAA8B;CAC7D,MAAM,CAACC,OAAOC,QAAQnB,WAAWiB,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAuB,QAAAC,QAAA;EAAAlB,OAAAiB,OAAAhB,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWrB,GAAG,6CAA6Ce,MAAMO,KAAK;EAAC,EAAA,GAC/DN,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAqB;CAAA,EAAA,CAAA;AAGd;;;;;;;AAQA,SAAgBE,YAAYzB,OAA8B;CACxD,MAAM,CAACC,OAAOC,QAAQnB,WAAWiB,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAA0B,QAAAC,QAAA;EAAArB,OAAAoB,OAAAnB,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWrB,GAAG,sDAAsDe,MAAMO,KAAK;EAAC,EAAA,GACxEN,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAwB;CAAA,EAAA,CAAA;AAGd"}
1
+ {"version":3,"file":"alert.js","names":["AlertCircle","CheckCircle2","Info","TriangleAlert","children","resolveChildren","splitProps","Dynamic","cva","cn","alertVariants","variants","variant","default","destructive","success","warning","info","defaultVariants","alertIcons","alertIconTones","icon","Alert","props","local","rest","tone","_el$","_tmpl$","_$spread","_$mergeProps","class","_$insert","_c$","_$memo","_el$2","_tmpl$2","_$createComponent","component","_$effect","_$className","AlertTitle","_el$3","_tmpl$3","AlertDescription","_el$4","_tmpl$4","AlertAction","_el$5","_tmpl$5"],"sources":["../../../../src/components/ui/alert/alert.tsx"],"sourcesContent":["import { AlertCircle, CheckCircle2, Info, TriangleAlert } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { children as resolveChildren, splitProps } from 'solid-js'\nimport { Dynamic } from 'solid-js/web'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\n\n/**\n * Alert.\n *\n * A message about the whole surface it sits in — a form's validation summary,\n * a failed sync banner, a permission notice. It is deliberately not a dialog:\n * an alert that must be dismissed before the user can continue is a Dialog.\n *\n * The glyph follows the tone rather than being passed in, so an alert cannot\n * be given a green checkmark on a destructive fill. A caller that genuinely\n * needs a different icon passes `icon`; `icon={null}` removes it. Text stays on\n * the body foreground over the tinted status surface, while the glyph and edge\n * carry the status hue.\n */\nconst alertVariants = cva(\n 'relative grid w-full grid-cols-[auto_1fr] items-start gap-x-3 gap-y-1 rounded-lg border px-3 py-2.5 text-sm',\n {\n variants: {\n variant: {\n default: 'bg-card text-card-foreground border-border',\n destructive: 'bg-destructive-subtle text-foreground border-destructive/30',\n success: 'bg-success-subtle text-foreground border-success/30',\n warning: 'bg-warning-subtle text-foreground border-warning/30',\n info: 'bg-info-subtle text-foreground border-info/30',\n },\n },\n defaultVariants: { variant: 'default' },\n }\n)\n\nconst alertIcons = {\n default: Info,\n destructive: AlertCircle,\n success: CheckCircle2,\n warning: TriangleAlert,\n info: Info,\n} as const\n\nconst alertIconTones = {\n default: 'text-muted-foreground',\n destructive: 'text-destructive',\n success: 'text-success',\n warning: 'text-warning',\n info: 'text-info',\n} as const\n\ntype AlertVariantProps = VariantProps<typeof alertVariants>\n\nexport type AlertProps = ComponentProps<'div'> &\n AlertVariantProps & {\n /** Replace the tone's glyph with your own element. `null` removes it. */\n icon?: JSX.Element | null\n }\n\nexport function Alert(props: AlertProps) {\n const [local, rest] = splitProps(props, ['class', 'variant', 'icon', 'children'])\n\n const tone = () => local.variant ?? 'default'\n const icon = resolveChildren(() => local.icon)\n\n return (\n <div\n data-slot=\"alert\"\n role=\"alert\"\n class={cn(alertVariants({ variant: local.variant }), local.class)}\n {...rest}\n >\n {icon() === null ? null : (\n <span\n data-slot=\"alert-icon\"\n class={cn('row-span-2 pt-0.5 [&_svg]:size-4', alertIconTones[tone()])}\n >\n {icon() ?? <Dynamic component={alertIcons[tone()]} />}\n </span>\n )}\n {local.children}\n </div>\n )\n}\n\nexport function AlertTitle(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"alert-title\"\n class={cn('col-start-2 font-medium tracking-tight', local.class)}\n {...rest}\n />\n )\n}\n\nexport function AlertDescription(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"alert-description\"\n class={cn('col-start-2 text-sm [&_p]:leading-relaxed', local.class)}\n {...rest}\n />\n )\n}\n\n/**\n * The alert's own actions — a Retry, an Open settings, a Cancel — on a row\n * under the text, aligned with the title rather than the glyph. Buttons here\n * are `size=\"xs\" variant=\"outline\"` by convention, so an alert's action reads\n * as part of the message rather than as the page's primary action.\n */\nexport function AlertAction(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"alert-action\"\n class={cn('col-start-2 mt-1 flex flex-wrap items-center gap-2', local.class)}\n {...rest}\n />\n )\n}\n\nexport { alertVariants }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAoBA,IAAMU,gBAAgBF,IACpB,+GACA;CACEG,UAAU,EACRC,SAAS;EACPC,SAAS;EACTC,aAAa;EACbC,SAAS;EACTC,SAAS;EACTC,MAAM;CACR,EACF;CACAC,iBAAiB,EAAEN,SAAS,UAAU;AACxC,CACF;AAEA,IAAMO,aAAa;CACjBN,SAASX;CACTY,aAAad;CACbe,SAASd;CACTe,SAASb;CACTc,MAAMf;AACR;AAEA,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AA;EAAA,OAAAiB;CAAA,EAAA,CAAA;AAGd;AAEA,SAAgBE,iBAAiBrB,OAA8B;CAC7D,MAAM,CAACC,OAAOC,QAAQnB,WAAWiB,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAsB,QAAAC,QAAA;EAAAjB,OAAAgB,OAAAf,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWrB,GAAG,6CAA6Ce,MAAMO,KAAK;EAAC,EAAA,GAC/DN,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAoB;CAAA,EAAA,CAAA;AAGd;;;;;;;AAQA,SAAgBE,YAAYxB,OAA8B;CACxD,MAAM,CAACC,OAAOC,QAAQnB,WAAWiB,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAyB,QAAAC,QAAA;EAAApB,OAAAmB,OAAAlB,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWrB,GAAG,sDAAsDe,MAAMO,KAAK;EAAC,EAAA,GACxEN,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAuB;CAAA,EAAA,CAAA;AAGd"}
@@ -7,7 +7,7 @@ import type { Accessor, ComponentProps } from 'solid-js';
7
7
  * and the user must choose one of the actions. Escape is the keyboard's Cancel: it
8
8
  * closes the dialog exactly as the cancel action does, so nothing is confirmed. That
9
9
  * is the whole difference from Dialog, and it is why this exists as its own
10
- * component rather than a prop — a caller has to reach for it deliberately.
10
+ * component rather than a prop, a caller has to reach for it deliberately.
11
11
  *
12
12
  * The consequence is a rule of use: this is for confirming a destructive or
13
13
  * irreversible step. Wrapping an ordinary form in an AlertDialog traps someone who
@@ -19,7 +19,7 @@ function AlertDialogOverlay(props) {
19
19
  * The panel.
20
20
  *
21
21
  * Kobalte's `AlertDialog.Content` is `Dialog.Content` with `role="alertdialog"`
22
- * and nothing else — an outside click dismisses it exactly as it dismisses a
22
+ * and nothing else, an outside click dismisses it exactly as it dismisses a
23
23
  * Dialog. That is a real gap in the primitive, so the blocking is implemented
24
24
  * here, and it is the whole difference between this component and a Dialog:
25
25
  *
@@ -126,8 +126,8 @@ function AlertDialogDescription(props) {
126
126
  * destructive action from the safe one.
127
127
  *
128
128
  * The injected label is removed rather than overridden with an empty one. An empty
129
- * `aria-label` is not reliably ignored — some name computations treat its presence
130
- * as an explicit empty name, which leaves the button unnamed — so the attribute
129
+ * `aria-label` is not reliably ignored, some name computations treat its presence
130
+ * as an explicit empty name, which leaves the button unnamed, so the attribute
131
131
  * has to go, and the visible text becomes the name. A caller whose button is an
132
132
  * icon passes its own `aria-label`, and that one is left alone.
133
133
  *
@@ -1 +1 @@
1
- {"version":3,"file":"alert-dialog.js","names":["KobalteAlertDialog","KobalteAlertDialogContent","createEffect","createSignal","splitProps","dialogSurface","overlayDescription","overlayFooter","overlayHeader","overlayMotion","overlayPositioner","overlayScrim","overlayScrimMotion","overlayTitle","cn","createDialogLayer","DialogEscapeTarget","Portal","AlertDialogOverlay","props","Overlay","local","rest","_$createComponent","_$mergeProps","class","blockDismissal","onPointerDownOutside","event","preventDefault","onFocusOutside","onInteractOutside","restoreFocusRef","AlertDialogContent","layer","onOpenAutoFocus","onCloseAutoFocus","children","_el$","_tmpl$","_$className","_$insert","onEscapeKeyDown","AlertDialogHeader","_el$2","_tmpl$2","_$spread","AlertDialogFooter","_el$3","_tmpl$3","AlertDialogTitle","Title","AlertDialogDescription","Description","AlertDialogChoice","CloseButton","wrapper","setWrapper","root","undefined","querySelector","removeAttribute","_el$4","_tmpl$4","_$use","AlertDialogAction","AlertDialogCancel"],"sources":["../../../../src/components/ui/alert-dialog/alert-dialog.tsx"],"sourcesContent":["import {\n AlertDialog as KobalteAlertDialog,\n Content as KobalteAlertDialogContent,\n} from '@kobalte/core/alert-dialog'\n// Use the alert-specific export rather than DialogRoot.Content, which other imports can replace.\nimport type { Accessor, ComponentProps } from 'solid-js'\nimport { createEffect, createSignal, splitProps } from 'solid-js'\nimport {\n dialogSurface,\n overlayDescription,\n overlayFooter,\n overlayHeader,\n overlayMotion,\n overlayPositioner,\n overlayScrim,\n overlayScrimMotion,\n overlayTitle,\n} from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { createDialogLayer, DialogEscapeTarget } from '../dialog/dialog-layer'\n\n/**\n * AlertDialog.\n *\n * A dialog that cannot be dismissed by accident: a click on the scrim does nothing,\n * and the user must choose one of the actions. Escape is the keyboard's Cancel: it\n * closes the dialog exactly as the cancel action does, so nothing is confirmed. That\n * is the whole difference from Dialog, and it is why this exists as its own\n * component rather than a prop — a caller has to reach for it deliberately.\n *\n * The consequence is a rule of use: this is for confirming a destructive or\n * irreversible step. Wrapping an ordinary form in an AlertDialog traps someone who\n * wants to back out.\n *\n * There is deliberately no close button in the corner. An X has no label, and the\n * point of this surface is that every exit is a named choice.\n */\nexport {\n Root as AlertDialog,\n Trigger as AlertDialogTrigger,\n Portal as AlertDialogPortal,\n} from '@kobalte/core/alert-dialog'\n\nexport function AlertDialogOverlay(props: ComponentProps<typeof KobalteAlertDialog.Overlay>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteAlertDialog.Overlay\n class={cn(overlayScrim, overlayScrimMotion, local.class)}\n {...rest}\n />\n )\n}\n\n/**\n * The panel.\n *\n * Kobalte's `AlertDialog.Content` is `Dialog.Content` with `role=\"alertdialog\"`\n * and nothing else — an outside click dismisses it exactly as it dismisses a\n * Dialog. That is a real gap in the primitive, so the blocking is implemented\n * here, and it is the whole difference between this component and a Dialog:\n *\n * - Pointer and focus interactions outside are prevented, including the scrim\n * click, because a stray click that closes a confirmation is a click that\n * makes \"confirm\" meaningless.\n *\n * Escape is deliberately left to the primitive. It can only ever cancel, never\n * confirm, so it is not an accident that matters; refusing it traps a keyboard\n * user who has changed their mind, and the WAI-ARIA alertdialog pattern says\n * Escape closes. It reports `onOpenChange(false)` and returns focus to what had\n * it before the confirmation opened, which is what the cancel action does, and\n * as the topmost layer it closes only the confirmation, not a dialog underneath.\n *\n * There is deliberately no prop to turn the scrim blocking off. A surface that can be escaped\n * accidentally does not need to be an AlertDialog; it is a Dialog, and using this\n * one would be a claim about the flow that is not true.\n */\nconst blockDismissal = {\n onPointerDownOutside: (event: Event) => event.preventDefault(),\n onFocusOutside: (event: Event) => event.preventDefault(),\n onInteractOutside: (event: Event) => event.preventDefault(),\n} as const\n\nexport type AlertDialogContentProps = ComponentProps<typeof KobalteAlertDialogContent> & {\n /** The control to focus on close when the one focused before opening is gone by then. */\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n}\n\nexport function AlertDialogContent(props: AlertDialogContentProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'children',\n 'restoreFocusRef',\n 'onOpenAutoFocus',\n 'onCloseAutoFocus',\n ])\n const layer = createDialogLayer({\n restoreFocusRef: local.restoreFocusRef,\n onOpenAutoFocus: (event) => local.onOpenAutoFocus?.(event),\n onCloseAutoFocus: (event) => local.onCloseAutoFocus?.(event),\n })\n\n return (\n <KobalteAlertDialog.Portal>\n <AlertDialogOverlay />\n <div class={overlayPositioner}>\n <KobalteAlertDialogContent\n {...blockDismissal}\n class={cn(\n dialogSurface,\n overlayMotion,\n 'grid max-h-full w-full max-w-md gap-4 overflow-y-auto p-5',\n local.class\n )}\n {...rest}\n onOpenAutoFocus={layer.onOpenAutoFocus}\n onCloseAutoFocus={layer.onCloseAutoFocus}\n >\n <DialogEscapeTarget onEscapeKeyDown={props.onEscapeKeyDown}>\n {local.children}\n </DialogEscapeTarget>\n </KobalteAlertDialogContent>\n </div>\n </KobalteAlertDialog.Portal>\n )\n}\n\nexport function AlertDialogHeader(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return <div data-slot=\"alert-dialog-header\" class={cn(overlayHeader, local.class)} {...rest} />\n}\n\nexport function AlertDialogFooter(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return <div data-slot=\"alert-dialog-footer\" class={cn(overlayFooter, local.class)} {...rest} />\n}\n\nexport function AlertDialogTitle(props: ComponentProps<typeof KobalteAlertDialog.Title>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteAlertDialog.Title class={cn(overlayTitle, local.class)} {...rest} />\n}\n\nexport function AlertDialogDescription(\n props: ComponentProps<typeof KobalteAlertDialog.Description>\n) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteAlertDialog.Description class={cn(overlayDescription, local.class)} {...rest} />\n}\n\n/**\n * One of the dialog's two named choices.\n *\n * Kobalte labels its close button \"Dismiss\" by default, because a generic close\n * button is usually an icon with no text of its own. In an AlertDialog it is\n * something else: the named choices. An `aria-label` there *replaces* the visible\n * text, so a screen reader hears \"Dismiss\" twice and the user cannot tell the\n * destructive action from the safe one.\n *\n * The injected label is removed rather than overridden with an empty one. An empty\n * `aria-label` is not reliably ignored — some name computations treat its presence\n * as an explicit empty name, which leaves the button unnamed — so the attribute\n * has to go, and the visible text becomes the name. A caller whose button is an\n * icon passes its own `aria-label`, and that one is left alone.\n *\n * Applied through a layout-neutral wrapper because Kobalte keeps the `ref` for its\n * own dismissable layer and does not forward it. The wrapper is `display: contents`\n * so the button remains the flex item its parent lays out.\n */\nfunction AlertDialogChoice(props: ComponentProps<typeof KobalteAlertDialog.CloseButton>) {\n const [local, rest] = splitProps(props, ['class', 'aria-label'])\n const [wrapper, setWrapper] = createSignal<HTMLSpanElement>()\n\n createEffect(() => {\n const root = wrapper()\n if (!root || local['aria-label'] !== undefined) return\n root.querySelector('button')?.removeAttribute('aria-label')\n })\n\n return (\n <span ref={setWrapper} class=\"contents\">\n <KobalteAlertDialog.CloseButton\n class={cn(local.class)}\n aria-label={local['aria-label']}\n {...rest}\n />\n </span>\n )\n}\n\nexport function AlertDialogAction(props: ComponentProps<typeof KobalteAlertDialog.CloseButton>) {\n return <AlertDialogChoice {...props} />\n}\n\nexport function AlertDialogCancel(props: ComponentProps<typeof KobalteAlertDialog.CloseButton>) {\n return <AlertDialogChoice {...props} />\n}\n"],"mappings":";;;;;;;;;;;AA2CA,SAAgBkB,mBAAmBC,OAA0D;CAC3F,MAAM,CA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nC,OAA8D;CACvF,MAAM,CAACE,OAAOC,QAAQlB,WAAWe,OAAO,CAAC,SAAS,YAAY,CAAC;CAC/D,MAAM,CAACqC,SAASC,cAActD,aAA8B;CAE5DD,mBAAmB;EACjB,MAAMwD,OAAOF,QAAQ;EACrB,IAAI,CAACE,QAAQrC,MAAM,kBAAkBsC,KAAAA,GAAW;EAChDD,KAAKE,cAAc,QAAQ,CAAC,EAAEC,gBAAgB,YAAY;CAC5D,CAAC;CAED,cAAA;EAAA,IAAAC,QAAAC,QAAA;EAAAC,IACaP,YAAUK,KAAA;EAAArB,OAAAqB,OAAAvC,gBAClBvB,YAAmBuD,aAAW/B,WAAA;GAAA,KAAA,WAAA;IAAA,OACtBV,GAAGO,MAAMI,KAAK;GAAC;GAAA,KAAA,gBAAA;IAAA,OACVJ,MAAM;GAAa;EAAA,GAC3BC,IAAI,CAAA,CAAA;EAAA,OAAAwC;CAAA,EAAA,CAAA;AAIhB;AAEA,SAAgBG,kBAAkB9C,OAA8D;CAC9F,OAAAI,gBAAQ+B,mBAAsBnC,KAAK;AACrC;AAEA,SAAgB+C,kBAAkB/C,OAA8D;CAC9F,OAAAI,gBAAQ+B,mBAAsBnC,KAAK;AACrC"}
1
+ {"version":3,"file":"alert-dialog.js","names":["KobalteAlertDialog","KobalteAlertDialogContent","createEffect","createSignal","splitProps","dialogSurface","overlayDescription","overlayFooter","overlayHeader","overlayMotion","overlayPositioner","overlayScrim","overlayScrimMotion","overlayTitle","cn","createDialogLayer","DialogEscapeTarget","Portal","AlertDialogOverlay","props","Overlay","local","rest","_$createComponent","_$mergeProps","class","blockDismissal","onPointerDownOutside","event","preventDefault","onFocusOutside","onInteractOutside","restoreFocusRef","AlertDialogContent","layer","onOpenAutoFocus","onCloseAutoFocus","children","_el$","_tmpl$","_$className","_$insert","onEscapeKeyDown","AlertDialogHeader","_el$2","_tmpl$2","_$spread","AlertDialogFooter","_el$3","_tmpl$3","AlertDialogTitle","Title","AlertDialogDescription","Description","AlertDialogChoice","CloseButton","wrapper","setWrapper","root","undefined","querySelector","removeAttribute","_el$4","_tmpl$4","_$use","AlertDialogAction","AlertDialogCancel"],"sources":["../../../../src/components/ui/alert-dialog/alert-dialog.tsx"],"sourcesContent":["import {\n AlertDialog as KobalteAlertDialog,\n Content as KobalteAlertDialogContent,\n} from '@kobalte/core/alert-dialog'\n// Use the alert-specific export rather than DialogRoot.Content, which other imports can replace.\nimport type { Accessor, ComponentProps } from 'solid-js'\nimport { createEffect, createSignal, splitProps } from 'solid-js'\nimport {\n dialogSurface,\n overlayDescription,\n overlayFooter,\n overlayHeader,\n overlayMotion,\n overlayPositioner,\n overlayScrim,\n overlayScrimMotion,\n overlayTitle,\n} from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { createDialogLayer, DialogEscapeTarget } from '../dialog/dialog-layer'\n\n/**\n * AlertDialog.\n *\n * A dialog that cannot be dismissed by accident: a click on the scrim does nothing,\n * and the user must choose one of the actions. Escape is the keyboard's Cancel: it\n * closes the dialog exactly as the cancel action does, so nothing is confirmed. That\n * is the whole difference from Dialog, and it is why this exists as its own\n * component rather than a prop, a caller has to reach for it deliberately.\n *\n * The consequence is a rule of use: this is for confirming a destructive or\n * irreversible step. Wrapping an ordinary form in an AlertDialog traps someone who\n * wants to back out.\n *\n * There is deliberately no close button in the corner. An X has no label, and the\n * point of this surface is that every exit is a named choice.\n */\nexport {\n Root as AlertDialog,\n Trigger as AlertDialogTrigger,\n Portal as AlertDialogPortal,\n} from '@kobalte/core/alert-dialog'\n\nexport function AlertDialogOverlay(props: ComponentProps<typeof KobalteAlertDialog.Overlay>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteAlertDialog.Overlay\n class={cn(overlayScrim, overlayScrimMotion, local.class)}\n {...rest}\n />\n )\n}\n\n/**\n * The panel.\n *\n * Kobalte's `AlertDialog.Content` is `Dialog.Content` with `role=\"alertdialog\"`\n * and nothing else, an outside click dismisses it exactly as it dismisses a\n * Dialog. That is a real gap in the primitive, so the blocking is implemented\n * here, and it is the whole difference between this component and a Dialog:\n *\n * - Pointer and focus interactions outside are prevented, including the scrim\n * click, because a stray click that closes a confirmation is a click that\n * makes \"confirm\" meaningless.\n *\n * Escape is deliberately left to the primitive. It can only ever cancel, never\n * confirm, so it is not an accident that matters; refusing it traps a keyboard\n * user who has changed their mind, and the WAI-ARIA alertdialog pattern says\n * Escape closes. It reports `onOpenChange(false)` and returns focus to what had\n * it before the confirmation opened, which is what the cancel action does, and\n * as the topmost layer it closes only the confirmation, not a dialog underneath.\n *\n * There is deliberately no prop to turn the scrim blocking off. A surface that can be escaped\n * accidentally does not need to be an AlertDialog; it is a Dialog, and using this\n * one would be a claim about the flow that is not true.\n */\nconst blockDismissal = {\n onPointerDownOutside: (event: Event) => event.preventDefault(),\n onFocusOutside: (event: Event) => event.preventDefault(),\n onInteractOutside: (event: Event) => event.preventDefault(),\n} as const\n\nexport type AlertDialogContentProps = ComponentProps<typeof KobalteAlertDialogContent> & {\n /** The control to focus on close when the one focused before opening is gone by then. */\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n}\n\nexport function AlertDialogContent(props: AlertDialogContentProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'children',\n 'restoreFocusRef',\n 'onOpenAutoFocus',\n 'onCloseAutoFocus',\n ])\n const layer = createDialogLayer({\n restoreFocusRef: local.restoreFocusRef,\n onOpenAutoFocus: (event) => local.onOpenAutoFocus?.(event),\n onCloseAutoFocus: (event) => local.onCloseAutoFocus?.(event),\n })\n\n return (\n <KobalteAlertDialog.Portal>\n <AlertDialogOverlay />\n <div class={overlayPositioner}>\n <KobalteAlertDialogContent\n {...blockDismissal}\n class={cn(\n dialogSurface,\n overlayMotion,\n 'grid max-h-full w-full max-w-md gap-4 overflow-y-auto p-5',\n local.class\n )}\n {...rest}\n onOpenAutoFocus={layer.onOpenAutoFocus}\n onCloseAutoFocus={layer.onCloseAutoFocus}\n >\n <DialogEscapeTarget onEscapeKeyDown={props.onEscapeKeyDown}>\n {local.children}\n </DialogEscapeTarget>\n </KobalteAlertDialogContent>\n </div>\n </KobalteAlertDialog.Portal>\n )\n}\n\nexport function AlertDialogHeader(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return <div data-slot=\"alert-dialog-header\" class={cn(overlayHeader, local.class)} {...rest} />\n}\n\nexport function AlertDialogFooter(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return <div data-slot=\"alert-dialog-footer\" class={cn(overlayFooter, local.class)} {...rest} />\n}\n\nexport function AlertDialogTitle(props: ComponentProps<typeof KobalteAlertDialog.Title>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteAlertDialog.Title class={cn(overlayTitle, local.class)} {...rest} />\n}\n\nexport function AlertDialogDescription(\n props: ComponentProps<typeof KobalteAlertDialog.Description>\n) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteAlertDialog.Description class={cn(overlayDescription, local.class)} {...rest} />\n}\n\n/**\n * One of the dialog's two named choices.\n *\n * Kobalte labels its close button \"Dismiss\" by default, because a generic close\n * button is usually an icon with no text of its own. In an AlertDialog it is\n * something else: the named choices. An `aria-label` there *replaces* the visible\n * text, so a screen reader hears \"Dismiss\" twice and the user cannot tell the\n * destructive action from the safe one.\n *\n * The injected label is removed rather than overridden with an empty one. An empty\n * `aria-label` is not reliably ignored, some name computations treat its presence\n * as an explicit empty name, which leaves the button unnamed, so the attribute\n * has to go, and the visible text becomes the name. A caller whose button is an\n * icon passes its own `aria-label`, and that one is left alone.\n *\n * Applied through a layout-neutral wrapper because Kobalte keeps the `ref` for its\n * own dismissable layer and does not forward it. The wrapper is `display: contents`\n * so the button remains the flex item its parent lays out.\n */\nfunction AlertDialogChoice(props: ComponentProps<typeof KobalteAlertDialog.CloseButton>) {\n const [local, rest] = splitProps(props, ['class', 'aria-label'])\n const [wrapper, setWrapper] = createSignal<HTMLSpanElement>()\n\n createEffect(() => {\n const root = wrapper()\n if (!root || local['aria-label'] !== undefined) return\n root.querySelector('button')?.removeAttribute('aria-label')\n })\n\n return (\n <span ref={setWrapper} class=\"contents\">\n <KobalteAlertDialog.CloseButton\n class={cn(local.class)}\n aria-label={local['aria-label']}\n {...rest}\n />\n </span>\n )\n}\n\nexport function AlertDialogAction(props: ComponentProps<typeof KobalteAlertDialog.CloseButton>) {\n return <AlertDialogChoice {...props} />\n}\n\nexport function AlertDialogCancel(props: ComponentProps<typeof KobalteAlertDialog.CloseButton>) {\n return <AlertDialogChoice {...props} />\n}\n"],"mappings":";;;;;;;;;;;AA2CA,SAAgBkB,mBAAmBC,OAA0D;CAC3F,MAAM,CAACE,OAAOC,QAAQlB,WAAWe,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAI,gBACGvB,YAAmBoB,SAAOI,WAAA,EAAA,KAAA,WAAA;EAAA,OAClBV,GAAGH,cAAcC,oBAAoBS,MAAMI,KAAK;CAAC,EAAA,GACpDH,IAAI,CAAA;AAGd;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,IAAMI,iBAAiB;CACrBC,uBAAuBC,UAAiBA,MAAMC,eAAe;CAC7DC,iBAAiBF,UAAiBA,MAAMC,eAAe;CACvDE,oBAAoBH,UAAiBA,MAAMC,eAAe;AAC5D;AAOA,SAAgBI,mBAAmBd,OAAgC;CACjE,MAAM,CAACE,OAAOC,QAAQlB,WAAWe,OAAO;EACtC;EACA;EACA;EACA;EACA;CAAkB,CACnB;CACD,MAAMe,QAAQnB,kBAAkB;EAC9BiB,iBAAiBX,MAAMW;EACvBG,kBAAkBP,UAAUP,MAAMc,kBAAkBP,KAAK;EACzDQ,mBAAmBR,UAAUP,MAAMe,mBAAmBR,KAAK;CAC7D,CAAC;CAED,OAAAL,gBACGvB,YAAmBiB,QAAM,EAAA,IAAAoB,WAAA;EAAA,OAAA,CAAAd,gBACvBL,oBAAkB,CAAA,CAAA,UAAA;GAAA,IAAAoB,OAAAC,OAAA;GAAAC,UAAAF,MACP5B,iBAAiB;GAAA+B,OAAAH,MAAAf,gB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,EAAA,KAAA,WAAA;EAAA,OAAQV,GAAGD,cAAcQ,MAAMI,KAAK;CAAC,EAAA,GAAMH,IAAI,CAAA;AACjF;AAEA,SAAgB8B,uBACdjC,OACA;CACA,MAAM,CAACE,OAAOC,QAAQlB,WAAWe,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAI,gBAAQvB,YAAmBqD,aAAW7B,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQV,GAAGR,oBAAoBe,MAAMI,KAAK;CAAC,EAAA,GAAMH,IAAI,CAAA;AAC7F;;;;;;;;;;;;;;;;;;;;AAqBA,SAASgC,kBAAkBnC,OAA8D;CACvF,MAAM,CAACE,OAAOC,QAAQlB,WAAWe,OAAO,CAAC,SAAS,YAAY,CAAC;CAC/D,MAAM,CAACqC,SAASC,cAActD,aAA8B;CAE5DD,mBAAmB;EACjB,MAAMwD,OAAOF,QAAQ;EACrB,IAAI,CAACE,QAAQrC,MAAM,kBAAkBsC,KAAAA,GAAW;EAChDD,KAAKE,cAAc,QAAQ,CAAC,EAAEC,gBAAgB,YAAY;CAC5D,CAAC;CAED,cAAA;EAAA,IAAAC,QAAAC,QAAA;EAAAC,IACaP,YAAUK,KAAA;EAAArB,OAAAqB,OAAAvC,gBAClBvB,YAAmBuD,aAAW/B,WAAA;GAAA,KAAA,WAAA;IAAA,OACtBV,GAAGO,MAAMI,KAAK;GAAC;GAAA,KAAA,gBAAA;IAAA,OACVJ,MAAM;GAAa;EAAA,GAC3BC,IAAI,CAAA,CAAA;EAAA,OAAAwC;CAAA,EAAA,CAAA;AAIhB;AAEA,SAAgBG,kBAAkB9C,OAA8D;CAC9F,OAAAI,gBAAQ+B,mBAAsBnC,KAAK;AACrC;AAEA,SAAgB+C,kBAAkB/C,OAA8D;CAC9F,OAAAI,gBAAQ+B,mBAAsBnC,KAAK;AACrC"}
@@ -5,7 +5,7 @@ import { type VariantProps } from '#lib/variants';
5
5
  * Badge.
6
6
  *
7
7
  * A short, non-interactive status label. If it can be clicked it is a Button
8
- * with `size="2xs"`, not a Badge — the difference matters because a Badge
8
+ * with `size="2xs"`, not a Badge, the difference matters because a Badge
9
9
  * carries no focus or pressed state and must never be the only way to reach an
10
10
  * action.
11
11
  */
@@ -8,7 +8,7 @@ import { Polymorphic } from "@kobalte/core/polymorphic";
8
8
  * Badge.
9
9
  *
10
10
  * A short, non-interactive status label. If it can be clicked it is a Button
11
- * with `size="2xs"`, not a Badge — the difference matters because a Badge
11
+ * with `size="2xs"`, not a Badge, the difference matters because a Badge
12
12
  * carries no focus or pressed state and must never be the only way to reach an
13
13
  * action.
14
14
  */
@@ -32,7 +32,7 @@ var badgeVariants = cva("inline-flex w-fit shrink-0 items-center justify-center
32
32
  * A count that asks for attention, pinned to a corner of another control
33
33
  * (a workspace mark, a rail icon). At `sm` it is a 2xs label on whatever
34
34
  * surface sits behind the corner, where the destructive tint all but
35
- * disappears — so it takes the solid, contrast-measured action fill.
35
+ * disappears, so it takes the solid, contrast-measured action fill.
36
36
  */
37
37
  notification: "bg-destructive-action text-destructive-action-foreground"
38
38
  },
@@ -1 +1 @@
1
- {"version":3,"file":"badge.js","names":["Polymorphic","splitProps","cva","cn","badgeVariants","variants","variant","default","secondary","outline","success","warning","destructive","info","subtle","notification","size","sm","md","lg","defaultVariants","class","Badge","props","local","rest","_$createComponent","_$mergeProps","as"],"sources":["../../../../src/components/ui/badge/badge.tsx"],"sourcesContent":["import { Polymorphic, type PolymorphicProps } from '@kobalte/core/polymorphic'\nimport { type ComponentProps, splitProps, type ValidComponent } from 'solid-js'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\n\n/**\n * Badge.\n *\n * A short, non-interactive status label. If it can be clicked it is a Button\n * with `size=\"2xs\"`, not a Badge — the difference matters because a Badge\n * carries no focus or pressed state and must never be the only way to reach an\n * action.\n */\nexport const badgeVariants = cva(\n 'inline-flex w-fit shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-md border border-transparent font-medium transition-colors [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-3',\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground',\n secondary: 'bg-secondary text-secondary-foreground',\n outline: 'border-border text-foreground',\n /**\n * Tinted status fills, for counts and states rather than actions. The\n * word stays in `foreground` for contrast; the glyph takes the status\n * hue, so tags of different tones read apart at a glance.\n */\n success: 'bg-success-subtle text-foreground [&_svg]:text-success',\n warning: 'bg-warning-subtle text-foreground [&_svg]:text-warning',\n destructive: 'bg-destructive-subtle text-foreground [&_svg]:text-destructive',\n info: 'bg-info-subtle text-foreground [&_svg]:text-info',\n subtle: 'bg-primary-subtle text-primary',\n /**\n * A count that asks for attention, pinned to a corner of another control\n * (a workspace mark, a rail icon). At `sm` it is a 2xs label on whatever\n * surface sits behind the corner, where the destructive tint all but\n * disappears — so it takes the solid, contrast-measured action fill.\n */\n notification: 'bg-destructive-action text-destructive-action-foreground',\n },\n size: {\n sm: 'h-4 px-1.5 text-2xs',\n md: 'h-5 px-2 text-xs',\n lg: 'h-6 px-2.5 text-xs',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n },\n }\n)\n\ntype BadgeVariantProps = VariantProps<typeof badgeVariants>\n\nexport type BadgeProps<T extends ValidComponent = 'span'> = PolymorphicProps<\n T,\n BadgeVariantProps & { class?: string }\n>\n\nexport function Badge<T extends ValidComponent = 'span'>(props: BadgeProps<T>) {\n const [local, rest] = splitProps(props as BadgeProps, ['variant', 'size', 'class'])\n\n return (\n <Polymorphic\n as=\"span\"\n data-slot=\"badge\"\n class={cn(badgeVariants({ variant: local.variant, size: local.size }), local.class)}\n {...(rest as ComponentProps<'span'>)}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAaA,IAAaI,gBAAgBF,IAC3B,iNACA;CACEG,UAAU;EACRC,SAAS;GACPC,SAAS;GACTC,WAAW;GACXC,SAAS;;;;;;GAMTC,SAAS;GACTC,SAAS;GACTC,aAAa;GACbC,MAAM;GACNC,QAAQ;;;;;;;GAORC,cAAc;EAChB;EACAC,MAAM;GACJC,IAAI;GACJC,IAAI;GACJC,IAAI;EACN;CACF;CACAC,iBAAiB;EACfd,SAAS;EACTU,MAAM;CACR;AACF,CACF;AASA,SAAgBM,MAAyCC,OAAsB;CAC7E,MAAM,CAACC,OAAOC,QAAQxB,WAAWsB,OAAqB;EAAC;EAAW;EAAQ;CAAO,CAAC;CAElF,OAAAG,gBACG1B,aAAW2B,WAAA;EACVC,IAAE;EAAA,aAAA;EAAA,KAAA,WAAA;GAAA,OAEKzB,GAAGC,cAAc;IAAEE,SAASkB,MAAMlB;IAASU,MAAMQ,MAAMR;GAAK,CAAC,GAAGQ,MAAMH,KAAK;EAAC;CAAA,GAC9EI,IAA8B,CAAA;AAGzC"}
1
+ {"version":3,"file":"badge.js","names":["Polymorphic","splitProps","cva","cn","badgeVariants","variants","variant","default","secondary","outline","success","warning","destructive","info","subtle","notification","size","sm","md","lg","defaultVariants","class","Badge","props","local","rest","_$createComponent","_$mergeProps","as"],"sources":["../../../../src/components/ui/badge/badge.tsx"],"sourcesContent":["import { Polymorphic, type PolymorphicProps } from '@kobalte/core/polymorphic'\nimport { type ComponentProps, splitProps, type ValidComponent } from 'solid-js'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\n\n/**\n * Badge.\n *\n * A short, non-interactive status label. If it can be clicked it is a Button\n * with `size=\"2xs\"`, not a Badge, the difference matters because a Badge\n * carries no focus or pressed state and must never be the only way to reach an\n * action.\n */\nexport const badgeVariants = cva(\n 'inline-flex w-fit shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-md border border-transparent font-medium transition-colors [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-3',\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground',\n secondary: 'bg-secondary text-secondary-foreground',\n outline: 'border-border text-foreground',\n /**\n * Tinted status fills, for counts and states rather than actions. The\n * word stays in `foreground` for contrast; the glyph takes the status\n * hue, so tags of different tones read apart at a glance.\n */\n success: 'bg-success-subtle text-foreground [&_svg]:text-success',\n warning: 'bg-warning-subtle text-foreground [&_svg]:text-warning',\n destructive: 'bg-destructive-subtle text-foreground [&_svg]:text-destructive',\n info: 'bg-info-subtle text-foreground [&_svg]:text-info',\n subtle: 'bg-primary-subtle text-primary',\n /**\n * A count that asks for attention, pinned to a corner of another control\n * (a workspace mark, a rail icon). At `sm` it is a 2xs label on whatever\n * surface sits behind the corner, where the destructive tint all but\n * disappears, so it takes the solid, contrast-measured action fill.\n */\n notification: 'bg-destructive-action text-destructive-action-foreground',\n },\n size: {\n sm: 'h-4 px-1.5 text-2xs',\n md: 'h-5 px-2 text-xs',\n lg: 'h-6 px-2.5 text-xs',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n },\n }\n)\n\ntype BadgeVariantProps = VariantProps<typeof badgeVariants>\n\nexport type BadgeProps<T extends ValidComponent = 'span'> = PolymorphicProps<\n T,\n BadgeVariantProps & { class?: string }\n>\n\nexport function Badge<T extends ValidComponent = 'span'>(props: BadgeProps<T>) {\n const [local, rest] = splitProps(props as BadgeProps, ['variant', 'size', 'class'])\n\n return (\n <Polymorphic\n as=\"span\"\n data-slot=\"badge\"\n class={cn(badgeVariants({ variant: local.variant, size: local.size }), local.class)}\n {...(rest as ComponentProps<'span'>)}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAaA,IAAaI,gBAAgBF,IAC3B,iNACA;CACEG,UAAU;EACRC,SAAS;GACPC,SAAS;GACTC,WAAW;GACXC,SAAS;;;;;;GAMTC,SAAS;GACTC,SAAS;GACTC,aAAa;GACbC,MAAM;GACNC,QAAQ;;;;;;;GAORC,cAAc;EAChB;EACAC,MAAM;GACJC,IAAI;GACJC,IAAI;GACJC,IAAI;EACN;CACF;CACAC,iBAAiB;EACfd,SAAS;EACTU,MAAM;CACR;AACF,CACF;AASA,SAAgBM,MAAyCC,OAAsB;CAC7E,MAAM,CAACC,OAAOC,QAAQxB,WAAWsB,OAAqB;EA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cn } from "../../../lib/utils.js";
3
3
  import { badgeVariants } from "../badge/badge.js";
4
4
  import { headingVariants, textVariants } from "../typography/typography.js";
5
5
  import { className, createComponent, delegateEvents, effect, insert, mergeProps, setAttribute, spread, template, use } from "solid-js/web";
6
- import { For, Index, Show, createEffect, createMemo, createSignal, onCleanup, splitProps } from "solid-js";
6
+ import { For, Index, Show, createEffect, createMemo, createSelector, createSignal, onCleanup, splitProps, untrack } from "solid-js";
7
7
  // src/components/ui/board/board.tsx
8
8
  var _tmpl$ = /*#__PURE__*/ template(`<span aria-hidden=true>`);
9
9
  var _tmpl$2 = /*#__PURE__*/ template(`<span data-slot=board-column-count>`);
@@ -74,6 +74,10 @@ function Board(props) {
74
74
  "class"
75
75
  ]);
76
76
  const [dragging, setDragging] = createSignal(null);
77
+ const isDraggingId = createSelector(() => {
78
+ const current = dragging();
79
+ return current ? local.itemId(current) : void 0;
80
+ });
77
81
  const [overColumn, setOverColumn] = createSignal(null);
78
82
  const [announcement, setAnnouncement] = createSignal("");
79
83
  const cardElements = /* @__PURE__ */ new Map();
@@ -241,10 +245,7 @@ function Board(props) {
241
245
  return items();
242
246
  },
243
247
  children: (item) => {
244
- const isDragging = () => {
245
- const current = dragging();
246
- return Boolean(current && local.itemId(current) === local.itemId(item));
247
- };
248
+ const isDragging = () => isDraggingId(local.itemId(item));
248
249
  return (() => {
249
250
  var _el$11 = _tmpl$0();
250
251
  _el$11.$$keydown = (event) => {
@@ -270,7 +271,10 @@ function Board(props) {
270
271
  });
271
272
  }, _el$11);
272
273
  setAttribute(_el$11, "draggable", true);
273
- insert(_el$11, () => local.children(item, { dragging: isDragging() }));
274
+ insert(_el$11, () => {
275
+ const isItemDragging = isDragging();
276
+ return untrack(() => local.children(item, { dragging: isItemDragging }));
277
+ });
274
278
  effect(() => className(_el$11, cn("relative shrink-0 cursor-grab rounded-md border border-border bg-card text-sm shadow-xs outline-none transition-colors hover:bg-surface-hover focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle active:cursor-grabbing", cardDragState[isDragging() ? "dragging" : "idle"])));
275
279
  return _el$11;
276
280
  })();