@shavin/ui 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +94 -0
- package/LICENSE +21 -0
- package/README.md +81 -2
- package/components.json +15771 -0
- package/dist/authoring/types.js +0 -0
- package/dist/icons.d.ts +20 -0
- package/dist/icons.js +6 -0
- package/dist/index.d.ts +3325 -0
- package/dist/index.js +531 -0
- package/dist/inspector/FindingPopover.js +252 -0
- package/dist/inspector/Highlight.js +76 -0
- package/dist/inspector/Inspector.js +420 -0
- package/dist/inspector/InspectorRoot.js +75 -0
- package/dist/inspector/IssuesLayer.js +134 -0
- package/dist/inspector/IssuesList.js +174 -0
- package/dist/inspector/SettingsPanel.js +89 -0
- package/dist/inspector/ShavinMark.js +22 -0
- package/dist/inspector/Toolbar.js +202 -0
- package/dist/inspector/barPlacement.js +117 -0
- package/dist/inspector/env.js +59 -0
- package/dist/inspector/geometry.js +44 -0
- package/dist/inspector/ignored.js +52 -0
- package/dist/inspector/index.js +7 -0
- package/dist/inspector/journalClient.js +57 -0
- package/dist/inspector/journalState.js +36 -0
- package/dist/inspector/pin.js +43 -0
- package/dist/inspector/placement.js +96 -0
- package/dist/inspector/prompt.js +63 -0
- package/dist/inspector/scheme.js +56 -0
- package/dist/inspector/settings.js +54 -0
- package/dist/inspector/strings.js +67 -0
- package/dist/inspector/targets.js +31 -0
- package/dist/inspector/theme/ThemeControls.js +351 -0
- package/dist/inspector/theme/ThemePanel.js +32 -0
- package/dist/inspector/theme/useThemeController.js +560 -0
- package/dist/inspector/usePhone.js +32 -0
- package/dist/inspector/useSelectTool.js +82 -0
- package/dist/inspector/useTimeouts.js +22 -0
- package/dist/inspector/useTrackedRect.js +39 -0
- package/dist/lib/announce.js +47 -0
- package/dist/lib/bridge.js +43 -0
- package/dist/lib/buttonState.js +81 -0
- package/dist/lib/chart-kit.js +226 -0
- package/dist/lib/cn.js +8 -0
- package/dist/lib/color-space.js +315 -0
- package/dist/lib/concentric.js +85 -0
- package/dist/lib/hit-area.js +25 -0
- package/dist/lib/inspector/collect.js +299 -0
- package/dist/lib/inspector/color.js +58 -0
- package/dist/lib/inspector/console-capture.js +96 -0
- package/dist/lib/inspector/index.js +8 -0
- package/dist/lib/inspector/rules.js +232 -0
- package/dist/lib/inspector/run.js +35 -0
- package/dist/lib/inspector/schema.js +110 -0
- package/dist/lib/inspector/selector.js +103 -0
- package/dist/lib/inspector/tokens.js +34 -0
- package/dist/lib/media-overlay-presets.js +284 -0
- package/dist/lib/media-overlays.js +381 -0
- package/dist/lib/meta.js +70 -0
- package/dist/lib/motion-gsap.js +25 -0
- package/dist/lib/motion-runtime.js +283 -0
- package/dist/lib/neutral-tint.js +108 -0
- package/dist/lib/portal-container.js +12 -0
- package/dist/lib/scroll-edges.js +41 -0
- package/dist/lib/surface.js +6 -0
- package/dist/lib/syntax.js +115 -0
- package/dist/lib/theme-presets.d.ts +1 -0
- package/dist/lib/theme-presets.js +759 -0
- package/dist/lib/useClientLocale.js +11 -0
- package/dist/lib/useFieldErrorAnnouncement.js +15 -0
- package/dist/lib/useReducedMotion.js +17 -0
- package/dist/lib/useResizable.js +313 -0
- package/dist/lib/useReturnFocus.js +24 -0
- package/dist/lib/useSlidingIndicator.js +56 -0
- package/dist/panels.d.ts +37 -0
- package/dist/panels.js +19 -0
- package/dist/primitives/Accordion/Accordion.doc.js +37 -0
- package/dist/primitives/Accordion/Accordion.js +87 -0
- package/dist/primitives/Accordion/index.js +2 -0
- package/dist/primitives/ActionBar/ActionBar.doc.js +37 -0
- package/dist/primitives/ActionBar/ActionBar.js +126 -0
- package/dist/primitives/ActionBar/index.js +2 -0
- package/dist/primitives/AlertDialog/AlertDialog.doc.js +54 -0
- package/dist/primitives/AlertDialog/AlertDialog.js +113 -0
- package/dist/primitives/AlertDialog/index.js +2 -0
- package/dist/primitives/AppShell/AppShell.doc.js +81 -0
- package/dist/primitives/AppShell/AppShell.js +178 -0
- package/dist/primitives/AppShell/frame-context.js +10 -0
- package/dist/primitives/AppShell/index.js +2 -0
- package/dist/primitives/AspectRatio/AspectRatio.doc.js +34 -0
- package/dist/primitives/AspectRatio/AspectRatio.js +5 -0
- package/dist/primitives/AspectRatio/index.js +2 -0
- package/dist/primitives/Avatar/Avatar.doc.js +40 -0
- package/dist/primitives/Avatar/Avatar.js +62 -0
- package/dist/primitives/Avatar/index.js +2 -0
- package/dist/primitives/Backdrop/Backdrop.doc.js +24 -0
- package/dist/primitives/Backdrop/Backdrop.js +42 -0
- package/dist/primitives/Backdrop/index.js +2 -0
- package/dist/primitives/Badge/Badge.doc.js +35 -0
- package/dist/primitives/Badge/Badge.js +95 -0
- package/dist/primitives/Badge/index.js +2 -0
- package/dist/primitives/BarChart/BarChart.doc.js +59 -0
- package/dist/primitives/BarChart/BarChart.js +154 -0
- package/dist/primitives/BarChart/index.js +2 -0
- package/dist/primitives/BlockPreview/BlockPreview.doc.js +51 -0
- package/dist/primitives/BlockPreview/BlockPreview.js +485 -0
- package/dist/primitives/BlockPreview/index.js +8 -0
- package/dist/primitives/Blockquote/Blockquote.doc.js +25 -0
- package/dist/primitives/Blockquote/Blockquote.js +19 -0
- package/dist/primitives/Blockquote/index.js +2 -0
- package/dist/primitives/BottomNav/BottomNav.doc.js +37 -0
- package/dist/primitives/BottomNav/BottomNav.js +54 -0
- package/dist/primitives/BottomNav/index.js +2 -0
- package/dist/primitives/Box/Box.doc.js +45 -0
- package/dist/primitives/Box/Box.js +51 -0
- package/dist/primitives/Box/index.js +2 -0
- package/dist/primitives/Breadcrumbs/Breadcrumbs.doc.js +35 -0
- package/dist/primitives/Breadcrumbs/Breadcrumbs.js +40 -0
- package/dist/primitives/Breadcrumbs/index.js +2 -0
- package/dist/primitives/Button/Button.doc.js +80 -0
- package/dist/primitives/Button/Button.js +132 -0
- package/dist/primitives/Button/index.js +2 -0
- package/dist/primitives/Calendar/Calendar.doc.js +36 -0
- package/dist/primitives/Calendar/Calendar.js +502 -0
- package/dist/primitives/Calendar/index.js +2 -0
- package/dist/primitives/Callout/Callout.doc.js +34 -0
- package/dist/primitives/Callout/Callout.js +63 -0
- package/dist/primitives/Callout/index.js +2 -0
- package/dist/primitives/Card/Card.doc.js +46 -0
- package/dist/primitives/Card/Card.js +159 -0
- package/dist/primitives/Card/index.js +2 -0
- package/dist/primitives/Carousel/Carousel.doc.js +61 -0
- package/dist/primitives/Carousel/Carousel.js +369 -0
- package/dist/primitives/Carousel/index.js +1 -0
- package/dist/primitives/ChatBubble/ChatBubble.doc.js +37 -0
- package/dist/primitives/ChatBubble/ChatBubble.js +120 -0
- package/dist/primitives/ChatBubble/index.js +2 -0
- package/dist/primitives/Checkbox/Checkbox.doc.js +36 -0
- package/dist/primitives/Checkbox/Checkbox.js +57 -0
- package/dist/primitives/Checkbox/index.js +2 -0
- package/dist/primitives/CheckboxCards/CheckboxCards.doc.js +35 -0
- package/dist/primitives/CheckboxCards/CheckboxCards.js +47 -0
- package/dist/primitives/CheckboxCards/index.js +2 -0
- package/dist/primitives/CheckboxGroup/CheckboxGroup.doc.js +35 -0
- package/dist/primitives/CheckboxGroup/CheckboxGroup.js +40 -0
- package/dist/primitives/CheckboxGroup/index.js +2 -0
- package/dist/primitives/Code/Code.doc.js +22 -0
- package/dist/primitives/Code/Code.js +17 -0
- package/dist/primitives/Code/index.js +2 -0
- package/dist/primitives/CodeBlock/CodeBlock.doc.js +36 -0
- package/dist/primitives/CodeBlock/CodeBlock.js +205 -0
- package/dist/primitives/CodeBlock/index.js +2 -0
- package/dist/primitives/CodeEditor/CodeEditor.doc.js +53 -0
- package/dist/primitives/CodeEditor/CodeEditor.js +204 -0
- package/dist/primitives/CodeEditor/index.js +4 -0
- package/dist/primitives/ColorPicker/ColorPicker.doc.js +37 -0
- package/dist/primitives/ColorPicker/ColorPicker.js +776 -0
- package/dist/primitives/ColorPicker/index.js +2 -0
- package/dist/primitives/Combobox/Combobox.doc.js +36 -0
- package/dist/primitives/Combobox/Combobox.js +199 -0
- package/dist/primitives/Combobox/index.js +2 -0
- package/dist/primitives/Container/Container.doc.js +46 -0
- package/dist/primitives/Container/Container.js +54 -0
- package/dist/primitives/Container/index.js +2 -0
- package/dist/primitives/ContextMenu/ContextMenu.doc.js +36 -0
- package/dist/primitives/ContextMenu/ContextMenu.js +59 -0
- package/dist/primitives/ContextMenu/index.js +2 -0
- package/dist/primitives/DataList/DataList.doc.js +34 -0
- package/dist/primitives/DataList/DataList.js +35 -0
- package/dist/primitives/DataList/index.js +2 -0
- package/dist/primitives/DatePicker/DatePicker.doc.js +36 -0
- package/dist/primitives/DatePicker/DatePicker.js +398 -0
- package/dist/primitives/DatePicker/index.js +2 -0
- package/dist/primitives/Dialog/Dialog.doc.js +107 -0
- package/dist/primitives/Dialog/Dialog.js +143 -0
- package/dist/primitives/Dialog/index.js +2 -0
- package/dist/primitives/DonutChart/DonutChart.doc.js +26 -0
- package/dist/primitives/DonutChart/DonutChart.js +71 -0
- package/dist/primitives/DonutChart/index.js +2 -0
- package/dist/primitives/Drawer/Drawer.doc.js +44 -0
- package/dist/primitives/Drawer/Drawer.js +158 -0
- package/dist/primitives/Drawer/index.js +2 -0
- package/dist/primitives/Dropdown/Dropdown.doc.js +40 -0
- package/dist/primitives/Dropdown/Dropdown.js +146 -0
- package/dist/primitives/Dropdown/index.js +2 -0
- package/dist/primitives/Emphasis/Emphasis.doc.js +28 -0
- package/dist/primitives/Emphasis/Emphasis.js +25 -0
- package/dist/primitives/Emphasis/index.js +2 -0
- package/dist/primitives/EmptyState/EmptyState.doc.js +76 -0
- package/dist/primitives/EmptyState/EmptyState.js +118 -0
- package/dist/primitives/EmptyState/index.js +2 -0
- package/dist/primitives/FileOutput/FileOutput.doc.js +26 -0
- package/dist/primitives/FileOutput/FileOutput.js +55 -0
- package/dist/primitives/FileOutput/index.js +2 -0
- package/dist/primitives/Flex/Flex.doc.js +58 -0
- package/dist/primitives/Flex/Flex.js +98 -0
- package/dist/primitives/Flex/index.js +2 -0
- package/dist/primitives/FormErrorSummary/FormErrorSummary.doc.js +39 -0
- package/dist/primitives/FormErrorSummary/FormErrorSummary.js +61 -0
- package/dist/primitives/FormErrorSummary/index.js +2 -0
- package/dist/primitives/FormField/FormField.doc.js +68 -0
- package/dist/primitives/FormField/FormField.js +149 -0
- package/dist/primitives/FormField/index.js +2 -0
- package/dist/primitives/FunnelChart/FunnelChart.doc.js +45 -0
- package/dist/primitives/FunnelChart/FunnelChart.js +54 -0
- package/dist/primitives/FunnelChart/index.js +2 -0
- package/dist/primitives/Grid/Grid.doc.js +57 -0
- package/dist/primitives/Grid/Grid.js +122 -0
- package/dist/primitives/Grid/index.js +2 -0
- package/dist/primitives/Heading/Heading.doc.js +46 -0
- package/dist/primitives/Heading/Heading.js +80 -0
- package/dist/primitives/Heading/index.js +2 -0
- package/dist/primitives/Heatmap/Heatmap.doc.js +49 -0
- package/dist/primitives/Heatmap/Heatmap.js +42 -0
- package/dist/primitives/Heatmap/index.js +2 -0
- package/dist/primitives/HoverCard/HoverCard.doc.js +36 -0
- package/dist/primitives/HoverCard/HoverCard.js +39 -0
- package/dist/primitives/HoverCard/index.js +2 -0
- package/dist/primitives/Icon/Icon.doc.js +49 -0
- package/dist/primitives/Icon/Icon.js +214 -0
- package/dist/primitives/Icon/buckets/lucide-a.js +214 -0
- package/dist/primitives/Icon/buckets/lucide-b.js +298 -0
- package/dist/primitives/Icon/buckets/lucide-c.js +524 -0
- package/dist/primitives/Icon/buckets/lucide-d.js +110 -0
- package/dist/primitives/Icon/buckets/lucide-e.js +50 -0
- package/dist/primitives/Icon/buckets/lucide-f.js +264 -0
- package/dist/primitives/Icon/buckets/lucide-g.js +108 -0
- package/dist/primitives/Icon/buckets/lucide-h.js +112 -0
- package/dist/primitives/Icon/buckets/lucide-i.js +46 -0
- package/dist/primitives/Icon/buckets/lucide-j.js +6 -0
- package/dist/primitives/Icon/buckets/lucide-k.js +18 -0
- package/dist/primitives/Icon/buckets/lucide-l.js +162 -0
- package/dist/primitives/Icon/buckets/lucide-m.js +266 -0
- package/dist/primitives/Icon/buckets/lucide-n.js +34 -0
- package/dist/primitives/Icon/buckets/lucide-o.js +20 -0
- package/dist/primitives/Icon/buckets/lucide-p.js +216 -0
- package/dist/primitives/Icon/buckets/lucide-q.js +6 -0
- package/dist/primitives/Icon/buckets/lucide-r.js +140 -0
- package/dist/primitives/Icon/buckets/lucide-s.js +490 -0
- package/dist/primitives/Icon/buckets/lucide-t.js +204 -0
- package/dist/primitives/Icon/buckets/lucide-u.js +84 -0
- package/dist/primitives/Icon/buckets/lucide-v.js +46 -0
- package/dist/primitives/Icon/buckets/lucide-w.js +82 -0
- package/dist/primitives/Icon/buckets/lucide-x.js +6 -0
- package/dist/primitives/Icon/buckets/lucide-z.js +36 -0
- package/dist/primitives/Icon/buckets/phosphor-a.js +250 -0
- package/dist/primitives/Icon/buckets/phosphor-b.js +158 -0
- package/dist/primitives/Icon/buckets/phosphor-c.js +320 -0
- package/dist/primitives/Icon/buckets/phosphor-d.js +90 -0
- package/dist/primitives/Icon/buckets/phosphor-e.js +52 -0
- package/dist/primitives/Icon/buckets/phosphor-f.js +162 -0
- package/dist/primitives/Icon/buckets/phosphor-g.js +92 -0
- package/dist/primitives/Icon/buckets/phosphor-h.js +88 -0
- package/dist/primitives/Icon/buckets/phosphor-i.js +26 -0
- package/dist/primitives/Icon/buckets/phosphor-j.js +8 -0
- package/dist/primitives/Icon/buckets/phosphor-k.js +8 -0
- package/dist/primitives/Icon/buckets/phosphor-l.js +84 -0
- package/dist/primitives/Icon/buckets/phosphor-m.js +110 -0
- package/dist/primitives/Icon/buckets/phosphor-n.js +100 -0
- package/dist/primitives/Icon/buckets/phosphor-o.js +14 -0
- package/dist/primitives/Icon/buckets/phosphor-p.js +166 -0
- package/dist/primitives/Icon/buckets/phosphor-q.js +10 -0
- package/dist/primitives/Icon/buckets/phosphor-r.js +46 -0
- package/dist/primitives/Icon/buckets/phosphor-s.js +254 -0
- package/dist/primitives/Icon/buckets/phosphor-t.js +152 -0
- package/dist/primitives/Icon/buckets/phosphor-u.js +38 -0
- package/dist/primitives/Icon/buckets/phosphor-v.js +22 -0
- package/dist/primitives/Icon/buckets/phosphor-w.js +48 -0
- package/dist/primitives/Icon/buckets/phosphor-x.js +4 -0
- package/dist/primitives/Icon/buckets/phosphor-y.js +8 -0
- package/dist/primitives/Icon/icon-display-names.generated.js +4 -0
- package/dist/primitives/Icon/icon-loaders.generated.js +70 -0
- package/dist/primitives/Icon/icon-names-material.generated.js +4 -0
- package/dist/primitives/Icon/icon-names.js +11 -0
- package/dist/primitives/Icon/index.js +7 -0
- package/dist/primitives/IconButton/IconButton.doc.js +43 -0
- package/dist/primitives/IconButton/IconButton.js +98 -0
- package/dist/primitives/IconButton/index.js +2 -0
- package/dist/primitives/IconPicker/IconPicker.doc.js +52 -0
- package/dist/primitives/IconPicker/IconPicker.js +193 -0
- package/dist/primitives/IconPicker/index.js +2 -0
- package/dist/primitives/IconPicker/registry.js +98 -0
- package/dist/primitives/Image/Image.doc.js +40 -0
- package/dist/primitives/Image/Image.js +76 -0
- package/dist/primitives/Image/index.js +2 -0
- package/dist/primitives/Inset/Inset.doc.js +34 -0
- package/dist/primitives/Inset/Inset.js +51 -0
- package/dist/primitives/Inset/index.js +2 -0
- package/dist/primitives/Kbd/Kbd.doc.js +22 -0
- package/dist/primitives/Kbd/Kbd.js +17 -0
- package/dist/primitives/Kbd/index.js +2 -0
- package/dist/primitives/LineChart/LineChart.doc.js +61 -0
- package/dist/primitives/LineChart/LineChart.js +146 -0
- package/dist/primitives/LineChart/index.js +2 -0
- package/dist/primitives/Link/Link.doc.js +45 -0
- package/dist/primitives/Link/Link.js +37 -0
- package/dist/primitives/Link/index.js +2 -0
- package/dist/primitives/List/List.doc.js +35 -0
- package/dist/primitives/List/List.js +35 -0
- package/dist/primitives/List/index.js +2 -0
- package/dist/primitives/Menu/Menu.doc.js +37 -0
- package/dist/primitives/Menu/Menu.js +117 -0
- package/dist/primitives/Menu/index.js +2 -0
- package/dist/primitives/Murmur/Murmur.doc.js +32 -0
- package/dist/primitives/Murmur/Murmur.js +85 -0
- package/dist/primitives/Murmur/engine.js +163 -0
- package/dist/primitives/Murmur/index.js +12 -0
- package/dist/primitives/Pagination/Pagination.doc.js +37 -0
- package/dist/primitives/Pagination/Pagination.js +183 -0
- package/dist/primitives/Pagination/index.js +2 -0
- package/dist/primitives/PanelGroup/PanelGroup.doc.js +41 -0
- package/dist/primitives/PanelGroup/PanelGroup.js +142 -0
- package/dist/primitives/PanelGroup/index.js +2 -0
- package/dist/primitives/Popover/Popover.doc.js +36 -0
- package/dist/primitives/Popover/Popover.js +41 -0
- package/dist/primitives/Popover/index.js +2 -0
- package/dist/primitives/Progress/Progress.doc.js +35 -0
- package/dist/primitives/Progress/Progress.js +77 -0
- package/dist/primitives/Progress/index.js +2 -0
- package/dist/primitives/RadioGroup/RadioGroup.doc.js +36 -0
- package/dist/primitives/RadioGroup/RadioGroup.js +132 -0
- package/dist/primitives/RadioGroup/index.js +2 -0
- package/dist/primitives/Rating/NpsScale.js +102 -0
- package/dist/primitives/Rating/Rating.doc.js +35 -0
- package/dist/primitives/Rating/Rating.js +116 -0
- package/dist/primitives/Rating/RatingSummary.js +50 -0
- package/dist/primitives/Rating/SentimentRating.js +81 -0
- package/dist/primitives/Rating/index.js +5 -0
- package/dist/primitives/Reasoning/Reasoning.doc.js +28 -0
- package/dist/primitives/Reasoning/Reasoning.js +73 -0
- package/dist/primitives/Reasoning/index.js +2 -0
- package/dist/primitives/Resizable/Resizable.doc.js +50 -0
- package/dist/primitives/Resizable/ResizeHandle.js +185 -0
- package/dist/primitives/Resizable/index.js +2 -0
- package/dist/primitives/Row/Row.doc.js +36 -0
- package/dist/primitives/Row/Row.js +53 -0
- package/dist/primitives/Row/index.js +2 -0
- package/dist/primitives/ScrollArea/ScrollArea.doc.js +35 -0
- package/dist/primitives/ScrollArea/ScrollArea.js +50 -0
- package/dist/primitives/ScrollArea/index.js +2 -0
- package/dist/primitives/Section/Section.doc.js +64 -0
- package/dist/primitives/Section/Section.js +76 -0
- package/dist/primitives/Section/index.js +2 -0
- package/dist/primitives/SegmentedControl/SegmentedControl.doc.js +75 -0
- package/dist/primitives/SegmentedControl/SegmentedControl.js +160 -0
- package/dist/primitives/SegmentedControl/index.js +2 -0
- package/dist/primitives/Select/Select.doc.js +42 -0
- package/dist/primitives/Select/Select.js +180 -0
- package/dist/primitives/Select/index.js +2 -0
- package/dist/primitives/Separator/Separator.doc.js +34 -0
- package/dist/primitives/Separator/Separator.js +84 -0
- package/dist/primitives/Separator/index.js +2 -0
- package/dist/primitives/ShavinDevTools/DevToolsPanel.js +2050 -0
- package/dist/primitives/ShavinDevTools/ShavinDevTools.doc.js +44 -0
- package/dist/primitives/ShavinDevTools/ShavinDevTools.js +15 -0
- package/dist/primitives/ShavinDevTools/index.js +8 -0
- package/dist/primitives/ShavinDevTools/types.js +0 -0
- package/dist/primitives/Sidebar/Sidebar.doc.js +39 -0
- package/dist/primitives/Sidebar/Sidebar.js +295 -0
- package/dist/primitives/Sidebar/index.js +2 -0
- package/dist/primitives/Skeleton/Skeleton.doc.js +38 -0
- package/dist/primitives/Skeleton/Skeleton.js +36 -0
- package/dist/primitives/Skeleton/index.js +2 -0
- package/dist/primitives/Slider/Slider.doc.js +45 -0
- package/dist/primitives/Slider/Slider.js +406 -0
- package/dist/primitives/Slider/index.js +2 -0
- package/dist/primitives/Sortable/Sortable.doc.js +35 -0
- package/dist/primitives/Sortable/Sortable.js +179 -0
- package/dist/primitives/Sortable/index.js +2 -0
- package/dist/primitives/Sparkline/Sparkline.doc.js +25 -0
- package/dist/primitives/Sparkline/Sparkline.js +46 -0
- package/dist/primitives/Sparkline/index.js +2 -0
- package/dist/primitives/Spinner/Spinner.doc.js +35 -0
- package/dist/primitives/Spinner/Spinner.js +162 -0
- package/dist/primitives/Spinner/index.js +2 -0
- package/dist/primitives/Spotlight/Spotlight.doc.js +36 -0
- package/dist/primitives/Spotlight/Spotlight.js +139 -0
- package/dist/primitives/Spotlight/index.js +2 -0
- package/dist/primitives/Stepper/Stepper.doc.js +46 -0
- package/dist/primitives/Stepper/Stepper.js +235 -0
- package/dist/primitives/Stepper/index.js +2 -0
- package/dist/primitives/Switch/Switch.doc.js +36 -0
- package/dist/primitives/Switch/Switch.js +54 -0
- package/dist/primitives/Switch/index.js +2 -0
- package/dist/primitives/Table/Table.doc.js +47 -0
- package/dist/primitives/Table/Table.js +63 -0
- package/dist/primitives/Table/index.js +2 -0
- package/dist/primitives/Tabs/Tabs.doc.js +53 -0
- package/dist/primitives/Tabs/Tabs.js +275 -0
- package/dist/primitives/Tabs/index.js +2 -0
- package/dist/primitives/Text/Text.doc.js +35 -0
- package/dist/primitives/Text/Text.js +67 -0
- package/dist/primitives/Text/index.js +2 -0
- package/dist/primitives/TextArea/TextArea.doc.js +35 -0
- package/dist/primitives/TextArea/TextArea.js +45 -0
- package/dist/primitives/TextArea/index.js +2 -0
- package/dist/primitives/TextField/TextField.doc.js +41 -0
- package/dist/primitives/TextField/TextField.js +290 -0
- package/dist/primitives/TextField/index.js +2 -0
- package/dist/primitives/ThemeProvider/ScopedThemeProvider.js +71 -0
- package/dist/primitives/ThemeProvider/ThemeProvider.doc.js +61 -0
- package/dist/primitives/ThemeProvider/ThemeProvider.js +143 -0
- package/dist/primitives/ThemeProvider/clientTheme.js +47 -0
- package/dist/primitives/ThemeProvider/index.js +3 -0
- package/dist/primitives/ThemeProvider/themeContext.js +11 -0
- package/dist/primitives/ThemeSwitcher/ThemeSwitcher.doc.js +49 -0
- package/dist/primitives/ThemeSwitcher/ThemeSwitcher.js +323 -0
- package/dist/primitives/ThemeSwitcher/index.js +2 -0
- package/dist/primitives/TimePicker/TimePicker.doc.js +36 -0
- package/dist/primitives/TimePicker/TimePicker.js +368 -0
- package/dist/primitives/TimePicker/index.js +2 -0
- package/dist/primitives/Toast/Toast.doc.js +65 -0
- package/dist/primitives/Toast/Toast.js +304 -0
- package/dist/primitives/Toast/index.js +2 -0
- package/dist/primitives/ToolCall/ToolCall.doc.js +29 -0
- package/dist/primitives/ToolCall/ToolCall.js +75 -0
- package/dist/primitives/ToolCall/index.js +2 -0
- package/dist/primitives/Tooltip/Tooltip.doc.js +37 -0
- package/dist/primitives/Tooltip/Tooltip.js +55 -0
- package/dist/primitives/Tooltip/index.js +2 -0
- package/dist/primitives/TopBar/TopBar.doc.js +34 -0
- package/dist/primitives/TopBar/TopBar.js +8 -0
- package/dist/primitives/TopBar/index.js +2 -0
- package/dist/primitives/Video/PauseToggle.js +49 -0
- package/dist/primitives/Video/Video.doc.js +47 -0
- package/dist/primitives/Video/Video.js +104 -0
- package/dist/primitives/Video/index.js +1 -0
- package/dist/primitives/VoiceInput/VoiceInput.doc.js +38 -0
- package/dist/primitives/VoiceInput/VoiceInput.js +96 -0
- package/dist/primitives/VoiceInput/index.js +2 -0
- package/dist/primitives/WiseOwlLogo/WiseOwlLogo.doc.js +38 -0
- package/dist/primitives/WiseOwlLogo/WiseOwlLogo.js +82 -0
- package/dist/primitives/WiseOwlLogo/index.js +2 -0
- package/dist/primitives/WiseOwlLogo/paths.js +10 -0
- package/dist/server.d.ts +256 -0
- package/dist/server.js +22 -0
- package/dist/styles/base-oklch.css +124 -0
- package/dist/styles/base-oklch.d.ts +2 -0
- package/dist/styles/base.css +124 -0
- package/dist/styles/base.d.ts +2 -0
- package/dist/styles/brand-preset.d.ts +22 -0
- package/dist/styles/brand-preset.js +13 -0
- package/dist/styles/brand-theme-v4-oklch.css +2 -0
- package/dist/styles/brand-theme-v4-oklch.d.ts +2 -0
- package/dist/styles/brand-theme-v4.css +2 -0
- package/dist/styles/brand-theme-v4.d.ts +2 -0
- package/dist/styles/brand-tokens-oklch.css +6 -0
- package/dist/styles/brand-tokens-oklch.d.ts +2 -0
- package/dist/styles/brand-tokens.css +6 -0
- package/dist/styles/brand-tokens.d.ts +2 -0
- package/dist/styles/global-oklch.css +1329 -0
- package/dist/styles/global-oklch.d.ts +2 -0
- package/dist/styles/global.css +1329 -0
- package/dist/styles/global.d.ts +2 -0
- package/dist/styles/theme-v4-oklch.css +22 -0
- package/dist/styles/theme-v4-oklch.d.ts +2 -0
- package/dist/styles/theme-v4.css +22 -0
- package/dist/styles/theme-v4.d.ts +2 -0
- package/dist/styles/tokens-oklch.css +1204 -0
- package/dist/styles/tokens-oklch.d.ts +2 -0
- package/dist/styles/tokens.css +1204 -0
- package/dist/styles/tokens.d.ts +2 -0
- package/dist/tailwind-preset.cjs +155 -0
- package/dist/tailwind-preset.d.ts +112 -0
- package/dist/tailwind-preset.js +133 -0
- package/dist/theme-presets-BVWZ_TxX.d.ts +514 -0
- package/global-oklch.css +3 -0
- package/package.json +169 -4
- package/styles.css +3 -0
- package/tailwind-preset.ts +140 -0
- package/tokens.json +423 -0
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
createContext,
|
|
5
|
+
useContext,
|
|
6
|
+
useState,
|
|
7
|
+
useEffect,
|
|
8
|
+
useCallback,
|
|
9
|
+
useRef,
|
|
10
|
+
useLayoutEffect
|
|
11
|
+
} from "react";
|
|
12
|
+
import { cn } from "../../lib/cn.js";
|
|
13
|
+
import { announce } from "../../lib/announce.js";
|
|
14
|
+
import { X, CheckCircle2, AlertCircle, AlertTriangle, Info, Loader2 } from "lucide-react";
|
|
15
|
+
const ToastContext = createContext(void 0);
|
|
16
|
+
function useToast() {
|
|
17
|
+
const context = useContext(ToastContext);
|
|
18
|
+
if (!context) throw new Error("useToast must be used within a ToastProvider");
|
|
19
|
+
return context;
|
|
20
|
+
}
|
|
21
|
+
function useIsMobile() {
|
|
22
|
+
const [mobile, setMobile] = useState(false);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
if (typeof window === "undefined" || !window.matchMedia) return;
|
|
25
|
+
const mq = window.matchMedia("(max-width: 767px)");
|
|
26
|
+
const on = () => setMobile(mq.matches);
|
|
27
|
+
on();
|
|
28
|
+
mq.addEventListener?.("change", on);
|
|
29
|
+
return () => mq.removeEventListener?.("change", on);
|
|
30
|
+
}, []);
|
|
31
|
+
return mobile;
|
|
32
|
+
}
|
|
33
|
+
let counter = 0;
|
|
34
|
+
const nextId = () => `t${++counter}`;
|
|
35
|
+
function ToastProvider({
|
|
36
|
+
children,
|
|
37
|
+
position = "bottom-right",
|
|
38
|
+
duration = 4e3
|
|
39
|
+
}) {
|
|
40
|
+
const [toasts, setToasts] = useState([]);
|
|
41
|
+
const toastsRef = useRef([]);
|
|
42
|
+
toastsRef.current = toasts;
|
|
43
|
+
const upsert = useCallback((item) => {
|
|
44
|
+
setToasts((prev) => {
|
|
45
|
+
const i = prev.findIndex((t) => t.id === item.id);
|
|
46
|
+
if (i === -1) return [...prev, item];
|
|
47
|
+
const next = [...prev];
|
|
48
|
+
next[i] = item;
|
|
49
|
+
return next;
|
|
50
|
+
});
|
|
51
|
+
}, []);
|
|
52
|
+
const dismiss = useCallback((id) => {
|
|
53
|
+
setToasts((prev) => id ? prev.filter((t) => t.id !== id) : []);
|
|
54
|
+
}, []);
|
|
55
|
+
const make = useCallback(
|
|
56
|
+
(type) => (title, options) => {
|
|
57
|
+
const isSame = (t) => t.type === type && !t.render && typeof title === "string" && t.title === title && t.description === options?.description;
|
|
58
|
+
const same = toastsRef.current.find(isSame);
|
|
59
|
+
if (same) return same.id;
|
|
60
|
+
const id = nextId();
|
|
61
|
+
const item = { id, title, type, ...options };
|
|
62
|
+
setToasts((prev) => prev.some(isSame) ? prev : [...prev, item]);
|
|
63
|
+
return id;
|
|
64
|
+
},
|
|
65
|
+
[upsert]
|
|
66
|
+
);
|
|
67
|
+
const promise = useCallback(
|
|
68
|
+
(p, msgs) => {
|
|
69
|
+
const id = nextId();
|
|
70
|
+
upsert({ id, title: msgs.loading, type: "loading", duration: Infinity });
|
|
71
|
+
p.then(
|
|
72
|
+
(v) => upsert({
|
|
73
|
+
id,
|
|
74
|
+
title: typeof msgs.success === "function" ? msgs.success(v) : msgs.success,
|
|
75
|
+
type: "success"
|
|
76
|
+
}),
|
|
77
|
+
() => upsert({ id, title: msgs.error, type: "error" })
|
|
78
|
+
);
|
|
79
|
+
return p;
|
|
80
|
+
},
|
|
81
|
+
[upsert]
|
|
82
|
+
);
|
|
83
|
+
const value = {
|
|
84
|
+
toast: make("default"),
|
|
85
|
+
success: make("success"),
|
|
86
|
+
error: make("error"),
|
|
87
|
+
warning: make("warning"),
|
|
88
|
+
info: make("info"),
|
|
89
|
+
loading: (title, options) => {
|
|
90
|
+
const id = nextId();
|
|
91
|
+
upsert({ id, title, type: "loading", duration: Infinity, ...options });
|
|
92
|
+
return id;
|
|
93
|
+
},
|
|
94
|
+
custom: (render, options) => {
|
|
95
|
+
const id = nextId();
|
|
96
|
+
upsert({ id, render, type: "default", ...options });
|
|
97
|
+
return id;
|
|
98
|
+
},
|
|
99
|
+
promise,
|
|
100
|
+
dismiss
|
|
101
|
+
};
|
|
102
|
+
return /* @__PURE__ */ jsxs(ToastContext.Provider, { value, children: [
|
|
103
|
+
children,
|
|
104
|
+
/* @__PURE__ */ jsx(Toaster, { toasts, onRemove: dismiss, position, defaultDuration: duration })
|
|
105
|
+
] });
|
|
106
|
+
}
|
|
107
|
+
const PEEK = 14;
|
|
108
|
+
const GAP = 14;
|
|
109
|
+
const MAX_VISIBLE = 3;
|
|
110
|
+
const SWIPE_DISMISS_PX = 80;
|
|
111
|
+
const CORNER = {
|
|
112
|
+
"top-left": "top-4 left-4",
|
|
113
|
+
"top-center": "top-4 left-1/2 -translate-x-1/2",
|
|
114
|
+
"top-right": "top-4 right-4",
|
|
115
|
+
"bottom-left": "bottom-4 left-4",
|
|
116
|
+
"bottom-center": "bottom-4 left-1/2 -translate-x-1/2",
|
|
117
|
+
"bottom-right": "bottom-4 right-4"
|
|
118
|
+
};
|
|
119
|
+
function Toaster({
|
|
120
|
+
toasts,
|
|
121
|
+
onRemove,
|
|
122
|
+
position,
|
|
123
|
+
defaultDuration
|
|
124
|
+
}) {
|
|
125
|
+
const [expanded, setExpanded] = useState(false);
|
|
126
|
+
const [heights, setHeights] = useState({});
|
|
127
|
+
const mobile = useIsMobile();
|
|
128
|
+
position = mobile ? "bottom-center" : position;
|
|
129
|
+
const isTop = position.startsWith("top");
|
|
130
|
+
const ordered = [...toasts].reverse();
|
|
131
|
+
const reportHeight = useCallback((id, h) => {
|
|
132
|
+
setHeights((prev) => prev[id] === h ? prev : { ...prev, [id]: h });
|
|
133
|
+
}, []);
|
|
134
|
+
const dir = isTop ? 1 : -1;
|
|
135
|
+
return /* @__PURE__ */ jsx(
|
|
136
|
+
"div",
|
|
137
|
+
{
|
|
138
|
+
role: "region",
|
|
139
|
+
"aria-label": "Notifications",
|
|
140
|
+
className: cn(
|
|
141
|
+
"pointer-events-none fixed z-[100]",
|
|
142
|
+
mobile ? "inset-x-2 w-auto" : cn("w-[356px] max-w-[calc(100vw-2rem)]", CORNER[position])
|
|
143
|
+
),
|
|
144
|
+
style: mobile ? { bottom: "calc(var(--bottom-nav-height, 0px) + env(safe-area-inset-bottom, 0px) + 0.5rem)" } : void 0,
|
|
145
|
+
onMouseEnter: () => setExpanded(true),
|
|
146
|
+
onMouseLeave: () => setExpanded(false),
|
|
147
|
+
onFocus: () => setExpanded(true),
|
|
148
|
+
onBlur: (e) => {
|
|
149
|
+
if (!e.currentTarget.contains(e.relatedTarget)) setExpanded(false);
|
|
150
|
+
},
|
|
151
|
+
children: /* @__PURE__ */ jsx("div", { className: "relative h-0 w-full", children: ordered.map((t, i) => {
|
|
152
|
+
let cum = 0;
|
|
153
|
+
for (let j = 0; j < i; j++) cum += (heights[ordered[j].id] ?? 64) + GAP;
|
|
154
|
+
const ty = expanded ? dir * cum : dir * i * PEEK;
|
|
155
|
+
const scale = expanded ? 1 : Math.max(1 - i * 0.05, 0.9);
|
|
156
|
+
const hidden = i >= MAX_VISIBLE;
|
|
157
|
+
return /* @__PURE__ */ jsx(
|
|
158
|
+
ToastCard,
|
|
159
|
+
{
|
|
160
|
+
toast: t,
|
|
161
|
+
onRemove,
|
|
162
|
+
reportHeight,
|
|
163
|
+
isTop,
|
|
164
|
+
anchor: position,
|
|
165
|
+
translateY: ty,
|
|
166
|
+
scale,
|
|
167
|
+
zIndex: ordered.length - i,
|
|
168
|
+
hidden,
|
|
169
|
+
autoClose: i === 0 && !expanded,
|
|
170
|
+
defaultDuration
|
|
171
|
+
},
|
|
172
|
+
t.id
|
|
173
|
+
);
|
|
174
|
+
}) })
|
|
175
|
+
}
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
const ICON = {
|
|
179
|
+
default: null,
|
|
180
|
+
success: /* @__PURE__ */ jsx(CheckCircle2, { className: "h-4 w-4 shrink-0 text-success", "aria-hidden": true }),
|
|
181
|
+
error: /* @__PURE__ */ jsx(AlertCircle, { className: "h-4 w-4 shrink-0 text-danger", "aria-hidden": true }),
|
|
182
|
+
warning: /* @__PURE__ */ jsx(AlertTriangle, { className: "h-4 w-4 shrink-0 text-warning", "aria-hidden": true }),
|
|
183
|
+
info: /* @__PURE__ */ jsx(Info, { className: "h-4 w-4 shrink-0 text-brand-text", "aria-hidden": true }),
|
|
184
|
+
loading: /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 shrink-0 animate-spin text-fg-muted", "aria-hidden": true })
|
|
185
|
+
};
|
|
186
|
+
function ToastCard({
|
|
187
|
+
toast,
|
|
188
|
+
onRemove,
|
|
189
|
+
reportHeight,
|
|
190
|
+
isTop,
|
|
191
|
+
translateY,
|
|
192
|
+
scale,
|
|
193
|
+
zIndex,
|
|
194
|
+
hidden,
|
|
195
|
+
autoClose,
|
|
196
|
+
defaultDuration
|
|
197
|
+
}) {
|
|
198
|
+
const ref = useRef(null);
|
|
199
|
+
const removeRef = useRef(onRemove);
|
|
200
|
+
removeRef.current = onRemove;
|
|
201
|
+
const [enter, setEnter] = useState(false);
|
|
202
|
+
const [swipe, setSwipe] = useState(0);
|
|
203
|
+
const drag = useRef(null);
|
|
204
|
+
useLayoutEffect(() => {
|
|
205
|
+
if (ref.current) reportHeight(toast.id, ref.current.offsetHeight);
|
|
206
|
+
}, [toast.id, toast.title, toast.description, toast.render, reportHeight]);
|
|
207
|
+
useEffect(() => {
|
|
208
|
+
const id = setTimeout(() => setEnter(true), 20);
|
|
209
|
+
return () => clearTimeout(id);
|
|
210
|
+
}, []);
|
|
211
|
+
const contentRef = useRef(null);
|
|
212
|
+
useEffect(() => {
|
|
213
|
+
const text = contentRef.current?.textContent ?? "";
|
|
214
|
+
announce(text, toast.type === "error" ? "assertive" : "polite");
|
|
215
|
+
}, [toast.id, toast.title, toast.description, toast.type]);
|
|
216
|
+
useEffect(() => {
|
|
217
|
+
const d = toast.duration ?? (toast.action ? Infinity : toast.type === "error" ? Math.max(defaultDuration, 8e3) : defaultDuration);
|
|
218
|
+
if (!autoClose || !Number.isFinite(d)) return;
|
|
219
|
+
const timer = setTimeout(() => removeRef.current(toast.id), d);
|
|
220
|
+
return () => clearTimeout(timer);
|
|
221
|
+
}, [toast.id, toast.duration, toast.type, toast.action, autoClose, defaultDuration]);
|
|
222
|
+
const dismissing = useRef(false);
|
|
223
|
+
const dismiss = () => {
|
|
224
|
+
if (dismissing.current) return;
|
|
225
|
+
dismissing.current = true;
|
|
226
|
+
removeRef.current(toast.id);
|
|
227
|
+
};
|
|
228
|
+
const enterY = isTop ? -20 : 20;
|
|
229
|
+
const y = enter ? translateY : translateY + enterY;
|
|
230
|
+
const edgeClass = isTop ? "top-0" : "bottom-0";
|
|
231
|
+
const dragging = drag.current?.active;
|
|
232
|
+
const icon = ICON[toast.type ?? "default"];
|
|
233
|
+
return /* @__PURE__ */ jsx(
|
|
234
|
+
"div",
|
|
235
|
+
{
|
|
236
|
+
ref,
|
|
237
|
+
"aria-hidden": hidden || void 0,
|
|
238
|
+
inert: hidden || void 0,
|
|
239
|
+
style: {
|
|
240
|
+
transform: `translateY(${y}px) translateX(${swipe}px) scale(${enter ? scale : 0.95})`,
|
|
241
|
+
opacity: hidden ? 0 : enter ? 1 - Math.min(Math.abs(swipe) / 220, 0.8) : 0,
|
|
242
|
+
zIndex,
|
|
243
|
+
willChange: "transform, opacity",
|
|
244
|
+
transition: dragging ? "none" : "transform 0.4s cubic-bezier(0.22,1,0.36,1), opacity 0.3s ease"
|
|
245
|
+
},
|
|
246
|
+
className: cn("pointer-events-auto absolute left-0 right-0 touch-none", edgeClass),
|
|
247
|
+
onPointerDown: (e) => {
|
|
248
|
+
drag.current = { startX: e.clientX, active: true };
|
|
249
|
+
e.target.setPointerCapture?.(e.pointerId);
|
|
250
|
+
},
|
|
251
|
+
onPointerMove: (e) => {
|
|
252
|
+
if (!drag.current?.active) return;
|
|
253
|
+
setSwipe(e.clientX - drag.current.startX);
|
|
254
|
+
},
|
|
255
|
+
onPointerUp: () => {
|
|
256
|
+
const dx = swipe;
|
|
257
|
+
drag.current = null;
|
|
258
|
+
if (Math.abs(dx) > SWIPE_DISMISS_PX) dismiss();
|
|
259
|
+
else setSwipe(0);
|
|
260
|
+
},
|
|
261
|
+
children: /* @__PURE__ */ jsx(
|
|
262
|
+
"div",
|
|
263
|
+
{
|
|
264
|
+
ref: contentRef,
|
|
265
|
+
"data-panel": true,
|
|
266
|
+
className: "flex w-full items-start gap-3 rounded-[var(--radius-panel)] border border-hairline p-3.5 shadow-panel",
|
|
267
|
+
children: toast.render ?? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
268
|
+
icon,
|
|
269
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
270
|
+
toast.title && /* @__PURE__ */ jsx("div", { className: "text-sm font-medium leading-snug text-fg", children: toast.title }),
|
|
271
|
+
toast.description && /* @__PURE__ */ jsx("div", { className: "mt-0.5 text-xs leading-relaxed text-fg-muted", children: toast.description })
|
|
272
|
+
] }),
|
|
273
|
+
toast.action && /* @__PURE__ */ jsx(
|
|
274
|
+
"button",
|
|
275
|
+
{
|
|
276
|
+
type: "button",
|
|
277
|
+
onClick: () => {
|
|
278
|
+
toast.action?.onClick();
|
|
279
|
+
dismiss();
|
|
280
|
+
},
|
|
281
|
+
className: "shrink-0 rounded-[var(--radius-lg)] border border-hairline px-2.5 py-1 text-xs font-medium text-fg transition hover:bg-surface-hover active:scale-[0.97]",
|
|
282
|
+
children: toast.action.label
|
|
283
|
+
}
|
|
284
|
+
),
|
|
285
|
+
/* @__PURE__ */ jsx(
|
|
286
|
+
"button",
|
|
287
|
+
{
|
|
288
|
+
type: "button",
|
|
289
|
+
onClick: dismiss,
|
|
290
|
+
"aria-label": "Dismiss",
|
|
291
|
+
className: "-m-1 flex h-6 w-6 shrink-0 items-center justify-center rounded-[var(--radius-lg)] text-fg-muted transition hover:bg-surface-hover hover:text-fg",
|
|
292
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-3.5 w-3.5", "aria-hidden": true })
|
|
293
|
+
}
|
|
294
|
+
)
|
|
295
|
+
] })
|
|
296
|
+
}
|
|
297
|
+
)
|
|
298
|
+
}
|
|
299
|
+
);
|
|
300
|
+
}
|
|
301
|
+
export {
|
|
302
|
+
ToastProvider,
|
|
303
|
+
useToast
|
|
304
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const docs = {
|
|
2
|
+
name: "ToolCall",
|
|
3
|
+
description: "One tool or function call by an assistant with its lifecycle and the permission request shown before it runs.",
|
|
4
|
+
features: [
|
|
5
|
+
"status: pending, running, needs-approval, done, error, denied",
|
|
6
|
+
"needs-approval shows the input and Allow once, Always allow and Deny actions",
|
|
7
|
+
"Result goes in children and shows when done or error",
|
|
8
|
+
"title replaces the monospace name with a wrapping plain-language heading",
|
|
9
|
+
"compact swaps the status badge for the icon alone (label kept for screen readers)",
|
|
10
|
+
"footer is a row under the result for actions such as Undo"
|
|
11
|
+
],
|
|
12
|
+
accessibility: [
|
|
13
|
+
"Permission actions sit in a role=group labelled with the tool name",
|
|
14
|
+
"Status is conveyed by text label as well as icon and colour"
|
|
15
|
+
],
|
|
16
|
+
keyboard: "Tab to the approval buttons, Enter or Space to choose.",
|
|
17
|
+
usage: {
|
|
18
|
+
bestPractices: [
|
|
19
|
+
{ guidance: true, description: "Ask before any tool that reads private data or changes something, and show the exact input." },
|
|
20
|
+
{ guidance: false, description: "Do not auto-approve in the component, the host app owns the decision and the stored Always preference." }
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
examples: [
|
|
24
|
+
{ title: "ToolCall example", code: '<ToolCall name="search_tickets" status="needs-approval" description="Search support tickets" input="query: refund AND status:open" onApprove={(scope) => allow(scope)} onDeny={() => deny()} />' }
|
|
25
|
+
]
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
docs
|
|
29
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../../lib/cn.js";
|
|
4
|
+
import { Badge } from "../Badge/Badge.js";
|
|
5
|
+
import { Button } from "../Button/Button.js";
|
|
6
|
+
import { Murmur } from "../Murmur/Murmur.js";
|
|
7
|
+
import { Text } from "../Text/index.js";
|
|
8
|
+
import { Ban, Check, Clock, ShieldQuestion, Wrench, X } from "lucide-react";
|
|
9
|
+
const META = {
|
|
10
|
+
pending: { label: "Queued", tone: "neutral" },
|
|
11
|
+
running: { label: "Running", tone: "brand" },
|
|
12
|
+
"needs-approval": { label: "Needs approval", tone: "warning" },
|
|
13
|
+
done: { label: "Done", tone: "success" },
|
|
14
|
+
error: { label: "Failed", tone: "danger" },
|
|
15
|
+
denied: { label: "Denied", tone: "neutral" }
|
|
16
|
+
};
|
|
17
|
+
function StatusIcon({ status }) {
|
|
18
|
+
const cls = "h-4 w-4";
|
|
19
|
+
if (status === "running") return /* @__PURE__ */ jsx(Murmur, { state: "working", size: 22, label: "Running" });
|
|
20
|
+
if (status === "pending") return /* @__PURE__ */ jsx(Clock, { className: cls, "aria-hidden": true });
|
|
21
|
+
if (status === "needs-approval") return /* @__PURE__ */ jsx(ShieldQuestion, { className: cn(cls, "text-warning"), "aria-hidden": true });
|
|
22
|
+
if (status === "done") return /* @__PURE__ */ jsx(Check, { className: cn(cls, "text-success"), "aria-hidden": true });
|
|
23
|
+
if (status === "error") return /* @__PURE__ */ jsx(X, { className: cn(cls, "text-danger"), "aria-hidden": true });
|
|
24
|
+
if (status === "denied") return /* @__PURE__ */ jsx(Ban, { className: cls, "aria-hidden": true });
|
|
25
|
+
return /* @__PURE__ */ jsx(Wrench, { className: cls, "aria-hidden": true });
|
|
26
|
+
}
|
|
27
|
+
function ToolCall({
|
|
28
|
+
name,
|
|
29
|
+
title,
|
|
30
|
+
compact,
|
|
31
|
+
footer,
|
|
32
|
+
status = "done",
|
|
33
|
+
description,
|
|
34
|
+
input,
|
|
35
|
+
children,
|
|
36
|
+
onApprove,
|
|
37
|
+
onDeny,
|
|
38
|
+
hideAlways,
|
|
39
|
+
className,
|
|
40
|
+
...props
|
|
41
|
+
}) {
|
|
42
|
+
const meta = META[status];
|
|
43
|
+
const asking = status === "needs-approval";
|
|
44
|
+
return /* @__PURE__ */ jsxs(
|
|
45
|
+
"div",
|
|
46
|
+
{
|
|
47
|
+
className: cn("flex w-full flex-col gap-3 rounded-[var(--radius-panel)] border bg-surface p-3", asking ? "border-warning/40" : "border-hairline", className),
|
|
48
|
+
"data-status": status,
|
|
49
|
+
...props,
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
52
|
+
/* @__PURE__ */ jsx("span", { className: "flex h-8 w-8 shrink-0 items-center justify-center rounded-[var(--radius-lg)] bg-surface-hover text-fg-muted", children: /* @__PURE__ */ jsx(StatusIcon, { status }) }),
|
|
53
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
54
|
+
title ? /* @__PURE__ */ jsx(Text, { as: "p", size: "sm", weight: "medium", className: "break-words", children: title }) : /* @__PURE__ */ jsx(Text, { as: "p", size: "sm", weight: "medium", className: "truncate font-mono", children: name }),
|
|
55
|
+
description && /* @__PURE__ */ jsx(Text, { as: "p", size: "xs", color: "subtle", className: title ? "break-words" : "truncate", children: description })
|
|
56
|
+
] }),
|
|
57
|
+
compact ? /* @__PURE__ */ jsx("span", { className: "sr-only", children: meta.label }) : /* @__PURE__ */ jsx(Badge, { variant: "soft", tone: meta.tone, size: "sm", children: meta.label })
|
|
58
|
+
] }),
|
|
59
|
+
asking && /* @__PURE__ */ jsxs("div", { role: "group", "aria-label": `Permission request for ${name}`, className: "flex flex-col gap-3", children: [
|
|
60
|
+
input && /* @__PURE__ */ jsx("pre", { className: "max-h-32 overflow-auto whitespace-pre-wrap rounded-[var(--radius-lg)] bg-surface-hover px-3 py-2 font-mono text-xs text-fg-muted", children: input }),
|
|
61
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
62
|
+
/* @__PURE__ */ jsx(Button, { size: "sm", onClick: () => onApprove?.("once"), children: "Allow once" }),
|
|
63
|
+
!hideAlways && /* @__PURE__ */ jsx(Button, { size: "sm", variant: "outline", onClick: () => onApprove?.("always"), children: "Always allow" }),
|
|
64
|
+
/* @__PURE__ */ jsx(Button, { size: "sm", variant: "ghost", onClick: () => onDeny?.(), children: "Deny" })
|
|
65
|
+
] })
|
|
66
|
+
] }),
|
|
67
|
+
(status === "done" || status === "error") && children != null && /* @__PURE__ */ jsx("div", { className: "rounded-[var(--radius-lg)] bg-surface-hover px-3 py-2 text-xs text-fg-muted", children }),
|
|
68
|
+
footer != null && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-between gap-2 border-t border-hairline pt-2", children: footer })
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
export {
|
|
74
|
+
ToolCall
|
|
75
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const docs = {
|
|
2
|
+
name: "Tooltip",
|
|
3
|
+
description: "A short label that appears on hover or keyboard focus, positioned automatically, with an optional arrow.",
|
|
4
|
+
features: [
|
|
5
|
+
"Supports tone: auto (semantic token), dark (high contrast dark), light (light background)",
|
|
6
|
+
"Configurable placement side: top, right, bottom, left",
|
|
7
|
+
"Uses control radius --radius-lg for compact label pill geometry",
|
|
8
|
+
"Includes built-in TooltipProvider and animated entry transitions"
|
|
9
|
+
],
|
|
10
|
+
accessibility: [
|
|
11
|
+
"Triggers on keyboard focus as well as mouse hover",
|
|
12
|
+
"ESC key dismisses tooltip without moving focus",
|
|
13
|
+
"Exposes role='tooltip' automatically"
|
|
14
|
+
],
|
|
15
|
+
keyboard: "Focus trigger element to reveal, Escape to dismiss",
|
|
16
|
+
usage: {
|
|
17
|
+
bestPractices: [
|
|
18
|
+
{
|
|
19
|
+
guidance: true,
|
|
20
|
+
description: "Use Tooltip for short, non-interactive icon descriptions or action hints."
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
guidance: false,
|
|
24
|
+
description: "Do not place interactive buttons or links inside Tooltip content \u2014 use Popover instead."
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
examples: [
|
|
29
|
+
{
|
|
30
|
+
title: "Action Hint Tooltip",
|
|
31
|
+
code: '<Tooltip content="Save item to library"><Button iconLeft={<PlusIcon />}>Save</Button></Tooltip>'
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
docs
|
|
37
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
4
|
+
import { cn } from "../../lib/cn.js";
|
|
5
|
+
import { usePortalContainer } from "../../lib/portal-container.js";
|
|
6
|
+
const TONE_CLASSES = {
|
|
7
|
+
auto: "border border-transparent bg-tooltip text-tooltip-fg",
|
|
8
|
+
// ds-lint-disable-next-line no-hex — forced tone: fixed contrast regardless of theme
|
|
9
|
+
dark: "border border-transparent bg-[#18181b] text-white",
|
|
10
|
+
// ds-lint-disable-next-line no-hex — forced tone: fixed contrast regardless of theme
|
|
11
|
+
light: "border border-transparent bg-white text-[#18181b]"
|
|
12
|
+
};
|
|
13
|
+
const TONE_ARROW_FILL = {
|
|
14
|
+
auto: "fill-[rgb(var(--bg-tooltip))]",
|
|
15
|
+
// ds-lint-disable-next-line no-hex — forced-tone arrow fill matches TONE_CLASSES.dark
|
|
16
|
+
dark: "fill-[#18181b]",
|
|
17
|
+
light: "fill-white"
|
|
18
|
+
};
|
|
19
|
+
function Tooltip({
|
|
20
|
+
content,
|
|
21
|
+
children,
|
|
22
|
+
side = "top",
|
|
23
|
+
delayDuration = 300,
|
|
24
|
+
tone = "auto",
|
|
25
|
+
className,
|
|
26
|
+
open,
|
|
27
|
+
onOpenChange
|
|
28
|
+
}) {
|
|
29
|
+
const portalContainer = usePortalContainer();
|
|
30
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Provider, { delayDuration, skipDelayDuration: 300, children: /* @__PURE__ */ jsxs(TooltipPrimitive.Root, { open, onOpenChange, children: [
|
|
31
|
+
/* @__PURE__ */ jsx(TooltipPrimitive.Trigger, { asChild: true, children }),
|
|
32
|
+
/* @__PURE__ */ jsx(TooltipPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxs(
|
|
33
|
+
TooltipPrimitive.Content,
|
|
34
|
+
{
|
|
35
|
+
"data-panel": tone === "auto" ? true : void 0,
|
|
36
|
+
side,
|
|
37
|
+
sideOffset: 6,
|
|
38
|
+
avoidCollisions: true,
|
|
39
|
+
collisionPadding: 8,
|
|
40
|
+
className: cn(
|
|
41
|
+
"animate-rise-fast origin-[var(--radix-tooltip-content-transform-origin)] z-[var(--z-floating)] rounded-[var(--radius-lg)] px-2.5 py-1.5 text-xs shadow-panel max-w-[240px]",
|
|
42
|
+
TONE_CLASSES[tone],
|
|
43
|
+
className
|
|
44
|
+
),
|
|
45
|
+
children: [
|
|
46
|
+
content,
|
|
47
|
+
/* @__PURE__ */ jsx(TooltipPrimitive.Arrow, { className: TONE_ARROW_FILL[tone] })
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
) })
|
|
51
|
+
] }) });
|
|
52
|
+
}
|
|
53
|
+
export {
|
|
54
|
+
Tooltip
|
|
55
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const docs = {
|
|
2
|
+
name: "TopBar",
|
|
3
|
+
group: "layout",
|
|
4
|
+
description: "Header bar chrome component for page headers, breadcrumbs, search bars, and action toolbars.",
|
|
5
|
+
features: [
|
|
6
|
+
"Native HTML5 <header> semantic landmark wrapper",
|
|
7
|
+
"Standardized border-b border-hairline bottom border separator",
|
|
8
|
+
"Flex layout container for title, search, and action buttons"
|
|
9
|
+
],
|
|
10
|
+
accessibility: [
|
|
11
|
+
"Native <header> landmark element for page structure navigation"
|
|
12
|
+
],
|
|
13
|
+
usage: {
|
|
14
|
+
bestPractices: [
|
|
15
|
+
{
|
|
16
|
+
guidance: true,
|
|
17
|
+
description: "Use TopBar at the top of main content columns to host breadcrumbs, page titles, and action buttons."
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
guidance: false,
|
|
21
|
+
description: "Do not put primary application navigation inside TopBar \u2014 reach for Sidebar instead."
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
examples: [
|
|
26
|
+
{
|
|
27
|
+
title: "Header Toolbar",
|
|
28
|
+
code: '<TopBar><Breadcrumbs items={[{ label: "App" }, { label: "Settings" }]} /><Button size="sm" className="ml-auto">Save</Button></TopBar>'
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
docs
|
|
34
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/cn.js";
|
|
3
|
+
function TopBar({ children, className }) {
|
|
4
|
+
return /* @__PURE__ */ jsx("header", { className: cn("flex items-center min-h-14 border-b border-hairline bg-surface px-4 py-2", className), children });
|
|
5
|
+
}
|
|
6
|
+
export {
|
|
7
|
+
TopBar
|
|
8
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../../lib/cn.js";
|
|
4
|
+
function MotionPauseButton({
|
|
5
|
+
playing,
|
|
6
|
+
onToggle,
|
|
7
|
+
label = "animation",
|
|
8
|
+
className
|
|
9
|
+
}) {
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
"button",
|
|
12
|
+
{
|
|
13
|
+
type: "button",
|
|
14
|
+
onClick: onToggle,
|
|
15
|
+
"aria-label": playing ? `Pause ${label}` : `Play ${label}`,
|
|
16
|
+
className: cn(
|
|
17
|
+
"absolute bottom-2 right-2 z-10 flex h-8 w-8 items-center justify-center rounded-full border border-hairline bg-surface/85 text-fg shadow-2 backdrop-blur-sm transition hover:bg-surface",
|
|
18
|
+
className
|
|
19
|
+
),
|
|
20
|
+
children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", className: "h-3.5 w-3.5", fill: "currentColor", "aria-hidden": "true", children: playing ? /* @__PURE__ */ jsx("path", { d: "M7 5h3.5v14H7zM13.5 5H17v14h-3.5z" }) : /* @__PURE__ */ jsx("path", { d: "M8 5.5v13l11-6.5z" }) })
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
function VideoPauseToggle({
|
|
25
|
+
videoRef,
|
|
26
|
+
playing,
|
|
27
|
+
label = "video",
|
|
28
|
+
className
|
|
29
|
+
}) {
|
|
30
|
+
return /* @__PURE__ */ jsx(
|
|
31
|
+
MotionPauseButton,
|
|
32
|
+
{
|
|
33
|
+
playing,
|
|
34
|
+
label,
|
|
35
|
+
className,
|
|
36
|
+
onToggle: () => {
|
|
37
|
+
const v = videoRef.current;
|
|
38
|
+
if (!v) return;
|
|
39
|
+
if (v.paused) void v.play().catch(() => {
|
|
40
|
+
});
|
|
41
|
+
else v.pause();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
MotionPauseButton,
|
|
48
|
+
VideoPauseToggle
|
|
49
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const docs = {
|
|
2
|
+
name: "Video",
|
|
3
|
+
description: "Plays a video at a set ratio and fit, with a poster image and a placeholder when the source is missing. By default it plays muted on a loop, unless the user prefers reduced motion, with a pause button.",
|
|
4
|
+
features: [
|
|
5
|
+
"Supports radius escape hatch (radius='none|small|medium|large|full|inherit|concentric')",
|
|
6
|
+
"Defaults to panel radius --radius-panel per AGENTS.md rules",
|
|
7
|
+
"Zero Layout Shift (CLS) via ratio prop (e.g. ratio='16/9')",
|
|
8
|
+
"Autoplay defaults to true (with muted+loop for browser compliance)",
|
|
9
|
+
"Graceful SVG placeholder when src is missing",
|
|
10
|
+
"Poster image support for pre-load preview frame",
|
|
11
|
+
"playsInline enforced for mobile autoplay support"
|
|
12
|
+
],
|
|
13
|
+
accessibility: [
|
|
14
|
+
"Applies role='img' and aria-label='Video placeholder' to missing-src states",
|
|
15
|
+
"Supports native video controls via controls prop for keyboard-accessible playback",
|
|
16
|
+
"Muted by default to comply with browser autoplay policies"
|
|
17
|
+
],
|
|
18
|
+
usage: {
|
|
19
|
+
bestPractices: [
|
|
20
|
+
{
|
|
21
|
+
guidance: true,
|
|
22
|
+
description: "Always pass ratio='16/9' or explicit dimensions to reserve space and prevent layout shifts."
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
guidance: true,
|
|
26
|
+
description: "Provide a poster image for a professional pre-load frame before the video data arrives."
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
guidance: false,
|
|
30
|
+
description: "Do not use raw un-styled <video> tags \u2014 reach for Video primitive to handle placeholders and radius consistently."
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
examples: [
|
|
35
|
+
{
|
|
36
|
+
title: "Autoplay Background Video",
|
|
37
|
+
code: '<Video src="/hero.mp4" poster="/hero-poster.jpg" ratio="16/9" fit="cover" autoPlay loop muted />'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
title: "Controllable Video with Poster",
|
|
41
|
+
code: '<Video src="/demo.mp4" poster="/demo.jpg" ratio="16/9" controls autoPlay={false} />'
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
docs
|
|
47
|
+
};
|