@adea-ai/ui 0.60.4 → 0.61.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 (862) hide show
  1. package/README.md +108 -34
  2. package/dist/components/composites/account-menu/account-menu.d.ts +48 -0
  3. package/dist/components/composites/account-menu/account-menu.d.ts.map +1 -0
  4. package/dist/components/composites/account-menu/account-menu.js +119 -0
  5. package/dist/components/composites/account-menu/account-menu.js.map +1 -0
  6. package/dist/components/composites/account-menu/index.d.ts +2 -0
  7. package/dist/components/composites/account-menu/index.d.ts.map +1 -0
  8. package/dist/components/composites/list-row/index.d.ts +2 -0
  9. package/dist/components/composites/list-row/index.d.ts.map +1 -0
  10. package/dist/components/composites/list-row/list-row.d.ts +44 -0
  11. package/dist/components/composites/list-row/list-row.d.ts.map +1 -0
  12. package/dist/components/composites/list-row/list-row.js +124 -0
  13. package/dist/components/composites/list-row/list-row.js.map +1 -0
  14. package/dist/components/composites/settings/index.d.ts +2 -0
  15. package/dist/components/composites/settings/index.d.ts.map +1 -0
  16. package/dist/components/composites/settings/settings.d.ts +49 -0
  17. package/dist/components/composites/settings/settings.d.ts.map +1 -0
  18. package/dist/components/composites/settings/settings.js +148 -0
  19. package/dist/components/composites/settings/settings.js.map +1 -0
  20. package/dist/components/composites/stat/index.d.ts +2 -0
  21. package/dist/components/composites/stat/index.d.ts.map +1 -0
  22. package/dist/components/composites/stat/stat.d.ts +48 -0
  23. package/dist/components/composites/stat/stat.d.ts.map +1 -0
  24. package/dist/components/composites/stat/stat.js +148 -0
  25. package/dist/components/composites/stat/stat.js.map +1 -0
  26. package/dist/components/composites/update-dialog/index.d.ts +2 -0
  27. package/dist/components/composites/update-dialog/index.d.ts.map +1 -0
  28. package/dist/components/composites/update-dialog/update-dialog.d.ts +108 -0
  29. package/dist/components/composites/update-dialog/update-dialog.d.ts.map +1 -0
  30. package/dist/components/composites/update-dialog/update-dialog.js +452 -0
  31. package/dist/components/composites/update-dialog/update-dialog.js.map +1 -0
  32. package/dist/components/composites/workspace-mark/index.d.ts +2 -0
  33. package/dist/components/composites/workspace-mark/index.d.ts.map +1 -0
  34. package/dist/components/composites/workspace-mark/workspace-mark.d.ts +24 -0
  35. package/dist/components/composites/workspace-mark/workspace-mark.d.ts.map +1 -0
  36. package/dist/components/composites/workspace-mark/workspace-mark.js +76 -0
  37. package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -0
  38. package/dist/components/conversation/conversation-avatar.d.ts +21 -0
  39. package/dist/components/conversation/conversation-avatar.d.ts.map +1 -0
  40. package/dist/components/conversation/conversation-avatar.js +52 -0
  41. package/dist/components/conversation/conversation-avatar.js.map +1 -0
  42. package/dist/components/conversation/conversation-surface.d.ts +27 -0
  43. package/dist/components/conversation/conversation-surface.d.ts.map +1 -0
  44. package/dist/components/conversation/conversation-surface.js +118 -0
  45. package/dist/components/conversation/conversation-surface.js.map +1 -0
  46. package/dist/components/conversation/index.d.ts +6 -0
  47. package/dist/components/conversation/index.d.ts.map +1 -0
  48. package/dist/components/conversation/message-composer.d.ts +70 -0
  49. package/dist/components/conversation/message-composer.d.ts.map +1 -0
  50. package/dist/components/conversation/message-composer.js +235 -0
  51. package/dist/components/conversation/message-composer.js.map +1 -0
  52. package/dist/components/conversation/message-row.d.ts +101 -0
  53. package/dist/components/conversation/message-row.d.ts.map +1 -0
  54. package/dist/components/conversation/message-row.js +389 -0
  55. package/dist/components/conversation/message-row.js.map +1 -0
  56. package/dist/components/conversation/thread-panel.d.ts +45 -0
  57. package/dist/components/conversation/thread-panel.d.ts.map +1 -0
  58. package/dist/components/conversation/thread-panel.js +123 -0
  59. package/dist/components/conversation/thread-panel.js.map +1 -0
  60. package/dist/components/layout/app-shell/app-shell.d.ts +45 -0
  61. package/dist/components/layout/app-shell/app-shell.d.ts.map +1 -0
  62. package/dist/components/layout/app-shell/app-shell.js +89 -0
  63. package/dist/components/layout/app-shell/app-shell.js.map +1 -0
  64. package/dist/components/layout/app-shell/index.d.ts +2 -0
  65. package/dist/components/layout/app-shell/index.d.ts.map +1 -0
  66. package/dist/components/layout/page/index.d.ts +2 -0
  67. package/dist/components/layout/page/index.d.ts.map +1 -0
  68. package/dist/components/layout/page/page.d.ts +31 -0
  69. package/dist/components/layout/page/page.d.ts.map +1 -0
  70. package/dist/components/layout/page/page.js +143 -0
  71. package/dist/components/layout/page/page.js.map +1 -0
  72. package/dist/components/layout/panel/index.d.ts +2 -0
  73. package/dist/components/layout/panel/index.d.ts.map +1 -0
  74. package/dist/components/layout/panel/panel.d.ts +44 -0
  75. package/dist/components/layout/panel/panel.d.ts.map +1 -0
  76. package/dist/components/layout/panel/panel.js +151 -0
  77. package/dist/components/layout/panel/panel.js.map +1 -0
  78. package/dist/components/layout/side-rail/index.d.ts +3 -0
  79. package/dist/components/layout/side-rail/index.d.ts.map +1 -0
  80. package/dist/components/layout/side-rail/side-rail-context.d.ts +23 -0
  81. package/dist/components/layout/side-rail/side-rail-context.d.ts.map +1 -0
  82. package/dist/components/layout/side-rail/side-rail-context.js +18 -0
  83. package/dist/components/layout/side-rail/side-rail-context.js.map +1 -0
  84. package/dist/components/layout/side-rail/side-rail.d.ts +101 -0
  85. package/dist/components/layout/side-rail/side-rail.d.ts.map +1 -0
  86. package/dist/components/layout/side-rail/side-rail.js +336 -0
  87. package/dist/components/layout/side-rail/side-rail.js.map +1 -0
  88. package/dist/components/layout/sidebar-nav/index.d.ts +2 -0
  89. package/dist/components/layout/sidebar-nav/index.d.ts.map +1 -0
  90. package/dist/components/layout/sidebar-nav/sidebar-nav.d.ts +62 -0
  91. package/dist/components/layout/sidebar-nav/sidebar-nav.d.ts.map +1 -0
  92. package/dist/components/layout/sidebar-nav/sidebar-nav.js +231 -0
  93. package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -0
  94. package/dist/components/layout/status-bar/index.d.ts +2 -0
  95. package/dist/components/layout/status-bar/index.d.ts.map +1 -0
  96. package/dist/components/layout/status-bar/status-bar.d.ts +23 -0
  97. package/dist/components/layout/status-bar/status-bar.d.ts.map +1 -0
  98. package/dist/components/layout/status-bar/status-bar.js +68 -0
  99. package/dist/components/layout/status-bar/status-bar.js.map +1 -0
  100. package/dist/components/layout/top-bar/index.d.ts +2 -0
  101. package/dist/components/layout/top-bar/index.d.ts.map +1 -0
  102. package/dist/components/layout/top-bar/top-bar.d.ts +59 -0
  103. package/dist/components/layout/top-bar/top-bar.d.ts.map +1 -0
  104. package/dist/components/layout/top-bar/top-bar.js +118 -0
  105. package/dist/components/layout/top-bar/top-bar.js.map +1 -0
  106. package/dist/components/motion/index.d.ts +3 -0
  107. package/dist/components/motion/index.d.ts.map +1 -0
  108. package/dist/components/motion/index.js +3 -0
  109. package/dist/components/motion/presence.d.ts +29 -0
  110. package/dist/components/motion/presence.d.ts.map +1 -0
  111. package/dist/components/motion/presence.js +10 -0
  112. package/dist/components/motion/presence.js.map +1 -0
  113. package/dist/components/theme/appearance-panel.d.ts +25 -0
  114. package/dist/components/theme/appearance-panel.d.ts.map +1 -0
  115. package/dist/components/theme/appearance-panel.js +162 -0
  116. package/dist/components/theme/appearance-panel.js.map +1 -0
  117. package/dist/components/theme/index.d.ts +5 -0
  118. package/dist/components/theme/index.d.ts.map +1 -0
  119. package/dist/components/theme/theme-picker.d.ts +54 -0
  120. package/dist/components/theme/theme-picker.d.ts.map +1 -0
  121. package/dist/components/theme/theme-picker.js +156 -0
  122. package/dist/components/theme/theme-picker.js.map +1 -0
  123. package/dist/components/theme/theme-provider.d.ts +130 -0
  124. package/dist/components/theme/theme-provider.d.ts.map +1 -0
  125. package/dist/components/theme/theme-provider.js +164 -0
  126. package/dist/components/theme/theme-provider.js.map +1 -0
  127. package/dist/components/theme/theme-toggle.d.ts +19 -0
  128. package/dist/components/theme/theme-toggle.d.ts.map +1 -0
  129. package/dist/components/theme/theme-toggle.js +69 -0
  130. package/dist/components/theme/theme-toggle.js.map +1 -0
  131. package/dist/components/ui/accordion/accordion.d.ts +18 -0
  132. package/dist/components/ui/accordion/accordion.d.ts.map +1 -0
  133. package/dist/components/ui/accordion/accordion.js +60 -0
  134. package/dist/components/ui/accordion/accordion.js.map +1 -0
  135. package/dist/components/ui/accordion/index.d.ts +2 -0
  136. package/dist/components/ui/accordion/index.d.ts.map +1 -0
  137. package/dist/components/ui/alert/alert.d.ts +26 -0
  138. package/dist/components/ui/alert/alert.d.ts.map +1 -0
  139. package/dist/components/ui/alert/alert.js +89 -0
  140. package/dist/components/ui/alert/alert.js.map +1 -0
  141. package/dist/components/ui/alert/index.d.ts +2 -0
  142. package/dist/components/ui/alert/index.d.ts.map +1 -0
  143. package/dist/components/ui/alert-dialog/alert-dialog.d.ts +29 -0
  144. package/dist/components/ui/alert-dialog/alert-dialog.d.ts.map +1 -0
  145. package/dist/components/ui/alert-dialog/alert-dialog.js +155 -0
  146. package/dist/components/ui/alert-dialog/alert-dialog.js.map +1 -0
  147. package/dist/components/ui/alert-dialog/index.d.ts +2 -0
  148. package/dist/components/ui/alert-dialog/index.d.ts.map +1 -0
  149. package/dist/components/ui/aspect-ratio/aspect-ratio.d.ts +22 -0
  150. package/dist/components/ui/aspect-ratio/aspect-ratio.d.ts.map +1 -0
  151. package/dist/components/ui/aspect-ratio/aspect-ratio.js +29 -0
  152. package/dist/components/ui/aspect-ratio/aspect-ratio.js.map +1 -0
  153. package/dist/components/ui/aspect-ratio/index.d.ts +2 -0
  154. package/dist/components/ui/aspect-ratio/index.d.ts.map +1 -0
  155. package/dist/components/ui/avatar/avatar.d.ts +41 -0
  156. package/dist/components/ui/avatar/avatar.d.ts.map +1 -0
  157. package/dist/components/ui/avatar/avatar.js +106 -0
  158. package/dist/components/ui/avatar/avatar.js.map +1 -0
  159. package/dist/components/ui/avatar/index.d.ts +2 -0
  160. package/dist/components/ui/avatar/index.d.ts.map +1 -0
  161. package/dist/components/ui/badge/badge.d.ts +22 -0
  162. package/dist/components/ui/badge/badge.d.ts.map +1 -0
  163. package/dist/components/ui/badge/badge.js +58 -0
  164. package/dist/components/ui/badge/badge.js.map +1 -0
  165. package/dist/components/ui/badge/index.d.ts +2 -0
  166. package/dist/components/ui/badge/index.d.ts.map +1 -0
  167. package/dist/components/ui/board/board.d.ts +78 -0
  168. package/dist/components/ui/board/board.d.ts.map +1 -0
  169. package/dist/components/ui/board/board.js +200 -0
  170. package/dist/components/ui/board/board.js.map +1 -0
  171. package/dist/components/ui/board/index.d.ts +2 -0
  172. package/dist/components/ui/board/index.d.ts.map +1 -0
  173. package/dist/components/ui/breadcrumb/breadcrumb.d.ts +24 -0
  174. package/dist/components/ui/breadcrumb/breadcrumb.d.ts.map +1 -0
  175. package/dist/components/ui/breadcrumb/breadcrumb.js +109 -0
  176. package/dist/components/ui/breadcrumb/breadcrumb.js.map +1 -0
  177. package/dist/components/ui/breadcrumb/index.d.ts +2 -0
  178. package/dist/components/ui/breadcrumb/index.d.ts.map +1 -0
  179. package/dist/components/ui/button/button.d.ts +30 -0
  180. package/dist/components/ui/button/button.d.ts.map +1 -0
  181. package/dist/components/ui/button/button.js +80 -0
  182. package/dist/components/ui/button/button.js.map +1 -0
  183. package/dist/components/ui/button/index.d.ts +2 -0
  184. package/dist/components/ui/button/index.d.ts.map +1 -0
  185. package/dist/components/ui/button-group/button-group.d.ts +39 -0
  186. package/dist/components/ui/button-group/button-group.d.ts.map +1 -0
  187. package/dist/components/ui/button-group/button-group.js +63 -0
  188. package/dist/components/ui/button-group/button-group.js.map +1 -0
  189. package/dist/components/ui/button-group/index.d.ts +2 -0
  190. package/dist/components/ui/button-group/index.d.ts.map +1 -0
  191. package/dist/components/ui/calendar/calendar.d.ts +93 -0
  192. package/dist/components/ui/calendar/calendar.d.ts.map +1 -0
  193. package/dist/components/ui/calendar/calendar.js +243 -0
  194. package/dist/components/ui/calendar/calendar.js.map +1 -0
  195. package/dist/components/ui/calendar/index.d.ts +2 -0
  196. package/dist/components/ui/calendar/index.d.ts.map +1 -0
  197. package/dist/components/ui/card/card.d.ts +23 -0
  198. package/dist/components/ui/card/card.d.ts.map +1 -0
  199. package/dist/components/ui/card/card.js +98 -0
  200. package/dist/components/ui/card/card.js.map +1 -0
  201. package/dist/components/ui/card/index.d.ts +2 -0
  202. package/dist/components/ui/card/index.d.ts.map +1 -0
  203. package/dist/components/ui/carousel/carousel.d.ts +66 -0
  204. package/dist/components/ui/carousel/carousel.d.ts.map +1 -0
  205. package/dist/components/ui/carousel/carousel.js +178 -0
  206. package/dist/components/ui/carousel/carousel.js.map +1 -0
  207. package/dist/components/ui/carousel/index.d.ts +2 -0
  208. package/dist/components/ui/carousel/index.d.ts.map +1 -0
  209. package/dist/components/ui/chart/chart.d.ts +154 -0
  210. package/dist/components/ui/chart/chart.d.ts.map +1 -0
  211. package/dist/components/ui/chart/chart.js +373 -0
  212. package/dist/components/ui/chart/chart.js.map +1 -0
  213. package/dist/components/ui/chart/index.d.ts +2 -0
  214. package/dist/components/ui/chart/index.d.ts.map +1 -0
  215. package/dist/components/ui/checkbox/checkbox.d.ts +33 -0
  216. package/dist/components/ui/checkbox/checkbox.d.ts.map +1 -0
  217. package/dist/components/ui/checkbox/checkbox.js +76 -0
  218. package/dist/components/ui/checkbox/checkbox.js.map +1 -0
  219. package/dist/components/ui/checkbox/index.d.ts +2 -0
  220. package/dist/components/ui/checkbox/index.d.ts.map +1 -0
  221. package/dist/components/ui/code-block/code-block.d.ts +75 -0
  222. package/dist/components/ui/code-block/code-block.d.ts.map +1 -0
  223. package/dist/components/ui/code-block/code-block.js +186 -0
  224. package/dist/components/ui/code-block/code-block.js.map +1 -0
  225. package/dist/components/ui/code-block/index.d.ts +2 -0
  226. package/dist/components/ui/code-block/index.d.ts.map +1 -0
  227. package/dist/components/ui/collapsible/collapsible.d.ts +17 -0
  228. package/dist/components/ui/collapsible/collapsible.d.ts.map +1 -0
  229. package/dist/components/ui/collapsible/collapsible.js +38 -0
  230. package/dist/components/ui/collapsible/collapsible.js.map +1 -0
  231. package/dist/components/ui/collapsible/index.d.ts +2 -0
  232. package/dist/components/ui/collapsible/index.d.ts.map +1 -0
  233. package/dist/components/ui/combobox/combobox.d.ts +28 -0
  234. package/dist/components/ui/combobox/combobox.d.ts.map +1 -0
  235. package/dist/components/ui/combobox/combobox.js +102 -0
  236. package/dist/components/ui/combobox/combobox.js.map +1 -0
  237. package/dist/components/ui/combobox/index.d.ts +2 -0
  238. package/dist/components/ui/combobox/index.d.ts.map +1 -0
  239. package/dist/components/ui/command/command.d.ts +53 -0
  240. package/dist/components/ui/command/command.d.ts.map +1 -0
  241. package/dist/components/ui/command/command.js +137 -0
  242. package/dist/components/ui/command/command.js.map +1 -0
  243. package/dist/components/ui/command/index.d.ts +2 -0
  244. package/dist/components/ui/command/index.d.ts.map +1 -0
  245. package/dist/components/ui/context-menu/context-menu.d.ts +32 -0
  246. package/dist/components/ui/context-menu/context-menu.d.ts.map +1 -0
  247. package/dist/components/ui/context-menu/context-menu.js +119 -0
  248. package/dist/components/ui/context-menu/context-menu.js.map +1 -0
  249. package/dist/components/ui/context-menu/index.d.ts +2 -0
  250. package/dist/components/ui/context-menu/index.d.ts.map +1 -0
  251. package/dist/components/ui/detail-panel/detail-panel.d.ts +61 -0
  252. package/dist/components/ui/detail-panel/detail-panel.d.ts.map +1 -0
  253. package/dist/components/ui/detail-panel/detail-panel.js +132 -0
  254. package/dist/components/ui/detail-panel/detail-panel.js.map +1 -0
  255. package/dist/components/ui/detail-panel/index.d.ts +2 -0
  256. package/dist/components/ui/detail-panel/index.d.ts.map +1 -0
  257. package/dist/components/ui/dialog/dialog.d.ts +40 -0
  258. package/dist/components/ui/dialog/dialog.d.ts.map +1 -0
  259. package/dist/components/ui/dialog/dialog.js +125 -0
  260. package/dist/components/ui/dialog/dialog.js.map +1 -0
  261. package/dist/components/ui/dialog/index.d.ts +2 -0
  262. package/dist/components/ui/dialog/index.d.ts.map +1 -0
  263. package/dist/components/ui/diff-block/diff-block.d.ts +95 -0
  264. package/dist/components/ui/diff-block/diff-block.d.ts.map +1 -0
  265. package/dist/components/ui/diff-block/diff-block.js +230 -0
  266. package/dist/components/ui/diff-block/diff-block.js.map +1 -0
  267. package/dist/components/ui/diff-block/diff-block.test.d.ts +2 -0
  268. package/dist/components/ui/diff-block/diff-block.test.d.ts.map +1 -0
  269. package/dist/components/ui/diff-block/index.d.ts +2 -0
  270. package/dist/components/ui/diff-block/index.d.ts.map +1 -0
  271. package/dist/components/ui/drawer/drawer.d.ts +39 -0
  272. package/dist/components/ui/drawer/drawer.d.ts.map +1 -0
  273. package/dist/components/ui/drawer/drawer.js +106 -0
  274. package/dist/components/ui/drawer/drawer.js.map +1 -0
  275. package/dist/components/ui/drawer/index.d.ts +2 -0
  276. package/dist/components/ui/drawer/index.d.ts.map +1 -0
  277. package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +48 -0
  278. package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts.map +1 -0
  279. package/dist/components/ui/dropdown-menu/dropdown-menu.js +151 -0
  280. package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -0
  281. package/dist/components/ui/dropdown-menu/index.d.ts +2 -0
  282. package/dist/components/ui/dropdown-menu/index.d.ts.map +1 -0
  283. package/dist/components/ui/empty/empty.d.ts +27 -0
  284. package/dist/components/ui/empty/empty.d.ts.map +1 -0
  285. package/dist/components/ui/{empty.js → empty/empty.js} +28 -23
  286. package/dist/components/ui/empty/empty.js.map +1 -0
  287. package/dist/components/ui/empty/index.d.ts +2 -0
  288. package/dist/components/ui/empty/index.d.ts.map +1 -0
  289. package/dist/components/ui/entity-icon/entity-icon.d.ts +59 -0
  290. package/dist/components/ui/entity-icon/entity-icon.d.ts.map +1 -0
  291. package/dist/components/ui/entity-icon/entity-icon.js +145 -0
  292. package/dist/components/ui/entity-icon/entity-icon.js.map +1 -0
  293. package/dist/components/ui/entity-icon/index.d.ts +2 -0
  294. package/dist/components/ui/entity-icon/index.d.ts.map +1 -0
  295. package/dist/components/ui/field/field.d.ts +39 -0
  296. package/dist/components/ui/field/field.d.ts.map +1 -0
  297. package/dist/components/ui/field/field.js +111 -0
  298. package/dist/components/ui/field/field.js.map +1 -0
  299. package/dist/components/ui/field/index.d.ts +2 -0
  300. package/dist/components/ui/field/index.d.ts.map +1 -0
  301. package/dist/components/ui/hover-card/hover-card.d.ts +17 -0
  302. package/dist/components/ui/hover-card/hover-card.d.ts.map +1 -0
  303. package/dist/components/ui/hover-card/hover-card.js +40 -0
  304. package/dist/components/ui/hover-card/hover-card.js.map +1 -0
  305. package/dist/components/ui/hover-card/index.d.ts +2 -0
  306. package/dist/components/ui/hover-card/index.d.ts.map +1 -0
  307. package/dist/components/ui/input/index.d.ts +2 -0
  308. package/dist/components/ui/input/index.d.ts.map +1 -0
  309. package/dist/components/ui/input/input.d.ts +15 -0
  310. package/dist/components/ui/input/input.d.ts.map +1 -0
  311. package/dist/components/ui/input/input.js +36 -0
  312. package/dist/components/ui/input/input.js.map +1 -0
  313. package/dist/components/ui/input-group/index.d.ts +2 -0
  314. package/dist/components/ui/input-group/index.d.ts.map +1 -0
  315. package/dist/components/ui/input-group/input-group.d.ts +34 -0
  316. package/dist/components/ui/input-group/input-group.d.ts.map +1 -0
  317. package/dist/components/ui/input-group/input-group.js +93 -0
  318. package/dist/components/ui/input-group/input-group.js.map +1 -0
  319. package/dist/components/ui/input-otp/index.d.ts +2 -0
  320. package/dist/components/ui/input-otp/index.d.ts.map +1 -0
  321. package/dist/components/ui/input-otp/input-otp.d.ts +37 -0
  322. package/dist/components/ui/input-otp/input-otp.d.ts.map +1 -0
  323. package/dist/components/ui/input-otp/input-otp.js +92 -0
  324. package/dist/components/ui/input-otp/input-otp.js.map +1 -0
  325. package/dist/components/ui/item/index.d.ts +2 -0
  326. package/dist/components/ui/item/index.d.ts.map +1 -0
  327. package/dist/components/ui/item/item.d.ts +49 -0
  328. package/dist/components/ui/item/item.d.ts.map +1 -0
  329. package/dist/components/ui/item/item.js +163 -0
  330. package/dist/components/ui/item/item.js.map +1 -0
  331. package/dist/components/ui/kbd/index.d.ts +2 -0
  332. package/dist/components/ui/kbd/index.d.ts.map +1 -0
  333. package/dist/components/ui/kbd/kbd.d.ts +14 -0
  334. package/dist/components/ui/kbd/kbd.d.ts.map +1 -0
  335. package/dist/components/ui/kbd/kbd.js +40 -0
  336. package/dist/components/ui/kbd/kbd.js.map +1 -0
  337. package/dist/components/ui/label/index.d.ts +2 -0
  338. package/dist/components/ui/label/index.d.ts.map +1 -0
  339. package/dist/components/ui/label/label.d.ts +17 -0
  340. package/dist/components/ui/label/label.d.ts.map +1 -0
  341. package/dist/components/ui/label/label.js +33 -0
  342. package/dist/components/ui/label/label.js.map +1 -0
  343. package/dist/components/ui/menubar/index.d.ts +2 -0
  344. package/dist/components/ui/menubar/index.d.ts.map +1 -0
  345. package/dist/components/ui/menubar/menubar.d.ts +38 -0
  346. package/dist/components/ui/menubar/menubar.d.ts.map +1 -0
  347. package/dist/components/ui/menubar/menubar.js +138 -0
  348. package/dist/components/ui/menubar/menubar.js.map +1 -0
  349. package/dist/components/ui/modal-dialog/index.d.ts +2 -0
  350. package/dist/components/ui/modal-dialog/index.d.ts.map +1 -0
  351. package/dist/components/ui/modal-dialog/modal-dialog.d.ts +35 -0
  352. package/dist/components/ui/modal-dialog/modal-dialog.d.ts.map +1 -0
  353. package/dist/components/ui/modal-dialog/modal-dialog.js +78 -0
  354. package/dist/components/ui/modal-dialog/modal-dialog.js.map +1 -0
  355. package/dist/components/ui/navigation-menu/index.d.ts +2 -0
  356. package/dist/components/ui/navigation-menu/index.d.ts.map +1 -0
  357. package/dist/components/ui/navigation-menu/navigation-menu.d.ts +77 -0
  358. package/dist/components/ui/navigation-menu/navigation-menu.d.ts.map +1 -0
  359. package/dist/components/ui/navigation-menu/navigation-menu.js +116 -0
  360. package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -0
  361. package/dist/components/ui/pagination/index.d.ts +2 -0
  362. package/dist/components/ui/pagination/index.d.ts.map +1 -0
  363. package/dist/components/ui/pagination/pagination.d.ts +33 -0
  364. package/dist/components/ui/pagination/pagination.d.ts.map +1 -0
  365. package/dist/components/ui/pagination/pagination.js +92 -0
  366. package/dist/components/ui/pagination/pagination.js.map +1 -0
  367. package/dist/components/ui/popover/index.d.ts +2 -0
  368. package/dist/components/ui/popover/index.d.ts.map +1 -0
  369. package/dist/components/ui/popover/popover.d.ts +26 -0
  370. package/dist/components/ui/popover/popover.d.ts.map +1 -0
  371. package/dist/components/ui/popover/popover.js +66 -0
  372. package/dist/components/ui/popover/popover.js.map +1 -0
  373. package/dist/components/ui/progress/index.d.ts +2 -0
  374. package/dist/components/ui/progress/index.d.ts.map +1 -0
  375. package/dist/components/ui/progress/progress.d.ts +29 -0
  376. package/dist/components/ui/progress/progress.d.ts.map +1 -0
  377. package/dist/components/ui/progress/progress.js +53 -0
  378. package/dist/components/ui/progress/progress.js.map +1 -0
  379. package/dist/components/ui/radio-group/index.d.ts +2 -0
  380. package/dist/components/ui/radio-group/index.d.ts.map +1 -0
  381. package/dist/components/ui/radio-group/radio-group.d.ts +26 -0
  382. package/dist/components/ui/radio-group/radio-group.d.ts.map +1 -0
  383. package/dist/components/ui/radio-group/radio-group.js +77 -0
  384. package/dist/components/ui/radio-group/radio-group.js.map +1 -0
  385. package/dist/components/ui/resizable/index.d.ts +2 -0
  386. package/dist/components/ui/resizable/index.d.ts.map +1 -0
  387. package/dist/components/ui/resizable/resizable.d.ts +33 -0
  388. package/dist/components/ui/resizable/resizable.d.ts.map +1 -0
  389. package/dist/components/ui/resizable/resizable.js +57 -0
  390. package/dist/components/ui/resizable/resizable.js.map +1 -0
  391. package/dist/components/ui/scroll-area/index.d.ts +2 -0
  392. package/dist/components/ui/scroll-area/index.d.ts.map +1 -0
  393. package/dist/components/ui/scroll-area/scroll-area.d.ts +26 -0
  394. package/dist/components/ui/scroll-area/scroll-area.d.ts.map +1 -0
  395. package/dist/components/ui/scroll-area/scroll-area.js +36 -0
  396. package/dist/components/ui/scroll-area/scroll-area.js.map +1 -0
  397. package/dist/components/ui/select/index.d.ts +2 -0
  398. package/dist/components/ui/select/index.d.ts.map +1 -0
  399. package/dist/components/ui/select/select.d.ts +63 -0
  400. package/dist/components/ui/select/select.d.ts.map +1 -0
  401. package/dist/components/ui/select/select.js +142 -0
  402. package/dist/components/ui/select/select.js.map +1 -0
  403. package/dist/components/ui/separator/index.d.ts +2 -0
  404. package/dist/components/ui/separator/index.d.ts.map +1 -0
  405. package/dist/components/ui/separator/separator.d.ts +17 -0
  406. package/dist/components/ui/separator/separator.d.ts.map +1 -0
  407. package/dist/components/ui/separator/separator.js +24 -0
  408. package/dist/components/ui/separator/separator.js.map +1 -0
  409. package/dist/components/ui/sheet/index.d.ts +2 -0
  410. package/dist/components/ui/sheet/index.d.ts.map +1 -0
  411. package/dist/components/ui/sheet/sheet.d.ts +32 -0
  412. package/dist/components/ui/sheet/sheet.d.ts.map +1 -0
  413. package/dist/components/ui/sheet/sheet.js +118 -0
  414. package/dist/components/ui/sheet/sheet.js.map +1 -0
  415. package/dist/components/ui/skeleton/index.d.ts +2 -0
  416. package/dist/components/ui/skeleton/index.d.ts.map +1 -0
  417. package/dist/components/ui/skeleton/skeleton.d.ts +15 -0
  418. package/dist/components/ui/skeleton/skeleton.d.ts.map +1 -0
  419. package/dist/components/ui/skeleton/skeleton.js +31 -0
  420. package/dist/components/ui/skeleton/skeleton.js.map +1 -0
  421. package/dist/components/ui/slider/index.d.ts +2 -0
  422. package/dist/components/ui/slider/index.d.ts.map +1 -0
  423. package/dist/components/ui/slider/slider.d.ts +22 -0
  424. package/dist/components/ui/slider/slider.d.ts.map +1 -0
  425. package/dist/components/ui/slider/slider.js +59 -0
  426. package/dist/components/ui/slider/slider.js.map +1 -0
  427. package/dist/components/ui/spinner/index.d.ts +2 -0
  428. package/dist/components/ui/spinner/index.d.ts.map +1 -0
  429. package/dist/components/ui/spinner/spinner.d.ts +25 -0
  430. package/dist/components/ui/spinner/spinner.d.ts.map +1 -0
  431. package/dist/components/ui/spinner/spinner.js +57 -0
  432. package/dist/components/ui/spinner/spinner.js.map +1 -0
  433. package/dist/components/ui/status-chip/index.d.ts +2 -0
  434. package/dist/components/ui/status-chip/index.d.ts.map +1 -0
  435. package/dist/components/ui/status-chip/status-chip.d.ts +70 -0
  436. package/dist/components/ui/status-chip/status-chip.d.ts.map +1 -0
  437. package/dist/components/ui/status-chip/status-chip.js +140 -0
  438. package/dist/components/ui/status-chip/status-chip.js.map +1 -0
  439. package/dist/components/ui/switch/index.d.ts +2 -0
  440. package/dist/components/ui/switch/index.d.ts.map +1 -0
  441. package/dist/components/ui/switch/switch.d.ts +36 -0
  442. package/dist/components/ui/switch/switch.d.ts.map +1 -0
  443. package/dist/components/ui/switch/switch.js +74 -0
  444. package/dist/components/ui/switch/switch.js.map +1 -0
  445. package/dist/components/ui/table/index.d.ts +2 -0
  446. package/dist/components/ui/table/index.d.ts.map +1 -0
  447. package/dist/components/ui/table/table.d.ts +29 -0
  448. package/dist/components/ui/table/table.d.ts.map +1 -0
  449. package/dist/components/ui/table/table.js +129 -0
  450. package/dist/components/ui/table/table.js.map +1 -0
  451. package/dist/components/ui/tabs/index.d.ts +2 -0
  452. package/dist/components/ui/tabs/index.d.ts.map +1 -0
  453. package/dist/components/ui/tabs/tabs.d.ts +23 -0
  454. package/dist/components/ui/tabs/tabs.d.ts.map +1 -0
  455. package/dist/components/ui/tabs/tabs.js +43 -0
  456. package/dist/components/ui/tabs/tabs.js.map +1 -0
  457. package/dist/components/ui/textarea/index.d.ts +2 -0
  458. package/dist/components/ui/textarea/index.d.ts.map +1 -0
  459. package/dist/components/ui/textarea/textarea.d.ts +14 -0
  460. package/dist/components/ui/textarea/textarea.d.ts.map +1 -0
  461. package/dist/components/ui/textarea/textarea.js +30 -0
  462. package/dist/components/ui/textarea/textarea.js.map +1 -0
  463. package/dist/components/ui/toast/index.d.ts +2 -0
  464. package/dist/components/ui/toast/index.d.ts.map +1 -0
  465. package/dist/components/ui/toast/toast.d.ts +68 -0
  466. package/dist/components/ui/toast/toast.d.ts.map +1 -0
  467. package/dist/components/ui/toast/toast.js +186 -0
  468. package/dist/components/ui/toast/toast.js.map +1 -0
  469. package/dist/components/ui/toggle/index.d.ts +2 -0
  470. package/dist/components/ui/toggle/index.d.ts.map +1 -0
  471. package/dist/components/ui/toggle/toggle.d.ts +22 -0
  472. package/dist/components/ui/toggle/toggle.d.ts.map +1 -0
  473. package/dist/components/ui/toggle/toggle.js +64 -0
  474. package/dist/components/ui/toggle/toggle.js.map +1 -0
  475. package/dist/components/ui/toggle-group/index.d.ts +2 -0
  476. package/dist/components/ui/toggle-group/index.d.ts.map +1 -0
  477. package/dist/components/ui/toggle-group/toggle-group.d.ts +35 -0
  478. package/dist/components/ui/toggle-group/toggle-group.d.ts.map +1 -0
  479. package/dist/components/ui/toggle-group/toggle-group.js +38 -0
  480. package/dist/components/ui/toggle-group/toggle-group.js.map +1 -0
  481. package/dist/components/ui/tooltip/index.d.ts +2 -0
  482. package/dist/components/ui/tooltip/index.d.ts.map +1 -0
  483. package/dist/components/ui/tooltip/tooltip.d.ts +18 -0
  484. package/dist/components/ui/tooltip/tooltip.d.ts.map +1 -0
  485. package/dist/components/ui/tooltip/tooltip.js +67 -0
  486. package/dist/components/ui/tooltip/tooltip.js.map +1 -0
  487. package/dist/index.d.ts +96 -19
  488. package/dist/index.d.ts.map +1 -0
  489. package/dist/index.js +90 -20
  490. package/dist/lib/keyed-rows.d.ts +36 -0
  491. package/dist/lib/keyed-rows.d.ts.map +1 -0
  492. package/dist/lib/keyed-rows.js +53 -0
  493. package/dist/lib/keyed-rows.js.map +1 -0
  494. package/dist/lib/keyed-rows.test.d.ts +2 -0
  495. package/dist/lib/keyed-rows.test.d.ts.map +1 -0
  496. package/dist/lib/overlay.d.ts +44 -0
  497. package/dist/lib/overlay.d.ts.map +1 -0
  498. package/dist/lib/overlay.js +57 -0
  499. package/dist/lib/overlay.js.map +1 -0
  500. package/dist/lib/themes.d.ts +197 -0
  501. package/dist/lib/themes.d.ts.map +1 -0
  502. package/dist/lib/themes.js +303 -0
  503. package/dist/lib/themes.js.map +1 -0
  504. package/dist/lib/tokens.d.ts +103 -0
  505. package/dist/lib/tokens.d.ts.map +1 -0
  506. package/dist/lib/tokens.js +805 -0
  507. package/dist/lib/tokens.js.map +1 -0
  508. package/dist/lib/utils.d.ts +27 -0
  509. package/dist/lib/utils.d.ts.map +1 -0
  510. package/dist/lib/utils.js +61 -3
  511. package/dist/lib/utils.js.map +1 -0
  512. package/dist/lib/variants.d.ts +57 -0
  513. package/dist/lib/variants.d.ts.map +1 -0
  514. package/dist/lib/variants.js +49 -0
  515. package/dist/lib/variants.js.map +1 -0
  516. package/dist/lib/version-notes.d.ts +24 -0
  517. package/dist/lib/version-notes.d.ts.map +1 -0
  518. package/dist/lib/version-notes.js +41 -1
  519. package/dist/lib/version-notes.js.map +1 -0
  520. package/dist/r/accordion.json +23 -0
  521. package/dist/r/account-menu.json +25 -0
  522. package/dist/r/alert-dialog.json +22 -0
  523. package/dist/r/alert.json +22 -0
  524. package/dist/r/app-shell.json +20 -0
  525. package/dist/r/aspect-ratio.json +20 -0
  526. package/dist/r/avatar.json +20 -0
  527. package/dist/r/badge.json +22 -0
  528. package/dist/r/board.json +20 -0
  529. package/dist/r/breadcrumb.json +22 -0
  530. package/dist/r/button-group.json +22 -0
  531. package/dist/r/button.json +22 -0
  532. package/dist/r/calendar.json +25 -0
  533. package/dist/r/card.json +20 -0
  534. package/dist/r/carousel.json +26 -0
  535. package/dist/r/chart.json +23 -0
  536. package/dist/r/checkbox.json +23 -0
  537. package/dist/r/code-block.json +24 -0
  538. package/dist/r/collapsible.json +22 -0
  539. package/dist/r/combobox.json +23 -0
  540. package/dist/r/command.json +23 -0
  541. package/dist/r/context-menu.json +23 -0
  542. package/dist/r/conversation.json +48 -0
  543. package/dist/r/detail-panel.json +24 -0
  544. package/dist/r/dialog.json +23 -0
  545. package/dist/r/diff-block.json +20 -0
  546. package/dist/r/drawer.json +22 -0
  547. package/dist/r/dropdown-menu.json +23 -0
  548. package/dist/r/empty.json +20 -0
  549. package/dist/r/entity-icon.json +20 -0
  550. package/dist/r/field.json +22 -0
  551. package/dist/r/hover-card.json +22 -0
  552. package/dist/r/input-group.json +20 -0
  553. package/dist/r/input-otp.json +22 -0
  554. package/dist/r/input.json +20 -0
  555. package/dist/r/item.json +20 -0
  556. package/dist/r/kbd.json +20 -0
  557. package/dist/r/label.json +20 -0
  558. package/dist/r/list-row.json +22 -0
  559. package/dist/r/menubar.json +23 -0
  560. package/dist/r/modal-dialog.json +22 -0
  561. package/dist/r/navigation-menu.json +23 -0
  562. package/dist/r/page.json +20 -0
  563. package/dist/r/pagination.json +23 -0
  564. package/dist/r/panel.json +20 -0
  565. package/dist/r/popover.json +22 -0
  566. package/dist/r/progress.json +22 -0
  567. package/dist/r/radio-group.json +23 -0
  568. package/dist/r/registry.json +1676 -0
  569. package/dist/r/resizable.json +23 -0
  570. package/dist/r/scroll-area.json +20 -0
  571. package/dist/r/select.json +23 -0
  572. package/dist/r/separator.json +22 -0
  573. package/dist/r/settings.json +20 -0
  574. package/dist/r/sheet.json +25 -0
  575. package/dist/r/side-rail.json +27 -0
  576. package/dist/r/sidebar-nav.json +23 -0
  577. package/dist/r/skeleton.json +20 -0
  578. package/dist/r/slider.json +22 -0
  579. package/dist/r/spinner.json +22 -0
  580. package/dist/r/stat.json +22 -0
  581. package/dist/r/status-bar.json +20 -0
  582. package/dist/r/status-chip.json +22 -0
  583. package/dist/r/switch.json +22 -0
  584. package/dist/r/table.json +20 -0
  585. package/dist/r/tabs.json +22 -0
  586. package/dist/r/textarea.json +20 -0
  587. package/dist/r/theme.json +36 -0
  588. package/dist/r/toast.json +23 -0
  589. package/dist/r/toggle-group.json +24 -0
  590. package/dist/r/toggle.json +22 -0
  591. package/dist/r/tooltip.json +22 -0
  592. package/dist/r/top-bar.json +20 -0
  593. package/dist/r/update-dialog.json +27 -0
  594. package/dist/r/workspace-mark.json +22 -0
  595. package/package.json +75 -21
  596. package/registry.json +1676 -0
  597. package/src/components/composites/account-menu/account-menu.tsx +150 -0
  598. package/src/components/composites/account-menu/index.ts +1 -0
  599. package/src/components/composites/list-row/index.ts +1 -0
  600. package/src/components/composites/list-row/list-row.tsx +116 -0
  601. package/src/components/composites/settings/index.ts +1 -0
  602. package/src/components/composites/settings/settings.tsx +142 -0
  603. package/src/components/composites/stat/index.ts +9 -0
  604. package/src/components/composites/stat/stat.tsx +155 -0
  605. package/src/components/composites/update-dialog/index.ts +7 -0
  606. package/src/components/composites/update-dialog/update-dialog.tsx +529 -0
  607. package/src/components/composites/workspace-mark/index.ts +1 -0
  608. package/src/components/composites/workspace-mark/workspace-mark.tsx +72 -0
  609. package/src/components/conversation/conversation-avatar.tsx +60 -0
  610. package/src/components/conversation/conversation-surface.tsx +107 -0
  611. package/src/components/conversation/index.ts +25 -0
  612. package/src/components/conversation/message-composer.tsx +239 -0
  613. package/src/components/conversation/message-row.tsx +387 -0
  614. package/src/components/conversation/thread-panel.tsx +141 -0
  615. package/src/components/layout/app-shell/app-shell.tsx +92 -0
  616. package/src/components/layout/app-shell/index.ts +1 -0
  617. package/src/components/layout/page/index.ts +9 -0
  618. package/src/components/layout/page/page.tsx +122 -0
  619. package/src/components/layout/panel/index.ts +12 -0
  620. package/src/components/layout/panel/panel.tsx +166 -0
  621. package/src/components/layout/side-rail/index.ts +12 -0
  622. package/src/components/layout/side-rail/side-rail-context.ts +42 -0
  623. package/src/components/layout/side-rail/side-rail.tsx +405 -0
  624. package/src/components/layout/sidebar-nav/index.ts +14 -0
  625. package/src/components/layout/sidebar-nav/sidebar-nav.tsx +244 -0
  626. package/src/components/layout/status-bar/index.ts +1 -0
  627. package/src/components/layout/status-bar/status-bar.tsx +73 -0
  628. package/src/components/layout/top-bar/index.ts +10 -0
  629. package/src/components/layout/top-bar/top-bar.tsx +166 -0
  630. package/src/components/motion/index.ts +2 -0
  631. package/src/components/motion/presence.tsx +32 -0
  632. package/src/components/theme/appearance-panel.tsx +179 -0
  633. package/src/components/theme/index.ts +22 -0
  634. package/src/components/theme/theme-picker.tsx +174 -0
  635. package/src/components/theme/theme-provider.tsx +309 -0
  636. package/src/components/theme/theme-toggle.tsx +64 -0
  637. package/src/components/ui/accordion/accordion.tsx +66 -0
  638. package/src/components/ui/accordion/index.ts +1 -0
  639. package/src/components/ui/alert/alert.tsx +95 -0
  640. package/src/components/ui/alert/index.ts +1 -0
  641. package/src/components/ui/alert-dialog/alert-dialog.tsx +176 -0
  642. package/src/components/ui/alert-dialog/index.ts +13 -0
  643. package/src/components/ui/aspect-ratio/aspect-ratio.tsx +38 -0
  644. package/src/components/ui/aspect-ratio/index.ts +1 -0
  645. package/src/components/ui/avatar/avatar.tsx +114 -0
  646. package/src/components/ui/avatar/index.ts +9 -0
  647. package/src/components/ui/badge/badge.tsx +59 -0
  648. package/src/components/ui/badge/index.ts +1 -0
  649. package/src/components/ui/board/board.tsx +254 -0
  650. package/src/components/ui/board/index.ts +10 -0
  651. package/src/components/ui/breadcrumb/breadcrumb.tsx +117 -0
  652. package/src/components/ui/breadcrumb/index.ts +9 -0
  653. package/src/components/ui/button/button.tsx +89 -0
  654. package/src/components/ui/button/index.ts +1 -0
  655. package/src/components/ui/button-group/button-group.tsx +92 -0
  656. package/src/components/ui/button-group/index.ts +6 -0
  657. package/src/components/ui/calendar/calendar.tsx +277 -0
  658. package/src/components/ui/calendar/index.ts +1 -0
  659. package/src/components/ui/card/card.tsx +82 -0
  660. package/src/components/ui/card/index.ts +10 -0
  661. package/src/components/ui/carousel/carousel.tsx +209 -0
  662. package/src/components/ui/carousel/index.ts +1 -0
  663. package/src/components/ui/chart/chart.tsx +413 -0
  664. package/src/components/ui/chart/index.ts +17 -0
  665. package/src/components/ui/checkbox/checkbox.tsx +99 -0
  666. package/src/components/ui/checkbox/index.ts +1 -0
  667. package/src/components/ui/code-block/code-block.tsx +238 -0
  668. package/src/components/ui/code-block/index.ts +1 -0
  669. package/src/components/ui/collapsible/collapsible.tsx +54 -0
  670. package/src/components/ui/collapsible/index.ts +1 -0
  671. package/src/components/ui/combobox/combobox.tsx +142 -0
  672. package/src/components/ui/combobox/index.ts +10 -0
  673. package/src/components/ui/command/command.tsx +214 -0
  674. package/src/components/ui/command/index.ts +12 -0
  675. package/src/components/ui/context-menu/context-menu.tsx +163 -0
  676. package/src/components/ui/context-menu/index.ts +15 -0
  677. package/src/components/ui/detail-panel/detail-panel.tsx +161 -0
  678. package/src/components/ui/detail-panel/index.ts +9 -0
  679. package/src/components/ui/dialog/dialog.tsx +138 -0
  680. package/src/components/ui/dialog/index.ts +14 -0
  681. package/src/components/ui/diff-block/diff-block.tsx +286 -0
  682. package/src/components/ui/diff-block/index.ts +11 -0
  683. package/src/components/ui/drawer/drawer.tsx +144 -0
  684. package/src/components/ui/drawer/index.ts +13 -0
  685. package/src/components/ui/dropdown-menu/dropdown-menu.tsx +203 -0
  686. package/src/components/ui/dropdown-menu/index.ts +18 -0
  687. package/src/components/ui/empty/empty.tsx +104 -0
  688. package/src/components/ui/empty/index.ts +10 -0
  689. package/src/components/ui/entity-icon/entity-icon.tsx +154 -0
  690. package/src/components/ui/entity-icon/index.ts +1 -0
  691. package/src/components/ui/field/field.tsx +131 -0
  692. package/src/components/ui/field/index.ts +11 -0
  693. package/src/components/ui/hover-card/hover-card.tsx +48 -0
  694. package/src/components/ui/hover-card/index.ts +1 -0
  695. package/src/components/ui/input/index.ts +1 -0
  696. package/src/components/ui/input/input.tsx +41 -0
  697. package/src/components/ui/input-group/index.ts +8 -0
  698. package/src/components/ui/input-group/input-group.tsx +111 -0
  699. package/src/components/ui/input-otp/index.ts +1 -0
  700. package/src/components/ui/input-otp/input-otp.tsx +108 -0
  701. package/src/components/ui/item/index.ts +10 -0
  702. package/src/components/ui/item/item.tsx +146 -0
  703. package/src/components/ui/kbd/index.ts +1 -0
  704. package/src/components/ui/kbd/kbd.tsx +42 -0
  705. package/src/components/ui/label/index.ts +1 -0
  706. package/src/components/ui/label/label.tsx +36 -0
  707. package/src/components/ui/menubar/index.ts +16 -0
  708. package/src/components/ui/menubar/menubar.tsx +190 -0
  709. package/src/components/ui/modal-dialog/index.ts +1 -0
  710. package/src/components/ui/modal-dialog/modal-dialog.tsx +95 -0
  711. package/src/components/ui/navigation-menu/index.ts +13 -0
  712. package/src/components/ui/navigation-menu/navigation-menu.tsx +229 -0
  713. package/src/components/ui/pagination/index.ts +8 -0
  714. package/src/components/ui/pagination/pagination.tsx +144 -0
  715. package/src/components/ui/popover/index.ts +10 -0
  716. package/src/components/ui/popover/popover.tsx +81 -0
  717. package/src/components/ui/progress/index.ts +1 -0
  718. package/src/components/ui/progress/progress.tsx +67 -0
  719. package/src/components/ui/radio-group/index.ts +1 -0
  720. package/src/components/ui/radio-group/radio-group.tsx +78 -0
  721. package/src/components/ui/resizable/index.ts +6 -0
  722. package/src/components/ui/resizable/resizable.tsx +74 -0
  723. package/src/components/ui/scroll-area/index.ts +1 -0
  724. package/src/components/ui/scroll-area/scroll-area.tsx +66 -0
  725. package/src/components/ui/select/index.ts +11 -0
  726. package/src/components/ui/select/select.tsx +188 -0
  727. package/src/components/ui/separator/index.ts +1 -0
  728. package/src/components/ui/separator/separator.tsx +40 -0
  729. package/src/components/ui/sheet/index.ts +13 -0
  730. package/src/components/ui/sheet/sheet.tsx +132 -0
  731. package/src/components/ui/skeleton/index.ts +1 -0
  732. package/src/components/ui/skeleton/skeleton.tsx +28 -0
  733. package/src/components/ui/slider/index.ts +1 -0
  734. package/src/components/ui/slider/slider.tsx +81 -0
  735. package/src/components/ui/spinner/index.ts +1 -0
  736. package/src/components/ui/spinner/spinner.tsx +58 -0
  737. package/src/components/ui/status-chip/index.ts +8 -0
  738. package/src/components/ui/status-chip/status-chip.tsx +142 -0
  739. package/src/components/ui/switch/index.ts +1 -0
  740. package/src/components/ui/switch/switch.tsx +100 -0
  741. package/src/components/ui/table/index.ts +11 -0
  742. package/src/components/ui/table/table.tsx +125 -0
  743. package/src/components/ui/tabs/index.ts +8 -0
  744. package/src/components/ui/tabs/tabs.tsx +77 -0
  745. package/src/components/ui/textarea/index.ts +1 -0
  746. package/src/components/ui/textarea/textarea.tsx +36 -0
  747. package/src/components/ui/toast/index.ts +1 -0
  748. package/src/components/ui/toast/toast.tsx +220 -0
  749. package/src/components/ui/toggle/index.ts +1 -0
  750. package/src/components/ui/toggle/toggle.tsx +60 -0
  751. package/src/components/ui/toggle-group/index.ts +6 -0
  752. package/src/components/ui/toggle-group/toggle-group.tsx +66 -0
  753. package/src/components/ui/tooltip/index.ts +9 -0
  754. package/src/components/ui/tooltip/tooltip.tsx +102 -0
  755. package/src/index.ts +154 -0
  756. package/src/lib/keyed-rows.ts +68 -0
  757. package/src/lib/overlay.ts +70 -0
  758. package/src/lib/themes.ts +490 -0
  759. package/src/lib/tokens.ts +688 -0
  760. package/src/lib/utils.ts +74 -4
  761. package/src/lib/variants.ts +62 -0
  762. package/src/lib/version-notes.ts +35 -0
  763. package/src/styles/base.css +489 -484
  764. package/src/styles/fonts.css +26 -0
  765. package/src/styles/globals.css +14 -3
  766. package/src/styles/theme.css +838 -229
  767. package/LICENSE +0 -201
  768. package/dist/components/account-drawer.d.ts +0 -11
  769. package/dist/components/account-drawer.js +0 -120
  770. package/dist/components/appearance.d.ts +0 -261
  771. package/dist/components/appearance.js +0 -802
  772. package/dist/components/on-screen-controls.d.ts +0 -8
  773. package/dist/components/on-screen-controls.js +0 -162
  774. package/dist/components/scene-settings.d.ts +0 -33
  775. package/dist/components/scene-settings.js +0 -253
  776. package/dist/components/theme-preview.d.ts +0 -40
  777. package/dist/components/theme-preview.js +0 -210
  778. package/dist/components/theme-provider.d.ts +0 -52
  779. package/dist/components/theme-provider.js +0 -128
  780. package/dist/components/theme-swatch.d.ts +0 -12
  781. package/dist/components/theme-swatch.js +0 -66
  782. package/dist/components/theme-toggle.d.ts +0 -7
  783. package/dist/components/theme-toggle.js +0 -64
  784. package/dist/components/ui/badge.d.ts +0 -8
  785. package/dist/components/ui/badge.js +0 -34
  786. package/dist/components/ui/button.d.ts +0 -9
  787. package/dist/components/ui/button.js +0 -52
  788. package/dist/components/ui/card.d.ts +0 -4
  789. package/dist/components/ui/card.js +0 -28
  790. package/dist/components/ui/dialog.d.ts +0 -15
  791. package/dist/components/ui/dialog.js +0 -104
  792. package/dist/components/ui/drawer.d.ts +0 -24
  793. package/dist/components/ui/drawer.js +0 -120
  794. package/dist/components/ui/dropdown-menu.d.ts +0 -35
  795. package/dist/components/ui/dropdown-menu.js +0 -180
  796. package/dist/components/ui/empty.d.ts +0 -12
  797. package/dist/components/ui/field.d.ts +0 -25
  798. package/dist/components/ui/field.js +0 -188
  799. package/dist/components/ui/input.d.ts +0 -3
  800. package/dist/components/ui/input.js +0 -22
  801. package/dist/components/ui/label.d.ts +0 -3
  802. package/dist/components/ui/label.js +0 -17
  803. package/dist/components/ui/radio-group.d.ts +0 -5
  804. package/dist/components/ui/radio-group.js +0 -39
  805. package/dist/components/ui/separator.d.ts +0 -7
  806. package/dist/components/ui/separator.js +0 -20
  807. package/dist/components/ui/skeleton.d.ts +0 -3
  808. package/dist/components/ui/skeleton.js +0 -17
  809. package/dist/components/ui/spinner.d.ts +0 -5
  810. package/dist/components/ui/spinner.js +0 -17
  811. package/dist/components/ui/switch.d.ts +0 -8
  812. package/dist/components/ui/switch.js +0 -59
  813. package/dist/components/ui/tabs.d.ts +0 -11
  814. package/dist/components/ui/tabs.js +0 -57
  815. package/dist/components/ui/toggle-group.d.ts +0 -13
  816. package/dist/components/ui/toggle-group.js +0 -95
  817. package/dist/components/ui/toggle.d.ts +0 -10
  818. package/dist/components/ui/toggle.js +0 -41
  819. package/dist/components/ui/tooltip.d.ts +0 -15
  820. package/dist/components/ui/tooltip.js +0 -55
  821. package/dist/components/version-dialog.d.ts +0 -25
  822. package/dist/components/version-dialog.js +0 -330
  823. package/dist/components/workspace-brand.d.ts +0 -5
  824. package/dist/components/workspace-brand.js +0 -13
  825. package/dist/components/workspace-logo.d.ts +0 -3
  826. package/dist/components/workspace-logo.js +0 -17
  827. package/src/components/account-drawer.tsx +0 -114
  828. package/src/components/appearance.ts +0 -1112
  829. package/src/components/on-screen-controls.tsx +0 -149
  830. package/src/components/scene-settings.tsx +0 -199
  831. package/src/components/theme-preview.tsx +0 -170
  832. package/src/components/theme-provider.tsx +0 -214
  833. package/src/components/theme-swatch.tsx +0 -49
  834. package/src/components/theme-toggle.tsx +0 -48
  835. package/src/components/ui/badge.tsx +0 -40
  836. package/src/components/ui/button.tsx +0 -58
  837. package/src/components/ui/card.tsx +0 -21
  838. package/src/components/ui/dialog.tsx +0 -132
  839. package/src/components/ui/drawer.tsx +0 -168
  840. package/src/components/ui/dropdown-menu.tsx +0 -235
  841. package/src/components/ui/empty.tsx +0 -97
  842. package/src/components/ui/field.tsx +0 -220
  843. package/src/components/ui/input.tsx +0 -20
  844. package/src/components/ui/label.tsx +0 -19
  845. package/src/components/ui/radio-group.tsx +0 -41
  846. package/src/components/ui/separator.tsx +0 -28
  847. package/src/components/ui/skeleton.tsx +0 -16
  848. package/src/components/ui/spinner.tsx +0 -20
  849. package/src/components/ui/switch.tsx +0 -59
  850. package/src/components/ui/tabs.tsx +0 -76
  851. package/src/components/ui/toggle-group.tsx +0 -98
  852. package/src/components/ui/toggle.tsx +0 -42
  853. package/src/components/ui/tooltip.tsx +0 -61
  854. package/src/components/version-dialog.tsx +0 -368
  855. package/src/components/workspace-brand.tsx +0 -18
  856. package/src/components/workspace-logo.tsx +0 -21
  857. package/src/index.tsx +0 -53
  858. package/src/styles/auth-shell.css +0 -167
  859. package/src/styles/conventional-workspace.css +0 -2858
  860. package/src/styles/dev-view.css +0 -899
  861. package/src/styles/workspace-shell.css +0 -82
  862. package/tsconfig.json +0 -11
