@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,55 @@
1
+ name: Label
2
+ description: "Semantic color tag with dot indicator for categorizing items such as bugs, features, and improvements."
3
+ layer: core
4
+ category: data-display
5
+ when_to_use:
6
+ - "For categorizing issues, tasks, or items (bug, feature, improvement)"
7
+ - "For colored tags in list views and detail panels"
8
+ - "For custom-colored labels using the color prop"
9
+ when_not_to_use:
10
+ - "For numeric counts — use Badge component"
11
+ - "For status indicators — use StatusIcon component"
12
+ - "For form labels — use a native <label> element"
13
+ composition_partners:
14
+ - Table (in category columns)
15
+ - Properties (as value display)
16
+ - ListRow (as category indicator)
17
+ props:
18
+ - name: variant
19
+ type: "'bug' | 'feature' | 'improvement'"
20
+ required: false
21
+ description: "Predefined color scheme for common category types"
22
+ - name: color
23
+ type: string
24
+ required: false
25
+ description: "Custom color override (any CSS color string). When provided, overrides variant colors using OKLCH mixing."
26
+ - name: shape
27
+ type: "'square' | 'round'"
28
+ required: false
29
+ default: "'square'"
30
+ description: "square is the default chip (rounded-sm); round is a pill (rounded-full, with px-2 padding)"
31
+ - name: children
32
+ type: React.ReactNode
33
+ required: false
34
+ description: "Label text content"
35
+ props_priority:
36
+ - variant
37
+ - color
38
+ - shape
39
+ - children
40
+ variants:
41
+ - bug: "Red tones — for bug reports and defects"
42
+ - feature: "Purple tones — for feature requests and new functionality"
43
+ - improvement: "Blue tones — for enhancements and optimizations"
44
+ examples:
45
+ - title: "Bug label"
46
+ code: '<Label variant="bug">Bug</Label>'
47
+ - title: "Feature label"
48
+ code: '<Label variant="feature">Feature</Label>'
49
+ - title: "Custom color label"
50
+ code: '<Label color="#e08a20">Design</Label>'
51
+ anti_patterns:
52
+ - "Don't use both variant and color simultaneously — color overrides variant, which is confusing"
53
+ - "Don't use for form field labels — this is a visual tag, not a form label element"
54
+ - "Don't override the dot indicator styles — they're part of the component design"
55
+ accessibility_notes: "Renders as a <span> with a visual dot indicator. The text content provides meaning. For additional context, wrap in an element with aria-label."
@@ -0,0 +1,72 @@
1
+ import * as React from "react";
2
+ import { cva, type VariantProps } from "class-variance-authority";
3
+
4
+ import { cn } from "../../../lib/utils";
5
+
6
+ // Optical centring (Bridge): 1px bottom padding lifts the 12px label to the pill's centre; the dot
7
+ // keeps the pill's centre (-1px bottom margin). One line (Bridge): a fixed-height chip never wraps its text.
8
+ const labelVariants = cva(
9
+ "pb-px inline-flex items-center gap-1 h-[18px] px-1.5 text-xs font-medium whitespace-nowrap select-none",
10
+ {
11
+ variants: {
12
+ variant: {
13
+ bug: "bg-label-bug-bg text-label-bug-fg",
14
+ feature: "bg-label-feature-bg text-label-feature-fg",
15
+ improvement: "bg-label-improvement-bg text-label-improvement-fg",
16
+ },
17
+ shape: {
18
+ square: "rounded-sm",
19
+ round: "rounded-full px-2",
20
+ },
21
+ },
22
+ defaultVariants: {
23
+ shape: "square",
24
+ },
25
+ },
26
+ );
27
+
28
+ type LabelVariant = "bug" | "feature" | "improvement";
29
+
30
+ const dotColorMap: Record<LabelVariant, string> = {
31
+ bug: "bg-label-bug-dot",
32
+ feature: "bg-label-feature-dot",
33
+ improvement: "bg-label-improvement-dot",
34
+ };
35
+
36
+ interface LabelProps extends React.ComponentProps<"span">, VariantProps<typeof labelVariants> {
37
+ color?: string;
38
+ }
39
+
40
+ function Label({ className, variant, shape, color, children, style, ...props }: LabelProps) {
41
+ const useCustom = !!color;
42
+ return (
43
+ <span
44
+ data-slot="label"
45
+ className={cn(labelVariants({ variant: useCustom ? undefined : variant, shape, className }))}
46
+ style={
47
+ useCustom
48
+ ? {
49
+ ...style,
50
+ // oklab (Bridge): in oklch the hue travels from the neutral surface's hue 0, turning a yellow pink.
51
+ backgroundColor: `color-mix(in oklab, ${color} 12%, var(--bg-surface))`,
52
+ color: color,
53
+ }
54
+ : style
55
+ }
56
+ {...props}
57
+ >
58
+ <span
59
+ aria-hidden="true"
60
+ className={cn(
61
+ "size-[7px] rounded-full shrink-0 -mb-px",
62
+ !useCustom && variant && dotColorMap[variant],
63
+ )}
64
+ style={useCustom ? { backgroundColor: color } : undefined}
65
+ />
66
+ {children}
67
+ </span>
68
+ );
69
+ }
70
+
71
+ export { Label, labelVariants };
72
+ export type { LabelProps, LabelVariant };
@@ -0,0 +1,2 @@
1
+ export { MainContent } from "./main-content";
2
+ export type { MainContentProps } from "./main-content";
@@ -0,0 +1,23 @@
1
+ name: MainContent
2
+ description: "The content of a main pane, single or multiple (SinglePane's content, MultiPane's main, a Detail): its margins and its column, centred, at one of three widths. The one place that decides a screen's column for all of Bridge: no screen draws its own. It does not scroll; its pane does."
3
+ layer: core
4
+ category: layout
5
+ when_to_use:
6
+ - "Everything a main pane shows: a settings page, a record, a document, a page of samples"
7
+ - "read (default) for a column to read, wide for a wider page, full for a large table or a dashboard"
8
+ when_not_to_use:
9
+ - "In nav or aside (a list's column): use Pane"
10
+ - "Inside SinglePane or Detail, which already hold one"
11
+ props:
12
+ - name: width
13
+ type: '"read" | "wide" | "full"'
14
+ required: false
15
+ description: "read (default): 720px of content at most; wide: 1040px; full: the whole width. Narrow, all take the width"
16
+ composition_partners:
17
+ - SinglePane (holds one, its width)
18
+ - MultiPane (in its main pane)
19
+ - Detail (holds one, read)
20
+ - ScrollArea (the pane that scrolls around it)
21
+ anti_patterns:
22
+ - "A div of its own with max-width and padding around a screen's content: the column is MainContent's"
23
+ notes: "Sub-parts by data-slot: main-content (the full pane, a container), main-content-column (the column, its props). data-width carries the width."
@@ -0,0 +1,49 @@
1
+ import * as React from "react";
2
+
3
+ import { cn } from "../../../lib/utils";
4
+
5
+ // research-070: one content wrapper for the main panes, single or multiple (SinglePane's content, MultiPane's `main`, a
6
+ // Detail), never `nav` or `aside`. It alone decides, for all of Bridge, the column's width, its margins and its
7
+ // alignment (centred, owner, 12 November 2026), so no screen draws its own column. It does not scroll: its pane does.
8
+
9
+ const widths = {
10
+ /** A column to read: a record, settings, a document. */
11
+ read: "max-w-[800px]",
12
+ /** A wider column: a page of samples, settings with two columns. */
13
+ wide: "max-w-[1120px]",
14
+ /** The whole width: a large table, a dashboard. */
15
+ full: "",
16
+ } as const;
17
+
18
+ interface MainContentProps extends React.ComponentProps<"div"> {
19
+ /** `read` (default): a column of 720px at most; `wide`: 1040px; `full`: the whole width. Narrow, all take the width. */
20
+ width?: keyof typeof widths;
21
+ }
22
+
23
+ /** The main pane's content: its margins (16px, 40px from 640px of pane), its column centred. Its props go to the
24
+ * column (`aria-label`, `className`). */
25
+ function MainContent({ width = "read", className, children, ...props }: MainContentProps) {
26
+ return (
27
+ <div
28
+ data-slot="main-content"
29
+ data-width={width}
30
+ className="@container/main-content flex min-h-0 w-full min-w-0 flex-1 flex-col"
31
+ >
32
+ <div
33
+ data-slot="main-content-column"
34
+ className={cn(
35
+ // The width counts the margins (box-border): read 720px and wide 1040px of content, 40px each side.
36
+ "mx-auto box-border w-full px-4 pt-4 pb-16 @min-[640px]/main-content:px-10 @min-[640px]/main-content:pt-8",
37
+ widths[width],
38
+ className,
39
+ )}
40
+ {...props}
41
+ >
42
+ {children}
43
+ </div>
44
+ </div>
45
+ );
46
+ }
47
+
48
+ export { MainContent };
49
+ export type { MainContentProps };
@@ -0,0 +1 @@
1
+ export { Pane, PaneHeader, PaneBody, PaneFooter, PaneNote } from "./pane";
@@ -0,0 +1,13 @@
1
+ name: Pane
2
+ description: 'A list''s column: PaneHeader (a toolbar whose first control, a search, grows), PaneBody (scrolls), PaneFooter (a count, its filters, the selection) and PaneNote (the list''s last line, "Loading…" while a next page waits).'
3
+ layer: core
4
+ category: layout
5
+ when_to_use:
6
+ - "The list side of a list-and-card screen (Contacts, Organizations)"
7
+ when_not_to_use:
8
+ - "A record's page — use Detail"
9
+ composition_partners:
10
+ - Input (the search, first in PaneHeader)
11
+ - List (variant records, in PaneBody)
12
+ - EmptyState (in PaneBody when nothing shows)
13
+ - ListSkeleton (in PaneBody while loading)
@@ -0,0 +1,64 @@
1
+ import * as React from "react";
2
+
3
+ import { cn } from "../../../lib/utils";
4
+ import { ScrollArea } from "../scroll-area";
5
+
6
+ // A list's column (research-033's mockup, Contacts the reference): a toolbar on top (a search that grows, then icon
7
+ // buttons), a body that scrolls, a footer (a count, filters, a selection). And the list's last line: "Loading…"
8
+ // while a next page waits.
9
+
10
+ function Pane({ className, ...props }: React.ComponentProps<"section">) {
11
+ return (
12
+ <section
13
+ data-slot="pane"
14
+ className={cn("flex h-full min-w-0 flex-col", className)}
15
+ {...props}
16
+ />
17
+ );
18
+ }
19
+
20
+ /** The pane's toolbar: its first control (a search, or the KeyHint around it) grows. */
21
+ function PaneHeader({ className, ...props }: React.ComponentProps<"div">) {
22
+ return (
23
+ <div
24
+ data-slot="pane-header"
25
+ className={cn(
26
+ "flex items-center gap-2 pt-2.5 pr-2 pb-2 pl-3 [&>*:first-child]:min-w-0 [&>*:first-child]:flex-1",
27
+ className,
28
+ )}
29
+ {...props}
30
+ />
31
+ );
32
+ }
33
+
34
+ /** The pane's scrolling body. */
35
+ function PaneBody({ className, ...props }: React.ComponentProps<typeof ScrollArea>) {
36
+ return <ScrollArea className={cn("min-h-0 min-w-0 flex-1", className)} {...props} />;
37
+ }
38
+
39
+ /** The pane's footer: a count, its filters, the selection (a `strong` stands out); muted, tabular figures. */
40
+ function PaneFooter({ className, ...props }: React.ComponentProps<"footer">) {
41
+ return (
42
+ <footer
43
+ data-slot="pane-footer"
44
+ className={cn(
45
+ "flex flex-wrap items-center gap-1.5 border-t-[0.5px] border-border-subtle px-4 py-2 text-[12px] leading-[normal] text-muted tabular-nums [&_strong]:font-medium [&_strong]:text-foreground",
46
+ className,
47
+ )}
48
+ {...props}
49
+ />
50
+ );
51
+ }
52
+
53
+ /** A list's last line ("Loading…" while its next page waits); a ref on it loads that page once in view. */
54
+ function PaneNote({ className, ...props }: React.ComponentProps<"div">) {
55
+ return (
56
+ <div
57
+ data-slot="pane-note"
58
+ className={cn("px-4 py-2 text-[12px] leading-[normal] text-muted", className)}
59
+ {...props}
60
+ />
61
+ );
62
+ }
63
+
64
+ export { Pane, PaneHeader, PaneBody, PaneFooter, PaneNote };
@@ -0,0 +1,4 @@
1
+ export { DataMenuTrigger, PickMenu, PickSelect } from "./pick-menu";
2
+ export type { DataMenuTriggerProps, PickMenuProps, PickOption, PickSelectProps } from "./pick-menu";
3
+ export { TagMenu } from "./tag-menu";
4
+ export type { TagMenuProps, TagCount } from "./tag-menu";
@@ -0,0 +1,36 @@
1
+ name: PickMenu
2
+ description: "A keyboard-first menu opened from anywhere and anchored to an element (research-033's mockup openMenu): a search, options with an icon, a label, a quiet note and a check, 1-9 to pick, 'Create “…”', a footer hint; multiple stays open with checkboxes."
3
+ layer: core
4
+ category: input
5
+ when_to_use:
6
+ - "Tags of a record or of a selection (multiple, onCreate), opened from a + button, a key (L), the selection bar or a row's menu"
7
+ - "A filter over a list (multiple, a count as each option's note)"
8
+ - "One value picked from a list without a pill of its own (an organization from the selection bar)"
9
+ when_not_to_use:
10
+ - "A property pill on a card with one value — Picker"
11
+ - "In a form — Select or Combobox"
12
+ props:
13
+ - name: open / onOpenChange
14
+ type: "boolean / (open: boolean) => void"
15
+ required: true
16
+ description: "Controlled; Escape or a click outside close it"
17
+ - name: anchor
18
+ type: "Element | null"
19
+ required: true
20
+ description: "What it opens next to"
21
+ - name: options / onPick
22
+ type: "PickOption[] / (option) => void"
23
+ required: true
24
+ description: "{ key, label, icon?, note?, checked? }; filtered here by label as the user types"
25
+ - name: multiple
26
+ type: boolean
27
+ required: false
28
+ description: "Checkboxes; stays open after a pick"
29
+ - name: onCreate
30
+ type: "(text: string) => void"
31
+ required: false
32
+ description: "Offers 'Create “text”' for a typed text no option's label is"
33
+ - name: placeholder / footer / aria-label
34
+ type: "string / ReactNode / string"
35
+ required: false
36
+ description: "The search's placeholder; a quiet hint under the options; the menu's name"
@@ -0,0 +1,348 @@
1
+ import * as React from "react";
2
+ import { Popover as PopoverPrimitive } from "@base-ui/react/popover";
3
+ import { CSPProvider } from "@base-ui/react/csp-provider";
4
+
5
+ import { cn } from "../../../lib/utils";
6
+ import { noAutofill } from "../input/input";
7
+ import { ScrollArea } from "../scroll-area";
8
+ import { isComposing } from "../../../lib/keys";
9
+
10
+ // research-033's mockup `openMenu`: a keyboard-first menu opened from anywhere (a + on a card, the selection bar, a row's
11
+ // right-click, a key), anchored to an element: a search, the options (an icon, a label, a quiet count or note, checked
12
+ // or not), 1-9 to pick while nothing is typed, "Create “…”" for a text no option has, and a footer hint. `multiple`
13
+ // (tags, a filter): checkboxes, and the menu stays open after a pick. The options are the caller's, filtered here by
14
+ // their label; a `none` option ("No organization") stays whatever is typed and takes 0. A single menu opens on its
15
+ // checked option.
16
+
17
+ interface PickOption {
18
+ key: string;
19
+ label: string;
20
+ /** Before the label (a tag's dot, an avatar). */
21
+ icon?: React.ReactNode;
22
+ /** After the label, quieter (a count, a website). */
23
+ note?: string;
24
+ checked?: boolean;
25
+ /** The "none" choice ("No organization"): first, shown whatever is typed, picked with 0. */
26
+ none?: boolean;
27
+ }
28
+
29
+ interface PickMenuProps {
30
+ open: boolean;
31
+ onOpenChange: (open: boolean) => void;
32
+ /** What it opens next to. */
33
+ anchor: Element | null;
34
+ options: readonly PickOption[];
35
+ onPick: (option: PickOption) => void;
36
+ /** Checkboxes, and the menu stays open after a pick. */
37
+ multiple?: boolean;
38
+ /** Offers "Create “text”" for a typed text no option's label is (any case). */
39
+ onCreate?: (text: string) => void;
40
+ placeholder?: string;
41
+ /** The caller searches (a server) as one types: `options` are its answer for the text, not filtered here. */
42
+ onSearch?: (text: string) => void;
43
+ /** Said when no option shows ("No match" by default): a search on its way, or its failure. */
44
+ emptyText?: string;
45
+ /** Under the options, quieter ("Enter toggles · Esc closes"). */
46
+ footer?: React.ReactNode;
47
+ "aria-label"?: string;
48
+ }
49
+
50
+ function PickMenu({
51
+ open,
52
+ onOpenChange,
53
+ anchor,
54
+ options,
55
+ onPick,
56
+ multiple = false,
57
+ onCreate,
58
+ placeholder = "Search…",
59
+ onSearch,
60
+ emptyText = "No match",
61
+ footer,
62
+ "aria-label": ariaLabel,
63
+ }: PickMenuProps) {
64
+ const [text, setText] = React.useState("");
65
+ const [active, setActive] = React.useState(-1);
66
+ const id = React.useId();
67
+ const query = text.trim().toLowerCase();
68
+ const shown =
69
+ query && !onSearch
70
+ ? options.filter((each) => each.none || each.label.toLowerCase().includes(query))
71
+ : options;
72
+ const checkedAt = multiple ? -1 : shown.findIndex((each) => each.checked);
73
+ React.useEffect(() => {
74
+ if (open) return;
75
+ setText("");
76
+ setActive(-1);
77
+ }, [open]);
78
+ // 1-9 number the options but `none` (0).
79
+ const numbers = shown.map((each, index) =>
80
+ each.none ? 0 : index - shown.slice(0, index).filter((one) => one.none).length + 1,
81
+ );
82
+ const create =
83
+ onCreate && query && !options.some((each) => each.label.toLowerCase() === query)
84
+ ? text.trim()
85
+ : undefined;
86
+ const rows = shown.length + (create ? 1 : 0);
87
+ // Nothing moved yet: on the checked option; with a text typed, on its first match (not `none`).
88
+ const first = query ? shown.findIndex((each) => !each.none) : checkedAt;
89
+ const at = Math.min(active < 0 ? Math.max(0, first) : active, Math.max(0, rows - 1));
90
+ const choose = (index: number) => {
91
+ if (index < shown.length) onPick(shown[index]!);
92
+ else if (create !== undefined) {
93
+ onCreate!(create);
94
+ setText("");
95
+ }
96
+ if (!multiple) onOpenChange(false);
97
+ };
98
+ const onKeyDown = (event: React.KeyboardEvent) => {
99
+ if (isComposing(event)) return;
100
+ if (event.key === "ArrowDown") {
101
+ event.preventDefault();
102
+ setActive((at + 1) % Math.max(1, rows));
103
+ } else if (event.key === "ArrowUp") {
104
+ event.preventDefault();
105
+ setActive((at - 1 + rows) % Math.max(1, rows));
106
+ } else if (event.key === "Enter") {
107
+ event.preventDefault();
108
+ // A text typed and nothing matching it yet (a search on its way): not `none` by default.
109
+ if (query && active < 0 && first < 0 && create === undefined) return;
110
+ if (rows) choose(at);
111
+ } else if (!text && /^[0-9]$/.test(event.key)) {
112
+ // 0-9 pick while nothing is typed.
113
+ const index = numbers.indexOf(Number(event.key));
114
+ if (index < 0) return;
115
+ event.preventDefault();
116
+ choose(index);
117
+ }
118
+ };
119
+ React.useEffect(() => {
120
+ document.getElementById(`${id}-${at}`)?.scrollIntoView?.({ block: "nearest" });
121
+ }, [at, id]);
122
+ // Closed, nothing at all: a closed Base UI popover kept mounted against an anchor that re-renders (a card) made that
123
+ // anchor render again and again.
124
+ if (!open) return null;
125
+ return (
126
+ <PopoverPrimitive.Root open={open} onOpenChange={(next) => onOpenChange(next)}>
127
+ <CSPProvider disableStyleElements>
128
+ <PopoverPrimitive.Portal>
129
+ <PopoverPrimitive.Positioner
130
+ anchor={anchor}
131
+ side="bottom"
132
+ align="start"
133
+ sideOffset={4}
134
+ className="z-50"
135
+ >
136
+ <PopoverPrimitive.Popup
137
+ data-slot="pick-menu"
138
+ aria-label={ariaLabel}
139
+ className="flex max-h-[340px] w-[min(300px,92vw)] min-w-56 flex-col rounded-dropdown bg-surface text-sm outline-none"
140
+ style={{ boxShadow: "var(--shadow-dropdown)" }}
141
+ >
142
+ <input
143
+ autoFocus
144
+ autoComplete={noAutofill}
145
+ role="combobox"
146
+ aria-expanded="true"
147
+ aria-controls={`${id}-list`}
148
+ aria-activedescendant={rows ? `${id}-${at}` : undefined}
149
+ aria-label={ariaLabel ? `Search ${ariaLabel}` : "Search"}
150
+ value={text}
151
+ placeholder={placeholder}
152
+ onChange={(event) => {
153
+ setText(event.target.value);
154
+ setActive(-1);
155
+ onSearch?.(event.target.value);
156
+ }}
157
+ onKeyDown={onKeyDown}
158
+ className="h-lg shrink-0 border-0 border-b-[0.5px] border-border bg-transparent px-3 text-sm text-foreground outline-none placeholder:text-placeholder"
159
+ />
160
+ <ScrollArea className="flex min-h-0 flex-col" viewportClassName="min-h-0 flex-1">
161
+ <div
162
+ id={`${id}-list`}
163
+ role="listbox"
164
+ aria-multiselectable={multiple || undefined}
165
+ className="p-1"
166
+ >
167
+ {shown.map((option, index) => (
168
+ <div
169
+ key={option.key}
170
+ id={`${id}-${index}`}
171
+ role="option"
172
+ data-label={option.label}
173
+ aria-selected={option.checked ?? false}
174
+ data-highlighted={index === at || undefined}
175
+ onMouseMove={() => setActive(index)}
176
+ onMouseDown={(event) => event.preventDefault()}
177
+ onClick={() => choose(index)}
178
+ className="flex h-md cursor-pointer items-center gap-2 rounded-control px-2 data-highlighted:bg-hover"
179
+ >
180
+ {multiple && (
181
+ <span
182
+ aria-hidden="true"
183
+ className={cn(
184
+ "flex size-3.5 shrink-0 items-center justify-center rounded-[3px] border-[0.5px]",
185
+ option.checked ? "border-accent bg-accent text-white" : "border-input",
186
+ )}
187
+ >
188
+ {option.checked && (
189
+ <svg viewBox="0 0 10 10" className="size-2.5">
190
+ <path
191
+ d="M2 5.2 4 7l4-4.4"
192
+ fill="none"
193
+ stroke="currentColor"
194
+ strokeWidth="1.5"
195
+ />
196
+ </svg>
197
+ )}
198
+ </span>
199
+ )}
200
+ {option.icon}
201
+ <span className="min-w-0 flex-1 truncate">
202
+ {option.label}
203
+ {option.note && (
204
+ <span className="ml-1.5 text-xs text-muted">{option.note}</span>
205
+ )}
206
+ </span>
207
+ {!multiple && option.checked && (
208
+ <span className="text-xs text-accent">✓</span>
209
+ )}
210
+ {!text && numbers[index]! <= 9 && (
211
+ <span
212
+ aria-hidden="true"
213
+ className="w-3 shrink-0 text-right text-xs text-muted tabular-nums"
214
+ >
215
+ {numbers[index]}
216
+ </span>
217
+ )}
218
+ </div>
219
+ ))}
220
+ {create !== undefined && (
221
+ <>
222
+ {shown.length > 0 && <div className="mx-[-4px] my-1 h-px bg-border" />}
223
+ <div
224
+ id={`${id}-${shown.length}`}
225
+ role="option"
226
+ aria-selected={false}
227
+ data-highlighted={at === shown.length || undefined}
228
+ onMouseMove={() => setActive(shown.length)}
229
+ onMouseDown={(event) => event.preventDefault()}
230
+ onClick={() => choose(shown.length)}
231
+ className="flex h-md cursor-pointer items-center gap-2 rounded-control px-2 data-highlighted:bg-hover"
232
+ >
233
+ Create “{create}”
234
+ </div>
235
+ </>
236
+ )}
237
+ {create === undefined && shown.every((each) => each.none) && (
238
+ <div role="status" className="px-2 py-1.5 text-muted">
239
+ {emptyText}
240
+ </div>
241
+ )}
242
+ </div>
243
+ </ScrollArea>
244
+ {footer && (
245
+ <div
246
+ data-slot="pick-menu-footer"
247
+ className="border-t-[0.5px] border-border px-3 py-1.5 text-[11px] text-muted"
248
+ >
249
+ {footer}
250
+ </div>
251
+ )}
252
+ </PopoverPrimitive.Popup>
253
+ </PopoverPrimitive.Positioner>
254
+ </PopoverPrimitive.Portal>
255
+ </CSPProvider>
256
+ </PopoverPrimitive.Root>
257
+ );
258
+ }
259
+
260
+ interface DataMenuTriggerProps extends React.ComponentProps<"button"> {
261
+ /** Nothing chosen yet ("Set organization"): muted. */
262
+ empty?: boolean;
263
+ /** Height, as Button's and Input's (h-sm, h-md, h-lg). Defaults to `default` (h-md). */
264
+ size?: "sm" | "default" | "lg" | undefined;
265
+ }
266
+
267
+ const dataMenuTriggerSizes = { sm: "h-sm", default: "h-md", lg: "h-lg" } as const;
268
+
269
+ /** A data menu's trigger, as Linear's properties: an icon and a label, no border, a background on hover; an input's height and text, so it lines up with the fields beside. Its icon
270
+ * sits on the value column's edge. */
271
+ function DataMenuTrigger({
272
+ empty = false,
273
+ size = "default",
274
+ className,
275
+ type = "button",
276
+ ...props
277
+ }: DataMenuTriggerProps) {
278
+ return (
279
+ <button
280
+ type={type}
281
+ data-slot="data-menu-trigger"
282
+ data-empty={empty || undefined}
283
+ data-size={size}
284
+ className={cn(
285
+ dataMenuTriggerSizes[size],
286
+ "-ml-1.5 inline-flex max-w-full min-w-0 shrink-0 cursor-pointer items-center gap-1.5 whitespace-nowrap rounded-control border-0 bg-transparent px-1.5 font-[inherit] text-sm leading-[normal] text-foreground outline-none hover:bg-hover focus-visible:bg-hover disabled:cursor-default disabled:hover:bg-transparent [&_svg]:shrink-0 [&_svg]:text-muted",
287
+ empty && "text-muted",
288
+ className,
289
+ )}
290
+ {...props}
291
+ />
292
+ );
293
+ }
294
+
295
+ interface PickSelectProps {
296
+ value: string;
297
+ options: readonly Omit<PickOption, "checked">[];
298
+ onChange: (key: string) => void;
299
+ /** The pill's and the menu's accessible name. */
300
+ "aria-label": string;
301
+ disabled?: boolean;
302
+ /** Its trigger's height (DataMenuTrigger's `size`). */
303
+ size?: DataMenuTriggerProps["size"];
304
+ className?: string;
305
+ }
306
+
307
+ /** Linear's data menu for one value among a few (an email's kind): its trigger, a PickMenu on its checked option. */
308
+ function PickSelect({
309
+ value,
310
+ options,
311
+ onChange,
312
+ disabled,
313
+ size,
314
+ className,
315
+ ...props
316
+ }: PickSelectProps) {
317
+ const [open, setOpen] = React.useState(false);
318
+ const [anchor, setAnchor] = React.useState<HTMLButtonElement | null>(null);
319
+ const current = options.find((each) => each.key === value);
320
+ return (
321
+ <>
322
+ <DataMenuTrigger
323
+ ref={setAnchor}
324
+ aria-label={props["aria-label"]}
325
+ aria-haspopup="listbox"
326
+ aria-expanded={open}
327
+ disabled={disabled}
328
+ size={size}
329
+ className={className}
330
+ onClick={() => setOpen(true)}
331
+ >
332
+ {current?.icon}
333
+ {current?.label ?? value}
334
+ </DataMenuTrigger>
335
+ <PickMenu
336
+ open={open}
337
+ onOpenChange={setOpen}
338
+ anchor={anchor}
339
+ aria-label={props["aria-label"]}
340
+ options={options.map((each) => ({ ...each, checked: each.key === value }))}
341
+ onPick={(option) => onChange(option.key)}
342
+ />
343
+ </>
344
+ );
345
+ }
346
+
347
+ export { DataMenuTrigger, PickMenu, PickSelect };
348
+ export type { DataMenuTriggerProps, PickMenuProps, PickOption, PickSelectProps };