@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,159 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext } from "react";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { cn } from "../../lib/cn.js";
|
|
5
|
+
import { cardPaddingToScale, concentricContainerStyle, concentricRadius, withConcentricStyle } from "../../lib/concentric.js";
|
|
6
|
+
import { Text } from "../Text/index.js";
|
|
7
|
+
import { bgMediaLayer, resolveBgReadability } from "../../lib/media-overlays.js";
|
|
8
|
+
import { surfaceClass } from "../../lib/surface.js";
|
|
9
|
+
import { withResizable } from "../Resizable/index.js";
|
|
10
|
+
const cardVariants = cva("rounded-[var(--radius-panel)] border border-hairline bg-surface text-fg transition-all duration-200 ease-out", {
|
|
11
|
+
variants: {
|
|
12
|
+
padding: {
|
|
13
|
+
none: "",
|
|
14
|
+
xs: "p-2",
|
|
15
|
+
sm: "p-4",
|
|
16
|
+
md: "p-5",
|
|
17
|
+
lg: "p-6",
|
|
18
|
+
xl: "p-8",
|
|
19
|
+
"2xl": "p-10",
|
|
20
|
+
"3xl": "p-12"
|
|
21
|
+
},
|
|
22
|
+
interactive: {
|
|
23
|
+
true: "hover:border-hairline-strong hover:shadow-panel cursor-pointer motion-safe:active:translate-y-px",
|
|
24
|
+
false: ""
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: { padding: "none", interactive: false }
|
|
28
|
+
});
|
|
29
|
+
const CARD_PADDING = {
|
|
30
|
+
none: "",
|
|
31
|
+
xs: "p-2",
|
|
32
|
+
sm: "p-4",
|
|
33
|
+
md: "p-5",
|
|
34
|
+
lg: "p-6",
|
|
35
|
+
xl: "p-8",
|
|
36
|
+
"2xl": "p-10",
|
|
37
|
+
"3xl": "p-12"
|
|
38
|
+
};
|
|
39
|
+
const CardRadiusContext = createContext(null);
|
|
40
|
+
function CardBase({
|
|
41
|
+
className,
|
|
42
|
+
padding,
|
|
43
|
+
interactive,
|
|
44
|
+
style,
|
|
45
|
+
bgVideo,
|
|
46
|
+
bgImage,
|
|
47
|
+
bgSize,
|
|
48
|
+
bgOverlays,
|
|
49
|
+
bgVideoPaused,
|
|
50
|
+
bgPoster,
|
|
51
|
+
/** Surface contrast scope intent. "dark"/"light" auto-invert against the page
|
|
52
|
+
theme (contrast band). "dark-always"/"light-always" lock to one theme
|
|
53
|
+
regardless of page (for media backgrounds). Undefined inherits page theme. */
|
|
54
|
+
surface,
|
|
55
|
+
children,
|
|
56
|
+
...props
|
|
57
|
+
}) {
|
|
58
|
+
const parentInner = useContext(CardRadiusContext);
|
|
59
|
+
const outer = parentInner ?? "var(--radius-panel)";
|
|
60
|
+
const inner = concentricRadius(cardPaddingToScale(padding || "none"), { outer, border: true }) ?? outer;
|
|
61
|
+
const concentricStyle = {
|
|
62
|
+
...concentricContainerStyle(padding || "none", true, { outer, border: true }),
|
|
63
|
+
...parentInner ? { borderRadius: parentInner } : {}
|
|
64
|
+
};
|
|
65
|
+
const paddingClass = CARD_PADDING[padding || "none"] || "";
|
|
66
|
+
const bg = resolveBgReadability({ surface, bgVideo, bgImage, bgOverlays });
|
|
67
|
+
const { hasMedia, media, content } = bgMediaLayer({ bgVideo, bgImage, bgSize, bgOverlays: bg.bgOverlays, bgVideoPaused, bgPoster }, paddingClass);
|
|
68
|
+
return /* @__PURE__ */ jsxs(
|
|
69
|
+
"div",
|
|
70
|
+
{
|
|
71
|
+
"data-surface": bg.surface || void 0,
|
|
72
|
+
className: cn(hasMedia ? "relative overflow-hidden" : "", cardVariants({ padding: hasMedia ? "none" : padding, interactive }), surfaceClass(bg.surface), className),
|
|
73
|
+
style: withConcentricStyle(concentricStyle, style ?? {}),
|
|
74
|
+
...props,
|
|
75
|
+
children: [
|
|
76
|
+
media,
|
|
77
|
+
/* @__PURE__ */ jsx(CardRadiusContext.Provider, { value: inner, children: content(children) })
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
const Card = withResizable(CardBase, "Card");
|
|
83
|
+
function CardList({
|
|
84
|
+
as: Tag = "div",
|
|
85
|
+
className,
|
|
86
|
+
style,
|
|
87
|
+
...props
|
|
88
|
+
}) {
|
|
89
|
+
return /* @__PURE__ */ jsx(
|
|
90
|
+
Tag,
|
|
91
|
+
{
|
|
92
|
+
className: cn("divide-y divide-hairline rounded-[var(--radius-panel)] border border-hairline bg-surface overflow-hidden", className),
|
|
93
|
+
style,
|
|
94
|
+
...props
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
function CardListItem({
|
|
99
|
+
as: Tag = "div",
|
|
100
|
+
className,
|
|
101
|
+
...props
|
|
102
|
+
}) {
|
|
103
|
+
return /* @__PURE__ */ jsx(
|
|
104
|
+
Tag,
|
|
105
|
+
{
|
|
106
|
+
className: cn("flex items-center gap-3 px-4 py-3 hover:bg-surface-hover", className),
|
|
107
|
+
...props
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
function CardRow({
|
|
112
|
+
label,
|
|
113
|
+
children
|
|
114
|
+
}) {
|
|
115
|
+
return /* @__PURE__ */ jsxs("div", { className: "p-4", children: [
|
|
116
|
+
/* @__PURE__ */ jsx(Text, { weight: "semibold", children: label }),
|
|
117
|
+
/* @__PURE__ */ jsx("div", { className: "mt-1.5 flex items-center justify-between gap-4", children })
|
|
118
|
+
] });
|
|
119
|
+
}
|
|
120
|
+
const statCardVariants = cva("rounded-[var(--radius-panel)] border border-hairline bg-surface", {
|
|
121
|
+
variants: {
|
|
122
|
+
padding: {
|
|
123
|
+
sm: "p-4",
|
|
124
|
+
md: "p-5"
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
defaultVariants: { padding: "sm" }
|
|
128
|
+
});
|
|
129
|
+
function StatCard({
|
|
130
|
+
label,
|
|
131
|
+
value,
|
|
132
|
+
sub,
|
|
133
|
+
trend,
|
|
134
|
+
alert,
|
|
135
|
+
padding = "sm",
|
|
136
|
+
style,
|
|
137
|
+
className,
|
|
138
|
+
...props
|
|
139
|
+
}) {
|
|
140
|
+
const concentricStyle = concentricContainerStyle(padding, true);
|
|
141
|
+
return /* @__PURE__ */ jsxs("div", { className: cn(statCardVariants({ padding }), className), style: withConcentricStyle(style, concentricStyle), ...props, children: [
|
|
142
|
+
/* @__PURE__ */ jsxs(Text, { size: "xs", color: "muted", className: cn(alert && "inline-flex items-center gap-1.5"), children: [
|
|
143
|
+
alert && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
144
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "size-1.5 shrink-0 rounded-full bg-warning" }),
|
|
145
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Needs attention: " })
|
|
146
|
+
] }),
|
|
147
|
+
label
|
|
148
|
+
] }),
|
|
149
|
+
/* @__PURE__ */ jsx(Text, { size: "lg", weight: "semibold", className: "mt-1 text-2xl font-semibold", children: value }),
|
|
150
|
+
sub && /* @__PURE__ */ jsx(Text, { size: "xs", color: "subtle", className: cn("mt-0.5", trend === "up" && "text-success", trend === "down" && "text-danger"), children: sub })
|
|
151
|
+
] });
|
|
152
|
+
}
|
|
153
|
+
export {
|
|
154
|
+
Card,
|
|
155
|
+
CardList,
|
|
156
|
+
CardListItem,
|
|
157
|
+
CardRow,
|
|
158
|
+
StatCard
|
|
159
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
const docs = {
|
|
2
|
+
name: "Carousel",
|
|
3
|
+
description: "A horizontal row of items users scroll through, either several cards at a time or one slide per view. Comes with previous and next buttons, dots, faded edges and optional autoplay.",
|
|
4
|
+
features: [
|
|
5
|
+
"Variants: cards (free-scrolling track of several items) and slider (one item per view, snap paging)",
|
|
6
|
+
"alignToContainer lines the first and last items up with a Shavin container width",
|
|
7
|
+
"fadeEdges softens the track edges; scrollStep sets how far Previous and Next travel",
|
|
8
|
+
"Compound parts: Carousel.Track, Carousel.Item, Carousel.Controls, Carousel.Previous, Carousel.Next, Carousel.Dots"
|
|
9
|
+
],
|
|
10
|
+
accessibility: [
|
|
11
|
+
'The root is a region with aria-roledescription="carousel"; each Carousel.Item is a group with aria-roledescription="slide" (pass index for a "Slide N" label)',
|
|
12
|
+
'Previous and Next are native buttons labelled "Previous slide" and "Next slide"',
|
|
13
|
+
'Carousel.Dots renders a tablist of buttons labelled "Go to slide N" with aria-selected on the current one',
|
|
14
|
+
"The track is focusable (tabIndex 0), so keyboard users can scroll it; give the carousel an aria-label that names its content"
|
|
15
|
+
],
|
|
16
|
+
keyboard: "Tab to the track and use Left/Right arrows to scroll it; Tab to Previous, Next or a dot and press Enter or Space to move.",
|
|
17
|
+
usage: {
|
|
18
|
+
bestPractices: [
|
|
19
|
+
{
|
|
20
|
+
guidance: true,
|
|
21
|
+
description: 'Give the carousel an aria-label (e.g. "Featured templates") and keep visible Previous/Next controls so it is usable without a trackpad.'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
guidance: true,
|
|
25
|
+
description: 'Use variant="cards" for browsable collections and variant="slider" for one-at-a-time content such as testimonials.'
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
guidance: false,
|
|
29
|
+
description: "Do not rely on autoPlayInterval for content people must read: autoplay does not pause on hover or focus yet."
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
guidance: false,
|
|
33
|
+
description: "Do not hide the only route to important content inside a carousel; most visitors never page past the first items."
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
examples: [
|
|
38
|
+
{
|
|
39
|
+
title: "Cards track with gutter alignment",
|
|
40
|
+
code: `<Carousel variant="cards" alignToContainer="lg" fadeEdges aria-label="Featured items">
|
|
41
|
+
<div className="mb-4 flex items-center justify-between">
|
|
42
|
+
<Heading size="lg">Featured items</Heading>
|
|
43
|
+
<Carousel.Controls>
|
|
44
|
+
<Carousel.Previous />
|
|
45
|
+
<Carousel.Next />
|
|
46
|
+
</Carousel.Controls>
|
|
47
|
+
</div>
|
|
48
|
+
<Carousel.Track gap="5">
|
|
49
|
+
{["Analytics", "Billing", "Teams", "Integrations", "Security", "Audit log"].map((title, index) => (
|
|
50
|
+
<Carousel.Item key={title} index={index} className="w-[320px]">
|
|
51
|
+
<Card>{title}</Card>
|
|
52
|
+
</Carousel.Item>
|
|
53
|
+
))}
|
|
54
|
+
</Carousel.Track>
|
|
55
|
+
</Carousel>`
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
};
|
|
59
|
+
export {
|
|
60
|
+
docs
|
|
61
|
+
};
|
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
createContext,
|
|
5
|
+
useContext,
|
|
6
|
+
useRef,
|
|
7
|
+
useState,
|
|
8
|
+
useEffect,
|
|
9
|
+
useCallback
|
|
10
|
+
} from "react";
|
|
11
|
+
import { cva } from "class-variance-authority";
|
|
12
|
+
import { cn } from "../../lib/cn.js";
|
|
13
|
+
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
14
|
+
const carouselVariants = cva("relative w-full", {
|
|
15
|
+
variants: {
|
|
16
|
+
variant: {
|
|
17
|
+
slider: "overflow-hidden",
|
|
18
|
+
cards: "overflow-hidden"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
variant: "cards"
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
const CarouselContext = createContext(null);
|
|
26
|
+
function useCarousel() {
|
|
27
|
+
const context = useContext(CarouselContext);
|
|
28
|
+
if (!context) {
|
|
29
|
+
throw new Error("useCarousel must be used within a <Carousel> primitive.");
|
|
30
|
+
}
|
|
31
|
+
return context;
|
|
32
|
+
}
|
|
33
|
+
function Carousel({
|
|
34
|
+
variant = "cards",
|
|
35
|
+
alignToContainer = "none",
|
|
36
|
+
fadeEdges = false,
|
|
37
|
+
scrollStep = 340,
|
|
38
|
+
autoPlayInterval,
|
|
39
|
+
onSlideChange,
|
|
40
|
+
className,
|
|
41
|
+
children,
|
|
42
|
+
...props
|
|
43
|
+
}) {
|
|
44
|
+
const scrollContainerRef = useRef(null);
|
|
45
|
+
const [canScrollPrev, setCanScrollPrev] = useState(false);
|
|
46
|
+
const [canScrollNext, setCanScrollNext] = useState(true);
|
|
47
|
+
const [activeIndex, setActiveIndex] = useState(0);
|
|
48
|
+
const [totalItems, setTotalItems] = useState(0);
|
|
49
|
+
const checkScrollability = useCallback(() => {
|
|
50
|
+
const el = scrollContainerRef.current;
|
|
51
|
+
if (!el) return;
|
|
52
|
+
const { scrollLeft, scrollWidth, clientWidth } = el;
|
|
53
|
+
setCanScrollPrev(scrollLeft > 4);
|
|
54
|
+
setCanScrollNext(scrollLeft < scrollWidth - clientWidth - 4);
|
|
55
|
+
if (variant === "slider" && clientWidth > 0) {
|
|
56
|
+
const idx = Math.round(scrollLeft / clientWidth);
|
|
57
|
+
setActiveIndex(idx);
|
|
58
|
+
onSlideChange?.(idx);
|
|
59
|
+
}
|
|
60
|
+
}, [variant, onSlideChange]);
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
const el = scrollContainerRef.current;
|
|
63
|
+
if (!el) return;
|
|
64
|
+
checkScrollability();
|
|
65
|
+
el.addEventListener("scroll", checkScrollability, { passive: true });
|
|
66
|
+
window.addEventListener("resize", checkScrollability);
|
|
67
|
+
return () => {
|
|
68
|
+
el.removeEventListener("scroll", checkScrollability);
|
|
69
|
+
window.removeEventListener("resize", checkScrollability);
|
|
70
|
+
};
|
|
71
|
+
}, [checkScrollability]);
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
if (variant !== "slider" || !autoPlayInterval || totalItems <= 1) return;
|
|
74
|
+
const interval = setInterval(() => {
|
|
75
|
+
if (!scrollContainerRef.current) return;
|
|
76
|
+
const { scrollLeft, scrollWidth, clientWidth } = scrollContainerRef.current;
|
|
77
|
+
if (scrollLeft >= scrollWidth - clientWidth - 4) {
|
|
78
|
+
scrollContainerRef.current.scrollTo({ left: 0, behavior: "smooth" });
|
|
79
|
+
} else {
|
|
80
|
+
scrollContainerRef.current.scrollBy({ left: clientWidth, behavior: "smooth" });
|
|
81
|
+
}
|
|
82
|
+
}, autoPlayInterval);
|
|
83
|
+
return () => clearInterval(interval);
|
|
84
|
+
}, [variant, autoPlayInterval, totalItems]);
|
|
85
|
+
const scrollPrev = useCallback(() => {
|
|
86
|
+
const el = scrollContainerRef.current;
|
|
87
|
+
if (!el) return;
|
|
88
|
+
const amount = variant === "slider" ? el.clientWidth : scrollStep;
|
|
89
|
+
el.scrollBy({ left: -amount, behavior: "smooth" });
|
|
90
|
+
}, [variant, scrollStep]);
|
|
91
|
+
const scrollNext = useCallback(() => {
|
|
92
|
+
const el = scrollContainerRef.current;
|
|
93
|
+
if (!el) return;
|
|
94
|
+
const amount = variant === "slider" ? el.clientWidth : scrollStep;
|
|
95
|
+
el.scrollBy({ left: amount, behavior: "smooth" });
|
|
96
|
+
}, [variant, scrollStep]);
|
|
97
|
+
const scrollToIndex = useCallback(
|
|
98
|
+
(index) => {
|
|
99
|
+
const el = scrollContainerRef.current;
|
|
100
|
+
if (!el) return;
|
|
101
|
+
const amount = variant === "slider" ? el.clientWidth * index : scrollStep * index;
|
|
102
|
+
el.scrollTo({ left: amount, behavior: "smooth" });
|
|
103
|
+
},
|
|
104
|
+
[variant, scrollStep]
|
|
105
|
+
);
|
|
106
|
+
return /* @__PURE__ */ jsx(
|
|
107
|
+
CarouselContext.Provider,
|
|
108
|
+
{
|
|
109
|
+
value: {
|
|
110
|
+
scrollContainerRef,
|
|
111
|
+
variant: variant || "cards",
|
|
112
|
+
alignToContainer,
|
|
113
|
+
scrollPrev,
|
|
114
|
+
scrollNext,
|
|
115
|
+
canScrollPrev,
|
|
116
|
+
canScrollNext,
|
|
117
|
+
activeIndex,
|
|
118
|
+
totalItems,
|
|
119
|
+
setTotalItems,
|
|
120
|
+
scrollToIndex
|
|
121
|
+
},
|
|
122
|
+
children: /* @__PURE__ */ jsxs(
|
|
123
|
+
"div",
|
|
124
|
+
{
|
|
125
|
+
role: "region",
|
|
126
|
+
"aria-roledescription": "carousel",
|
|
127
|
+
className: cn(carouselVariants({ variant }), className),
|
|
128
|
+
...props,
|
|
129
|
+
children: [
|
|
130
|
+
fadeEdges && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
131
|
+
/* @__PURE__ */ jsx(
|
|
132
|
+
"div",
|
|
133
|
+
{
|
|
134
|
+
"aria-hidden": "true",
|
|
135
|
+
className: "pointer-events-none absolute inset-y-0 left-0 z-10 w-10 md:w-20 bg-gradient-to-r from-canvas to-transparent"
|
|
136
|
+
}
|
|
137
|
+
),
|
|
138
|
+
/* @__PURE__ */ jsx(
|
|
139
|
+
"div",
|
|
140
|
+
{
|
|
141
|
+
"aria-hidden": "true",
|
|
142
|
+
className: "pointer-events-none absolute inset-y-0 right-0 z-10 w-10 md:w-20 bg-gradient-to-l from-canvas to-transparent"
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
] }),
|
|
146
|
+
children
|
|
147
|
+
]
|
|
148
|
+
}
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
const CONTAINER_MAX_WIDTHS = {
|
|
154
|
+
xs: "28rem",
|
|
155
|
+
sm: "42rem",
|
|
156
|
+
md: "56rem",
|
|
157
|
+
lg: "72rem",
|
|
158
|
+
xl: "90rem"
|
|
159
|
+
};
|
|
160
|
+
function CarouselTrack({
|
|
161
|
+
gap = "5",
|
|
162
|
+
className,
|
|
163
|
+
children,
|
|
164
|
+
...props
|
|
165
|
+
}) {
|
|
166
|
+
const { scrollContainerRef, variant, alignToContainer } = useCarousel();
|
|
167
|
+
const gapClass = {
|
|
168
|
+
"2": "gap-2",
|
|
169
|
+
"3": "gap-3",
|
|
170
|
+
"4": "gap-4",
|
|
171
|
+
"5": "gap-5",
|
|
172
|
+
"6": "gap-6",
|
|
173
|
+
"8": "gap-8"
|
|
174
|
+
}[gap];
|
|
175
|
+
const gapMarginClass = {
|
|
176
|
+
"2": "-mr-2",
|
|
177
|
+
"3": "-mr-3",
|
|
178
|
+
"4": "-mr-4",
|
|
179
|
+
"5": "-mr-5",
|
|
180
|
+
"6": "-mr-6",
|
|
181
|
+
"8": "-mr-8"
|
|
182
|
+
}[gap];
|
|
183
|
+
const gapMarginTrailingClass = {
|
|
184
|
+
"2": "-ml-2",
|
|
185
|
+
"3": "-ml-3",
|
|
186
|
+
"4": "-ml-4",
|
|
187
|
+
"5": "-ml-5",
|
|
188
|
+
"6": "-ml-6",
|
|
189
|
+
"8": "-ml-8"
|
|
190
|
+
}[gap];
|
|
191
|
+
const maxW = CONTAINER_MAX_WIDTHS[alignToContainer] || "72rem";
|
|
192
|
+
const hasGutter = alignToContainer !== "none" && alignToContainer !== "full";
|
|
193
|
+
return /* @__PURE__ */ jsxs(
|
|
194
|
+
"div",
|
|
195
|
+
{
|
|
196
|
+
ref: scrollContainerRef,
|
|
197
|
+
tabIndex: 0,
|
|
198
|
+
className: cn(
|
|
199
|
+
"flex w-full overflow-x-auto pb-4 pt-1 no-scrollbar scroll-smooth motion-reduce:scroll-auto",
|
|
200
|
+
variant === "slider" && "snap-x snap-mandatory",
|
|
201
|
+
gapClass,
|
|
202
|
+
className
|
|
203
|
+
),
|
|
204
|
+
style: {
|
|
205
|
+
scrollbarWidth: "none",
|
|
206
|
+
msOverflowStyle: "none"
|
|
207
|
+
},
|
|
208
|
+
...props,
|
|
209
|
+
children: [
|
|
210
|
+
hasGutter && /* @__PURE__ */ jsx(
|
|
211
|
+
"div",
|
|
212
|
+
{
|
|
213
|
+
"aria-hidden": "true",
|
|
214
|
+
className: cn(
|
|
215
|
+
"shrink-0 pointer-events-none",
|
|
216
|
+
gapMarginClass
|
|
217
|
+
),
|
|
218
|
+
style: {
|
|
219
|
+
width: `max(1.5rem, calc((100vw - ${maxW}) / 2 + 1.5rem))`
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
),
|
|
223
|
+
children,
|
|
224
|
+
hasGutter && /* @__PURE__ */ jsx(
|
|
225
|
+
"div",
|
|
226
|
+
{
|
|
227
|
+
"aria-hidden": "true",
|
|
228
|
+
className: cn(
|
|
229
|
+
"shrink-0 pointer-events-none",
|
|
230
|
+
gapMarginTrailingClass
|
|
231
|
+
),
|
|
232
|
+
style: {
|
|
233
|
+
width: `max(1.5rem, calc((100vw - ${maxW}) / 2 + 1.5rem))`
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
)
|
|
237
|
+
]
|
|
238
|
+
}
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
function CarouselItem({
|
|
242
|
+
index,
|
|
243
|
+
className,
|
|
244
|
+
children,
|
|
245
|
+
...props
|
|
246
|
+
}) {
|
|
247
|
+
const { variant } = useCarousel();
|
|
248
|
+
return /* @__PURE__ */ jsx(
|
|
249
|
+
"div",
|
|
250
|
+
{
|
|
251
|
+
role: "group",
|
|
252
|
+
"aria-roledescription": "slide",
|
|
253
|
+
"aria-label": index !== void 0 ? `Slide ${index + 1}` : void 0,
|
|
254
|
+
className: cn(
|
|
255
|
+
"shrink-0",
|
|
256
|
+
variant === "slider" && "w-full snap-center",
|
|
257
|
+
className
|
|
258
|
+
),
|
|
259
|
+
...props,
|
|
260
|
+
children
|
|
261
|
+
}
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
function CarouselControls({
|
|
265
|
+
className,
|
|
266
|
+
children,
|
|
267
|
+
...props
|
|
268
|
+
}) {
|
|
269
|
+
return /* @__PURE__ */ jsx("div", { className: cn("flex items-center gap-1.5", className), ...props, children });
|
|
270
|
+
}
|
|
271
|
+
function CarouselPrevious({
|
|
272
|
+
className,
|
|
273
|
+
...props
|
|
274
|
+
}) {
|
|
275
|
+
const { scrollPrev, canScrollPrev } = useCarousel();
|
|
276
|
+
return /* @__PURE__ */ jsx(
|
|
277
|
+
"button",
|
|
278
|
+
{
|
|
279
|
+
type: "button",
|
|
280
|
+
onClick: scrollPrev,
|
|
281
|
+
disabled: !canScrollPrev,
|
|
282
|
+
"aria-label": "Previous slide",
|
|
283
|
+
className: cn(
|
|
284
|
+
"w-9 h-9 flex items-center justify-center rounded-[var(--radius-lg)] border border-hairline bg-surface text-fg-subtle hover:text-fg hover:border-hairline-strong active:scale-95 transition-all disabled:opacity-40 disabled:pointer-events-none cursor-pointer",
|
|
285
|
+
className
|
|
286
|
+
),
|
|
287
|
+
...props,
|
|
288
|
+
children: /* @__PURE__ */ jsx(ChevronLeft, { className: "w-4 h-4" })
|
|
289
|
+
}
|
|
290
|
+
);
|
|
291
|
+
}
|
|
292
|
+
function CarouselNext({
|
|
293
|
+
className,
|
|
294
|
+
...props
|
|
295
|
+
}) {
|
|
296
|
+
const { scrollNext, canScrollNext } = useCarousel();
|
|
297
|
+
return /* @__PURE__ */ jsx(
|
|
298
|
+
"button",
|
|
299
|
+
{
|
|
300
|
+
type: "button",
|
|
301
|
+
onClick: scrollNext,
|
|
302
|
+
disabled: !canScrollNext,
|
|
303
|
+
"aria-label": "Next slide",
|
|
304
|
+
className: cn(
|
|
305
|
+
"w-9 h-9 flex items-center justify-center rounded-[var(--radius-lg)] border border-hairline bg-surface text-fg-subtle hover:text-fg hover:border-hairline-strong active:scale-95 transition-all disabled:opacity-40 disabled:pointer-events-none cursor-pointer",
|
|
306
|
+
className
|
|
307
|
+
),
|
|
308
|
+
...props,
|
|
309
|
+
children: /* @__PURE__ */ jsx(ChevronRight, { className: "w-4 h-4" })
|
|
310
|
+
}
|
|
311
|
+
);
|
|
312
|
+
}
|
|
313
|
+
function CarouselDots({
|
|
314
|
+
count,
|
|
315
|
+
className,
|
|
316
|
+
...props
|
|
317
|
+
}) {
|
|
318
|
+
const { activeIndex, scrollToIndex } = useCarousel();
|
|
319
|
+
return (
|
|
320
|
+
// Plain buttons, not tabs: there are no tab panels to control (WCAG 4.1.2).
|
|
321
|
+
/* @__PURE__ */ jsx(
|
|
322
|
+
"div",
|
|
323
|
+
{
|
|
324
|
+
role: "group",
|
|
325
|
+
"aria-label": "Slides",
|
|
326
|
+
className: cn("flex items-center justify-center pt-3", className),
|
|
327
|
+
...props,
|
|
328
|
+
children: Array.from({ length: count }, (_, i) => /* @__PURE__ */ jsx(
|
|
329
|
+
"button",
|
|
330
|
+
{
|
|
331
|
+
type: "button",
|
|
332
|
+
"aria-current": activeIndex === i ? "true" : void 0,
|
|
333
|
+
"aria-label": `Go to slide ${i + 1}`,
|
|
334
|
+
onClick: () => scrollToIndex(i),
|
|
335
|
+
className: "group flex h-7 min-w-7 items-center justify-center cursor-pointer",
|
|
336
|
+
children: /* @__PURE__ */ jsx(
|
|
337
|
+
"span",
|
|
338
|
+
{
|
|
339
|
+
"aria-hidden": "true",
|
|
340
|
+
className: cn(
|
|
341
|
+
"h-1.5 rounded-full transition-all duration-300",
|
|
342
|
+
activeIndex === i ? "w-6 bg-fg" : "w-1.5 bg-hairline-strong group-hover:bg-fg-muted"
|
|
343
|
+
)
|
|
344
|
+
}
|
|
345
|
+
)
|
|
346
|
+
},
|
|
347
|
+
i
|
|
348
|
+
))
|
|
349
|
+
}
|
|
350
|
+
)
|
|
351
|
+
);
|
|
352
|
+
}
|
|
353
|
+
Carousel.Track = CarouselTrack;
|
|
354
|
+
Carousel.Item = CarouselItem;
|
|
355
|
+
Carousel.Controls = CarouselControls;
|
|
356
|
+
Carousel.Previous = CarouselPrevious;
|
|
357
|
+
Carousel.Next = CarouselNext;
|
|
358
|
+
Carousel.Dots = CarouselDots;
|
|
359
|
+
export {
|
|
360
|
+
Carousel,
|
|
361
|
+
CarouselControls,
|
|
362
|
+
CarouselDots,
|
|
363
|
+
CarouselItem,
|
|
364
|
+
CarouselNext,
|
|
365
|
+
CarouselPrevious,
|
|
366
|
+
CarouselTrack,
|
|
367
|
+
carouselVariants,
|
|
368
|
+
useCarousel
|
|
369
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Carousel.js";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const docs = {
|
|
2
|
+
name: "ChatBubble",
|
|
3
|
+
description: "One message in a conversation, human or AI. Handles who is speaking, bubble or flat layout, and the turn lifecycle (submitted, streaming, ready, stopped, error) so any AI chat framework can map its message parts and status onto it.",
|
|
4
|
+
features: [
|
|
5
|
+
"role: user, assistant, system. variant (incoming, outgoing, system) is the older spelling and still works",
|
|
6
|
+
"layout: bubble (text on a surface) or flat (content flows as a document). role=assistant defaults to flat so Reasoning, ToolCall, CodeBlock and FileOutput are never squeezed into a bubble",
|
|
7
|
+
"status: submitted (Murmur pending indicator), streaming (live caret, aria-live), ready, stopped, error with Retry. Names match the Vercel AI SDK chat status",
|
|
8
|
+
"sharpCorner (top by default, bottom or none) places the speech-bubble tail; hoverTimestamp shows the timestamp only on hover",
|
|
9
|
+
"interim shows unconfirmed live text (a speech transcript) italic and quiet",
|
|
10
|
+
"Bubble width is capped at 85% of the row and shrinks to the text, so short messages stay short and long ones wrap late",
|
|
11
|
+
"actions slot for copy / regenerate / feedback, hidden while submitted or streaming",
|
|
12
|
+
"Children are the message parts in order. Part primitives: Reasoning (reasoning part), ToolCall (tool part with approval), CodeBlock (code), FileOutput (file part)",
|
|
13
|
+
"Uses panel radius --radius-panel with a tail corner in bubble layout; avatar, author and timestamp slots"
|
|
14
|
+
],
|
|
15
|
+
accessibility: [
|
|
16
|
+
"Streaming turns are aria-live=polite and aria-busy; the pending indicator is a role=status",
|
|
17
|
+
"Error row is role=alert",
|
|
18
|
+
"Direction (user vs assistant) is conveyed by alignment and data-role, not colour alone"
|
|
19
|
+
],
|
|
20
|
+
keyboard: "Tab to actions, Retry and any interactive parts inside the message.",
|
|
21
|
+
usage: {
|
|
22
|
+
bestPractices: [
|
|
23
|
+
{ guidance: true, description: 'For AI chat use role="assistant" (flat) for the model and role="user" for the person, and put each message part inside as a child.' },
|
|
24
|
+
{ guidance: true, description: "Map your framework's status straight onto the status prop and your parts onto the part primitives." },
|
|
25
|
+
{ guidance: false, description: 'Do not put ToolCall, CodeBlock or FileOutput inside layout="bubble", use flat.' },
|
|
26
|
+
{ guidance: false, description: "Do not use ChatBubble for long editorial articles, reach for Section or Container." }
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
examples: [
|
|
30
|
+
{ title: "Assistant turn with parts", code: '<ChatBubble role="assistant" avatarFallback="AI" status="streaming"><Reasoning status="thinking">Checking the policy\u2026</Reasoning>A refund is possible within 30 days</ChatBubble>' },
|
|
31
|
+
{ title: "User message", code: '<ChatBubble role="user" hideAvatar>Where is my order?</ChatBubble>' },
|
|
32
|
+
{ title: "Support chat bubble", code: '<ChatBubble variant="incoming" author="Studio AI" avatarFallback="AI" timestamp="Just now">How can I help?</ChatBubble>' }
|
|
33
|
+
]
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
docs
|
|
37
|
+
};
|