@@ -1,1112 +0,0 @@
1
- /*
2
- * Copyright (c) 2026 Wing
3
- * Licensed under the MIT License.
4
- *
5
- * Appearance domain model substantially translated from Zeron
6
- * crates/theme/src/lib.rs and crates/ui/src/appearance.rs, revision
7
- * 30a9a9537c5ec96226c87f4bf349b6f77c5dfb59: color math with WCAG contrast,
8
- * accent role derivation, independent light/dark theme selection, the
9
- * system/light/dark mode resolver, surface preference resolution, the theme
10
- * registry with deterministic built-in fallback, and its validation rules.
11
- * Modified for TypeScript, Adea's token layer, custom accent validation,
12
- * the translucent surface capability, and the user reduced-transparency
13
- * policy Zeron lacks. See NOTICE and docs/research/dev-view-donor-audit.md.
14
- *
15
- * This module is the declared token layer for the built-in theme palette
16
- * data: the color string literals below are the theme itself, exactly like
17
- * the declarations in `styles/theme.css` (see
18
- * `scripts/check-theme-colors.mjs`).
19
- */
20
-
21
- /**
22
- * The versioned client appearance preference (Dev Runtime spec,
23
- * "Appearance and App Library"). Stored as one JSON document; the legacy
24
- * single `theme` key migrates into it without deleting the old value.
25
- */
26
- export type AppearancePreferencesV2 = Readonly<{
27
- version: 2
28
- mode: AppearanceMode
29
- lightThemeId: string
30
- darkThemeId: string
31
- /** `'theme'`, a built-in preset id, or a validated `#rrggbb` color. */
32
- accent: 'theme' | string
33
- surface: 'opaque' | 'frosted' | 'translucent'
34
- reduceTransparency: boolean
35
- }>
36
-
37
- export type AppearanceMode = 'system' | 'light' | 'dark'
38
- export type ResolvedAppearance = 'light' | 'dark'
39
- export type SurfacePreference = 'opaque' | 'frosted' | 'translucent'
40
-
41
- export const APPEARANCE_STORAGE_KEY = 'appearance'
42
- /** The pre-#425 key. Migration reads it and never deletes it. */
43
- export const LEGACY_THEME_STORAGE_KEY = 'theme'
44
- /**
45
- * Recovery envelope for unread preference documents (Dev Runtime spec,
46
- * "Compatibility, migrations, and waivers": a failed migration retains the
47
- * original record; it never silently rewrites or deletes the input). A
48
- * malformed or future-version document is quarantined here — before any
49
- * write can touch the main key — so saving valid preferences later can never
50
- * destroy the user's unread data.
51
- */
52
- export const APPEARANCE_RECOVERY_STORAGE_KEY = 'appearance.recovery'
53
-
54
- export type AppearanceRecoveryEnvelope = Readonly<{
55
- schemaVersion: 1
56
- reason: 'corrupt_json' | 'unsupported_record'
57
- capturedAt: string
58
- raw: string
59
- }>
60
-
61
- export const DARK_QUERY = '(prefers-color-scheme: dark)'
62
- export const REDUCED_TRANSPARENCY_QUERY = '(prefers-reduced-transparency: reduce)'
63
-
64
- export const defaultAppearancePreferences: AppearancePreferencesV2 = Object.freeze({
65
- version: 2,
66
- mode: 'system',
67
- lightThemeId: 'adea-light',
68
- darkThemeId: 'adea-dark',
69
- accent: 'theme',
70
- surface: 'opaque',
71
- reduceTransparency: false,
72
- })
73
-
74
- /**
75
- * Combine the user's choice with the OS state. A pinned mode ignores the OS;
76
- * `system` follows it. (Zeron `resolve`.)
77
- */
78
- export function resolveAppearanceMode(
79
- mode: AppearanceMode,
80
- system: ResolvedAppearance
81
- ): ResolvedAppearance {
82
- if (mode === 'system') return system
83
- return mode
84
- }
85
-
86
- /*
87
- * Color math — Zeron `Color`, translated. Values are `#rgb`, `#rgba`,
88
- * `#rrggbb`, or `#rrggbbaa` strings.
89
- */
90
-
91
- export type RgbColor = Readonly<{ r: number; g: number; b: number; a: number }>
92
-
93
- export class ColorParseError extends Error {
94
- constructor() {
95
- super('expected a CSS hex color (#rgb, #rgba, #rrggbb, or #rrggbbaa)')
96
- this.name = 'ColorParseError'
97
- }
98
- }
99
-
100
- const NIBBLES: Record<string, number> = {
101
- '0': 0,
102
- '1': 1,
103
- '2': 2,
104
- '3': 3,
105
- '4': 4,
106
- '5': 5,
107
- '6': 6,
108
- '7': 7,
109
- '8': 8,
110
- '9': 9,
111
- a: 10,
112
- b: 11,
113
- c: 12,
114
- d: 13,
115
- e: 14,
116
- f: 15,
117
- A: 10,
118
- B: 11,
119
- C: 12,
120
- D: 13,
121
- E: 14,
122
- F: 15,
123
- }
124
-
125
- function expandNibble(nibble: number): number {
126
- return (nibble << 4) | nibble
127
- }
128
-
129
- function parseByte(high: number, low: number): number {
130
- return (high << 4) | low
131
- }
132
-
133
- /** Parse a hex color. Returns `undefined` for anything unsupported. */
134
- export function parseColor(value: string): RgbColor | undefined {
135
- const trimmed = value.trim()
136
- if (!trimmed.startsWith('#')) return undefined
137
- const bytes = trimmed.slice(1)
138
- if (bytes.length === 3 || bytes.length === 4) {
139
- const nibbles: number[] = []
140
- for (const character of bytes) {
141
- const nibble = NIBBLES[character]
142
- if (nibble === undefined) return undefined
143
- nibbles.push(nibble)
144
- }
145
- return {
146
- r: expandNibble(nibbles[0]!),
147
- g: expandNibble(nibbles[1]!),
148
- b: expandNibble(nibbles[2]!),
149
- a: nibbles.length === 4 ? expandNibble(nibbles[3]!) : 255,
150
- }
151
- }
152
- if (bytes.length === 6 || bytes.length === 8) {
153
- const nibbles: number[] = []
154
- for (const character of bytes) {
155
- const nibble = NIBBLES[character]
156
- if (nibble === undefined) return undefined
157
- nibbles.push(nibble)
158
- }
159
- const pair = (index: number) => parseByte(nibbles[index]!, nibbles[index + 1]!)
160
- return {
161
- r: pair(0),
162
- g: pair(2),
163
- b: pair(4),
164
- a: nibbles.length === 8 ? pair(6) : 255,
165
- }
166
- }
167
- return undefined
168
- }
169
-
170
- function toHexByte(value: number): string {
171
- return value.toString(16).padStart(2, '0')
172
- }
173
-
174
- export function colorToHex(color: RgbColor): string {
175
- if (color.a === 255) return `#${toHexByte(color.r)}${toHexByte(color.g)}${toHexByte(color.b)}`
176
- return `#${toHexByte(color.r)}${toHexByte(color.g)}${toHexByte(color.b)}${toHexByte(color.a)}`
177
- }
178
-
179
- function blendOver(foreground: RgbColor, background: RgbColor): RgbColor {
180
- const alpha = foreground.a / 255
181
- const blend = (front: number, back: number) => Math.round(front * alpha + back * (1 - alpha))
182
- return {
183
- r: blend(foreground.r, background.r),
184
- g: blend(foreground.g, background.g),
185
- b: blend(foreground.b, background.b),
186
- a: 255,
187
- }
188
- }
189
-
190
- function mixColors(left: RgbColor, right: RgbColor, amount: number): RgbColor {
191
- const clamped = Math.min(1, Math.max(0, amount))
192
- const mix = (a: number, b: number) => Math.round(a + (b - a) * clamped)
193
- return { r: mix(left.r, right.r), g: mix(left.g, right.g), b: mix(left.b, right.b), a: 255 }
194
- }
195
-
196
- function linearChannel(channel: number): number {
197
- const value = channel / 255
198
- return value <= 0.04045 ? value / 12.92 : ((value + 0.055) / 1.055) ** 2.4
199
- }
200
-
201
- function relativeLuminance(color: RgbColor): number {
202
- return (
203
- 0.2126 * linearChannel(color.r) +
204
- 0.7152 * linearChannel(color.g) +
205
- 0.0722 * linearChannel(color.b)
206
- )
207
- }
208
-
209
- /** WCAG contrast ratio between two colors. Alpha composites over the background first. */
210
- export function contrastRatio(
211
- foreground: RgbColor | string,
212
- background: RgbColor | string
213
- ): number {
214
- const front = typeof foreground === 'string' ? parseColor(foreground) : foreground
215
- const back = typeof background === 'string' ? parseColor(background) : background
216
- if (!front || !back) return 0
217
- const opaqueFront = front.a === 255 ? front : blendOver(front, back)
218
- const a = relativeLuminance(opaqueFront)
219
- const b = relativeLuminance(back)
220
- return (Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05)
221
- }
222
-
223
- function bestOnColor(color: RgbColor): RgbColor {
224
- return contrastRatio(WHITE, color) >= contrastRatio(BLACK, color) ? WHITE : BLACK
225
- }
226
-
227
- const WHITE: RgbColor = { r: 255, g: 255, b: 255, a: 255 }
228
- const BLACK: RgbColor = { r: 0, g: 0, b: 0, a: 255 }
229
-
230
- /** Move toward black or white until the requested contrast is met. (Zeron `ensure_contrast`.) */
231
- function ensureContrast(color: RgbColor, background: RgbColor, minimum: number): RgbColor {
232
- if (contrastRatio(color, background) >= minimum) return color
233
- const target =
234
- contrastRatio(BLACK, background) >= contrastRatio(WHITE, background) ? BLACK : WHITE
235
- for (let step = 1; step <= 20; step++) {
236
- const candidate = mixColors(color, target, step / 20)
237
- if (contrastRatio(candidate, background) >= minimum) return candidate
238
- }
239
- return target
240
- }
241
-
242
- /*
243
- * Accent — Zeron `AccentPreset`/`AccentSelection`/`AccentRoles` with Adea's
244
- * custom-color validation. Presets carry per-appearance values; a custom
245
- * color is normalized to the 3:1 interaction minimum instead of rejected
246
- * outright, and unparseable values fall back to the theme default.
247
- */
248
-
249
- export type AccentPreset = Readonly<{
250
- id: string
251
- label: string
252
- dark: string
253
- light: string
254
- }>
255
-
256
- export const accentPresets: readonly AccentPreset[] = Object.freeze([
257
- { id: 'violet', label: 'Violet', dark: '#a78bfa', light: '#6d28d9' },
258
- { id: 'blue', label: 'Blue', dark: '#60a5fa', light: '#2563eb' },
259
- { id: 'green', label: 'Green', dark: '#4ade80', light: '#15803d' },
260
- { id: 'amber', label: 'Amber', dark: '#fbbf24', light: '#b45309' },
261
- { id: 'cyan', label: 'Cyan', dark: '#22d3ee', light: '#0e7490' },
262
- { id: 'pink', label: 'Pink', dark: '#f472b6', light: '#be185d' },
263
- ])
264
-
265
- /**
266
- * Normalize a custom accent color against a variant background: unparseable
267
- * input is rejected (`undefined`), and any accepted color is raised to the
268
- * 3:1 interaction minimum so an accent can never ship unreadable.
269
- */
270
- export function normalizeAccentValue(value: string, background: string): string | undefined {
271
- const parsed = parseColor(value)
272
- if (!parsed) return undefined
273
- const backdrop = parseColor(background) ?? WHITE
274
- return colorToHex(ensureContrast(parsed, backdrop, 3))
275
- }
276
-
277
- export function accentPresetById(id: string): AccentPreset | undefined {
278
- return accentPresets.find((preset) => preset.id === id)
279
- }
280
-
281
- export type AccentRoles = Readonly<{
282
- /** Interactive primary. */
283
- primary: string
284
- /** Text drawn on `primary`-filled controls; ≥ 4.5:1 against it. */
285
- onPrimary: string
286
- /** Hover/press emphasis derived from the primary. */
287
- strong: string
288
- /** Focus ring color. */
289
- ring: string
290
- /** False when the selection is the variant's own accent and no role should be overridden. */
291
- overrides: boolean
292
- }>
293
-
294
- /**
295
- * Derive the accent roles for a selection against a variant. `'theme'` keeps
296
- * the variant's own accent; presets and custom colors are normalized to the
297
- * 3:1 interaction minimum (Zeron `AccentRoles::derive`, thresholds preserved).
298
- */
299
- export function deriveAccentRoles(selection: string, variant: ThemeVariant): AccentRoles {
300
- const background = variant.colors.background
301
- let primary = variant.colors.primary
302
- let overrides = false
303
- if (selection !== 'theme') {
304
- const preset = accentPresetById(selection)
305
- const requested = preset
306
- ? parseColor(variant.appearance === 'dark' ? preset.dark : preset.light)
307
- : parseColor(selection)
308
- if (requested) {
309
- primary = colorToHex(ensureContrast(requested, parseColor(background)!, 3))
310
- overrides = true
311
- }
312
- }
313
- const primaryRgb = parseColor(primary)!
314
- const onPrimary = colorToHex(bestOnColor(primaryRgb))
315
- let strong = primary
316
- if (contrastRatio(onPrimary, strong) < 4.5) {
317
- strong = colorToHex(ensureContrast(primaryRgb, parseColor(onPrimary)!, 4.5))
318
- }
319
- return { primary, onPrimary, strong, ring: strong, overrides }
320
- }
321
-
322
- /*
323
- * Surface — Zeron `SurfacePreference.resolve` extended with Adea's
324
- * translucent capability gate and the reduced-transparency policy: the OS
325
- * setting or the user preference forces an accessible opaque fallback, and a
326
- * translucent request on a host without native translucency renders the
327
- * tokenized frosted surface instead of pretending to OS vibrancy.
328
- */
329
- export type EffectiveSurface = 'opaque' | 'frosted' | 'translucent'
330
-
331
- export function resolveSurface(
332
- preference: SurfacePreference,
333
- environment: Readonly<{
334
- osReducedTransparency: boolean
335
- userReducedTransparency: boolean
336
- nativeTranslucency: boolean
337
- }>
338
- ): EffectiveSurface {
339
- if (environment.osReducedTransparency || environment.userReducedTransparency) return 'opaque'
340
- if (preference === 'translucent' && !environment.nativeTranslucency) return 'frosted'
341
- return preference
342
- }
343
-
344
- /*
345
- * Theme registry — Zeron `ThemeVariant`/`ThemeRegistry`, narrowed to Adea's
346
- * semantic roles. Every runtime component consumes the CSS custom properties
347
- * declared here; terminal ANSI and editor roles come from the same manifest
348
- * so a theme switch updates them live without remounting a terminal or
349
- * editor.
350
- */
351
-
352
- export type ThemeTerminalPalette = Readonly<{
353
- background: string
354
- foreground: string
355
- cursor: string
356
- selection: string
357
- /** The 16 xterm ANSI slots, in protocol order. */
358
- ansi: readonly string[]
359
- }>
360
-
361
- export type ThemeEditorRoles = Readonly<{
362
- keyword: string
363
- string: string
364
- number: string
365
- comment: string
366
- function: string
367
- variable: string
368
- type: string
369
- tag: string
370
- attribute: string
371
- operator: string
372
- heading: string
373
- link: string
374
- diffAdd: string
375
- diffDelete: string
376
- diffHunk: string
377
- searchMatch: string
378
- }>
379
-
380
- export type ThemeChartRoles = Readonly<{
381
- chart1: string
382
- chart2: string
383
- chart3: string
384
- chart4: string
385
- chart5: string
386
- chart6: string
387
- }>
388
-
389
- export type ThemeColors = Readonly<{
390
- background: string
391
- foreground: string
392
- card: string
393
- cardForeground: string
394
- popover: string
395
- popoverForeground: string
396
- primary: string
397
- primaryForeground: string
398
- secondary: string
399
- secondaryForeground: string
400
- muted: string
401
- mutedForeground: string
402
- accent: string
403
- accentForeground: string
404
- destructive: string
405
- success: string
406
- border: string
407
- input: string
408
- ring: string
409
- }>
410
-
411
- export type ThemeVariant = Readonly<{
412
- id: string
413
- familyId: string
414
- familyName: string
415
- name: string
416
- appearance: ResolvedAppearance
417
- colors: ThemeColors
418
- terminal: ThemeTerminalPalette
419
- editor: ThemeEditorRoles
420
- charts: ThemeChartRoles
421
- }>
422
-
423
- /**
424
- * The independent per-appearance theme selection (Zeron `ThemeSelection`,
425
- * carrying the V2 preference's field names).
426
- */
427
- export type ThemeSelection = Readonly<{ lightThemeId: string; darkThemeId: string }>
428
-
429
- export function themeSelectionVariantId(
430
- selection: ThemeSelection,
431
- appearance: ResolvedAppearance
432
- ): string {
433
- return appearance === 'dark' ? selection.darkThemeId : selection.lightThemeId
434
- }
435
-
436
- export type ValidationIssue = Readonly<{
437
- variantId: string
438
- severity: 'error' | 'warning'
439
- message: string
440
- }>
441
-
442
- /**
443
- * Registry validation, ported from Zeron `ThemeRegistry::validate`: core text
444
- * and muted text must reach 4.5:1, the accent 3:1, on-accent 4.5:1, the
445
- * terminal foreground 4.5:1, and every chromatic ANSI slot 3:1 (slots 0 and 8
446
- * are structural black/dim colors). Provenance completeness is a Zeron
447
- * library concept; M12 ships only built-ins, so the structural check here is
448
- * id/non-empty-color integrity.
449
- */
450
- export function validateThemeRegistry(registry: readonly ThemeVariant[]): ValidationIssue[] {
451
- const issues: ValidationIssue[] = []
452
- const seen = new Set<string>()
453
- for (const variant of registry) {
454
- if (variant.id.trim().length === 0 || seen.has(variant.id)) {
455
- issues.push({
456
- variantId: variant.id,
457
- severity: 'error',
458
- message: 'variant id must be unique',
459
- })
460
- }
461
- seen.add(variant.id)
462
- const check = (role: string, foreground: string, background: string, minimum: number) => {
463
- const actual = contrastRatio(foreground, background)
464
- if (actual < minimum) {
465
- issues.push({
466
- variantId: variant.id,
467
- severity: 'error',
468
- message: `${role} contrast is ${actual.toFixed(2)}:1; expected ${minimum.toFixed(1)}:1`,
469
- })
470
- }
471
- }
472
- check('text', variant.colors.foreground, variant.colors.background, 4.5)
473
- check('muted text', variant.colors.mutedForeground, variant.colors.background, 4.5)
474
- check('primary', variant.colors.primary, variant.colors.background, 3)
475
- check('on-primary', variant.colors.primaryForeground, variant.colors.primary, 4.5)
476
- check('terminal foreground', variant.terminal.foreground, variant.terminal.background, 4.5)
477
- for (const [index, color] of variant.terminal.ansi.entries()) {
478
- if (index % 8 === 0) continue
479
- const actual = contrastRatio(color, variant.terminal.background)
480
- if (actual < 3) {
481
- issues.push({
482
- variantId: variant.id,
483
- severity: 'warning',
484
- message: `terminal ANSI slot ${index} is below 3:1`,
485
- })
486
- }
487
- }
488
- check('editor comment', variant.editor.comment, variant.colors.background, 4.5)
489
- check('diff delete', variant.editor.diffDelete, variant.colors.background, 3)
490
- check('diff add', variant.editor.diffAdd, variant.colors.background, 3)
491
- }
492
- return issues
493
- }
494
-
495
- /**
496
- * Resolve the variant for a selection, falling back deterministically to the
497
- * default variant of the same appearance when the stored id is missing or
498
- * broken — a corrupt preference degrades the palette, never the UI.
499
- * (Zeron `ThemeRegistry::resolve`.)
500
- */
501
- export function resolveThemeVariant(
502
- registry: readonly ThemeVariant[],
503
- selection: ThemeSelection,
504
- appearance: ResolvedAppearance
505
- ): ThemeVariant {
506
- const wanted = themeSelectionVariantId(selection, appearance)
507
- const found = registry.find((variant) => variant.id === wanted)
508
- if (found) return found
509
- const fallbackId =
510
- appearance === 'dark'
511
- ? defaultAppearancePreferences.darkThemeId
512
- : defaultAppearancePreferences.lightThemeId
513
- const fallback = registry.find((variant) => variant.id === fallbackId)
514
- if (fallback) return fallback
515
- const sameAppearance = registry.find((variant) => variant.appearance === appearance)
516
- if (sameAppearance) return sameAppearance
517
- return registry[0]!
518
- }
519
-
520
- /*
521
- * Built-in registry — Adea's curated M12 set. `adea-light`/`adea-dark` mirror
522
- * the token declarations in `styles/theme.css` (which stay authoritative for
523
- * the defaults so first paint never shifts); `slate` is a cool quiet pair and
524
- * `contrast` an AA-emphasized pair. Terminal/editor/charts ship one curated
525
- * template per appearance so every variant keeps ANSI/syntax/diff legibility.
526
- */
527
-
528
- const lightTerminal: ThemeTerminalPalette = Object.freeze({
529
- background: '#ffffff',
530
- foreground: '#1b1f24',
531
- cursor: '#24292f',
532
- selection: '#b6c7ff',
533
- ansi: Object.freeze([
534
- '#1b1f24',
535
- '#b91c1c',
536
- '#116a2e',
537
- '#8a5a1b',
538
- '#0b57d0',
539
- '#a0186f',
540
- '#0e7490',
541
- '#57606a',
542
- '#57606a',
543
- '#c94d4d',
544
- '#1f9d4f',
545
- '#a9752c',
546
- '#3b82f6',
547
- '#c04a92',
548
- '#0891b2',
549
- '#24292f',
550
- ]),
551
- })
552
-
553
- const darkTerminal: ThemeTerminalPalette = Object.freeze({
554
- background: '#0d1117',
555
- foreground: '#e6edf3',
556
- cursor: '#e6edf3',
557
- selection: '#264f78',
558
- ansi: Object.freeze([
559
- '#2f3742',
560
- '#ff8183',
561
- '#56d364',
562
- '#e3b341',
563
- '#6ca4f8',
564
- '#db61a2',
565
- '#39c5cf',
566
- '#d5dde5',
567
- '#57606a',
568
- '#ff9494',
569
- '#79dd8a',
570
- '#f0c264',
571
- '#8db9ff',
572
- '#e87cb4',
573
- '#66d3dc',
574
- '#eef2f6',
575
- ]),
576
- })
577
-
578
- const lightEditor: ThemeEditorRoles = Object.freeze({
579
- keyword: '#0b57d0',
580
- string: '#116a2e',
581
- number: '#8a5a1b',
582
- comment: '#57606a',
583
- function: '#a0186f',
584
- variable: '#1b1f24',
585
- type: '#0e7490',
586
- tag: '#b91c1c',
587
- attribute: '#8a5a1b',
588
- operator: '#1b1f24',
589
- heading: '#1b1f24',
590
- link: '#0b57d0',
591
- diffAdd: '#116a2e',
592
- diffDelete: '#b91c1c',
593
- diffHunk: '#57606a',
594
- searchMatch: '#8a5a1b',
595
- })
596
-
597
- const darkEditor: ThemeEditorRoles = Object.freeze({
598
- keyword: '#6ca4f8',
599
- string: '#56d364',
600
- number: '#e3b341',
601
- comment: '#8b949e',
602
- function: '#db61a2',
603
- variable: '#e6edf3',
604
- type: '#39c5cf',
605
- tag: '#ff8183',
606
- attribute: '#e3b341',
607
- operator: '#e6edf3',
608
- heading: '#e6edf3',
609
- link: '#6ca4f8',
610
- diffAdd: '#56d364',
611
- diffDelete: '#ff8183',
612
- diffHunk: '#8b949e',
613
- searchMatch: '#e3b341',
614
- })
615
-
616
- const lightCharts: ThemeChartRoles = Object.freeze({
617
- chart1: '#0b57d0',
618
- chart2: '#116a2e',
619
- chart3: '#8a5a1b',
620
- chart4: '#a0186f',
621
- chart5: '#0e7490',
622
- chart6: '#57606a',
623
- })
624
-
625
- const darkCharts: ThemeChartRoles = Object.freeze({
626
- chart1: '#6ca4f8',
627
- chart2: '#56d364',
628
- chart3: '#e3b341',
629
- chart4: '#db61a2',
630
- chart5: '#39c5cf',
631
- chart6: '#8b949e',
632
- })
633
-
634
- function defineVariant(
635
- id: string,
636
- familyId: string,
637
- familyName: string,
638
- name: string,
639
- appearance: ResolvedAppearance,
640
- colors: ThemeColors
641
- ): ThemeVariant {
642
- const light = appearance === 'light'
643
- return {
644
- id,
645
- familyId,
646
- familyName,
647
- name,
648
- appearance,
649
- colors,
650
- terminal: light ? lightTerminal : darkTerminal,
651
- editor: light ? lightEditor : darkEditor,
652
- charts: light ? lightCharts : darkCharts,
653
- }
654
- }
655
-
656
- /** The `adea-light`/`adea-dark` entries mirror `styles/theme.css`. */
657
- export const builtinThemeRegistry: readonly ThemeVariant[] = Object.freeze([
658
- defineVariant('adea-light', 'adea', 'Adea', 'Adea Light', 'light', {
659
- background: '#ffffff',
660
- foreground: '#252525',
661
- card: '#ffffff',
662
- cardForeground: '#252525',
663
- popover: '#ffffff',
664
- popoverForeground: '#252525',
665
- primary: '#343434',
666
- primaryForeground: '#fcfcfc',
667
- secondary: '#f7f7f7',
668
- secondaryForeground: '#343434',
669
- muted: '#f7f7f7',
670
- mutedForeground: '#6f6f6f',
671
- accent: '#f7f7f7',
672
- accentForeground: '#343434',
673
- destructive: '#c53c2b',
674
- success: '#1a7f37',
675
- border: '#ebebeb',
676
- input: '#ebebeb',
677
- ring: '#a3a3a3',
678
- }),
679
- defineVariant('adea-dark', 'adea', 'Adea', 'Adea Dark', 'dark', {
680
- background: '#252525',
681
- foreground: '#fcfcfc',
682
- card: '#343434',
683
- cardForeground: '#fcfcfc',
684
- popover: '#343434',
685
- popoverForeground: '#fcfcfc',
686
- primary: '#ebebeb',
687
- primaryForeground: '#343434',
688
- secondary: '#444444',
689
- secondaryForeground: '#fcfcfc',
690
- muted: '#444444',
691
- mutedForeground: '#a3a3a3',
692
- accent: '#444444',
693
- accentForeground: '#fcfcfc',
694
- destructive: '#e07060',
695
- success: '#3fb950',
696
- border: 'rgba(255, 255, 255, 0.16)',
697
- input: 'rgba(255, 255, 255, 0.2)',
698
- ring: '#7c7c7c',
699
- }),
700
- defineVariant('slate-light', 'slate', 'Slate', 'Slate Light', 'light', {
701
- background: '#f8fafc',
702
- foreground: '#0f172a',
703
- card: '#ffffff',
704
- cardForeground: '#0f172a',
705
- popover: '#ffffff',
706
- popoverForeground: '#0f172a',
707
- primary: '#0f172a',
708
- primaryForeground: '#f8fafc',
709
- secondary: '#e2e8f0',
710
- secondaryForeground: '#0f172a',
711
- muted: '#e2e8f0',
712
- mutedForeground: '#475569',
713
- accent: '#e2e8f0',
714
- accentForeground: '#0f172a',
715
- destructive: '#b91c1c',
716
- success: '#15803d',
717
- border: '#cbd5e1',
718
- input: '#cbd5e1',
719
- ring: '#64748b',
720
- }),
721
- defineVariant('slate-dark', 'slate', 'Slate', 'Slate Dark', 'dark', {
722
- background: '#0f172a',
723
- foreground: '#f1f5f9',
724
- card: '#1e293b',
725
- cardForeground: '#f1f5f9',
726
- popover: '#1e293b',
727
- popoverForeground: '#f1f5f9',
728
- primary: '#e2e8f0',
729
- primaryForeground: '#0f172a',
730
- secondary: '#334155',
731
- secondaryForeground: '#f1f5f9',
732
- muted: '#334155',
733
- mutedForeground: '#94a3b8',
734
- accent: '#334155',
735
- accentForeground: '#f1f5f9',
736
- destructive: '#f87171',
737
- success: '#4ade80',
738
- border: 'rgba(148, 163, 184, 0.2)',
739
- input: 'rgba(148, 163, 184, 0.25)',
740
- ring: '#64748b',
741
- }),
742
- defineVariant('contrast-light', 'contrast', 'High Contrast', 'High Contrast Light', 'light', {
743
- background: '#ffffff',
744
- foreground: '#000000',
745
- card: '#ffffff',
746
- cardForeground: '#000000',
747
- popover: '#ffffff',
748
- popoverForeground: '#000000',
749
- primary: '#143d8f',
750
- primaryForeground: '#ffffff',
751
- secondary: '#f0f0f0',
752
- secondaryForeground: '#000000',
753
- muted: '#f0f0f0',
754
- mutedForeground: '#333333',
755
- accent: '#f0f0f0',
756
- accentForeground: '#000000',
757
- destructive: '#b91c1c',
758
- success: '#14532d',
759
- border: '#767676',
760
- input: '#767676',
761
- ring: '#000000',
762
- }),
763
- defineVariant('contrast-dark', 'contrast', 'High Contrast', 'High Contrast Dark', 'dark', {
764
- background: '#000000',
765
- foreground: '#ffffff',
766
- card: '#0a0a0a',
767
- cardForeground: '#ffffff',
768
- popover: '#0a0a0a',
769
- popoverForeground: '#ffffff',
770
- primary: '#8ab4ff',
771
- primaryForeground: '#000000',
772
- secondary: '#1a1a1a',
773
- secondaryForeground: '#ffffff',
774
- muted: '#1a1a1a',
775
- mutedForeground: '#e5e5e5',
776
- accent: '#1a1a1a',
777
- accentForeground: '#ffffff',
778
- destructive: '#ff6b6b',
779
- success: '#4ade80',
780
- border: '#8f8f8f',
781
- input: '#8f8f8f',
782
- ring: '#ffffff',
783
- }),
784
- ])
785
-
786
- /*
787
- * Preference storage: normalization, legacy migration, corrupt retention.
788
- */
789
-
790
- function normalizeMode(value: unknown): AppearanceMode {
791
- return value === 'light' || value === 'dark' || value === 'system' ? value : 'system'
792
- }
793
-
794
- function normalizeSurface(value: unknown): SurfacePreference {
795
- return value === 'frosted' || value === 'translucent' || value === 'opaque' ? value : 'opaque'
796
- }
797
-
798
- function normalizeThemeId(value: unknown, fallback: string): string {
799
- return typeof value === 'string' && value.trim().length > 0 ? value : fallback
800
- }
801
-
802
- function normalizeAccent(value: unknown): string {
803
- if (value === 'theme') return 'theme'
804
- if (typeof value !== 'string') return 'theme'
805
- if (accentPresetById(value)) return value
806
- const parsed = parseColor(value)
807
- return parsed ? colorToHex(parsed) : 'theme'
808
- }
809
-
810
- export type NormalizedPreferences = Readonly<{
811
- /** The strict v2 document, with every unknown field corrected to defaults. */
812
- value: AppearancePreferencesV2
813
- /**
814
- * The raw stored document when it was not a valid v2 record. Retained so a
815
- * future version (or a repaired write) never loses the user's data.
816
- */
817
- retainedRaw?: unknown
818
- }>
819
-
820
- /**
821
- * Parse a stored appearance document. Anything that is not a strict version-2
822
- * record falls back to the defaults and keeps the raw value for retention;
823
- * individual unknown values inside a v2 record are corrected field by field.
824
- */
825
- export function normalizeAppearancePreferences(raw: unknown): NormalizedPreferences {
826
- if (typeof raw !== 'object' || raw === null || (raw as { version?: unknown }).version !== 2) {
827
- return { value: defaultAppearancePreferences, retainedRaw: raw }
828
- }
829
- const record = raw as Record<string, unknown>
830
- return {
831
- value: {
832
- version: 2,
833
- mode: normalizeMode(record.mode),
834
- lightThemeId: normalizeThemeId(
835
- record.lightThemeId,
836
- defaultAppearancePreferences.lightThemeId
837
- ),
838
- darkThemeId: normalizeThemeId(record.darkThemeId, defaultAppearancePreferences.darkThemeId),
839
- accent: normalizeAccent(record.accent),
840
- surface: normalizeSurface(record.surface),
841
- reduceTransparency: record.reduceTransparency === true,
842
- },
843
- }
844
- }
845
-
846
- /** The legacy single-key preference, mapped into v2 during migration. */
847
- export function migrateLegacyThemeValue(
848
- stored: string | null
849
- ): AppearancePreferencesV2 | undefined {
850
- if (stored !== 'light' && stored !== 'dark' && stored !== 'system') return undefined
851
- return { ...defaultAppearancePreferences, mode: stored }
852
- }
853
-
854
- type AppearanceStorage = Pick<Storage, 'getItem' | 'setItem' | 'removeItem'>
855
-
856
- /**
857
- * Quarantine an unread raw document into the recovery envelope. Runs at read
858
- * time — before any later write can overwrite the main key — and is
859
- * idempotent: re-reading the same unread value refreshes the capture without
860
- * losing it.
861
- */
862
- function retainRecoveryEnvelope(
863
- storage: AppearanceStorage,
864
- raw: string,
865
- reason: AppearanceRecoveryEnvelope['reason']
866
- ): void {
867
- try {
868
- const envelope: AppearanceRecoveryEnvelope = {
869
- schemaVersion: 1,
870
- reason,
871
- capturedAt: new Date().toISOString(),
872
- raw,
873
- }
874
- storage.setItem(APPEARANCE_RECOVERY_STORAGE_KEY, JSON.stringify(envelope))
875
- } catch {
876
- // Quarantine is best-effort; the active preference still fails closed.
877
- }
878
- }
879
-
880
- /**
881
- * Read the appearance preferences: the v2 key first, then the legacy `theme`
882
- * key, then defaults. A malformed or future-version document is quarantined
883
- * into the recovery envelope and the defaults are returned; storage failures
884
- * degrade to defaults like every other blocked-storage consumer.
885
- */
886
- export function readAppearancePreferences(
887
- storage: AppearanceStorage | undefined
888
- ): AppearancePreferencesV2 {
889
- if (!storage) return defaultAppearancePreferences
890
- try {
891
- const raw = storage.getItem(APPEARANCE_STORAGE_KEY)
892
- if (raw !== null) {
893
- let parsed: unknown
894
- try {
895
- parsed = JSON.parse(raw)
896
- } catch {
897
- retainRecoveryEnvelope(storage, raw, 'corrupt_json')
898
- return defaultAppearancePreferences
899
- }
900
- const normalized = normalizeAppearancePreferences(parsed)
901
- if (normalized.retainedRaw !== undefined) {
902
- retainRecoveryEnvelope(
903
- storage,
904
- raw,
905
- typeof parsed === 'object' && parsed !== null ? 'unsupported_record' : 'corrupt_json'
906
- )
907
- }
908
- return normalized.value
909
- }
910
- return (
911
- migrateLegacyThemeValue(storage.getItem(LEGACY_THEME_STORAGE_KEY)) ??
912
- defaultAppearancePreferences
913
- )
914
- } catch {
915
- return defaultAppearancePreferences
916
- }
917
- }
918
-
919
- export function writeAppearancePreferences(
920
- storage: AppearanceStorage | undefined,
921
- preferences: AppearancePreferencesV2
922
- ): void {
923
- if (!storage) return
924
- try {
925
- storage.setItem(APPEARANCE_STORAGE_KEY, JSON.stringify(preferences))
926
- } catch {
927
- // Persistence is best-effort: private modes and full quotas keep the
928
- // in-memory preference.
929
- }
930
- }
931
-
932
- /*
933
- * Document application. Both the provider and the no-flash inline script
934
- * resolve preferences to the same document shape, so a pre-paint restore and
935
- * a live change cannot disagree.
936
- */
937
-
938
- export type ResolvedAppearanceState = Readonly<{
939
- resolvedMode: ResolvedAppearance
940
- variant: ThemeVariant
941
- accent: AccentRoles
942
- effectiveSurface: EffectiveSurface
943
- reduceTransparencyActive: boolean
944
- }>
945
-
946
- /** Resolve preferences against the environment into the applied document state. */
947
- export function resolveAppearanceState(
948
- preferences: AppearancePreferencesV2,
949
- environment: Readonly<{
950
- systemAppearance: ResolvedAppearance
951
- osReducedTransparency: boolean
952
- nativeTranslucency: boolean
953
- }>,
954
- registry: readonly ThemeVariant[] = builtinThemeRegistry
955
- ): ResolvedAppearanceState {
956
- const resolvedMode = resolveAppearanceMode(preferences.mode, environment.systemAppearance)
957
- const variant = resolveThemeVariant(registry, preferences, resolvedMode)
958
- return {
959
- resolvedMode,
960
- variant,
961
- accent: deriveAccentRoles(preferences.accent, variant),
962
- effectiveSurface: resolveSurface(preferences.surface, {
963
- osReducedTransparency: environment.osReducedTransparency,
964
- userReducedTransparency: preferences.reduceTransparency,
965
- nativeTranslucency: environment.nativeTranslucency,
966
- }),
967
- reduceTransparencyActive: environment.osReducedTransparency || preferences.reduceTransparency,
968
- }
969
- }
970
-
971
- const SURFACE_BACKGROUND_ALPHA: Record<EffectiveSurface, string> = {
972
- opaque: '1',
973
- frosted: '0.92',
974
- translucent: '0.8',
975
- }
976
-
977
- /**
978
- * The custom properties a non-default variant owns, as a flat map. This one
979
- * mapping feeds both the live provider and the pre-paint no-flash script, so
980
- * a restored first paint and a later live switch cannot disagree. Default
981
- * variants return an empty map: `styles/theme.css` declares those tokens.
982
- */
983
- export function flatVariantTokens(variant: ThemeVariant): Record<string, string> {
984
- if (isDefaultVariant(variant)) return {}
985
- const tokens: Record<string, string> = {}
986
- for (const [role, value] of Object.entries(variant.colors)) {
987
- tokens[`--${kebabCase(role)}`] = value
988
- }
989
- const terminal = variant.terminal
990
- tokens['--terminal-background'] = terminal.background
991
- tokens['--terminal-foreground'] = terminal.foreground
992
- tokens['--terminal-cursor'] = terminal.cursor
993
- tokens['--terminal-selection'] = terminal.selection
994
- const ansiNames = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white']
995
- for (const [index, color] of terminal.ansi.entries()) {
996
- const name = ansiNames[index % 8]!
997
- tokens[index < 8 ? `--terminal-ansi-${name}` : `--terminal-ansi-bright-${name}`] = color
998
- }
999
- for (const [role, value] of Object.entries(variant.editor)) {
1000
- tokens[`--editor-${kebabCase(role)}`] = value
1001
- }
1002
- for (const [index, value] of Object.values(variant.charts).entries()) {
1003
- tokens[`--chart-${index + 1}`] = value
1004
- }
1005
- return tokens
1006
- }
1007
-
1008
- /**
1009
- * Apply a resolved state to a document: the `dark` class and color scheme for
1010
- * the palette, the diagnostic data attributes, the accent role overrides, and
1011
- * the resolved variant's semantic tokens (including terminal ANSI and editor
1012
- * roles). CSS custom properties cascade, so terminals and editors update live
1013
- * without remounting.
1014
- *
1015
- * The default `adea-light`/`adea-dark` variants skip the palette override —
1016
- * `styles/theme.css` declares those tokens already, and leaving them CSS-owned
1017
- * keeps first paint byte-identical to the pre-#425 app.
1018
- */
1019
- export function applyAppearanceToDocument(
1020
- document: Document,
1021
- state: ResolvedAppearanceState
1022
- ): void {
1023
- const root = document.documentElement
1024
- const style = root.style
1025
-
1026
- root.classList.toggle('dark', state.resolvedMode === 'dark')
1027
- style.colorScheme = state.resolvedMode
1028
- root.dataset.theme = state.variant.id
1029
- root.dataset.appearanceMode = state.resolvedMode
1030
- root.dataset.surface = state.effectiveSurface
1031
- root.dataset.accent = state.accent.overrides ? 'custom' : 'theme'
1032
- root.dataset.reduceTransparency = state.reduceTransparencyActive ? 'true' : 'false'
1033
-
1034
- const setToken = (name: string, value: string) => style.setProperty(name, value)
1035
- setToken('--surface-alpha', SURFACE_BACKGROUND_ALPHA[state.effectiveSurface])
1036
- // `theme` keeps every interactive role CSS-owned; an override touches only
1037
- // the accent roles, never the surface or text palette. Returning to
1038
- // `theme` must also *remove* a previous override's inline properties — they
1039
- // beat the stylesheet, so leaving them behind made "Theme default" look like
1040
- // a dead button after any preset or custom accent had been used.
1041
- if (state.accent.overrides) {
1042
- setToken('--primary', state.accent.primary)
1043
- setToken('--primary-foreground', state.accent.onPrimary)
1044
- setToken('--ring', state.accent.ring)
1045
- } else {
1046
- style.removeProperty('--primary')
1047
- style.removeProperty('--primary-foreground')
1048
- style.removeProperty('--ring')
1049
- }
1050
- for (const [name, value] of Object.entries(flatVariantTokens(state.variant))) {
1051
- setToken(name, value)
1052
- }
1053
- }
1054
-
1055
- /**
1056
- * The no-flash preload script rendered in the document head. It re-resolves
1057
- * the stored (or legacy) preference against the OS before first paint and
1058
- * applies the same palette state the provider would, so hydration never shows
1059
- * the wrong palette. Accent overrides land with the provider: they decorate
1060
- * the resolved palette and cannot produce a wrong-palette flash.
1061
- */
1062
- export function appearanceThemeScript(): string {
1063
- const preload = builtinThemeRegistry.map((variant) => ({
1064
- id: variant.id,
1065
- dark: variant.appearance === 'dark',
1066
- tokens: flatVariantTokens(variant),
1067
- }))
1068
- const registry = JSON.stringify(preload)
1069
- const alpha = JSON.stringify(SURFACE_BACKGROUND_ALPHA)
1070
- return `(function(){try{
1071
- var prefs=null;var raw=null;
1072
- try{raw=localStorage.getItem('${APPEARANCE_STORAGE_KEY}')}catch(e){}
1073
- if(raw){try{var parsed=JSON.parse(raw);if(parsed&&parsed.version===2)prefs=parsed}catch(e){}}
1074
- var mode='system';
1075
- if(prefs){if(prefs.mode==='light'||prefs.mode==='dark')mode=prefs.mode}
1076
- else{try{var t=localStorage.getItem('${LEGACY_THEME_STORAGE_KEY}');if(t==='light'||t==='dark')mode=t}catch(e){}}
1077
- var dark=mode==='dark'||(mode==='system'&&window.matchMedia('${DARK_QUERY}').matches);
1078
- var registry=${registry};
1079
- var wanted=dark?(prefs&&prefs.darkThemeId)||'${defaultAppearancePreferences.darkThemeId}':(prefs&&prefs.lightThemeId)||'${defaultAppearancePreferences.lightThemeId}';
1080
- var variant=null;
1081
- for(var i=0;i<registry.length;i++){if(registry[i].id===wanted)variant=registry[i]}
1082
- if(!variant){for(var j=0;j<registry.length;j++){if(registry[j].dark===dark)variant=registry[j]}}
1083
- if(!variant)variant=registry[0];
1084
- var reduce=window.matchMedia('${REDUCED_TRANSPARENCY_QUERY}').matches||!!(prefs&&prefs.reduceTransparency);
1085
- /* Pre-hydration the host translucency capability is unknown, so the script
1086
- resolves every glass request to the conservative frosted tokens; the
1087
- provider re-resolves with the real capability once mounted. */
1088
- var surface=reduce?'opaque':(prefs&&prefs.surface==='frosted'||prefs&&prefs.surface==='translucent'?'frosted':'opaque');
1089
- if(surface!=='opaque'&&surface!=='frosted')surface='opaque';
1090
- var r=document.documentElement,s=r.style;
1091
- r.classList.toggle('dark',dark);
1092
- s.colorScheme=dark?'dark':'light';
1093
- r.dataset.theme=variant.id;
1094
- r.dataset.appearanceMode=mode;
1095
- r.dataset.surface=surface;
1096
- r.dataset.reduceTransparency=reduce?'true':'false';
1097
- s.setProperty('--surface-alpha',${alpha}[surface]||'1');
1098
- var tokens=variant.tokens||{};
1099
- for(var name in tokens){s.setProperty(name,tokens[name])}
1100
- }catch(e){}})();`
1101
- }
1102
-
1103
- function isDefaultVariant(variant: ThemeVariant): boolean {
1104
- return (
1105
- variant.id === defaultAppearancePreferences.lightThemeId ||
1106
- variant.id === defaultAppearancePreferences.darkThemeId
1107
- )
1108
- }
1109
-
1110
- function kebabCase(value: string): string {
1111
- return value.replaceAll(/[A-Z]/g, (character) => `-${character.toLocaleLowerCase()}`)
1112
- }