cursedbelt 5.40.0 → 5.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (499) hide show
  1. package/dist/react/Toast.d.ts +12 -2
  2. package/dist/react/Toast.d.ts.map +1 -1
  3. package/dist/react/Toast.js +32 -3
  4. package/dist/react/Toast.js.map +1 -1
  5. package/dist/react/analytics/MetricDrilldown.js +1 -1
  6. package/dist/react/charts/AreaChart.d.ts.map +1 -1
  7. package/dist/react/charts/AreaChart.js +5 -5
  8. package/dist/react/charts/AreaChart.js.map +1 -1
  9. package/dist/react/charts/BarChart.d.ts.map +1 -1
  10. package/dist/react/charts/BarChart.js +3 -3
  11. package/dist/react/charts/BarChart.js.map +1 -1
  12. package/dist/react/charts/ChartCard.d.ts +53 -0
  13. package/dist/react/charts/ChartCard.d.ts.map +1 -0
  14. package/dist/react/charts/ChartCard.js +46 -0
  15. package/dist/react/charts/ChartCard.js.map +1 -0
  16. package/dist/react/charts/ChartFrame.d.ts +12 -5
  17. package/dist/react/charts/ChartFrame.d.ts.map +1 -1
  18. package/dist/react/charts/ChartFrame.js +12 -5
  19. package/dist/react/charts/ChartFrame.js.map +1 -1
  20. package/dist/react/charts/ChartLegend.js +1 -1
  21. package/dist/react/charts/ChartLegend.js.map +1 -1
  22. package/dist/react/charts/HeatmapChart.js +3 -3
  23. package/dist/react/charts/HeatmapChart.js.map +1 -1
  24. package/dist/react/charts/IntervalTimeline.js +1 -1
  25. package/dist/react/charts/IntervalTimeline.js.map +1 -1
  26. package/dist/react/charts/LineChart.d.ts.map +1 -1
  27. package/dist/react/charts/LineChart.js +3 -3
  28. package/dist/react/charts/LineChart.js.map +1 -1
  29. package/dist/react/charts/TimeSeriesChart.d.ts.map +1 -1
  30. package/dist/react/charts/TimeSeriesChart.js +6 -6
  31. package/dist/react/charts/TimeSeriesChart.js.map +1 -1
  32. package/dist/react/charts/chartBox.d.ts +46 -0
  33. package/dist/react/charts/chartBox.d.ts.map +1 -0
  34. package/dist/react/charts/chartBox.js +45 -0
  35. package/dist/react/charts/chartBox.js.map +1 -0
  36. package/dist/react/charts/index.d.ts +2 -0
  37. package/dist/react/charts/index.d.ts.map +1 -1
  38. package/dist/react/charts/index.js +2 -0
  39. package/dist/react/charts/index.js.map +1 -1
  40. package/dist/react/charts/shared.d.ts +13 -2
  41. package/dist/react/charts/shared.d.ts.map +1 -1
  42. package/dist/react/charts/shared.js +14 -3
  43. package/dist/react/charts/shared.js.map +1 -1
  44. package/dist/react/chat/Bubble.js +4 -4
  45. package/dist/react/chat/Bubble.js.map +1 -1
  46. package/dist/react/chat/MessageScroller.js +1 -1
  47. package/dist/react/chat/MessageScroller.js.map +1 -1
  48. package/dist/react/components/ActionBar.d.ts.map +1 -1
  49. package/dist/react/components/ActionBar.js +63 -1
  50. package/dist/react/components/ActionBar.js.map +1 -1
  51. package/dist/react/components/AddItemsMenu.js +1 -1
  52. package/dist/react/components/AddItemsMenu.js.map +1 -1
  53. package/dist/react/components/Alert.d.ts +16 -2
  54. package/dist/react/components/Alert.d.ts.map +1 -1
  55. package/dist/react/components/Alert.js +35 -2
  56. package/dist/react/components/Alert.js.map +1 -1
  57. package/dist/react/components/AppShell.d.ts +55 -33
  58. package/dist/react/components/AppShell.d.ts.map +1 -1
  59. package/dist/react/components/AppShell.js +121 -31
  60. package/dist/react/components/AppShell.js.map +1 -1
  61. package/dist/react/components/AsyncPanel.d.ts +21 -3
  62. package/dist/react/components/AsyncPanel.d.ts.map +1 -1
  63. package/dist/react/components/AsyncPanel.js +49 -5
  64. package/dist/react/components/AsyncPanel.js.map +1 -1
  65. package/dist/react/components/BannerLane.d.ts +32 -0
  66. package/dist/react/components/BannerLane.d.ts.map +1 -0
  67. package/dist/react/components/BannerLane.js +41 -0
  68. package/dist/react/components/BannerLane.js.map +1 -0
  69. package/dist/react/components/Button.d.ts.map +1 -1
  70. package/dist/react/components/Button.js +2 -1
  71. package/dist/react/components/Button.js.map +1 -1
  72. package/dist/react/components/ChipFilterStrip.js +1 -1
  73. package/dist/react/components/ChipFilterStrip.js.map +1 -1
  74. package/dist/react/components/ComboboxField.d.ts.map +1 -1
  75. package/dist/react/components/ComboboxField.js +14 -4
  76. package/dist/react/components/ComboboxField.js.map +1 -1
  77. package/dist/react/components/CommentThread.js +2 -2
  78. package/dist/react/components/CommentThread.js.map +1 -1
  79. package/dist/react/components/ConfirmDialog.js +1 -1
  80. package/dist/react/components/ConfirmDialog.js.map +1 -1
  81. package/dist/react/components/DataTable/DataTable.d.ts +18 -2
  82. package/dist/react/components/DataTable/DataTable.d.ts.map +1 -1
  83. package/dist/react/components/DataTable/DataTable.js +51 -12
  84. package/dist/react/components/DataTable/DataTable.js.map +1 -1
  85. package/dist/react/components/DataTable/Pagination.js +1 -1
  86. package/dist/react/components/DataTable/Pagination.js.map +1 -1
  87. package/dist/react/components/DataTable/RowActions.d.ts +7 -1
  88. package/dist/react/components/DataTable/RowActions.d.ts.map +1 -1
  89. package/dist/react/components/DataTable/RowActions.js +10 -3
  90. package/dist/react/components/DataTable/RowActions.js.map +1 -1
  91. package/dist/react/components/DataTable/TableFilterBuilder.js +1 -1
  92. package/dist/react/components/DataTable/TableFilterBuilder.js.map +1 -1
  93. package/dist/react/components/DataTable/cells/CodeCell.js +1 -1
  94. package/dist/react/components/DataTable/cells/CodeCell.js.map +1 -1
  95. package/dist/react/components/DataTable/cells/LinkCell.js +1 -1
  96. package/dist/react/components/DataTable/cells/LinkCell.js.map +1 -1
  97. package/dist/react/components/DataTable/index.d.ts +1 -1
  98. package/dist/react/components/DataTable/index.d.ts.map +1 -1
  99. package/dist/react/components/DataTable/index.js.map +1 -1
  100. package/dist/react/components/DataTable/types.d.ts +20 -0
  101. package/dist/react/components/DataTable/types.d.ts.map +1 -1
  102. package/dist/react/components/DataTable/types.js +22 -0
  103. package/dist/react/components/DataTable/types.js.map +1 -1
  104. package/dist/react/components/DateTimeField.d.ts.map +1 -1
  105. package/dist/react/components/DateTimeField.js +4 -1
  106. package/dist/react/components/DateTimeField.js.map +1 -1
  107. package/dist/react/components/DeleteButton.js +2 -0
  108. package/dist/react/components/DeleteButton.js.map +1 -1
  109. package/dist/react/components/Drawer.js +3 -3
  110. package/dist/react/components/Drawer.js.map +1 -1
  111. package/dist/react/components/DropdownMenu.d.ts +16 -0
  112. package/dist/react/components/DropdownMenu.d.ts.map +1 -1
  113. package/dist/react/components/DropdownMenu.js +22 -6
  114. package/dist/react/components/DropdownMenu.js.map +1 -1
  115. package/dist/react/components/EmptyState.d.ts +10 -2
  116. package/dist/react/components/EmptyState.d.ts.map +1 -1
  117. package/dist/react/components/EmptyState.js +10 -5
  118. package/dist/react/components/EmptyState.js.map +1 -1
  119. package/dist/react/components/EventTimeline.js +1 -1
  120. package/dist/react/components/EventTimeline.js.map +1 -1
  121. package/dist/react/components/FileDropZone.js +1 -1
  122. package/dist/react/components/FileDropZone.js.map +1 -1
  123. package/dist/react/components/Grid.d.ts +9 -1
  124. package/dist/react/components/Grid.d.ts.map +1 -1
  125. package/dist/react/components/Grid.js +20 -2
  126. package/dist/react/components/Grid.js.map +1 -1
  127. package/dist/react/components/Guide.d.ts +31 -0
  128. package/dist/react/components/Guide.d.ts.map +1 -0
  129. package/dist/react/components/Guide.js +18 -0
  130. package/dist/react/components/Guide.js.map +1 -0
  131. package/dist/react/components/InfoHintImpl.d.ts +0 -13
  132. package/dist/react/components/InfoHintImpl.d.ts.map +1 -1
  133. package/dist/react/components/InfoHintImpl.js +17 -1
  134. package/dist/react/components/InfoHintImpl.js.map +1 -1
  135. package/dist/react/components/InlineEditableText.js +1 -1
  136. package/dist/react/components/InlineEditableText.js.map +1 -1
  137. package/dist/react/components/IsolatedFrame.js +1 -1
  138. package/dist/react/components/IsolatedFrame.js.map +1 -1
  139. package/dist/react/components/ListToolbar.d.ts.map +1 -1
  140. package/dist/react/components/ListToolbar.js +2 -2
  141. package/dist/react/components/ListToolbar.js.map +1 -1
  142. package/dist/react/components/LogViewer.d.ts +26 -2
  143. package/dist/react/components/LogViewer.d.ts.map +1 -1
  144. package/dist/react/components/LogViewer.js +41 -26
  145. package/dist/react/components/LogViewer.js.map +1 -1
  146. package/dist/react/components/Modal.d.ts +5 -1
  147. package/dist/react/components/Modal.d.ts.map +1 -1
  148. package/dist/react/components/Modal.js +18 -8
  149. package/dist/react/components/Modal.js.map +1 -1
  150. package/dist/react/components/Page.d.ts +51 -7
  151. package/dist/react/components/Page.d.ts.map +1 -1
  152. package/dist/react/components/Page.js +53 -8
  153. package/dist/react/components/Page.js.map +1 -1
  154. package/dist/react/components/PageGuideButton.d.ts +11 -0
  155. package/dist/react/components/PageGuideButton.d.ts.map +1 -0
  156. package/dist/react/components/PageGuideButton.js +13 -0
  157. package/dist/react/components/PageGuideButton.js.map +1 -0
  158. package/dist/react/components/PanelSeparator.js +1 -1
  159. package/dist/react/components/PanelSeparator.js.map +1 -1
  160. package/dist/react/components/Popover.d.ts.map +1 -1
  161. package/dist/react/components/Popover.js +2 -1
  162. package/dist/react/components/Popover.js.map +1 -1
  163. package/dist/react/components/PromptDialog.js +1 -1
  164. package/dist/react/components/PromptDialog.js.map +1 -1
  165. package/dist/react/components/ScrollArea.d.ts +9 -1
  166. package/dist/react/components/ScrollArea.d.ts.map +1 -1
  167. package/dist/react/components/ScrollArea.js +9 -3
  168. package/dist/react/components/ScrollArea.js.map +1 -1
  169. package/dist/react/components/Section.d.ts +5 -2
  170. package/dist/react/components/Section.d.ts.map +1 -1
  171. package/dist/react/components/Section.js +5 -2
  172. package/dist/react/components/Section.js.map +1 -1
  173. package/dist/react/components/Skeleton.d.ts +19 -1
  174. package/dist/react/components/Skeleton.d.ts.map +1 -1
  175. package/dist/react/components/Skeleton.js +24 -2
  176. package/dist/react/components/Skeleton.js.map +1 -1
  177. package/dist/react/components/StatStrip.js +1 -1
  178. package/dist/react/components/StatStrip.js.map +1 -1
  179. package/dist/react/components/StatTile.d.ts +30 -3
  180. package/dist/react/components/StatTile.d.ts.map +1 -1
  181. package/dist/react/components/StatTile.js +35 -9
  182. package/dist/react/components/StatTile.js.map +1 -1
  183. package/dist/react/components/StatTileGrid.d.ts +10 -1
  184. package/dist/react/components/StatTileGrid.d.ts.map +1 -1
  185. package/dist/react/components/StatTileGrid.js +50 -33
  186. package/dist/react/components/StatTileGrid.js.map +1 -1
  187. package/dist/react/components/StatusPill.d.ts.map +1 -1
  188. package/dist/react/components/StatusPill.js +26 -1
  189. package/dist/react/components/StatusPill.js.map +1 -1
  190. package/dist/react/components/Surface.d.ts +1 -1
  191. package/dist/react/components/Surface.d.ts.map +1 -1
  192. package/dist/react/components/Surface.js +20 -11
  193. package/dist/react/components/Surface.js.map +1 -1
  194. package/dist/react/components/SwatchPicker.d.ts.map +1 -1
  195. package/dist/react/components/SwatchPicker.js +5 -1
  196. package/dist/react/components/SwatchPicker.js.map +1 -1
  197. package/dist/react/components/Switch.js +1 -1
  198. package/dist/react/components/Switch.js.map +1 -1
  199. package/dist/react/components/WidgetHeader.js +1 -1
  200. package/dist/react/components/WidgetHeader.js.map +1 -1
  201. package/dist/react/components/calendar/CalendarLegend.js +1 -1
  202. package/dist/react/components/calendar/CalendarLegend.js.map +1 -1
  203. package/dist/react/components/calendar/DayAgenda.js +1 -1
  204. package/dist/react/components/calendar/DayAgenda.js.map +1 -1
  205. package/dist/react/components/calendar/EventChip.js +1 -1
  206. package/dist/react/components/calendar/EventChip.js.map +1 -1
  207. package/dist/react/components/calendar/MonthGrid.js +1 -1
  208. package/dist/react/components/calendar/MonthGrid.js.map +1 -1
  209. package/dist/react/components/calendar/WeekView.js +2 -2
  210. package/dist/react/components/calendar/WeekView.js.map +1 -1
  211. package/dist/react/components/cardFrame.d.ts +16 -0
  212. package/dist/react/components/cardFrame.d.ts.map +1 -0
  213. package/dist/react/components/cardFrame.js +24 -0
  214. package/dist/react/components/cardFrame.js.map +1 -0
  215. package/dist/react/components/dialog.d.ts.map +1 -1
  216. package/dist/react/components/dialog.js +2 -1
  217. package/dist/react/components/dialog.js.map +1 -1
  218. package/dist/react/dashboard-grid/WidgetFrame.js +2 -2
  219. package/dist/react/dashboard-grid/WidgetFrame.js.map +1 -1
  220. package/dist/react/emoji/EmojiPicker.js +1 -1
  221. package/dist/react/emoji/EmojiPicker.js.map +1 -1
  222. package/dist/react/file-tree/FileTree.d.ts +8 -1
  223. package/dist/react/file-tree/FileTree.d.ts.map +1 -1
  224. package/dist/react/file-tree/FileTree.js +29 -4
  225. package/dist/react/file-tree/FileTree.js.map +1 -1
  226. package/dist/react/filter-rail/FilterRail.js +1 -1
  227. package/dist/react/filter-rail/FilterRail.js.map +1 -1
  228. package/dist/react/icons.js +1 -1
  229. package/dist/react/icons.js.map +1 -1
  230. package/dist/react/index.d.ts +8 -5
  231. package/dist/react/index.d.ts.map +1 -1
  232. package/dist/react/index.js +5 -2
  233. package/dist/react/index.js.map +1 -1
  234. package/dist/react/lib/menuSections.d.ts +8 -0
  235. package/dist/react/lib/menuSections.d.ts.map +1 -0
  236. package/dist/react/lib/menuSections.js +37 -0
  237. package/dist/react/lib/menuSections.js.map +1 -0
  238. package/dist/react/markdown/Markdown.js +2 -2
  239. package/dist/react/markdown/Markdown.js.map +1 -1
  240. package/dist/react/media/HoverScrubVideoThumb.js +1 -1
  241. package/dist/react/media/HoverScrubVideoThumb.js.map +1 -1
  242. package/dist/react/media/MaskPainter.js +1 -1
  243. package/dist/react/media/MediaUploadControl.js +1 -1
  244. package/dist/react/media/MediaUploadControl.js.map +1 -1
  245. package/dist/react/media/VideoTrimmer.js +1 -1
  246. package/dist/react/media/VideoTrimmer.js.map +1 -1
  247. package/dist/react/media/denseGallery.css +5 -1
  248. package/dist/react/namespace/NamespaceTargetCapsule.js +1 -1
  249. package/dist/react/namespace/NamespaceTargetCapsule.js.map +1 -1
  250. package/dist/react/nav/BreadcrumbTrail.js +1 -1
  251. package/dist/react/nav/BreadcrumbTrail.js.map +1 -1
  252. package/dist/react/nav/CommandBar.d.ts +7 -1
  253. package/dist/react/nav/CommandBar.d.ts.map +1 -1
  254. package/dist/react/nav/CommandBar.js +5 -3
  255. package/dist/react/nav/CommandBar.js.map +1 -1
  256. package/dist/react/nav/PlaceBar.d.ts.map +1 -1
  257. package/dist/react/nav/PlaceBar.js +7 -9
  258. package/dist/react/nav/PlaceBar.js.map +1 -1
  259. package/dist/react/nav/SideNav.d.ts +12 -2
  260. package/dist/react/nav/SideNav.d.ts.map +1 -1
  261. package/dist/react/nav/SideNav.js +42 -22
  262. package/dist/react/nav/SideNav.js.map +1 -1
  263. package/dist/react/nav/TopBar.d.ts +65 -31
  264. package/dist/react/nav/TopBar.d.ts.map +1 -1
  265. package/dist/react/nav/TopBar.js +59 -24
  266. package/dist/react/nav/TopBar.js.map +1 -1
  267. package/dist/react/nav/index.d.ts +1 -1
  268. package/dist/react/nav/index.d.ts.map +1 -1
  269. package/dist/react/nav/index.js +1 -1
  270. package/dist/react/nav/index.js.map +1 -1
  271. package/dist/react/nav/navShared.d.ts +10 -1
  272. package/dist/react/nav/navShared.d.ts.map +1 -1
  273. package/dist/react/nav/navShared.js +23 -0
  274. package/dist/react/nav/navShared.js.map +1 -1
  275. package/dist/react/notifications/NotificationFeed.js +2 -2
  276. package/dist/react/notifications/NotificationFeed.js.map +1 -1
  277. package/dist/react/palette/Command.d.ts.map +1 -1
  278. package/dist/react/palette/Command.js +1 -1
  279. package/dist/react/palette/Command.js.map +1 -1
  280. package/dist/react/palette/CommandPalette.d.ts +13 -1
  281. package/dist/react/palette/CommandPalette.d.ts.map +1 -1
  282. package/dist/react/palette/CommandPalette.js +44 -8
  283. package/dist/react/palette/CommandPalette.js.map +1 -1
  284. package/dist/react/palette/commandSources.d.ts +57 -0
  285. package/dist/react/palette/commandSources.d.ts.map +1 -0
  286. package/dist/react/palette/commandSources.js +129 -0
  287. package/dist/react/palette/commandSources.js.map +1 -0
  288. package/dist/react/palette/index.d.ts +1 -0
  289. package/dist/react/palette/index.d.ts.map +1 -1
  290. package/dist/react/palette/index.js +1 -0
  291. package/dist/react/palette/index.js.map +1 -1
  292. package/dist/react/rich-text/RichTextEditor.js +1 -1
  293. package/dist/react/rich-text/RichTextEditor.js.map +1 -1
  294. package/dist/react/rich-text/RichTextToolbar.js +1 -1
  295. package/dist/react/rich-text/RichTextToolbar.js.map +1 -1
  296. package/dist/scripts/guardrailsEnforce.d.ts.map +1 -1
  297. package/dist/styles-areas/analytics.css +16 -16
  298. package/dist/styles-areas/auth.css +3 -3
  299. package/dist/styles-areas/calendar.css +6 -6
  300. package/dist/styles-areas/chart-table.css +1 -1
  301. package/dist/styles-areas/charts.css +3 -3
  302. package/dist/styles-areas/chat.css +7 -6
  303. package/dist/styles-areas/companion-link.css +2 -2
  304. package/dist/styles-areas/core.css +98 -89
  305. package/dist/styles-areas/dashboard-grid.css +4 -4
  306. package/dist/styles-areas/data-table.css +16 -16
  307. package/dist/styles-areas/disk-usage.css +5 -5
  308. package/dist/styles-areas/emoji.css +2 -2
  309. package/dist/styles-areas/fields.css +13 -14
  310. package/dist/styles-areas/filter-rail.css +4 -4
  311. package/dist/styles-areas/folder-tree.css +3 -3
  312. package/dist/styles-areas/markdown.css +2 -1
  313. package/dist/styles-areas/master-detail.css +3 -3
  314. package/dist/styles-areas/media-gallery.css +8 -8
  315. package/dist/styles-areas/media.css +12 -13
  316. package/dist/styles-areas/nav.css +28 -14
  317. package/dist/styles-areas/notifications.css +4 -4
  318. package/dist/styles-areas/overlays.css +4 -4
  319. package/dist/styles-areas/palette.css +4 -3
  320. package/dist/styles-areas/rich-text.css +3 -3
  321. package/dist/styles-areas/sharing.css +4 -3
  322. package/dist/styles-areas/stats.css +9 -8
  323. package/dist/styles-areas/test-report.css +3 -3
  324. package/dist/styles-areas/wizard.css +6 -5
  325. package/dist/styles-areas/workbench.css +10 -9
  326. package/dist/styles-areas/workbook-viewer.css +2 -2
  327. package/dist/styles-utilities.css +272 -187
  328. package/dist/testing/designAudit.d.ts.map +1 -1
  329. package/dist/testing/designAudit.js +4 -0
  330. package/dist/testing/designAudit.js.map +1 -1
  331. package/dist/testing/designBaseline.d.ts.map +1 -1
  332. package/dist/testing/designBaseline.js +4 -0
  333. package/dist/testing/designBaseline.js.map +1 -1
  334. package/dist/theme.css +103 -2
  335. package/package.json +3 -2
  336. package/scripts/guardrails-baseline.json +2 -1
  337. package/scripts/guardrailsEnforce.spec.ts +64 -0
  338. package/scripts/guardrailsEnforce.ts +65 -8
  339. package/scripts/styleAreas.ts +1 -0
  340. package/src/nodeTypesDeclared.spec.ts +47 -0
  341. package/src/react/Toast.spec.tsx +43 -0
  342. package/src/react/Toast.tsx +45 -2
  343. package/src/react/analytics/MetricDrilldown.tsx +1 -1
  344. package/src/react/charts/AreaChart.tsx +9 -8
  345. package/src/react/charts/BarChart.tsx +11 -10
  346. package/src/react/charts/ChartCard.tsx +146 -0
  347. package/src/react/charts/ChartFrame.tsx +28 -10
  348. package/src/react/charts/ChartLegend.tsx +1 -1
  349. package/src/react/charts/HeatmapChart.tsx +5 -5
  350. package/src/react/charts/IntervalTimeline.tsx +2 -2
  351. package/src/react/charts/LineChart.tsx +9 -8
  352. package/src/react/charts/TimeSeriesChart.tsx +11 -10
  353. package/src/react/charts/chartBox.spec.ts +40 -0
  354. package/src/react/charts/chartBox.ts +75 -0
  355. package/src/react/charts/index.ts +2 -0
  356. package/src/react/charts/shared.ts +16 -3
  357. package/src/react/chat/Bubble.tsx +5 -5
  358. package/src/react/chat/MessageScroller.tsx +1 -1
  359. package/src/react/components/ActionBar.spec.tsx +90 -0
  360. package/src/react/components/ActionBar.tsx +82 -2
  361. package/src/react/components/AddItemsMenu.tsx +1 -1
  362. package/src/react/components/Alert.spec.tsx +32 -2
  363. package/src/react/components/Alert.tsx +47 -3
  364. package/src/react/components/AppShell.spec.tsx +199 -13
  365. package/src/react/components/AppShell.tsx +235 -92
  366. package/src/react/components/AsyncPanel.spec.tsx +7 -1
  367. package/src/react/components/AsyncPanel.tsx +85 -5
  368. package/src/react/components/BannerLane.tsx +128 -0
  369. package/src/react/components/Button.tsx +2 -0
  370. package/src/react/components/ChipFilterStrip.tsx +1 -1
  371. package/src/react/components/ComboboxField.tsx +20 -3
  372. package/src/react/components/CommentThread.tsx +2 -2
  373. package/src/react/components/ConfirmDialog.tsx +1 -1
  374. package/src/react/components/DataTable/DataTable.tsx +80 -8
  375. package/src/react/components/DataTable/Pagination.tsx +1 -1
  376. package/src/react/components/DataTable/RowActions.tsx +55 -2
  377. package/src/react/components/DataTable/TableFilterBuilder.tsx +1 -1
  378. package/src/react/components/DataTable/cells/CodeCell.tsx +1 -1
  379. package/src/react/components/DataTable/cells/LinkCell.tsx +1 -1
  380. package/src/react/components/DataTable/index.ts +1 -0
  381. package/src/react/components/DataTable/numericColumn.spec.ts +19 -0
  382. package/src/react/components/DataTable/types.ts +36 -0
  383. package/src/react/components/DateTimeField.tsx +3 -1
  384. package/src/react/components/DeleteButton.tsx +3 -0
  385. package/src/react/components/Drawer.tsx +3 -3
  386. package/src/react/components/DropdownMenu.spec.tsx +55 -0
  387. package/src/react/components/DropdownMenu.tsx +73 -20
  388. package/src/react/components/EmptyState.tsx +26 -7
  389. package/src/react/components/EventTimeline.tsx +1 -1
  390. package/src/react/components/Field.width.spec.tsx +11 -0
  391. package/src/react/components/FileDropZone.tsx +1 -1
  392. package/src/react/components/Grid.spec.tsx +44 -0
  393. package/src/react/components/Grid.tsx +41 -11
  394. package/src/react/components/Guide.tsx +77 -0
  395. package/src/react/components/InfoHint.spec.tsx +21 -0
  396. package/src/react/components/InfoHintImpl.tsx +22 -1
  397. package/src/react/components/InlineEditableText.tsx +1 -1
  398. package/src/react/components/IsolatedFrame.tsx +1 -1
  399. package/src/react/components/ListToolbar.spec.tsx +12 -0
  400. package/src/react/components/ListToolbar.tsx +8 -5
  401. package/src/react/components/LogViewer.tsx +118 -18
  402. package/src/react/components/Modal.spec.tsx +17 -2
  403. package/src/react/components/Modal.tsx +25 -10
  404. package/src/react/components/MultiSelectField.spec.tsx +6 -0
  405. package/src/react/components/Page.spec.tsx +89 -5
  406. package/src/react/components/Page.tsx +100 -16
  407. package/src/react/components/PageGuideButton.tsx +42 -0
  408. package/src/react/components/PanelSeparator.tsx +1 -1
  409. package/src/react/components/Popover.tsx +3 -1
  410. package/src/react/components/PromptDialog.tsx +1 -1
  411. package/src/react/components/ScrollArea.spec.tsx +20 -0
  412. package/src/react/components/ScrollArea.tsx +19 -0
  413. package/src/react/components/Section.spec.tsx +82 -1
  414. package/src/react/components/Section.tsx +10 -4
  415. package/src/react/components/Skeleton.tsx +50 -2
  416. package/src/react/components/StatStrip.tsx +1 -1
  417. package/src/react/components/StatTile.tsx +84 -11
  418. package/src/react/components/StatTileGrid.spec.tsx +6 -1
  419. package/src/react/components/StatTileGrid.tsx +25 -0
  420. package/src/react/components/StatusPill.tsx +26 -1
  421. package/src/react/components/Surface.tsx +22 -14
  422. package/src/react/components/SwatchPicker.tsx +4 -0
  423. package/src/react/components/Switch.tsx +1 -1
  424. package/src/react/components/WidgetHeader.tsx +1 -1
  425. package/src/react/components/calendar/CalendarLegend.tsx +1 -1
  426. package/src/react/components/calendar/DayAgenda.tsx +1 -1
  427. package/src/react/components/calendar/EventChip.tsx +1 -1
  428. package/src/react/components/calendar/MonthGrid.tsx +1 -1
  429. package/src/react/components/calendar/WeekView.tsx +2 -2
  430. package/src/react/components/cardFrame.ts +28 -0
  431. package/src/react/components/dataDisplay.spec.tsx +176 -0
  432. package/src/react/components/dialog.tsx +4 -1
  433. package/src/react/dashboard-grid/WidgetFrame.tsx +2 -2
  434. package/src/react/emoji/EmojiPicker.tsx +1 -1
  435. package/src/react/file-tree/FileTree.spec.tsx +49 -0
  436. package/src/react/file-tree/FileTree.tsx +37 -4
  437. package/src/react/filter-rail/FilterRail.tsx +1 -1
  438. package/src/react/icons.tsx +1 -1
  439. package/src/react/index.ts +28 -3
  440. package/src/react/lib/menuSections.ts +33 -0
  441. package/src/react/markdown/Markdown.tsx +2 -2
  442. package/src/react/media/HoverScrubVideoThumb.tsx +2 -2
  443. package/src/react/media/MaskPainter.tsx +1 -1
  444. package/src/react/media/MediaUploadControl.tsx +1 -1
  445. package/src/react/media/VideoTrimmer.tsx +1 -1
  446. package/src/react/media/denseGallery.css +5 -1
  447. package/src/react/namespace/NamespaceTargetCapsule.tsx +1 -1
  448. package/src/react/nav/BreadcrumbTrail.tsx +2 -2
  449. package/src/react/nav/CommandBar.tsx +14 -3
  450. package/src/react/nav/PlaceBar.tsx +18 -8
  451. package/src/react/nav/SideNav.tsx +99 -17
  452. package/src/react/nav/TopBar.spec.tsx +78 -21
  453. package/src/react/nav/TopBar.tsx +270 -98
  454. package/src/react/nav/index.ts +8 -1
  455. package/src/react/nav/nav.spec.tsx +46 -2
  456. package/src/react/nav/navShared.tsx +23 -2
  457. package/src/react/notifications/NotificationFeed.tsx +2 -2
  458. package/src/react/palette/Command.tsx +1 -1
  459. package/src/react/palette/CommandPalette.spec.tsx +31 -0
  460. package/src/react/palette/CommandPalette.tsx +108 -11
  461. package/src/react/palette/commandSources.tsx +186 -0
  462. package/src/react/palette/index.ts +7 -0
  463. package/src/react/rich-text/RichTextEditor.tsx +1 -1
  464. package/src/react/rich-text/RichTextToolbar.tsx +1 -1
  465. package/src/styles-areas/analytics.css +16 -16
  466. package/src/styles-areas/auth.css +3 -3
  467. package/src/styles-areas/calendar.css +6 -6
  468. package/src/styles-areas/chart-table.css +1 -1
  469. package/src/styles-areas/charts.css +3 -3
  470. package/src/styles-areas/chat.css +7 -6
  471. package/src/styles-areas/companion-link.css +2 -2
  472. package/src/styles-areas/core.css +98 -89
  473. package/src/styles-areas/dashboard-grid.css +4 -4
  474. package/src/styles-areas/data-table.css +16 -16
  475. package/src/styles-areas/disk-usage.css +5 -5
  476. package/src/styles-areas/emoji.css +2 -2
  477. package/src/styles-areas/fields.css +13 -14
  478. package/src/styles-areas/filter-rail.css +4 -4
  479. package/src/styles-areas/folder-tree.css +3 -3
  480. package/src/styles-areas/markdown.css +2 -1
  481. package/src/styles-areas/master-detail.css +3 -3
  482. package/src/styles-areas/media-gallery.css +8 -8
  483. package/src/styles-areas/media.css +12 -13
  484. package/src/styles-areas/nav.css +28 -14
  485. package/src/styles-areas/notifications.css +4 -4
  486. package/src/styles-areas/overlays.css +4 -4
  487. package/src/styles-areas/palette.css +4 -3
  488. package/src/styles-areas/rich-text.css +3 -3
  489. package/src/styles-areas/sharing.css +4 -3
  490. package/src/styles-areas/stats.css +9 -8
  491. package/src/styles-areas/test-report.css +3 -3
  492. package/src/styles-areas/wizard.css +6 -5
  493. package/src/styles-areas/workbench.css +10 -9
  494. package/src/styles-areas/workbook-viewer.css +2 -2
  495. package/src/styles-utilities.css +272 -187
  496. package/src/testing/designAudit.ts +3 -0
  497. package/src/testing/designBaseline.ts +4 -0
  498. package/src/theme.css +103 -2
  499. package/src/themeDarkScopeAliases.spec.ts +65 -0
