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.
- package/dist/react/Toast.d.ts +12 -2
- package/dist/react/Toast.d.ts.map +1 -1
- package/dist/react/Toast.js +32 -3
- package/dist/react/Toast.js.map +1 -1
- package/dist/react/analytics/MetricDrilldown.js +1 -1
- package/dist/react/charts/AreaChart.d.ts.map +1 -1
- package/dist/react/charts/AreaChart.js +5 -5
- package/dist/react/charts/AreaChart.js.map +1 -1
- package/dist/react/charts/BarChart.d.ts.map +1 -1
- package/dist/react/charts/BarChart.js +3 -3
- package/dist/react/charts/BarChart.js.map +1 -1
- package/dist/react/charts/ChartCard.d.ts +53 -0
- package/dist/react/charts/ChartCard.d.ts.map +1 -0
- package/dist/react/charts/ChartCard.js +46 -0
- package/dist/react/charts/ChartCard.js.map +1 -0
- package/dist/react/charts/ChartFrame.d.ts +12 -5
- package/dist/react/charts/ChartFrame.d.ts.map +1 -1
- package/dist/react/charts/ChartFrame.js +12 -5
- package/dist/react/charts/ChartFrame.js.map +1 -1
- package/dist/react/charts/ChartLegend.js +1 -1
- package/dist/react/charts/ChartLegend.js.map +1 -1
- package/dist/react/charts/HeatmapChart.js +3 -3
- package/dist/react/charts/HeatmapChart.js.map +1 -1
- package/dist/react/charts/IntervalTimeline.js +1 -1
- package/dist/react/charts/IntervalTimeline.js.map +1 -1
- package/dist/react/charts/LineChart.d.ts.map +1 -1
- package/dist/react/charts/LineChart.js +3 -3
- package/dist/react/charts/LineChart.js.map +1 -1
- package/dist/react/charts/TimeSeriesChart.d.ts.map +1 -1
- package/dist/react/charts/TimeSeriesChart.js +6 -6
- package/dist/react/charts/TimeSeriesChart.js.map +1 -1
- package/dist/react/charts/chartBox.d.ts +46 -0
- package/dist/react/charts/chartBox.d.ts.map +1 -0
- package/dist/react/charts/chartBox.js +45 -0
- package/dist/react/charts/chartBox.js.map +1 -0
- package/dist/react/charts/index.d.ts +2 -0
- package/dist/react/charts/index.d.ts.map +1 -1
- package/dist/react/charts/index.js +2 -0
- package/dist/react/charts/index.js.map +1 -1
- package/dist/react/charts/shared.d.ts +13 -2
- package/dist/react/charts/shared.d.ts.map +1 -1
- package/dist/react/charts/shared.js +14 -3
- package/dist/react/charts/shared.js.map +1 -1
- package/dist/react/chat/Bubble.js +4 -4
- package/dist/react/chat/Bubble.js.map +1 -1
- package/dist/react/chat/MessageScroller.js +1 -1
- package/dist/react/chat/MessageScroller.js.map +1 -1
- package/dist/react/components/ActionBar.d.ts.map +1 -1
- package/dist/react/components/ActionBar.js +63 -1
- package/dist/react/components/ActionBar.js.map +1 -1
- package/dist/react/components/AddItemsMenu.js +1 -1
- package/dist/react/components/AddItemsMenu.js.map +1 -1
- package/dist/react/components/Alert.d.ts +16 -2
- package/dist/react/components/Alert.d.ts.map +1 -1
- package/dist/react/components/Alert.js +35 -2
- package/dist/react/components/Alert.js.map +1 -1
- package/dist/react/components/AppShell.d.ts +55 -33
- package/dist/react/components/AppShell.d.ts.map +1 -1
- package/dist/react/components/AppShell.js +121 -31
- package/dist/react/components/AppShell.js.map +1 -1
- package/dist/react/components/AsyncPanel.d.ts +21 -3
- package/dist/react/components/AsyncPanel.d.ts.map +1 -1
- package/dist/react/components/AsyncPanel.js +49 -5
- package/dist/react/components/AsyncPanel.js.map +1 -1
- package/dist/react/components/BannerLane.d.ts +32 -0
- package/dist/react/components/BannerLane.d.ts.map +1 -0
- package/dist/react/components/BannerLane.js +41 -0
- package/dist/react/components/BannerLane.js.map +1 -0
- package/dist/react/components/Button.d.ts.map +1 -1
- package/dist/react/components/Button.js +2 -1
- package/dist/react/components/Button.js.map +1 -1
- package/dist/react/components/ChipFilterStrip.js +1 -1
- package/dist/react/components/ChipFilterStrip.js.map +1 -1
- package/dist/react/components/ComboboxField.d.ts.map +1 -1
- package/dist/react/components/ComboboxField.js +14 -4
- package/dist/react/components/ComboboxField.js.map +1 -1
- package/dist/react/components/CommentThread.js +2 -2
- package/dist/react/components/CommentThread.js.map +1 -1
- package/dist/react/components/ConfirmDialog.js +1 -1
- package/dist/react/components/ConfirmDialog.js.map +1 -1
- package/dist/react/components/DataTable/DataTable.d.ts +18 -2
- package/dist/react/components/DataTable/DataTable.d.ts.map +1 -1
- package/dist/react/components/DataTable/DataTable.js +51 -12
- package/dist/react/components/DataTable/DataTable.js.map +1 -1
- package/dist/react/components/DataTable/Pagination.js +1 -1
- package/dist/react/components/DataTable/Pagination.js.map +1 -1
- package/dist/react/components/DataTable/RowActions.d.ts +7 -1
- package/dist/react/components/DataTable/RowActions.d.ts.map +1 -1
- package/dist/react/components/DataTable/RowActions.js +10 -3
- package/dist/react/components/DataTable/RowActions.js.map +1 -1
- package/dist/react/components/DataTable/TableFilterBuilder.js +1 -1
- package/dist/react/components/DataTable/TableFilterBuilder.js.map +1 -1
- package/dist/react/components/DataTable/cells/CodeCell.js +1 -1
- package/dist/react/components/DataTable/cells/CodeCell.js.map +1 -1
- package/dist/react/components/DataTable/cells/LinkCell.js +1 -1
- package/dist/react/components/DataTable/cells/LinkCell.js.map +1 -1
- package/dist/react/components/DataTable/index.d.ts +1 -1
- package/dist/react/components/DataTable/index.d.ts.map +1 -1
- package/dist/react/components/DataTable/index.js.map +1 -1
- package/dist/react/components/DataTable/types.d.ts +20 -0
- package/dist/react/components/DataTable/types.d.ts.map +1 -1
- package/dist/react/components/DataTable/types.js +22 -0
- package/dist/react/components/DataTable/types.js.map +1 -1
- package/dist/react/components/DateTimeField.d.ts.map +1 -1
- package/dist/react/components/DateTimeField.js +4 -1
- package/dist/react/components/DateTimeField.js.map +1 -1
- package/dist/react/components/DeleteButton.js +2 -0
- package/dist/react/components/DeleteButton.js.map +1 -1
- package/dist/react/components/Drawer.js +3 -3
- package/dist/react/components/Drawer.js.map +1 -1
- package/dist/react/components/DropdownMenu.d.ts +16 -0
- package/dist/react/components/DropdownMenu.d.ts.map +1 -1
- package/dist/react/components/DropdownMenu.js +22 -6
- package/dist/react/components/DropdownMenu.js.map +1 -1
- package/dist/react/components/EmptyState.d.ts +10 -2
- package/dist/react/components/EmptyState.d.ts.map +1 -1
- package/dist/react/components/EmptyState.js +10 -5
- package/dist/react/components/EmptyState.js.map +1 -1
- package/dist/react/components/EventTimeline.js +1 -1
- package/dist/react/components/EventTimeline.js.map +1 -1
- package/dist/react/components/FileDropZone.js +1 -1
- package/dist/react/components/FileDropZone.js.map +1 -1
- package/dist/react/components/Grid.d.ts +9 -1
- package/dist/react/components/Grid.d.ts.map +1 -1
- package/dist/react/components/Grid.js +20 -2
- package/dist/react/components/Grid.js.map +1 -1
- package/dist/react/components/Guide.d.ts +31 -0
- package/dist/react/components/Guide.d.ts.map +1 -0
- package/dist/react/components/Guide.js +18 -0
- package/dist/react/components/Guide.js.map +1 -0
- package/dist/react/components/InfoHintImpl.d.ts +0 -13
- package/dist/react/components/InfoHintImpl.d.ts.map +1 -1
- package/dist/react/components/InfoHintImpl.js +17 -1
- package/dist/react/components/InfoHintImpl.js.map +1 -1
- package/dist/react/components/InlineEditableText.js +1 -1
- package/dist/react/components/InlineEditableText.js.map +1 -1
- package/dist/react/components/IsolatedFrame.js +1 -1
- package/dist/react/components/IsolatedFrame.js.map +1 -1
- package/dist/react/components/ListToolbar.d.ts.map +1 -1
- package/dist/react/components/ListToolbar.js +2 -2
- package/dist/react/components/ListToolbar.js.map +1 -1
- package/dist/react/components/LogViewer.d.ts +26 -2
- package/dist/react/components/LogViewer.d.ts.map +1 -1
- package/dist/react/components/LogViewer.js +41 -26
- package/dist/react/components/LogViewer.js.map +1 -1
- package/dist/react/components/Modal.d.ts +5 -1
- package/dist/react/components/Modal.d.ts.map +1 -1
- package/dist/react/components/Modal.js +18 -8
- package/dist/react/components/Modal.js.map +1 -1
- package/dist/react/components/Page.d.ts +51 -7
- package/dist/react/components/Page.d.ts.map +1 -1
- package/dist/react/components/Page.js +53 -8
- package/dist/react/components/Page.js.map +1 -1
- package/dist/react/components/PageGuideButton.d.ts +11 -0
- package/dist/react/components/PageGuideButton.d.ts.map +1 -0
- package/dist/react/components/PageGuideButton.js +13 -0
- package/dist/react/components/PageGuideButton.js.map +1 -0
- package/dist/react/components/PanelSeparator.js +1 -1
- package/dist/react/components/PanelSeparator.js.map +1 -1
- package/dist/react/components/Popover.d.ts.map +1 -1
- package/dist/react/components/Popover.js +2 -1
- package/dist/react/components/Popover.js.map +1 -1
- package/dist/react/components/PromptDialog.js +1 -1
- package/dist/react/components/PromptDialog.js.map +1 -1
- package/dist/react/components/ScrollArea.d.ts +9 -1
- package/dist/react/components/ScrollArea.d.ts.map +1 -1
- package/dist/react/components/ScrollArea.js +9 -3
- package/dist/react/components/ScrollArea.js.map +1 -1
- package/dist/react/components/Section.d.ts +5 -2
- package/dist/react/components/Section.d.ts.map +1 -1
- package/dist/react/components/Section.js +5 -2
- package/dist/react/components/Section.js.map +1 -1
- package/dist/react/components/Skeleton.d.ts +19 -1
- package/dist/react/components/Skeleton.d.ts.map +1 -1
- package/dist/react/components/Skeleton.js +24 -2
- package/dist/react/components/Skeleton.js.map +1 -1
- package/dist/react/components/StatStrip.js +1 -1
- package/dist/react/components/StatStrip.js.map +1 -1
- package/dist/react/components/StatTile.d.ts +30 -3
- package/dist/react/components/StatTile.d.ts.map +1 -1
- package/dist/react/components/StatTile.js +35 -9
- package/dist/react/components/StatTile.js.map +1 -1
- package/dist/react/components/StatTileGrid.d.ts +10 -1
- package/dist/react/components/StatTileGrid.d.ts.map +1 -1
- package/dist/react/components/StatTileGrid.js +50 -33
- package/dist/react/components/StatTileGrid.js.map +1 -1
- package/dist/react/components/StatusPill.d.ts.map +1 -1
- package/dist/react/components/StatusPill.js +26 -1
- package/dist/react/components/StatusPill.js.map +1 -1
- package/dist/react/components/Surface.d.ts +1 -1
- package/dist/react/components/Surface.d.ts.map +1 -1
- package/dist/react/components/Surface.js +20 -11
- package/dist/react/components/Surface.js.map +1 -1
- package/dist/react/components/SwatchPicker.d.ts.map +1 -1
- package/dist/react/components/SwatchPicker.js +5 -1
- package/dist/react/components/SwatchPicker.js.map +1 -1
- package/dist/react/components/Switch.js +1 -1
- package/dist/react/components/Switch.js.map +1 -1
- package/dist/react/components/WidgetHeader.js +1 -1
- package/dist/react/components/WidgetHeader.js.map +1 -1
- package/dist/react/components/calendar/CalendarLegend.js +1 -1
- package/dist/react/components/calendar/CalendarLegend.js.map +1 -1
- package/dist/react/components/calendar/DayAgenda.js +1 -1
- package/dist/react/components/calendar/DayAgenda.js.map +1 -1
- package/dist/react/components/calendar/EventChip.js +1 -1
- package/dist/react/components/calendar/EventChip.js.map +1 -1
- package/dist/react/components/calendar/MonthGrid.js +1 -1
- package/dist/react/components/calendar/MonthGrid.js.map +1 -1
- package/dist/react/components/calendar/WeekView.js +2 -2
- package/dist/react/components/calendar/WeekView.js.map +1 -1
- package/dist/react/components/cardFrame.d.ts +16 -0
- package/dist/react/components/cardFrame.d.ts.map +1 -0
- package/dist/react/components/cardFrame.js +24 -0
- package/dist/react/components/cardFrame.js.map +1 -0
- package/dist/react/components/dialog.d.ts.map +1 -1
- package/dist/react/components/dialog.js +2 -1
- package/dist/react/components/dialog.js.map +1 -1
- package/dist/react/dashboard-grid/WidgetFrame.js +2 -2
- package/dist/react/dashboard-grid/WidgetFrame.js.map +1 -1
- package/dist/react/emoji/EmojiPicker.js +1 -1
- package/dist/react/emoji/EmojiPicker.js.map +1 -1
- package/dist/react/file-tree/FileTree.d.ts +8 -1
- package/dist/react/file-tree/FileTree.d.ts.map +1 -1
- package/dist/react/file-tree/FileTree.js +29 -4
- package/dist/react/file-tree/FileTree.js.map +1 -1
- package/dist/react/filter-rail/FilterRail.js +1 -1
- package/dist/react/filter-rail/FilterRail.js.map +1 -1
- package/dist/react/icons.js +1 -1
- package/dist/react/icons.js.map +1 -1
- package/dist/react/index.d.ts +8 -5
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +5 -2
- package/dist/react/index.js.map +1 -1
- package/dist/react/lib/menuSections.d.ts +8 -0
- package/dist/react/lib/menuSections.d.ts.map +1 -0
- package/dist/react/lib/menuSections.js +37 -0
- package/dist/react/lib/menuSections.js.map +1 -0
- package/dist/react/markdown/Markdown.js +2 -2
- package/dist/react/markdown/Markdown.js.map +1 -1
- package/dist/react/media/HoverScrubVideoThumb.js +1 -1
- package/dist/react/media/HoverScrubVideoThumb.js.map +1 -1
- package/dist/react/media/MaskPainter.js +1 -1
- package/dist/react/media/MediaUploadControl.js +1 -1
- package/dist/react/media/MediaUploadControl.js.map +1 -1
- package/dist/react/media/VideoTrimmer.js +1 -1
- package/dist/react/media/VideoTrimmer.js.map +1 -1
- package/dist/react/media/denseGallery.css +5 -1
- package/dist/react/namespace/NamespaceTargetCapsule.js +1 -1
- package/dist/react/namespace/NamespaceTargetCapsule.js.map +1 -1
- package/dist/react/nav/BreadcrumbTrail.js +1 -1
- package/dist/react/nav/BreadcrumbTrail.js.map +1 -1
- package/dist/react/nav/CommandBar.d.ts +7 -1
- package/dist/react/nav/CommandBar.d.ts.map +1 -1
- package/dist/react/nav/CommandBar.js +5 -3
- package/dist/react/nav/CommandBar.js.map +1 -1
- package/dist/react/nav/PlaceBar.d.ts.map +1 -1
- package/dist/react/nav/PlaceBar.js +7 -9
- package/dist/react/nav/PlaceBar.js.map +1 -1
- package/dist/react/nav/SideNav.d.ts +12 -2
- package/dist/react/nav/SideNav.d.ts.map +1 -1
- package/dist/react/nav/SideNav.js +42 -22
- package/dist/react/nav/SideNav.js.map +1 -1
- package/dist/react/nav/TopBar.d.ts +65 -31
- package/dist/react/nav/TopBar.d.ts.map +1 -1
- package/dist/react/nav/TopBar.js +59 -24
- package/dist/react/nav/TopBar.js.map +1 -1
- package/dist/react/nav/index.d.ts +1 -1
- package/dist/react/nav/index.d.ts.map +1 -1
- package/dist/react/nav/index.js +1 -1
- package/dist/react/nav/index.js.map +1 -1
- package/dist/react/nav/navShared.d.ts +10 -1
- package/dist/react/nav/navShared.d.ts.map +1 -1
- package/dist/react/nav/navShared.js +23 -0
- package/dist/react/nav/navShared.js.map +1 -1
- package/dist/react/notifications/NotificationFeed.js +2 -2
- package/dist/react/notifications/NotificationFeed.js.map +1 -1
- package/dist/react/palette/Command.d.ts.map +1 -1
- package/dist/react/palette/Command.js +1 -1
- package/dist/react/palette/Command.js.map +1 -1
- package/dist/react/palette/CommandPalette.d.ts +13 -1
- package/dist/react/palette/CommandPalette.d.ts.map +1 -1
- package/dist/react/palette/CommandPalette.js +44 -8
- package/dist/react/palette/CommandPalette.js.map +1 -1
- package/dist/react/palette/commandSources.d.ts +57 -0
- package/dist/react/palette/commandSources.d.ts.map +1 -0
- package/dist/react/palette/commandSources.js +129 -0
- package/dist/react/palette/commandSources.js.map +1 -0
- package/dist/react/palette/index.d.ts +1 -0
- package/dist/react/palette/index.d.ts.map +1 -1
- package/dist/react/palette/index.js +1 -0
- package/dist/react/palette/index.js.map +1 -1
- package/dist/react/rich-text/RichTextEditor.js +1 -1
- package/dist/react/rich-text/RichTextEditor.js.map +1 -1
- package/dist/react/rich-text/RichTextToolbar.js +1 -1
- package/dist/react/rich-text/RichTextToolbar.js.map +1 -1
- package/dist/scripts/guardrailsEnforce.d.ts.map +1 -1
- package/dist/styles-areas/analytics.css +16 -16
- package/dist/styles-areas/auth.css +3 -3
- package/dist/styles-areas/calendar.css +6 -6
- package/dist/styles-areas/chart-table.css +1 -1
- package/dist/styles-areas/charts.css +3 -3
- package/dist/styles-areas/chat.css +7 -6
- package/dist/styles-areas/companion-link.css +2 -2
- package/dist/styles-areas/core.css +98 -89
- package/dist/styles-areas/dashboard-grid.css +4 -4
- package/dist/styles-areas/data-table.css +16 -16
- package/dist/styles-areas/disk-usage.css +5 -5
- package/dist/styles-areas/emoji.css +2 -2
- package/dist/styles-areas/fields.css +13 -14
- package/dist/styles-areas/filter-rail.css +4 -4
- package/dist/styles-areas/folder-tree.css +3 -3
- package/dist/styles-areas/markdown.css +2 -1
- package/dist/styles-areas/master-detail.css +3 -3
- package/dist/styles-areas/media-gallery.css +8 -8
- package/dist/styles-areas/media.css +12 -13
- package/dist/styles-areas/nav.css +28 -14
- package/dist/styles-areas/notifications.css +4 -4
- package/dist/styles-areas/overlays.css +4 -4
- package/dist/styles-areas/palette.css +4 -3
- package/dist/styles-areas/rich-text.css +3 -3
- package/dist/styles-areas/sharing.css +4 -3
- package/dist/styles-areas/stats.css +9 -8
- package/dist/styles-areas/test-report.css +3 -3
- package/dist/styles-areas/wizard.css +6 -5
- package/dist/styles-areas/workbench.css +10 -9
- package/dist/styles-areas/workbook-viewer.css +2 -2
- package/dist/styles-utilities.css +272 -187
- package/dist/testing/designAudit.d.ts.map +1 -1
- package/dist/testing/designAudit.js +4 -0
- package/dist/testing/designAudit.js.map +1 -1
- package/dist/testing/designBaseline.d.ts.map +1 -1
- package/dist/testing/designBaseline.js +4 -0
- package/dist/testing/designBaseline.js.map +1 -1
- package/dist/theme.css +103 -2
- package/package.json +3 -2
- package/scripts/guardrails-baseline.json +2 -1
- package/scripts/guardrailsEnforce.spec.ts +64 -0
- package/scripts/guardrailsEnforce.ts +65 -8
- package/scripts/styleAreas.ts +1 -0
- package/src/nodeTypesDeclared.spec.ts +47 -0
- package/src/react/Toast.spec.tsx +43 -0
- package/src/react/Toast.tsx +45 -2
- package/src/react/analytics/MetricDrilldown.tsx +1 -1
- package/src/react/charts/AreaChart.tsx +9 -8
- package/src/react/charts/BarChart.tsx +11 -10
- package/src/react/charts/ChartCard.tsx +146 -0
- package/src/react/charts/ChartFrame.tsx +28 -10
- package/src/react/charts/ChartLegend.tsx +1 -1
- package/src/react/charts/HeatmapChart.tsx +5 -5
- package/src/react/charts/IntervalTimeline.tsx +2 -2
- package/src/react/charts/LineChart.tsx +9 -8
- package/src/react/charts/TimeSeriesChart.tsx +11 -10
- package/src/react/charts/chartBox.spec.ts +40 -0
- package/src/react/charts/chartBox.ts +75 -0
- package/src/react/charts/index.ts +2 -0
- package/src/react/charts/shared.ts +16 -3
- package/src/react/chat/Bubble.tsx +5 -5
- package/src/react/chat/MessageScroller.tsx +1 -1
- package/src/react/components/ActionBar.spec.tsx +90 -0
- package/src/react/components/ActionBar.tsx +82 -2
- package/src/react/components/AddItemsMenu.tsx +1 -1
- package/src/react/components/Alert.spec.tsx +32 -2
- package/src/react/components/Alert.tsx +47 -3
- package/src/react/components/AppShell.spec.tsx +199 -13
- package/src/react/components/AppShell.tsx +235 -92
- package/src/react/components/AsyncPanel.spec.tsx +7 -1
- package/src/react/components/AsyncPanel.tsx +85 -5
- package/src/react/components/BannerLane.tsx +128 -0
- package/src/react/components/Button.tsx +2 -0
- package/src/react/components/ChipFilterStrip.tsx +1 -1
- package/src/react/components/ComboboxField.tsx +20 -3
- package/src/react/components/CommentThread.tsx +2 -2
- package/src/react/components/ConfirmDialog.tsx +1 -1
- package/src/react/components/DataTable/DataTable.tsx +80 -8
- package/src/react/components/DataTable/Pagination.tsx +1 -1
- package/src/react/components/DataTable/RowActions.tsx +55 -2
- package/src/react/components/DataTable/TableFilterBuilder.tsx +1 -1
- package/src/react/components/DataTable/cells/CodeCell.tsx +1 -1
- package/src/react/components/DataTable/cells/LinkCell.tsx +1 -1
- package/src/react/components/DataTable/index.ts +1 -0
- package/src/react/components/DataTable/numericColumn.spec.ts +19 -0
- package/src/react/components/DataTable/types.ts +36 -0
- package/src/react/components/DateTimeField.tsx +3 -1
- package/src/react/components/DeleteButton.tsx +3 -0
- package/src/react/components/Drawer.tsx +3 -3
- package/src/react/components/DropdownMenu.spec.tsx +55 -0
- package/src/react/components/DropdownMenu.tsx +73 -20
- package/src/react/components/EmptyState.tsx +26 -7
- package/src/react/components/EventTimeline.tsx +1 -1
- package/src/react/components/Field.width.spec.tsx +11 -0
- package/src/react/components/FileDropZone.tsx +1 -1
- package/src/react/components/Grid.spec.tsx +44 -0
- package/src/react/components/Grid.tsx +41 -11
- package/src/react/components/Guide.tsx +77 -0
- package/src/react/components/InfoHint.spec.tsx +21 -0
- package/src/react/components/InfoHintImpl.tsx +22 -1
- package/src/react/components/InlineEditableText.tsx +1 -1
- package/src/react/components/IsolatedFrame.tsx +1 -1
- package/src/react/components/ListToolbar.spec.tsx +12 -0
- package/src/react/components/ListToolbar.tsx +8 -5
- package/src/react/components/LogViewer.tsx +118 -18
- package/src/react/components/Modal.spec.tsx +17 -2
- package/src/react/components/Modal.tsx +25 -10
- package/src/react/components/MultiSelectField.spec.tsx +6 -0
- package/src/react/components/Page.spec.tsx +89 -5
- package/src/react/components/Page.tsx +100 -16
- package/src/react/components/PageGuideButton.tsx +42 -0
- package/src/react/components/PanelSeparator.tsx +1 -1
- package/src/react/components/Popover.tsx +3 -1
- package/src/react/components/PromptDialog.tsx +1 -1
- package/src/react/components/ScrollArea.spec.tsx +20 -0
- package/src/react/components/ScrollArea.tsx +19 -0
- package/src/react/components/Section.spec.tsx +82 -1
- package/src/react/components/Section.tsx +10 -4
- package/src/react/components/Skeleton.tsx +50 -2
- package/src/react/components/StatStrip.tsx +1 -1
- package/src/react/components/StatTile.tsx +84 -11
- package/src/react/components/StatTileGrid.spec.tsx +6 -1
- package/src/react/components/StatTileGrid.tsx +25 -0
- package/src/react/components/StatusPill.tsx +26 -1
- package/src/react/components/Surface.tsx +22 -14
- package/src/react/components/SwatchPicker.tsx +4 -0
- package/src/react/components/Switch.tsx +1 -1
- package/src/react/components/WidgetHeader.tsx +1 -1
- package/src/react/components/calendar/CalendarLegend.tsx +1 -1
- package/src/react/components/calendar/DayAgenda.tsx +1 -1
- package/src/react/components/calendar/EventChip.tsx +1 -1
- package/src/react/components/calendar/MonthGrid.tsx +1 -1
- package/src/react/components/calendar/WeekView.tsx +2 -2
- package/src/react/components/cardFrame.ts +28 -0
- package/src/react/components/dataDisplay.spec.tsx +176 -0
- package/src/react/components/dialog.tsx +4 -1
- package/src/react/dashboard-grid/WidgetFrame.tsx +2 -2
- package/src/react/emoji/EmojiPicker.tsx +1 -1
- package/src/react/file-tree/FileTree.spec.tsx +49 -0
- package/src/react/file-tree/FileTree.tsx +37 -4
- package/src/react/filter-rail/FilterRail.tsx +1 -1
- package/src/react/icons.tsx +1 -1
- package/src/react/index.ts +28 -3
- package/src/react/lib/menuSections.ts +33 -0
- package/src/react/markdown/Markdown.tsx +2 -2
- package/src/react/media/HoverScrubVideoThumb.tsx +2 -2
- package/src/react/media/MaskPainter.tsx +1 -1
- package/src/react/media/MediaUploadControl.tsx +1 -1
- package/src/react/media/VideoTrimmer.tsx +1 -1
- package/src/react/media/denseGallery.css +5 -1
- package/src/react/namespace/NamespaceTargetCapsule.tsx +1 -1
- package/src/react/nav/BreadcrumbTrail.tsx +2 -2
- package/src/react/nav/CommandBar.tsx +14 -3
- package/src/react/nav/PlaceBar.tsx +18 -8
- package/src/react/nav/SideNav.tsx +99 -17
- package/src/react/nav/TopBar.spec.tsx +78 -21
- package/src/react/nav/TopBar.tsx +270 -98
- package/src/react/nav/index.ts +8 -1
- package/src/react/nav/nav.spec.tsx +46 -2
- package/src/react/nav/navShared.tsx +23 -2
- package/src/react/notifications/NotificationFeed.tsx +2 -2
- package/src/react/palette/Command.tsx +1 -1
- package/src/react/palette/CommandPalette.spec.tsx +31 -0
- package/src/react/palette/CommandPalette.tsx +108 -11
- package/src/react/palette/commandSources.tsx +186 -0
- package/src/react/palette/index.ts +7 -0
- package/src/react/rich-text/RichTextEditor.tsx +1 -1
- package/src/react/rich-text/RichTextToolbar.tsx +1 -1
- package/src/styles-areas/analytics.css +16 -16
- package/src/styles-areas/auth.css +3 -3
- package/src/styles-areas/calendar.css +6 -6
- package/src/styles-areas/chart-table.css +1 -1
- package/src/styles-areas/charts.css +3 -3
- package/src/styles-areas/chat.css +7 -6
- package/src/styles-areas/companion-link.css +2 -2
- package/src/styles-areas/core.css +98 -89
- package/src/styles-areas/dashboard-grid.css +4 -4
- package/src/styles-areas/data-table.css +16 -16
- package/src/styles-areas/disk-usage.css +5 -5
- package/src/styles-areas/emoji.css +2 -2
- package/src/styles-areas/fields.css +13 -14
- package/src/styles-areas/filter-rail.css +4 -4
- package/src/styles-areas/folder-tree.css +3 -3
- package/src/styles-areas/markdown.css +2 -1
- package/src/styles-areas/master-detail.css +3 -3
- package/src/styles-areas/media-gallery.css +8 -8
- package/src/styles-areas/media.css +12 -13
- package/src/styles-areas/nav.css +28 -14
- package/src/styles-areas/notifications.css +4 -4
- package/src/styles-areas/overlays.css +4 -4
- package/src/styles-areas/palette.css +4 -3
- package/src/styles-areas/rich-text.css +3 -3
- package/src/styles-areas/sharing.css +4 -3
- package/src/styles-areas/stats.css +9 -8
- package/src/styles-areas/test-report.css +3 -3
- package/src/styles-areas/wizard.css +6 -5
- package/src/styles-areas/workbench.css +10 -9
- package/src/styles-areas/workbook-viewer.css +2 -2
- package/src/styles-utilities.css +272 -187
- package/src/testing/designAudit.ts +3 -0
- package/src/testing/designBaseline.ts +4 -0
- package/src/theme.css +103 -2
- package/src/themeDarkScopeAliases.spec.ts +65 -0
package/src/react/Toast.tsx
CHANGED
|
@@ -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
|
-
|
|
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: {
|
|
@@ -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)}
|
|
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={
|
|
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)}
|
|
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
|
-
|
|
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
|
-
/**
|
|
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
|
|
20
|
-
* and never overflows its column.
|
|
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
|
|
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
|
|
27
|
-
|
|
28
|
-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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)}
|
|
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={
|
|
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
|
|
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
|
-
|
|
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:
|
|
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
|
+
});
|