@adea-ai/ui 0.152.3 → 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
@@ -32,8 +32,8 @@ function pairNeedsData(pair) {
32
32
  *
33
33
  * True when the variant being shown, the pinned terminal theme, or (for a
34
34
  * theme-derived `ansi-*` accent) either theme of the pair is a catalogue theme other
35
- * than the two defaults. Everything else — the default pair, a host's own variants,
36
- * every preset and custom accent — the light engine answers from shipped data.
35
+ * than the two defaults. Everything else, the default pair, a host's own variants,
36
+ * every preset and custom accent, the light engine answers from shipped data.
37
37
  */
38
38
  function needsCatalogue(selection, appearance) {
39
39
  if (needsData(appearance === "dark" ? selection.darkThemeId : selection.lightThemeId)) return true;
@@ -1 +1 @@
1
- {"version":3,"file":"theme-engine.js","names":[],"sources":["../../src/lib/theme-engine.ts"],"sourcesContent":["/**\n * The catalogue-dependent operations a provider performs, as one seam.\n *\n * `ThemeProvider` needs to ask a handful of questions that only the catalogue can\n * answer in general: the built-in variants, a variant's custom properties, the roles\n * an accent paints over it, the accents a theme pair offers. Two engines answer them.\n *\n * - `catalogueThemeEngine` (`lib/theme-catalogue`) is the full answer, backed by the\n * whole catalogue. It is what `ThemeProvider` uses and what the lazy provider\n * switches to once the catalogue has loaded.\n * - `createLightThemeEngine` (`lib/theme-engine-light`) answers from the data that\n * ships with the provider (`theme-defaults`): the default light/dark pair, host\n * variants that are not in the catalogue, and nothing else. It imports no catalogue\n * data, which is the point: a host that keeps the default pair never pays for the\n * other 32 themes. A question it cannot answer exactly is one {@link needsCatalogue}\n * names up front, so the lazy provider loads the catalogue instead of painting it.\n *\n * `tests/theme-engine.test.ts` holds the two to the same answers wherever the light\n * engine can answer.\n */\nimport type { AccentPreset } from '@adea-ai/themes'\nimport type { AccentRoles } from './accent-roles'\nimport { isThemeAccentId } from './theme-accents'\nimport { cataloguePair, isCatalogueThemeId, isDefaultThemeId } from './theme-defaults'\nimport type {\n AccentVariableOptions,\n ThemeAppearance,\n ThemeCssVariableOptions,\n ThemePair,\n ThemeVariant,\n} from './theme-types'\n\nexport type ThemeEngine = {\n /** The built-in variants. A plain array, in catalogue order. */\n readonly builtinThemes: readonly ThemeVariant[]\n /** True for the catalogue's own variant, not a host's copy that merely shares its id. */\n isCatalogueVariant(variant: ThemeVariant): boolean\n /** The custom properties a variant sets. */\n themeCssVariables(\n variant: ThemeVariant,\n options?: ThemeCssVariableOptions\n ): Record<string, string>\n /**\n * The custom properties an accent selection overrides on the document (`--primary`, its\n * foreground, hover and ring), or `undefined` when it overrides nothing.\n */\n accentVariables(\n accentId: string,\n appearance: ThemeAppearance,\n pair: ThemePair,\n options?: AccentVariableOptions\n ): Record<string, string> | undefined\n /** An accent selection resolved to its full roles against a theme pair, or `undefined`. */\n accentRolesForSelection(\n accentId: string,\n appearance: ThemeAppearance,\n pair: ThemePair,\n options?: AccentVariableOptions\n ): AccentRoles | undefined\n /** The accents a light/dark pair offers beside the presets. */\n themeAccentsFor(lightThemeId: string, darkThemeId: string): readonly AccentPreset[]\n}\n\n/**\n * @deprecated Nothing throws it any more: the light engine checks up front\n * whether a question needs the catalogue (`needsCatalogue`). Kept so existing\n * `instanceof` checks still compile; remove in the next major.\n */\nexport class CatalogueRequired extends Error {\n constructor(what: string) {\n super(`${what} needs the theme catalogue, which has not been loaded`)\n this.name = 'CatalogueRequired'\n }\n}\n\n/** @deprecated Use `cataloguePair` from `@adea-ai/ui/lib/theme-defaults`. */\nexport function pairIds(lightThemeId: string, darkThemeId: string): [string, string] {\n const pair = cataloguePair({ lightThemeId, darkThemeId })\n return [pair.lightThemeId, pair.darkThemeId]\n}\n\n/** A catalogue id other than the two defaults: its data is not in the light engine. */\nexport const needsData = (id: string) => isCatalogueThemeId(id) && !isDefaultThemeId(id)\n\n/** Whether the accents a pair offers need the catalogue to measure. */\nexport function pairNeedsData(pair: ThemePair): boolean {\n const resolved = cataloguePair(pair)\n return needsData(resolved.lightThemeId) || needsData(resolved.darkThemeId)\n}\n\n/**\n * Whether answering for this selection needs the catalogue.\n *\n * True when the variant being shown, the pinned terminal theme, or (for a\n * theme-derived `ansi-*` accent) either theme of the pair is a catalogue theme other\n * than the two defaults. Everything else — the default pair, a host's own variants,\n * every preset and custom accent — the light engine answers from shipped data.\n */\nexport function needsCatalogue(\n selection: ThemePair & { accent: string; terminalThemeId?: string },\n appearance: ThemeAppearance\n): boolean {\n const shown = appearance === 'dark' ? selection.darkThemeId : selection.lightThemeId\n if (needsData(shown)) return true\n if (selection.terminalThemeId !== undefined && needsData(selection.terminalThemeId)) return true\n return isThemeAccentId(selection.accent) && pairNeedsData(selection)\n}\n"],"mappings":";;;;;;;;AAoEA,IAAa,oBAAb,cAAuC,MAAM;CAC3C,YAAY,MAAc;EACxB,MAAM,GAAG,KAAK,sDAAsD;EACpE,KAAK,OAAO;CACd;AACF;;AAGA,SAAgB,QAAQ,cAAsB,aAAuC;CACnF,MAAM,OAAO,cAAc;EAAE;EAAc;CAAY,CAAC;CACxD,OAAO,CAAC,KAAK,cAAc,KAAK,WAAW;AAC7C;;AAGA,IAAa,aAAa,OAAe,mBAAmB,EAAE,KAAK,CAAC,iBAAiB,EAAE;;AAGvF,SAAgB,cAAc,MAA0B;CACtD,MAAM,WAAW,cAAc,IAAI;CACnC,OAAO,UAAU,SAAS,YAAY,KAAK,UAAU,SAAS,WAAW;AAC3E;;;;;;;;;AAUA,SAAgB,eACd,WACA,YACS;CAET,IAAI,UADU,eAAe,SAAS,UAAU,cAAc,UAAU,YACrD,GAAG,OAAO;CAC7B,IAAI,UAAU,oBAAoB,KAAA,KAAa,UAAU,UAAU,eAAe,GAAG,OAAO;CAC5F,OAAO,gBAAgB,UAAU,MAAM,KAAK,cAAc,SAAS;AACrE"}
1
+ {"version":3,"file":"theme-engine.js","names":[],"sources":["../../src/lib/theme-engine.ts"],"sourcesContent":["/**\n * The catalogue-dependent operations a provider performs, as one seam.\n *\n * `ThemeProvider` needs to ask a handful of questions that only the catalogue can\n * answer in general: the built-in variants, a variant's custom properties, the roles\n * an accent paints over it, the accents a theme pair offers. Two engines answer them.\n *\n * - `catalogueThemeEngine` (`lib/theme-catalogue`) is the full answer, backed by the\n * whole catalogue. It is what `ThemeProvider` uses and what the lazy provider\n * switches to once the catalogue has loaded.\n * - `createLightThemeEngine` (`lib/theme-engine-light`) answers from the data that\n * ships with the provider (`theme-defaults`): the default light/dark pair, host\n * variants that are not in the catalogue, and nothing else. It imports no catalogue\n * data, which is the point: a host that keeps the default pair never pays for the\n * other 32 themes. A question it cannot answer exactly is one {@link needsCatalogue}\n * names up front, so the lazy provider loads the catalogue instead of painting it.\n *\n * `tests/theme-engine.test.ts` holds the two to the same answers wherever the light\n * engine can answer.\n */\nimport type { AccentPreset } from '@adea-ai/themes'\nimport type { AccentRoles } from './accent-roles'\nimport { isThemeAccentId } from './theme-accents'\nimport { cataloguePair, isCatalogueThemeId, isDefaultThemeId } from './theme-defaults'\nimport type {\n AccentVariableOptions,\n ThemeAppearance,\n ThemeCssVariableOptions,\n ThemePair,\n ThemeVariant,\n} from './theme-types'\n\nexport type ThemeEngine = {\n /** The built-in variants. A plain array, in catalogue order. */\n readonly builtinThemes: readonly ThemeVariant[]\n /** True for the catalogue's own variant, not a host's copy that merely shares its id. */\n isCatalogueVariant(variant: ThemeVariant): boolean\n /** The custom properties a variant sets. */\n themeCssVariables(\n variant: ThemeVariant,\n options?: ThemeCssVariableOptions\n ): Record<string, string>\n /**\n * The custom properties an accent selection overrides on the document (`--primary`, its\n * foreground, hover and ring), or `undefined` when it overrides nothing.\n */\n accentVariables(\n accentId: string,\n appearance: ThemeAppearance,\n pair: ThemePair,\n options?: AccentVariableOptions\n ): Record<string, string> | undefined\n /** An accent selection resolved to its full roles against a theme pair, or `undefined`. */\n accentRolesForSelection(\n accentId: string,\n appearance: ThemeAppearance,\n pair: ThemePair,\n options?: AccentVariableOptions\n ): AccentRoles | undefined\n /** The accents a light/dark pair offers beside the presets. */\n themeAccentsFor(lightThemeId: string, darkThemeId: string): readonly AccentPreset[]\n}\n\n/**\n * @deprecated Nothing throws it any more: the light engine checks up front\n * whether a question needs the catalogue (`needsCatalogue`). Kept so existing\n * `instanceof` checks still compile; remove in the next major.\n */\nexport class CatalogueRequired extends Error {\n constructor(what: string) {\n super(`${what} needs the theme catalogue, which has not been loaded`)\n this.name = 'CatalogueRequired'\n }\n}\n\n/** @deprecated Use `cataloguePair` from `@adea-ai/ui/lib/theme-defaults`. */\nexport function pairIds(lightThemeId: string, darkThemeId: string): [string, string] {\n const pair = cataloguePair({ lightThemeId, darkThemeId })\n return [pair.lightThemeId, pair.darkThemeId]\n}\n\n/** A catalogue id other than the two defaults: its data is not in the light engine. */\nexport const needsData = (id: string) => isCatalogueThemeId(id) && !isDefaultThemeId(id)\n\n/** Whether the accents a pair offers need the catalogue to measure. */\nexport function pairNeedsData(pair: ThemePair): boolean {\n const resolved = cataloguePair(pair)\n return needsData(resolved.lightThemeId) || needsData(resolved.darkThemeId)\n}\n\n/**\n * Whether answering for this selection needs the catalogue.\n *\n * True when the variant being shown, the pinned terminal theme, or (for a\n * theme-derived `ansi-*` accent) either theme of the pair is a catalogue theme other\n * than the two defaults. Everything else, the default pair, a host's own variants,\n * every preset and custom accent, the light engine answers from shipped data.\n */\nexport function needsCatalogue(\n selection: ThemePair & { accent: string; terminalThemeId?: string },\n appearance: ThemeAppearance\n): boolean {\n const shown = appearance === 'dark' ? selection.darkThemeId : selection.lightThemeId\n if (needsData(shown)) return true\n if (selection.terminalThemeId !== undefined && needsData(selection.terminalThemeId)) return true\n return isThemeAccentId(selection.accent) && pairNeedsData(selection)\n}\n"],"mappings":";;;;;;;;AAoEA,IAAa,oBAAb,cAAuC,MAAM;CAC3C,YAAY,MAAc;EACxB,MAAM,GAAG,KAAK,sDAAsD;EACpE,KAAK,OAAO;CACd;AACF;;AAGA,SAAgB,QAAQ,cAAsB,aAAuC;CACnF,MAAM,OAAO,cAAc;EAAE;EAAc;CAAY,CAAC;CACxD,OAAO,CAAC,KAAK,cAAc,KAAK,WAAW;AAC7C;;AAGA,IAAa,aAAa,OAAe,mBAAmB,EAAE,KAAK,CAAC,iBAAiB,EAAE;;AAGvF,SAAgB,cAAc,MAA0B;CACtD,MAAM,WAAW,cAAc,IAAI;CACnC,OAAO,UAAU,SAAS,YAAY,KAAK,UAAU,SAAS,WAAW;AAC3E;;;;;;;;;AAUA,SAAgB,eACd,WACA,YACS;CAET,IAAI,UADU,eAAe,SAAS,UAAU,cAAc,UAAU,YACrD,GAAG,OAAO;CAC7B,IAAI,UAAU,oBAAoB,KAAA,KAAa,UAAU,UAAU,eAAe,GAAG,OAAO;CAC5F,OAAO,gBAAgB,UAAU,MAAM,KAAK,cAAc,SAAS;AACrE"}
@@ -15,7 +15,7 @@ export declare function defaultThemeRecord(appearance: 'light' | 'dark'): AdeaTh
15
15
  /**
16
16
  * The accents a light/dark pair of records carries itself, beside the presets.
17
17
  *
18
- * For a host whose pair is not in the catalogue — an imported theme — where
18
+ * For a host whose pair is not in the catalogue, an imported theme, where
19
19
  * `themeAccentsFor` (which looks the pair up by id) cannot answer. A slot is offered
20
20
  * only when both themes clear the catalogue's accent floors.
21
21
  */
@@ -11,7 +11,7 @@ import { toXtermTheme } from "@adea-ai/themes/adapters/xterm";
11
11
  * Adea imports user themes: a file is validated, repaired toward the readable floor,
12
12
  * and projected onto the hex values the host persists. That projection is the
13
13
  * catalogue's own (`shadcnVariables`, the xterm adapter, the editor roles), so it is
14
- * re-exported here and the host depends on this package alone for it — the pin
14
+ * re-exported here and the host depends on this package alone for it, the pin
15
15
  * between this package and `@adea-ai/themes` cannot drift from the host's.
16
16
  *
17
17
  * Its own module, with no catalogue data and no definition of its own beyond the two
@@ -35,7 +35,7 @@ function defaultThemeRecord(appearance) {
35
35
  /**
36
36
  * The accents a light/dark pair of records carries itself, beside the presets.
37
37
  *
38
- * For a host whose pair is not in the catalogue — an imported theme — where
38
+ * For a host whose pair is not in the catalogue, an imported theme, where
39
39
  * `themeAccentsFor` (which looks the pair up by id) cannot answer. A slot is offered
40
40
  * only when both themes clear the catalogue's accent floors.
41
41
  */
@@ -1 +1 @@
1
- {"version":3,"file":"theme-projection.js","names":[],"sources":["../../src/lib/theme-projection.ts"],"sourcesContent":["/**\n * What a host needs to turn a canonical theme record into the values it stores.\n *\n * Adea imports user themes: a file is validated, repaired toward the readable floor,\n * and projected onto the hex values the host persists. That projection is the\n * catalogue's own (`shadcnVariables`, the xterm adapter, the editor roles), so it is\n * re-exported here and the host depends on this package alone for it — the pin\n * between this package and `@adea-ai/themes` cannot drift from the host's.\n *\n * Its own module, with no catalogue data and no definition of its own beyond the two\n * default records, so that:\n *\n * - a host's start-up path never reaches it (it is for an importer loaded on demand);\n * - `lib/themes.ts`, which holds the 34-theme table, is not the place a host has to\n * import from to get a record-shaped helper.\n */\nimport adeaDark from '@adea-ai/themes/themes/adea-dark'\nimport adeaLight from '@adea-ai/themes/themes/adea-light'\nimport {\n themeAccentPresets,\n type AccentPreset,\n type AdeaTheme,\n type AdeaThemeRecord,\n} from '@adea-ai/themes'\n\nexport { editorRolesHex, syntaxRolesHex } from '@adea-ai/themes'\nexport { oklchToHex, parseColor as parseOklchColor } from '@adea-ai/themes/oklch'\nexport { shadcnDestructiveProjection, shadcnVariables } from '@adea-ai/themes/adapters/shadcn'\nexport { toXtermTheme } from '@adea-ai/themes/adapters/xterm'\n\n/**\n * The default theme of an appearance as a canonical record: the roles an imported\n * theme falls back to for anything its file does not carry.\n *\n * `defaultVariantFor` is the same theme as a runtime variant; a record keeps the\n * catalogue's own roles (`surfaceActive`, `textSubtle`, the ANSI ramp) that a variant\n * folds together.\n */\nexport function defaultThemeRecord(appearance: 'light' | 'dark'): AdeaThemeRecord {\n return appearance === 'dark' ? adeaDark : adeaLight\n}\n\n/**\n * The accents a light/dark pair of records carries itself, beside the presets.\n *\n * For a host whose pair is not in the catalogue — an imported theme — where\n * `themeAccentsFor` (which looks the pair up by id) cannot answer. A slot is offered\n * only when both themes clear the catalogue's accent floors.\n */\nexport function themeAccentsForRecords(light: AdeaTheme, dark: AdeaTheme): readonly AccentPreset[] {\n return themeAccentPresets(light, dark)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,SAAgB,mBAAmB,YAA+C;CAChF,OAAO,eAAe,SAAS,WAAW;AAC5C;;;;;;;;AASA,SAAgB,uBAAuB,OAAkB,MAA0C;CACjG,OAAO,mBAAmB,OAAO,IAAI;AACvC"}
1
+ {"version":3,"file":"theme-projection.js","names":[],"sources":["../../src/lib/theme-projection.ts"],"sourcesContent":["/**\n * What a host needs to turn a canonical theme record into the values it stores.\n *\n * Adea imports user themes: a file is validated, repaired toward the readable floor,\n * and projected onto the hex values the host persists. That projection is the\n * catalogue's own (`shadcnVariables`, the xterm adapter, the editor roles), so it is\n * re-exported here and the host depends on this package alone for it, the pin\n * between this package and `@adea-ai/themes` cannot drift from the host's.\n *\n * Its own module, with no catalogue data and no definition of its own beyond the two\n * default records, so that:\n *\n * - a host's start-up path never reaches it (it is for an importer loaded on demand);\n * - `lib/themes.ts`, which holds the 34-theme table, is not the place a host has to\n * import from to get a record-shaped helper.\n */\nimport adeaDark from '@adea-ai/themes/themes/adea-dark'\nimport adeaLight from '@adea-ai/themes/themes/adea-light'\nimport {\n themeAccentPresets,\n type AccentPreset,\n type AdeaTheme,\n type AdeaThemeRecord,\n} from '@adea-ai/themes'\n\nexport { editorRolesHex, syntaxRolesHex } from '@adea-ai/themes'\nexport { oklchToHex, parseColor as parseOklchColor } from '@adea-ai/themes/oklch'\nexport { shadcnDestructiveProjection, shadcnVariables } from '@adea-ai/themes/adapters/shadcn'\nexport { toXtermTheme } from '@adea-ai/themes/adapters/xterm'\n\n/**\n * The default theme of an appearance as a canonical record: the roles an imported\n * theme falls back to for anything its file does not carry.\n *\n * `defaultVariantFor` is the same theme as a runtime variant; a record keeps the\n * catalogue's own roles (`surfaceActive`, `textSubtle`, the ANSI ramp) that a variant\n * folds together.\n */\nexport function defaultThemeRecord(appearance: 'light' | 'dark'): AdeaThemeRecord {\n return appearance === 'dark' ? adeaDark : adeaLight\n}\n\n/**\n * The accents a light/dark pair of records carries itself, beside the presets.\n *\n * For a host whose pair is not in the catalogue, an imported theme, where\n * `themeAccentsFor` (which looks the pair up by id) cannot answer. A slot is offered\n * only when both themes clear the catalogue's accent floors.\n */\nexport function themeAccentsForRecords(light: AdeaTheme, dark: AdeaTheme): readonly AccentPreset[] {\n return themeAccentPresets(light, dark)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,SAAgB,mBAAmB,YAA+C;CAChF,OAAO,eAAe,SAAS,WAAW;AAC5C;;;;;;;;AASA,SAAgB,uBAAuB,OAAkB,MAA0C;CACjG,OAAO,mBAAmB,OAAO,IAAI;AACvC"}
@@ -20,8 +20,8 @@ export type { AdeaTheme, AdeaThemeRecord } from '@adea-ai/themes';
20
20
  /**
21
21
  * The design system's view of one catalogue record, built in full and at once.
22
22
  *
23
- * For a host that holds a record the catalogue does not — an imported theme, a
24
- * reconstruction from stored data — and wants a variant it can hand to
23
+ * For a host that holds a record the catalogue does not, an imported theme, a
24
+ * reconstruction from stored data, and wants a variant it can hand to
25
25
  * `ThemeProvider`'s `themes`. It throws for a record the shadcn projection cannot
26
26
  * map, here and now, rather than on first paint. The catalogue itself goes through
27
27
  * {@link lazyVariantFromRecord} instead.
@@ -70,8 +70,8 @@ function provenanceOf(theme) {
70
70
  /**
71
71
  * The design system's view of one catalogue record, built in full and at once.
72
72
  *
73
- * For a host that holds a record the catalogue does not — an imported theme, a
74
- * reconstruction from stored data — and wants a variant it can hand to
73
+ * For a host that holds a record the catalogue does not, an imported theme, a
74
+ * reconstruction from stored data, and wants a variant it can hand to
75
75
  * `ThemeProvider`'s `themes`. It throws for a record the shadcn projection cannot
76
76
  * map, here and now, rather than on first paint. The catalogue itself goes through
77
77
  * {@link lazyVariantFromRecord} instead.
@@ -1 +1 @@
1
- {"version":3,"file":"theme-records.js","names":[],"sources":["../../src/lib/theme-records.ts"],"sourcesContent":["/**\n * One catalogue record, as this system's {@link ThemeVariant}.\n *\n * `variantFromRecord` and the lazy form the catalogue is built with live here, and not\n * beside the 34-theme table in `lib/themes.ts`, because a bundler places a module\n * whole: a host that imports `variantFromRecord` from the same module as the table\n * ships the table with it. This module reads a record it is handed and imports no\n * catalogue, so a start-up path that only turns a stored record into a variant\n * (an imported theme, a reconstruction) stays small. `lib/themes.ts` re-exports\n * `variantFromRecord`; the lazy start-up gate (`check:theme-startup`) holds the split\n * in place.\n *\n * It does import `@adea-ai/themes` for the projection helpers (`chartSeries`,\n * `tint`, `shadcnVariables`…), none of which reads the table of themes.\n */\nimport {\n chartSeries,\n shadcnDestructiveProjection,\n statusForeground,\n syntaxRoles,\n tint,\n type AdeaThemeRecord,\n} from '@adea-ai/themes'\nimport { shadcnVariables } from '@adea-ai/themes/adapters/shadcn'\nimport {\n THEME_COLOR_PROPERTIES,\n THEME_EDITOR_PROPERTIES,\n THEME_TERMINAL_PROPERTIES,\n pickRoles,\n type ThemeColors,\n type ThemeEditorPalette,\n type ThemeProvenance,\n type ThemeTerminalPalette,\n type ThemeVariant,\n} from './theme-types'\n\n/** The catalogue's canonical theme shapes, for a host that holds records and no catalogue. */\nexport type { AdeaTheme, AdeaThemeRecord } from '@adea-ai/themes'\n\n/**\n * The shadcn-vocabulary roles of one catalogue entry.\n *\n * The expensive half of a variant: `shadcnVariables` projects the whole palette\n * (about 4 ms a theme), which is why {@link lazyVariantFromRecord} defers it.\n */\nfunction colorsOf(theme: AdeaThemeRecord): ThemeColors {\n const projected = shadcnVariables(theme)\n const destructiveAction = shadcnDestructiveProjection(theme)\n const { colors } = theme\n // The status labels and washes are measured from the canonical roles. `destructive`\n // keeps the UI's semantic error token: the shared projection fills `--destructive`\n // with its contrast-safe solid-action colour, which UI keeps as `destructiveAction`.\n const measured: Partial<ThemeColors> = {\n destructive: colors.error,\n destructiveForeground: statusForeground(theme, 'error'),\n destructiveSubtle: tint(colors.error, colors.background),\n destructiveAction: destructiveAction.fill,\n destructiveActionForeground: destructiveAction.foreground,\n successForeground: statusForeground(theme, 'success'),\n successSubtle: tint(colors.success, colors.background),\n warningForeground: statusForeground(theme, 'warning'),\n warningSubtle: tint(colors.warning, colors.background),\n infoForeground: statusForeground(theme, 'info'),\n infoSubtle: tint(colors.info, colors.background),\n }\n const roles = {} as ThemeColors\n for (const [role, property] of Object.entries(THEME_COLOR_PROPERTIES)) {\n const value = measured[role as keyof ThemeColors] ?? projected[property]\n if (!value) throw new Error(`${theme.id} has no shared shadcn projection for ${property}`)\n roles[role as keyof ThemeColors] = value\n }\n return roles\n}\n\n// The embedded terminal uses the theme's own canvas rather than a palette of its\n// own. The ANSI colours came from the palette that produced the canvas, so they\n// were chosen against it; a terminal on a different background would be the one\n// surface in the application not lit by the active theme.\nfunction terminalOf(theme: AdeaThemeRecord): ThemeTerminalPalette {\n return pickRoles(THEME_TERMINAL_PROPERTIES, {\n background: theme.colors.background,\n foreground: theme.colors.foreground,\n cursor: theme.cursor,\n selection: theme.selection,\n ...theme.ansi,\n })\n}\n\nfunction editorOf(theme: AdeaThemeRecord): ThemeEditorPalette {\n return pickRoles(THEME_EDITOR_PROPERTIES, syntaxRoles(theme))\n}\n\nfunction provenanceOf(theme: AdeaThemeRecord): ThemeProvenance {\n return {\n source: theme.provenance.project,\n url: theme.provenance.url,\n license: theme.provenance.license,\n }\n}\n\n/**\n * The design system's view of one catalogue record, built in full and at once.\n *\n * For a host that holds a record the catalogue does not — an imported theme, a\n * reconstruction from stored data — and wants a variant it can hand to\n * `ThemeProvider`'s `themes`. It throws for a record the shadcn projection cannot\n * map, here and now, rather than on first paint. The catalogue itself goes through\n * {@link lazyVariantFromRecord} instead.\n */\nexport function variantFromRecord(theme: AdeaThemeRecord): ThemeVariant {\n return {\n id: theme.id,\n family: theme.family,\n familyLabel: theme.familyLabel,\n label: theme.label,\n appearance: theme.appearance,\n description: theme.description,\n colors: colorsOf(theme),\n terminal: terminalOf(theme),\n editor: editorOf(theme),\n chart: chartSeries(theme),\n provenance: provenanceOf(theme),\n }\n}\n\n/** Runs `build` on first call and returns that value from then on. A throw is not cached. */\nfunction once<T>(build: () => T): () => T {\n let built = false\n let value: T\n return () => {\n if (!built) {\n value = build()\n built = true\n }\n return value\n }\n}\n\nconst lazy = <T>(build: () => T): PropertyDescriptor => ({\n get: once(build),\n enumerable: true,\n})\n\n/**\n * {@link variantFromRecord} with the four derived palettes built on first read.\n *\n * Evaluating this module used to project all 34 catalogue themes up front, about\n * 155 ms before a single one was needed, on the hydration path of every consumer.\n * A page paints one variant, and a picker's labels and appearance are plain\n * fields, so only a variant whose `colors`, `terminal`, `editor` or `chart` is read\n * pays for them, once. The properties stay enumerable data-shaped accessors, so\n * spreading, `Object.entries` and JSON see the same object they always did.\n */\nexport function lazyVariantFromRecord(theme: AdeaThemeRecord): ThemeVariant {\n return Object.defineProperties(\n {\n id: theme.id,\n family: theme.family,\n familyLabel: theme.familyLabel,\n label: theme.label,\n appearance: theme.appearance,\n description: theme.description,\n provenance: provenanceOf(theme),\n },\n {\n colors: lazy(() => colorsOf(theme)),\n terminal: lazy(() => terminalOf(theme)),\n editor: lazy(() => editorOf(theme)),\n chart: lazy(() => chartSeries(theme)),\n }\n ) as ThemeVariant\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,SAAS,SAAS,OAAqC;CACrD,MAAM,YAAY,gBAAgB,KAAK;CACvC,MAAM,oBAAoB,4BAA4B,KAAK;CAC3D,MAAM,EAAE,WAAW;CAInB,MAAM,WAAiC;EACrC,aAAa,OAAO;EACpB,uBAAuB,iBAAiB,OAAO,OAAO;EACtD,mBAAmB,KAAK,OAAO,OAAO,OAAO,UAAU;EACvD,mBAAmB,kBAAkB;EACrC,6BAA6B,kBAAkB;EAC/C,mBAAmB,iBAAiB,OAAO,SAAS;EACpD,eAAe,KAAK,OAAO,SAAS,OAAO,UAAU;EACrD,mBAAmB,iBAAiB,OAAO,SAAS;EACpD,eAAe,KAAK,OAAO,SAAS,OAAO,UAAU;EACrD,gBAAgB,iBAAiB,OAAO,MAAM;EAC9C,YAAY,KAAK,OAAO,MAAM,OAAO,UAAU;CACjD;CACA,MAAM,QAAQ,CAAC;CACf,KAAK,MAAM,CAAC,MAAM,aAAa,OAAO,QAAQ,sBAAsB,GAAG;EACrE,MAAM,QAAQ,SAAS,SAA8B,UAAU;EAC/D,IAAI,CAAC,OAAO,MAAM,IAAI,MAAM,GAAG,MAAM,GAAG,uCAAuC,UAAU;EACzF,MAAM,QAA6B;CACrC;CACA,OAAO;AACT;AAMA,SAAS,WAAW,OAA8C;CAChE,OAAO,UAAU,2BAA2B;EAC1C,YAAY,MAAM,OAAO;EACzB,YAAY,MAAM,OAAO;EACzB,QAAQ,MAAM;EACd,WAAW,MAAM;EACjB,GAAG,MAAM;CACX,CAAC;AACH;AAEA,SAAS,SAAS,OAA4C;CAC5D,OAAO,UAAU,yBAAyB,YAAY,KAAK,CAAC;AAC9D;AAEA,SAAS,aAAa,OAAyC;CAC7D,OAAO;EACL,QAAQ,MAAM,WAAW;EACzB,KAAK,MAAM,WAAW;EACtB,SAAS,MAAM,WAAW;CAC5B;AACF;;;;;;;;;;AAWA,SAAgB,kBAAkB,OAAsC;CACtE,OAAO;EACL,IAAI,MAAM;EACV,QAAQ,MAAM;EACd,aAAa,MAAM;EACnB,OAAO,MAAM;EACb,YAAY,MAAM;EAClB,aAAa,MAAM;EACnB,QAAQ,SAAS,KAAK;EACtB,UAAU,WAAW,KAAK;EAC1B,QAAQ,SAAS,KAAK;EACtB,OAAO,YAAY,KAAK;EACxB,YAAY,aAAa,KAAK;CAChC;AACF;;AAGA,SAAS,KAAQ,OAAyB;CACxC,IAAI,QAAQ;CACZ,IAAI;CACJ,aAAa;EACX,IAAI,CAAC,OAAO;GACV,QAAQ,MAAM;GACd,QAAQ;EACV;EACA,OAAO;CACT;AACF;AAEA,IAAM,QAAW,WAAwC;CACvD,KAAK,KAAK,KAAK;CACf,YAAY;AACd;;;;;;;;;;;AAYA,SAAgB,sBAAsB,OAAsC;CAC1E,OAAO,OAAO,iBACZ;EACE,IAAI,MAAM;EACV,QAAQ,MAAM;EACd,aAAa,MAAM;EACnB,OAAO,MAAM;EACb,YAAY,MAAM;EAClB,aAAa,MAAM;EACnB,YAAY,aAAa,KAAK;CAChC,GACA;EACE,QAAQ,WAAW,SAAS,KAAK,CAAC;EAClC,UAAU,WAAW,WAAW,KAAK,CAAC;EACtC,QAAQ,WAAW,SAAS,KAAK,CAAC;EAClC,OAAO,WAAW,YAAY,KAAK,CAAC;CACtC,CACF;AACF"}
1
+ {"version":3,"file":"theme-records.js","names":[],"sources":["../../src/lib/theme-records.ts"],"sourcesContent":["/**\n * One catalogue record, as this system's {@link ThemeVariant}.\n *\n * `variantFromRecord` and the lazy form the catalogue is built with live here, and not\n * beside the 34-theme table in `lib/themes.ts`, because a bundler places a module\n * whole: a host that imports `variantFromRecord` from the same module as the table\n * ships the table with it. This module reads a record it is handed and imports no\n * catalogue, so a start-up path that only turns a stored record into a variant\n * (an imported theme, a reconstruction) stays small. `lib/themes.ts` re-exports\n * `variantFromRecord`; the lazy start-up gate (`check:theme-startup`) holds the split\n * in place.\n *\n * It does import `@adea-ai/themes` for the projection helpers (`chartSeries`,\n * `tint`, `shadcnVariables`…), none of which reads the table of themes.\n */\nimport {\n chartSeries,\n shadcnDestructiveProjection,\n statusForeground,\n syntaxRoles,\n tint,\n type AdeaThemeRecord,\n} from '@adea-ai/themes'\nimport { shadcnVariables } from '@adea-ai/themes/adapters/shadcn'\nimport {\n THEME_COLOR_PROPERTIES,\n THEME_EDITOR_PROPERTIES,\n THEME_TERMINAL_PROPERTIES,\n pickRoles,\n type ThemeColors,\n type ThemeEditorPalette,\n type ThemeProvenance,\n type ThemeTerminalPalette,\n type ThemeVariant,\n} from './theme-types'\n\n/** The catalogue's canonical theme shapes, for a host that holds records and no catalogue. */\nexport type { AdeaTheme, AdeaThemeRecord } from '@adea-ai/themes'\n\n/**\n * The shadcn-vocabulary roles of one catalogue entry.\n *\n * The expensive half of a variant: `shadcnVariables` projects the whole palette\n * (about 4 ms a theme), which is why {@link lazyVariantFromRecord} defers it.\n */\nfunction colorsOf(theme: AdeaThemeRecord): ThemeColors {\n const projected = shadcnVariables(theme)\n const destructiveAction = shadcnDestructiveProjection(theme)\n const { colors } = theme\n // The status labels and washes are measured from the canonical roles. `destructive`\n // keeps the UI's semantic error token: the shared projection fills `--destructive`\n // with its contrast-safe solid-action colour, which UI keeps as `destructiveAction`.\n const measured: Partial<ThemeColors> = {\n destructive: colors.error,\n destructiveForeground: statusForeground(theme, 'error'),\n destructiveSubtle: tint(colors.error, colors.background),\n destructiveAction: destructiveAction.fill,\n destructiveActionForeground: destructiveAction.foreground,\n successForeground: statusForeground(theme, 'success'),\n successSubtle: tint(colors.success, colors.background),\n warningForeground: statusForeground(theme, 'warning'),\n warningSubtle: tint(colors.warning, colors.background),\n infoForeground: statusForeground(theme, 'info'),\n infoSubtle: tint(colors.info, colors.background),\n }\n const roles = {} as ThemeColors\n for (const [role, property] of Object.entries(THEME_COLOR_PROPERTIES)) {\n const value = measured[role as keyof ThemeColors] ?? projected[property]\n if (!value) throw new Error(`${theme.id} has no shared shadcn projection for ${property}`)\n roles[role as keyof ThemeColors] = value\n }\n return roles\n}\n\n// The embedded terminal uses the theme's own canvas rather than a palette of its\n// own. The ANSI colours came from the palette that produced the canvas, so they\n// were chosen against it; a terminal on a different background would be the one\n// surface in the application not lit by the active theme.\nfunction terminalOf(theme: AdeaThemeRecord): ThemeTerminalPalette {\n return pickRoles(THEME_TERMINAL_PROPERTIES, {\n background: theme.colors.background,\n foreground: theme.colors.foreground,\n cursor: theme.cursor,\n selection: theme.selection,\n ...theme.ansi,\n })\n}\n\nfunction editorOf(theme: AdeaThemeRecord): ThemeEditorPalette {\n return pickRoles(THEME_EDITOR_PROPERTIES, syntaxRoles(theme))\n}\n\nfunction provenanceOf(theme: AdeaThemeRecord): ThemeProvenance {\n return {\n source: theme.provenance.project,\n url: theme.provenance.url,\n license: theme.provenance.license,\n }\n}\n\n/**\n * The design system's view of one catalogue record, built in full and at once.\n *\n * For a host that holds a record the catalogue does not, an imported theme, a\n * reconstruction from stored data, and wants a variant it can hand to\n * `ThemeProvider`'s `themes`. It throws for a record the shadcn projection cannot\n * map, here and now, rather than on first paint. The catalogue itself goes through\n * {@link lazyVariantFromRecord} instead.\n */\nexport function variantFromRecord(theme: AdeaThemeRecord): ThemeVariant {\n return {\n id: theme.id,\n family: theme.family,\n familyLabel: theme.familyLabel,\n label: theme.label,\n appearance: theme.appearance,\n description: theme.description,\n colors: colorsOf(theme),\n terminal: terminalOf(theme),\n editor: editorOf(theme),\n chart: chartSeries(theme),\n provenance: provenanceOf(theme),\n }\n}\n\n/** Runs `build` on first call and returns that value from then on. A throw is not cached. */\nfunction once<T>(build: () => T): () => T {\n let built = false\n let value: T\n return () => {\n if (!built) {\n value = build()\n built = true\n }\n return value\n }\n}\n\nconst lazy = <T>(build: () => T): PropertyDescriptor => ({\n get: once(build),\n enumerable: true,\n})\n\n/**\n * {@link variantFromRecord} with the four derived palettes built on first read.\n *\n * Evaluating this module used to project all 34 catalogue themes up front, about\n * 155 ms before a single one was needed, on the hydration path of every consumer.\n * A page paints one variant, and a picker's labels and appearance are plain\n * fields, so only a variant whose `colors`, `terminal`, `editor` or `chart` is read\n * pays for them, once. The properties stay enumerable data-shaped accessors, so\n * spreading, `Object.entries` and JSON see the same object they always did.\n */\nexport function lazyVariantFromRecord(theme: AdeaThemeRecord): ThemeVariant {\n return Object.defineProperties(\n {\n id: theme.id,\n family: theme.family,\n familyLabel: theme.familyLabel,\n label: theme.label,\n appearance: theme.appearance,\n description: theme.description,\n provenance: provenanceOf(theme),\n },\n {\n colors: lazy(() => colorsOf(theme)),\n terminal: lazy(() => terminalOf(theme)),\n editor: lazy(() => editorOf(theme)),\n chart: lazy(() => chartSeries(theme)),\n }\n ) as ThemeVariant\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,SAAS,SAAS,OAAqC;CACrD,MAAM,YAAY,gBAAgB,KAAK;CACvC,MAAM,oBAAoB,4BAA4B,KAAK;CAC3D,MAAM,EAAE,WAAW;CAInB,MAAM,WAAiC;EACrC,aAAa,OAAO;EACpB,uBAAuB,iBAAiB,OAAO,OAAO;EACtD,mBAAmB,KAAK,OAAO,OAAO,OAAO,UAAU;EACvD,mBAAmB,kBAAkB;EACrC,6BAA6B,kBAAkB;EAC/C,mBAAmB,iBAAiB,OAAO,SAAS;EACpD,eAAe,KAAK,OAAO,SAAS,OAAO,UAAU;EACrD,mBAAmB,iBAAiB,OAAO,SAAS;EACpD,eAAe,KAAK,OAAO,SAAS,OAAO,UAAU;EACrD,gBAAgB,iBAAiB,OAAO,MAAM;EAC9C,YAAY,KAAK,OAAO,MAAM,OAAO,UAAU;CACjD;CACA,MAAM,QAAQ,CAAC;CACf,KAAK,MAAM,CAAC,MAAM,aAAa,OAAO,QAAQ,sBAAsB,GAAG;EACrE,MAAM,QAAQ,SAAS,SAA8B,UAAU;EAC/D,IAAI,CAAC,OAAO,MAAM,IAAI,MAAM,GAAG,MAAM,GAAG,uCAAuC,UAAU;EACzF,MAAM,QAA6B;CACrC;CACA,OAAO;AACT;AAMA,SAAS,WAAW,OAA8C;CAChE,OAAO,UAAU,2BAA2B;EAC1C,YAAY,MAAM,OAAO;EACzB,YAAY,MAAM,OAAO;EACzB,QAAQ,MAAM;EACd,WAAW,MAAM;EACjB,GAAG,MAAM;CACX,CAAC;AACH;AAEA,SAAS,SAAS,OAA4C;CAC5D,OAAO,UAAU,yBAAyB,YAAY,KAAK,CAAC;AAC9D;AAEA,SAAS,aAAa,OAAyC;CAC7D,OAAO;EACL,QAAQ,MAAM,WAAW;EACzB,KAAK,MAAM,WAAW;EACtB,SAAS,MAAM,WAAW;CAC5B;AACF;;;;;;;;;;AAWA,SAAgB,kBAAkB,OAAsC;CACtE,OAAO;EACL,IAAI,MAAM;EACV,QAAQ,MAAM;EACd,aAAa,MAAM;EACnB,OAAO,MAAM;EACb,YAAY,MAAM;EAClB,aAAa,MAAM;EACnB,QAAQ,SAAS,KAAK;EACtB,UAAU,WAAW,KAAK;EAC1B,QAAQ,SAAS,KAAK;EACtB,OAAO,YAAY,KAAK;EACxB,YAAY,aAAa,KAAK;CAChC;AACF;;AAGA,SAAS,KAAQ,OAAyB;CACxC,IAAI,QAAQ;CACZ,IAAI;CACJ,aAAa;EACX,IAAI,CAAC,OAAO;GACV,QAAQ,MAAM;GACd,QAAQ;EACV;EACA,OAAO;CACT;AACF;AAEA,IAAM,QAAW,WAAwC;CACvD,KAAK,KAAK,KAAK;CACf,YAAY;AACd;;;;;;;;;;;AAYA,SAAgB,sBAAsB,OAAsC;CAC1E,OAAO,OAAO,iBACZ;EACE,IAAI,MAAM;EACV,QAAQ,MAAM;EACd,aAAa,MAAM;EACnB,OAAO,MAAM;EACb,YAAY,MAAM;EAClB,aAAa,MAAM;EACnB,YAAY,aAAa,KAAK;CAChC,GACA;EACE,QAAQ,WAAW,SAAS,KAAK,CAAC;EAClC,UAAU,WAAW,WAAW,KAAK,CAAC;EACtC,QAAQ,WAAW,SAAS,KAAK,CAAC;EAClC,OAAO,WAAW,YAAY,KAAK,CAAC;CACtC,CACF;AACF"}
@@ -131,7 +131,7 @@ export type ThemeVariant = {
131
131
  /**
132
132
  * Custom properties written verbatim over `themeCssVariables`, last.
133
133
  *
134
- * For a variant a host built from data it does not control the derivation of —
134
+ * For a variant a host built from data it does not control the derivation of,
135
135
  * an imported theme whose painted colours must stay exactly what the user
136
136
  * imported. The catalogue's own variants never carry it, so the derived roles
137
137
  * stay the only source of truth for them.
@@ -1 +1 @@
1
- {"version":3,"file":"theme-types.js","names":[],"sources":["../../src/lib/theme-types.ts"],"sourcesContent":["/**\n * The shapes of the theme system, and the role tables they are built from.\n *\n * Its own module, with no runtime dependency, because everything else depends on it:\n * the catalogue bridge (`lib/themes`), the catalogue-free engine, the provider and\n * the build scripts. `lib/themes` changes with the catalogue; these change only when\n * a role is added, so nothing that only needs a type has to import the catalogue's\n * module to get it.\n */\n\nexport type ThemeAppearance = 'light' | 'dark'\n\n/**\n * The surface and text roles, in shadcn's vocabulary, with the custom property each\n * one paints.\n *\n * Named to match the components, which is why they differ from the catalogue's:\n * these are this system's variable names, and renaming them would mean touching\n * every component in the library for no gain. `destructiveAction` is the\n * contrast-safe solid-action presentation, derived from the canonical error role.\n */\nexport const THEME_COLOR_PROPERTIES = {\n background: '--background',\n foreground: '--foreground',\n card: '--card',\n cardForeground: '--card-foreground',\n popover: '--popover',\n popoverForeground: '--popover-foreground',\n primary: '--primary',\n primaryForeground: '--primary-foreground',\n secondary: '--secondary',\n secondaryForeground: '--secondary-foreground',\n muted: '--muted',\n mutedForeground: '--muted-foreground',\n accent: '--accent',\n accentForeground: '--accent-foreground',\n destructive: '--destructive',\n destructiveForeground: '--destructive-foreground',\n destructiveSubtle: '--destructive-subtle',\n destructiveAction: '--destructive-action',\n destructiveActionForeground: '--destructive-action-foreground',\n success: '--success',\n successForeground: '--success-foreground',\n successSubtle: '--success-subtle',\n warning: '--warning',\n warningForeground: '--warning-foreground',\n warningSubtle: '--warning-subtle',\n info: '--info',\n infoForeground: '--info-foreground',\n infoSubtle: '--info-subtle',\n border: '--border',\n input: '--input',\n ring: '--ring',\n sidebar: '--sidebar',\n sidebarForeground: '--sidebar-foreground',\n sidebarAccent: '--sidebar-accent',\n sidebarBorder: '--sidebar-border',\n sidebarMutedForeground: '--sidebar-muted-foreground',\n} as const\n\nexport type ThemeColors = Record<keyof typeof THEME_COLOR_PROPERTIES, string>\n\n/** The sixteen ANSI colours a terminal needs, plus its cursor and selection. */\nexport const THEME_TERMINAL_PROPERTIES = {\n background: '--terminal-background',\n foreground: '--terminal-foreground',\n cursor: '--terminal-cursor',\n selection: '--terminal-selection',\n black: '--terminal-ansi-black',\n red: '--terminal-ansi-red',\n green: '--terminal-ansi-green',\n yellow: '--terminal-ansi-yellow',\n blue: '--terminal-ansi-blue',\n magenta: '--terminal-ansi-magenta',\n cyan: '--terminal-ansi-cyan',\n white: '--terminal-ansi-white',\n brightBlack: '--terminal-ansi-bright-black',\n brightRed: '--terminal-ansi-bright-red',\n brightGreen: '--terminal-ansi-bright-green',\n brightYellow: '--terminal-ansi-bright-yellow',\n brightBlue: '--terminal-ansi-bright-blue',\n brightMagenta: '--terminal-ansi-bright-magenta',\n brightCyan: '--terminal-ansi-bright-cyan',\n brightWhite: '--terminal-ansi-bright-white',\n} as const\n\nexport type ThemeTerminalPalette = Record<keyof typeof THEME_TERMINAL_PROPERTIES, string>\n\n/** The syntax roles a code view needs. */\nexport const THEME_EDITOR_PROPERTIES = {\n keyword: '--editor-keyword',\n string: '--editor-string',\n number: '--editor-number',\n comment: '--editor-comment',\n function: '--editor-function',\n variable: '--editor-variable',\n type: '--editor-type',\n tag: '--editor-tag',\n attribute: '--editor-attribute',\n operator: '--editor-operator',\n heading: '--editor-heading',\n link: '--editor-link',\n diffAdd: '--editor-diff-add',\n diffDelete: '--editor-diff-delete',\n diffHunk: '--editor-diff-hunk',\n searchMatch: '--editor-search-match',\n} as const\n\nexport type ThemeEditorPalette = Record<keyof typeof THEME_EDITOR_PROPERTIES, string>\n\n/** The roles of `table` read out of `source`, in the table's order. */\nexport function pickRoles<Table extends Readonly<Record<string, string>>>(\n table: Table,\n source: Readonly<Record<keyof Table, string>>\n): Record<keyof Table, string> {\n const picked = {} as Record<keyof Table, string>\n for (const role of Object.keys(table) as (keyof Table)[]) picked[role] = source[role]\n return picked\n}\n\n/** `palette` as the custom properties `table` names, in the table's order. */\nexport function rolesAsProperties<Table extends Readonly<Record<string, string>>>(\n table: Table,\n palette: Readonly<Record<keyof Table, string>>\n): Record<string, string> {\n const properties: Record<string, string> = {}\n for (const [role, property] of Object.entries(table)) properties[property] = palette[role]!\n return properties\n}\n\n/** Where a palette came from, and the terms it is used under. */\nexport type ThemeProvenance = {\n /** The project or person the palette belongs to. */\n source: string\n url: string\n /** An SPDX identifier. Every palette in this catalogue is permissive. */\n license: string\n}\n\nexport type ThemeVariant = {\n /** The `data-theme` value and the id a preference stores. */\n id: string\n /** Groups the variants that came from one project. */\n family: string\n familyLabel: string\n label: string\n appearance: ThemeAppearance\n /** One line, shown in a picker. */\n description: string\n colors: ThemeColors\n terminal: ThemeTerminalPalette\n editor: ThemeEditorPalette\n /** The categorical series, in order. */\n chart: readonly string[]\n provenance: ThemeProvenance\n /**\n * Custom properties written verbatim over `themeCssVariables`, last.\n *\n * For a variant a host built from data it does not control the derivation of —\n * an imported theme whose painted colours must stay exactly what the user\n * imported. The catalogue's own variants never carry it, so the derived roles\n * stay the only source of truth for them.\n */\n tokens?: Readonly<Record<string, string>>\n}\n\n/**\n * Which projection fills the `--editor-*` ramp.\n *\n * - `syntax` (the default) is the catalogue's quiet syntax roles, as `ThemeVariant.editor`\n * holds them: a comment may sit below body-text contrast, because in a code view\n * it is meant to recede.\n * - `floor` holds every editor role to 4.5:1 on the canvas (`editorRolesHex`), for a\n * host that renders code as content rather than as decoration. It is hex, where\n * `syntax` is `oklch()`.\n */\nexport type EditorRolesMode = 'syntax' | 'floor'\n\n/** Options for `themeCssVariables`. */\nexport type ThemeCssVariableOptions = {\n /** The `--editor-*` projection. Default `syntax`: absent, the output is unchanged. */\n editor?: EditorRolesMode\n}\n\n/** What an accent is held to when it is resolved against a surface. */\nexport type AccentVariableOptions = {\n /** The surface the accent must read on: the variant's `colors.background`. */\n background?: string\n /**\n * The contrast floor against `background`. Absent, a preset is painted verbatim\n * and only a custom `#rrggbb` is held to the default floor.\n */\n floor?: number\n /** The variant the accent is applied to, so the tint takes its measured strength. */\n variantId?: string\n}\n\n/** A selection's light and dark theme ids. */\nexport type ThemePair = { lightThemeId: string; darkThemeId: string }\n"],"mappings":";;;;;;;;;;AAqBA,IAAa,yBAAyB;CACpC,YAAY;CACZ,YAAY;CACZ,MAAM;CACN,gBAAgB;CAChB,SAAS;CACT,mBAAmB;CACnB,SAAS;CACT,mBAAmB;CACnB,WAAW;CACX,qBAAqB;CACrB,OAAO;CACP,iBAAiB;CACjB,QAAQ;CACR,kBAAkB;CAClB,aAAa;CACb,uBAAuB;CACvB,mBAAmB;CACnB,mBAAmB;CACnB,6BAA6B;CAC7B,SAAS;CACT,mBAAmB;CACnB,eAAe;CACf,SAAS;CACT,mBAAmB;CACnB,eAAe;CACf,MAAM;CACN,gBAAgB;CAChB,YAAY;CACZ,QAAQ;CACR,OAAO;CACP,MAAM;CACN,SAAS;CACT,mBAAmB;CACnB,eAAe;CACf,eAAe;CACf,wBAAwB;AAC1B;;AAKA,IAAa,4BAA4B;CACvC,YAAY;CACZ,YAAY;CACZ,QAAQ;CACR,WAAW;CACX,OAAO;CACP,KAAK;CACL,OAAO;CACP,QAAQ;CACR,MAAM;CACN,SAAS;CACT,MAAM;CACN,OAAO;CACP,aAAa;CACb,WAAW;CACX,aAAa;CACb,cAAc;CACd,YAAY;CACZ,eAAe;CACf,YAAY;CACZ,aAAa;AACf;;AAKA,IAAa,0BAA0B;CACrC,SAAS;CACT,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,UAAU;CACV,UAAU;CACV,MAAM;CACN,KAAK;CACL,WAAW;CACX,UAAU;CACV,SAAS;CACT,MAAM;CACN,SAAS;CACT,YAAY;CACZ,UAAU;CACV,aAAa;AACf;;AAKA,SAAgB,UACd,OACA,QAC6B;CAC7B,MAAM,SAAS,CAAC;CAChB,KAAK,MAAM,QAAQ,OAAO,KAAK,KAAK,GAAsB,OAAO,QAAQ,OAAO;CAChF,OAAO;AACT;;AAGA,SAAgB,kBACd,OACA,SACwB;CACxB,MAAM,aAAqC,CAAC;CAC5C,KAAK,MAAM,CAAC,MAAM,aAAa,OAAO,QAAQ,KAAK,GAAG,WAAW,YAAY,QAAQ;CACrF,OAAO;AACT"}
1
+ {"version":3,"file":"theme-types.js","names":[],"sources":["../../src/lib/theme-types.ts"],"sourcesContent":["/**\n * The shapes of the theme system, and the role tables they are built from.\n *\n * Its own module, with no runtime dependency, because everything else depends on it:\n * the catalogue bridge (`lib/themes`), the catalogue-free engine, the provider and\n * the build scripts. `lib/themes` changes with the catalogue; these change only when\n * a role is added, so nothing that only needs a type has to import the catalogue's\n * module to get it.\n */\n\nexport type ThemeAppearance = 'light' | 'dark'\n\n/**\n * The surface and text roles, in shadcn's vocabulary, with the custom property each\n * one paints.\n *\n * Named to match the components, which is why they differ from the catalogue's:\n * these are this system's variable names, and renaming them would mean touching\n * every component in the library for no gain. `destructiveAction` is the\n * contrast-safe solid-action presentation, derived from the canonical error role.\n */\nexport const THEME_COLOR_PROPERTIES = {\n background: '--background',\n foreground: '--foreground',\n card: '--card',\n cardForeground: '--card-foreground',\n popover: '--popover',\n popoverForeground: '--popover-foreground',\n primary: '--primary',\n primaryForeground: '--primary-foreground',\n secondary: '--secondary',\n secondaryForeground: '--secondary-foreground',\n muted: '--muted',\n mutedForeground: '--muted-foreground',\n accent: '--accent',\n accentForeground: '--accent-foreground',\n destructive: '--destructive',\n destructiveForeground: '--destructive-foreground',\n destructiveSubtle: '--destructive-subtle',\n destructiveAction: '--destructive-action',\n destructiveActionForeground: '--destructive-action-foreground',\n success: '--success',\n successForeground: '--success-foreground',\n successSubtle: '--success-subtle',\n warning: '--warning',\n warningForeground: '--warning-foreground',\n warningSubtle: '--warning-subtle',\n info: '--info',\n infoForeground: '--info-foreground',\n infoSubtle: '--info-subtle',\n border: '--border',\n input: '--input',\n ring: '--ring',\n sidebar: '--sidebar',\n sidebarForeground: '--sidebar-foreground',\n sidebarAccent: '--sidebar-accent',\n sidebarBorder: '--sidebar-border',\n sidebarMutedForeground: '--sidebar-muted-foreground',\n} as const\n\nexport type ThemeColors = Record<keyof typeof THEME_COLOR_PROPERTIES, string>\n\n/** The sixteen ANSI colours a terminal needs, plus its cursor and selection. */\nexport const THEME_TERMINAL_PROPERTIES = {\n background: '--terminal-background',\n foreground: '--terminal-foreground',\n cursor: '--terminal-cursor',\n selection: '--terminal-selection',\n black: '--terminal-ansi-black',\n red: '--terminal-ansi-red',\n green: '--terminal-ansi-green',\n yellow: '--terminal-ansi-yellow',\n blue: '--terminal-ansi-blue',\n magenta: '--terminal-ansi-magenta',\n cyan: '--terminal-ansi-cyan',\n white: '--terminal-ansi-white',\n brightBlack: '--terminal-ansi-bright-black',\n brightRed: '--terminal-ansi-bright-red',\n brightGreen: '--terminal-ansi-bright-green',\n brightYellow: '--terminal-ansi-bright-yellow',\n brightBlue: '--terminal-ansi-bright-blue',\n brightMagenta: '--terminal-ansi-bright-magenta',\n brightCyan: '--terminal-ansi-bright-cyan',\n brightWhite: '--terminal-ansi-bright-white',\n} as const\n\nexport type ThemeTerminalPalette = Record<keyof typeof THEME_TERMINAL_PROPERTIES, string>\n\n/** The syntax roles a code view needs. */\nexport const THEME_EDITOR_PROPERTIES = {\n keyword: '--editor-keyword',\n string: '--editor-string',\n number: '--editor-number',\n comment: '--editor-comment',\n function: '--editor-function',\n variable: '--editor-variable',\n type: '--editor-type',\n tag: '--editor-tag',\n attribute: '--editor-attribute',\n operator: '--editor-operator',\n heading: '--editor-heading',\n link: '--editor-link',\n diffAdd: '--editor-diff-add',\n diffDelete: '--editor-diff-delete',\n diffHunk: '--editor-diff-hunk',\n searchMatch: '--editor-search-match',\n} as const\n\nexport type ThemeEditorPalette = Record<keyof typeof THEME_EDITOR_PROPERTIES, string>\n\n/** The roles of `table` read out of `source`, in the table's order. */\nexport function pickRoles<Table extends Readonly<Record<string, string>>>(\n table: Table,\n source: Readonly<Record<keyof Table, string>>\n): Record<keyof Table, string> {\n const picked = {} as Record<keyof Table, string>\n for (const role of Object.keys(table) as (keyof Table)[]) picked[role] = source[role]\n return picked\n}\n\n/** `palette` as the custom properties `table` names, in the table's order. */\nexport function rolesAsProperties<Table extends Readonly<Record<string, string>>>(\n table: Table,\n palette: Readonly<Record<keyof Table, string>>\n): Record<string, string> {\n const properties: Record<string, string> = {}\n for (const [role, property] of Object.entries(table)) properties[property] = palette[role]!\n return properties\n}\n\n/** Where a palette came from, and the terms it is used under. */\nexport type ThemeProvenance = {\n /** The project or person the palette belongs to. */\n source: string\n url: string\n /** An SPDX identifier. Every palette in this catalogue is permissive. */\n license: string\n}\n\nexport type ThemeVariant = {\n /** The `data-theme` value and the id a preference stores. */\n id: string\n /** Groups the variants that came from one project. */\n family: string\n familyLabel: string\n label: string\n appearance: ThemeAppearance\n /** One line, shown in a picker. */\n description: string\n colors: ThemeColors\n terminal: ThemeTerminalPalette\n editor: ThemeEditorPalette\n /** The categorical series, in order. */\n chart: readonly string[]\n provenance: ThemeProvenance\n /**\n * Custom properties written verbatim over `themeCssVariables`, last.\n *\n * For a variant a host built from data it does not control the derivation of,\n * an imported theme whose painted colours must stay exactly what the user\n * imported. The catalogue's own variants never carry it, so the derived roles\n * stay the only source of truth for them.\n */\n tokens?: Readonly<Record<string, string>>\n}\n\n/**\n * Which projection fills the `--editor-*` ramp.\n *\n * - `syntax` (the default) is the catalogue's quiet syntax roles, as `ThemeVariant.editor`\n * holds them: a comment may sit below body-text contrast, because in a code view\n * it is meant to recede.\n * - `floor` holds every editor role to 4.5:1 on the canvas (`editorRolesHex`), for a\n * host that renders code as content rather than as decoration. It is hex, where\n * `syntax` is `oklch()`.\n */\nexport type EditorRolesMode = 'syntax' | 'floor'\n\n/** Options for `themeCssVariables`. */\nexport type ThemeCssVariableOptions = {\n /** The `--editor-*` projection. Default `syntax`: absent, the output is unchanged. */\n editor?: EditorRolesMode\n}\n\n/** What an accent is held to when it is resolved against a surface. */\nexport type AccentVariableOptions = {\n /** The surface the accent must read on: the variant's `colors.background`. */\n background?: string\n /**\n * The contrast floor against `background`. Absent, a preset is painted verbatim\n * and only a custom `#rrggbb` is held to the default floor.\n */\n floor?: number\n /** The variant the accent is applied to, so the tint takes its measured strength. */\n variantId?: string\n}\n\n/** A selection's light and dark theme ids. */\nexport type ThemePair = { lightThemeId: string; darkThemeId: string }\n"],"mappings":";;;;;;;;;;AAqBA,IAAa,yBAAyB;CACpC,YAAY;CACZ,YAAY;CACZ,MAAM;CACN,gBAAgB;CAChB,SAAS;CACT,mBAAmB;CACnB,SAAS;CACT,mBAAmB;CACnB,WAAW;CACX,qBAAqB;CACrB,OAAO;CACP,iBAAiB;CACjB,QAAQ;CACR,kBAAkB;CAClB,aAAa;CACb,uBAAuB;CACvB,mBAAmB;CACnB,mBAAmB;CACnB,6BAA6B;CAC7B,SAAS;CACT,mBAAmB;CACnB,eAAe;CACf,SAAS;CACT,mBAAmB;CACnB,eAAe;CACf,MAAM;CACN,gBAAgB;CAChB,YAAY;CACZ,QAAQ;CACR,OAAO;CACP,MAAM;CACN,SAAS;CACT,mBAAmB;CACnB,eAAe;CACf,eAAe;CACf,wBAAwB;AAC1B;;AAKA,IAAa,4BAA4B;CACvC,YAAY;CACZ,YAAY;CACZ,QAAQ;CACR,WAAW;CACX,OAAO;CACP,KAAK;CACL,OAAO;CACP,QAAQ;CACR,MAAM;CACN,SAAS;CACT,MAAM;CACN,OAAO;CACP,aAAa;CACb,WAAW;CACX,aAAa;CACb,cAAc;CACd,YAAY;CACZ,eAAe;CACf,YAAY;CACZ,aAAa;AACf;;AAKA,IAAa,0BAA0B;CACrC,SAAS;CACT,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,UAAU;CACV,UAAU;CACV,MAAM;CACN,KAAK;CACL,WAAW;CACX,UAAU;CACV,SAAS;CACT,MAAM;CACN,SAAS;CACT,YAAY;CACZ,UAAU;CACV,aAAa;AACf;;AAKA,SAAgB,UACd,OACA,QAC6B;CAC7B,MAAM,SAAS,CAAC;CAChB,KAAK,MAAM,QAAQ,OAAO,KAAK,KAAK,GAAsB,OAAO,QAAQ,OAAO;CAChF,OAAO;AACT;;AAGA,SAAgB,kBACd,OACA,SACwB;CACxB,MAAM,aAAqC,CAAC;CAC5C,KAAK,MAAM,CAAC,MAAM,aAAa,OAAO,QAAQ,KAAK,GAAG,WAAW,YAAY,QAAQ;CACrF,OAAO;AACT"}
@@ -5,7 +5,7 @@
5
5
  * the design system: the translation between the catalogue's **canonical** role
6
6
  * names and the **shadcn** vocabulary every component here is written against, plus
7
7
  * the handful of custom properties this system declares that are presentations of
8
- * data the catalogue already holds — the `--terminal-*` ramp, the `--editor-*` ramp,
8
+ * data the catalogue already holds, the `--terminal-*` ramp, the `--editor-*` ramp,
9
9
  * and `--chrome`.
10
10
  *
11
11
  * ## Why it is a bridge and not a copy
@@ -13,7 +13,7 @@
13
13
  * This file used to hold thirteen themes as hand-written hex literal tables, with its
14
14
  * own contrast validator, its own terminal and editor palettes, and its own
15
15
  * provenance records. That is a lot of surface to maintain for one consumer of a
16
- * palette, and it meant every product that wanted the same themes — Adea, Cortana —
16
+ * palette, and it meant every product that wanted the same themes, Adea, Cortana,
17
17
  * either imported this package or wrote its own. The catalogue moved out so that
18
18
  * there is one answer to "what is Catppuccin Mocha", and this file is the part that
19
19
  * genuinely belongs to the design system.
@@ -27,8 +27,8 @@
27
27
  * The package-owned `shadcnVariables` adapter maps canonical roles onto this
28
28
  * system's vocabulary. One entry will trip a reader: the catalogue's `accent`
29
29
  * becomes this system's `primary`, because in the shadcn vocabulary `--primary` is
30
- * the action colour — the fill of a primary button, the thing a focus ring is drawn
31
- * in — while `--accent` is a low-contrast hover wash. The catalogue's `accent` is
30
+ * the action colour, the fill of a primary button, the thing a focus ring is drawn
31
+ * in, while `--accent` is a low-contrast hover wash. The catalogue's `accent` is
32
32
  * the former, so it goes to `--primary`, and `--accent` is filled from
33
33
  * `surfaceHover`, which is what shadcn components actually use it for.
34
34
  */
@@ -69,7 +69,7 @@ export declare function themeFamilies(): {
69
69
  *
70
70
  * {@link builtinThemes} is this system's projection of the catalogue onto the
71
71
  * shadcn vocabulary, which is what a document is painted with. A *preview* of a
72
- * theme — the miniatures `AppearanceEditor` and `ThemeMiniature` draw — reads the
72
+ * theme, the miniatures `AppearanceEditor` and `ThemeMiniature` draw, reads the
73
73
  * catalogue's own roles instead (`surfaceActive`, `borderMuted`, `textSubtle`…),
74
74
  * several of which the projection folds together. These are those records, so a
75
75
  * consumer hands the editor exactly what it takes rather than reconstructing it
@@ -78,7 +78,7 @@ export declare function themeFamilies(): {
78
78
  export declare const themeRecords: readonly AdeaThemeRecord[];
79
79
  export declare function themeRecordById(id: string): AdeaThemeRecord | undefined;
80
80
  /**
81
- * The accents the selected light/dark pair carries — offered beside the presets.
81
+ * The accents the selected light/dark pair carries, offered beside the presets.
82
82
  *
83
83
  * Computed per pair rather than per theme because a theme accent is a *pair* of
84
84
  * values, like a preset: a slot is offered only when both themes can offer it.
@@ -87,7 +87,7 @@ export declare function themeAccentsFor(lightThemeId: string, darkThemeId: strin
87
87
  /**
88
88
  * An accent id resolved against a theme pair: a preset, a theme accent the pair
89
89
  * offers, or `undefined` for `theme`, an unknown id, or a slot this pair cannot
90
- * offer — each of which means "use the theme's own primary".
90
+ * offer, each of which means "use the theme's own primary".
91
91
  *
92
92
  * Theme accent ids are role-shaped (`ansi-blue`), so a stored one survives a theme
93
93
  * switch and resolves to the new theme's blue; when the new pair cannot offer the
@@ -105,8 +105,8 @@ export declare function withAccent<T extends AdeaTheme>(theme: T, accent: Accent
105
105
  /**
106
106
  * The two preview themes an appearance selection resolves to, accent applied.
107
107
  *
108
- * The adapter between a stored selection and `AppearanceEditor`: it takes ids —
109
- * what a preference holds — and returns the canonical records the editor's
108
+ * The adapter between a stored selection and `AppearanceEditor`: it takes ids,
109
+ * what a preference holds, and returns the canonical records the editor's
110
110
  * `lightTheme` and `darkTheme` props take, so a host does not map roles by hand.
111
111
  * Unknown ids fall back to the defaults and an accent the pair cannot offer falls
112
112
  * back to the theme's own, exactly as `ThemeProvider` resolves them.
@@ -125,24 +125,24 @@ export declare function appearancePreviewThemes(selection: {
125
125
  * ## Why this exists rather than relying on the `[data-accent]` blocks
126
126
  *
127
127
  * `theme.css` carries a `[data-accent='…']` block per preset, and those blocks are
128
- * correct — but they are unreachable at runtime. `ThemeProvider` writes a theme's
128
+ * correct, but they are unreachable at runtime. `ThemeProvider` writes a theme's
129
129
  * whole role set onto `<html>` as *inline* custom properties, and an inline
130
130
  * declaration outranks any stylesheet selector regardless of specificity. The
131
131
  * attribute was set, the rules existed, the values were right, and every one of the
132
132
  * seven accents rendered as the same blue.
133
133
  *
134
134
  * The blocks are kept, because they are what styles the window between the document
135
- * arriving and the provider mounting — which is the whole reason `themeScript`
135
+ * arriving and the provider mounting, which is the whole reason `themeScript`
136
136
  * exists. But the authoritative value has to be applied by the same code that
137
137
  * applies the theme, from the same source, or the two can drift again. So both the
138
138
  * provider and the CSS generator call `accentRoles` out of `@adea-ai/themes`, and
139
139
  * `tests/appearance-axes.test.ts` asserts the two agree value for value.
140
140
  *
141
141
  * A theme accent (`ansi-blue`) has no block: its value depends on the theme pair,
142
- * so it is resolved against `pair` — the selection's light and dark theme ids —
142
+ * so it is resolved against `pair`, the selection's light and dark theme ids,
143
143
  * and only ever applied here. Without a pair it resolves against the defaults.
144
144
  *
145
- * Returns `undefined` for `theme` — the variant's own primary — for an id the
145
+ * Returns `undefined` for `theme`, the variant's own primary, for an id the
146
146
  * catalogue does not have, and for a theme accent the pair does not offer, so a
147
147
  * stale stored preference falls back to the theme rather than blanking the primary.
148
148
  */
@@ -14,7 +14,7 @@ import { accentForeground, contrastRatio, editorRolesHex, getAccent, getTheme, h
14
14
  * the design system: the translation between the catalogue's **canonical** role
15
15
  * names and the **shadcn** vocabulary every component here is written against, plus
16
16
  * the handful of custom properties this system declares that are presentations of
17
- * data the catalogue already holds — the `--terminal-*` ramp, the `--editor-*` ramp,
17
+ * data the catalogue already holds, the `--terminal-*` ramp, the `--editor-*` ramp,
18
18
  * and `--chrome`.
19
19
  *
20
20
  * ## Why it is a bridge and not a copy
@@ -22,7 +22,7 @@ import { accentForeground, contrastRatio, editorRolesHex, getAccent, getTheme, h
22
22
  * This file used to hold thirteen themes as hand-written hex literal tables, with its
23
23
  * own contrast validator, its own terminal and editor palettes, and its own
24
24
  * provenance records. That is a lot of surface to maintain for one consumer of a
25
- * palette, and it meant every product that wanted the same themes — Adea, Cortana —
25
+ * palette, and it meant every product that wanted the same themes, Adea, Cortana,
26
26
  * either imported this package or wrote its own. The catalogue moved out so that
27
27
  * there is one answer to "what is Catppuccin Mocha", and this file is the part that
28
28
  * genuinely belongs to the design system.
@@ -36,8 +36,8 @@ import { accentForeground, contrastRatio, editorRolesHex, getAccent, getTheme, h
36
36
  * The package-owned `shadcnVariables` adapter maps canonical roles onto this
37
37
  * system's vocabulary. One entry will trip a reader: the catalogue's `accent`
38
38
  * becomes this system's `primary`, because in the shadcn vocabulary `--primary` is
39
- * the action colour — the fill of a primary button, the thing a focus ring is drawn
40
- * in — while `--accent` is a low-contrast hover wash. The catalogue's `accent` is
39
+ * the action colour, the fill of a primary button, the thing a focus ring is drawn
40
+ * in, while `--accent` is a low-contrast hover wash. The catalogue's `accent` is
41
41
  * the former, so it goes to `--primary`, and `--accent` is filled from
42
42
  * `surfaceHover`, which is what shadcn components actually use it for.
43
43
  */
@@ -86,7 +86,7 @@ function themeFamilies() {
86
86
  *
87
87
  * {@link builtinThemes} is this system's projection of the catalogue onto the
88
88
  * shadcn vocabulary, which is what a document is painted with. A *preview* of a
89
- * theme — the miniatures `AppearanceEditor` and `ThemeMiniature` draw — reads the
89
+ * theme, the miniatures `AppearanceEditor` and `ThemeMiniature` draw, reads the
90
90
  * catalogue's own roles instead (`surfaceActive`, `borderMuted`, `textSubtle`…),
91
91
  * several of which the projection folds together. These are those records, so a
92
92
  * consumer hands the editor exactly what it takes rather than reconstructing it
@@ -105,7 +105,7 @@ function recordPair(pair) {
105
105
  };
106
106
  }
107
107
  /**
108
- * The accents the selected light/dark pair carries — offered beside the presets.
108
+ * The accents the selected light/dark pair carries, offered beside the presets.
109
109
  *
110
110
  * Computed per pair rather than per theme because a theme accent is a *pair* of
111
111
  * values, like a preset: a slot is offered only when both themes can offer it.
@@ -120,7 +120,7 @@ function themeAccentsFor(lightThemeId, darkThemeId) {
120
120
  /**
121
121
  * An accent id resolved against a theme pair: a preset, a theme accent the pair
122
122
  * offers, or `undefined` for `theme`, an unknown id, or a slot this pair cannot
123
- * offer — each of which means "use the theme's own primary".
123
+ * offer, each of which means "use the theme's own primary".
124
124
  *
125
125
  * Theme accent ids are role-shaped (`ansi-blue`), so a stored one survives a theme
126
126
  * switch and resolves to the new theme's blue; when the new pair cannot offer the
@@ -155,8 +155,8 @@ function withAccent(theme, accent) {
155
155
  /**
156
156
  * The two preview themes an appearance selection resolves to, accent applied.
157
157
  *
158
- * The adapter between a stored selection and `AppearanceEditor`: it takes ids —
159
- * what a preference holds — and returns the canonical records the editor's
158
+ * The adapter between a stored selection and `AppearanceEditor`: it takes ids,
159
+ * what a preference holds, and returns the canonical records the editor's
160
160
  * `lightTheme` and `darkTheme` props take, so a host does not map roles by hand.
161
161
  * Unknown ids fall back to the defaults and an accent the pair cannot offer falls
162
162
  * back to the theme's own, exactly as `ThemeProvider` resolves them.
@@ -175,24 +175,24 @@ function appearancePreviewThemes(selection) {
175
175
  * ## Why this exists rather than relying on the `[data-accent]` blocks
176
176
  *
177
177
  * `theme.css` carries a `[data-accent='…']` block per preset, and those blocks are
178
- * correct — but they are unreachable at runtime. `ThemeProvider` writes a theme's
178
+ * correct, but they are unreachable at runtime. `ThemeProvider` writes a theme's
179
179
  * whole role set onto `<html>` as *inline* custom properties, and an inline
180
180
  * declaration outranks any stylesheet selector regardless of specificity. The
181
181
  * attribute was set, the rules existed, the values were right, and every one of the
182
182
  * seven accents rendered as the same blue.
183
183
  *
184
184
  * The blocks are kept, because they are what styles the window between the document
185
- * arriving and the provider mounting — which is the whole reason `themeScript`
185
+ * arriving and the provider mounting, which is the whole reason `themeScript`
186
186
  * exists. But the authoritative value has to be applied by the same code that
187
187
  * applies the theme, from the same source, or the two can drift again. So both the
188
188
  * provider and the CSS generator call `accentRoles` out of `@adea-ai/themes`, and
189
189
  * `tests/appearance-axes.test.ts` asserts the two agree value for value.
190
190
  *
191
191
  * A theme accent (`ansi-blue`) has no block: its value depends on the theme pair,
192
- * so it is resolved against `pair` — the selection's light and dark theme ids —
192
+ * so it is resolved against `pair`, the selection's light and dark theme ids,
193
193
  * and only ever applied here. Without a pair it resolves against the defaults.
194
194
  *
195
- * Returns `undefined` for `theme` — the variant's own primary — for an id the
195
+ * Returns `undefined` for `theme`, the variant's own primary, for an id the
196
196
  * catalogue does not have, and for a theme accent the pair does not offer, so a
197
197
  * stale stored preference falls back to the theme rather than blanking the primary.
198
198
  */
@@ -1 +1 @@
1
- {"version":3,"file":"themes.js","names":["catalogue","themes"],"sources":["../../src/lib/themes.ts"],"sourcesContent":["/**\n * The theme registry, now a bridge.\n *\n * The catalogue itself lives in `@adea-ai/themes`. This module is what is left in\n * the design system: the translation between the catalogue's **canonical** role\n * names and the **shadcn** vocabulary every component here is written against, plus\n * the handful of custom properties this system declares that are presentations of\n * data the catalogue already holds — the `--terminal-*` ramp, the `--editor-*` ramp,\n * and `--chrome`.\n *\n * ## Why it is a bridge and not a copy\n *\n * This file used to hold thirteen themes as hand-written hex literal tables, with its\n * own contrast validator, its own terminal and editor palettes, and its own\n * provenance records. That is a lot of surface to maintain for one consumer of a\n * palette, and it meant every product that wanted the same themes — Adea, Cortana —\n * either imported this package or wrote its own. The catalogue moved out so that\n * there is one answer to \"what is Catppuccin Mocha\", and this file is the part that\n * genuinely belongs to the design system.\n *\n * It is deliberately thin. If you are looking for a colour, it is not here: see\n * `@adea-ai/themes`, whose README explains how the values are produced and whose\n * `NOTICE` records where every palette came from.\n *\n * ## The mapping, and the entry that is not a rename\n *\n * The package-owned `shadcnVariables` adapter maps canonical roles onto this\n * system's vocabulary. One entry will trip a reader: the catalogue's `accent`\n * becomes this system's `primary`, because in the shadcn vocabulary `--primary` is\n * the action colour — the fill of a primary button, the thing a focus ring is drawn\n * in — while `--accent` is a low-contrast hover wash. The catalogue's `accent` is\n * the former, so it goes to `--primary`, and `--accent` is filled from\n * `surfaceHover`, which is what shadcn components actually use it for.\n */\n\nimport {\n accentForeground,\n editorRolesHex,\n getAccent,\n getTheme,\n hasTheme,\n primarySubtleCss,\n themes as catalogue,\n themesByAppearance,\n themeAccentPresets,\n validateCatalogue,\n type AccentPreset,\n type AdeaTheme,\n type AdeaThemeRecord,\n type ContrastFinding,\n} from '@adea-ai/themes'\nimport { accentOverrideVariables, resolveAccentRoles, type AccentRoles } from './accent-roles'\nimport { isThemeAccentId } from './theme-accents'\nimport { themeCssVariablesWith } from './theme-css'\nimport { THEME_DEFAULT_ID, cataloguePair, defaultThemePair } from './theme-defaults'\nimport { lazyVariantFromRecord } from './theme-records'\nimport {\n THEME_EDITOR_PROPERTIES,\n pickRoles,\n type AccentVariableOptions,\n type EditorRolesMode,\n type ThemeAppearance,\n type ThemeCssVariableOptions,\n type ThemeEditorPalette,\n type ThemePair,\n type ThemeVariant,\n} from './theme-types'\n\nexport { accents } from './accent-presets'\nexport { isThemeAccentId } from './theme-accents'\nexport { terminalCssVariables, tokensAsHex } from './theme-css'\nexport { defaultDarkThemeId, defaultLightThemeId, resolveVariant } from './theme-defaults'\nexport { variantFromRecord } from './theme-records'\nexport type {\n AccentVariableOptions,\n EditorRolesMode,\n ThemeAppearance,\n ThemeColors,\n ThemeCssVariableOptions,\n ThemeEditorPalette,\n ThemeProvenance,\n ThemeTerminalPalette,\n ThemeVariant,\n} from './theme-types'\n\n/**\n * A variant's `--primary-subtle`: the tint over `var(--primary)` at the strength its\n * catalogue record measures (`primarySubtleAlpha`). A variant that is not in the\n * catalogue has nothing to measure, and gets its appearance's ceiling.\n */\nexport function primarySubtleFor(theme: Pick<ThemeVariant, 'id' | 'appearance'>): string {\n const record = getTheme(theme.id)\n return record ? primarySubtleCss(record) : primarySubtleCss(theme.appearance)\n}\n\n/**\n * The catalogue, in catalogue order.\n *\n * The `@__PURE__` marks let a bundler drop the whole table, and with it the catalogue,\n * from a consumer that imports only this module's catalogue-free helpers\n * (`tokensAsHex`, `isThemeAccentId`, `resolveVariant`…) and never reads it.\n */\nexport const builtinThemes: readonly ThemeVariant[] = /* @__PURE__ */ Object.freeze(\n /* @__PURE__ */ catalogue.map(lazyVariantFromRecord)\n)\n\nexport function themeById(id: string): ThemeVariant | undefined {\n if (!hasTheme(id)) return undefined\n return builtinThemes.find((theme) => theme.id === id)\n}\n\n/** The variants of one appearance, which is what a picker for that mode shows. */\nexport function themesForAppearance(appearance: ThemeAppearance): readonly ThemeVariant[] {\n const ids = new Set(themesByAppearance(appearance).map((theme) => theme.id))\n return builtinThemes.filter((theme) => ids.has(theme.id))\n}\n\n/** The families in the catalogue, in catalogue order. */\nexport function themeFamilies(): { family: string; label: string; themes: ThemeVariant[] }[] {\n const families = new Map<string, { family: string; label: string; themes: ThemeVariant[] }>()\n for (const theme of builtinThemes) {\n const entry = families.get(theme.family) ?? {\n family: theme.family,\n label: theme.familyLabel,\n themes: [],\n }\n entry.themes.push(theme)\n families.set(theme.family, entry)\n }\n return [...families.values()]\n}\n\n/**\n * The canonical catalogue records, in catalogue order.\n *\n * {@link builtinThemes} is this system's projection of the catalogue onto the\n * shadcn vocabulary, which is what a document is painted with. A *preview* of a\n * theme — the miniatures `AppearanceEditor` and `ThemeMiniature` draw — reads the\n * catalogue's own roles instead (`surfaceActive`, `borderMuted`, `textSubtle`…),\n * several of which the projection folds together. These are those records, so a\n * consumer hands the editor exactly what it takes rather than reconstructing it\n * from the projection.\n */\nexport const themeRecords: readonly AdeaThemeRecord[] = catalogue\n\nexport function themeRecordById(id: string): AdeaThemeRecord | undefined {\n return getTheme(id)\n}\n\n/** A light/dark theme pair by id, with the defaults standing in for an unknown id. */\nfunction recordPair(pair: ThemePair) {\n const { lightThemeId, darkThemeId } = cataloguePair(pair)\n return { light: getTheme(lightThemeId)!, dark: getTheme(darkThemeId)! }\n}\n\n/**\n * The accents the selected light/dark pair carries — offered beside the presets.\n *\n * Computed per pair rather than per theme because a theme accent is a *pair* of\n * values, like a preset: a slot is offered only when both themes can offer it.\n */\nexport function themeAccentsFor(\n lightThemeId: string,\n darkThemeId: string\n): readonly AccentPreset[] {\n const { light, dark } = recordPair({ lightThemeId, darkThemeId })\n return themeAccentPresets(light, dark)\n}\n\n/**\n * An accent id resolved against a theme pair: a preset, a theme accent the pair\n * offers, or `undefined` for `theme`, an unknown id, or a slot this pair cannot\n * offer — each of which means \"use the theme's own primary\".\n *\n * Theme accent ids are role-shaped (`ansi-blue`), so a stored one survives a theme\n * switch and resolves to the new theme's blue; when the new pair cannot offer the\n * slot it resolves to nothing, the same fallback a stale preset id gets.\n */\nexport function resolveAccentPreset(\n accentId: string,\n light: AdeaTheme,\n dark: AdeaTheme\n): AccentPreset | undefined {\n if (accentId === THEME_DEFAULT_ID) return undefined\n const preset = getAccent(accentId)\n if (preset) return preset\n if (!isThemeAccentId(accentId)) return undefined\n return themeAccentPresets(light, dark).find((option) => option.id === accentId)\n}\n\n/**\n * A theme with an accent laid over it, in the catalogue's own shape.\n *\n * The accent replaces `accent` and its measured label, which is all an accent\n * changes about a theme; `undefined` returns the theme untouched. This is the\n * overlay a host needs for `AppearanceEditor`'s `lightTheme`/`darkTheme`.\n */\nexport function withAccent<T extends AdeaTheme>(theme: T, accent: AccentPreset | undefined): T {\n if (!accent) return theme\n const value = theme.appearance === 'dark' ? accent.dark : accent.light\n return {\n ...theme,\n colors: { ...theme.colors, accent: value, accentForeground: accentForeground(value) },\n }\n}\n\n/**\n * The two preview themes an appearance selection resolves to, accent applied.\n *\n * The adapter between a stored selection and `AppearanceEditor`: it takes ids —\n * what a preference holds — and returns the canonical records the editor's\n * `lightTheme` and `darkTheme` props take, so a host does not map roles by hand.\n * Unknown ids fall back to the defaults and an accent the pair cannot offer falls\n * back to the theme's own, exactly as `ThemeProvider` resolves them.\n */\nexport function appearancePreviewThemes(selection: {\n lightThemeId: string\n darkThemeId: string\n accent: string\n}): { lightTheme: AdeaThemeRecord; darkTheme: AdeaThemeRecord } {\n const { light, dark } = recordPair(selection)\n const accent = resolveAccentPreset(selection.accent, light, dark)\n return { lightTheme: withAccent(light, accent), darkTheme: withAccent(dark, accent) }\n}\n\n/**\n * The properties an accent selection overrides, as CSS custom properties.\n *\n * ## Why this exists rather than relying on the `[data-accent]` blocks\n *\n * `theme.css` carries a `[data-accent='…']` block per preset, and those blocks are\n * correct — but they are unreachable at runtime. `ThemeProvider` writes a theme's\n * whole role set onto `<html>` as *inline* custom properties, and an inline\n * declaration outranks any stylesheet selector regardless of specificity. The\n * attribute was set, the rules existed, the values were right, and every one of the\n * seven accents rendered as the same blue.\n *\n * The blocks are kept, because they are what styles the window between the document\n * arriving and the provider mounting — which is the whole reason `themeScript`\n * exists. But the authoritative value has to be applied by the same code that\n * applies the theme, from the same source, or the two can drift again. So both the\n * provider and the CSS generator call `accentRoles` out of `@adea-ai/themes`, and\n * `tests/appearance-axes.test.ts` asserts the two agree value for value.\n *\n * A theme accent (`ansi-blue`) has no block: its value depends on the theme pair,\n * so it is resolved against `pair` — the selection's light and dark theme ids —\n * and only ever applied here. Without a pair it resolves against the defaults.\n *\n * Returns `undefined` for `theme` — the variant's own primary — for an id the\n * catalogue does not have, and for a theme accent the pair does not offer, so a\n * stale stored preference falls back to the theme rather than blanking the primary.\n */\nexport function accentVariables(\n accentId: string,\n appearance: ThemeAppearance,\n pair: ThemePair = defaultThemePair,\n options: AccentVariableOptions = {}\n): Record<string, string> | undefined {\n const roles = accentRolesForSelection(accentId, appearance, pair, options)\n return roles ? accentOverrideVariables(roles) : undefined\n}\n\n/**\n * An accent selection resolved to the full {@link AccentRoles}, against a theme\n * pair. {@link accentVariables} is the document half of this; an element-scoped\n * paint (`paintAccentRoles`) wants all of it, including the tint.\n */\nexport function accentRolesForSelection(\n accentId: string,\n appearance: ThemeAppearance,\n pair: ThemePair = defaultThemePair,\n options: AccentVariableOptions = {}\n): AccentRoles | undefined {\n if (accentId === THEME_DEFAULT_ID) return undefined\n const record = options.variantId ? getTheme(options.variantId) : undefined\n return resolveAccentRoles(accentId, {\n target: record ?? appearance,\n background: options.background,\n floor: options.floor,\n // Only an `ansi-*` id needs the pair's offering, and measuring it is not free.\n themeAccents: isThemeAccentId(accentId)\n ? themeAccentsFor(pair.lightThemeId, pair.darkThemeId)\n : undefined,\n })\n}\n\n/**\n * True for the catalogue's own variant, not a host's copy that merely shares its id.\n *\n * Identity rather than id, because a host's imported theme may reuse a catalogue id\n * with different colours, and projecting the catalogue's record for it would paint\n * the wrong palette.\n */\nexport function isCatalogueVariant(variant: ThemeVariant): boolean {\n return themeById(variant.id) === variant\n}\n\n/**\n * The editor palette held to 4.5:1, or `fallback` for a record that cannot reach it.\n *\n * Some palettes (an imported one, most often) cannot be repaired to the floor from\n * their own ramp within the catalogue's lightness budget, and `editorRolesHex` says\n * so by throwing. A palette that paints nothing is worse than one that paints its\n * quiet roles, so the throw is the cue to fall back rather than to fail. `project` is\n * a parameter so that path can be exercised: no catalogue theme takes it.\n */\nexport function floorEditorPalette(\n record: AdeaTheme,\n fallback: ThemeEditorPalette,\n project: (theme: AdeaTheme) => Record<keyof ThemeEditorPalette, string> = editorRolesHex\n): ThemeEditorPalette {\n try {\n return pickRoles(THEME_EDITOR_PROPERTIES, project(record))\n } catch {\n return fallback\n }\n}\n\nconst floorEditorCache = new Map<string, ThemeEditorPalette>()\n\n/**\n * The editor palette a variant paints under a projection.\n *\n * `floor` applies to the catalogue's own variants, whose record the catalogue holds.\n * A variant it does not hold (a host's imported theme) has no record to project and\n * keeps its own `editor`; such a theme normally carries its roles in `tokens`, which\n * win over either projection anyway. Computed once per theme: the repair is a search.\n */\nexport function editorPaletteFor(\n theme: ThemeVariant,\n mode: EditorRolesMode = 'syntax'\n): ThemeEditorPalette {\n if (mode !== 'floor' || !isCatalogueVariant(theme)) return theme.editor\n const cached = floorEditorCache.get(theme.id)\n if (cached) return cached\n const record = getTheme(theme.id)\n const palette = record ? floorEditorPalette(record, theme.editor) : theme.editor\n floorEditorCache.set(theme.id, palette)\n return palette\n}\n\n/**\n * The roles a variant sets, as CSS custom properties.\n *\n * The mapping itself is `themeCssVariablesWith` in `theme-css.ts`; this binds it to\n * the catalogue, which measures a theme's `--primary-subtle` strength\n * ({@link primarySubtleFor}) and projects its floor editor ramp\n * ({@link editorPaletteFor}). Absent `options`, the result is what it has always\n * been; the generated `theme-variants.css` and the design-system artifact are built\n * without it.\n */\nexport function themeCssVariables(\n theme: ThemeVariant,\n options: ThemeCssVariableOptions = {}\n): Record<string, string> {\n return themeCssVariablesWith(\n {\n primarySubtle: primarySubtleFor,\n editor: (variant, mode) => editorPaletteFor(variant, mode),\n },\n theme,\n options\n )\n}\n\n/* ---------------------------------------------------------------------------\n * Validation\n *\n * Delegated. The floors are the catalogue's, because they are what makes the\n * catalogue able to hold other people's palettes at all, and a second set of floors\n * here would be a second answer to the same question — and the one that drifts.\n * ------------------------------------------------------------------------- */\n\nexport type ThemeFinding = {\n themeId: string\n role: string\n message: string\n}\n\nfunction toFinding(finding: ContrastFinding): ThemeFinding {\n return { themeId: finding.themeId, role: finding.role, message: finding.message }\n}\n\n/** Validates one variant. The floors, and the reasoning behind them, live in the catalogue. */\nexport function validateTheme(theme: ThemeVariant): ThemeFinding[] {\n const record = catalogue.find((entry) => entry.id === theme.id)\n if (!record) {\n return [{ themeId: theme.id, role: 'id', message: `${theme.id} is not in the catalogue` }]\n }\n return validateCatalogue([record]).map(toFinding)\n}\n\n/** Validates the whole registry, including the catalogue-level invariants. */\nexport function validateThemeRegistry(\n themes: readonly ThemeVariant[] = builtinThemes\n): ThemeFinding[] {\n const records = themes\n .map((theme) => catalogue.find((entry) => entry.id === theme.id))\n .filter((record): record is AdeaThemeRecord => !!record)\n\n const orphaned = themes\n .filter((theme) => !hasTheme(theme.id))\n .map((theme) => ({\n themeId: theme.id,\n role: 'id',\n message: `${theme.id} is in the registry but not in the catalogue`,\n }))\n\n return [...orphaned, ...validateCatalogue(records).map(toFinding)]\n}\n\n/** Re-exported so a consumer measuring a colour does not need a second import. */\nexport { contrastRatio } from '@adea-ai/themes'\n"],"mappings":"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"}
1
+ {"version":3,"file":"themes.js","names":["catalogue","themes"],"sources":["../../src/lib/themes.ts"],"sourcesContent":["/**\n * The theme registry, now a bridge.\n *\n * The catalogue itself lives in `@adea-ai/themes`. This module is what is left in\n * the design system: the translation between the catalogue's **canonical** role\n * names and the **shadcn** vocabulary every component here is written against, plus\n * the handful of custom properties this system declares that are presentations of\n * data the catalogue already holds, the `--terminal-*` ramp, the `--editor-*` ramp,\n * and `--chrome`.\n *\n * ## Why it is a bridge and not a copy\n *\n * This file used to hold thirteen themes as hand-written hex literal tables, with its\n * own contrast validator, its own terminal and editor palettes, and its own\n * provenance records. That is a lot of surface to maintain for one consumer of a\n * palette, and it meant every product that wanted the same themes, Adea, Cortana,\n * either imported this package or wrote its own. The catalogue moved out so that\n * there is one answer to \"what is Catppuccin Mocha\", and this file is the part that\n * genuinely belongs to the design system.\n *\n * It is deliberately thin. If you are looking for a colour, it is not here: see\n * `@adea-ai/themes`, whose README explains how the values are produced and whose\n * `NOTICE` records where every palette came from.\n *\n * ## The mapping, and the entry that is not a rename\n *\n * The package-owned `shadcnVariables` adapter maps canonical roles onto this\n * system's vocabulary. One entry will trip a reader: the catalogue's `accent`\n * becomes this system's `primary`, because in the shadcn vocabulary `--primary` is\n * the action colour, the fill of a primary button, the thing a focus ring is drawn\n * in, while `--accent` is a low-contrast hover wash. The catalogue's `accent` is\n * the former, so it goes to `--primary`, and `--accent` is filled from\n * `surfaceHover`, which is what shadcn components actually use it for.\n */\n\nimport {\n accentForeground,\n editorRolesHex,\n getAccent,\n getTheme,\n hasTheme,\n primarySubtleCss,\n themes as catalogue,\n themesByAppearance,\n themeAccentPresets,\n validateCatalogue,\n type AccentPreset,\n type AdeaTheme,\n type AdeaThemeRecord,\n type ContrastFinding,\n} from '@adea-ai/themes'\nimport { accentOverrideVariables, resolveAccentRoles, type AccentRoles } from './accent-roles'\nimport { isThemeAccentId } from './theme-accents'\nimport { themeCssVariablesWith } from './theme-css'\nimport { THEME_DEFAULT_ID, cataloguePair, defaultThemePair } from './theme-defaults'\nimport { lazyVariantFromRecord } from './theme-records'\nimport {\n THEME_EDITOR_PROPERTIES,\n pickRoles,\n type AccentVariableOptions,\n type EditorRolesMode,\n type ThemeAppearance,\n type ThemeCssVariableOptions,\n type ThemeEditorPalette,\n type ThemePair,\n type ThemeVariant,\n} from './theme-types'\n\nexport { accents } from './accent-presets'\nexport { isThemeAccentId } from './theme-accents'\nexport { terminalCssVariables, tokensAsHex } from './theme-css'\nexport { defaultDarkThemeId, defaultLightThemeId, resolveVariant } from './theme-defaults'\nexport { variantFromRecord } from './theme-records'\nexport type {\n AccentVariableOptions,\n EditorRolesMode,\n ThemeAppearance,\n ThemeColors,\n ThemeCssVariableOptions,\n ThemeEditorPalette,\n ThemeProvenance,\n ThemeTerminalPalette,\n ThemeVariant,\n} from './theme-types'\n\n/**\n * A variant's `--primary-subtle`: the tint over `var(--primary)` at the strength its\n * catalogue record measures (`primarySubtleAlpha`). A variant that is not in the\n * catalogue has nothing to measure, and gets its appearance's ceiling.\n */\nexport function primarySubtleFor(theme: Pick<ThemeVariant, 'id' | 'appearance'>): string {\n const record = getTheme(theme.id)\n return record ? primarySubtleCss(record) : primarySubtleCss(theme.appearance)\n}\n\n/**\n * The catalogue, in catalogue order.\n *\n * The `@__PURE__` marks let a bundler drop the whole table, and with it the catalogue,\n * from a consumer that imports only this module's catalogue-free helpers\n * (`tokensAsHex`, `isThemeAccentId`, `resolveVariant`…) and never reads it.\n */\nexport const builtinThemes: readonly ThemeVariant[] = /* @__PURE__ */ Object.freeze(\n /* @__PURE__ */ catalogue.map(lazyVariantFromRecord)\n)\n\nexport function themeById(id: string): ThemeVariant | undefined {\n if (!hasTheme(id)) return undefined\n return builtinThemes.find((theme) => theme.id === id)\n}\n\n/** The variants of one appearance, which is what a picker for that mode shows. */\nexport function themesForAppearance(appearance: ThemeAppearance): readonly ThemeVariant[] {\n const ids = new Set(themesByAppearance(appearance).map((theme) => theme.id))\n return builtinThemes.filter((theme) => ids.has(theme.id))\n}\n\n/** The families in the catalogue, in catalogue order. */\nexport function themeFamilies(): { family: string; label: string; themes: ThemeVariant[] }[] {\n const families = new Map<string, { family: string; label: string; themes: ThemeVariant[] }>()\n for (const theme of builtinThemes) {\n const entry = families.get(theme.family) ?? {\n family: theme.family,\n label: theme.familyLabel,\n themes: [],\n }\n entry.themes.push(theme)\n families.set(theme.family, entry)\n }\n return [...families.values()]\n}\n\n/**\n * The canonical catalogue records, in catalogue order.\n *\n * {@link builtinThemes} is this system's projection of the catalogue onto the\n * shadcn vocabulary, which is what a document is painted with. A *preview* of a\n * theme, the miniatures `AppearanceEditor` and `ThemeMiniature` draw, reads the\n * catalogue's own roles instead (`surfaceActive`, `borderMuted`, `textSubtle`…),\n * several of which the projection folds together. These are those records, so a\n * consumer hands the editor exactly what it takes rather than reconstructing it\n * from the projection.\n */\nexport const themeRecords: readonly AdeaThemeRecord[] = catalogue\n\nexport function themeRecordById(id: string): AdeaThemeRecord | undefined {\n return getTheme(id)\n}\n\n/** A light/dark theme pair by id, with the defaults standing in for an unknown id. */\nfunction recordPair(pair: ThemePair) {\n const { lightThemeId, darkThemeId } = cataloguePair(pair)\n return { light: getTheme(lightThemeId)!, dark: getTheme(darkThemeId)! }\n}\n\n/**\n * The accents the selected light/dark pair carries, offered beside the presets.\n *\n * Computed per pair rather than per theme because a theme accent is a *pair* of\n * values, like a preset: a slot is offered only when both themes can offer it.\n */\nexport function themeAccentsFor(\n lightThemeId: string,\n darkThemeId: string\n): readonly AccentPreset[] {\n const { light, dark } = recordPair({ lightThemeId, darkThemeId })\n return themeAccentPresets(light, dark)\n}\n\n/**\n * An accent id resolved against a theme pair: a preset, a theme accent the pair\n * offers, or `undefined` for `theme`, an unknown id, or a slot this pair cannot\n * offer, each of which means \"use the theme's own primary\".\n *\n * Theme accent ids are role-shaped (`ansi-blue`), so a stored one survives a theme\n * switch and resolves to the new theme's blue; when the new pair cannot offer the\n * slot it resolves to nothing, the same fallback a stale preset id gets.\n */\nexport function resolveAccentPreset(\n accentId: string,\n light: AdeaTheme,\n dark: AdeaTheme\n): AccentPreset | undefined {\n if (accentId === THEME_DEFAULT_ID) return undefined\n const preset = getAccent(accentId)\n if (preset) return preset\n if (!isThemeAccentId(accentId)) return undefined\n return themeAccentPresets(light, dark).find((option) => option.id === accentId)\n}\n\n/**\n * A theme with an accent laid over it, in the catalogue's own shape.\n *\n * The accent replaces `accent` and its measured label, which is all an accent\n * changes about a theme; `undefined` returns the theme untouched. This is the\n * overlay a host needs for `AppearanceEditor`'s `lightTheme`/`darkTheme`.\n */\nexport function withAccent<T extends AdeaTheme>(theme: T, accent: AccentPreset | undefined): T {\n if (!accent) return theme\n const value = theme.appearance === 'dark' ? accent.dark : accent.light\n return {\n ...theme,\n colors: { ...theme.colors, accent: value, accentForeground: accentForeground(value) },\n }\n}\n\n/**\n * The two preview themes an appearance selection resolves to, accent applied.\n *\n * The adapter between a stored selection and `AppearanceEditor`: it takes ids,\n * what a preference holds, and returns the canonical records the editor's\n * `lightTheme` and `darkTheme` props take, so a host does not map roles by hand.\n * Unknown ids fall back to the defaults and an accent the pair cannot offer falls\n * back to the theme's own, exactly as `ThemeProvider` resolves them.\n */\nexport function appearancePreviewThemes(selection: {\n lightThemeId: string\n darkThemeId: string\n accent: string\n}): { lightTheme: AdeaThemeRecord; darkTheme: AdeaThemeRecord } {\n const { light, dark } = recordPair(selection)\n const accent = resolveAccentPreset(selection.accent, light, dark)\n return { lightTheme: withAccent(light, accent), darkTheme: withAccent(dark, accent) }\n}\n\n/**\n * The properties an accent selection overrides, as CSS custom properties.\n *\n * ## Why this exists rather than relying on the `[data-accent]` blocks\n *\n * `theme.css` carries a `[data-accent='…']` block per preset, and those blocks are\n * correct, but they are unreachable at runtime. `ThemeProvider` writes a theme's\n * whole role set onto `<html>` as *inline* custom properties, and an inline\n * declaration outranks any stylesheet selector regardless of specificity. The\n * attribute was set, the rules existed, the values were right, and every one of the\n * seven accents rendered as the same blue.\n *\n * The blocks are kept, because they are what styles the window between the document\n * arriving and the provider mounting, which is the whole reason `themeScript`\n * exists. But the authoritative value has to be applied by the same code that\n * applies the theme, from the same source, or the two can drift again. So both the\n * provider and the CSS generator call `accentRoles` out of `@adea-ai/themes`, and\n * `tests/appearance-axes.test.ts` asserts the two agree value for value.\n *\n * A theme accent (`ansi-blue`) has no block: its value depends on the theme pair,\n * so it is resolved against `pair`, the selection's light and dark theme ids,\n * and only ever applied here. Without a pair it resolves against the defaults.\n *\n * Returns `undefined` for `theme`, the variant's own primary, for an id the\n * catalogue does not have, and for a theme accent the pair does not offer, so a\n * stale stored preference falls back to the theme rather than blanking the primary.\n */\nexport function accentVariables(\n accentId: string,\n appearance: ThemeAppearance,\n pair: ThemePair = defaultThemePair,\n options: AccentVariableOptions = {}\n): Record<string, string> | undefined {\n const roles = accentRolesForSelection(accentId, appearance, pair, options)\n return roles ? accentOverrideVariables(roles) : undefined\n}\n\n/**\n * An accent selection resolved to the full {@link AccentRoles}, against a theme\n * pair. {@link accentVariables} is the document half of this; an element-scoped\n * paint (`paintAccentRoles`) wants all of it, including the tint.\n */\nexport function accentRolesForSelection(\n accentId: string,\n appearance: ThemeAppearance,\n pair: ThemePair = defaultThemePair,\n options: AccentVariableOptions = {}\n): AccentRoles | undefined {\n if (accentId === THEME_DEFAULT_ID) return undefined\n const record = options.variantId ? getTheme(options.variantId) : undefined\n return resolveAccentRoles(accentId, {\n target: record ?? appearance,\n background: options.background,\n floor: options.floor,\n // Only an `ansi-*` id needs the pair's offering, and measuring it is not free.\n themeAccents: isThemeAccentId(accentId)\n ? themeAccentsFor(pair.lightThemeId, pair.darkThemeId)\n : undefined,\n })\n}\n\n/**\n * True for the catalogue's own variant, not a host's copy that merely shares its id.\n *\n * Identity rather than id, because a host's imported theme may reuse a catalogue id\n * with different colours, and projecting the catalogue's record for it would paint\n * the wrong palette.\n */\nexport function isCatalogueVariant(variant: ThemeVariant): boolean {\n return themeById(variant.id) === variant\n}\n\n/**\n * The editor palette held to 4.5:1, or `fallback` for a record that cannot reach it.\n *\n * Some palettes (an imported one, most often) cannot be repaired to the floor from\n * their own ramp within the catalogue's lightness budget, and `editorRolesHex` says\n * so by throwing. A palette that paints nothing is worse than one that paints its\n * quiet roles, so the throw is the cue to fall back rather than to fail. `project` is\n * a parameter so that path can be exercised: no catalogue theme takes it.\n */\nexport function floorEditorPalette(\n record: AdeaTheme,\n fallback: ThemeEditorPalette,\n project: (theme: AdeaTheme) => Record<keyof ThemeEditorPalette, string> = editorRolesHex\n): ThemeEditorPalette {\n try {\n return pickRoles(THEME_EDITOR_PROPERTIES, project(record))\n } catch {\n return fallback\n }\n}\n\nconst floorEditorCache = new Map<string, ThemeEditorPalette>()\n\n/**\n * The editor palette a variant paints under a projection.\n *\n * `floor` applies to the catalogue's own variants, whose record the catalogue holds.\n * A variant it does not hold (a host's imported theme) has no record to project and\n * keeps its own `editor`; such a theme normally carries its roles in `tokens`, which\n * win over either projection anyway. Computed once per theme: the repair is a search.\n */\nexport function editorPaletteFor(\n theme: ThemeVariant,\n mode: EditorRolesMode = 'syntax'\n): ThemeEditorPalette {\n if (mode !== 'floor' || !isCatalogueVariant(theme)) return theme.editor\n const cached = floorEditorCache.get(theme.id)\n if (cached) return cached\n const record = getTheme(theme.id)\n const palette = record ? floorEditorPalette(record, theme.editor) : theme.editor\n floorEditorCache.set(theme.id, palette)\n return palette\n}\n\n/**\n * The roles a variant sets, as CSS custom properties.\n *\n * The mapping itself is `themeCssVariablesWith` in `theme-css.ts`; this binds it to\n * the catalogue, which measures a theme's `--primary-subtle` strength\n * ({@link primarySubtleFor}) and projects its floor editor ramp\n * ({@link editorPaletteFor}). Absent `options`, the result is what it has always\n * been; the generated `theme-variants.css` and the design-system artifact are built\n * without it.\n */\nexport function themeCssVariables(\n theme: ThemeVariant,\n options: ThemeCssVariableOptions = {}\n): Record<string, string> {\n return themeCssVariablesWith(\n {\n primarySubtle: primarySubtleFor,\n editor: (variant, mode) => editorPaletteFor(variant, mode),\n },\n theme,\n options\n )\n}\n\n/* ---------------------------------------------------------------------------\n * Validation\n *\n * Delegated. The floors are the catalogue's, because they are what makes the\n * catalogue able to hold other people's palettes at all, and a second set of floors\n * here would be a second answer to the same question, and the one that drifts.\n * ------------------------------------------------------------------------- */\n\nexport type ThemeFinding = {\n themeId: string\n role: string\n message: string\n}\n\nfunction toFinding(finding: ContrastFinding): ThemeFinding {\n return { themeId: finding.themeId, role: finding.role, message: finding.message }\n}\n\n/** Validates one variant. The floors, and the reasoning behind them, live in the catalogue. */\nexport function validateTheme(theme: ThemeVariant): ThemeFinding[] {\n const record = catalogue.find((entry) => entry.id === theme.id)\n if (!record) {\n return [{ themeId: theme.id, role: 'id', message: `${theme.id} is not in the catalogue` }]\n }\n return validateCatalogue([record]).map(toFinding)\n}\n\n/** Validates the whole registry, including the catalogue-level invariants. */\nexport function validateThemeRegistry(\n themes: readonly ThemeVariant[] = builtinThemes\n): ThemeFinding[] {\n const records = themes\n .map((theme) => catalogue.find((entry) => entry.id === theme.id))\n .filter((record): record is AdeaThemeRecord => !!record)\n\n const orphaned = themes\n .filter((theme) => !hasTheme(theme.id))\n .map((theme) => ({\n themeId: theme.id,\n role: 'id',\n message: `${theme.id} is in the registry but not in the catalogue`,\n }))\n\n return [...orphaned, ...validateCatalogue(records).map(toFinding)]\n}\n\n/** Re-exported so a consumer measuring a colour does not need a second import. */\nexport { contrastRatio } from '@adea-ai/themes'\n"],"mappings":"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"}
@@ -2,7 +2,7 @@
2
2
  * The design system's token manifest.
3
3
  *
4
4
  * `theme.css` is the source of truth for token *values*. This file is the
5
- * source of truth for token *names and meaning* — what each one is for, and
5
+ * source of truth for token *names and meaning*, what each one is for, and
6
6
  * which ones a theme may vary.
7
7
  *
8
8
  * It exists because a manifest that is only documentation rots. Two things read
@@ -31,7 +31,7 @@ export type TokenDefinition = {
31
31
  /**
32
32
  * Colour roles, in the order they appear in a page: surfaces first, then text,
33
33
  * then the lines between them, then the semantic fills. The order is the
34
- * documentation — reading the gallery top to bottom walks the surface ladder.
34
+ * documentation, reading the gallery top to bottom walks the surface ladder.
35
35
  */
36
36
  export declare const colorTokens: TokenDefinition[];
37
37
  export declare const radiusTokens: TokenDefinition[];
@@ -4,7 +4,7 @@ import { accentPresets } from "./accent-presets.js";
4
4
  /**
5
5
  * Colour roles, in the order they appear in a page: surfaces first, then text,
6
6
  * then the lines between them, then the semantic fills. The order is the
7
- * documentation — reading the gallery top to bottom walks the surface ladder.
7
+ * documentation, reading the gallery top to bottom walks the surface ladder.
8
8
  */
9
9
  var colorTokens = [
10
10
  {