@shavin/ui 0.0.0-stage → 0.1.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/CHANGELOG.md +94 -0
- package/LICENSE +21 -0
- package/README.md +81 -2
- package/components.json +15771 -0
- package/dist/authoring/types.js +0 -0
- package/dist/icons.d.ts +20 -0
- package/dist/icons.js +6 -0
- package/dist/index.d.ts +3325 -0
- package/dist/index.js +531 -0
- package/dist/inspector/FindingPopover.js +252 -0
- package/dist/inspector/Highlight.js +76 -0
- package/dist/inspector/Inspector.js +420 -0
- package/dist/inspector/InspectorRoot.js +75 -0
- package/dist/inspector/IssuesLayer.js +134 -0
- package/dist/inspector/IssuesList.js +174 -0
- package/dist/inspector/SettingsPanel.js +89 -0
- package/dist/inspector/ShavinMark.js +22 -0
- package/dist/inspector/Toolbar.js +202 -0
- package/dist/inspector/barPlacement.js +117 -0
- package/dist/inspector/env.js +59 -0
- package/dist/inspector/geometry.js +44 -0
- package/dist/inspector/ignored.js +52 -0
- package/dist/inspector/index.js +7 -0
- package/dist/inspector/journalClient.js +57 -0
- package/dist/inspector/journalState.js +36 -0
- package/dist/inspector/pin.js +43 -0
- package/dist/inspector/placement.js +96 -0
- package/dist/inspector/prompt.js +63 -0
- package/dist/inspector/scheme.js +56 -0
- package/dist/inspector/settings.js +54 -0
- package/dist/inspector/strings.js +67 -0
- package/dist/inspector/targets.js +31 -0
- package/dist/inspector/theme/ThemeControls.js +351 -0
- package/dist/inspector/theme/ThemePanel.js +32 -0
- package/dist/inspector/theme/useThemeController.js +560 -0
- package/dist/inspector/usePhone.js +32 -0
- package/dist/inspector/useSelectTool.js +82 -0
- package/dist/inspector/useTimeouts.js +22 -0
- package/dist/inspector/useTrackedRect.js +39 -0
- package/dist/lib/announce.js +47 -0
- package/dist/lib/bridge.js +43 -0
- package/dist/lib/buttonState.js +81 -0
- package/dist/lib/chart-kit.js +226 -0
- package/dist/lib/cn.js +8 -0
- package/dist/lib/color-space.js +315 -0
- package/dist/lib/concentric.js +85 -0
- package/dist/lib/hit-area.js +25 -0
- package/dist/lib/inspector/collect.js +299 -0
- package/dist/lib/inspector/color.js +58 -0
- package/dist/lib/inspector/console-capture.js +96 -0
- package/dist/lib/inspector/index.js +8 -0
- package/dist/lib/inspector/rules.js +232 -0
- package/dist/lib/inspector/run.js +35 -0
- package/dist/lib/inspector/schema.js +110 -0
- package/dist/lib/inspector/selector.js +103 -0
- package/dist/lib/inspector/tokens.js +34 -0
- package/dist/lib/media-overlay-presets.js +284 -0
- package/dist/lib/media-overlays.js +381 -0
- package/dist/lib/meta.js +70 -0
- package/dist/lib/motion-gsap.js +25 -0
- package/dist/lib/motion-runtime.js +283 -0
- package/dist/lib/neutral-tint.js +108 -0
- package/dist/lib/portal-container.js +12 -0
- package/dist/lib/scroll-edges.js +41 -0
- package/dist/lib/surface.js +6 -0
- package/dist/lib/syntax.js +115 -0
- package/dist/lib/theme-presets.d.ts +1 -0
- package/dist/lib/theme-presets.js +759 -0
- package/dist/lib/useClientLocale.js +11 -0
- package/dist/lib/useFieldErrorAnnouncement.js +15 -0
- package/dist/lib/useReducedMotion.js +17 -0
- package/dist/lib/useResizable.js +313 -0
- package/dist/lib/useReturnFocus.js +24 -0
- package/dist/lib/useSlidingIndicator.js +56 -0
- package/dist/panels.d.ts +37 -0
- package/dist/panels.js +19 -0
- package/dist/primitives/Accordion/Accordion.doc.js +37 -0
- package/dist/primitives/Accordion/Accordion.js +87 -0
- package/dist/primitives/Accordion/index.js +2 -0
- package/dist/primitives/ActionBar/ActionBar.doc.js +37 -0
- package/dist/primitives/ActionBar/ActionBar.js +126 -0
- package/dist/primitives/ActionBar/index.js +2 -0
- package/dist/primitives/AlertDialog/AlertDialog.doc.js +54 -0
- package/dist/primitives/AlertDialog/AlertDialog.js +113 -0
- package/dist/primitives/AlertDialog/index.js +2 -0
- package/dist/primitives/AppShell/AppShell.doc.js +81 -0
- package/dist/primitives/AppShell/AppShell.js +178 -0
- package/dist/primitives/AppShell/frame-context.js +10 -0
- package/dist/primitives/AppShell/index.js +2 -0
- package/dist/primitives/AspectRatio/AspectRatio.doc.js +34 -0
- package/dist/primitives/AspectRatio/AspectRatio.js +5 -0
- package/dist/primitives/AspectRatio/index.js +2 -0
- package/dist/primitives/Avatar/Avatar.doc.js +40 -0
- package/dist/primitives/Avatar/Avatar.js +62 -0
- package/dist/primitives/Avatar/index.js +2 -0
- package/dist/primitives/Backdrop/Backdrop.doc.js +24 -0
- package/dist/primitives/Backdrop/Backdrop.js +42 -0
- package/dist/primitives/Backdrop/index.js +2 -0
- package/dist/primitives/Badge/Badge.doc.js +35 -0
- package/dist/primitives/Badge/Badge.js +95 -0
- package/dist/primitives/Badge/index.js +2 -0
- package/dist/primitives/BarChart/BarChart.doc.js +59 -0
- package/dist/primitives/BarChart/BarChart.js +154 -0
- package/dist/primitives/BarChart/index.js +2 -0
- package/dist/primitives/BlockPreview/BlockPreview.doc.js +51 -0
- package/dist/primitives/BlockPreview/BlockPreview.js +485 -0
- package/dist/primitives/BlockPreview/index.js +8 -0
- package/dist/primitives/Blockquote/Blockquote.doc.js +25 -0
- package/dist/primitives/Blockquote/Blockquote.js +19 -0
- package/dist/primitives/Blockquote/index.js +2 -0
- package/dist/primitives/BottomNav/BottomNav.doc.js +37 -0
- package/dist/primitives/BottomNav/BottomNav.js +54 -0
- package/dist/primitives/BottomNav/index.js +2 -0
- package/dist/primitives/Box/Box.doc.js +45 -0
- package/dist/primitives/Box/Box.js +51 -0
- package/dist/primitives/Box/index.js +2 -0
- package/dist/primitives/Breadcrumbs/Breadcrumbs.doc.js +35 -0
- package/dist/primitives/Breadcrumbs/Breadcrumbs.js +40 -0
- package/dist/primitives/Breadcrumbs/index.js +2 -0
- package/dist/primitives/Button/Button.doc.js +80 -0
- package/dist/primitives/Button/Button.js +132 -0
- package/dist/primitives/Button/index.js +2 -0
- package/dist/primitives/Calendar/Calendar.doc.js +36 -0
- package/dist/primitives/Calendar/Calendar.js +502 -0
- package/dist/primitives/Calendar/index.js +2 -0
- package/dist/primitives/Callout/Callout.doc.js +34 -0
- package/dist/primitives/Callout/Callout.js +63 -0
- package/dist/primitives/Callout/index.js +2 -0
- package/dist/primitives/Card/Card.doc.js +46 -0
- package/dist/primitives/Card/Card.js +159 -0
- package/dist/primitives/Card/index.js +2 -0
- package/dist/primitives/Carousel/Carousel.doc.js +61 -0
- package/dist/primitives/Carousel/Carousel.js +369 -0
- package/dist/primitives/Carousel/index.js +1 -0
- package/dist/primitives/ChatBubble/ChatBubble.doc.js +37 -0
- package/dist/primitives/ChatBubble/ChatBubble.js +120 -0
- package/dist/primitives/ChatBubble/index.js +2 -0
- package/dist/primitives/Checkbox/Checkbox.doc.js +36 -0
- package/dist/primitives/Checkbox/Checkbox.js +57 -0
- package/dist/primitives/Checkbox/index.js +2 -0
- package/dist/primitives/CheckboxCards/CheckboxCards.doc.js +35 -0
- package/dist/primitives/CheckboxCards/CheckboxCards.js +47 -0
- package/dist/primitives/CheckboxCards/index.js +2 -0
- package/dist/primitives/CheckboxGroup/CheckboxGroup.doc.js +35 -0
- package/dist/primitives/CheckboxGroup/CheckboxGroup.js +40 -0
- package/dist/primitives/CheckboxGroup/index.js +2 -0
- package/dist/primitives/Code/Code.doc.js +22 -0
- package/dist/primitives/Code/Code.js +17 -0
- package/dist/primitives/Code/index.js +2 -0
- package/dist/primitives/CodeBlock/CodeBlock.doc.js +36 -0
- package/dist/primitives/CodeBlock/CodeBlock.js +205 -0
- package/dist/primitives/CodeBlock/index.js +2 -0
- package/dist/primitives/CodeEditor/CodeEditor.doc.js +53 -0
- package/dist/primitives/CodeEditor/CodeEditor.js +204 -0
- package/dist/primitives/CodeEditor/index.js +4 -0
- package/dist/primitives/ColorPicker/ColorPicker.doc.js +37 -0
- package/dist/primitives/ColorPicker/ColorPicker.js +776 -0
- package/dist/primitives/ColorPicker/index.js +2 -0
- package/dist/primitives/Combobox/Combobox.doc.js +36 -0
- package/dist/primitives/Combobox/Combobox.js +199 -0
- package/dist/primitives/Combobox/index.js +2 -0
- package/dist/primitives/Container/Container.doc.js +46 -0
- package/dist/primitives/Container/Container.js +54 -0
- package/dist/primitives/Container/index.js +2 -0
- package/dist/primitives/ContextMenu/ContextMenu.doc.js +36 -0
- package/dist/primitives/ContextMenu/ContextMenu.js +59 -0
- package/dist/primitives/ContextMenu/index.js +2 -0
- package/dist/primitives/DataList/DataList.doc.js +34 -0
- package/dist/primitives/DataList/DataList.js +35 -0
- package/dist/primitives/DataList/index.js +2 -0
- package/dist/primitives/DatePicker/DatePicker.doc.js +36 -0
- package/dist/primitives/DatePicker/DatePicker.js +398 -0
- package/dist/primitives/DatePicker/index.js +2 -0
- package/dist/primitives/Dialog/Dialog.doc.js +107 -0
- package/dist/primitives/Dialog/Dialog.js +143 -0
- package/dist/primitives/Dialog/index.js +2 -0
- package/dist/primitives/DonutChart/DonutChart.doc.js +26 -0
- package/dist/primitives/DonutChart/DonutChart.js +71 -0
- package/dist/primitives/DonutChart/index.js +2 -0
- package/dist/primitives/Drawer/Drawer.doc.js +44 -0
- package/dist/primitives/Drawer/Drawer.js +158 -0
- package/dist/primitives/Drawer/index.js +2 -0
- package/dist/primitives/Dropdown/Dropdown.doc.js +40 -0
- package/dist/primitives/Dropdown/Dropdown.js +146 -0
- package/dist/primitives/Dropdown/index.js +2 -0
- package/dist/primitives/Emphasis/Emphasis.doc.js +28 -0
- package/dist/primitives/Emphasis/Emphasis.js +25 -0
- package/dist/primitives/Emphasis/index.js +2 -0
- package/dist/primitives/EmptyState/EmptyState.doc.js +76 -0
- package/dist/primitives/EmptyState/EmptyState.js +118 -0
- package/dist/primitives/EmptyState/index.js +2 -0
- package/dist/primitives/FileOutput/FileOutput.doc.js +26 -0
- package/dist/primitives/FileOutput/FileOutput.js +55 -0
- package/dist/primitives/FileOutput/index.js +2 -0
- package/dist/primitives/Flex/Flex.doc.js +58 -0
- package/dist/primitives/Flex/Flex.js +98 -0
- package/dist/primitives/Flex/index.js +2 -0
- package/dist/primitives/FormErrorSummary/FormErrorSummary.doc.js +39 -0
- package/dist/primitives/FormErrorSummary/FormErrorSummary.js +61 -0
- package/dist/primitives/FormErrorSummary/index.js +2 -0
- package/dist/primitives/FormField/FormField.doc.js +68 -0
- package/dist/primitives/FormField/FormField.js +149 -0
- package/dist/primitives/FormField/index.js +2 -0
- package/dist/primitives/FunnelChart/FunnelChart.doc.js +45 -0
- package/dist/primitives/FunnelChart/FunnelChart.js +54 -0
- package/dist/primitives/FunnelChart/index.js +2 -0
- package/dist/primitives/Grid/Grid.doc.js +57 -0
- package/dist/primitives/Grid/Grid.js +122 -0
- package/dist/primitives/Grid/index.js +2 -0
- package/dist/primitives/Heading/Heading.doc.js +46 -0
- package/dist/primitives/Heading/Heading.js +80 -0
- package/dist/primitives/Heading/index.js +2 -0
- package/dist/primitives/Heatmap/Heatmap.doc.js +49 -0
- package/dist/primitives/Heatmap/Heatmap.js +42 -0
- package/dist/primitives/Heatmap/index.js +2 -0
- package/dist/primitives/HoverCard/HoverCard.doc.js +36 -0
- package/dist/primitives/HoverCard/HoverCard.js +39 -0
- package/dist/primitives/HoverCard/index.js +2 -0
- package/dist/primitives/Icon/Icon.doc.js +49 -0
- package/dist/primitives/Icon/Icon.js +214 -0
- package/dist/primitives/Icon/buckets/lucide-a.js +214 -0
- package/dist/primitives/Icon/buckets/lucide-b.js +298 -0
- package/dist/primitives/Icon/buckets/lucide-c.js +524 -0
- package/dist/primitives/Icon/buckets/lucide-d.js +110 -0
- package/dist/primitives/Icon/buckets/lucide-e.js +50 -0
- package/dist/primitives/Icon/buckets/lucide-f.js +264 -0
- package/dist/primitives/Icon/buckets/lucide-g.js +108 -0
- package/dist/primitives/Icon/buckets/lucide-h.js +112 -0
- package/dist/primitives/Icon/buckets/lucide-i.js +46 -0
- package/dist/primitives/Icon/buckets/lucide-j.js +6 -0
- package/dist/primitives/Icon/buckets/lucide-k.js +18 -0
- package/dist/primitives/Icon/buckets/lucide-l.js +162 -0
- package/dist/primitives/Icon/buckets/lucide-m.js +266 -0
- package/dist/primitives/Icon/buckets/lucide-n.js +34 -0
- package/dist/primitives/Icon/buckets/lucide-o.js +20 -0
- package/dist/primitives/Icon/buckets/lucide-p.js +216 -0
- package/dist/primitives/Icon/buckets/lucide-q.js +6 -0
- package/dist/primitives/Icon/buckets/lucide-r.js +140 -0
- package/dist/primitives/Icon/buckets/lucide-s.js +490 -0
- package/dist/primitives/Icon/buckets/lucide-t.js +204 -0
- package/dist/primitives/Icon/buckets/lucide-u.js +84 -0
- package/dist/primitives/Icon/buckets/lucide-v.js +46 -0
- package/dist/primitives/Icon/buckets/lucide-w.js +82 -0
- package/dist/primitives/Icon/buckets/lucide-x.js +6 -0
- package/dist/primitives/Icon/buckets/lucide-z.js +36 -0
- package/dist/primitives/Icon/buckets/phosphor-a.js +250 -0
- package/dist/primitives/Icon/buckets/phosphor-b.js +158 -0
- package/dist/primitives/Icon/buckets/phosphor-c.js +320 -0
- package/dist/primitives/Icon/buckets/phosphor-d.js +90 -0
- package/dist/primitives/Icon/buckets/phosphor-e.js +52 -0
- package/dist/primitives/Icon/buckets/phosphor-f.js +162 -0
- package/dist/primitives/Icon/buckets/phosphor-g.js +92 -0
- package/dist/primitives/Icon/buckets/phosphor-h.js +88 -0
- package/dist/primitives/Icon/buckets/phosphor-i.js +26 -0
- package/dist/primitives/Icon/buckets/phosphor-j.js +8 -0
- package/dist/primitives/Icon/buckets/phosphor-k.js +8 -0
- package/dist/primitives/Icon/buckets/phosphor-l.js +84 -0
- package/dist/primitives/Icon/buckets/phosphor-m.js +110 -0
- package/dist/primitives/Icon/buckets/phosphor-n.js +100 -0
- package/dist/primitives/Icon/buckets/phosphor-o.js +14 -0
- package/dist/primitives/Icon/buckets/phosphor-p.js +166 -0
- package/dist/primitives/Icon/buckets/phosphor-q.js +10 -0
- package/dist/primitives/Icon/buckets/phosphor-r.js +46 -0
- package/dist/primitives/Icon/buckets/phosphor-s.js +254 -0
- package/dist/primitives/Icon/buckets/phosphor-t.js +152 -0
- package/dist/primitives/Icon/buckets/phosphor-u.js +38 -0
- package/dist/primitives/Icon/buckets/phosphor-v.js +22 -0
- package/dist/primitives/Icon/buckets/phosphor-w.js +48 -0
- package/dist/primitives/Icon/buckets/phosphor-x.js +4 -0
- package/dist/primitives/Icon/buckets/phosphor-y.js +8 -0
- package/dist/primitives/Icon/icon-display-names.generated.js +4 -0
- package/dist/primitives/Icon/icon-loaders.generated.js +70 -0
- package/dist/primitives/Icon/icon-names-material.generated.js +4 -0
- package/dist/primitives/Icon/icon-names.js +11 -0
- package/dist/primitives/Icon/index.js +7 -0
- package/dist/primitives/IconButton/IconButton.doc.js +43 -0
- package/dist/primitives/IconButton/IconButton.js +98 -0
- package/dist/primitives/IconButton/index.js +2 -0
- package/dist/primitives/IconPicker/IconPicker.doc.js +52 -0
- package/dist/primitives/IconPicker/IconPicker.js +193 -0
- package/dist/primitives/IconPicker/index.js +2 -0
- package/dist/primitives/IconPicker/registry.js +98 -0
- package/dist/primitives/Image/Image.doc.js +40 -0
- package/dist/primitives/Image/Image.js +76 -0
- package/dist/primitives/Image/index.js +2 -0
- package/dist/primitives/Inset/Inset.doc.js +34 -0
- package/dist/primitives/Inset/Inset.js +51 -0
- package/dist/primitives/Inset/index.js +2 -0
- package/dist/primitives/Kbd/Kbd.doc.js +22 -0
- package/dist/primitives/Kbd/Kbd.js +17 -0
- package/dist/primitives/Kbd/index.js +2 -0
- package/dist/primitives/LineChart/LineChart.doc.js +61 -0
- package/dist/primitives/LineChart/LineChart.js +146 -0
- package/dist/primitives/LineChart/index.js +2 -0
- package/dist/primitives/Link/Link.doc.js +45 -0
- package/dist/primitives/Link/Link.js +37 -0
- package/dist/primitives/Link/index.js +2 -0
- package/dist/primitives/List/List.doc.js +35 -0
- package/dist/primitives/List/List.js +35 -0
- package/dist/primitives/List/index.js +2 -0
- package/dist/primitives/Menu/Menu.doc.js +37 -0
- package/dist/primitives/Menu/Menu.js +117 -0
- package/dist/primitives/Menu/index.js +2 -0
- package/dist/primitives/Murmur/Murmur.doc.js +32 -0
- package/dist/primitives/Murmur/Murmur.js +85 -0
- package/dist/primitives/Murmur/engine.js +163 -0
- package/dist/primitives/Murmur/index.js +12 -0
- package/dist/primitives/Pagination/Pagination.doc.js +37 -0
- package/dist/primitives/Pagination/Pagination.js +183 -0
- package/dist/primitives/Pagination/index.js +2 -0
- package/dist/primitives/PanelGroup/PanelGroup.doc.js +41 -0
- package/dist/primitives/PanelGroup/PanelGroup.js +142 -0
- package/dist/primitives/PanelGroup/index.js +2 -0
- package/dist/primitives/Popover/Popover.doc.js +36 -0
- package/dist/primitives/Popover/Popover.js +41 -0
- package/dist/primitives/Popover/index.js +2 -0
- package/dist/primitives/Progress/Progress.doc.js +35 -0
- package/dist/primitives/Progress/Progress.js +77 -0
- package/dist/primitives/Progress/index.js +2 -0
- package/dist/primitives/RadioGroup/RadioGroup.doc.js +36 -0
- package/dist/primitives/RadioGroup/RadioGroup.js +132 -0
- package/dist/primitives/RadioGroup/index.js +2 -0
- package/dist/primitives/Rating/NpsScale.js +102 -0
- package/dist/primitives/Rating/Rating.doc.js +35 -0
- package/dist/primitives/Rating/Rating.js +116 -0
- package/dist/primitives/Rating/RatingSummary.js +50 -0
- package/dist/primitives/Rating/SentimentRating.js +81 -0
- package/dist/primitives/Rating/index.js +5 -0
- package/dist/primitives/Reasoning/Reasoning.doc.js +28 -0
- package/dist/primitives/Reasoning/Reasoning.js +73 -0
- package/dist/primitives/Reasoning/index.js +2 -0
- package/dist/primitives/Resizable/Resizable.doc.js +50 -0
- package/dist/primitives/Resizable/ResizeHandle.js +185 -0
- package/dist/primitives/Resizable/index.js +2 -0
- package/dist/primitives/Row/Row.doc.js +36 -0
- package/dist/primitives/Row/Row.js +53 -0
- package/dist/primitives/Row/index.js +2 -0
- package/dist/primitives/ScrollArea/ScrollArea.doc.js +35 -0
- package/dist/primitives/ScrollArea/ScrollArea.js +50 -0
- package/dist/primitives/ScrollArea/index.js +2 -0
- package/dist/primitives/Section/Section.doc.js +64 -0
- package/dist/primitives/Section/Section.js +76 -0
- package/dist/primitives/Section/index.js +2 -0
- package/dist/primitives/SegmentedControl/SegmentedControl.doc.js +75 -0
- package/dist/primitives/SegmentedControl/SegmentedControl.js +160 -0
- package/dist/primitives/SegmentedControl/index.js +2 -0
- package/dist/primitives/Select/Select.doc.js +42 -0
- package/dist/primitives/Select/Select.js +180 -0
- package/dist/primitives/Select/index.js +2 -0
- package/dist/primitives/Separator/Separator.doc.js +34 -0
- package/dist/primitives/Separator/Separator.js +84 -0
- package/dist/primitives/Separator/index.js +2 -0
- package/dist/primitives/ShavinDevTools/DevToolsPanel.js +2050 -0
- package/dist/primitives/ShavinDevTools/ShavinDevTools.doc.js +44 -0
- package/dist/primitives/ShavinDevTools/ShavinDevTools.js +15 -0
- package/dist/primitives/ShavinDevTools/index.js +8 -0
- package/dist/primitives/ShavinDevTools/types.js +0 -0
- package/dist/primitives/Sidebar/Sidebar.doc.js +39 -0
- package/dist/primitives/Sidebar/Sidebar.js +295 -0
- package/dist/primitives/Sidebar/index.js +2 -0
- package/dist/primitives/Skeleton/Skeleton.doc.js +38 -0
- package/dist/primitives/Skeleton/Skeleton.js +36 -0
- package/dist/primitives/Skeleton/index.js +2 -0
- package/dist/primitives/Slider/Slider.doc.js +45 -0
- package/dist/primitives/Slider/Slider.js +406 -0
- package/dist/primitives/Slider/index.js +2 -0
- package/dist/primitives/Sortable/Sortable.doc.js +35 -0
- package/dist/primitives/Sortable/Sortable.js +179 -0
- package/dist/primitives/Sortable/index.js +2 -0
- package/dist/primitives/Sparkline/Sparkline.doc.js +25 -0
- package/dist/primitives/Sparkline/Sparkline.js +46 -0
- package/dist/primitives/Sparkline/index.js +2 -0
- package/dist/primitives/Spinner/Spinner.doc.js +35 -0
- package/dist/primitives/Spinner/Spinner.js +162 -0
- package/dist/primitives/Spinner/index.js +2 -0
- package/dist/primitives/Spotlight/Spotlight.doc.js +36 -0
- package/dist/primitives/Spotlight/Spotlight.js +139 -0
- package/dist/primitives/Spotlight/index.js +2 -0
- package/dist/primitives/Stepper/Stepper.doc.js +46 -0
- package/dist/primitives/Stepper/Stepper.js +235 -0
- package/dist/primitives/Stepper/index.js +2 -0
- package/dist/primitives/Switch/Switch.doc.js +36 -0
- package/dist/primitives/Switch/Switch.js +54 -0
- package/dist/primitives/Switch/index.js +2 -0
- package/dist/primitives/Table/Table.doc.js +47 -0
- package/dist/primitives/Table/Table.js +63 -0
- package/dist/primitives/Table/index.js +2 -0
- package/dist/primitives/Tabs/Tabs.doc.js +53 -0
- package/dist/primitives/Tabs/Tabs.js +275 -0
- package/dist/primitives/Tabs/index.js +2 -0
- package/dist/primitives/Text/Text.doc.js +35 -0
- package/dist/primitives/Text/Text.js +67 -0
- package/dist/primitives/Text/index.js +2 -0
- package/dist/primitives/TextArea/TextArea.doc.js +35 -0
- package/dist/primitives/TextArea/TextArea.js +45 -0
- package/dist/primitives/TextArea/index.js +2 -0
- package/dist/primitives/TextField/TextField.doc.js +41 -0
- package/dist/primitives/TextField/TextField.js +290 -0
- package/dist/primitives/TextField/index.js +2 -0
- package/dist/primitives/ThemeProvider/ScopedThemeProvider.js +71 -0
- package/dist/primitives/ThemeProvider/ThemeProvider.doc.js +61 -0
- package/dist/primitives/ThemeProvider/ThemeProvider.js +143 -0
- package/dist/primitives/ThemeProvider/clientTheme.js +47 -0
- package/dist/primitives/ThemeProvider/index.js +3 -0
- package/dist/primitives/ThemeProvider/themeContext.js +11 -0
- package/dist/primitives/ThemeSwitcher/ThemeSwitcher.doc.js +49 -0
- package/dist/primitives/ThemeSwitcher/ThemeSwitcher.js +323 -0
- package/dist/primitives/ThemeSwitcher/index.js +2 -0
- package/dist/primitives/TimePicker/TimePicker.doc.js +36 -0
- package/dist/primitives/TimePicker/TimePicker.js +368 -0
- package/dist/primitives/TimePicker/index.js +2 -0
- package/dist/primitives/Toast/Toast.doc.js +65 -0
- package/dist/primitives/Toast/Toast.js +304 -0
- package/dist/primitives/Toast/index.js +2 -0
- package/dist/primitives/ToolCall/ToolCall.doc.js +29 -0
- package/dist/primitives/ToolCall/ToolCall.js +75 -0
- package/dist/primitives/ToolCall/index.js +2 -0
- package/dist/primitives/Tooltip/Tooltip.doc.js +37 -0
- package/dist/primitives/Tooltip/Tooltip.js +55 -0
- package/dist/primitives/Tooltip/index.js +2 -0
- package/dist/primitives/TopBar/TopBar.doc.js +34 -0
- package/dist/primitives/TopBar/TopBar.js +8 -0
- package/dist/primitives/TopBar/index.js +2 -0
- package/dist/primitives/Video/PauseToggle.js +49 -0
- package/dist/primitives/Video/Video.doc.js +47 -0
- package/dist/primitives/Video/Video.js +104 -0
- package/dist/primitives/Video/index.js +1 -0
- package/dist/primitives/VoiceInput/VoiceInput.doc.js +38 -0
- package/dist/primitives/VoiceInput/VoiceInput.js +96 -0
- package/dist/primitives/VoiceInput/index.js +2 -0
- package/dist/primitives/WiseOwlLogo/WiseOwlLogo.doc.js +38 -0
- package/dist/primitives/WiseOwlLogo/WiseOwlLogo.js +82 -0
- package/dist/primitives/WiseOwlLogo/index.js +2 -0
- package/dist/primitives/WiseOwlLogo/paths.js +10 -0
- package/dist/server.d.ts +256 -0
- package/dist/server.js +22 -0
- package/dist/styles/base-oklch.css +124 -0
- package/dist/styles/base-oklch.d.ts +2 -0
- package/dist/styles/base.css +124 -0
- package/dist/styles/base.d.ts +2 -0
- package/dist/styles/brand-preset.d.ts +22 -0
- package/dist/styles/brand-preset.js +13 -0
- package/dist/styles/brand-theme-v4-oklch.css +2 -0
- package/dist/styles/brand-theme-v4-oklch.d.ts +2 -0
- package/dist/styles/brand-theme-v4.css +2 -0
- package/dist/styles/brand-theme-v4.d.ts +2 -0
- package/dist/styles/brand-tokens-oklch.css +6 -0
- package/dist/styles/brand-tokens-oklch.d.ts +2 -0
- package/dist/styles/brand-tokens.css +6 -0
- package/dist/styles/brand-tokens.d.ts +2 -0
- package/dist/styles/global-oklch.css +1329 -0
- package/dist/styles/global-oklch.d.ts +2 -0
- package/dist/styles/global.css +1329 -0
- package/dist/styles/global.d.ts +2 -0
- package/dist/styles/theme-v4-oklch.css +22 -0
- package/dist/styles/theme-v4-oklch.d.ts +2 -0
- package/dist/styles/theme-v4.css +22 -0
- package/dist/styles/theme-v4.d.ts +2 -0
- package/dist/styles/tokens-oklch.css +1204 -0
- package/dist/styles/tokens-oklch.d.ts +2 -0
- package/dist/styles/tokens.css +1204 -0
- package/dist/styles/tokens.d.ts +2 -0
- package/dist/tailwind-preset.cjs +155 -0
- package/dist/tailwind-preset.d.ts +112 -0
- package/dist/tailwind-preset.js +133 -0
- package/dist/theme-presets-BVWZ_TxX.d.ts +514 -0
- package/global-oklch.css +3 -0
- package/package.json +169 -4
- package/styles.css +3 -0
- package/tailwind-preset.ts +140 -0
- package/tokens.json +423 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
cloneElement,
|
|
5
|
+
isValidElement,
|
|
6
|
+
use,
|
|
7
|
+
useId
|
|
8
|
+
} from "react";
|
|
9
|
+
import { cva } from "class-variance-authority";
|
|
10
|
+
import { CircleAlert, CircleCheck, Lock } from "lucide-react";
|
|
11
|
+
import { cn } from "../../lib/cn.js";
|
|
12
|
+
import { useFieldErrorAnnouncement } from "../../lib/useFieldErrorAnnouncement.js";
|
|
13
|
+
import { Select } from "../Select/Select.js";
|
|
14
|
+
import { Combobox } from "../Combobox/Combobox.js";
|
|
15
|
+
import { DatePicker } from "../DatePicker/DatePicker.js";
|
|
16
|
+
import { TimePicker, TimePickerInput } from "../TimePicker/TimePicker.js";
|
|
17
|
+
import { TextArea } from "../TextArea/TextArea.js";
|
|
18
|
+
import { Checkbox } from "../Checkbox/Checkbox.js";
|
|
19
|
+
import { Switch } from "../Switch/Switch.js";
|
|
20
|
+
import { RadioGroup } from "../RadioGroup/RadioGroup.js";
|
|
21
|
+
import { CheckboxGroup } from "../CheckboxGroup/CheckboxGroup.js";
|
|
22
|
+
const formFieldVariants = cva("flex w-full gap-1.5", {
|
|
23
|
+
variants: {
|
|
24
|
+
orientation: {
|
|
25
|
+
vertical: "flex-col",
|
|
26
|
+
// Settings rows: label left, control right from md up; stacked below md.
|
|
27
|
+
horizontal: "flex-col md:flex-row md:items-start md:justify-between md:gap-6"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
defaultVariants: { orientation: "vertical" }
|
|
31
|
+
});
|
|
32
|
+
const LABEL = "inline-flex items-center gap-1.5 text-xs font-semibold text-fg-muted";
|
|
33
|
+
const MESSAGE = "flex items-start gap-1 text-xs";
|
|
34
|
+
const LAZY = /* @__PURE__ */ Symbol.for("react.lazy");
|
|
35
|
+
const isLazy = (x) => !!x && typeof x === "object" && x.$$typeof === LAZY;
|
|
36
|
+
const isThenable = (x) => !!x && typeof x.then === "function";
|
|
37
|
+
function resolveLazy(node) {
|
|
38
|
+
let cur = node;
|
|
39
|
+
for (let i = 0; i < 8 && isLazy(cur); i++) {
|
|
40
|
+
cur = isThenable(cur._payload) ? use(cur._payload) : cur._init(cur._payload);
|
|
41
|
+
}
|
|
42
|
+
return cur;
|
|
43
|
+
}
|
|
44
|
+
const isDev = typeof process !== "undefined" && process.env?.NODE_ENV !== "production";
|
|
45
|
+
function FormField({
|
|
46
|
+
label,
|
|
47
|
+
hint,
|
|
48
|
+
error,
|
|
49
|
+
status = "default",
|
|
50
|
+
required: requiredProp,
|
|
51
|
+
disabled,
|
|
52
|
+
readOnly,
|
|
53
|
+
announceError = true,
|
|
54
|
+
size,
|
|
55
|
+
orientation,
|
|
56
|
+
id: customId,
|
|
57
|
+
className,
|
|
58
|
+
children,
|
|
59
|
+
...props
|
|
60
|
+
}) {
|
|
61
|
+
const autoId = useId();
|
|
62
|
+
const child = resolveLazy(Array.isArray(children) && children.length === 1 ? children[0] : children);
|
|
63
|
+
if (!isValidElement(child)) {
|
|
64
|
+
throw new Error("[shavin] FormField needs exactly one Shavin control as its child (TextArea, Select, Combobox, DatePicker, TimePicker, Checkbox, Switch, RadioGroup or CheckboxGroup).");
|
|
65
|
+
}
|
|
66
|
+
const childProps = child.props;
|
|
67
|
+
const controlId = customId ?? childProps.id ?? `${autoId}-control`;
|
|
68
|
+
const labelId = `${autoId}-label`;
|
|
69
|
+
const hintId = `${autoId}-hint`;
|
|
70
|
+
const errorId = `${autoId}-error`;
|
|
71
|
+
useFieldErrorAnnouncement(error, announceError);
|
|
72
|
+
const type = resolveLazy(child.type);
|
|
73
|
+
const isGroup = type === RadioGroup || type === CheckboxGroup;
|
|
74
|
+
const isToggle = type === Checkbox || type === Switch;
|
|
75
|
+
const isSelectLike = type === Select || type === Combobox;
|
|
76
|
+
const isPicker = type === DatePicker || type === TimePicker || type === TimePickerInput;
|
|
77
|
+
const supportsReadOnly = type === TextArea;
|
|
78
|
+
const required = requiredProp ?? !isToggle;
|
|
79
|
+
if (isDev && label && isToggle && childProps.label) {
|
|
80
|
+
console.warn(
|
|
81
|
+
"[shavin] FormField: the child Checkbox/Switch has its own `label`, so the FormField `label` names it twice. Fix: remove the FormField `label` and keep only hint/error."
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
const message = error ? errorId : hint ? hintId : void 0;
|
|
85
|
+
const describedBy = [childProps["aria-describedby"], message].filter(Boolean).join(" ") || void 0;
|
|
86
|
+
const inject = { "aria-describedby": describedBy };
|
|
87
|
+
if (!isGroup || type === RadioGroup) {
|
|
88
|
+
if (!isGroup) inject.id = controlId;
|
|
89
|
+
if (error) inject["aria-invalid"] = true;
|
|
90
|
+
if (required && type !== Select) inject["aria-required"] = true;
|
|
91
|
+
}
|
|
92
|
+
if (required && !isPicker) inject.required = true;
|
|
93
|
+
if (disabled !== void 0) inject.disabled = disabled;
|
|
94
|
+
if (readOnly && supportsReadOnly) inject.readOnly = true;
|
|
95
|
+
if (error && type === TextArea) inject.invalid = true;
|
|
96
|
+
if (size && isSelectLike) inject.size = type === Combobox && size === "lg" ? "md" : size;
|
|
97
|
+
if (label && (type === Select || isPicker || type === RadioGroup || type === Combobox)) inject["aria-labelledby"] = labelId;
|
|
98
|
+
if (isGroup && type === RadioGroup && label) inject["aria-labelledby"] = labelId;
|
|
99
|
+
const control = cloneElement(child, inject);
|
|
100
|
+
const optional = !required && !isToggle ? /* @__PURE__ */ jsx("span", { className: "font-normal text-fg-subtle", children: "Optional" }) : null;
|
|
101
|
+
const lock = readOnly ? /* @__PURE__ */ jsx(Lock, { "aria-hidden": "true", className: "h-3 w-3 text-fg-subtle" }) : null;
|
|
102
|
+
const messageNode = error ? /* @__PURE__ */ jsxs("span", { id: errorId, className: cn(MESSAGE, "text-danger"), children: [
|
|
103
|
+
/* @__PURE__ */ jsx(CircleAlert, { "aria-hidden": "true", className: "mt-px h-3.5 w-3.5 shrink-0" }),
|
|
104
|
+
error
|
|
105
|
+
] }) : hint ? /* @__PURE__ */ jsxs("span", { id: hintId, className: cn(MESSAGE, status === "success" ? "text-success" : "text-fg-subtle"), children: [
|
|
106
|
+
status === "success" && /* @__PURE__ */ jsx(CircleCheck, { "aria-hidden": "true", className: "mt-px h-3.5 w-3.5 shrink-0" }),
|
|
107
|
+
hint
|
|
108
|
+
] }) : null;
|
|
109
|
+
const horizontal = orientation === "horizontal";
|
|
110
|
+
if (isGroup) {
|
|
111
|
+
return /* @__PURE__ */ jsxs(
|
|
112
|
+
"fieldset",
|
|
113
|
+
{
|
|
114
|
+
disabled,
|
|
115
|
+
"aria-describedby": message,
|
|
116
|
+
className: cn("m-0 min-w-0 border-0 p-0", formFieldVariants({ orientation }), className),
|
|
117
|
+
...props,
|
|
118
|
+
children: [
|
|
119
|
+
label && /* @__PURE__ */ jsxs("legend", { id: labelId, className: cn(LABEL, "mb-1.5 p-0"), children: [
|
|
120
|
+
label,
|
|
121
|
+
optional
|
|
122
|
+
] }),
|
|
123
|
+
control,
|
|
124
|
+
messageNode
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
const labelNode = label ? /* @__PURE__ */ jsxs("label", { id: labelId, htmlFor: controlId, className: LABEL, children: [
|
|
130
|
+
label,
|
|
131
|
+
optional,
|
|
132
|
+
lock
|
|
133
|
+
] }) : null;
|
|
134
|
+
return /* @__PURE__ */ jsx("div", { "data-form-field": "", className: cn(formFieldVariants({ orientation }), className), ...props, children: horizontal ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
135
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-1 md:max-w-[50%]", children: [
|
|
136
|
+
labelNode,
|
|
137
|
+
messageNode
|
|
138
|
+
] }),
|
|
139
|
+
/* @__PURE__ */ jsx("div", { className: "shrink-0", children: control })
|
|
140
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
141
|
+
labelNode,
|
|
142
|
+
control,
|
|
143
|
+
messageNode
|
|
144
|
+
] }) });
|
|
145
|
+
}
|
|
146
|
+
export {
|
|
147
|
+
FormField,
|
|
148
|
+
formFieldVariants
|
|
149
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const docs = {
|
|
2
|
+
name: "FunnelChart",
|
|
3
|
+
description: "A conversion funnel in either direction, with step counts, share of the first step and drop-off between steps.",
|
|
4
|
+
features: [
|
|
5
|
+
"orientation horizontal (bar per step) or vertical (column per step)",
|
|
6
|
+
"centered narrows the stack like a funnel (horizontal)",
|
|
7
|
+
"Drop-off percentage between steps, toggle with showDropOff"
|
|
8
|
+
],
|
|
9
|
+
accessibility: ["The chart has role=img with a label; keep the surrounding heading and values in text", "Colour is never the only signal: legends, labels and tooltips carry names and values"],
|
|
10
|
+
keyboard: "Hover to inspect values.",
|
|
11
|
+
usage: {
|
|
12
|
+
bestPractices: [
|
|
13
|
+
{ guidance: true, description: "Use vertical for short funnels (up to 6 steps) with long names elsewhere; horizontal reads best in narrow cards." },
|
|
14
|
+
{ guidance: false, description: "Do not pass pre-formatted strings as values; keep numbers raw and format with yFormat." }
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
examples: [
|
|
18
|
+
{
|
|
19
|
+
title: "Horizontal",
|
|
20
|
+
code: `<FunnelChart
|
|
21
|
+
steps={[
|
|
22
|
+
{ name: "Visited", value: 12400 },
|
|
23
|
+
{ name: "Signed up", value: 3100 },
|
|
24
|
+
{ name: "Activated", value: 1650 },
|
|
25
|
+
{ name: "Paid", value: 420 },
|
|
26
|
+
]}
|
|
27
|
+
/>`
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
title: "Vertical",
|
|
31
|
+
code: `<FunnelChart
|
|
32
|
+
orientation="vertical"
|
|
33
|
+
steps={[
|
|
34
|
+
{ name: "Visited", value: 12400 },
|
|
35
|
+
{ name: "Signed up", value: 3100 },
|
|
36
|
+
{ name: "Activated", value: 1650 },
|
|
37
|
+
{ name: "Paid", value: 420 },
|
|
38
|
+
]}
|
|
39
|
+
/>`
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
docs
|
|
45
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../../lib/cn.js";
|
|
4
|
+
const pct = (n, digits = 0) => `${(n * 100).toFixed(digits)}%`;
|
|
5
|
+
const num = (n) => n.toLocaleString("en");
|
|
6
|
+
function FunnelChart({ steps, orientation = "horizontal", centered = false, height = 220, showDropOff = true, className, ...props }) {
|
|
7
|
+
if (!steps.length) return null;
|
|
8
|
+
const first = steps[0].value || 1;
|
|
9
|
+
if (orientation === "vertical") {
|
|
10
|
+
return /* @__PURE__ */ jsx("div", { className: cn("flex items-end gap-2", className), ...props, children: steps.map((s, i) => {
|
|
11
|
+
const share = s.value / first;
|
|
12
|
+
const prev = i === 0 ? null : s.value / (steps[i - 1].value || 1);
|
|
13
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
14
|
+
/* @__PURE__ */ jsxs("div", { className: "flex h-9 flex-col justify-end", children: [
|
|
15
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium tabular-nums text-fg", children: num(s.value) }),
|
|
16
|
+
showDropOff && prev !== null && /* @__PURE__ */ jsxs("span", { className: "text-xs text-danger", children: [
|
|
17
|
+
"\u2212",
|
|
18
|
+
pct(1 - prev)
|
|
19
|
+
] })
|
|
20
|
+
] }),
|
|
21
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-end", style: { height }, children: /* @__PURE__ */ jsx("div", { className: "w-full rounded-t-[var(--radius-lg)] bg-brand", style: { height: `${Math.max(share * 100, 2)}%`, opacity: 1 - i * Math.min(0.12, 0.6 / steps.length) } }) }),
|
|
22
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 border-t border-hairline pt-2", children: [
|
|
23
|
+
/* @__PURE__ */ jsx("div", { className: "truncate text-xs text-fg-muted", title: s.name, children: s.name }),
|
|
24
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs text-fg-subtle tabular-nums", children: pct(share, share < 0.1 ? 1 : 0) })
|
|
25
|
+
] })
|
|
26
|
+
] }, `${s.name}-${i}`);
|
|
27
|
+
}) });
|
|
28
|
+
}
|
|
29
|
+
return /* @__PURE__ */ jsx("div", { className: cn("flex flex-col gap-3", className), ...props, children: steps.map((s, i) => {
|
|
30
|
+
const share = s.value / first;
|
|
31
|
+
const prev = i === 0 ? null : s.value / (steps[i - 1].value || 1);
|
|
32
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
33
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-baseline justify-between gap-3", children: [
|
|
34
|
+
/* @__PURE__ */ jsxs("span", { className: "text-sm font-medium text-fg", children: [
|
|
35
|
+
i + 1,
|
|
36
|
+
". ",
|
|
37
|
+
s.name
|
|
38
|
+
] }),
|
|
39
|
+
/* @__PURE__ */ jsxs("span", { className: "text-sm tabular-nums text-fg-muted whitespace-nowrap", children: [
|
|
40
|
+
num(s.value),
|
|
41
|
+
showDropOff && prev !== null && /* @__PURE__ */ jsxs("span", { className: "text-xs text-danger", children: [
|
|
42
|
+
" \xB7 ",
|
|
43
|
+
pct(1 - prev),
|
|
44
|
+
" drop"
|
|
45
|
+
] })
|
|
46
|
+
] })
|
|
47
|
+
] }),
|
|
48
|
+
/* @__PURE__ */ jsx("div", { className: cn("h-8 overflow-hidden rounded-[var(--radius-lg)] bg-fg/[0.06]", centered && "flex justify-center"), children: /* @__PURE__ */ jsx("div", { className: "h-full rounded-[var(--radius-lg)] bg-brand", style: { width: `${Math.max(share * 100, 1.5)}%`, opacity: 1 - i * Math.min(0.12, 0.6 / steps.length) } }) })
|
|
49
|
+
] }, `${s.name}-${i}`);
|
|
50
|
+
}) });
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
FunnelChart
|
|
54
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
const docs = {
|
|
2
|
+
name: "Grid",
|
|
3
|
+
group: "layout",
|
|
4
|
+
description: "Lays children out in columns. Set a count, or let it fit as many as the space allows. It can carry a background image or video.",
|
|
5
|
+
features: [
|
|
6
|
+
'Columns: 1 through 6 equal-width tracks, or "auto" for intrinsic tracks that wrap by themselves in any container (width from minWidth: xs 10rem, sm 14rem, md 18rem default, lg 24rem, xl 32rem); maxColumns (2-6) caps the track count so a wide container never adds extra columns',
|
|
7
|
+
"Rows: 1 through 6 equal-height tracks",
|
|
8
|
+
"Alignments: start, center, end, stretch",
|
|
9
|
+
"Token gap scale: 0 through 7",
|
|
10
|
+
"Responsive stack: auto (3+ cols \u2192 2 on tablet \u2192 1 on mobile; 2 cols \u2192 1 on mobile), tablet, mobile, none (default)",
|
|
11
|
+
"Surface contrast scope via surface prop for media backgrounds. With a photo, video or fx backdrop and no surface it defaults to dark-always plus a dark scrim (dark-30, fx dark-50); meshes and custom gradients need an explicit surface (dark-always or light-always)",
|
|
12
|
+
"Background media: bgVideo, bgImage, bgOverlays (presets, hex, tokens, gradients via comma-separated shorthand), bgSize, bgVideoPaused",
|
|
13
|
+
"Fx backdrops (needs `npm i @shavin/fx`, free to use under its own licence, and `registerFxBackdrops()`): bgOverlays=\"fx:dither-waves, gradient-bottom\"; params only when changed: fx:fluid-silk(speed=1.2); quote text values: fx:type-tiles(text='Plan money')"
|
|
14
|
+
],
|
|
15
|
+
accessibility: [
|
|
16
|
+
"Supports semantic HTML tags via polymorphic as prop"
|
|
17
|
+
],
|
|
18
|
+
usage: {
|
|
19
|
+
bestPractices: [
|
|
20
|
+
{ guidance: true, description: "Use Grid for 2-dimensional layouts with equal-width columns and token gap spacing." },
|
|
21
|
+
{ guidance: true, description: 'Set stack="auto" on multi-column marketing grids so they collapse on tablet and mobile without hand-written breakpoint classes.' },
|
|
22
|
+
{ guidance: true, description: 'Prefer columns="auto" for card, stat and feature grids: it adapts to the width of its container (sidebar, canvas, full page) with no stack or breakpoint props. Add maxColumns="3" (or 4) when a section must never exceed that many columns on very wide containers. Use a fixed column count only when the design needs exactly N columns.' },
|
|
23
|
+
{ guidance: false, description: 'Do not use columns="auto" for placed layouts: bento grids, feature-plus-list splits, or anything using col-span, row-span or col-start. Spans assume a fixed track count, so an auto grid gives the wrong shape. Use numeric columns (with stack) there.' },
|
|
24
|
+
{ guidance: false, description: 'columns="auto" replaces stack: do not combine them, and do not add grid-cols-* classes to the same Grid.' },
|
|
25
|
+
{ guidance: false, description: "Do not mix arbitrary grid-cols-* utilities when Grid primitive provides structured column props." },
|
|
26
|
+
{ guidance: true, description: "Use bgVideo / bgImage for shared media backdrops across grid items \u2014 the primitive renders the media layer behind all children." }
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
examples: [
|
|
30
|
+
{
|
|
31
|
+
title: "Intrinsic grid (adapts to its container)",
|
|
32
|
+
code: '<Grid columns="auto" minWidth="sm" gap="4"><Card padding="md">One</Card><Card padding="md">Two</Card><Card padding="md">Three</Card><Card padding="md">Four</Card></Grid>'
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
title: "3-Column Feature Grid",
|
|
36
|
+
code: '<Grid columns="3" gap="5" stack="auto"><Card padding="md">Item 1</Card><Card padding="md">Item 2</Card><Card padding="md">Item 3</Card></Grid>'
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
title: "Grid with Background Image + Vignette",
|
|
40
|
+
description: "Grid with bgImage and vignette overlay; card items render above the media via z-10 wrapper",
|
|
41
|
+
code: '<Grid columns="2" gap="4" bgImage="https://..." bgOverlays="vignette" surface="dark-always" className="h-[300px]"><Card padding="md">Feature 1</Card><Card padding="md">Feature 2</Card></Grid>'
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
title: "Multi-Layer Overlay with Video",
|
|
45
|
+
description: "bgVideo with dark-30 base + gradient-radial focus at 70% opacity",
|
|
46
|
+
code: '<Grid columns="3" gap="3" bgVideo="https://..." bgOverlays="dark-30, gradient-radial/70" surface="dark-always"><Text>Item 1</Text></Grid>'
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
title: "Custom Gradient + Token Overlay",
|
|
50
|
+
description: "Custom linear gradient with hex stops + semantic brand token \u2014 no JSON needed",
|
|
51
|
+
code: '<Grid columns="2" gap="3" bgImage="https://..." bgOverlays="linear(180deg, #1a1a2e/0%, #1a1a2e/100%)/60, (brand)/15" surface="dark-always"><Text>Custom</Text></Grid>'
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
};
|
|
55
|
+
export {
|
|
56
|
+
docs
|
|
57
|
+
};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { cn } from "../../lib/cn.js";
|
|
4
|
+
import { concentricContainerStyle, paddingScaleFromClassName, withConcentricStyle } from "../../lib/concentric.js";
|
|
5
|
+
import { surfaceClass } from "../../lib/surface.js";
|
|
6
|
+
import { bgMediaLayer, resolveBgReadability } from "../../lib/media-overlays.js";
|
|
7
|
+
const gridVariants = cva("grid", {
|
|
8
|
+
variants: {
|
|
9
|
+
columns: {
|
|
10
|
+
"1": "grid-cols-1",
|
|
11
|
+
"2": "grid-cols-2",
|
|
12
|
+
"3": "grid-cols-3",
|
|
13
|
+
"4": "grid-cols-4",
|
|
14
|
+
"5": "grid-cols-5",
|
|
15
|
+
"6": "grid-cols-6",
|
|
16
|
+
/** Intrinsic: as many tracks as fit at `minWidth`, wrapping by itself in any container. Needs no `stack`. */
|
|
17
|
+
auto: ""
|
|
18
|
+
},
|
|
19
|
+
/** Smallest width a column may shrink to when `columns="auto"`. */
|
|
20
|
+
minWidth: {
|
|
21
|
+
xs: "[--grid-min:10rem]",
|
|
22
|
+
sm: "[--grid-min:14rem]",
|
|
23
|
+
md: "[--grid-min:18rem]",
|
|
24
|
+
lg: "[--grid-min:24rem]",
|
|
25
|
+
xl: "[--grid-min:32rem]"
|
|
26
|
+
},
|
|
27
|
+
/** Upper bound on tracks when `columns="auto"`: never more than N columns, however wide the container. */
|
|
28
|
+
maxColumns: {
|
|
29
|
+
none: "",
|
|
30
|
+
"2": "[--grid-max:2]",
|
|
31
|
+
"3": "[--grid-max:3]",
|
|
32
|
+
"4": "[--grid-max:4]",
|
|
33
|
+
"5": "[--grid-max:5]",
|
|
34
|
+
"6": "[--grid-max:6]"
|
|
35
|
+
},
|
|
36
|
+
rows: {
|
|
37
|
+
"1": "grid-rows-1",
|
|
38
|
+
"2": "grid-rows-2",
|
|
39
|
+
"3": "grid-rows-3",
|
|
40
|
+
"4": "grid-rows-4",
|
|
41
|
+
"5": "grid-rows-5",
|
|
42
|
+
"6": "grid-rows-6"
|
|
43
|
+
},
|
|
44
|
+
align: { start: "items-start", center: "items-center", end: "items-end", stretch: "items-stretch" },
|
|
45
|
+
/** Responsive collapse. "auto": 3+ cols → 2 on tablet → 1 on mobile; 2 cols → 1 on mobile. */
|
|
46
|
+
stack: { none: "", auto: "", mobile: "max-md:grid-cols-1", tablet: "max-lg:grid-cols-1" },
|
|
47
|
+
gap: {
|
|
48
|
+
"0": "gap-0 [--grid-gap:0px]",
|
|
49
|
+
"1": "gap-1 [--grid-gap:0.25rem]",
|
|
50
|
+
"2": "gap-2 [--grid-gap:0.5rem]",
|
|
51
|
+
"3": "gap-3 [--grid-gap:0.75rem]",
|
|
52
|
+
"4": "gap-4 [--grid-gap:1rem]",
|
|
53
|
+
"5": "gap-6 [--grid-gap:1.5rem]",
|
|
54
|
+
"6": "gap-8 [--grid-gap:2rem]",
|
|
55
|
+
"7": "gap-12 [--grid-gap:3rem]"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
compoundVariants: [
|
|
59
|
+
{ columns: "auto", minWidth: "xs", maxColumns: "none", className: "grid-cols-[repeat(auto-fit,minmax(min(100%,10rem),1fr))]" },
|
|
60
|
+
{ columns: "auto", minWidth: "sm", maxColumns: "none", className: "grid-cols-[repeat(auto-fit,minmax(min(100%,14rem),1fr))]" },
|
|
61
|
+
{ columns: "auto", minWidth: "md", maxColumns: "none", className: "grid-cols-[repeat(auto-fit,minmax(min(100%,18rem),1fr))]" },
|
|
62
|
+
{ columns: "auto", minWidth: "lg", maxColumns: "none", className: "grid-cols-[repeat(auto-fit,minmax(min(100%,24rem),1fr))]" },
|
|
63
|
+
{ columns: "auto", minWidth: "xl", maxColumns: "none", className: "grid-cols-[repeat(auto-fit,minmax(min(100%,32rem),1fr))]" },
|
|
64
|
+
{ columns: "auto", maxColumns: ["2", "3", "4", "5", "6"], className: "grid-cols-[repeat(auto-fit,minmax(min(100%,max(var(--grid-min),calc((100%_-_(var(--grid-max)_-_1)_*_var(--grid-gap))_/_var(--grid-max)))),1fr))]" },
|
|
65
|
+
{ stack: "auto", columns: ["2"], className: "max-md:grid-cols-1" },
|
|
66
|
+
{ stack: "auto", columns: ["3", "4", "5", "6"], className: "max-lg:grid-cols-2 max-md:grid-cols-1" }
|
|
67
|
+
],
|
|
68
|
+
defaultVariants: { columns: "2", align: "stretch", gap: "4", stack: "none", minWidth: "md", maxColumns: "none" }
|
|
69
|
+
});
|
|
70
|
+
function Grid({
|
|
71
|
+
as: Tag = "div",
|
|
72
|
+
className,
|
|
73
|
+
columns,
|
|
74
|
+
minWidth,
|
|
75
|
+
maxColumns,
|
|
76
|
+
rows,
|
|
77
|
+
align,
|
|
78
|
+
gap,
|
|
79
|
+
stack,
|
|
80
|
+
translucent,
|
|
81
|
+
surface,
|
|
82
|
+
style,
|
|
83
|
+
bgVideo,
|
|
84
|
+
bgImage,
|
|
85
|
+
bgSize,
|
|
86
|
+
bgOverlays,
|
|
87
|
+
bgVideoPaused,
|
|
88
|
+
bgPoster,
|
|
89
|
+
children,
|
|
90
|
+
...props
|
|
91
|
+
}) {
|
|
92
|
+
const concentricStyle = translucent ? (
|
|
93
|
+
// Padding comes from className (p-6, px-4 py-8): the real value, not a guess.
|
|
94
|
+
concentricContainerStyle(paddingScaleFromClassName(className), false, { border: true })
|
|
95
|
+
) : {};
|
|
96
|
+
const layoutClass = gridVariants({ columns, minWidth, maxColumns, rows, align, gap, stack });
|
|
97
|
+
const bg = resolveBgReadability({ surface, bgVideo, bgImage, bgOverlays });
|
|
98
|
+
const { hasMedia, media, content } = bgMediaLayer({ bgVideo, bgImage, bgSize, bgOverlays: bg.bgOverlays, bgVideoPaused, bgPoster }, layoutClass);
|
|
99
|
+
return /* @__PURE__ */ jsxs(
|
|
100
|
+
Tag,
|
|
101
|
+
{
|
|
102
|
+
"data-panel": translucent || void 0,
|
|
103
|
+
"data-surface": bg.surface || void 0,
|
|
104
|
+
className: cn(
|
|
105
|
+
hasMedia ? "relative overflow-hidden" : layoutClass,
|
|
106
|
+
translucent && "rounded-[var(--radius-panel)] border border-hairline shadow-card",
|
|
107
|
+
surfaceClass(bg.surface),
|
|
108
|
+
className
|
|
109
|
+
),
|
|
110
|
+
style: withConcentricStyle(style, concentricStyle),
|
|
111
|
+
...props,
|
|
112
|
+
children: [
|
|
113
|
+
media,
|
|
114
|
+
content(children)
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
export {
|
|
120
|
+
Grid,
|
|
121
|
+
gridVariants
|
|
122
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
const docs = {
|
|
2
|
+
name: "Heading",
|
|
3
|
+
group: "typography",
|
|
4
|
+
description: "Page, section and card titles on one type scale; the tag sets the document outline and picks the display or subheading font.",
|
|
5
|
+
features: [
|
|
6
|
+
"Sizes: sm 18px, md 20px, lg 24px (default) are fixed; xl 24\u219230px, 2xl 30\u219236px, 3xl 36\u219248px and the display sizes 4xl 36\u219260px and 5xl 36\u219272px are fluid: they grow smoothly with the nearest container (an AppFrame) or the window, no breakpoints",
|
|
7
|
+
"Font role by tag: h1/h2 and display sizes use the display font, h3-h6 use --font-subheading (the body font unless ThemeProvider sets subheadingFont). An explicit font-* class wins",
|
|
8
|
+
"weight (default semibold), tracking and truncate (three-line clamp); text-balance on every heading",
|
|
9
|
+
"as renders any tag: h1-h6, div, span"
|
|
10
|
+
],
|
|
11
|
+
accessibility: [
|
|
12
|
+
"Pick `as` for the document outline (one h1 per page, no skipped levels) and `size` for the look; the two are independent",
|
|
13
|
+
"Text colour is text-fg, which meets WCAG 2.2 AA contrast (4.5:1) on every surface token"
|
|
14
|
+
],
|
|
15
|
+
usage: {
|
|
16
|
+
bestPractices: [
|
|
17
|
+
{ guidance: true, description: "Choose the heading level with `as` and the visual size with `size`." },
|
|
18
|
+
{ guidance: true, description: "Pair a heading with a muted Text line for page and section intros." },
|
|
19
|
+
{ guidance: false, description: "Do not add font-display or font-sans to an h3-h6 Heading \u2014 the tag already selects the subheading font." },
|
|
20
|
+
{ guidance: true, description: "Pick the size for the widest layout and let it scale: section titles 2xl or 3xl, heroes 4xl or 5xl. They shrink in a narrow column, card, app frame or phone without breakpoints." },
|
|
21
|
+
{ guidance: false, description: "Do not set text-2xl or similar size classes on headings, and do not add breakpoint size steps such as md:text-6xl; use the size prop. The one exception: a plain size class such as text-6xl pins a heading to a fixed size when it must not scale." }
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
examples: [
|
|
25
|
+
{
|
|
26
|
+
title: "Page header",
|
|
27
|
+
code: `<div>
|
|
28
|
+
<Heading as="h1" size="2xl">Dashboard overview</Heading>
|
|
29
|
+
<Text size="sm" color="muted">System performance and active project metrics.</Text>
|
|
30
|
+
</div>`
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
title: "Display heading",
|
|
34
|
+
description: "Fluid: 36px in a narrow container, up to 72px on a wide one.",
|
|
35
|
+
code: '<Heading as="h1" size="5xl">Design that agents follow</Heading>'
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
title: "Fixed display size",
|
|
39
|
+
description: "A size class such as text-6xl in className replaces the fluid size; this heading is 60px everywhere.",
|
|
40
|
+
code: '<Heading as="h1" size="5xl" className="text-6xl">Design that agents follow</Heading>'
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
};
|
|
44
|
+
export {
|
|
45
|
+
docs
|
|
46
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { cn } from "../../lib/cn.js";
|
|
4
|
+
const FLUID_XL = "text-[clamp(1.5rem,1.2rem_+_1.2cqi,1.875rem)] leading-[1.25]";
|
|
5
|
+
const FLUID_2XL = "text-[clamp(1.875rem,1.575rem_+_1.2cqi,2.25rem)] leading-[1.2]";
|
|
6
|
+
const FLUID_3XL = "text-[clamp(2.25rem,1.65rem_+_2.4cqi,3rem)] leading-[1.12]";
|
|
7
|
+
const FLUID_4XL = "text-[clamp(2.25rem,1.05rem_+_4.8cqi,3.75rem)]";
|
|
8
|
+
const FLUID_5XL = "text-[clamp(2.25rem,0.96rem_+_5.14cqi,4.5rem)]";
|
|
9
|
+
const headingVariants = cva("text-fg text-balance", {
|
|
10
|
+
variants: {
|
|
11
|
+
size: {
|
|
12
|
+
inherit: "",
|
|
13
|
+
sm: "text-lg",
|
|
14
|
+
md: "text-xl",
|
|
15
|
+
lg: "text-2xl",
|
|
16
|
+
// xl and up are fluid: they grow smoothly with the nearest container (an AppFrame)
|
|
17
|
+
// or, outside one, the window. xl 24-30px, 2xl 30-36, 3xl 36-48, and the display
|
|
18
|
+
// sizes 4xl 36-60 and 5xl 36-72 for heroes. sm, md and lg stay fixed. A text-*
|
|
19
|
+
// class in className replaces the fluid size.
|
|
20
|
+
xl: FLUID_XL,
|
|
21
|
+
"2xl": FLUID_2XL,
|
|
22
|
+
"3xl": FLUID_3XL,
|
|
23
|
+
"4xl": `${FLUID_4XL} leading-[1.08] tracking-tight`,
|
|
24
|
+
"5xl": `${FLUID_5XL} leading-[1.05] tracking-tight`,
|
|
25
|
+
"4": "text-lg",
|
|
26
|
+
"5": "text-xl",
|
|
27
|
+
"6": "text-2xl",
|
|
28
|
+
"7": FLUID_XL,
|
|
29
|
+
"8": FLUID_2XL,
|
|
30
|
+
"9": FLUID_3XL,
|
|
31
|
+
"10": `${FLUID_4XL} leading-[1.08] tracking-tight`,
|
|
32
|
+
"11": `${FLUID_5XL} leading-[1.05] tracking-tight`
|
|
33
|
+
},
|
|
34
|
+
weight: {
|
|
35
|
+
inherit: "",
|
|
36
|
+
normal: "font-normal",
|
|
37
|
+
medium: "font-medium",
|
|
38
|
+
semibold: "font-semibold",
|
|
39
|
+
bold: "font-bold"
|
|
40
|
+
},
|
|
41
|
+
tracking: {
|
|
42
|
+
inherit: "",
|
|
43
|
+
tighter: "tracking-tighter",
|
|
44
|
+
tight: "tracking-tight",
|
|
45
|
+
normal: "tracking-normal",
|
|
46
|
+
wide: "tracking-wide",
|
|
47
|
+
wider: "tracking-wider",
|
|
48
|
+
widest: "tracking-widest"
|
|
49
|
+
},
|
|
50
|
+
truncate: {
|
|
51
|
+
true: "line-clamp-3 overflow-hidden text-ellipsis",
|
|
52
|
+
false: ""
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
defaultVariants: { size: "lg", weight: "semibold", tracking: "normal", truncate: false }
|
|
56
|
+
});
|
|
57
|
+
const SUBHEADING_TAGS = /* @__PURE__ */ new Set(["h3", "h4", "h5", "h6"]);
|
|
58
|
+
const DISPLAY_SIZES = /* @__PURE__ */ new Set(["3xl", "4xl", "5xl", "9", "10", "11"]);
|
|
59
|
+
const EXPLICIT_FAMILY = /(^|\s)font-(display|subheading|sans|body|serif|mono)(\s|$)/;
|
|
60
|
+
function headingFamily(tag, size, className) {
|
|
61
|
+
if (className && EXPLICIT_FAMILY.test(className)) return "";
|
|
62
|
+
const isSub = typeof tag === "string" && SUBHEADING_TAGS.has(tag) && !DISPLAY_SIZES.has(String(size ?? ""));
|
|
63
|
+
return isSub ? "font-subheading" : "font-display";
|
|
64
|
+
}
|
|
65
|
+
function Heading({
|
|
66
|
+
as: Tag = "h2",
|
|
67
|
+
size,
|
|
68
|
+
weight,
|
|
69
|
+
tracking,
|
|
70
|
+
truncate,
|
|
71
|
+
className,
|
|
72
|
+
children,
|
|
73
|
+
...props
|
|
74
|
+
}) {
|
|
75
|
+
return /* @__PURE__ */ jsx(Tag, { className: cn(headingFamily(Tag, size, className), headingVariants({ size, weight, tracking, truncate }), className), ...props, children });
|
|
76
|
+
}
|
|
77
|
+
export {
|
|
78
|
+
Heading,
|
|
79
|
+
headingVariants
|
|
80
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const docs = {
|
|
2
|
+
name: "Heatmap",
|
|
3
|
+
description: "A labelled grid of cells shaded by value: cohort retention, activity by day and hour, correlations.",
|
|
4
|
+
features: [
|
|
5
|
+
"values[row][column], null leaves a cell empty (cohort triangle)",
|
|
6
|
+
"tone brand | success | warning | danger",
|
|
7
|
+
"format number or percent; showValues toggles in-cell numbers",
|
|
8
|
+
"Scrolls sideways instead of squashing columns"
|
|
9
|
+
],
|
|
10
|
+
accessibility: ["The chart has role=img with a label; keep the surrounding heading and values in text", "Colour is never the only signal: legends, labels and tooltips carry names and values"],
|
|
11
|
+
keyboard: "Hover to inspect values.",
|
|
12
|
+
usage: {
|
|
13
|
+
bestPractices: [
|
|
14
|
+
{ guidance: true, description: "Use a Heatmap for two-dimensional patterns. Keep to one tone so intensity is the only signal." },
|
|
15
|
+
{ guidance: false, description: "Do not pass pre-formatted strings as values; keep numbers raw and format with yFormat." }
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
examples: [
|
|
19
|
+
{
|
|
20
|
+
title: "Activity by hour",
|
|
21
|
+
code: `<Heatmap
|
|
22
|
+
rows={["Mon", "Tue", "Wed"]}
|
|
23
|
+
columns={["9am", "12pm", "3pm", "6pm"]}
|
|
24
|
+
values={[
|
|
25
|
+
[12, 40, 35, 8],
|
|
26
|
+
[15, 44, 30, 10],
|
|
27
|
+
[9, 38, 41, 12],
|
|
28
|
+
]}
|
|
29
|
+
/>`
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
title: "Retention",
|
|
33
|
+
code: `<Heatmap
|
|
34
|
+
rows={["Jan cohort", "Feb cohort", "Mar cohort"]}
|
|
35
|
+
columns={["Week 0", "Week 1", "Week 2"]}
|
|
36
|
+
values={[
|
|
37
|
+
[1, 0.62, 0.48],
|
|
38
|
+
[1, 0.58, null],
|
|
39
|
+
[1, null, null],
|
|
40
|
+
]}
|
|
41
|
+
format="percent"
|
|
42
|
+
max={1}
|
|
43
|
+
/>`
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
};
|
|
47
|
+
export {
|
|
48
|
+
docs
|
|
49
|
+
};
|