@misoto22/folio 0.0.0 → 0.16.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/WorkflowFigure.md +51 -0
- package/dist/agent/catalog.json +8006 -0
- package/dist/agent/index.md +182 -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 +193 -0
- package/dist/styles.css +98 -0
- package/dist/themes.css +514 -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 +652 -0
- package/dist/tokens.d.ts +198 -0
- package/dist/tokens.js +1020 -0
- package/dist/tokens.json +1019 -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/index.d.ts +27 -0
- package/dist/website/index.js +21 -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 +17 -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.css +25 -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 +133 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { AnchorHTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import { RemixiconComponentType } from '@remixicon/react';
|
|
4
|
+
|
|
5
|
+
interface NavItemProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'className' | 'children'> {
|
|
6
|
+
href: string;
|
|
7
|
+
/** Optional leading icon (a `@remixicon/react` component, rendered at 18px). */
|
|
8
|
+
icon?: RemixiconComponentType;
|
|
9
|
+
/** Marks the current route. Also sets `aria-current="page"`. */
|
|
10
|
+
active?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Hand the styling to a router's own `Link` instead of a native `<a>`.
|
|
13
|
+
*
|
|
14
|
+
* The slotted child receives the classes and `aria-current`, and becomes the
|
|
15
|
+
* row — so `icon` is not rendered in this mode; put it inside the child.
|
|
16
|
+
*/
|
|
17
|
+
asChild?: boolean;
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A row in a sidebar.
|
|
23
|
+
*
|
|
24
|
+
* `aria-current="page"` and not only a colour: the active row has to be
|
|
25
|
+
* identifiable to a reader who cannot see that it is darker. In this system it
|
|
26
|
+
* is also carried by weight and by a filled ground, so it survives monochrome
|
|
27
|
+
* printing and low contrast.
|
|
28
|
+
*
|
|
29
|
+
* Framework-agnostic. `asChild` is how a Next or React Router app gets
|
|
30
|
+
* client-side navigation without this package importing either.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* <NavItem href="/components/button" icon={Square} active>Button</NavItem>
|
|
34
|
+
* @example
|
|
35
|
+
* <NavItem asChild href="/work"><Link href="/work">Work</Link></NavItem>
|
|
36
|
+
*/
|
|
37
|
+
declare function NavItem({ href, icon: Icon, active, asChild, children, className, ...rest }: NavItemProps): react.JSX.Element;
|
|
38
|
+
|
|
39
|
+
export { NavItem, type NavItemProps, NavItem as default };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
3
|
+
import { cn } from "../../lib/cn.js";
|
|
4
|
+
function NavItem({
|
|
5
|
+
href,
|
|
6
|
+
icon: Icon,
|
|
7
|
+
active = false,
|
|
8
|
+
asChild = false,
|
|
9
|
+
children,
|
|
10
|
+
className,
|
|
11
|
+
...rest
|
|
12
|
+
}) {
|
|
13
|
+
const cls = cn(
|
|
14
|
+
"flex min-h-(--control-h-sm) items-center gap-2.5 rounded-(--radius-sm) px-2.5 py-1.5 text-sm transition-colors duration-(--duration-fast)",
|
|
15
|
+
active ? "bg-(--stone) font-medium text-(--ink)" : "text-(--ink-3-aa) hover:bg-(--stone) hover:text-(--ink)",
|
|
16
|
+
className
|
|
17
|
+
);
|
|
18
|
+
if (asChild) {
|
|
19
|
+
return /* @__PURE__ */ jsx(Slot, { "aria-current": active ? "page" : void 0, className: cls, ...rest, children });
|
|
20
|
+
}
|
|
21
|
+
return /* @__PURE__ */ jsxs("a", { href, "aria-current": active ? "page" : void 0, className: cls, ...rest, children: [
|
|
22
|
+
Icon && /* @__PURE__ */ jsx(Icon, { size: 18, "aria-hidden": true, className: "shrink-0" }),
|
|
23
|
+
children
|
|
24
|
+
] });
|
|
25
|
+
}
|
|
26
|
+
var NavItem_default = NavItem;
|
|
27
|
+
export {
|
|
28
|
+
NavItem,
|
|
29
|
+
NavItem_default as default
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=NavItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/NavItem/NavItem.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot'\nimport type { RemixiconComponentType } from '@remixicon/react'\nimport type { AnchorHTMLAttributes, ReactNode } from 'react'\nimport { cn } from '../../lib/cn'\n\nexport interface NavItemProps\n extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'className' | 'children'> {\n href: string\n /** Optional leading icon (a `@remixicon/react` component, rendered at 18px). */\n icon?: RemixiconComponentType\n /** Marks the current route. Also sets `aria-current=\"page\"`. */\n active?: boolean\n /**\n * Hand the styling to a router's own `Link` instead of a native `<a>`.\n *\n * The slotted child receives the classes and `aria-current`, and becomes the\n * row — so `icon` is not rendered in this mode; put it inside the child.\n */\n asChild?: boolean\n children: ReactNode\n className?: string\n}\n\n/**\n * A row in a sidebar.\n *\n * `aria-current=\"page\"` and not only a colour: the active row has to be\n * identifiable to a reader who cannot see that it is darker. In this system it\n * is also carried by weight and by a filled ground, so it survives monochrome\n * printing and low contrast.\n *\n * Framework-agnostic. `asChild` is how a Next or React Router app gets\n * client-side navigation without this package importing either.\n *\n * @example\n * <NavItem href=\"/components/button\" icon={Square} active>Button</NavItem>\n * @example\n * <NavItem asChild href=\"/work\"><Link href=\"/work\">Work</Link></NavItem>\n */\nexport function NavItem({\n href,\n icon: Icon,\n active = false,\n asChild = false,\n children,\n className,\n ...rest\n}: NavItemProps) {\n const cls = cn(\n 'flex min-h-(--control-h-sm) items-center gap-2.5 rounded-(--radius-sm) px-2.5 py-1.5 text-sm transition-colors duration-(--duration-fast)',\n active\n ? 'bg-(--stone) font-medium text-(--ink)'\n : 'text-(--ink-3-aa) hover:bg-(--stone) hover:text-(--ink)',\n className,\n )\n\n if (asChild) {\n // Slot demands exactly ONE child, and `{Icon && …}` is a second one the\n // moment `icon` is omitted — which is how a whole sidebar of slotted rows\n // failed to render at all. So a slotted row takes its icon inside the child\n // it was handed, and this branch passes `children` through untouched.\n return (\n <Slot aria-current={active ? 'page' : undefined} className={cls} {...rest}>\n {children}\n </Slot>\n )\n }\n\n return (\n <a href={href} aria-current={active ? 'page' : undefined} className={cls} {...rest}>\n {Icon && <Icon size={18} aria-hidden className=\"shrink-0\" />}\n {children}\n </a>\n )\n}\n\nexport default NavItem\n"],"mappings":"AA8DM,cAOF,YAPE;AA9DN,SAAS,YAAY;AAGrB,SAAS,UAAU;AAoCZ,SAAS,QAAQ;AAAA,EACtB;AAAA,EACA,MAAM;AAAA,EACN,SAAS;AAAA,EACT,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAiB;AACf,QAAM,MAAM;AAAA,IACV;AAAA,IACA,SACI,0CACA;AAAA,IACJ;AAAA,EACF;AAEA,MAAI,SAAS;AAKX,WACE,oBAAC,QAAK,gBAAc,SAAS,SAAS,QAAW,WAAW,KAAM,GAAG,MAClE,UACH;AAAA,EAEJ;AAEA,SACE,qBAAC,OAAE,MAAY,gBAAc,SAAS,SAAS,QAAW,WAAW,KAAM,GAAG,MAC3E;AAAA,YAAQ,oBAAC,QAAK,MAAM,IAAI,eAAW,MAAC,WAAU,YAAW;AAAA,IACzD;AAAA,KACH;AAEJ;AAEA,IAAO,kBAAQ;","names":[]}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { InputHTMLAttributes, Ref } from 'react';
|
|
3
|
+
|
|
4
|
+
interface NumberFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'defaultValue' | 'min' | 'max' | 'step' | 'type'> {
|
|
5
|
+
value?: number;
|
|
6
|
+
defaultValue?: number;
|
|
7
|
+
/** Fires with the parsed number. Raw `onChange` still fires with the event. */
|
|
8
|
+
onValueChange?: (value: number) => void;
|
|
9
|
+
min?: number;
|
|
10
|
+
max?: number;
|
|
11
|
+
/** The increment for the arrows and for one notch of a scrub. */
|
|
12
|
+
step?: number;
|
|
13
|
+
/**
|
|
14
|
+
* A unit drawn inside the end of the field — `%`, `px`, `ms`.
|
|
15
|
+
*
|
|
16
|
+
* The field reserves a fixed slot for it, so keep it to about four
|
|
17
|
+
* characters; a longer one runs under a long number. It is announced through
|
|
18
|
+
* `aria-describedby` as well as drawn, because a unit nobody hears turns
|
|
19
|
+
* "300" into a number with no dimension.
|
|
20
|
+
*/
|
|
21
|
+
unit?: string;
|
|
22
|
+
/**
|
|
23
|
+
* A grip at the start of the field that changes the value as it is dragged.
|
|
24
|
+
*
|
|
25
|
+
* On by default, and the reason to reach for this over `<Input type="number">`:
|
|
26
|
+
* a value that is being TUNED — a duration, a weight, an offset — is found by
|
|
27
|
+
* sweeping through neighbouring values, not by typing candidates one at a
|
|
28
|
+
* time. Shift multiplies the travel by ten.
|
|
29
|
+
*
|
|
30
|
+
* Pointer only, and `aria-hidden` for that reason: the same journey on a
|
|
31
|
+
* keyboard is the arrow keys on the field itself, which the platform already
|
|
32
|
+
* provides. Turn it off where the number is a quantity rather than a setting
|
|
33
|
+
* — a line item's quantity is chosen, not swept to.
|
|
34
|
+
*/
|
|
35
|
+
scrub?: boolean;
|
|
36
|
+
/** Paints the resting border with `--danger` and reflects `aria-invalid`. */
|
|
37
|
+
invalid?: boolean;
|
|
38
|
+
ref?: Ref<HTMLInputElement>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* A number, typed or swept to.
|
|
42
|
+
*
|
|
43
|
+
* `Input` with `type="number"` is a box that happens to reject letters. This is
|
|
44
|
+
* the control for a number that has a RANGE and a sensible increment: the
|
|
45
|
+
* arrows step it, the grip sweeps it, and `min`, `max` and `step` are honoured
|
|
46
|
+
* on the way out rather than merely announced.
|
|
47
|
+
*
|
|
48
|
+
* Reach for `Slider` instead when the position along the range is the
|
|
49
|
+
* information — a volume, a confidence, anything a reader judges by where the
|
|
50
|
+
* thumb sits. Reach for this when the digits are. A slider that also has to be
|
|
51
|
+
* exact is a `Slider` with `editable`, not one of these beside it.
|
|
52
|
+
*
|
|
53
|
+
* **Clamping happens when the field is left, not while it is being typed.** A
|
|
54
|
+
* minimum of 10 would otherwise make 50 unreachable: the `5` is clamped up to
|
|
55
|
+
* 10 before the `0` arrives. So `onValueChange` can report a number outside the
|
|
56
|
+
* range mid-keystroke, and the value that settles is always inside it.
|
|
57
|
+
*
|
|
58
|
+
* The native spinner buttons are hidden — they are three different controls in
|
|
59
|
+
* three browsers, and none of them is this system's. The grip replaces them for
|
|
60
|
+
* a pointer; the arrow keys were always the keyboard's answer.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* <Field label="Line height"><NumberField defaultValue={1.5} min={1} max={3} step={0.1} /></Field>
|
|
64
|
+
* @example
|
|
65
|
+
* <Field label="Timeout"><NumberField defaultValue={30} min={0} max={600} unit="s" /></Field>
|
|
66
|
+
*/
|
|
67
|
+
declare function NumberField({ value, defaultValue, onValueChange, min, max, step, unit, scrub, invalid, disabled, className, ref, onChange, onFocus, onBlur, onKeyDown, 'aria-describedby': describedBy, 'aria-invalid': ariaInvalid, ...rest }: NumberFieldProps): react.JSX.Element;
|
|
68
|
+
|
|
69
|
+
export { NumberField, type NumberFieldProps, NumberField as default };
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { RiArrowLeftRightLine } from "@remixicon/react";
|
|
4
|
+
import { useId, useRef, useState } from "react";
|
|
5
|
+
import { cn } from "../../lib/cn.js";
|
|
6
|
+
import { CONTROL_BASE, CONTROL_BORDER, isInvalid } from "../../lib/control.js";
|
|
7
|
+
import { clampToRange, parseNumber, snapToStep } from "../../lib/numeric.js";
|
|
8
|
+
const PX_PER_STEP = 4;
|
|
9
|
+
const COARSE = 10;
|
|
10
|
+
function NumberField({
|
|
11
|
+
value,
|
|
12
|
+
defaultValue,
|
|
13
|
+
onValueChange,
|
|
14
|
+
min = Number.NEGATIVE_INFINITY,
|
|
15
|
+
max = Number.POSITIVE_INFINITY,
|
|
16
|
+
step = 1,
|
|
17
|
+
unit,
|
|
18
|
+
scrub = true,
|
|
19
|
+
invalid,
|
|
20
|
+
disabled,
|
|
21
|
+
className,
|
|
22
|
+
ref,
|
|
23
|
+
onChange,
|
|
24
|
+
onFocus,
|
|
25
|
+
onBlur,
|
|
26
|
+
onKeyDown,
|
|
27
|
+
"aria-describedby": describedBy,
|
|
28
|
+
"aria-invalid": ariaInvalid,
|
|
29
|
+
...rest
|
|
30
|
+
}) {
|
|
31
|
+
const bad = isInvalid(invalid, ariaInvalid);
|
|
32
|
+
const unitId = useId();
|
|
33
|
+
const [uncontrolled, setUncontrolled] = useState(
|
|
34
|
+
defaultValue ?? (Number.isFinite(min) ? min : 0)
|
|
35
|
+
);
|
|
36
|
+
const current = value ?? uncontrolled;
|
|
37
|
+
const [draft, setDraft] = useState(null);
|
|
38
|
+
const draftRef = useRef(null);
|
|
39
|
+
const setDraftText = (text) => {
|
|
40
|
+
draftRef.current = text;
|
|
41
|
+
setDraft(text);
|
|
42
|
+
};
|
|
43
|
+
const emit = (next) => {
|
|
44
|
+
if (value === void 0) setUncontrolled(next);
|
|
45
|
+
onValueChange?.(next);
|
|
46
|
+
};
|
|
47
|
+
const settle = (next) => emit(clampToRange(snapToStep(next, step, Number.isFinite(min) ? min : 0), min, max));
|
|
48
|
+
const entry = useRef(current);
|
|
49
|
+
const drag = useRef(null);
|
|
50
|
+
const startScrub = (event) => {
|
|
51
|
+
if (event.button !== 0 || disabled) return;
|
|
52
|
+
event.preventDefault();
|
|
53
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
54
|
+
drag.current = {
|
|
55
|
+
pointerId: event.pointerId,
|
|
56
|
+
startX: event.clientX,
|
|
57
|
+
startValue: current,
|
|
58
|
+
// A scrub is spatial, so it follows the reading direction the way the
|
|
59
|
+
// slider's own track does: in an RTL page, more is to the left.
|
|
60
|
+
sign: getComputedStyle(event.currentTarget).direction === "rtl" ? -1 : 1
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
const moveScrub = (event) => {
|
|
64
|
+
const state = drag.current;
|
|
65
|
+
if (!state || state.pointerId !== event.pointerId) return;
|
|
66
|
+
const notches = Math.round((event.clientX - state.startX) / PX_PER_STEP) * state.sign;
|
|
67
|
+
settle(state.startValue + notches * step * (event.shiftKey ? COARSE : 1));
|
|
68
|
+
};
|
|
69
|
+
const endScrub = (event) => {
|
|
70
|
+
if (drag.current?.pointerId !== event.pointerId) return;
|
|
71
|
+
event.currentTarget.releasePointerCapture(event.pointerId);
|
|
72
|
+
drag.current = null;
|
|
73
|
+
};
|
|
74
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("relative w-full", disabled && "opacity-(--disabled-opacity)", className), children: [
|
|
75
|
+
/* @__PURE__ */ jsx(
|
|
76
|
+
"input",
|
|
77
|
+
{
|
|
78
|
+
ref,
|
|
79
|
+
type: "number",
|
|
80
|
+
inputMode: "decimal",
|
|
81
|
+
disabled,
|
|
82
|
+
value: draft ?? String(current),
|
|
83
|
+
min: Number.isFinite(min) ? min : void 0,
|
|
84
|
+
max: Number.isFinite(max) ? max : void 0,
|
|
85
|
+
step,
|
|
86
|
+
"aria-describedby": [describedBy, unit ? unitId : null].filter(Boolean).join(" ") || void 0,
|
|
87
|
+
"aria-invalid": ariaInvalid ?? (invalid ? true : void 0),
|
|
88
|
+
onFocus: (event) => {
|
|
89
|
+
entry.current = current;
|
|
90
|
+
onFocus?.(event);
|
|
91
|
+
},
|
|
92
|
+
onChange: (event) => {
|
|
93
|
+
setDraftText(event.target.value);
|
|
94
|
+
const parsed = parseNumber(event.target.value);
|
|
95
|
+
if (parsed !== null) emit(parsed);
|
|
96
|
+
onChange?.(event);
|
|
97
|
+
},
|
|
98
|
+
onBlur: (event) => {
|
|
99
|
+
const text = draftRef.current;
|
|
100
|
+
const parsed = text === null ? null : parseNumber(text);
|
|
101
|
+
if (parsed !== null) settle(parsed);
|
|
102
|
+
setDraftText(null);
|
|
103
|
+
onBlur?.(event);
|
|
104
|
+
},
|
|
105
|
+
onKeyDown: (event) => {
|
|
106
|
+
if (event.key === "Enter") {
|
|
107
|
+
const text = draftRef.current;
|
|
108
|
+
const parsed = text === null ? null : parseNumber(text);
|
|
109
|
+
if (parsed !== null) settle(parsed);
|
|
110
|
+
setDraftText(null);
|
|
111
|
+
}
|
|
112
|
+
if (event.key === "Escape") {
|
|
113
|
+
emit(entry.current);
|
|
114
|
+
setDraftText(null);
|
|
115
|
+
event.currentTarget.blur();
|
|
116
|
+
}
|
|
117
|
+
onKeyDown?.(event);
|
|
118
|
+
},
|
|
119
|
+
className: cn(
|
|
120
|
+
CONTROL_BASE,
|
|
121
|
+
bad ? CONTROL_BORDER.invalid : CONTROL_BORDER.resting,
|
|
122
|
+
"tabular-nums",
|
|
123
|
+
// Full literal strings: Tailwind only emits what it can read here.
|
|
124
|
+
scrub && "ps-9",
|
|
125
|
+
unit && "pe-12",
|
|
126
|
+
// Three browsers, three spinners, none of them this system's.
|
|
127
|
+
"[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"
|
|
128
|
+
),
|
|
129
|
+
...rest
|
|
130
|
+
}
|
|
131
|
+
),
|
|
132
|
+
scrub && /* @__PURE__ */ jsx(
|
|
133
|
+
"span",
|
|
134
|
+
{
|
|
135
|
+
"aria-hidden": "true",
|
|
136
|
+
onPointerDown: startScrub,
|
|
137
|
+
onPointerMove: moveScrub,
|
|
138
|
+
onPointerUp: endScrub,
|
|
139
|
+
onPointerCancel: endScrub,
|
|
140
|
+
className: cn(
|
|
141
|
+
"absolute inset-y-0 start-0 flex touch-none select-none items-center ps-2.5 text-(--ink-3-aa) transition-colors duration-(--duration-fast)",
|
|
142
|
+
disabled ? "pointer-events-none" : "cursor-ew-resize hover:text-(--ink)"
|
|
143
|
+
),
|
|
144
|
+
children: /* @__PURE__ */ jsx(RiArrowLeftRightLine, { className: "size-4", "aria-hidden": true })
|
|
145
|
+
}
|
|
146
|
+
),
|
|
147
|
+
unit && /* @__PURE__ */ jsx(
|
|
148
|
+
"span",
|
|
149
|
+
{
|
|
150
|
+
id: unitId,
|
|
151
|
+
className: "pointer-events-none absolute inset-y-0 end-0 flex items-center pe-3 text-sm text-(--ink-3-aa)",
|
|
152
|
+
children: unit
|
|
153
|
+
}
|
|
154
|
+
)
|
|
155
|
+
] });
|
|
156
|
+
}
|
|
157
|
+
var NumberField_default = NumberField;
|
|
158
|
+
export {
|
|
159
|
+
NumberField,
|
|
160
|
+
NumberField_default as default
|
|
161
|
+
};
|
|
162
|
+
//# sourceMappingURL=NumberField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/NumberField/NumberField.tsx"],"sourcesContent":["'use client'\n\nimport { RiArrowLeftRightLine } from '@remixicon/react'\nimport { useId, useRef, useState, type InputHTMLAttributes, type PointerEvent, type Ref } from 'react'\nimport { cn } from '../../lib/cn'\nimport { CONTROL_BASE, CONTROL_BORDER, isInvalid } from '../../lib/control'\nimport { clampToRange, parseNumber, snapToStep } from '../../lib/numeric'\n\n/**\n * Pixels of travel per step while scrubbing.\n *\n * Four is the number a pointer reads as \"one notch\". At one or two the value\n * runs away from the hand; past about eight the gesture stops feeling like it\n * is driving anything and a reader goes back to typing.\n */\nconst PX_PER_STEP = 4\n\n/** How much Shift multiplies a scrub by. Ten, as in every drawing tool. */\nconst COARSE = 10\n\nexport interface NumberFieldProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'defaultValue' | 'min' | 'max' | 'step' | 'type'> {\n value?: number\n defaultValue?: number\n /** Fires with the parsed number. Raw `onChange` still fires with the event. */\n onValueChange?: (value: number) => void\n min?: number\n max?: number\n /** The increment for the arrows and for one notch of a scrub. */\n step?: number\n /**\n * A unit drawn inside the end of the field — `%`, `px`, `ms`.\n *\n * The field reserves a fixed slot for it, so keep it to about four\n * characters; a longer one runs under a long number. It is announced through\n * `aria-describedby` as well as drawn, because a unit nobody hears turns\n * \"300\" into a number with no dimension.\n */\n unit?: string\n /**\n * A grip at the start of the field that changes the value as it is dragged.\n *\n * On by default, and the reason to reach for this over `<Input type=\"number\">`:\n * a value that is being TUNED — a duration, a weight, an offset — is found by\n * sweeping through neighbouring values, not by typing candidates one at a\n * time. Shift multiplies the travel by ten.\n *\n * Pointer only, and `aria-hidden` for that reason: the same journey on a\n * keyboard is the arrow keys on the field itself, which the platform already\n * provides. Turn it off where the number is a quantity rather than a setting\n * — a line item's quantity is chosen, not swept to.\n */\n scrub?: boolean\n /** Paints the resting border with `--danger` and reflects `aria-invalid`. */\n invalid?: boolean\n ref?: Ref<HTMLInputElement>\n}\n\n/**\n * A number, typed or swept to.\n *\n * `Input` with `type=\"number\"` is a box that happens to reject letters. This is\n * the control for a number that has a RANGE and a sensible increment: the\n * arrows step it, the grip sweeps it, and `min`, `max` and `step` are honoured\n * on the way out rather than merely announced.\n *\n * Reach for `Slider` instead when the position along the range is the\n * information — a volume, a confidence, anything a reader judges by where the\n * thumb sits. Reach for this when the digits are. A slider that also has to be\n * exact is a `Slider` with `editable`, not one of these beside it.\n *\n * **Clamping happens when the field is left, not while it is being typed.** A\n * minimum of 10 would otherwise make 50 unreachable: the `5` is clamped up to\n * 10 before the `0` arrives. So `onValueChange` can report a number outside the\n * range mid-keystroke, and the value that settles is always inside it.\n *\n * The native spinner buttons are hidden — they are three different controls in\n * three browsers, and none of them is this system's. The grip replaces them for\n * a pointer; the arrow keys were always the keyboard's answer.\n *\n * @example\n * <Field label=\"Line height\"><NumberField defaultValue={1.5} min={1} max={3} step={0.1} /></Field>\n * @example\n * <Field label=\"Timeout\"><NumberField defaultValue={30} min={0} max={600} unit=\"s\" /></Field>\n */\nexport function NumberField({\n value,\n defaultValue,\n onValueChange,\n min = Number.NEGATIVE_INFINITY,\n max = Number.POSITIVE_INFINITY,\n step = 1,\n unit,\n scrub = true,\n invalid,\n disabled,\n className,\n ref,\n onChange,\n onFocus,\n onBlur,\n onKeyDown,\n 'aria-describedby': describedBy,\n 'aria-invalid': ariaInvalid,\n ...rest\n}: NumberFieldProps) {\n const bad = isInvalid(invalid, ariaInvalid)\n const unitId = useId()\n\n const [uncontrolled, setUncontrolled] = useState<number>(\n defaultValue ?? (Number.isFinite(min) ? min : 0),\n )\n const current = value ?? uncontrolled\n\n // Non-null only while the box is being typed into. The field shows the draft\n // verbatim then, so a half-typed \"1.\" or \"-\" survives to the next keystroke\n // instead of being rewritten into a number the moment it parses.\n //\n // Mirrored into a ref because Escape has to clear it and then blur the field\n // in the SAME event: `setDraft(null)` has not been applied by the time the\n // blur handler runs, so a handler reading the state variable would still see\n // the abandoned text and commit it.\n const [draft, setDraft] = useState<string | null>(null)\n const draftRef = useRef<string | null>(null)\n const setDraftText = (text: string | null) => {\n draftRef.current = text\n setDraft(text)\n }\n\n const emit = (next: number) => {\n if (value === undefined) setUncontrolled(next)\n onValueChange?.(next)\n }\n\n /** Reconciles a number with the range and the step, then commits it. */\n const settle = (next: number) => emit(clampToRange(snapToStep(next, step, Number.isFinite(min) ? min : 0), min, max))\n\n // What the value was when the box gained focus, so Escape has something to\n // go back to: the raw emits above have already moved it by then.\n const entry = useRef(current)\n\n const drag = useRef<{ pointerId: number; startX: number; startValue: number; sign: 1 | -1 } | null>(null)\n\n const startScrub = (event: PointerEvent<HTMLSpanElement>) => {\n if (event.button !== 0 || disabled) return\n // Otherwise the gesture selects the text of the field it is dragging over.\n event.preventDefault()\n event.currentTarget.setPointerCapture(event.pointerId)\n drag.current = {\n pointerId: event.pointerId,\n startX: event.clientX,\n startValue: current,\n // A scrub is spatial, so it follows the reading direction the way the\n // slider's own track does: in an RTL page, more is to the left.\n sign: getComputedStyle(event.currentTarget).direction === 'rtl' ? -1 : 1,\n }\n }\n\n const moveScrub = (event: PointerEvent<HTMLSpanElement>) => {\n const state = drag.current\n if (!state || state.pointerId !== event.pointerId) return\n const notches = Math.round((event.clientX - state.startX) / PX_PER_STEP) * state.sign\n settle(state.startValue + notches * step * (event.shiftKey ? COARSE : 1))\n }\n\n const endScrub = (event: PointerEvent<HTMLSpanElement>) => {\n if (drag.current?.pointerId !== event.pointerId) return\n event.currentTarget.releasePointerCapture(event.pointerId)\n drag.current = null\n }\n\n return (\n <div className={cn('relative w-full', disabled && 'opacity-(--disabled-opacity)', className)}>\n <input\n ref={ref}\n type=\"number\"\n inputMode=\"decimal\"\n disabled={disabled}\n value={draft ?? String(current)}\n min={Number.isFinite(min) ? min : undefined}\n max={Number.isFinite(max) ? max : undefined}\n step={step}\n aria-describedby={[describedBy, unit ? unitId : null].filter(Boolean).join(' ') || undefined}\n aria-invalid={ariaInvalid ?? (invalid ? true : undefined)}\n onFocus={(event) => {\n entry.current = current\n onFocus?.(event)\n }}\n onChange={(event) => {\n setDraftText(event.target.value)\n // The raw number, unclamped — see the note on the component.\n const parsed = parseNumber(event.target.value)\n if (parsed !== null) emit(parsed)\n onChange?.(event)\n }}\n onBlur={(event) => {\n const text = draftRef.current\n const parsed = text === null ? null : parseNumber(text)\n if (parsed !== null) settle(parsed)\n setDraftText(null)\n onBlur?.(event)\n }}\n onKeyDown={(event) => {\n if (event.key === 'Enter') {\n const text = draftRef.current\n const parsed = text === null ? null : parseNumber(text)\n if (parsed !== null) settle(parsed)\n setDraftText(null)\n }\n if (event.key === 'Escape') {\n emit(entry.current)\n setDraftText(null)\n event.currentTarget.blur()\n }\n onKeyDown?.(event)\n }}\n className={cn(\n CONTROL_BASE,\n bad ? CONTROL_BORDER.invalid : CONTROL_BORDER.resting,\n 'tabular-nums',\n // Full literal strings: Tailwind only emits what it can read here.\n scrub && 'ps-9',\n unit && 'pe-12',\n // Three browsers, three spinners, none of them this system's.\n '[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none',\n )}\n {...rest}\n />\n {scrub && (\n <span\n // Not a button: it commits nothing, has no keyboard journey of its\n // own, and announcing it would give a reader a control that does\n // nothing when they press it. The arrow keys on the field are the\n // keyboard's path to the same values.\n aria-hidden=\"true\"\n onPointerDown={startScrub}\n onPointerMove={moveScrub}\n onPointerUp={endScrub}\n onPointerCancel={endScrub}\n className={cn(\n 'absolute inset-y-0 start-0 flex touch-none select-none items-center ps-2.5 text-(--ink-3-aa) transition-colors duration-(--duration-fast)',\n disabled ? 'pointer-events-none' : 'cursor-ew-resize hover:text-(--ink)',\n )}\n >\n <RiArrowLeftRightLine className=\"size-4\" aria-hidden />\n </span>\n )}\n {unit && (\n <span\n id={unitId}\n className=\"pointer-events-none absolute inset-y-0 end-0 flex items-center pe-3 text-sm text-(--ink-3-aa)\"\n >\n {unit}\n </span>\n )}\n </div>\n )\n}\n\nexport default NumberField\n"],"mappings":";AA4KI,SACE,KADF;AA1KJ,SAAS,4BAA4B;AACrC,SAAS,OAAO,QAAQ,gBAAuE;AAC/F,SAAS,UAAU;AACnB,SAAS,cAAc,gBAAgB,iBAAiB;AACxD,SAAS,cAAc,aAAa,kBAAkB;AAStD,MAAM,cAAc;AAGpB,MAAM,SAAS;AAmER,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA,MAAM,OAAO;AAAA,EACb,MAAM,OAAO;AAAA,EACb,OAAO;AAAA,EACP;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,oBAAoB;AAAA,EACpB,gBAAgB;AAAA,EAChB,GAAG;AACL,GAAqB;AACnB,QAAM,MAAM,UAAU,SAAS,WAAW;AAC1C,QAAM,SAAS,MAAM;AAErB,QAAM,CAAC,cAAc,eAAe,IAAI;AAAA,IACtC,iBAAiB,OAAO,SAAS,GAAG,IAAI,MAAM;AAAA,EAChD;AACA,QAAM,UAAU,SAAS;AAUzB,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAwB,IAAI;AACtD,QAAM,WAAW,OAAsB,IAAI;AAC3C,QAAM,eAAe,CAAC,SAAwB;AAC5C,aAAS,UAAU;AACnB,aAAS,IAAI;AAAA,EACf;AAEA,QAAM,OAAO,CAAC,SAAiB;AAC7B,QAAI,UAAU,OAAW,iBAAgB,IAAI;AAC7C,oBAAgB,IAAI;AAAA,EACtB;AAGA,QAAM,SAAS,CAAC,SAAiB,KAAK,aAAa,WAAW,MAAM,MAAM,OAAO,SAAS,GAAG,IAAI,MAAM,CAAC,GAAG,KAAK,GAAG,CAAC;AAIpH,QAAM,QAAQ,OAAO,OAAO;AAE5B,QAAM,OAAO,OAAuF,IAAI;AAExG,QAAM,aAAa,CAAC,UAAyC;AAC3D,QAAI,MAAM,WAAW,KAAK,SAAU;AAEpC,UAAM,eAAe;AACrB,UAAM,cAAc,kBAAkB,MAAM,SAAS;AACrD,SAAK,UAAU;AAAA,MACb,WAAW,MAAM;AAAA,MACjB,QAAQ,MAAM;AAAA,MACd,YAAY;AAAA;AAAA;AAAA,MAGZ,MAAM,iBAAiB,MAAM,aAAa,EAAE,cAAc,QAAQ,KAAK;AAAA,IACzE;AAAA,EACF;AAEA,QAAM,YAAY,CAAC,UAAyC;AAC1D,UAAM,QAAQ,KAAK;AACnB,QAAI,CAAC,SAAS,MAAM,cAAc,MAAM,UAAW;AACnD,UAAM,UAAU,KAAK,OAAO,MAAM,UAAU,MAAM,UAAU,WAAW,IAAI,MAAM;AACjF,WAAO,MAAM,aAAa,UAAU,QAAQ,MAAM,WAAW,SAAS,EAAE;AAAA,EAC1E;AAEA,QAAM,WAAW,CAAC,UAAyC;AACzD,QAAI,KAAK,SAAS,cAAc,MAAM,UAAW;AACjD,UAAM,cAAc,sBAAsB,MAAM,SAAS;AACzD,SAAK,UAAU;AAAA,EACjB;AAEA,SACE,qBAAC,SAAI,WAAW,GAAG,mBAAmB,YAAY,gCAAgC,SAAS,GACzF;AAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,MAAK;AAAA,QACL,WAAU;AAAA,QACV;AAAA,QACA,OAAO,SAAS,OAAO,OAAO;AAAA,QAC9B,KAAK,OAAO,SAAS,GAAG,IAAI,MAAM;AAAA,QAClC,KAAK,OAAO,SAAS,GAAG,IAAI,MAAM;AAAA,QAClC;AAAA,QACA,oBAAkB,CAAC,aAAa,OAAO,SAAS,IAAI,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,KAAK;AAAA,QACnF,gBAAc,gBAAgB,UAAU,OAAO;AAAA,QAC/C,SAAS,CAAC,UAAU;AAClB,gBAAM,UAAU;AAChB,oBAAU,KAAK;AAAA,QACjB;AAAA,QACA,UAAU,CAAC,UAAU;AACnB,uBAAa,MAAM,OAAO,KAAK;AAE/B,gBAAM,SAAS,YAAY,MAAM,OAAO,KAAK;AAC7C,cAAI,WAAW,KAAM,MAAK,MAAM;AAChC,qBAAW,KAAK;AAAA,QAClB;AAAA,QACA,QAAQ,CAAC,UAAU;AACjB,gBAAM,OAAO,SAAS;AACtB,gBAAM,SAAS,SAAS,OAAO,OAAO,YAAY,IAAI;AACtD,cAAI,WAAW,KAAM,QAAO,MAAM;AAClC,uBAAa,IAAI;AACjB,mBAAS,KAAK;AAAA,QAChB;AAAA,QACA,WAAW,CAAC,UAAU;AACpB,cAAI,MAAM,QAAQ,SAAS;AACzB,kBAAM,OAAO,SAAS;AACtB,kBAAM,SAAS,SAAS,OAAO,OAAO,YAAY,IAAI;AACtD,gBAAI,WAAW,KAAM,QAAO,MAAM;AAClC,yBAAa,IAAI;AAAA,UACnB;AACA,cAAI,MAAM,QAAQ,UAAU;AAC1B,iBAAK,MAAM,OAAO;AAClB,yBAAa,IAAI;AACjB,kBAAM,cAAc,KAAK;AAAA,UAC3B;AACA,sBAAY,KAAK;AAAA,QACnB;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA,MAAM,eAAe,UAAU,eAAe;AAAA,UAC9C;AAAA;AAAA,UAEA,SAAS;AAAA,UACT,QAAQ;AAAA;AAAA,UAER;AAAA,QACF;AAAA,QACC,GAAG;AAAA;AAAA,IACN;AAAA,IACC,SACC;AAAA,MAAC;AAAA;AAAA,QAKC,eAAY;AAAA,QACZ,eAAe;AAAA,QACf,eAAe;AAAA,QACf,aAAa;AAAA,QACb,iBAAiB;AAAA,QACjB,WAAW;AAAA,UACT;AAAA,UACA,WAAW,wBAAwB;AAAA,QACrC;AAAA,QAEA,8BAAC,wBAAqB,WAAU,UAAS,eAAW,MAAC;AAAA;AAAA,IACvD;AAAA,IAED,QACC;AAAA,MAAC;AAAA;AAAA,QACC,IAAI;AAAA,QACJ,WAAU;AAAA,QAET;AAAA;AAAA,IACH;AAAA,KAEJ;AAEJ;AAEA,IAAO,sBAAQ;","names":[]}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import { HeadingLevel } from '../Heading/Heading.js';
|
|
4
|
+
|
|
5
|
+
interface PageHeaderProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
|
|
6
|
+
/** What this page is. One line, and the only thing at this weight. */
|
|
7
|
+
title: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* The kicker above the title.
|
|
10
|
+
*
|
|
11
|
+
* A wayfinding aid rather than decoration: in a console whose pages are
|
|
12
|
+
* referred to by a numeral, this is that numeral, and elsewhere it is the
|
|
13
|
+
* section the page belongs to.
|
|
14
|
+
*/
|
|
15
|
+
eyebrow?: ReactNode;
|
|
16
|
+
/** One sentence saying what the page is for. Never a second finding. */
|
|
17
|
+
description?: ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* The trail above the opening, for a shell that does not already pin one.
|
|
20
|
+
*
|
|
21
|
+
* A page rendered inside an application frame usually leaves this off — two
|
|
22
|
+
* trails on one screen are two answers to "where am I". Takes the rendered
|
|
23
|
+
* `Breadcrumb` rather than its items, so the crumbs stay the caller's to
|
|
24
|
+
* wire to a router.
|
|
25
|
+
*/
|
|
26
|
+
breadcrumb?: ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* Controls that qualify what the page IS, set inside the opening rather than
|
|
29
|
+
* above the content.
|
|
30
|
+
*
|
|
31
|
+
* The distinction is worth holding: a range picker does not act on the
|
|
32
|
+
* records, it says which slice of them the title refers to. Below the rule it
|
|
33
|
+
* becomes a toolbar competing with whatever strip follows; beside the title
|
|
34
|
+
* it reads as part of the heading, which is what it is.
|
|
35
|
+
*/
|
|
36
|
+
actions?: ReactNode;
|
|
37
|
+
/**
|
|
38
|
+
* The heading level `title` opens, in the document the opening lands in.
|
|
39
|
+
*
|
|
40
|
+
* Defaults to `1`, which is what a page opening IS: a page has one name, and
|
|
41
|
+
* a shell that owns the document's heading has taken the page's own name away
|
|
42
|
+
* from it. Move it only where the opening is not the document's — a preview
|
|
43
|
+
* canvas, a template shown inside a documentation page, a composition
|
|
44
|
+
* embedded under a host's own `h1`.
|
|
45
|
+
*
|
|
46
|
+
* The size does not follow the level. `title` renders at `--fs-heading` at
|
|
47
|
+
* every level, because moving an opening down the outline is a fact about the
|
|
48
|
+
* document and not a request for smaller type.
|
|
49
|
+
*/
|
|
50
|
+
level?: HeadingLevel;
|
|
51
|
+
className?: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* A page opening: what this page is, and what qualifies it.
|
|
55
|
+
*
|
|
56
|
+
* The system has `Heading` for a heading and `Breadcrumb` for a trail, and
|
|
57
|
+
* nothing that said how a page STARTS — so every application invented the
|
|
58
|
+
* arrangement, and the eyebrow landed above the title on one screen and below
|
|
59
|
+
* it on the next. This fixes the order, the rule under it, and where the
|
|
60
|
+
* controls sit.
|
|
61
|
+
*
|
|
62
|
+
* Distinct from `AppShell`, which is the frame around a page rather than the
|
|
63
|
+
* top of one: a shell holds the rail and the bar for every route, and this is
|
|
64
|
+
* the first thing inside the route's own column.
|
|
65
|
+
*
|
|
66
|
+
* The title renders as an `h1` unless `level` says otherwise, and it is worth
|
|
67
|
+
* saying why the default is the whole answer nearly always: a page has one name,
|
|
68
|
+
* and a shell that owns the document's heading has taken the page's own name
|
|
69
|
+
* away from it. A second opening on one screen is two pages.
|
|
70
|
+
*
|
|
71
|
+
* The SIZE is not a prop at all. `Heading` at level 1 defaults to `--fs-title`,
|
|
72
|
+
* which is the editorial step for a document whose subject IS its title; a page
|
|
73
|
+
* opening stands over a working screen, where the title is the label for what
|
|
74
|
+
* follows and the records under it are what the reader came for. `--fs-heading`
|
|
75
|
+
* is that step at every level, and `Heading` is what draws it, so the ladder
|
|
76
|
+
* stays one ladder and moving an opening down the outline never resizes it.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* <PageHeader eyebrow="04" title="Money" description="Balances and flows." />
|
|
80
|
+
* @example
|
|
81
|
+
* <PageHeader
|
|
82
|
+
* title="Jobs"
|
|
83
|
+
* breadcrumb={<Breadcrumb items={crumbs} />}
|
|
84
|
+
* actions={<Button size="sm">Run now</Button>}
|
|
85
|
+
* />
|
|
86
|
+
* @example
|
|
87
|
+
* // Inside a page that already has its own h1 — a preview, a template.
|
|
88
|
+
* <PageHeader level={2} title="Money" />
|
|
89
|
+
*/
|
|
90
|
+
declare function PageHeader({ title, eyebrow, description, breadcrumb, actions, level, className, ...rest }: PageHeaderProps): react.JSX.Element;
|
|
91
|
+
|
|
92
|
+
export { PageHeader, type PageHeaderProps, PageHeader as default };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Heading } from "../Heading/Heading.js";
|
|
3
|
+
import { cn } from "../../lib/cn.js";
|
|
4
|
+
const CLASS = {
|
|
5
|
+
header: "flex flex-col gap-1 border-b border-(--rule) pb-6",
|
|
6
|
+
trail: "mb-2",
|
|
7
|
+
eyebrow: "m-0 eyebrow text-(--ink-3-aa)",
|
|
8
|
+
row: "flex flex-wrap items-baseline justify-between gap-3",
|
|
9
|
+
actions: "flex shrink-0 items-center gap-2",
|
|
10
|
+
description: "m-0 max-w-(--measure-record) text-(--ink-2)"
|
|
11
|
+
};
|
|
12
|
+
function PageHeader({
|
|
13
|
+
title,
|
|
14
|
+
eyebrow,
|
|
15
|
+
description,
|
|
16
|
+
breadcrumb,
|
|
17
|
+
actions,
|
|
18
|
+
level = 1,
|
|
19
|
+
className,
|
|
20
|
+
...rest
|
|
21
|
+
}) {
|
|
22
|
+
return /* @__PURE__ */ jsxs("header", { className: cn(CLASS.header, className), ...rest, children: [
|
|
23
|
+
breadcrumb !== void 0 && /* @__PURE__ */ jsx("div", { className: CLASS.trail, children: breadcrumb }),
|
|
24
|
+
eyebrow !== void 0 && /* @__PURE__ */ jsx("p", { className: CLASS.eyebrow, children: eyebrow }),
|
|
25
|
+
/* @__PURE__ */ jsxs("div", { className: CLASS.row, children: [
|
|
26
|
+
/* @__PURE__ */ jsx(Heading, { level, size: "heading", children: title }),
|
|
27
|
+
actions !== void 0 && /* @__PURE__ */ jsx("div", { className: CLASS.actions, children: actions })
|
|
28
|
+
] }),
|
|
29
|
+
description !== void 0 && /* @__PURE__ */ jsx("p", { className: CLASS.description, children: description })
|
|
30
|
+
] });
|
|
31
|
+
}
|
|
32
|
+
var PageHeader_default = PageHeader;
|
|
33
|
+
export {
|
|
34
|
+
PageHeader,
|
|
35
|
+
PageHeader_default as default
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=PageHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/PageHeader/PageHeader.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from 'react'\nimport { Heading, type HeadingLevel } from '../Heading/Heading'\nimport { cn } from '../../lib/cn'\n\n/**\n * The parts, named. One place to read what a page opening is made of, and the\n * reason a caller never needs a class of their own to adjust one.\n */\nconst CLASS = {\n header: 'flex flex-col gap-1 border-b border-(--rule) pb-6',\n trail: 'mb-2',\n eyebrow: 'm-0 eyebrow text-(--ink-3-aa)',\n row: 'flex flex-wrap items-baseline justify-between gap-3',\n actions: 'flex shrink-0 items-center gap-2',\n description: 'm-0 max-w-(--measure-record) text-(--ink-2)',\n} as const\n\nexport interface PageHeaderProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {\n /** What this page is. One line, and the only thing at this weight. */\n title: ReactNode\n /**\n * The kicker above the title.\n *\n * A wayfinding aid rather than decoration: in a console whose pages are\n * referred to by a numeral, this is that numeral, and elsewhere it is the\n * section the page belongs to.\n */\n eyebrow?: ReactNode\n /** One sentence saying what the page is for. Never a second finding. */\n description?: ReactNode\n /**\n * The trail above the opening, for a shell that does not already pin one.\n *\n * A page rendered inside an application frame usually leaves this off — two\n * trails on one screen are two answers to \"where am I\". Takes the rendered\n * `Breadcrumb` rather than its items, so the crumbs stay the caller's to\n * wire to a router.\n */\n breadcrumb?: ReactNode\n /**\n * Controls that qualify what the page IS, set inside the opening rather than\n * above the content.\n *\n * The distinction is worth holding: a range picker does not act on the\n * records, it says which slice of them the title refers to. Below the rule it\n * becomes a toolbar competing with whatever strip follows; beside the title\n * it reads as part of the heading, which is what it is.\n */\n actions?: ReactNode\n /**\n * The heading level `title` opens, in the document the opening lands in.\n *\n * Defaults to `1`, which is what a page opening IS: a page has one name, and\n * a shell that owns the document's heading has taken the page's own name away\n * from it. Move it only where the opening is not the document's — a preview\n * canvas, a template shown inside a documentation page, a composition\n * embedded under a host's own `h1`.\n *\n * The size does not follow the level. `title` renders at `--fs-heading` at\n * every level, because moving an opening down the outline is a fact about the\n * document and not a request for smaller type.\n */\n level?: HeadingLevel\n className?: string\n}\n\n/**\n * A page opening: what this page is, and what qualifies it.\n *\n * The system has `Heading` for a heading and `Breadcrumb` for a trail, and\n * nothing that said how a page STARTS — so every application invented the\n * arrangement, and the eyebrow landed above the title on one screen and below\n * it on the next. This fixes the order, the rule under it, and where the\n * controls sit.\n *\n * Distinct from `AppShell`, which is the frame around a page rather than the\n * top of one: a shell holds the rail and the bar for every route, and this is\n * the first thing inside the route's own column.\n *\n * The title renders as an `h1` unless `level` says otherwise, and it is worth\n * saying why the default is the whole answer nearly always: a page has one name,\n * and a shell that owns the document's heading has taken the page's own name\n * away from it. A second opening on one screen is two pages.\n *\n * The SIZE is not a prop at all. `Heading` at level 1 defaults to `--fs-title`,\n * which is the editorial step for a document whose subject IS its title; a page\n * opening stands over a working screen, where the title is the label for what\n * follows and the records under it are what the reader came for. `--fs-heading`\n * is that step at every level, and `Heading` is what draws it, so the ladder\n * stays one ladder and moving an opening down the outline never resizes it.\n *\n * @example\n * <PageHeader eyebrow=\"04\" title=\"Money\" description=\"Balances and flows.\" />\n * @example\n * <PageHeader\n * title=\"Jobs\"\n * breadcrumb={<Breadcrumb items={crumbs} />}\n * actions={<Button size=\"sm\">Run now</Button>}\n * />\n * @example\n * // Inside a page that already has its own h1 — a preview, a template.\n * <PageHeader level={2} title=\"Money\" />\n */\nexport function PageHeader({\n title,\n eyebrow,\n description,\n breadcrumb,\n actions,\n level = 1,\n className,\n ...rest\n}: PageHeaderProps) {\n return (\n <header className={cn(CLASS.header, className)} {...rest}>\n {breadcrumb !== undefined && <div className={CLASS.trail}>{breadcrumb}</div>}\n {eyebrow !== undefined && <p className={CLASS.eyebrow}>{eyebrow}</p>}\n <div className={CLASS.row}>\n <Heading level={level} size=\"heading\">\n {title}\n </Heading>\n {actions !== undefined && <div className={CLASS.actions}>{actions}</div>}\n </div>\n {description !== undefined && <p className={CLASS.description}>{description}</p>}\n </header>\n )\n}\n\nexport default PageHeader\n"],"mappings":"AAmHmC,cAE7B,YAF6B;AAlHnC,SAAS,eAAkC;AAC3C,SAAS,UAAU;AAMnB,MAAM,QAAQ;AAAA,EACZ,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,SAAS;AAAA,EACT,KAAK;AAAA,EACL,SAAS;AAAA,EACT,aAAa;AACf;AAwFO,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA,GAAG;AACL,GAAoB;AAClB,SACE,qBAAC,YAAO,WAAW,GAAG,MAAM,QAAQ,SAAS,GAAI,GAAG,MACjD;AAAA,mBAAe,UAAa,oBAAC,SAAI,WAAW,MAAM,OAAQ,sBAAW;AAAA,IACrE,YAAY,UAAa,oBAAC,OAAE,WAAW,MAAM,SAAU,mBAAQ;AAAA,IAChE,qBAAC,SAAI,WAAW,MAAM,KACpB;AAAA,0BAAC,WAAQ,OAAc,MAAK,WACzB,iBACH;AAAA,MACC,YAAY,UAAa,oBAAC,SAAI,WAAW,MAAM,SAAU,mBAAQ;AAAA,OACpE;AAAA,IACC,gBAAgB,UAAa,oBAAC,OAAE,WAAW,MAAM,aAAc,uBAAY;AAAA,KAC9E;AAEJ;AAEA,IAAO,qBAAQ;","names":[]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, 'onChange'> {
|
|
5
|
+
/** 1-based. */
|
|
6
|
+
page: number;
|
|
7
|
+
/** Total pages. A value of 1 or less renders nothing. */
|
|
8
|
+
pageCount: number;
|
|
9
|
+
onPageChange: (page: number) => void;
|
|
10
|
+
/** How many numbered pages sit either side of the current one. */
|
|
11
|
+
siblings?: number;
|
|
12
|
+
label?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Names the two step controls.
|
|
15
|
+
*
|
|
16
|
+
* Each is a chevron and nothing else, so these strings are its entire
|
|
17
|
+
* accessible name — the same reason `AppShell` exposes `openLabel` and
|
|
18
|
+
* `closeLabel` rather than baking them in.
|
|
19
|
+
*/
|
|
20
|
+
previousLabel?: string;
|
|
21
|
+
nextLabel?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Names one numbered page.
|
|
24
|
+
*
|
|
25
|
+
* A function rather than a template, because the number does not sit in the
|
|
26
|
+
* same place in every language and neither does the noun around it —
|
|
27
|
+
* `"Page 3"`, `"第 3 页"`, `"Seite 3"`. The visible digit is the same either
|
|
28
|
+
* way; this is what a screen reader hears instead of a bare number.
|
|
29
|
+
*/
|
|
30
|
+
pageLabel?: (page: number) => string;
|
|
31
|
+
}
|
|
32
|
+
declare const GAP: "\u2026";
|
|
33
|
+
/**
|
|
34
|
+
* Builds the visible page list: always the first and last page, a window around
|
|
35
|
+
* the current one, and an ellipsis wherever the sequence skips.
|
|
36
|
+
*
|
|
37
|
+
* Returned as numbers and a literal ellipsis rather than as pre-rendered nodes,
|
|
38
|
+
* so the shape is testable without a DOM — the off-by-one at the window edges
|
|
39
|
+
* is the whole difficulty of this component.
|
|
40
|
+
*/
|
|
41
|
+
declare function paginationRange(page: number, pageCount: number, siblings?: number): (number | typeof GAP)[];
|
|
42
|
+
/**
|
|
43
|
+
* Numbered pagination.
|
|
44
|
+
*
|
|
45
|
+
* The current page is marked by one filled pill that TRAVELS between the
|
|
46
|
+
* numbers rather than by a background switching off on one and on on another.
|
|
47
|
+
* Two backgrounds cross-fading reads as two things changing; a shape moving
|
|
48
|
+
* reads as the one thing that actually did.
|
|
49
|
+
*
|
|
50
|
+
* A `<nav>` wrapping a list, and the current page is a `<button aria-current>`
|
|
51
|
+
* rather than a styled `<span>` — a reader jumping by landmark needs to find
|
|
52
|
+
* the control, and a reader on the current page needs to be told they are
|
|
53
|
+
* already there.
|
|
54
|
+
*
|
|
55
|
+
* Renders nothing at one page or fewer. A pager for a single page is furniture.
|
|
56
|
+
*
|
|
57
|
+
* Every string a reader hears is a prop. The chevrons carry no text, so
|
|
58
|
+
* `previousLabel` and `nextLabel` are the whole of those two controls' names,
|
|
59
|
+
* and `pageLabel` is a function because "Page 3" is a phrase whose parts move
|
|
60
|
+
* around between languages.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* <Pagination page={page} pageCount={12} onPageChange={setPage} />
|
|
64
|
+
*/
|
|
65
|
+
declare function Pagination({ page, pageCount, onPageChange, siblings, label, previousLabel, nextLabel, pageLabel, className, ...rest }: PaginationProps): react.JSX.Element | null;
|
|
66
|
+
|
|
67
|
+
export { Pagination, type PaginationProps, Pagination as default, paginationRange };
|