@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,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../../lib/cn.js";
|
|
4
|
+
import { Icon } from "../Icon/index.js";
|
|
5
|
+
import { Rating } from "./Rating.js";
|
|
6
|
+
function RatingSummary({ counts, average, onSelect, selected, noun = "reviews", className, ...props }) {
|
|
7
|
+
const total = counts.reduce((n, c) => n + c, 0);
|
|
8
|
+
const avg = average ?? (total ? counts.reduce((n, c, i) => n + c * (i + 1), 0) / total : 0);
|
|
9
|
+
const top = Math.max(1, ...counts);
|
|
10
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-wrap items-center gap-x-10 gap-y-5", className), ...props, children: [
|
|
11
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
12
|
+
/* @__PURE__ */ jsx("span", { className: "text-5xl font-semibold tracking-tight tabular-nums text-fg", children: avg.toFixed(1) }),
|
|
13
|
+
/* @__PURE__ */ jsx(Rating, { readOnly: true, value: avg, max: counts.length, size: "md" }),
|
|
14
|
+
/* @__PURE__ */ jsxs("span", { className: "text-sm text-fg-muted tabular-nums", children: [
|
|
15
|
+
total.toLocaleString("en"),
|
|
16
|
+
" ",
|
|
17
|
+
noun
|
|
18
|
+
] })
|
|
19
|
+
] }),
|
|
20
|
+
/* @__PURE__ */ jsx("div", { className: "flex min-w-56 flex-1 flex-col gap-1.5", role: "list", "aria-label": "Rating breakdown", children: counts.map((_, k) => {
|
|
21
|
+
const stars = counts.length - k;
|
|
22
|
+
const c = counts[stars - 1];
|
|
23
|
+
const row = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
24
|
+
/* @__PURE__ */ jsxs("span", { className: "inline-flex w-8 shrink-0 items-center gap-0.5 text-sm tabular-nums text-fg-muted", children: [
|
|
25
|
+
stars,
|
|
26
|
+
/* @__PURE__ */ jsx(Icon, { name: "star", size: "xs", color: "inherit", className: "fill-current" })
|
|
27
|
+
] }),
|
|
28
|
+
/* @__PURE__ */ jsx("span", { className: "relative h-2 flex-1 overflow-hidden rounded-full bg-fg/10", children: /* @__PURE__ */ jsx("span", { className: "absolute inset-y-0 left-0 rounded-full bg-brand transition-[width] duration-500 ease-out", style: { width: `${c / top * 100}%` } }) }),
|
|
29
|
+
/* @__PURE__ */ jsx("span", { className: "w-10 shrink-0 text-right text-sm tabular-nums text-fg-muted", children: c.toLocaleString("en") })
|
|
30
|
+
] });
|
|
31
|
+
return onSelect ? (
|
|
32
|
+
// A role on the button would erase its button semantics; the listitem wraps it.
|
|
33
|
+
/* @__PURE__ */ jsx("div", { role: "listitem", children: /* @__PURE__ */ jsx(
|
|
34
|
+
"button",
|
|
35
|
+
{
|
|
36
|
+
type: "button",
|
|
37
|
+
"aria-pressed": selected === stars,
|
|
38
|
+
"aria-label": `${stars} stars, ${c} ${noun}`,
|
|
39
|
+
onClick: () => onSelect(stars),
|
|
40
|
+
className: cn("flex w-full items-center gap-3 rounded-[var(--radius-lg)] px-1.5 py-0.5 transition-colors hover:bg-surface-hover", selected === stars && "bg-surface-hover"),
|
|
41
|
+
children: row
|
|
42
|
+
}
|
|
43
|
+
) }, stars)
|
|
44
|
+
) : /* @__PURE__ */ jsx("div", { role: "listitem", className: "flex items-center gap-3 px-1.5 py-0.5", children: row }, stars);
|
|
45
|
+
}) })
|
|
46
|
+
] });
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
RatingSummary
|
|
50
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useRef, useState } from "react";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { cn } from "../../lib/cn.js";
|
|
6
|
+
import { Icon } from "../Icon/index.js";
|
|
7
|
+
const button = cva(
|
|
8
|
+
"inline-flex items-center justify-center rounded-full border transition-[background-color,border-color,color,transform] duration-150 active:scale-95",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
size: { sm: "size-8", md: "size-10", lg: "size-12" },
|
|
12
|
+
selected: {
|
|
13
|
+
true: "border-transparent bg-brand-solid text-brand-fg",
|
|
14
|
+
false: "border-hairline bg-surface text-fg-muted hover:bg-surface-hover hover:text-fg"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
defaultVariants: { size: "md", selected: false }
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
const FACES = [
|
|
21
|
+
{ value: 1, icon: "angry", label: "Very unhappy" },
|
|
22
|
+
{ value: 2, icon: "frown", label: "Unhappy" },
|
|
23
|
+
{ value: 3, icon: "meh", label: "Neutral" },
|
|
24
|
+
{ value: 4, icon: "smile", label: "Happy" },
|
|
25
|
+
{ value: 5, icon: "laugh", label: "Very happy" }
|
|
26
|
+
];
|
|
27
|
+
const THUMBS = [
|
|
28
|
+
{ value: 1, icon: "thumbs-up", label: "Helpful" },
|
|
29
|
+
{ value: -1, icon: "thumbs-down", label: "Not helpful" }
|
|
30
|
+
];
|
|
31
|
+
function SentimentRating({ variant = "thumbs", value, defaultValue = null, onValueChange, size = "md", disabled, label = "How was it?", className, ...props }) {
|
|
32
|
+
const [inner, setInner] = useState(defaultValue);
|
|
33
|
+
const refs = useRef([]);
|
|
34
|
+
const current = value !== void 0 ? value : inner;
|
|
35
|
+
const options = variant === "faces" ? FACES : THUMBS;
|
|
36
|
+
function pick(i) {
|
|
37
|
+
if (disabled) return;
|
|
38
|
+
const v = options[i].value;
|
|
39
|
+
if (value === void 0) setInner(v);
|
|
40
|
+
onValueChange?.(v);
|
|
41
|
+
refs.current[i]?.focus();
|
|
42
|
+
}
|
|
43
|
+
function onKeyDown(e) {
|
|
44
|
+
const at = Math.max(0, options.findIndex((o) => o.value === current));
|
|
45
|
+
if (e.key === "Home" || e.key === "End") {
|
|
46
|
+
e.preventDefault();
|
|
47
|
+
pick(e.key === "Home" ? 0 : options.length - 1);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const dir = e.key === "ArrowRight" || e.key === "ArrowDown" ? 1 : e.key === "ArrowLeft" || e.key === "ArrowUp" ? -1 : 0;
|
|
51
|
+
if (dir) {
|
|
52
|
+
e.preventDefault();
|
|
53
|
+
pick((at + dir + options.length) % options.length);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return /* @__PURE__ */ jsx("div", { role: "radiogroup", "aria-label": label, "aria-disabled": disabled || void 0, onKeyDown, className: cn("inline-flex items-center gap-2", disabled && "opacity-50", className), ...props, children: options.map((o, i) => {
|
|
57
|
+
const selected = current === o.value;
|
|
58
|
+
return /* @__PURE__ */ jsx(
|
|
59
|
+
"button",
|
|
60
|
+
{
|
|
61
|
+
ref: (el) => {
|
|
62
|
+
refs.current[i] = el;
|
|
63
|
+
},
|
|
64
|
+
type: "button",
|
|
65
|
+
role: "radio",
|
|
66
|
+
"aria-checked": selected,
|
|
67
|
+
"aria-label": o.label,
|
|
68
|
+
title: o.label,
|
|
69
|
+
disabled,
|
|
70
|
+
tabIndex: selected || current === null && i === 0 ? 0 : -1,
|
|
71
|
+
onClick: () => pick(i),
|
|
72
|
+
className: button({ size, selected }),
|
|
73
|
+
children: /* @__PURE__ */ jsx(Icon, { name: o.icon, size: size === "lg" ? "md" : "sm", color: "inherit" })
|
|
74
|
+
},
|
|
75
|
+
o.value
|
|
76
|
+
);
|
|
77
|
+
}) });
|
|
78
|
+
}
|
|
79
|
+
export {
|
|
80
|
+
SentimentRating
|
|
81
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const docs = {
|
|
2
|
+
name: "Reasoning",
|
|
3
|
+
description: "Collapsible disclosure for a model's reasoning: pulsing Thinking\u2026 while live, Thought for 4s when done.",
|
|
4
|
+
features: [
|
|
5
|
+
"status: thinking (open, pulsing mark) or done (collapsed summary)",
|
|
6
|
+
"duration and label props, controlled or uncontrolled open state",
|
|
7
|
+
"Times the thinking itself: Thinking\u2026 4s while live, Thought for 4s after, unless you pass duration",
|
|
8
|
+
"Folds away on thinking to done when uncontrolled (autoCollapse, default true), and announces that it finished",
|
|
9
|
+
"maxHeight scrolls a long chain of thought inside the block"
|
|
10
|
+
],
|
|
11
|
+
accessibility: [
|
|
12
|
+
"Trigger is a button with aria-expanded and aria-controls",
|
|
13
|
+
"Pulse uses a CSS animation that respects reduced motion"
|
|
14
|
+
],
|
|
15
|
+
keyboard: "Enter or Space toggles the disclosure.",
|
|
16
|
+
usage: {
|
|
17
|
+
bestPractices: [
|
|
18
|
+
{ guidance: true, description: "Place Reasoning first inside an assistant ChatBubble, before the answer." },
|
|
19
|
+
{ guidance: false, description: "Do not show raw chain-of-thought you would not want users to read; summarise it." }
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
examples: [
|
|
23
|
+
{ title: "Reasoning example", code: '<Reasoning status="done" duration="4s">I compared the refund clause with the order date.</Reasoning>' }
|
|
24
|
+
]
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
docs
|
|
28
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useId, useRef, useState } from "react";
|
|
4
|
+
import { cn } from "../../lib/cn.js";
|
|
5
|
+
import { hitAreaClass } from "../../lib/hit-area.js";
|
|
6
|
+
import { ChevronRight } from "lucide-react";
|
|
7
|
+
import { Murmur } from "../Murmur/Murmur.js";
|
|
8
|
+
import { announce } from "../../lib/announce.js";
|
|
9
|
+
function Reasoning({
|
|
10
|
+
children,
|
|
11
|
+
status = "done",
|
|
12
|
+
duration,
|
|
13
|
+
maxHeight,
|
|
14
|
+
autoCollapse = true,
|
|
15
|
+
label,
|
|
16
|
+
defaultOpen,
|
|
17
|
+
open: openProp,
|
|
18
|
+
onOpenChange,
|
|
19
|
+
hitArea,
|
|
20
|
+
className,
|
|
21
|
+
...props
|
|
22
|
+
}) {
|
|
23
|
+
const id = useId();
|
|
24
|
+
const [inner, setInner] = useState(defaultOpen ?? status === "thinking");
|
|
25
|
+
const open = openProp ?? inner;
|
|
26
|
+
const thinking = status === "thinking";
|
|
27
|
+
const [seconds, setSeconds] = useState(0);
|
|
28
|
+
const sawThinking = useRef(thinking);
|
|
29
|
+
const prevThinking = useRef(thinking);
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (!thinking) return;
|
|
32
|
+
setSeconds(0);
|
|
33
|
+
const t0 = Date.now();
|
|
34
|
+
const timer = setInterval(() => setSeconds(Math.floor((Date.now() - t0) / 1e3)), 1e3);
|
|
35
|
+
return () => clearInterval(timer);
|
|
36
|
+
}, [thinking]);
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (prevThinking.current && !thinking) {
|
|
39
|
+
if (openProp === void 0 && autoCollapse) setInner(false);
|
|
40
|
+
announce("Finished thinking", "polite");
|
|
41
|
+
}
|
|
42
|
+
if (thinking) sawThinking.current = true;
|
|
43
|
+
prevThinking.current = thinking;
|
|
44
|
+
}, [thinking, openProp, autoCollapse]);
|
|
45
|
+
const timed = sawThinking.current && seconds > 0 ? `${seconds}s` : void 0;
|
|
46
|
+
const text = label ?? (thinking ? timed ? `Thinking\u2026 ${timed}` : "Thinking\u2026" : duration ?? timed ? `Thought for ${duration ?? timed}` : "Thought process");
|
|
47
|
+
const toggle = () => {
|
|
48
|
+
const next = !open;
|
|
49
|
+
setInner(next);
|
|
50
|
+
onOpenChange?.(next);
|
|
51
|
+
};
|
|
52
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-2", className), ...props, children: [
|
|
53
|
+
/* @__PURE__ */ jsxs(
|
|
54
|
+
"button",
|
|
55
|
+
{
|
|
56
|
+
type: "button",
|
|
57
|
+
onClick: toggle,
|
|
58
|
+
"aria-expanded": open,
|
|
59
|
+
"aria-controls": id,
|
|
60
|
+
className: cn("hit-area group inline-flex w-fit items-center gap-1.5 rounded-[var(--radius-lg)] px-1 py-0.5 text-xs font-medium text-fg-muted transition-colors hover:text-fg", hitAreaClass(hitArea, "floor", "Reasoning")),
|
|
61
|
+
children: [
|
|
62
|
+
thinking && /* @__PURE__ */ jsx(Murmur, { state: "thinking", size: 22, label: "" }),
|
|
63
|
+
/* @__PURE__ */ jsx("span", { children: text }),
|
|
64
|
+
/* @__PURE__ */ jsx(ChevronRight, { className: cn("h-3.5 w-3.5 transition-transform", open && "rotate-90"), "aria-hidden": true })
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
open && children != null && /* @__PURE__ */ jsx("div", { id, className: cn("border-l border-hairline pl-3 text-sm leading-relaxed text-fg-subtle", maxHeight !== void 0 && "overflow-y-auto"), style: maxHeight !== void 0 ? { maxHeight } : void 0, children })
|
|
69
|
+
] });
|
|
70
|
+
}
|
|
71
|
+
export {
|
|
72
|
+
Reasoning
|
|
73
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
const docs = {
|
|
2
|
+
name: "ResizeHandle",
|
|
3
|
+
group: "layout",
|
|
4
|
+
description: "Resize handle and the headless useResizable engine behind the resizable prop on Box, Flex, Card and Sidebar. The element owns its own size; for panes that trade space with neighbours use PanelGroup from @shavin/ui/panels.",
|
|
5
|
+
features: [
|
|
6
|
+
'resizable prop on Box, Flex and Card: one edge ("right"), an axis ("x", "y"), "both", true, or a list of edges and corners',
|
|
7
|
+
"minWidth / maxWidth / minHeight / maxHeight bounds, snap grid, lockAspectRatio",
|
|
8
|
+
"persistKey remembers the size in localStorage; double-click or Enter resets it",
|
|
9
|
+
"Handle looks: line (line on hover), grip (always-visible pill), invisible",
|
|
10
|
+
"resizeColor: brand-subtle (default, softer brand), brand or neutral (monochrome)",
|
|
11
|
+
"While dragging, the grip slides along the edge with the pointer (clear of rounded corners) and re-centres on release",
|
|
12
|
+
"Radius-aware: edge lines stop where rounded corners begin; corner handles sit on the curve",
|
|
13
|
+
"Works inside scaled canvases; an overlay stops iframes swallowing the drag",
|
|
14
|
+
"useResizable hook for custom handles; ResizeHandle / ResizeHandles for the Shavin look"
|
|
15
|
+
],
|
|
16
|
+
accessibility: [
|
|
17
|
+
'Each handle is a focusable role="separator" with aria-orientation, aria-valuenow, aria-valuemin and aria-valuemax',
|
|
18
|
+
"Arrow keys move the focused edge by resizeStep (Shift = 4x); Home / End jump to the bounds; Enter resets",
|
|
19
|
+
"Touch screens get a 24px hit area"
|
|
20
|
+
],
|
|
21
|
+
usage: {
|
|
22
|
+
bestPractices: [
|
|
23
|
+
{ guidance: true, description: "Use the resizable prop when one element resizes against flexible space (a sidebar next to a flex-1 main area, an inspector, a chat input)." },
|
|
24
|
+
{ guidance: true, description: "Always set minWidth/maxWidth (or minHeight/maxHeight) so the element cannot be dragged to nothing or past its layout." },
|
|
25
|
+
{ guidance: true, description: "Use PanelGroup from @shavin/ui/panels when two or more panes must share a fixed space." },
|
|
26
|
+
{ guidance: false, description: "Do not put resizable on a flex-1 item: flex-grow overrides the dragged width." },
|
|
27
|
+
{ guidance: false, description: "Do not resize from left or top on an absolutely positioned element without moving it in onResize; it grows backwards." }
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
examples: [
|
|
31
|
+
{
|
|
32
|
+
title: "Resizable inspector",
|
|
33
|
+
description: "Right-aligned panel resized from its left edge, remembered between visits",
|
|
34
|
+
code: '<Flex className="h-80"><Box className="flex-1">Canvas</Box><Box resizable="left" minWidth={240} maxWidth={480} persistKey="inspector" className="w-72 border-l border-hairline bg-surface p-4">Inspector</Box></Flex>'
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
title: "Resizable card",
|
|
38
|
+
description: "Corner and edges, with an always-visible grip",
|
|
39
|
+
code: '<Card resizable="both" resizeHandle="grip" minWidth={200} minHeight={120} padding="md" className="w-72 h-40"><Flex direction="column" gap="3"><Text weight="medium">Notes</Text><Text color="subtle">Drag the corner.</Text></Flex></Card>'
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
title: "Headless hook",
|
|
43
|
+
description: "Custom element with Shavin handles",
|
|
44
|
+
code: 'const r = useResizable({ edges: "x", minWidth: 200 });\n<div ref={r.ref} style={r.style} className="relative"><ResizeHandles state={r} /></div>'
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
};
|
|
48
|
+
export {
|
|
49
|
+
docs
|
|
50
|
+
};
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { cn } from "../../lib/cn.js";
|
|
4
|
+
import {
|
|
5
|
+
useMergedRef,
|
|
6
|
+
useResizable
|
|
7
|
+
} from "../../lib/useResizable.js";
|
|
8
|
+
const resizeHandleVariants = cva(
|
|
9
|
+
"absolute z-20 touch-none select-none outline-none after:pointer-events-none after:absolute after:bg-transparent after:transition-colors after:duration-150 before:pointer-events-none before:absolute before:rounded-full before:transition-[background-color,top,left] before:duration-150 data-[resizing]:before:transition-[background-color]",
|
|
10
|
+
{
|
|
11
|
+
variants: {
|
|
12
|
+
edge: {
|
|
13
|
+
right: "inset-y-0 -right-3 w-6 cursor-ew-resize after:top-[var(--resize-inset-start,0px)] after:bottom-[var(--resize-inset-end,0px)] after:left-1/2 after:w-px after:-translate-x-1/2 focus-visible:after:w-0.5 data-[resizing]:after:w-0.5",
|
|
14
|
+
left: "inset-y-0 -left-3 w-6 cursor-ew-resize after:top-[var(--resize-inset-start,0px)] after:bottom-[var(--resize-inset-end,0px)] after:left-1/2 after:w-px after:-translate-x-1/2 focus-visible:after:w-0.5 data-[resizing]:after:w-0.5",
|
|
15
|
+
bottom: "inset-x-0 -bottom-3 h-6 cursor-ns-resize after:left-[var(--resize-inset-start,0px)] after:right-[var(--resize-inset-end,0px)] after:top-1/2 after:h-px after:-translate-y-1/2 focus-visible:after:h-0.5 data-[resizing]:after:h-0.5",
|
|
16
|
+
top: "inset-x-0 -top-3 h-6 cursor-ns-resize after:left-[var(--resize-inset-start,0px)] after:right-[var(--resize-inset-end,0px)] after:top-1/2 after:h-px after:-translate-y-1/2 focus-visible:after:h-0.5 data-[resizing]:after:h-0.5",
|
|
17
|
+
"top-left": "z-[21] -left-3 -top-3 h-6 w-6 cursor-nwse-resize",
|
|
18
|
+
"top-right": "z-[21] -right-3 -top-3 h-6 w-6 cursor-nesw-resize",
|
|
19
|
+
"bottom-left": "z-[21] -bottom-3 -left-3 h-6 w-6 cursor-nesw-resize",
|
|
20
|
+
"bottom-right": "z-[21] -bottom-3 -right-3 h-6 w-6 cursor-nwse-resize"
|
|
21
|
+
},
|
|
22
|
+
variant: {
|
|
23
|
+
line: "",
|
|
24
|
+
grip: "before:-translate-x-1/2 before:-translate-y-1/2 before:bg-hairline-strong",
|
|
25
|
+
invisible: "after:hidden before:hidden focus-visible:after:block"
|
|
26
|
+
},
|
|
27
|
+
// Hover, focus and drag colours of the line and the grip.
|
|
28
|
+
color: {
|
|
29
|
+
brand: "hover:after:bg-brand focus-visible:after:bg-brand-text data-[resizing]:after:bg-brand hover:before:bg-brand focus-visible:before:bg-brand-text data-[resizing]:before:bg-brand",
|
|
30
|
+
"brand-subtle": "hover:after:bg-brand/40 focus-visible:after:bg-brand-text data-[resizing]:after:bg-brand/60 hover:before:bg-brand/40 focus-visible:before:bg-brand-text data-[resizing]:before:bg-brand/60",
|
|
31
|
+
neutral: "hover:after:bg-fg-subtle focus-visible:after:bg-fg-muted data-[resizing]:after:bg-fg-muted hover:before:bg-fg-subtle focus-visible:before:bg-fg-muted data-[resizing]:before:bg-fg-muted"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
compoundVariants: [
|
|
35
|
+
// Corners draw a dot instead of a line.
|
|
36
|
+
{
|
|
37
|
+
edge: ["top-left", "top-right", "bottom-left", "bottom-right"],
|
|
38
|
+
className: "after:left-1/2 after:top-1/2 after:h-1.5 after:w-1.5 after:-translate-x-1/2 after:-translate-y-1/2 after:rounded-full"
|
|
39
|
+
},
|
|
40
|
+
// While dragging, the grip follows the pointer along the edge (--resize-thumb, set by
|
|
41
|
+
// trackResizeThumb), clamped so its 24px pill never enters a rounded corner. Centred at rest.
|
|
42
|
+
{
|
|
43
|
+
edge: ["left", "right"],
|
|
44
|
+
variant: "grip",
|
|
45
|
+
className: "before:h-6 before:w-1 before:left-1/2 before:top-[clamp(calc(var(--resize-inset-start,0px)_+_12px),var(--resize-thumb,50%),calc(100%_-_var(--resize-inset-end,0px)_-_12px))]"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
edge: ["top", "bottom"],
|
|
49
|
+
variant: "grip",
|
|
50
|
+
className: "before:h-1 before:w-6 before:top-1/2 before:left-[clamp(calc(var(--resize-inset-start,0px)_+_12px),var(--resize-thumb,50%),calc(100%_-_var(--resize-inset-end,0px)_-_12px))]"
|
|
51
|
+
},
|
|
52
|
+
{ edge: ["top-left", "top-right", "bottom-left", "bottom-right"], variant: "grip", className: "before:h-1.5 before:w-1.5 before:left-1/2 before:top-1/2" }
|
|
53
|
+
],
|
|
54
|
+
defaultVariants: { variant: "line", color: "brand-subtle" }
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
function ResizeHandle({ edge, variant, color, className, ...props }) {
|
|
58
|
+
return /* @__PURE__ */ jsx("div", { className: cn(resizeHandleVariants({ edge, variant, color }), className), ...props });
|
|
59
|
+
}
|
|
60
|
+
const ON_CURVE = 1 - Math.SQRT1_2;
|
|
61
|
+
function handleGeometry(edge, radii) {
|
|
62
|
+
if (!radii) return void 0;
|
|
63
|
+
const px = (n) => `${n}px`;
|
|
64
|
+
switch (edge) {
|
|
65
|
+
case "right":
|
|
66
|
+
return { "--resize-inset-start": px(radii.topRight), "--resize-inset-end": px(radii.bottomRight) };
|
|
67
|
+
case "left":
|
|
68
|
+
return { "--resize-inset-start": px(radii.topLeft), "--resize-inset-end": px(radii.bottomLeft) };
|
|
69
|
+
case "top":
|
|
70
|
+
return { "--resize-inset-start": px(radii.topLeft), "--resize-inset-end": px(radii.topRight) };
|
|
71
|
+
case "bottom":
|
|
72
|
+
return { "--resize-inset-start": px(radii.bottomLeft), "--resize-inset-end": px(radii.bottomRight) };
|
|
73
|
+
default: {
|
|
74
|
+
const r = { "top-left": radii.topLeft, "top-right": radii.topRight, "bottom-left": radii.bottomLeft, "bottom-right": radii.bottomRight }[edge];
|
|
75
|
+
if (!r) return void 0;
|
|
76
|
+
const k = Math.round(r * ON_CURVE * 10) / 10;
|
|
77
|
+
const dx = edge.endsWith("right") ? -k : k;
|
|
78
|
+
const dy = edge.startsWith("bottom") ? -k : k;
|
|
79
|
+
return { translate: `${dx}px ${dy}px` };
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
function ResizeHandles({
|
|
84
|
+
state,
|
|
85
|
+
variant,
|
|
86
|
+
color,
|
|
87
|
+
sizeHint = true
|
|
88
|
+
}) {
|
|
89
|
+
if (!state.enabled) return null;
|
|
90
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
91
|
+
state.edges.map((edge) => /* @__PURE__ */ jsx(
|
|
92
|
+
ResizeHandle,
|
|
93
|
+
{
|
|
94
|
+
edge,
|
|
95
|
+
variant,
|
|
96
|
+
color,
|
|
97
|
+
style: handleGeometry(edge, state.radii),
|
|
98
|
+
...state.getHandleProps(edge)
|
|
99
|
+
},
|
|
100
|
+
edge
|
|
101
|
+
)),
|
|
102
|
+
sizeHint && state.isResizing && state.measured && /* @__PURE__ */ jsxs(
|
|
103
|
+
"span",
|
|
104
|
+
{
|
|
105
|
+
"data-panel": true,
|
|
106
|
+
"aria-hidden": "true",
|
|
107
|
+
className: "pointer-events-none absolute bottom-2 right-2 z-30 rounded-[var(--radius-lg)] border border-hairline bg-elevated px-1.5 py-0.5 text-xs tabular-nums text-fg shadow-panel",
|
|
108
|
+
children: [
|
|
109
|
+
state.measured.width,
|
|
110
|
+
" \xD7 ",
|
|
111
|
+
state.measured.height
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
] });
|
|
116
|
+
}
|
|
117
|
+
function splitResizableProps(props) {
|
|
118
|
+
const {
|
|
119
|
+
resizable,
|
|
120
|
+
minWidth,
|
|
121
|
+
maxWidth,
|
|
122
|
+
minHeight,
|
|
123
|
+
maxHeight,
|
|
124
|
+
resizeStep,
|
|
125
|
+
snap,
|
|
126
|
+
lockAspectRatio,
|
|
127
|
+
persistKey,
|
|
128
|
+
onResize,
|
|
129
|
+
onResizeEnd,
|
|
130
|
+
resizeHandle,
|
|
131
|
+
resizeColor,
|
|
132
|
+
...rest
|
|
133
|
+
} = props;
|
|
134
|
+
return {
|
|
135
|
+
options: {
|
|
136
|
+
edges: resizable,
|
|
137
|
+
minWidth,
|
|
138
|
+
maxWidth,
|
|
139
|
+
minHeight,
|
|
140
|
+
maxHeight,
|
|
141
|
+
step: resizeStep,
|
|
142
|
+
snap,
|
|
143
|
+
lockAspectRatio,
|
|
144
|
+
persistKey,
|
|
145
|
+
onResize,
|
|
146
|
+
onResizeEnd
|
|
147
|
+
},
|
|
148
|
+
handleVariant: resizeHandle,
|
|
149
|
+
handleColor: resizeColor,
|
|
150
|
+
rest
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
function withResizable(Inner, displayName) {
|
|
154
|
+
function ResizableHostImpl(props) {
|
|
155
|
+
const { options, handleVariant, handleColor, rest } = splitResizableProps(props);
|
|
156
|
+
const state = useResizable(options);
|
|
157
|
+
const host = rest;
|
|
158
|
+
const ref = useMergedRef(host.ref, state.ref);
|
|
159
|
+
return /* @__PURE__ */ jsxs(
|
|
160
|
+
Inner,
|
|
161
|
+
{
|
|
162
|
+
...{ ...host, ref },
|
|
163
|
+
style: { ...host.style, ...state.style },
|
|
164
|
+
className: cn("relative", state.isResizing && "select-none", host.className),
|
|
165
|
+
children: [
|
|
166
|
+
host.children,
|
|
167
|
+
/* @__PURE__ */ jsx(ResizeHandles, { state, variant: handleVariant, color: handleColor })
|
|
168
|
+
]
|
|
169
|
+
}
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
function Component(props) {
|
|
173
|
+
if (props.resizable) return /* @__PURE__ */ jsx(ResizableHostImpl, { ...props });
|
|
174
|
+
return /* @__PURE__ */ jsx(Inner, { ...splitResizableProps(props).rest });
|
|
175
|
+
}
|
|
176
|
+
Component.displayName = displayName;
|
|
177
|
+
return Component;
|
|
178
|
+
}
|
|
179
|
+
export {
|
|
180
|
+
ResizeHandle,
|
|
181
|
+
ResizeHandles,
|
|
182
|
+
resizeHandleVariants,
|
|
183
|
+
splitResizableProps,
|
|
184
|
+
withResizable
|
|
185
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const docs = {
|
|
2
|
+
name: "Row",
|
|
3
|
+
description: "A clickable line in a list or menu, with an icon or control at the start, a label, and actions at the end. It has an active state, and a drag handle is available for reorderable lists.",
|
|
4
|
+
features: [
|
|
5
|
+
"Polymorphic tag: as='button' (default for click row) or as='div' (when row contains nested sub-buttons)",
|
|
6
|
+
"Slots: leading (icon, avatar, check) and trailing (badge, chevron, action button)",
|
|
7
|
+
"Includes RowDragHandle icon component for sortable lists",
|
|
8
|
+
"Uses control radius --radius-lg for row item pill hover states"
|
|
9
|
+
],
|
|
10
|
+
accessibility: [
|
|
11
|
+
"Supports button and div element rendering avoiding illegal nested button HTML",
|
|
12
|
+
"Renders group class enabling CSS hover-reveal action buttons (group-hover:opacity-100)"
|
|
13
|
+
],
|
|
14
|
+
keyboard: "Tab to row button, Space/Enter to activate",
|
|
15
|
+
usage: {
|
|
16
|
+
bestPractices: [
|
|
17
|
+
{
|
|
18
|
+
guidance: true,
|
|
19
|
+
description: "Use Row for sidebar navigation items, list rows, setting items, and sortable cards."
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
guidance: false,
|
|
23
|
+
description: "Do not render interactive nested <button> elements inside a Row with as='button' \u2014 pass as='div' instead."
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
examples: [
|
|
28
|
+
{
|
|
29
|
+
title: "Navigation Row with Trailing Badge",
|
|
30
|
+
code: "<Row leading={<Folder />} trailing={<Badge>12</Badge>} active>Projects</Row>"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
docs
|
|
36
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { cn } from "../../lib/cn.js";
|
|
4
|
+
const rowVariants = cva(
|
|
5
|
+
"group flex w-full items-center gap-2.5 rounded-[var(--radius-lg)] px-2.5 py-2 text-left text-sm transition",
|
|
6
|
+
{
|
|
7
|
+
variants: {
|
|
8
|
+
active: {
|
|
9
|
+
true: "bg-fg/[0.07] font-medium text-fg",
|
|
10
|
+
false: "text-fg-muted hover:bg-fg/[0.05] hover:text-fg"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
defaultVariants: { active: false }
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
function Row({
|
|
17
|
+
as: Tag = "button",
|
|
18
|
+
active,
|
|
19
|
+
leading,
|
|
20
|
+
trailing,
|
|
21
|
+
children,
|
|
22
|
+
className,
|
|
23
|
+
...props
|
|
24
|
+
}) {
|
|
25
|
+
return /* @__PURE__ */ jsxs(
|
|
26
|
+
Tag,
|
|
27
|
+
{
|
|
28
|
+
type: Tag === "button" ? "button" : void 0,
|
|
29
|
+
className: cn(rowVariants({ active }), className),
|
|
30
|
+
...props,
|
|
31
|
+
children: [
|
|
32
|
+
leading && /* @__PURE__ */ jsx("span", { className: "flex shrink-0 items-center", children: leading }),
|
|
33
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children }),
|
|
34
|
+
trailing && /* @__PURE__ */ jsx("span", { className: "flex shrink-0 items-center", children: trailing })
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
function RowDragHandle({ className }) {
|
|
40
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", className: cn("h-4 w-4 cursor-grab text-fg-subtle active:cursor-grabbing", className), fill: "currentColor", children: [
|
|
41
|
+
/* @__PURE__ */ jsx("circle", { cx: "9", cy: "6", r: "1.4" }),
|
|
42
|
+
/* @__PURE__ */ jsx("circle", { cx: "15", cy: "6", r: "1.4" }),
|
|
43
|
+
/* @__PURE__ */ jsx("circle", { cx: "9", cy: "12", r: "1.4" }),
|
|
44
|
+
/* @__PURE__ */ jsx("circle", { cx: "15", cy: "12", r: "1.4" }),
|
|
45
|
+
/* @__PURE__ */ jsx("circle", { cx: "9", cy: "18", r: "1.4" }),
|
|
46
|
+
/* @__PURE__ */ jsx("circle", { cx: "15", cy: "18", r: "1.4" })
|
|
47
|
+
] });
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
Row,
|
|
51
|
+
RowDragHandle,
|
|
52
|
+
rowVariants
|
|
53
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const docs = {
|
|
2
|
+
name: "ScrollArea",
|
|
3
|
+
description: "A scrolling region with slim, styled scrollbars in place of the browser's own. It scrolls both ways and can be scrolled with the keyboard.",
|
|
4
|
+
features: [
|
|
5
|
+
"Built on @radix-ui/react-scroll-area",
|
|
6
|
+
"Custom rounded scrollbar thumbs styled with bg-hairline-strong",
|
|
7
|
+
"Cross-browser consistent scrollbars across macOS, Windows, and Linux",
|
|
8
|
+
"Supports vertical and horizontal scrollbars"
|
|
9
|
+
],
|
|
10
|
+
accessibility: [
|
|
11
|
+
"Native scroll accessibility interactions and keyboard arrow navigation"
|
|
12
|
+
],
|
|
13
|
+
keyboard: "Up/Down and PageUp/PageDown keys scroll viewport content when focused",
|
|
14
|
+
usage: {
|
|
15
|
+
bestPractices: [
|
|
16
|
+
{
|
|
17
|
+
guidance: true,
|
|
18
|
+
description: "Use ScrollArea inside fixed-height dialogs, dropdowns, and sidebars."
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
guidance: false,
|
|
22
|
+
description: "Do not forget to set an explicit height (e.g. h-64 or max-h-80) on ScrollArea container."
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
examples: [
|
|
27
|
+
{
|
|
28
|
+
title: "Fixed Height Scrollable List",
|
|
29
|
+
code: '<ScrollArea className="h-48 border border-hairline p-3"><div className="space-y-4"><div>Item 1</div><div>Item 2</div><div>Item 3</div><div>Item 4</div></div></ScrollArea>'
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
docs
|
|
35
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
4
|
+
import { cn } from "../../lib/cn.js";
|
|
5
|
+
function ScrollArea({
|
|
6
|
+
children,
|
|
7
|
+
className,
|
|
8
|
+
style,
|
|
9
|
+
"aria-label": ariaLabel
|
|
10
|
+
}) {
|
|
11
|
+
return /* @__PURE__ */ jsxs(
|
|
12
|
+
ScrollAreaPrimitive.Root,
|
|
13
|
+
{
|
|
14
|
+
className: cn("overflow-hidden", className),
|
|
15
|
+
style,
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ jsx(
|
|
18
|
+
ScrollAreaPrimitive.Viewport,
|
|
19
|
+
{
|
|
20
|
+
tabIndex: 0,
|
|
21
|
+
role: ariaLabel ? "region" : void 0,
|
|
22
|
+
"aria-label": ariaLabel,
|
|
23
|
+
className: "h-full w-full rounded-[inherit]",
|
|
24
|
+
children
|
|
25
|
+
}
|
|
26
|
+
),
|
|
27
|
+
/* @__PURE__ */ jsx(
|
|
28
|
+
ScrollAreaPrimitive.Scrollbar,
|
|
29
|
+
{
|
|
30
|
+
orientation: "vertical",
|
|
31
|
+
className: "flex w-2.5 touch-none select-none p-0.5",
|
|
32
|
+
children: /* @__PURE__ */ jsx(ScrollAreaPrimitive.Thumb, { className: "flex-1 rounded-full bg-hairline-strong" })
|
|
33
|
+
}
|
|
34
|
+
),
|
|
35
|
+
/* @__PURE__ */ jsx(
|
|
36
|
+
ScrollAreaPrimitive.Scrollbar,
|
|
37
|
+
{
|
|
38
|
+
orientation: "horizontal",
|
|
39
|
+
className: "flex h-2.5 flex-col touch-none select-none p-0.5",
|
|
40
|
+
children: /* @__PURE__ */ jsx(ScrollAreaPrimitive.Thumb, { className: "flex-1 rounded-full bg-hairline-strong" })
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ jsx(ScrollAreaPrimitive.Corner, {})
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
ScrollArea
|
|
50
|
+
};
|