@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,36 @@
|
|
|
1
|
+
const docs = {
|
|
2
|
+
name: "Combobox",
|
|
3
|
+
description: "Searchable autocomplete dropdown control combining text input typing with filtered Radix Popover item selection.",
|
|
4
|
+
features: [
|
|
5
|
+
"Real-time client-side option filtering as the user types",
|
|
6
|
+
"Uses control radius --radius-lg for input and panel radius --radius-panel for popover list",
|
|
7
|
+
"Supports custom label formatting function via prettyOptionLabel",
|
|
8
|
+
"Matches popover panel width to the text input trigger width dynamically"
|
|
9
|
+
],
|
|
10
|
+
accessibility: [
|
|
11
|
+
"Supports keyboard typing, popover toggle, and focus restoration to input",
|
|
12
|
+
"Uses aria-expanded and aria-controls attributes for popup menu"
|
|
13
|
+
],
|
|
14
|
+
keyboard: "Type to filter options, Up/Down arrows to navigate popover list, Enter to select option, Escape to dismiss",
|
|
15
|
+
usage: {
|
|
16
|
+
bestPractices: [
|
|
17
|
+
{
|
|
18
|
+
guidance: true,
|
|
19
|
+
description: "Use Combobox when selecting from large datasets (>10 items) where typing to filter enhances speed."
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
guidance: false,
|
|
23
|
+
description: "Do not use Combobox for small static option lists (<= 5 items) \u2014 reach for Select or RadioGroup instead."
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
examples: [
|
|
28
|
+
{
|
|
29
|
+
title: "Searchable Country Combobox",
|
|
30
|
+
code: '<Combobox value="United States" options={["Canada", "Mexico", "United Kingdom", "United States"]} onChange={() => {}} />'
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
docs
|
|
36
|
+
};
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState, useMemo, useRef, useEffect, useId } from "react";
|
|
4
|
+
import { Popover, PopoverTrigger, PopoverContent, PopoverAnchor } from "../Popover/index.js";
|
|
5
|
+
import { cn } from "../../lib/cn.js";
|
|
6
|
+
import { hitAreaClass } from "../../lib/hit-area.js";
|
|
7
|
+
import { announce } from "../../lib/announce.js";
|
|
8
|
+
function Combobox({
|
|
9
|
+
value,
|
|
10
|
+
onChange,
|
|
11
|
+
options,
|
|
12
|
+
prettyOptionLabel,
|
|
13
|
+
size = "md",
|
|
14
|
+
hoverPreview = true,
|
|
15
|
+
hitArea,
|
|
16
|
+
className,
|
|
17
|
+
placeholder = "Select or type...",
|
|
18
|
+
disabled,
|
|
19
|
+
id,
|
|
20
|
+
...props
|
|
21
|
+
}) {
|
|
22
|
+
const [open, setOpen] = useState(false);
|
|
23
|
+
const [hoveredOption, setHoveredOption] = useState(null);
|
|
24
|
+
const [activeIndex, setActiveIndex] = useState(-1);
|
|
25
|
+
const triggerRef = useRef(null);
|
|
26
|
+
const inputRef = useRef(null);
|
|
27
|
+
const listRef = useRef(null);
|
|
28
|
+
const [width, setWidth] = useState(void 0);
|
|
29
|
+
const autoId = useId();
|
|
30
|
+
const inputId = id ?? `${autoId}-input`;
|
|
31
|
+
const listId = `${autoId}-list`;
|
|
32
|
+
const optionId = (i) => `${autoId}-opt-${i}`;
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (triggerRef.current) {
|
|
35
|
+
setWidth(triggerRef.current.getBoundingClientRect().width);
|
|
36
|
+
}
|
|
37
|
+
}, [open]);
|
|
38
|
+
const filteredOptions = useMemo(() => {
|
|
39
|
+
const q = (value || "").trim().toLowerCase();
|
|
40
|
+
if (!q) return options;
|
|
41
|
+
return options.filter((opt) => {
|
|
42
|
+
const keyMatch = opt.toLowerCase().includes(q);
|
|
43
|
+
const labelMatch = prettyOptionLabel ? prettyOptionLabel(opt).toLowerCase().includes(q) : false;
|
|
44
|
+
return keyMatch || labelMatch;
|
|
45
|
+
});
|
|
46
|
+
}, [options, value, prettyOptionLabel]);
|
|
47
|
+
const labelOf = (opt) => prettyOptionLabel ? prettyOptionLabel(opt) : opt;
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
setActiveIndex(-1);
|
|
50
|
+
if (!open) return;
|
|
51
|
+
const n = filteredOptions.length;
|
|
52
|
+
const t = setTimeout(() => announce(n === 0 ? "No matching options" : `${n} option${n === 1 ? "" : "s"} available`), 400);
|
|
53
|
+
return () => clearTimeout(t);
|
|
54
|
+
}, [filteredOptions, open]);
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
if (activeIndex < 0) return;
|
|
57
|
+
listRef.current?.querySelector(`#${CSS.escape(optionId(activeIndex))}`)?.scrollIntoView({ block: "nearest" });
|
|
58
|
+
}, [activeIndex]);
|
|
59
|
+
const commit = (opt) => {
|
|
60
|
+
onChange(opt);
|
|
61
|
+
setHoveredOption(null);
|
|
62
|
+
setActiveIndex(-1);
|
|
63
|
+
setOpen(false);
|
|
64
|
+
inputRef.current?.focus();
|
|
65
|
+
};
|
|
66
|
+
const onKeyDown = (e) => {
|
|
67
|
+
const last = filteredOptions.length - 1;
|
|
68
|
+
switch (e.key) {
|
|
69
|
+
case "ArrowDown":
|
|
70
|
+
e.preventDefault();
|
|
71
|
+
if (!open) setOpen(true);
|
|
72
|
+
if (!e.altKey && last >= 0) setActiveIndex((i) => i >= last ? 0 : i + 1);
|
|
73
|
+
break;
|
|
74
|
+
case "ArrowUp":
|
|
75
|
+
e.preventDefault();
|
|
76
|
+
if (!open) setOpen(true);
|
|
77
|
+
if (last >= 0) setActiveIndex((i) => i <= 0 ? last : i - 1);
|
|
78
|
+
break;
|
|
79
|
+
case "Enter":
|
|
80
|
+
if (open && activeIndex >= 0 && filteredOptions[activeIndex] !== void 0) {
|
|
81
|
+
e.preventDefault();
|
|
82
|
+
commit(filteredOptions[activeIndex]);
|
|
83
|
+
}
|
|
84
|
+
break;
|
|
85
|
+
case "Escape":
|
|
86
|
+
if (open) {
|
|
87
|
+
e.preventDefault();
|
|
88
|
+
e.stopPropagation();
|
|
89
|
+
setOpen(false);
|
|
90
|
+
setActiveIndex(-1);
|
|
91
|
+
}
|
|
92
|
+
break;
|
|
93
|
+
case "Tab":
|
|
94
|
+
setOpen(false);
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
props.onKeyDown?.(e);
|
|
98
|
+
};
|
|
99
|
+
const displayValue = hoverPreview && hoveredOption !== null ? labelOf(hoveredOption) : value;
|
|
100
|
+
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
101
|
+
/* @__PURE__ */ jsx(PopoverAnchor, { asChild: true, children: /* @__PURE__ */ jsxs("div", { ref: triggerRef, className: "relative flex items-center w-full", children: [
|
|
102
|
+
/* @__PURE__ */ jsx(
|
|
103
|
+
"input",
|
|
104
|
+
{
|
|
105
|
+
ref: inputRef,
|
|
106
|
+
id: inputId,
|
|
107
|
+
value: displayValue,
|
|
108
|
+
onChange: (e) => {
|
|
109
|
+
setHoveredOption(null);
|
|
110
|
+
onChange(e.target.value);
|
|
111
|
+
if (!open) setOpen(true);
|
|
112
|
+
},
|
|
113
|
+
onFocus: () => {
|
|
114
|
+
if (!open) setOpen(true);
|
|
115
|
+
},
|
|
116
|
+
placeholder,
|
|
117
|
+
disabled,
|
|
118
|
+
autoComplete: "off",
|
|
119
|
+
className: cn(
|
|
120
|
+
// Native <input>: no hit-area pseudo-element, so it grows under a coarse pointer (`hit-area-input`).
|
|
121
|
+
"hit-area-input w-full rounded-[var(--radius-lg)] border border-border-control bg-surface disabled:opacity-40",
|
|
122
|
+
hitAreaClass(hitArea, "input", "Combobox"),
|
|
123
|
+
size === "sm" ? "h-8 pl-2.5 pr-7 text-xs" : "h-10 pl-3 pr-8 text-base md:text-sm",
|
|
124
|
+
className
|
|
125
|
+
),
|
|
126
|
+
...props,
|
|
127
|
+
role: "combobox",
|
|
128
|
+
"aria-expanded": open,
|
|
129
|
+
"aria-controls": listId,
|
|
130
|
+
"aria-autocomplete": "list",
|
|
131
|
+
"aria-activedescendant": open && activeIndex >= 0 ? optionId(activeIndex) : void 0,
|
|
132
|
+
onKeyDown
|
|
133
|
+
}
|
|
134
|
+
),
|
|
135
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
136
|
+
"button",
|
|
137
|
+
{
|
|
138
|
+
type: "button",
|
|
139
|
+
tabIndex: -1,
|
|
140
|
+
disabled: disabled || options.length === 0,
|
|
141
|
+
onClick: (e) => {
|
|
142
|
+
e.preventDefault();
|
|
143
|
+
setOpen((prev) => !prev);
|
|
144
|
+
inputRef.current?.focus();
|
|
145
|
+
},
|
|
146
|
+
className: "absolute right-0 top-0 bottom-0 px-2 text-fg-muted hover:text-fg disabled:opacity-40 cursor-pointer",
|
|
147
|
+
"aria-label": "Show options",
|
|
148
|
+
"aria-expanded": open,
|
|
149
|
+
"aria-controls": listId,
|
|
150
|
+
children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", className: "h-3.5 w-3.5", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M6 9l6 6 6-6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
151
|
+
}
|
|
152
|
+
) })
|
|
153
|
+
] }) }),
|
|
154
|
+
/* @__PURE__ */ jsx(
|
|
155
|
+
PopoverContent,
|
|
156
|
+
{
|
|
157
|
+
style: { width: width ? `${width}px` : "auto" },
|
|
158
|
+
className: "p-1 min-w-[140px] max-h-56 overflow-y-auto shadow-panel",
|
|
159
|
+
align: "start",
|
|
160
|
+
sideOffset: 4,
|
|
161
|
+
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
162
|
+
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
163
|
+
onInteractOutside: (e) => {
|
|
164
|
+
if (triggerRef.current?.contains(e.target)) e.preventDefault();
|
|
165
|
+
},
|
|
166
|
+
children: /* @__PURE__ */ jsx(
|
|
167
|
+
"div",
|
|
168
|
+
{
|
|
169
|
+
ref: listRef,
|
|
170
|
+
id: listId,
|
|
171
|
+
role: "listbox",
|
|
172
|
+
"aria-labelledby": props["aria-labelledby"],
|
|
173
|
+
"aria-label": props["aria-labelledby"] ? void 0 : props["aria-label"] ?? placeholder,
|
|
174
|
+
children: filteredOptions.length === 0 ? /* @__PURE__ */ jsx("div", { className: "px-2.5 py-2 text-xs text-fg-subtle italic", children: "No matching options" }) : filteredOptions.map((opt, i) => /* @__PURE__ */ jsx(
|
|
175
|
+
"div",
|
|
176
|
+
{
|
|
177
|
+
id: optionId(i),
|
|
178
|
+
role: "option",
|
|
179
|
+
"aria-selected": i === activeIndex,
|
|
180
|
+
"data-highlighted": i === activeIndex || void 0,
|
|
181
|
+
"data-current": opt === value || void 0,
|
|
182
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
183
|
+
onMouseEnter: () => hoverPreview && setHoveredOption(opt),
|
|
184
|
+
onMouseLeave: () => hoverPreview && setHoveredOption(null),
|
|
185
|
+
onClick: () => commit(opt),
|
|
186
|
+
className: "flex w-full cursor-pointer items-center justify-between rounded-[var(--radius-lg)] px-2.5 py-1.5 text-left text-xs text-fg hover:bg-elevated-hover data-[highlighted]:bg-elevated-hover data-[current]:font-medium",
|
|
187
|
+
children: labelOf(opt)
|
|
188
|
+
},
|
|
189
|
+
opt
|
|
190
|
+
))
|
|
191
|
+
}
|
|
192
|
+
)
|
|
193
|
+
}
|
|
194
|
+
)
|
|
195
|
+
] });
|
|
196
|
+
}
|
|
197
|
+
export {
|
|
198
|
+
Combobox
|
|
199
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
const docs = {
|
|
2
|
+
name: "Container",
|
|
3
|
+
group: "layout",
|
|
4
|
+
description: "Width-constrained content container with size presets (xs to full) and background media props. Useful for centered hero content with full-bleed media backdrops.",
|
|
5
|
+
features: [
|
|
6
|
+
"Size presets: xs (28rem), sm (42rem), md (56rem), lg (72rem), xl (88rem), full (no constraint)",
|
|
7
|
+
"Surface contrast scope via surface prop for media backgrounds. With a photo, video or fx backdrop and no surface it defaults to dark-always plus a dark scrim (dark-30, fx dark-50); meshes and custom gradients need an explicit surface (dark-always or light-always)",
|
|
8
|
+
"Background media: bgVideo, bgImage, bgOverlays (presets, hex, tokens, gradients via comma-separated shorthand), bgSize, bgVideoPaused",
|
|
9
|
+
"Fx backdrops (needs `npm i @shavin/fx`, free to use under its own licence, and `registerFxBackdrops()`): bgOverlays=\"fx:dither-waves, gradient-bottom\"; params only when changed: fx:fluid-silk(speed=1.2); quote text values: fx:type-tiles(text='Plan money')"
|
|
10
|
+
],
|
|
11
|
+
accessibility: [
|
|
12
|
+
"Supports semantic HTML tags via polymorphic as prop"
|
|
13
|
+
],
|
|
14
|
+
usage: {
|
|
15
|
+
bestPractices: [
|
|
16
|
+
{ guidance: true, description: "Use Container inside Section to constrain content width within full-bleed sections." },
|
|
17
|
+
{ guidance: true, description: 'Use size="lg" for every body section of a page so all content shares one centred column with margins at 1280 and 1440; keep xl for the nav and footer and full for media.' },
|
|
18
|
+
{ guidance: true, description: "Use bgImage with dark-50 overlay + surface=dark for centered hero content over media." },
|
|
19
|
+
{ guidance: false, description: "Do not wrap media in nested divs \u2014 pass bgVideo/bgImage directly to Container." }
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
examples: [
|
|
23
|
+
{
|
|
24
|
+
title: "Centered Content Container",
|
|
25
|
+
code: '<Container size="md"><Heading size="xl">Title</Heading><Text>Content here.</Text></Container>'
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
title: "Container with Background Image + Dark Overlay",
|
|
29
|
+
description: "bgImage with dark-50 overlay and surface=dark for centered hero content",
|
|
30
|
+
code: '<Container size="lg" bgImage="https://..." bgOverlays="dark-50" surface="dark-always" className="h-[300px] flex flex-col items-center justify-center"><Heading size="2xl">Centered Hero</Heading><Button size="lg">Learn More</Button></Container>'
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
title: "Triple-Layer Overlay with Video",
|
|
34
|
+
description: "bgVideo with three composited layers \u2014 dark-20 base, gradient-radial@60%, light-20@30%",
|
|
35
|
+
code: '<Container size="md" bgVideo="https://..." bgOverlays="dark-20, gradient-radial/60, light-20/30" surface="dark-always"><Heading size="xl">Triple Layer</Heading></Container>'
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
title: "Custom Gradient + Token Overlay",
|
|
39
|
+
description: "Custom linear gradient with hex stops + semantic brand token \u2014 no JSON needed",
|
|
40
|
+
code: '<Container size="md" bgVideo="https://..." bgOverlays="linear(180deg, #000/0%, #000/100%)/70, (brand)/15" surface="dark-always"><Heading size="2xl">Gradient + Brand</Heading><Button>Get Started</Button></Container>'
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
};
|
|
44
|
+
export {
|
|
45
|
+
docs
|
|
46
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { cn } from "../../lib/cn.js";
|
|
4
|
+
import { surfaceClass } from "../../lib/surface.js";
|
|
5
|
+
import { bgMediaLayer, resolveBgReadability } from "../../lib/media-overlays.js";
|
|
6
|
+
const containerVariants = cva("mx-auto w-full px-4 sm:px-6", {
|
|
7
|
+
variants: {
|
|
8
|
+
size: { xs: "max-w-md", sm: "max-w-2xl", md: "max-w-4xl", lg: "max-w-6xl", xl: "max-w-8xl", full: "max-w-none" }
|
|
9
|
+
},
|
|
10
|
+
defaultVariants: { size: "md" }
|
|
11
|
+
});
|
|
12
|
+
function Container({
|
|
13
|
+
as: Tag = "div",
|
|
14
|
+
className,
|
|
15
|
+
size,
|
|
16
|
+
translucent,
|
|
17
|
+
surface,
|
|
18
|
+
style,
|
|
19
|
+
bgVideo,
|
|
20
|
+
bgImage,
|
|
21
|
+
bgSize,
|
|
22
|
+
bgOverlays,
|
|
23
|
+
bgVideoPaused,
|
|
24
|
+
bgPoster,
|
|
25
|
+
children,
|
|
26
|
+
...props
|
|
27
|
+
}) {
|
|
28
|
+
const layoutClass = containerVariants({ size });
|
|
29
|
+
const bg = resolveBgReadability({ surface, bgVideo, bgImage, bgOverlays });
|
|
30
|
+
const { hasMedia, media, content } = bgMediaLayer({ bgVideo, bgImage, bgSize, bgOverlays: bg.bgOverlays, bgVideoPaused, bgPoster }, layoutClass);
|
|
31
|
+
return /* @__PURE__ */ jsxs(
|
|
32
|
+
Tag,
|
|
33
|
+
{
|
|
34
|
+
"data-panel": translucent || void 0,
|
|
35
|
+
"data-surface": bg.surface || void 0,
|
|
36
|
+
className: cn(
|
|
37
|
+
hasMedia ? "relative overflow-hidden" : layoutClass,
|
|
38
|
+
translucent && "rounded-[var(--radius-panel)] border border-hairline shadow-card",
|
|
39
|
+
surfaceClass(bg.surface),
|
|
40
|
+
className
|
|
41
|
+
),
|
|
42
|
+
style,
|
|
43
|
+
...props,
|
|
44
|
+
children: [
|
|
45
|
+
media,
|
|
46
|
+
content(children)
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
Container,
|
|
53
|
+
containerVariants
|
|
54
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const docs = {
|
|
2
|
+
name: "ContextMenu",
|
|
3
|
+
description: "A menu of actions that opens when the user right-clicks the area it wraps. Items can be marked as dangerous.",
|
|
4
|
+
features: [
|
|
5
|
+
"Components: ContextMenu and ContextMenuItem",
|
|
6
|
+
"Supports CVA variant='default' and variant='danger' (destructive item)",
|
|
7
|
+
"Right-click trigger zone binding",
|
|
8
|
+
"Includes data-panel translucent backdrop attribute"
|
|
9
|
+
],
|
|
10
|
+
accessibility: [
|
|
11
|
+
"Keyboard item highlight and selection",
|
|
12
|
+
"Applies role='menu' and role='menuitem' accessibility semantics"
|
|
13
|
+
],
|
|
14
|
+
keyboard: "Up/Down arrows to navigate menu items, Enter to select item, Escape to dismiss",
|
|
15
|
+
usage: {
|
|
16
|
+
bestPractices: [
|
|
17
|
+
{
|
|
18
|
+
guidance: true,
|
|
19
|
+
description: "Use ContextMenu for desktop right-click power-user shortcuts (e.g. file row actions)."
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
guidance: false,
|
|
23
|
+
description: "Do not hide critical primary functionality exclusively behind right-click context menus."
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
examples: [
|
|
28
|
+
{
|
|
29
|
+
title: "Right-Click Context Target",
|
|
30
|
+
code: '<ContextMenu trigger={<div>Right click me</div>}><ContextMenuItem>Copy Link</ContextMenuItem><ContextMenuItem variant="danger">Delete</ContextMenuItem></ContextMenu>'
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
docs
|
|
36
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { cn } from "../../lib/cn.js";
|
|
6
|
+
import { usePortalContainer } from "../../lib/portal-container.js";
|
|
7
|
+
function ContextMenu({
|
|
8
|
+
trigger,
|
|
9
|
+
children,
|
|
10
|
+
className
|
|
11
|
+
}) {
|
|
12
|
+
const portalContainer = usePortalContainer();
|
|
13
|
+
return /* @__PURE__ */ jsxs(ContextMenuPrimitive.Root, { children: [
|
|
14
|
+
/* @__PURE__ */ jsx(ContextMenuPrimitive.Trigger, { asChild: true, children: trigger }),
|
|
15
|
+
/* @__PURE__ */ jsx(ContextMenuPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
|
|
16
|
+
ContextMenuPrimitive.Content,
|
|
17
|
+
{
|
|
18
|
+
"data-panel": true,
|
|
19
|
+
avoidCollisions: true,
|
|
20
|
+
collisionPadding: 8,
|
|
21
|
+
className: cn(
|
|
22
|
+
"animate-rise origin-[var(--radix-context-menu-content-transform-origin)] z-[var(--z-floating)] min-w-44 overflow-hidden rounded-[var(--radius-panel)] border border-hairline bg-surface p-1 space-y-0.5 shadow-panel focus:outline-none select-none",
|
|
23
|
+
className
|
|
24
|
+
),
|
|
25
|
+
children
|
|
26
|
+
}
|
|
27
|
+
) })
|
|
28
|
+
] });
|
|
29
|
+
}
|
|
30
|
+
const contextMenuItemVariants = cva(
|
|
31
|
+
"flex items-center w-full cursor-pointer px-2.5 h-7 text-left text-xs rounded-panel-p1 outline-none hover:bg-elevated-hover data-[highlighted]:bg-elevated-hover transition-colors",
|
|
32
|
+
{
|
|
33
|
+
variants: {
|
|
34
|
+
variant: {
|
|
35
|
+
default: "text-fg",
|
|
36
|
+
danger: "border-t border-hairline text-danger"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
defaultVariants: { variant: "default" }
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
function ContextMenuItem({
|
|
43
|
+
className,
|
|
44
|
+
variant,
|
|
45
|
+
...props
|
|
46
|
+
}) {
|
|
47
|
+
return /* @__PURE__ */ jsx(
|
|
48
|
+
ContextMenuPrimitive.Item,
|
|
49
|
+
{
|
|
50
|
+
className: cn(contextMenuItemVariants({ variant }), className),
|
|
51
|
+
...props
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
ContextMenu,
|
|
57
|
+
ContextMenuItem,
|
|
58
|
+
contextMenuItemVariants
|
|
59
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const docs = {
|
|
2
|
+
name: "DataList",
|
|
3
|
+
description: "Shows labelled values, such as the fields of a record, as a list of label and value pairs. Labels sit above the values or beside them.",
|
|
4
|
+
features: [
|
|
5
|
+
"Orientations: vertical (default stacked) and horizontal (inline justify-between rows)",
|
|
6
|
+
"Semantic <dl> / <dt> / <dd> HTML structure",
|
|
7
|
+
"Uses Text primitive with size='overline' for label formatting"
|
|
8
|
+
],
|
|
9
|
+
accessibility: [
|
|
10
|
+
"Native HTML5 description list accessibility semantics (<dl>, <dt>, <dd>)",
|
|
11
|
+
"Clean screen reader association between definition terms and values"
|
|
12
|
+
],
|
|
13
|
+
usage: {
|
|
14
|
+
bestPractices: [
|
|
15
|
+
{
|
|
16
|
+
guidance: true,
|
|
17
|
+
description: "Use DataList for key-value property summaries in drawer inspectors, detail sidebars, or modal viewports."
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
guidance: false,
|
|
21
|
+
description: "Do not use plain <div> or <span> pairs when displaying key-value properties \u2014 reach for DataList."
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
examples: [
|
|
26
|
+
{
|
|
27
|
+
title: "Vertical Property DataList",
|
|
28
|
+
code: '<DataList orientation="vertical"><DataListItem label="Status">Active</DataListItem><DataListItem label="Role">Administrator</DataListItem></DataList>'
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
docs
|
|
34
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { cn } from "../../lib/cn.js";
|
|
4
|
+
import { Text } from "../Text/index.js";
|
|
5
|
+
const dataListVariants = cva("flex flex-col", {
|
|
6
|
+
variants: {
|
|
7
|
+
orientation: {
|
|
8
|
+
vertical: "gap-4",
|
|
9
|
+
horizontal: "gap-2 [&>div]:flex-row [&>div]:items-baseline [&>div]:justify-between [&>div]:gap-4"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
defaultVariants: { orientation: "vertical" }
|
|
13
|
+
});
|
|
14
|
+
function DataList({
|
|
15
|
+
orientation,
|
|
16
|
+
className,
|
|
17
|
+
...props
|
|
18
|
+
}) {
|
|
19
|
+
return /* @__PURE__ */ jsx("dl", { className: cn(dataListVariants({ orientation }), className), ...props });
|
|
20
|
+
}
|
|
21
|
+
function DataListItem({
|
|
22
|
+
label,
|
|
23
|
+
className,
|
|
24
|
+
children
|
|
25
|
+
}) {
|
|
26
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-1", className), children: [
|
|
27
|
+
/* @__PURE__ */ jsx("dt", { children: /* @__PURE__ */ jsx(Text, { size: "overline", color: "subtle", weight: "medium", children: label }) }),
|
|
28
|
+
/* @__PURE__ */ jsx("dd", { children: /* @__PURE__ */ jsx(Text, { size: "sm", weight: "medium", children }) })
|
|
29
|
+
] });
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
DataList,
|
|
33
|
+
DataListItem,
|
|
34
|
+
dataListVariants
|
|
35
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const docs = {
|
|
2
|
+
name: "DatePicker",
|
|
3
|
+
description: "Standalone themeable date and time picker with portal popup calendar, editable text draft input, and customizable token styling.",
|
|
4
|
+
features: [
|
|
5
|
+
"Supports dateOnly mode or combined date and time selection",
|
|
6
|
+
"Editable input field allows direct typing or popover selection",
|
|
7
|
+
"Uses portal rendering to prevent container clipping",
|
|
8
|
+
"Fully customizable DatePickerTokens prop interface"
|
|
9
|
+
],
|
|
10
|
+
accessibility: [
|
|
11
|
+
"Renders accessible calendar grid with month navigation controls",
|
|
12
|
+
"Applies keyboard Enter commit handling on input draft field"
|
|
13
|
+
],
|
|
14
|
+
keyboard: "Type date string in input, Enter to commit, Arrow buttons to switch month view",
|
|
15
|
+
usage: {
|
|
16
|
+
bestPractices: [
|
|
17
|
+
{
|
|
18
|
+
guidance: true,
|
|
19
|
+
description: "Use DatePicker for form date selection (e.g. Birthdays, Scheduling, Event dates)."
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
guidance: false,
|
|
23
|
+
description: "Do not use DatePicker for static inline event calendar displays \u2014 reach for Calendar primitive instead."
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
examples: [
|
|
28
|
+
{
|
|
29
|
+
title: "Date & Time Input Field",
|
|
30
|
+
code: "<DatePicker value={new Date()} onChange={() => {}} dateOnly={false} />"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
docs
|
|
36
|
+
};
|