@@ -11,9 +11,42 @@
11
11
  * light/dark exactly like every other primitive (no sonner `richColors` — that
12
12
  * would inject sonner's own hardcoded palette instead of our tokens).
13
13
  */
14
- import { Toaster as SonnerToaster, toast } from 'sonner';
14
+ import { type ExternalToast, Toaster as SonnerToaster, toast as sonnerToast } from 'sonner';
15
+ import { devWarnOnce } from './lib/devWarn.js';
15
16
 
16
- export { toast };
17
+ type ToastMessage = Parameters<typeof sonnerToast.error>[0];
18
+
19
+ /**
20
+ * OVL-9: a toast confirms what happened ("Moved to trash") and offers Undo; it never carries an
21
+ * error the reader must act on — that is an inline `Alert` where the problem is, because a toast
22
+ * leaves in four seconds and takes the problem with it. An error toast is allowed only with an
23
+ * `action` (Retry, Undo), so the error is something the toast itself lets you resolve.
24
+ */
25
+ function errorToast(message: ToastMessage, data?: ExternalToast) {
26
+ if (!data?.action) {
27
+ devWarnOnce(
28
+ 'toast:error-without-action',
29
+ 'cursedbelt: toast.error() with no `action` — an error the reader must act on belongs in an inline <Alert tone="error"> ' +
30
+ "where the problem is (OVL-9). Give the toast an action (Retry) if it can resolve it itself.",
31
+ );
32
+ }
33
+ return sonnerToast.error(message, data);
34
+ }
35
+
36
+ /**
37
+ * "Moved 3 files to trash" with an Undo — the shape OVL-9 asks every reversible action to take.
38
+ * `onUndo` runs when Undo is pressed; the toast stays for 6s, long enough to reach the button.
39
+ */
40
+ function undoToast(message: ToastMessage, onUndo: () => void, data?: ExternalToast) {
41
+ return sonnerToast(message, { duration: 6000, ...data, action: { label: 'Undo', onClick: onUndo } });
42
+ }
43
+
44
+ /** sonner's `toast`, with OVL-9's rules on `error` and an `undo` helper. */
45
+ export const toast: typeof sonnerToast & { undo: typeof undoToast } = Object.assign(
46
+ (...args: Parameters<typeof sonnerToast>) => sonnerToast(...args),
47
+ sonnerToast,
48
+ { error: errorToast, undo: undoToast },
49
+ );
17
50
 
18
51
  export type ToasterProps = React.ComponentProps<typeof SonnerToaster>;
19
52
 
@@ -31,11 +64,21 @@ const TOKEN_VARS = {
31
64
  '--normal-text': 'var(--popover-foreground)',
32
65
  } as React.CSSProperties;
33
66
 
67
+ /**
68
+ * OVL-9: on a phone the stack sits ABOVE the `PlaceBar` (and any bottom dock), not on top of
69
+ * the navigation. `AppShell` publishes its bottom chrome's height as `--cb-bottom-chrome-h`;
70
+ * outside a shell it is 0 and this is sonner's own gap.
71
+ */
72
+ const BOTTOM_OFFSET = { bottom: 'calc(var(--cb-bottom-chrome-h, 0px) + 16px)', right: '16px' };
73
+ const DESKTOP_OFFSET = { bottom: 'calc(var(--cb-bottom-chrome-h, 0px) + 24px)', right: '24px' };
74
+
34
75
  export function Toaster({ style, ...props }: ToasterProps) {
35
76
  return (
36
77
  <SonnerToaster
37
78
  style={{ ...TOKEN_VARS, ...style }}
38
79
  position='bottom-right'
80
+ offset={DESKTOP_OFFSET}
81
+ mobileOffset={BOTTOM_OFFSET}
39
82
  closeButton
40
83
  toastOptions={{
41
84
  classNames: {
@@ -77,7 +77,7 @@ export function MetricDrilldown<TRow extends Record<string, unknown>>({
77
77
  <Modal
78
78
  open={open}
79
79
  onClose={onClose}
80
- size='xl'
80
+ size='lg'
81
81
  title={
82
82
  value === undefined ? (
83
83
  title
@@ -7,10 +7,11 @@ import {
7
7
  XAxis,
8
8
  YAxis,
9
9
  } from 'recharts';
10
+ import type { ChartBox } from './chartBox.js';
10
11
  import { ChartFrame } from './ChartFrame.js';
11
12
  import { legendContent } from './ChartLegend.js';
12
13
  import { tooltipContent } from './ChartTooltip.js';
13
- import { axisProps, type ChartDatum, type ChartSeries, seriesColor, useGradientId } from './shared.js';
14
+ import { axisProps, valueAxisProps, type ChartDatum, type ChartSeries, seriesColor, useGradientId } from './shared.js';
14
15
 
15
16
  export type AreaChartProps = {
16
17
  data: ChartDatum[];
@@ -53,10 +54,10 @@ export function AreaChart({
53
54
  labelFormatter,
54
55
  }: AreaChartProps) {
55
56
  const gradId = useGradientId();
56
- const showLegend = legend ?? series.length > 1;
57
+ const showLegend = (box: ChartBox) => legend ?? (!box.legendInHeader && series.length > 1);
57
58
  return (
58
59
  <ChartFrame ariaLabel={ariaLabel} height={height}>
59
- {(t) => (
60
+ {(t, box) => (
60
61
  <RAreaChart data={data} margin={{ top: 8, right: 12, bottom: 0, left: 0 }}>
61
62
  <defs>
62
63
  {series.map((s, i) => {
@@ -86,18 +87,18 @@ export function AreaChart({
86
87
  )}
87
88
  <XAxis
88
89
  dataKey={xKey}
89
- {...axisProps(t)}
90
+ {...axisProps(t, box)}
90
91
  tickFormatter={xTickFormatter}
91
92
  interval='preserveStartEnd'
92
- minTickGap={24}
93
+ minTickGap={box.gap(24)}
93
94
  />
94
- <YAxis {...axisProps(t)} tickFormatter={valueFormatter} width={yWidth} axisLine={false} />
95
+ <YAxis {...axisProps(t, box)} {...valueAxisProps(box, valueFormatter)} width={yWidth} axisLine={false} />
95
96
  <Tooltip
96
97
  content={tooltipContent(t, labelFormatter, valueFormatter)}
97
98
  cursor={{ stroke: t.foregroundMuted, strokeWidth: 1, strokeOpacity: 0.5 }}
98
99
  isAnimationActive={false}
99
100
  />
100
- {showLegend && <Legend content={legendContent(t)} />}
101
+ {showLegend(box) && <Legend content={legendContent(t)} />}
101
102
  {series.map((s, i) => {
102
103
  const c = seriesColor(t, s, i);
103
104
  return (
@@ -108,7 +109,7 @@ export function AreaChart({
108
109
  name={s.name ?? s.dataKey}
109
110
  stackId={stacked ? (s.stackId ?? 'stack') : s.stackId}
110
111
  stroke={c}
111
- strokeWidth={2}
112
+ strokeWidth={box.stroke}
112
113
  fill={`url(#${gradId}-${s.dataKey})`}
113
114
  isAnimationActive={false}
114
115
  />
@@ -1,8 +1,9 @@
1
1
  import { Bar, CartesianGrid, Legend, BarChart as RBarChart, Tooltip, XAxis, YAxis } from 'recharts';
2
+ import type { ChartBox } from './chartBox.js';
2
3
  import { ChartFrame } from './ChartFrame.js';
3
4
  import { legendContent } from './ChartLegend.js';
4
5
  import { tooltipContent } from './ChartTooltip.js';
5
- import { axisProps, type ChartDatum, type ChartSeries, seriesColor } from './shared.js';
6
+ import { axisProps, valueAxisProps, type ChartDatum, type ChartSeries, seriesColor } from './shared.js';
6
7
 
7
8
  type Corners = [number, number, number, number];
8
9
 
@@ -47,7 +48,7 @@ export function BarChart({
47
48
  labelFormatter,
48
49
  }: BarChartProps) {
49
50
  const horizontal = orientation === 'horizontal';
50
- const showLegend = legend ?? series.length > 1;
51
+ const showLegend = (box: ChartBox) => legend ?? (!box.legendInHeader && series.length > 1);
51
52
  // Round only the outer end of each bar; for a stack, only the last (outer) series.
52
53
  const cornersFor = (i: number): Corners => {
53
54
  const outer = !stacked || i === series.length - 1;
@@ -56,7 +57,7 @@ export function BarChart({
56
57
  };
57
58
  return (
58
59
  <ChartFrame ariaLabel={ariaLabel} height={height}>
59
- {(t) => (
60
+ {(t, box) => (
60
61
  <RBarChart
61
62
  data={data}
62
63
  layout={horizontal ? 'vertical' : 'horizontal'}
@@ -73,11 +74,11 @@ export function BarChart({
73
74
  )}
74
75
  {horizontal ? (
75
76
  <>
76
- <XAxis type='number' {...axisProps(t)} tickFormatter={valueFormatter} />
77
+ <XAxis type='number' {...axisProps(t, box)} {...valueAxisProps(box, valueFormatter)} />
77
78
  <YAxis
78
79
  type='category'
79
80
  dataKey={xKey}
80
- {...axisProps(t)}
81
+ {...axisProps(t, box)}
81
82
  tickFormatter={categoryTickFormatter}
82
83
  width={yWidth}
83
84
  axisLine={false}
@@ -88,15 +89,15 @@ export function BarChart({
88
89
  <XAxis
89
90
  type='category'
90
91
  dataKey={xKey}
91
- {...axisProps(t)}
92
+ {...axisProps(t, box)}
92
93
  tickFormatter={categoryTickFormatter}
93
94
  interval='preserveStartEnd'
94
- minTickGap={8}
95
+ minTickGap={box.gap(8)}
95
96
  />
96
97
  <YAxis
97
98
  type='number'
98
- {...axisProps(t)}
99
- tickFormatter={valueFormatter}
99
+ {...axisProps(t, box)}
100
+ {...valueAxisProps(box, valueFormatter)}
100
101
  width={yWidth}
101
102
  axisLine={false}
102
103
  />
@@ -107,7 +108,7 @@ export function BarChart({
107
108
  cursor={{ fill: t.foregroundMuted, fillOpacity: 0.08 }}
108
109
  isAnimationActive={false}
109
110
  />
110
- {showLegend && <Legend content={legendContent(t)} />}
111
+ {showLegend(box) && <Legend content={legendContent(t)} />}
111
112
  {series.map((s, i) => (
112
113
  <Bar
113
114
  key={s.dataKey}
@@ -0,0 +1,146 @@
1
+ import { type ReactNode, useRef } from 'react';
2
+ import { Button } from '../components/Button.js';
3
+ import { EmptyState } from '../components/EmptyState.js';
4
+ import { Popover } from '../components/Popover.js';
5
+ import { Skeleton } from '../components/Skeleton.js';
6
+ import { Surface } from '../components/Surface.js';
7
+ import { useElementSize } from '../hooks/useResizeObserver.js';
8
+ import { cn } from '../lib/cn.js';
9
+ import { CHART_PHONE_MAX, ChartCardContext, chartHeight } from './chartBox.js';
10
+ import type { ChartTone } from './tokens.js';
11
+
12
+ /** One entry of the header legend — a dot and its label (CHT-2). */
13
+ export interface ChartCardLegendItem {
14
+ label: string;
15
+ /** A semantic color instead of the positional one — the same `tone` its series carries. */
16
+ tone?: ChartTone;
17
+ }
18
+
19
+ export interface ChartCardProps {
20
+ /** What is measured — "Daily volume". */
21
+ title: ReactNode;
22
+ /** The range, in one line — "Sep 13 → Oct 1" (CHT-2). */
23
+ subtitle?: ReactNode;
24
+ /**
25
+ * The legend, drawn inline in the header instead of under the plot, in SERIES ORDER: item
26
+ * `i` takes `--chart-{i+1}`, the color the chart gives its series `i` (CHT-7), unless a
27
+ * `tone` says otherwise. When set, a chart inside the card leaves its own legend off.
28
+ * Long legends wrap; on a phone-width card they fold into a "Legend" button.
29
+ */
30
+ legend?: ChartCardLegendItem[];
31
+ /** Header controls on the right — a range picker, a chart/table toggle. */
32
+ actions?: ReactNode;
33
+ /** First load: a skeleton of the frame at the frame's own size (CHT-9, STA-1). */
34
+ loading?: boolean;
35
+ /**
36
+ * No data: an empty state INSIDE the frame at the same size (CHT-9). `true` uses a generic
37
+ * title; pass `{ title, description, action }` to say what is missing and what fills it.
38
+ */
39
+ empty?: boolean | { title: ReactNode; description?: ReactNode; action?: ReactNode };
40
+ /** Fix the plot height. Leave unset — the card takes the aspect for its width (CHT-1). */
41
+ height?: number;
42
+ /** The chart — any `cursedbelt/react/charts` chart, with its `height` left unset. */
43
+ children: ReactNode;
44
+ className?: string;
45
+ }
46
+
47
+ const TONE_VAR: Record<ChartTone, string> = {
48
+ accent: 'var(--accent)',
49
+ success: 'var(--success)',
50
+ warning: 'var(--warning)',
51
+ danger: 'var(--destructive)',
52
+ neutral: 'var(--muted-foreground)',
53
+ };
54
+
55
+ /** CHT-7: one color order across every chart — the same `--chart-*` the chart's series take. */
56
+ export function legendColor(item: ChartCardLegendItem, index: number): string {
57
+ return item.tone ? TONE_VAR[item.tone] : `var(--chart-${(index % 8) + 1})`;
58
+ }
59
+
60
+ function LegendList({ items, className }: { items: ChartCardLegendItem[]; className?: string }) {
61
+ return (
62
+ <ul data-cb-chart-legend='' className={cn('m-0 flex list-none flex-wrap items-center gap-x-3 gap-y-1 p-0 text-xs', className)}>
63
+ {items.map((item, i) => (
64
+ <li key={item.label} className='flex min-w-0 items-center gap-1.5 text-muted-foreground'>
65
+ {/* An SVG fill, not an inline style: the color is data (the series' slot), not layout. */}
66
+ <svg aria-hidden className='size-2 shrink-0' viewBox='0 0 8 8'>
67
+ <circle cx='4' cy='4' r='4' fill={legendColor(item, i)} />
68
+ </svg>
69
+ <span className='truncate'>{item.label}</span>
70
+ </li>
71
+ ))}
72
+ </ul>
73
+ );
74
+ }
75
+
76
+ /**
77
+ * The chart's frame (CHT-1, CHT-2, CHT-9): a card whose header holds the title, the range and
78
+ * an inline legend, and whose body owns the plot's SHAPE — the chart inside measures the same
79
+ * width and takes the same aspect, so the loading skeleton, the empty state and the chart are
80
+ * one size and nothing moves when the data lands. Collapse a sidebar beside it and the chart
81
+ * re-measures; it never clips.
82
+ *
83
+ * Build an operations-console Trends section from this and a `DataTable` with no app-local
84
+ * styling (`docs/design/blueprints/operations-console.md`).
85
+ */
86
+ export function ChartCard({
87
+ title,
88
+ subtitle,
89
+ legend,
90
+ actions,
91
+ loading = false,
92
+ empty = false,
93
+ height,
94
+ children,
95
+ className,
96
+ }: ChartCardProps) {
97
+ const bodyRef = useRef<HTMLDivElement>(null);
98
+ const { width } = useElementSize(bodyRef, { layout: true });
99
+ const plotHeight = height ?? chartHeight(width);
100
+ const phone = width > 0 && width < CHART_PHONE_MAX;
101
+ // A phone header has room for two or three dots; past that the legend folds (CHT-2) rather
102
+ // than push the plot down the screen.
103
+ const foldLegend = phone && legend != null && legend.length > 3;
104
+ const emptyContent = empty === true ? { title: 'No data for this range' } : empty || null;
105
+
106
+ return (
107
+ <Surface level='flat' pad='md' radius='lg' className={cn('flex min-w-0 flex-col gap-3', className)} data-cb-chart-card=''>
108
+ <div className='flex min-w-0 flex-wrap items-start justify-between gap-x-4 gap-y-2'>
109
+ <div className='flex min-w-0 flex-col gap-0.5'>
110
+ <h3 className='truncate text-sm font-semibold text-foreground'>{title}</h3>
111
+ {subtitle != null && <p className='truncate text-xs tabular-nums text-muted-foreground'>{subtitle}</p>}
112
+ </div>
113
+ <div className='flex min-w-0 flex-wrap items-center justify-end gap-x-3 gap-y-2'>
114
+ {legend && legend.length > 0 && !foldLegend && <LegendList items={legend} className='justify-end' />}
115
+ {foldLegend && legend && (
116
+ <Popover
117
+ trigger={
118
+ <Button variant='ghost' size='sm' tooltip='Show what each color is' tooltipMobile='off'>
119
+ {`Legend · ${legend.length}`}
120
+ </Button>
121
+ }
122
+ align='end'
123
+ label='Chart legend'
124
+ >
125
+ <LegendList items={legend} className='flex-col items-start' />
126
+ </Popover>
127
+ )}
128
+ {actions}
129
+ </div>
130
+ </div>
131
+ <div ref={bodyRef} className='min-w-0' data-cb-chart-body=''>
132
+ {loading ? (
133
+ <Skeleton className='w-full rounded-md' style={{ height: plotHeight }} data-cb-chart-skeleton='' />
134
+ ) : emptyContent ? (
135
+ <div className='flex w-full items-center justify-center rounded-md border border-dashed border-border' style={{ height: plotHeight }}>
136
+ <EmptyState compact title={emptyContent.title} description={emptyContent.description} action={emptyContent.action} />
137
+ </div>
138
+ ) : (
139
+ <ChartCardContext.Provider value={{ legendInHeader: legend != null && legend.length > 0, height }}>
140
+ {children}
141
+ </ChartCardContext.Provider>
142
+ )}
143
+ </div>
144
+ </Surface>
145
+ );
146
+ }
@@ -1,31 +1,49 @@
1
- import { type ReactElement, useRef } from 'react';
1
+ import { type ReactElement, useContext, useRef } from 'react';
2
2
  import { ResponsiveContainer } from 'recharts';
3
+ import { useElementSize } from '../hooks/useResizeObserver.js';
3
4
  import { cn } from '../lib/cn.js';
5
+ import { type ChartBox, ChartCardContext, chartBox } from './chartBox.js';
4
6
  import { type ChartTokens, useChartTokens } from './tokens.js';
5
7
 
6
8
  export type ChartFrameProps = {
7
9
  /** Human label for the chart's `role="img"` wrapper (SVG a11y). */
8
10
  ariaLabel: string;
9
- /** Pixel height of the responsive container. Width is always 100%. */
11
+ /**
12
+ * Pixel height of the plot. Leave it unset: the frame takes its shape from its own width
13
+ * (CHT-1 — 4:3 on a phone, 2:1 on a desktop, 3:1 on a very wide screen, clamped to
14
+ * 160–480px) and re-measures when its container resizes. Width is always 100%.
15
+ */
10
16
  height?: number;
11
17
  className?: string;
12
- /** Render the recharts chart from the live tokens. */
13
- children: (tokens: ChartTokens) => ReactElement;
18
+ /** Render the recharts chart from the live tokens and the measured box. */
19
+ children: (tokens: ChartTokens, box: ChartBox) => ReactElement;
14
20
  };
15
21
 
16
22
  /**
17
23
  * The shared chart wrapper. Its `role="img"` element is the cascade anchor
18
24
  * useChartTokens reads from (so a `.dark`/accent ancestor themes the chart), and it
19
- * hosts a recharts <ResponsiveContainer> that owns sizing — every chart is 100% wide
20
- * and never overflows its column. All wrappers below build on it.
25
+ * hosts a recharts <ResponsiveContainer> that owns the width — every chart is 100% wide
26
+ * and never overflows its column. The HEIGHT is the frame's: it measures its own width
27
+ * (a sidebar folding re-measures it) and derives the plot's shape and its marks' weight
28
+ * from it — see `chartBox`. All wrappers below build on it.
21
29
  */
22
- export function ChartFrame({ ariaLabel, height = 240, className, children }: ChartFrameProps) {
30
+ export function ChartFrame({ ariaLabel, height, className, children }: ChartFrameProps) {
23
31
  const ref = useRef<HTMLDivElement>(null);
24
32
  const tokens = useChartTokens(ref);
33
+ const { width } = useElementSize(ref, { layout: true });
34
+ const card = useContext(ChartCardContext);
35
+ const box = chartBox(width, { height: height ?? card?.height, legendInHeader: card?.legendInHeader ?? false });
25
36
  return (
26
- <div ref={ref} role='img' aria-label={ariaLabel} data-cb-chart='' className={cn('w-full', className)}>
27
- <ResponsiveContainer width='100%' height={height}>
28
- {children(tokens)}
37
+ <div
38
+ ref={ref}
39
+ role='img'
40
+ aria-label={ariaLabel}
41
+ data-cb-chart=''
42
+ data-cb-chart-tier={box.tier}
43
+ className={cn('w-full min-w-0', className)}
44
+ >
45
+ <ResponsiveContainer width='100%' height={box.height}>
46
+ {children(tokens, box)}
29
47
  </ResponsiveContainer>
30
48
  </div>
31
49
  );
@@ -29,7 +29,7 @@ export function ChartLegend({ payload, tokens = FALLBACK_TOKENS }: ChartLegendPr
29
29
  className='flex items-center gap-1.5'
30
30
  >
31
31
  <span
32
- className='inline-block h-2.5 w-2.5 shrink-0 rounded-[3px]'
32
+ className='inline-block h-2.5 w-2.5 shrink-0 rounded-xs'
33
33
  style={{ backgroundColor: entry.color }}
34
34
  />
35
35
  <span>{entry.value}</span>
@@ -117,7 +117,7 @@ export function HeatmapChart({
117
117
  <div
118
118
  role='img'
119
119
  aria-label={ariaLabel}
120
- className='grid min-w-0 gap-[2px]'
120
+ className='grid min-w-0 gap-0.5'
121
121
  // The row-label column is sized to its content; every data column shares
122
122
  // the remainder equally, so the grid fits its container at any width.
123
123
  style={{ gridTemplateColumns: `auto repeat(${columns.length}, minmax(0, 1fr))` }}
@@ -153,7 +153,7 @@ export function HeatmapChart({
153
153
  key={column}
154
154
  label={text}
155
155
  className={cn(
156
- 'rounded-[3px] transition-opacity',
156
+ 'rounded-xs transition-opacity',
157
157
  empty && 'border border-border border-dashed',
158
158
  onCellClick && 'cursor-pointer hover:opacity-80 focus-visible:cb-ring',
159
159
  )}
@@ -174,18 +174,18 @@ export function HeatmapChart({
174
174
  {legend && (
175
175
  <div className='flex items-center gap-2 text-caption text-muted-foreground'>
176
176
  <span>{valueFormatter(bottom)}</span>
177
- <div className='flex h-2 flex-1 gap-[2px]'>
177
+ <div className='flex h-2 flex-1 gap-0.5'>
178
178
  {[0, 0.25, 0.5, 0.75, 1].map((f) => (
179
179
  <div
180
180
  key={f}
181
- className='flex-1 rounded-[2px]'
181
+ className='flex-1 rounded-xs'
182
182
  style={{ background: sequentialStep(hue, f) }}
183
183
  />
184
184
  ))}
185
185
  </div>
186
186
  <span>{valueFormatter(top)}</span>
187
187
  <span className='ml-2 inline-flex items-center gap-1'>
188
- <span className='inline-block h-2 w-3 rounded-[2px] border border-border border-dashed' />
188
+ <span className='inline-block h-2 w-3 rounded-xs border border-border border-dashed' />
189
189
  no data
190
190
  </span>
191
191
  </div>
@@ -186,14 +186,14 @@ export function IntervalTimeline({
186
186
  type='button'
187
187
  aria-label={label}
188
188
  onClick={() => onSelect(interval)}
189
- className='absolute cursor-pointer rounded-[3px] p-0 outline-none focus-visible:ring-2 focus-visible:ring-ring'
189
+ className='absolute cursor-pointer rounded-xs p-0 outline-none focus-visible:ring-2 focus-visible:ring-ring'
190
190
  style={style}
191
191
  />
192
192
  ) : (
193
193
  <span
194
194
  role='img'
195
195
  aria-label={label}
196
- className='absolute rounded-[3px]'
196
+ className='absolute rounded-xs'
197
197
  style={style}
198
198
  />
199
199
  )}
@@ -7,10 +7,11 @@ import {
7
7
  XAxis,
8
8
  YAxis,
9
9
  } from 'recharts';
10
+ import type { ChartBox } from './chartBox.js';
10
11
  import { ChartFrame } from './ChartFrame.js';
11
12
  import { legendContent } from './ChartLegend.js';
12
13
  import { tooltipContent } from './ChartTooltip.js';
13
- import { axisProps, type ChartDatum, type ChartSeries, seriesColor } from './shared.js';
14
+ import { axisProps, valueAxisProps, type ChartDatum, type ChartSeries, seriesColor } from './shared.js';
14
15
 
15
16
  export type LineChartProps = {
16
17
  data: ChartDatum[];
@@ -49,10 +50,10 @@ export function LineChart({
49
50
  valueFormatter,
50
51
  labelFormatter,
51
52
  }: LineChartProps) {
52
- const showLegend = legend ?? series.length > 1;
53
+ const showLegend = (box: ChartBox) => legend ?? (!box.legendInHeader && series.length > 1);
53
54
  return (
54
55
  <ChartFrame ariaLabel={ariaLabel} height={height}>
55
- {(t) => (
56
+ {(t, box) => (
56
57
  <RLineChart data={data} margin={{ top: 8, right: 12, bottom: 0, left: 0 }}>
57
58
  {grid && (
58
59
  <CartesianGrid
@@ -64,18 +65,18 @@ export function LineChart({
64
65
  )}
65
66
  <XAxis
66
67
  dataKey={xKey}
67
- {...axisProps(t)}
68
+ {...axisProps(t, box)}
68
69
  tickFormatter={xTickFormatter}
69
70
  interval='preserveStartEnd'
70
- minTickGap={24}
71
+ minTickGap={box.gap(24)}
71
72
  />
72
- <YAxis {...axisProps(t)} tickFormatter={valueFormatter} width={yWidth} axisLine={false} />
73
+ <YAxis {...axisProps(t, box)} {...valueAxisProps(box, valueFormatter)} width={yWidth} axisLine={false} />
73
74
  <Tooltip
74
75
  content={tooltipContent(t, labelFormatter, valueFormatter)}
75
76
  cursor={{ stroke: t.foregroundMuted, strokeWidth: 1, strokeOpacity: 0.5 }}
76
77
  isAnimationActive={false}
77
78
  />
78
- {showLegend && <Legend content={legendContent(t)} />}
79
+ {showLegend(box) && <Legend content={legendContent(t)} />}
79
80
  {series.map((s, i) => (
80
81
  <Line
81
82
  key={s.dataKey}
@@ -83,7 +84,7 @@ export function LineChart({
83
84
  dataKey={s.dataKey}
84
85
  name={s.name ?? s.dataKey}
85
86
  stroke={seriesColor(t, s, i)}
86
- strokeWidth={2}
87
+ strokeWidth={box.stroke}
87
88
  dot={false}
88
89
  activeDot={{ r: 3 }}
89
90
  isAnimationActive={false}
@@ -1,9 +1,10 @@
1
1
  import { Area, CartesianGrid, ComposedChart, Legend, Line, ReferenceArea, ReferenceLine, Tooltip, XAxis, YAxis } from 'recharts';
2
+ import type { ChartBox } from './chartBox.js';
2
3
  import { ChartFrame } from './ChartFrame.js';
3
4
  import { legendContent } from './ChartLegend.js';
4
5
  import { tooltipContent } from './ChartTooltip.js';
5
6
  import { formatTimeFull, formatTimeTick } from './format.js';
6
- import { axisProps, type ChartDatum, type ChartSeries, seriesColor, useGradientId } from './shared.js';
7
+ import { axisProps, valueAxisProps, type ChartDatum, type ChartSeries, seriesColor, useGradientId } from './shared.js';
7
8
  import { type ChartTone, toneColor } from './tokens.js';
8
9
 
9
10
  /** A series on a time axis. Extends the shared shape with a render kind. */
@@ -82,7 +83,7 @@ export function TimeSeriesChart({
82
83
  series,
83
84
  ariaLabel,
84
85
  xKey = 'ts',
85
- height = 240,
86
+ height,
86
87
  includeDate = false,
87
88
  valueFormatter,
88
89
  references,
@@ -93,11 +94,11 @@ export function TimeSeriesChart({
93
94
  zeroBaseline = true,
94
95
  }: TimeSeriesChartProps) {
95
96
  const gradId = useGradientId();
96
- const showLegend = legend ?? series.length > 1;
97
+ const showLegend = (box: ChartBox) => legend ?? (!box.legendInHeader && series.length > 1);
97
98
 
98
99
  return (
99
100
  <ChartFrame ariaLabel={ariaLabel} height={height}>
100
- {(t) => (
101
+ {(t, box) => (
101
102
  <ComposedChart data={data} margin={{ top: 8, right: 12, bottom: 0, left: 0 }}>
102
103
  <defs>
103
104
  {series.map((s, i) => {
@@ -121,13 +122,13 @@ export function TimeSeriesChart({
121
122
  // intervals as equal and silently flattens the hole.
122
123
  domain={['dataMin', 'dataMax']}
123
124
  scale='time'
124
- {...axisProps(t)}
125
+ {...axisProps(t, box)}
125
126
  tickFormatter={(v) => formatTimeTick(Number(v), includeDate)}
126
- minTickGap={32}
127
+ minTickGap={box.gap(32)}
127
128
  />
128
129
  <YAxis
129
- {...axisProps(t)}
130
- tickFormatter={valueFormatter}
130
+ {...axisProps(t, box)}
131
+ {...valueAxisProps(box, valueFormatter)}
131
132
  width={yWidth}
132
133
  axisLine={false}
133
134
  domain={zeroBaseline ? [0, 'auto'] : ['auto', 'auto']}
@@ -178,7 +179,7 @@ export function TimeSeriesChart({
178
179
  cursor={{ stroke: t.foregroundMuted, strokeWidth: 1, strokeOpacity: 0.5 }}
179
180
  isAnimationActive={false}
180
181
  />
181
- {showLegend && <Legend content={legendContent(t)} />}
182
+ {showLegend(box) && <Legend content={legendContent(t)} />}
182
183
 
183
184
  {references?.map((r) => (
184
185
  <ReferenceLine
@@ -197,7 +198,7 @@ export function TimeSeriesChart({
197
198
  dataKey: s.dataKey,
198
199
  name: s.name ?? s.dataKey,
199
200
  stroke: c,
200
- strokeWidth: 2,
201
+ strokeWidth: box.stroke,
201
202
  isAnimationActive: false,
202
203
  ...(s.dashed ? { strokeDasharray: '5 4' } : {}),
203
204
  // A gap in the data must render as a gap. Without this recharts
@@ -0,0 +1,40 @@
1
+ import { describe, expect, test } from 'bun:test';
2
+ import { CHART_FALLBACK_HEIGHT, CHART_MAX_HEIGHT, CHART_MIN_HEIGHT, chartBox, chartHeight, chartTier } from './chartBox.js';
3
+
4
+ describe('chartBox (CHT-1, CHT-6)', () => {
5
+ test('tiers by the CONTAINER width — phone below 560, wide from 1280', () => {
6
+ expect(chartTier(390)).toBe('phone');
7
+ expect(chartTier(559)).toBe('phone');
8
+ expect(chartTier(560)).toBe('desktop');
9
+ expect(chartTier(1279)).toBe('desktop');
10
+ expect(chartTier(1280)).toBe('wide');
11
+ // Unmeasured is not a phone — the first paint must not flash the phone shape.
12
+ expect(chartTier(0)).toBe('desktop');
13
+ });
14
+
15
+ test('4:3 on a phone, 2:1 on a desktop, 3:1 wide — clamped to 160–400', () => {
16
+ expect(chartHeight(360)).toBe(270);
17
+ expect(chartHeight(700)).toBe(350);
18
+ expect(chartHeight(1500)).toBe(CHART_MAX_HEIGHT);
19
+ expect(chartHeight(900)).toBe(CHART_MAX_HEIGHT);
20
+ expect(chartHeight(150)).toBe(CHART_MIN_HEIGHT);
21
+ expect(chartHeight(0)).toBe(CHART_FALLBACK_HEIGHT);
22
+ });
23
+
24
+ test('marks scale with the tier: fewer ticks and wider gaps on a phone, heavier strokes wide', () => {
25
+ const phone = chartBox(390);
26
+ const wide = chartBox(1400);
27
+ expect(phone.tickCount).toBeLessThan(wide.tickCount);
28
+ expect(phone.gap(20)).toBe(40);
29
+ expect(wide.gap(20)).toBe(20);
30
+ expect(phone.stroke).toBeLessThan(chartBox(800).stroke);
31
+ expect(wide.stroke).toBeGreaterThan(chartBox(800).stroke);
32
+ });
33
+
34
+ test('a fixed height and the header legend pass through', () => {
35
+ const box = chartBox(800, { height: 222, legendInHeader: true });
36
+ expect(box.height).toBe(222);
37
+ expect(box.legendInHeader).toBe(true);
38
+ expect(chartBox(800).legendInHeader).toBe(false);
39
+ });
40
+ });