@shavin/ui 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +94 -0
- package/LICENSE +21 -0
- package/README.md +81 -2
- package/components.json +15771 -0
- package/dist/authoring/types.js +0 -0
- package/dist/icons.d.ts +20 -0
- package/dist/icons.js +6 -0
- package/dist/index.d.ts +3325 -0
- package/dist/index.js +531 -0
- package/dist/inspector/FindingPopover.js +252 -0
- package/dist/inspector/Highlight.js +76 -0
- package/dist/inspector/Inspector.js +420 -0
- package/dist/inspector/InspectorRoot.js +75 -0
- package/dist/inspector/IssuesLayer.js +134 -0
- package/dist/inspector/IssuesList.js +174 -0
- package/dist/inspector/SettingsPanel.js +89 -0
- package/dist/inspector/ShavinMark.js +22 -0
- package/dist/inspector/Toolbar.js +202 -0
- package/dist/inspector/barPlacement.js +117 -0
- package/dist/inspector/env.js +59 -0
- package/dist/inspector/geometry.js +44 -0
- package/dist/inspector/ignored.js +52 -0
- package/dist/inspector/index.js +7 -0
- package/dist/inspector/journalClient.js +57 -0
- package/dist/inspector/journalState.js +36 -0
- package/dist/inspector/pin.js +43 -0
- package/dist/inspector/placement.js +96 -0
- package/dist/inspector/prompt.js +63 -0
- package/dist/inspector/scheme.js +56 -0
- package/dist/inspector/settings.js +54 -0
- package/dist/inspector/strings.js +67 -0
- package/dist/inspector/targets.js +31 -0
- package/dist/inspector/theme/ThemeControls.js +351 -0
- package/dist/inspector/theme/ThemePanel.js +32 -0
- package/dist/inspector/theme/useThemeController.js +560 -0
- package/dist/inspector/usePhone.js +32 -0
- package/dist/inspector/useSelectTool.js +82 -0
- package/dist/inspector/useTimeouts.js +22 -0
- package/dist/inspector/useTrackedRect.js +39 -0
- package/dist/lib/announce.js +47 -0
- package/dist/lib/bridge.js +43 -0
- package/dist/lib/buttonState.js +81 -0
- package/dist/lib/chart-kit.js +226 -0
- package/dist/lib/cn.js +8 -0
- package/dist/lib/color-space.js +315 -0
- package/dist/lib/concentric.js +85 -0
- package/dist/lib/hit-area.js +25 -0
- package/dist/lib/inspector/collect.js +299 -0
- package/dist/lib/inspector/color.js +58 -0
- package/dist/lib/inspector/console-capture.js +96 -0
- package/dist/lib/inspector/index.js +8 -0
- package/dist/lib/inspector/rules.js +232 -0
- package/dist/lib/inspector/run.js +35 -0
- package/dist/lib/inspector/schema.js +110 -0
- package/dist/lib/inspector/selector.js +103 -0
- package/dist/lib/inspector/tokens.js +34 -0
- package/dist/lib/media-overlay-presets.js +284 -0
- package/dist/lib/media-overlays.js +381 -0
- package/dist/lib/meta.js +70 -0
- package/dist/lib/motion-gsap.js +25 -0
- package/dist/lib/motion-runtime.js +283 -0
- package/dist/lib/neutral-tint.js +108 -0
- package/dist/lib/portal-container.js +12 -0
- package/dist/lib/scroll-edges.js +41 -0
- package/dist/lib/surface.js +6 -0
- package/dist/lib/syntax.js +115 -0
- package/dist/lib/theme-presets.d.ts +1 -0
- package/dist/lib/theme-presets.js +759 -0
- package/dist/lib/useClientLocale.js +11 -0
- package/dist/lib/useFieldErrorAnnouncement.js +15 -0
- package/dist/lib/useReducedMotion.js +17 -0
- package/dist/lib/useResizable.js +313 -0
- package/dist/lib/useReturnFocus.js +24 -0
- package/dist/lib/useSlidingIndicator.js +56 -0
- package/dist/panels.d.ts +37 -0
- package/dist/panels.js +19 -0
- package/dist/primitives/Accordion/Accordion.doc.js +37 -0
- package/dist/primitives/Accordion/Accordion.js +87 -0
- package/dist/primitives/Accordion/index.js +2 -0
- package/dist/primitives/ActionBar/ActionBar.doc.js +37 -0
- package/dist/primitives/ActionBar/ActionBar.js +126 -0
- package/dist/primitives/ActionBar/index.js +2 -0
- package/dist/primitives/AlertDialog/AlertDialog.doc.js +54 -0
- package/dist/primitives/AlertDialog/AlertDialog.js +113 -0
- package/dist/primitives/AlertDialog/index.js +2 -0
- package/dist/primitives/AppShell/AppShell.doc.js +81 -0
- package/dist/primitives/AppShell/AppShell.js +178 -0
- package/dist/primitives/AppShell/frame-context.js +10 -0
- package/dist/primitives/AppShell/index.js +2 -0
- package/dist/primitives/AspectRatio/AspectRatio.doc.js +34 -0
- package/dist/primitives/AspectRatio/AspectRatio.js +5 -0
- package/dist/primitives/AspectRatio/index.js +2 -0
- package/dist/primitives/Avatar/Avatar.doc.js +40 -0
- package/dist/primitives/Avatar/Avatar.js +62 -0
- package/dist/primitives/Avatar/index.js +2 -0
- package/dist/primitives/Backdrop/Backdrop.doc.js +24 -0
- package/dist/primitives/Backdrop/Backdrop.js +42 -0
- package/dist/primitives/Backdrop/index.js +2 -0
- package/dist/primitives/Badge/Badge.doc.js +35 -0
- package/dist/primitives/Badge/Badge.js +95 -0
- package/dist/primitives/Badge/index.js +2 -0
- package/dist/primitives/BarChart/BarChart.doc.js +59 -0
- package/dist/primitives/BarChart/BarChart.js +154 -0
- package/dist/primitives/BarChart/index.js +2 -0
- package/dist/primitives/BlockPreview/BlockPreview.doc.js +51 -0
- package/dist/primitives/BlockPreview/BlockPreview.js +485 -0
- package/dist/primitives/BlockPreview/index.js +8 -0
- package/dist/primitives/Blockquote/Blockquote.doc.js +25 -0
- package/dist/primitives/Blockquote/Blockquote.js +19 -0
- package/dist/primitives/Blockquote/index.js +2 -0
- package/dist/primitives/BottomNav/BottomNav.doc.js +37 -0
- package/dist/primitives/BottomNav/BottomNav.js +54 -0
- package/dist/primitives/BottomNav/index.js +2 -0
- package/dist/primitives/Box/Box.doc.js +45 -0
- package/dist/primitives/Box/Box.js +51 -0
- package/dist/primitives/Box/index.js +2 -0
- package/dist/primitives/Breadcrumbs/Breadcrumbs.doc.js +35 -0
- package/dist/primitives/Breadcrumbs/Breadcrumbs.js +40 -0
- package/dist/primitives/Breadcrumbs/index.js +2 -0
- package/dist/primitives/Button/Button.doc.js +80 -0
- package/dist/primitives/Button/Button.js +132 -0
- package/dist/primitives/Button/index.js +2 -0
- package/dist/primitives/Calendar/Calendar.doc.js +36 -0
- package/dist/primitives/Calendar/Calendar.js +502 -0
- package/dist/primitives/Calendar/index.js +2 -0
- package/dist/primitives/Callout/Callout.doc.js +34 -0
- package/dist/primitives/Callout/Callout.js +63 -0
- package/dist/primitives/Callout/index.js +2 -0
- package/dist/primitives/Card/Card.doc.js +46 -0
- package/dist/primitives/Card/Card.js +159 -0
- package/dist/primitives/Card/index.js +2 -0
- package/dist/primitives/Carousel/Carousel.doc.js +61 -0
- package/dist/primitives/Carousel/Carousel.js +369 -0
- package/dist/primitives/Carousel/index.js +1 -0
- package/dist/primitives/ChatBubble/ChatBubble.doc.js +37 -0
- package/dist/primitives/ChatBubble/ChatBubble.js +120 -0
- package/dist/primitives/ChatBubble/index.js +2 -0
- package/dist/primitives/Checkbox/Checkbox.doc.js +36 -0
- package/dist/primitives/Checkbox/Checkbox.js +57 -0
- package/dist/primitives/Checkbox/index.js +2 -0
- package/dist/primitives/CheckboxCards/CheckboxCards.doc.js +35 -0
- package/dist/primitives/CheckboxCards/CheckboxCards.js +47 -0
- package/dist/primitives/CheckboxCards/index.js +2 -0
- package/dist/primitives/CheckboxGroup/CheckboxGroup.doc.js +35 -0
- package/dist/primitives/CheckboxGroup/CheckboxGroup.js +40 -0
- package/dist/primitives/CheckboxGroup/index.js +2 -0
- package/dist/primitives/Code/Code.doc.js +22 -0
- package/dist/primitives/Code/Code.js +17 -0
- package/dist/primitives/Code/index.js +2 -0
- package/dist/primitives/CodeBlock/CodeBlock.doc.js +36 -0
- package/dist/primitives/CodeBlock/CodeBlock.js +205 -0
- package/dist/primitives/CodeBlock/index.js +2 -0
- package/dist/primitives/CodeEditor/CodeEditor.doc.js +53 -0
- package/dist/primitives/CodeEditor/CodeEditor.js +204 -0
- package/dist/primitives/CodeEditor/index.js +4 -0
- package/dist/primitives/ColorPicker/ColorPicker.doc.js +37 -0
- package/dist/primitives/ColorPicker/ColorPicker.js +776 -0
- package/dist/primitives/ColorPicker/index.js +2 -0
- package/dist/primitives/Combobox/Combobox.doc.js +36 -0
- package/dist/primitives/Combobox/Combobox.js +199 -0
- package/dist/primitives/Combobox/index.js +2 -0
- package/dist/primitives/Container/Container.doc.js +46 -0
- package/dist/primitives/Container/Container.js +54 -0
- package/dist/primitives/Container/index.js +2 -0
- package/dist/primitives/ContextMenu/ContextMenu.doc.js +36 -0
- package/dist/primitives/ContextMenu/ContextMenu.js +59 -0
- package/dist/primitives/ContextMenu/index.js +2 -0
- package/dist/primitives/DataList/DataList.doc.js +34 -0
- package/dist/primitives/DataList/DataList.js +35 -0
- package/dist/primitives/DataList/index.js +2 -0
- package/dist/primitives/DatePicker/DatePicker.doc.js +36 -0
- package/dist/primitives/DatePicker/DatePicker.js +398 -0
- package/dist/primitives/DatePicker/index.js +2 -0
- package/dist/primitives/Dialog/Dialog.doc.js +107 -0
- package/dist/primitives/Dialog/Dialog.js +143 -0
- package/dist/primitives/Dialog/index.js +2 -0
- package/dist/primitives/DonutChart/DonutChart.doc.js +26 -0
- package/dist/primitives/DonutChart/DonutChart.js +71 -0
- package/dist/primitives/DonutChart/index.js +2 -0
- package/dist/primitives/Drawer/Drawer.doc.js +44 -0
- package/dist/primitives/Drawer/Drawer.js +158 -0
- package/dist/primitives/Drawer/index.js +2 -0
- package/dist/primitives/Dropdown/Dropdown.doc.js +40 -0
- package/dist/primitives/Dropdown/Dropdown.js +146 -0
- package/dist/primitives/Dropdown/index.js +2 -0
- package/dist/primitives/Emphasis/Emphasis.doc.js +28 -0
- package/dist/primitives/Emphasis/Emphasis.js +25 -0
- package/dist/primitives/Emphasis/index.js +2 -0
- package/dist/primitives/EmptyState/EmptyState.doc.js +76 -0
- package/dist/primitives/EmptyState/EmptyState.js +118 -0
- package/dist/primitives/EmptyState/index.js +2 -0
- package/dist/primitives/FileOutput/FileOutput.doc.js +26 -0
- package/dist/primitives/FileOutput/FileOutput.js +55 -0
- package/dist/primitives/FileOutput/index.js +2 -0
- package/dist/primitives/Flex/Flex.doc.js +58 -0
- package/dist/primitives/Flex/Flex.js +98 -0
- package/dist/primitives/Flex/index.js +2 -0
- package/dist/primitives/FormErrorSummary/FormErrorSummary.doc.js +39 -0
- package/dist/primitives/FormErrorSummary/FormErrorSummary.js +61 -0
- package/dist/primitives/FormErrorSummary/index.js +2 -0
- package/dist/primitives/FormField/FormField.doc.js +68 -0
- package/dist/primitives/FormField/FormField.js +149 -0
- package/dist/primitives/FormField/index.js +2 -0
- package/dist/primitives/FunnelChart/FunnelChart.doc.js +45 -0
- package/dist/primitives/FunnelChart/FunnelChart.js +54 -0
- package/dist/primitives/FunnelChart/index.js +2 -0
- package/dist/primitives/Grid/Grid.doc.js +57 -0
- package/dist/primitives/Grid/Grid.js +122 -0
- package/dist/primitives/Grid/index.js +2 -0
- package/dist/primitives/Heading/Heading.doc.js +46 -0
- package/dist/primitives/Heading/Heading.js +80 -0
- package/dist/primitives/Heading/index.js +2 -0
- package/dist/primitives/Heatmap/Heatmap.doc.js +49 -0
- package/dist/primitives/Heatmap/Heatmap.js +42 -0
- package/dist/primitives/Heatmap/index.js +2 -0
- package/dist/primitives/HoverCard/HoverCard.doc.js +36 -0
- package/dist/primitives/HoverCard/HoverCard.js +39 -0
- package/dist/primitives/HoverCard/index.js +2 -0
- package/dist/primitives/Icon/Icon.doc.js +49 -0
- package/dist/primitives/Icon/Icon.js +214 -0
- package/dist/primitives/Icon/buckets/lucide-a.js +214 -0
- package/dist/primitives/Icon/buckets/lucide-b.js +298 -0
- package/dist/primitives/Icon/buckets/lucide-c.js +524 -0
- package/dist/primitives/Icon/buckets/lucide-d.js +110 -0
- package/dist/primitives/Icon/buckets/lucide-e.js +50 -0
- package/dist/primitives/Icon/buckets/lucide-f.js +264 -0
- package/dist/primitives/Icon/buckets/lucide-g.js +108 -0
- package/dist/primitives/Icon/buckets/lucide-h.js +112 -0
- package/dist/primitives/Icon/buckets/lucide-i.js +46 -0
- package/dist/primitives/Icon/buckets/lucide-j.js +6 -0
- package/dist/primitives/Icon/buckets/lucide-k.js +18 -0
- package/dist/primitives/Icon/buckets/lucide-l.js +162 -0
- package/dist/primitives/Icon/buckets/lucide-m.js +266 -0
- package/dist/primitives/Icon/buckets/lucide-n.js +34 -0
- package/dist/primitives/Icon/buckets/lucide-o.js +20 -0
- package/dist/primitives/Icon/buckets/lucide-p.js +216 -0
- package/dist/primitives/Icon/buckets/lucide-q.js +6 -0
- package/dist/primitives/Icon/buckets/lucide-r.js +140 -0
- package/dist/primitives/Icon/buckets/lucide-s.js +490 -0
- package/dist/primitives/Icon/buckets/lucide-t.js +204 -0
- package/dist/primitives/Icon/buckets/lucide-u.js +84 -0
- package/dist/primitives/Icon/buckets/lucide-v.js +46 -0
- package/dist/primitives/Icon/buckets/lucide-w.js +82 -0
- package/dist/primitives/Icon/buckets/lucide-x.js +6 -0
- package/dist/primitives/Icon/buckets/lucide-z.js +36 -0
- package/dist/primitives/Icon/buckets/phosphor-a.js +250 -0
- package/dist/primitives/Icon/buckets/phosphor-b.js +158 -0
- package/dist/primitives/Icon/buckets/phosphor-c.js +320 -0
- package/dist/primitives/Icon/buckets/phosphor-d.js +90 -0
- package/dist/primitives/Icon/buckets/phosphor-e.js +52 -0
- package/dist/primitives/Icon/buckets/phosphor-f.js +162 -0
- package/dist/primitives/Icon/buckets/phosphor-g.js +92 -0
- package/dist/primitives/Icon/buckets/phosphor-h.js +88 -0
- package/dist/primitives/Icon/buckets/phosphor-i.js +26 -0
- package/dist/primitives/Icon/buckets/phosphor-j.js +8 -0
- package/dist/primitives/Icon/buckets/phosphor-k.js +8 -0
- package/dist/primitives/Icon/buckets/phosphor-l.js +84 -0
- package/dist/primitives/Icon/buckets/phosphor-m.js +110 -0
- package/dist/primitives/Icon/buckets/phosphor-n.js +100 -0
- package/dist/primitives/Icon/buckets/phosphor-o.js +14 -0
- package/dist/primitives/Icon/buckets/phosphor-p.js +166 -0
- package/dist/primitives/Icon/buckets/phosphor-q.js +10 -0
- package/dist/primitives/Icon/buckets/phosphor-r.js +46 -0
- package/dist/primitives/Icon/buckets/phosphor-s.js +254 -0
- package/dist/primitives/Icon/buckets/phosphor-t.js +152 -0
- package/dist/primitives/Icon/buckets/phosphor-u.js +38 -0
- package/dist/primitives/Icon/buckets/phosphor-v.js +22 -0
- package/dist/primitives/Icon/buckets/phosphor-w.js +48 -0
- package/dist/primitives/Icon/buckets/phosphor-x.js +4 -0
- package/dist/primitives/Icon/buckets/phosphor-y.js +8 -0
- package/dist/primitives/Icon/icon-display-names.generated.js +4 -0
- package/dist/primitives/Icon/icon-loaders.generated.js +70 -0
- package/dist/primitives/Icon/icon-names-material.generated.js +4 -0
- package/dist/primitives/Icon/icon-names.js +11 -0
- package/dist/primitives/Icon/index.js +7 -0
- package/dist/primitives/IconButton/IconButton.doc.js +43 -0
- package/dist/primitives/IconButton/IconButton.js +98 -0
- package/dist/primitives/IconButton/index.js +2 -0
- package/dist/primitives/IconPicker/IconPicker.doc.js +52 -0
- package/dist/primitives/IconPicker/IconPicker.js +193 -0
- package/dist/primitives/IconPicker/index.js +2 -0
- package/dist/primitives/IconPicker/registry.js +98 -0
- package/dist/primitives/Image/Image.doc.js +40 -0
- package/dist/primitives/Image/Image.js +76 -0
- package/dist/primitives/Image/index.js +2 -0
- package/dist/primitives/Inset/Inset.doc.js +34 -0
- package/dist/primitives/Inset/Inset.js +51 -0
- package/dist/primitives/Inset/index.js +2 -0
- package/dist/primitives/Kbd/Kbd.doc.js +22 -0
- package/dist/primitives/Kbd/Kbd.js +17 -0
- package/dist/primitives/Kbd/index.js +2 -0
- package/dist/primitives/LineChart/LineChart.doc.js +61 -0
- package/dist/primitives/LineChart/LineChart.js +146 -0
- package/dist/primitives/LineChart/index.js +2 -0
- package/dist/primitives/Link/Link.doc.js +45 -0
- package/dist/primitives/Link/Link.js +37 -0
- package/dist/primitives/Link/index.js +2 -0
- package/dist/primitives/List/List.doc.js +35 -0
- package/dist/primitives/List/List.js +35 -0
- package/dist/primitives/List/index.js +2 -0
- package/dist/primitives/Menu/Menu.doc.js +37 -0
- package/dist/primitives/Menu/Menu.js +117 -0
- package/dist/primitives/Menu/index.js +2 -0
- package/dist/primitives/Murmur/Murmur.doc.js +32 -0
- package/dist/primitives/Murmur/Murmur.js +85 -0
- package/dist/primitives/Murmur/engine.js +163 -0
- package/dist/primitives/Murmur/index.js +12 -0
- package/dist/primitives/Pagination/Pagination.doc.js +37 -0
- package/dist/primitives/Pagination/Pagination.js +183 -0
- package/dist/primitives/Pagination/index.js +2 -0
- package/dist/primitives/PanelGroup/PanelGroup.doc.js +41 -0
- package/dist/primitives/PanelGroup/PanelGroup.js +142 -0
- package/dist/primitives/PanelGroup/index.js +2 -0
- package/dist/primitives/Popover/Popover.doc.js +36 -0
- package/dist/primitives/Popover/Popover.js +41 -0
- package/dist/primitives/Popover/index.js +2 -0
- package/dist/primitives/Progress/Progress.doc.js +35 -0
- package/dist/primitives/Progress/Progress.js +77 -0
- package/dist/primitives/Progress/index.js +2 -0
- package/dist/primitives/RadioGroup/RadioGroup.doc.js +36 -0
- package/dist/primitives/RadioGroup/RadioGroup.js +132 -0
- package/dist/primitives/RadioGroup/index.js +2 -0
- package/dist/primitives/Rating/NpsScale.js +102 -0
- package/dist/primitives/Rating/Rating.doc.js +35 -0
- package/dist/primitives/Rating/Rating.js +116 -0
- package/dist/primitives/Rating/RatingSummary.js +50 -0
- package/dist/primitives/Rating/SentimentRating.js +81 -0
- package/dist/primitives/Rating/index.js +5 -0
- package/dist/primitives/Reasoning/Reasoning.doc.js +28 -0
- package/dist/primitives/Reasoning/Reasoning.js +73 -0
- package/dist/primitives/Reasoning/index.js +2 -0
- package/dist/primitives/Resizable/Resizable.doc.js +50 -0
- package/dist/primitives/Resizable/ResizeHandle.js +185 -0
- package/dist/primitives/Resizable/index.js +2 -0
- package/dist/primitives/Row/Row.doc.js +36 -0
- package/dist/primitives/Row/Row.js +53 -0
- package/dist/primitives/Row/index.js +2 -0
- package/dist/primitives/ScrollArea/ScrollArea.doc.js +35 -0
- package/dist/primitives/ScrollArea/ScrollArea.js +50 -0
- package/dist/primitives/ScrollArea/index.js +2 -0
- package/dist/primitives/Section/Section.doc.js +64 -0
- package/dist/primitives/Section/Section.js +76 -0
- package/dist/primitives/Section/index.js +2 -0
- package/dist/primitives/SegmentedControl/SegmentedControl.doc.js +75 -0
- package/dist/primitives/SegmentedControl/SegmentedControl.js +160 -0
- package/dist/primitives/SegmentedControl/index.js +2 -0
- package/dist/primitives/Select/Select.doc.js +42 -0
- package/dist/primitives/Select/Select.js +180 -0
- package/dist/primitives/Select/index.js +2 -0
- package/dist/primitives/Separator/Separator.doc.js +34 -0
- package/dist/primitives/Separator/Separator.js +84 -0
- package/dist/primitives/Separator/index.js +2 -0
- package/dist/primitives/ShavinDevTools/DevToolsPanel.js +2050 -0
- package/dist/primitives/ShavinDevTools/ShavinDevTools.doc.js +44 -0
- package/dist/primitives/ShavinDevTools/ShavinDevTools.js +15 -0
- package/dist/primitives/ShavinDevTools/index.js +8 -0
- package/dist/primitives/ShavinDevTools/types.js +0 -0
- package/dist/primitives/Sidebar/Sidebar.doc.js +39 -0
- package/dist/primitives/Sidebar/Sidebar.js +295 -0
- package/dist/primitives/Sidebar/index.js +2 -0
- package/dist/primitives/Skeleton/Skeleton.doc.js +38 -0
- package/dist/primitives/Skeleton/Skeleton.js +36 -0
- package/dist/primitives/Skeleton/index.js +2 -0
- package/dist/primitives/Slider/Slider.doc.js +45 -0
- package/dist/primitives/Slider/Slider.js +406 -0
- package/dist/primitives/Slider/index.js +2 -0
- package/dist/primitives/Sortable/Sortable.doc.js +35 -0
- package/dist/primitives/Sortable/Sortable.js +179 -0
- package/dist/primitives/Sortable/index.js +2 -0
- package/dist/primitives/Sparkline/Sparkline.doc.js +25 -0
- package/dist/primitives/Sparkline/Sparkline.js +46 -0
- package/dist/primitives/Sparkline/index.js +2 -0
- package/dist/primitives/Spinner/Spinner.doc.js +35 -0
- package/dist/primitives/Spinner/Spinner.js +162 -0
- package/dist/primitives/Spinner/index.js +2 -0
- package/dist/primitives/Spotlight/Spotlight.doc.js +36 -0
- package/dist/primitives/Spotlight/Spotlight.js +139 -0
- package/dist/primitives/Spotlight/index.js +2 -0
- package/dist/primitives/Stepper/Stepper.doc.js +46 -0
- package/dist/primitives/Stepper/Stepper.js +235 -0
- package/dist/primitives/Stepper/index.js +2 -0
- package/dist/primitives/Switch/Switch.doc.js +36 -0
- package/dist/primitives/Switch/Switch.js +54 -0
- package/dist/primitives/Switch/index.js +2 -0
- package/dist/primitives/Table/Table.doc.js +47 -0
- package/dist/primitives/Table/Table.js +63 -0
- package/dist/primitives/Table/index.js +2 -0
- package/dist/primitives/Tabs/Tabs.doc.js +53 -0
- package/dist/primitives/Tabs/Tabs.js +275 -0
- package/dist/primitives/Tabs/index.js +2 -0
- package/dist/primitives/Text/Text.doc.js +35 -0
- package/dist/primitives/Text/Text.js +67 -0
- package/dist/primitives/Text/index.js +2 -0
- package/dist/primitives/TextArea/TextArea.doc.js +35 -0
- package/dist/primitives/TextArea/TextArea.js +45 -0
- package/dist/primitives/TextArea/index.js +2 -0
- package/dist/primitives/TextField/TextField.doc.js +41 -0
- package/dist/primitives/TextField/TextField.js +290 -0
- package/dist/primitives/TextField/index.js +2 -0
- package/dist/primitives/ThemeProvider/ScopedThemeProvider.js +71 -0
- package/dist/primitives/ThemeProvider/ThemeProvider.doc.js +61 -0
- package/dist/primitives/ThemeProvider/ThemeProvider.js +143 -0
- package/dist/primitives/ThemeProvider/clientTheme.js +47 -0
- package/dist/primitives/ThemeProvider/index.js +3 -0
- package/dist/primitives/ThemeProvider/themeContext.js +11 -0
- package/dist/primitives/ThemeSwitcher/ThemeSwitcher.doc.js +49 -0
- package/dist/primitives/ThemeSwitcher/ThemeSwitcher.js +323 -0
- package/dist/primitives/ThemeSwitcher/index.js +2 -0
- package/dist/primitives/TimePicker/TimePicker.doc.js +36 -0
- package/dist/primitives/TimePicker/TimePicker.js +368 -0
- package/dist/primitives/TimePicker/index.js +2 -0
- package/dist/primitives/Toast/Toast.doc.js +65 -0
- package/dist/primitives/Toast/Toast.js +304 -0
- package/dist/primitives/Toast/index.js +2 -0
- package/dist/primitives/ToolCall/ToolCall.doc.js +29 -0
- package/dist/primitives/ToolCall/ToolCall.js +75 -0
- package/dist/primitives/ToolCall/index.js +2 -0
- package/dist/primitives/Tooltip/Tooltip.doc.js +37 -0
- package/dist/primitives/Tooltip/Tooltip.js +55 -0
- package/dist/primitives/Tooltip/index.js +2 -0
- package/dist/primitives/TopBar/TopBar.doc.js +34 -0
- package/dist/primitives/TopBar/TopBar.js +8 -0
- package/dist/primitives/TopBar/index.js +2 -0
- package/dist/primitives/Video/PauseToggle.js +49 -0
- package/dist/primitives/Video/Video.doc.js +47 -0
- package/dist/primitives/Video/Video.js +104 -0
- package/dist/primitives/Video/index.js +1 -0
- package/dist/primitives/VoiceInput/VoiceInput.doc.js +38 -0
- package/dist/primitives/VoiceInput/VoiceInput.js +96 -0
- package/dist/primitives/VoiceInput/index.js +2 -0
- package/dist/primitives/WiseOwlLogo/WiseOwlLogo.doc.js +38 -0
- package/dist/primitives/WiseOwlLogo/WiseOwlLogo.js +82 -0
- package/dist/primitives/WiseOwlLogo/index.js +2 -0
- package/dist/primitives/WiseOwlLogo/paths.js +10 -0
- package/dist/server.d.ts +256 -0
- package/dist/server.js +22 -0
- package/dist/styles/base-oklch.css +124 -0
- package/dist/styles/base-oklch.d.ts +2 -0
- package/dist/styles/base.css +124 -0
- package/dist/styles/base.d.ts +2 -0
- package/dist/styles/brand-preset.d.ts +22 -0
- package/dist/styles/brand-preset.js +13 -0
- package/dist/styles/brand-theme-v4-oklch.css +2 -0
- package/dist/styles/brand-theme-v4-oklch.d.ts +2 -0
- package/dist/styles/brand-theme-v4.css +2 -0
- package/dist/styles/brand-theme-v4.d.ts +2 -0
- package/dist/styles/brand-tokens-oklch.css +6 -0
- package/dist/styles/brand-tokens-oklch.d.ts +2 -0
- package/dist/styles/brand-tokens.css +6 -0
- package/dist/styles/brand-tokens.d.ts +2 -0
- package/dist/styles/global-oklch.css +1329 -0
- package/dist/styles/global-oklch.d.ts +2 -0
- package/dist/styles/global.css +1329 -0
- package/dist/styles/global.d.ts +2 -0
- package/dist/styles/theme-v4-oklch.css +22 -0
- package/dist/styles/theme-v4-oklch.d.ts +2 -0
- package/dist/styles/theme-v4.css +22 -0
- package/dist/styles/theme-v4.d.ts +2 -0
- package/dist/styles/tokens-oklch.css +1204 -0
- package/dist/styles/tokens-oklch.d.ts +2 -0
- package/dist/styles/tokens.css +1204 -0
- package/dist/styles/tokens.d.ts +2 -0
- package/dist/tailwind-preset.cjs +155 -0
- package/dist/tailwind-preset.d.ts +112 -0
- package/dist/tailwind-preset.js +133 -0
- package/dist/theme-presets-BVWZ_TxX.d.ts +514 -0
- package/global-oklch.css +3 -0
- package/package.json +169 -4
- package/styles.css +3 -0
- package/tailwind-preset.ts +140 -0
- package/tokens.json +423 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,3325 @@
|
|
|
1
|
+
import * as gsap from 'gsap';
|
|
2
|
+
import { Surface } from './server.js';
|
|
3
|
+
export { SHAVIN_META, ShavinMcpTool, ShavinMeta, cardPaddingToScale, cn, concentricBoundaryResetStyle, concentricContainerStyle, concentricRadius, paddingScaleFromClassName, surfaceClass, withConcentricStyle } from './server.js';
|
|
4
|
+
import * as React$1 from 'react';
|
|
5
|
+
import React__default, { ReactNode, ComponentProps, ButtonHTMLAttributes, ReactElement, CSSProperties, ComponentPropsWithoutRef, InputHTMLAttributes, HTMLAttributes, TextareaHTMLAttributes, ElementType, AnchorHTMLAttributes, RefCallback, PointerEvent, KeyboardEvent, Ref, ImgHTMLAttributes, VideoHTMLAttributes, ComponentType, LiHTMLAttributes, TdHTMLAttributes, ThHTMLAttributes, MutableRefObject, SVGProps } from 'react';
|
|
6
|
+
import { B as BrandSolidMode, N as NeutralsMode, a as NeutralsAmount, C as ColorSpace } from './theme-presets-BVWZ_TxX.js';
|
|
7
|
+
export { b as BODY_FONTS, c as BRAND_PRESETS, d as BRAND_SOLID_CONTRAST, e as BRAND_SOLID_MAX_DL, f as BRAND_SOLID_MODES, g as BrandSolid, D as DISPLAY_FONTS, G as GRAY_PRESETS, h as GRAY_STEPS, O as Oklch, R as RADIUS_PRESETS, S as SCALING_PRESETS, T as THEME_PRESETS, i as ThemePreset, j as apcaContrast, k as applyBodyFontPreset, l as applyBrandColor, m as applyDisplayFontPreset, n as applyGrayColor, o as applyPanelBackground, p as applyRadiusPreset, q as applyScalingPreset, r as applySubheadingFont, s as applyThemePreset, t as brandForegroundFor, u as brandForegroundForOklch, v as brandHoverFor, w as brandHoverForOklch, x as brandSolidFor, y as brandSolidForOklch, z as brandTextFor, A as brandTextForOklch, E as getColorSpace, F as hexToOklch, H as hexToTriplet, I as loadGoogleFont, J as oklchBrandForMode, K as oklchForegroundFor, L as oklchHoverFor, M as oklchLuminance, P as oklchMix, Q as oklchSolidFor, U as oklchSolidHoverFor, V as oklchTextFor, W as oklchToCss, X as oklchToHex, Y as oklchToRgbTriplet, Z as parseGoogleFontEmbed, _ as perceptualAaFailures, $ as preloadGoogleFontsBundle, a0 as resolveBrand, a1 as resolveBrandTriplet, a2 as rgbTripletToOklch, a3 as scopedThemeVars, a4 as setBrandSolidMode, a5 as setColorSpace, a6 as tripletToHex } from './theme-presets-BVWZ_TxX.js';
|
|
8
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
9
|
+
import { VariantProps } from 'class-variance-authority';
|
|
10
|
+
import * as RadixDialog from '@radix-ui/react-dialog';
|
|
11
|
+
import * as RadixMenu from '@radix-ui/react-dropdown-menu';
|
|
12
|
+
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
|
13
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
14
|
+
import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
|
|
15
|
+
import * as RadixAccordion from '@radix-ui/react-accordion';
|
|
16
|
+
import * as RadixCheckbox from '@radix-ui/react-checkbox';
|
|
17
|
+
import * as RadixRadioGroup from '@radix-ui/react-radio-group';
|
|
18
|
+
import * as RadixSwitch from '@radix-ui/react-switch';
|
|
19
|
+
import { LucideIcon } from 'lucide-react';
|
|
20
|
+
import * as RadixSlider from '@radix-ui/react-slider';
|
|
21
|
+
import * as RadixToggleGroup from '@radix-ui/react-toggle-group';
|
|
22
|
+
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
23
|
+
import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio';
|
|
24
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
25
|
+
import 'clsx';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Capability flags for the motion engine backends. `gsap` is the power backend for scroll scrub/pin
|
|
29
|
+
* (and later timelines). Set `motionConfig.gsap = false` to disable it — the one-flag kill switch:
|
|
30
|
+
* scrub/pin become no-ops and GSAP is never loaded. GSAP is an OPTIONAL peer dependency; if it is not
|
|
31
|
+
* installed the loader fails gracefully and scrub/pin simply don't run.
|
|
32
|
+
*/
|
|
33
|
+
declare const motionConfig: MotionConfig;
|
|
34
|
+
/** What a GSAP loader resolves to. `ScrollTrigger` and `SplitText` are registered when present. */
|
|
35
|
+
interface GsapModules {
|
|
36
|
+
gsap: typeof gsap.gsap;
|
|
37
|
+
ScrollTrigger?: object;
|
|
38
|
+
SplitText?: object | null;
|
|
39
|
+
}
|
|
40
|
+
interface MotionConfig {
|
|
41
|
+
/** Kill switch: `false` disables scroll scrub/pin and GSAP is never loaded. */
|
|
42
|
+
gsap: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Supply GSAP yourself instead of letting the runtime import it: `motionConfig.loadGsap = async () =>
|
|
45
|
+
* ({ gsap: (await import("gsap")).gsap, ScrollTrigger: (await import("gsap/ScrollTrigger")).ScrollTrigger })`.
|
|
46
|
+
* Set it before the first scroll animation runs. Useful when your bundler inlines dynamic imports
|
|
47
|
+
* (esbuild without code splitting): mark `gsap` external there and the default loader fails quietly.
|
|
48
|
+
*/
|
|
49
|
+
loadGsap?: () => Promise<GsapModules>;
|
|
50
|
+
}
|
|
51
|
+
/** Idempotent boot. Safe to call repeatedly; re-scans for newly added motion elements. */
|
|
52
|
+
declare function initMotionRuntime(): void;
|
|
53
|
+
|
|
54
|
+
declare const PortalContainerProvider: React$1.Provider<HTMLElement | null>;
|
|
55
|
+
/** The element floating panels should mount in, or `undefined` for the default (`document.body`). */
|
|
56
|
+
declare function usePortalContainer(): HTMLElement | undefined;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Connection config for the local Agent-Browser bridge (the dev daemon that
|
|
60
|
+
* `<ShavinDevTools>` streams DOM snapshots to, and that `npx @shavin/cli bridge`
|
|
61
|
+
* starts).
|
|
62
|
+
*
|
|
63
|
+
* `@shavin/ui` ships standalone — it does not depend on `@shavin/mcp` — so the
|
|
64
|
+
* default port lives here as well as in the server's canonical constant
|
|
65
|
+
* (`packages/mcp-server/src/bridge/constants.mjs`). The two MUST stay equal;
|
|
66
|
+
* `npm run verify` checks it.
|
|
67
|
+
*
|
|
68
|
+
* A consumer who runs the bridge on a non-default port tells the browser by
|
|
69
|
+
* setting `NEXT_PUBLIC_SHAVIN_BRIDGE_PORT` (Next.js) or `VITE_SHAVIN_BRIDGE_PORT`
|
|
70
|
+
* (Vite), or by passing `bridgePort` to `<ThemeProvider>` / `<ShavinDevTools>`.
|
|
71
|
+
*/
|
|
72
|
+
declare const DEFAULT_BRIDGE_PORT = 7036;
|
|
73
|
+
declare const BRIDGE_HOST = "127.0.0.1";
|
|
74
|
+
/** Resolve the bridge port: explicit argument → build-time env → default. */
|
|
75
|
+
declare function resolveBridgePort(explicit?: number): number;
|
|
76
|
+
/** `http://127.0.0.1:<port>` — the origin the browser connects to. */
|
|
77
|
+
declare function bridgeOrigin(port?: number): string;
|
|
78
|
+
/** Build a bridge API URL, e.g. `bridgeUrl("/api/audit")`. */
|
|
79
|
+
declare function bridgeUrl(path: string, port?: number): string;
|
|
80
|
+
/** Human-facing dashboard URL (uses `localhost` for readability). */
|
|
81
|
+
declare function bridgeDashboardUrl(port?: number): string;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Screen-reader announcements through two persistent live regions (WCAG 4.1.3).
|
|
85
|
+
*
|
|
86
|
+
* A live region only speaks reliably when it exists BEFORE its text changes, so
|
|
87
|
+
* mounting `role="status"` together with its message (a new toast, a spinner) is
|
|
88
|
+
* often silent. These regions are created once, appended to <body>, and reused.
|
|
89
|
+
*
|
|
90
|
+
* announce("Saved"); // polite: waits for the user to pause
|
|
91
|
+
* announce("Upload failed", "assertive"); // interrupts: errors only
|
|
92
|
+
*/
|
|
93
|
+
type Politeness = "polite" | "assertive";
|
|
94
|
+
declare function announce(message: string, politeness?: Politeness): void;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Canonical overlay-preset style table — pure data, no JSX.
|
|
98
|
+
*
|
|
99
|
+
* Lives in its own .ts module so non-JSX consumers (notably
|
|
100
|
+
* parsers that fold serialized overlays
|
|
101
|
+
* back into bg* props) can import it via the `@shavin/ui/lib/*` subpath.
|
|
102
|
+
* `media-overlays.tsx` re-exports this — the public API is unchanged.
|
|
103
|
+
*/
|
|
104
|
+
declare const OVERLAY_PRESET_STYLES: Record<string, {
|
|
105
|
+
background?: string;
|
|
106
|
+
backgroundColor?: string;
|
|
107
|
+
}>;
|
|
108
|
+
/** Ordered preset keys — the canonical list for pickers and legacy `bgOverlay` shorthand. */
|
|
109
|
+
declare const OVERLAY_PRESET_KEYS: readonly string[];
|
|
110
|
+
/** Minimal layer shape for shorthand parse/serialize (no React dependency). */
|
|
111
|
+
interface ShorthandLayer {
|
|
112
|
+
id: string;
|
|
113
|
+
type: string;
|
|
114
|
+
presetKey?: string;
|
|
115
|
+
opacity?: number;
|
|
116
|
+
visible?: boolean;
|
|
117
|
+
color?: string;
|
|
118
|
+
token?: string;
|
|
119
|
+
angle?: number;
|
|
120
|
+
/** Radial centre, e.g. "20% 30%" (default "center"). */
|
|
121
|
+
position?: string;
|
|
122
|
+
/** Slow drift animation (mesh presets only, via "-animated" suffix). */
|
|
123
|
+
animated?: boolean;
|
|
124
|
+
stops?: Array<{
|
|
125
|
+
color: string;
|
|
126
|
+
offset: number;
|
|
127
|
+
opacity: number;
|
|
128
|
+
token?: string;
|
|
129
|
+
}>;
|
|
130
|
+
/** For type "fx": the registered Backdrop variant. */
|
|
131
|
+
fxKey?: string;
|
|
132
|
+
/** For type "fx": params handed to the Backdrop renderer. */
|
|
133
|
+
fxParams?: Record<string, string>;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Parse shorthand overlay syntax:
|
|
137
|
+
* "dark-30, scrim/90" — presets
|
|
138
|
+
* "#000/80, (brand)/30" — solid colors
|
|
139
|
+
* "linear(45deg, #000/0%, #000/100%)/80" — gradient
|
|
140
|
+
* "dark-20, radial(brand/0%, brand/100%)/60" — mixed
|
|
141
|
+
*
|
|
142
|
+
* Returns [] if any token is unparseable (caller falls back to JSON).
|
|
143
|
+
*/
|
|
144
|
+
declare function parseOverlayShorthand$1(raw: string): ShorthandLayer[];
|
|
145
|
+
/**
|
|
146
|
+
* Convert overlay layers back to shorthand syntax when possible.
|
|
147
|
+
*
|
|
148
|
+
* Returns a shorthand string if all layers can be expressed in shorthand.
|
|
149
|
+
* Returns null if any layer has features that require JSON (hidden layers,
|
|
150
|
+
* unknown types, fx keys or params it cannot print).
|
|
151
|
+
*/
|
|
152
|
+
declare function overlayLayersToShorthand$1(layers: ShorthandLayer[]): string | null;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Media overlays & background media — the single source of truth for the
|
|
156
|
+
* block "background media + overlay layers" prop contract:
|
|
157
|
+
* bgImage / bgVideo / bgSize / bgVideoPaused / bgOverlay / bgOverlays
|
|
158
|
+
*
|
|
159
|
+
* Shared by the Studio, Docs, and Community block registries via `@shavin/ui`
|
|
160
|
+
* (previously three hand-synced copies inside each app's registry — which had
|
|
161
|
+
* drifted: Docs' preset lookup was dead, Community still used the legacy
|
|
162
|
+
* class-based path).
|
|
163
|
+
*
|
|
164
|
+
* ⚠️ FILE_EXEMPT in scripts/lint-tokens.mjs (same status as theme-presets.ts):
|
|
165
|
+
* the preset table below is DATA, not styling — intentional pure black/white
|
|
166
|
+
* alpha scrims layered over background imagery. They must render identically
|
|
167
|
+
* in light and dark theme, so semantic theme tokens cannot represent them.
|
|
168
|
+
* Rendered overlay layers carry `data-overlay="true"` and are exempted by the
|
|
169
|
+
* live DOM audit (ShavinDevTools), mirroring how `data-swatch` exempts color
|
|
170
|
+
* swatches; code generators emit the same marker so `validate_code` skips
|
|
171
|
+
* those lines.
|
|
172
|
+
*/
|
|
173
|
+
|
|
174
|
+
declare const isVideoUrl: (url?: string) => boolean;
|
|
175
|
+
/** Ordered preset keys — legacy re-export lives at the top of this file. */
|
|
176
|
+
type OverlayLayer = {
|
|
177
|
+
id: string;
|
|
178
|
+
type: "solid" | "linear" | "radial" | "preset" | "fx";
|
|
179
|
+
color?: string;
|
|
180
|
+
token?: string;
|
|
181
|
+
opacity: number;
|
|
182
|
+
angle?: number;
|
|
183
|
+
position?: string;
|
|
184
|
+
animated?: boolean;
|
|
185
|
+
stops?: Array<{
|
|
186
|
+
color: string;
|
|
187
|
+
offset: number;
|
|
188
|
+
opacity: number;
|
|
189
|
+
token?: string;
|
|
190
|
+
}>;
|
|
191
|
+
presetKey?: string;
|
|
192
|
+
/** For type "fx": the registered Backdrop variant to render (e.g. "fluid-silk").
|
|
193
|
+
* Rendered via the Backdrop registry so @shavin/ui needs no @shavin/fx dependency —
|
|
194
|
+
* the host app registers fx backdrops with registerBackdrop(). */
|
|
195
|
+
fxKey?: string;
|
|
196
|
+
/** Optional per-fx params, passed to the backdrop renderer. */
|
|
197
|
+
fxParams?: Record<string, string>;
|
|
198
|
+
visible: boolean;
|
|
199
|
+
};
|
|
200
|
+
/**
|
|
201
|
+
* Background-media props accepted by every layout primitive (Flex, Grid,
|
|
202
|
+
* Section, Box, Container, Card). When any of these are set, the primitive
|
|
203
|
+
* renders a `renderBgMedia()` layer behind its children and wraps the
|
|
204
|
+
* children in a relative z-10 container so they sit above the media.
|
|
205
|
+
*
|
|
206
|
+
* This is the canonical single-source for the bg* contract — the Studio
|
|
207
|
+
* block registry, the code generator, and the parser all reference these
|
|
208
|
+
* field names. `foldBackgroundMedia()` in the parser is a compatibility
|
|
209
|
+
* shim for legacy hand-crafted `<video>`/`<div data-overlay>` children;
|
|
210
|
+
* new code should always use these props directly.
|
|
211
|
+
*/
|
|
212
|
+
interface BgMediaProps {
|
|
213
|
+
/** Background video URL (mp4, webm, etc.). Renders an autoPlay/loop/muted <video> element behind children. */
|
|
214
|
+
bgVideo?: string;
|
|
215
|
+
/** Background image URL. Renders an <img> with object-cover (default) or object-contain. */
|
|
216
|
+
bgImage?: string;
|
|
217
|
+
/** Background media fit: "cover" fills the container (default), "contain" fits within. */
|
|
218
|
+
bgSize?: "cover" | "contain";
|
|
219
|
+
/** Comma-separated shorthand for overlay layers. Supports presets ("dark-50"), solid colors (#hex or (token)), gradients (linear/radial), and fx backdrops ("fx:dither-waves(speed=1.2)" via the Backdrop registry). JSON array of OverlayLayer[] as fallback for advanced cases. Layers composite top-to-bottom. */
|
|
220
|
+
bgOverlays?: string;
|
|
221
|
+
/** When true, pauses the background video (renders a static poster frame instead of autoplay). */
|
|
222
|
+
bgVideoPaused?: string;
|
|
223
|
+
/** Poster image for bgVideo — shown while loading and as the static fallback under prefers-reduced-motion. */
|
|
224
|
+
bgPoster?: string;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Resolve bg* props into a media layer element and a children wrapper.
|
|
228
|
+
*
|
|
229
|
+
* When no bg* props are set, `hasMedia` is false and `content` is the identity
|
|
230
|
+
* function — the primitive renders children directly with zero overhead.
|
|
231
|
+
*
|
|
232
|
+
* When bg* props are present, `hasMedia` is true: `media` is the rendered
|
|
233
|
+
* background layer (absolute z-0) and `content` wraps children in a relative
|
|
234
|
+
* z-10 div carrying `contentClassName`. The primitive should strip its layout
|
|
235
|
+
* variant classes (flex/grid) from the parent and pass them as
|
|
236
|
+
* `contentClassName` so the wrapper — not the parent — is the sole layout
|
|
237
|
+
* context. The parent becomes a positioning shell (`relative overflow-hidden`)
|
|
238
|
+
* for the absolute media layer.
|
|
239
|
+
*
|
|
240
|
+
* Usage in a primitive:
|
|
241
|
+
* const { hasMedia, media, content } = bgMediaLayer(props, flexVariants({ ... }));
|
|
242
|
+
* return (
|
|
243
|
+
* <Tag className={cn(hasMedia ? "relative overflow-hidden" : flexVariants({ ... }), ...rest)}>
|
|
244
|
+
* {media}{content(children)}
|
|
245
|
+
* </Tag>
|
|
246
|
+
* );
|
|
247
|
+
*/
|
|
248
|
+
declare function bgMediaLayer<P extends BgMediaProps>(props: P, contentClassName?: string): {
|
|
249
|
+
hasMedia: boolean;
|
|
250
|
+
media: React$1.ReactNode;
|
|
251
|
+
content: (children: React$1.ReactNode) => React$1.ReactNode;
|
|
252
|
+
};
|
|
253
|
+
/**
|
|
254
|
+
* Readable text by default over background media.
|
|
255
|
+
*
|
|
256
|
+
* A layout with a photo, video or `fx:` backdrop and no explicit `surface` would otherwise keep the theme's
|
|
257
|
+
* text colour, which is unreadable on most media. When `surface` is not set, this returns `dark-always`
|
|
258
|
+
* (light text) and, unless the overlays already hold a dark enough scrim, appends one: `dark-30` for photos
|
|
259
|
+
* and video, `dark-50` for fx, which are brighter and busier. An explicit `surface` always wins and is never
|
|
260
|
+
* second-guessed, and a light tint (`light-*`) in the overlays means the author chose dark text, so nothing
|
|
261
|
+
* is changed. Meshes and custom gradients are left alone: their tone depends on the page theme, so the
|
|
262
|
+
* author picks the `surface` (validate_code flags a missing one).
|
|
263
|
+
*/
|
|
264
|
+
declare function resolveBgReadability<S extends string | undefined>(props: BgMediaProps & {
|
|
265
|
+
surface?: S;
|
|
266
|
+
}): {
|
|
267
|
+
surface: S | "dark-always" | undefined;
|
|
268
|
+
bgOverlays: string | undefined;
|
|
269
|
+
};
|
|
270
|
+
declare function hexToRgb(hex: string): {
|
|
271
|
+
r: number;
|
|
272
|
+
g: number;
|
|
273
|
+
b: number;
|
|
274
|
+
a: number;
|
|
275
|
+
};
|
|
276
|
+
declare function tokenNameToCssColor(token?: string, fallbackHex?: string, alpha?: number): string;
|
|
277
|
+
declare function tokenNameToCssVar(token?: string): string | null;
|
|
278
|
+
declare function getPresetThumbnailStyle(presetKey?: string): React$1.CSSProperties;
|
|
279
|
+
declare function getOverlayThumbnailStyle(layer: OverlayLayer): React$1.CSSProperties;
|
|
280
|
+
declare const parseOverlayShorthand: typeof parseOverlayShorthand$1;
|
|
281
|
+
declare const overlayLayersToShorthand: typeof overlayLayersToShorthand$1;
|
|
282
|
+
declare function parseOverlayLayers(props: Record<string, string>): OverlayLayer[];
|
|
283
|
+
declare function getOverlayLayerClass(layer: OverlayLayer): string;
|
|
284
|
+
declare function getOverlayLayerStyle(layer: OverlayLayer): React$1.CSSProperties | undefined;
|
|
285
|
+
/**
|
|
286
|
+
* Render background media (image/video) plus overlay layers for a block's
|
|
287
|
+
* bg* props. Overlay layers are marked `data-overlay="true"` — the live DOM
|
|
288
|
+
* audit exempts them (intentional scrims, see file header).
|
|
289
|
+
*/
|
|
290
|
+
declare const renderBgMedia: (props: Record<string, string>) => React$1.JSX.Element | null;
|
|
291
|
+
/**
|
|
292
|
+
* Render a list of overlay layers as absolutely-positioned nodes (z-[1]).
|
|
293
|
+
* Shared by `renderBgMedia` (layout backgrounds) and the `Image` primitive
|
|
294
|
+
* (overlays on top of the image) so both composite layers identically.
|
|
295
|
+
* An `fx` layer renders a registered Backdrop variant; the rest render CSS divs.
|
|
296
|
+
*/
|
|
297
|
+
declare function renderOverlayLayers(layers: OverlayLayer[]): React$1.ReactNode[];
|
|
298
|
+
/** Parse + render overlay layers from an `overlays`/`bgOverlays` string (for the Image primitive). */
|
|
299
|
+
declare function renderOverlays(overlays?: string): React$1.ReactNode[];
|
|
300
|
+
|
|
301
|
+
/** The theme a ThemeProvider resolved from its props (preset values filled in). Published on `window.__SHAVIN_THEME_CONFIG__` and in the `shavin-theme-init` event. */
|
|
302
|
+
interface ShavinThemeConfig {
|
|
303
|
+
theme?: string;
|
|
304
|
+
brand?: string;
|
|
305
|
+
gray?: string;
|
|
306
|
+
radius?: string;
|
|
307
|
+
scaling?: number;
|
|
308
|
+
translucentPanels: boolean;
|
|
309
|
+
displayFont?: string;
|
|
310
|
+
bodyFont?: string;
|
|
311
|
+
/** How solid brand fills are chosen (see ThemeProviderProps.brandSolid). */
|
|
312
|
+
brandSolid: BrandSolidMode;
|
|
313
|
+
}
|
|
314
|
+
interface ThemeProviderProps {
|
|
315
|
+
/** A named THEME_PRESETS preset (e.g. "Editorial") — applies its whole config. Individual props below override it. */
|
|
316
|
+
theme?: string;
|
|
317
|
+
/** Appearance when nothing is stored yet. Defaults to "system" (follows the OS setting). */
|
|
318
|
+
defaultTheme?: "light" | "dark" | "system";
|
|
319
|
+
/** One of the Configurator's 24 named brand colours (e.g. "Monochrome"), or a literal "#rrggbb". */
|
|
320
|
+
brandColor?: string;
|
|
321
|
+
/** "Zinc" | "Slate" | "Gray" | "Neutral" | "Stone" */
|
|
322
|
+
grayColor?: string;
|
|
323
|
+
/** Radius preset: "none" | "small" | "medium" | "large" | "full". */
|
|
324
|
+
radius?: "none" | "small" | "medium" | "large" | "full";
|
|
325
|
+
/** Scaling percentage preset: 90 | 95 | 100 | 105 | 110 | "90%" | "95%" | "100%" | "105%" | "110%". */
|
|
326
|
+
scaling?: 90 | 95 | 100 | 105 | 110 | "90%" | "95%" | "100%" | "105%" | "110%";
|
|
327
|
+
/** Panel background translucent vs solid mode: "solid" | "translucent". */
|
|
328
|
+
panelBackground?: "solid" | "translucent";
|
|
329
|
+
/** Display font preset family string. */
|
|
330
|
+
displayFont?: string;
|
|
331
|
+
/** Body font preset family string. */
|
|
332
|
+
bodyFont?: string;
|
|
333
|
+
/**
|
|
334
|
+
* Focus ring weight for the whole page: "subtle" (default: 1px ring, 2px offset), "default" (2px,
|
|
335
|
+
* the pre-0.1.0 ring) or "strong" (3px). Colour is always --focus (brand text colour, >=3:1 on page
|
|
336
|
+
* fills). Sets data-focus-ring on <html>; tune --focus-width / --focus-offset in CSS for anything else.
|
|
337
|
+
*/
|
|
338
|
+
focusRing?: "subtle" | "default" | "strong";
|
|
339
|
+
/** Font for h3-h6 headings: "body" (default), "display" (follow the display font), or a font family name. */
|
|
340
|
+
subheadingFont?: string;
|
|
341
|
+
/**
|
|
342
|
+
* How the fill under text on the brand (solid Button, Badge, selected states) is chosen. Written to
|
|
343
|
+
* `--brand-solid`, `--brand-solid-hover` and `--brand-fg`.
|
|
344
|
+
* - "accessible" (default): the brand's hue with lightness lowered just far enough that white text
|
|
345
|
+
* clears 4.6:1 (WCAG 2 AA with headroom); a genuinely light brand (lime, mint, sky, amber) keeps
|
|
346
|
+
* its exact fill and takes dark text.
|
|
347
|
+
* - "exact": the exact brand fill, text white or ink by WCAG 2 contrast (the behaviour before this prop).
|
|
348
|
+
* - "perceptual": the exact brand fill, text white wherever APCA prefers it. Does NOT meet WCAG 2 AA on
|
|
349
|
+
* every brand colour; a development-only console warning says which. Inherited by ScopedThemeProvider.
|
|
350
|
+
*/
|
|
351
|
+
brandSolid?: BrandSolidMode;
|
|
352
|
+
/**
|
|
353
|
+
* Hue of the grey scale. "neutral" (default) keeps the plain grey. "brand" is opt-in: it tints backgrounds,
|
|
354
|
+
* borders and text greys toward the brand colour at very low chroma, with the same lightness as the plain
|
|
355
|
+
* greys so every contrast pair holds, and wins over a gray preset. Grey and monochrome brands never tint.
|
|
356
|
+
*/
|
|
357
|
+
neutrals?: NeutralsMode;
|
|
358
|
+
/** How much of the brand hue shows in tinted greys: "subtle" (default) or "medium". */
|
|
359
|
+
neutralsAmount?: NeutralsAmount;
|
|
360
|
+
/**
|
|
361
|
+
* Color space for runtime token values. "rgb" (default) outputs bare RGB triplets
|
|
362
|
+
* for Tailwind v3 + v4-rgb paths. "oklch" outputs oklch() CSS strings for the
|
|
363
|
+
* Tailwind v4 OKLCH path (global-oklch.css + theme-v4-oklch.css).
|
|
364
|
+
* Set to "oklch" when your project imports @shavin/ui/global-oklch.css.
|
|
365
|
+
*/
|
|
366
|
+
colorSpace?: ColorSpace;
|
|
367
|
+
/** When true, preloads the complete curated Google Fonts bundle (all 30 families) on mount so every font is available for instant preview in the DevTools inspector. Recommended for dev/playground only — end users should add only the fonts they use. */
|
|
368
|
+
preloadFonts?: boolean;
|
|
369
|
+
/** Whether to render the Shavin Dev Inspector in development. Defaults to true in dev. */
|
|
370
|
+
devTools?: boolean;
|
|
371
|
+
/** Port the local Agent-Browser bridge listens on. Defaults to the env override, then the built-in default. Pass this when running `npx @shavin/cli bridge --port <n>`. */
|
|
372
|
+
bridgePort?: number;
|
|
373
|
+
/**
|
|
374
|
+
* Target size policy (docs: "Target size"). "comfortable" (default): primary controls grow to 44px under a
|
|
375
|
+
* coarse pointer (touch). "compact": they do not grow; every control still keeps its 24px WCAG 2.5.8 floor.
|
|
376
|
+
* Sets `data-touch-targets` on <html>; tune the sizes with the `--tap-min` and `--tap-min-touch` CSS variables.
|
|
377
|
+
*/
|
|
378
|
+
touchTargets?: "comfortable" | "compact";
|
|
379
|
+
children?: ReactNode;
|
|
380
|
+
}
|
|
381
|
+
declare function ThemeProvider({ theme, defaultTheme, brandColor, grayColor, radius, scaling, panelBackground, displayFont, bodyFont, subheadingFont, focusRing, brandSolid, neutrals, neutralsAmount, colorSpace, preloadFonts, devTools, bridgePort, touchTargets, children, }: ThemeProviderProps): React$1.JSX.Element;
|
|
382
|
+
|
|
383
|
+
interface ScopedThemeProviderProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
384
|
+
/** A named THEME_PRESETS preset (e.g. "Editorial") */
|
|
385
|
+
theme?: string;
|
|
386
|
+
/** Explicit appearance mode: "dark" | "light" | "inherit". Defaults to "inherit". */
|
|
387
|
+
appearance?: "dark" | "light" | "inherit";
|
|
388
|
+
/** One of the 24 named brand colours (e.g. "Monochrome") or raw hex "#rrggbb". */
|
|
389
|
+
brandColor?: string;
|
|
390
|
+
/** Gray family: "Zinc" | "Slate" | "Gray" | "Neutral" | "Stone" | "Mauve" | "Sage". */
|
|
391
|
+
grayColor?: string;
|
|
392
|
+
/** Radius preset: "none" | "small" | "medium" | "large" | "full". */
|
|
393
|
+
radius?: "none" | "small" | "medium" | "large" | "full";
|
|
394
|
+
/** Scaling percentage preset: 90 | 95 | 100 | 105 | 110 | "90%" | "95%" | "100%" | "105%" | "110%". */
|
|
395
|
+
scaling?: 90 | 95 | 100 | 105 | 110 | "90%" | "95%" | "100%" | "105%" | "110%";
|
|
396
|
+
/** Display font family string. */
|
|
397
|
+
displayFont?: string;
|
|
398
|
+
/** Body font family string. */
|
|
399
|
+
bodyFont?: string;
|
|
400
|
+
/** Panel background: "solid" | "translucent". */
|
|
401
|
+
panelBackground?: "solid" | "translucent";
|
|
402
|
+
/** Focus ring weight inside this subtree: "subtle" | "default" | "strong". Unset inherits the parent (ThemeProvider or an outer ScopedThemeProvider). */
|
|
403
|
+
focusRing?: "subtle" | "default" | "strong";
|
|
404
|
+
/** Color space: "rgb" | "oklch". Defaults to "rgb". */
|
|
405
|
+
colorSpace?: ColorSpace;
|
|
406
|
+
/**
|
|
407
|
+
* Target size policy for this subtree: "comfortable" grows primary controls to 44px under a coarse pointer,
|
|
408
|
+
* "compact" does not (the 24px WCAG 2.5.8 floor stays). Sets `data-touch-targets` on the container.
|
|
409
|
+
*
|
|
410
|
+
* **Unset means inherit, not "comfortable".** Without this prop the island writes no attribute and keeps the
|
|
411
|
+
* policy of its nearest parent: a compact `ThemeProvider` keeps an unset island compact, and the root default
|
|
412
|
+
* is comfortable only when nothing above says otherwise. Pass `"comfortable"` explicitly to override a compact
|
|
413
|
+
* parent. Content portaled out of the container (menus, popovers, dialogs) follows `<html>`, not this value.
|
|
414
|
+
*/
|
|
415
|
+
touchTargets?: "comfortable" | "compact";
|
|
416
|
+
/** How solid brand fills are chosen in this scope: "accessible" | "exact" | "perceptual". Unset inherits the ThemeProvider above (default "accessible"). */
|
|
417
|
+
brandSolid?: BrandSolidMode;
|
|
418
|
+
/** Custom class name applied to the container. */
|
|
419
|
+
className?: string;
|
|
420
|
+
/** Custom inline styles merged with scoped CSS variables. */
|
|
421
|
+
style?: React__default.CSSProperties;
|
|
422
|
+
/** Child elements. */
|
|
423
|
+
children?: ReactNode;
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* ScopedThemeProvider — First-class local subtree theme isolator.
|
|
427
|
+
*
|
|
428
|
+
* Defines an isolated theme boundary for embedded sandboxes, card previews,
|
|
429
|
+
* multi-brand islands, or canvas frames without mutating the global :root application theme.
|
|
430
|
+
*/
|
|
431
|
+
declare function ScopedThemeProvider({ theme, appearance, brandColor, grayColor, radius, scaling, displayFont, bodyFont, panelBackground, focusRing, colorSpace, touchTargets, brandSolid, className, style, children, ...rest }: ScopedThemeProviderProps): React__default.JSX.Element;
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* Per-component override for the target-size policy (docs: "Target size").
|
|
435
|
+
*
|
|
436
|
+
* - `"default"` (or unset): the component's own policy (primary controls: 24px floor, 44px under a coarse
|
|
437
|
+
* pointer, unless the provider is `touchTargets="compact"`).
|
|
438
|
+
* - `"none"`: no invisible hit area and no growth, at any pointer. For dense tables and toolbars. The control
|
|
439
|
+
* can then be smaller than the 24px WCAG 2.5.8 floor: that is the consumer's responsibility.
|
|
440
|
+
* - `"touch"`: always grow to 44px under a coarse pointer, even when the provider is compact.
|
|
441
|
+
*/
|
|
442
|
+
type HitArea = "none" | "default" | "touch";
|
|
443
|
+
|
|
444
|
+
type ThemeMode = "light" | "dark" | "system";
|
|
445
|
+
interface UseThemeOptions {
|
|
446
|
+
storageKey?: string;
|
|
447
|
+
defaultTheme?: ThemeMode;
|
|
448
|
+
}
|
|
449
|
+
declare function useTheme(options?: UseThemeOptions): {
|
|
450
|
+
theme: ThemeMode;
|
|
451
|
+
resolvedTheme: "dark" | "light";
|
|
452
|
+
systemTheme: "dark" | "light";
|
|
453
|
+
setTheme: (newTheme: ThemeMode) => void;
|
|
454
|
+
toggleTheme: () => void;
|
|
455
|
+
mounted: boolean;
|
|
456
|
+
};
|
|
457
|
+
interface ThemeScriptProps {
|
|
458
|
+
storageKey?: string;
|
|
459
|
+
defaultTheme?: ThemeMode;
|
|
460
|
+
/** Adds the translucent-panels class before first paint (the provider's panelBackground). */
|
|
461
|
+
translucentPanels?: boolean;
|
|
462
|
+
/** Sets data-focus-ring on <html> before first paint (the provider's focusRing). */
|
|
463
|
+
focusRing?: "subtle" | "default" | "strong";
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* Hydration script to inject in <head> or at root of page to prevent flash of unstyled theme (FOUC).
|
|
467
|
+
*/
|
|
468
|
+
declare function ThemeScript({ storageKey, defaultTheme, translucentPanels, focusRing, }: ThemeScriptProps): React__default.JSX.Element;
|
|
469
|
+
declare const themeSwitcherVariants: (props?: ({
|
|
470
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
471
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
472
|
+
interface ThemeSwitcherProps extends React__default.HTMLAttributes<HTMLDivElement>, VariantProps<typeof themeSwitcherVariants> {
|
|
473
|
+
variant?: "icon-button" | "segmented" | "menu" | "switch";
|
|
474
|
+
storageKey?: string;
|
|
475
|
+
defaultTheme?: ThemeMode;
|
|
476
|
+
showLabels?: boolean;
|
|
477
|
+
labels?: {
|
|
478
|
+
light?: string;
|
|
479
|
+
dark?: string;
|
|
480
|
+
system?: string;
|
|
481
|
+
};
|
|
482
|
+
/**
|
|
483
|
+
* Hit-area override (docs: "Target size"). "default": 24px floor, 44px on touch. "none": no hit area
|
|
484
|
+
* growth (dense toolbars; may go below 24px, yours to own). "touch": always 44px on a coarse pointer.
|
|
485
|
+
*/
|
|
486
|
+
hitArea?: HitArea;
|
|
487
|
+
}
|
|
488
|
+
declare const ThemeSwitcher: React__default.ForwardRefExoticComponent<ThemeSwitcherProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
489
|
+
|
|
490
|
+
declare const modalPanelVariants: (props?: ({
|
|
491
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
492
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
493
|
+
declare const panelVariants: (props?: ({
|
|
494
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
495
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
496
|
+
interface DialogProps extends VariantProps<typeof panelVariants> {
|
|
497
|
+
/** Heading shown at the top of the dialog (also its accessible name). */
|
|
498
|
+
title: ReactNode;
|
|
499
|
+
/** Supporting line under the title (also its accessible description). */
|
|
500
|
+
description?: ReactNode;
|
|
501
|
+
/** Controlled open state. Pair with `onOpenChange`. */
|
|
502
|
+
open?: boolean;
|
|
503
|
+
/** Initial open state when uncontrolled. Default: closed when `trigger` is set, otherwise open. */
|
|
504
|
+
defaultOpen?: boolean;
|
|
505
|
+
/** Called whenever the dialog asks to open or close (trigger, Escape, backdrop, close button). */
|
|
506
|
+
onOpenChange?: (open: boolean) => void;
|
|
507
|
+
/** Element that opens the dialog, e.g. `<Button>Edit profile</Button>`. */
|
|
508
|
+
trigger?: ReactNode;
|
|
509
|
+
/** Called after the close animation finishes. Use it to unmount a dialog you render conditionally. */
|
|
510
|
+
onClose?: () => void;
|
|
511
|
+
/** Dialog body. */
|
|
512
|
+
children?: ReactNode;
|
|
513
|
+
/** Footer actions, right-aligned. Wrap a button in `<DialogClose asChild>` to close from it. */
|
|
514
|
+
footer?: ReactNode;
|
|
515
|
+
/** Whether clicking the backdrop closes the dialog. Default true. */
|
|
516
|
+
dismissible?: boolean;
|
|
517
|
+
/**
|
|
518
|
+
* Header treatment. `default`: left-aligned title row with a close button. `centered`: centred title and
|
|
519
|
+
* description, no header row (for confirmations, success and invite moments). `bare`: no header row; the title
|
|
520
|
+
* and description sit above the content with no chrome (for forms and pickers that lead with their content).
|
|
521
|
+
*/
|
|
522
|
+
layout?: "default" | "centered" | "bare";
|
|
523
|
+
/** Hairlines between header, body and footer. Default: on for `default`, off for `centered` and `bare`. */
|
|
524
|
+
divided?: boolean;
|
|
525
|
+
/** Footer button alignment. `stretch` makes buttons share the row (good on mobile). Default `end`. */
|
|
526
|
+
footerAlign?: "start" | "center" | "end" | "between" | "stretch";
|
|
527
|
+
}
|
|
528
|
+
declare function Dialog({ title, description, open: openProp, defaultOpen, onOpenChange, trigger, onClose, children, footer, size, dismissible, layout, divided, footerAlign, }: DialogProps): React$1.JSX.Element;
|
|
529
|
+
/** Closes the surrounding Dialog. Use `asChild` to make a footer button close it. */
|
|
530
|
+
declare const DialogClose: React$1.ForwardRefExoticComponent<RadixDialog.DialogCloseProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
531
|
+
declare function CloseButton({ onClose, className, }: {
|
|
532
|
+
onClose: () => void;
|
|
533
|
+
className?: string;
|
|
534
|
+
}): React$1.JSX.Element;
|
|
535
|
+
|
|
536
|
+
interface SpotlightProps {
|
|
537
|
+
/** Whether the spotlight dialog is open. */
|
|
538
|
+
open: boolean;
|
|
539
|
+
/** Callback fired when open state changes (e.g. via Escape key or backdrop click). */
|
|
540
|
+
onOpenChange: (open: boolean) => void;
|
|
541
|
+
/** Search query value. */
|
|
542
|
+
query: string;
|
|
543
|
+
/** Callback fired when search query changes. */
|
|
544
|
+
onQueryChange: (query: string) => void;
|
|
545
|
+
/** Callback fired on keyboard input (e.g. ArrowUp, ArrowDown, Enter navigation). */
|
|
546
|
+
onKeyDown?: (e: React__default.KeyboardEvent<HTMLInputElement>) => void;
|
|
547
|
+
/** Input placeholder text. */
|
|
548
|
+
placeholder?: string;
|
|
549
|
+
/** Accessible name of the dialog and its search field. Default "Search". */
|
|
550
|
+
title?: string;
|
|
551
|
+
/**
|
|
552
|
+
* id of the highlighted result. When set, the field becomes an ARIA combobox and the
|
|
553
|
+
* results area a listbox: give each result `role="option"`, an `id` and `aria-selected`.
|
|
554
|
+
*/
|
|
555
|
+
activeOptionId?: string;
|
|
556
|
+
/** Number of results, announced to screen readers as it changes. */
|
|
557
|
+
resultCount?: number;
|
|
558
|
+
/** Content rendered below input (e.g. search suggestions, grouped items). */
|
|
559
|
+
children?: ReactNode;
|
|
560
|
+
/** Optional custom footer bar (defaults to standard keyboard shortcut hints). */
|
|
561
|
+
footer?: ReactNode;
|
|
562
|
+
/** Additional container className overrides. */
|
|
563
|
+
className?: string;
|
|
564
|
+
}
|
|
565
|
+
declare function Spotlight({ open, onOpenChange, query, onQueryChange, onKeyDown, placeholder, title, activeOptionId, resultCount, children, footer, className, }: SpotlightProps): React__default.JSX.Element;
|
|
566
|
+
|
|
567
|
+
interface AlertDialogProps {
|
|
568
|
+
/** Whether alert dialog is open. */
|
|
569
|
+
open: boolean;
|
|
570
|
+
/** Callback fired when open state changes. */
|
|
571
|
+
onOpenChange: (open: boolean) => void;
|
|
572
|
+
/** Title of the alert dialog. */
|
|
573
|
+
title: string;
|
|
574
|
+
/** Optional body description element. */
|
|
575
|
+
description?: ReactNode;
|
|
576
|
+
/** Confirm action button label. Default 'Confirm'. */
|
|
577
|
+
confirmLabel?: string;
|
|
578
|
+
/** Cancel action button label. Default 'Cancel'. */
|
|
579
|
+
cancelLabel?: string;
|
|
580
|
+
/** Callback fired when user clicks confirm button. */
|
|
581
|
+
onConfirm: () => void;
|
|
582
|
+
/** Styles confirm action as danger. Deprecated: use intent='danger'. */
|
|
583
|
+
danger?: boolean;
|
|
584
|
+
/** Visual intent/tone: info, warning, success, danger, default. */
|
|
585
|
+
intent?: "info" | "warning" | "success" | "danger" | "default";
|
|
586
|
+
/** Layout alignment: default (left-aligned) or centered. */
|
|
587
|
+
layout?: "default" | "centered";
|
|
588
|
+
/** Optional badge text below title. */
|
|
589
|
+
badgeText?: string;
|
|
590
|
+
/** Optional custom icon element override. */
|
|
591
|
+
icon?: ReactNode;
|
|
592
|
+
/** Children element slot. */
|
|
593
|
+
children?: ReactNode;
|
|
594
|
+
}
|
|
595
|
+
declare function AlertDialog({ open, onOpenChange, title, description, confirmLabel, cancelLabel, onConfirm, danger, intent, layout, badgeText, icon, children, }: AlertDialogProps): React__default.JSX.Element;
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* Drawer — edge-mounted overlay panel built on Radix Dialog.
|
|
599
|
+
*
|
|
600
|
+
* Slides in from `side="left"` or `side="right"` with directional
|
|
601
|
+
* slide-in/slide-out animations. Unlike `Sidebar` (which is an in-flow
|
|
602
|
+
* layout primitive), the Drawer overlays content with a backdrop and
|
|
603
|
+
* dismisses on outside click / Escape. Use it for temporary contextual
|
|
604
|
+
* panels: filters, inspectors, quick settings, mobile navigation.
|
|
605
|
+
*
|
|
606
|
+
* Variants (presentation only):
|
|
607
|
+
* - "floating": inset card with margin, rounded corners, shadow (default)
|
|
608
|
+
* - "fixed": flush against the screen edge, full-height panel
|
|
609
|
+
*/
|
|
610
|
+
declare const drawerPanelVariants: (props?: ({
|
|
611
|
+
side?: "left" | "right" | null | undefined;
|
|
612
|
+
variant?: "fixed" | "floating" | null | undefined;
|
|
613
|
+
size?: "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
614
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
615
|
+
interface DrawerProps extends VariantProps<typeof drawerPanelVariants> {
|
|
616
|
+
/** Controlled open state. Leave it out for an uncontrolled drawer (see `trigger` and `defaultOpen`). */
|
|
617
|
+
open?: boolean;
|
|
618
|
+
/** Initial open state when uncontrolled. Default: closed when `trigger` is set, otherwise open. */
|
|
619
|
+
defaultOpen?: boolean;
|
|
620
|
+
/** Element that opens the drawer, e.g. `<IconButton aria-label="Open menu">…</IconButton>`. Makes the drawer work without state, so it can be used in blocks. */
|
|
621
|
+
trigger?: ReactNode;
|
|
622
|
+
/** Called whenever the drawer asks to open or close (trigger, Escape, backdrop, close button). */
|
|
623
|
+
onOpenChange?: (open: boolean) => void;
|
|
624
|
+
/** Callback fired when drawer requests to close (Escape, backdrop click, close button). Required when controlled; optional otherwise. */
|
|
625
|
+
onClose?: () => void;
|
|
626
|
+
/** Drawer header title (string or custom content like a logo). */
|
|
627
|
+
title: ReactNode;
|
|
628
|
+
/** Optional subtitle line below title. */
|
|
629
|
+
subtitle?: string;
|
|
630
|
+
/** Edge the drawer slides in from. Default "right". */
|
|
631
|
+
side?: "left" | "right";
|
|
632
|
+
/** Presentation variant. "floating" = inset card (default), "fixed" = flush edge. */
|
|
633
|
+
variant?: "fixed" | "floating";
|
|
634
|
+
/** Panel max-width. sm (384px), md (448px), lg (512px), xl (672px). Default "md". */
|
|
635
|
+
size?: "sm" | "md" | "lg" | "xl";
|
|
636
|
+
/** Whether clicking the backdrop closes the drawer. Default true. */
|
|
637
|
+
dismissible?: boolean;
|
|
638
|
+
/** Backdrop opacity intensity 0–1. Default uses the theme's --overlay-opacity token. */
|
|
639
|
+
overlayOpacity?: number;
|
|
640
|
+
/** Drawer body content. */
|
|
641
|
+
children?: ReactNode;
|
|
642
|
+
/** Footer slot rendered at the bottom (e.g. action buttons). */
|
|
643
|
+
footer?: ReactNode;
|
|
644
|
+
/** Additional className overrides for the panel. */
|
|
645
|
+
className?: string;
|
|
646
|
+
/** Additional className overrides for the header container. */
|
|
647
|
+
headerClassName?: string;
|
|
648
|
+
/** Whether to use modal mode (focus trap + pointer event blocking). Default true. Set false to allow nested popovers/menus. */
|
|
649
|
+
modal?: boolean;
|
|
650
|
+
}
|
|
651
|
+
declare function Drawer({ open: controlledOpen, defaultOpen, trigger, onOpenChange, onClose, title, subtitle, side, variant, size, dismissible, overlayOpacity, children, footer, className, headerClassName, modal, }: DrawerProps): React$1.JSX.Element;
|
|
652
|
+
|
|
653
|
+
interface MenuProps {
|
|
654
|
+
/** Trigger element slot. */
|
|
655
|
+
trigger: ReactNode;
|
|
656
|
+
/** Menu content items. */
|
|
657
|
+
children: ReactNode;
|
|
658
|
+
/** Content alignment (start or end). Default start. */
|
|
659
|
+
align?: "start" | "end";
|
|
660
|
+
/** Called when the menu opens or closes (e.g. keep a hover-only trigger visible while open). */
|
|
661
|
+
onOpenChange?: (open: boolean) => void;
|
|
662
|
+
}
|
|
663
|
+
declare function Menu({ trigger, children, align, onOpenChange, }: MenuProps): React$1.JSX.Element;
|
|
664
|
+
declare const MenuTrigger: React$1.ForwardRefExoticComponent<ButtonHTMLAttributes<HTMLButtonElement> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
665
|
+
declare const menuItemVariants: (props?: ({
|
|
666
|
+
variant?: "default" | "danger" | null | undefined;
|
|
667
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
668
|
+
declare function MenuItem({ className, variant, ...props }: ComponentProps<typeof RadixMenu.Item> & VariantProps<typeof menuItemVariants>): React$1.JSX.Element;
|
|
669
|
+
declare function MenuSub({ children, ...props }: RadixMenu.DropdownMenuSubProps): React$1.JSX.Element;
|
|
670
|
+
declare const MenuSubTrigger: React$1.ForwardRefExoticComponent<RadixMenu.DropdownMenuSubTriggerProps & {
|
|
671
|
+
className?: string;
|
|
672
|
+
children: ReactNode;
|
|
673
|
+
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
674
|
+
declare const MenuSubContent: React$1.ForwardRefExoticComponent<RadixMenu.DropdownMenuSubContentProps & {
|
|
675
|
+
className?: string;
|
|
676
|
+
children: ReactNode;
|
|
677
|
+
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
678
|
+
|
|
679
|
+
interface ContextMenuProps {
|
|
680
|
+
/** Target trigger element — right-clicking anywhere inside opens context menu. */
|
|
681
|
+
trigger: ReactNode;
|
|
682
|
+
/** Context menu content items. */
|
|
683
|
+
children: ReactNode;
|
|
684
|
+
/** Optional custom class for ContextMenu content panel. */
|
|
685
|
+
className?: string;
|
|
686
|
+
}
|
|
687
|
+
declare function ContextMenu({ trigger, children, className, }: ContextMenuProps): React$1.JSX.Element;
|
|
688
|
+
declare const contextMenuItemVariants: (props?: ({
|
|
689
|
+
variant?: "default" | "danger" | null | undefined;
|
|
690
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
691
|
+
declare function ContextMenuItem({ className, variant, ...props }: ComponentProps<typeof ContextMenuPrimitive.Item> & VariantProps<typeof contextMenuItemVariants>): React$1.JSX.Element;
|
|
692
|
+
|
|
693
|
+
declare const Popover: React$1.FC<PopoverPrimitive.PopoverProps>;
|
|
694
|
+
declare const PopoverTrigger: React$1.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
695
|
+
declare const PopoverAnchor: React$1.ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
696
|
+
declare function PopoverContent({ className, children, align, sideOffset, avoidCollisions, collisionPadding, ...props }: ComponentProps<typeof PopoverPrimitive.Content>): React$1.JSX.Element;
|
|
697
|
+
|
|
698
|
+
declare const HoverCard: React$1.FC<HoverCardPrimitive.HoverCardProps>;
|
|
699
|
+
declare const HoverCardTrigger: React$1.ForwardRefExoticComponent<HoverCardPrimitive.HoverCardTriggerProps & React$1.RefAttributes<HTMLAnchorElement>>;
|
|
700
|
+
interface HoverCardContentProps extends ComponentProps<typeof HoverCardPrimitive.Content> {
|
|
701
|
+
}
|
|
702
|
+
declare function HoverCardContent({ className, children, align, sideOffset, avoidCollisions, collisionPadding, ...props }: HoverCardContentProps): React$1.JSX.Element;
|
|
703
|
+
|
|
704
|
+
interface TooltipProps {
|
|
705
|
+
/** Tooltip popover label content. */
|
|
706
|
+
content: ReactNode;
|
|
707
|
+
/** Trigger element (must support forwardRef). */
|
|
708
|
+
children: ReactElement;
|
|
709
|
+
/** Placement side (top, right, bottom, left). Default top. */
|
|
710
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
711
|
+
/** Open delay duration in milliseconds. Default 300. */
|
|
712
|
+
delayDuration?: number;
|
|
713
|
+
/** Color tone: auto (theme default), dark, or light. Default auto. */
|
|
714
|
+
tone?: "auto" | "dark" | "light";
|
|
715
|
+
/** Optional custom CSS class name. */
|
|
716
|
+
className?: string;
|
|
717
|
+
/** Controlled open state (optional). */
|
|
718
|
+
open?: boolean;
|
|
719
|
+
/** Called when the tooltip wants to open or close (hover, focus, Escape, outside press). */
|
|
720
|
+
onOpenChange?: (open: boolean) => void;
|
|
721
|
+
}
|
|
722
|
+
declare function Tooltip({ content, children, side, delayDuration, tone, className, open, onOpenChange, }: TooltipProps): React$1.JSX.Element;
|
|
723
|
+
|
|
724
|
+
interface ScrollAreaProps {
|
|
725
|
+
/** ScrollArea body content. */
|
|
726
|
+
children: ReactNode;
|
|
727
|
+
/** Names the scrollable region for screen readers. */
|
|
728
|
+
"aria-label"?: string;
|
|
729
|
+
/** Custom outer container class name (e.g. h-64 or max-h-96). */
|
|
730
|
+
className?: string;
|
|
731
|
+
style?: CSSProperties;
|
|
732
|
+
}
|
|
733
|
+
declare function ScrollArea({ children, className, style, "aria-label": ariaLabel, }: ScrollAreaProps): React$1.JSX.Element;
|
|
734
|
+
|
|
735
|
+
declare const accordionVariants: (props?: ({
|
|
736
|
+
variant?: "outline" | "default" | "ghost" | null | undefined;
|
|
737
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
738
|
+
type AccordionProps = ComponentPropsWithoutRef<typeof RadixAccordion.Root> & VariantProps<typeof accordionVariants>;
|
|
739
|
+
declare const Accordion: React__default.ForwardRefExoticComponent<AccordionProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
740
|
+
declare const AccordionItem: React__default.ForwardRefExoticComponent<Omit<RadixAccordion.AccordionItemProps & React__default.RefAttributes<HTMLDivElement>, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
|
|
741
|
+
declare const AccordionTrigger: React__default.ForwardRefExoticComponent<Omit<RadixAccordion.AccordionTriggerProps & React__default.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
742
|
+
/** Heading level of the trigger's header, to fit the page outline. Default 3. */
|
|
743
|
+
headingLevel?: 2 | 3 | 4 | 5 | 6;
|
|
744
|
+
} & React__default.RefAttributes<HTMLButtonElement>>;
|
|
745
|
+
declare const AccordionContent: React__default.ForwardRefExoticComponent<Omit<RadixAccordion.AccordionContentProps & React__default.RefAttributes<HTMLDivElement>, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
|
|
746
|
+
|
|
747
|
+
interface Option {
|
|
748
|
+
value: string;
|
|
749
|
+
label: string;
|
|
750
|
+
prefix?: React.ReactNode;
|
|
751
|
+
/** Muted text after the label in the open list only (e.g. a size "1440×1024"). The closed trigger shows just the label. */
|
|
752
|
+
hint?: string;
|
|
753
|
+
}
|
|
754
|
+
interface OptionGroup {
|
|
755
|
+
group: string;
|
|
756
|
+
options: Option[];
|
|
757
|
+
}
|
|
758
|
+
interface SelectProps {
|
|
759
|
+
/** Active selected option value (controlled). Omit and use `defaultValue` for uncontrolled. */
|
|
760
|
+
value?: string;
|
|
761
|
+
/** Initial selected value when uncontrolled. */
|
|
762
|
+
defaultValue?: string;
|
|
763
|
+
/** Flat options list or grouped option list. */
|
|
764
|
+
options: (Option | OptionGroup)[];
|
|
765
|
+
/** Callback fired when user selects an option. */
|
|
766
|
+
onChange?: (v: string) => void;
|
|
767
|
+
/** Alias of `onChange` (Radix naming). */
|
|
768
|
+
onValueChange?: (v: string) => void;
|
|
769
|
+
/** Optional callback fired when an item is hovered/focused for live preview. Passed null on mouseleave/close. */
|
|
770
|
+
onItemHighlight?: (v: string | null) => void;
|
|
771
|
+
/** Accessible ARIA label string. */
|
|
772
|
+
ariaLabel?: string;
|
|
773
|
+
/** Placeholder text when value is unselected. */
|
|
774
|
+
placeholder?: string;
|
|
775
|
+
/** Optional custom CSS class name for the trigger. */
|
|
776
|
+
className?: string;
|
|
777
|
+
/** Optional custom CSS class name for the portaled dropdown content. */
|
|
778
|
+
contentClassName?: string;
|
|
779
|
+
/** Optional custom inline style for the portaled dropdown content. */
|
|
780
|
+
contentStyle?: React.CSSProperties;
|
|
781
|
+
/** Select trigger size. Heights match Button, TextField and Combobox: sm 32px, md 40px, lg 48px. */
|
|
782
|
+
size?: "sm" | "md" | "lg";
|
|
783
|
+
/**
|
|
784
|
+
* outline (default): a 3:1 control border (WCAG 1.4.11). soft: filled and borderless, for
|
|
785
|
+
* dense tool panels; the value and the chevron identify it. Both show the 2px focus ring.
|
|
786
|
+
*/
|
|
787
|
+
variant?: "outline" | "soft";
|
|
788
|
+
/**
|
|
789
|
+
* Hit-area override (docs: "Target size"). "default": 24px floor, 44px on touch. "none": no hit area
|
|
790
|
+
* growth (dense toolbars; may go below 24px, yours to own). "touch": always 44px on a coarse pointer.
|
|
791
|
+
*/
|
|
792
|
+
hitArea?: HitArea;
|
|
793
|
+
/** Whether the control is disabled. */
|
|
794
|
+
disabled?: boolean;
|
|
795
|
+
/** id of the trigger, so a `<label htmlFor>` can name it. */
|
|
796
|
+
id?: string;
|
|
797
|
+
/** Form field name; submits the value through Radix's hidden native select. */
|
|
798
|
+
name?: string;
|
|
799
|
+
/** Marks the field required for forms and assistive tech. */
|
|
800
|
+
required?: boolean;
|
|
801
|
+
"aria-label"?: string;
|
|
802
|
+
"aria-labelledby"?: string;
|
|
803
|
+
/** id(s) of hint or error text describing the field. */
|
|
804
|
+
"aria-describedby"?: string;
|
|
805
|
+
"aria-invalid"?: boolean;
|
|
806
|
+
}
|
|
807
|
+
declare function Select({ value: controlledValue, defaultValue, options, onChange, onValueChange, onItemHighlight, ariaLabel, placeholder, className, contentClassName, contentStyle, size, variant, hitArea, disabled, id, name, required, "aria-label": ariaLabelAttr, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, }: SelectProps): React$1.JSX.Element;
|
|
808
|
+
|
|
809
|
+
declare const triggerVariants: (props?: ({
|
|
810
|
+
size?: "sm" | "md" | null | undefined;
|
|
811
|
+
appearance?: "default" | "ghost" | null | undefined;
|
|
812
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
813
|
+
interface DropdownOption {
|
|
814
|
+
value: string;
|
|
815
|
+
label: string;
|
|
816
|
+
}
|
|
817
|
+
interface DropdownProps extends VariantProps<typeof triggerVariants> {
|
|
818
|
+
/** Active selected option value string (controlled). Omit and use `defaultValue` for uncontrolled. */
|
|
819
|
+
value?: string;
|
|
820
|
+
/** Initial selected value when uncontrolled. */
|
|
821
|
+
defaultValue?: string;
|
|
822
|
+
/** Callback fired when selected option value changes. */
|
|
823
|
+
onChange?: (v: string) => void;
|
|
824
|
+
/** Alias of `onChange`. */
|
|
825
|
+
onValueChange?: (v: string) => void;
|
|
826
|
+
/** List of dropdown options ({ value, label }). */
|
|
827
|
+
options: DropdownOption[];
|
|
828
|
+
/** Whether control is disabled. */
|
|
829
|
+
disabled?: boolean;
|
|
830
|
+
/** Rendering variant: native (<select>) or default (custom popup). Default 'default'. */
|
|
831
|
+
variant?: "native" | "default";
|
|
832
|
+
/** Popup placement relative to trigger: 'bottom' or 'top'. Default 'bottom'. */
|
|
833
|
+
placement?: "bottom" | "top";
|
|
834
|
+
/** Popup horizontal alignment relative to trigger: 'start' (left) or 'end' (right). Default 'start'. */
|
|
835
|
+
align?: "start" | "end";
|
|
836
|
+
/** Accessible ARIA label. */
|
|
837
|
+
ariaLabel?: string;
|
|
838
|
+
/** Optional custom CSS class name. */
|
|
839
|
+
className?: string;
|
|
840
|
+
/** id of the control, so a `<label htmlFor>` can name it. */
|
|
841
|
+
id?: string;
|
|
842
|
+
/** Form field name. */
|
|
843
|
+
name?: string;
|
|
844
|
+
/** Marks the field required. */
|
|
845
|
+
required?: boolean;
|
|
846
|
+
"aria-labelledby"?: string;
|
|
847
|
+
/** id(s) of hint or error text describing the field. */
|
|
848
|
+
"aria-describedby"?: string;
|
|
849
|
+
/**
|
|
850
|
+
* Hit-area override (docs: "Target size"). "default": 24px floor, 44px on touch. "none": no hit area
|
|
851
|
+
* growth (dense toolbars; may go below 24px, yours to own). "touch": always 44px on a coarse pointer.
|
|
852
|
+
*/
|
|
853
|
+
hitArea?: HitArea;
|
|
854
|
+
}
|
|
855
|
+
declare function Dropdown({ value: controlledValue, defaultValue, onChange, onValueChange, options, disabled, size, appearance, hitArea, variant, placement, align, ariaLabel, className, id, name, required, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, }: DropdownProps): React$1.JSX.Element;
|
|
856
|
+
|
|
857
|
+
interface DatePickerTokens {
|
|
858
|
+
brand: string;
|
|
859
|
+
brandFg: string;
|
|
860
|
+
brandSolid: string;
|
|
861
|
+
field: string;
|
|
862
|
+
elevated: string;
|
|
863
|
+
border: string;
|
|
864
|
+
hover: string;
|
|
865
|
+
fg: string;
|
|
866
|
+
fgMuted: string;
|
|
867
|
+
fgSubtle: string;
|
|
868
|
+
radius: string;
|
|
869
|
+
popupRadius: string;
|
|
870
|
+
cellRadius: string;
|
|
871
|
+
font: string;
|
|
872
|
+
}
|
|
873
|
+
interface DatePickerProps {
|
|
874
|
+
/** Active selected Date object. */
|
|
875
|
+
value: Date;
|
|
876
|
+
/** Callback fired when Date changes. */
|
|
877
|
+
onChange: (d: Date) => void;
|
|
878
|
+
/** Hide time selection controls and close on day pick. Default false. */
|
|
879
|
+
dateOnly?: boolean;
|
|
880
|
+
/** Override any visual token; unspecified keys fall back to the theme. */
|
|
881
|
+
tokens?: Partial<DatePickerTokens>;
|
|
882
|
+
/** Optional custom CSS class name. */
|
|
883
|
+
className?: string;
|
|
884
|
+
/** id of the text field, so a `<label htmlFor>` can name it. */
|
|
885
|
+
id?: string;
|
|
886
|
+
/** Locale for the field text and day names. Defaults to the browser's locale. */
|
|
887
|
+
locale?: string;
|
|
888
|
+
/** Accessible name of the text field when there is no visible label. Default "Date". */
|
|
889
|
+
"aria-label"?: string;
|
|
890
|
+
"aria-labelledby"?: string;
|
|
891
|
+
/** id(s) of hint or error text describing the field. */
|
|
892
|
+
"aria-describedby"?: string;
|
|
893
|
+
/** Marks the field invalid (FormField passes it with an error). The field also sets it for an unparseable date. */
|
|
894
|
+
"aria-invalid"?: boolean | "true" | "false";
|
|
895
|
+
/** Marks the field required (FormField passes it). */
|
|
896
|
+
"aria-required"?: boolean | "true" | "false";
|
|
897
|
+
}
|
|
898
|
+
declare function DatePicker({ value, onChange, dateOnly, tokens, className, id, locale, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, }: DatePickerProps): React$1.JSX.Element;
|
|
899
|
+
|
|
900
|
+
interface TimePickerProps {
|
|
901
|
+
/** Currently selected Date object. */
|
|
902
|
+
value: Date;
|
|
903
|
+
/** Callback fired when selected time changes. */
|
|
904
|
+
onChange: (d: Date) => void;
|
|
905
|
+
/** Screen reader label for accessibility. */
|
|
906
|
+
ariaLabel?: string;
|
|
907
|
+
/** Minutes between each option in select dropdown — 15, 30, 60, etc. Default 30. */
|
|
908
|
+
intervalMinutes?: number;
|
|
909
|
+
/** id of the group, so FormField can point at it. */
|
|
910
|
+
id?: string;
|
|
911
|
+
/** id of a visible label (FormField passes its label); replaces ariaLabel. */
|
|
912
|
+
"aria-labelledby"?: string;
|
|
913
|
+
/** id(s) of hint or error text describing the time. */
|
|
914
|
+
"aria-describedby"?: string;
|
|
915
|
+
/** Marks the time invalid (FormField passes it with an error). */
|
|
916
|
+
"aria-invalid"?: boolean | "true" | "false";
|
|
917
|
+
/** Marks the time required. */
|
|
918
|
+
"aria-required"?: boolean | "true" | "false";
|
|
919
|
+
}
|
|
920
|
+
declare function TimePicker({ value, onChange, ariaLabel, intervalMinutes, id, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, }: TimePickerProps): React__default.JSX.Element;
|
|
921
|
+
interface TimeVariantProps {
|
|
922
|
+
value: Date;
|
|
923
|
+
onChange: (d: Date) => void;
|
|
924
|
+
ariaLabel?: string;
|
|
925
|
+
/** id of the group, so FormField can point at it (TimePickerInput). */
|
|
926
|
+
id?: string;
|
|
927
|
+
/** id of a visible label; replaces ariaLabel (TimePickerInput). */
|
|
928
|
+
"aria-labelledby"?: string;
|
|
929
|
+
/** id(s) of hint or error text (TimePickerInput). */
|
|
930
|
+
"aria-describedby"?: string;
|
|
931
|
+
/** Marks both fields invalid (TimePickerInput). */
|
|
932
|
+
"aria-invalid"?: boolean | "true" | "false";
|
|
933
|
+
/** Marks both fields required (TimePickerInput). */
|
|
934
|
+
"aria-required"?: boolean | "true" | "false";
|
|
935
|
+
}
|
|
936
|
+
declare function TimePickerInput({ value, onChange, ariaLabel, id, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, }: TimeVariantProps): React__default.JSX.Element;
|
|
937
|
+
declare function TimePickerClock({ value, onChange, ariaLabel }: TimeVariantProps): React__default.JSX.Element;
|
|
938
|
+
|
|
939
|
+
declare const colorPickerVariants: (props?: ({
|
|
940
|
+
size?: "sm" | "md" | "lg" | "full" | null | undefined;
|
|
941
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
942
|
+
interface ColorPickerSwatch {
|
|
943
|
+
name: string;
|
|
944
|
+
hex: string;
|
|
945
|
+
}
|
|
946
|
+
interface ColorPickerProps extends Omit<React__default.HTMLAttributes<HTMLDivElement>, "onChange">, VariantProps<typeof colorPickerVariants> {
|
|
947
|
+
/** The currently selected hex color string (e.g. "#46a758"). */
|
|
948
|
+
value: string;
|
|
949
|
+
/** Callback fired when the color changes. */
|
|
950
|
+
onChange: (hex: string) => void;
|
|
951
|
+
/** Visual variant: "popover" (default triggerable popover), "canvas" (inline 2D canvas), "swatches" (preset swatches grid), or "field" (compact input). */
|
|
952
|
+
variant?: "popover" | "canvas" | "swatches" | "field" | "default";
|
|
953
|
+
/** Optional custom trigger element when using popover mode. */
|
|
954
|
+
trigger?: React__default.ReactNode;
|
|
955
|
+
/** Preset swatch spectrum. Defaults to Shavin UI's 24 brand swatches. */
|
|
956
|
+
presets?: ColorPickerSwatch[];
|
|
957
|
+
/** Layout of preset swatches: multi-row grid or single-row horizontal scroll bar. Default "grid". */
|
|
958
|
+
swatchLayout?: "grid" | "scroll";
|
|
959
|
+
/** Maximum number of swatches to render from presets list. */
|
|
960
|
+
maxSwatches?: number;
|
|
961
|
+
/** Format mode for custom color input: "hex" or "rgb". Default "hex". */
|
|
962
|
+
colorMode?: "hex" | "rgb";
|
|
963
|
+
/** Custom label text or element for the custom color input section. Default "Custom". */
|
|
964
|
+
customLabel?: React__default.ReactNode;
|
|
965
|
+
/** Custom CSS class names to style the custom mode label text/font/size/color. */
|
|
966
|
+
customLabelClassName?: string;
|
|
967
|
+
/** Whether to display the custom eyedropper pipette and text input. Default true. */
|
|
968
|
+
allowCustom?: boolean;
|
|
969
|
+
}
|
|
970
|
+
/**
|
|
971
|
+
* 2D Canvas Color Picker Panel with Saturation/Value matrix, Rainbow hue slider,
|
|
972
|
+
* Eyedropper, preview swatch, and right-end up-down arrow switcher (HEX / RGB).
|
|
973
|
+
*/
|
|
974
|
+
declare function CanvasColorPickerPopup({ value, onChange, className, }: {
|
|
975
|
+
value: string;
|
|
976
|
+
onChange: (hex: string) => void;
|
|
977
|
+
className?: string;
|
|
978
|
+
}): React__default.JSX.Element;
|
|
979
|
+
/**
|
|
980
|
+
* Triggerable Popover Color Picker wrapper.
|
|
981
|
+
*/
|
|
982
|
+
declare function ColorPickerPopover({ value, onChange, trigger, align, sideOffset, }: {
|
|
983
|
+
value: string;
|
|
984
|
+
onChange: (hex: string) => void;
|
|
985
|
+
trigger?: React__default.ReactNode;
|
|
986
|
+
align?: "start" | "center" | "end";
|
|
987
|
+
sideOffset?: number;
|
|
988
|
+
}): React__default.JSX.Element;
|
|
989
|
+
declare function ColorPicker({ value, onChange, variant, trigger, presets, swatchLayout, maxSwatches, colorMode, customLabel, customLabelClassName, allowCustom, size, className, ...props }: ColorPickerProps): React__default.JSX.Element;
|
|
990
|
+
|
|
991
|
+
declare const textFieldVariants: (props?: ({
|
|
992
|
+
variant?: "outline" | "soft" | null | undefined;
|
|
993
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
994
|
+
invalid?: boolean | null | undefined;
|
|
995
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
996
|
+
interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size">, VariantProps<typeof textFieldVariants> {
|
|
997
|
+
/** Icon rendered inside the field, pinned to the left edge. */
|
|
998
|
+
leadingIcon?: ReactNode;
|
|
999
|
+
/** Icon rendered inside the field, pinned to the right edge. */
|
|
1000
|
+
trailingIcon?: ReactNode;
|
|
1001
|
+
/** Optional label text rendered above the field. */
|
|
1002
|
+
label?: string;
|
|
1003
|
+
/** Optional hint/helper text rendered below the field. */
|
|
1004
|
+
hint?: string;
|
|
1005
|
+
/** Number of digits/slots when type="otp". Default 6. */
|
|
1006
|
+
length?: number | string;
|
|
1007
|
+
/** Whether to mask digits with bullet dots (for PIN / password OTP codes) or mask password text. Default false. */
|
|
1008
|
+
mask?: boolean;
|
|
1009
|
+
/** OTP only: separator element or character rendered midway (e.g. '-' or index=3 for 3-3 split). */
|
|
1010
|
+
separator?: ReactNode;
|
|
1011
|
+
/** OTP only: index position to render the separator (defaults to Math.floor(length / 2)). */
|
|
1012
|
+
separatorIndex?: number;
|
|
1013
|
+
/** Callback fired when all OTP digits have been entered. */
|
|
1014
|
+
onComplete?: (code: string) => void;
|
|
1015
|
+
/** Optional custom CSS class name applied directly to individual OTP slot boxes. */
|
|
1016
|
+
slotClassName?: string;
|
|
1017
|
+
/** Password-only: render the built-in show/hide (Eye/EyeOff) trailing button. Ignored for other types. */
|
|
1018
|
+
showHidePassword?: boolean;
|
|
1019
|
+
/** Error message text — when set, the field renders in invalid/error state and shows this message below the input. */
|
|
1020
|
+
errorMessage?: string;
|
|
1021
|
+
/**
|
|
1022
|
+
* Announce `errorMessage` (polite) once when it first appears, for blur and change validation.
|
|
1023
|
+
* Default true. Set false while a form moves focus to its FormErrorSummary after a failed submit
|
|
1024
|
+
* (FormErrorSummary also silences it automatically for that render).
|
|
1025
|
+
*/
|
|
1026
|
+
announceError?: boolean;
|
|
1027
|
+
/**
|
|
1028
|
+
* Hit-area override (docs: "Target size"). "default": 24px floor, 44px on touch. "none": no hit area
|
|
1029
|
+
* growth (dense toolbars; may go below 24px, yours to own). "touch": always 44px on a coarse pointer.
|
|
1030
|
+
* The field itself grows (native input); the password toggle gets a hit area.
|
|
1031
|
+
*/
|
|
1032
|
+
hitArea?: HitArea;
|
|
1033
|
+
}
|
|
1034
|
+
declare const TextField: React$1.ForwardRefExoticComponent<TextFieldProps & React$1.RefAttributes<HTMLInputElement>>;
|
|
1035
|
+
|
|
1036
|
+
declare const formFieldVariants: (props?: ({
|
|
1037
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
1038
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1039
|
+
interface FormFieldProps extends Omit<HTMLAttributes<HTMLDivElement>, "children">, VariantProps<typeof formFieldVariants> {
|
|
1040
|
+
/** Visible label. Omit it for a single Checkbox or Switch that has its own `label`. Never use a placeholder as the label. */
|
|
1041
|
+
label?: string;
|
|
1042
|
+
/** Helper text below the control. Give the reason here when the field is disabled. */
|
|
1043
|
+
hint?: string;
|
|
1044
|
+
/** Error message: marks the control invalid (aria-invalid), replaces the hint, icon + text. */
|
|
1045
|
+
error?: string;
|
|
1046
|
+
/** `success` shows a check icon and the hint in the success colour ("Email verified"). Use sparingly. */
|
|
1047
|
+
status?: "default" | "success";
|
|
1048
|
+
/**
|
|
1049
|
+
* Default true (false for a single Checkbox or Switch, where required means "must be on").
|
|
1050
|
+
* Optional fields (false) show "Optional" after the label; required ones get no asterisk.
|
|
1051
|
+
*/
|
|
1052
|
+
required?: boolean;
|
|
1053
|
+
/** Passes `disabled` to the control (and the fieldset for a group). Say why in `hint`. */
|
|
1054
|
+
disabled?: boolean;
|
|
1055
|
+
/** Only for TextArea (and TextField): focusable, selectable, submitted; shows a lock icon by the label. */
|
|
1056
|
+
readOnly?: boolean;
|
|
1057
|
+
/** Announce `error` (polite) once when it first appears. Default true. */
|
|
1058
|
+
announceError?: boolean;
|
|
1059
|
+
/** One size for every field in a row; passed to Select and Combobox, ignored by the others. */
|
|
1060
|
+
size?: "sm" | "md" | "lg";
|
|
1061
|
+
/** id for the control (default generated). Links the label and the FormErrorSummary item. */
|
|
1062
|
+
id?: string;
|
|
1063
|
+
/** Exactly one Shavin control: TextArea, Select, Combobox, DatePicker, TimePicker, Checkbox, Switch, RadioGroup or CheckboxGroup. */
|
|
1064
|
+
children: ReactElement;
|
|
1065
|
+
}
|
|
1066
|
+
/**
|
|
1067
|
+
* FormField — label, hint and error for any Shavin control (TextField has its own; use it alone).
|
|
1068
|
+
* Creates the ids, renders `<label htmlFor>` (or `<fieldset><legend>` for RadioGroup and
|
|
1069
|
+
* CheckboxGroup) and injects `id`, `aria-describedby`, `aria-invalid`, `aria-required`,
|
|
1070
|
+
* `required`, `disabled` and `readOnly` into its single child with `cloneElement`.
|
|
1071
|
+
*/
|
|
1072
|
+
declare function FormField({ label, hint, error, status, required: requiredProp, disabled, readOnly, announceError, size, orientation, id: customId, className, children, ...props }: FormFieldProps): React$1.JSX.Element;
|
|
1073
|
+
|
|
1074
|
+
declare const textAreaVariants: (props?: ({
|
|
1075
|
+
variant?: "outline" | "soft" | null | undefined;
|
|
1076
|
+
invalid?: boolean | null | undefined;
|
|
1077
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1078
|
+
interface TextAreaProps extends TextareaHTMLAttributes<HTMLTextAreaElement>, VariantProps<typeof textAreaVariants> {
|
|
1079
|
+
}
|
|
1080
|
+
declare const TextArea: React$1.ForwardRefExoticComponent<TextAreaProps & React$1.RefAttributes<HTMLTextAreaElement>>;
|
|
1081
|
+
|
|
1082
|
+
declare const checkboxVariants: (props?: ({
|
|
1083
|
+
size?: "sm" | "md" | null | undefined;
|
|
1084
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1085
|
+
interface CheckboxProps extends ComponentPropsWithoutRef<typeof RadixCheckbox.Root>, VariantProps<typeof checkboxVariants> {
|
|
1086
|
+
/** Optional label text placed adjacent to checkbox. */
|
|
1087
|
+
label?: string;
|
|
1088
|
+
/**
|
|
1089
|
+
* Hit-area override (docs: "Target size"). "default": 24px floor, 44px on touch. "none": no hit area
|
|
1090
|
+
* growth (dense toolbars; may go below 24px, yours to own). "touch": always 44px on a coarse pointer.
|
|
1091
|
+
*/
|
|
1092
|
+
hitArea?: HitArea;
|
|
1093
|
+
}
|
|
1094
|
+
declare const Checkbox: React$1.ForwardRefExoticComponent<CheckboxProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
1095
|
+
|
|
1096
|
+
interface CheckboxGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
1097
|
+
/** Visible group label; names the group for screen readers (WCAG 1.3.1). Or pass `aria-label`. */
|
|
1098
|
+
label?: ReactNode;
|
|
1099
|
+
/** Vertical list of CheckboxGroupItem children. */
|
|
1100
|
+
children: ReactNode;
|
|
1101
|
+
/** Custom wrapper class name. */
|
|
1102
|
+
className?: string;
|
|
1103
|
+
}
|
|
1104
|
+
declare function CheckboxGroup({ children, className, label, ...props }: CheckboxGroupProps): React$1.JSX.Element;
|
|
1105
|
+
interface CheckboxGroupItemProps {
|
|
1106
|
+
/** Whether item is checked. */
|
|
1107
|
+
checked: boolean;
|
|
1108
|
+
/** Callback fired when checked state changes. */
|
|
1109
|
+
onCheckedChange: (checked: boolean) => void;
|
|
1110
|
+
/** Item label text. */
|
|
1111
|
+
label: string;
|
|
1112
|
+
/** Disabled state. */
|
|
1113
|
+
disabled?: boolean;
|
|
1114
|
+
}
|
|
1115
|
+
declare function CheckboxGroupItem({ checked, onCheckedChange, label, disabled, }: CheckboxGroupItemProps): React$1.JSX.Element;
|
|
1116
|
+
|
|
1117
|
+
interface CheckboxCardsProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
1118
|
+
/** Visible group label; names the group for screen readers (WCAG 1.3.1). Or pass `aria-label`. */
|
|
1119
|
+
label?: ReactNode;
|
|
1120
|
+
/** Checkbox card items grid wrapper. */
|
|
1121
|
+
children: ReactNode;
|
|
1122
|
+
/** Custom CSS grid layout class name. */
|
|
1123
|
+
className?: string;
|
|
1124
|
+
}
|
|
1125
|
+
declare function CheckboxCards({ children, className, label, ...props }: CheckboxCardsProps): React$1.JSX.Element;
|
|
1126
|
+
interface CheckboxCardsItemProps {
|
|
1127
|
+
/** Whether card option is checked. */
|
|
1128
|
+
checked: boolean;
|
|
1129
|
+
/** Callback fired when checked state changes. */
|
|
1130
|
+
onCheckedChange: (checked: boolean) => void;
|
|
1131
|
+
/** Content rendered inside card body. */
|
|
1132
|
+
children: ReactNode;
|
|
1133
|
+
/** Disabled state. */
|
|
1134
|
+
disabled?: boolean;
|
|
1135
|
+
/** Inline style override. */
|
|
1136
|
+
style?: CSSProperties;
|
|
1137
|
+
}
|
|
1138
|
+
declare function CheckboxCardsItem({ checked, onCheckedChange, children, disabled, style, }: CheckboxCardsItemProps): React$1.JSX.Element;
|
|
1139
|
+
|
|
1140
|
+
type RadiusPreset = "none" | "small" | "medium" | "large" | "full" | "inherit" | "concentric";
|
|
1141
|
+
interface RadioGroupProps extends ComponentPropsWithoutRef<typeof RadixRadioGroup.Root> {
|
|
1142
|
+
/** Visual variant: default radio buttons or cards layout. Default "default". */
|
|
1143
|
+
variant?: "default" | "cards";
|
|
1144
|
+
/** Radius style for radio items or card containers. Default "inherit". */
|
|
1145
|
+
radius?: RadiusPreset;
|
|
1146
|
+
/**
|
|
1147
|
+
* Hit-area override (docs: "Target size"). "default": 24px floor, 44px on touch. "none": no hit area
|
|
1148
|
+
* growth (dense toolbars; may go below 24px, yours to own). "touch": always 44px on a coarse pointer.
|
|
1149
|
+
*/
|
|
1150
|
+
hitArea?: HitArea;
|
|
1151
|
+
}
|
|
1152
|
+
declare function RadioGroup({ variant, radius, hitArea, disabled, className, children, ...props }: RadioGroupProps): React__default.JSX.Element;
|
|
1153
|
+
interface RadioProps {
|
|
1154
|
+
/** Option value string. */
|
|
1155
|
+
value: string;
|
|
1156
|
+
/** Primary option label text. */
|
|
1157
|
+
label?: string;
|
|
1158
|
+
/** Optional secondary description text for card layout. */
|
|
1159
|
+
description?: string;
|
|
1160
|
+
/** Disabled state. */
|
|
1161
|
+
disabled?: boolean;
|
|
1162
|
+
/** Radius override for this specific item. */
|
|
1163
|
+
radius?: RadiusPreset;
|
|
1164
|
+
/** Variant override for this specific item. */
|
|
1165
|
+
variant?: "default" | "cards";
|
|
1166
|
+
/** Hit-area override for this item; defaults to the group's. See RadioGroup. */
|
|
1167
|
+
hitArea?: HitArea;
|
|
1168
|
+
/** Custom wrapper class name. */
|
|
1169
|
+
className?: string;
|
|
1170
|
+
/** Custom children element to render inside card or label. */
|
|
1171
|
+
children?: ReactNode;
|
|
1172
|
+
/** Accessible name when there is no visible `label` (e.g. the row text names it visually). */
|
|
1173
|
+
"aria-label"?: string;
|
|
1174
|
+
}
|
|
1175
|
+
declare function Radio({ value, label, description, disabled: itemDisabled, radius: itemRadius, variant: itemVariant, hitArea: itemHitArea, className, children, "aria-label": ariaLabel, }: RadioProps): React__default.JSX.Element;
|
|
1176
|
+
|
|
1177
|
+
declare const trackVariants: (props?: ({
|
|
1178
|
+
size?: "sm" | "md" | null | undefined;
|
|
1179
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1180
|
+
interface SwitchProps extends ComponentPropsWithoutRef<typeof RadixSwitch.Root>, VariantProps<typeof trackVariants> {
|
|
1181
|
+
/** Visible label; wraps the switch in a <label> so it names it and is clickable. */
|
|
1182
|
+
label?: string;
|
|
1183
|
+
/**
|
|
1184
|
+
* Hit-area override (docs: "Target size"). "default": 24px floor, 44px on touch. "none": no hit area
|
|
1185
|
+
* growth (dense toolbars; may go below 24px, yours to own). "touch": always 44px on a coarse pointer.
|
|
1186
|
+
*/
|
|
1187
|
+
hitArea?: HitArea;
|
|
1188
|
+
}
|
|
1189
|
+
declare const Switch: React$1.ForwardRefExoticComponent<SwitchProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
1190
|
+
|
|
1191
|
+
declare const iconVariants: (props?: ({
|
|
1192
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | null | undefined;
|
|
1193
|
+
color?: "default" | "inherit" | "brand" | "danger" | "success" | "warning" | "muted" | "subtle" | "contrast" | null | undefined;
|
|
1194
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1195
|
+
type IconSizeToken = "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
|
|
1196
|
+
type IconColorToken = "default" | "subtle" | "muted" | "brand" | "contrast" | "success" | "warning" | "danger" | "inherit";
|
|
1197
|
+
interface IconProps extends Omit<React__default.SVGAttributes<SVGSVGElement>, "color" | "size"> {
|
|
1198
|
+
/** Name of the icon in Lucide / Shavin icon set (e.g. "Sparkles", "Search", "arrow-right"). */
|
|
1199
|
+
name?: string;
|
|
1200
|
+
/** Direct icon component or custom React node to render. */
|
|
1201
|
+
icon?: LucideIcon | React__default.ElementType | React__default.ReactNode;
|
|
1202
|
+
/** Size token (xs, sm, md, lg, xl, 2xl, 3xl) or custom numeric pixel value (16-256) or CSS size string. */
|
|
1203
|
+
size?: IconSizeToken | number | string;
|
|
1204
|
+
/** Semantic color token or custom hex/CSS color string. Defaults to "inherit" (currentColor), so an icon always takes the colour of its parent (buttons, tabs, chips, filled brand surfaces). */
|
|
1205
|
+
color?: IconColorToken | (string & {});
|
|
1206
|
+
/** Stroke width for vector lines (from 0.5 to 3.0 in 0.25 steps, default 2). */
|
|
1207
|
+
strokeWidth?: number;
|
|
1208
|
+
/** Whether stroke width remains absolute regardless of scaling. */
|
|
1209
|
+
absoluteStrokeWidth?: boolean;
|
|
1210
|
+
/** Custom pixel or CSS size override if not using size prop. */
|
|
1211
|
+
customSize?: number | string;
|
|
1212
|
+
/** Optional title for accessibility hover tooltip. */
|
|
1213
|
+
title?: string;
|
|
1214
|
+
/** Accessible ARIA label. */
|
|
1215
|
+
"aria-label"?: string;
|
|
1216
|
+
className?: string;
|
|
1217
|
+
}
|
|
1218
|
+
/**
|
|
1219
|
+
* Load icons ahead of rendering. Streaming server rendering (Next.js, renderToReadableStream,
|
|
1220
|
+
* prerender) waits for icons on its own; synchronous renderers (renderToString,
|
|
1221
|
+
* renderToStaticMarkup, tests that assert right after render) need the icons loaded first.
|
|
1222
|
+
* With no names, loads every Lucide and Phosphor icon, which suits Node scripts.
|
|
1223
|
+
*/
|
|
1224
|
+
declare function preloadIcons(names?: string[]): Promise<void>;
|
|
1225
|
+
declare const Icon: React__default.ForwardRefExoticComponent<IconProps & React__default.RefAttributes<SVGSVGElement>>;
|
|
1226
|
+
|
|
1227
|
+
interface IconPickerProps {
|
|
1228
|
+
/** Active selected icon name key. */
|
|
1229
|
+
value: string;
|
|
1230
|
+
/** Callback fired when an icon is picked. */
|
|
1231
|
+
onChange: (v: string) => void;
|
|
1232
|
+
/** Optional custom trigger element. If provided, replaces the default trigger button. */
|
|
1233
|
+
children?: React__default.ReactNode;
|
|
1234
|
+
/** Visual variant of default trigger: 'default' (full input-like trigger) or 'icon' (compact square button). */
|
|
1235
|
+
variant?: "default" | "icon";
|
|
1236
|
+
/** Size of the trigger button. Default "md". */
|
|
1237
|
+
size?: "sm" | "md" | "lg";
|
|
1238
|
+
/** Whether to show a 'None' (Ø) option at start of grid. Default false. */
|
|
1239
|
+
allowNone?: boolean;
|
|
1240
|
+
/** Enabled icon libraries to show filter tabs for (e.g. ['phosphor', 'lucide', 'radix']). */
|
|
1241
|
+
libraries?: string[];
|
|
1242
|
+
/** Custom wrapper class name. */
|
|
1243
|
+
className?: string;
|
|
1244
|
+
}
|
|
1245
|
+
declare function IconPicker({ value, onChange, children, variant, size, allowNone, libraries, className, }: IconPickerProps): React__default.JSX.Element;
|
|
1246
|
+
|
|
1247
|
+
/** Readable names of every Lucide, Phosphor and Radix icon <Icon name> accepts (Material names load on demand). */
|
|
1248
|
+
declare const ICON_NAMES: readonly string[];
|
|
1249
|
+
|
|
1250
|
+
/**
|
|
1251
|
+
* Whether <Icon name> knows this name in Lucide, Phosphor or Radix, matched the way Icon matches
|
|
1252
|
+
* ("layout-dashboard" = "layoutDashboard"). Material names are checked when an icon loads, not here.
|
|
1253
|
+
*/
|
|
1254
|
+
declare function iconExists(name: string): boolean;
|
|
1255
|
+
|
|
1256
|
+
interface ComboboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "size"> {
|
|
1257
|
+
/** Selected or typed string value. */
|
|
1258
|
+
value: string;
|
|
1259
|
+
/** Callback fired when user selects or types a value string. */
|
|
1260
|
+
onChange: (value: string) => void;
|
|
1261
|
+
/** List of string option items for autocomplete filtering. */
|
|
1262
|
+
options: string[];
|
|
1263
|
+
/** Optional formatter function for option labels. */
|
|
1264
|
+
prettyOptionLabel?: (val: string) => string;
|
|
1265
|
+
/** Size variant: "sm" (32px height) or "md" (40px height), matching Select sm and md. Default "md". */
|
|
1266
|
+
size?: "sm" | "md";
|
|
1267
|
+
/** Preview the hovered option in the field as you move over the list. Default true;
|
|
1268
|
+
* set false for a plain select that only applies on click. */
|
|
1269
|
+
hoverPreview?: boolean;
|
|
1270
|
+
/**
|
|
1271
|
+
* Hit-area override (docs: "Target size"). "default": 24px floor, 44px on touch. "none": no hit area
|
|
1272
|
+
* growth (dense toolbars; may go below 24px, yours to own). "touch": always 44px on a coarse pointer.
|
|
1273
|
+
* Native input: the field itself grows (min-height), there is no invisible area.
|
|
1274
|
+
*/
|
|
1275
|
+
hitArea?: HitArea;
|
|
1276
|
+
}
|
|
1277
|
+
declare function Combobox({ value, onChange, options, prettyOptionLabel, size, hoverPreview, hitArea, className, placeholder, disabled, id, ...props }: ComboboxProps): React__default.JSX.Element;
|
|
1278
|
+
|
|
1279
|
+
declare const trackRadiusVariants: (props?: ({
|
|
1280
|
+
radius?: "small" | "none" | "inherit" | "medium" | "large" | "full" | "concentric" | null | undefined;
|
|
1281
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1282
|
+
type SliderRootProps = ComponentPropsWithoutRef<typeof RadixSlider.Root>;
|
|
1283
|
+
interface CapsuleSliderProps {
|
|
1284
|
+
/** Text or React element label shown inside the slider pill. */
|
|
1285
|
+
label?: ReactNode;
|
|
1286
|
+
/** Numerical value or single-element array. */
|
|
1287
|
+
value?: number | number[];
|
|
1288
|
+
/** Default value when uncontrolled. */
|
|
1289
|
+
defaultValue?: number | number[];
|
|
1290
|
+
/** Minimum range bound. Default 0. */
|
|
1291
|
+
min?: number;
|
|
1292
|
+
/** Maximum range bound. Default 100. */
|
|
1293
|
+
max?: number;
|
|
1294
|
+
/** Step increment / snapping granularity. Default 1. */
|
|
1295
|
+
step?: number;
|
|
1296
|
+
/** Formatter for live value display text (e.g. (v) => `${v}px` or `${v}%`). */
|
|
1297
|
+
formatValue?: (val: number) => string;
|
|
1298
|
+
/** Callback fired when slider value updates. */
|
|
1299
|
+
onValueChange?: (val: any) => void;
|
|
1300
|
+
/** Custom CSS classes. */
|
|
1301
|
+
className?: string;
|
|
1302
|
+
/** Whether the slider is disabled. */
|
|
1303
|
+
disabled?: boolean;
|
|
1304
|
+
/** Active fill color style: "brand" (uses active theme brand token) or "mono" (inverting monochrome). Default "brand". */
|
|
1305
|
+
color?: "brand" | "mono";
|
|
1306
|
+
/** Whether to show subtle tick marks on hover. Default true when steps count is between 3 and 30. */
|
|
1307
|
+
showStops?: boolean;
|
|
1308
|
+
/** Explicit array of stop values (e.g. [0, 25, 50, 75, 100]) or "auto" for auto-calculated stops based on step. */
|
|
1309
|
+
marks?: number[] | "auto";
|
|
1310
|
+
}
|
|
1311
|
+
declare function CapsuleSlider({ label, value: controlledValue, defaultValue, min, max, step, formatValue, onValueChange, className, disabled, color, showStops, marks, "aria-label": ariaLabel, }: CapsuleSliderProps & {
|
|
1312
|
+
"aria-label"?: string;
|
|
1313
|
+
}): React$1.JSX.Element;
|
|
1314
|
+
interface SliderProps extends Omit<SliderRootProps, "value" | "defaultValue" | "onValueChange">, VariantProps<typeof trackRadiusVariants> {
|
|
1315
|
+
/** Visual variant: "default" (standard track & thumb) or "capsule" (sleek compact pill with embedded label and live fill value). */
|
|
1316
|
+
variant?: "default" | "capsule";
|
|
1317
|
+
/** Current value: number[] (e.g. [40]) or single number (e.g. 40). */
|
|
1318
|
+
value?: number[] | number;
|
|
1319
|
+
/** Default value when uncontrolled. */
|
|
1320
|
+
defaultValue?: number[] | number;
|
|
1321
|
+
/** Value change callback. */
|
|
1322
|
+
onValueChange?: (val: any) => void;
|
|
1323
|
+
/** Optional array of numeric tick mark values drawn on the track (e.g. [0, 50, 100]) or "auto" for auto-calculated stops based on step. */
|
|
1324
|
+
marks?: number[] | "auto";
|
|
1325
|
+
/** Label text or ReactNode displayed inside capsule slider track (when variant="capsule"). */
|
|
1326
|
+
label?: ReactNode;
|
|
1327
|
+
/** Formatter function for displaying formatted value string in capsule mode (e.g. (v) => `${v}px`). */
|
|
1328
|
+
formatValue?: (val: number) => string;
|
|
1329
|
+
/** Fill color style in capsule mode: "brand" (active theme brand) or "mono" (monochrome inverting). Default "brand". */
|
|
1330
|
+
color?: "brand" | "mono";
|
|
1331
|
+
/** Whether to show subtle stop ticks on hover in capsule mode. Default true for discrete steps (3–30). */
|
|
1332
|
+
showStops?: boolean;
|
|
1333
|
+
/**
|
|
1334
|
+
* Hit-area override for the thumbs (default variant) (docs: "Target size"). "default": 24px floor, 44px on touch. "none": no hit area
|
|
1335
|
+
* growth (dense toolbars; may go below 24px, yours to own). "touch": always 44px on a coarse pointer.
|
|
1336
|
+
*/
|
|
1337
|
+
hitArea?: HitArea;
|
|
1338
|
+
}
|
|
1339
|
+
declare const Slider: React$1.ForwardRefExoticComponent<SliderProps & React$1.RefAttributes<HTMLSpanElement>>;
|
|
1340
|
+
|
|
1341
|
+
type Size = "sm" | "md";
|
|
1342
|
+
type Variant = "default" | "pill" | "subtle" | "expand" | "icon";
|
|
1343
|
+
interface SegmentedControlProps extends Omit<RadixToggleGroup.ToggleGroupSingleProps, "type"> {
|
|
1344
|
+
size?: Size;
|
|
1345
|
+
/** default | pill | subtle | expand | icon. */
|
|
1346
|
+
variant?: Variant;
|
|
1347
|
+
/**
|
|
1348
|
+
* Hit-area override (docs: "Target size"). "default": 24px floor, 44px on touch. "none": no hit area
|
|
1349
|
+
* growth (dense toolbars; may go below 24px, yours to own). "touch": always 44px on a coarse pointer.
|
|
1350
|
+
*/
|
|
1351
|
+
hitArea?: HitArea;
|
|
1352
|
+
}
|
|
1353
|
+
declare function SegmentedControl({ className, size, variant, hitArea, value, defaultValue, onValueChange, children, ...props }: SegmentedControlProps): React$1.JSX.Element;
|
|
1354
|
+
interface SegmentedControlItemProps {
|
|
1355
|
+
value: string;
|
|
1356
|
+
children?: ReactNode;
|
|
1357
|
+
icon?: ReactNode;
|
|
1358
|
+
label?: ReactNode;
|
|
1359
|
+
disabled?: boolean;
|
|
1360
|
+
/** Accessible name for icon-only items when `label` is not a string. Falls back to `value`. */
|
|
1361
|
+
"aria-label"?: string;
|
|
1362
|
+
/** Hit-area override for this item; defaults to the control's. See SegmentedControl. */
|
|
1363
|
+
hitArea?: HitArea;
|
|
1364
|
+
}
|
|
1365
|
+
declare function SegmentedControlItem({ value, children, icon, label, disabled, hitArea: itemHitArea, "aria-label": ariaLabel, }: SegmentedControlItemProps): React$1.JSX.Element;
|
|
1366
|
+
|
|
1367
|
+
type Step = {
|
|
1368
|
+
title: string;
|
|
1369
|
+
description?: string;
|
|
1370
|
+
icon?: React__default.ReactNode;
|
|
1371
|
+
disabled?: boolean;
|
|
1372
|
+
};
|
|
1373
|
+
interface StepperProps {
|
|
1374
|
+
/** Array of step definitions ({ title, description, icon, disabled }). */
|
|
1375
|
+
steps: Step[];
|
|
1376
|
+
/** 0-based active step index. */
|
|
1377
|
+
current: number;
|
|
1378
|
+
/** Layout orientation: "horizontal" or "vertical". @default "horizontal" */
|
|
1379
|
+
orientation?: "horizontal" | "vertical";
|
|
1380
|
+
/** Visual variant: "default" (connected circles), "cards" (multi-step wizard cards), or "pills". @default "default" */
|
|
1381
|
+
variant?: "default" | "cards" | "pills";
|
|
1382
|
+
/** Size variant: "sm" or "md". @default "md" */
|
|
1383
|
+
size?: "sm" | "md";
|
|
1384
|
+
/** Callback fired when an interactive step is clicked. */
|
|
1385
|
+
onStepClick?: (stepIndex: number) => void;
|
|
1386
|
+
/** Which steps can be clicked: "completed" (default when onStepClick is set), "all", or false. @default "completed" */
|
|
1387
|
+
clickable?: boolean | "completed" | "all";
|
|
1388
|
+
className?: string;
|
|
1389
|
+
/** Hit-area override for the clickable step chips (pills variant). See docs: "Target size". */
|
|
1390
|
+
hitArea?: HitArea;
|
|
1391
|
+
}
|
|
1392
|
+
declare function Stepper({ steps, current, orientation, variant, size, onStepClick, clickable, hitArea, className, }: StepperProps): React__default.JSX.Element;
|
|
1393
|
+
|
|
1394
|
+
declare const buttonVariants: (props?: ({
|
|
1395
|
+
variant?: "outline" | "solid" | "soft" | "ghost" | null | undefined;
|
|
1396
|
+
tone?: "brand" | "danger" | null | undefined;
|
|
1397
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
1398
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1399
|
+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
1400
|
+
asChild?: boolean;
|
|
1401
|
+
/** Whether text label truncates with ellipsis if container space is constrained. Default true. */
|
|
1402
|
+
truncate?: boolean;
|
|
1403
|
+
/** Icon rendered before the label. Size it to the text (e.g. an h-4 w-4 svg). */
|
|
1404
|
+
iconLeft?: ReactNode;
|
|
1405
|
+
/** Icon rendered after the label. */
|
|
1406
|
+
iconRight?: ReactNode;
|
|
1407
|
+
/**
|
|
1408
|
+
* Pending state while a request runs: a Spinner replaces `iconLeft` (or covers the label when
|
|
1409
|
+
* there is no icon), the width does not change, `aria-busy`, clicks are ignored, the button stays
|
|
1410
|
+
* focusable and shows the progress cursor. Not dimmed: it is busy, not unavailable.
|
|
1411
|
+
*/
|
|
1412
|
+
loading?: boolean;
|
|
1413
|
+
/** Optional text shown and announced (polite) while `loading`, e.g. "Saving…". */
|
|
1414
|
+
loadingLabel?: string;
|
|
1415
|
+
/**
|
|
1416
|
+
* Why the action is unavailable ("Upgrade to Pro to export"). Renders the button `aria-disabled`
|
|
1417
|
+
* (not `disabled`) so it stays focusable and hoverable, with the reason in a Tooltip on hover and
|
|
1418
|
+
* keyboard focus, on tap for touch, and as its accessible description. Clicks do nothing.
|
|
1419
|
+
* Takes precedence over `disabled`.
|
|
1420
|
+
*/
|
|
1421
|
+
disabledReason?: string;
|
|
1422
|
+
/**
|
|
1423
|
+
* Hit-area override (docs: "Target size"). "default": 24px floor, 44px on touch. "none": no hit area
|
|
1424
|
+
* growth (dense toolbars; may go below 24px, yours to own). "touch": always 44px on a coarse pointer.
|
|
1425
|
+
*/
|
|
1426
|
+
hitArea?: HitArea;
|
|
1427
|
+
}
|
|
1428
|
+
declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
1429
|
+
|
|
1430
|
+
declare const iconButtonVariants: (props?: ({
|
|
1431
|
+
variant?: "outline" | "solid" | "soft" | "ghost" | null | undefined;
|
|
1432
|
+
tone?: "brand" | "danger" | null | undefined;
|
|
1433
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
1434
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1435
|
+
interface IconButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "aria-label">, VariantProps<typeof iconButtonVariants> {
|
|
1436
|
+
/** Mandatory ARIA accessible label string for screen reader name computation. */
|
|
1437
|
+
"aria-label": string;
|
|
1438
|
+
children: ReactNode;
|
|
1439
|
+
/** Pending state: a Spinner replaces the icon, `aria-busy`, clicks ignored, stays focusable, progress cursor. */
|
|
1440
|
+
loading?: boolean;
|
|
1441
|
+
/** Optional text announced (polite) when `loading` starts. */
|
|
1442
|
+
loadingLabel?: string;
|
|
1443
|
+
/**
|
|
1444
|
+
* Why the action is unavailable. Renders `aria-disabled` (focusable) with the reason in a Tooltip
|
|
1445
|
+
* on hover, focus and tap, and as the accessible description. Takes precedence over `disabled`.
|
|
1446
|
+
*/
|
|
1447
|
+
disabledReason?: string;
|
|
1448
|
+
/**
|
|
1449
|
+
* Hit-area override (docs: "Target size"). "default": 24px floor, 44px on touch. "none": no hit area
|
|
1450
|
+
* growth (dense toolbars; may go below 24px, yours to own). "touch": always 44px on a coarse pointer.
|
|
1451
|
+
*/
|
|
1452
|
+
hitArea?: HitArea;
|
|
1453
|
+
}
|
|
1454
|
+
declare const IconButton: React$1.ForwardRefExoticComponent<IconButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
1455
|
+
|
|
1456
|
+
declare const paginationVariants: (props?: ({
|
|
1457
|
+
variant?: "numeric" | "cards" | "simple" | null | undefined;
|
|
1458
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
1459
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1460
|
+
interface PaginationProps extends React__default.HTMLAttributes<HTMLElement>, VariantProps<typeof paginationVariants> {
|
|
1461
|
+
/** Current active page (1-indexed). Default 1. */
|
|
1462
|
+
page?: number;
|
|
1463
|
+
/** Total number of pages. Default 1. */
|
|
1464
|
+
totalPages?: number;
|
|
1465
|
+
/** Callback fired when a page is selected. */
|
|
1466
|
+
onPageChange?: (page: number) => void;
|
|
1467
|
+
/** Custom label for previous button/link. Default "Previous". */
|
|
1468
|
+
prevLabel?: string;
|
|
1469
|
+
/** Custom label for next button/link. Default "Next" or "Up next". */
|
|
1470
|
+
nextLabel?: string;
|
|
1471
|
+
/** Title text for previous item (used in "cards" variant). */
|
|
1472
|
+
prevTitle?: string;
|
|
1473
|
+
/** Title text for next item (used in "cards" variant). */
|
|
1474
|
+
nextTitle?: string;
|
|
1475
|
+
/** Href link for previous card/button (optional, enables link mode). */
|
|
1476
|
+
prevHref?: string;
|
|
1477
|
+
/** Href link for next card/button (optional, enables link mode). */
|
|
1478
|
+
nextHref?: string;
|
|
1479
|
+
}
|
|
1480
|
+
declare function Pagination({ page, totalPages, onPageChange, variant, size, prevLabel, nextLabel, prevTitle, nextTitle, prevHref, nextHref, className, ...props }: PaginationProps): React__default.JSX.Element;
|
|
1481
|
+
|
|
1482
|
+
declare const carouselVariants: (props?: ({
|
|
1483
|
+
variant?: "slider" | "cards" | null | undefined;
|
|
1484
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1485
|
+
type ContainerSize = "xs" | "sm" | "md" | "lg" | "xl" | "full" | "none";
|
|
1486
|
+
interface CarouselContextValue {
|
|
1487
|
+
scrollContainerRef: React__default.RefObject<HTMLDivElement | null>;
|
|
1488
|
+
variant: "slider" | "cards";
|
|
1489
|
+
alignToContainer: ContainerSize;
|
|
1490
|
+
scrollPrev: () => void;
|
|
1491
|
+
scrollNext: () => void;
|
|
1492
|
+
canScrollPrev: boolean;
|
|
1493
|
+
canScrollNext: boolean;
|
|
1494
|
+
activeIndex: number;
|
|
1495
|
+
totalItems: number;
|
|
1496
|
+
setTotalItems: (count: number) => void;
|
|
1497
|
+
scrollToIndex: (index: number) => void;
|
|
1498
|
+
}
|
|
1499
|
+
declare function useCarousel(): CarouselContextValue;
|
|
1500
|
+
interface CarouselProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof carouselVariants> {
|
|
1501
|
+
/** Alignment of track start/end to a standard Shavin container size. Default "none". */
|
|
1502
|
+
alignToContainer?: ContainerSize;
|
|
1503
|
+
/** Whether to render subtle gradient edge fade overlays on the track boundaries. Default false. */
|
|
1504
|
+
fadeEdges?: boolean;
|
|
1505
|
+
/** Custom scroll step in pixels for cards variant. Default 340. */
|
|
1506
|
+
scrollStep?: number;
|
|
1507
|
+
/** Auto-scroll interval in ms (slider mode only). Default disabled. */
|
|
1508
|
+
autoPlayInterval?: number;
|
|
1509
|
+
/** Callback fired when active slide index changes. */
|
|
1510
|
+
onSlideChange?: (index: number) => void;
|
|
1511
|
+
}
|
|
1512
|
+
declare function Carousel({ variant, alignToContainer, fadeEdges, scrollStep, autoPlayInterval, onSlideChange, className, children, ...props }: CarouselProps): React__default.JSX.Element;
|
|
1513
|
+
declare namespace Carousel {
|
|
1514
|
+
var Track: typeof CarouselTrack;
|
|
1515
|
+
var Item: typeof CarouselItem;
|
|
1516
|
+
var Controls: typeof CarouselControls;
|
|
1517
|
+
var Previous: typeof CarouselPrevious;
|
|
1518
|
+
var Next: typeof CarouselNext;
|
|
1519
|
+
var Dots: typeof CarouselDots;
|
|
1520
|
+
}
|
|
1521
|
+
interface CarouselTrackProps extends HTMLAttributes<HTMLDivElement> {
|
|
1522
|
+
/** Gap between items. Default "5" (1.25rem). */
|
|
1523
|
+
gap?: "2" | "3" | "4" | "5" | "6" | "8";
|
|
1524
|
+
}
|
|
1525
|
+
declare function CarouselTrack({ gap, className, children, ...props }: CarouselTrackProps): React__default.JSX.Element;
|
|
1526
|
+
interface CarouselItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
1527
|
+
/** Optional index for accessible numbering */
|
|
1528
|
+
index?: number;
|
|
1529
|
+
}
|
|
1530
|
+
declare function CarouselItem({ index, className, children, ...props }: CarouselItemProps): React__default.JSX.Element;
|
|
1531
|
+
interface CarouselControlsProps extends HTMLAttributes<HTMLDivElement> {
|
|
1532
|
+
}
|
|
1533
|
+
declare function CarouselControls({ className, children, ...props }: CarouselControlsProps): React__default.JSX.Element;
|
|
1534
|
+
interface CarouselButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
1535
|
+
}
|
|
1536
|
+
declare function CarouselPrevious({ className, ...props }: CarouselButtonProps): React__default.JSX.Element;
|
|
1537
|
+
declare function CarouselNext({ className, ...props }: CarouselButtonProps): React__default.JSX.Element;
|
|
1538
|
+
interface CarouselDotsProps extends HTMLAttributes<HTMLDivElement> {
|
|
1539
|
+
count: number;
|
|
1540
|
+
}
|
|
1541
|
+
declare function CarouselDots({ count, className, ...props }: CarouselDotsProps): React__default.JSX.Element;
|
|
1542
|
+
|
|
1543
|
+
declare const headingVariants: (props?: ({
|
|
1544
|
+
size?: "sm" | "md" | "lg" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "xl" | "2xl" | "3xl" | "inherit" | "4xl" | "5xl" | null | undefined;
|
|
1545
|
+
weight?: "inherit" | "normal" | "medium" | "bold" | "semibold" | null | undefined;
|
|
1546
|
+
tracking?: "inherit" | "normal" | "tighter" | "tight" | "wide" | "wider" | "widest" | null | undefined;
|
|
1547
|
+
truncate?: boolean | null | undefined;
|
|
1548
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1549
|
+
interface HeadingProps extends HTMLAttributes<HTMLHeadingElement>, VariantProps<typeof headingVariants> {
|
|
1550
|
+
/** Polymorphic heading element: h1-h6, div, span, etc. Default "h2". */
|
|
1551
|
+
as?: ElementType;
|
|
1552
|
+
/** Whether to truncate overflowing text with an ellipsis. */
|
|
1553
|
+
truncate?: boolean;
|
|
1554
|
+
}
|
|
1555
|
+
declare function Heading({ as: Tag, size, weight, tracking, truncate, className, children, ...props }: HeadingProps): React$1.JSX.Element;
|
|
1556
|
+
|
|
1557
|
+
declare const textVariants: (props?: ({
|
|
1558
|
+
size?: "xs" | "sm" | "md" | "lg" | "1" | "2" | "3" | "4" | "inherit" | "overline" | null | undefined;
|
|
1559
|
+
weight?: "inherit" | "normal" | "medium" | "bold" | "semibold" | null | undefined;
|
|
1560
|
+
tracking?: "inherit" | "normal" | "tighter" | "tight" | "wide" | "wider" | "widest" | null | undefined;
|
|
1561
|
+
color?: "link" | "default" | "inherit" | "fg" | "brand" | "danger" | "muted" | "subtle" | null | undefined;
|
|
1562
|
+
truncate?: boolean | null | undefined;
|
|
1563
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1564
|
+
interface TextProps extends Omit<HTMLAttributes<HTMLElement>, "color">, VariantProps<typeof textVariants> {
|
|
1565
|
+
/** Polymorphic element: p, span, div, label, etc. Default "p". */
|
|
1566
|
+
as?: ElementType;
|
|
1567
|
+
/** Whether to truncate overflowing text with an ellipsis. */
|
|
1568
|
+
truncate?: boolean;
|
|
1569
|
+
}
|
|
1570
|
+
declare function Text({ as: Tag, size, weight, color, tracking, truncate, className, children, ...props }: TextProps): React$1.JSX.Element;
|
|
1571
|
+
|
|
1572
|
+
declare const linkVariants: (props?: ({
|
|
1573
|
+
underline?: "none" | "always" | "hover" | null | undefined;
|
|
1574
|
+
color?: "default" | "brand" | null | undefined;
|
|
1575
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1576
|
+
interface LinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "color">, VariantProps<typeof linkVariants> {
|
|
1577
|
+
size?: "xs" | "sm" | "md" | "lg";
|
|
1578
|
+
/**
|
|
1579
|
+
* The link stands on its own (navigation, footer, table of contents, a list item that is only a link)
|
|
1580
|
+
* rather than sitting in a sentence. Gives it a hit area of at least 24x24 (WCAG 2.5.8) without changing its
|
|
1581
|
+
* layout. Links inside running text are exempt from the rule: leave this off. Defaults to true when
|
|
1582
|
+
* `underline="none"` (a link with no underline is not running text, and every navigation and footer link
|
|
1583
|
+
* is written that way), otherwise false. Pass `standalone={false}` to opt out.
|
|
1584
|
+
*/
|
|
1585
|
+
standalone?: boolean;
|
|
1586
|
+
/** Hit-area override for a `standalone` link: "none" removes it, "touch" grows to 44px on a coarse pointer. Default 24px floor. */
|
|
1587
|
+
hitArea?: HitArea;
|
|
1588
|
+
}
|
|
1589
|
+
declare function Link({ href, children, underline, color, size, standalone, hitArea, className, ...props }: LinkProps): React$1.JSX.Element;
|
|
1590
|
+
|
|
1591
|
+
interface CodeProps {
|
|
1592
|
+
children: ReactNode;
|
|
1593
|
+
className?: string;
|
|
1594
|
+
}
|
|
1595
|
+
declare function Code({ children, className }: CodeProps): React$1.JSX.Element;
|
|
1596
|
+
|
|
1597
|
+
interface KbdProps {
|
|
1598
|
+
children: ReactNode;
|
|
1599
|
+
className?: string;
|
|
1600
|
+
}
|
|
1601
|
+
declare function Kbd({ children, className }: KbdProps): React$1.JSX.Element;
|
|
1602
|
+
|
|
1603
|
+
interface BlockquoteProps {
|
|
1604
|
+
children: ReactNode;
|
|
1605
|
+
className?: string;
|
|
1606
|
+
cite?: string;
|
|
1607
|
+
}
|
|
1608
|
+
declare function Blockquote({ children, className, cite, }: BlockquoteProps): React$1.JSX.Element;
|
|
1609
|
+
|
|
1610
|
+
/** Inline prose marks: emphasis, strong importance and inline quotations. */
|
|
1611
|
+
interface EmProps {
|
|
1612
|
+
children: ReactNode;
|
|
1613
|
+
className?: string;
|
|
1614
|
+
}
|
|
1615
|
+
declare function Em({ children, className }: EmProps): React$1.JSX.Element;
|
|
1616
|
+
interface StrongProps {
|
|
1617
|
+
children: ReactNode;
|
|
1618
|
+
className?: string;
|
|
1619
|
+
}
|
|
1620
|
+
declare function Strong({ children, className }: StrongProps): React$1.JSX.Element;
|
|
1621
|
+
interface QuoteProps {
|
|
1622
|
+
children: ReactNode;
|
|
1623
|
+
className?: string;
|
|
1624
|
+
}
|
|
1625
|
+
declare function Quote({ children, className }: QuoteProps): React$1.JSX.Element;
|
|
1626
|
+
|
|
1627
|
+
type CalendarViewMode = "full" | "1day" | "2days" | "3days";
|
|
1628
|
+
interface CalendarEvent {
|
|
1629
|
+
id: string;
|
|
1630
|
+
title: string;
|
|
1631
|
+
date: string;
|
|
1632
|
+
time?: string;
|
|
1633
|
+
tone?: "default" | "info" | "success" | "warning" | "danger";
|
|
1634
|
+
description?: string;
|
|
1635
|
+
}
|
|
1636
|
+
interface CalendarProps {
|
|
1637
|
+
/** Currently anchored date (controlled). */
|
|
1638
|
+
date?: Date;
|
|
1639
|
+
/** Initial anchored date for uncontrolled mode. */
|
|
1640
|
+
defaultDate?: Date;
|
|
1641
|
+
/** Callback fired when anchored date changes. */
|
|
1642
|
+
onDateChange?: (date: Date) => void;
|
|
1643
|
+
/** Active view mode ("full", "1day", "2days", "3days"). */
|
|
1644
|
+
view?: CalendarViewMode;
|
|
1645
|
+
/** Default view mode for uncontrolled mode (defaults to "full"). */
|
|
1646
|
+
defaultView?: CalendarViewMode;
|
|
1647
|
+
/** Callback fired when view mode changes. */
|
|
1648
|
+
onViewChange?: (view: CalendarViewMode) => void;
|
|
1649
|
+
/** Allowed view modes for user switching (defaults to ["full", "1day", "2days", "3days"]). */
|
|
1650
|
+
allowedViews?: CalendarViewMode[];
|
|
1651
|
+
/** Whether user is allowed to toggle view modes (defaults to true). */
|
|
1652
|
+
allowViewChange?: boolean;
|
|
1653
|
+
/** Starting hour for schedule view (0–23, defaults to 0 for 12 AM). */
|
|
1654
|
+
startHour?: number;
|
|
1655
|
+
/** Ending hour for schedule view (0–23, defaults to 23 for 11 PM). */
|
|
1656
|
+
endHour?: number;
|
|
1657
|
+
/** List of events to display on the calendar. */
|
|
1658
|
+
events?: CalendarEvent[];
|
|
1659
|
+
/** Callback fired when a date cell or day header is clicked. */
|
|
1660
|
+
onSelectDate?: (date: Date) => void;
|
|
1661
|
+
/** Callback fired when an event chip is clicked. */
|
|
1662
|
+
onEventClick?: (event: CalendarEvent) => void;
|
|
1663
|
+
/** Locale for day names read by screen readers. Defaults to the browser's locale. */
|
|
1664
|
+
locale?: string;
|
|
1665
|
+
/** Stretch to fit parent container height & flex layout (defaults to true). */
|
|
1666
|
+
fitContainer?: boolean;
|
|
1667
|
+
className?: string;
|
|
1668
|
+
style?: CSSProperties;
|
|
1669
|
+
}
|
|
1670
|
+
declare function CalendarEventChip({ event, onClick, }: {
|
|
1671
|
+
event: CalendarEvent;
|
|
1672
|
+
onClick?: (event: CalendarEvent) => void;
|
|
1673
|
+
}): React$1.JSX.Element;
|
|
1674
|
+
declare function CalendarView({ date, defaultDate, onDateChange, view, defaultView, onViewChange, allowedViews, allowViewChange, startHour, endHour, events, onSelectDate, onEventClick, fitContainer, locale, className, style, }: CalendarProps): React$1.JSX.Element;
|
|
1675
|
+
declare function Calendar(props: CalendarProps): React$1.JSX.Element;
|
|
1676
|
+
|
|
1677
|
+
/** An edge or corner of a resizable element. Edges are physical, not logical. */
|
|
1678
|
+
type ResizeEdge = "top" | "right" | "bottom" | "left" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
1679
|
+
/**
|
|
1680
|
+
* Which edges get a resize handle.
|
|
1681
|
+
* `true` / `"both"` = right + bottom + bottom-right corner, `"x"` = left + right,
|
|
1682
|
+
* `"y"` = top + bottom, or one edge, or a list of edges.
|
|
1683
|
+
*/
|
|
1684
|
+
type ResizableEdges = ResizeEdge | ResizeEdge[] | "x" | "y" | "both" | boolean;
|
|
1685
|
+
interface ResizeSize {
|
|
1686
|
+
width: number;
|
|
1687
|
+
height: number;
|
|
1688
|
+
}
|
|
1689
|
+
/** Rendered corner radii in px, used to keep handle lines off rounded corners. */
|
|
1690
|
+
interface ResizeRadii {
|
|
1691
|
+
topLeft: number;
|
|
1692
|
+
topRight: number;
|
|
1693
|
+
bottomRight: number;
|
|
1694
|
+
bottomLeft: number;
|
|
1695
|
+
}
|
|
1696
|
+
interface UseResizableOptions {
|
|
1697
|
+
/** Edges that get a handle. Falsy disables resizing. */
|
|
1698
|
+
edges?: ResizableEdges;
|
|
1699
|
+
/** Minimum width in px. */
|
|
1700
|
+
minWidth?: number;
|
|
1701
|
+
/** Maximum width in px. */
|
|
1702
|
+
maxWidth?: number;
|
|
1703
|
+
/** Minimum height in px. */
|
|
1704
|
+
minHeight?: number;
|
|
1705
|
+
/** Maximum height in px. */
|
|
1706
|
+
maxHeight?: number;
|
|
1707
|
+
/** Arrow-key step in px. Shift multiplies it by 4. Default 16. */
|
|
1708
|
+
step?: number;
|
|
1709
|
+
/** Round dragged sizes to this grid in px. */
|
|
1710
|
+
snap?: number;
|
|
1711
|
+
/** Keep the width/height ratio the element had when the resize started. */
|
|
1712
|
+
lockAspectRatio?: boolean;
|
|
1713
|
+
/** Save the size in localStorage under `shavin:resize:<persistKey>`. */
|
|
1714
|
+
persistKey?: string;
|
|
1715
|
+
/** Turn resizing off without changing `edges` (e.g. while collapsed). */
|
|
1716
|
+
disabled?: boolean;
|
|
1717
|
+
/** Fires once per frame while resizing. */
|
|
1718
|
+
onResize?: (size: ResizeSize) => void;
|
|
1719
|
+
/** Fires when a drag or key press finishes. */
|
|
1720
|
+
onResizeEnd?: (size: ResizeSize) => void;
|
|
1721
|
+
}
|
|
1722
|
+
interface ResizeHandleProps$1 {
|
|
1723
|
+
role: "separator";
|
|
1724
|
+
tabIndex: number;
|
|
1725
|
+
"aria-label": string;
|
|
1726
|
+
"aria-orientation"?: "horizontal" | "vertical";
|
|
1727
|
+
"aria-valuenow"?: number;
|
|
1728
|
+
"aria-valuemin"?: number;
|
|
1729
|
+
"aria-valuemax"?: number;
|
|
1730
|
+
"data-edge": ResizeEdge;
|
|
1731
|
+
"data-resizing"?: "";
|
|
1732
|
+
onPointerDown: (event: PointerEvent<HTMLElement>) => void;
|
|
1733
|
+
onKeyDown: (event: KeyboardEvent<HTMLElement>) => void;
|
|
1734
|
+
onDoubleClick: () => void;
|
|
1735
|
+
}
|
|
1736
|
+
interface UseResizableResult {
|
|
1737
|
+
/** Attach to the element being resized. */
|
|
1738
|
+
ref: RefCallback<HTMLElement>;
|
|
1739
|
+
/** True when resizing is on (edges set and not disabled). */
|
|
1740
|
+
enabled: boolean;
|
|
1741
|
+
/** Edges that get a handle. */
|
|
1742
|
+
edges: ResizeEdge[];
|
|
1743
|
+
/** Size set by the user, or null while the element has its natural size. */
|
|
1744
|
+
size: Partial<ResizeSize> | null;
|
|
1745
|
+
/** Rendered size in layout px (unaffected by CSS transforms). */
|
|
1746
|
+
measured: ResizeSize | null;
|
|
1747
|
+
/** Rendered corner radii in px (0 for square corners). */
|
|
1748
|
+
radii: ResizeRadii | null;
|
|
1749
|
+
/** Inline style to merge onto the element: the user size plus min/max bounds. */
|
|
1750
|
+
style: CSSProperties;
|
|
1751
|
+
isResizing: boolean;
|
|
1752
|
+
activeEdge: ResizeEdge | null;
|
|
1753
|
+
getHandleProps: (edge: ResizeEdge) => ResizeHandleProps$1;
|
|
1754
|
+
/** Back to the natural size; clears the persisted value. */
|
|
1755
|
+
reset: () => void;
|
|
1756
|
+
}
|
|
1757
|
+
declare function resolveResizeEdges(edges: ResizableEdges | undefined): ResizeEdge[];
|
|
1758
|
+
/**
|
|
1759
|
+
* Headless resize engine behind the `resizable` prop on Box, Flex, Card and Sidebar.
|
|
1760
|
+
* Owns the element's own width/height; renders nothing. Spread `getHandleProps(edge)`
|
|
1761
|
+
* onto each handle element (or render `<ResizeHandles state={...} />`).
|
|
1762
|
+
*/
|
|
1763
|
+
declare function useResizable(options?: UseResizableOptions): UseResizableResult;
|
|
1764
|
+
|
|
1765
|
+
declare const resizeHandleVariants: (props?: ({
|
|
1766
|
+
edge?: "bottom" | "left" | "right" | "top" | "bottom-left" | "bottom-right" | "top-left" | "top-right" | null | undefined;
|
|
1767
|
+
variant?: "line" | "grip" | "invisible" | null | undefined;
|
|
1768
|
+
color?: "brand" | "neutral" | "brand-subtle" | null | undefined;
|
|
1769
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1770
|
+
type ResizeHandleVariant = "line" | "grip" | "invisible";
|
|
1771
|
+
type ResizeHandleColor = "brand" | "brand-subtle" | "neutral";
|
|
1772
|
+
interface ResizeHandleProps extends Omit<HTMLAttributes<HTMLDivElement>, "onPointerDown" | "onKeyDown" | "onDoubleClick" | "color">, VariantProps<typeof resizeHandleVariants> {
|
|
1773
|
+
/** Edge or corner this handle sits on. */
|
|
1774
|
+
edge: ResizeEdge;
|
|
1775
|
+
/** Spread from `useResizable().getHandleProps(edge)`. */
|
|
1776
|
+
onPointerDown?: HTMLAttributes<HTMLDivElement>["onPointerDown"];
|
|
1777
|
+
onKeyDown?: HTMLAttributes<HTMLDivElement>["onKeyDown"];
|
|
1778
|
+
onDoubleClick?: () => void;
|
|
1779
|
+
}
|
|
1780
|
+
/** One styled resize handle. Position it inside a `relative` element. */
|
|
1781
|
+
declare function ResizeHandle({ edge, variant, color, className, ...props }: ResizeHandleProps): React$1.JSX.Element;
|
|
1782
|
+
/** Every handle for a `useResizable` result, plus the size hint shown while dragging. */
|
|
1783
|
+
declare function ResizeHandles({ state, variant, color, sizeHint, }: {
|
|
1784
|
+
state: UseResizableResult;
|
|
1785
|
+
variant?: ResizeHandleVariant;
|
|
1786
|
+
color?: ResizeHandleColor;
|
|
1787
|
+
/** Show "320 × 200" while dragging. Default true. */
|
|
1788
|
+
sizeHint?: boolean;
|
|
1789
|
+
}): React$1.JSX.Element | null;
|
|
1790
|
+
/** Props shared by every primitive that takes `resizable` (Box, Flex, Card). */
|
|
1791
|
+
interface ResizableProps {
|
|
1792
|
+
/** Make the element user-resizable from these edges: "right", "bottom", "x", "y", "both", true, or a list such as ["left", "bottom-left"]. Off by default. */
|
|
1793
|
+
resizable?: ResizableEdges;
|
|
1794
|
+
/** Minimum width in px while resizable (also applied as CSS min-width). */
|
|
1795
|
+
minWidth?: number;
|
|
1796
|
+
/** Maximum width in px while resizable (also applied as CSS max-width). */
|
|
1797
|
+
maxWidth?: number;
|
|
1798
|
+
/** Minimum height in px while resizable (also applied as CSS min-height). */
|
|
1799
|
+
minHeight?: number;
|
|
1800
|
+
/** Maximum height in px while resizable (also applied as CSS max-height). */
|
|
1801
|
+
maxHeight?: number;
|
|
1802
|
+
/** Arrow-key resize step in px; Shift multiplies by 4. Default 16. */
|
|
1803
|
+
resizeStep?: number;
|
|
1804
|
+
/** Round dragged sizes to this grid in px. */
|
|
1805
|
+
snap?: number;
|
|
1806
|
+
/** Keep the width/height ratio while resizing. */
|
|
1807
|
+
lockAspectRatio?: boolean;
|
|
1808
|
+
/** Remember the size in localStorage under this key. */
|
|
1809
|
+
persistKey?: string;
|
|
1810
|
+
/** Fires once per frame while resizing. */
|
|
1811
|
+
onResize?: (size: ResizeSize) => void;
|
|
1812
|
+
/** Fires when a resize finishes. */
|
|
1813
|
+
onResizeEnd?: (size: ResizeSize) => void;
|
|
1814
|
+
/** Handle look: "line" (brand line on hover), "grip" (always-visible pill) or "invisible". Default "line". */
|
|
1815
|
+
resizeHandle?: ResizeHandleVariant;
|
|
1816
|
+
/** Handle colour on hover, focus and drag: "brand", "brand-subtle" (softer brand) or "neutral" (monochrome). Default "brand-subtle". */
|
|
1817
|
+
resizeColor?: ResizeHandleColor;
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1820
|
+
declare const Card: {
|
|
1821
|
+
(props: Omit<HTMLAttributes<HTMLDivElement>, "onResize"> & VariantProps<(props?: ({
|
|
1822
|
+
padding?: "xs" | "sm" | "md" | "lg" | "none" | "xl" | "2xl" | "3xl" | null | undefined;
|
|
1823
|
+
interactive?: boolean | null | undefined;
|
|
1824
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string> & BgMediaProps & ResizableProps & {
|
|
1825
|
+
style?: React.CSSProperties;
|
|
1826
|
+
surface?: Surface;
|
|
1827
|
+
ref?: Ref<HTMLDivElement>;
|
|
1828
|
+
}): React$1.JSX.Element;
|
|
1829
|
+
displayName: string;
|
|
1830
|
+
};
|
|
1831
|
+
declare function CardList({ as: Tag, className, style, ...props }: HTMLAttributes<HTMLElement> & {
|
|
1832
|
+
as?: ElementType;
|
|
1833
|
+
style?: React.CSSProperties;
|
|
1834
|
+
}): React$1.JSX.Element;
|
|
1835
|
+
declare function CardListItem({ as: Tag, className, ...props }: HTMLAttributes<HTMLElement> & {
|
|
1836
|
+
as?: ElementType;
|
|
1837
|
+
}): React$1.JSX.Element;
|
|
1838
|
+
declare function CardRow({ label, children, }: {
|
|
1839
|
+
label: string;
|
|
1840
|
+
children: ReactNode;
|
|
1841
|
+
}): React$1.JSX.Element;
|
|
1842
|
+
declare const statCardVariants: (props?: ({
|
|
1843
|
+
padding?: "sm" | "md" | null | undefined;
|
|
1844
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1845
|
+
declare function StatCard({ label, value, sub, trend, alert, padding, style, className, ...props }: {
|
|
1846
|
+
label: string;
|
|
1847
|
+
value: string;
|
|
1848
|
+
/** Small line under the value, e.g. a change like "+7.8%". */
|
|
1849
|
+
sub?: string;
|
|
1850
|
+
/** Colours the sub line: up = success, down = danger. */
|
|
1851
|
+
trend?: "up" | "down" | "flat";
|
|
1852
|
+
/** Marks the card as needing attention: a warning dot before the label and "Needs attention" for screen readers. Never underlines the value (an underline reads as a link). */
|
|
1853
|
+
alert?: boolean;
|
|
1854
|
+
style?: React.CSSProperties;
|
|
1855
|
+
} & VariantProps<typeof statCardVariants> & HTMLAttributes<HTMLDivElement>): React$1.JSX.Element;
|
|
1856
|
+
|
|
1857
|
+
type SupportedLanguage = "tsx" | "typescript" | "jsx" | "javascript" | "html" | "css" | "scss" | "json" | "bash" | "shell" | "python" | "sql" | "markdown" | string;
|
|
1858
|
+
/**
|
|
1859
|
+
* Universal multi-language syntax highlighter that compiles regex token streams
|
|
1860
|
+
* into semantic @shavin/ui tokens.
|
|
1861
|
+
*/
|
|
1862
|
+
declare function highlightCode(code: string, languageOrFilename?: string): ReactNode[];
|
|
1863
|
+
|
|
1864
|
+
interface CodeBlockProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
1865
|
+
/** Source code string to highlight. */
|
|
1866
|
+
code: string;
|
|
1867
|
+
/** Language identifier for syntax coloring (e.g. 'tsx', 'typescript', 'html', 'css', 'json', 'bash', 'python', 'sql'). Default 'tsx'. */
|
|
1868
|
+
language?: SupportedLanguage;
|
|
1869
|
+
/** Explicit appearance mode: 'dark' (forces dark theme), 'light' (forces light theme), or 'auto' (inherits from page theme). Default 'auto'. */
|
|
1870
|
+
appearance?: "dark" | "light" | "auto";
|
|
1871
|
+
/** Optional alias for appearance. */
|
|
1872
|
+
theme?: "dark" | "light" | "auto";
|
|
1873
|
+
/** Layout variant: 'standalone' (independent code box), 'attached' (anchored below component preview), 'collapsible' (expandable code drawer with view/hide toggle), or 'split' (horizontal side-by-side preview and code). Default 'standalone'. */
|
|
1874
|
+
variant?: "standalone" | "attached" | "collapsible" | "split";
|
|
1875
|
+
/** Optional alias for variant="collapsible". */
|
|
1876
|
+
collapsible?: boolean;
|
|
1877
|
+
/** Split orientation when pairing code with a live preview: 'vertical' (stacked) or 'horizontal' (side-by-side). Default 'vertical' (or 'horizontal' when variant='split'). */
|
|
1878
|
+
split?: "vertical" | "horizontal";
|
|
1879
|
+
/** Position of the preview relative to the code block: 'left' | 'right' | 'top' | 'bottom'. Default 'right' when split='horizontal', 'top' when split='vertical'. */
|
|
1880
|
+
previewPosition?: "left" | "right" | "top" | "bottom";
|
|
1881
|
+
/** Optional live preview component rendered alongside the code block. */
|
|
1882
|
+
children?: ReactNode;
|
|
1883
|
+
/** Whether code wraps lines automatically (whitespace-pre-wrap). Default false. */
|
|
1884
|
+
wrap?: boolean;
|
|
1885
|
+
/** Show one-click Copy button overlay. Default true. */
|
|
1886
|
+
copyable?: boolean;
|
|
1887
|
+
/** Collapsible drawer state ('open' | 'close') when variant='collapsible'. Default 'close'. */
|
|
1888
|
+
state?: "open" | "close";
|
|
1889
|
+
/** Optional initial open state for collapsible mode. */
|
|
1890
|
+
defaultOpen?: boolean;
|
|
1891
|
+
/** Callback fired when collapsible state changes ('open' | 'close'). */
|
|
1892
|
+
onStateChange?: (state: "open" | "close") => void;
|
|
1893
|
+
/** Optional label or description displayed in the collapsible footer bar. */
|
|
1894
|
+
description?: string;
|
|
1895
|
+
/** Optional title displayed in the collapsible footer bar (alias for description). */
|
|
1896
|
+
title?: string;
|
|
1897
|
+
/** Hit-area override for the Copy and View-code buttons (docs: "Target size"). */
|
|
1898
|
+
hitArea?: HitArea;
|
|
1899
|
+
}
|
|
1900
|
+
declare function CodeBlock({ code, language, appearance, theme, variant, collapsible, split, previewPosition, children, wrap, copyable, state, defaultOpen, onStateChange, description, title, hitArea, className, ...props }: CodeBlockProps): React$1.JSX.Element;
|
|
1901
|
+
|
|
1902
|
+
interface CodeEditorProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
1903
|
+
/** Source code string to edit or display. */
|
|
1904
|
+
value: string;
|
|
1905
|
+
/** Callback fired when code changes. */
|
|
1906
|
+
onChange?: (value: string) => void;
|
|
1907
|
+
/** Filename shown in the top header bar. */
|
|
1908
|
+
filename?: string;
|
|
1909
|
+
/** Language identifier badge (e.g. 'React TSX', 'TypeScript', 'JSON'). */
|
|
1910
|
+
language?: string;
|
|
1911
|
+
/** Whether to show the language badge on the editor header. Default true. */
|
|
1912
|
+
showLanguage?: boolean;
|
|
1913
|
+
/** Option to hide the top header bar completely. Default false. */
|
|
1914
|
+
hideHeader?: boolean;
|
|
1915
|
+
/** Option to show header (alias for !hideHeader). Default true. */
|
|
1916
|
+
showHeader?: boolean;
|
|
1917
|
+
/** Scoped theme mode for the editor box: 'dark' | 'light' | 'auto'. In 'auto', defaults to dark IDE theme. */
|
|
1918
|
+
theme?: "dark" | "light" | "auto";
|
|
1919
|
+
/** Allow users to toggle between dark and light themes within the editor container. */
|
|
1920
|
+
allowThemeToggle?: boolean;
|
|
1921
|
+
/** Whether the code editor is read-only. */
|
|
1922
|
+
readOnly?: boolean;
|
|
1923
|
+
/** Placeholder text shown when editor is empty. */
|
|
1924
|
+
placeholder?: string;
|
|
1925
|
+
/** Minimum height for the editor in pixels or CSS unit. */
|
|
1926
|
+
minHeight?: number | string;
|
|
1927
|
+
/** Whether to show a one-click Copy button in the header bar. */
|
|
1928
|
+
copyable?: boolean;
|
|
1929
|
+
/** Custom content rendered on the left side of the header bar. */
|
|
1930
|
+
headerLeft?: ReactNode;
|
|
1931
|
+
/** Custom content rendered on the right side of the header bar. */
|
|
1932
|
+
headerRight?: ReactNode;
|
|
1933
|
+
/** Custom footer node rendered below the editor. */
|
|
1934
|
+
footer?: ReactNode;
|
|
1935
|
+
/** Custom wrapper class name. */
|
|
1936
|
+
className?: string;
|
|
1937
|
+
/** Accessible name for the code field. Defaults to the filename. */
|
|
1938
|
+
label?: string;
|
|
1939
|
+
}
|
|
1940
|
+
declare function CodeEditor({ value, onChange, filename, language, showLanguage, hideHeader, showHeader, theme, allowThemeToggle, readOnly, placeholder, minHeight, copyable, headerLeft, headerRight, footer, className, label, ...props }: CodeEditorProps): React$1.JSX.Element;
|
|
1941
|
+
|
|
1942
|
+
/** Semantic colour tone for a series or datum (resolved to theme tokens). */
|
|
1943
|
+
type ChartTone = "brand" | "success" | "danger" | "warning" | "neutral";
|
|
1944
|
+
/** Y-axis / tooltip value format. */
|
|
1945
|
+
type ChartYFormat = "number" | "compact" | "currency" | "percent";
|
|
1946
|
+
/** Bar corner radius token. `floor` = concentric floor min(radius-lg, radius-panel / 2). */
|
|
1947
|
+
type ChartBarRadius = "none" | "sm" | "lg" | "floor";
|
|
1948
|
+
interface ChartPadding {
|
|
1949
|
+
top?: number;
|
|
1950
|
+
right?: number;
|
|
1951
|
+
bottom?: number;
|
|
1952
|
+
left?: number;
|
|
1953
|
+
}
|
|
1954
|
+
/** Format a y value for axis ticks (`precise` false) or tooltips (`precise` true). */
|
|
1955
|
+
declare function formatChartValue(value: number, format?: ChartYFormat, prefix?: string, suffix?: string, precise?: boolean): string;
|
|
1956
|
+
/** Axis and layout options shared by BarChart and LineChart. Everything is optional. */
|
|
1957
|
+
interface AxisProps extends FormatProps {
|
|
1958
|
+
/** Chart height in px (default 260). */
|
|
1959
|
+
height?: number;
|
|
1960
|
+
/** Plot padding in px, merged over the defaults. */
|
|
1961
|
+
padding?: ChartPadding;
|
|
1962
|
+
/** Number of y-axis intervals (default 4, so 5 ticks). */
|
|
1963
|
+
tickCount?: number;
|
|
1964
|
+
/** Fixed y-axis maximum; defaults to a rounded data maximum. */
|
|
1965
|
+
yMax?: number;
|
|
1966
|
+
showYAxis?: boolean;
|
|
1967
|
+
showXAxis?: boolean;
|
|
1968
|
+
showGrid?: boolean;
|
|
1969
|
+
/** Show every Nth x label, starting with the first (default 1). */
|
|
1970
|
+
xLabelEvery?: number;
|
|
1971
|
+
/** Below the md breakpoint show every Nth label instead (hides the rest on small screens). */
|
|
1972
|
+
xLabelEveryMobile?: number;
|
|
1973
|
+
/** Explicit x labels to show (matched against each datum's `label`); overrides the stride props. */
|
|
1974
|
+
xLabels?: string[];
|
|
1975
|
+
}
|
|
1976
|
+
/** One series in a multi-series chart. Values live on each datum under `key`. */
|
|
1977
|
+
interface SeriesSpec {
|
|
1978
|
+
key: string;
|
|
1979
|
+
name: string;
|
|
1980
|
+
tone?: ChartTone | (string & {});
|
|
1981
|
+
color?: string;
|
|
1982
|
+
}
|
|
1983
|
+
/** Rounds a maximum up to a "nice" number and returns evenly spaced ticks from 0. */
|
|
1984
|
+
declare function niceScale(max: number, intervals?: number): {
|
|
1985
|
+
max: number;
|
|
1986
|
+
ticks: number[];
|
|
1987
|
+
};
|
|
1988
|
+
interface FormatProps {
|
|
1989
|
+
yFormat?: ChartYFormat;
|
|
1990
|
+
yPrefix?: string;
|
|
1991
|
+
ySuffix?: string;
|
|
1992
|
+
}
|
|
1993
|
+
interface ChartA11yProps {
|
|
1994
|
+
/** Accessible name, e.g. "Monthly revenue, 2026". Read by screen readers and used as the data table caption. */
|
|
1995
|
+
title?: string;
|
|
1996
|
+
/** One-sentence takeaway, e.g. "Revenue doubled after the March launch." */
|
|
1997
|
+
description?: string;
|
|
1998
|
+
/**
|
|
1999
|
+
* Tell series apart by more than colour: fill patterns on bars and slices, dashes and
|
|
2000
|
+
* marker shapes on lines, repeated in the legend and tooltip (WCAG 1.4.1). Default true.
|
|
2001
|
+
* Turn off only when every series is labelled directly on the chart.
|
|
2002
|
+
*/
|
|
2003
|
+
patterns?: boolean;
|
|
2004
|
+
}
|
|
2005
|
+
|
|
2006
|
+
type SparklinePoint = number | {
|
|
2007
|
+
value: number;
|
|
2008
|
+
label?: string;
|
|
2009
|
+
tone?: ChartTone | (string & {});
|
|
2010
|
+
color?: string;
|
|
2011
|
+
};
|
|
2012
|
+
interface SparklineProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
2013
|
+
/** Numbers, or objects with a `value` (and an optional per-bar `tone` / `color`). */
|
|
2014
|
+
data: SparklinePoint[];
|
|
2015
|
+
/** Default "line". */
|
|
2016
|
+
type?: "line" | "area" | "bar";
|
|
2017
|
+
/** Colour of the line, area or bars. Default brand. */
|
|
2018
|
+
tone?: ChartTone;
|
|
2019
|
+
/** Line and area only. Default "smooth". */
|
|
2020
|
+
curve?: "linear" | "smooth";
|
|
2021
|
+
/** Bar corner radius token (default "sm"). */
|
|
2022
|
+
barRadius?: ChartBarRadius;
|
|
2023
|
+
/** Gap between bars in px (default 4). */
|
|
2024
|
+
barGap?: number;
|
|
2025
|
+
/**
|
|
2026
|
+
* What the trend says, e.g. "Signups, up 12% this week". Makes the sparkline an image
|
|
2027
|
+
* with that name; without it the sparkline is decorative (pair it with text nearby).
|
|
2028
|
+
*/
|
|
2029
|
+
label?: string;
|
|
2030
|
+
}
|
|
2031
|
+
/** A tiny, axis-free trend for a card or table cell. It fills its container: size it with className (default h-12 w-full). */
|
|
2032
|
+
declare function Sparkline({ data, type, tone, curve, barRadius, barGap, label, className, ...props }: SparklineProps): React$1.JSX.Element;
|
|
2033
|
+
|
|
2034
|
+
interface LineChartProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "title">, AxisProps, ChartA11yProps {
|
|
2035
|
+
/** One record per x position: `label` plus a number under each series `key` (`value` when `series` is omitted). */
|
|
2036
|
+
data: Record<string, any>[];
|
|
2037
|
+
/** Omit for a single series of `value`s. */
|
|
2038
|
+
series?: SeriesSpec[];
|
|
2039
|
+
/** `area` fills under each line (stacked areas when `stacked`). */
|
|
2040
|
+
type?: "line" | "area";
|
|
2041
|
+
/** Stack the series on top of each other instead of overlaying them. */
|
|
2042
|
+
stacked?: boolean;
|
|
2043
|
+
/** `step` holds each value until the next point (balances, plans, queue depth). */
|
|
2044
|
+
curve?: "linear" | "smooth" | "step";
|
|
2045
|
+
showLegend?: boolean;
|
|
2046
|
+
/** Draw a dot on every point (default true when 16 points or fewer). */
|
|
2047
|
+
showDots?: boolean;
|
|
2048
|
+
}
|
|
2049
|
+
/** Line or area chart, single or multi-series, with nice axis ticks, a legend and a shared hover tooltip. */
|
|
2050
|
+
declare function LineChart({ data, series, type, stacked, curve, height, showLegend, showGrid, showYAxis, showXAxis, showDots, xLabelEvery, xLabelEveryMobile, xLabels, tickCount, yMax, padding: paddingProp, yFormat, yPrefix, ySuffix, title, description, patterns, className, ...props }: LineChartProps): React$1.JSX.Element;
|
|
2051
|
+
|
|
2052
|
+
interface BarChartProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "title">, AxisProps, ChartA11yProps {
|
|
2053
|
+
/**
|
|
2054
|
+
* One record per category: `label` plus a number under each series `key`.
|
|
2055
|
+
* Without `series`, the number is `value`, and a datum may carry its own `tone` or `color`.
|
|
2056
|
+
*/
|
|
2057
|
+
data: Record<string, any>[];
|
|
2058
|
+
/** Omit for a single series of `value`s. */
|
|
2059
|
+
series?: SeriesSpec[];
|
|
2060
|
+
/** `horizontal` puts categories on the y axis, good for long labels and rankings. */
|
|
2061
|
+
orientation?: "vertical" | "horizontal";
|
|
2062
|
+
/** `grouped` puts the series side by side per category (comparison); `stacked` adds them up. */
|
|
2063
|
+
mode?: "grouped" | "stacked";
|
|
2064
|
+
showLegend?: boolean;
|
|
2065
|
+
/** Bar corner radius token (default "sm"). */
|
|
2066
|
+
barRadius?: ChartBarRadius;
|
|
2067
|
+
/** Gap between categories in px (default: 30% of the slot). */
|
|
2068
|
+
barGap?: number;
|
|
2069
|
+
/** Maximum bar width in px. */
|
|
2070
|
+
maxBarWidth?: number;
|
|
2071
|
+
}
|
|
2072
|
+
/** Vertical or horizontal bars: single, grouped (compare two or more per category) or stacked. Values may be negative (vertical). */
|
|
2073
|
+
declare function BarChart({ data, series, orientation, mode, height, showLegend, showGrid, showYAxis, showXAxis, xLabelEvery, xLabelEveryMobile, xLabels, tickCount, yMax, padding: paddingProp, barRadius, barGap, maxBarWidth, yFormat, yPrefix, ySuffix, title, description, patterns, className, ...props }: BarChartProps): React$1.JSX.Element;
|
|
2074
|
+
|
|
2075
|
+
interface HeatmapProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "title"> {
|
|
2076
|
+
rows: string[];
|
|
2077
|
+
columns: string[];
|
|
2078
|
+
/** `values[row][column]`. Use `null` for cells with no data (they stay empty, like the lower triangle of a cohort table). */
|
|
2079
|
+
values: (number | null)[][];
|
|
2080
|
+
/** Colour of the filled cells (a theme tone). */
|
|
2081
|
+
tone?: "brand" | "success" | "warning" | "danger";
|
|
2082
|
+
/** Value that maps to full intensity; defaults to the largest value. */
|
|
2083
|
+
max?: number;
|
|
2084
|
+
format?: ChartYFormat;
|
|
2085
|
+
/** Print the value inside each cell (default true). */
|
|
2086
|
+
showValues?: boolean;
|
|
2087
|
+
/** Narrowest a column may get before the heatmap scrolls sideways, in px. */
|
|
2088
|
+
minColumnWidth?: number;
|
|
2089
|
+
/** Width of the row label column. */
|
|
2090
|
+
labelWidth?: string;
|
|
2091
|
+
rowLabelTitle?: string;
|
|
2092
|
+
/** Accessible name, used for the screen-reader table caption and the scroll region. */
|
|
2093
|
+
title?: string;
|
|
2094
|
+
}
|
|
2095
|
+
/** A labelled grid of cells shaded by value: cohort retention, activity by hour, correlation. */
|
|
2096
|
+
declare function Heatmap({ rows, columns, values, tone, max, format, showValues, minColumnWidth, labelWidth, rowLabelTitle, title, className, ...props }: HeatmapProps): React$1.JSX.Element;
|
|
2097
|
+
|
|
2098
|
+
interface FunnelStep {
|
|
2099
|
+
name: string;
|
|
2100
|
+
value: number;
|
|
2101
|
+
}
|
|
2102
|
+
interface FunnelChartProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
2103
|
+
steps: FunnelStep[];
|
|
2104
|
+
/** `horizontal` stacks a bar per step; `vertical` draws a column per step, left to right. */
|
|
2105
|
+
orientation?: "horizontal" | "vertical";
|
|
2106
|
+
/** `centered` (horizontal only) centres each bar so the stack narrows like a funnel. */
|
|
2107
|
+
centered?: boolean;
|
|
2108
|
+
/** Height of the columns in px (vertical). */
|
|
2109
|
+
height?: number;
|
|
2110
|
+
/** Show the drop-off between steps (default true). */
|
|
2111
|
+
showDropOff?: boolean;
|
|
2112
|
+
}
|
|
2113
|
+
/** Conversion funnel in either direction: step counts, share of the first step and drop-off between steps. */
|
|
2114
|
+
declare function FunnelChart({ steps, orientation, centered, height, showDropOff, className, ...props }: FunnelChartProps): React$1.JSX.Element | null;
|
|
2115
|
+
|
|
2116
|
+
declare const toneClass: (props?: ({
|
|
2117
|
+
tone?: "brand" | "success" | "warning" | null | undefined;
|
|
2118
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2119
|
+
declare const sizeClass: (props?: ({
|
|
2120
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
2121
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2122
|
+
interface RatingProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue">, VariantProps<typeof toneClass>, VariantProps<typeof sizeClass> {
|
|
2123
|
+
/** Current value, 0 to `max`. Fractions render as partly filled stars (4.5, 4.2…). */
|
|
2124
|
+
value?: number;
|
|
2125
|
+
defaultValue?: number;
|
|
2126
|
+
onValueChange?: (value: number) => void;
|
|
2127
|
+
/** Number of stars. @default 5 */
|
|
2128
|
+
max?: number;
|
|
2129
|
+
/** Input step. `half` lets people pick 3.5. Display always shows any fraction. @default "full" */
|
|
2130
|
+
precision?: "full" | "half";
|
|
2131
|
+
/** Display only: no focus, no pointer, announced as an image. */
|
|
2132
|
+
readOnly?: boolean;
|
|
2133
|
+
disabled?: boolean;
|
|
2134
|
+
/** Show the number next to the stars, for example "4.8". */
|
|
2135
|
+
showValue?: boolean;
|
|
2136
|
+
/** Review count shown in brackets, for example "(34)". */
|
|
2137
|
+
count?: number;
|
|
2138
|
+
/** Accessible name for the interactive control. @default "Rating" */
|
|
2139
|
+
label?: string;
|
|
2140
|
+
}
|
|
2141
|
+
/**
|
|
2142
|
+
* Star rating, for showing an average (read only, fractions allowed) or collecting one (click, drag-free,
|
|
2143
|
+
* arrow keys, optional half stars). Interactive mode is a single `slider` so screen readers announce
|
|
2144
|
+
* "3 out of 5" and keyboard users use Arrow, Home and End.
|
|
2145
|
+
*/
|
|
2146
|
+
declare function Rating({ value, defaultValue, onValueChange, max, precision, readOnly, disabled, showValue, count, label, tone, size, className, ...props }: RatingProps): React$1.JSX.Element;
|
|
2147
|
+
|
|
2148
|
+
interface NpsScaleProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue"> {
|
|
2149
|
+
/** 0 to 10, or null for no answer. */
|
|
2150
|
+
value?: number | null;
|
|
2151
|
+
defaultValue?: number | null;
|
|
2152
|
+
onValueChange?: (value: number) => void;
|
|
2153
|
+
/** Label under the left end. @default "Not at all likely" */
|
|
2154
|
+
lowLabel?: string;
|
|
2155
|
+
/** Label under the right end. @default "Extremely likely" */
|
|
2156
|
+
highLabel?: string;
|
|
2157
|
+
size?: "sm" | "md" | "lg";
|
|
2158
|
+
readOnly?: boolean;
|
|
2159
|
+
disabled?: boolean;
|
|
2160
|
+
/** Accessible name. @default "How likely are you to recommend us, from 0 to 10?" */
|
|
2161
|
+
label?: string;
|
|
2162
|
+
}
|
|
2163
|
+
/**
|
|
2164
|
+
* The 0 to 10 Net Promoter Score question. The chosen number takes the colour of its band:
|
|
2165
|
+
* 0 to 6 detractor, 7 to 8 passive, 9 to 10 promoter. Arrow keys move the choice; Home and End jump to 0 and 10.
|
|
2166
|
+
*/
|
|
2167
|
+
declare function NpsScale({ value, defaultValue, onValueChange, lowLabel, highLabel, size, readOnly, disabled, label, className, ...props }: NpsScaleProps): React$1.JSX.Element;
|
|
2168
|
+
interface NpsResult {
|
|
2169
|
+
/** Promoters minus detractors, as a whole number from -100 to 100. */
|
|
2170
|
+
score: number;
|
|
2171
|
+
promoters: number;
|
|
2172
|
+
passives: number;
|
|
2173
|
+
detractors: number;
|
|
2174
|
+
total: number;
|
|
2175
|
+
}
|
|
2176
|
+
/** Net Promoter Score from raw 0 to 10 answers. */
|
|
2177
|
+
declare function calculateNps(scores: number[]): NpsResult;
|
|
2178
|
+
|
|
2179
|
+
interface SentimentRatingProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue"> {
|
|
2180
|
+
/** `thumbs`: value 1 is up, -1 is down. `faces`: value 1 (very unhappy) to 5 (very happy). */
|
|
2181
|
+
variant?: "thumbs" | "faces";
|
|
2182
|
+
value?: number | null;
|
|
2183
|
+
defaultValue?: number | null;
|
|
2184
|
+
onValueChange?: (value: number) => void;
|
|
2185
|
+
size?: "sm" | "md" | "lg";
|
|
2186
|
+
disabled?: boolean;
|
|
2187
|
+
/** Accessible name. @default "How was it?" */
|
|
2188
|
+
label?: string;
|
|
2189
|
+
}
|
|
2190
|
+
/** Quick feedback in one tap: thumbs up or down, or a five-point face scale. Arrow keys move between options. */
|
|
2191
|
+
declare function SentimentRating({ variant, value, defaultValue, onValueChange, size, disabled, label, className, ...props }: SentimentRatingProps): React$1.JSX.Element;
|
|
2192
|
+
|
|
2193
|
+
interface RatingSummaryProps extends Omit<HTMLAttributes<HTMLDivElement>, "onSelect"> {
|
|
2194
|
+
/** How many ratings each star level got, from 1 star up: `[2, 1, 4, 20, 55]`. Average and total are derived from it. */
|
|
2195
|
+
counts: number[];
|
|
2196
|
+
/** Overrides the computed average (for example when it comes from your backend). */
|
|
2197
|
+
average?: number;
|
|
2198
|
+
/** Makes each row a button that reports its star level, for filtering reviews. */
|
|
2199
|
+
onSelect?: (stars: number) => void;
|
|
2200
|
+
/** The star level currently filtered, highlighted. */
|
|
2201
|
+
selected?: number | null;
|
|
2202
|
+
/** Noun for the total line. @default "reviews" */
|
|
2203
|
+
noun?: string;
|
|
2204
|
+
}
|
|
2205
|
+
/** Review summary: the average with stars and a count, beside a 5 to 1 distribution. */
|
|
2206
|
+
declare function RatingSummary({ counts, average, onSelect, selected, noun, className, ...props }: RatingSummaryProps): React$1.JSX.Element;
|
|
2207
|
+
|
|
2208
|
+
interface DonutDatum {
|
|
2209
|
+
label: string;
|
|
2210
|
+
value: number;
|
|
2211
|
+
tone?: string;
|
|
2212
|
+
color?: string;
|
|
2213
|
+
}
|
|
2214
|
+
interface DonutChartProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "title">, ChartA11yProps {
|
|
2215
|
+
data: DonutDatum[];
|
|
2216
|
+
/** Diameter in px (default 160). */
|
|
2217
|
+
size?: number;
|
|
2218
|
+
/** Ring thickness in px (default 18). */
|
|
2219
|
+
thickness?: number;
|
|
2220
|
+
/** Small text in the centre, above the value. */
|
|
2221
|
+
centerLabel?: string;
|
|
2222
|
+
/** Large text in the centre. Defaults to the total. */
|
|
2223
|
+
centerValue?: ReactNode;
|
|
2224
|
+
showLegend?: boolean;
|
|
2225
|
+
}
|
|
2226
|
+
/** A share-of-total ring with a centre readout and a legend that shows each slice's percentage. */
|
|
2227
|
+
declare function DonutChart({ data, size, thickness, centerLabel, centerValue, showLegend, title, description, patterns, className, ...props }: DonutChartProps): React$1.JSX.Element;
|
|
2228
|
+
|
|
2229
|
+
declare const badgeVariants: (props?: ({
|
|
2230
|
+
variant?: "outline" | "solid" | "surface" | "soft" | null | undefined;
|
|
2231
|
+
tone?: "brand" | "danger" | "success" | "warning" | "neutral" | null | undefined;
|
|
2232
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
2233
|
+
radius?: "small" | "none" | "inherit" | "medium" | "large" | "full" | "concentric" | null | undefined;
|
|
2234
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2235
|
+
interface BadgeProps extends Omit<React__default.HTMLAttributes<HTMLSpanElement>, "color">, VariantProps<typeof badgeVariants> {
|
|
2236
|
+
/** @deprecated Backward compatible alias of `tone`. Use `tone`. */
|
|
2237
|
+
color?: "neutral" | "brand" | "success" | "warning" | "danger";
|
|
2238
|
+
/** Optional icon node rendered before label. */
|
|
2239
|
+
icon?: React__default.ReactNode;
|
|
2240
|
+
}
|
|
2241
|
+
declare function Badge({ className, variant, tone, color, size, radius, icon, children, ...props }: BadgeProps): React__default.JSX.Element;
|
|
2242
|
+
|
|
2243
|
+
declare const calloutVariants: (props?: ({
|
|
2244
|
+
color?: "brand" | "danger" | "success" | "warning" | "neutral" | null | undefined;
|
|
2245
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2246
|
+
interface CalloutProps extends Omit<React__default.HTMLAttributes<HTMLDivElement>, "color">, VariantProps<typeof calloutVariants> {
|
|
2247
|
+
/** Title text header for callout. */
|
|
2248
|
+
title?: string;
|
|
2249
|
+
/**
|
|
2250
|
+
* Element for the title. Default `p`: a callout title labels a note, it does not open a
|
|
2251
|
+
* section. Use a heading level that fits the page outline when it should be navigable.
|
|
2252
|
+
*/
|
|
2253
|
+
titleAs?: "p" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
2254
|
+
/** Custom icon node override. */
|
|
2255
|
+
icon?: React__default.ReactNode;
|
|
2256
|
+
/**
|
|
2257
|
+
* ARIA role. Default `alert` for `color="danger"` and `status` for the other colours. Pass
|
|
2258
|
+
* `role="note"` for a static notice that is on the page from the first load.
|
|
2259
|
+
*/
|
|
2260
|
+
role?: React__default.AriaRole;
|
|
2261
|
+
}
|
|
2262
|
+
declare function Callout({ className, color, title, icon, titleAs: TitleTag, children, ...props }: CalloutProps): React__default.JSX.Element;
|
|
2263
|
+
|
|
2264
|
+
declare const emptyStateVariants: (props?: ({
|
|
2265
|
+
layout?: "inline" | "centered" | null | undefined;
|
|
2266
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
2267
|
+
variant?: "plain" | "bordered" | null | undefined;
|
|
2268
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2269
|
+
type EmptyStateKind = "first-time" | "empty" | "no-results" | "success";
|
|
2270
|
+
interface EmptyStateProps extends Omit<HTMLAttributes<HTMLDivElement>, "title">, VariantProps<typeof emptyStateVariants> {
|
|
2271
|
+
/**
|
|
2272
|
+
* The situation: sets the default icon only (copy always comes from you).
|
|
2273
|
+
* first-time = never created one; empty = had items, none now; no-results = a filter or search
|
|
2274
|
+
* matched nothing; success = a flow finished (a result screen).
|
|
2275
|
+
*/
|
|
2276
|
+
kind?: EmptyStateKind;
|
|
2277
|
+
/** Specific title: "No invoices yet", never "No data" or "Nothing here". */
|
|
2278
|
+
title: string;
|
|
2279
|
+
/** One sentence, at most 25 words: what is missing and how to add it. */
|
|
2280
|
+
description?: ReactNode;
|
|
2281
|
+
/** Icon override (use `<Icon name>`). Default per kind: inbox, folder-open, search-x, circle-check. */
|
|
2282
|
+
icon?: ReactNode;
|
|
2283
|
+
/** Monochrome illustration; replaces the icon. Rendered aria-hidden. */
|
|
2284
|
+
illustration?: ReactNode;
|
|
2285
|
+
/** The one primary action that fixes the emptiness (a Button). */
|
|
2286
|
+
action?: ReactNode;
|
|
2287
|
+
/** A second, quieter action (a ghost Button or Link). */
|
|
2288
|
+
secondaryAction?: ReactNode;
|
|
2289
|
+
/** Heading element, independent of size. Default h3. */
|
|
2290
|
+
titleAs?: "h2" | "h3" | "h4" | "h5" | "h6" | "p";
|
|
2291
|
+
/**
|
|
2292
|
+
* Announce the title (polite) once on mount, for an empty state that replaces content after the
|
|
2293
|
+
* user acts. Default true for no-results, false otherwise.
|
|
2294
|
+
*/
|
|
2295
|
+
announce?: boolean;
|
|
2296
|
+
/** Move focus to the title on mount. Recommended for kind="success" result screens. */
|
|
2297
|
+
focusOnMount?: boolean;
|
|
2298
|
+
}
|
|
2299
|
+
/**
|
|
2300
|
+
* EmptyState — the one component for "nothing is shown here yet": first-time, empty, no-results
|
|
2301
|
+
* and success result screens. Sits on the surface it replaces (no card, AP-09); `bordered` keeps a
|
|
2302
|
+
* region visible.
|
|
2303
|
+
*/
|
|
2304
|
+
declare function EmptyState({ kind, title, description, icon, illustration, action, secondaryAction, titleAs: TitleTag, announce: shouldAnnounce, focusOnMount, layout, size, variant, className, ...props }: EmptyStateProps): React$1.JSX.Element;
|
|
2305
|
+
|
|
2306
|
+
interface FormErrorSummaryItem {
|
|
2307
|
+
/** The invalid field's id (TextField / FormField `id`). */
|
|
2308
|
+
id: string;
|
|
2309
|
+
/** What is wrong and how to fix it: "Enter an email like name@company.com". */
|
|
2310
|
+
message: string;
|
|
2311
|
+
}
|
|
2312
|
+
interface FormErrorSummaryProps extends Omit<HTMLAttributes<HTMLDivElement>, "title" | "role" | "color"> {
|
|
2313
|
+
/** One entry per invalid field; each becomes a link that focuses that field. */
|
|
2314
|
+
errors: FormErrorSummaryItem[];
|
|
2315
|
+
/** Heading. Default "Fix 1 field to continue" / "Fix N fields to continue". */
|
|
2316
|
+
title?: string;
|
|
2317
|
+
/** Move focus to the heading when the summary appears after a failed submit (WCAG 3.3.1). Default true. */
|
|
2318
|
+
focusOnMount?: boolean;
|
|
2319
|
+
/** Heading element. Default h2. */
|
|
2320
|
+
titleAs?: "h2" | "h3" | "h4";
|
|
2321
|
+
}
|
|
2322
|
+
/**
|
|
2323
|
+
* FormErrorSummary — submit-time error list for forms of 3+ fields (WCAG 3.3.1). A danger Callout
|
|
2324
|
+
* with role="group" (not "alert": the focus move to its heading is the one announcement), a heading
|
|
2325
|
+
* that takes focus, and a link per invalid field. Keep the field-level errors as well.
|
|
2326
|
+
*/
|
|
2327
|
+
declare function FormErrorSummary({ errors, title, focusOnMount, titleAs: TitleTag, className, ...props }: FormErrorSummaryProps): React$1.JSX.Element | null;
|
|
2328
|
+
|
|
2329
|
+
declare const avatarVariants: (props?: ({
|
|
2330
|
+
size?: "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
2331
|
+
radius?: "small" | "none" | "inherit" | "medium" | "large" | "full" | "concentric" | null | undefined;
|
|
2332
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2333
|
+
/** Fallback fill. `neutral` is the default grey; the rest are tinted (`soft`) or filled (`solid`). */
|
|
2334
|
+
type AvatarColor = "neutral" | "brand" | "success" | "warning" | "danger";
|
|
2335
|
+
interface AvatarProps extends VariantProps<typeof avatarVariants> {
|
|
2336
|
+
/** Image source URL. */
|
|
2337
|
+
src?: string;
|
|
2338
|
+
/** Image alt text. */
|
|
2339
|
+
alt?: string;
|
|
2340
|
+
/** Text or letter fallback when image fails to load. */
|
|
2341
|
+
fallback?: React__default.ReactNode;
|
|
2342
|
+
/** Custom icon fallback, e.g. `<Icon name="globe" size="sm" />` (inherits the fallback colour). */
|
|
2343
|
+
fallbackIcon?: React__default.ReactNode;
|
|
2344
|
+
/** Fallback fill colour: use with `fallbackIcon` or initials for project, workspace or team avatars. Default `neutral`. */
|
|
2345
|
+
color?: AvatarColor;
|
|
2346
|
+
/** `soft` (tinted, default) or `solid` (filled) when `color` is not neutral. */
|
|
2347
|
+
variant?: "soft" | "solid";
|
|
2348
|
+
/** Optional custom CSS class name. */
|
|
2349
|
+
className?: string;
|
|
2350
|
+
}
|
|
2351
|
+
declare function Avatar({ src, alt, fallback, fallbackIcon, color, variant, size, radius, className, }: AvatarProps): React__default.JSX.Element;
|
|
2352
|
+
|
|
2353
|
+
declare const imageVariants: (props?: ({
|
|
2354
|
+
radius?: "small" | "none" | "inherit" | "medium" | "large" | "full" | "concentric" | null | undefined;
|
|
2355
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2356
|
+
interface ImageProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, "width" | "height">, VariantProps<typeof imageVariants> {
|
|
2357
|
+
/** Image source URL. */
|
|
2358
|
+
src?: string;
|
|
2359
|
+
/** Image accessible alt text. */
|
|
2360
|
+
alt?: string;
|
|
2361
|
+
/** CSS aspect-ratio string, e.g. "16/9", "1/1", "4/3". Reserves space to avoid layout shift. */
|
|
2362
|
+
ratio?: string;
|
|
2363
|
+
/** Object fit style: "cover", "contain", "fill", "none". Default "cover". */
|
|
2364
|
+
fit?: "cover" | "contain" | "fill" | "none";
|
|
2365
|
+
/** Custom placeholder node shown when src is missing or fails to load. */
|
|
2366
|
+
placeholder?: React__default.ReactNode;
|
|
2367
|
+
/** Overlay layers composited on top of the image (scrim / gradient / solid / fx),
|
|
2368
|
+
* same shorthand + JSON format as a layout's bgOverlays — one unified layer system. */
|
|
2369
|
+
bgOverlays?: string;
|
|
2370
|
+
}
|
|
2371
|
+
declare function Image({ src, alt, ratio, fit, radius, placeholder, bgOverlays, className, style, ...props }: ImageProps): React__default.JSX.Element;
|
|
2372
|
+
|
|
2373
|
+
declare const videoVariants: (props?: ({
|
|
2374
|
+
radius?: "small" | "none" | "inherit" | "medium" | "large" | "full" | "concentric" | null | undefined;
|
|
2375
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2376
|
+
interface VideoProps extends Omit<VideoHTMLAttributes<HTMLVideoElement>, "width" | "height">, VariantProps<typeof videoVariants> {
|
|
2377
|
+
/** Video source URL. */
|
|
2378
|
+
src?: string;
|
|
2379
|
+
/** Poster image URL shown before the video loads/plays. */
|
|
2380
|
+
poster?: string;
|
|
2381
|
+
/** Object fit style: "cover", "contain", "fill", "none". Default "cover". */
|
|
2382
|
+
fit?: "cover" | "contain" | "fill" | "none";
|
|
2383
|
+
/** CSS aspect-ratio string, e.g. "16/9", "1/1". Reserves space to avoid layout shift. */
|
|
2384
|
+
ratio?: string;
|
|
2385
|
+
/** Autoplay the video (muted is required by browsers for autoplay). Default true. */
|
|
2386
|
+
autoPlay?: boolean;
|
|
2387
|
+
/** Loop the video. Default true. */
|
|
2388
|
+
loop?: boolean;
|
|
2389
|
+
/** Mute the video. Default true. */
|
|
2390
|
+
muted?: boolean;
|
|
2391
|
+
/** Show native browser controls. Default false. */
|
|
2392
|
+
controls?: boolean;
|
|
2393
|
+
/** Custom placeholder node shown when src is missing. */
|
|
2394
|
+
placeholder?: React__default.ReactNode;
|
|
2395
|
+
/** WebVTT captions file for speech or meaningful sound (WCAG 1.2.2). */
|
|
2396
|
+
captions?: string;
|
|
2397
|
+
/** Language of the captions track. Default "en". */
|
|
2398
|
+
captionsLang?: string;
|
|
2399
|
+
/** What the video shows, for screen readers. Omit with `decorative`. */
|
|
2400
|
+
label?: string;
|
|
2401
|
+
/** Pure ambience (a background loop): hidden from screen readers. The pause button stays. */
|
|
2402
|
+
decorative?: boolean;
|
|
2403
|
+
}
|
|
2404
|
+
declare function Video({ src, poster, fit, ratio, radius, autoPlay, loop, muted, controls, placeholder, captions, captionsLang, label, decorative, className, style, ...props }: VideoProps): React__default.JSX.Element;
|
|
2405
|
+
|
|
2406
|
+
/**
|
|
2407
|
+
* Pause/play button for moving content: autoplay or looping video, background video and
|
|
2408
|
+
* fx animations (WCAG 2.2.2: anything that moves for more than five seconds next to other
|
|
2409
|
+
* content needs a way to stop it). Sits in the bottom-right corner of the nearest
|
|
2410
|
+
* positioned ancestor.
|
|
2411
|
+
*/
|
|
2412
|
+
declare function MotionPauseButton({ playing, onToggle, label, className, }: {
|
|
2413
|
+
playing: boolean;
|
|
2414
|
+
onToggle: () => void;
|
|
2415
|
+
/** What moves, read after "Pause"/"Play": "background video", "background animation". */
|
|
2416
|
+
label?: string;
|
|
2417
|
+
className?: string;
|
|
2418
|
+
}): React$1.JSX.Element;
|
|
2419
|
+
|
|
2420
|
+
declare const bubbleVariants: (props?: ({
|
|
2421
|
+
variant?: "system" | "incoming" | "outgoing" | null | undefined;
|
|
2422
|
+
sharpCorner?: "bottom" | "top" | "none" | null | undefined;
|
|
2423
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2424
|
+
/** Who is speaking. `variant` (incoming, outgoing, system) is the older spelling of the same thing. */
|
|
2425
|
+
type ChatRole = "user" | "assistant" | "system";
|
|
2426
|
+
/** bubble: text sits on a surface. flat: content flows as a document, which is what rich AI replies need. */
|
|
2427
|
+
type ChatLayout = "bubble" | "flat";
|
|
2428
|
+
/**
|
|
2429
|
+
* Lifecycle of a turn. submitted/streaming/ready/error match the Vercel AI SDK chat status;
|
|
2430
|
+
* stopped is a turn the user cut short.
|
|
2431
|
+
*/
|
|
2432
|
+
type ChatStatus = "ready" | "submitted" | "streaming" | "stopped" | "error";
|
|
2433
|
+
interface ChatBubbleProps extends VariantProps<typeof bubbleVariants> {
|
|
2434
|
+
/**
|
|
2435
|
+
* Message content. For AI turns pass the parts in order: Reasoning, ToolCall, text, CodeBlock, FileOutput.
|
|
2436
|
+
* Use layout="flat" (the default for role="assistant") so cards and code are not squeezed into a bubble.
|
|
2437
|
+
*/
|
|
2438
|
+
children?: React__default.ReactNode;
|
|
2439
|
+
/** user, assistant or system. Assistant defaults to layout="flat". Overrides `variant`. */
|
|
2440
|
+
role?: ChatRole;
|
|
2441
|
+
/** bubble or flat. Defaults to flat for role="assistant", bubble otherwise (and for `variant`). */
|
|
2442
|
+
layout?: ChatLayout;
|
|
2443
|
+
/** Which corner of a bubble gets the sharp speech-bubble tail. Default "top", as before. "none" keeps all corners round. */
|
|
2444
|
+
sharpCorner?: "bottom" | "top" | "none";
|
|
2445
|
+
/** Turn lifecycle. Default "ready". submitted shows the pending indicator, streaming a live caret, stopped a label, error a retry row. */
|
|
2446
|
+
status?: ChatStatus;
|
|
2447
|
+
/** Live, unconfirmed text (a speech transcript still being heard). Shown italic and quiet until you drop the flag. */
|
|
2448
|
+
interim?: boolean;
|
|
2449
|
+
/** Message shown when status="error". */
|
|
2450
|
+
error?: string;
|
|
2451
|
+
/** Called by the Retry button in the error row. */
|
|
2452
|
+
onRetry?: () => void;
|
|
2453
|
+
/** Footer actions (copy, regenerate, feedback). Hidden while submitted or streaming. */
|
|
2454
|
+
actions?: React__default.ReactNode;
|
|
2455
|
+
/** Replaces the pending indicator shown while status="submitted". Default is a Murmur with pendingLabel. */
|
|
2456
|
+
indicator?: React__default.ReactNode;
|
|
2457
|
+
/** Text beside the pending indicator. Default "Thinking…". */
|
|
2458
|
+
pendingLabel?: string;
|
|
2459
|
+
/** Name shown above the bubble. */
|
|
2460
|
+
author?: string;
|
|
2461
|
+
/** Timestamp / status shown under the bubble. */
|
|
2462
|
+
timestamp?: string;
|
|
2463
|
+
/** If true, the timestamp only appears on hover. */
|
|
2464
|
+
hoverTimestamp?: boolean;
|
|
2465
|
+
/** Avatar image for the message sender. */
|
|
2466
|
+
avatarSrc?: string;
|
|
2467
|
+
/** Fallback initials when no avatar image (e.g. "AI", "AB"). */
|
|
2468
|
+
avatarFallback?: string;
|
|
2469
|
+
/** Hide the avatar column. */
|
|
2470
|
+
hideAvatar?: boolean;
|
|
2471
|
+
/** Optional custom CSS class name. */
|
|
2472
|
+
className?: string;
|
|
2473
|
+
}
|
|
2474
|
+
/**
|
|
2475
|
+
* One message in a conversation, human or AI. Handles who is speaking, how the content is laid out,
|
|
2476
|
+
* and the turn lifecycle (pending, streaming, stopped, error) so an AI framework only has to map its
|
|
2477
|
+
* message parts and status onto it.
|
|
2478
|
+
*/
|
|
2479
|
+
declare function ChatBubble({ children, variant, role, layout, sharpCorner, status, interim, error, onRetry, actions, indicator, pendingLabel, author, timestamp, hoverTimestamp, avatarSrc, avatarFallback, hideAvatar, className, }: ChatBubbleProps): React__default.JSX.Element;
|
|
2480
|
+
|
|
2481
|
+
/** Built-in states (all free). Other names resolve to states added with registerMurmurState. */
|
|
2482
|
+
type MurmurState = "idle" | "thinking" | "working" | "listening" | "searching" | "composing" | "weaving" | "connecting" | "orbiting" | "looping" | (string & {});
|
|
2483
|
+
interface MurmurProps extends Omit<React__default.HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
2484
|
+
/** Which motion to play. Default "thinking". */
|
|
2485
|
+
state?: MurmurState;
|
|
2486
|
+
/** Diameter in px. Default 24. */
|
|
2487
|
+
size?: number;
|
|
2488
|
+
/** Live input level 0-1 that drives "listening". */
|
|
2489
|
+
level?: number;
|
|
2490
|
+
/** Speed multiplier. Default 1. */
|
|
2491
|
+
speed?: number;
|
|
2492
|
+
/** Number of dots. Default scales with size. */
|
|
2493
|
+
dots?: number;
|
|
2494
|
+
/** Dot size multiplier. Default 0.4. */
|
|
2495
|
+
dotSize?: number;
|
|
2496
|
+
/** Accessible name. Default is the state, e.g. "Thinking". Pass "" to hide it from assistive tech when a visible label sits beside it. */
|
|
2497
|
+
label?: string;
|
|
2498
|
+
}
|
|
2499
|
+
/**
|
|
2500
|
+
* A living dot-sphere that shows what an AI is doing. Colour follows the text colour
|
|
2501
|
+
* (brand by default), motion pauses off screen and stops under prefers-reduced-motion.
|
|
2502
|
+
*/
|
|
2503
|
+
declare function Murmur({ state, size, level, speed, dots, dotSize, label, className, style, ...props }: MurmurProps): React__default.JSX.Element;
|
|
2504
|
+
|
|
2505
|
+
/**
|
|
2506
|
+
* Murmur engine: a swarm of dots on a sphere, moved by a per-state function.
|
|
2507
|
+
* Every state is built in and free: idle, thinking, working, listening, searching, composing,
|
|
2508
|
+
* weaving, connecting, and the loaders orbiting and looping. Add your own with
|
|
2509
|
+
* `registerMurmurState`.
|
|
2510
|
+
*/
|
|
2511
|
+
interface MurmurFrame {
|
|
2512
|
+
/** Milliseconds since the component mounted. */
|
|
2513
|
+
t: number;
|
|
2514
|
+
/** Live input level 0-1 (listening). */
|
|
2515
|
+
level: number;
|
|
2516
|
+
/** Speed multiplier. */
|
|
2517
|
+
speed: number;
|
|
2518
|
+
}
|
|
2519
|
+
/** A dot's fixed identity: a point on the unit sphere plus a random phase. */
|
|
2520
|
+
interface MurmurDot {
|
|
2521
|
+
x: number;
|
|
2522
|
+
y: number;
|
|
2523
|
+
z: number;
|
|
2524
|
+
/** 0-2π, random but stable per dot. */
|
|
2525
|
+
phase: number;
|
|
2526
|
+
/** 0-1 position index along the swarm, for sweeps and waves. */
|
|
2527
|
+
index: number;
|
|
2528
|
+
}
|
|
2529
|
+
/** What a state function writes for each dot, each frame. Unit space, z toward the viewer. */
|
|
2530
|
+
interface MurmurOut {
|
|
2531
|
+
x: number;
|
|
2532
|
+
y: number;
|
|
2533
|
+
z: number;
|
|
2534
|
+
/** Dot size multiplier, 1 = default. */
|
|
2535
|
+
size: number;
|
|
2536
|
+
/** 0-1. */
|
|
2537
|
+
alpha: number;
|
|
2538
|
+
}
|
|
2539
|
+
type MurmurStateFn = (dot: MurmurDot, frame: MurmurFrame, out: MurmurOut) => void;
|
|
2540
|
+
/** Adds or replaces a state. */
|
|
2541
|
+
declare function registerMurmurState(name: string, fn: MurmurStateFn): void;
|
|
2542
|
+
/** Every built-in state. */
|
|
2543
|
+
declare const MURMUR_STATES: string[];
|
|
2544
|
+
|
|
2545
|
+
/** Static, token-driven variants. `registerBackdrop` lets an app add its own. */
|
|
2546
|
+
declare const BACKDROP_FREE_VARIANTS: readonly ["mesh", "aurora", "grid", "dots"];
|
|
2547
|
+
type BackdropVariant = (typeof BACKDROP_FREE_VARIANTS)[number] | (string & {});
|
|
2548
|
+
interface BackdropProps extends HTMLAttributes<HTMLDivElement> {
|
|
2549
|
+
/** Which backdrop to draw. Unknown names fall back to `mesh`. */
|
|
2550
|
+
variant?: BackdropVariant;
|
|
2551
|
+
/** Per-variant params forwarded to a registered renderer (e.g. an fx effect's speed/strength). */
|
|
2552
|
+
params?: Record<string, string>;
|
|
2553
|
+
}
|
|
2554
|
+
type BackdropRenderer = ComponentType<{
|
|
2555
|
+
className?: string;
|
|
2556
|
+
params?: Record<string, string>;
|
|
2557
|
+
}>;
|
|
2558
|
+
/** Adds or replaces a backdrop variant. @shavin/fx (`npm i @shavin/fx`, free to use under its own licence) uses this to install its effect variants. */
|
|
2559
|
+
declare function registerBackdrop(name: string, renderer: BackdropRenderer): void;
|
|
2560
|
+
/** A decorative, token-driven background that fills its positioned parent. Put content above it with `relative`. */
|
|
2561
|
+
declare function Backdrop({ variant, className, params, ...props }: BackdropProps): React$1.JSX.Element;
|
|
2562
|
+
|
|
2563
|
+
interface ReasoningProps extends Omit<React__default.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
2564
|
+
/** The model's thinking text. */
|
|
2565
|
+
children?: React__default.ReactNode;
|
|
2566
|
+
/** thinking: live, open by default with a pulsing mark. done: collapsed summary. Default "done". */
|
|
2567
|
+
status?: "thinking" | "done";
|
|
2568
|
+
/** Elapsed time shown when done, e.g. "4s". Omit it and the component times the thinking itself. */
|
|
2569
|
+
duration?: string;
|
|
2570
|
+
/** Fold the text away when status goes from thinking to done (uncontrolled only). Default true; pass false to leave it open. */
|
|
2571
|
+
autoCollapse?: boolean;
|
|
2572
|
+
/** Cap the open text at this height (px or CSS length) and scroll inside it, so a long chain of thought does not push the message down. */
|
|
2573
|
+
maxHeight?: number | string;
|
|
2574
|
+
/** Override the trigger label. */
|
|
2575
|
+
label?: string;
|
|
2576
|
+
/** Initial open state when uncontrolled. Defaults to open while thinking, closed when done. */
|
|
2577
|
+
defaultOpen?: boolean;
|
|
2578
|
+
/** Controlled open state. */
|
|
2579
|
+
open?: boolean;
|
|
2580
|
+
onOpenChange?: (open: boolean) => void;
|
|
2581
|
+
/**
|
|
2582
|
+
* Hit-area override (docs: "Target size"). "default": 24px floor (this control stays at 24px on touch). "none": no hit area
|
|
2583
|
+
* growth (dense toolbars; may go below 24px, yours to own). "touch": always 44px on a coarse pointer.
|
|
2584
|
+
*/
|
|
2585
|
+
hitArea?: HitArea;
|
|
2586
|
+
}
|
|
2587
|
+
/** Collapsible "Thinking…" / "Thought for 4s" disclosure for a model's reasoning. */
|
|
2588
|
+
declare function Reasoning({ children, status, duration, maxHeight, autoCollapse, label, defaultOpen, open: openProp, onOpenChange, hitArea, className, ...props }: ReasoningProps): React__default.JSX.Element;
|
|
2589
|
+
|
|
2590
|
+
type ToolCallStatus = "pending" | "running" | "needs-approval" | "done" | "error" | "denied";
|
|
2591
|
+
type ToolApprovalScope = "once" | "always";
|
|
2592
|
+
interface ToolCallProps extends Omit<React__default.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
2593
|
+
/** Tool identifier shown in monospace, e.g. "search_tickets". Also names the approval group. */
|
|
2594
|
+
name: string;
|
|
2595
|
+
/** Plain-language heading shown instead of `name` (wraps, not monospace): "Change text". */
|
|
2596
|
+
title?: string;
|
|
2597
|
+
/** Hide the status badge and keep the icon (the label stays for screen readers). For narrow panels. */
|
|
2598
|
+
compact?: boolean;
|
|
2599
|
+
/** Row under the result for actions about this call, such as Undo. */
|
|
2600
|
+
footer?: React__default.ReactNode;
|
|
2601
|
+
/** Lifecycle of the call. */
|
|
2602
|
+
status?: ToolCallStatus;
|
|
2603
|
+
/** One line saying what the tool is doing or wants to do, in plain language. */
|
|
2604
|
+
description?: string;
|
|
2605
|
+
/** What the tool will receive, shown in the approval request (e.g. a query or file path). */
|
|
2606
|
+
input?: string;
|
|
2607
|
+
/** Result of the call. Shown when done or failed. */
|
|
2608
|
+
children?: React__default.ReactNode;
|
|
2609
|
+
/** Called when the user allows a call that needs approval. */
|
|
2610
|
+
onApprove?: (scope: ToolApprovalScope) => void;
|
|
2611
|
+
/** Called when the user denies a call that needs approval. */
|
|
2612
|
+
onDeny?: () => void;
|
|
2613
|
+
/** Hide the "Always allow" choice. */
|
|
2614
|
+
hideAlways?: boolean;
|
|
2615
|
+
}
|
|
2616
|
+
/** One tool/function call by an assistant, including the permission request before it runs. */
|
|
2617
|
+
declare function ToolCall({ name, title, compact, footer, status, description, input, children, onApprove, onDeny, hideAlways, className, ...props }: ToolCallProps): React__default.JSX.Element;
|
|
2618
|
+
|
|
2619
|
+
type FileOutputKind = "document" | "spreadsheet" | "image" | "code" | "archive" | "file";
|
|
2620
|
+
type FileOutputStatus = "generating" | "ready" | "error";
|
|
2621
|
+
interface FileOutputProps extends Omit<React__default.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
2622
|
+
/** File name with extension. */
|
|
2623
|
+
name: string;
|
|
2624
|
+
/** Icon family. Default "file". */
|
|
2625
|
+
kind?: FileOutputKind;
|
|
2626
|
+
/** generating: spinner or progress, ready: download, error. Default "ready". */
|
|
2627
|
+
status?: FileOutputStatus;
|
|
2628
|
+
/** Size or detail text, e.g. "1.8 MB". */
|
|
2629
|
+
meta?: string;
|
|
2630
|
+
/** 0-100. Shows a determinate bar while generating. */
|
|
2631
|
+
progress?: number;
|
|
2632
|
+
/** Download URL. Renders the action as a link. */
|
|
2633
|
+
href?: string;
|
|
2634
|
+
/** Download handler when there is no href. */
|
|
2635
|
+
onDownload?: () => void;
|
|
2636
|
+
/** Message shown when status="error". */
|
|
2637
|
+
error?: string;
|
|
2638
|
+
/** Label for the action. Default "Download". */
|
|
2639
|
+
actionLabel?: string;
|
|
2640
|
+
}
|
|
2641
|
+
/** A file the assistant produced: generating, ready to download, or failed. */
|
|
2642
|
+
declare function FileOutput({ name, kind, status, meta, progress, href, onDownload, error, actionLabel, className, ...props }: FileOutputProps): React__default.JSX.Element;
|
|
2643
|
+
|
|
2644
|
+
type VoiceInputState = "idle" | "requesting" | "listening" | "transcribing" | "processing" | "error";
|
|
2645
|
+
/** push-to-send: record, then press send (a composer). hands-free: the app detects when you stop talking, so there is nothing to send. */
|
|
2646
|
+
type VoiceInputMode = "push-to-send" | "hands-free";
|
|
2647
|
+
interface VoiceInputProps extends Omit<React__default.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
2648
|
+
/** Current state. Default "idle". processing is the step after transcribing, when the app acts on what was said. */
|
|
2649
|
+
state?: VoiceInputState;
|
|
2650
|
+
/** Default "push-to-send". hands-free drops the send arrow: one Stop button ends the session, and the layout is a centred stack that fits a side panel. */
|
|
2651
|
+
mode?: VoiceInputMode;
|
|
2652
|
+
/** Quiet line under the status, e.g. what the voice command will act on ("Pointing at Hero heading"). */
|
|
2653
|
+
description?: string;
|
|
2654
|
+
/** Text for the processing state. Default "Working on it…". */
|
|
2655
|
+
processingLabel?: string;
|
|
2656
|
+
/** Live input level 0-1 that drives the bars while listening. Omit for a gentle idle pulse. */
|
|
2657
|
+
level?: number;
|
|
2658
|
+
/** Elapsed recording time, e.g. "0:07". */
|
|
2659
|
+
elapsed?: string;
|
|
2660
|
+
/** Live or final transcript shown while listening or transcribing. Wraps up to two lines. */
|
|
2661
|
+
transcript?: string;
|
|
2662
|
+
/** Message shown when state="error" (e.g. "Microphone blocked"). */
|
|
2663
|
+
error?: string;
|
|
2664
|
+
/** Dismiss the error and return to idle (error). */
|
|
2665
|
+
onDismiss?: () => void;
|
|
2666
|
+
/** Start recording (idle and error). */
|
|
2667
|
+
onStart?: () => void;
|
|
2668
|
+
/** Stop and send (listening). */
|
|
2669
|
+
onStop?: () => void;
|
|
2670
|
+
/** Discard the recording (listening). Also shows a cancel button while requesting, transcribing and processing, so nobody has to wait it out. */
|
|
2671
|
+
onCancel?: () => void;
|
|
2672
|
+
}
|
|
2673
|
+
/** Voice-to-text control for a composer: idle mic, permission wait, live waveform, transcribing, error. */
|
|
2674
|
+
declare function VoiceInput({ state, mode, description, processingLabel, level, elapsed, transcript, error, onStart, onDismiss, onStop, onCancel, className, ...props }: VoiceInputProps): React__default.JSX.Element;
|
|
2675
|
+
|
|
2676
|
+
declare const progressVariants: (props?: ({
|
|
2677
|
+
variant?: "bar" | "top-bar" | null | undefined;
|
|
2678
|
+
size?: "sm" | "md" | null | undefined;
|
|
2679
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2680
|
+
interface ProgressProps extends VariantProps<typeof progressVariants> {
|
|
2681
|
+
/** 0-100 percentage. When omitted or set to null, progress operates in indeterminate loading mode. */
|
|
2682
|
+
value?: number | null;
|
|
2683
|
+
/** Force indeterminate infinite sliding animation. */
|
|
2684
|
+
indeterminate?: boolean;
|
|
2685
|
+
/** Display numeric percentage indicator. @default false */
|
|
2686
|
+
showValue?: boolean;
|
|
2687
|
+
/** Custom formatter function for numeric indicator. @default (v) => `${Math.round(v)}%` */
|
|
2688
|
+
valueFormat?: (value: number) => string;
|
|
2689
|
+
/** Title or label text displayed above or alongside the progress bar. */
|
|
2690
|
+
label?: string;
|
|
2691
|
+
/** Position of numeric indicator & label ("top" header row or "right" side-by-side). @default "right" */
|
|
2692
|
+
labelPosition?: "top" | "right";
|
|
2693
|
+
/** Accessible name when the bar has no visible `label` (e.g. a heading above names it). */
|
|
2694
|
+
"aria-label"?: string;
|
|
2695
|
+
className?: string;
|
|
2696
|
+
}
|
|
2697
|
+
declare function Progress({ value, indeterminate, showValue, valueFormat, label, labelPosition, "aria-label": ariaLabel, variant, size, className, }: ProgressProps): React$1.JSX.Element;
|
|
2698
|
+
|
|
2699
|
+
declare const spinnerVariants: (props?: ({
|
|
2700
|
+
variant?: "ellipsis" | "dots" | "spin" | "glyph" | null | undefined;
|
|
2701
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
2702
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2703
|
+
interface SpinnerProps extends HTMLAttributes<HTMLElement>, VariantProps<typeof spinnerVariants> {
|
|
2704
|
+
/** Custom array of glyphs for variant="glyph". Default ["✻", "✽", "✶", "✳", "✢"] */
|
|
2705
|
+
glyphs?: string[];
|
|
2706
|
+
/** Animation cycle interval in ms for variant="glyph" or variant="ellipsis". Default 200 */
|
|
2707
|
+
intervalMs?: number;
|
|
2708
|
+
/** What is loading, for screen readers. Default "Loading". */
|
|
2709
|
+
label?: string;
|
|
2710
|
+
}
|
|
2711
|
+
declare function Spinner({ variant, size, glyphs, intervalMs, label, className, ...props }: SpinnerProps): React__default.JSX.Element;
|
|
2712
|
+
|
|
2713
|
+
interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {
|
|
2714
|
+
className?: string;
|
|
2715
|
+
}
|
|
2716
|
+
declare function Skeleton({ className, ...props }: SkeletonProps): React$1.JSX.Element;
|
|
2717
|
+
interface SkeletonMimicProps {
|
|
2718
|
+
/** Whether loading placeholder overlay is active. Default true. */
|
|
2719
|
+
loading?: boolean;
|
|
2720
|
+
/** Actual component structure to mirror into loading pulse placeholders. */
|
|
2721
|
+
children: ReactNode;
|
|
2722
|
+
className?: string;
|
|
2723
|
+
}
|
|
2724
|
+
declare function SkeletonMimic({ loading, children, className, }: SkeletonMimicProps): React$1.JSX.Element;
|
|
2725
|
+
|
|
2726
|
+
declare const dataListVariants: (props?: ({
|
|
2727
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
2728
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2729
|
+
interface DataListProps extends HTMLAttributes<HTMLDListElement>, VariantProps<typeof dataListVariants> {
|
|
2730
|
+
}
|
|
2731
|
+
declare function DataList({ orientation, className, ...props }: DataListProps): React$1.JSX.Element;
|
|
2732
|
+
interface DataListItemProps {
|
|
2733
|
+
/** Label text for data term definition. */
|
|
2734
|
+
label: string;
|
|
2735
|
+
/** Optional custom CSS class name. */
|
|
2736
|
+
className?: string;
|
|
2737
|
+
/** Value content. */
|
|
2738
|
+
children: ReactNode;
|
|
2739
|
+
}
|
|
2740
|
+
declare function DataListItem({ label, className, children, }: DataListItemProps): React$1.JSX.Element;
|
|
2741
|
+
|
|
2742
|
+
declare const listVariants: (props?: ({
|
|
2743
|
+
marker?: "number" | "none" | "bullet" | "lower-roman" | "upper-roman" | "lower-alpha" | "upper-alpha" | null | undefined;
|
|
2744
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2745
|
+
interface ListProps extends HTMLAttributes<HTMLUListElement | HTMLOListElement>, VariantProps<typeof listVariants> {
|
|
2746
|
+
/** Underlying tag type override: "ul" (unordered list) or "ol" (ordered list). Auto-inferred if marker is set. */
|
|
2747
|
+
as?: "ul" | "ol";
|
|
2748
|
+
}
|
|
2749
|
+
declare function List({ as, marker, className, ...props }: ListProps): React$1.JSX.Element;
|
|
2750
|
+
interface ListItemProps extends LiHTMLAttributes<HTMLLIElement> {
|
|
2751
|
+
}
|
|
2752
|
+
declare function ListItem({ className, ...props }: ListItemProps): React$1.JSX.Element;
|
|
2753
|
+
|
|
2754
|
+
interface TableProps extends HTMLAttributes<HTMLTableElement> {
|
|
2755
|
+
/** Accessible name of the scrolling region, announced once the table is wider than its container. Defaults to the table's own `aria-label` or "Scrollable table". */
|
|
2756
|
+
scrollLabel?: string;
|
|
2757
|
+
}
|
|
2758
|
+
/**
|
|
2759
|
+
* A table that never clips. It scrolls sideways inside its own container when it is wider than the space it is given,
|
|
2760
|
+
* fades the edge that still has content (so cut-off values read as "scroll for more"), and becomes keyboard focusable
|
|
2761
|
+
* only while it scrolls. Keep the first column short, and do not wrap a Table in `overflow-hidden`.
|
|
2762
|
+
*/
|
|
2763
|
+
declare function Table({ className, children, scrollLabel, ...props }: TableProps): React$1.JSX.Element;
|
|
2764
|
+
interface TableHeaderProps extends HTMLAttributes<HTMLTableSectionElement> {
|
|
2765
|
+
}
|
|
2766
|
+
declare function TableHeader({ className, ...props }: TableHeaderProps): React$1.JSX.Element;
|
|
2767
|
+
interface TableBodyProps extends HTMLAttributes<HTMLTableSectionElement> {
|
|
2768
|
+
}
|
|
2769
|
+
declare function TableBody({ className, ...props }: TableBodyProps): React$1.JSX.Element;
|
|
2770
|
+
interface TableRowProps extends HTMLAttributes<HTMLTableRowElement> {
|
|
2771
|
+
}
|
|
2772
|
+
declare function TableRow({ className, onClick, ...props }: TableRowProps): React$1.JSX.Element;
|
|
2773
|
+
interface TableColumnHeaderCellProps extends ThHTMLAttributes<HTMLTableCellElement> {
|
|
2774
|
+
}
|
|
2775
|
+
declare function TableColumnHeaderCell({ className, ...props }: TableColumnHeaderCellProps): React$1.JSX.Element;
|
|
2776
|
+
interface TableCellProps extends TdHTMLAttributes<HTMLTableCellElement> {
|
|
2777
|
+
}
|
|
2778
|
+
declare function TableCell({ className, ...props }: TableCellProps): React$1.JSX.Element;
|
|
2779
|
+
|
|
2780
|
+
declare const separatorVariants: (props?: ({
|
|
2781
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
2782
|
+
size?: "1" | "2" | "3" | "4" | "full" | null | undefined;
|
|
2783
|
+
color?: "default" | "inherit" | "hairline-strong" | "hairline" | "brand" | "danger" | "muted" | "subtle" | "contrast" | null | undefined;
|
|
2784
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2785
|
+
type SeparatorColorToken = "hairline" | "hairline-strong" | "subtle" | "muted" | "default" | "brand" | "contrast" | "danger" | "inherit";
|
|
2786
|
+
type SeparatorSizeToken = "1" | "2" | "3" | "4" | "full";
|
|
2787
|
+
interface SeparatorProps extends Omit<React__default.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>, "color" | "size" | "orientation">, Omit<VariantProps<typeof separatorVariants>, "color"> {
|
|
2788
|
+
color?: SeparatorColorToken | (string & {});
|
|
2789
|
+
size?: SeparatorSizeToken;
|
|
2790
|
+
orientation?: "horizontal" | "vertical";
|
|
2791
|
+
}
|
|
2792
|
+
declare const Separator: React__default.ForwardRefExoticComponent<SeparatorProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
2793
|
+
|
|
2794
|
+
interface SortableProps<T> {
|
|
2795
|
+
/** Array of items to reorder. */
|
|
2796
|
+
items: T[];
|
|
2797
|
+
/** Callback fired when items are drag-reordered. */
|
|
2798
|
+
onReorder: (next: T[]) => void;
|
|
2799
|
+
/** Function returning unique key per item. */
|
|
2800
|
+
getKey: (item: T, index: number) => string | number;
|
|
2801
|
+
/** Render prop function for item row content. */
|
|
2802
|
+
children: (item: T, index: number) => ReactNode;
|
|
2803
|
+
/** Orientation mode: "vertical" (list), "horizontal" (row), or "grid". Default "vertical". */
|
|
2804
|
+
orientation?: "vertical" | "horizontal" | "grid";
|
|
2805
|
+
/** Name of each item for screen-reader announcements. Defaults to its key. */
|
|
2806
|
+
getLabel?: (item: T, index: number) => string;
|
|
2807
|
+
/** Accessible name of the list. */
|
|
2808
|
+
"aria-label"?: string;
|
|
2809
|
+
className?: string;
|
|
2810
|
+
}
|
|
2811
|
+
/**
|
|
2812
|
+
* Drag to reorder with the mouse, or with the keyboard through `SortableHandle`
|
|
2813
|
+
* (WCAG 2.1.1): Space or Enter picks an item up, the arrow keys move it, Space or
|
|
2814
|
+
* Enter drops it, Escape puts it back. Every step is announced.
|
|
2815
|
+
*/
|
|
2816
|
+
declare function Sortable<T>({ items, onReorder, getKey, children, orientation, getLabel, "aria-label": ariaLabel, className, }: SortableProps<T>): React$1.JSX.Element;
|
|
2817
|
+
interface SortableHandleProps {
|
|
2818
|
+
className?: string;
|
|
2819
|
+
/**
|
|
2820
|
+
* Hit-area override (docs: "Target size"). "default": 24px floor (this control stays at 24px on touch). "none": no hit area
|
|
2821
|
+
* growth (dense toolbars; may go below 24px, yours to own). "touch": always 44px on a coarse pointer.
|
|
2822
|
+
*/
|
|
2823
|
+
hitArea?: HitArea;
|
|
2824
|
+
}
|
|
2825
|
+
/** Grip for a Sortable item: a drag affordance for the pointer and the keyboard control for reordering. */
|
|
2826
|
+
declare function SortableHandle({ className, hitArea }: SortableHandleProps): React$1.JSX.Element;
|
|
2827
|
+
|
|
2828
|
+
declare const AspectRatio: React$1.ForwardRefExoticComponent<AspectRatioPrimitive.AspectRatioProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
2829
|
+
|
|
2830
|
+
declare const insetVariants: (props?: ({
|
|
2831
|
+
p?: "sm" | "md" | null | undefined;
|
|
2832
|
+
side?: "x" | "bottom" | "top" | "all" | null | undefined;
|
|
2833
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2834
|
+
interface InsetProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof insetVariants> {
|
|
2835
|
+
/** Whether to clip overflow to parent card radius (overflow-hidden rounded-[var(--radius-panel)]). */
|
|
2836
|
+
clip?: boolean;
|
|
2837
|
+
}
|
|
2838
|
+
declare function Inset({ side, p, clip, className, ...props }: InsetProps): React$1.JSX.Element;
|
|
2839
|
+
|
|
2840
|
+
type TabVariant = "line" | "segmented" | "pills" | "button" | "pill";
|
|
2841
|
+
type TabOrientation = "horizontal" | "vertical";
|
|
2842
|
+
interface TabItem {
|
|
2843
|
+
value?: string;
|
|
2844
|
+
href?: string;
|
|
2845
|
+
label: ReactNode;
|
|
2846
|
+
icon?: ReactNode;
|
|
2847
|
+
content?: ReactNode;
|
|
2848
|
+
disabled?: boolean;
|
|
2849
|
+
active?: boolean;
|
|
2850
|
+
external?: boolean;
|
|
2851
|
+
}
|
|
2852
|
+
interface TabsProps {
|
|
2853
|
+
/** Mode: "states" for in-page stateful panels (default), "navigation" for URL routing links. */
|
|
2854
|
+
as?: "states" | "navigation";
|
|
2855
|
+
/** Visual variant: "line" (default), "segmented", "pills", or "button". */
|
|
2856
|
+
variant?: TabVariant;
|
|
2857
|
+
/** Layout orientation: "horizontal" (default) or "vertical". */
|
|
2858
|
+
orientation?: "horizontal" | "vertical";
|
|
2859
|
+
/** Component size: "sm" (small) or "md" (medium, default). */
|
|
2860
|
+
size?: "sm" | "md";
|
|
2861
|
+
value?: string;
|
|
2862
|
+
defaultValue?: string;
|
|
2863
|
+
onValueChange?: (value: string) => void;
|
|
2864
|
+
/** List of tab items. */
|
|
2865
|
+
items?: readonly TabItem[];
|
|
2866
|
+
/** Alias for items when passing data-driven tabs. */
|
|
2867
|
+
tabs?: readonly TabItem[];
|
|
2868
|
+
/** Router component for as="navigation" mode (defaults to "a"). */
|
|
2869
|
+
linkComponent?: ElementType;
|
|
2870
|
+
children?: ReactNode;
|
|
2871
|
+
className?: string;
|
|
2872
|
+
/** Names the tab list (states) or the `<nav>` landmark (navigation). */
|
|
2873
|
+
"aria-label"?: string;
|
|
2874
|
+
/**
|
|
2875
|
+
* Hit-area override (docs: "Target size"). "default": 24px floor, 44px on touch. "none": no hit area
|
|
2876
|
+
* growth (dense toolbars; may go below 24px, yours to own). "touch": always 44px on a coarse pointer.
|
|
2877
|
+
*/
|
|
2878
|
+
hitArea?: HitArea;
|
|
2879
|
+
}
|
|
2880
|
+
declare function Tabs({ as, variant, orientation, size, value, defaultValue, onValueChange, items, tabs, linkComponent: LinkComponent, children, className, hitArea, "aria-label": ariaLabel, }: TabsProps): React$1.JSX.Element;
|
|
2881
|
+
declare function TabsList({ children, className, variant, orientation, hitArea, "aria-label": ariaLabel, }: {
|
|
2882
|
+
children: ReactNode;
|
|
2883
|
+
className?: string;
|
|
2884
|
+
variant?: TabVariant;
|
|
2885
|
+
orientation?: TabOrientation;
|
|
2886
|
+
/** Hit-area override for every trigger in this list. See Tabs. */
|
|
2887
|
+
hitArea?: HitArea;
|
|
2888
|
+
"aria-label"?: string;
|
|
2889
|
+
}): React$1.JSX.Element;
|
|
2890
|
+
/** Extra button props (aria-*, data-*, id, title, handlers) pass through to the Radix trigger and win over its own,
|
|
2891
|
+
* e.g. `aria-controls` when the panel is rendered outside `<Tabs>`. */
|
|
2892
|
+
declare function TabsTrigger({ value, children, className, variant: variantProp, orientation: orientationProp, hitArea: hitAreaProp, disabled, ...props }: Omit<ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>, "value" | "children" | "className" | "disabled"> & {
|
|
2893
|
+
value: string;
|
|
2894
|
+
children: ReactNode;
|
|
2895
|
+
className?: string;
|
|
2896
|
+
variant?: TabVariant;
|
|
2897
|
+
orientation?: TabOrientation;
|
|
2898
|
+
/** Hit-area override for this trigger; defaults to the list's. See Tabs. */
|
|
2899
|
+
hitArea?: HitArea;
|
|
2900
|
+
disabled?: boolean;
|
|
2901
|
+
}): React$1.JSX.Element;
|
|
2902
|
+
declare function TabsContent({ value, children, className, ...props }: Omit<ComponentPropsWithoutRef<typeof TabsPrimitive.Content>, "value" | "children" | "className"> & {
|
|
2903
|
+
value: string;
|
|
2904
|
+
children: ReactNode;
|
|
2905
|
+
className?: string;
|
|
2906
|
+
}): React$1.JSX.Element;
|
|
2907
|
+
|
|
2908
|
+
declare const rowVariants: (props?: ({
|
|
2909
|
+
active?: boolean | null | undefined;
|
|
2910
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2911
|
+
interface RowProps extends HTMLAttributes<HTMLElement>, VariantProps<typeof rowVariants> {
|
|
2912
|
+
/** Polymorphic element tag: "button" (default for single click target) or "div" (for nested interactive controls). */
|
|
2913
|
+
as?: ElementType;
|
|
2914
|
+
/** Icon, color dot, Checkbox, Radio, or drag handle leading slot. */
|
|
2915
|
+
leading?: ReactNode;
|
|
2916
|
+
/** Chevron, Badge, secondary text, or hover-revealed action button trailing slot. */
|
|
2917
|
+
trailing?: ReactNode;
|
|
2918
|
+
children?: ReactNode;
|
|
2919
|
+
className?: string;
|
|
2920
|
+
}
|
|
2921
|
+
declare function Row({ as: Tag, active, leading, trailing, children, className, ...props }: RowProps): React$1.JSX.Element;
|
|
2922
|
+
interface RowDragHandleProps {
|
|
2923
|
+
className?: string;
|
|
2924
|
+
}
|
|
2925
|
+
declare function RowDragHandle({ className }: RowDragHandleProps): React$1.JSX.Element;
|
|
2926
|
+
|
|
2927
|
+
interface BoxProps extends Omit<HTMLAttributes<HTMLElement>, "onResize">, BgMediaProps, ResizableProps {
|
|
2928
|
+
/** Polymorphic element tag: div, section, article, span, etc. Default "div". */
|
|
2929
|
+
as?: ElementType;
|
|
2930
|
+
/** Whether to apply translucent panel styling with data-panel attribute. */
|
|
2931
|
+
translucent?: boolean;
|
|
2932
|
+
/** Surface contrast scope intent. "dark"/"light" auto-invert against the page
|
|
2933
|
+
theme (contrast band). "dark-always"/"light-always" lock to one theme
|
|
2934
|
+
regardless of page (for media backgrounds). Undefined inherits page theme. */
|
|
2935
|
+
surface?: Surface;
|
|
2936
|
+
/** Ref to the rendered element. */
|
|
2937
|
+
ref?: Ref<HTMLElement>;
|
|
2938
|
+
}
|
|
2939
|
+
declare const Box: {
|
|
2940
|
+
(props: BoxProps & ResizableProps): React$1.JSX.Element;
|
|
2941
|
+
displayName: string;
|
|
2942
|
+
};
|
|
2943
|
+
|
|
2944
|
+
declare const flexVariants: (props?: ({
|
|
2945
|
+
direction?: "col" | "column" | "column-reverse" | "row" | "row-reverse" | "col-reverse" | null | undefined;
|
|
2946
|
+
align?: "center" | "start" | "end" | "stretch" | "baseline" | null | undefined;
|
|
2947
|
+
justify?: "center" | "start" | "end" | "between" | "around" | null | undefined;
|
|
2948
|
+
wrap?: "nowrap" | "wrap" | null | undefined;
|
|
2949
|
+
gap?: "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | null | undefined;
|
|
2950
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2951
|
+
interface FlexProps extends Omit<HTMLAttributes<HTMLElement>, "onResize">, VariantProps<typeof flexVariants>, BgMediaProps, ResizableProps {
|
|
2952
|
+
/** Polymorphic element tag: div, section, header, etc. Default "div". */
|
|
2953
|
+
as?: ElementType;
|
|
2954
|
+
/** Whether to apply translucent panel styling with data-panel attribute. */
|
|
2955
|
+
translucent?: boolean;
|
|
2956
|
+
/** Surface contrast scope intent. "dark"/"light" auto-invert against the page
|
|
2957
|
+
theme (contrast band). "dark-always"/"light-always" lock to one theme
|
|
2958
|
+
regardless of page (for media backgrounds). Undefined inherits page theme. */
|
|
2959
|
+
surface?: Surface;
|
|
2960
|
+
/** Ref to the rendered element. */
|
|
2961
|
+
ref?: Ref<HTMLElement>;
|
|
2962
|
+
}
|
|
2963
|
+
declare const Flex: {
|
|
2964
|
+
(props: FlexProps & ResizableProps): React$1.JSX.Element;
|
|
2965
|
+
displayName: string;
|
|
2966
|
+
};
|
|
2967
|
+
|
|
2968
|
+
declare const gridVariants: (props?: ({
|
|
2969
|
+
columns?: "1" | "2" | "3" | "4" | "5" | "6" | "auto" | null | undefined;
|
|
2970
|
+
minWidth?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
2971
|
+
maxColumns?: "none" | "2" | "3" | "4" | "5" | "6" | null | undefined;
|
|
2972
|
+
rows?: "1" | "2" | "3" | "4" | "5" | "6" | null | undefined;
|
|
2973
|
+
align?: "center" | "start" | "end" | "stretch" | null | undefined;
|
|
2974
|
+
stack?: "none" | "auto" | "mobile" | "tablet" | null | undefined;
|
|
2975
|
+
gap?: "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | null | undefined;
|
|
2976
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2977
|
+
interface GridProps extends HTMLAttributes<HTMLElement>, VariantProps<typeof gridVariants>, BgMediaProps {
|
|
2978
|
+
/** Polymorphic element tag: div, section, ul, etc. Default "div". */
|
|
2979
|
+
as?: ElementType;
|
|
2980
|
+
/** Whether to apply translucent panel styling with data-panel attribute. */
|
|
2981
|
+
translucent?: boolean;
|
|
2982
|
+
/** Surface contrast scope intent. "dark"/"light" auto-invert against the page
|
|
2983
|
+
theme (contrast band). "dark-always"/"light-always" lock to one theme
|
|
2984
|
+
regardless of page (for media backgrounds). Undefined inherits page theme. */
|
|
2985
|
+
surface?: Surface;
|
|
2986
|
+
}
|
|
2987
|
+
declare function Grid({ as: Tag, className, columns, minWidth, maxColumns, rows, align, gap, stack, translucent, surface, style, bgVideo, bgImage, bgSize, bgOverlays, bgVideoPaused, bgPoster, children, ...props }: GridProps): React$1.JSX.Element;
|
|
2988
|
+
|
|
2989
|
+
declare const containerVariants: (props?: ({
|
|
2990
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | "full" | null | undefined;
|
|
2991
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2992
|
+
interface ContainerProps extends HTMLAttributes<HTMLElement>, VariantProps<typeof containerVariants>, BgMediaProps {
|
|
2993
|
+
/** Polymorphic element tag: div, section, main, article, etc. Default "div". */
|
|
2994
|
+
as?: ElementType;
|
|
2995
|
+
/** Whether to apply translucent panel styling with data-panel attribute. */
|
|
2996
|
+
translucent?: boolean;
|
|
2997
|
+
/** Surface contrast scope intent. "dark"/"light" auto-invert against the page
|
|
2998
|
+
theme (contrast band). "dark-always"/"light-always" lock to one theme
|
|
2999
|
+
regardless of page (for media backgrounds). Undefined inherits page theme. */
|
|
3000
|
+
surface?: Surface;
|
|
3001
|
+
}
|
|
3002
|
+
declare function Container({ as: Tag, className, size, translucent, surface, style, bgVideo, bgImage, bgSize, bgOverlays, bgVideoPaused, bgPoster, children, ...props }: ContainerProps): React$1.JSX.Element;
|
|
3003
|
+
|
|
3004
|
+
declare const sectionVariants: (props?: ({
|
|
3005
|
+
size?: "body" | "1" | "none" | "2" | "3" | "4" | "compact" | "strip" | "hero" | null | undefined;
|
|
3006
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
3007
|
+
interface SectionProps extends HTMLAttributes<HTMLElement>, VariantProps<typeof sectionVariants>, BgMediaProps {
|
|
3008
|
+
/** Polymorphic tag type: section, main, article, div. Default "section". */
|
|
3009
|
+
as?: ElementType;
|
|
3010
|
+
/** Whether to apply translucent panel styling with data-panel attribute. */
|
|
3011
|
+
translucent?: boolean;
|
|
3012
|
+
/** Surface contrast scope intent. "dark"/"light" auto-invert against the page
|
|
3013
|
+
theme (contrast band). "dark-always"/"light-always" lock to one theme
|
|
3014
|
+
regardless of page (for media backgrounds). Undefined inherits page theme. */
|
|
3015
|
+
surface?: Surface;
|
|
3016
|
+
}
|
|
3017
|
+
declare function Section({ as: Tag, className, size, translucent, surface, style, bgVideo, bgImage, bgSize, bgOverlays, bgVideoPaused, bgPoster, children, ...props }: SectionProps): React$1.JSX.Element;
|
|
3018
|
+
|
|
3019
|
+
interface SidebarContextValue {
|
|
3020
|
+
side: "left" | "right";
|
|
3021
|
+
variant: "fixed" | "collapsible" | "floating" | "inset";
|
|
3022
|
+
collapsibleMode: "icon" | "offcanvas" | "none";
|
|
3023
|
+
collapsed: boolean;
|
|
3024
|
+
setCollapsed: (collapsed: boolean) => void;
|
|
3025
|
+
toggleSidebar: () => void;
|
|
3026
|
+
}
|
|
3027
|
+
declare function useSidebar(): SidebarContextValue;
|
|
3028
|
+
interface SidebarProps extends HTMLAttributes<HTMLElement> {
|
|
3029
|
+
/** Sidebar dock side: "left" (Sidenav, left panel) or "right" (Configurator, Inspector). Default "left". */
|
|
3030
|
+
side?: "left" | "right";
|
|
3031
|
+
/** Sidebar visual variant: fixed width, collapsible rail, floating card, or inset panel. Default "fixed". */
|
|
3032
|
+
variant?: "fixed" | "collapsible" | "floating" | "inset";
|
|
3033
|
+
/** Collapsible mode: "icon" rail collapse, "offcanvas" full hide, or "none". Default "icon". */
|
|
3034
|
+
collapsibleMode?: "icon" | "offcanvas" | "none";
|
|
3035
|
+
/** Controlled collapsed state. */
|
|
3036
|
+
collapsed?: boolean;
|
|
3037
|
+
/** Callback fired when collapsed state changes. */
|
|
3038
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
3039
|
+
/** Initial default collapsed state. */
|
|
3040
|
+
defaultCollapsed?: boolean;
|
|
3041
|
+
/** Custom width CSS string (e.g. "w-60", "w-72", "w-80"). Default "w-60". */
|
|
3042
|
+
width?: string;
|
|
3043
|
+
/** Enable interactive drag resizability. Default false. */
|
|
3044
|
+
resizable?: boolean;
|
|
3045
|
+
/** Minimum width in pixels when resizable. Default 180. */
|
|
3046
|
+
minWidth?: number;
|
|
3047
|
+
/** Maximum width in pixels when resizable. Default 420. */
|
|
3048
|
+
maxWidth?: number;
|
|
3049
|
+
/** Remember the resized width in localStorage under this key. */
|
|
3050
|
+
persistKey?: string;
|
|
3051
|
+
/** Resize handle colour on hover, focus and drag. Default "brand-subtle". */
|
|
3052
|
+
resizeColor?: ResizeHandleColor;
|
|
3053
|
+
/** Custom sidebar content. */
|
|
3054
|
+
children?: ReactNode;
|
|
3055
|
+
/** Custom root class name. */
|
|
3056
|
+
className?: string;
|
|
3057
|
+
}
|
|
3058
|
+
declare function Sidebar({ side, variant, collapsibleMode, collapsed: controlledCollapsed, onCollapsedChange, defaultCollapsed, width, resizable, minWidth, maxWidth, persistKey, resizeColor, children, className, style, ...props }: SidebarProps): React__default.JSX.Element;
|
|
3059
|
+
/**
|
|
3060
|
+
* SidebarTrigger — one button, two jobs, chosen by where you put it.
|
|
3061
|
+
* - Inside a `<Sidebar>` (usually its header): collapses / expands the sidebar rail.
|
|
3062
|
+
* - Inside an `<AppFrame>` but outside the sidebar (usually the `<TopBar>`): opens the
|
|
3063
|
+
* navigation drawer. It only appears while the frame is compact, so there is nothing to
|
|
3064
|
+
* show or hide by hand.
|
|
3065
|
+
*/
|
|
3066
|
+
declare function SidebarTrigger({ className, onClick, hitArea, ...props }: HTMLAttributes<HTMLButtonElement> & {
|
|
3067
|
+
/** Hit-area override (docs: "Target size"): "default" 24px floor and 44px on touch, "none", or "touch". */
|
|
3068
|
+
hitArea?: HitArea;
|
|
3069
|
+
}): React__default.JSX.Element | null;
|
|
3070
|
+
declare function SidebarHeader({ className, children, ...props }: HTMLAttributes<HTMLDivElement>): React__default.JSX.Element;
|
|
3071
|
+
declare function SidebarBody({ className, children, ...props }: HTMLAttributes<HTMLDivElement>): React__default.JSX.Element;
|
|
3072
|
+
declare function SidebarFooter({ className, children, ...props }: HTMLAttributes<HTMLDivElement>): React__default.JSX.Element;
|
|
3073
|
+
interface SidebarSectionProps extends HTMLAttributes<HTMLDivElement> {
|
|
3074
|
+
title?: string;
|
|
3075
|
+
}
|
|
3076
|
+
declare function SidebarSection({ title, className, children, ...props }: SidebarSectionProps): React__default.JSX.Element;
|
|
3077
|
+
interface SidebarNavItemProps {
|
|
3078
|
+
icon?: ReactNode;
|
|
3079
|
+
label: string;
|
|
3080
|
+
active?: boolean;
|
|
3081
|
+
badge?: ReactNode;
|
|
3082
|
+
href?: string;
|
|
3083
|
+
onClick?: () => void;
|
|
3084
|
+
className?: string;
|
|
3085
|
+
}
|
|
3086
|
+
declare function SidebarNavItem({ icon, label, active, badge, href, onClick, className, }: SidebarNavItemProps): React__default.JSX.Element;
|
|
3087
|
+
|
|
3088
|
+
interface AppFrameContextValue {
|
|
3089
|
+
/** True while the frame is narrower than its `compactBelow` width (sidebar is a drawer). */
|
|
3090
|
+
compact: boolean;
|
|
3091
|
+
/** True while the drawer is open (never true when not compact). */
|
|
3092
|
+
open: boolean;
|
|
3093
|
+
/** Element that gets focus back when the drawer closes (set by SidebarTrigger; falls back to whatever was focused on open). */
|
|
3094
|
+
returnFocusRef: MutableRefObject<HTMLElement | null>;
|
|
3095
|
+
/** id of the navigation container, for aria-controls. */
|
|
3096
|
+
navId: string;
|
|
3097
|
+
setOpen: (open: boolean) => void;
|
|
3098
|
+
toggleNav: () => void;
|
|
3099
|
+
/** Close the drawer. A no-op when the frame is not compact, so nav items can call it unconditionally. */
|
|
3100
|
+
closeNav: () => void;
|
|
3101
|
+
}
|
|
3102
|
+
/** The surrounding AppFrame's state, or null outside one. */
|
|
3103
|
+
declare function useAppFrame(): AppFrameContextValue | null;
|
|
3104
|
+
|
|
3105
|
+
interface AppFrameProps {
|
|
3106
|
+
/** The app's navigation: a `<Sidebar>`. Written once; the frame turns it into a slide-in drawer when it runs out of room. */
|
|
3107
|
+
sidebar: ReactNode;
|
|
3108
|
+
/** Main application content (usually a `<TopBar>` followed by the page body). */
|
|
3109
|
+
children: ReactNode;
|
|
3110
|
+
/** Frame width below which the sidebar becomes a drawer: "md" (768px, default) or "lg" (1024px). Measured on the frame itself, not the window. */
|
|
3111
|
+
compactBelow?: "md" | "lg";
|
|
3112
|
+
/** Accessible name of the navigation drawer. Default "Navigation". */
|
|
3113
|
+
navLabel?: string;
|
|
3114
|
+
/** Pass the current route (e.g. `usePathname()`): the drawer closes whenever it changes, so navigation from menus or links inside the sidebar never leaves it open. */
|
|
3115
|
+
routeKey?: string;
|
|
3116
|
+
className?: string;
|
|
3117
|
+
}
|
|
3118
|
+
/**
|
|
3119
|
+
* AppFrame — the application shell.
|
|
3120
|
+
*
|
|
3121
|
+
* Sidebar + main column. The frame measures its OWN width (container query in CSS,
|
|
3122
|
+
* ResizeObserver for behaviour), so it adapts the same way on a phone, in a narrow
|
|
3123
|
+
* browser window, or inside a Studio device preview:
|
|
3124
|
+
*
|
|
3125
|
+
* - wide: the sidebar sits in flow, exactly as written
|
|
3126
|
+
* - compact: the same sidebar slides over the content as a drawer — scrim, inert
|
|
3127
|
+
* background, Escape, focus return, swipe-to-close. `<SidebarTrigger />` placed in
|
|
3128
|
+
* the TopBar shows up automatically (and only) in this mode.
|
|
3129
|
+
*/
|
|
3130
|
+
declare function AppFrame({ sidebar, children, compactBelow, navLabel, routeKey, className }: AppFrameProps): React$1.JSX.Element;
|
|
3131
|
+
|
|
3132
|
+
interface TopBarProps {
|
|
3133
|
+
/** TopBar header content. */
|
|
3134
|
+
children?: ReactNode;
|
|
3135
|
+
className?: string;
|
|
3136
|
+
}
|
|
3137
|
+
declare function TopBar({ children, className }: TopBarProps): React$1.JSX.Element;
|
|
3138
|
+
|
|
3139
|
+
interface BreadcrumbItem {
|
|
3140
|
+
label: string;
|
|
3141
|
+
href?: string;
|
|
3142
|
+
active?: boolean;
|
|
3143
|
+
}
|
|
3144
|
+
interface BreadcrumbsProps {
|
|
3145
|
+
/** Array of breadcrumb items ({ label, href, active }). */
|
|
3146
|
+
items: BreadcrumbItem[];
|
|
3147
|
+
/** Optional custom CSS class name. */
|
|
3148
|
+
className?: string;
|
|
3149
|
+
}
|
|
3150
|
+
declare function Breadcrumbs({ items, className, }: BreadcrumbsProps): React$1.JSX.Element;
|
|
3151
|
+
|
|
3152
|
+
type ActionBarItem = {
|
|
3153
|
+
value: string;
|
|
3154
|
+
label: string;
|
|
3155
|
+
keywords?: string[];
|
|
3156
|
+
icon?: ReactNode;
|
|
3157
|
+
};
|
|
3158
|
+
type ActionBarGroup = {
|
|
3159
|
+
key: string;
|
|
3160
|
+
label: string;
|
|
3161
|
+
icon?: ReactNode;
|
|
3162
|
+
items: ActionBarItem[];
|
|
3163
|
+
};
|
|
3164
|
+
interface ActionBarProps {
|
|
3165
|
+
/** Array of action groups ({ key, label, icon, items }). */
|
|
3166
|
+
groups: ActionBarGroup[];
|
|
3167
|
+
/** Callback fired when an action option is selected (groupKey, value). */
|
|
3168
|
+
onAction?: (groupKey: string, value: string) => void;
|
|
3169
|
+
/** Optional custom CSS class name. */
|
|
3170
|
+
className?: string;
|
|
3171
|
+
/** Accessible toolbar label string. Default 'Action Bar'. */
|
|
3172
|
+
ariaLabel?: string;
|
|
3173
|
+
}
|
|
3174
|
+
declare function ActionBar({ groups, onAction, className, ariaLabel }: ActionBarProps): React$1.JSX.Element;
|
|
3175
|
+
|
|
3176
|
+
type ToastType = "default" | "success" | "error" | "warning" | "info" | "loading";
|
|
3177
|
+
type ToastPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
3178
|
+
interface ToastItem {
|
|
3179
|
+
id: string;
|
|
3180
|
+
title?: React__default.ReactNode;
|
|
3181
|
+
description?: React__default.ReactNode;
|
|
3182
|
+
type?: ToastType;
|
|
3183
|
+
duration?: number;
|
|
3184
|
+
action?: {
|
|
3185
|
+
label: string;
|
|
3186
|
+
onClick: () => void;
|
|
3187
|
+
};
|
|
3188
|
+
render?: React__default.ReactNode;
|
|
3189
|
+
}
|
|
3190
|
+
type ToastOptions = Omit<ToastItem, "id" | "title" | "type" | "render">;
|
|
3191
|
+
interface ToastContextType {
|
|
3192
|
+
toast: (title: React__default.ReactNode, options?: ToastOptions) => string;
|
|
3193
|
+
success: (title: React__default.ReactNode, options?: ToastOptions) => string;
|
|
3194
|
+
error: (title: React__default.ReactNode, options?: ToastOptions) => string;
|
|
3195
|
+
warning: (title: React__default.ReactNode, options?: ToastOptions) => string;
|
|
3196
|
+
info: (title: React__default.ReactNode, options?: ToastOptions) => string;
|
|
3197
|
+
loading: (title: React__default.ReactNode, options?: ToastOptions) => string;
|
|
3198
|
+
custom: (render: React__default.ReactNode, options?: ToastOptions) => string;
|
|
3199
|
+
promise: <T>(promise: Promise<T>, msgs: {
|
|
3200
|
+
loading: React__default.ReactNode;
|
|
3201
|
+
success: React__default.ReactNode | ((v: T) => React__default.ReactNode);
|
|
3202
|
+
error: React__default.ReactNode;
|
|
3203
|
+
}) => Promise<T>;
|
|
3204
|
+
dismiss: (id?: string) => void;
|
|
3205
|
+
}
|
|
3206
|
+
declare function useToast(): ToastContextType;
|
|
3207
|
+
interface ToastProviderProps {
|
|
3208
|
+
children: React__default.ReactNode;
|
|
3209
|
+
position?: ToastPosition;
|
|
3210
|
+
/** Default auto-dismiss duration in milliseconds. */
|
|
3211
|
+
duration?: number;
|
|
3212
|
+
}
|
|
3213
|
+
declare function ToastProvider({ children, position, duration, }: ToastProviderProps): React__default.JSX.Element;
|
|
3214
|
+
|
|
3215
|
+
interface BottomNavItem {
|
|
3216
|
+
href: string;
|
|
3217
|
+
label: string;
|
|
3218
|
+
icon?: ReactNode;
|
|
3219
|
+
active?: boolean;
|
|
3220
|
+
badge?: string | number;
|
|
3221
|
+
}
|
|
3222
|
+
interface BottomNavProps extends Omit<React__default.HTMLAttributes<HTMLElement>, "onSelect"> {
|
|
3223
|
+
/** List of 3 to 5 mobile tab destinations ({ href, label, icon, active, badge }). */
|
|
3224
|
+
items: BottomNavItem[];
|
|
3225
|
+
/** Callback fired when a mobile tab destination is clicked. */
|
|
3226
|
+
onSelect?: (href: string) => void;
|
|
3227
|
+
/** Accessible navigation ARIA label. Default 'Bottom navigation'. */
|
|
3228
|
+
ariaLabel?: string;
|
|
3229
|
+
}
|
|
3230
|
+
declare function BottomNav({ items, onSelect, className, ariaLabel, ...props }: BottomNavProps): React__default.JSX.Element;
|
|
3231
|
+
|
|
3232
|
+
interface ShavinDevToolsProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
3233
|
+
/** Optional custom trigger class name. */
|
|
3234
|
+
className?: string;
|
|
3235
|
+
/** Where the inspector bar starts, until it is dragged somewhere else (the new spot is remembered per browser). Defaults to "bottom-right". */
|
|
3236
|
+
position?: "bottom-left" | "bottom-right" | "top-left" | "top-right";
|
|
3237
|
+
/** If true, forces ShavinDevTools to render even in production. By default, it is omitted in production (NODE_ENV === 'production'). */
|
|
3238
|
+
forceShow?: boolean;
|
|
3239
|
+
/**
|
|
3240
|
+
* Port the local Agent-Browser bridge listens on. Defaults to
|
|
3241
|
+
* `NEXT_PUBLIC_SHAVIN_BRIDGE_PORT` / `VITE_SHAVIN_BRIDGE_PORT`, then the built-in
|
|
3242
|
+
* default. Set this when you run `npx @shavin/cli bridge --port <n>`.
|
|
3243
|
+
*/
|
|
3244
|
+
bridgePort?: number;
|
|
3245
|
+
}
|
|
3246
|
+
|
|
3247
|
+
declare function ShavinDevTools({ forceShow, ...props }: ShavinDevToolsProps): React$1.JSX.Element | null;
|
|
3248
|
+
declare const ShavinDevInspector: typeof ShavinDevTools;
|
|
3249
|
+
|
|
3250
|
+
declare const DeviceContext: React__default.Context<"mobile" | "tablet" | "desktop">;
|
|
3251
|
+
interface BlockPreviewProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
3252
|
+
/** Title of the block displayed in code modal and headers */
|
|
3253
|
+
title: string;
|
|
3254
|
+
/** Full JSX/TSX raw source code */
|
|
3255
|
+
code: string;
|
|
3256
|
+
/** CLI install command, e.g. `npx @shavin/cli add ...` */
|
|
3257
|
+
command: string;
|
|
3258
|
+
/** Layout mode for canvas composition */
|
|
3259
|
+
layout?: "fullscreen" | "sidebar" | "sidebar-right" | "header" | "centered" | "plain" | "app-shell";
|
|
3260
|
+
/** Optional template key to link to Shavin Studio */
|
|
3261
|
+
studioKey?: string;
|
|
3262
|
+
/** Optional direct URL override for the Open in Studio link */
|
|
3263
|
+
studioUrl?: string;
|
|
3264
|
+
/** @deprecated Renamed to `studioKey`; still accepted. */
|
|
3265
|
+
builderKey?: string;
|
|
3266
|
+
/** @deprecated Renamed to `studioUrl`; still accepted. */
|
|
3267
|
+
builderUrl?: string;
|
|
3268
|
+
/** Live interactive component or BlockRenderer tree */
|
|
3269
|
+
children: ReactNode;
|
|
3270
|
+
}
|
|
3271
|
+
declare function BlockPreview({ title, code, command, layout, studioKey: studioKeyProp, studioUrl: studioUrlProp, builderKey, builderUrl, children, className, ...props }: BlockPreviewProps): React__default.JSX.Element;
|
|
3272
|
+
interface MiniPreviewFrameProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
3273
|
+
children: ReactNode;
|
|
3274
|
+
className?: string;
|
|
3275
|
+
showDotGrid?: boolean;
|
|
3276
|
+
}
|
|
3277
|
+
declare function MiniPreviewFrame({ children, className, showDotGrid, ...props }: MiniPreviewFrameProps): React__default.JSX.Element;
|
|
3278
|
+
interface MiniBlockPreviewProps {
|
|
3279
|
+
children?: ReactNode;
|
|
3280
|
+
scale?: number;
|
|
3281
|
+
fallback?: ReactNode;
|
|
3282
|
+
className?: string;
|
|
3283
|
+
/** Whether videos inside the preview should play. Default true. Set to false for file thumbnails to pause all videos. */
|
|
3284
|
+
playVideo?: boolean;
|
|
3285
|
+
}
|
|
3286
|
+
declare class SafeMiniPreview extends React__default.Component<{
|
|
3287
|
+
children: ReactNode;
|
|
3288
|
+
fallback?: ReactNode;
|
|
3289
|
+
}, {
|
|
3290
|
+
hasError: boolean;
|
|
3291
|
+
}> {
|
|
3292
|
+
constructor(props: any);
|
|
3293
|
+
static getDerivedStateFromError(): {
|
|
3294
|
+
hasError: boolean;
|
|
3295
|
+
};
|
|
3296
|
+
render(): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | React__default.JSX.Element | null | undefined;
|
|
3297
|
+
}
|
|
3298
|
+
declare function MiniBlockPreview({ children, scale, fallback, className, playVideo, }: MiniBlockPreviewProps): React__default.JSX.Element;
|
|
3299
|
+
|
|
3300
|
+
declare const wiseOwlLogoVariants: (props?: ({
|
|
3301
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
3302
|
+
color?: "default" | "inherit" | "brand" | "muted" | null | undefined;
|
|
3303
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
3304
|
+
declare const wiseOwlMarkVariants: (props?: ({
|
|
3305
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
3306
|
+
color?: "default" | "inherit" | "brand" | "muted" | null | undefined;
|
|
3307
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
3308
|
+
interface WiseOwlLogoProps extends Omit<SVGProps<SVGSVGElement>, "color" | "ref">, VariantProps<typeof wiseOwlLogoVariants> {
|
|
3309
|
+
/** Accessible name. Default "WiseOwl". */
|
|
3310
|
+
label?: string;
|
|
3311
|
+
/** Hide from assistive tech when the name is already visible next to it. */
|
|
3312
|
+
decorative?: boolean;
|
|
3313
|
+
}
|
|
3314
|
+
interface WiseOwlMarkProps extends Omit<SVGProps<SVGSVGElement>, "color" | "ref">, VariantProps<typeof wiseOwlMarkVariants> {
|
|
3315
|
+
/** Accessible name. Default "WiseOwl". */
|
|
3316
|
+
label?: string;
|
|
3317
|
+
/** Hide from assistive tech when the name is already visible next to it. */
|
|
3318
|
+
decorative?: boolean;
|
|
3319
|
+
}
|
|
3320
|
+
/** WiseOwl's full logo: the owl mark plus the "Wise Owl" wordmark. Heights 24 / 32 / 56 px; keep it 20 px or taller. */
|
|
3321
|
+
declare const WiseOwlLogo: React__default.ForwardRefExoticComponent<WiseOwlLogoProps & React__default.RefAttributes<SVGSVGElement>>;
|
|
3322
|
+
/** WiseOwl's owl mark on its own, for sidebars, app icons and tight spaces. 16 to 48 px; keep it 16 px or larger. */
|
|
3323
|
+
declare const WiseOwlMark: React__default.ForwardRefExoticComponent<WiseOwlMarkProps & React__default.RefAttributes<SVGSVGElement>>;
|
|
3324
|
+
|
|
3325
|
+
export { Accordion, AccordionContent, AccordionItem, type AccordionProps, AccordionTrigger, ActionBar, type ActionBarGroup, type ActionBarItem, type ActionBarProps, AlertDialog, AppFrame, type AppFrameProps, AspectRatio, Avatar, type AxisProps, BACKDROP_FREE_VARIANTS, BRIDGE_HOST, Backdrop, type BackdropProps, type BackdropRenderer, type BackdropVariant, Badge, BarChart, type BarChartProps, type BgMediaProps, BlockPreview, type BlockPreviewProps, Blockquote, type BlockquoteProps, BottomNav, type BottomNavItem, type BottomNavProps, Box, BrandSolidMode, type BreadcrumbItem, Breadcrumbs, Button, Calendar, type CalendarEvent, CalendarEventChip, type CalendarProps, CalendarView, type CalendarViewMode, Callout, type CalloutProps, CanvasColorPickerPopup, CapsuleSlider, type CapsuleSliderProps, Card, CardList, CardListItem, CardRow, Carousel, CarouselControls, CarouselDots, CarouselItem, type CarouselItemProps, CarouselNext, CarouselPrevious, type CarouselProps, CarouselTrack, type CarouselTrackProps, type ChartBarRadius, type ChartPadding, type ChartTone, type ChartYFormat, ChatBubble, type ChatBubbleProps, type ChatLayout, type ChatRole, type ChatStatus, Checkbox, CheckboxCards, CheckboxCardsItem, CheckboxGroup, CheckboxGroupItem, CloseButton, Code, CodeBlock, type CodeBlockProps, CodeEditor, type CodeEditorProps, type CodeProps, ColorPicker, ColorPickerPopover, type ColorPickerProps, type ColorPickerSwatch, ColorSpace, Combobox, Container, ContextMenu, ContextMenuItem, DEFAULT_BRIDGE_PORT, DataList, DataListItem, DatePicker, type DatePickerTokens, DeviceContext, Dialog, DialogClose, type DialogProps, DonutChart, type DonutChartProps, type DonutDatum, Drawer, type DrawerProps, Dropdown, Em, type EmProps, EmptyState, type EmptyStateKind, type EmptyStateProps, FileOutput, type FileOutputKind, type FileOutputProps, type FileOutputStatus, Flex, FormErrorSummary, type FormErrorSummaryItem, type FormErrorSummaryProps, FormField, type FormFieldProps, FunnelChart, type FunnelChartProps, type FunnelStep, Grid, type GsapModules, Heading, type HeadingProps, Heatmap, type HeatmapProps, HoverCard, HoverCardContent, HoverCardTrigger, ICON_NAMES, Icon, IconButton, type IconColorToken, IconPicker, type IconProps, type IconSizeToken, Image, type ImageProps, Inset, Kbd, type KbdProps, LineChart, type LineChartProps, Link, type LinkProps, List, ListItem, MURMUR_STATES, Menu, MenuItem, MenuSub, MenuSubContent, MenuSubTrigger, MenuTrigger, MiniBlockPreview, type MiniBlockPreviewProps, MiniPreviewFrame, type MiniPreviewFrameProps, type MotionConfig, MotionPauseButton, Murmur, type MurmurDot, type MurmurFrame, type MurmurOut, type MurmurProps, type MurmurState, type MurmurStateFn, type NpsResult, NpsScale, type NpsScaleProps, OVERLAY_PRESET_KEYS, OVERLAY_PRESET_STYLES, type Option, type OptionGroup, type OverlayLayer, Pagination, type PaginationProps, type Politeness, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PortalContainerProvider, Progress, Quote, type QuoteProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, Rating, type RatingProps, RatingSummary, type RatingSummaryProps, Reasoning, type ReasoningProps, type ResizableEdges, type ResizableProps, type ResizeEdge, ResizeHandle, type ResizeHandleColor, type ResizeHandleProps, type ResizeHandleVariant, ResizeHandles, type ResizeRadii, type ResizeSize, Row, RowDragHandle, SafeMiniPreview, ScopedThemeProvider, type ScopedThemeProviderProps, ScrollArea, Section, SegmentedControl, SegmentedControlItem, Select, SentimentRating, type SentimentRatingProps, Separator, type SeriesSpec, ShavinDevInspector, ShavinDevTools, type ShavinDevToolsProps, type ShavinThemeConfig, Sidebar, SidebarBody, SidebarFooter, SidebarHeader, SidebarNavItem, type SidebarNavItemProps, type SidebarProps, SidebarSection, SidebarTrigger, Skeleton, SkeletonMimic, Slider, type SliderProps, Sortable, SortableHandle, Sparkline, type SparklinePoint, type SparklineProps, Spinner, Spotlight, type SpotlightProps, StatCard, type Step, Stepper, Strong, type StrongProps, type SupportedLanguage, Surface, Switch, type TabItem, Table, TableBody, TableCell, TableColumnHeaderCell, TableHeader, TableRow, Tabs, TabsContent, TabsList, type TabsProps, TabsTrigger, Text, TextArea, TextField, type TextProps, type ThemeMode, ThemeProvider, ThemeScript, type ThemeScriptProps, ThemeSwitcher, type ThemeSwitcherProps, TimePicker, TimePickerClock, TimePickerInput, type ToastItem, type ToastPosition, ToastProvider, type ToastType, type ToolApprovalScope, ToolCall, type ToolCallProps, type ToolCallStatus, Tooltip, TopBar, type UseResizableOptions, type UseResizableResult, Video, type VideoProps, VoiceInput, type VoiceInputMode, type VoiceInputProps, type VoiceInputState, WiseOwlLogo, type WiseOwlLogoProps, WiseOwlMark, type WiseOwlMarkProps, announce, bgMediaLayer, bridgeDashboardUrl, bridgeOrigin, bridgeUrl, calculateNps, carouselVariants, drawerPanelVariants, emptyStateVariants, formFieldVariants, formatChartValue, getOverlayLayerClass, getOverlayLayerStyle, getOverlayThumbnailStyle, getPresetThumbnailStyle, headingVariants, hexToRgb, highlightCode, iconExists, iconVariants, initMotionRuntime, isVideoUrl, linkVariants, modalPanelVariants, motionConfig, niceScale, overlayLayersToShorthand, parseOverlayLayers, parseOverlayShorthand, preloadIcons, registerBackdrop, registerMurmurState, renderBgMedia, renderOverlayLayers, renderOverlays, resizeHandleVariants, resolveBgReadability, resolveBridgePort, resolveResizeEdges, textVariants, tokenNameToCssColor, tokenNameToCssVar, useAppFrame, useCarousel, usePortalContainer, useResizable, useSidebar, useTheme, useToast, wiseOwlLogoVariants, wiseOwlMarkVariants };
|