@bridgebrew/ui 0.0.0-stage → 0.1.9

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 (411) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +39 -2
  3. package/SOURCE.md +182 -0
  4. package/dist/build.js +871 -0
  5. package/dist/theme-css.js +896 -0
  6. package/dist/themes.js +69 -0
  7. package/dist/types/build/stylesheet.d.ts +31 -0
  8. package/dist/types/components/composite/command/command.d.ts +94 -0
  9. package/dist/types/components/composite/command/index.d.ts +2 -0
  10. package/dist/types/components/composite/draft-bar/draft-bar.d.ts +12 -0
  11. package/dist/types/components/composite/draft-bar/index.d.ts +2 -0
  12. package/dist/types/components/composite/image-field/image-field.d.ts +33 -0
  13. package/dist/types/components/composite/image-field/index.d.ts +2 -0
  14. package/dist/types/components/composite/list/index.d.ts +3 -0
  15. package/dist/types/components/composite/list/list-swipe.d.ts +28 -0
  16. package/dist/types/components/composite/list/list.d.ts +95 -0
  17. package/dist/types/components/composite/picker/index.d.ts +2 -0
  18. package/dist/types/components/composite/picker/picker.d.ts +44 -0
  19. package/dist/types/components/composite/prompt-field/index.d.ts +2 -0
  20. package/dist/types/components/composite/prompt-field/prompt-field.d.ts +18 -0
  21. package/dist/types/components/composite/properties/index.d.ts +2 -0
  22. package/dist/types/components/composite/properties/properties.d.ts +24 -0
  23. package/dist/types/components/composite/snooze-menu/index.d.ts +4 -0
  24. package/dist/types/components/composite/snooze-menu/presets.d.ts +36 -0
  25. package/dist/types/components/composite/snooze-menu/snooze-menu.d.ts +27 -0
  26. package/dist/types/components/composite/tag-input/index.d.ts +2 -0
  27. package/dist/types/components/composite/tag-input/tag-input.d.ts +22 -0
  28. package/dist/types/components/composite/wizard/index.d.ts +2 -0
  29. package/dist/types/components/composite/wizard/wizard.d.ts +53 -0
  30. package/dist/types/components/core/avatar/avatar.d.ts +16 -0
  31. package/dist/types/components/core/avatar/index.d.ts +2 -0
  32. package/dist/types/components/core/badge/badge.d.ts +8 -0
  33. package/dist/types/components/core/badge/index.d.ts +2 -0
  34. package/dist/types/components/core/breadcrumb/breadcrumb.d.ts +21 -0
  35. package/dist/types/components/core/breadcrumb/index.d.ts +2 -0
  36. package/dist/types/components/core/bullets/bullets.d.ts +15 -0
  37. package/dist/types/components/core/bullets/index.d.ts +2 -0
  38. package/dist/types/components/core/button/button.d.ts +14 -0
  39. package/dist/types/components/core/button/index.d.ts +2 -0
  40. package/dist/types/components/core/card/card.d.ts +16 -0
  41. package/dist/types/components/core/card/index.d.ts +2 -0
  42. package/dist/types/components/core/checkbox/checkbox.d.ts +15 -0
  43. package/dist/types/components/core/checkbox/index.d.ts +2 -0
  44. package/dist/types/components/core/cluster/cluster.d.ts +5 -0
  45. package/dist/types/components/core/cluster/index.d.ts +1 -0
  46. package/dist/types/components/core/code-block/code-block.d.ts +18 -0
  47. package/dist/types/components/core/code-block/index.d.ts +2 -0
  48. package/dist/types/components/core/collapsible/collapsible.d.ts +8 -0
  49. package/dist/types/components/core/collapsible/index.d.ts +1 -0
  50. package/dist/types/components/core/colour-picker/colour-picker.d.ts +25 -0
  51. package/dist/types/components/core/colour-picker/index.d.ts +4 -0
  52. package/dist/types/components/core/combobox/combobox.d.ts +63 -0
  53. package/dist/types/components/core/combobox/index.d.ts +2 -0
  54. package/dist/types/components/core/detail/detail.d.ts +12 -0
  55. package/dist/types/components/core/detail/index.d.ts +1 -0
  56. package/dist/types/components/core/dialog/dialog.d.ts +43 -0
  57. package/dist/types/components/core/dialog/drag.d.ts +4 -0
  58. package/dist/types/components/core/dialog/index.d.ts +2 -0
  59. package/dist/types/components/core/drop-zone/drop-zone.d.ts +23 -0
  60. package/dist/types/components/core/drop-zone/index.d.ts +2 -0
  61. package/dist/types/components/core/dropdown-menu/dropdown-menu.d.ts +78 -0
  62. package/dist/types/components/core/dropdown-menu/index.d.ts +2 -0
  63. package/dist/types/components/core/editable-field/editable-field.d.ts +42 -0
  64. package/dist/types/components/core/editable-field/index.d.ts +2 -0
  65. package/dist/types/components/core/empty-state/empty-state.d.ts +11 -0
  66. package/dist/types/components/core/empty-state/index.d.ts +2 -0
  67. package/dist/types/components/core/field/field.d.ts +31 -0
  68. package/dist/types/components/core/field/index.d.ts +2 -0
  69. package/dist/types/components/core/icon/icon-sets.d.ts +38 -0
  70. package/dist/types/components/core/icon/icon.d.ts +14 -0
  71. package/dist/types/components/core/icon/index.d.ts +2 -0
  72. package/dist/types/components/core/input/index.d.ts +4 -0
  73. package/dist/types/components/core/input/input.d.ts +22 -0
  74. package/dist/types/components/core/input/textarea.d.ts +8 -0
  75. package/dist/types/components/core/kbd/index.d.ts +2 -0
  76. package/dist/types/components/core/kbd/kbd.d.ts +7 -0
  77. package/dist/types/components/core/label/index.d.ts +2 -0
  78. package/dist/types/components/core/label/label.d.ts +13 -0
  79. package/dist/types/components/core/main-content/index.d.ts +2 -0
  80. package/dist/types/components/core/main-content/main-content.d.ts +18 -0
  81. package/dist/types/components/core/pane/index.d.ts +1 -0
  82. package/dist/types/components/core/pane/pane.d.ts +12 -0
  83. package/dist/types/components/core/pick-menu/index.d.ts +4 -0
  84. package/dist/types/components/core/pick-menu/pick-menu.d.ts +57 -0
  85. package/dist/types/components/core/pick-menu/tag-menu.d.ts +19 -0
  86. package/dist/types/components/core/popover/index.d.ts +2 -0
  87. package/dist/types/components/core/popover/popover.d.ts +22 -0
  88. package/dist/types/components/core/progress/index.d.ts +2 -0
  89. package/dist/types/components/core/progress/progress.d.ts +13 -0
  90. package/dist/types/components/core/resizable/index.d.ts +2 -0
  91. package/dist/types/components/core/resizable/resizable.d.ts +15 -0
  92. package/dist/types/components/core/resizable/use-remembered-layout.d.ts +31 -0
  93. package/dist/types/components/core/screen-link/index.d.ts +2 -0
  94. package/dist/types/components/core/screen-link/screen-link.d.ts +52 -0
  95. package/dist/types/components/core/scroll-area/index.d.ts +2 -0
  96. package/dist/types/components/core/scroll-area/scroll-area.d.ts +13 -0
  97. package/dist/types/components/core/scroll-area/steps.d.ts +5 -0
  98. package/dist/types/components/core/section/index.d.ts +2 -0
  99. package/dist/types/components/core/section/section.d.ts +16 -0
  100. package/dist/types/components/core/segment-group/index.d.ts +2 -0
  101. package/dist/types/components/core/segment-group/segment-group.d.ts +24 -0
  102. package/dist/types/components/core/select/index.d.ts +2 -0
  103. package/dist/types/components/core/select/select.d.ts +39 -0
  104. package/dist/types/components/core/skeleton/index.d.ts +2 -0
  105. package/dist/types/components/core/skeleton/skeleton.d.ts +13 -0
  106. package/dist/types/components/core/slider/index.d.ts +2 -0
  107. package/dist/types/components/core/slider/slider.d.ts +9 -0
  108. package/dist/types/components/core/sortable/index.d.ts +2 -0
  109. package/dist/types/components/core/sortable/sortable.d.ts +53 -0
  110. package/dist/types/components/core/split-view/index.d.ts +2 -0
  111. package/dist/types/components/core/split-view/split-view.d.ts +28 -0
  112. package/dist/types/components/core/status-icon/index.d.ts +2 -0
  113. package/dist/types/components/core/status-icon/status-icon.d.ts +13 -0
  114. package/dist/types/components/core/table/collapsible-rows.d.ts +7 -0
  115. package/dist/types/components/core/table/expand-toggle.d.ts +10 -0
  116. package/dist/types/components/core/table/group-header.d.ts +14 -0
  117. package/dist/types/components/core/table/index.d.ts +8 -0
  118. package/dist/types/components/core/table/table.d.ts +31 -0
  119. package/dist/types/components/core/tabs/index.d.ts +2 -0
  120. package/dist/types/components/core/tabs/tabs.d.ts +20 -0
  121. package/dist/types/components/core/tag-pill/index.d.ts +2 -0
  122. package/dist/types/components/core/tag-pill/tag-pill.d.ts +25 -0
  123. package/dist/types/components/core/thumbnail/index.d.ts +2 -0
  124. package/dist/types/components/core/thumbnail/thumbnail.d.ts +23 -0
  125. package/dist/types/components/core/toast/index.d.ts +2 -0
  126. package/dist/types/components/core/toast/toast.d.ts +88 -0
  127. package/dist/types/components/core/toggle/index.d.ts +2 -0
  128. package/dist/types/components/core/toggle/toggle.d.ts +9 -0
  129. package/dist/types/components/core/toggle-group/index.d.ts +2 -0
  130. package/dist/types/components/core/toggle-group/toggle-group.d.ts +21 -0
  131. package/dist/types/components/core/tooltip/index.d.ts +2 -0
  132. package/dist/types/components/core/tooltip/tooltip.d.ts +33 -0
  133. package/dist/types/components/layout/multi-pane/index.d.ts +4 -0
  134. package/dist/types/components/layout/multi-pane/list-detail.d.ts +17 -0
  135. package/dist/types/components/layout/multi-pane/multi-pane.d.ts +34 -0
  136. package/dist/types/components/layout/single-pane/index.d.ts +2 -0
  137. package/dist/types/components/layout/single-pane/single-pane.d.ts +11 -0
  138. package/dist/types/components/shell/app-shell/app-shell.d.ts +12 -0
  139. package/dist/types/components/shell/app-shell/index.d.ts +2 -0
  140. package/dist/types/components/shell/sidebar/index.d.ts +2 -0
  141. package/dist/types/components/shell/sidebar/sidebar-group.d.ts +45 -0
  142. package/dist/types/components/shell/sidebar/sidebar-item.d.ts +19 -0
  143. package/dist/types/components/shell/sidebar/sidebar-resize-handle.d.ts +17 -0
  144. package/dist/types/components/shell/sidebar/sidebar-tree.d.ts +42 -0
  145. package/dist/types/components/shell/sidebar/sidebar.d.ts +27 -0
  146. package/dist/types/components/template/address-book-template/address-book-template.d.ts +15 -0
  147. package/dist/types/components/template/address-book-template/index.d.ts +2 -0
  148. package/dist/types/components/template/mail-template/index.d.ts +2 -0
  149. package/dist/types/components/template/mail-template/mail-template.d.ts +11 -0
  150. package/dist/types/components/template/use-narrow.d.ts +3 -0
  151. package/dist/types/index.d.ts +149 -0
  152. package/dist/types/kit/check-rendering.d.ts +3 -0
  153. package/dist/types/kit/kit.d.ts +76 -0
  154. package/dist/types/lib/clipboard.d.ts +5 -0
  155. package/dist/types/lib/dates.d.ts +9 -0
  156. package/dist/types/lib/json.d.ts +26 -0
  157. package/dist/types/lib/keys.d.ts +15 -0
  158. package/dist/types/lib/utils.d.ts +2 -0
  159. package/dist/types/lib/view-scope.d.ts +22 -0
  160. package/dist/types/profile/profile.d.ts +34 -0
  161. package/dist/types/theme/appearance.d.ts +31 -0
  162. package/dist/types/theme/boot.d.ts +3 -0
  163. package/dist/types/theme/client-appearance-react.d.ts +3 -0
  164. package/dist/types/theme/client-appearance.d.ts +69 -0
  165. package/dist/types/theme/generate-tokens.d.ts +45 -0
  166. package/dist/types/theme/pack-themes-react.d.ts +24 -0
  167. package/dist/types/theme/palette.d.ts +111 -0
  168. package/dist/types/theme/semantic-mapping.d.ts +28 -0
  169. package/dist/types/theme/set-theme.d.ts +30 -0
  170. package/dist/types/theme/theme-colours.d.ts +14 -0
  171. package/dist/types/theme/theme-css.d.ts +3 -0
  172. package/dist/types/theme/themes.d.ts +63 -0
  173. package/dist/types/theme/wallpaper-sheet.d.ts +16 -0
  174. package/dist/types/theme/wallpaper-theme-react.d.ts +7 -0
  175. package/dist/types/theme/wallpaper-theme.d.ts +37 -0
  176. package/package.json +87 -3
  177. package/src/build/stylesheet.ts +128 -0
  178. package/src/components/composite/command/command.meta.yaml +74 -0
  179. package/src/components/composite/command/command.tsx +939 -0
  180. package/src/components/composite/command/index.ts +17 -0
  181. package/src/components/composite/draft-bar/draft-bar.meta.yaml +19 -0
  182. package/src/components/composite/draft-bar/draft-bar.tsx +57 -0
  183. package/src/components/composite/draft-bar/index.ts +2 -0
  184. package/src/components/composite/image-field/image-field.meta.yaml +69 -0
  185. package/src/components/composite/image-field/image-field.tsx +267 -0
  186. package/src/components/composite/image-field/index.ts +2 -0
  187. package/src/components/composite/list/index.ts +18 -0
  188. package/src/components/composite/list/list-swipe.tsx +163 -0
  189. package/src/components/composite/list/list.meta.yaml +238 -0
  190. package/src/components/composite/list/list.tsx +868 -0
  191. package/src/components/composite/picker/index.ts +2 -0
  192. package/src/components/composite/picker/picker.meta.yaml +103 -0
  193. package/src/components/composite/picker/picker.tsx +276 -0
  194. package/src/components/composite/prompt-field/index.ts +2 -0
  195. package/src/components/composite/prompt-field/prompt-field.meta.yaml +60 -0
  196. package/src/components/composite/prompt-field/prompt-field.tsx +81 -0
  197. package/src/components/composite/properties/index.ts +9 -0
  198. package/src/components/composite/properties/properties.meta.yaml +56 -0
  199. package/src/components/composite/properties/properties.tsx +132 -0
  200. package/src/components/composite/snooze-menu/index.ts +11 -0
  201. package/src/components/composite/snooze-menu/presets.ts +169 -0
  202. package/src/components/composite/snooze-menu/snooze-menu.meta.yaml +58 -0
  203. package/src/components/composite/snooze-menu/snooze-menu.tsx +146 -0
  204. package/src/components/composite/tag-input/index.ts +2 -0
  205. package/src/components/composite/tag-input/tag-input.meta.yaml +51 -0
  206. package/src/components/composite/tag-input/tag-input.tsx +404 -0
  207. package/src/components/composite/wizard/index.ts +2 -0
  208. package/src/components/composite/wizard/wizard.meta.yaml +73 -0
  209. package/src/components/composite/wizard/wizard.tsx +256 -0
  210. package/src/components/core/avatar/avatar.meta.yaml +71 -0
  211. package/src/components/core/avatar/avatar.tsx +92 -0
  212. package/src/components/core/avatar/index.ts +2 -0
  213. package/src/components/core/badge/badge.meta.yaml +34 -0
  214. package/src/components/core/badge/badge.tsx +23 -0
  215. package/src/components/core/badge/index.ts +2 -0
  216. package/src/components/core/breadcrumb/breadcrumb.meta.yaml +45 -0
  217. package/src/components/core/breadcrumb/breadcrumb.tsx +110 -0
  218. package/src/components/core/breadcrumb/index.ts +2 -0
  219. package/src/components/core/bullets/bullets.meta.yaml +37 -0
  220. package/src/components/core/bullets/bullets.tsx +60 -0
  221. package/src/components/core/bullets/index.ts +2 -0
  222. package/src/components/core/button/button.meta.yaml +91 -0
  223. package/src/components/core/button/button.tsx +93 -0
  224. package/src/components/core/button/index.ts +2 -0
  225. package/src/components/core/card/card.meta.yaml +94 -0
  226. package/src/components/core/card/card.tsx +54 -0
  227. package/src/components/core/card/index.ts +2 -0
  228. package/src/components/core/checkbox/checkbox.meta.yaml +59 -0
  229. package/src/components/core/checkbox/checkbox.tsx +106 -0
  230. package/src/components/core/checkbox/index.ts +2 -0
  231. package/src/components/core/cluster/cluster.meta.yaml +4 -0
  232. package/src/components/core/cluster/cluster.tsx +17 -0
  233. package/src/components/core/cluster/index.ts +1 -0
  234. package/src/components/core/code-block/code-block.meta.yaml +30 -0
  235. package/src/components/core/code-block/code-block.tsx +93 -0
  236. package/src/components/core/code-block/index.ts +2 -0
  237. package/src/components/core/collapsible/collapsible.meta.yaml +34 -0
  238. package/src/components/core/collapsible/collapsible.tsx +54 -0
  239. package/src/components/core/collapsible/index.ts +1 -0
  240. package/src/components/core/colour-picker/colour-picker.meta.yaml +52 -0
  241. package/src/components/core/colour-picker/colour-picker.tsx +314 -0
  242. package/src/components/core/colour-picker/index.ts +4 -0
  243. package/src/components/core/combobox/combobox.meta.yaml +75 -0
  244. package/src/components/core/combobox/combobox.tsx +288 -0
  245. package/src/components/core/combobox/index.ts +2 -0
  246. package/src/components/core/detail/detail.meta.yaml +13 -0
  247. package/src/components/core/detail/detail.tsx +73 -0
  248. package/src/components/core/detail/index.ts +1 -0
  249. package/src/components/core/dialog/dialog.meta.yaml +95 -0
  250. package/src/components/core/dialog/dialog.tsx +254 -0
  251. package/src/components/core/dialog/drag.ts +40 -0
  252. package/src/components/core/dialog/index.ts +25 -0
  253. package/src/components/core/drop-zone/drop-zone.meta.yaml +55 -0
  254. package/src/components/core/drop-zone/drop-zone.tsx +146 -0
  255. package/src/components/core/drop-zone/index.ts +2 -0
  256. package/src/components/core/dropdown-menu/dropdown-menu.meta.yaml +118 -0
  257. package/src/components/core/dropdown-menu/dropdown-menu.tsx +407 -0
  258. package/src/components/core/dropdown-menu/index.ts +32 -0
  259. package/src/components/core/editable-field/editable-field.meta.yaml +120 -0
  260. package/src/components/core/editable-field/editable-field.tsx +346 -0
  261. package/src/components/core/editable-field/index.ts +2 -0
  262. package/src/components/core/empty-state/empty-state.meta.yaml +21 -0
  263. package/src/components/core/empty-state/empty-state.tsx +42 -0
  264. package/src/components/core/empty-state/index.ts +2 -0
  265. package/src/components/core/field/field.meta.yaml +37 -0
  266. package/src/components/core/field/field.tsx +100 -0
  267. package/src/components/core/field/index.ts +9 -0
  268. package/src/components/core/icon/curated-names.json +107 -0
  269. package/src/components/core/icon/icon-sets.ts +109 -0
  270. package/src/components/core/icon/icon.meta.yaml +30 -0
  271. package/src/components/core/icon/icon.tsx +93 -0
  272. package/src/components/core/icon/index.ts +2 -0
  273. package/src/components/core/input/index.ts +4 -0
  274. package/src/components/core/input/input.meta.yaml +98 -0
  275. package/src/components/core/input/input.tsx +133 -0
  276. package/src/components/core/input/textarea.meta.yaml +79 -0
  277. package/src/components/core/input/textarea.tsx +63 -0
  278. package/src/components/core/kbd/index.ts +2 -0
  279. package/src/components/core/kbd/kbd.meta.yaml +12 -0
  280. package/src/components/core/kbd/kbd.tsx +29 -0
  281. package/src/components/core/label/index.ts +2 -0
  282. package/src/components/core/label/label.meta.yaml +55 -0
  283. package/src/components/core/label/label.tsx +72 -0
  284. package/src/components/core/main-content/index.ts +2 -0
  285. package/src/components/core/main-content/main-content.meta.yaml +23 -0
  286. package/src/components/core/main-content/main-content.tsx +49 -0
  287. package/src/components/core/pane/index.ts +1 -0
  288. package/src/components/core/pane/pane.meta.yaml +13 -0
  289. package/src/components/core/pane/pane.tsx +64 -0
  290. package/src/components/core/pick-menu/index.ts +4 -0
  291. package/src/components/core/pick-menu/pick-menu.meta.yaml +36 -0
  292. package/src/components/core/pick-menu/pick-menu.tsx +348 -0
  293. package/src/components/core/pick-menu/tag-menu.meta.yaml +7 -0
  294. package/src/components/core/pick-menu/tag-menu.tsx +79 -0
  295. package/src/components/core/popover/index.ts +2 -0
  296. package/src/components/core/popover/popover.meta.yaml +16 -0
  297. package/src/components/core/popover/popover.tsx +66 -0
  298. package/src/components/core/progress/index.ts +2 -0
  299. package/src/components/core/progress/progress.meta.yaml +47 -0
  300. package/src/components/core/progress/progress.tsx +56 -0
  301. package/src/components/core/resizable/index.ts +13 -0
  302. package/src/components/core/resizable/resizable.meta.yaml +110 -0
  303. package/src/components/core/resizable/resizable.tsx +125 -0
  304. package/src/components/core/resizable/use-remembered-layout.ts +261 -0
  305. package/src/components/core/screen-link/index.ts +2 -0
  306. package/src/components/core/screen-link/screen-link.meta.yaml +34 -0
  307. package/src/components/core/screen-link/screen-link.tsx +100 -0
  308. package/src/components/core/scroll-area/index.ts +2 -0
  309. package/src/components/core/scroll-area/scroll-area.meta.yaml +72 -0
  310. package/src/components/core/scroll-area/scroll-area.tsx +95 -0
  311. package/src/components/core/scroll-area/steps.tsx +72 -0
  312. package/src/components/core/section/index.ts +2 -0
  313. package/src/components/core/section/section.meta.yaml +72 -0
  314. package/src/components/core/section/section.tsx +93 -0
  315. package/src/components/core/segment-group/index.ts +2 -0
  316. package/src/components/core/segment-group/segment-group.meta.yaml +71 -0
  317. package/src/components/core/segment-group/segment-group.tsx +166 -0
  318. package/src/components/core/select/index.ts +20 -0
  319. package/src/components/core/select/select.meta.yaml +48 -0
  320. package/src/components/core/select/select.tsx +226 -0
  321. package/src/components/core/skeleton/index.ts +2 -0
  322. package/src/components/core/skeleton/skeleton.meta.yaml +50 -0
  323. package/src/components/core/skeleton/skeleton.tsx +71 -0
  324. package/src/components/core/slider/index.ts +2 -0
  325. package/src/components/core/slider/slider.meta.yaml +55 -0
  326. package/src/components/core/slider/slider.tsx +46 -0
  327. package/src/components/core/sortable/index.ts +16 -0
  328. package/src/components/core/sortable/sortable.meta.yaml +125 -0
  329. package/src/components/core/sortable/sortable.tsx +471 -0
  330. package/src/components/core/split-view/index.ts +2 -0
  331. package/src/components/core/split-view/split-view.meta.yaml +85 -0
  332. package/src/components/core/split-view/split-view.tsx +193 -0
  333. package/src/components/core/status-icon/index.ts +2 -0
  334. package/src/components/core/status-icon/status-icon.meta.yaml +64 -0
  335. package/src/components/core/status-icon/status-icon.tsx +94 -0
  336. package/src/components/core/table/collapsible-rows.tsx +30 -0
  337. package/src/components/core/table/expand-toggle.tsx +58 -0
  338. package/src/components/core/table/group-header.tsx +35 -0
  339. package/src/components/core/table/index.ts +26 -0
  340. package/src/components/core/table/table.meta.yaml +67 -0
  341. package/src/components/core/table/table.tsx +166 -0
  342. package/src/components/core/tabs/index.ts +2 -0
  343. package/src/components/core/tabs/tabs.meta.yaml +57 -0
  344. package/src/components/core/tabs/tabs.tsx +74 -0
  345. package/src/components/core/tag-pill/index.ts +2 -0
  346. package/src/components/core/tag-pill/tag-pill.meta.yaml +19 -0
  347. package/src/components/core/tag-pill/tag-pill.tsx +102 -0
  348. package/src/components/core/thumbnail/index.ts +2 -0
  349. package/src/components/core/thumbnail/thumbnail.meta.yaml +59 -0
  350. package/src/components/core/thumbnail/thumbnail.tsx +162 -0
  351. package/src/components/core/toast/index.ts +12 -0
  352. package/src/components/core/toast/toast.meta.yaml +93 -0
  353. package/src/components/core/toast/toast.tsx +763 -0
  354. package/src/components/core/toggle/index.ts +2 -0
  355. package/src/components/core/toggle/toggle.meta.yaml +53 -0
  356. package/src/components/core/toggle/toggle.tsx +44 -0
  357. package/src/components/core/toggle-group/index.ts +2 -0
  358. package/src/components/core/toggle-group/toggle-group.meta.yaml +59 -0
  359. package/src/components/core/toggle-group/toggle-group.tsx +68 -0
  360. package/src/components/core/tooltip/index.ts +7 -0
  361. package/src/components/core/tooltip/tooltip.meta.yaml +93 -0
  362. package/src/components/core/tooltip/tooltip.tsx +198 -0
  363. package/src/components/layout/multi-pane/index.ts +4 -0
  364. package/src/components/layout/multi-pane/list-detail.tsx +45 -0
  365. package/src/components/layout/multi-pane/multi-pane.meta.yaml +67 -0
  366. package/src/components/layout/multi-pane/multi-pane.tsx +158 -0
  367. package/src/components/layout/single-pane/index.ts +2 -0
  368. package/src/components/layout/single-pane/single-pane.meta.yaml +35 -0
  369. package/src/components/layout/single-pane/single-pane.tsx +48 -0
  370. package/src/components/shell/app-shell/app-shell.meta.yaml +65 -0
  371. package/src/components/shell/app-shell/app-shell.tsx +61 -0
  372. package/src/components/shell/app-shell/index.ts +2 -0
  373. package/src/components/shell/sidebar/index.ts +35 -0
  374. package/src/components/shell/sidebar/sidebar-group.tsx +254 -0
  375. package/src/components/shell/sidebar/sidebar-item.tsx +88 -0
  376. package/src/components/shell/sidebar/sidebar-resize-handle.tsx +101 -0
  377. package/src/components/shell/sidebar/sidebar-tree.tsx +325 -0
  378. package/src/components/shell/sidebar/sidebar.meta.yaml +126 -0
  379. package/src/components/shell/sidebar/sidebar.tsx +142 -0
  380. package/src/components/template/address-book-template/address-book-template.meta.yaml +22 -0
  381. package/src/components/template/address-book-template/address-book-template.tsx +201 -0
  382. package/src/components/template/address-book-template/index.ts +2 -0
  383. package/src/components/template/mail-template/index.ts +2 -0
  384. package/src/components/template/mail-template/mail-template.meta.yaml +22 -0
  385. package/src/components/template/mail-template/mail-template.tsx +731 -0
  386. package/src/components/template/use-narrow.ts +18 -0
  387. package/src/index.ts +505 -0
  388. package/src/kit/check-rendering.tsx +130 -0
  389. package/src/kit/kit.tsx +177 -0
  390. package/src/lib/clipboard.ts +27 -0
  391. package/src/lib/dates.ts +13 -0
  392. package/src/lib/json.ts +59 -0
  393. package/src/lib/keys.ts +54 -0
  394. package/src/lib/utils.ts +12 -0
  395. package/src/lib/view-scope.tsx +60 -0
  396. package/src/profile/profile.ts +238 -0
  397. package/src/theme/appearance.ts +198 -0
  398. package/src/theme/boot.ts +6 -0
  399. package/src/theme/client-appearance-react.ts +14 -0
  400. package/src/theme/client-appearance.ts +284 -0
  401. package/src/theme/generate-tokens.ts +658 -0
  402. package/src/theme/pack-themes-react.ts +107 -0
  403. package/src/theme/palette.ts +301 -0
  404. package/src/theme/semantic-mapping.ts +165 -0
  405. package/src/theme/set-theme.ts +162 -0
  406. package/src/theme/theme-colours.ts +60 -0
  407. package/src/theme/theme-css.ts +15 -0
  408. package/src/theme/themes.ts +133 -0
  409. package/src/theme/wallpaper-sheet.ts +58 -0
  410. package/src/theme/wallpaper-theme-react.ts +60 -0
  411. package/src/theme/wallpaper-theme.ts +231 -0
