@bridgebrew/ui 0.0.0-stage → 0.1.10-next.79

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,45 @@
1
+ /**
2
+ * Bridge UI Token Generator
3
+ *
4
+ * Reads the default themes' palette YAML from a folder its host gives (`palettes`: one `<id>.yaml` per
5
+ * theme of THEMES; Bridge's are its `themes-default` pack's), derives all semantic tokens via the
6
+ * palette engine, and returns the kit's theme CSS: one [data-theme="<id>"] block per theme, the
7
+ * Tailwind bridge, and the static tokens (appended verbatim).
8
+ *
9
+ * Usage: generateThemeCss(palettes) — the host calls it once at start and compiles Tailwind over
10
+ * it; the result is never committed.
11
+ *
12
+ * CSS contract: the generated CSS contains only token variables, the Tailwind bridge,
13
+ * static tokens, and component-scoped rules ([data-slot], keyframes). It carries NO bare
14
+ * HTML tag selectors and NO geometry on native elements; the host compiles it with
15
+ * Tailwind's theme and utilities layers only (no preflight).
16
+ */
17
+ import { type PaletteInput } from "./palette.ts";
18
+ import { type SemanticTokens } from "./semantic-mapping.ts";
19
+ export declare function loadPalette(filePath: string): PaletteInput;
20
+ /** The derived tokens of every v0 theme, by id, in THEMES order, from the folder `palettes`. Throws on a missing or
21
+ * invalid palette. */
22
+ export declare function themeTokens(palettes: string): Map<string, {
23
+ input: PaletteInput;
24
+ tokens: SemanticTokens;
25
+ }>;
26
+ /** The kit's theme CSS (Tailwind input): the v0 theme blocks from the folder `palettes`, the Tailwind bridge, and the
27
+ * static tokens. */
28
+ export declare function generateThemeCss(palettes: string): string;
29
+ /** A theme a pack brings, as its page lists it. */
30
+ export interface PackThemeInfo {
31
+ id: string;
32
+ label: string;
33
+ type: "light" | "dark";
34
+ }
35
+ /** `#rgb` or `#rrggbb` as an OKLCH string; anything else as given. */
36
+ export declare function colourOf(value: unknown): unknown;
37
+ /** A pack's theme file, read (`raw`, parsed YAML or JSON) into its page entry and its `[data-theme]` block. Only
38
+ * `name`, `type`, `bg` and `fg` are required; whatever else it leaves out is the default theme's of the same type
39
+ * (accent, hues, paint), and every token is then derived from its own palette (research-038 T3). Colours are OKLCH
40
+ * or `#rrggbb`. `tokens` sets single tokens over the derived ones. `palettes`: the default themes' folder, as
41
+ * `generateThemeCss`'s. Throws an Error naming what is wrong. */
42
+ export declare function packTheme(raw: unknown, palettes: string): {
43
+ info: PackThemeInfo;
44
+ css: string;
45
+ };
@@ -0,0 +1,24 @@
1
+ import * as React from "react";
2
+ import { type ThemeInfo } from "./themes";
3
+ /** Where the host serves the themes packs bring. */
4
+ export interface PackThemeRoutes {
5
+ /** A workspace's pack themes, as JSON: `{ themes: [{ id, label, type }] }`. */
6
+ themes: (slug: string) => string;
7
+ /** Their stylesheet of `[data-theme]` blocks. */
8
+ stylesheet: (slug: string) => string;
9
+ /** The themes every workspace has (Bridge's default theme is chosen among them), in the same JSON. */
10
+ hostThemes: string;
11
+ }
12
+ /** Gives the page's pack-theme hooks their host's routes (the shell, around the page). */
13
+ export declare function PackThemesProvider({ value, children, }: {
14
+ value: PackThemeRoutes;
15
+ children: React.ReactNode;
16
+ }): React.FunctionComponentElement<React.ProviderProps<PackThemeRoutes | undefined>>;
17
+ /** `slug`: the workspace shown; `key`: what changes when its plugins do (their ids and states). */
18
+ export declare function usePackThemes(slug: string | undefined, key: string): void;
19
+ /** The themes every workspace has, for Bridge's default theme (Admin): Bridge's own and `_host`'s packs', not those
20
+ * of one workspace's packs, which another workspace would not have. */
21
+ export declare function useHostThemes(): ThemeInfo[];
22
+ /** Every theme the page can show (./themes.ts `allThemes`), drawn again when the packs' change, their names too (the
23
+ * boot page names them by id until the host's list says better). */
24
+ export declare function useThemes(): readonly ThemeInfo[];
@@ -0,0 +1,111 @@
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
+ export interface OklchColor {
16
+ /** Lightness 0→1 (0=black, 1=white) */
17
+ l: number;
18
+ /** Chroma 0→~0.37 (0=gray, higher=vivid) */
19
+ c: number;
20
+ /** Hue 0→360 degrees */
21
+ h: number;
22
+ }
23
+ export type HueName = "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "orange" | "pink";
24
+ export interface ChromaticVariants {
25
+ low: OklchColor;
26
+ mid: OklchColor;
27
+ normal: OklchColor;
28
+ bright: OklchColor;
29
+ high: OklchColor;
30
+ }
31
+ export interface NeutralStep {
32
+ color: OklchColor;
33
+ /** Tailwind-style name: "50", "100", ..., "950" */
34
+ name: string;
35
+ /** Semantic role: "sidebar", "bg", "surface", "hover", etc. */
36
+ role: string;
37
+ }
38
+ export interface PaletteInput {
39
+ /** Theme name (e.g., "dracula", "nord") */
40
+ name: string;
41
+ /** "dark" or "light" — selects the neutral curve */
42
+ type: "dark" | "light";
43
+ /** Which hue slot feeds --accent */
44
+ accent: HueName;
45
+ /** Page background color */
46
+ bg: OklchColor;
47
+ /** Primary text color */
48
+ fg: OklchColor;
49
+ /** 8 chromatic hue pairs (normal + bright) */
50
+ hues: Record<HueName, {
51
+ normal: OklchColor;
52
+ bright: OklchColor;
53
+ }>;
54
+ /** Optional hand-picked tokens for palettes with character (Bridge addition); absent = derived. */
55
+ overrides?: PaletteOverrides;
56
+ }
57
+ /** Tokens a palette may set instead of deriving them (Bridge addition): `--accent-fg`, `--bg-sidebar`, `--fg-muted`. */
58
+ export interface PaletteOverrides {
59
+ accentFg?: OklchColor;
60
+ sidebar?: OklchColor;
61
+ fgMuted?: OklchColor;
62
+ }
63
+ export interface DerivedPalette {
64
+ /** 8 hues × 5 variants = 40 chromatic colors */
65
+ chromatic: Record<HueName, ChromaticVariants>;
66
+ /** 11 neutral steps from sidebar/surface → fg */
67
+ neutrals: NeutralStep[];
68
+ /** Which hue is the accent */
69
+ accent: HueName;
70
+ /** Whether this is a dark theme */
71
+ isDark: boolean;
72
+ /** The input's overrides, applied by mapPaletteToTokens (Bridge addition) */
73
+ overrides?: PaletteOverrides;
74
+ }
75
+ /** All hue names */
76
+ export declare const HUE_NAMES: HueName[];
77
+ /** Parse an OKLCH string like "oklch(56.74% 0.1585 275.21)" */
78
+ export declare function parseOklch(str: string): OklchColor | null;
79
+ /** Format an OKLCH color to CSS string (clamps lightness and chroma to valid ranges) */
80
+ export declare function oklchToString(color: OklchColor): string;
81
+ /** Interpolate between two OKLCH colors */
82
+ export declare function lerpOklch(a: OklchColor, b: OklchColor, t: number): OklchColor;
83
+ /**
84
+ * Derive 5 variants (LOW, MID, NORMAL, BRIGHT, HIGH) from a hue's
85
+ * NORMAL + BRIGHT pair and the theme's background color.
86
+ *
87
+ * - LOW: subtle bg tint (for label backgrounds, destructive-subtle)
88
+ * - MID: middle ground (for dots, colored borders)
89
+ * - NORMAL: the primary hue color (direct from input)
90
+ * - BRIGHT: the emphasis variant (direct from input)
91
+ * - HIGH: max contrast variant (for fg-on-color usage)
92
+ */
93
+ export declare function deriveVariants(normal: OklchColor, bright: OklchColor, bg: OklchColor, isDark?: boolean): ChromaticVariants;
94
+ /**
95
+ * Derive 11 neutral steps from bg + fg using the theme-appropriate curve.
96
+ *
97
+ * Dark themes: sidebar (darkest) → bg → surface → ... → fg (lightest)
98
+ * Light themes: surface (whitest) → bg → sidebar → ... → fg (darkest)
99
+ *
100
+ * The position arrays encode a non-linear distribution:
101
+ * - Background steps (50-400) are clustered tightly (~9% of range)
102
+ * - Foreground steps (500-950) spread across the remaining range
103
+ */
104
+ export declare function deriveNeutrals(bg: OklchColor, fg: OklchColor, isDark?: boolean): NeutralStep[];
105
+ /**
106
+ * Derive a complete palette from minimal inputs.
107
+ *
108
+ * Input: 18 colors (8 hues × normal/bright + bg + fg) + accent hint
109
+ * Output: 40 chromatic (5 variants × 8 hues) + 11 neutral steps
110
+ */
111
+ export declare function derivePalette(input: PaletteInput): DerivedPalette;
@@ -0,0 +1,28 @@
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
+ import { type DerivedPalette } from "./palette.ts";
10
+ export interface SemanticTokens {
11
+ /** CSS custom property name → OKLCH value string */
12
+ colors: Record<string, string>;
13
+ /** Overlay shadow tokens (theme-aware opacity + optional glow) */
14
+ shadows: Record<string, string>;
15
+ /** Whether to include color-scheme: dark */
16
+ colorScheme: "dark" | "light";
17
+ }
18
+ /**
19
+ * Map a derived palette to Bridge UI semantic tokens.
20
+ *
21
+ * The accent hue determines which chromatic palette slot feeds --accent*.
22
+ * Label feature colors also follow the accent hue.
23
+ *
24
+ * Role mapping differs between dark and light themes:
25
+ * - Dark: step 600 = placeholder → --fg-placeholder, --border-input computed separately
26
+ * - Light: step 600 = border-input → --border-input, fg roles shift down by one
27
+ */
28
+ export declare function mapPaletteToTokens(palette: DerivedPalette): SemanticTokens;
@@ -0,0 +1,30 @@
1
+ import { type Mode, type ThemeSources } from "./themes";
2
+ /** What decides the theme now (./themes.ts `resolveTheme`), read from the page and this browser's storage. */
3
+ export declare function themeSources(): ThemeSources;
4
+ /** Shows the theme its sources give now (a mode, a choice, a proposal or a default changed). */
5
+ export declare function refreshTheme(): void;
6
+ /** This browser's theme: the stored one ("system" too), else the Bridge default (`<html data-default-theme>`), else
7
+ * "system" (an unknown or unreadable one counts as none). */
8
+ export declare function getTheme(): string;
9
+ /** Whether this browser chose a theme of its own (one that wins over the workspace's proposal). */
10
+ export declare const hasOwnTheme: () => boolean;
11
+ /** Shows a v0 theme ("system": the page's theme for the system's mode) without remembering it. */
12
+ export declare function applyTheme(id: string): void;
13
+ /** Chooses a v0 theme for this browser and remembers it, its mode with it (the theme shows); "system" drops the theme
14
+ * chosen and follows the system's mode. It wins over the workspace's proposal and the Bridge default. Throws on an
15
+ * unknown id. A storage failure leaves it chosen for this page only. */
16
+ export declare function setTheme(id: string): void;
17
+ /** This browser's mode: the one chosen, else the one its theme or the Bridge default gives (`modeOf`), as a choice
18
+ * ("system" when it follows the system). */
19
+ export declare function getModeChoice(): "light" | "dark" | "system";
20
+ /** Chooses the user's mode (client-wide: every workspace's, in the app every instance's): the theme of the pair, and
21
+ * every light/dark value, follow it. Answers why it is not kept, if it is not (it holds for this page). */
22
+ export declare function setMode(mode: "light" | "dark" | "system"): Promise<string | undefined>;
23
+ /** The mode of the theme shown (`<html data-theme>`), as it changes. */
24
+ export declare const getColourMode: () => Mode;
25
+ /** The mode shown, re-rendering the caller when it changes (a mode, a theme, the system). */
26
+ export declare function useColourMode(): Mode;
27
+ /** The theme the page shows in `mode` (the one shown now, or the other of its pair), re-rendering the caller when a
28
+ * choice, a proposal or a default changes: a value left to the theme draws in it (`<span data-theme>`). `bridge`: the
29
+ * one a workspace proposing none gets, the Bridge default's (or T3 Code), whatever this browser or workspace chose. */
30
+ export declare function useThemeOfMode(mode: Mode, layer?: "page" | "bridge"): string;
@@ -0,0 +1,14 @@
1
+ /** A colour offered: its value as stored (a CSS colour, `var(--accent)`), its name. */
2
+ export interface ColourSwatch {
3
+ value: string;
4
+ name: string;
5
+ }
6
+ /** Colours offered together in the popover, under `label`. */
7
+ export interface ColourGroup {
8
+ label: string;
9
+ swatches: readonly ColourSwatch[];
10
+ }
11
+ /** The theme's accents: what a colour of the look is offered first. */
12
+ export declare const THEME_COLOURS: readonly ColourSwatch[];
13
+ /** The theme's other colours, by group (never its text or its background: a paint or a tile in them would not read). */
14
+ export declare const THEME_COLOUR_GROUPS: readonly ColourGroup[];
@@ -0,0 +1,3 @@
1
+ export { generateThemeCss, packTheme, type PackThemeInfo } from "./generate-tokens.ts";
2
+ /** Absolute path of the kit's sources (`<kit>/src`), which a published copy keeps. */
3
+ export declare const kitSources: string;
@@ -0,0 +1,63 @@
1
+ export interface ThemeInfo {
2
+ id: string;
3
+ label: string;
4
+ type: "light" | "dark";
5
+ /** Drawn in the page from the workspace's wallpaper (./wallpaper-theme.ts): never Bridge's default theme. */
6
+ wallpaper?: true;
7
+ }
8
+ export declare const THEMES: readonly ThemeInfo[];
9
+ /** The themes Bridge's default may be (Admin): not those of a workspace's wallpaper. */
10
+ export declare const BRIDGE_THEMES: ThemeInfo[];
11
+ /** The theme when none is chosen: Bridge's, light or dark following the system. */
12
+ export declare const DEFAULT_THEME: {
13
+ readonly light: "bridge-light";
14
+ readonly dark: "bridge-dark";
15
+ };
16
+ /** Where the page keeps the chosen theme; the boot kernel reads it before the first mount. */
17
+ export declare const THEME_STORAGE_KEY = "bridge.theme";
18
+ /** A colour mode: which theme of a pair shows, which value of a light/dark setting applies. */
19
+ export type Mode = "light" | "dark";
20
+ /** A theme pair (research-028 A9): the theme shown in light mode and the one shown in dark mode. */
21
+ export interface ThemePair {
22
+ light?: string | undefined;
23
+ dark?: string | undefined;
24
+ }
25
+ /** Dispatched on `window` when the pack themes change, for the lists of themes to draw again. */
26
+ export declare const PACK_THEMES_EVENT = "bridge:pack-themes";
27
+ /** Sets the themes the workspace's packs bring (the boot kernel from `<html data-pack-themes>`, the shell from the
28
+ * workspace's status); an id of Bridge's own is skipped. */
29
+ export declare function setPackThemes(themes: readonly ThemeInfo[]): void;
30
+ /** The pack themes `<html data-pack-themes="<id>:<type> …">` names (the boot page's), labelled by their id until the
31
+ * host's list says better. */
32
+ export declare function packThemesOfAttribute(value: string | undefined): ThemeInfo[];
33
+ /** Every theme the page can show: Bridge's own, then its packs'. */
34
+ export declare const allThemes: () => readonly ThemeInfo[];
35
+ /** The id the page knows `id` by now (a former id read as its pack theme's, research-038), if it knows it at all. */
36
+ export declare const knownThemeId: (id: string | null | undefined) => string | undefined;
37
+ /** The theme of `mode` that goes with `id`: `id` itself when it is of that mode, else its counterpart (its id with light
38
+ * and dark swapped, as the theme menu's toggle had it); `undefined` for an unknown id or one without counterpart. */
39
+ export declare function themeOfMode(id: string | null | undefined, mode: Mode): string | undefined;
40
+ /** What decides the theme shown (research-028 resolution): the user's mode (client-wide), this page's own theme (stored,
41
+ * or kept by the page when storage refused it: the kit outside Bridge), the workspace's pair (its proposal, with the
42
+ * user's Mine over it), the Bridge default theme, the system's mode. */
43
+ export interface ThemeSources {
44
+ /** "light", "dark", "system", or nothing chosen. */
45
+ mode?: string | null | undefined;
46
+ /** A theme id, "system" (no theme chosen), or nothing chosen. */
47
+ own?: string | null | undefined;
48
+ proposal?: ThemePair | undefined;
49
+ /** The Bridge default: a theme id, or "system"/nothing. */
50
+ bridge?: string | null | undefined;
51
+ systemDark: boolean;
52
+ }
53
+ /** The mode shown: the browser's mode; none chosen, the mode of the theme it chose (a browser from before modes), else of
54
+ * the Bridge default's theme (so a Bridge set to a dark theme stays dark), else the system's. */
55
+ export declare function modeOf({ mode, own, bridge, systemDark }: ThemeSources): Mode;
56
+ /** The theme shown and its mode: in the mode shown, the browser's theme (or its counterpart), else the workspace's
57
+ * proposal for that mode, else the Bridge default's (or its counterpart), else T3 Code. */
58
+ export declare function resolveTheme(sources: ThemeSources): {
59
+ id: string;
60
+ mode: Mode;
61
+ };
62
+ /** The mode of the theme `id` (`<html data-theme>`), light for an unknown one. */
63
+ export declare const modeOfTheme: (id: string | null | undefined) => Mode;
@@ -0,0 +1,16 @@
1
+ /** Where the rules last drawn are kept, by workspace: the images they come from, the CSS. */
2
+ export declare const WALLPAPER_THEME_KEY = "bridge.wallpaper-theme";
3
+ type Kept = Record<string, {
4
+ images: string;
5
+ css: string;
6
+ }>;
7
+ export declare const keptWallpaperRules: () => Kept;
8
+ /** The page's one sheet for these rules (on `window`: the boot kernel's bundle and the kit's share it). */
9
+ export declare function layWallpaperRules(css: string): void;
10
+ /** Sent on `window` when the rules change: what reads the page's colours reads them again. */
11
+ export declare const WALLPAPER_RULES_EVENT = "bridge-wallpaper-rules";
12
+ /** The rules last drawn for `slug`, laid (the boot kernel, before the first paint). */
13
+ export declare function layKeptWallpaperRules(slug: string): void;
14
+ /** Keeps `value` (none: forgets) as `slug`'s rules. */
15
+ export declare const keepWallpaperRules: (slug: string, value: Kept[string] | undefined) => void;
16
+ export {};
@@ -0,0 +1,7 @@
1
+ /** Draws the theme from `images` (each mode's image URL; none: the kit's own blocks) for workspace `slug`, kept for the
2
+ * next page by `named` (what names the images: their URL may be the page's own, a `blob:`) and the derivation's version;
3
+ * again when either changes. */
4
+ export declare function useWallpaperTheme(slug: string | undefined, images: {
5
+ light?: string | undefined;
6
+ dark?: string | undefined;
7
+ }, named: string): void;
@@ -0,0 +1,37 @@
1
+ import { type OklchColor, type PaletteInput } from "./palette.ts";
2
+ /** The derivation's version: rules a page kept from another version are drawn again. */
3
+ export declare const WALLPAPER_THEME_VERSION = 2;
4
+ /** The two ids, paired by `themeOfMode` as any other pair. */
5
+ export declare const WALLPAPER_THEMES: {
6
+ readonly light: "wallpaper-light";
7
+ readonly dark: "wallpaper-dark";
8
+ };
9
+ export declare const isWallpaperTheme: (id: string | undefined) => id is "wallpaper-dark" | "wallpaper-light";
10
+ /** What an image gives a theme: its main colour, its second, and its most vivid (none in a grey image). */
11
+ export interface WallpaperColours {
12
+ main: OklchColor;
13
+ second: OklchColor;
14
+ vivid?: OklchColor | undefined;
15
+ }
16
+ /** T3 Code's hues (./palettes/t3-code-*.yaml, kept equal by themes.test.ts): the base of the theme. */
17
+ export declare const BASE_HUES: Record<"light" | "dark", PaletteInput["hues"]>;
18
+ /** An sRGB colour (0–255 each) in OKLCH (Björn Ottosson's OKLab). */
19
+ export declare function rgbToOklch(r: number, g: number, b: number): OklchColor;
20
+ /** The colours of an image's RGBA pixels (a canvas's `getImageData().data`, small: a few thousand pixels), by hue
21
+ * bins of 30° and one bin of greys, each averaged in OKLab: the main colour is the fullest bin, the second the next;
22
+ * the vivid one the bin whose pixels are the most chromatic on average (of those covering `VIVID_SHARE` of the image),
23
+ * when it is chromatic enough.
24
+ * Transparent pixels are skipped; none left: undefined. */
25
+ export declare function wallpaperColours(pixels: ArrayLike<number>): WallpaperColours | undefined;
26
+ /** The theme's palette and paint seeds for `type`, from `colours` (none: T3 Code's). */
27
+ export declare function wallpaperPalette(colours: WallpaperColours | undefined, type: "light" | "dark"): {
28
+ input: PaletteInput;
29
+ paint: {
30
+ c1: OklchColor;
31
+ c2: OklchColor;
32
+ };
33
+ };
34
+ /** The theme's declarations for `type` from `colours`: every token, the paint seeds and the colour scheme. */
35
+ export declare function wallpaperThemeTokens(colours: WallpaperColours | undefined, type: "light" | "dark"): Record<string, string>;
36
+ /** `[data-theme="<id>"]`'s rule for `type` from `colours`, for a constructed style sheet. */
37
+ export declare const wallpaperThemeRule: (colours: WallpaperColours | undefined, type: "light" | "dark") => string;
package/package.json CHANGED
@@ -1,6 +1,90 @@
1
1
  {
2
2
  "name": "@bridgebrew/ui",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.10-next.79",
4
+ "description": "Bridge UI: the toolkit Bridge and its plugins draw with (served to every page as @bridge/ui).",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "engines": {
8
+ "bridge": ">=0.0.1"
9
+ },
10
+ "files": [
11
+ "src",
12
+ "!src/**/*.test.ts",
13
+ "!src/**/*.test.tsx",
14
+ "!src/test",
15
+ "dist",
16
+ "README.md",
17
+ "LICENSE",
18
+ "SOURCE.md"
19
+ ],
20
+ "exports": {
21
+ ".": {
22
+ "types": "./dist/types/index.d.ts",
23
+ "default": "./src/index.ts"
24
+ },
25
+ "./boot": {
26
+ "types": "./dist/types/theme/boot.d.ts",
27
+ "default": "./src/theme/boot.ts"
28
+ },
29
+ "./build": {
30
+ "types": "./dist/types/build/stylesheet.d.ts",
31
+ "default": "./dist/build.js"
32
+ },
33
+ "./theme-css": {
34
+ "types": "./dist/types/theme/theme-css.d.ts",
35
+ "default": "./dist/theme-css.js"
36
+ },
37
+ "./themes": {
38
+ "types": "./dist/types/theme/themes.d.ts",
39
+ "default": "./dist/themes.js"
40
+ },
41
+ "./testing": {
42
+ "types": "./dist/types/kit/check-rendering.d.ts",
43
+ "default": "./src/kit/check-rendering.tsx"
44
+ }
45
+ },
46
+ "dependencies": {
47
+ "@base-ui/react": "1.7.0",
48
+ "@dnd-kit/core": "6.3.1",
49
+ "@dnd-kit/sortable": "10.0.0",
50
+ "@dnd-kit/utilities": "3.2.2",
51
+ "@tailwindcss/oxide": "4.3.3",
52
+ "class-variance-authority": "0.7.1",
53
+ "clsx": "2.1.1",
54
+ "lucide-react": "1.48.0",
55
+ "react-resizable-panels": "4.7.1",
56
+ "tailwind-merge": "3.5.0",
57
+ "tailwindcss": "4.3.3",
58
+ "yaml": "2.8.3"
59
+ },
60
+ "peerDependencies": {
61
+ "@types/react": "^19.3.0",
62
+ "@types/react-dom": "^19.3.0",
63
+ "react": "19.3.0",
64
+ "react-dom": "19.3.0"
65
+ },
66
+ "peerDependenciesMeta": {
67
+ "@types/react": {
68
+ "optional": true
69
+ },
70
+ "@types/react-dom": {
71
+ "optional": true
72
+ }
73
+ },
74
+ "devDependencies": {
75
+ "@testing-library/dom": "10.4.2",
76
+ "@testing-library/jest-dom": "6.9.1",
77
+ "@testing-library/react": "16.3.3",
78
+ "@testing-library/user-event": "14.6.1",
79
+ "@types/node": "24.19.0",
80
+ "@types/react": "19.3.0",
81
+ "@types/react-dom": "19.3.0",
82
+ "esbuild": "0.28.2",
83
+ "react": "19.3.0",
84
+ "react-dom": "19.3.0",
85
+ "typescript": "7.0.2"
86
+ },
87
+ "scripts": {
88
+ "build": "node scripts/build.mjs"
89
+ }
6
90
  }
