@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
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@shavin/ui` are recorded here. After 0.1.0, releases are versioned and described with [Changesets](https://github.com/changesets/changesets).
|
|
4
|
+
|
|
5
|
+
## 0.1.0 — first npm release
|
|
6
|
+
|
|
7
|
+
The Shavin React primitive library: token-driven components that coding agents can read and check.
|
|
8
|
+
|
|
9
|
+
### What's in it
|
|
10
|
+
|
|
11
|
+
- 94 primitives with a documented, machine-readable API (`components.json`)
|
|
12
|
+
- The `Container` docs say which size a page uses: `lg` (72rem) for every body section, `xl` for the nav and footer, `full` for media; no change to the component or its default
|
|
13
|
+
- Semantic design tokens as CSS variables, a Tailwind 3 preset and Tailwind 4 theme files, light and dark, sRGB and OKLCH builds
|
|
14
|
+
- `ThemeProvider` with brand colour, density and scaling, plus a dev inspector that streams live token and contrast checks to the MCP bridge
|
|
15
|
+
- The dev inspector loads on demand: a production page that never shows it no longer downloads it
|
|
16
|
+
- The dev inspector has a Select tool (one outline that glides between elements, still under reduced motion) and an Issues tool: calm dot and ring markers, a list with filters, and findings for overlapping text, tight line height, contrast on a solid background, horizontal overflow, small tap targets and console errors next to the token checks. Findings are advice and never fail a build. An ignored finding stays in the list in gray and is not counted anywhere. The inspector keeps its own colours, so a page theme cannot restyle it.
|
|
17
|
+
- Click an element, a marker or a list row in the dev inspector and one dialog opens beside it (never over the element, the bar or the list; a bottom sheet on a phone): what is wrong and the fix, a note, Ignore, Copy as prompt, and Send to agent. Send reaches an agent through the local bridge (`await_finding`, or `shavin findings` from a shell); the list shows where each finding stands (waiting, with the agent, done, resolved). Ignoring a finding also takes it out of the queue if no agent has it yet.
|
|
18
|
+
- The dev inspector is now a control bar that starts as a round tile with the Shavin logo. Drag it by the logo to one of eight spots (it is remembered), collapse it, and use four tools: Select, Issues, Theme and Settings (keys `V`, `I`, `T` and `,`; `Esc` steps back one level; `Alt+Shift+S` hides it). Theme is a floating panel with the same controls the old Theme tab had, plus Copy Theme Code. Settings turns the single-key shortcuts off, reduces motion, reserves room for the bar, forces light or dark controls and clears ignored findings, and has a row that opens the older panel (DS Audit, MCP, Stream). The bar moves out of the way of what you select, panels step around it, and on a phone it is a bottom dock with one shared sheet. The old round launcher, the Theme tab of the older panel and the dashed red outline it drew on violations are removed; the Issues tool replaces the outline. `ShavinDevTools` `position` now sets where the bar starts.
|
|
19
|
+
- Server Component helpers in `@shavin/ui/server`
|
|
20
|
+
- Accessibility built in: Radix behaviour, visible focus, contrast-checked brand colours
|
|
21
|
+
- `PortalContainerProvider` and `usePortalContainer`: a frame that scales or clips its content can make Popover, Menu, ContextMenu, HoverCard, Tooltip, Select and Dropdown open inside it (default is still `document.body`). `BlockPreview` uses it, and its toolbar becomes icon buttons on phones
|
|
22
|
+
- `Drawer` takes `trigger`, `defaultOpen` and `onOpenChange` (uncontrolled, no state needed); `open` and `onClose` are now optional. A drawer with no trigger is open by default, as before
|
|
23
|
+
- `Table` no longer looks clipped on a narrow screen: when it is wider than its container it fades the edge that still has content, becomes a keyboard-focusable region while it scrolls, and takes `scrollLabel` for the region's name. Do not wrap a `Table` in `overflow-hidden`.
|
|
24
|
+
- `Text` docs: `size="overline"` is for a label that adds information, used sparingly; most headings need none (guidance text only, no API change)
|
|
25
|
+
- Removed before release: the cross-site URL helpers (`isLocalhost`, `getWebsiteUrl`, `getStudioUrl`, `getDocsUrl`, `getCommunityUrl`, `getKitsUrl`, `getAssetsUrl`) and the `@shavin/ui/lib/docs-routes` subpath (`DOCS_ROUTES`, `docsPath`, `docsUrl`). They only served the Shavin sites; nothing in the published packages links to the documentation website any more. Not breaking for anyone: none of this was in a published release
|
|
26
|
+
- The inspector's "Add custom font" option explains how to add a font in place instead of opening the documentation website
|
|
27
|
+
- The target size warning (`hitArea="none"`) and the Button, Link and ThemeProvider docs say what the 24px floor is, the trade-off and how to restore it in place; they no longer link to the documentation website
|
|
28
|
+
- `ShavinDevTools` no longer reports a made-up "7.1:1 (AAA Pass)" when a colour cannot be read: it says "unknown". Its contrast note names WCAG 2, not 2.1
|
|
29
|
+
- AI primitives gain the states voice and streaming UIs need. Nothing is removed and every default is kept
|
|
30
|
+
- `VoiceInput`
|
|
31
|
+
- `mode="hands-free"`: a centred stack with one Stop button, for voice-activity detection (new `VoiceInputMode` type)
|
|
32
|
+
- a `processing` state with `processingLabel`
|
|
33
|
+
- a `description` line, and a transcript that wraps to two lines at any width
|
|
34
|
+
- a cancel button while requesting, transcribing and processing, when `onCancel` is passed
|
|
35
|
+
- `ChatBubble`
|
|
36
|
+
- `interim` for live, unconfirmed text such as a speech transcript
|
|
37
|
+
- `sharpCorner` (top by default, bottom or none) and `hoverTimestamp`
|
|
38
|
+
- `Reasoning`
|
|
39
|
+
- times the thinking itself ("Thinking… 4s", then "Thought for 4s") unless `duration` is passed
|
|
40
|
+
- announces when it finishes
|
|
41
|
+
- `maxHeight` scrolls long text inside the block
|
|
42
|
+
- `ToolCall`
|
|
43
|
+
- `title`: a wrapping plain-language heading in place of the monospace `name`
|
|
44
|
+
- `compact`: icon only, status kept for screen readers
|
|
45
|
+
- `footer`: a row under the result for actions such as Undo
|
|
46
|
+
- **Visible change**: `Reasoning` folds away when thinking finishes (new `autoCollapse`, on by default)
|
|
47
|
+
- pass `autoCollapse={false}` to keep a block open
|
|
48
|
+
- existing uncontrolled blocks now collapse on their own
|
|
49
|
+
- **Visible change**: `ChatBubble` keeps its 85% width cap on the message column, not on the bubble, so a short bubble sizes to its text instead of wrapping early in a narrow container
|
|
50
|
+
- Opt-in brand-tinted greys: `ThemeProvider` takes `neutrals` (`"neutral"` or `"brand"`) and `neutralsAmount` (`"subtle"` or `"medium"`). With `"brand"` the greys lean toward the brand hue at very low chroma and keep the lightness of the plain greys, so contrast is unchanged. The default is unchanged
|
|
51
|
+
- **Visible change**: headings in composed sections fade and rise as they scroll into view (CSS only, off under `prefers-reduced-motion`; `data-reveal="off"` opts out), and interactive cards move one pixel on press
|
|
52
|
+
|
|
53
|
+
### Also in this release
|
|
54
|
+
|
|
55
|
+
Anyone who copied Shavin from the public GitHub repository before this release should read the **Breaking** items.
|
|
56
|
+
|
|
57
|
+
- **Breaking**: the default display font is Rethink Sans, not Space Grotesk (`--font-display`, the Tailwind preset fallback, the `Monochrome` preset and the Studio, docs and DevTools defaults). Space Grotesk stays in the font list. To keep it, pass `displayFont="Space Grotesk"` to `ThemeProvider`.
|
|
58
|
+
- **Breaking**: theme presets are cut from 16 to 9: `Monochrome`, `Midnight`, `Neo Tokyo`, `Terminal`, `Velvet`, `Paper` (was `Minimal`), `Editorial`, `Hearth` (was `Warm`) and `Opal` (was `Nordic`). Removed: `Linear` (use `Midnight`), `Vanguard`, `Cyber`, `Sunset`, `Ocean`, `Oasis` and `Playful`. Brand colour is its own setting, so a removed preset is reproduced with `theme` plus `brandColor`. `Neo Tokyo` now uses Host Grotesk, `Midnight` uses Inter, and `Opal` uses Figtree.
|
|
59
|
+
- **Breaking**: the brand colour is `brand`, not `accent`. CSS variables `--accent*` are now `--brand*`, Tailwind colours `accent*` are now `brand*`, and every component class follows (`bg-accent` becomes `bg-brand`). The `ThemeProvider` prop is `brandColor` (was `accentColor`), plus `applyBrandColor`, `BRAND_PRESETS`, the `tone="brand"` / `color="brand"` values, the `shavin-brand` storage key and `tokens.json` `presets.brands`. Why: shadcn/ui owns `--accent`, and the two clashed in one project.
|
|
60
|
+
- **Breaking**: `--brand-primary` is removed (and `bg-brand-primary`). Use `--brand` / `bg-brand`.
|
|
61
|
+
- **Breaking**: the global stylesheet is split. Element defaults (body type, focus ring, selection, scrollbars) move to `@shavin/ui/base.css` (and `base-oklch.css`); `@shavin/ui/tokens.css` (and `tokens-oklch.css`) hold tokens only. On Tailwind 4, import `base.css` with `layer(base)` after `@import "tailwindcss"`. `styles.css` and `global-oklch.css` still include both.
|
|
62
|
+
- **Breaking**: Tailwind 3 CommonJS configs now `require("@shavin/ui/tailwind-preset")` and get a real preset (new `require` export, `dist/tailwind-preset.cjs`). Before, the ES module namespace was returned and no Shavin colour utilities were generated.
|
|
63
|
+
- **Breaking**: deprecated APIs are removed: `Dialog` `subtitle` (use `description`), `ActionBar` `onInsert` (use `onAction`), `SegmentedControl` `iconOnly` (use `variant="expand"`), `oklchAchromaticInversion` (use `oklchBrandForMode`) and `MURMUR_FREE_STATES` (use `MURMUR_STATES`).
|
|
64
|
+
- `<Icon name>` loads only the icons it renders; the full registry lives in `@shavin/ui/icons` (`preloadIcons`, `ICON_NAMES`, `iconExists`). Server-rendered pages no longer report a hydration mismatch.
|
|
65
|
+
- New token `--bg-elevated-hover` (`bg-elevated-hover`): hovered and keyboard-highlighted rows in menus, selects and comboboxes are now visible in dark mode. Visible change: dark-mode highlighted rows are a shade lighter.
|
|
66
|
+
- Links and focus rings use the contrast-corrected colour on first paint. `ThemeProvider` defaults to `"system"` and 100% scaling. `TabsTrigger` inherits the `TabsList` variant and orientation.
|
|
67
|
+
- **Visible change**: the default focus ring is now thinner and subtler: 1px (was 2px), same 2px offset, same contrast-guaranteed brand text colour. New `focusRing` prop on `ThemeProvider` and `ScopedThemeProvider` (`"subtle"` default, `"default"` = the previous 2px ring, `"strong"` = 3px), backed by new tokens `--focus-width`, `--focus-offset` and `--focus-offset-inset` and a `data-focus-ring` attribute. Opt out of the change with `focusRing="default"`. Every primitive, Studio and the docs follow the tokens (no component draws its own 2px or brand-fill ring any more). Text fields still draw the ring over their border. WCAG 2.4.13 Focus Appearance (AAA) is not claimed for `subtle`.
|
|
68
|
+
- Brand-coloured borders, rings and bars that show a state (checked checkbox and radio, selected tab and tab underline, current step, selected day, drop target, selected card) use `brand-text` (`border-brand-text`, `ring-brand-text`, `bg-brand-text`) instead of the raw brand fill, so they reach 3:1 against what they sit next to for any brand colour (lime and other light brands were 1.2-3:1 on light pages). `validate_code` warns on the raw form (`raw-brand-border`).
|
|
69
|
+
- Root `styles.css` and `global-oklch.css` for tools that ignore package `exports`. New `WiseOwlLogo` and `WiseOwlMark` sample-brand exports (internal).
|
|
70
|
+
- `engines.node` is `>=18.18`.
|
|
71
|
+
- **Accessibility claim is WCAG 2.2 AA only (never AAA).** Component docs (`ThemeProvider`, `Heading`, `Text`, `ThemeSwitcher`) and the MCP `synthesize_layout` checklist no longer say AAA; they state what the tests prove: 4.5:1 for text and 3:1 for control boundaries and focus. A unit test fails if a public non-skills source reintroduces an AAA claim. The CLI score badge (build, eval, ledger and test scripts) is now computed from the score and each script's passing threshold (`scripts/lib/grade.mjs`): at or above the threshold it prints VERIFIED with a bronze, silver, gold or platinum tier from a data preset, from the acceptable floor (80) up to the threshold it prints a neutral ACCEPTABLE, and below that NEEDS WORK, instead of a fixed label. Exit codes still use each script's own threshold.
|
|
72
|
+
- **Target size policy (WCAG 2.2 AA 2.5.8, never AAA):** every interactive component has a hit area of at least 24×24 CSS px, and under `@media (pointer: coarse)` the primary controls (`Button`, `IconButton`, `TextField`, `Switch`, `Checkbox`, `RadioGroup`, `Tabs`, `SegmentedControl`, `Select`, `SidebarTrigger`, `ThemeSwitcher`, the `CodeBlock` copy and toggle buttons) reach 44×44. The extra area is an invisible `::after` from the new `hit-area` / `hit-area-touch` classes in `base.css`, so size, layout and focus rings are unchanged (use them on custom controls; they need `base.css`, which `styles.css` already includes). **Notable, visible change for touch users:** `TextField`, `Combobox` and the native `Dropdown` grow to a 44px minimum height on touch screens (a native input cannot carry a pseudo-element); desktop is unchanged. One-line opt-out: `<ThemeProvider touchTargets="compact">`, which keeps them at 40 (`md`) and 32 (`sm`) and stops every primary control growing on touch. Also: `Breadcrumbs` links, `Stepper` steps, the `Slider` thumb, `Reasoning`, `Sortable` handles and `FormErrorSummary` links reach 24px; `Resizable` handles are 24px wide for every pointer (were 8px with a mouse); `PanelGroup` dividers hit-test 24px (mouse) and 44px (touch).
|
|
73
|
+
- **Target size is switchable and overridable.** `ThemeProvider` and `ScopedThemeProvider` take `touchTargets="comfortable" | "compact"` (default comfortable: today's behaviour; compact: no 44px growth on touch, the 24px WCAG 2.5.8 floor stays). CSS tokens `--tap-min` (24px) and `--tap-min-touch` (44px) tune it. Per component, `hitArea="none" | "default" | "touch"` on `Button`, `IconButton`, `Switch`, `Checkbox`, `RadioGroup` / `Radio`, `Tabs`, `SegmentedControl`, `Select`, `Dropdown`, `Combobox`, `TextField`, `SidebarTrigger`, `ThemeSwitcher`, `CodeBlock`, `Stepper`, `Slider`, `Link`, `Reasoning` and `SortableHandle` (`"none"` can go below 24px; that is yours to own). `hit-area`, `hit-area-touch`, `hit-area-force`, `hit-area-input` and `hit-area-none` are public utilities in `base.css`; they reserve the element's `::after`, and `hitArea="none"` hands it back. `Link` has an opt-in `standalone` prop (24px target for navigation, footer and table-of-contents links; inline links are unchanged). Calendar days, swatches, Rating, Pagination, menu rows, BottomNav and Carousel keep the 24px AA floor; opt in to 44px with `hitArea="touch"` or `hit-area-touch`. Shavin claims WCAG 2.2 AA (2.5.8), not 44px (AAA).
|
|
74
|
+
- `hitArea="none"` still works, but in development (`NODE_ENV` not `production`, in the browser) the first use on each component type logs one `console.warn`: it drops the control below the WCAG 2.2 AA 2.5.8 24px floor unless it is already 24px, and the message says how to restore it (remove the prop, `hitArea="default"`, or a 24px target another way). Silent in production and on the server. `ScopedThemeProvider` without `touchTargets` inherits from its parent (documented: it is not an explicit `"comfortable"`; pass one to override a compact page).
|
|
75
|
+
- **Visible change:** `Badge` `variant="soft"` for `success`, `warning` and `danger` uses an 8% tint (was 10%), so the text clears 4.5:1 on the blended background in light mode at every gray preset (it was 4.39 to 4.49). The tint is a shade lighter; dark mode and `tone="brand"` are unchanged.
|
|
76
|
+
- New state components: `EmptyState` (`kind` first-time / empty / no-results / success), `FormField` (label, hint and error for any control that has none of its own) and `FormErrorSummary` (submit-time error list that takes focus). New exports `concentricRadius` and `paddingScaleFromClassName`; `CalloutProps` is exported.
|
|
77
|
+
- `Button` and `IconButton`: new `loading`, `loadingLabel` and `disabledReason` props. **Visible change:** a plain `disabled` button keeps `disabled` but no longer sets `pointer-events: none`, so it shows the not-allowed cursor; `disabledReason` renders `aria-disabled` (focusable) with the reason in a Tooltip; `loading` keeps the button focusable with the progress cursor. Hover and press styles are off in all three states.
|
|
78
|
+
- **Visible change (brand text contrast):** `--brand-contrast`, `--brand-text`, `--link` and `--focus` (`brandTextFor`, `oklchTextFor`, and the CLI `shavin brand` output) now guarantee 4.5:1 for brand-coloured text for any brand colour, light and dark, on every page fill of every gray preset (including dark `elevated-hover`) and on the brand's own soft tint over them (Badge `soft`, Button and IconButton `soft` and their hover, Avatar `soft`). Before, only the plain page fills were checked, so `Badge tone="brand" variant="soft"` could fall to 4.19:1 (light) and 4.23:1 (dark). Links, underlines and focus rings use the same colour, so they clear 3:1 (WCAG 1.4.11) as well. Hue is kept; only lightness moves. Notable for brands whose text colour shifts: of the 24 presets, 41 of 48 preset x mode text colours change, by a median OKLCH lightness of 0.06 (largest 0.10, for example Blue dark text goes from rgb(0 144 255) to rgb(77 177 255), Tomato light from rgb(192 65 39) to rgb(169 57 34)). Unchanged: Monochrome, Lime (both modes), and Mint, Sky and Amber in dark mode. Barely visible (at most 5 of 255 per channel): Mint, Sky and Amber in light mode. A brand that already passes everywhere (a deep navy in light mode) keeps its text colour. Dark-mode brand text is lighter, and light-mode brand text darker, than before. Solid fills (`bg-brand`) are untouched. The visible colour change was reviewed against a before/after preview.
|
|
79
|
+
- `Link` is a stand-alone link (24px hit area, no layout change) by default when `underline="none"`, because agents write every navigation and footer link that way and left out `standalone`; `standalone={false}` opts out. Links with an underline are unchanged.
|
|
80
|
+
- **Visible change:** `StatCard alert` no longer underlines the value (an underline reads as a link). It shows a warning dot before the label and "Needs attention" for screen readers.
|
|
81
|
+
- The dev inspector's MCP tool list shows the new `render_check` tool (one line in `ShavinDevTools`).
|
|
82
|
+
- **Visible change (brand text, raw `text-brand` removed):** 27 class lists in 12 primitives used `text-brand` (the brand FILL) as a text or icon colour, which fails contrast for light brands such as lime or yellow and for dark brands in dark mode. They now use `text-brand-text` (the contrast-guaranteed colour): Pagination cards hover, Rating `tone="brand"`, Toast info icon, Stepper current step, SegmentedControl on-state, BottomNav active item, Select checked item, AlertDialog info, IconPicker selected, TimePicker active mode, BlockPreview prompt and the dev inspector. Brand text in those components shifts to the same colour as links and `Text color="brand"`. Use `text-brand-text` (or `text-brand-contrast`) in your own code; `text-brand-fg` is for text on a solid `bg-brand`. `validate_code` warns on raw `text-brand` (`raw-brand-text`).
|
|
83
|
+
- **Notable (Studio exported files, brand text):** Studio code export now writes `text-brand-text` for text with `color="brand"` instead of the raw `text-brand` fill, so exported brand text keeps its contrast on light and dark brands. Studio still reads `text-brand`, `text-brand-text` and `text-brand-contrast` as the brand colour, so older files open unchanged. The first time you save or export an older file, its brand text classes are rewritten to `text-brand-text`: a one-time change in the diff, same colour on the canvas. The `autofix` helper in the evals maps colour utilities to `text-brand-text` too.
|
|
84
|
+
- **Visible change (solid brand fills, `brandSolid`):** solid brand buttons, badges and selected states used the exact brand fill, so most presets got near-black text on a mid-tone fill (14 of the 24 presets, in light and dark). New tokens `--brand-solid` and `--brand-solid-hover` (`bg-brand-solid`, `hover:bg-brand-solid-hover`, `border-brand-solid`, plus `--brand-on-dark-*` and `--brand-on-light-*` twins) hold the fill under text, and `--brand-fg` is the text on them. The default, `ThemeProvider` `brandSolid="accessible"`, keeps the brand's hue and lowers OKLCH lightness just far enough for **white text at 4.6:1**: 14 of 24 presets get a slightly deeper fill (Tomato, Red, Ruby, Crimson, Pink, Blue, Cyan, Teal, Jade, Green, Grass, Gold, Bronze, Brown; lightness drop median 0.067, largest 0.107 on Cyan), the hover fill keeps the text at 4.5:1, and a genuinely light brand (Lime, Mint, Sky, Amber, and Monochrome in dark mode) keeps its exact fill with dark text. `--brand` itself does not change. Opt out with `brandSolid="exact"` (the previous output, byte for byte); `brandSolid="perceptual"` keeps the exact fill and picks white text wherever APCA prefers it, which misses WCAG 2 AA on 14 of 24 presets and logs a one-time development warning. `ScopedThemeProvider` takes the same prop and inherits the provider's. Every primitive that puts text on the brand (Button, IconButton, Badge, Avatar, Tabs, SegmentedControl, Stepper, Pagination, Calendar, TimePicker, DatePicker, BottomNav, ChatBubble, AlertDialog, SentimentRating) and the on-state of Switch, Checkbox, RadioGroup, Slider and Progress use it; `Button` and `IconButton` hover with `hover:bg-brand-solid-hover` instead of `hover:opacity-90`. In your own code use `bg-brand-solid text-brand-fg hover:bg-brand-solid-hover` for anything with text on the brand and keep `bg-brand` for decoration; `validate_code` warns on `bg-brand` with `text-brand-fg` (`raw-brand-solid`). Overriding `--brand-solid` or `--brand-fg` in your own CSS bypasses the guarantee. The shadcn bridge maps `--primary` to `--brand-solid`. CLI: `shavin brand` adds `--brand-<name>-solid`, `-solid-hover` and a matching `-fg` for every extra brand colour (`--brand-solid-mode: accessible | exact | perceptual;` in `brand-tokens.css`; `solid`, `solid-hover` and `solid-mode` are now reserved names), and `shavin doctor` / `inspect_environment` report the active mode, flag `perceptual` and warn on literal overrides under 4.5:1. Studio exports `brandSolid` on the ThemeProvider it generates.
|
|
85
|
+
- **Visible change (readable text over background media):** a layout (`Section`, `Box`, `Container`, `Flex`, `Grid`, `Card`) with a photo (`bgImage`), video (`bgVideo`) or `fx:` backdrop and no `surface` now defaults to `surface="dark-always"` (light text) and adds a scrim unless the overlays already have one: `dark-30` for photos and video, `dark-50` for fx. Before, the text kept the page colour and was often unreadable. An explicit `surface` or overlay always wins, a `light-*` tint keeps dark text, and meshes and custom gradients are unchanged because their tone depends on the page theme (set `surface` yourself). New export `resolveBgReadability`.
|
|
86
|
+
- **Visible change:** `Callout` sets `role="alert"` for `color="danger"` and `role="status"` for the other colours; pass `role="note"` for a static notice.
|
|
87
|
+
- `TextField` error messages show an icon and are announced once when they appear (`announceError`, default true). `DatePicker` and `TimePicker` accept `aria-invalid` / `aria-required` (and `TimePicker` `id`, `aria-labelledby`, `aria-describedby`). `Tooltip` accepts controlled `open` / `onOpenChange`.
|
|
88
|
+
- **Visible change:** `Toast` shows at most three toasts at once, drops an identical message that is already showing, keeps plain errors for 8 seconds, and below the md breakpoint moves the stack to the bottom centre at full width.
|
|
89
|
+
- **Breaking**: `concentricCompoundStyle` is removed. Its value referenced `--radius-panel-inner` inside itself, a CSS cycle that resolved to nothing. Nest a padded `Card` instead (nested Cards are now concentric).
|
|
90
|
+
- **Visible change (radius):** translucent `Box` / `Flex` / `Grid` / `Section` take the inner radius from their real padding (className) instead of assuming `p-4`; `Card padding="none"` gives flush children its own radius instead of an ancestor's; a `Card` inside a `Card` uses the parent's inner radius; menu, select, dropdown and context-menu items are inset by `p-1` and use `rounded-panel-p1`; segmented `Tabs` use `rounded-panel-p1`; `SegmentedControl` uses the new `rounded-control-inner` utility; `Stepper`, `IconPicker` and `ContextMenu` no longer use the undefined `--radius-md` (it rendered square). `applyRadiusPreset` and `themeCss` also set `--radius-panel-inner`.
|
|
91
|
+
- **Breaking (build output)**: the package ships one ES module per source file with explicit `.js` imports and `sideEffects` set, instead of one flattened `dist/index.js`, so bundlers drop the components a page does not import. In a production Next 15 build a Button-only page drops from about 245 kB to about 28 kB gzip over an empty page; Vite and esbuild with code splitting show the same cut. Bundled `.d.ts` files stay per public entry. The package is ESM only (the Tailwind 3 preset still ships as CommonJS). The motion runtime no longer boots as a side effect of importing the root (that would keep the whole library in every bundle): `ThemeProvider` starts it on mount, and an app without a ThemeProvider calls `initMotionRuntime()`.
|
|
92
|
+
- **Fix**: `ThemeProvider` follows the OS appearance in client-only apps (Vite, `createRoot`). The inline `ThemeScript` only runs in server-rendered HTML, so such an app stayed light on a dark OS. On mount, before first paint, `ThemeProvider` now sets the `dark` class, `data-theme` and `color-scheme` from the stored choice or the OS setting, applies the brand tokens for that appearance and, while the preference is "system", follows OS changes. A stored light or dark choice (or `defaultTheme`) is respected, and HTML that was already resolved (server-rendered apps, next-themes) is left alone. A page that shows content before the bundle runs can still flash light for one frame; put the same appearance script in `index.html` to avoid it.
|
|
93
|
+
- **Breaking**: the package no longer includes its `src` folder, and the `@shavin/ui/primitives/*` and `@shavin/ui/lib/*` subpaths (raw TypeScript) are removed. Import everything from `@shavin/ui` (`cn` and the theme preset functions are exported from the root; `cn` is also in `@shavin/ui/server`). The one kept subpath is `@shavin/ui/lib/theme-presets` (compiled, with types). `@shavin/ui/styles/*` and the brand files now resolve to `dist/styles`. `OVERLAY_PRESET_STYLES` is exported from the root.
|
|
94
|
+
- `<Icon name>` loads its name tables with the first named icon instead of with the bundle. `motionConfig.loadGsap` lets you supply GSAP yourself (the default loader sits in its own module); with esbuild without code splitting, mark `gsap` external, set `motionConfig.gsap = false` or supply the loader.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Avinash Bussa and Shavin contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,82 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Shavin UI (`@shavin/ui`)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A React design system that AI coding agents can follow as reliably as people do: 94 accessible primitives on Radix, a strict two-tier token system, concentric-radius geometry, and machine-readable manifests (`tokens.json`, `components.json`) for the Shavin MCP server.
|
|
4
|
+
|
|
5
|
+
- **Docs:** https://docs.shavin.cc
|
|
6
|
+
- **Requires:** React 19, Tailwind CSS 3.4 or 4
|
|
7
|
+
|
|
8
|
+
## Quick start
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
npx @shavin/cli init
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
`init` installs the package, wires Tailwind (v3 preset or v4 CSS), imports the styles, wraps your root layout in `<ThemeProvider>`, and writes the `SHAVIN.md` project brain. Add `--oklch` for the OKLCH colour space.
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
import { Button, Card, Flex, Heading, Text } from "@shavin/ui";
|
|
20
|
+
|
|
21
|
+
export function Welcome() {
|
|
22
|
+
return (
|
|
23
|
+
<Card padding="md">
|
|
24
|
+
<Flex direction="column" gap="3">
|
|
25
|
+
<Heading size="md">Deploy previews</Heading>
|
|
26
|
+
<Text color="subtle">Every pull request gets its own URL.</Text>
|
|
27
|
+
<Button variant="solid">Enable previews</Button>
|
|
28
|
+
</Flex>
|
|
29
|
+
</Card>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Always import from the package root, never from deep paths. The package ships no source and has no `./primitives/*` entry; the only `lib` subpath is `@shavin/ui/lib/theme-presets`.
|
|
35
|
+
|
|
36
|
+
## Theme in client-only apps
|
|
37
|
+
|
|
38
|
+
`ThemeProvider` follows the OS light and dark setting out of the box. In a server-rendered app (Next) an inline script sets the appearance before first paint. In a client-only app (Vite, `createRoot`) that script never runs, so `ThemeProvider` resolves the appearance when it mounts, before the first paint of your React tree, and keeps following OS changes unless you stored an explicit choice. One limitation: if your `index.html` shows content before the bundle has run, that content can paint light for a frame on a dark OS; put an inline script in `index.html` that adds the `dark` class from `prefers-color-scheme` to avoid it.
|
|
39
|
+
|
|
40
|
+
## Module format and bundle size
|
|
41
|
+
|
|
42
|
+
- **ESM only.** `@shavin/ui` (and `/server`, `/panels`, `/icons`) is an ES module with one file per source module and `sideEffects` set, so webpack, Turbopack, Rollup/Vite and esbuild drop the components you do not import. A Button-only page costs about 30 kB gzip. Use a bundler or a runtime that loads ESM (Node 18.18+ `import`); `require("@shavin/ui")` is not supported. The Tailwind 3 preset is the one exception and also ships as CommonJS (`require("@shavin/ui/tailwind-preset")`).
|
|
43
|
+
- **Server Components.** Only the root, `/panels` and `/icons` entries carry `"use client"`. Helpers such as `cn` come from `@shavin/ui/server` in files without `"use client"`.
|
|
44
|
+
- **Icons** load on demand: an `<Icon name>` fetches only the icon it renders. `@shavin/ui/icons` is the opt-in full catalogue.
|
|
45
|
+
- **Scroll motion** (`scrub`, `pin`) uses GSAP, an optional peer that is imported only when a scroll animation runs. If your bundler inlines dynamic imports (esbuild without `splitting`), mark `gsap` external, set `motionConfig.gsap = false`, or supply it yourself:
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
import { motionConfig } from "@shavin/ui";
|
|
49
|
+
|
|
50
|
+
motionConfig.loadGsap = async () => ({
|
|
51
|
+
gsap: (await import("gsap")).gsap,
|
|
52
|
+
ScrollTrigger: (await import("gsap/ScrollTrigger")).ScrollTrigger,
|
|
53
|
+
});
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Rules the system enforces
|
|
57
|
+
|
|
58
|
+
- **Semantic tokens only** — `bg-surface`, `text-fg`, `text-fg-subtle`, `border-hairline`. No hex, `rgb()` or raw Tailwind colour scales in components.
|
|
59
|
+
- **Two radius roles** — controls use `--radius-lg`, containers use `--radius-panel`; nested surfaces follow R_inner = max(floor, R_outer − P) (`rounded-panel-p3`, `rounded-panel-p5`).
|
|
60
|
+
- **Floating surfaces** carry `data-panel`; icons use `<Icon>`, never emoji or glyphs.
|
|
61
|
+
|
|
62
|
+
Lint with `npx -p @shavin/skills shavin-lint-tokens` (from `@shavin/skills`) or the MCP server's `validate_code`.
|
|
63
|
+
|
|
64
|
+
## Package entry points
|
|
65
|
+
|
|
66
|
+
| Import | What it is |
|
|
67
|
+
|---|---|
|
|
68
|
+
| `@shavin/ui` | Components, `ThemeProvider`, helpers |
|
|
69
|
+
| `@shavin/ui/styles.css`, `@shavin/ui/global-oklch.css` | Token definitions + base styles (RGB / OKLCH) |
|
|
70
|
+
| `@shavin/ui/tokens.css`, `@shavin/ui/base.css` (+ `-oklch`) | The same, split for Tailwind v4: import `base.css` with `layer(base)` |
|
|
71
|
+
| `@shavin/ui/theme-v4.css`, `@shavin/ui/theme-v4-oklch.css` | Tailwind v4 `@theme` bridge |
|
|
72
|
+
| `@shavin/ui/tailwind-preset` | Tailwind v3 preset |
|
|
73
|
+
| `@shavin/ui/tokens.json`, `@shavin/ui/components.json` | Machine-readable token and component manifests |
|
|
74
|
+
|
|
75
|
+
## Related packages
|
|
76
|
+
|
|
77
|
+
[`@shavin/cli`](https://www.npmjs.com/package/@shavin/cli) · [`@shavin/mcp`](https://www.npmjs.com/package/@shavin/mcp) · [`@shavin/skills`](https://www.npmjs.com/package/@shavin/skills) · [`@shavin/block-schema`](https://www.npmjs.com/package/@shavin/block-schema)
|
|
78
|
+
|
|
79
|
+
## Licence
|
|
80
|
+
|
|
81
|
+
MIT © 2026 Avinash Bussa and Shavin contributors. See [LICENSE](./LICENSE).
|
|
82
|
+
"Shavin" and the Shavin product names are trademarks of Avinash Bussa.
|