@@ -0,0 +1,107 @@
1
+ // The workspace's pack themes in the page (research-038): when the workspace shown or its plugins change, the shell asks
2
+ // the host for their list and links their stylesheet in place of the last workspace's, then resolves the theme again.
3
+ // The kit knows no route of its host (research-078): the shell gives them (`PackThemesProvider`), as it gives
4
+ // `FollowProvider`; without them, the page has the kit's own themes only.
5
+ import * as React from "react";
6
+ import { isRecord } from "../lib/json.ts";
7
+ import { refreshTheme } from "./set-theme";
8
+ import { PACK_THEMES_EVENT, THEMES, allThemes, setPackThemes, type ThemeInfo } from "./themes";
9
+
10
+ const isTheme = (value: unknown): value is ThemeInfo =>
11
+ isRecord(value) &&
12
+ typeof value.id === "string" &&
13
+ /^[a-z0-9-]+$/.test(value.id) &&
14
+ typeof value.label === "string" &&
15
+ (value.type === "light" || value.type === "dark");
16
+
17
+ /** Where the host serves the themes packs bring. */
18
+ export interface PackThemeRoutes {
19
+ /** A workspace's pack themes, as JSON: `{ themes: [{ id, label, type }] }`. */
20
+ themes: (slug: string) => string;
21
+ /** Their stylesheet of `[data-theme]` blocks. */
22
+ stylesheet: (slug: string) => string;
23
+ /** The themes every workspace has (Bridge's default theme is chosen among them), in the same JSON. */
24
+ hostThemes: string;
25
+ }
26
+
27
+ const Routes = React.createContext<PackThemeRoutes | undefined>(undefined);
28
+
29
+ /** Gives the page's pack-theme hooks their host's routes (the shell, around the page). */
30
+ export function PackThemesProvider({
31
+ value,
32
+ children,
33
+ }: {
34
+ value: PackThemeRoutes;
35
+ children: React.ReactNode;
36
+ }) {
37
+ return React.createElement(Routes.Provider, { value }, children);
38
+ }
39
+
40
+ /** `slug`: the workspace shown; `key`: what changes when its plugins do (their ids and states). */
41
+ export function usePackThemes(slug: string | undefined, key: string): void {
42
+ const routes = React.useContext(Routes);
43
+ React.useEffect(() => {
44
+ if (slug === undefined || routes === undefined) return;
45
+ let gone = false;
46
+ fetch(routes.themes(slug))
47
+ .then((response) => (response.ok ? (response.json() as Promise<unknown>) : undefined))
48
+ .then((body) => {
49
+ if (gone || !isRecord(body) || !Array.isArray(body.themes)) return;
50
+ const themes = body.themes
51
+ .filter(isTheme)
52
+ .map(({ id, label, type }) => ({ id, label, type }));
53
+ const current = document.querySelector<HTMLLinkElement>("link[data-bridge-pack-themes]");
54
+ if (themes.length > 0) {
55
+ const link = current ?? document.createElement("link");
56
+ link.rel = "stylesheet";
57
+ link.setAttribute("data-bridge-pack-themes", "");
58
+ link.href = `${routes.stylesheet(slug)}?${encodeURIComponent(key.length.toString(36) + Date.now().toString(36))}`;
59
+ if (!current) document.querySelector("link[data-bridge-kit]")?.after(link);
60
+ } else current?.remove();
61
+ setPackThemes(themes);
62
+ refreshTheme();
63
+ })
64
+ .catch((error: unknown) => console.warn("pack themes unavailable", error));
65
+ return () => {
66
+ gone = true;
67
+ };
68
+ }, [slug, key, routes]);
69
+ }
70
+
71
+ /** The themes every workspace has, for Bridge's default theme (Admin): Bridge's own and `_host`'s packs', not those
72
+ * of one workspace's packs, which another workspace would not have. */
73
+ export function useHostThemes(): ThemeInfo[] {
74
+ const routes = React.useContext(Routes);
75
+ const [packs, setPacks] = React.useState<ThemeInfo[]>([]);
76
+ React.useEffect(() => {
77
+ if (routes === undefined) return;
78
+ let gone = false;
79
+ fetch(routes.hostThemes)
80
+ .then((response) => (response.ok ? (response.json() as Promise<unknown>) : undefined))
81
+ .then((body) => {
82
+ if (gone || !isRecord(body) || !Array.isArray(body.themes)) return;
83
+ setPacks(body.themes.filter(isTheme).map(({ id, label, type }) => ({ id, label, type })));
84
+ })
85
+ .catch((error: unknown) => console.warn("_host's themes unavailable", error));
86
+ return () => {
87
+ gone = true;
88
+ };
89
+ }, [routes]);
90
+ return [...THEMES.filter((theme) => !theme.wallpaper), ...packs];
91
+ }
92
+
93
+ /** Every theme the page can show (./themes.ts `allThemes`), drawn again when the packs' change, their names too (the
94
+ * boot page names them by id until the host's list says better). */
95
+ export function useThemes(): readonly ThemeInfo[] {
96
+ const key = React.useSyncExternalStore(
97
+ (listener) => {
98
+ window.addEventListener(PACK_THEMES_EVENT, listener);
99
+ return () => window.removeEventListener(PACK_THEMES_EVENT, listener);
100
+ },
101
+ () =>
102
+ allThemes()
103
+ .map(({ id, label }) => `${id}:${label}`)
104
+ .join(" "),
105
+ );
106
+ return React.useMemo(() => allThemes(), [key]);
107
+ }
@@ -0,0 +1,301 @@
1
+ /**
2
+ * Bridge UI Palette System — Core Derivation Engine
3
+ *
4
+ * Derives a complete set of semantic color tokens from a minimal palette input:
5
+ * - 8 hues × (normal + bright) = 16 chromatic inputs
6
+ * - bg + fg = 2 neutral endpoints
7
+ * - accent hint = which hue feeds --accent
8
+ *
9
+ * Produces:
10
+ * - 40 chromatic tokens (5 variants × 8 hues)
11
+ * - 11 neutral steps (Tailwind-style 50→950)
12
+ *
13
+ * Ported from _bmad-output/mockups/palette-system.html
14
+ */
15
+
16
+ // ─── Types ───────────────────────────────────────────────────────────────────
17
+
18
+ export interface OklchColor {
19
+ /** Lightness 0→1 (0=black, 1=white) */
20
+ l: number;
21
+ /** Chroma 0→~0.37 (0=gray, higher=vivid) */
22
+ c: number;
23
+ /** Hue 0→360 degrees */
24
+ h: number;
25
+ }
26
+
27
+ export type HueName = "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "orange" | "pink";
28
+
29
+ export interface ChromaticVariants {
30
+ low: OklchColor;
31
+ mid: OklchColor;
32
+ normal: OklchColor;
33
+ bright: OklchColor;
34
+ high: OklchColor;
35
+ }
36
+
37
+ export interface NeutralStep {
38
+ color: OklchColor;
39
+ /** Tailwind-style name: "50", "100", ..., "950" */
40
+ name: string;
41
+ /** Semantic role: "sidebar", "bg", "surface", "hover", etc. */
42
+ role: string;
43
+ }
44
+
45
+ export interface PaletteInput {
46
+ /** Theme name (e.g., "dracula", "nord") */
47
+ name: string;
48
+ /** "dark" or "light" — selects the neutral curve */
49
+ type: "dark" | "light";
50
+ /** Which hue slot feeds --accent */
51
+ accent: HueName;
52
+ /** Page background color */
53
+ bg: OklchColor;
54
+ /** Primary text color */
55
+ fg: OklchColor;
56
+ /** 8 chromatic hue pairs (normal + bright) */
57
+ hues: Record<HueName, { normal: OklchColor; bright: OklchColor }>;
58
+ /** Optional hand-picked tokens for palettes with character (Bridge addition); absent = derived. */
59
+ overrides?: PaletteOverrides;
60
+ }
61
+
62
+ /** Tokens a palette may set instead of deriving them (Bridge addition): `--accent-fg`, `--bg-sidebar`, `--fg-muted`. */
63
+ export interface PaletteOverrides {
64
+ accentFg?: OklchColor;
65
+ sidebar?: OklchColor;
66
+ fgMuted?: OklchColor;
67
+ }
68
+
69
+ export interface DerivedPalette {
70
+ /** 8 hues × 5 variants = 40 chromatic colors */
71
+ chromatic: Record<HueName, ChromaticVariants>;
72
+ /** 11 neutral steps from sidebar/surface → fg */
73
+ neutrals: NeutralStep[];
74
+ /** Which hue is the accent */
75
+ accent: HueName;
76
+ /** Whether this is a dark theme */
77
+ isDark: boolean;
78
+ /** The input's overrides, applied by mapPaletteToTokens (Bridge addition) */
79
+ overrides?: PaletteOverrides;
80
+ }
81
+
82
+ // ─── Constants ───────────────────────────────────────────────────────────────
83
+
84
+ /** Neutral step names (Tailwind-style) */
85
+ const NEUTRAL_NAMES = [
86
+ "50",
87
+ "100",
88
+ "200",
89
+ "300",
90
+ "400",
91
+ "500",
92
+ "600",
93
+ "700",
94
+ "800",
95
+ "900",
96
+ "950",
97
+ ] as const;
98
+
99
+ /** All hue names */
100
+ export const HUE_NAMES: HueName[] = [
101
+ "red",
102
+ "green",
103
+ "yellow",
104
+ "blue",
105
+ "magenta",
106
+ "cyan",
107
+ "orange",
108
+ "pink",
109
+ ];
110
+
111
+ /**
112
+ * Neutral scale position arrays — extracted from Bridge UI's hand-tuned tokens.
113
+ * These ARE the curves. Not easing functions, but measured lookup tables.
114
+ *
115
+ * Dark: ultra-compressed bg zone (steps 50-400 cover ~9% of lightness range)
116
+ * Light: stays near white longer (steps 50-400 cover ~8% of lightness range)
117
+ */
118
+ const DARK_POSITIONS = [0.0, 0.012, 0.03, 0.06, 0.09, 0.18, 0.3, 0.452, 0.69, 0.85, 1.0];
119
+ const LIGHT_POSITIONS = [0.0, 0.015, 0.031, 0.046, 0.077, 0.134, 0.182, 0.335, 0.511, 0.704, 1.0];
120
+
121
+ /**
122
+ * Semantic roles for neutral steps.
123
+ * Dark: sidebar is darkest (step 50), surface is lighter than bg (step 200)
124
+ * The fg-strong step (900) sits between secondary and fg for extra range.
125
+ * Light: surface is whitest (step 50), sidebar is grayer than bg (step 200)
126
+ * Step 600 maps to border-input (not a fg token), shifting fg roles down by one.
127
+ * This matches the hand-tuned token values extracted from Bridge UI.
128
+ */
129
+ const DARK_ROLES = [
130
+ "sidebar",
131
+ "bg",
132
+ "surface",
133
+ "hover",
134
+ "active",
135
+ "badge/border",
136
+ "placeholder",
137
+ "muted",
138
+ "secondary",
139
+ "fg-strong",
140
+ "fg",
141
+ ];
142
+ const LIGHT_ROLES = [
143
+ "surface",
144
+ "bg",
145
+ "sidebar",
146
+ "hover",
147
+ "active",
148
+ "badge/border",
149
+ "border-input",
150
+ "placeholder",
151
+ "muted",
152
+ "secondary",
153
+ "fg",
154
+ ];
155
+
156
+ // ─── OKLCH Math ──────────────────────────────────────────────────────────────
157
+
158
+ /** Parse an OKLCH string like "oklch(56.74% 0.1585 275.21)" */
159
+ export function parseOklch(str: string): OklchColor | null {
160
+ const m = str.match(/oklch\(\s*([\d.]+)%\s+([\d.]+)\s+([\d.]+|none)\s*\)/);
161
+ if (!m) return null;
162
+ const [, l, c, h] = m;
163
+ if (l === undefined || c === undefined || h === undefined) return null;
164
+ return {
165
+ l: parseFloat(l) / 100,
166
+ c: parseFloat(c),
167
+ h: h === "none" ? 0 : parseFloat(h),
168
+ };
169
+ }
170
+
171
+ /** Format an OKLCH color to CSS string (clamps lightness and chroma to valid ranges) */
172
+ export function oklchToString(color: OklchColor): string {
173
+ const l = Math.max(0, Math.min(1, color.l));
174
+ const c = Math.max(0, color.c);
175
+ return `oklch(${(l * 100).toFixed(2)}% ${c.toFixed(4)} ${color.h.toFixed(1)})`;
176
+ }
177
+
178
+ /** Linear interpolation */
179
+ function lerp(a: number, b: number, t: number): number {
180
+ return a + (b - a) * t;
181
+ }
182
+
183
+ /** Interpolate between two OKLCH colors */
184
+ export function lerpOklch(a: OklchColor, b: OklchColor, t: number): OklchColor {
185
+ return {
186
+ l: lerp(a.l, b.l, t),
187
+ c: lerp(a.c, b.c, t),
188
+ h: lerp(a.h, b.h, t),
189
+ };
190
+ }
191
+
192
+ // ─── Chromatic Derivation ────────────────────────────────────────────────────
193
+
194
+ /**
195
+ * Derive 5 variants (LOW, MID, NORMAL, BRIGHT, HIGH) from a hue's
196
+ * NORMAL + BRIGHT pair and the theme's background color.
197
+ *
198
+ * - LOW: subtle bg tint (for label backgrounds, destructive-subtle)
199
+ * - MID: middle ground (for dots, colored borders)
200
+ * - NORMAL: the primary hue color (direct from input)
201
+ * - BRIGHT: the emphasis variant (direct from input)
202
+ * - HIGH: max contrast variant (for fg-on-color usage)
203
+ */
204
+ export function deriveVariants(
205
+ normal: OklchColor,
206
+ bright: OklchColor,
207
+ bg: OklchColor,
208
+ isDark?: boolean,
209
+ ): ChromaticVariants {
210
+ isDark = isDark ?? bg.l < 0.5;
211
+
212
+ const low: OklchColor = {
213
+ l: isDark ? lerp(bg.l, normal.l, 0.15) : lerp(bg.l, normal.l, 0.08),
214
+ c: normal.c * (isDark ? 0.25 : 0.15),
215
+ h: normal.h,
216
+ };
217
+
218
+ const mid: OklchColor = {
219
+ l: lerp(low.l, normal.l, 0.55),
220
+ c: normal.c * 0.65,
221
+ h: normal.h,
222
+ };
223
+
224
+ const high: OklchColor = isDark
225
+ ? { l: Math.min(bright.l + 0.08, 0.97), c: bright.c * 0.6, h: bright.h }
226
+ : { l: Math.max(normal.l - 0.12, 0.15), c: normal.c * 0.9, h: normal.h };
227
+
228
+ return { low, mid, normal, bright, high };
229
+ }
230
+
231
+ // ─── Neutral Derivation ──────────────────────────────────────────────────────
232
+
233
+ /**
234
+ * Derive 11 neutral steps from bg + fg using the theme-appropriate curve.
235
+ *
236
+ * Dark themes: sidebar (darkest) → bg → surface → ... → fg (lightest)
237
+ * Light themes: surface (whitest) → bg → sidebar → ... → fg (darkest)
238
+ *
239
+ * The position arrays encode a non-linear distribution:
240
+ * - Background steps (50-400) are clustered tightly (~9% of range)
241
+ * - Foreground steps (500-950) spread across the remaining range
242
+ */
243
+ export function deriveNeutrals(bg: OklchColor, fg: OklchColor, isDark?: boolean): NeutralStep[] {
244
+ isDark = isDark ?? bg.l < fg.l;
245
+
246
+ const positions = isDark ? DARK_POSITIONS : LIGHT_POSITIONS;
247
+ const roles = isDark ? DARK_ROLES : LIGHT_ROLES;
248
+
249
+ // Start point: most extreme background
250
+ // Dark: sidebar = bg - 1.5% lightness (darker)
251
+ // Light: surface = bg + 1.2% lightness (whiter, capped at 100%)
252
+ const startL = isDark ? Math.max(bg.l - 0.015, 0.03) : Math.min(bg.l + 0.012, 1.0);
253
+ const start: OklchColor = { l: startL, c: bg.c, h: bg.h };
254
+
255
+ const steps: NeutralStep[] = [];
256
+ for (let i = 0; i < 11; i++) {
257
+ const position = positions[i];
258
+ const name = NEUTRAL_NAMES[i];
259
+ const role = roles[i];
260
+ if (position === undefined || name === undefined || role === undefined) {
261
+ continue;
262
+ }
263
+ steps.push({
264
+ color: lerpOklch(start, fg, position),
265
+ name,
266
+ role,
267
+ });
268
+ }
269
+
270
+ return steps;
271
+ }
272
+
273
+ // ─── Full Palette Derivation ─────────────────────────────────────────────────
274
+
275
+ /**
276
+ * Derive a complete palette from minimal inputs.
277
+ *
278
+ * Input: 18 colors (8 hues × normal/bright + bg + fg) + accent hint
279
+ * Output: 40 chromatic (5 variants × 8 hues) + 11 neutral steps
280
+ */
281
+ export function derivePalette(input: PaletteInput): DerivedPalette {
282
+ const isDark = input.type === "dark";
283
+
284
+ // Derive 5 variants for each hue
285
+ const chromatic = {} as Record<HueName, ChromaticVariants>;
286
+ for (const hue of HUE_NAMES) {
287
+ const { normal, bright } = input.hues[hue];
288
+ chromatic[hue] = deriveVariants(normal, bright, input.bg, isDark);
289
+ }
290
+
291
+ // Derive 11 neutral steps
292
+ const neutrals = deriveNeutrals(input.bg, input.fg, isDark);
293
+
294
+ return {
295
+ chromatic,
296
+ neutrals,
297
+ accent: input.accent,
298
+ isDark,
299
+ ...(input.overrides && { overrides: input.overrides }),
300
+ };
301
+ }
@@ -0,0 +1,165 @@
1
+ /**
2
+ * Bridge UI Palette System — Semantic Token Mapping
3
+ *
4
+ * Maps a DerivedPalette to Bridge UI's semantic CSS custom properties.
5
+ * The output is a flat Record<string, string> of CSS var name → OKLCH value.
6
+ *
7
+ * Components consume these tokens unchanged — the palette system is transparent.
8
+ */
9
+
10
+ import { type DerivedPalette, type NeutralStep, oklchToString, lerpOklch } from "./palette.ts";
11
+
12
+ export interface SemanticTokens {
13
+ /** CSS custom property name → OKLCH value string */
14
+ colors: Record<string, string>;
15
+ /** Overlay shadow tokens (theme-aware opacity + optional glow) */
16
+ shadows: Record<string, string>;
17
+ /** Whether to include color-scheme: dark */
18
+ colorScheme: "dark" | "light";
19
+ }
20
+
21
+ /**
22
+ * Find a neutral step by its semantic role name.
23
+ */
24
+ function byRole(neutrals: NeutralStep[], role: string): string {
25
+ const step = neutrals.find((s) => s.role === role);
26
+ if (!step) throw new Error(`Neutral role "${role}" not found`);
27
+ return oklchToString(step.color);
28
+ }
29
+
30
+ /**
31
+ * Find a neutral step's raw color by role name.
32
+ */
33
+ function colorByRole(neutrals: NeutralStep[], role: string): { l: number; c: number; h: number } {
34
+ const step = neutrals.find((s) => s.role === role);
35
+ if (!step) throw new Error(`Neutral role "${role}" not found`);
36
+ return step.color;
37
+ }
38
+
39
+ /**
40
+ * Map a derived palette to Bridge UI semantic tokens.
41
+ *
42
+ * The accent hue determines which chromatic palette slot feeds --accent*.
43
+ * Label feature colors also follow the accent hue.
44
+ *
45
+ * Role mapping differs between dark and light themes:
46
+ * - Dark: step 600 = placeholder → --fg-placeholder, --border-input computed separately
47
+ * - Light: step 600 = border-input → --border-input, fg roles shift down by one
48
+ */
49
+ export function mapPaletteToTokens(palette: DerivedPalette): SemanticTokens {
50
+ const { chromatic, neutrals, accent, isDark } = palette;
51
+ const a = chromatic[accent];
52
+ const fmt = oklchToString;
53
+
54
+ // ── Border-input derivation ──
55
+ // Dark: halfway between badge/border and placeholder steps
56
+ // Light: dedicated "border-input" step exists in the neutral scale
57
+ const borderInputValue = isDark
58
+ ? fmt(
59
+ lerpOklch(
60
+ colorByRole(neutrals, "badge/border"),
61
+ colorByRole(neutrals, "placeholder"),
62
+ 0.55,
63
+ ),
64
+ )
65
+ : byRole(neutrals, "border-input");
66
+
67
+ const colors: Record<string, string> = {
68
+ // ── Backgrounds (from neutral scale) ──
69
+ "--bg": byRole(neutrals, "bg"),
70
+ "--bg-surface": byRole(neutrals, "surface"),
71
+ "--bg-hover": byRole(neutrals, "hover"),
72
+ "--bg-active": byRole(neutrals, "active"),
73
+ "--bg-sidebar": byRole(neutrals, "sidebar"),
74
+ "--bg-badge": byRole(neutrals, "active"), // badge uses active-level neutral
75
+
76
+ // ── Foregrounds (from neutral scale) ──
77
+ // Dark: placeholder → muted → secondary → fg-strong → fg
78
+ // Light: placeholder → muted → secondary → fg (no fg-strong)
79
+ "--fg": byRole(neutrals, "fg"),
80
+ "--fg-secondary": byRole(neutrals, "secondary"),
81
+ "--fg-muted": byRole(neutrals, "muted"),
82
+ "--fg-placeholder": byRole(neutrals, "placeholder"),
83
+
84
+ // ── Borders (from neutral scale) ──
85
+ "--border": byRole(neutrals, "badge/border"),
86
+ "--border-subtle": byRole(neutrals, "active"), // subtle border = active level
87
+ "--border-input": borderInputValue,
88
+
89
+ // ── Accent (from accent hue) ──
90
+ // accent-fg = high-contrast text ON accent backgrounds (white on dark accent, dark on light accent)
91
+ "--accent": fmt(a.normal),
92
+ "--accent-hover": fmt(a.bright),
93
+ "--accent-fg": isDark ? byRole(neutrals, "sidebar") : oklchToString({ l: 1.0, c: 0, h: 0 }),
94
+ "--accent-subtle": fmt(a.low),
95
+
96
+ // ── Semantic colors ──
97
+ // Each has: base color, subtle bg variant, fg (text ON that color)
98
+ "--destructive": fmt(chromatic.red.normal),
99
+ "--destructive-subtle": fmt(chromatic.red.low),
100
+ "--destructive-fg": isDark
101
+ ? byRole(neutrals, "sidebar")
102
+ : oklchToString({ l: 1.0, c: 0, h: 0 }),
103
+ "--success": fmt(chromatic.green.normal),
104
+ "--success-subtle": fmt(chromatic.green.low),
105
+ "--success-fg": isDark ? byRole(neutrals, "sidebar") : oklchToString({ l: 1.0, c: 0, h: 0 }),
106
+ "--warning": fmt(chromatic.yellow.normal),
107
+ "--warning-subtle": fmt(chromatic.yellow.low),
108
+ // warning-fg is always dark — yellow is bright in both light and dark themes
109
+ "--warning-fg": isDark ? byRole(neutrals, "sidebar") : byRole(neutrals, "fg"),
110
+ // Bridge: warning as text. The bright yellow stays for backgrounds, icons, and dots; on a light
111
+ // background it is unreadable as text, so light themes darken it to 62.5% lightness (contrast-checked).
112
+ "--warning-text": isDark
113
+ ? fmt(chromatic.yellow.normal)
114
+ : fmt({ ...chromatic.yellow.normal, l: Math.min(chromatic.yellow.normal.l, 0.625) }),
115
+
116
+ // Bridge: a merged pull request (`text-merged`). No palette hue is violet, so it is fixed per theme type:
117
+ // violet-600 on a light background, violet-300 on a dark one (contrast-checked in themes.test.ts).
118
+ "--merged": isDark ? "oklch(81.10% 0.1110 293.6)" : "oklch(54.10% 0.2810 293.0)",
119
+
120
+ // ── Labels ──
121
+ "--label-bug-bg": fmt(chromatic.red.low),
122
+ "--label-bug-fg": fmt(chromatic.red.bright),
123
+ "--label-bug-dot": fmt(chromatic.red.mid),
124
+ "--label-feature-bg": fmt(a.low),
125
+ "--label-feature-fg": fmt(a.bright),
126
+ "--label-feature-dot": fmt(a.mid),
127
+ "--label-improvement-bg": fmt(chromatic.green.low),
128
+ "--label-improvement-fg": fmt(chromatic.green.bright),
129
+ "--label-improvement-dot": fmt(chromatic.green.mid),
130
+ // Bridge: a TagInput chip's dot — the feature label's, but the livelier accent in dark themes.
131
+ "--label-tag-dot": isDark ? fmt(a.normal) : fmt(a.mid),
132
+ };
133
+
134
+ // ── Overlay shadows ──
135
+ const shadowOpacity = isDark ? 0.5 : 0.16;
136
+ const shadowOpacityMd = isDark ? 0.4 : 0.12;
137
+ const shadowOpacitySm = isDark ? 0.5 : 0.15;
138
+
139
+ // Glow only for very high-chroma cyan-to-blue accents (chroma >= 0.18, hue 150–250) on dark themes
140
+ const accentChroma = a.normal.c;
141
+ const isHighChromaAccent = accentChroma >= 0.18 && a.normal.h >= 150 && a.normal.h <= 250;
142
+ const hasGlow = isDark && isHighChromaAccent;
143
+
144
+ const glowDialog = hasGlow ? `, 0 0 24px rgba(0, 200, 210, 0.08)` : "";
145
+ const glowDropdown = hasGlow ? `, 0 0 16px rgba(0, 200, 210, 0.06)` : "";
146
+ const glowTooltip = hasGlow ? `, 0 0 8px rgba(0, 200, 210, 0.08)` : "";
147
+
148
+ const shadows: Record<string, string> = {
149
+ "--shadow-dialog": `0 16px 48px rgba(0, 0, 0, ${shadowOpacity})${glowDialog}, 0 0 0 0.5px var(--border)`,
150
+ "--shadow-dropdown": `0 4px 24px rgba(0, 0, 0, ${shadowOpacityMd})${glowDropdown}, 0 0 0 0.5px var(--border)`,
151
+ "--shadow-tooltip": `0 4px 12px rgba(0, 0, 0, ${shadowOpacitySm})${glowTooltip}`,
152
+ };
153
+
154
+ // ── Overrides (Bridge addition): a palette without them maps exactly as upstream ──
155
+ const { overrides } = palette;
156
+ if (overrides?.accentFg) colors["--accent-fg"] = fmt(overrides.accentFg);
157
+ if (overrides?.sidebar) colors["--bg-sidebar"] = fmt(overrides.sidebar);
158
+ if (overrides?.fgMuted) colors["--fg-muted"] = fmt(overrides.fgMuted);
159
+
160
+ return {
161
+ colors,
162
+ shadows,
163
+ colorScheme: isDark ? "dark" : "light",
164
+ };
165
+ }