@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,235 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../../lib/cn.js";
|
|
4
|
+
import { hitAreaClass } from "../../lib/hit-area.js";
|
|
5
|
+
import { Text } from "../Text/index.js";
|
|
6
|
+
function indicatorClass(state, size, isClickable) {
|
|
7
|
+
return cn(
|
|
8
|
+
"flex shrink-0 items-center justify-center rounded-full border-2 font-medium transition select-none",
|
|
9
|
+
size === "sm" ? "h-7 w-7 text-xs" : "h-9 w-9 text-sm",
|
|
10
|
+
state === "complete" && "border-brand-solid bg-brand-solid text-brand-fg",
|
|
11
|
+
state === "current" && "border-brand-text bg-surface text-brand-text font-bold",
|
|
12
|
+
state === "upcoming" && "border-hairline bg-surface text-fg-subtle",
|
|
13
|
+
isClickable && "group-hover:scale-105 transition-transform"
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
function CheckIcon({ size }) {
|
|
17
|
+
return /* @__PURE__ */ jsx(
|
|
18
|
+
"svg",
|
|
19
|
+
{
|
|
20
|
+
viewBox: "0 0 24 24",
|
|
21
|
+
fill: "none",
|
|
22
|
+
className: size === "sm" ? "h-3.5 w-3.5" : "h-4 w-4",
|
|
23
|
+
children: /* @__PURE__ */ jsx(
|
|
24
|
+
"path",
|
|
25
|
+
{
|
|
26
|
+
d: "M5 13l4 4L19 7",
|
|
27
|
+
stroke: "currentColor",
|
|
28
|
+
strokeWidth: "2.4",
|
|
29
|
+
strokeLinecap: "round",
|
|
30
|
+
strokeLinejoin: "round"
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
function Labels({
|
|
37
|
+
step,
|
|
38
|
+
state,
|
|
39
|
+
className
|
|
40
|
+
}) {
|
|
41
|
+
return /* @__PURE__ */ jsxs("div", { className, children: [
|
|
42
|
+
/* @__PURE__ */ jsx(
|
|
43
|
+
Text,
|
|
44
|
+
{
|
|
45
|
+
size: "sm",
|
|
46
|
+
weight: state === "current" ? "semibold" : "medium",
|
|
47
|
+
color: state === "upcoming" ? "muted" : "default",
|
|
48
|
+
children: step.title
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
step.description && /* @__PURE__ */ jsx(Text, { size: "xs", color: "subtle", className: "mt-0.5", children: step.description })
|
|
52
|
+
] });
|
|
53
|
+
}
|
|
54
|
+
function Stepper({
|
|
55
|
+
steps,
|
|
56
|
+
current,
|
|
57
|
+
orientation = "horizontal",
|
|
58
|
+
variant = "default",
|
|
59
|
+
size = "md",
|
|
60
|
+
onStepClick,
|
|
61
|
+
clickable,
|
|
62
|
+
hitArea,
|
|
63
|
+
className
|
|
64
|
+
}) {
|
|
65
|
+
const isClickableRule = clickable === "all" ? "all" : clickable === true || clickable === "completed" || onStepClick !== void 0 ? "completed" : false;
|
|
66
|
+
const stateOf = (i) => i < current ? "complete" : i === current ? "current" : "upcoming";
|
|
67
|
+
const isStepClickable = (i, step) => {
|
|
68
|
+
if (step.disabled) return false;
|
|
69
|
+
if (!onStepClick) return false;
|
|
70
|
+
if (isClickableRule === "all") return true;
|
|
71
|
+
if (isClickableRule === "completed") return i <= current;
|
|
72
|
+
return false;
|
|
73
|
+
};
|
|
74
|
+
const handleStepClick = (i, step) => {
|
|
75
|
+
if (isStepClickable(i, step) && onStepClick) {
|
|
76
|
+
onStepClick(i);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
if (variant === "cards") {
|
|
80
|
+
return /* @__PURE__ */ jsx("nav", { "aria-label": "Progress", className: cn("w-full", className), children: /* @__PURE__ */ jsx(
|
|
81
|
+
"ol",
|
|
82
|
+
{
|
|
83
|
+
className: cn(
|
|
84
|
+
"grid gap-2",
|
|
85
|
+
orientation === "vertical" ? "grid-cols-1" : `grid-cols-2 sm:grid-cols-${Math.min(steps.length, 6)}`
|
|
86
|
+
),
|
|
87
|
+
children: steps.map((step, i) => {
|
|
88
|
+
const state = stateOf(i);
|
|
89
|
+
const clickableStep = isStepClickable(i, step);
|
|
90
|
+
const isCurrent = state === "current";
|
|
91
|
+
const isComplete = state === "complete";
|
|
92
|
+
return /* @__PURE__ */ jsx("li", { className: "min-w-0", children: /* @__PURE__ */ jsxs(
|
|
93
|
+
"button",
|
|
94
|
+
{
|
|
95
|
+
type: "button",
|
|
96
|
+
onClick: () => handleStepClick(i, step),
|
|
97
|
+
disabled: !clickableStep,
|
|
98
|
+
"aria-current": isCurrent ? "step" : void 0,
|
|
99
|
+
className: cn(
|
|
100
|
+
"group flex w-full items-center gap-2.5 rounded-[var(--radius-lg)] p-2 text-left transition",
|
|
101
|
+
isCurrent ? "border border-hairline bg-surface-hover shadow-1 cursor-default" : isComplete ? clickableStep ? "border border-transparent hover:bg-surface-hover/60 cursor-pointer opacity-90" : "border border-transparent opacity-80 cursor-default" : "border border-transparent opacity-40 cursor-not-allowed"
|
|
102
|
+
),
|
|
103
|
+
children: [
|
|
104
|
+
/* @__PURE__ */ jsx(
|
|
105
|
+
"span",
|
|
106
|
+
{
|
|
107
|
+
className: cn(
|
|
108
|
+
"flex shrink-0 items-center justify-center rounded-full font-bold transition",
|
|
109
|
+
size === "sm" ? "h-6 w-6 text-xs" : "h-7 w-7 text-xs",
|
|
110
|
+
isCurrent ? "bg-brand-solid text-brand-fg" : isComplete ? "bg-fg text-surface" : "border border-hairline bg-surface text-fg-subtle"
|
|
111
|
+
),
|
|
112
|
+
children: isComplete ? /* @__PURE__ */ jsx(CheckIcon, { size: "sm" }) : step.icon ? step.icon : i + 1
|
|
113
|
+
}
|
|
114
|
+
),
|
|
115
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
116
|
+
/* @__PURE__ */ jsx("div", { className: "truncate text-xs font-semibold text-fg leading-tight", children: step.title }),
|
|
117
|
+
step.description && /* @__PURE__ */ jsx("div", { className: "truncate text-[11px] text-fg-subtle mt-0.5", children: step.description })
|
|
118
|
+
] })
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
) }, i);
|
|
122
|
+
})
|
|
123
|
+
}
|
|
124
|
+
) });
|
|
125
|
+
}
|
|
126
|
+
if (variant === "pills") {
|
|
127
|
+
return /* @__PURE__ */ jsx("nav", { "aria-label": "Progress", className: cn("w-full", className), children: /* @__PURE__ */ jsx("ol", { className: "flex flex-wrap items-center gap-2", children: steps.map((step, i) => {
|
|
128
|
+
const state = stateOf(i);
|
|
129
|
+
const clickableStep = isStepClickable(i, step);
|
|
130
|
+
const isCurrent = state === "current";
|
|
131
|
+
const isComplete = state === "complete";
|
|
132
|
+
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
|
|
133
|
+
"button",
|
|
134
|
+
{
|
|
135
|
+
type: "button",
|
|
136
|
+
onClick: () => handleStepClick(i, step),
|
|
137
|
+
disabled: !clickableStep,
|
|
138
|
+
"aria-current": isCurrent ? "step" : void 0,
|
|
139
|
+
className: cn(
|
|
140
|
+
"hit-area-touch inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium transition",
|
|
141
|
+
hitAreaClass(hitArea, "touch", "Stepper"),
|
|
142
|
+
isCurrent ? "bg-brand-solid text-brand-fg font-semibold shadow-1" : isComplete ? "bg-surface border border-hairline text-fg hover:border-hairline-strong cursor-pointer" : "bg-surface/50 border border-hairline text-fg-subtle opacity-60 cursor-not-allowed"
|
|
143
|
+
),
|
|
144
|
+
children: [
|
|
145
|
+
/* @__PURE__ */ jsx("span", { className: "font-bold", children: isComplete ? "\u2713" : i + 1 }),
|
|
146
|
+
/* @__PURE__ */ jsx("span", { children: step.title })
|
|
147
|
+
]
|
|
148
|
+
}
|
|
149
|
+
) }, i);
|
|
150
|
+
}) }) });
|
|
151
|
+
}
|
|
152
|
+
const connectorMt = size === "sm" ? "mt-[13px]" : "mt-[17px]";
|
|
153
|
+
if (orientation === "vertical") {
|
|
154
|
+
return /* @__PURE__ */ jsx("nav", { "aria-label": "Progress", className: cn("w-full", className), children: /* @__PURE__ */ jsx("ol", { className: "flex flex-col", children: steps.map((step, i) => {
|
|
155
|
+
const last = i === steps.length - 1;
|
|
156
|
+
const state = stateOf(i);
|
|
157
|
+
const clickableStep = isStepClickable(i, step);
|
|
158
|
+
const content = /* @__PURE__ */ jsxs("div", { className: "flex gap-3 text-left", children: [
|
|
159
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
|
|
160
|
+
/* @__PURE__ */ jsx("span", { className: indicatorClass(state, size, clickableStep), children: state === "complete" ? /* @__PURE__ */ jsx(CheckIcon, { size }) : step.icon ? step.icon : i + 1 }),
|
|
161
|
+
!last && /* @__PURE__ */ jsx(
|
|
162
|
+
"span",
|
|
163
|
+
{
|
|
164
|
+
className: cn(
|
|
165
|
+
"my-1 w-0.5 flex-1 transition-colors",
|
|
166
|
+
i < current ? "bg-brand-solid" : "bg-hairline"
|
|
167
|
+
)
|
|
168
|
+
}
|
|
169
|
+
)
|
|
170
|
+
] }),
|
|
171
|
+
/* @__PURE__ */ jsx(
|
|
172
|
+
Labels,
|
|
173
|
+
{
|
|
174
|
+
step,
|
|
175
|
+
state,
|
|
176
|
+
className: cn(
|
|
177
|
+
size === "sm" ? "pt-1" : "pt-1.5",
|
|
178
|
+
!last && "pb-6"
|
|
179
|
+
)
|
|
180
|
+
}
|
|
181
|
+
)
|
|
182
|
+
] });
|
|
183
|
+
return /* @__PURE__ */ jsx("li", { "aria-current": state === "current" ? "step" : void 0, children: clickableStep ? /* @__PURE__ */ jsx(
|
|
184
|
+
"button",
|
|
185
|
+
{
|
|
186
|
+
type: "button",
|
|
187
|
+
onClick: () => handleStepClick(i, step),
|
|
188
|
+
className: "group w-full rounded-[var(--radius-lg)] text-left",
|
|
189
|
+
children: content
|
|
190
|
+
}
|
|
191
|
+
) : content }, i);
|
|
192
|
+
}) }) });
|
|
193
|
+
}
|
|
194
|
+
return /* @__PURE__ */ jsx("nav", { "aria-label": "Progress", className: cn("w-full", className), children: /* @__PURE__ */ jsx("ol", { className: "flex w-full items-start", children: steps.map((step, i) => {
|
|
195
|
+
const last = i === steps.length - 1;
|
|
196
|
+
const state = stateOf(i);
|
|
197
|
+
const clickableStep = isStepClickable(i, step);
|
|
198
|
+
const content = /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center text-center", children: [
|
|
199
|
+
/* @__PURE__ */ jsx("span", { className: indicatorClass(state, size, clickableStep), children: state === "complete" ? /* @__PURE__ */ jsx(CheckIcon, { size }) : step.icon ? step.icon : i + 1 }),
|
|
200
|
+
/* @__PURE__ */ jsx(Labels, { step, state, className: "mt-2 px-2" })
|
|
201
|
+
] });
|
|
202
|
+
return /* @__PURE__ */ jsxs(
|
|
203
|
+
"li",
|
|
204
|
+
{
|
|
205
|
+
className: cn("flex items-start", !last && "flex-1"),
|
|
206
|
+
"aria-current": state === "current" ? "step" : void 0,
|
|
207
|
+
children: [
|
|
208
|
+
clickableStep ? /* @__PURE__ */ jsx(
|
|
209
|
+
"button",
|
|
210
|
+
{
|
|
211
|
+
type: "button",
|
|
212
|
+
onClick: () => handleStepClick(i, step),
|
|
213
|
+
className: "group rounded-[var(--radius-lg)] cursor-pointer",
|
|
214
|
+
children: content
|
|
215
|
+
}
|
|
216
|
+
) : content,
|
|
217
|
+
!last && /* @__PURE__ */ jsx(
|
|
218
|
+
"span",
|
|
219
|
+
{
|
|
220
|
+
className: cn(
|
|
221
|
+
"mx-2 h-0.5 flex-1 rounded-full transition-colors",
|
|
222
|
+
connectorMt,
|
|
223
|
+
i < current ? "bg-brand-solid" : "bg-hairline"
|
|
224
|
+
)
|
|
225
|
+
}
|
|
226
|
+
)
|
|
227
|
+
]
|
|
228
|
+
},
|
|
229
|
+
i
|
|
230
|
+
);
|
|
231
|
+
}) }) });
|
|
232
|
+
}
|
|
233
|
+
export {
|
|
234
|
+
Stepper
|
|
235
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const docs = {
|
|
2
|
+
name: "Switch",
|
|
3
|
+
description: "Turns a setting on or off, with an optional label. The thumb slides across the track when toggled.",
|
|
4
|
+
features: [
|
|
5
|
+
"Sizes: sm (20px track height) and md (24px track height)",
|
|
6
|
+
"Pill-shaped rounded-full handle and track (allowed exception to container panel radius)",
|
|
7
|
+
"Smooth sliding thumb transition between checked and unchecked states"
|
|
8
|
+
],
|
|
9
|
+
accessibility: [
|
|
10
|
+
"Uses role='switch' with aria-checked state handling",
|
|
11
|
+
"Space/Enter toggles active state when focused",
|
|
12
|
+
"Restores contrast across light and dark themes"
|
|
13
|
+
],
|
|
14
|
+
keyboard: "Space or Enter to toggle switch on/off",
|
|
15
|
+
usage: {
|
|
16
|
+
bestPractices: [
|
|
17
|
+
{
|
|
18
|
+
guidance: true,
|
|
19
|
+
description: "Use Switch for instant system setting toggles (e.g. Dark Mode, Notifications)."
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
guidance: false,
|
|
23
|
+
description: "Do not use Switch for form items requiring a manual Submit button \u2014 reach for Checkbox instead."
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
examples: [
|
|
28
|
+
{
|
|
29
|
+
title: "Settings Toggle",
|
|
30
|
+
code: '<Switch defaultChecked size="md" />'
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
docs
|
|
36
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import * as RadixSwitch from "@radix-ui/react-switch";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
import { cn } from "../../lib/cn.js";
|
|
7
|
+
import { hitAreaClass } from "../../lib/hit-area.js";
|
|
8
|
+
const trackVariants = cva(
|
|
9
|
+
"hit-area-touch relative inline-flex shrink-0 items-center rounded-full transition data-[state=checked]:bg-brand-solid data-[state=unchecked]:bg-border-control disabled:opacity-50",
|
|
10
|
+
{
|
|
11
|
+
variants: {
|
|
12
|
+
size: {
|
|
13
|
+
sm: "h-5 w-9",
|
|
14
|
+
md: "h-6 w-11"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
defaultVariants: { size: "md" }
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
const thumbVariants = cva(
|
|
21
|
+
"block rounded-full bg-canvas shadow-2 transition-transform data-[state=unchecked]:translate-x-0.5",
|
|
22
|
+
{
|
|
23
|
+
variants: {
|
|
24
|
+
size: {
|
|
25
|
+
sm: "h-4 w-4 data-[state=checked]:translate-x-[18px]",
|
|
26
|
+
md: "h-5 w-5 data-[state=checked]:translate-x-[22px]"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
defaultVariants: { size: "md" }
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
const Switch = forwardRef(function Switch2({ className, size, label, hitArea, ...props }, ref) {
|
|
33
|
+
const control = /* @__PURE__ */ jsx(RadixSwitch.Root, { ref, className: cn(trackVariants({ size }), hitAreaClass(hitArea, "touch", "Switch"), !label && className), ...props, children: /* @__PURE__ */ jsx(RadixSwitch.Thumb, { className: thumbVariants({ size }) }) });
|
|
34
|
+
if (!label) return control;
|
|
35
|
+
return /* @__PURE__ */ jsxs(
|
|
36
|
+
"label",
|
|
37
|
+
{
|
|
38
|
+
className: cn(
|
|
39
|
+
"inline-flex items-center gap-2 select-none",
|
|
40
|
+
props.disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer",
|
|
41
|
+
className
|
|
42
|
+
),
|
|
43
|
+
children: [
|
|
44
|
+
control,
|
|
45
|
+
/* @__PURE__ */ jsx("span", { className: cn(size === "sm" ? "text-xs" : "text-sm", "text-fg"), children: label })
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
});
|
|
50
|
+
export {
|
|
51
|
+
Switch,
|
|
52
|
+
thumbVariants,
|
|
53
|
+
trackVariants
|
|
54
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const docs = {
|
|
2
|
+
name: "Table",
|
|
3
|
+
description: "Data grid table primitives matching design system divider and hairline border visual token specifications.",
|
|
4
|
+
features: [
|
|
5
|
+
"Components: Table, TableHeader, TableBody, TableRow, TableColumnHeaderCell, TableCell",
|
|
6
|
+
"Scrolls sideways inside its own container when wider than the space it is given, fades the edge that still has content and becomes keyboard focusable only while it scrolls (scrollLabel names the region)",
|
|
7
|
+
"Row hover highlight and click handler support",
|
|
8
|
+
"Standardized cell padding and border-hairline dividers"
|
|
9
|
+
],
|
|
10
|
+
accessibility: [
|
|
11
|
+
"Native HTML5 <table>, <thead>, <tbody>, <th>, and <td> semantic elements",
|
|
12
|
+
"High contrast header text tracking",
|
|
13
|
+
"While the table scrolls it is a focusable region (tabIndex 0, role region) named by scrollLabel, so keyboard users can scroll it"
|
|
14
|
+
],
|
|
15
|
+
keyboard: "Tab to interactive table cells or action buttons inside table rows",
|
|
16
|
+
usage: {
|
|
17
|
+
bestPractices: [
|
|
18
|
+
{
|
|
19
|
+
guidance: true,
|
|
20
|
+
description: "Use Table for structured tabular data, invoices, user directories, and audit logs."
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
guidance: false,
|
|
24
|
+
description: "Do not use Table for page layout columns \u2014 reach for Grid or Flex instead."
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
guidance: false,
|
|
28
|
+
description: "Do not wrap a Table in overflow-hidden (a Card with overflow-hidden clips the scroll area). Keep the first column short; a comparison table with many columns is fine, it scrolls and fades."
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
structure: [
|
|
33
|
+
"Table > TableHeader > TableRow > TableColumnHeaderCell; Table > TableBody > TableRow > TableCell"
|
|
34
|
+
],
|
|
35
|
+
examples: [
|
|
36
|
+
{
|
|
37
|
+
title: "Data Directory Table",
|
|
38
|
+
code: `<Table>
|
|
39
|
+
<TableHeader><TableRow><TableColumnHeaderCell>Name</TableColumnHeaderCell><TableColumnHeaderCell>Role</TableColumnHeaderCell></TableRow></TableHeader>
|
|
40
|
+
<TableBody><TableRow><TableCell>Elena Rostova</TableCell><TableCell>Staff Engineer</TableCell></TableRow></TableBody>
|
|
41
|
+
</Table>`
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
docs
|
|
47
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../../lib/cn.js";
|
|
4
|
+
import { useScrollEdges } from "../../lib/scroll-edges.js";
|
|
5
|
+
function Table({ className, children, scrollLabel, ...props }) {
|
|
6
|
+
const { ref, scrollable, fadeStyle } = useScrollEdges();
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
"div",
|
|
9
|
+
{
|
|
10
|
+
ref,
|
|
11
|
+
className: "w-full overflow-x-auto",
|
|
12
|
+
style: fadeStyle,
|
|
13
|
+
...scrollable ? { tabIndex: 0, role: "region", "aria-label": scrollLabel ?? props["aria-label"] ?? "Scrollable table" } : {},
|
|
14
|
+
children: /* @__PURE__ */ jsx("table", { className: cn("w-full text-sm", className), ...props, children })
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
function TableHeader({ className, ...props }) {
|
|
19
|
+
return /* @__PURE__ */ jsx("thead", { className: cn(className), ...props });
|
|
20
|
+
}
|
|
21
|
+
function TableBody({ className, ...props }) {
|
|
22
|
+
return /* @__PURE__ */ jsx("tbody", { className: cn("divide-y divide-hairline", className), ...props });
|
|
23
|
+
}
|
|
24
|
+
function TableRow({
|
|
25
|
+
className,
|
|
26
|
+
onClick,
|
|
27
|
+
...props
|
|
28
|
+
}) {
|
|
29
|
+
return /* @__PURE__ */ jsx(
|
|
30
|
+
"tr",
|
|
31
|
+
{
|
|
32
|
+
className: cn(onClick && "cursor-pointer hover:bg-surface-hover transition", className),
|
|
33
|
+
onClick,
|
|
34
|
+
...props
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
function TableColumnHeaderCell({
|
|
39
|
+
className,
|
|
40
|
+
...props
|
|
41
|
+
}) {
|
|
42
|
+
return /* @__PURE__ */ jsx(
|
|
43
|
+
"th",
|
|
44
|
+
{
|
|
45
|
+
className: cn(
|
|
46
|
+
"border-b border-hairline px-3 py-2 text-left text-xs uppercase tracking-wide text-fg-muted",
|
|
47
|
+
className
|
|
48
|
+
),
|
|
49
|
+
...props
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
function TableCell({ className, ...props }) {
|
|
54
|
+
return /* @__PURE__ */ jsx("td", { className: cn("border-b border-hairline px-3 py-2 text-fg", className), ...props });
|
|
55
|
+
}
|
|
56
|
+
export {
|
|
57
|
+
Table,
|
|
58
|
+
TableBody,
|
|
59
|
+
TableCell,
|
|
60
|
+
TableColumnHeaderCell,
|
|
61
|
+
TableHeader,
|
|
62
|
+
TableRow
|
|
63
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
const docs = {
|
|
2
|
+
name: "Tabs",
|
|
3
|
+
description: "Switch between panels on a page, or between routes. Comes in line, segmented, pills and button styles.",
|
|
4
|
+
features: [
|
|
5
|
+
"Modes: as='states' (in-page panels) and as='navigation' (URL routing links)",
|
|
6
|
+
"Variants: line (default active underline), segmented, pills (rounded-full), button",
|
|
7
|
+
"Orientations: horizontal and vertical",
|
|
8
|
+
"Data-driven items prop array or compound children pattern"
|
|
9
|
+
],
|
|
10
|
+
accessibility: [
|
|
11
|
+
"Arrow key navigation between tab triggers",
|
|
12
|
+
"Automatic aria-selected and role='tablist' / role='tab' accessibility tree wiring",
|
|
13
|
+
"Supports disabled tab state and keyboard focus indicator"
|
|
14
|
+
],
|
|
15
|
+
keyboard: "Left/Right or Up/Down arrows to move focus between tab triggers, Space/Enter to activate",
|
|
16
|
+
usage: {
|
|
17
|
+
bestPractices: [
|
|
18
|
+
{
|
|
19
|
+
guidance: true,
|
|
20
|
+
description: "Use variant='line' for main page/section tabs and variant='segmented' for compact inline filters."
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
guidance: false,
|
|
24
|
+
description: "Do not mix as='states' and as='navigation' modes in the same tab strip."
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
examples: [
|
|
29
|
+
{
|
|
30
|
+
title: "Line (default)",
|
|
31
|
+
description: "Underline that slides to the active tab.",
|
|
32
|
+
code: '<Tabs variant="line" items={[{ label: "Overview", content: "Overview content" }, { label: "Activity", content: "Activity content" }, { label: "Settings", content: "Settings content" }]} />'
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
title: "Segmented",
|
|
36
|
+
description: 'Enclosed control; the brand pill glides between tabs (variant="segmented").',
|
|
37
|
+
code: '<Tabs variant="segmented" items={[{ label: "Day", content: "Day view" }, { label: "Week", content: "Week view" }, { label: "Month", content: "Month view" }]} />'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
title: "Pills",
|
|
41
|
+
description: 'Rounded capsule tabs (variant="pills").',
|
|
42
|
+
code: '<Tabs variant="pills" items={[{ label: "All", content: "All items" }, { label: "Active", content: "Active items" }, { label: "Archived", content: "Archived items" }]} />'
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
title: "Button",
|
|
46
|
+
description: 'Toolbar-style button tabs (variant="button").',
|
|
47
|
+
code: '<Tabs variant="button" items={[{ label: "Edit", content: "Editing" }, { label: "Preview", content: "Previewing" }]} />'
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
};
|
|
51
|
+
export {
|
|
52
|
+
docs
|
|
53
|
+
};
|