basalt-ui 0.4.2 → 1.0.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 +70 -0
- package/CHANGELOG.md +199 -41
- package/LICENSE +201 -0
- package/README.md +434 -160
- package/agent/rules/basalt-agent.md +395 -0
- package/agent/rules/basalt-charts.md +170 -0
- package/agent/rules/basalt-commands.md +320 -0
- package/agent/rules/basalt-content.md +390 -0
- package/agent/rules/basalt-data.md +237 -0
- package/agent/rules/basalt-forms.md +186 -0
- package/agent/rules/basalt-mantine.md +327 -0
- package/agent/rules/basalt-notifications.md +264 -0
- package/agent/rules/basalt-query.md +130 -0
- package/agent/rules/basalt-router.md +173 -0
- package/agent/rules/basalt-state.md +99 -0
- package/agent/rules/basalt-tokens.md +148 -0
- package/agent/templates/CLAUDE-block.md.tpl +35 -0
- package/agent/templates/DESIGN.md.tpl +71 -0
- package/agent/templates/__root.tpl +31 -0
- package/agent/templates/query-client.ts.tpl +12 -0
- package/bin/basalt.mjs +14 -0
- package/configs/check.yml +29 -0
- package/configs/lefthook.yml +21 -0
- package/configs/oxfmt.json +8 -0
- package/configs/oxlint-plugin.js +269 -0
- package/configs/oxlint-plugin.test.ts +107 -0
- package/configs/oxlint.json +116 -0
- package/configs/tsconfig.base.json +20 -0
- package/configs/tsconfig.node.json +8 -0
- package/configs/tsconfig.react-app.json +8 -0
- package/dist/agent/ai-sdk-transport.d.ts +85 -0
- package/dist/agent/ai-sdk-transport.d.ts.map +1 -0
- package/dist/agent/ai-sdk-transport.js +109 -0
- package/dist/agent/history.d.ts +55 -0
- package/dist/agent/history.d.ts.map +1 -0
- package/dist/agent/history.js +32 -0
- package/dist/agent/index.d.ts +53 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/index.js +23 -0
- package/dist/agent/outcome.d.ts +71 -0
- package/dist/agent/outcome.d.ts.map +1 -0
- package/dist/agent/outcome.js +30 -0
- package/dist/agent/part-list.d.ts +75 -0
- package/dist/agent/part-list.d.ts.map +1 -0
- package/dist/agent/part-list.js +127 -0
- package/dist/agent/parts.d.ts +91 -0
- package/dist/agent/parts.d.ts.map +1 -0
- package/dist/agent/parts.js +49 -0
- package/dist/agent/stick-to-bottom.d.ts +23 -0
- package/dist/agent/stick-to-bottom.d.ts.map +1 -0
- package/dist/agent/stick-to-bottom.js +73 -0
- package/dist/agent/thread.d.ts +124 -0
- package/dist/agent/thread.d.ts.map +1 -0
- package/dist/agent/thread.js +131 -0
- package/dist/agent/transport.d.ts +87 -0
- package/dist/agent/transport.d.ts.map +1 -0
- package/dist/agent/transport.js +21 -0
- package/dist/agent/use-agent-stream.d.ts +34 -0
- package/dist/agent/use-agent-stream.d.ts.map +1 -0
- package/dist/agent/use-agent-stream.js +56 -0
- package/dist/agent/use-agent-thread-runs.d.ts +72 -0
- package/dist/agent/use-agent-thread-runs.d.ts.map +1 -0
- package/dist/agent/use-agent-thread-runs.js +217 -0
- package/dist/agent-chat/composer.d.ts +18 -0
- package/dist/agent-chat/composer.d.ts.map +1 -0
- package/dist/agent-chat/composer.js +86 -0
- package/dist/agent-chat/index.d.ts +24 -0
- package/dist/agent-chat/index.d.ts.map +1 -0
- package/dist/agent-chat/index.js +15 -0
- package/dist/agent-chat/thread-detail-panel.d.ts +27 -0
- package/dist/agent-chat/thread-detail-panel.d.ts.map +1 -0
- package/dist/agent-chat/thread-detail-panel.js +108 -0
- package/dist/agent-chat/thread-feed.d.ts +18 -0
- package/dist/agent-chat/thread-feed.d.ts.map +1 -0
- package/dist/agent-chat/thread-feed.js +42 -0
- package/dist/agent-chat/thread-message.d.ts +31 -0
- package/dist/agent-chat/thread-message.d.ts.map +1 -0
- package/dist/agent-chat/thread-message.js +128 -0
- package/dist/agent-chat/thread-outcome-card.d.ts +19 -0
- package/dist/agent-chat/thread-outcome-card.d.ts.map +1 -0
- package/dist/agent-chat/thread-outcome-card.js +120 -0
- package/dist/agent-chat/thread-workspace.d.ts +27 -0
- package/dist/agent-chat/thread-workspace.d.ts.map +1 -0
- package/dist/agent-chat/thread-workspace.js +95 -0
- package/dist/charts/hooks/useChartSize.d.ts +25 -0
- package/dist/charts/hooks/useChartSize.d.ts.map +1 -0
- package/dist/charts/hooks/useChartSize.js +8 -0
- package/dist/charts/hooks/useChartTooltip.d.ts +13 -0
- package/dist/charts/hooks/useChartTooltip.d.ts.map +1 -0
- package/dist/charts/hooks/useChartTooltip.js +26 -0
- package/dist/charts/hooks/useHoverSync.d.ts +30 -0
- package/dist/charts/hooks/useHoverSync.d.ts.map +1 -0
- package/dist/charts/hooks/useHoverSync.js +70 -0
- package/dist/charts/hover-context.d.ts +21 -0
- package/dist/charts/hover-context.d.ts.map +1 -0
- package/dist/charts/hover-context.js +12 -0
- package/dist/charts/hover-sync.d.ts +14 -0
- package/dist/charts/hover-sync.d.ts.map +1 -0
- package/dist/charts/hover-sync.js +17 -0
- package/dist/charts/index.d.ts +47 -0
- package/dist/charts/index.d.ts.map +1 -0
- package/dist/charts/index.js +129 -0
- package/dist/charts/kinds/Bars.d.ts +129 -0
- package/dist/charts/kinds/Bars.d.ts.map +1 -0
- package/dist/charts/kinds/Bars.js +467 -0
- package/dist/charts/kinds/Donut.d.ts +65 -0
- package/dist/charts/kinds/Donut.d.ts.map +1 -0
- package/dist/charts/kinds/Donut.js +158 -0
- package/dist/charts/kinds/DualPanel.d.ts +67 -0
- package/dist/charts/kinds/DualPanel.d.ts.map +1 -0
- package/dist/charts/kinds/DualPanel.js +326 -0
- package/dist/charts/kinds/Heatmap.d.ts +59 -0
- package/dist/charts/kinds/Heatmap.d.ts.map +1 -0
- package/dist/charts/kinds/Heatmap.js +175 -0
- package/dist/charts/kinds/MultiLine.d.ts +73 -0
- package/dist/charts/kinds/MultiLine.d.ts.map +1 -0
- package/dist/charts/kinds/MultiLine.js +275 -0
- package/dist/charts/kinds/StackedArea.d.ts +35 -0
- package/dist/charts/kinds/StackedArea.d.ts.map +1 -0
- package/dist/charts/kinds/StackedArea.js +151 -0
- package/dist/charts/kinds/ZonedLine.d.ts +94 -0
- package/dist/charts/kinds/ZonedLine.d.ts.map +1 -0
- package/dist/charts/kinds/ZonedLine.js +218 -0
- package/dist/charts/primitives/AreaGradient.d.ts +18 -0
- package/dist/charts/primitives/AreaGradient.d.ts.map +1 -0
- package/dist/charts/primitives/AreaGradient.js +13 -0
- package/dist/charts/primitives/Axes.d.ts +22 -0
- package/dist/charts/primitives/Axes.d.ts.map +1 -0
- package/dist/charts/primitives/Axes.js +79 -0
- package/dist/charts/primitives/ChartCard.d.ts +14 -0
- package/dist/charts/primitives/ChartCard.d.ts.map +1 -0
- package/dist/charts/primitives/ChartCard.js +144 -0
- package/dist/charts/primitives/ChartFrame.d.ts +70 -0
- package/dist/charts/primitives/ChartFrame.d.ts.map +1 -0
- package/dist/charts/primitives/ChartFrame.js +77 -0
- package/dist/charts/primitives/ChartLegend.d.ts +36 -0
- package/dist/charts/primitives/ChartLegend.d.ts.map +1 -0
- package/dist/charts/primitives/ChartLegend.js +234 -0
- package/dist/charts/primitives/ChartTooltip.d.ts +34 -0
- package/dist/charts/primitives/ChartTooltip.d.ts.map +1 -0
- package/dist/charts/primitives/ChartTooltip.js +134 -0
- package/dist/charts/primitives/Crosshair.d.ts +23 -0
- package/dist/charts/primitives/Crosshair.d.ts.map +1 -0
- package/dist/charts/primitives/Crosshair.js +21 -0
- package/dist/charts/primitives/HoverOverlay.d.ts +9 -0
- package/dist/charts/primitives/HoverOverlay.d.ts.map +1 -0
- package/dist/charts/primitives/HoverOverlay.js +21 -0
- package/dist/charts/primitives/ResponsiveChart.d.ts +45 -0
- package/dist/charts/primitives/ResponsiveChart.d.ts.map +1 -0
- package/dist/charts/primitives/ResponsiveChart.js +24 -0
- package/dist/charts/primitives/ZoneRects.d.ts +38 -0
- package/dist/charts/primitives/ZoneRects.d.ts.map +1 -0
- package/dist/charts/primitives/ZoneRects.js +30 -0
- package/dist/charts/series.d.ts +99 -0
- package/dist/charts/series.d.ts.map +1 -0
- package/dist/charts/series.js +55 -0
- package/dist/charts/sparklines/BarSparkline.d.ts +13 -0
- package/dist/charts/sparklines/BarSparkline.d.ts.map +1 -0
- package/dist/charts/sparklines/BarSparkline.js +33 -0
- package/dist/charts/sparklines/LineSparkline.d.ts +15 -0
- package/dist/charts/sparklines/LineSparkline.d.ts.map +1 -0
- package/dist/charts/sparklines/LineSparkline.js +39 -0
- package/dist/charts/sparklines/index.d.ts +3 -0
- package/dist/charts/sparklines/index.d.ts.map +1 -0
- package/dist/charts/sparklines/index.js +6 -0
- package/dist/charts/theme.d.ts +21 -0
- package/dist/charts/theme.d.ts.map +1 -0
- package/dist/charts/theme.js +30 -0
- package/dist/charts/utils/domain.d.ts +20 -0
- package/dist/charts/utils/domain.d.ts.map +1 -0
- package/dist/charts/utils/domain.js +7 -0
- package/dist/charts/utils/format.d.ts +5 -0
- package/dist/charts/utils/format.d.ts.map +1 -0
- package/dist/charts/utils/format.js +27 -0
- package/dist/charts/utils/ticks.d.ts +5 -0
- package/dist/charts/utils/ticks.d.ts.map +1 -0
- package/dist/charts/utils/ticks.js +18 -0
- package/dist/cli/index.d.ts +273 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +907 -0
- package/dist/commands/ShortcutsHelp.d.ts +17 -0
- package/dist/commands/ShortcutsHelp.d.ts.map +1 -0
- package/dist/commands/ShortcutsHelp.js +64 -0
- package/dist/commands/define-commands.d.ts +140 -0
- package/dist/commands/define-commands.d.ts.map +1 -0
- package/dist/commands/define-commands.js +26 -0
- package/dist/commands/define-overlays.d.ts +134 -0
- package/dist/commands/define-overlays.d.ts.map +1 -0
- package/dist/commands/define-overlays.js +53 -0
- package/dist/commands/index.d.ts +42 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +46 -0
- package/dist/commands/overlays-mount.d.ts +117 -0
- package/dist/commands/overlays-mount.d.ts.map +1 -0
- package/dist/commands/overlays-mount.js +116 -0
- package/dist/commands/projectors.d.ts +152 -0
- package/dist/commands/projectors.d.ts.map +1 -0
- package/dist/commands/projectors.js +87 -0
- package/dist/commands/shortcut-format.d.ts +48 -0
- package/dist/commands/shortcut-format.d.ts.map +1 -0
- package/dist/commands/shortcut-format.js +33 -0
- package/dist/commands/useCommandHotkeys.d.ts +14 -0
- package/dist/commands/useCommandHotkeys.d.ts.map +1 -0
- package/dist/commands/useCommandHotkeys.js +45 -0
- package/dist/connectivity/connectivity-indicator.d.ts +8 -0
- package/dist/connectivity/connectivity-indicator.d.ts.map +1 -0
- package/dist/connectivity/connectivity-indicator.js +203 -0
- package/dist/connectivity/connectivity-provider.d.ts +7 -0
- package/dist/connectivity/connectivity-provider.d.ts.map +1 -0
- package/dist/connectivity/connectivity-provider.js +125 -0
- package/dist/connectivity/index.d.ts +13 -0
- package/dist/connectivity/index.d.ts.map +1 -0
- package/dist/connectivity/index.js +8 -0
- package/dist/connectivity/types.d.ts +36 -0
- package/dist/connectivity/types.d.ts.map +1 -0
- package/dist/connectivity/types.js +0 -0
- package/dist/connectivity/use-connectivity.d.ts +3 -0
- package/dist/connectivity/use-connectivity.d.ts.map +1 -0
- package/dist/connectivity/use-connectivity.js +14 -0
- package/dist/content/article-actions.d.ts +39 -0
- package/dist/content/article-actions.d.ts.map +1 -0
- package/dist/content/article-actions.js +28 -0
- package/dist/content/article-card.d.ts +58 -0
- package/dist/content/article-card.d.ts.map +1 -0
- package/dist/content/article-card.js +76 -0
- package/dist/content/article-card.module.css +109 -0
- package/dist/content/article-card.module.css.d.ts +16 -0
- package/dist/content/article-filter-bar.d.ts +40 -0
- package/dist/content/article-filter-bar.d.ts.map +1 -0
- package/dist/content/article-filter-bar.js +56 -0
- package/dist/content/article-layout.d.ts +61 -0
- package/dist/content/article-layout.d.ts.map +1 -0
- package/dist/content/article-layout.js +71 -0
- package/dist/content/article-layout.module.css +131 -0
- package/dist/content/article-layout.module.css.d.ts +20 -0
- package/dist/content/article-model.d.ts +62 -0
- package/dist/content/article-model.d.ts.map +1 -0
- package/dist/content/article-model.js +41 -0
- package/dist/content/block-split.d.ts +24 -0
- package/dist/content/block-split.d.ts.map +1 -0
- package/dist/content/block-split.js +63 -0
- package/dist/content/callout-alert.d.ts +27 -0
- package/dist/content/callout-alert.d.ts.map +1 -0
- package/dist/content/callout-alert.js +59 -0
- package/dist/content/callout.d.ts +24 -0
- package/dist/content/callout.d.ts.map +1 -0
- package/dist/content/callout.js +59 -0
- package/dist/content/callout.module.css +77 -0
- package/dist/content/callout.module.css.d.ts +16 -0
- package/dist/content/code-block.d.ts +26 -0
- package/dist/content/code-block.d.ts.map +1 -0
- package/dist/content/code-block.js +41 -0
- package/dist/content/code-block.module.css +86 -0
- package/dist/content/code-block.module.css.d.ts +14 -0
- package/dist/content/copy-action.d.ts +29 -0
- package/dist/content/copy-action.d.ts.map +1 -0
- package/dist/content/copy-action.js +46 -0
- package/dist/content/fence-block.d.ts +19 -0
- package/dist/content/fence-block.d.ts.map +1 -0
- package/dist/content/fence-block.js +23 -0
- package/dist/content/glyphs.d.ts +18 -0
- package/dist/content/glyphs.d.ts.map +1 -0
- package/dist/content/glyphs.js +43 -0
- package/dist/content/guide.d.ts +47 -0
- package/dist/content/guide.d.ts.map +1 -0
- package/dist/content/guide.js +110 -0
- package/dist/content/guide.module.css +62 -0
- package/dist/content/guide.module.css.d.ts +13 -0
- package/dist/content/heading-anchor.d.ts +8 -0
- package/dist/content/heading-anchor.d.ts.map +1 -0
- package/dist/content/heading-anchor.js +23 -0
- package/dist/content/heading-components.d.ts +5 -0
- package/dist/content/heading-components.d.ts.map +1 -0
- package/dist/content/heading-components.js +41 -0
- package/dist/content/highlighter.d.ts +8 -0
- package/dist/content/highlighter.d.ts.map +1 -0
- package/dist/content/highlighter.js +85 -0
- package/dist/content/index.d.ts +45 -0
- package/dist/content/index.d.ts.map +1 -0
- package/dist/content/index.js +43 -0
- package/dist/content/markdown-hast.d.ts +23 -0
- package/dist/content/markdown-hast.d.ts.map +1 -0
- package/dist/content/markdown-hast.js +48 -0
- package/dist/content/markdown.d.ts +68 -0
- package/dist/content/markdown.d.ts.map +1 -0
- package/dist/content/markdown.js +180 -0
- package/dist/content/mdx.d.ts +20 -0
- package/dist/content/mdx.d.ts.map +1 -0
- package/dist/content/mdx.js +64 -0
- package/dist/content/mermaid.d.ts +32 -0
- package/dist/content/mermaid.d.ts.map +1 -0
- package/dist/content/mermaid.js +70 -0
- package/dist/content/mermaid.module.css +20 -0
- package/dist/content/mermaid.module.css.d.ts +8 -0
- package/dist/content/prose.d.ts +29 -0
- package/dist/content/prose.d.ts.map +1 -0
- package/dist/content/prose.js +24 -0
- package/dist/content/prose.module.css +330 -0
- package/dist/content/prose.module.css.d.ts +12 -0
- package/dist/content/reading-progress.d.ts +20 -0
- package/dist/content/reading-progress.d.ts.map +1 -0
- package/dist/content/reading-progress.js +38 -0
- package/dist/content/reading-progress.module.css +22 -0
- package/dist/content/reading-progress.module.css.d.ts +9 -0
- package/dist/content/slug.d.ts +28 -0
- package/dist/content/slug.d.ts.map +1 -0
- package/dist/content/slug.js +28 -0
- package/dist/content/toc.d.ts +37 -0
- package/dist/content/toc.d.ts.map +1 -0
- package/dist/content/toc.js +134 -0
- package/dist/content/toc.module.css +51 -0
- package/dist/content/toc.module.css.d.ts +13 -0
- package/dist/content/url-hardening.d.ts +23 -0
- package/dist/content/url-hardening.d.ts.map +1 -0
- package/dist/content/url-hardening.js +23 -0
- package/dist/dashboard/delta-badge.d.ts +13 -0
- package/dist/dashboard/delta-badge.d.ts.map +1 -0
- package/dist/dashboard/delta-badge.js +45 -0
- package/dist/dashboard/empty-state.d.ts +15 -0
- package/dist/dashboard/empty-state.d.ts.map +1 -0
- package/dist/dashboard/empty-state.js +56 -0
- package/dist/dashboard/index.d.ts +5 -0
- package/dist/dashboard/index.d.ts.map +1 -0
- package/dist/dashboard/index.js +16 -0
- package/dist/dashboard/settings-section.d.ts +24 -0
- package/dist/dashboard/settings-section.d.ts.map +1 -0
- package/dist/dashboard/settings-section.js +61 -0
- package/dist/dashboard/settings-section.module.css +23 -0
- package/dist/dashboard/settings-section.module.css.d.ts +10 -0
- package/dist/dashboard/stat-card.d.ts +18 -0
- package/dist/dashboard/stat-card.d.ts.map +1 -0
- package/dist/dashboard/stat-card.js +74 -0
- package/dist/data/data-table.d.ts +198 -0
- package/dist/data/data-table.d.ts.map +1 -0
- package/dist/data/data-table.js +342 -0
- package/dist/data/index.d.ts +34 -0
- package/dist/data/index.d.ts.map +1 -0
- package/dist/data/index.js +2 -0
- package/dist/data/table.d.ts +24 -0
- package/dist/data/table.d.ts.map +1 -0
- package/dist/data/table.js +20 -0
- package/dist/data/virtual-list.d.ts +74 -0
- package/dist/data/virtual-list.d.ts.map +1 -0
- package/dist/data/virtual-list.js +86 -0
- package/dist/data/virtual.d.ts +20 -0
- package/dist/data/virtual.d.ts.map +1 -0
- package/dist/data/virtual.js +4 -0
- package/dist/forms/FormErrorSummary.d.ts +29 -0
- package/dist/forms/FormErrorSummary.d.ts.map +1 -0
- package/dist/forms/FormErrorSummary.js +28 -0
- package/dist/forms/create-form.d.ts +31 -0
- package/dist/forms/create-form.d.ts.map +1 -0
- package/dist/forms/create-form.js +18 -0
- package/dist/forms/field.d.ts +22 -0
- package/dist/forms/field.d.ts.map +1 -0
- package/dist/forms/field.js +9 -0
- package/dist/forms/index.d.ts +17 -0
- package/dist/forms/index.d.ts.map +1 -0
- package/dist/forms/index.js +13 -0
- package/dist/forms/use-form-draft.d.ts +61 -0
- package/dist/forms/use-form-draft.d.ts.map +1 -0
- package/dist/forms/use-form-draft.js +55 -0
- package/dist/guard/guard-hook.d.ts +40 -0
- package/dist/guard/guard-hook.d.ts.map +1 -0
- package/dist/guard/guard-hook.js +55 -0
- package/dist/guard/index.d.ts +144 -0
- package/dist/guard/index.d.ts.map +1 -0
- package/dist/guard/index.js +315 -0
- package/dist/guard/types.d.ts +97 -0
- package/dist/guard/types.d.ts.map +1 -0
- package/dist/guard/types.js +0 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +90 -0
- package/dist/motion/index.d.ts +29 -0
- package/dist/motion/index.d.ts.map +1 -0
- package/dist/motion/index.js +12 -0
- package/dist/notifications/bell.d.ts +12 -0
- package/dist/notifications/bell.d.ts.map +1 -0
- package/dist/notifications/bell.js +84 -0
- package/dist/notifications/center.d.ts +20 -0
- package/dist/notifications/center.d.ts.map +1 -0
- package/dist/notifications/center.js +144 -0
- package/dist/notifications/define-notifications.d.ts +97 -0
- package/dist/notifications/define-notifications.d.ts.map +1 -0
- package/dist/notifications/define-notifications.js +27 -0
- package/dist/notifications/index.d.ts +36 -0
- package/dist/notifications/index.d.ts.map +1 -0
- package/dist/notifications/index.js +52 -0
- package/dist/notifications/notify.d.ts +92 -0
- package/dist/notifications/notify.d.ts.map +1 -0
- package/dist/notifications/notify.js +127 -0
- package/dist/notifications/overlay.d.ts +20 -0
- package/dist/notifications/overlay.d.ts.map +1 -0
- package/dist/notifications/overlay.js +12 -0
- package/dist/notifications/store.d.ts +120 -0
- package/dist/notifications/store.d.ts.map +1 -0
- package/dist/notifications/store.js +113 -0
- package/dist/provider/index.d.ts +93 -0
- package/dist/provider/index.d.ts.map +1 -0
- package/dist/provider/index.js +106 -0
- package/dist/query/devtools.d.ts +21 -0
- package/dist/query/devtools.d.ts.map +1 -0
- package/dist/query/devtools.js +12 -0
- package/dist/query/index.d.ts +65 -0
- package/dist/query/index.d.ts.map +1 -0
- package/dist/query/index.js +68 -0
- package/dist/register.d.ts +139 -0
- package/dist/register.d.ts.map +1 -0
- package/dist/register.js +6 -0
- package/dist/router-tanstack/index.d.ts +74 -0
- package/dist/router-tanstack/index.d.ts.map +1 -0
- package/dist/router-tanstack/index.js +29 -0
- package/dist/router-tanstack/multi-search-param-store.d.ts +78 -0
- package/dist/router-tanstack/multi-search-param-store.d.ts.map +1 -0
- package/dist/router-tanstack/multi-search-param-store.js +35 -0
- package/dist/router-tanstack/search-param-store.d.ts +92 -0
- package/dist/router-tanstack/search-param-store.d.ts.map +1 -0
- package/dist/router-tanstack/search-param-store.js +26 -0
- package/dist/shell/account-types.d.ts +118 -0
- package/dist/shell/account-types.d.ts.map +1 -0
- package/dist/shell/account-types.js +0 -0
- package/dist/shell/app-breadcrumbs.d.ts +17 -0
- package/dist/shell/app-breadcrumbs.d.ts.map +1 -0
- package/dist/shell/app-breadcrumbs.js +39 -0
- package/dist/shell/app-header.module.css +73 -0
- package/dist/shell/app-header.module.css.d.ts +11 -0
- package/dist/shell/app-mobile-nav.d.ts +26 -0
- package/dist/shell/app-mobile-nav.d.ts.map +1 -0
- package/dist/shell/app-mobile-nav.js +106 -0
- package/dist/shell/app-mobile-nav.module.css +100 -0
- package/dist/shell/app-mobile-nav.module.css.d.ts +14 -0
- package/dist/shell/app-sidebar-account.d.ts +3 -0
- package/dist/shell/app-sidebar-account.d.ts.map +1 -0
- package/dist/shell/app-sidebar-account.js +84 -0
- package/dist/shell/app-sidebar.d.ts +56 -0
- package/dist/shell/app-sidebar.d.ts.map +1 -0
- package/dist/shell/app-sidebar.js +455 -0
- package/dist/shell/app-sidebar.module.css +414 -0
- package/dist/shell/app-sidebar.module.css.d.ts +34 -0
- package/dist/shell/index.d.ts +123 -0
- package/dist/shell/index.d.ts.map +1 -0
- package/dist/shell/index.js +179 -0
- package/dist/shell/page-header.d.ts +13 -0
- package/dist/shell/page-header.d.ts.map +1 -0
- package/dist/shell/page-header.js +23 -0
- package/dist/shell/sidebar-search.d.ts +12 -0
- package/dist/shell/sidebar-search.d.ts.map +1 -0
- package/dist/shell/sidebar-search.js +62 -0
- package/dist/shell/sidebar-search.module.css +62 -0
- package/dist/shell/sidebar-search.module.css.d.ts +11 -0
- package/dist/state.d.ts +62 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/state.js +124 -0
- package/dist/styles.css +166 -0
- package/dist/surfaces.d.ts +376 -0
- package/dist/surfaces.d.ts.map +1 -0
- package/dist/surfaces.js +306 -0
- package/dist/theme/controls.module.css +143 -0
- package/dist/theme/controls.module.css.d.ts +17 -0
- package/dist/theme/floating.module.css +35 -0
- package/dist/theme/floating.module.css.d.ts +9 -0
- package/dist/theme/index.d.ts +22 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +733 -0
- package/dist/theme/nav-link.module.css +67 -0
- package/dist/theme/nav-link.module.css.d.ts +8 -0
- package/dist/theme/segmented-control.module.css +14 -0
- package/dist/theme/segmented-control.module.css.d.ts +8 -0
- package/dist/theme/timeline.module.css +29 -0
- package/dist/theme/timeline.module.css.d.ts +9 -0
- package/dist/theme-lab/index.d.ts +59 -0
- package/dist/theme-lab/index.d.ts.map +1 -0
- package/dist/theme-lab/index.js +263 -0
- package/dist/theme-toggle/index.d.ts +8 -0
- package/dist/theme-toggle/index.d.ts.map +1 -0
- package/dist/theme-toggle/index.js +155 -0
- package/dist/tokens/index.d.ts +151 -0
- package/dist/tokens/index.d.ts.map +1 -0
- package/dist/tokens/index.js +246 -0
- package/dist/tokens/palette.d.ts +304 -0
- package/dist/tokens/palette.d.ts.map +1 -0
- package/dist/tokens/palette.js +186 -0
- package/dist/vite.d.ts +30 -0
- package/dist/vite.d.ts.map +1 -0
- package/dist/vite.js +68 -0
- package/llms.txt +149 -0
- package/package.json +243 -46
- package/src/agent/ai-sdk-transport.ts +280 -0
- package/src/agent/history.ts +128 -0
- package/src/agent/index.ts +92 -0
- package/src/agent/outcome.ts +120 -0
- package/src/agent/part-list.tsx +292 -0
- package/src/agent/parts.ts +136 -0
- package/src/agent/stick-to-bottom.tsx +154 -0
- package/src/agent/thread.ts +312 -0
- package/src/agent/transport.ts +114 -0
- package/src/agent/use-agent-stream.ts +141 -0
- package/src/agent/use-agent-thread-runs.ts +440 -0
- package/src/agent-chat/composer.tsx +131 -0
- package/src/agent-chat/index.ts +35 -0
- package/src/agent-chat/thread-detail-panel.tsx +192 -0
- package/src/agent-chat/thread-feed.tsx +81 -0
- package/src/agent-chat/thread-message.tsx +251 -0
- package/src/agent-chat/thread-outcome-card.tsx +196 -0
- package/src/agent-chat/thread-workspace.tsx +179 -0
- package/src/charts/hooks/useChartSize.ts +31 -0
- package/src/charts/hooks/useChartTooltip.ts +31 -0
- package/src/charts/hooks/useHoverSync.ts +116 -0
- package/src/charts/hover-context.ts +28 -0
- package/src/charts/hover-sync.tsx +37 -0
- package/src/charts/index.ts +118 -0
- package/src/charts/kinds/Bars.tsx +634 -0
- package/src/charts/kinds/Donut.tsx +233 -0
- package/src/charts/kinds/DualPanel.tsx +432 -0
- package/src/charts/kinds/Heatmap.tsx +255 -0
- package/src/charts/kinds/MultiLine.tsx +376 -0
- package/src/charts/kinds/StackedArea.tsx +218 -0
- package/src/charts/kinds/ZonedLine.tsx +346 -0
- package/src/charts/primitives/AreaGradient.tsx +26 -0
- package/src/charts/primitives/Axes.tsx +97 -0
- package/src/charts/primitives/ChartCard.tsx +180 -0
- package/src/charts/primitives/ChartFrame.tsx +157 -0
- package/src/charts/primitives/ChartLegend.tsx +302 -0
- package/src/charts/primitives/ChartTooltip.tsx +158 -0
- package/src/charts/primitives/Crosshair.tsx +40 -0
- package/src/charts/primitives/HoverOverlay.tsx +24 -0
- package/src/charts/primitives/ResponsiveChart.tsx +64 -0
- package/src/charts/primitives/ZoneRects.tsx +67 -0
- package/src/charts/series.ts +163 -0
- package/src/charts/sparklines/BarSparkline.tsx +48 -0
- package/src/charts/sparklines/LineSparkline.tsx +57 -0
- package/src/charts/sparklines/index.ts +2 -0
- package/src/charts/theme.tsx +53 -0
- package/src/charts/utils/domain.test.ts +24 -0
- package/src/charts/utils/domain.ts +22 -0
- package/src/charts/utils/format.ts +27 -0
- package/src/charts/utils/ticks.ts +18 -0
- package/src/cli/check-theme.test.ts +658 -0
- package/src/cli/index.ts +1497 -0
- package/src/cli/init-sync.test.ts +160 -0
- package/src/commands/ShortcutsHelp.tsx +129 -0
- package/src/commands/define-commands.ts +184 -0
- package/src/commands/define-overlays.ts +197 -0
- package/src/commands/index.ts +86 -0
- package/src/commands/overlays-mount.tsx +301 -0
- package/src/commands/projectors.ts +267 -0
- package/src/commands/shortcut-format.ts +83 -0
- package/src/commands/useCommandHotkeys.ts +114 -0
- package/src/connectivity/connectivity-indicator.tsx +249 -0
- package/src/connectivity/connectivity-provider.tsx +186 -0
- package/src/connectivity/index.ts +18 -0
- package/src/connectivity/types.ts +39 -0
- package/src/connectivity/use-connectivity.ts +25 -0
- package/src/content/article-actions.test.ts +78 -0
- package/src/content/article-actions.ts +72 -0
- package/src/content/article-card.module.css +109 -0
- package/src/content/article-card.module.css.d.ts +16 -0
- package/src/content/article-card.tsx +173 -0
- package/src/content/article-filter-bar.tsx +88 -0
- package/src/content/article-layout.module.css +131 -0
- package/src/content/article-layout.module.css.d.ts +20 -0
- package/src/content/article-layout.tsx +167 -0
- package/src/content/article-model.test.ts +119 -0
- package/src/content/article-model.ts +110 -0
- package/src/content/block-split.test.ts +75 -0
- package/src/content/block-split.ts +102 -0
- package/src/content/callout-alert.ts +88 -0
- package/src/content/callout.module.css +77 -0
- package/src/content/callout.module.css.d.ts +16 -0
- package/src/content/callout.tsx +96 -0
- package/src/content/code-block.module.css +86 -0
- package/src/content/code-block.module.css.d.ts +14 -0
- package/src/content/code-block.tsx +82 -0
- package/src/content/copy-action.tsx +79 -0
- package/src/content/fence-block.tsx +39 -0
- package/src/content/glyphs.tsx +53 -0
- package/src/content/guide.module.css +62 -0
- package/src/content/guide.module.css.d.ts +13 -0
- package/src/content/guide.tsx +174 -0
- package/src/content/heading-anchor.tsx +54 -0
- package/src/content/heading-components.tsx +62 -0
- package/src/content/highlighter.ts +123 -0
- package/src/content/index.ts +60 -0
- package/src/content/markdown-hast.ts +80 -0
- package/src/content/markdown.tsx +346 -0
- package/src/content/mdx.tsx +127 -0
- package/src/content/mermaid.module.css +20 -0
- package/src/content/mermaid.module.css.d.ts +8 -0
- package/src/content/mermaid.tsx +124 -0
- package/src/content/prose.module.css +330 -0
- package/src/content/prose.module.css.d.ts +12 -0
- package/src/content/prose.tsx +53 -0
- package/src/content/reading-progress.module.css +22 -0
- package/src/content/reading-progress.module.css.d.ts +9 -0
- package/src/content/reading-progress.tsx +67 -0
- package/src/content/slug.test.ts +62 -0
- package/src/content/slug.ts +57 -0
- package/src/content/toc.module.css +51 -0
- package/src/content/toc.module.css.d.ts +13 -0
- package/src/content/toc.tsx +226 -0
- package/src/content/url-hardening.ts +46 -0
- package/src/dashboard/delta-badge.tsx +70 -0
- package/src/dashboard/empty-state.tsx +80 -0
- package/src/dashboard/index.ts +11 -0
- package/src/dashboard/settings-section.module.css +23 -0
- package/src/dashboard/settings-section.module.css.d.ts +10 -0
- package/src/dashboard/settings-section.tsx +118 -0
- package/src/dashboard/stat-card.tsx +105 -0
- package/src/data/data-table.tsx +695 -0
- package/src/data/index.ts +37 -0
- package/src/data/table.ts +46 -0
- package/src/data/virtual-list.tsx +180 -0
- package/src/data/virtual.ts +21 -0
- package/src/forms/FormErrorSummary.tsx +64 -0
- package/src/forms/create-form.ts +57 -0
- package/src/forms/field.ts +30 -0
- package/src/forms/index.ts +26 -0
- package/src/forms/use-form-draft.ts +170 -0
- package/src/guard/check-source.test.ts +834 -0
- package/src/guard/guard-hook.test.ts +173 -0
- package/src/guard/guard-hook.ts +122 -0
- package/src/guard/index.ts +510 -0
- package/src/guard/types.ts +117 -0
- package/src/index.ts +139 -0
- package/src/motion/index.ts +26 -0
- package/src/notifications/bell.tsx +108 -0
- package/src/notifications/center.tsx +245 -0
- package/src/notifications/define-notifications.ts +162 -0
- package/src/notifications/index.ts +79 -0
- package/src/notifications/notify.tsx +260 -0
- package/src/notifications/overlay.tsx +64 -0
- package/src/notifications/store.ts +287 -0
- package/src/provider/index.tsx +234 -0
- package/src/query/devtools.tsx +38 -0
- package/src/query/index.ts +129 -0
- package/src/register.ts +158 -0
- package/src/router-tanstack/index.ts +111 -0
- package/src/router-tanstack/multi-search-param-store.test.ts +56 -0
- package/src/router-tanstack/multi-search-param-store.ts +122 -0
- package/src/router-tanstack/search-param-store.ts +125 -0
- package/src/shell/account-types.ts +119 -0
- package/src/shell/app-breadcrumbs.tsx +90 -0
- package/src/shell/app-header.module.css +73 -0
- package/src/shell/app-header.module.css.d.ts +11 -0
- package/src/shell/app-mobile-nav.module.css +100 -0
- package/src/shell/app-mobile-nav.module.css.d.ts +14 -0
- package/src/shell/app-mobile-nav.tsx +146 -0
- package/src/shell/app-sidebar-account.tsx +142 -0
- package/src/shell/app-sidebar.module.css +414 -0
- package/src/shell/app-sidebar.module.css.d.ts +34 -0
- package/src/shell/app-sidebar.tsx +632 -0
- package/src/shell/index.tsx +343 -0
- package/src/shell/page-header.tsx +35 -0
- package/src/shell/sidebar-search.module.css +62 -0
- package/src/shell/sidebar-search.module.css.d.ts +11 -0
- package/src/shell/sidebar-search.tsx +80 -0
- package/src/state.ts +246 -0
- package/src/styles.css +166 -0
- package/src/styles.floor.test.ts +36 -0
- package/src/surfaces.ts +489 -0
- package/src/theme/border-coverage.test.ts +272 -0
- package/src/theme/contrast.test.ts +306 -0
- package/src/theme/controls.module.css +143 -0
- package/src/theme/controls.module.css.d.ts +17 -0
- package/src/theme/floating.module.css +35 -0
- package/src/theme/floating.module.css.d.ts +9 -0
- package/src/theme/index.ts +933 -0
- package/src/theme/nav-link.module.css +67 -0
- package/src/theme/nav-link.module.css.d.ts +8 -0
- package/src/theme/segmented-control.module.css +14 -0
- package/src/theme/segmented-control.module.css.d.ts +8 -0
- package/src/theme/shadow-surfaces.test.ts +421 -0
- package/src/theme/timeline.module.css +29 -0
- package/src/theme/timeline.module.css.d.ts +9 -0
- package/src/theme-lab/index.tsx +359 -0
- package/src/theme-lab/theme-lab.test.ts +60 -0
- package/src/theme-toggle/index.tsx +180 -0
- package/src/tokens/index.ts +363 -0
- package/src/tokens/palette.ts +288 -0
- package/src/vite.ts +122 -0
- package/src/index.css +0 -877
- package/src/starlight.css +0 -308
- package/tailwind.config.js +0 -78
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Callout — a soft tinted panel with a left rail, keyed to one of the four semantic tokens.
|
|
3
|
+
* `--callout-ink` is set per kind below and consumed by both the rail/bg tint and the title/icon
|
|
4
|
+
* color — one custom property, no per-kind duplication.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
.root {
|
|
8
|
+
border-radius: var(--vx-radius-card);
|
|
9
|
+
padding: 10px 14px;
|
|
10
|
+
border-left: 2px solid var(--callout-ink);
|
|
11
|
+
background: color-mix(in srgb, var(--callout-ink) 8%, transparent);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.root > :first-child {
|
|
15
|
+
margin-top: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.root > :last-child {
|
|
19
|
+
margin-bottom: 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.info {
|
|
23
|
+
--callout-ink: var(--vx-accent);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.good {
|
|
27
|
+
--callout-ink: var(--vx-goodSolid);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.warn {
|
|
31
|
+
--callout-ink: var(--vx-warnSolid);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.bad {
|
|
35
|
+
--callout-ink: var(--vx-badSolid);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.titleRow {
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
gap: 8px;
|
|
42
|
+
margin-bottom: 4px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.icon {
|
|
46
|
+
display: inline-flex;
|
|
47
|
+
color: var(--callout-ink);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.title {
|
|
51
|
+
font-family: var(--basalt-font-head);
|
|
52
|
+
font-stretch: 88%;
|
|
53
|
+
font-weight: 550;
|
|
54
|
+
font-size: var(--vx-text-md);
|
|
55
|
+
color: var(--callout-ink);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.body {
|
|
59
|
+
font-size: var(--vx-text-md);
|
|
60
|
+
color: var(--vx-ink2);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* Scoped under `.root` to reach (0,3,0): a Callout rendered inside `Prose` is also matched by
|
|
64
|
+
* `.root.article p` (0,2,1) from prose.module.css, which out-specifies a bare `.body > :last-child`
|
|
65
|
+
* and re-asserted a 14px bottom margin on the last paragraph — 24px of padding under the text where
|
|
66
|
+
* the panel specifies 10px. */
|
|
67
|
+
.root .body > :first-child {
|
|
68
|
+
margin-top: 0;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.root .body > :last-child {
|
|
72
|
+
margin-bottom: 0;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.body p {
|
|
76
|
+
margin: 0 0 8px;
|
|
77
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed CSS-module declaration (the S4 CSS-modules path). Named string props — not an index
|
|
3
|
+
* signature — so dot access stays verbatim under the package's strict flags.
|
|
4
|
+
*/
|
|
5
|
+
declare const classes: {
|
|
6
|
+
readonly root: string
|
|
7
|
+
readonly info: string
|
|
8
|
+
readonly good: string
|
|
9
|
+
readonly warn: string
|
|
10
|
+
readonly bad: string
|
|
11
|
+
readonly titleRow: string
|
|
12
|
+
readonly icon: string
|
|
13
|
+
readonly title: string
|
|
14
|
+
readonly body: string
|
|
15
|
+
}
|
|
16
|
+
export default classes
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Callout — a soft tinted panel keyed to a semantic kind (docs/CONTENT-SPEC.md §3).
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* import { Callout } from 'basalt-ui/content'
|
|
6
|
+
*
|
|
7
|
+
* <Callout kind="warn" title="Heads up">
|
|
8
|
+
* <p>This endpoint is rate-limited to 60 requests/minute.</p>
|
|
9
|
+
* </Callout>
|
|
10
|
+
*/
|
|
11
|
+
import type { CSSProperties, ReactNode } from 'react'
|
|
12
|
+
import classes from './callout.module.css'
|
|
13
|
+
|
|
14
|
+
export type CalloutKind = 'info' | 'good' | 'warn' | 'bad'
|
|
15
|
+
|
|
16
|
+
export type CalloutProps = {
|
|
17
|
+
/** Semantic kind — drives the rail/tint color and the default icon. Default `'info'`. */
|
|
18
|
+
readonly kind?: CalloutKind
|
|
19
|
+
readonly title?: string
|
|
20
|
+
/** Overrides the default per-kind icon. Only rendered alongside a `title`. */
|
|
21
|
+
readonly icon?: ReactNode
|
|
22
|
+
readonly children: ReactNode
|
|
23
|
+
readonly className?: string
|
|
24
|
+
readonly style?: CSSProperties
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const KIND_CLASS: Record<CalloutKind, string> = {
|
|
28
|
+
info: classes.info,
|
|
29
|
+
good: classes.good,
|
|
30
|
+
warn: classes.warn,
|
|
31
|
+
bad: classes.bad,
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function InfoGlyph() {
|
|
35
|
+
return (
|
|
36
|
+
<svg width={16} height={16} viewBox="0 0 24 24" fill="none" stroke="currentColor" aria-hidden>
|
|
37
|
+
<path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" strokeWidth={2} />
|
|
38
|
+
<path
|
|
39
|
+
d="M12 9h.01M11 12h1v4h1"
|
|
40
|
+
strokeWidth={2}
|
|
41
|
+
strokeLinecap="round"
|
|
42
|
+
strokeLinejoin="round"
|
|
43
|
+
/>
|
|
44
|
+
</svg>
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function GoodGlyph() {
|
|
49
|
+
return (
|
|
50
|
+
<svg width={16} height={16} viewBox="0 0 24 24" fill="none" stroke="currentColor" aria-hidden>
|
|
51
|
+
<path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" strokeWidth={2} />
|
|
52
|
+
<path d="M9 12l2 2l4 -4" strokeWidth={2} strokeLinecap="round" strokeLinejoin="round" />
|
|
53
|
+
</svg>
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function WarnGlyph() {
|
|
58
|
+
return (
|
|
59
|
+
<svg width={16} height={16} viewBox="0 0 24 24" fill="none" stroke="currentColor" aria-hidden>
|
|
60
|
+
<path d="M12 4l9 16h-18z" strokeWidth={2} strokeLinecap="round" strokeLinejoin="round" />
|
|
61
|
+
<path d="M12 10v3M12 16.5v.01" strokeWidth={2} strokeLinecap="round" />
|
|
62
|
+
</svg>
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function BadGlyph() {
|
|
67
|
+
return (
|
|
68
|
+
<svg width={16} height={16} viewBox="0 0 24 24" fill="none" stroke="currentColor" aria-hidden>
|
|
69
|
+
<path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" strokeWidth={2} />
|
|
70
|
+
<path d="M9.5 9.5l5 5M14.5 9.5l-5 5" strokeWidth={2} strokeLinecap="round" />
|
|
71
|
+
</svg>
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const DEFAULT_ICON: Record<CalloutKind, ReactNode> = {
|
|
76
|
+
info: <InfoGlyph />,
|
|
77
|
+
good: <GoodGlyph />,
|
|
78
|
+
warn: <WarnGlyph />,
|
|
79
|
+
bad: <BadGlyph />,
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export function Callout({ kind = 'info', title, icon, children, className, style }: CalloutProps) {
|
|
83
|
+
const rootClass = [classes.root, KIND_CLASS[kind], className].filter(Boolean).join(' ')
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<div className={rootClass} {...(style !== undefined && { style })}>
|
|
87
|
+
{title !== undefined && (
|
|
88
|
+
<div className={classes.titleRow}>
|
|
89
|
+
<span className={classes.icon}>{icon ?? DEFAULT_ICON[kind]}</span>
|
|
90
|
+
<span className={classes.title}>{title}</span>
|
|
91
|
+
</div>
|
|
92
|
+
)}
|
|
93
|
+
<div className={classes.body}>{children}</div>
|
|
94
|
+
</div>
|
|
95
|
+
)
|
|
96
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* CodeBlock chrome. The OUTER container owns the surface (bg/radius/border); shiki's own
|
|
3
|
+
* `<pre class="shiki">` (when highlighting resolved) has its margin/padding/background reset so it
|
|
4
|
+
* never fights the container for the surface — see `.body :global(pre.shiki)` below.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
.container {
|
|
8
|
+
position: relative;
|
|
9
|
+
border-radius: 8px;
|
|
10
|
+
background-color: color-mix(in srgb, var(--vx-ink) 6%, transparent);
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.header {
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: space-between;
|
|
18
|
+
gap: 8px;
|
|
19
|
+
padding: 6px 10px 6px 14px;
|
|
20
|
+
border-bottom: 1px solid var(--vx-divider);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.title {
|
|
24
|
+
font-family: var(--basalt-font-mono);
|
|
25
|
+
font-size: var(--vx-text-xs);
|
|
26
|
+
color: var(--vx-ink2);
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
text-overflow: ellipsis;
|
|
29
|
+
white-space: nowrap;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.headerRight {
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
gap: 6px;
|
|
36
|
+
flex-shrink: 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.langBadge {
|
|
40
|
+
font-family: var(--basalt-font-mono);
|
|
41
|
+
font-size: var(--vx-text-micro);
|
|
42
|
+
letter-spacing: 0.06em;
|
|
43
|
+
text-transform: uppercase;
|
|
44
|
+
color: var(--vx-faint);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* Body — shared padding/font/scroll treatment across both the plain `<pre>` fallback and the
|
|
48
|
+
* shiki-highlighted `<div>` wrapper (X-axis scroll is the sanctioned overflow exception). */
|
|
49
|
+
.body {
|
|
50
|
+
margin: 0;
|
|
51
|
+
font-family: var(--basalt-font-mono);
|
|
52
|
+
font-size: var(--vx-text-sm);
|
|
53
|
+
line-height: 1.6;
|
|
54
|
+
padding: 10px 14px;
|
|
55
|
+
overflow-x: auto;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.body :global(pre.shiki) {
|
|
59
|
+
margin: 0;
|
|
60
|
+
padding: 0;
|
|
61
|
+
background: transparent !important;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* Dual-theme activation — shiki's `defaultColor: false` emits `--shiki-{light,dark}` vars only;
|
|
65
|
+
* dark is the basalt default, light activates under the Mantine light scheme attribute. */
|
|
66
|
+
.body :global(.shiki span) {
|
|
67
|
+
color: var(--shiki-dark);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
html[data-mantine-color-scheme='light'] .body :global(.shiki span) {
|
|
71
|
+
color: var(--shiki-light);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* Floating copy button — shown only when there is no header (no title), revealed on hover/focus. */
|
|
75
|
+
.floatingCopy {
|
|
76
|
+
position: absolute;
|
|
77
|
+
top: 6px;
|
|
78
|
+
right: 6px;
|
|
79
|
+
opacity: 0;
|
|
80
|
+
transition: opacity 120ms ease;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.container:hover .floatingCopy,
|
|
84
|
+
.container:focus-within .floatingCopy {
|
|
85
|
+
opacity: 1;
|
|
86
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed CSS-module declaration (the S4 CSS-modules path). Named string props — not an index
|
|
3
|
+
* signature — so dot access stays verbatim under the package's strict flags.
|
|
4
|
+
*/
|
|
5
|
+
declare const classes: {
|
|
6
|
+
readonly container: string
|
|
7
|
+
readonly header: string
|
|
8
|
+
readonly title: string
|
|
9
|
+
readonly headerRight: string
|
|
10
|
+
readonly langBadge: string
|
|
11
|
+
readonly body: string
|
|
12
|
+
readonly floatingCopy: string
|
|
13
|
+
}
|
|
14
|
+
export default classes
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CodeBlock — a chrome'd fenced code block with shiki syntax highlighting (optional peer, lazy
|
|
3
|
+
* singleton), a copy button, and an optional filename/title tab (docs/CONTENT-SPEC.md §3).
|
|
4
|
+
*
|
|
5
|
+
* Degrades to a plain mono `<pre>` when `shiki` is not installed, when `language` is omitted, or
|
|
6
|
+
* when the language isn't in the curated map — never a crash, never an unhandled rejection (see
|
|
7
|
+
* `./highlighter`).
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* import { CodeBlock } from 'basalt-ui/content'
|
|
11
|
+
*
|
|
12
|
+
* <CodeBlock title="vite.config.ts" language="ts" code={source} />
|
|
13
|
+
* <CodeBlock language="bash" code="bun add basalt-ui" showCopy />
|
|
14
|
+
*/
|
|
15
|
+
import type { CSSProperties } from 'react'
|
|
16
|
+
import { useEffect, useState } from 'react'
|
|
17
|
+
import classes from './code-block.module.css'
|
|
18
|
+
import { CopyAction } from './copy-action'
|
|
19
|
+
import { highlightCode } from './highlighter'
|
|
20
|
+
|
|
21
|
+
export type CodeBlockProps = {
|
|
22
|
+
readonly code: string
|
|
23
|
+
readonly language?: string
|
|
24
|
+
readonly title?: string
|
|
25
|
+
/** Show the copy-to-clipboard action. Default `true`. */
|
|
26
|
+
readonly showCopy?: boolean
|
|
27
|
+
readonly className?: string
|
|
28
|
+
readonly style?: CSSProperties
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function CodeBlock({
|
|
32
|
+
code,
|
|
33
|
+
language,
|
|
34
|
+
title,
|
|
35
|
+
showCopy = true,
|
|
36
|
+
className,
|
|
37
|
+
style,
|
|
38
|
+
}: CodeBlockProps) {
|
|
39
|
+
// Intentionally NOT reset on every code/language change — keeping the last-good html while a
|
|
40
|
+
// re-highlight is in flight avoids a flash back to plain mono on every keystroke of streamed code.
|
|
41
|
+
const [html, setHtml] = useState<string | null>(null)
|
|
42
|
+
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
if (language === undefined) return
|
|
45
|
+
let cancelled = false
|
|
46
|
+
highlightCode(code, language).then((result) => {
|
|
47
|
+
if (!cancelled) setHtml(result)
|
|
48
|
+
return undefined
|
|
49
|
+
})
|
|
50
|
+
return () => {
|
|
51
|
+
cancelled = true
|
|
52
|
+
}
|
|
53
|
+
}, [code, language])
|
|
54
|
+
|
|
55
|
+
const containerClass = [classes.container, className].filter(Boolean).join(' ')
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<div className={containerClass} {...(style !== undefined && { style })}>
|
|
59
|
+
{title !== undefined && (
|
|
60
|
+
<div className={classes.header}>
|
|
61
|
+
<span className={classes.title}>{title}</span>
|
|
62
|
+
<div className={classes.headerRight}>
|
|
63
|
+
{language !== undefined && <span className={classes.langBadge}>{language}</span>}
|
|
64
|
+
{showCopy && <CopyAction value={code} ariaLabel="Copy code" />}
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
)}
|
|
68
|
+
{html !== null ? (
|
|
69
|
+
<div className={classes.body} dangerouslySetInnerHTML={{ __html: html }} />
|
|
70
|
+
) : (
|
|
71
|
+
<pre className={classes.body}>
|
|
72
|
+
<code>{code}</code>
|
|
73
|
+
</pre>
|
|
74
|
+
)}
|
|
75
|
+
{title === undefined && showCopy && (
|
|
76
|
+
<div className={classes.floatingCopy}>
|
|
77
|
+
<CopyAction value={code} ariaLabel="Copy code" />
|
|
78
|
+
</div>
|
|
79
|
+
)}
|
|
80
|
+
</div>
|
|
81
|
+
)
|
|
82
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CopyAction — the content surface's ONE copy-to-clipboard affordance: a subtle icon button whose
|
|
3
|
+
* tooltip reads "Copy" → "Copied" and whose glyph swaps to a teal check for a beat. `CodeBlock`
|
|
4
|
+
* (copy the snippet) and `HeadingAnchor` (copy a link to the section) both render THIS component,
|
|
5
|
+
* so the two never drift into two different copy languages.
|
|
6
|
+
*
|
|
7
|
+
* The check + tooltip are the entire success signal — no notification (docs/CONTENT-SPEC.md §7).
|
|
8
|
+
* `color="teal"` resolves through the bridged Mantine family, so it stays on the token layer in
|
|
9
|
+
* both schemes (see the package CLAUDE.md on `cssVariablesResolver`).
|
|
10
|
+
*
|
|
11
|
+
* Not part of the public surface — reach it through `CodeBlock` / `HeadingAnchor`.
|
|
12
|
+
*/
|
|
13
|
+
import type { FloatingPosition } from '@mantine/core'
|
|
14
|
+
import type { ReactNode } from 'react'
|
|
15
|
+
import { useEffect, useRef, useState } from 'react'
|
|
16
|
+
import { ActionIcon, Tooltip } from '@mantine/core'
|
|
17
|
+
import { CheckGlyph, CopyGlyph } from './glyphs'
|
|
18
|
+
|
|
19
|
+
const COPIED_RESET_MS = 1500
|
|
20
|
+
|
|
21
|
+
export type CopyActionProps = {
|
|
22
|
+
/**
|
|
23
|
+
* The text to copy. Pass a resolver to defer it to click time — a value derived from live
|
|
24
|
+
* browser state (the current URL) would otherwise be captured at render, and read stale.
|
|
25
|
+
*/
|
|
26
|
+
readonly value: string | (() => string)
|
|
27
|
+
readonly label?: string
|
|
28
|
+
readonly copiedLabel?: string
|
|
29
|
+
readonly ariaLabel: string
|
|
30
|
+
readonly tooltipPosition?: FloatingPosition
|
|
31
|
+
/** Resting glyph. Defaults to the copy glyph; a heading anchor shows a link instead. */
|
|
32
|
+
readonly glyph?: ReactNode
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function CopyAction({
|
|
36
|
+
value,
|
|
37
|
+
label = 'Copy',
|
|
38
|
+
copiedLabel = 'Copied',
|
|
39
|
+
ariaLabel,
|
|
40
|
+
tooltipPosition = 'left',
|
|
41
|
+
glyph,
|
|
42
|
+
}: CopyActionProps) {
|
|
43
|
+
const [copied, setCopied] = useState(false)
|
|
44
|
+
const timer = useRef<ReturnType<typeof setTimeout> | null>(null)
|
|
45
|
+
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
return () => {
|
|
48
|
+
if (timer.current !== null) clearTimeout(timer.current)
|
|
49
|
+
}
|
|
50
|
+
}, [])
|
|
51
|
+
|
|
52
|
+
const handleCopy = async () => {
|
|
53
|
+
// Clipboard is unavailable on insecure origins — say nothing rather than flash a check we
|
|
54
|
+
// didn't earn.
|
|
55
|
+
if (!navigator.clipboard) return
|
|
56
|
+
try {
|
|
57
|
+
await navigator.clipboard.writeText(typeof value === 'function' ? value() : value)
|
|
58
|
+
} catch {
|
|
59
|
+
return
|
|
60
|
+
}
|
|
61
|
+
setCopied(true)
|
|
62
|
+
if (timer.current !== null) clearTimeout(timer.current)
|
|
63
|
+
timer.current = setTimeout(() => setCopied(false), COPIED_RESET_MS)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<Tooltip label={copied ? copiedLabel : label} withArrow position={tooltipPosition}>
|
|
68
|
+
<ActionIcon
|
|
69
|
+
variant="subtle"
|
|
70
|
+
size="sm"
|
|
71
|
+
color={copied ? 'teal' : 'gray'}
|
|
72
|
+
onClick={handleCopy}
|
|
73
|
+
aria-label={ariaLabel}
|
|
74
|
+
>
|
|
75
|
+
{copied ? <CheckGlyph /> : (glyph ?? <CopyGlyph />)}
|
|
76
|
+
</ActionIcon>
|
|
77
|
+
</Tooltip>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FenceBlock — renders a fenced code block's hast `pre` node as `CodeBlock` or `MermaidDiagram`
|
|
3
|
+
* (docs/CONTENT-SPEC.md §2 decision 4 / §6). Shared by every `pre` override `./markdown` builds
|
|
4
|
+
* (one per streamed block, each with its own `settled` flag).
|
|
5
|
+
*
|
|
6
|
+
* `mermaid` fences render as a plain `CodeBlock` while `settled` is `false` (the in-flight
|
|
7
|
+
* streaming tail) and upgrade to `MermaidDiagram` once the fence's block settles — no flicker, no
|
|
8
|
+
* wasted parse pass on a still-changing diagram. Every other fenced language hides its copy
|
|
9
|
+
* action while unsettled for the same reason (copying a still-streaming block is misleading).
|
|
10
|
+
*
|
|
11
|
+
* Not part of the public surface.
|
|
12
|
+
*/
|
|
13
|
+
import type { Element } from 'hast'
|
|
14
|
+
import { CodeBlock } from './code-block'
|
|
15
|
+
import { extractFenceInfo } from './markdown-hast'
|
|
16
|
+
import { MermaidDiagram } from './mermaid'
|
|
17
|
+
|
|
18
|
+
export type FenceBlockProps = {
|
|
19
|
+
readonly node?: Element
|
|
20
|
+
readonly settled: boolean
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function FenceBlock({ node, settled }: FenceBlockProps) {
|
|
24
|
+
const fence = node ? extractFenceInfo(node) : undefined
|
|
25
|
+
if (!fence) return null
|
|
26
|
+
|
|
27
|
+
if (fence.language === 'mermaid' && settled) {
|
|
28
|
+
return <MermaidDiagram code={fence.code} />
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<CodeBlock
|
|
33
|
+
code={fence.code}
|
|
34
|
+
showCopy={settled}
|
|
35
|
+
{...(fence.language !== undefined && { language: fence.language })}
|
|
36
|
+
{...(fence.title !== undefined && { title: fence.title })}
|
|
37
|
+
/>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The content surface's inline glyph set. Shared so every copy affordance reads as ONE idiom —
|
|
3
|
+
* `CodeBlock`'s copy button and a heading's copy-link anchor resolve the same check, not two
|
|
4
|
+
* hand-drawn ones that drift apart.
|
|
5
|
+
*
|
|
6
|
+
* Inline SVG rather than an icon dep: the framework takes icons as `ReactNode` from the consumer
|
|
7
|
+
* (see the package CLAUDE.md) and ships none, but these are internal chrome of a shipped component,
|
|
8
|
+
* not a consumer-facing slot. `currentColor` + `1em`-agnostic sizing keeps them steerable from CSS
|
|
9
|
+
* — the heading anchor sizes its glyph as an optical ratio of whatever step the heading lands on
|
|
10
|
+
* (docs/DESIGN-SPEC.md §3), while the code-block chrome pins a fixed 14px.
|
|
11
|
+
*
|
|
12
|
+
* Not part of the public surface.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
export function CopyGlyph() {
|
|
16
|
+
return (
|
|
17
|
+
<svg width={14} height={14} viewBox="0 0 24 24" fill="none" stroke="currentColor" aria-hidden>
|
|
18
|
+
<path
|
|
19
|
+
d="M8 8m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z"
|
|
20
|
+
strokeWidth={2}
|
|
21
|
+
/>
|
|
22
|
+
<path d="M16 8V6a2 2 0 0 0 -2 -2H6a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2" strokeWidth={2} />
|
|
23
|
+
</svg>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function CheckGlyph() {
|
|
28
|
+
return (
|
|
29
|
+
<svg width={14} height={14} viewBox="0 0 24 24" fill="none" stroke="currentColor" aria-hidden>
|
|
30
|
+
<path d="M5 12l5 5l10 -10" strokeWidth={2} strokeLinecap="round" strokeLinejoin="round" />
|
|
31
|
+
</svg>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Chain/link glyph — the "copy a link to this section" affordance on a heading. */
|
|
36
|
+
export function LinkGlyph() {
|
|
37
|
+
return (
|
|
38
|
+
<svg width={14} height={14} viewBox="0 0 24 24" fill="none" stroke="currentColor" aria-hidden>
|
|
39
|
+
<path
|
|
40
|
+
d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"
|
|
41
|
+
strokeWidth={2}
|
|
42
|
+
strokeLinecap="round"
|
|
43
|
+
strokeLinejoin="round"
|
|
44
|
+
/>
|
|
45
|
+
<path
|
|
46
|
+
d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"
|
|
47
|
+
strokeWidth={2}
|
|
48
|
+
strokeLinecap="round"
|
|
49
|
+
strokeLinejoin="round"
|
|
50
|
+
/>
|
|
51
|
+
</svg>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* GuideDrawer / GuideLink — contextual in-app docs (docs/CONTENT-SPEC.md §2 decision 8 / §3). The
|
|
3
|
+
* trigger must read as QUIET (faint ink, accent on hover) — never a loud button, this is a
|
|
4
|
+
* "there's more context here" affordance, not a primary action.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
.drawerTitle {
|
|
8
|
+
font-family: var(--basalt-font-head);
|
|
9
|
+
font-stretch: 88%;
|
|
10
|
+
font-weight: 550;
|
|
11
|
+
font-size: var(--vx-text-md);
|
|
12
|
+
color: var(--vx-ink);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.body {
|
|
16
|
+
padding-bottom: 8px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.footer {
|
|
20
|
+
margin-top: 20px;
|
|
21
|
+
padding-top: 16px;
|
|
22
|
+
border-top: 1px solid var(--vx-divider);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* Consumer `renderLink` anchors inside the footer inherit the quiet footer-link treatment instead
|
|
26
|
+
* of browser anchor defaults. */
|
|
27
|
+
.footer a {
|
|
28
|
+
font-size: var(--vx-text-sm);
|
|
29
|
+
color: var(--vx-muted);
|
|
30
|
+
text-decoration: none;
|
|
31
|
+
transition: color 120ms ease;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.footer a:hover {
|
|
35
|
+
color: var(--vx-accent);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.footerLink {
|
|
39
|
+
font-size: var(--vx-text-sm);
|
|
40
|
+
color: var(--vx-muted);
|
|
41
|
+
text-decoration: none;
|
|
42
|
+
transition: color 120ms ease;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.footerLink:hover {
|
|
46
|
+
color: var(--vx-accent);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.trigger {
|
|
50
|
+
color: var(--vx-faint) !important;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.trigger:hover {
|
|
54
|
+
color: var(--vx-accent) !important;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.triggerLabel {
|
|
58
|
+
font-family: var(--basalt-font-mono);
|
|
59
|
+
font-size: var(--vx-text-micro);
|
|
60
|
+
letter-spacing: 0.06em;
|
|
61
|
+
text-transform: uppercase;
|
|
62
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed CSS-module declaration (the S4 CSS-modules path). Named string props — not an index
|
|
3
|
+
* signature — so dot access stays verbatim under the package's strict flags.
|
|
4
|
+
*/
|
|
5
|
+
declare const classes: {
|
|
6
|
+
readonly drawerTitle: string
|
|
7
|
+
readonly body: string
|
|
8
|
+
readonly footer: string
|
|
9
|
+
readonly footerLink: string
|
|
10
|
+
readonly trigger: string
|
|
11
|
+
readonly triggerLabel: string
|
|
12
|
+
}
|
|
13
|
+
export default classes
|