@misoto22/folio 0.0.0 → 0.17.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/AGENTS.md +88 -0
- package/CLAUDE.md +1 -0
- package/LICENSE +21 -0
- package/README.md +208 -2
- package/bin/folio-design.mjs +277 -0
- package/bin/migrate-legacy.mjs +81 -0
- package/dist/agent/Accordion.md +65 -0
- package/dist/agent/Actions.md +49 -0
- package/dist/agent/Alert.md +65 -0
- package/dist/agent/AppShell.md +69 -0
- package/dist/agent/ArchitectureFigure.md +72 -0
- package/dist/agent/AreaChart.md +94 -0
- package/dist/agent/Article.md +65 -0
- package/dist/agent/AspectRatio.md +58 -0
- package/dist/agent/Avatar.md +53 -0
- package/dist/agent/Badge.md +62 -0
- package/dist/agent/BarChart.md +93 -0
- package/dist/agent/BarList.md +67 -0
- package/dist/agent/BigNumber.md +70 -0
- package/dist/agent/BoxPlot.md +82 -0
- package/dist/agent/Breadcrumb.md +55 -0
- package/dist/agent/BulletChart.md +71 -0
- package/dist/agent/Button.md +81 -0
- package/dist/agent/Calendar.md +77 -0
- package/dist/agent/CalendarHeatmap.md +75 -0
- package/dist/agent/Card.md +72 -0
- package/dist/agent/Checkbox.md +57 -0
- package/dist/agent/Code.md +51 -0
- package/dist/agent/CodeBlock.md +77 -0
- package/dist/agent/Collapsible.md +68 -0
- package/dist/agent/Collection.md +169 -0
- package/dist/agent/ColorPicker.md +76 -0
- package/dist/agent/Combobox.md +77 -0
- package/dist/agent/Command.md +122 -0
- package/dist/agent/ComposedChart.md +82 -0
- package/dist/agent/Contact.md +90 -0
- package/dist/agent/Content.md +70 -0
- package/dist/agent/ContextMenu.md +93 -0
- package/dist/agent/Conversation.md +247 -0
- package/dist/agent/DataflowFigure.md +49 -0
- package/dist/agent/DatePicker.md +104 -0
- package/dist/agent/DescriptionList.md +69 -0
- package/dist/agent/Diagram.md +71 -0
- package/dist/agent/DiagramCanvas.md +71 -0
- package/dist/agent/DiagramExportMenu.md +65 -0
- package/dist/agent/DiagramInspector.md +73 -0
- package/dist/agent/DiagramLegend.md +56 -0
- package/dist/agent/DiagramMinimap.md +69 -0
- package/dist/agent/DiagramToolbar.md +70 -0
- package/dist/agent/Dialog.md +76 -0
- package/dist/agent/DropdownMenu.md +110 -0
- package/dist/agent/EmptyState.md +63 -0
- package/dist/agent/ErrorState.md +67 -0
- package/dist/agent/Evidence.md +165 -0
- package/dist/agent/Facet.md +107 -0
- package/dist/agent/Field.md +79 -0
- package/dist/agent/FigureBand.md +49 -0
- package/dist/agent/FloatingIconButton.md +61 -0
- package/dist/agent/FunnelChart.md +75 -0
- package/dist/agent/Heading.md +65 -0
- package/dist/agent/Heatmap.md +78 -0
- package/dist/agent/Histogram.md +88 -0
- package/dist/agent/Input.md +52 -0
- package/dist/agent/Kbd.md +48 -0
- package/dist/agent/LifecycleFigure.md +50 -0
- package/dist/agent/LineChart.md +85 -0
- package/dist/agent/LinkArrow.md +49 -0
- package/dist/agent/Markdown.md +69 -0
- package/dist/agent/Media.md +261 -0
- package/dist/agent/Metric.md +70 -0
- package/dist/agent/Metrics.md +114 -0
- package/dist/agent/Music.md +86 -0
- package/dist/agent/NativeSelect.md +62 -0
- package/dist/agent/NavItem.md +56 -0
- package/dist/agent/NumberField.md +73 -0
- package/dist/agent/PageHeader.md +69 -0
- package/dist/agent/Pagination.md +70 -0
- package/dist/agent/PieChart.md +80 -0
- package/dist/agent/Popover.md +80 -0
- package/dist/agent/Portfolio.md +93 -0
- package/dist/agent/PortfolioIndex.md +34 -0
- package/dist/agent/Progress.md +58 -0
- package/dist/agent/RadarChart.md +79 -0
- package/dist/agent/RadialChart.md +81 -0
- package/dist/agent/RadioGroup.md +66 -0
- package/dist/agent/Reading.md +233 -0
- package/dist/agent/Recovery.md +72 -0
- package/dist/agent/SankeyChart.md +85 -0
- package/dist/agent/ScatterChart.md +80 -0
- package/dist/agent/ScrollArea.md +62 -0
- package/dist/agent/SearchPalette.md +51 -0
- package/dist/agent/SearchableMenu.md +69 -0
- package/dist/agent/Select.md +102 -0
- package/dist/agent/Separator.md +60 -0
- package/dist/agent/SequenceFigure.md +51 -0
- package/dist/agent/Sheet.md +82 -0
- package/dist/agent/Sidebar.md +194 -0
- package/dist/agent/SiteNavigation.md +62 -0
- package/dist/agent/SiteShell.md +67 -0
- package/dist/agent/Skeleton.md +96 -0
- package/dist/agent/Slider.md +67 -0
- package/dist/agent/Sparkline.md +68 -0
- package/dist/agent/Spinner.md +62 -0
- package/dist/agent/StatusDot.md +56 -0
- package/dist/agent/StatusPill.md +55 -0
- package/dist/agent/Steps.md +68 -0
- package/dist/agent/Switch.md +50 -0
- package/dist/agent/Table.md +111 -0
- package/dist/agent/Tabs.md +71 -0
- package/dist/agent/Tag.md +67 -0
- package/dist/agent/Text.md +66 -0
- package/dist/agent/Textarea.md +46 -0
- package/dist/agent/Timeline.md +114 -0
- package/dist/agent/Timestamp.md +65 -0
- package/dist/agent/Toast.md +51 -0
- package/dist/agent/ToggleGroup.md +67 -0
- package/dist/agent/Toolbar.md +72 -0
- package/dist/agent/Tooltip.md +74 -0
- package/dist/agent/TreemapChart.md +76 -0
- package/dist/agent/WaterfallChart.md +86 -0
- package/dist/agent/Workbench.md +142 -0
- package/dist/agent/WorkflowFigure.md +51 -0
- package/dist/agent/catalog.json +8055 -0
- package/dist/agent/index.md +185 -0
- package/dist/article.css +407 -0
- package/dist/charts/AreaChart/AreaChart.d.ts +198 -0
- package/dist/charts/AreaChart/AreaChart.js +479 -0
- package/dist/charts/AreaChart/AreaChart.js.map +1 -0
- package/dist/charts/BarChart/BarChart.d.ts +190 -0
- package/dist/charts/BarChart/BarChart.js +599 -0
- package/dist/charts/BarChart/BarChart.js.map +1 -0
- package/dist/charts/BarList/BarList.d.ts +65 -0
- package/dist/charts/BarList/BarList.js +79 -0
- package/dist/charts/BarList/BarList.js.map +1 -0
- package/dist/charts/BigNumber/BigNumber.d.ts +72 -0
- package/dist/charts/BigNumber/BigNumber.js +51 -0
- package/dist/charts/BigNumber/BigNumber.js.map +1 -0
- package/dist/charts/BoxPlot/BoxPlot.d.ts +177 -0
- package/dist/charts/BoxPlot/BoxPlot.js +497 -0
- package/dist/charts/BoxPlot/BoxPlot.js.map +1 -0
- package/dist/charts/BulletChart/BulletChart.d.ts +100 -0
- package/dist/charts/BulletChart/BulletChart.js +197 -0
- package/dist/charts/BulletChart/BulletChart.js.map +1 -0
- package/dist/charts/CalendarHeatmap/CalendarHeatmap.d.ts +106 -0
- package/dist/charts/CalendarHeatmap/CalendarHeatmap.js +103 -0
- package/dist/charts/CalendarHeatmap/CalendarHeatmap.js.map +1 -0
- package/dist/charts/ComposedChart/ComposedChart.d.ts +178 -0
- package/dist/charts/ComposedChart/ComposedChart.js +667 -0
- package/dist/charts/ComposedChart/ComposedChart.js.map +1 -0
- package/dist/charts/Facet/Facet.d.ts +240 -0
- package/dist/charts/Facet/Facet.js +133 -0
- package/dist/charts/Facet/Facet.js.map +1 -0
- package/dist/charts/Facet/panels.d.ts +187 -0
- package/dist/charts/Facet/panels.js +203 -0
- package/dist/charts/Facet/panels.js.map +1 -0
- package/dist/charts/FunnelChart/FunnelChart.d.ts +106 -0
- package/dist/charts/FunnelChart/FunnelChart.js +137 -0
- package/dist/charts/FunnelChart/FunnelChart.js.map +1 -0
- package/dist/charts/Heatmap/Heatmap.d.ts +101 -0
- package/dist/charts/Heatmap/Heatmap.js +125 -0
- package/dist/charts/Heatmap/Heatmap.js.map +1 -0
- package/dist/charts/Histogram/Histogram.d.ts +188 -0
- package/dist/charts/Histogram/Histogram.js +382 -0
- package/dist/charts/Histogram/Histogram.js.map +1 -0
- package/dist/charts/LineChart/LineChart.d.ts +174 -0
- package/dist/charts/LineChart/LineChart.js +485 -0
- package/dist/charts/LineChart/LineChart.js.map +1 -0
- package/dist/charts/PieChart/PieChart.d.ts +140 -0
- package/dist/charts/PieChart/PieChart.js +317 -0
- package/dist/charts/PieChart/PieChart.js.map +1 -0
- package/dist/charts/RadarChart/RadarChart.d.ts +135 -0
- package/dist/charts/RadarChart/RadarChart.js +303 -0
- package/dist/charts/RadarChart/RadarChart.js.map +1 -0
- package/dist/charts/RadialChart/RadialChart.d.ts +142 -0
- package/dist/charts/RadialChart/RadialChart.js +279 -0
- package/dist/charts/RadialChart/RadialChart.js.map +1 -0
- package/dist/charts/SankeyChart/SankeyChart.d.ts +149 -0
- package/dist/charts/SankeyChart/SankeyChart.js +509 -0
- package/dist/charts/SankeyChart/SankeyChart.js.map +1 -0
- package/dist/charts/ScatterChart/ScatterChart.d.ts +149 -0
- package/dist/charts/ScatterChart/ScatterChart.js +275 -0
- package/dist/charts/ScatterChart/ScatterChart.js.map +1 -0
- package/dist/charts/Sparkline/Sparkline.d.ts +53 -0
- package/dist/charts/Sparkline/Sparkline.js +95 -0
- package/dist/charts/Sparkline/Sparkline.js.map +1 -0
- package/dist/charts/TreemapChart/TreemapChart.d.ts +98 -0
- package/dist/charts/TreemapChart/TreemapChart.js +127 -0
- package/dist/charts/TreemapChart/TreemapChart.js.map +1 -0
- package/dist/charts/WaterfallChart/WaterfallChart.d.ts +164 -0
- package/dist/charts/WaterfallChart/WaterfallChart.js +321 -0
- package/dist/charts/WaterfallChart/WaterfallChart.js.map +1 -0
- package/dist/charts/index.d.ts +43 -0
- package/dist/charts/index.js +130 -0
- package/dist/charts/index.js.map +1 -0
- package/dist/charts/lib/annotations.d.ts +103 -0
- package/dist/charts/lib/annotations.js +99 -0
- package/dist/charts/lib/annotations.js.map +1 -0
- package/dist/charts/lib/axis.d.ts +18 -0
- package/dist/charts/lib/axis.js +21 -0
- package/dist/charts/lib/axis.js.map +1 -0
- package/dist/charts/lib/background.d.ts +33 -0
- package/dist/charts/lib/background.js +173 -0
- package/dist/charts/lib/background.js.map +1 -0
- package/dist/charts/lib/brush.d.ts +94 -0
- package/dist/charts/lib/brush.js +535 -0
- package/dist/charts/lib/brush.js.map +1 -0
- package/dist/charts/lib/chart.d.ts +94 -0
- package/dist/charts/lib/chart.js +149 -0
- package/dist/charts/lib/chart.js.map +1 -0
- package/dist/charts/lib/dot.d.ts +29 -0
- package/dist/charts/lib/dot.js +78 -0
- package/dist/charts/lib/dot.js.map +1 -0
- package/dist/charts/lib/empty.d.ts +31 -0
- package/dist/charts/lib/empty.js +24 -0
- package/dist/charts/lib/empty.js.map +1 -0
- package/dist/charts/lib/export.d.ts +94 -0
- package/dist/charts/lib/export.js +62 -0
- package/dist/charts/lib/export.js.map +1 -0
- package/dist/charts/lib/figure.d.ts +81 -0
- package/dist/charts/lib/figure.js +62 -0
- package/dist/charts/lib/figure.js.map +1 -0
- package/dist/charts/lib/format.d.ts +46 -0
- package/dist/charts/lib/format.js +56 -0
- package/dist/charts/lib/format.js.map +1 -0
- package/dist/charts/lib/legend.d.ts +45 -0
- package/dist/charts/lib/legend.js +117 -0
- package/dist/charts/lib/legend.js.map +1 -0
- package/dist/charts/lib/loading.d.ts +48 -0
- package/dist/charts/lib/loading.js +105 -0
- package/dist/charts/lib/loading.js.map +1 -0
- package/dist/charts/lib/paint.d.ts +154 -0
- package/dist/charts/lib/paint.js +551 -0
- package/dist/charts/lib/paint.js.map +1 -0
- package/dist/charts/lib/scale.d.ts +23 -0
- package/dist/charts/lib/scale.js +13 -0
- package/dist/charts/lib/scale.js.map +1 -0
- package/dist/charts/lib/selection.d.ts +20 -0
- package/dist/charts/lib/selection.js +18 -0
- package/dist/charts/lib/selection.js.map +1 -0
- package/dist/charts/lib/sonify-control.d.ts +163 -0
- package/dist/charts/lib/sonify-control.js +172 -0
- package/dist/charts/lib/sonify-control.js.map +1 -0
- package/dist/charts/lib/sonify.d.ts +248 -0
- package/dist/charts/lib/sonify.js +262 -0
- package/dist/charts/lib/sonify.js.map +1 -0
- package/dist/charts/lib/toolbar.d.ts +144 -0
- package/dist/charts/lib/toolbar.js +156 -0
- package/dist/charts/lib/toolbar.js.map +1 -0
- package/dist/charts/lib/tooltip.d.ts +59 -0
- package/dist/charts/lib/tooltip.js +135 -0
- package/dist/charts/lib/tooltip.js.map +1 -0
- package/dist/charts/lib/values.d.ts +56 -0
- package/dist/charts/lib/values.js +71 -0
- package/dist/charts/lib/values.js.map +1 -0
- package/dist/charts/lib/zoom.d.ts +139 -0
- package/dist/charts/lib/zoom.js +314 -0
- package/dist/charts/lib/zoom.js.map +1 -0
- package/dist/components/Accordion/Accordion.d.ts +34 -0
- package/dist/components/Accordion/Accordion.js +43 -0
- package/dist/components/Accordion/Accordion.js.map +1 -0
- package/dist/components/Alert/Alert.d.ts +32 -0
- package/dist/components/Alert/Alert.js +49 -0
- package/dist/components/Alert/Alert.js.map +1 -0
- package/dist/components/AppShell/AppShell.d.ts +58 -0
- package/dist/components/AppShell/AppShell.js +126 -0
- package/dist/components/AppShell/AppShell.js.map +1 -0
- package/dist/components/Article/Article.d.ts +58 -0
- package/dist/components/Article/Article.js +34 -0
- package/dist/components/Article/Article.js.map +1 -0
- package/dist/components/AspectRatio/AspectRatio.d.ts +46 -0
- package/dist/components/AspectRatio/AspectRatio.js +33 -0
- package/dist/components/AspectRatio/AspectRatio.js.map +1 -0
- package/dist/components/Avatar/Avatar.d.ts +38 -0
- package/dist/components/Avatar/Avatar.js +44 -0
- package/dist/components/Avatar/Avatar.js.map +1 -0
- package/dist/components/Badge/Badge.d.ts +30 -0
- package/dist/components/Badge/Badge.js +29 -0
- package/dist/components/Badge/Badge.js.map +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +37 -0
- package/dist/components/Breadcrumb/Breadcrumb.js +46 -0
- package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -0
- package/dist/components/Button/Button.d.ts +70 -0
- package/dist/components/Button/Button.js +95 -0
- package/dist/components/Button/Button.js.map +1 -0
- package/dist/components/Calendar/Calendar.d.ts +54 -0
- package/dist/components/Calendar/Calendar.js +369 -0
- package/dist/components/Calendar/Calendar.js.map +1 -0
- package/dist/components/Card/Card.d.ts +55 -0
- package/dist/components/Card/Card.js +64 -0
- package/dist/components/Card/Card.js.map +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +26 -0
- package/dist/components/Checkbox/Checkbox.js +34 -0
- package/dist/components/Checkbox/Checkbox.js.map +1 -0
- package/dist/components/Code/Code.d.ts +30 -0
- package/dist/components/Code/Code.js +21 -0
- package/dist/components/Code/Code.js.map +1 -0
- package/dist/components/CodeBlock/CodeBlock.d.ts +145 -0
- package/dist/components/CodeBlock/CodeBlock.js +114 -0
- package/dist/components/CodeBlock/CodeBlock.js.map +1 -0
- package/dist/components/Collapsible/Collapsible.d.ts +45 -0
- package/dist/components/Collapsible/Collapsible.js +60 -0
- package/dist/components/Collapsible/Collapsible.js.map +1 -0
- package/dist/components/ColorPicker/ColorPicker.d.ts +67 -0
- package/dist/components/ColorPicker/ColorPicker.js +334 -0
- package/dist/components/ColorPicker/ColorPicker.js.map +1 -0
- package/dist/components/Combobox/Combobox.d.ts +77 -0
- package/dist/components/Combobox/Combobox.js +170 -0
- package/dist/components/Combobox/Combobox.js.map +1 -0
- package/dist/components/Command/Command.d.ts +125 -0
- package/dist/components/Command/Command.js +204 -0
- package/dist/components/Command/Command.js.map +1 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts +63 -0
- package/dist/components/ContextMenu/ContextMenu.js +109 -0
- package/dist/components/ContextMenu/ContextMenu.js.map +1 -0
- package/dist/components/DatePicker/DatePicker.d.ts +130 -0
- package/dist/components/DatePicker/DatePicker.js +257 -0
- package/dist/components/DatePicker/DatePicker.js.map +1 -0
- package/dist/components/DescriptionList/DescriptionList.d.ts +73 -0
- package/dist/components/DescriptionList/DescriptionList.js +35 -0
- package/dist/components/DescriptionList/DescriptionList.js.map +1 -0
- package/dist/components/Diagram/Diagram.d.ts +86 -0
- package/dist/components/Diagram/Diagram.js +211 -0
- package/dist/components/Diagram/Diagram.js.map +1 -0
- package/dist/components/Dialog/Dialog.d.ts +63 -0
- package/dist/components/Dialog/Dialog.js +90 -0
- package/dist/components/Dialog/Dialog.js.map +1 -0
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +87 -0
- package/dist/components/DropdownMenu/DropdownMenu.js +120 -0
- package/dist/components/DropdownMenu/DropdownMenu.js.map +1 -0
- package/dist/components/EmptyState/EmptyState.d.ts +55 -0
- package/dist/components/EmptyState/EmptyState.js +32 -0
- package/dist/components/EmptyState/EmptyState.js.map +1 -0
- package/dist/components/ErrorState/ErrorState.d.ts +55 -0
- package/dist/components/ErrorState/ErrorState.js +41 -0
- package/dist/components/ErrorState/ErrorState.js.map +1 -0
- package/dist/components/Field/Field.d.ts +111 -0
- package/dist/components/Field/Field.js +95 -0
- package/dist/components/Field/Field.js.map +1 -0
- package/dist/components/Field/field-control.d.ts +31 -0
- package/dist/components/Field/field-control.js +12 -0
- package/dist/components/Field/field-control.js.map +1 -0
- package/dist/components/FigureBand/FigureBand.d.ts +31 -0
- package/dist/components/FigureBand/FigureBand.js +51 -0
- package/dist/components/FigureBand/FigureBand.js.map +1 -0
- package/dist/components/FloatingIconButton/FloatingIconButton.d.ts +29 -0
- package/dist/components/FloatingIconButton/FloatingIconButton.js +34 -0
- package/dist/components/FloatingIconButton/FloatingIconButton.js.map +1 -0
- package/dist/components/Heading/Heading.d.ts +62 -0
- package/dist/components/Heading/Heading.js +44 -0
- package/dist/components/Heading/Heading.js.map +1 -0
- package/dist/components/Input/Input.d.ts +22 -0
- package/dist/components/Input/Input.js +21 -0
- package/dist/components/Input/Input.js.map +1 -0
- package/dist/components/Kbd/Kbd.d.ts +27 -0
- package/dist/components/Kbd/Kbd.js +21 -0
- package/dist/components/Kbd/Kbd.js.map +1 -0
- package/dist/components/LinkArrow/LinkArrow.d.ts +24 -0
- package/dist/components/LinkArrow/LinkArrow.js +24 -0
- package/dist/components/LinkArrow/LinkArrow.js.map +1 -0
- package/dist/components/Markdown/Markdown.d.ts +139 -0
- package/dist/components/Markdown/Markdown.js +135 -0
- package/dist/components/Markdown/Markdown.js.map +1 -0
- package/dist/components/Markdown/inline.d.ts +29 -0
- package/dist/components/Markdown/inline.js +74 -0
- package/dist/components/Markdown/inline.js.map +1 -0
- package/dist/components/Markdown/nodes.d.ts +65 -0
- package/dist/components/Markdown/nodes.js +1 -0
- package/dist/components/Markdown/nodes.js.map +1 -0
- package/dist/components/Markdown/parse.d.ts +24 -0
- package/dist/components/Markdown/parse.js +110 -0
- package/dist/components/Markdown/parse.js.map +1 -0
- package/dist/components/Markdown/slug.d.ts +15 -0
- package/dist/components/Markdown/slug.js +7 -0
- package/dist/components/Markdown/slug.js.map +1 -0
- package/dist/components/Metric/Metric.d.ts +61 -0
- package/dist/components/Metric/Metric.js +51 -0
- package/dist/components/Metric/Metric.js.map +1 -0
- package/dist/components/NativeSelect/NativeSelect.d.ts +33 -0
- package/dist/components/NativeSelect/NativeSelect.js +44 -0
- package/dist/components/NativeSelect/NativeSelect.js.map +1 -0
- package/dist/components/NavItem/NavItem.d.ts +39 -0
- package/dist/components/NavItem/NavItem.js +31 -0
- package/dist/components/NavItem/NavItem.js.map +1 -0
- package/dist/components/NumberField/NumberField.d.ts +69 -0
- package/dist/components/NumberField/NumberField.js +162 -0
- package/dist/components/NumberField/NumberField.js.map +1 -0
- package/dist/components/PageHeader/PageHeader.d.ts +92 -0
- package/dist/components/PageHeader/PageHeader.js +37 -0
- package/dist/components/PageHeader/PageHeader.js.map +1 -0
- package/dist/components/Pagination/Pagination.d.ts +67 -0
- package/dist/components/Pagination/Pagination.js +112 -0
- package/dist/components/Pagination/Pagination.js.map +1 -0
- package/dist/components/Popover/Popover.d.ts +39 -0
- package/dist/components/Popover/Popover.js +57 -0
- package/dist/components/Popover/Popover.js.map +1 -0
- package/dist/components/Progress/Progress.d.ts +43 -0
- package/dist/components/Progress/Progress.js +57 -0
- package/dist/components/Progress/Progress.js.map +1 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +49 -0
- package/dist/components/RadioGroup/RadioGroup.js +53 -0
- package/dist/components/RadioGroup/RadioGroup.js.map +1 -0
- package/dist/components/ScrollArea/ScrollArea.d.ts +46 -0
- package/dist/components/ScrollArea/ScrollArea.js +54 -0
- package/dist/components/ScrollArea/ScrollArea.js.map +1 -0
- package/dist/components/SearchableMenu/SearchableMenu.d.ts +68 -0
- package/dist/components/SearchableMenu/SearchableMenu.js +101 -0
- package/dist/components/SearchableMenu/SearchableMenu.js.map +1 -0
- package/dist/components/Select/Select.d.ts +87 -0
- package/dist/components/Select/Select.js +130 -0
- package/dist/components/Select/Select.js.map +1 -0
- package/dist/components/Separator/Separator.d.ts +48 -0
- package/dist/components/Separator/Separator.js +43 -0
- package/dist/components/Separator/Separator.js.map +1 -0
- package/dist/components/Sheet/Sheet.d.ts +43 -0
- package/dist/components/Sheet/Sheet.js +79 -0
- package/dist/components/Sheet/Sheet.js.map +1 -0
- package/dist/components/Sidebar/Sidebar.d.ts +357 -0
- package/dist/components/Sidebar/Sidebar.js +447 -0
- package/dist/components/Sidebar/Sidebar.js.map +1 -0
- package/dist/components/Skeleton/Skeleton.d.ts +70 -0
- package/dist/components/Skeleton/Skeleton.js +44 -0
- package/dist/components/Skeleton/Skeleton.js.map +1 -0
- package/dist/components/Slider/Slider.d.ts +74 -0
- package/dist/components/Slider/Slider.js +143 -0
- package/dist/components/Slider/Slider.js.map +1 -0
- package/dist/components/Spinner/Spinner.d.ts +58 -0
- package/dist/components/Spinner/Spinner.js +49 -0
- package/dist/components/Spinner/Spinner.js.map +1 -0
- package/dist/components/StatusDot/StatusDot.d.ts +29 -0
- package/dist/components/StatusDot/StatusDot.js +44 -0
- package/dist/components/StatusDot/StatusDot.js.map +1 -0
- package/dist/components/StatusPill/StatusPill.d.ts +30 -0
- package/dist/components/StatusPill/StatusPill.js +37 -0
- package/dist/components/StatusPill/StatusPill.js.map +1 -0
- package/dist/components/Steps/Steps.d.ts +65 -0
- package/dist/components/Steps/Steps.js +25 -0
- package/dist/components/Steps/Steps.js.map +1 -0
- package/dist/components/Switch/Switch.d.ts +23 -0
- package/dist/components/Switch/Switch.js +23 -0
- package/dist/components/Switch/Switch.js.map +1 -0
- package/dist/components/Table/Table.d.ts +116 -0
- package/dist/components/Table/Table.js +137 -0
- package/dist/components/Table/Table.js.map +1 -0
- package/dist/components/Tabs/Tabs.d.ts +37 -0
- package/dist/components/Tabs/Tabs.js +205 -0
- package/dist/components/Tabs/Tabs.js.map +1 -0
- package/dist/components/Tag/Tag.d.ts +87 -0
- package/dist/components/Tag/Tag.js +62 -0
- package/dist/components/Tag/Tag.js.map +1 -0
- package/dist/components/Text/Text.d.ts +62 -0
- package/dist/components/Text/Text.js +30 -0
- package/dist/components/Text/Text.js.map +1 -0
- package/dist/components/Textarea/Textarea.d.ts +20 -0
- package/dist/components/Textarea/Textarea.js +32 -0
- package/dist/components/Textarea/Textarea.js.map +1 -0
- package/dist/components/Timestamp/Timestamp.d.ts +59 -0
- package/dist/components/Timestamp/Timestamp.js +56 -0
- package/dist/components/Timestamp/Timestamp.js.map +1 -0
- package/dist/components/Toast/Toast.d.ts +32 -0
- package/dist/components/Toast/Toast.js +64 -0
- package/dist/components/Toast/Toast.js.map +1 -0
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +46 -0
- package/dist/components/ToggleGroup/ToggleGroup.js +88 -0
- package/dist/components/ToggleGroup/ToggleGroup.js.map +1 -0
- package/dist/components/Toolbar/Toolbar.d.ts +55 -0
- package/dist/components/Toolbar/Toolbar.js +43 -0
- package/dist/components/Toolbar/Toolbar.js.map +1 -0
- package/dist/components/Tooltip/Tooltip.d.ts +43 -0
- package/dist/components/Tooltip/Tooltip.js +40 -0
- package/dist/components/Tooltip/Tooltip.js.map +1 -0
- package/dist/diagrams/ArchitectureFigure/ArchitectureFigure.d.ts +55 -0
- package/dist/diagrams/ArchitectureFigure/ArchitectureFigure.js +175 -0
- package/dist/diagrams/ArchitectureFigure/ArchitectureFigure.js.map +1 -0
- package/dist/diagrams/DataflowFigure/DataflowFigure.d.ts +28 -0
- package/dist/diagrams/DataflowFigure/DataflowFigure.js +148 -0
- package/dist/diagrams/DataflowFigure/DataflowFigure.js.map +1 -0
- package/dist/diagrams/DiagramCanvas/DiagramCanvas.d.ts +78 -0
- package/dist/diagrams/DiagramCanvas/DiagramCanvas.js +229 -0
- package/dist/diagrams/DiagramCanvas/DiagramCanvas.js.map +1 -0
- package/dist/diagrams/DiagramExportMenu/DiagramExportMenu.d.ts +106 -0
- package/dist/diagrams/DiagramExportMenu/DiagramExportMenu.js +123 -0
- package/dist/diagrams/DiagramExportMenu/DiagramExportMenu.js.map +1 -0
- package/dist/diagrams/DiagramInspector/DiagramInspector.d.ts +70 -0
- package/dist/diagrams/DiagramInspector/DiagramInspector.js +94 -0
- package/dist/diagrams/DiagramInspector/DiagramInspector.js.map +1 -0
- package/dist/diagrams/DiagramLegend/DiagramLegend.d.ts +42 -0
- package/dist/diagrams/DiagramLegend/DiagramLegend.js +35 -0
- package/dist/diagrams/DiagramLegend/DiagramLegend.js.map +1 -0
- package/dist/diagrams/DiagramMinimap/DiagramMinimap.d.ts +77 -0
- package/dist/diagrams/DiagramMinimap/DiagramMinimap.js +106 -0
- package/dist/diagrams/DiagramMinimap/DiagramMinimap.js.map +1 -0
- package/dist/diagrams/DiagramToolbar/DiagramToolbar.d.ts +48 -0
- package/dist/diagrams/DiagramToolbar/DiagramToolbar.js +53 -0
- package/dist/diagrams/DiagramToolbar/DiagramToolbar.js.map +1 -0
- package/dist/diagrams/LifecycleFigure/LifecycleFigure.d.ts +31 -0
- package/dist/diagrams/LifecycleFigure/LifecycleFigure.js +234 -0
- package/dist/diagrams/LifecycleFigure/LifecycleFigure.js.map +1 -0
- package/dist/diagrams/SequenceFigure/SequenceFigure.d.ts +38 -0
- package/dist/diagrams/SequenceFigure/SequenceFigure.js +261 -0
- package/dist/diagrams/SequenceFigure/SequenceFigure.js.map +1 -0
- package/dist/diagrams/WorkflowFigure/WorkflowFigure.d.ts +36 -0
- package/dist/diagrams/WorkflowFigure/WorkflowFigure.js +259 -0
- package/dist/diagrams/WorkflowFigure/WorkflowFigure.js.map +1 -0
- package/dist/diagrams/index.d.ts +17 -0
- package/dist/diagrams/index.js +29 -0
- package/dist/diagrams/index.js.map +1 -0
- package/dist/diagrams/lib/dev.d.ts +61 -0
- package/dist/diagrams/lib/dev.js +96 -0
- package/dist/diagrams/lib/dev.js.map +1 -0
- package/dist/diagrams/lib/frame.d.ts +138 -0
- package/dist/diagrams/lib/frame.js +131 -0
- package/dist/diagrams/lib/frame.js.map +1 -0
- package/dist/diagrams/lib/geometry.d.ts +114 -0
- package/dist/diagrams/lib/geometry.js +113 -0
- package/dist/diagrams/lib/geometry.js.map +1 -0
- package/dist/diagrams/lib/legend.d.ts +32 -0
- package/dist/diagrams/lib/legend.js +84 -0
- package/dist/diagrams/lib/legend.js.map +1 -0
- package/dist/diagrams/lib/marks.d.ts +207 -0
- package/dist/diagrams/lib/marks.js +480 -0
- package/dist/diagrams/lib/marks.js.map +1 -0
- package/dist/diagrams/lib/route.d.ts +106 -0
- package/dist/diagrams/lib/route.js +201 -0
- package/dist/diagrams/lib/route.js.map +1 -0
- package/dist/diagrams/lib/wires.d.ts +59 -0
- package/dist/diagrams/lib/wires.js +94 -0
- package/dist/diagrams/lib/wires.js.map +1 -0
- package/dist/diagrams/spec.d.ts +405 -0
- package/dist/diagrams/spec.js +1 -0
- package/dist/diagrams/spec.js.map +1 -0
- package/dist/fonts/hanken-grotesk-300.woff2 +0 -0
- package/dist/fonts/hanken-grotesk-400.woff2 +0 -0
- package/dist/fonts/hanken-grotesk-500.woff2 +0 -0
- package/dist/fonts/hanken-grotesk-600.woff2 +0 -0
- package/dist/fonts/hanken-grotesk-700.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-400.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-500.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-600.woff2 +0 -0
- package/dist/fonts/newsreader-300.woff2 +0 -0
- package/dist/fonts/newsreader-400.woff2 +0 -0
- package/dist/fonts/newsreader-500.woff2 +0 -0
- package/dist/fonts/newsreader-600.woff2 +0 -0
- package/dist/fonts.css +96 -0
- package/dist/index.d.ts +97 -0
- package/dist/index.js +80 -0
- package/dist/index.js.map +1 -0
- package/dist/keyframes.css +300 -0
- package/dist/lib/cn.d.ts +21 -0
- package/dist/lib/cn.js +9 -0
- package/dist/lib/cn.js.map +1 -0
- package/dist/lib/color.d.ts +80 -0
- package/dist/lib/color.js +189 -0
- package/dist/lib/color.js.map +1 -0
- package/dist/lib/control.d.ts +32 -0
- package/dist/lib/control.js +14 -0
- package/dist/lib/control.js.map +1 -0
- package/dist/lib/index.d.ts +4 -0
- package/dist/lib/index.js +11 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/numeric.d.ts +35 -0
- package/dist/lib/numeric.js +29 -0
- package/dist/lib/numeric.js.map +1 -0
- package/dist/lib/overlay-container.d.ts +48 -0
- package/dist/lib/overlay-container.js +15 -0
- package/dist/lib/overlay-container.js.map +1 -0
- package/dist/lib/slot-content.d.ts +8 -0
- package/dist/lib/slot-content.js +17 -0
- package/dist/lib/slot-content.js.map +1 -0
- package/dist/lib/step-rail.d.ts +45 -0
- package/dist/lib/step-rail.js +47 -0
- package/dist/lib/step-rail.js.map +1 -0
- package/dist/lib/svg-export.d.ts +138 -0
- package/dist/lib/svg-export.js +198 -0
- package/dist/lib/svg-export.js.map +1 -0
- package/dist/lib/useClipboardCopy.d.ts +30 -0
- package/dist/lib/useClipboardCopy.js +37 -0
- package/dist/lib/useClipboardCopy.js.map +1 -0
- package/dist/lib/useSelectionIndicator.d.ts +29 -0
- package/dist/lib/useSelectionIndicator.js +49 -0
- package/dist/lib/useSelectionIndicator.js.map +1 -0
- package/dist/lib/warn.d.ts +73 -0
- package/dist/lib/warn.js +38 -0
- package/dist/lib/warn.js.map +1 -0
- package/dist/semantic.css +200 -0
- package/dist/styles.css +98 -0
- package/dist/themes.css +607 -0
- package/dist/tokens/brand.d.ts +47 -0
- package/dist/tokens/brand.js +38 -0
- package/dist/tokens/brand.js.map +1 -0
- package/dist/tokens.css +666 -0
- package/dist/tokens.d.ts +205 -0
- package/dist/tokens.js +1056 -0
- package/dist/tokens.json +1055 -0
- package/dist/website/Actions/Actions.d.ts +34 -0
- package/dist/website/Actions/Actions.js +29 -0
- package/dist/website/Actions/Actions.js.map +1 -0
- package/dist/website/Collection/Collection.d.ts +128 -0
- package/dist/website/Collection/Collection.js +162 -0
- package/dist/website/Collection/Collection.js.map +1 -0
- package/dist/website/Contact/Contact.d.ts +87 -0
- package/dist/website/Contact/Contact.js +94 -0
- package/dist/website/Contact/Contact.js.map +1 -0
- package/dist/website/Content/CodePanel.d.ts +27 -0
- package/dist/website/Content/CodePanel.js +30 -0
- package/dist/website/Content/CodePanel.js.map +1 -0
- package/dist/website/Content/Content.d.ts +29 -0
- package/dist/website/Content/Content.js +38 -0
- package/dist/website/Content/Content.js.map +1 -0
- package/dist/website/Conversation/Conversation.d.ts +193 -0
- package/dist/website/Conversation/Conversation.js +252 -0
- package/dist/website/Conversation/Conversation.js.map +1 -0
- package/dist/website/Evidence/Evidence.d.ts +116 -0
- package/dist/website/Evidence/Evidence.js +142 -0
- package/dist/website/Evidence/Evidence.js.map +1 -0
- package/dist/website/Media/Media.d.ts +173 -0
- package/dist/website/Media/Media.js +225 -0
- package/dist/website/Media/Media.js.map +1 -0
- package/dist/website/Media/MediaLightbox.d.ts +18 -0
- package/dist/website/Media/MediaLightbox.js +38 -0
- package/dist/website/Media/MediaLightbox.js.map +1 -0
- package/dist/website/Metrics/Metrics.d.ts +74 -0
- package/dist/website/Metrics/Metrics.js +96 -0
- package/dist/website/Metrics/Metrics.js.map +1 -0
- package/dist/website/Music/Music.d.ts +60 -0
- package/dist/website/Music/Music.js +80 -0
- package/dist/website/Music/Music.js.map +1 -0
- package/dist/website/Portfolio/FrameLayout.d.ts +9 -0
- package/dist/website/Portfolio/FrameLayout.js +42 -0
- package/dist/website/Portfolio/FrameLayout.js.map +1 -0
- package/dist/website/Portfolio/Portfolio.d.ts +49 -0
- package/dist/website/Portfolio/Portfolio.js +66 -0
- package/dist/website/Portfolio/Portfolio.js.map +1 -0
- package/dist/website/Portfolio/QuestionCard.d.ts +22 -0
- package/dist/website/Portfolio/QuestionCard.js +33 -0
- package/dist/website/Portfolio/QuestionCard.js.map +1 -0
- package/dist/website/PortfolioIndex/PortfolioIndex.d.ts +21 -0
- package/dist/website/PortfolioIndex/PortfolioIndex.js +31 -0
- package/dist/website/PortfolioIndex/PortfolioIndex.js.map +1 -0
- package/dist/website/Reading/Reading.d.ts +203 -0
- package/dist/website/Reading/Reading.js +357 -0
- package/dist/website/Reading/Reading.js.map +1 -0
- package/dist/website/Recovery/Recovery.d.ts +39 -0
- package/dist/website/Recovery/Recovery.js +96 -0
- package/dist/website/Recovery/Recovery.js.map +1 -0
- package/dist/website/SearchPalette/SearchPalette.d.ts +59 -0
- package/dist/website/SearchPalette/SearchPalette.js +120 -0
- package/dist/website/SearchPalette/SearchPalette.js.map +1 -0
- package/dist/website/SiteNavigation/SiteNavigation.d.ts +46 -0
- package/dist/website/SiteNavigation/SiteNavigation.js +101 -0
- package/dist/website/SiteNavigation/SiteNavigation.js.map +1 -0
- package/dist/website/SiteShell/SiteShell.d.ts +45 -0
- package/dist/website/SiteShell/SiteShell.js +46 -0
- package/dist/website/SiteShell/SiteShell.js.map +1 -0
- package/dist/website/Timeline/Timeline.d.ts +80 -0
- package/dist/website/Timeline/Timeline.js +99 -0
- package/dist/website/Timeline/Timeline.js.map +1 -0
- package/dist/website/Workbench/Chronology.d.ts +32 -0
- package/dist/website/Workbench/Chronology.js +32 -0
- package/dist/website/Workbench/Chronology.js.map +1 -0
- package/dist/website/Workbench/ContactRow.d.ts +13 -0
- package/dist/website/Workbench/ContactRow.js +11 -0
- package/dist/website/Workbench/ContactRow.js.map +1 -0
- package/dist/website/Workbench/PhotoMosaic.d.ts +13 -0
- package/dist/website/Workbench/PhotoMosaic.js +15 -0
- package/dist/website/Workbench/PhotoMosaic.js.map +1 -0
- package/dist/website/Workbench/Reveal.d.ts +19 -0
- package/dist/website/Workbench/Reveal.js +29 -0
- package/dist/website/Workbench/Reveal.js.map +1 -0
- package/dist/website/Workbench/ToolStrip.d.ts +18 -0
- package/dist/website/Workbench/ToolStrip.js +15 -0
- package/dist/website/Workbench/ToolStrip.js.map +1 -0
- package/dist/website/Workbench/Workbench.d.ts +23 -0
- package/dist/website/Workbench/Workbench.js +22 -0
- package/dist/website/Workbench/Workbench.js.map +1 -0
- package/dist/website/Workbench/WorkbenchCard.d.ts +29 -0
- package/dist/website/Workbench/WorkbenchCard.js +21 -0
- package/dist/website/Workbench/WorkbenchCard.js.map +1 -0
- package/dist/website/Workbench/WorkbenchEntries.d.ts +22 -0
- package/dist/website/Workbench/WorkbenchEntries.js +24 -0
- package/dist/website/Workbench/WorkbenchEntries.js.map +1 -0
- package/dist/website/Workbench/WorkbenchFigure.d.ts +20 -0
- package/dist/website/Workbench/WorkbenchFigure.js +15 -0
- package/dist/website/Workbench/WorkbenchFigure.js.map +1 -0
- package/dist/website/Workbench/WorkbenchHero.d.ts +24 -0
- package/dist/website/Workbench/WorkbenchHero.js +24 -0
- package/dist/website/Workbench/WorkbenchHero.js.map +1 -0
- package/dist/website/Workbench/theme.d.ts +22 -0
- package/dist/website/Workbench/theme.js +12 -0
- package/dist/website/Workbench/theme.js.map +1 -0
- package/dist/website/index.d.ts +38 -0
- package/dist/website/index.js +32 -0
- package/dist/website/index.js.map +1 -0
- package/dist/website-actions.css +6 -0
- package/dist/website-base.css +46 -0
- package/dist/website-collection.css +89 -0
- package/dist/website-contact.css +29 -0
- package/dist/website-content.css +20 -0
- package/dist/website-controls.css +91 -0
- package/dist/website-conversation.css +115 -0
- package/dist/website-evidence.css +56 -0
- package/dist/website-media.css +227 -0
- package/dist/website-metrics.css +15 -0
- package/dist/website-music.css +27 -0
- package/dist/website-portfolio.css +94 -0
- package/dist/website-reading.css +159 -0
- package/dist/website-recovery.css +28 -0
- package/dist/website-search.css +26 -0
- package/dist/website-shell.css +89 -0
- package/dist/website-timeline.css +43 -0
- package/dist/website-workbench.css +162 -0
- package/dist/website.css +26 -0
- package/llms.txt +35 -0
- package/package.json +163 -5
- package/skills/folio-design/SKILL.md +228 -0
- package/skills/folio-design/evals/claims.json +95 -0
- package/skills/folio-design/evals/evals.json +84 -0
- package/skills/folio-design/rules/a11y.md +167 -0
- package/skills/folio-design/rules/composition.md +108 -0
- package/skills/folio-design/rules/forms.md +135 -0
- package/skills/folio-design/rules/naming.md +155 -0
- package/skills/folio-design/rules/tokens.md +135 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/charts/BarChart/BarChart.tsx"],"sourcesContent":["'use client'\n\nimport {\n Children,\n createContext,\n isValidElement,\n useContext,\n useId,\n useMemo,\n useState,\n type ComponentProps,\n type ReactNode,\n} from 'react'\nimport {\n Bar as RechartsBar,\n BarChart as RechartsBarChart,\n CartesianGrid,\n Rectangle,\n XAxis as RechartsXAxis,\n YAxis as RechartsYAxis,\n} from 'recharts'\nimport type { RectRadius } from 'recharts/types/shape/Rectangle'\nimport { motion, useReducedMotion } from 'motion/react'\nimport { ChartContainer, type ChartConfig } from '../lib/chart'\nimport { ChartFigure } from '../lib/figure'\nimport { useChartSelection } from '../lib/selection'\nimport { type ChartEmptyProps } from '../lib/empty'\nimport { axisLabel } from '../lib/axis'\nimport { defaultTick } from '../lib/format'\nimport { Annotation, ReferenceBand, ReferenceLine } from '../lib/annotations'\nimport { Values, findSlot, resolveValues, type ValuesProps } from '../lib/values'\nimport {\n ChartSonifyButton,\n Sonify,\n useChartSonifySeries,\n type SonifyProps,\n} from '../lib/sonify-control'\n\n/**\n * The axis props, with `label` narrowed to a string.\n *\n * Recharts' own `label` accepts a render function and a config object, neither\n * of which a call site should be reaching for to name an axis — and both of\n * which would let a consumer opt out of the system's own axis type styling\n * without noticing.\n */\nexport type ChartXAxisProps = Omit<ComponentProps<typeof RechartsXAxis>, 'label'> & {\n /** What this axis measures. Say the unit here or in the series label, once. */\n label?: string\n}\n\nexport type ChartYAxisProps = Omit<ComponentProps<typeof RechartsYAxis>, 'label'> & {\n /** What this axis measures. Say the unit here or in the series label, once. */\n label?: string\n}\n\nimport { ChartBackground, type ChartBackgroundVariant } from '../lib/background'\nimport { ChartLegend, ChartLegendContent } from '../lib/legend'\nimport { ChartTooltip, ChartTooltipContent } from '../lib/tooltip'\nimport { Brush, ChartBrush, type BrushProps, type ChartBrushRange } from '../lib/brush'\nimport { ChartControls, Toolbar, type ToolbarProps } from '../lib/toolbar'\nimport { useChartZoom } from '../lib/zoom'\nimport { LoadingIndicator, LoadingShimmer, LOADING_KEY, useLoadingRows } from '../lib/loading'\nimport {\n BarBufferFill,\n BarDuotoneFill,\n BarGradientFill,\n BarHatchedFill,\n BarStrippedFill,\n GlowFilter,\n REVEAL_EASE,\n SeriesGradient,\n type ChartRevealType,\n} from '../lib/paint'\nimport type { ChartLegendSlotProps, ChartTooltipSlotProps } from '../AreaChart/AreaChart'\n\n/** The corner every bar rounds to unless it says otherwise. */\nconst BAR_RADIUS = 2\n\n/** One bar's grow-in, in seconds. */\nconst GROW_DURATION = 0.5\n\n/** How long each bar waits behind the one before it. */\nconst GROW_STAGGER = 0.05\n\nconst STACK_ID = 'folio-bar-stack'\n\n/**\n * Room around the plot, so the first and last tick labels are not sliced by the\n * container's edge. Recharts' own default is 5px on every side, which is not\n * enough for a label centred on the axis's first point.\n */\nconst CHART_MARGIN = { top: 8, right: 12, bottom: 0, left: 12 }\n\n/**\n * The gap between a bar's foot and its neighbour below in a stack, plus the\n * hairline.\n */\nconst FOOT_GAP = 3\n\n/**\n * The shortest a bar with a value on it may be drawn.\n *\n * Below `FOOT_GAP` the trim used to take the whole bar: a count of two on a\n * scale topping out at a thousand rendered at zero height and was\n * pixel-identical to a category with no rows at all. The full-column hit rect\n * still caught the pointer, so the reader could hover a bar that was not there.\n * One pixel is not much of a bar, and it is the difference between \"small\" and\n * \"absent\" — which is the whole reading.\n */\nconst MIN_BAR_LENGTH = 1\n\n/** How a bar meets the plot. The primary carrier of identity in monochrome. */\nexport type BarVariant = 'default' | 'hatched' | 'duotone' | 'duotone-reverse' | 'gradient' | 'stripped'\n\n/** How several bars combine: side by side, stacked, or normalised to 100%. */\nexport type BarStackType = 'default' | 'stacked' | 'percent'\n\n/**\n * Which way the bars run.\n *\n * `vertical` stands them up from a category axis along the bottom — the default,\n * and what a time series wants. `horizontal` lays them out from a category axis\n * down the side, which is what long category NAMES want: a label that would be\n * rotated 45° to fit under a column reads straight beside a row.\n */\nexport type BarOrientation = 'vertical' | 'horizontal'\n\ninterface BarChartContextValue {\n config: ChartConfig\n /** The rows on screen, so a mark can label its own extremes. */\n rows: Record<string, unknown>[]\n isStacked: boolean\n isHorizontal: boolean\n isLoading: boolean\n barRadius: number\n animationType: ChartRevealType\n introStartedAt: number\n dataLength: number\n /**\n * Where the last row of `data` sits in the window on screen, or -1 when it is\n * outside it. What `buffer` hatches.\n */\n bufferIndex: number\n selectedDataKey: string | null\n selectDataKey: (dataKey: string | null) => void\n isPointerInChart: boolean\n}\n\nconst BarChartContext = createContext<BarChartContextValue | null>(null)\n\nfunction useBarChart(): BarChartContextValue {\n const context = useContext(BarChartContext)\n if (!context) throw new Error('A bar chart part must be rendered inside <BarChart>')\n return context\n}\n\ntype ValidateKeys<TData, TConfig> = {\n [K in keyof TConfig]: K extends keyof TData ? ChartConfig[string] : never\n}\n\nexport interface BarChartProps<\n TData extends Record<string, unknown>,\n TConfig extends Record<string, ChartConfig[string]>,\n> {\n config: TConfig & ValidateKeys<TData, TConfig>\n /** The rows the chart draws. One entry per point, bar or category. */\n data: TData[]\n /**\n * What the chart shows, in a sentence a reader could act on. Required, and\n * announced to a screen reader even when it is not printed.\n */\n title: string\n /** Prints the title above the plot instead of hiding it from sight. */\n showTitle?: boolean\n /** A line under the title — the unit, the window, the caveat. */\n description?: ReactNode\n /**\n * The composed parts — axes, grid, tooltip, legend, and the marks\n * themselves.\n */\n children: ReactNode\n /** Merged onto the figure, last, so a call site can size or space it. */\n className?: string\n /** Escape hatch onto the raw Recharts chart element. */\n chartProps?: ComponentProps<typeof RechartsBarChart>\n /** How several marks combine: side by side, stacked, or normalised to 100%. */\n stackType?: BarStackType\n /**\n * Which way the bars run. Reach for `horizontal` when the category names are\n * long enough to need rotating under a column.\n */\n orientation?: BarOrientation\n /** The corner every `<BarChart.Bar>` inherits. */\n barRadius?: number\n /** The grow-in order every `<BarChart.Bar>` inherits. */\n animationType?: ChartRevealType\n /** Gap between bars inside one category. */\n barGap?: number\n /** Gap between categories. */\n barCategoryGap?: number\n /** The series lit on first render, when the chart keeps its own selection. */\n defaultSelectedDataKey?: string | null\n /**\n * The selected series, driven from outside.\n *\n * Give this and the chart follows it; leave it undefined and the chart keeps\n * its own, starting from `defaultSelectedDataKey`.\n */\n selectedDataKey?: string | null\n /** Fires when the selection changes, and with null when it is cleared. */\n onSelectionChange?: (selectedDataKey: string | null) => void\n /**\n * Swaps the marks for an animated skeleton, keeping the measured height so\n * the page does not jump when the data lands.\n */\n isLoading?: boolean\n /** How many bars the skeleton draws. */\n loadingBars?: number\n /**\n * The row field on the category axis. Needed by the brush and by the table\n * view.\n */\n xDataKey?: keyof TData & string\n /**\n * Drops the hidden table view. Only correct when the page prints the data\n * itself.\n */\n hideDataTable?: boolean\n /**\n * What the chart shows when it has nothing to draw.\n *\n * Rendered instead of the plot whenever `data` is empty and the chart is not\n * loading — the state a real dashboard reaches within a week, and the one an\n * empty pair of axes is indistinguishable from a failed load. `false` keeps\n * the axes, for a chart whose emptiness is itself the reading.\n */\n empty?: ChartEmptyProps | false\n}\n\n/**\n * Discrete categories compared by length — the shape for \"how much, per thing\".\n *\n * Reach for `<AreaChart>` or `<LineChart>` when the axis is continuous and the\n * reader is following a trend rather than comparing buckets.\n *\n * @example\n * <BarChart title=\"Visitors by month\" config={config} data={data} xDataKey=\"month\">\n * <BarChart.Grid />\n * <BarChart.XAxis dataKey=\"month\" />\n * <BarChart.Tooltip />\n * <BarChart.Bar dataKey=\"desktop\" variant=\"duotone\" />\n * </BarChart>\n */\nexport function BarChart<\n TData extends Record<string, unknown>,\n TConfig extends Record<string, ChartConfig[string]>,\n>({\n config,\n data,\n title,\n showTitle,\n description,\n children,\n className,\n chartProps,\n stackType = 'default',\n orientation = 'vertical',\n barRadius = BAR_RADIUS,\n animationType = 'forward',\n barGap,\n barCategoryGap,\n defaultSelectedDataKey = null,\n selectedDataKey: controlledDataKey,\n onSelectionChange,\n isLoading = false,\n loadingBars,\n xDataKey,\n hideDataTable = false,\n empty,\n}: BarChartProps<TData, TConfig>) {\n const chartId = useId().replace(/:/g, '')\n // Stamped once, on the first render. The grow-in reads elapsed time from\n // here rather than from mount, because Recharts remounts every bar on any\n // re-render — a mount-anchored animation would replay on every hover.\n const [introStartedAt] = useState(() => Date.now())\n const [isPointerInChart, setIsPointerInChart] = useState(false)\n const { rows: loadingData, onShimmerExit } = useLoadingRows(isLoading, loadingBars ?? 12)\n // One window, two views of it: the brush strip below the plot and the\n // toolbar above it both read and write this. See `useChartZoom` for why they\n // are not two separate windows.\n const zoom = useChartZoom({ data, xDataKey })\n\n // The brush, the toolbar and the sonify control are declared as children but\n // never rendered into the Recharts tree — they live in the figure, outside\n // the SVG.\n const { brushSlot, toolbarSlot, sonifySlot, chartChildren } = useMemo(() => {\n const parts = Children.toArray(children)\n const element = parts.find((child) => isValidElement(child) && child.type === Brush)\n const props = (isValidElement(element) ? element.props : {}) as BrushProps\n return {\n brushSlot: { present: isValidElement(element), ...props },\n toolbarSlot: findSlot<ToolbarProps>(parts, Toolbar),\n sonifySlot: findSlot<SonifyProps>(parts, Sonify),\n chartChildren: parts.filter(\n (child) =>\n !(\n isValidElement(child) &&\n (child.type === Brush || child.type === Toolbar || child.type === Sonify)\n ),\n ),\n }\n }, [children])\n\n const isStacked = stackType === 'stacked' || stackType === 'percent'\n const isHorizontal = orientation === 'horizontal'\n const columns = useMemo(\n () => Object.entries(config).map(([key, series]) => ({ key, label: series.label })),\n [config],\n )\n\n const showBrush = brushSlot.present && !isLoading\n const showToolbar = toolbarSlot !== null && !isLoading\n // `empty === false` keeps the axes, for a chart whose emptiness is the\n // reading — a monitoring panel that should show a flat, silent range rather\n // than a message.\n const isEmpty = !isLoading && empty !== false && data.length === 0\n const displayData = showBrush || showToolbar ? zoom.visibleData : data\n\n // Which bar on screen is the open period, if any is. Derived from the last\n // ROW rather than from the last bar drawn: brushed or zoomed back into the\n // middle of the range, the last bar in the window is a month that closed long\n // ago, and hatching it says it is still being counted.\n const bufferIndex =\n data.length > 0 && displayData[displayData.length - 1] === data[data.length - 1]\n ? displayData.length - 1\n : -1\n\n // The rows on screen, so a brushed range sounds like what it looks like. The\n // skeleton's rows carry no real series, which is what leaves the control\n // disabled while data is in flight rather than playing yesterday's numbers.\n const sonifySeries = useChartSonifySeries(\n sonifySlot,\n (isLoading ? loadingData : displayData) as Record<string, unknown>[],\n config,\n xDataKey,\n )\n\n const [selectedDataKey, selectDataKey] = useChartSelection(\n controlledDataKey,\n defaultSelectedDataKey,\n onSelectionChange,\n )\n\n const context = useMemo<BarChartContextValue>(\n () => ({\n config,\n rows: displayData as Record<string, unknown>[],\n isStacked,\n isHorizontal,\n isLoading,\n barRadius,\n animationType,\n introStartedAt,\n dataLength: displayData.length,\n bufferIndex,\n selectedDataKey,\n selectDataKey,\n isPointerInChart,\n }),\n [\n animationType,\n barRadius,\n bufferIndex,\n config,\n displayData,\n introStartedAt,\n isHorizontal,\n isLoading,\n isPointerInChart,\n isStacked,\n selectDataKey,\n selectedDataKey,\n ],\n )\n\n return (\n <BarChartContext.Provider value={context}>\n <ChartFigure\n title={title}\n showTitle={showTitle}\n description={description}\n className={className}\n table={\n hideDataTable\n ? false\n : { rows: data, rowKey: xDataKey, columns }\n }\n isEmpty={isEmpty}\n empty={empty}\n >\n {sonifySlot && (\n <ChartSonifyButton {...sonifySlot} title={title} series={sonifySeries} />\n )}\n <ChartControls\n toolbar={showToolbar ? toolbarSlot : null}\n zoom={zoom}\n title={title}\n rows={data}\n columns={columns}\n rowKey={xDataKey}\n >\n <ChartContainer\n config={config}\n footer={\n showBrush && (\n <ChartBrush\n data={data}\n config={config}\n xDataKey={xDataKey}\n variant=\"bar\"\n barRadius={barRadius}\n height={brushSlot.height}\n formatLabel={brushSlot.formatLabel}\n stacked={isStacked}\n className=\"mt-1\"\n {...zoom.brushProps}\n onChange={(range: ChartBrushRange) => {\n zoom.brushProps.onChange(range)\n brushSlot.onChange?.(range)\n }}\n />\n )\n }\n >\n <RechartsBarChart\n id={chartId}\n accessibilityLayer\n margin={CHART_MARGIN}\n // Recharts' `layout` names the axis the CATEGORIES run along, which\n // is the opposite of what a reader means by a horizontal bar chart.\n // The flip is done once, here.\n layout={isHorizontal ? 'vertical' : 'horizontal'}\n data={isLoading ? loadingData : displayData}\n barGap={barGap}\n barCategoryGap={barCategoryGap}\n stackOffset={stackType === 'percent' ? 'expand' : undefined}\n onMouseEnter={() => setIsPointerInChart(true)}\n onMouseLeave={() => setIsPointerInChart(false)}\n {...chartProps}\n >\n {chartChildren}\n {isLoading && <LoadingBar chartId={chartId} onShimmerExit={onShimmerExit} />}\n </RechartsBarChart>\n </ChartContainer>\n </ChartControls>\n <LoadingIndicator isLoading={isLoading} />\n </ChartFigure>\n </BarChartContext.Provider>\n )\n}\n\nexport interface BarProps {\n dataKey: string\n variant?: BarVariant\n radius?: number\n animationType?: ChartRevealType\n /** Lets a click on this series select it, dimming the rest. */\n isClickable?: boolean\n /** Dims this series while another bar in the same column is hovered. */\n enableHoverHighlight?: boolean\n /** A halo behind the bars — for the one series that is the point of the figure. */\n glowing?: boolean\n /**\n * Draws the last row of `data` as an open hatch rather than a solid bar.\n *\n * The idiom for a period still in progress: the bar is the same height as any\n * other but is visibly not the same kind of fact.\n *\n * Tied to the last ROW, not to the last bar on screen. Brush or zoom into the\n * middle of the range and no bar is hatched, because none of the periods in\n * the window is still being counted.\n */\n buffer?: boolean\n /** `<BarChart.Values>`. */\n children?: ReactNode\n barProps?: ComponentProps<typeof RechartsBar>\n}\n\n/**\n * One bar series. Scopes its own patterns under a unique id, so any number of\n * series with different variants can share a chart.\n */\nfunction Bar({\n dataKey,\n variant = 'default',\n radius,\n animationType,\n isClickable = false,\n enableHoverHighlight = false,\n glowing = false,\n buffer = false,\n children,\n barProps,\n}: BarProps) {\n const {\n config,\n isStacked,\n isHorizontal,\n isLoading,\n rows,\n barRadius: defaultRadius,\n animationType: defaultAnimation,\n introStartedAt,\n dataLength,\n bufferIndex,\n selectedDataKey,\n selectDataKey,\n isPointerInChart,\n } = useBarChart()\n const id = useId().replace(/:/g, '')\n const reduceMotion = useReducedMotion()\n\n if (isLoading) return null\n\n const resolvedRadius = radius ?? defaultRadius\n const isSelected = selectedDataKey === dataKey\n const reveal: ChartRevealType = reduceMotion ? 'none' : (animationType ?? defaultAnimation)\n\n const shared = {\n id,\n dataKey,\n variant,\n barRadius: resolvedRadius,\n glowing,\n buffer,\n isClickable,\n enableHoverHighlight,\n isPointerInChart,\n isHorizontal,\n introStartedAt,\n selectedDataKey,\n dataLength,\n bufferIndex,\n onSelect: () => {\n if (!isClickable) return\n selectDataKey(isSelected ? null : dataKey)\n },\n }\n\n return (\n <>\n <RechartsBar\n dataKey={dataKey}\n stackId={isStacked ? STACK_ID : undefined}\n fill={`url(#${id}-colors-${dataKey})`}\n radius={resolvedRadius}\n isAnimationActive={false}\n style={isClickable || enableHoverHighlight ? { cursor: 'pointer' } : undefined}\n shape={(props: unknown) => (\n <BarShape {...(props as BarGeometry)} {...shared} animationType={reveal} />\n )}\n // The hovered bar re-renders through `activeBar`; without forcing the\n // animation off here it would replay its grow-in under the pointer.\n activeBar={(props: unknown) => (\n <BarShape {...(props as BarGeometry)} {...shared} animationType=\"none\" />\n )}\n {...barProps}\n >\n {resolveValues(\n findSlot<ValuesProps>(children, Values),\n rows.map((row) => Number(row[dataKey])).filter(Number.isFinite),\n )}\n </RechartsBar>\n <defs>\n <SeriesGradient id={id} dataKey={dataKey} config={config} direction=\"vertical\" />\n {variant === 'hatched' && <BarHatchedFill id={id} dataKey={dataKey} />}\n {variant === 'duotone' && <BarDuotoneFill id={id} dataKey={dataKey} config={config} />}\n {variant === 'duotone-reverse' && (\n <BarDuotoneFill id={id} dataKey={dataKey} config={config} reverse />\n )}\n {variant === 'gradient' && <BarGradientFill id={id} dataKey={dataKey} />}\n {variant === 'stripped' && <BarStrippedFill id={id} dataKey={dataKey} />}\n {buffer && <BarBufferFill id={id} dataKey={dataKey} />}\n {glowing && <GlowFilter id={id} dataKey={dataKey} />}\n </defs>\n </>\n )\n}\n\n/** The geometry Recharts hands a custom bar shape. */\ninterface BarGeometry {\n x?: number\n y?: number\n width?: number\n height?: number\n index?: number\n isActive?: boolean\n [key: string]: unknown\n}\n\ninterface BarShapeProps extends BarGeometry {\n id: string\n dataKey: string\n variant: BarVariant\n barRadius: number\n glowing: boolean\n buffer: boolean\n isClickable: boolean\n enableHoverHighlight: boolean\n isPointerInChart: boolean\n isHorizontal: boolean\n animationType: ChartRevealType\n introStartedAt: number\n selectedDataKey: string | null\n dataLength: number\n bufferIndex: number\n onSelect: () => void\n}\n\n/**\n * One drawn bar.\n *\n * Two rectangles, and the second one is the reason this is a custom shape: an\n * invisible full-height rect keeps the whole COLUMN hoverable and clickable, so\n * a 3px bar at the bottom of the scale is as easy to hit as a full-height one.\n * The painted bar sits inside it and is the only part that animates.\n */\nfunction BarShape(props: BarShapeProps) {\n const {\n x = 0,\n y = 0,\n width = 0,\n height = 0,\n id,\n dataKey,\n variant,\n barRadius,\n glowing,\n buffer,\n isClickable,\n enableHoverHighlight,\n isPointerInChart,\n isHorizontal,\n animationType,\n introStartedAt,\n selectedDataKey,\n isActive,\n dataLength,\n bufferIndex,\n onSelect,\n } = props\n\n const index = typeof props.index === 'number' ? props.index : -1\n const isBufferBar = buffer && index >= 0 && index === bufferIndex\n const isStripped = variant === 'stripped'\n const grow = growAnimation(animationType, index, dataLength, isHorizontal, introStartedAt)\n\n const fill = isBufferBar ? `url(#${id}-buffer-${dataKey})` : variantFill(variant, id, dataKey)\n const opacity = barOpacity({\n isClickable,\n selectedDataKey,\n dataKey,\n enableHoverHighlight,\n isPointerInChart,\n isActive,\n })\n\n // Stripped rounds only the cap; every other variant rounds all four corners.\n const radius: RectRadius = isStripped ? [barRadius, barRadius, 0, 0] : barRadius\n\n const painted = (\n <>\n <Rectangle\n x={x}\n y={y}\n width={width}\n // Three pixels off the foot, which is the 2px surface gap between a bar\n // and its neighbour above in a stack, plus the hairline — but never all\n // the way to nothing while there is still a bar to draw.\n height={height <= 0 ? 0 : Math.max(MIN_BAR_LENGTH, height - FOOT_GAP)}\n opacity={opacity}\n radius={radius}\n fill={fill}\n filter={glowing ? `url(#${id}-glow-${dataKey})` : undefined}\n stroke={isBufferBar ? `url(#${id}-colors-${dataKey})` : undefined}\n strokeWidth={isBufferBar ? 1 : undefined}\n />\n {isStripped && (\n <Rectangle\n x={x}\n y={y - 4}\n width={width}\n height={2}\n radius={1}\n fill={`url(#${id}-colors-${dataKey})`}\n />\n )}\n </>\n )\n\n return (\n <g\n style={isClickable || enableHoverHighlight ? { cursor: 'pointer' } : undefined}\n onClick={onSelect}\n >\n <Rectangle {...props} fill=\"transparent\" />\n {grow ? (\n <motion.g\n initial={grow.initial}\n animate={grow.animate}\n transition={grow.transition}\n style={grow.style}\n >\n {painted}\n </motion.g>\n ) : (\n painted\n )}\n </g>\n )\n}\n\n/**\n * The grow-in for a single bar, or `null` when it should render static.\n *\n * The animation is anchored to when the CHART started rather than to when this\n * bar mounted, because Recharts remounts every bar on every re-render — a hover\n * anywhere in the plot would otherwise replay the whole intro. Reading elapsed\n * time makes it a true one-shot: a bar past its window renders flat, and a bar\n * caught mid-grow resumes from where it should already be.\n */\nfunction growAnimation(\n animationType: ChartRevealType,\n index: number,\n dataLength: number,\n isHorizontal: boolean,\n introStartedAt: number,\n) {\n if (animationType === 'none' || index < 0 || dataLength <= 0) return null\n\n const lastIndex = dataLength - 1\n const centre = lastIndex / 2\n\n let step: number\n switch (animationType) {\n case 'reverse':\n step = lastIndex - index\n break\n case 'center-out':\n step = Math.abs(index - centre)\n break\n case 'edges-in':\n step = centre - Math.abs(index - centre)\n break\n default:\n step = index\n }\n\n const startMs = step * GROW_STAGGER * 1000\n const endMs = startMs + GROW_DURATION * 1000\n const elapsed = Date.now() - introStartedAt\n\n if (elapsed >= endMs) return null\n\n const from = elapsed <= startMs ? 0 : (elapsed - startMs) / (GROW_DURATION * 1000)\n const transition = {\n duration: (endMs - Math.max(elapsed, startMs)) / 1000,\n ease: REVEAL_EASE,\n delay: Math.max(0, startMs - elapsed) / 1000,\n }\n\n return isHorizontal\n ? { initial: { scaleX: from }, animate: { scaleX: 1 }, transition, style: { originX: 0 } }\n : { initial: { scaleY: from }, animate: { scaleY: 1 }, transition, style: { originY: 1 } }\n}\n\n/** The paint reference for a variant. */\nfunction variantFill(variant: BarVariant, id: string, dataKey: string): string {\n if (variant === 'default') return `url(#${id}-colors-${dataKey})`\n return `url(#${id}-${variant}-${dataKey})`\n}\n\n/** How lit a bar is, given the click selection and the hover highlight. */\nfunction barOpacity({\n isClickable,\n selectedDataKey,\n dataKey,\n enableHoverHighlight,\n isPointerInChart,\n isActive,\n}: {\n isClickable: boolean\n selectedDataKey: string | null\n dataKey: string\n enableHoverHighlight: boolean\n isPointerInChart: boolean\n isActive?: boolean\n}) {\n const inSelection = selectedDataKey === null || selectedDataKey === dataKey\n const selectionOpacity = isClickable && selectedDataKey !== null ? (inSelection ? 1 : 0.15) : 1\n\n if (enableHoverHighlight && isPointerInChart) {\n return isActive ? selectionOpacity : selectionOpacity * 0.3\n }\n return selectionOpacity\n}\n\n/**\n * The category axis when the bars stand up, the value axis when they lie down.\n * The type is resolved from the orientation so a consumer never has to know\n * which way round Recharts wants it.\n */\nfunction XAxis({\n tickLine = false,\n axisLine = false,\n tickMargin = 8,\n minTickGap = 8,\n type,\n label,\n ...rest\n}: ChartXAxisProps) {\n const { isLoading, isHorizontal } = useBarChart()\n if (isLoading) return null\n return (\n <RechartsXAxis\n tickLine={tickLine}\n axisLine={axisLine}\n tickMargin={tickMargin}\n minTickGap={minTickGap}\n type={type ?? (isHorizontal ? 'number' : 'category')}\n {...rest}\n >\n {axisLabel(label, 'x')}\n </RechartsXAxis>\n )\n}\n\n/** The other axis, resolved the same way. */\nfunction YAxis({\n tickLine = false,\n axisLine = false,\n tickMargin = 8,\n minTickGap = 8,\n width = 'auto',\n type,\n label,\n tickFormatter,\n ...rest\n}: ChartYAxisProps) {\n const { isLoading, isHorizontal } = useBarChart()\n if (isLoading) return null\n return (\n <RechartsYAxis\n tickLine={tickLine}\n axisLine={axisLine}\n tickMargin={tickMargin}\n minTickGap={minTickGap}\n width={width}\n type={type ?? (isHorizontal ? 'category' : 'number')}\n tickFormatter={tickFormatter ?? defaultTick}\n {...rest}\n >\n {axisLabel(label, 'y')}\n </RechartsYAxis>\n )\n}\n\n/** Rules across the value axis — whichever axis that is for this orientation. */\nfunction Grid({\n strokeDasharray = '3 3',\n vertical,\n horizontal,\n ...rest\n}: ComponentProps<typeof CartesianGrid>) {\n const { isHorizontal } = useBarChart()\n return (\n <CartesianGrid\n strokeDasharray={strokeDasharray}\n vertical={vertical ?? isHorizontal}\n horizontal={horizontal ?? !isHorizontal}\n {...rest}\n />\n )\n}\n\n/**\n * The hover panel.\n *\n * No crosshair by default, unlike the line and area charts: a bar already marks\n * its own category, and a cursor over it draws a second edge on a shape that\n * has four already.\n */\nfunction Tooltip({ variant, roundness, defaultIndex, cursor = false }: ChartTooltipSlotProps) {\n const { isLoading, selectedDataKey } = useBarChart()\n if (isLoading) return null\n\n return (\n <ChartTooltip\n cursor={cursor}\n defaultIndex={defaultIndex}\n content={\n <ChartTooltipContent selected={selectedDataKey} roundness={roundness} variant={variant} />\n }\n />\n )\n}\n\n/** The key. Required above one series. */\nfunction Legend({\n variant,\n align = 'right',\n verticalAlign = 'top',\n isClickable = false,\n}: ChartLegendSlotProps) {\n const { selectedDataKey, selectDataKey } = useBarChart()\n\n return (\n <ChartLegend\n verticalAlign={verticalAlign}\n align={align}\n content={\n <ChartLegendContent\n selected={selectedDataKey}\n onSelectChange={selectDataKey}\n isClickable={isClickable}\n variant={variant}\n />\n }\n />\n )\n}\n\n/** The decorative plate behind the plot. */\nfunction Background({ variant }: { variant: ChartBackgroundVariant }) {\n const { isLoading } = useBarChart()\n if (isLoading) return null\n return <ChartBackground variant={variant} />\n}\n\n/** The skeleton drawn in place of the real bars while data is in flight. */\nfunction LoadingBar({ chartId, onShimmerExit }: { chartId: string; onShimmerExit: () => void }) {\n return (\n <>\n <RechartsBar\n dataKey={LOADING_KEY}\n fill=\"currentColor\"\n fillOpacity={0.15}\n radius={BAR_RADIUS}\n isAnimationActive={false}\n legendType=\"none\"\n className=\"text-(--ink)\"\n style={{ mask: `url(#${chartId}-loading-mask)` }}\n />\n <defs>\n <LoadingShimmer id={chartId} onShimmerExit={onShimmerExit} />\n </defs>\n </>\n )\n}\n\nBarChart.Bar = Bar\nBarChart.XAxis = XAxis\nBarChart.YAxis = YAxis\nBarChart.Grid = Grid\nBarChart.Tooltip = Tooltip\nBarChart.Legend = Legend\nBarChart.Background = Background\nBarChart.ReferenceLine = ReferenceLine\nBarChart.ReferenceBand = ReferenceBand\nBarChart.Annotation = Annotation\nBarChart.Values = Values\nBarChart.Brush = Brush\nBarChart.Toolbar = Toolbar\nBarChart.Sonify = Sonify\n\nexport default BarChart\n"],"mappings":";AAkZU,SAqJN,UArJM,KAiCA,YAjCA;AAhZV;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE,OAAO;AAAA,EACP,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT,SAAS;AAAA,OACJ;AAEP,SAAS,QAAQ,wBAAwB;AACzC,SAAS,sBAAwC;AACjD,SAAS,mBAAmB;AAC5B,SAAS,yBAAyB;AAClC,eAAqC;AACrC,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB;AAC5B,SAAS,YAAY,eAAe,qBAAqB;A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cAAc,GAAmD;AAC9F,SACE,iCACE;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,SAAS;AAAA,QACT,MAAK;AAAA,QACL,aAAa;AAAA,QACb,QAAQ;AAAA,QACR,mBAAmB;AAAA,QACnB,YAAW;AAAA,QACX,WAAU;AAAA,QACV,OAAO,EAAE,MAAM,QAAQ,OAAO,iBAAiB;AAAA;AAAA,IACjD;AAAA,IACA,oBAAC,UACC,8BAAC,kBAAe,IAAI,SAAS,eAA8B,GAC7D;AAAA,KACF;AAEJ;AAEA,SAAS,MAAM;AACf,SAAS,QAAQ;AACjB,SAAS,QAAQ;AACjB,SAAS,OAAO;AAChB,SAAS,UAAU;AACnB,SAAS,SAAS;AAClB,SAAS,aAAa;AACtB,SAAS,gBAAgB;AACzB,SAAS,gBAAgB;AACzB,SAAS,aAAa;AACtB,SAAS,SAAS;AAClB,SAAS,QAAQ;AACjB,SAAS,UAAU;AACnB,SAAS,SAAS;AAElB,IAAO,mBAAQ;","names":[]}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { ChartEmptyProps } from '../lib/empty.js';
|
|
4
|
+
|
|
5
|
+
interface BarListItem {
|
|
6
|
+
/** What the row is. Doubles as its key, so it must be unique. */
|
|
7
|
+
name: string;
|
|
8
|
+
value: number;
|
|
9
|
+
/** Turns the row's name into a link. */
|
|
10
|
+
href?: string;
|
|
11
|
+
/** Drawn before the name — a favicon, a status dot, a flag. */
|
|
12
|
+
icon?: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
interface BarListProps {
|
|
15
|
+
/** What the list ranks. Required: it names the table for a screen reader. */
|
|
16
|
+
label: string;
|
|
17
|
+
/** Prints the label above the list instead of hiding it from sight. */
|
|
18
|
+
showLabel?: boolean;
|
|
19
|
+
items: BarListItem[];
|
|
20
|
+
/** Keeps the top N and folds the rest into one "Other" row. */
|
|
21
|
+
limit?: number;
|
|
22
|
+
/** Formats each value. Defaults to the same compact form the axes use. */
|
|
23
|
+
formatValue?: (value: number) => string;
|
|
24
|
+
/**
|
|
25
|
+
* The scale's ceiling. Derived from the largest row when omitted.
|
|
26
|
+
*
|
|
27
|
+
* Pin it to compare two lists side by side — on independent scales the
|
|
28
|
+
* leading row of each fills its track, and two very different numbers look
|
|
29
|
+
* identical.
|
|
30
|
+
*/
|
|
31
|
+
max?: number;
|
|
32
|
+
/** Sorts descending before rendering. */
|
|
33
|
+
sort?: boolean;
|
|
34
|
+
className?: string;
|
|
35
|
+
/**
|
|
36
|
+
* What the list shows when it has nothing to rank.
|
|
37
|
+
*
|
|
38
|
+
* A caption over an empty `<tbody>` is a list that failed to load as far as
|
|
39
|
+
* the reader can tell, and the reader's next move is to reload the page.
|
|
40
|
+
*/
|
|
41
|
+
empty?: ChartEmptyProps;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* A ranked list, with the bar behind the name rather than beside it.
|
|
45
|
+
*
|
|
46
|
+
* The answer to "top referrers", "slowest endpoints", "biggest accounts" — and
|
|
47
|
+
* a better one than a horizontal bar chart, which spends a third of its width
|
|
48
|
+
* on a category axis repeating labels the rows could simply contain. Reading a
|
|
49
|
+
* name off a y-axis and matching it to a bar is two steps; reading it off the
|
|
50
|
+
* bar is none.
|
|
51
|
+
*
|
|
52
|
+
* It is a `<table>`, because that is what it is: two columns, a header, and one
|
|
53
|
+
* row per thing. The bar is a background on the name cell, so it never becomes
|
|
54
|
+
* a second element a screen reader has to walk past.
|
|
55
|
+
*
|
|
56
|
+
* Reach for `<BarChart orientation="horizontal">` instead when the categories
|
|
57
|
+
* are few and fixed and the axis is doing real work — a scale a reader needs to
|
|
58
|
+
* read values off, rather than a ranking they need to skim.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* <BarList label="Top referrers" items={referrers} limit={5} />
|
|
62
|
+
*/
|
|
63
|
+
declare function BarList({ label, showLabel, items, limit, formatValue, max, sort, className, empty, }: BarListProps): react.JSX.Element;
|
|
64
|
+
|
|
65
|
+
export { BarList, type BarListItem, type BarListProps, BarList as default };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/cn.js";
|
|
3
|
+
import { ChartEmpty } from "../lib/empty.js";
|
|
4
|
+
import { defaultTick } from "../lib/format.js";
|
|
5
|
+
function BarList({
|
|
6
|
+
label,
|
|
7
|
+
showLabel = false,
|
|
8
|
+
items,
|
|
9
|
+
limit,
|
|
10
|
+
formatValue = defaultTick,
|
|
11
|
+
max,
|
|
12
|
+
sort = true,
|
|
13
|
+
className,
|
|
14
|
+
empty
|
|
15
|
+
}) {
|
|
16
|
+
const ordered = sort ? [...items].sort((a, b) => b.value - a.value) : items;
|
|
17
|
+
const shown = limit !== void 0 && ordered.length > limit ? [
|
|
18
|
+
...ordered.slice(0, limit),
|
|
19
|
+
{
|
|
20
|
+
name: "Other",
|
|
21
|
+
value: ordered.slice(limit).reduce((sum, item) => sum + item.value, 0)
|
|
22
|
+
}
|
|
23
|
+
] : ordered;
|
|
24
|
+
const ceiling = max ?? Math.max(1, ...shown.map((item) => item.value));
|
|
25
|
+
if (shown.length === 0) {
|
|
26
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex w-full flex-col gap-2", className), children: [
|
|
27
|
+
/* @__PURE__ */ jsx("p", { className: cn("text-start", showLabel ? "mb-2 eyebrow text-(--ink-3-aa)" : "sr-only"), children: label }),
|
|
28
|
+
/* @__PURE__ */ jsx(ChartEmpty, { ...empty || {} })
|
|
29
|
+
] });
|
|
30
|
+
}
|
|
31
|
+
return /* @__PURE__ */ jsx("div", { className: cn("flex w-full flex-col gap-2", className), children: /* @__PURE__ */ jsxs("table", { className: "w-full border-collapse text-sm", children: [
|
|
32
|
+
/* @__PURE__ */ jsx(
|
|
33
|
+
"caption",
|
|
34
|
+
{
|
|
35
|
+
className: cn(
|
|
36
|
+
"text-start",
|
|
37
|
+
showLabel ? "mb-2 eyebrow text-(--ink-3-aa)" : "sr-only"
|
|
38
|
+
),
|
|
39
|
+
children: label
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
/* @__PURE__ */ jsx("thead", { className: "sr-only", children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
43
|
+
/* @__PURE__ */ jsx("th", { scope: "col", children: "Name" }),
|
|
44
|
+
/* @__PURE__ */ jsx("th", { scope: "col", children: "Value" })
|
|
45
|
+
] }) }),
|
|
46
|
+
/* @__PURE__ */ jsx("tbody", { children: shown.map((item) => {
|
|
47
|
+
const share = Math.max(0, Math.min(1, item.value / ceiling));
|
|
48
|
+
return /* @__PURE__ */ jsxs("tr", { className: "align-middle", children: [
|
|
49
|
+
/* @__PURE__ */ jsx("th", { scope: "row", className: "w-full py-1 pe-3 text-start font-normal", children: /* @__PURE__ */ jsxs(
|
|
50
|
+
"span",
|
|
51
|
+
{
|
|
52
|
+
className: "flex h-8 items-center gap-2 rounded-(--radius-sm) px-2 text-(--ink)",
|
|
53
|
+
style: {
|
|
54
|
+
background: `linear-gradient(to right, color-mix(in srgb, var(--series-1) calc(var(--chart-fill) * 100%), transparent) ${share * 100}%, transparent ${share * 100}%)`
|
|
55
|
+
},
|
|
56
|
+
children: [
|
|
57
|
+
item.icon && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "flex shrink-0 items-center text-(--ink-3-aa)", children: item.icon }),
|
|
58
|
+
item.href ? /* @__PURE__ */ jsx(
|
|
59
|
+
"a",
|
|
60
|
+
{
|
|
61
|
+
href: item.href,
|
|
62
|
+
className: "truncate underline-offset-2 hover:underline focus-visible:underline",
|
|
63
|
+
children: item.name
|
|
64
|
+
}
|
|
65
|
+
) : /* @__PURE__ */ jsx("span", { className: "truncate", children: item.name })
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
) }),
|
|
69
|
+
/* @__PURE__ */ jsx("td", { className: "py-1 text-end font-mono text-xs whitespace-nowrap tabular-nums text-(--ink-2)", children: formatValue(item.value) })
|
|
70
|
+
] }, item.name);
|
|
71
|
+
}) })
|
|
72
|
+
] }) });
|
|
73
|
+
}
|
|
74
|
+
var BarList_default = BarList;
|
|
75
|
+
export {
|
|
76
|
+
BarList,
|
|
77
|
+
BarList_default as default
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=BarList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/charts/BarList/BarList.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { cn } from '../../lib/cn'\nimport { ChartEmpty, type ChartEmptyProps } from '../lib/empty'\nimport { defaultTick } from '../lib/format'\n\nexport interface BarListItem {\n /** What the row is. Doubles as its key, so it must be unique. */\n name: string\n value: number\n /** Turns the row's name into a link. */\n href?: string\n /** Drawn before the name — a favicon, a status dot, a flag. */\n icon?: ReactNode\n}\n\nexport interface BarListProps {\n /** What the list ranks. Required: it names the table for a screen reader. */\n label: string\n /** Prints the label above the list instead of hiding it from sight. */\n showLabel?: boolean\n items: BarListItem[]\n /** Keeps the top N and folds the rest into one \"Other\" row. */\n limit?: number\n /** Formats each value. Defaults to the same compact form the axes use. */\n formatValue?: (value: number) => string\n /**\n * The scale's ceiling. Derived from the largest row when omitted.\n *\n * Pin it to compare two lists side by side — on independent scales the\n * leading row of each fills its track, and two very different numbers look\n * identical.\n */\n max?: number\n /** Sorts descending before rendering. */\n sort?: boolean\n className?: string\n /**\n * What the list shows when it has nothing to rank.\n *\n * A caption over an empty `<tbody>` is a list that failed to load as far as\n * the reader can tell, and the reader's next move is to reload the page.\n */\n empty?: ChartEmptyProps\n}\n\n/**\n * A ranked list, with the bar behind the name rather than beside it.\n *\n * The answer to \"top referrers\", \"slowest endpoints\", \"biggest accounts\" — and\n * a better one than a horizontal bar chart, which spends a third of its width\n * on a category axis repeating labels the rows could simply contain. Reading a\n * name off a y-axis and matching it to a bar is two steps; reading it off the\n * bar is none.\n *\n * It is a `<table>`, because that is what it is: two columns, a header, and one\n * row per thing. The bar is a background on the name cell, so it never becomes\n * a second element a screen reader has to walk past.\n *\n * Reach for `<BarChart orientation=\"horizontal\">` instead when the categories\n * are few and fixed and the axis is doing real work — a scale a reader needs to\n * read values off, rather than a ranking they need to skim.\n *\n * @example\n * <BarList label=\"Top referrers\" items={referrers} limit={5} />\n */\nexport function BarList({\n label,\n showLabel = false,\n items,\n limit,\n formatValue = defaultTick,\n max,\n sort = true,\n className,\n empty,\n}: BarListProps) {\n const ordered = sort ? [...items].sort((a, b) => b.value - a.value) : items\n\n // The tail is summed rather than dropped: a \"top five\" that silently discards\n // the other forty misstates the whole, and the reader has no way to tell.\n const shown =\n limit !== undefined && ordered.length > limit\n ? [\n ...ordered.slice(0, limit),\n {\n name: 'Other',\n value: ordered.slice(limit).reduce((sum, item) => sum + item.value, 0),\n },\n ]\n : ordered\n\n const ceiling = max ?? Math.max(1, ...shown.map((item) => item.value))\n\n if (shown.length === 0) {\n return (\n <div className={cn('flex w-full flex-col gap-2', className)}>\n <p className={cn('text-start', showLabel ? 'mb-2 eyebrow text-(--ink-3-aa)' : 'sr-only')}>\n {label}\n </p>\n <ChartEmpty {...(empty || {})} />\n </div>\n )\n }\n\n return (\n <div className={cn('flex w-full flex-col gap-2', className)}>\n <table className=\"w-full border-collapse text-sm\">\n <caption\n className={cn(\n 'text-start',\n showLabel ? 'mb-2 eyebrow text-(--ink-3-aa)' : 'sr-only',\n )}\n >\n {label}\n </caption>\n <thead className=\"sr-only\">\n <tr>\n <th scope=\"col\">Name</th>\n <th scope=\"col\">Value</th>\n </tr>\n </thead>\n <tbody>\n {shown.map((item) => {\n const share = Math.max(0, Math.min(1, item.value / ceiling))\n\n return (\n <tr key={item.name} className=\"align-middle\">\n <th scope=\"row\" className=\"w-full py-1 pe-3 text-start font-normal\">\n {/* The bar is a background on the cell, not a sibling: an\n empty <div> beside the name would be one more thing in the\n accessibility tree saying nothing. */}\n <span\n className=\"flex h-8 items-center gap-2 rounded-(--radius-sm) px-2 text-(--ink)\"\n style={{\n background: `linear-gradient(to right, color-mix(in srgb, var(--series-1) calc(var(--chart-fill) * 100%), transparent) ${share * 100}%, transparent ${share * 100}%)`,\n }}\n >\n {item.icon && (\n <span aria-hidden className=\"flex shrink-0 items-center text-(--ink-3-aa)\">\n {item.icon}\n </span>\n )}\n {item.href ? (\n <a\n href={item.href}\n className=\"truncate underline-offset-2 hover:underline focus-visible:underline\"\n >\n {item.name}\n </a>\n ) : (\n <span className=\"truncate\">{item.name}</span>\n )}\n </span>\n </th>\n <td className=\"py-1 text-end font-mono text-xs whitespace-nowrap tabular-nums text-(--ink-2)\">\n {formatValue(item.value)}\n </td>\n </tr>\n )\n })}\n </tbody>\n </table>\n </div>\n )\n}\n\nexport default BarList\n"],"mappings":"AA+FM,SACE,KADF;AA9FN,SAAS,UAAU;AACnB,SAAS,kBAAwC;AACjD,SAAS,mBAAmB;AA8DrB,SAAS,QAAQ;AAAA,EACtB;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd;AAAA,EACA,OAAO;AAAA,EACP;AAAA,EACA;AACF,GAAiB;AACf,QAAM,UAAU,OAAO,CAAC,GAAG,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,EAAE,QAAQ,EAAE,KAAK,IAAI;AAItE,QAAM,QACJ,UAAU,UAAa,QAAQ,SAAS,QACpC;AAAA,IACE,GAAG,QAAQ,MAAM,GAAG,KAAK;AAAA,IACzB;AAAA,MACE,MAAM;AAAA,MACN,OAAO,QAAQ,MAAM,KAAK,EAAE,OAAO,CAAC,KAAK,SAAS,MAAM,KAAK,OAAO,CAAC;AAAA,IACvE;AAAA,EACF,IACA;AAEN,QAAM,UAAU,OAAO,KAAK,IAAI,GAAG,GAAG,MAAM,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC;AAErE,MAAI,MAAM,WAAW,GAAG;AACtB,WACE,qBAAC,SAAI,WAAW,GAAG,8BAA8B,SAAS,GACxD;AAAA,0BAAC,OAAE,W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AAQ;","names":[]}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
/** Which way a change is good. */
|
|
5
|
+
type DeltaIntent = 'up-is-good' | 'down-is-good' | 'neutral';
|
|
6
|
+
interface BigNumberDelta {
|
|
7
|
+
/**
|
|
8
|
+
* The change, already computed, as a RATIO. Positive is up, whatever that
|
|
9
|
+
* means here.
|
|
10
|
+
*
|
|
11
|
+
* `0.124` is the twelve-point-four percent the default `format` prints.
|
|
12
|
+
* Passing `12.4` for the same change prints `+1240%`, and nothing can catch
|
|
13
|
+
* that for you — a ratio and a percentage are both plain numbers, and either
|
|
14
|
+
* is a legitimate value under a `format` of your own.
|
|
15
|
+
*/
|
|
16
|
+
value: number;
|
|
17
|
+
/** What it is a change from — "vs last week". */
|
|
18
|
+
label?: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Which direction counts as good.
|
|
21
|
+
*
|
|
22
|
+
* Required rather than assumed, because the assumption is wrong half the
|
|
23
|
+
* time: revenue up is good, error rate up is not, and a component that
|
|
24
|
+
* guesses will confidently colour a bad number green.
|
|
25
|
+
*/
|
|
26
|
+
intent?: DeltaIntent;
|
|
27
|
+
/** Formats the change. Defaults to a signed percentage. */
|
|
28
|
+
format?: (value: number) => string;
|
|
29
|
+
}
|
|
30
|
+
interface BigNumberProps {
|
|
31
|
+
/** What the number counts. */
|
|
32
|
+
label: ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* The number, already formatted — this component does not guess a unit.
|
|
35
|
+
*
|
|
36
|
+
* `null` and `undefined` are the empty state rather than a blank space: a
|
|
37
|
+
* headline with nothing under it reads as a figure that failed to load, and
|
|
38
|
+
* the reader's next move is to reload a page that will look the same.
|
|
39
|
+
*/
|
|
40
|
+
value: ReactNode;
|
|
41
|
+
/** What stands in for the number when there is none. */
|
|
42
|
+
emptyValue?: ReactNode;
|
|
43
|
+
delta?: BigNumberDelta;
|
|
44
|
+
/** A sparkline, a note, a caveat. Sits under the number. */
|
|
45
|
+
children?: ReactNode;
|
|
46
|
+
className?: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* One number, at the size of a headline.
|
|
50
|
+
*
|
|
51
|
+
* The form most dashboards need most often and most chart libraries do not
|
|
52
|
+
* ship, on the grounds that it is not a chart. It is the right answer whenever
|
|
53
|
+
* there is exactly one figure to report: a plot of a single value is a plot
|
|
54
|
+
* whose shape carries nothing, and the reader has to decode an axis to recover
|
|
55
|
+
* a number that could simply have been printed.
|
|
56
|
+
*
|
|
57
|
+
* The delta is where this earns its place over a `<p>`. Direction is stated by
|
|
58
|
+
* the CALL SITE (`intent`), never inferred: "errors down 12%" is good news and
|
|
59
|
+
* "revenue down 12%" is not, and no component can tell which it is holding.
|
|
60
|
+
* Where the direction is known, the arrow and the word carry it — the status
|
|
61
|
+
* colour is the third signal, never the only one.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* <BigNumber
|
|
65
|
+
* label="Monthly revenue"
|
|
66
|
+
* value="$48,210"
|
|
67
|
+
* delta={{ value: 0.124, label: 'vs last month', intent: 'up-is-good' }}
|
|
68
|
+
* />
|
|
69
|
+
*/
|
|
70
|
+
declare function BigNumber({ label, value, emptyValue, delta, children, className, }: BigNumberProps): react.JSX.Element;
|
|
71
|
+
|
|
72
|
+
export { BigNumber, type BigNumberDelta, type BigNumberProps, type DeltaIntent, BigNumber as default };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/cn.js";
|
|
3
|
+
const signed = (value) => `${value > 0 ? "+" : ""}${(value * 100).toFixed(1).replace(/\.0$/, "")}%`;
|
|
4
|
+
function BigNumber({
|
|
5
|
+
label,
|
|
6
|
+
value,
|
|
7
|
+
emptyValue = "\u2014",
|
|
8
|
+
delta,
|
|
9
|
+
children,
|
|
10
|
+
className
|
|
11
|
+
}) {
|
|
12
|
+
const intent = delta?.intent ?? "neutral";
|
|
13
|
+
const format = delta?.format ?? signed;
|
|
14
|
+
const rising = (delta?.value ?? 0) > 0;
|
|
15
|
+
const flat = (delta?.value ?? 0) === 0;
|
|
16
|
+
const isEmpty = value === null || value === void 0;
|
|
17
|
+
const good = flat || intent === "neutral" ? null : intent === "up-is-good" ? rising : !rising;
|
|
18
|
+
const tone = good === null ? "text-(--ink-2)" : good ? "text-(--ok)" : "text-(--danger)";
|
|
19
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-1", className), children: [
|
|
20
|
+
/* @__PURE__ */ jsx("span", { className: "eyebrow text-(--ink-3-aa)", children: label }),
|
|
21
|
+
/* @__PURE__ */ jsx(
|
|
22
|
+
"span",
|
|
23
|
+
{
|
|
24
|
+
className: cn(
|
|
25
|
+
"font-heading text-[length:var(--fs-lead)] leading-none tabular-nums",
|
|
26
|
+
isEmpty ? "text-(--ink-3-aa)" : "text-(--ink)"
|
|
27
|
+
),
|
|
28
|
+
children: isEmpty ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
29
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, children: emptyValue }),
|
|
30
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "No data" })
|
|
31
|
+
] }) : value
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
delta && /* @__PURE__ */ jsxs("span", { className: cn("flex items-baseline gap-1.5 mono-meta", tone), children: [
|
|
35
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, children: flat ? "\u2192" : rising ? "\u2191" : "\u2193" }),
|
|
36
|
+
/* @__PURE__ */ jsx("span", { children: format(delta.value) }),
|
|
37
|
+
/* @__PURE__ */ jsxs("span", { className: "sr-only", children: [
|
|
38
|
+
flat ? "no change" : rising ? "up" : "down",
|
|
39
|
+
good === null ? "" : good ? ", better" : ", worse"
|
|
40
|
+
] }),
|
|
41
|
+
delta.label && /* @__PURE__ */ jsx("span", { className: "text-(--ink-3-aa)", children: delta.label })
|
|
42
|
+
] }),
|
|
43
|
+
children && /* @__PURE__ */ jsx("div", { className: "mt-2", children })
|
|
44
|
+
] });
|
|
45
|
+
}
|
|
46
|
+
var BigNumber_default = BigNumber;
|
|
47
|
+
export {
|
|
48
|
+
BigNumber,
|
|
49
|
+
BigNumber_default as default
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=BigNumber.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/charts/BigNumber/BigNumber.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { cn } from '../../lib/cn'\n\n/** Which way a change is good. */\nexport type DeltaIntent = 'up-is-good' | 'down-is-good' | 'neutral'\n\nexport interface BigNumberDelta {\n /**\n * The change, already computed, as a RATIO. Positive is up, whatever that\n * means here.\n *\n * `0.124` is the twelve-point-four percent the default `format` prints.\n * Passing `12.4` for the same change prints `+1240%`, and nothing can catch\n * that for you — a ratio and a percentage are both plain numbers, and either\n * is a legitimate value under a `format` of your own.\n */\n value: number\n /** What it is a change from — \"vs last week\". */\n label?: ReactNode\n /**\n * Which direction counts as good.\n *\n * Required rather than assumed, because the assumption is wrong half the\n * time: revenue up is good, error rate up is not, and a component that\n * guesses will confidently colour a bad number green.\n */\n intent?: DeltaIntent\n /** Formats the change. Defaults to a signed percentage. */\n format?: (value: number) => string\n}\n\nexport interface BigNumberProps {\n /** What the number counts. */\n label: ReactNode\n /**\n * The number, already formatted — this component does not guess a unit.\n *\n * `null` and `undefined` are the empty state rather than a blank space: a\n * headline with nothing under it reads as a figure that failed to load, and\n * the reader's next move is to reload a page that will look the same.\n */\n value: ReactNode\n /** What stands in for the number when there is none. */\n emptyValue?: ReactNode\n delta?: BigNumberDelta\n /** A sparkline, a note, a caveat. Sits under the number. */\n children?: ReactNode\n className?: string\n}\n\nconst signed = (value: number): string =>\n `${value > 0 ? '+' : ''}${(value * 100).toFixed(1).replace(/\\.0$/, '')}%`\n\n/**\n * One number, at the size of a headline.\n *\n * The form most dashboards need most often and most chart libraries do not\n * ship, on the grounds that it is not a chart. It is the right answer whenever\n * there is exactly one figure to report: a plot of a single value is a plot\n * whose shape carries nothing, and the reader has to decode an axis to recover\n * a number that could simply have been printed.\n *\n * The delta is where this earns its place over a `<p>`. Direction is stated by\n * the CALL SITE (`intent`), never inferred: \"errors down 12%\" is good news and\n * \"revenue down 12%\" is not, and no component can tell which it is holding.\n * Where the direction is known, the arrow and the word carry it — the status\n * colour is the third signal, never the only one.\n *\n * @example\n * <BigNumber\n * label=\"Monthly revenue\"\n * value=\"$48,210\"\n * delta={{ value: 0.124, label: 'vs last month', intent: 'up-is-good' }}\n * />\n */\nexport function BigNumber({\n label,\n value,\n emptyValue = '—',\n delta,\n children,\n className,\n}: BigNumberProps) {\n const intent = delta?.intent ?? 'neutral'\n const format = delta?.format ?? signed\n const rising = (delta?.value ?? 0) > 0\n const flat = (delta?.value ?? 0) === 0\n const isEmpty = value === null || value === undefined\n\n // A change of exactly zero is not good news and not bad news, and the tone\n // and the arrow have always said so. The verdict is dropped with them: an\n // intent decides which DIRECTION is better, and there is no direction here,\n // so `{ value: 0, intent: 'up-is-good' }` used to be announced as \"no\n // change, worse\" — a judgement nothing on screen was making.\n const good = flat || intent === 'neutral' ? null : intent === 'up-is-good' ? rising : !rising\n const tone = good === null ? 'text-(--ink-2)' : good ? 'text-(--ok)' : 'text-(--danger)'\n\n return (\n <div className={cn('flex flex-col gap-1', className)}>\n <span className=\"eyebrow text-(--ink-3-aa)\">{label}</span>\n\n {/* The serif, at the record-title step. A number this size is the page's\n headline, and the system sets headlines in the editorial face. */}\n <span\n className={cn(\n 'font-heading text-[length:var(--fs-lead)] leading-none tabular-nums',\n isEmpty ? 'text-(--ink-3-aa)' : 'text-(--ink)',\n )}\n >\n {isEmpty ? (\n <>\n {/* The dash is the sighted reading and the sentence is the spoken\n one. Announcing \"em dash\" instead would be a third thing. */}\n <span aria-hidden>{emptyValue}</span>\n <span className=\"sr-only\">No data</span>\n </>\n ) : (\n value\n )}\n </span>\n\n {delta && (\n <span className={cn('flex items-baseline gap-1.5 mono-meta', tone)}>\n {/* The arrow is the second carrier and the word is the third, so the\n reading survives greyscale, forced colours and colour blindness —\n which the status tint alone does not. */}\n <span aria-hidden>{flat ? '→' : rising ? '↑' : '↓'}</span>\n <span>{format(delta.value)}</span>\n <span className=\"sr-only\">\n {flat ? 'no change' : rising ? 'up' : 'down'}\n {good === null ? '' : good ? ', better' : ', worse'}\n </span>\n {delta.label && <span className=\"text-(--ink-3-aa)\">{delta.label}</span>}\n </span>\n )}\n\n {children && <div className=\"mt-2\">{children}</div>}\n </div>\n )\n}\n\nexport default BigNumber\n"],"mappings":"AAmGM,SAWI,UAXJ,KAWI,YAXJ;AAlGN,SAAS,UAAU;AAiDnB,MAAM,SAAS,CAAC,UACd,GAAG,QAAQ,IAAI,MAAM,EAAE,IAAI,QAAQ,KAAK,QAAQ,CAAC,EAAE,QAAQ,QAAQ,EAAE,CAAC;AAwBjE,SAAS,UAAU;AAAA,EACxB;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA;AACF,GAAmB;AACjB,QAAM,SAAS,OAAO,UAAU;AAChC,QAAM,SAAS,OAAO,UAAU;AAChC,QAAM,UAAU,OAAO,SAAS,KAAK;AACrC,QAAM,QAAQ,OAAO,SAAS,OAAO;AACrC,QAAM,UAAU,UAAU,QAAQ,UAAU;AAO5C,QAAM,OAAO,QAAQ,WAAW,YAAY,OAAO,WAAW,eAAe,SAAS,CAAC;AACvF,QAAM,OAAO,SAAS,OAAO,mBAAmB,OAAO,gBAAgB;AAEvE,SACE,qBAAC,SAAI,WAAW,GAAG,uBAAuB,SAAS,GACjD;AAAA,wBAAC,UAAK,WAAU,6BAA6B,iBAAM;AAAA,IAInD;AAAA,MAAC;AAAA;AAAA,QACC,WAAW;AAAA,UACT;AAAA,UACA,UAAU,sBAAsB;AAAA,QAClC;AAAA,QAEC,oBACC,iCAGE;AAAA,8BAAC,UAAK,eAAW,MAAE,sBAAW;AAAA,UAC9B,oBAAC,UAAK,WAAU,WAAU,qBAAO;AAAA,WACnC,IAEA;AAAA;AAAA,IAEJ;AAAA,IAEC,SACC,qBAAC,UAAK,WAAW,GAAG,yCAAyC,IAAI,GAI/D;AAAA,0BAAC,UAAK,eAAW,MAAE,iBAAO,WAAM,SAAS,WAAM,UAAI;AAAA,MACnD,oBAAC,UAAM,iBAAO,MAAM,KAAK,GAAE;AAAA,MAC3B,qBAAC,UAAK,WAAU,WACb;AAAA,eAAO,cAAc,SAAS,OAAO;AAAA,QACrC,SAAS,OAAO,KAAK,OAAO,aAAa;AAAA,SAC5C;AAAA,MACC,MAAM,SAAS,oBAAC,UAAK,WAAU,qBAAqB,gBAAM,OAAM;AAAA,OACnE;AAAA,IAGD,YAAY,oBAAC,SAAI,WAAU,QAAQ,UAAS;AAAA,KAC/C;AAEJ;AAEA,IAAO,oBAAQ;","names":[]}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { ChartTooltipSlotProps } from '../AreaChart/AreaChart.js';
|
|
2
|
+
import { ChartXAxisProps, ChartYAxisProps } from '../BarChart/BarChart.js';
|
|
3
|
+
import * as react from 'react';
|
|
4
|
+
import { ReactNode, ComponentProps } from 'react';
|
|
5
|
+
import { BarChart, Bar, CartesianGrid } from 'recharts';
|
|
6
|
+
import { ChartConfig } from '../lib/chart.js';
|
|
7
|
+
import { ChartEmptyProps } from '../lib/empty.js';
|
|
8
|
+
import { ChartBackgroundVariant } from '../lib/background.js';
|
|
9
|
+
import { ReferenceLine, ReferenceBand, Annotation } from '../lib/annotations.js';
|
|
10
|
+
import '../lib/values.js';
|
|
11
|
+
import '../lib/sonify-control.js';
|
|
12
|
+
import '../lib/sonify.js';
|
|
13
|
+
import '../lib/brush.js';
|
|
14
|
+
import '../lib/toolbar.js';
|
|
15
|
+
import '../lib/zoom.js';
|
|
16
|
+
import '../lib/figure.js';
|
|
17
|
+
import '../lib/paint.js';
|
|
18
|
+
import '../lib/dot.js';
|
|
19
|
+
import '../lib/legend.js';
|
|
20
|
+
import '../lib/tooltip.js';
|
|
21
|
+
import 'recharts/types/component/DefaultTooltipContent';
|
|
22
|
+
|
|
23
|
+
/** Which way the boxes run. */
|
|
24
|
+
type BoxPlotOrientation = 'vertical' | 'horizontal';
|
|
25
|
+
/** A category summarised into the five numbers a box is drawn from. */
|
|
26
|
+
interface BoxPlotSummary {
|
|
27
|
+
/** What the box describes. Doubles as its key, so it must be unique. */
|
|
28
|
+
name: string;
|
|
29
|
+
/** The low whisker's end — the smallest observation inside the fence. */
|
|
30
|
+
min: number;
|
|
31
|
+
q1: number;
|
|
32
|
+
median: number;
|
|
33
|
+
q3: number;
|
|
34
|
+
/** The high whisker's end — the largest observation inside the fence. */
|
|
35
|
+
max: number;
|
|
36
|
+
/** Points outside the fences, drawn one dot each. */
|
|
37
|
+
outliers?: number[];
|
|
38
|
+
/**
|
|
39
|
+
* How many observations the box stands for.
|
|
40
|
+
*
|
|
41
|
+
* Needed for a notch, and worth carrying anyway: a box drawn from six points
|
|
42
|
+
* and a box drawn from six thousand look identical, and only one of them
|
|
43
|
+
* means anything.
|
|
44
|
+
*/
|
|
45
|
+
count?: number;
|
|
46
|
+
}
|
|
47
|
+
/** A category handed over as raw observations, for the chart to summarise. */
|
|
48
|
+
interface BoxPlotSample {
|
|
49
|
+
/** What the box describes. Doubles as its key, so it must be unique. */
|
|
50
|
+
name: string;
|
|
51
|
+
/** Every observation in this category, in any order. */
|
|
52
|
+
values: number[];
|
|
53
|
+
min?: never;
|
|
54
|
+
q1?: never;
|
|
55
|
+
median?: never;
|
|
56
|
+
q3?: never;
|
|
57
|
+
max?: never;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* One category: either the raw observations, or the summary itself.
|
|
61
|
+
*
|
|
62
|
+
* Both forms exist because both are real. A chart fed from a warehouse gets
|
|
63
|
+
* percentiles back from the query and never sees a row; a chart fed from a
|
|
64
|
+
* browser has the array in hand and should not have to compute quartiles to
|
|
65
|
+
* draw them.
|
|
66
|
+
*/
|
|
67
|
+
type BoxPlotDatum = BoxPlotSample | (BoxPlotSummary & {
|
|
68
|
+
values?: never;
|
|
69
|
+
});
|
|
70
|
+
interface BoxPlotProps {
|
|
71
|
+
/**
|
|
72
|
+
* The single series — its label and its paint. Only the FIRST entry is read;
|
|
73
|
+
* a box plot has one measurement and as many categories as it has boxes.
|
|
74
|
+
*/
|
|
75
|
+
config?: ChartConfig;
|
|
76
|
+
/** One entry per category, as raw observations or as a summary. */
|
|
77
|
+
data: BoxPlotDatum[];
|
|
78
|
+
/**
|
|
79
|
+
* What the chart shows, in a sentence a reader could act on. Required, and
|
|
80
|
+
* announced to a screen reader even when it is not printed.
|
|
81
|
+
*/
|
|
82
|
+
title: string;
|
|
83
|
+
/** Prints the title above the plot instead of hiding it from sight. */
|
|
84
|
+
showTitle?: boolean;
|
|
85
|
+
/** A line under the title — the unit, the window, the caveat. */
|
|
86
|
+
description?: ReactNode;
|
|
87
|
+
/** The composed parts — axes, grid, tooltip, and `<BoxPlot.Boxes>`. */
|
|
88
|
+
children: ReactNode;
|
|
89
|
+
/** Merged onto the figure, last, so a call site can size or space it. */
|
|
90
|
+
className?: string;
|
|
91
|
+
/** Escape hatch onto the raw Recharts chart element. */
|
|
92
|
+
chartProps?: ComponentProps<typeof BarChart>;
|
|
93
|
+
/**
|
|
94
|
+
* Which way the boxes run. Reach for `horizontal` when the category names
|
|
95
|
+
* are long enough to need rotating under a column.
|
|
96
|
+
*/
|
|
97
|
+
orientation?: BoxPlotOrientation;
|
|
98
|
+
/** Formats every number the chart prints — ticks, tooltip, table. */
|
|
99
|
+
formatValue?: (value: number) => string;
|
|
100
|
+
/** Drops the hidden table view. Only correct when the page prints the data itself. */
|
|
101
|
+
hideDataTable?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* What the chart shows when it has nothing to draw. `false` keeps the axes,
|
|
104
|
+
* for a chart whose emptiness is itself the reading.
|
|
105
|
+
*/
|
|
106
|
+
empty?: ChartEmptyProps | false;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The spread of a measurement, per category — median, middle half, reach, and
|
|
110
|
+
* the points that sit outside it.
|
|
111
|
+
*
|
|
112
|
+
* The form to reach for when the question is "how variable is this", and the
|
|
113
|
+
* one that answers it in a tenth of the ink a histogram per category would
|
|
114
|
+
* take. Six response-time distributions fit across one screen as six boxes;
|
|
115
|
+
* as six histograms they do not fit at all.
|
|
116
|
+
*
|
|
117
|
+
* **What a box plot hides is multimodality.** A box is five numbers, and five
|
|
118
|
+
* numbers cannot tell a single hump from two. A bimodal distribution — a fast
|
|
119
|
+
* cache path and a slow database path, two cohorts inside one average — draws
|
|
120
|
+
* exactly the same box as a smooth one centred in the same place, and the
|
|
121
|
+
* reader has no way to tell from the picture that the middle of the box is a
|
|
122
|
+
* value almost nothing takes. It also hides sample size: a box over six points
|
|
123
|
+
* and a box over six thousand are drawn identically, which is why `count` is
|
|
124
|
+
* worth carrying and why a notch, which does read `count`, is worth turning on
|
|
125
|
+
* when medians are being compared. When the SHAPE of one distribution is the
|
|
126
|
+
* question, reach for `<Histogram>`; when there are few enough observations to
|
|
127
|
+
* draw them all, reach for `<ScatterChart>` and plot the points.
|
|
128
|
+
*
|
|
129
|
+
* Recharts earns its place here: the boxes need a shared value axis with real
|
|
130
|
+
* ticks, a category axis, a grid and a tooltip, which is most of a cartesian
|
|
131
|
+
* chart. What it does not have is a box mark, so each box is drawn as a custom
|
|
132
|
+
* shape over a range bar — the bar supplies the category band and the scale,
|
|
133
|
+
* and the glyph inside it is ours.
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* <BoxPlot title="Response time by region" data={regions}>
|
|
137
|
+
* <BoxPlot.Grid />
|
|
138
|
+
* <BoxPlot.XAxis />
|
|
139
|
+
* <BoxPlot.YAxis label="ms" />
|
|
140
|
+
* <BoxPlot.Tooltip />
|
|
141
|
+
* <BoxPlot.Boxes showOutliers />
|
|
142
|
+
* </BoxPlot>
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* // Raw observations, summarised for you with Tukey's fences.
|
|
146
|
+
* const data = [{ name: 'Sydney', values: [180, 194, 210, 205, 640] }]
|
|
147
|
+
*/
|
|
148
|
+
declare function BoxPlot({ config, data, title, showTitle, description, children, className, chartProps, orientation, formatValue, hideDataTable, empty, }: BoxPlotProps): react.JSX.Element;
|
|
149
|
+
declare namespace BoxPlot {
|
|
150
|
+
var Boxes: ({ showOutliers, notch, barProps }: BoxPlotBoxesProps) => react.JSX.Element;
|
|
151
|
+
var XAxis: ({ dataKey, tickLine, axisLine, tickMargin, minTickGap, type, label, tickFormatter, domain, ...rest }: ChartXAxisProps) => react.JSX.Element;
|
|
152
|
+
var YAxis: ({ dataKey, tickLine, axisLine, tickMargin, minTickGap, width, type, label, tickFormatter, domain, ...rest }: ChartYAxisProps) => react.JSX.Element;
|
|
153
|
+
var Grid: ({ strokeDasharray, vertical, horizontal, ...rest }: ComponentProps<typeof CartesianGrid>) => react.JSX.Element;
|
|
154
|
+
var Tooltip: ({ variant, roundness, defaultIndex }: ChartTooltipSlotProps) => react.JSX.Element;
|
|
155
|
+
var Background: ({ variant }: {
|
|
156
|
+
variant: ChartBackgroundVariant;
|
|
157
|
+
}) => react.JSX.Element;
|
|
158
|
+
var ReferenceLine: typeof ReferenceLine;
|
|
159
|
+
var ReferenceBand: typeof ReferenceBand;
|
|
160
|
+
var Annotation: typeof Annotation;
|
|
161
|
+
}
|
|
162
|
+
interface BoxPlotBoxesProps {
|
|
163
|
+
/** Draws the points outside the fences as individual dots. */
|
|
164
|
+
showOutliers?: boolean;
|
|
165
|
+
/**
|
|
166
|
+
* Pinches the box in at the median by `1.58 × IQR / √n`.
|
|
167
|
+
*
|
|
168
|
+
* A confidence interval on the median drawn INSIDE the shape it belongs to,
|
|
169
|
+
* which is the only place a reader will actually look at it. Needs `count`
|
|
170
|
+
* on every box; a box without one is drawn square.
|
|
171
|
+
*/
|
|
172
|
+
notch?: boolean;
|
|
173
|
+
/** Escape hatch onto the range bar the boxes are drawn over. */
|
|
174
|
+
barProps?: ComponentProps<typeof Bar>;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export { BoxPlot, type BoxPlotBoxesProps, type BoxPlotDatum, type BoxPlotOrientation, type BoxPlotProps, type BoxPlotSample, type BoxPlotSummary, BoxPlot as default };
|