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
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
|
|
3
|
+
// The chart's box: what shape the frame takes at a width, and how the marks inside it scale
|
|
4
|
+
// with that width (CHT-1, CHT-6). Pure so it unit-tests without a DOM; `ChartFrame` measures
|
|
5
|
+
// its own width and hands the result to the chart it renders, and `ChartCard`'s skeleton and
|
|
6
|
+
// empty state take the SAME height, so nothing jumps when the data lands (CHT-9, STA-1).
|
|
7
|
+
|
|
8
|
+
/** Width tiers of the chart's CONTAINER (not the viewport — a chart in a narrow pane on a
|
|
9
|
+
* wide screen is a phone-sized chart). */
|
|
10
|
+
export type ChartTier = 'phone' | 'desktop' | 'wide';
|
|
11
|
+
|
|
12
|
+
export interface ChartBox {
|
|
13
|
+
tier: ChartTier;
|
|
14
|
+
/** The container's measured width in px (0 before the first measure). */
|
|
15
|
+
width: number;
|
|
16
|
+
/** The plot height the frame claims. */
|
|
17
|
+
height: number;
|
|
18
|
+
/** Series stroke width: heavier on a wide screen, lighter on a phone (CHT-6). */
|
|
19
|
+
stroke: number;
|
|
20
|
+
/** How many y ticks to aim for — fewer gridlines on a phone (CHT-6). */
|
|
21
|
+
tickCount: number;
|
|
22
|
+
/** Axis tick font size in px. */
|
|
23
|
+
tickFontSize: number;
|
|
24
|
+
/** Scale a chart's own `minTickGap` for the tier — x labels thin out on a phone. */
|
|
25
|
+
gap: (base: number) => number;
|
|
26
|
+
/** True inside a `ChartCard` that draws the legend in its header (CHT-2) — the chart then
|
|
27
|
+
* leaves its own legend off, so the plot keeps its height. */
|
|
28
|
+
legendInHeader: boolean;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Below this container width a chart is phone-shaped. */
|
|
32
|
+
export const CHART_PHONE_MAX = 560;
|
|
33
|
+
/** At or above this container width a chart is wide-screen-shaped (a `wide` 1536px page on a
|
|
34
|
+
* 2,560px monitor lands here; a `dashboard` 1152px page does not). */
|
|
35
|
+
export const CHART_WIDE_MIN = 1280;
|
|
36
|
+
/** The frame never gets shorter or taller than these, whatever the aspect says. */
|
|
37
|
+
export const CHART_MIN_HEIGHT = 160;
|
|
38
|
+
export const CHART_MAX_HEIGHT = 400;
|
|
39
|
+
/** Before the first measure — the height every chart used to hard-code. */
|
|
40
|
+
export const CHART_FALLBACK_HEIGHT = 240;
|
|
41
|
+
|
|
42
|
+
export function chartTier(width: number): ChartTier {
|
|
43
|
+
if (width > 0 && width < CHART_PHONE_MAX) return 'phone';
|
|
44
|
+
if (width >= CHART_WIDE_MIN) return 'wide';
|
|
45
|
+
return 'desktop';
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** CHT-1: 4:3 on a phone, about 2:1 on a desktop, about 3:1 on a very wide screen. */
|
|
49
|
+
export function chartAspect(tier: ChartTier): number {
|
|
50
|
+
return tier === 'phone' ? 4 / 3 : tier === 'wide' ? 3 : 2;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** The frame's height at a width — the aspect, clamped so a chart is never a sliver or a wall. */
|
|
54
|
+
export function chartHeight(width: number): number {
|
|
55
|
+
if (width <= 0) return CHART_FALLBACK_HEIGHT;
|
|
56
|
+
const h = Math.round(width / chartAspect(chartTier(width)));
|
|
57
|
+
return Math.min(CHART_MAX_HEIGHT, Math.max(CHART_MIN_HEIGHT, h));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function chartBox(width: number, options: { height?: number; legendInHeader?: boolean } = {}): ChartBox {
|
|
61
|
+
const tier = chartTier(width);
|
|
62
|
+
return {
|
|
63
|
+
tier,
|
|
64
|
+
width,
|
|
65
|
+
height: options.height ?? chartHeight(width),
|
|
66
|
+
stroke: tier === 'phone' ? 1.5 : tier === 'wide' ? 2.5 : 2,
|
|
67
|
+
tickCount: tier === 'phone' ? 3 : 5,
|
|
68
|
+
tickFontSize: tier === 'wide' ? 13 : 12,
|
|
69
|
+
gap: (base) => (tier === 'phone' ? base * 2 : base),
|
|
70
|
+
legendInHeader: options.legendInHeader ?? false,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Set by `ChartCard` around its body — read by `ChartFrame`. */
|
|
75
|
+
export const ChartCardContext = createContext<{ legendInHeader: boolean; height?: number } | null>(null);
|
|
@@ -19,6 +19,8 @@ export {
|
|
|
19
19
|
hexToRgb,
|
|
20
20
|
sequentialStep,
|
|
21
21
|
} from './categorical.js';
|
|
22
|
+
export { ChartCard, type ChartCardLegendItem, type ChartCardProps } from './ChartCard.js';
|
|
23
|
+
export { type ChartBox, type ChartTier, chartHeight } from './chartBox.js';
|
|
22
24
|
export { ChartFrame, type ChartFrameProps } from './ChartFrame.js';
|
|
23
25
|
export { ChartLegend, type ChartLegendProps, legendContent } from './ChartLegend.js';
|
|
24
26
|
export { ChartTooltip, type ChartTooltipProps, tooltipContent } from './ChartTooltip.js';
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { useId } from 'react';
|
|
2
|
+
import type { ChartBox } from './chartBox.js';
|
|
3
|
+
import { formatNumber } from './format.js';
|
|
2
4
|
import { type ChartTokens, type ChartTone, toneColor } from './tokens.js';
|
|
3
5
|
|
|
4
6
|
/** A row of chart data — string/number cells keyed by the x-axis + series dataKeys. */
|
|
@@ -20,12 +22,23 @@ export type ChartSeries = {
|
|
|
20
22
|
export const seriesColor = (t: ChartTokens, item: { tone?: ChartTone }, i: number): string =>
|
|
21
23
|
item.tone ? toneColor(t, item.tone) : t.series[i % t.series.length];
|
|
22
24
|
|
|
23
|
-
/** Shared cartesian-axis styling so every chart's ticks/lines read identically
|
|
24
|
-
|
|
25
|
+
/** Shared cartesian-axis styling so every chart's ticks/lines read identically — scaled to the
|
|
26
|
+
* frame's box when one is given (CHT-6: a larger tick on a wide screen). */
|
|
27
|
+
export const axisProps = (t: ChartTokens, box?: ChartBox) => ({
|
|
25
28
|
stroke: t.border,
|
|
26
|
-
tick: { fill: t.foregroundMuted, fontSize: 12 },
|
|
29
|
+
tick: { fill: t.foregroundMuted, fontSize: box?.tickFontSize ?? 12 },
|
|
27
30
|
tickLine: false,
|
|
28
31
|
});
|
|
29
32
|
|
|
33
|
+
/**
|
|
34
|
+
* The value axis's tick formatter and density for the box (CHT-6): fewer ticks on a phone,
|
|
35
|
+
* and an abbreviated number there ("12.4k") when the caller gave no formatter of its own — a
|
|
36
|
+
* phone-width y axis has no room for "12,400".
|
|
37
|
+
*/
|
|
38
|
+
export const valueAxisProps = (box: ChartBox, valueFormatter?: (value: number) => string) => ({
|
|
39
|
+
tickCount: box.tickCount,
|
|
40
|
+
tickFormatter: valueFormatter ?? (box.tier === 'phone' ? formatNumber : undefined),
|
|
41
|
+
});
|
|
42
|
+
|
|
30
43
|
/** A stable, collision-free SVG id for a chart's per-instance `<linearGradient>`. */
|
|
31
44
|
export const useGradientId = (): string => `cb-${useId().replace(/:/g, '')}`;
|
|
@@ -52,7 +52,7 @@ function AttachmentChip({
|
|
|
52
52
|
return (
|
|
53
53
|
<div
|
|
54
54
|
className={cn(
|
|
55
|
-
'flex min-h-
|
|
55
|
+
'flex min-h-11 items-center gap-2 rounded-md border border-border/40',
|
|
56
56
|
'bg-background/30 px-3 py-2 text-sm text-muted-foreground italic backdrop-blur-sm',
|
|
57
57
|
)}
|
|
58
58
|
>
|
|
@@ -66,7 +66,7 @@ function AttachmentChip({
|
|
|
66
66
|
return (
|
|
67
67
|
<div
|
|
68
68
|
className={cn(
|
|
69
|
-
'group flex min-h-
|
|
69
|
+
'group flex min-h-11 items-center gap-2 rounded-md border border-border/40',
|
|
70
70
|
'bg-background/30 px-3 py-2 text-sm backdrop-blur-sm hover:bg-background/50',
|
|
71
71
|
)}
|
|
72
72
|
>
|
|
@@ -182,7 +182,7 @@ export function Bubble({
|
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
const bubbleClasses = cn(
|
|
185
|
-
'relative max-w-
|
|
185
|
+
'relative max-w-4/5 rounded-2xl px-3.5 py-2.5 text-sm leading-relaxed',
|
|
186
186
|
isOwn
|
|
187
187
|
? ['bg-accent-solid text-white', grouped ? 'rounded-br-md' : 'rounded-br-sm']
|
|
188
188
|
: ['bg-muted text-foreground', grouped ? 'rounded-bl-md' : 'rounded-bl-sm'],
|
|
@@ -259,7 +259,7 @@ export function Bubble({
|
|
|
259
259
|
{message.attachments && message.attachments.length > 0 && (
|
|
260
260
|
<div
|
|
261
261
|
className={cn(
|
|
262
|
-
'flex w-full max-w-
|
|
262
|
+
'flex w-full max-w-4/5 flex-col gap-1.5',
|
|
263
263
|
isOwn ? 'items-end' : 'items-start',
|
|
264
264
|
)}
|
|
265
265
|
>
|
|
@@ -289,7 +289,7 @@ export function Bubble({
|
|
|
289
289
|
tooltip='Retry sending this message'
|
|
290
290
|
onClick={onRetry}
|
|
291
291
|
leftIcon={<RefreshCw className='h-3 w-3' aria-hidden='true' />}
|
|
292
|
-
className='min-h-
|
|
292
|
+
className='min-h-11 text-xs text-destructive'
|
|
293
293
|
>
|
|
294
294
|
Tap to retry
|
|
295
295
|
</Button>
|
|
@@ -179,7 +179,7 @@ export function MessageScroller({
|
|
|
179
179
|
leftIcon={<ChevronDown className='h-3.5 w-3.5' aria-hidden='true' />}
|
|
180
180
|
className={cn(
|
|
181
181
|
'absolute bottom-3 left-1/2 z-10 -translate-x-1/2',
|
|
182
|
-
'min-h-
|
|
182
|
+
'min-h-11 rounded-full border-border bg-surface px-4 py-2 text-xs font-medium text-foreground shadow-overlay',
|
|
183
183
|
)}
|
|
184
184
|
>
|
|
185
185
|
Jump to latest
|
|
@@ -170,3 +170,93 @@ describe('FooterSlot — a footer can no longer render without chrome', () => {
|
|
|
170
170
|
expect(bar.className).toContain('flex-wrap');
|
|
171
171
|
});
|
|
172
172
|
});
|
|
173
|
+
|
|
174
|
+
describe('ActionBar — the primary has one way in', () => {
|
|
175
|
+
beforeEach(() => stubMatchMedia(false));
|
|
176
|
+
|
|
177
|
+
test('a variant="primary" Button passed as a child warns, naming the slot (FRM-13)', () => {
|
|
178
|
+
const realWarn = console.warn;
|
|
179
|
+
const warnings: string[] = [];
|
|
180
|
+
console.warn = (message: string) => warnings.push(message);
|
|
181
|
+
try {
|
|
182
|
+
render(
|
|
183
|
+
<ActionBar secondary={<Button tooltip='Cancel'>Cancel</Button>}>
|
|
184
|
+
<Button variant='ghost' tooltip='Help'>Help</Button>
|
|
185
|
+
</ActionBar>,
|
|
186
|
+
);
|
|
187
|
+
expect(warnings).toEqual([]);
|
|
188
|
+
render(
|
|
189
|
+
<ActionBar>
|
|
190
|
+
<>
|
|
191
|
+
<Button variant='primary' tooltip='Save'>Save</Button>
|
|
192
|
+
</>
|
|
193
|
+
</ActionBar>,
|
|
194
|
+
);
|
|
195
|
+
expect(warnings).toHaveLength(1);
|
|
196
|
+
expect(warnings[0]).toContain('primary={…}');
|
|
197
|
+
} finally {
|
|
198
|
+
console.warn = realWarn;
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
describe('FooterSlot — the footer is ordered by variant, not by the children (OVL-2)', () => {
|
|
204
|
+
beforeEach(() => stubMatchMedia(false));
|
|
205
|
+
|
|
206
|
+
const labels = (el: Element | null) =>
|
|
207
|
+
Array.from(el?.querySelectorAll('button') ?? []).map((b) => b.textContent);
|
|
208
|
+
|
|
209
|
+
test('Save written first still lands far right; Delete written last lands far left', () => {
|
|
210
|
+
const { container } = render(
|
|
211
|
+
<FooterSlot
|
|
212
|
+
footer={
|
|
213
|
+
<>
|
|
214
|
+
<Button tooltip='Save' variant='primary'>Save</Button>
|
|
215
|
+
<Button tooltip='Cancel'>Cancel</Button>
|
|
216
|
+
<Button tooltip='Delete' variant='destructive'>Delete</Button>
|
|
217
|
+
</>
|
|
218
|
+
}
|
|
219
|
+
/>,
|
|
220
|
+
);
|
|
221
|
+
const slot = container.querySelector('[data-cb-footer-slot]') as HTMLElement;
|
|
222
|
+
expect(slot.getAttribute('data-cb-footer-slot')).toBe('ordered');
|
|
223
|
+
const bar = slot.querySelector('[data-cb-action-bar="desktop"]') as HTMLElement;
|
|
224
|
+
const [left, right] = Array.from(bar.children);
|
|
225
|
+
expect(labels(left ?? null)).toEqual(['Delete']);
|
|
226
|
+
expect(labels(right ?? null)).toEqual(['Cancel', 'Save']);
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
test('every order of the same three buttons renders the same footer', () => {
|
|
230
|
+
const save = <Button key='s' tooltip='Save' variant='primary'>Save</Button>;
|
|
231
|
+
const cancel = <Button key='c' tooltip='Cancel'>Cancel</Button>;
|
|
232
|
+
const remove = <Button key='d' tooltip='Delete' variant='destructive-outline'>Delete</Button>;
|
|
233
|
+
const orders = [
|
|
234
|
+
[save, cancel, remove],
|
|
235
|
+
[remove, save, cancel],
|
|
236
|
+
[cancel, remove, save],
|
|
237
|
+
];
|
|
238
|
+
const rendered = orders.map((order) => {
|
|
239
|
+
const { container } = render(<FooterSlot footer={order} />);
|
|
240
|
+
const out = labels(container.querySelector('[data-cb-action-bar]'));
|
|
241
|
+
cleanup();
|
|
242
|
+
return out;
|
|
243
|
+
});
|
|
244
|
+
for (const out of rendered) expect(out).toEqual(['Delete', 'Cancel', 'Save']);
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
test('a row with no primary and no destructive keeps its order in the plain chrome', () => {
|
|
248
|
+
const { container } = render(
|
|
249
|
+
<FooterSlot
|
|
250
|
+
footer={
|
|
251
|
+
<>
|
|
252
|
+
<Button tooltip='Back'>Back</Button>
|
|
253
|
+
<Button tooltip='Skip'>Skip</Button>
|
|
254
|
+
</>
|
|
255
|
+
}
|
|
256
|
+
/>,
|
|
257
|
+
);
|
|
258
|
+
const slot = container.querySelector('[data-cb-footer-slot]') as HTMLElement;
|
|
259
|
+
expect(slot.getAttribute('data-cb-footer-slot')).toBe('wrapped');
|
|
260
|
+
expect(labels(slot)).toEqual(['Back', 'Skip']);
|
|
261
|
+
});
|
|
262
|
+
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Children, Fragment, isValidElement, type ReactNode } from 'react';
|
|
2
2
|
import { useMediaQuery } from '../hooks/useMediaQuery.js';
|
|
3
3
|
import { cn } from '../lib/cn.js';
|
|
4
|
+
import { devWarnOnce } from '../lib/devWarn.js';
|
|
4
5
|
|
|
5
6
|
export interface FooterChromeProps {
|
|
6
7
|
children?: ReactNode;
|
|
@@ -83,6 +84,13 @@ export function ActionBar({
|
|
|
83
84
|
className,
|
|
84
85
|
}: ActionBarProps) {
|
|
85
86
|
const isMobile = useMediaQuery(MOBILE_QUERY);
|
|
87
|
+
if (hasPrimaryChild(children)) {
|
|
88
|
+
devWarnOnce(
|
|
89
|
+
'ActionBar:primary-child',
|
|
90
|
+
'cursedbelt: <ActionBar> was given a variant="primary" Button as a CHILD — children sit on the left, ' +
|
|
91
|
+
'so the hero action lands far from the bottom-right (FRM-13). Pass it as `primary={…}`.',
|
|
92
|
+
);
|
|
93
|
+
}
|
|
86
94
|
|
|
87
95
|
if (isMobile) {
|
|
88
96
|
return (
|
|
@@ -147,9 +155,81 @@ function ownsFooterChrome(node: ReactNode): boolean {
|
|
|
147
155
|
*/
|
|
148
156
|
export function FooterSlot({ footer }: { footer: ReactNode }) {
|
|
149
157
|
if (footer === null || footer === undefined || footer === false) return null;
|
|
158
|
+
if (ownsFooterChrome(footer)) {
|
|
159
|
+
return (
|
|
160
|
+
<div className='flex-none' data-cb-footer-slot='action-bar'>
|
|
161
|
+
{footer}
|
|
162
|
+
</div>
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
const ordered = orderFooterButtons(footer);
|
|
150
166
|
return (
|
|
151
|
-
<div className='flex-none' data-cb-footer-slot={
|
|
152
|
-
{
|
|
167
|
+
<div className='flex-none' data-cb-footer-slot={ordered ? 'ordered' : 'wrapped'}>
|
|
168
|
+
{ordered ?? <FooterChrome>{footer}</FooterChrome>}
|
|
153
169
|
</div>
|
|
154
170
|
);
|
|
155
171
|
}
|
|
172
|
+
|
|
173
|
+
type FooterRole = 'primary' | 'destructive' | 'other';
|
|
174
|
+
|
|
175
|
+
/** What a footer button is, by its variant — or, for `DeleteButton`, by its static `footerRole`. */
|
|
176
|
+
function footerRole(node: ReactNode): FooterRole | null {
|
|
177
|
+
if (!isValidElement<{ variant?: unknown }>(node)) return null;
|
|
178
|
+
const marked = (node.type as { footerRole?: FooterRole }).footerRole;
|
|
179
|
+
if (marked) return marked;
|
|
180
|
+
const variant = node.props.variant;
|
|
181
|
+
if (variant === 'primary' || variant === 'success-solid') return 'primary';
|
|
182
|
+
if (typeof variant === 'string' && variant.startsWith('destructive')) return 'destructive';
|
|
183
|
+
return 'other';
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function flattenFooter(node: ReactNode): ReactNode[] {
|
|
187
|
+
return Children.toArray(node).flatMap((child) =>
|
|
188
|
+
isValidElement<{ children?: ReactNode }>(child) && child.type === Fragment ? flattenFooter(child.props.children) : [child],
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* OVL-2 orders a footer by VARIANT, not by the order the caller wrote it: a destructive action
|
|
194
|
+
* alone on the far left, the primary on the far right, everything else (Cancel) beside the
|
|
195
|
+
* primary. A footer of bare buttons — `<><Button variant='primary'>Save</Button><Button>Cancel
|
|
196
|
+
* </Button></>`, which put Save on the left in vault and desk — is laid out as the
|
|
197
|
+
* {@link ActionBar} it should have been, so it also gets the phone's stacked thumb targets.
|
|
198
|
+
*
|
|
199
|
+
* Only a footer made wholly of elements is reordered, and only when it names a primary or a
|
|
200
|
+
* destructive action; text, or a row with neither, keeps its order inside the plain chrome.
|
|
201
|
+
*/
|
|
202
|
+
function orderFooterButtons(footer: ReactNode): ReactNode | null {
|
|
203
|
+
const items = flattenFooter(footer);
|
|
204
|
+
const roles = items.map(footerRole);
|
|
205
|
+
if (items.length < 2 || roles.some((r) => r === null)) return null;
|
|
206
|
+
if (!roles.some((r) => r === 'primary' || r === 'destructive')) return null;
|
|
207
|
+
const pick = (role: FooterRole) => items.filter((_, i) => roles[i] === role);
|
|
208
|
+
const primary = pick('primary');
|
|
209
|
+
const destructive = pick('destructive');
|
|
210
|
+
const others = pick('other');
|
|
211
|
+
// Two primaries is a caller's mistake; the last one written stays the hero, the other
|
|
212
|
+
// waits beside Cancel rather than vanishing.
|
|
213
|
+
const hero = primary.at(-1);
|
|
214
|
+
const secondary = [...others, ...primary.slice(0, -1)];
|
|
215
|
+
return (
|
|
216
|
+
<ActionBar
|
|
217
|
+
primary={hero}
|
|
218
|
+
secondary={secondary.length ? secondary : undefined}
|
|
219
|
+
destructive={destructive.length ? destructive : undefined}
|
|
220
|
+
/>
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* FRM-13 places the primary far right by its SLOT. Children are the left-hand misc group, so a
|
|
226
|
+
* primary passed there would sit beside the destructive action. No caller did on 2026-10-02
|
|
227
|
+
* (forge task 2514); the slot stays the one way, and this keeps it so.
|
|
228
|
+
*/
|
|
229
|
+
function hasPrimaryChild(node: ReactNode): boolean {
|
|
230
|
+
return Children.toArray(node).some(
|
|
231
|
+
(child) =>
|
|
232
|
+
isValidElement<{ variant?: unknown; children?: ReactNode }>(child) &&
|
|
233
|
+
(child.props.variant === 'primary' || (child.type === Fragment && hasPrimaryChild(child.props.children))),
|
|
234
|
+
);
|
|
235
|
+
}
|
|
@@ -77,7 +77,7 @@ export function AddItemsMenu<T>({
|
|
|
77
77
|
// height cap comes from Radix's reported available height.
|
|
78
78
|
// guardrails-ignore no-raw-overflow: floating popover panel outside the page's ScrollArea, height-capped by Radix — no keyboard-inset concern.
|
|
79
79
|
className={cn(
|
|
80
|
-
'max-h-[var(--radix-popover-content-available-height)] w-64 max-w-[
|
|
80
|
+
'max-h-[var(--radix-popover-content-available-height)] w-64 max-w-[var(--overlay-max-w)] overflow-y-auto p-0',
|
|
81
81
|
)}
|
|
82
82
|
trigger={
|
|
83
83
|
<Button
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { afterEach, describe, expect, test } from 'bun:test';
|
|
2
|
-
import { cleanup, render } from '@testing-library/react';
|
|
3
|
-
import { Alert } from './Alert.js';
|
|
2
|
+
import { cleanup, fireEvent, render } from '@testing-library/react';
|
|
3
|
+
import { ALERT_DISMISS_STORAGE_PREFIX, Alert } from './Alert.js';
|
|
4
4
|
|
|
5
5
|
afterEach(cleanup);
|
|
6
6
|
|
|
@@ -64,4 +64,34 @@ describe('Alert', () => {
|
|
|
64
64
|
const body = [...container.querySelectorAll('div')].find((d) => d.textContent === '/another/very/long/path');
|
|
65
65
|
expect(body?.className).toContain('wrap-anywhere');
|
|
66
66
|
});
|
|
67
|
+
|
|
68
|
+
test('dismissible with a dismissKey: the ✕ hides it, and it stays hidden on the next mount', () => {
|
|
69
|
+
localStorage.removeItem(`${ALERT_DISMISS_STORAGE_PREFIX}test:caveat`);
|
|
70
|
+
let called = 0;
|
|
71
|
+
const view = () => (
|
|
72
|
+
<Alert tone='warning' dismissible dismissKey='test:caveat' onDismiss={() => called++}>
|
|
73
|
+
Read me once
|
|
74
|
+
</Alert>
|
|
75
|
+
);
|
|
76
|
+
const first = render(view());
|
|
77
|
+
fireEvent.click(first.getByRole('button', { name: 'Dismiss' }));
|
|
78
|
+
expect(first.queryByText('Read me once')).toBeNull();
|
|
79
|
+
expect(called).toBe(1);
|
|
80
|
+
cleanup();
|
|
81
|
+
const second = render(view());
|
|
82
|
+
expect(second.queryByText('Read me once')).toBeNull();
|
|
83
|
+
// A different key is a different caveat.
|
|
84
|
+
cleanup();
|
|
85
|
+
const other = render(<Alert dismissible dismissKey='test:other'>Another caveat</Alert>);
|
|
86
|
+
expect(other.getByText('Another caveat')).toBeDefined();
|
|
87
|
+
localStorage.removeItem(`${ALERT_DISMISS_STORAGE_PREFIX}test:caveat`);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
test('dismissible with no key hides for this mount only', () => {
|
|
91
|
+
const first = render(<Alert dismissible>Session caveat</Alert>);
|
|
92
|
+
fireEvent.click(first.getByRole('button', { name: 'Dismiss' }));
|
|
93
|
+
expect(first.queryByText('Session caveat')).toBeNull();
|
|
94
|
+
cleanup();
|
|
95
|
+
expect(render(<Alert dismissible>Session caveat</Alert>).getByText('Session caveat')).toBeDefined();
|
|
96
|
+
});
|
|
67
97
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AlertTriangle, CheckCircle, Info, X, XCircle } from 'lucide-react';
|
|
2
|
-
import type
|
|
2
|
+
import { type ReactNode, useState } from 'react';
|
|
3
3
|
import { cn } from '../lib/cn.js';
|
|
4
4
|
import { IconButton } from './IconButton.js';
|
|
5
5
|
|
|
@@ -40,10 +40,43 @@ export interface AlertProps {
|
|
|
40
40
|
onDismiss?: () => void;
|
|
41
41
|
/** Accessible name for the dismiss ✕ (default "Dismiss"). */
|
|
42
42
|
dismissLabel?: string;
|
|
43
|
+
/**
|
|
44
|
+
* A caveat the reader needs to see ONCE (CPY-2): show a ✕, and once pressed the alert stays
|
|
45
|
+
* gone. With `dismissKey` it stays gone across reloads on this device; without one, until
|
|
46
|
+
* the component unmounts. `onDismiss`, when given too, is still called.
|
|
47
|
+
*/
|
|
48
|
+
dismissible?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Where a `dismissible` alert remembers it was dismissed — one stable name per caveat
|
|
51
|
+
* (`'station:limits-window'`). Change the key when the caveat's text changes enough to be
|
|
52
|
+
* worth reading again.
|
|
53
|
+
*/
|
|
54
|
+
dismissKey?: string;
|
|
43
55
|
className?: string;
|
|
44
56
|
children?: ReactNode;
|
|
45
57
|
}
|
|
46
58
|
|
|
59
|
+
/** The localStorage namespace for a dismissed `Alert`'s `dismissKey`. */
|
|
60
|
+
export const ALERT_DISMISS_STORAGE_PREFIX = 'cb:alert-dismissed:';
|
|
61
|
+
|
|
62
|
+
function readDismissed(key: string | undefined): boolean {
|
|
63
|
+
if (!key) return false;
|
|
64
|
+
try {
|
|
65
|
+
return globalThis.localStorage?.getItem(ALERT_DISMISS_STORAGE_PREFIX + key) !== null;
|
|
66
|
+
} catch {
|
|
67
|
+
return false; // storage refused (a private window): the caveat shows, which is the safe side
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function writeDismissed(key: string | undefined): void {
|
|
72
|
+
if (!key) return;
|
|
73
|
+
try {
|
|
74
|
+
globalThis.localStorage?.setItem(ALERT_DISMISS_STORAGE_PREFIX + key, new Date().toISOString());
|
|
75
|
+
} catch {
|
|
76
|
+
// Not persisted; it is still gone for this mount.
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
47
80
|
export function Alert({
|
|
48
81
|
tone = 'info',
|
|
49
82
|
title,
|
|
@@ -51,9 +84,20 @@ export function Alert({
|
|
|
51
84
|
actions,
|
|
52
85
|
onDismiss,
|
|
53
86
|
dismissLabel = 'Dismiss',
|
|
87
|
+
dismissible = false,
|
|
88
|
+
dismissKey,
|
|
54
89
|
className,
|
|
55
90
|
children,
|
|
56
91
|
}: AlertProps) {
|
|
92
|
+
const [dismissed, setDismissed] = useState(() => dismissible && readDismissed(dismissKey));
|
|
93
|
+
if (dismissed) return null;
|
|
94
|
+
const dismiss = dismissible
|
|
95
|
+
? () => {
|
|
96
|
+
writeDismissed(dismissKey);
|
|
97
|
+
setDismissed(true);
|
|
98
|
+
onDismiss?.();
|
|
99
|
+
}
|
|
100
|
+
: onDismiss;
|
|
57
101
|
return (
|
|
58
102
|
<div
|
|
59
103
|
// Errors are assertive (`alert`); the rest are polite live regions (`status`).
|
|
@@ -70,10 +114,10 @@ export function Alert({
|
|
|
70
114
|
{children && <div className='wrap-anywhere text-sm text-muted-foreground'>{children}</div>}
|
|
71
115
|
{actions && <div className='mt-2 flex flex-wrap gap-2'>{actions}</div>}
|
|
72
116
|
</div>
|
|
73
|
-
{
|
|
117
|
+
{dismiss && (
|
|
74
118
|
<IconButton
|
|
75
119
|
label={dismissLabel}
|
|
76
|
-
onClick={
|
|
120
|
+
onClick={dismiss}
|
|
77
121
|
className='alert-icon h-auto min-h-0 w-auto shrink-0 rounded p-0.5 text-current hover:opacity-70 hover:bg-transparent [&_svg]:size-4'
|
|
78
122
|
>
|
|
79
123
|
<X />
|