@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,29 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface FloatingIconButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
|
|
5
|
+
/**
|
|
6
|
+
* Which bottom corner the control is pinned to, in READING order —
|
|
7
|
+
* `end` is the right in English and the left in Arabic. Naming the sides
|
|
8
|
+
* `left`/`right` would have hard-coded one script's layout into the API.
|
|
9
|
+
*/
|
|
10
|
+
position: 'start' | 'end';
|
|
11
|
+
/** Accessible name — the button has no visible text, so this is its only name. */
|
|
12
|
+
label: string;
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A round action pinned to a screen corner.
|
|
17
|
+
*
|
|
18
|
+
* A translucent paper ground with a backdrop blur rather than a drop shadow —
|
|
19
|
+
* the White Reset has no elevation ramp, so what separates the control from
|
|
20
|
+
* the page under it is the blur and the hairline, not a glow.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* <FloatingIconButton position="right" label="Back to top" onClick={scrollUp}>
|
|
24
|
+
* <ArrowUp size={16} />
|
|
25
|
+
* </FloatingIconButton>
|
|
26
|
+
*/
|
|
27
|
+
declare function FloatingIconButton({ position, label, children, className, ...rest }: FloatingIconButtonProps): react.JSX.Element;
|
|
28
|
+
|
|
29
|
+
export { FloatingIconButton, type FloatingIconButtonProps, FloatingIconButton as default };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../../lib/cn.js";
|
|
4
|
+
import { warnBlankName } from "../../lib/warn.js";
|
|
5
|
+
const POSITION_CLASS = { start: "bottom-20 start-6", end: "bottom-6 end-6" };
|
|
6
|
+
function FloatingIconButton({
|
|
7
|
+
position,
|
|
8
|
+
label,
|
|
9
|
+
children,
|
|
10
|
+
className,
|
|
11
|
+
...rest
|
|
12
|
+
}) {
|
|
13
|
+
warnBlankName("FloatingIconButton", "label", label, 'the button is announced as "button" and nothing else');
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
15
|
+
"button",
|
|
16
|
+
{
|
|
17
|
+
type: "button",
|
|
18
|
+
"aria-label": label,
|
|
19
|
+
className: cn(
|
|
20
|
+
"fixed z-(--z-drawer) flex size-(--control-h-md) items-center justify-center rounded-(--radius-pill) border border-(--rule-2) bg-(--paper)/90 text-(--ink-2) backdrop-blur-sm transition-colors duration-(--duration-fast) hover:border-(--ink) hover:text-(--ink)",
|
|
21
|
+
POSITION_CLASS[position],
|
|
22
|
+
className
|
|
23
|
+
),
|
|
24
|
+
...rest,
|
|
25
|
+
children
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
var FloatingIconButton_default = FloatingIconButton;
|
|
30
|
+
export {
|
|
31
|
+
FloatingIconButton,
|
|
32
|
+
FloatingIconButton_default as default
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=FloatingIconButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/FloatingIconButton/FloatingIconButton.tsx"],"sourcesContent":["'use client'\n\nimport type { ButtonHTMLAttributes, ReactNode } from 'react'\nimport { cn } from '../../lib/cn'\nimport { warnBlankName } from '../../lib/warn'\n\nexport interface FloatingIconButtonProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {\n /**\n * Which bottom corner the control is pinned to, in READING order —\n * `end` is the right in English and the left in Arabic. Naming the sides\n * `left`/`right` would have hard-coded one script's layout into the API.\n */\n position: 'start' | 'end'\n /** Accessible name — the button has no visible text, so this is its only name. */\n label: string\n children: ReactNode\n}\n\n/**\n * Full literal class strings per corner. Tailwind only generates classes it can\n * see verbatim in the source, so the side is never interpolated into a string.\n *\n * The start corner sits higher: browser and OS chrome (a download shelf, a\n * status toast) commonly occupies the corner where reading begins, and the\n * global scroll action keeps the far one.\n */\nconst POSITION_CLASS = { start: 'bottom-20 start-6', end: 'bottom-6 end-6' } as const\n\n/**\n * A round action pinned to a screen corner.\n *\n * A translucent paper ground with a backdrop blur rather than a drop shadow —\n * the White Reset has no elevation ramp, so what separates the control from\n * the page under it is the blur and the hairline, not a glow.\n *\n * @example\n * <FloatingIconButton position=\"right\" label=\"Back to top\" onClick={scrollUp}>\n * <ArrowUp size={16} />\n * </FloatingIconButton>\n */\nexport function FloatingIconButton({\n position,\n label,\n children,\n className,\n ...rest\n}: FloatingIconButtonProps) {\n warnBlankName('FloatingIconButton', 'label', label, 'the button is announced as \"button\" and nothing else')\n return (\n <button\n type=\"button\"\n aria-label={label}\n className={cn(\n 'fixed z-(--z-drawer) flex size-(--control-h-md) items-center justify-center rounded-(--radius-pill) border border-(--rule-2) bg-(--paper)/90 text-(--ink-2) backdrop-blur-sm transition-colors duration-(--duration-fast) hover:border-(--ink) hover:text-(--ink)',\n POSITION_CLASS[position],\n className,\n )}\n {...rest}\n >\n {children}\n </button>\n )\n}\n\nexport default FloatingIconButton\n"],"mappings":";AAkDI;AA/CJ,SAAS,UAAU;AACnB,SAAS,qBAAqB;AAuB9B,MAAM,iBAAiB,EAAE,OAAO,qBAAqB,KAAK,iBAAiB;AAcpE,SAAS,mBAAmB;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAA4B;AAC1B,gBAAc,sBAAsB,SAAS,OAAO,sDAAsD;AAC1G,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,cAAY;AAAA,MACZ,WAAW;AAAA,QACT;AAAA,QACA,eAAe,QAAQ;AAAA,QACvB;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;AAEA,IAAO,6BAAQ;","names":[]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
5
|
+
/**
|
|
6
|
+
* A step on the type ladder, named for the thing it heads.
|
|
7
|
+
*
|
|
8
|
+
* `title` is the top and there is nothing above it — a page has exactly one
|
|
9
|
+
* thing larger than its own records. `label` is not on the size ladder at all:
|
|
10
|
+
* it is the mono kicker, which is what a fifth-level heading should look like,
|
|
11
|
+
* because a serif heading three steps down is indistinguishable from bold body
|
|
12
|
+
* copy.
|
|
13
|
+
*/
|
|
14
|
+
type HeadingSize = 'title' | 'lead' | 'heading' | 'sub' | 'item' | 'label';
|
|
15
|
+
interface HeadingProps extends HTMLAttributes<HTMLHeadingElement> {
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* The element: `1` renders `<h1>`, `6` renders `<h6>`.
|
|
19
|
+
*
|
|
20
|
+
* This is the document outline and nothing else — it is what a screen reader
|
|
21
|
+
* navigates by, so it follows the section the heading opens, never the size
|
|
22
|
+
* it wants to be. A heading two levels down inside an `<h2>` section is an
|
|
23
|
+
* `<h3>` even when the design calls for something enormous.
|
|
24
|
+
*/
|
|
25
|
+
level: HeadingLevel;
|
|
26
|
+
/**
|
|
27
|
+
* The size, when the outline and the design genuinely disagree.
|
|
28
|
+
*
|
|
29
|
+
* Defaults from `level` through the ladder above, which is the answer nearly
|
|
30
|
+
* always. Reach for this when a semantically-correct `h3` opens a page and
|
|
31
|
+
* has to look like one — not to squeeze a fourth step between two that are
|
|
32
|
+
* already only 14% apart.
|
|
33
|
+
*/
|
|
34
|
+
size?: HeadingSize;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A heading, with its element and its size decided separately.
|
|
38
|
+
*
|
|
39
|
+
* Every heading component that takes one number gets this wrong in one of two
|
|
40
|
+
* directions: either the outline is bent to reach a size (an `<h1>` in the
|
|
41
|
+
* middle of a page because the design wanted big type), or the size is bent to
|
|
42
|
+
* keep the outline (a section title set at 20px because it is the fourth level
|
|
43
|
+
* down). Both are one prop away from being right, so there are two.
|
|
44
|
+
*
|
|
45
|
+
* `level` is the document. `size` is the page. The default binds them through
|
|
46
|
+
* the system's ladder, so writing only `level` is correct — and the moment they
|
|
47
|
+
* come apart, the call site says so.
|
|
48
|
+
*
|
|
49
|
+
* Set in the editorial serif at weight 400, like every heading in the system.
|
|
50
|
+
* It also carries `scroll-margin-top`, so a heading given an `id` and linked
|
|
51
|
+
* from a table of contents comes to rest below the masthead rather than under
|
|
52
|
+
* it.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* <Heading level={1}>The White Reset</Heading>
|
|
56
|
+
* @example
|
|
57
|
+
* // Third level in the outline, page-title sized.
|
|
58
|
+
* <Heading level={3} size="title">Colour</Heading>
|
|
59
|
+
*/
|
|
60
|
+
declare function Heading({ children, level, size, className, ...rest }: HeadingProps): react.JSX.Element;
|
|
61
|
+
|
|
62
|
+
export { Heading, type HeadingLevel, type HeadingProps, type HeadingSize, Heading as default };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/cn.js";
|
|
3
|
+
const SIZE = {
|
|
4
|
+
title: "text-[length:var(--fs-title)] leading-[1.1] tracking-[-0.02em]",
|
|
5
|
+
lead: "text-[length:var(--fs-lead)] leading-[1.15] tracking-[-0.015em]",
|
|
6
|
+
heading: "text-[length:var(--fs-heading)] leading-[1.2]",
|
|
7
|
+
sub: "text-[length:var(--fs-sub)] leading-[1.25]",
|
|
8
|
+
item: "text-[length:var(--fs-item)] leading-[1.3]",
|
|
9
|
+
// Spelled out rather than reaching for the `eyebrow` utility: it and
|
|
10
|
+
// `font-heading` both set font-family, and a custom utility is invisible to
|
|
11
|
+
// tailwind-merge — so the two would land in the same cascade layer at the
|
|
12
|
+
// same specificity and source order would pick the winner.
|
|
13
|
+
label: "font-mono text-[11px] uppercase leading-[1.6] tracking-[0.2em] text-(--ink-3-aa)"
|
|
14
|
+
};
|
|
15
|
+
const LADDER = {
|
|
16
|
+
1: "title",
|
|
17
|
+
2: "heading",
|
|
18
|
+
3: "sub",
|
|
19
|
+
4: "item",
|
|
20
|
+
5: "label",
|
|
21
|
+
6: "label"
|
|
22
|
+
};
|
|
23
|
+
function Heading({ children, level, size, className, ...rest }) {
|
|
24
|
+
const Comp = `h${level}`;
|
|
25
|
+
const step = size ?? LADDER[level];
|
|
26
|
+
return /* @__PURE__ */ jsx(
|
|
27
|
+
Comp,
|
|
28
|
+
{
|
|
29
|
+
className: cn(
|
|
30
|
+
"m-0 scroll-mt-[var(--scroll-offset)] font-heading font-normal text-(--ink)",
|
|
31
|
+
SIZE[step],
|
|
32
|
+
className
|
|
33
|
+
),
|
|
34
|
+
...rest,
|
|
35
|
+
children
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
var Heading_default = Heading;
|
|
40
|
+
export {
|
|
41
|
+
Heading,
|
|
42
|
+
Heading_default as default
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=Heading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Heading/Heading.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from 'react'\nimport { cn } from '../../lib/cn'\n\nexport type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6\n\n/**\n * A step on the type ladder, named for the thing it heads.\n *\n * `title` is the top and there is nothing above it — a page has exactly one\n * thing larger than its own records. `label` is not on the size ladder at all:\n * it is the mono kicker, which is what a fifth-level heading should look like,\n * because a serif heading three steps down is indistinguishable from bold body\n * copy.\n */\nexport type HeadingSize = 'title' | 'lead' | 'heading' | 'sub' | 'item' | 'label'\n\nconst SIZE: Record<HeadingSize, string> = {\n title: 'text-[length:var(--fs-title)] leading-[1.1] tracking-[-0.02em]',\n lead: 'text-[length:var(--fs-lead)] leading-[1.15] tracking-[-0.015em]',\n heading: 'text-[length:var(--fs-heading)] leading-[1.2]',\n sub: 'text-[length:var(--fs-sub)] leading-[1.25]',\n item: 'text-[length:var(--fs-item)] leading-[1.3]',\n // Spelled out rather than reaching for the `eyebrow` utility: it and\n // `font-heading` both set font-family, and a custom utility is invisible to\n // tailwind-merge — so the two would land in the same cascade layer at the\n // same specificity and source order would pick the winner.\n label: 'font-mono text-[11px] uppercase leading-[1.6] tracking-[0.2em] text-(--ink-3-aa)',\n}\n\n/**\n * What each level looks like when nobody says otherwise — and the reason this\n * component exists rather than six styled tags.\n *\n * Read the gaps. `1 → title` then `2 → heading` SKIPS `lead`, because the\n * ladder's steps sit close together on purpose: it separates records of the\n * same kind, not a heading from its own sub-heading. `--fs-lead` over\n * `--fs-heading` is a ratio of 1.14 and reads as a rendering accident;\n * `--fs-title` over `--fs-heading` is 1.86 and reads as a hierarchy.\n *\n * So the correct pairing is what a caller gets for free, and stepping off the\n * ladder costs a prop and is visible in review. This is the same map\n * `article.css` applies to rendered Markdown, which is what makes a component\n * page and a post read as one publication.\n */\nconst LADDER: Record<HeadingLevel, HeadingSize> = {\n 1: 'title',\n 2: 'heading',\n 3: 'sub',\n 4: 'item',\n 5: 'label',\n 6: 'label',\n}\n\nexport interface HeadingProps extends HTMLAttributes<HTMLHeadingElement> {\n children?: ReactNode\n /**\n * The element: `1` renders `<h1>`, `6` renders `<h6>`.\n *\n * This is the document outline and nothing else — it is what a screen reader\n * navigates by, so it follows the section the heading opens, never the size\n * it wants to be. A heading two levels down inside an `<h2>` section is an\n * `<h3>` even when the design calls for something enormous.\n */\n level: HeadingLevel\n /**\n * The size, when the outline and the design genuinely disagree.\n *\n * Defaults from `level` through the ladder above, which is the answer nearly\n * always. Reach for this when a semantically-correct `h3` opens a page and\n * has to look like one — not to squeeze a fourth step between two that are\n * already only 14% apart.\n */\n size?: HeadingSize\n}\n\n/**\n * A heading, with its element and its size decided separately.\n *\n * Every heading component that takes one number gets this wrong in one of two\n * directions: either the outline is bent to reach a size (an `<h1>` in the\n * middle of a page because the design wanted big type), or the size is bent to\n * keep the outline (a section title set at 20px because it is the fourth level\n * down). Both are one prop away from being right, so there are two.\n *\n * `level` is the document. `size` is the page. The default binds them through\n * the system's ladder, so writing only `level` is correct — and the moment they\n * come apart, the call site says so.\n *\n * Set in the editorial serif at weight 400, like every heading in the system.\n * It also carries `scroll-margin-top`, so a heading given an `id` and linked\n * from a table of contents comes to rest below the masthead rather than under\n * it.\n *\n * @example\n * <Heading level={1}>The White Reset</Heading>\n * @example\n * // Third level in the outline, page-title sized.\n * <Heading level={3} size=\"title\">Colour</Heading>\n */\nexport function Heading({ children, level, size, className, ...rest }: HeadingProps) {\n const Comp = `h${level}` as const\n const step = size ?? LADDER[level]\n\n return (\n <Comp\n className={cn(\n 'm-0 scroll-mt-[var(--scroll-offset)] font-heading font-normal text-(--ink)',\n SIZE[step],\n className,\n )}\n {...rest}\n >\n {children}\n </Comp>\n )\n}\n\nexport default Heading\n"],"mappings":"AAwGI;AAvGJ,SAAS,UAAU;AAenB,MAAM,OAAoC;AAAA,EACxC,OAAO;AAAA,EACP,MAAM;AAAA,EACN,SAAS;AAAA,EACT,KAAK;AAAA,EACL,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA,EAKN,OAAO;AACT;AAiBA,MAAM,SAA4C;AAAA,EAChD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAgDO,SAAS,QAAQ,EAAE,UAAU,OAAO,MAAM,WAAW,GAAG,KAAK,GAAiB;AACnF,QAAM,OAAO,IAAI,KAAK;AACtB,QAAM,OAAO,QAAQ,OAAO,KAAK;AAEjC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,KAAK,IAAI;AAAA,QACT;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;AAEA,IAAO,kBAAQ;","names":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { InputHTMLAttributes, Ref } from 'react';
|
|
3
|
+
|
|
4
|
+
interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
5
|
+
/** Paints the resting border with `--danger` and reflects `aria-invalid`. */
|
|
6
|
+
invalid?: boolean;
|
|
7
|
+
ref?: Ref<HTMLInputElement>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A single line of text entry.
|
|
11
|
+
*
|
|
12
|
+
* Shares `CONTROL_BASE` with Textarea and Select, so the three cannot drift
|
|
13
|
+
* apart. Pair with `Field` for the label, hint and error — an input with a
|
|
14
|
+
* placeholder and no label is not labelled, because the placeholder disappears
|
|
15
|
+
* the moment anyone types.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* <Field label="Email" htmlFor="email"><Input id="email" type="email" /></Field>
|
|
19
|
+
*/
|
|
20
|
+
declare function Input({ invalid, className, ref, 'aria-invalid': ariaInvalid, ...rest }: InputProps): react.JSX.Element;
|
|
21
|
+
|
|
22
|
+
export { Input, type InputProps, Input as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/cn.js";
|
|
3
|
+
import { CONTROL_BASE, CONTROL_BORDER, isInvalid } from "../../lib/control.js";
|
|
4
|
+
function Input({ invalid, className, ref, "aria-invalid": ariaInvalid, ...rest }) {
|
|
5
|
+
const bad = isInvalid(invalid, ariaInvalid);
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
"input",
|
|
8
|
+
{
|
|
9
|
+
ref,
|
|
10
|
+
"aria-invalid": ariaInvalid ?? (invalid ? true : void 0),
|
|
11
|
+
className: cn(CONTROL_BASE, bad ? CONTROL_BORDER.invalid : CONTROL_BORDER.resting, className),
|
|
12
|
+
...rest
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
var Input_default = Input;
|
|
17
|
+
export {
|
|
18
|
+
Input,
|
|
19
|
+
Input_default as default
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=Input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Input/Input.tsx"],"sourcesContent":["import type { InputHTMLAttributes, Ref } from 'react'\nimport { cn } from '../../lib/cn'\nimport { CONTROL_BASE, CONTROL_BORDER, isInvalid } from '../../lib/control'\n\nexport interface InputProps extends InputHTMLAttributes<HTMLInputElement> {\n /** Paints the resting border with `--danger` and reflects `aria-invalid`. */\n invalid?: boolean\n ref?: Ref<HTMLInputElement>\n}\n\n/**\n * A single line of text entry.\n *\n * Shares `CONTROL_BASE` with Textarea and Select, so the three cannot drift\n * apart. Pair with `Field` for the label, hint and error — an input with a\n * placeholder and no label is not labelled, because the placeholder disappears\n * the moment anyone types.\n *\n * @example\n * <Field label=\"Email\" htmlFor=\"email\"><Input id=\"email\" type=\"email\" /></Field>\n */\nexport function Input({ invalid, className, ref, 'aria-invalid': ariaInvalid, ...rest }: InputProps) {\n const bad = isInvalid(invalid, ariaInvalid)\n return (\n <input\n ref={ref}\n aria-invalid={ariaInvalid ?? (invalid ? true : undefined)}\n className={cn(CONTROL_BASE, bad ? CONTROL_BORDER.invalid : CONTROL_BORDER.resting, className)}\n {...rest}\n />\n )\n}\n\nexport default Input\n"],"mappings":"AAwBI;AAvBJ,SAAS,UAAU;AACnB,SAAS,cAAc,gBAAgB,iBAAiB;AAmBjD,SAAS,MAAM,EAAE,SAAS,WAAW,KAAK,gBAAgB,aAAa,GAAG,KAAK,GAAe;AACnG,QAAM,MAAM,UAAU,SAAS,WAAW;AAC1C,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,gBAAc,gBAAgB,UAAU,OAAO;AAAA,MAC/C,WAAW,GAAG,cAAc,MAAM,eAAe,UAAU,eAAe,SAAS,SAAS;AAAA,MAC3F,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,IAAO,gBAAQ;","names":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface KbdProps extends HTMLAttributes<HTMLElement> {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A key on a keyboard, set as one.
|
|
9
|
+
*
|
|
10
|
+
* Renders a `<kbd>`, which is the element that means this — a `<span>` styled
|
|
11
|
+
* to look like a key tells a screen reader nothing. Sized in `em` so it tracks
|
|
12
|
+
* whatever type it sits beside rather than fixing itself at one px value, which
|
|
13
|
+
* is how the same shortcut ended up three different sizes across a page.
|
|
14
|
+
*
|
|
15
|
+
* Every dimension here tracked its context except the leading, which was a
|
|
16
|
+
* literal `1.6` — the body's READING leading, on a chip that is never a
|
|
17
|
+
* paragraph. Inside a control it therefore stood proud of the label beside it
|
|
18
|
+
* and pushed the whole box past its own height token: the masthead's search
|
|
19
|
+
* field measured 39px against a 36px `sm`, and it was this keycap doing it.
|
|
20
|
+
* `--control-lh` is the leading a one-line box gets, and this is one.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* Press <Kbd>⌘</Kbd> <Kbd>K</Kbd> to open the palette.
|
|
24
|
+
*/
|
|
25
|
+
declare function Kbd({ children, className, ...rest }: KbdProps): react.JSX.Element;
|
|
26
|
+
|
|
27
|
+
export { Kbd, type KbdProps, Kbd as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/cn.js";
|
|
3
|
+
function Kbd({ children, className, ...rest }) {
|
|
4
|
+
return /* @__PURE__ */ jsx(
|
|
5
|
+
"kbd",
|
|
6
|
+
{
|
|
7
|
+
className: cn(
|
|
8
|
+
"inline-flex min-w-[1.6em] items-center justify-center rounded-(--radius-sm) border border-(--rule-2) px-[0.4em] py-[0.1em] font-mono text-[0.8em] leading-(--control-lh) text-(--ink-2)",
|
|
9
|
+
className
|
|
10
|
+
),
|
|
11
|
+
...rest,
|
|
12
|
+
children
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
var Kbd_default = Kbd;
|
|
17
|
+
export {
|
|
18
|
+
Kbd,
|
|
19
|
+
Kbd_default as default
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=Kbd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Kbd/Kbd.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from 'react'\nimport { cn } from '../../lib/cn'\n\nexport interface KbdProps extends HTMLAttributes<HTMLElement> {\n children: ReactNode\n}\n\n/**\n * A key on a keyboard, set as one.\n *\n * Renders a `<kbd>`, which is the element that means this — a `<span>` styled\n * to look like a key tells a screen reader nothing. Sized in `em` so it tracks\n * whatever type it sits beside rather than fixing itself at one px value, which\n * is how the same shortcut ended up three different sizes across a page.\n *\n * Every dimension here tracked its context except the leading, which was a\n * literal `1.6` — the body's READING leading, on a chip that is never a\n * paragraph. Inside a control it therefore stood proud of the label beside it\n * and pushed the whole box past its own height token: the masthead's search\n * field measured 39px against a 36px `sm`, and it was this keycap doing it.\n * `--control-lh` is the leading a one-line box gets, and this is one.\n *\n * @example\n * Press <Kbd>⌘</Kbd> <Kbd>K</Kbd> to open the palette.\n */\nexport function Kbd({ children, className, ...rest }: KbdProps) {\n return (\n <kbd\n className={cn(\n 'inline-flex min-w-[1.6em] items-center justify-center rounded-(--radius-sm) border border-(--rule-2) px-[0.4em] py-[0.1em] font-mono text-[0.8em] leading-(--control-lh) text-(--ink-2)',\n className,\n )}\n {...rest}\n >\n {children}\n </kbd>\n )\n}\n\nexport default Kbd\n"],"mappings":"AA2BI;AA1BJ,SAAS,UAAU;AAwBZ,SAAS,IAAI,EAAE,UAAU,WAAW,GAAG,KAAK,GAAa;AAC9D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;AAEA,IAAO,cAAQ;","names":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
/** The glyph itself, exported so a non-React surface can use the same mark. */
|
|
5
|
+
declare const EXTERNAL_LINK_ARROW = "\u2197";
|
|
6
|
+
type LinkArrowProps = HTMLAttributes<HTMLSpanElement>;
|
|
7
|
+
/**
|
|
8
|
+
* The mark on a link that leaves the page — outbound, or on to a full index.
|
|
9
|
+
*
|
|
10
|
+
* Call sites used to write a bare `↗` inside the link text, which inherited the
|
|
11
|
+
* link's own size (a 17px arrow beside a 17px word, competing with it) and was
|
|
12
|
+
* read aloud as "north east arrow" because nothing hid it.
|
|
13
|
+
*
|
|
14
|
+
* `inline-block` is load-bearing twice over: it stops an underlined parent
|
|
15
|
+
* drawing its rule through the glyph, and it is what `align` is measured
|
|
16
|
+
* against. Sized in `em`, so it tracks whatever type it sits beside; coloured
|
|
17
|
+
* against paper, so a call site on a reversed plate passes its own colour.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* <a href="https://example.com">Read the paper<LinkArrow /></a>
|
|
21
|
+
*/
|
|
22
|
+
declare function LinkArrow({ className, ...rest }: LinkArrowProps): react.JSX.Element;
|
|
23
|
+
|
|
24
|
+
export { EXTERNAL_LINK_ARROW, LinkArrow, type LinkArrowProps, LinkArrow as default };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/cn.js";
|
|
3
|
+
const EXTERNAL_LINK_ARROW = "\u2197";
|
|
4
|
+
function LinkArrow({ className, ...rest }) {
|
|
5
|
+
return /* @__PURE__ */ jsx(
|
|
6
|
+
"span",
|
|
7
|
+
{
|
|
8
|
+
"aria-hidden": "true",
|
|
9
|
+
className: cn(
|
|
10
|
+
"ms-[0.22em] inline-block align-[0.28em] font-mono text-[0.68em] leading-none text-(--ink-3-aa)",
|
|
11
|
+
className
|
|
12
|
+
),
|
|
13
|
+
...rest,
|
|
14
|
+
children: EXTERNAL_LINK_ARROW
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
var LinkArrow_default = LinkArrow;
|
|
19
|
+
export {
|
|
20
|
+
EXTERNAL_LINK_ARROW,
|
|
21
|
+
LinkArrow,
|
|
22
|
+
LinkArrow_default as default
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=LinkArrow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/LinkArrow/LinkArrow.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react'\nimport { cn } from '../../lib/cn'\n\n/** The glyph itself, exported so a non-React surface can use the same mark. */\nexport const EXTERNAL_LINK_ARROW = '↗'\n\nexport type LinkArrowProps = HTMLAttributes<HTMLSpanElement>\n\n/**\n * The mark on a link that leaves the page — outbound, or on to a full index.\n *\n * Call sites used to write a bare `↗` inside the link text, which inherited the\n * link's own size (a 17px arrow beside a 17px word, competing with it) and was\n * read aloud as \"north east arrow\" because nothing hid it.\n *\n * `inline-block` is load-bearing twice over: it stops an underlined parent\n * drawing its rule through the glyph, and it is what `align` is measured\n * against. Sized in `em`, so it tracks whatever type it sits beside; coloured\n * against paper, so a call site on a reversed plate passes its own colour.\n *\n * @example\n * <a href=\"https://example.com\">Read the paper<LinkArrow /></a>\n */\nexport function LinkArrow({ className, ...rest }: LinkArrowProps) {\n return (\n <span\n aria-hidden=\"true\"\n className={cn(\n 'ms-[0.22em] inline-block align-[0.28em] font-mono text-[0.68em] leading-none text-(--ink-3-aa)',\n className,\n )}\n {...rest}\n >\n {EXTERNAL_LINK_ARROW}\n </span>\n )\n}\n\nexport default LinkArrow\n"],"mappings":"AAyBI;AAxBJ,SAAS,UAAU;AAGZ,MAAM,sBAAsB;AAmB5B,SAAS,UAAU,EAAE,WAAW,GAAG,KAAK,GAAmB;AAChE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAY;AAAA,MACZ,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;AAEA,IAAO,oBAAQ;","names":[]}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { MarkdownHeadingLevel, MarkdownNode } from './nodes.js';
|
|
3
|
+
export { MarkdownInline } from './nodes.js';
|
|
4
|
+
export { parseMarkdown } from './parse.js';
|
|
5
|
+
export { slugify } from './slug.js';
|
|
6
|
+
|
|
7
|
+
interface MarkdownProps {
|
|
8
|
+
/** The Markdown source. A string — not nodes, not HTML. */
|
|
9
|
+
children: string;
|
|
10
|
+
/**
|
|
11
|
+
* The level the document's top heading renders at.
|
|
12
|
+
*
|
|
13
|
+
* Markdown is written as a document, so its `#` is an `<h1>`. Dropped into a
|
|
14
|
+
* page that already has one — inside an `<h2>` section, in a card, under a
|
|
15
|
+
* dialog's title — that produces two first-level headings and an outline a
|
|
16
|
+
* screen reader cannot navigate. Set this to the level BELOW the heading the
|
|
17
|
+
* content sits under, and every level in the document shifts with it.
|
|
18
|
+
*/
|
|
19
|
+
headingLevelStart?: MarkdownHeadingLevel;
|
|
20
|
+
/**
|
|
21
|
+
* Namespaces the generated heading ids.
|
|
22
|
+
*
|
|
23
|
+
* Two documents on one page both containing "Installation" would otherwise
|
|
24
|
+
* both claim `#installation`, and a fragment link would land on whichever the
|
|
25
|
+
* browser found first.
|
|
26
|
+
*/
|
|
27
|
+
idPrefix?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Adds the system's outbound arrow to links that leave for another site.
|
|
30
|
+
*
|
|
31
|
+
* Off by default, and opt-in rather than automatic for two reasons. The mark
|
|
32
|
+
* is an addition to a sentence the component did not write, which is a
|
|
33
|
+
* different kind of act from styling one. And `Markdown` has no idea what
|
|
34
|
+
* origin it is being rendered on, so "leaves for another site" can only mean
|
|
35
|
+
* "carries an `http`/`https` scheme" — an absolute link back to your own
|
|
36
|
+
* domain gets the arrow too. A caller who knows the shape of their content
|
|
37
|
+
* turns it on; one who does not should not have it turned on for them.
|
|
38
|
+
*
|
|
39
|
+
* The `rel` on an outbound link is NOT opt-in and cannot be turned off: it
|
|
40
|
+
* is the security half of the same boundary as the scheme check.
|
|
41
|
+
*/
|
|
42
|
+
markExternalLinks?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Bring your own parser.
|
|
45
|
+
*
|
|
46
|
+
* Anything that turns the source into `MarkdownNode`s: markdown-it, remark,
|
|
47
|
+
* or a pipeline that already has an AST and only needs mapping. The node
|
|
48
|
+
* shapes are exported alongside the component as `MarkdownNode`,
|
|
49
|
+
* `MarkdownInline` and `MarkdownHeadingLevel`. The built-in parser covers the
|
|
50
|
+
* subset this system styles; this is the seam for tables, footnotes, task
|
|
51
|
+
* lists and everything else.
|
|
52
|
+
*/
|
|
53
|
+
parse?: (source: string) => MarkdownNode[];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* A Markdown string, rendered as this system's components.
|
|
57
|
+
*
|
|
58
|
+
* The gap it fills is content nobody on this side wrote: a comment, a README, a
|
|
59
|
+
* model's answer, a description out of a database. `Article` cannot take those
|
|
60
|
+
* — it renders HTML through `dangerouslySetInnerHTML` and is documented as
|
|
61
|
+
* trusted-input-only — and until now the alternative was a `<pre>` or a
|
|
62
|
+
* sanitiser bolted onto a styling primitive.
|
|
63
|
+
*
|
|
64
|
+
* IT IS NOT AN `Article`, and the two do not merge. `Markdown` turns a string
|
|
65
|
+
* into nodes; `Article` is the reading column those nodes can sit in. It
|
|
66
|
+
* renders a FRAGMENT rather than a wrapper, which is what makes that nesting
|
|
67
|
+
* work — `Article`'s rhythm is a direct-child combinator, so any element
|
|
68
|
+
* between the two, `display: contents` included, would cost every paragraph
|
|
69
|
+
* its spacing.
|
|
70
|
+
*
|
|
71
|
+
* ── It brings type and colour, and no vertical rhythm ──
|
|
72
|
+
*
|
|
73
|
+
* The nodes carry the system's faces and inks on their own, so one of these
|
|
74
|
+
* looks right in isolation. It is not SPACED in isolation: every node renders
|
|
75
|
+
* `m-0`, and a fragment has no box of its own to put a gap in. Nor does a
|
|
76
|
+
* uniform `gap` on a container reproduce it, because prose spacing is not
|
|
77
|
+
* uniform — `article.css` gives a heading 2.25em above and 0.75em below, which
|
|
78
|
+
* is what sits a heading with the paragraph it introduces rather than midway
|
|
79
|
+
* between two. For anything longer than a sentence — a comment, an answer, a
|
|
80
|
+
* README — put it in `<Article as="div">` and get the real rhythm for the cost
|
|
81
|
+
* of one element.
|
|
82
|
+
*
|
|
83
|
+
* ── A fenced code block brings a client component with it ──
|
|
84
|
+
*
|
|
85
|
+
* The renderer is plain functions and has no state, but a fenced block renders
|
|
86
|
+
* `CodeBlock`, which is `'use client'` and arrives with `useState`,
|
|
87
|
+
* `useEffect` and two icons. That is correct — the copy button is the reason
|
|
88
|
+
* the block exists — but "server-rendered" only holds for content with no code
|
|
89
|
+
* in it, which is worth knowing before this goes into a route that has no
|
|
90
|
+
* client bundle yet.
|
|
91
|
+
*
|
|
92
|
+
* ── Why there is no parser in `dependencies` ──
|
|
93
|
+
*
|
|
94
|
+
* Three options, and the decision is written here because it is the one a
|
|
95
|
+
* reader will want to argue with.
|
|
96
|
+
*
|
|
97
|
+
* 1. BUNDLE A PARSER. markdown-it is the obvious pick, and the documentation
|
|
98
|
+
* site already depends on it — but the site is an app and this is a
|
|
99
|
+
* library, where the dependency list is part of the contract every consumer
|
|
100
|
+
* signs. Measured with the same esbuild pass `check:size` uses, markdown-it
|
|
101
|
+
* is 110.7 kB minified against the 38.9 kB this package had left under its
|
|
102
|
+
* bundle budget. It is not close, and "we will raise the budget" is how a
|
|
103
|
+
* design system becomes the largest thing on a page.
|
|
104
|
+
* 2. TAKE PRE-PARSED HTML, the way `Article` does. Cheapest, and wrong for the
|
|
105
|
+
* case this exists for: HTML from an untrusted author is the input this is
|
|
106
|
+
* supposed to make safe, and it cannot carry `headingLevelStart` or stable
|
|
107
|
+
* heading ids without the component parsing markup back apart to find them.
|
|
108
|
+
* 3. PARSE THE SUBSET WE STYLE, and take a `parse` function for the rest.
|
|
109
|
+
* Chosen. The block grammar is line-based and small (see `parse.ts`), it
|
|
110
|
+
* emits React elements rather than markup — so there is no
|
|
111
|
+
* `dangerouslySetInnerHTML` in this path at all, no sanitiser to configure
|
|
112
|
+
* and no sanitiser to get wrong — and a consumer who needs tables,
|
|
113
|
+
* footnotes or task lists passes `parse` and keeps every other promise the
|
|
114
|
+
* component makes.
|
|
115
|
+
*
|
|
116
|
+
* Headings carry an `id` slugged from their own text and deduplicated within
|
|
117
|
+
* the document, so a table of contents can link to them without the caller
|
|
118
|
+
* post-processing the DOM to find out where they went.
|
|
119
|
+
*
|
|
120
|
+
* A link in the source is validated here, at the boundary: a scheme that is not
|
|
121
|
+
* `http`, `https`, `mailto` or `tel` never becomes a link, and one that leaves
|
|
122
|
+
* for another site carries `rel="noreferrer nofollow"` — so an author the page
|
|
123
|
+
* does not trust cannot spend its ranking or read its URL out of the `Referer`.
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* // A comment body or an answer: the reading column is what spaces it.
|
|
127
|
+
* <Article as="div">
|
|
128
|
+
* <Markdown headingLevelStart={3} idPrefix="answer">{answer}</Markdown>
|
|
129
|
+
* </Article>
|
|
130
|
+
* @example
|
|
131
|
+
* // A whole document, in the column it was written for.
|
|
132
|
+
* <Article><Markdown>{readme}</Markdown></Article>
|
|
133
|
+
* @example
|
|
134
|
+
* // Tables and footnotes, via the consumer's own pipeline.
|
|
135
|
+
* <Markdown parse={(source) => toMarkdownNodes(md.parse(source, {}))}>{post}</Markdown>
|
|
136
|
+
*/
|
|
137
|
+
declare function Markdown({ children, headingLevelStart, idPrefix, markExternalLinks, parse, }: MarkdownProps): react.JSX.Element;
|
|
138
|
+
|
|
139
|
+
export { Markdown, MarkdownHeadingLevel, MarkdownNode, type MarkdownProps, Markdown as default };
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment } from "react";
|
|
3
|
+
import { Code } from "../Code/Code.js";
|
|
4
|
+
import { CodeBlock } from "../CodeBlock/CodeBlock.js";
|
|
5
|
+
import { Heading } from "../Heading/Heading.js";
|
|
6
|
+
import { LinkArrow } from "../LinkArrow/LinkArrow.js";
|
|
7
|
+
import { Separator } from "../Separator/Separator.js";
|
|
8
|
+
import { Text } from "../Text/Text.js";
|
|
9
|
+
import { isOutbound } from "./inline.js";
|
|
10
|
+
import { parseMarkdown } from "./parse.js";
|
|
11
|
+
import { slugify } from "./slug.js";
|
|
12
|
+
import { parseMarkdown as parseMarkdown2 } from "./parse.js";
|
|
13
|
+
import { slugify as slugify2 } from "./slug.js";
|
|
14
|
+
function textOf(nodes) {
|
|
15
|
+
return nodes.map((node) => {
|
|
16
|
+
if (node.type === "text" || node.type === "code") return node.value;
|
|
17
|
+
if (node.type === "image") return node.alt;
|
|
18
|
+
return textOf(node.children);
|
|
19
|
+
}).join("");
|
|
20
|
+
}
|
|
21
|
+
function headingId(text, context) {
|
|
22
|
+
const base = slugify(text) || "section";
|
|
23
|
+
const seen = (context.taken.get(base) ?? 0) + 1;
|
|
24
|
+
context.taken.set(base, seen);
|
|
25
|
+
const id = seen === 1 ? base : `${base}-${seen}`;
|
|
26
|
+
return context.idPrefix ? `${context.idPrefix}-${id}` : id;
|
|
27
|
+
}
|
|
28
|
+
function renderInline(node, key, context) {
|
|
29
|
+
switch (node.type) {
|
|
30
|
+
case "text":
|
|
31
|
+
return node.value;
|
|
32
|
+
case "code":
|
|
33
|
+
return /* @__PURE__ */ jsx(Code, { children: node.value }, key);
|
|
34
|
+
case "strong":
|
|
35
|
+
return /* @__PURE__ */ jsx("strong", { className: "font-medium text-(--ink)", children: node.children.map((child, index) => renderInline(child, index, context)) }, key);
|
|
36
|
+
case "emphasis":
|
|
37
|
+
return /* @__PURE__ */ jsx("em", { className: "italic", children: node.children.map((child, index) => renderInline(child, index, context)) }, key);
|
|
38
|
+
case "image":
|
|
39
|
+
return /* @__PURE__ */ jsx(
|
|
40
|
+
"img",
|
|
41
|
+
{
|
|
42
|
+
src: node.src,
|
|
43
|
+
alt: node.alt,
|
|
44
|
+
loading: "lazy",
|
|
45
|
+
className: "h-auto max-w-full rounded-(--radius)"
|
|
46
|
+
},
|
|
47
|
+
key
|
|
48
|
+
);
|
|
49
|
+
case "link": {
|
|
50
|
+
const outbound = isOutbound(node.href);
|
|
51
|
+
return /* @__PURE__ */ jsxs(
|
|
52
|
+
"a",
|
|
53
|
+
{
|
|
54
|
+
href: node.href,
|
|
55
|
+
rel: outbound ? "noreferrer nofollow" : void 0,
|
|
56
|
+
className: "text-(--ink) underline decoration-[var(--rule-2)] underline-offset-4 transition-[text-decoration-color] duration-(--duration-fast) hover:decoration-[var(--ink)]",
|
|
57
|
+
children: [
|
|
58
|
+
node.children.map((child, index) => renderInline(child, index, context)),
|
|
59
|
+
outbound && context.markExternalLinks ? /* @__PURE__ */ jsx(LinkArrow, {}) : null
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
key
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function renderItem(blocks, key, context) {
|
|
68
|
+
const first = blocks[0];
|
|
69
|
+
const only = blocks.length === 1 && first?.type === "paragraph" ? first : void 0;
|
|
70
|
+
return /* @__PURE__ */ jsx("li", { className: "relative", children: only ? only.children.map((child, i) => renderInline(child, i, context)) : blocks.map((block, i) => renderBlock(block, i, context)) }, key);
|
|
71
|
+
}
|
|
72
|
+
function renderBlock(node, key, context) {
|
|
73
|
+
switch (node.type) {
|
|
74
|
+
case "heading": {
|
|
75
|
+
const level = Math.min(6, node.level + context.headingLevelStart - 1);
|
|
76
|
+
return /* @__PURE__ */ jsx(Heading, { level, id: headingId(textOf(node.children), context), children: node.children.map((child, index) => renderInline(child, index, context)) }, key);
|
|
77
|
+
}
|
|
78
|
+
case "paragraph":
|
|
79
|
+
return /* @__PURE__ */ jsx(Text, { children: node.children.map((child, index) => renderInline(child, index, context)) }, key);
|
|
80
|
+
case "code":
|
|
81
|
+
return /* @__PURE__ */ jsx(CodeBlock, { code: node.value, lang: node.lang }, key);
|
|
82
|
+
case "rule":
|
|
83
|
+
return /* @__PURE__ */ jsx(Separator, { weight: "edge", decorative: false }, key);
|
|
84
|
+
case "quote":
|
|
85
|
+
return /* @__PURE__ */ jsx(
|
|
86
|
+
"blockquote",
|
|
87
|
+
{
|
|
88
|
+
className: "m-0 border-s-2 border-(--rule-hard) ps-[1.25em] font-serif text-[length:var(--fs-item)] leading-[1.55] text-(--ink) [&>*+*]:mt-[0.6em]",
|
|
89
|
+
children: node.children.map((child, i) => renderBlock(child, i, context))
|
|
90
|
+
},
|
|
91
|
+
key
|
|
92
|
+
);
|
|
93
|
+
case "list":
|
|
94
|
+
return node.ordered ? /* @__PURE__ */ jsx(
|
|
95
|
+
"ol",
|
|
96
|
+
{
|
|
97
|
+
className: "m-0 list-decimal ps-[1.4em] text-(--ink-2) marker:text-(--ink-3-aa) [&>li+li]:mt-[0.4em]",
|
|
98
|
+
children: node.items.map((item, i) => renderItem(item, i, context))
|
|
99
|
+
},
|
|
100
|
+
key
|
|
101
|
+
) : (
|
|
102
|
+
// The marker is a hairline dash drawn on `::before`, not a disc: the
|
|
103
|
+
// system's only filled circle is a status dot. `article.css` draws the
|
|
104
|
+
// same dash on the same pseudo-element, so markdown dropped into an
|
|
105
|
+
// Article coincides with the stylesheet rather than doubling it.
|
|
106
|
+
/* @__PURE__ */ jsx(
|
|
107
|
+
"ul",
|
|
108
|
+
{
|
|
109
|
+
className: "m-0 list-none ps-[1.15em] text-(--ink-2) [&>li+li]:mt-[0.4em] [&>li]:before:absolute [&>li]:before:start-[-1.15em] [&>li]:before:top-[0.85em] [&>li]:before:h-px [&>li]:before:w-[0.55em] [&>li]:before:bg-(--rule-2) [&>li]:before:content-['']",
|
|
110
|
+
children: node.items.map((item, i) => renderItem(item, i, context))
|
|
111
|
+
},
|
|
112
|
+
key
|
|
113
|
+
)
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
function Markdown({
|
|
118
|
+
children,
|
|
119
|
+
headingLevelStart = 1,
|
|
120
|
+
idPrefix,
|
|
121
|
+
markExternalLinks = false,
|
|
122
|
+
parse = parseMarkdown
|
|
123
|
+
}) {
|
|
124
|
+
const context = { headingLevelStart, idPrefix, markExternalLinks, taken: /* @__PURE__ */ new Map() };
|
|
125
|
+
const nodes = typeof children === "string" ? parse(children) : [];
|
|
126
|
+
return /* @__PURE__ */ jsx(Fragment, { children: nodes.map((node, index) => renderBlock(node, index, context)) });
|
|
127
|
+
}
|
|
128
|
+
var Markdown_default = Markdown;
|
|
129
|
+
export {
|
|
130
|
+
Markdown,
|
|
131
|
+
Markdown_default as default,
|
|
132
|
+
parseMarkdown2 as parseMarkdown,
|
|
133
|
+
slugify2 as slugify
|
|
134
|
+
};
|
|
135
|
+
//# sourceMappingURL=Markdown.js.map
|