@@ -0,0 +1,128 @@
1
+ // Node-side entry of Bridge UI (`@bridge/ui/build`, research-078), for its host only: the kit's stylesheet compiled with
2
+ // the kit's own Tailwind, so the page's JavaScript and CSS always come from the same release and the Tailwind version is
3
+ // the kit's choice. One compile for the kit's sources and the host's own (two sheets in one `@layer utilities` cannot
4
+ // keep Tailwind's variant order: an element with `hidden md:flex` whose `hidden` lands in the later sheet stays hidden);
5
+ // a plugin outside the host's own gets its utilities apart, without the classes the kit's sheet already has.
6
+ import { readFileSync } from "node:fs";
7
+ import { createRequire } from "node:module";
8
+ import { dirname } from "node:path";
9
+ import { Scanner } from "@tailwindcss/oxide";
10
+ import { __unstable__loadDesignSystem as loadDesignSystem, compile } from "tailwindcss";
11
+ import { generateThemeCss } from "../theme/generate-tokens.ts";
12
+ import { kitSources } from "../theme/theme-css.ts";
13
+
14
+ /** Source files whose classes the stylesheet carries: absolute globs (`/a/b/**\/*.{ts,tsx}`), and those left out. */
15
+ export interface Sources {
16
+ include: string[];
17
+ exclude?: string[];
18
+ }
19
+
20
+ const require = createRequire(import.meta.url);
21
+
22
+ const tailwindInput = (
23
+ sources: string,
24
+ theme: string,
25
+ ) => `@layer theme, base, components, utilities;
26
+ @import "tailwindcss/theme.css" layer(theme);
27
+ @import "tailwindcss/utilities.css" layer(utilities);
28
+ ${sources}
29
+ ${theme}`;
30
+ const tailwindOptions = {
31
+ base: kitSources,
32
+ // The only imports: Tailwind's own stylesheets, a dependency of the kit.
33
+ loadStylesheet: async (id: string) => {
34
+ if (id !== "tailwindcss/theme.css" && id !== "tailwindcss/utilities.css")
35
+ throw new Error(`kit stylesheet: unexpected @import ${id}`);
36
+ const path = require.resolve(id);
37
+ return { path, base: dirname(path), content: readFileSync(path, "utf8") };
38
+ },
39
+ };
40
+
41
+ /** Tailwind's theme and utilities layers (no preflight) for the classes `sources` (`@source` lines) or else `content`
42
+ * use, but those in `skip`, with `theme`; with the classes found. */
43
+ const tailwind = async (sources: string, theme: string, content?: string, skip?: Set<string>) => {
44
+ const compiler = await compile(tailwindInput(sources, theme), tailwindOptions);
45
+ const classes =
46
+ content === undefined
47
+ ? new Scanner({ sources: compiler.sources }).scan()
48
+ : new Scanner({}).scanFiles([{ content, extension: "js" }]).filter((c) => !skip?.has(c));
49
+ return { css: compiler.build(classes), classes };
50
+ };
51
+
52
+ /** The `@theme` blocks of the theme CSS: the tokens as Tailwind knows them (`bg-surface`, `rounded-md`), without the
53
+ * `:root` values, the base rules and the keyframes the kit's stylesheet already puts on the page. */
54
+ const themeBlocks = (source: string) => {
55
+ // Without its comments: its header names `@theme` too.
56
+ const css = source.replace(/\/\*[\s\S]*?\*\//g, "");
57
+ const blocks: string[] = [];
58
+ for (let at = css.indexOf("@theme"); at !== -1; at = css.indexOf("@theme", at + 1)) {
59
+ let depth = 0;
60
+ let end = css.indexOf("{", at);
61
+ do depth += css[end] === "{" ? 1 : css[end] === "}" ? -1 : 0;
62
+ while (depth > 0 && ++end < css.length);
63
+ blocks.push(css.slice(at, end + 1));
64
+ at = end;
65
+ }
66
+ return blocks.join("\n");
67
+ };
68
+ const themes = new Map<string, string>();
69
+ const themeOf = (palettes: string) => {
70
+ let blocks = themes.get(palettes);
71
+ if (blocks === undefined)
72
+ themes.set(palettes, (blocks = themeBlocks(generateThemeCss(palettes))));
73
+ return blocks;
74
+ };
75
+
76
+ /** The kit's stylesheet: Tailwind's theme and utilities layers (no preflight: bare HTML elements stay the browser's, the
77
+ * kit resets only its own `[data-slot]` elements) for the classes the kit's sources (tests left out) and the host's
78
+ * `sources` use, and the theme tokens from the default themes' `palettes`. Not minified; with its classes, which a
79
+ * plugin's own utilities leave out (`compileUtilities`). */
80
+ export async function compileStylesheet({
81
+ sources,
82
+ palettes,
83
+ }: {
84
+ sources: Sources;
85
+ palettes: string;
86
+ }): Promise<{ css: string; classes: string[] }> {
87
+ const line = (rule: string, glob: string) => `${rule} ${JSON.stringify(glob)};`;
88
+ return tailwind(
89
+ [
90
+ line("@source", `${kitSources}/**/*.{ts,tsx}`),
91
+ line("@source not", `${kitSources}/**/*.test.{ts,tsx}`),
92
+ // This compile's own code names classes in its comments, never on an element.
93
+ line("@source not", `${kitSources}/build/**`),
94
+ ...sources.include.map((glob) => line("@source", glob)),
95
+ ...(sources.exclude ?? []).map((glob) => line("@source not", glob)),
96
+ ].join("\n"),
97
+ generateThemeCss(palettes),
98
+ );
99
+ }
100
+
101
+ /** A plugin outside the host's own: the Tailwind utilities its bundled `js` uses, in the kit's layers, so its classes
102
+ * work as in the host's own plugins, against the theme of `palettes` (only the variables a utility needs come with
103
+ * it). Without the classes in `skip` (the kit's stylesheet's): loaded after it, in the same layer, a plugin's `.hidden`
104
+ * would win over the kit's `@2xl/pm:flex` on the host's own elements. Not minified; `undefined` when it uses none. */
105
+ export async function compileUtilities({
106
+ js,
107
+ skip,
108
+ palettes,
109
+ }: {
110
+ js: string;
111
+ skip: Set<string>;
112
+ palettes: string;
113
+ }): Promise<string | undefined> {
114
+ const { css } = await tailwind("", themeOf(palettes), js, skip);
115
+ return /@layer utilities\s*\{\s*[^\s}]/.test(css) ? css : undefined;
116
+ }
117
+
118
+ /** Tailwind's classes and the theme's token names as the kit's stylesheet has them, for checking a plugin's own
119
+ * stylesheet. */
120
+ export async function stylesheetDesign(
121
+ palettes: string,
122
+ ): Promise<{ isUtility: (name: string) => boolean; tokens: Set<string> }> {
123
+ const design = await loadDesignSystem(tailwindInput("", themeOf(palettes)), tailwindOptions);
124
+ return {
125
+ isUtility: (name: string) => design.candidatesToCss([name])[0] != null,
126
+ tokens: new Set(generateThemeCss(palettes).match(/--[\w-]+(?=\s*:)/g)),
127
+ };
128
+ }