@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,275 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useContext } from "react";
|
|
4
|
+
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
5
|
+
import { cn } from "../../lib/cn.js";
|
|
6
|
+
import { hitAreaClass } from "../../lib/hit-area.js";
|
|
7
|
+
import { useSlidingIndicator } from "../../lib/useSlidingIndicator.js";
|
|
8
|
+
const SLIDING_TAB = /* @__PURE__ */ new Set(["line", "segmented", "pills", "pill"]);
|
|
9
|
+
function IndicatorList({
|
|
10
|
+
variant,
|
|
11
|
+
orientation,
|
|
12
|
+
size = "md",
|
|
13
|
+
className,
|
|
14
|
+
children,
|
|
15
|
+
"aria-label": ariaLabel
|
|
16
|
+
}) {
|
|
17
|
+
const horizontal = orientation !== "vertical";
|
|
18
|
+
const slides = SLIDING_TAB.has(variant);
|
|
19
|
+
const { ref, indicatorRef, pos, size: indSize, on, transitionClass: transition } = useSlidingIndicator({
|
|
20
|
+
enabled: slides,
|
|
21
|
+
orientation,
|
|
22
|
+
activeSelector: '[data-state="active"]'
|
|
23
|
+
});
|
|
24
|
+
const indStyle = horizontal ? { transform: `translateX(${pos}px)`, width: indSize } : { transform: `translateY(${pos}px)`, height: indSize };
|
|
25
|
+
const hidden = !on && "opacity-0";
|
|
26
|
+
return /* @__PURE__ */ jsxs(TabsPrimitive.List, { ref: slides ? ref : void 0, "aria-label": ariaLabel, className: cn(slides && "relative", listClass(variant, orientation, size), className), children: [
|
|
27
|
+
slides && (variant === "line" ? /* @__PURE__ */ jsx(
|
|
28
|
+
"span",
|
|
29
|
+
{
|
|
30
|
+
ref: indicatorRef,
|
|
31
|
+
"aria-hidden": "true",
|
|
32
|
+
className: cn("pointer-events-none absolute z-0 bg-brand-text", horizontal ? "bottom-0 h-0.5" : "left-0 w-0.5", transition, hidden),
|
|
33
|
+
style: indStyle
|
|
34
|
+
}
|
|
35
|
+
) : variant === "pills" || variant === "pill" ? /* @__PURE__ */ jsx(
|
|
36
|
+
"span",
|
|
37
|
+
{
|
|
38
|
+
ref: indicatorRef,
|
|
39
|
+
"aria-hidden": "true",
|
|
40
|
+
className: cn("pointer-events-none absolute z-0 rounded-full border border-hairline/40 bg-surface shadow-card", size === "sm" ? "top-0.5 bottom-0.5" : "top-1 bottom-1", transition, hidden),
|
|
41
|
+
style: indStyle
|
|
42
|
+
}
|
|
43
|
+
) : /* @__PURE__ */ jsx(
|
|
44
|
+
"span",
|
|
45
|
+
{
|
|
46
|
+
ref: indicatorRef,
|
|
47
|
+
"aria-hidden": "true",
|
|
48
|
+
className: cn("pointer-events-none absolute z-0 rounded-panel-p1 bg-brand-solid", size === "sm" ? "top-0.5 bottom-0.5" : "top-1 bottom-1", transition, hidden),
|
|
49
|
+
style: indStyle
|
|
50
|
+
}
|
|
51
|
+
)),
|
|
52
|
+
children
|
|
53
|
+
] });
|
|
54
|
+
}
|
|
55
|
+
function listClass(variant, o, size = "md") {
|
|
56
|
+
if (variant === "button") {
|
|
57
|
+
return cn(
|
|
58
|
+
"flex items-center",
|
|
59
|
+
size === "sm" ? "gap-0.5" : "gap-1",
|
|
60
|
+
o === "vertical" && "flex-col items-stretch"
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
if (variant === "pills" || variant === "pill") {
|
|
64
|
+
return cn(
|
|
65
|
+
"inline-flex border border-hairline/60 bg-surface-hover/80 w-fit",
|
|
66
|
+
o === "vertical" ? "flex-col rounded-[var(--radius-panel)]" : "rounded-full",
|
|
67
|
+
size === "sm" ? "gap-0.5 p-0.5" : "gap-1 p-1"
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
if (variant === "segmented") {
|
|
71
|
+
return cn(
|
|
72
|
+
"inline-flex rounded-[var(--radius-panel)] border border-hairline w-fit",
|
|
73
|
+
size === "sm" ? "gap-0.5 p-0.5" : "gap-0.5 p-1",
|
|
74
|
+
o === "vertical" && "flex-col"
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
return o === "vertical" ? cn("flex flex-col border-l border-hairline", size === "sm" ? "gap-0.5" : "gap-1") : cn("flex border-b border-hairline", size === "sm" ? "gap-0.5" : "gap-1");
|
|
78
|
+
}
|
|
79
|
+
function triggerClass(variant, o, size = "md", hitArea) {
|
|
80
|
+
return cn("hit-area-touch", hitAreaClass(hitArea, "touch", "Tabs"), triggerVariantClass(variant, o, size));
|
|
81
|
+
}
|
|
82
|
+
function triggerVariantClass(variant, o, size = "md") {
|
|
83
|
+
const isSm = size === "sm";
|
|
84
|
+
if (variant === "button") {
|
|
85
|
+
return cn(
|
|
86
|
+
"rounded-[var(--radius-lg)] font-medium text-fg-muted transition hover:bg-surface-hover hover:text-fg data-[state=active]:bg-surface-hover data-[state=active]:text-fg data-[state=active]:font-semibold",
|
|
87
|
+
isSm ? "px-2 py-1 text-xs" : "px-2.5 py-1 text-sm"
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
if (variant === "pills" || variant === "pill") {
|
|
91
|
+
return cn(
|
|
92
|
+
"relative z-10 rounded-full font-medium text-fg-muted transition hover:text-fg active:scale-[0.97] data-[state=active]:text-fg data-[state=active]:font-semibold",
|
|
93
|
+
isSm ? "px-3 py-1 text-xs" : "px-4 py-1.5 text-sm"
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
if (variant === "segmented") {
|
|
97
|
+
return cn(
|
|
98
|
+
"relative z-10 rounded-panel-p1 text-fg-muted transition hover:text-fg active:scale-[0.97] data-[state=active]:text-brand-fg",
|
|
99
|
+
isSm ? "px-2.5 py-1 text-xs font-medium" : "px-3 py-1.5 text-sm font-medium"
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
const active = "data-[state=active]:font-medium data-[state=active]:text-fg";
|
|
103
|
+
const inactive = "data-[state=inactive]:text-fg-muted data-[state=inactive]:hover:text-fg";
|
|
104
|
+
return o === "vertical" ? cn("relative z-10 -ml-px border-l-2 border-transparent text-left transition", isSm ? "px-2.5 py-1.5 text-xs" : "px-3 py-2 text-sm", active, inactive) : cn("relative z-10 -mb-px border-b-2 border-transparent transition", isSm ? "px-2.5 py-1.5 text-xs" : "px-3 py-2.5 text-sm", active, inactive);
|
|
105
|
+
}
|
|
106
|
+
function Tabs({
|
|
107
|
+
as = "states",
|
|
108
|
+
variant = "line",
|
|
109
|
+
orientation = "horizontal",
|
|
110
|
+
size = "md",
|
|
111
|
+
value,
|
|
112
|
+
defaultValue,
|
|
113
|
+
onValueChange,
|
|
114
|
+
items,
|
|
115
|
+
tabs,
|
|
116
|
+
linkComponent: LinkComponent = "a",
|
|
117
|
+
children,
|
|
118
|
+
className,
|
|
119
|
+
hitArea,
|
|
120
|
+
"aria-label": ariaLabel
|
|
121
|
+
}) {
|
|
122
|
+
const resolvedItems = items ?? tabs ?? [];
|
|
123
|
+
const isNavMode = as === "navigation";
|
|
124
|
+
if (isNavMode) {
|
|
125
|
+
return (
|
|
126
|
+
// Page links are navigation, not tabs: a labelled <nav> with aria-current, no tab roles.
|
|
127
|
+
/* @__PURE__ */ jsxs("nav", { "aria-label": ariaLabel, className: cn(listClass(variant, orientation, size), className), children: [
|
|
128
|
+
resolvedItems.map((item, i) => {
|
|
129
|
+
const isActive = item.active ?? (value ? item.value === value : false);
|
|
130
|
+
return /* @__PURE__ */ jsxs(
|
|
131
|
+
LinkComponent,
|
|
132
|
+
{
|
|
133
|
+
href: item.href ?? "#",
|
|
134
|
+
"aria-current": isActive ? "page" : void 0,
|
|
135
|
+
target: item.external ? "_blank" : void 0,
|
|
136
|
+
rel: item.external ? "noopener noreferrer" : void 0,
|
|
137
|
+
className: cn(
|
|
138
|
+
"hit-area-touch inline-flex items-center gap-1.5 font-medium transition cursor-pointer whitespace-nowrap",
|
|
139
|
+
hitAreaClass(hitArea, "touch", "Tabs"),
|
|
140
|
+
variant === "button" ? cn(
|
|
141
|
+
"rounded-[var(--radius-lg)]",
|
|
142
|
+
size === "sm" ? "px-2 py-1 text-xs" : "px-2.5 py-1 text-sm",
|
|
143
|
+
isActive ? "bg-surface-hover text-fg font-semibold" : "text-fg-muted hover:bg-surface-hover hover:text-fg"
|
|
144
|
+
) : variant === "pills" || variant === "pill" ? cn(
|
|
145
|
+
"rounded-full",
|
|
146
|
+
size === "sm" ? "px-3 py-1 text-xs" : "px-4 py-1.5 text-sm",
|
|
147
|
+
isActive ? "bg-surface text-fg font-semibold shadow-card border border-hairline/40" : "text-fg-muted hover:text-fg"
|
|
148
|
+
) : variant === "segmented" ? cn(
|
|
149
|
+
"rounded-panel-p1",
|
|
150
|
+
size === "sm" ? "px-2.5 py-1 text-xs" : "px-3 py-1.5 text-sm",
|
|
151
|
+
isActive ? "bg-brand-solid text-brand-fg" : "text-fg-muted hover:bg-surface-hover hover:text-fg"
|
|
152
|
+
) : cn(
|
|
153
|
+
orientation === "vertical" ? cn("-ml-px border-l-2", size === "sm" ? "px-2.5 py-1.5 text-xs" : "px-3 py-2 text-sm") : cn("-mb-px border-b-2", size === "sm" ? "px-2.5 py-1.5 text-xs" : "px-3 py-2.5 text-sm"),
|
|
154
|
+
isActive ? "border-brand-text text-fg font-medium" : "border-transparent text-fg-muted hover:text-fg"
|
|
155
|
+
)
|
|
156
|
+
),
|
|
157
|
+
children: [
|
|
158
|
+
item.icon && /* @__PURE__ */ jsx("span", { className: "[&_svg]:h-4 [&_svg]:w-4", children: item.icon }),
|
|
159
|
+
item.label
|
|
160
|
+
]
|
|
161
|
+
},
|
|
162
|
+
`${item.href ?? item.value ?? i}`
|
|
163
|
+
);
|
|
164
|
+
}),
|
|
165
|
+
children
|
|
166
|
+
] })
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
if (!resolvedItems || resolvedItems.length === 0) {
|
|
170
|
+
return /* @__PURE__ */ jsx(
|
|
171
|
+
TabsPrimitive.Root,
|
|
172
|
+
{
|
|
173
|
+
value,
|
|
174
|
+
defaultValue,
|
|
175
|
+
onValueChange,
|
|
176
|
+
orientation,
|
|
177
|
+
className: cn(orientation === "vertical" ? "flex gap-4" : "flex flex-col gap-1", className),
|
|
178
|
+
children
|
|
179
|
+
}
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
const initialDefault = defaultValue ?? (resolvedItems[0]?.value ?? "0");
|
|
183
|
+
const hasPanels = resolvedItems.some((t) => t.content != null);
|
|
184
|
+
return /* @__PURE__ */ jsxs(
|
|
185
|
+
TabsPrimitive.Root,
|
|
186
|
+
{
|
|
187
|
+
value,
|
|
188
|
+
defaultValue: initialDefault,
|
|
189
|
+
onValueChange,
|
|
190
|
+
orientation,
|
|
191
|
+
className: cn(orientation === "vertical" ? "flex gap-4" : "flex flex-col gap-1", className),
|
|
192
|
+
children: [
|
|
193
|
+
/* @__PURE__ */ jsx(IndicatorList, { variant, orientation, size, "aria-label": ariaLabel, children: resolvedItems.map((t, idx) => {
|
|
194
|
+
const itemVal = t.value ?? String(idx);
|
|
195
|
+
return /* @__PURE__ */ jsxs(
|
|
196
|
+
TabsPrimitive.Trigger,
|
|
197
|
+
{
|
|
198
|
+
value: itemVal,
|
|
199
|
+
disabled: t.disabled,
|
|
200
|
+
...hasPanels ? {} : { "aria-controls": void 0 },
|
|
201
|
+
className: cn("inline-flex items-center justify-center gap-1.5", triggerClass(variant, orientation, size, hitArea)),
|
|
202
|
+
children: [
|
|
203
|
+
t.icon && /* @__PURE__ */ jsx("span", { className: "[&_svg]:h-4 [&_svg]:w-4", children: t.icon }),
|
|
204
|
+
t.label
|
|
205
|
+
]
|
|
206
|
+
},
|
|
207
|
+
itemVal
|
|
208
|
+
);
|
|
209
|
+
}) }),
|
|
210
|
+
hasPanels && /* @__PURE__ */ jsx("div", { className: orientation === "vertical" ? "flex-1" : "", children: resolvedItems.map((t, idx) => {
|
|
211
|
+
const itemVal = t.value ?? String(idx);
|
|
212
|
+
return /* @__PURE__ */ jsx(
|
|
213
|
+
TabsPrimitive.Content,
|
|
214
|
+
{
|
|
215
|
+
value: itemVal,
|
|
216
|
+
className: cn(orientation === "vertical" ? "" : "pt-4"),
|
|
217
|
+
children: t.content
|
|
218
|
+
},
|
|
219
|
+
itemVal
|
|
220
|
+
);
|
|
221
|
+
}) })
|
|
222
|
+
]
|
|
223
|
+
}
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
const TabsListContext = createContext(null);
|
|
227
|
+
function TabsList({
|
|
228
|
+
children,
|
|
229
|
+
className,
|
|
230
|
+
variant = "line",
|
|
231
|
+
orientation = "horizontal",
|
|
232
|
+
hitArea,
|
|
233
|
+
"aria-label": ariaLabel
|
|
234
|
+
}) {
|
|
235
|
+
return /* @__PURE__ */ jsx(TabsListContext.Provider, { value: { variant, orientation, hitArea }, children: /* @__PURE__ */ jsx(IndicatorList, { variant, orientation, className, "aria-label": ariaLabel, children }) });
|
|
236
|
+
}
|
|
237
|
+
function TabsTrigger({
|
|
238
|
+
value,
|
|
239
|
+
children,
|
|
240
|
+
className,
|
|
241
|
+
variant: variantProp,
|
|
242
|
+
orientation: orientationProp,
|
|
243
|
+
hitArea: hitAreaProp,
|
|
244
|
+
disabled,
|
|
245
|
+
...props
|
|
246
|
+
}) {
|
|
247
|
+
const list = useContext(TabsListContext);
|
|
248
|
+
const variant = variantProp ?? list?.variant ?? "line";
|
|
249
|
+
const orientation = orientationProp ?? list?.orientation ?? "horizontal";
|
|
250
|
+
const hitArea = hitAreaProp ?? list?.hitArea;
|
|
251
|
+
return /* @__PURE__ */ jsx(
|
|
252
|
+
TabsPrimitive.Trigger,
|
|
253
|
+
{
|
|
254
|
+
...props,
|
|
255
|
+
value,
|
|
256
|
+
disabled,
|
|
257
|
+
className: cn(triggerClass(variant, orientation, "md", hitArea), className),
|
|
258
|
+
children
|
|
259
|
+
}
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
function TabsContent({
|
|
263
|
+
value,
|
|
264
|
+
children,
|
|
265
|
+
className,
|
|
266
|
+
...props
|
|
267
|
+
}) {
|
|
268
|
+
return /* @__PURE__ */ jsx(TabsPrimitive.Content, { ...props, value, className: cn("pt-4", className), children });
|
|
269
|
+
}
|
|
270
|
+
export {
|
|
271
|
+
Tabs,
|
|
272
|
+
TabsContent,
|
|
273
|
+
TabsList,
|
|
274
|
+
TabsTrigger
|
|
275
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const docs = {
|
|
2
|
+
name: "Text",
|
|
3
|
+
group: "typography",
|
|
4
|
+
description: "Body copy, labels and captions with semantic colour, size and weight.",
|
|
5
|
+
features: [
|
|
6
|
+
"Sizes: xs, sm, md, lg, overline (uppercase, tracked); inherit by default",
|
|
7
|
+
"Colours: default, muted, subtle, danger, link, brand \u2014 all semantic tokens",
|
|
8
|
+
"weight, tracking and truncate (three-line clamp)",
|
|
9
|
+
"as renders any tag: p (default), span, div, label"
|
|
10
|
+
],
|
|
11
|
+
accessibility: [
|
|
12
|
+
"Colour tokens meet WCAG 2.2 AA contrast (4.5:1) on surface tokens; subtle is for de-emphasised supporting text only",
|
|
13
|
+
'Use as="label" with htmlFor when the text labels a control'
|
|
14
|
+
],
|
|
15
|
+
usage: {
|
|
16
|
+
bestPractices: [
|
|
17
|
+
{ guidance: true, description: 'Use color="muted" for supporting copy under a title, and color="subtle" only for tertiary hints.' },
|
|
18
|
+
{ guidance: true, description: 'Use size="overline" sparingly, for a label that adds information (a category or a status) above a group. Most headings need none.' },
|
|
19
|
+
{ guidance: false, description: "Do not use literal Tailwind size or colour classes (text-sm, text-gray-500) on text; use the props." }
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
examples: [
|
|
23
|
+
{
|
|
24
|
+
title: "Body and supporting text",
|
|
25
|
+
code: `<div className="max-w-md space-y-2">
|
|
26
|
+
<Text size="overline" color="muted">Billing</Text>
|
|
27
|
+
<Text>Your plan renews on 1 November.</Text>
|
|
28
|
+
<Text size="sm" color="muted">You can change or cancel it at any time.</Text>
|
|
29
|
+
</div>`
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
docs
|
|
35
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { cn } from "../../lib/cn.js";
|
|
4
|
+
const textVariants = cva("", {
|
|
5
|
+
variants: {
|
|
6
|
+
size: {
|
|
7
|
+
inherit: "",
|
|
8
|
+
xs: "text-xs",
|
|
9
|
+
sm: "text-sm",
|
|
10
|
+
md: "text-base",
|
|
11
|
+
lg: "text-lg",
|
|
12
|
+
overline: "text-[10px] uppercase tracking-[0.15em]",
|
|
13
|
+
"1": "text-xs",
|
|
14
|
+
"2": "text-sm",
|
|
15
|
+
"3": "text-base",
|
|
16
|
+
"4": "text-lg"
|
|
17
|
+
},
|
|
18
|
+
weight: {
|
|
19
|
+
inherit: "",
|
|
20
|
+
normal: "font-normal",
|
|
21
|
+
medium: "font-medium",
|
|
22
|
+
semibold: "font-semibold",
|
|
23
|
+
bold: "font-bold"
|
|
24
|
+
},
|
|
25
|
+
tracking: {
|
|
26
|
+
inherit: "",
|
|
27
|
+
tighter: "tracking-tighter",
|
|
28
|
+
tight: "tracking-tight",
|
|
29
|
+
normal: "tracking-normal",
|
|
30
|
+
wide: "tracking-wide",
|
|
31
|
+
wider: "tracking-wider",
|
|
32
|
+
widest: "tracking-widest"
|
|
33
|
+
},
|
|
34
|
+
color: {
|
|
35
|
+
inherit: "",
|
|
36
|
+
default: "text-fg",
|
|
37
|
+
fg: "text-fg",
|
|
38
|
+
muted: "text-fg-muted",
|
|
39
|
+
subtle: "text-fg-subtle",
|
|
40
|
+
danger: "text-danger",
|
|
41
|
+
link: "text-link",
|
|
42
|
+
brand: "text-brand-contrast"
|
|
43
|
+
},
|
|
44
|
+
truncate: {
|
|
45
|
+
true: "line-clamp-3 overflow-hidden text-ellipsis",
|
|
46
|
+
false: ""
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
defaultVariants: { size: "inherit", weight: "inherit", color: "inherit", tracking: "inherit", truncate: false }
|
|
50
|
+
});
|
|
51
|
+
function Text({
|
|
52
|
+
as: Tag = "p",
|
|
53
|
+
size,
|
|
54
|
+
weight,
|
|
55
|
+
color,
|
|
56
|
+
tracking,
|
|
57
|
+
truncate,
|
|
58
|
+
className,
|
|
59
|
+
children,
|
|
60
|
+
...props
|
|
61
|
+
}) {
|
|
62
|
+
return /* @__PURE__ */ jsx(Tag, { className: cn(textVariants({ size, weight, color, tracking, truncate }), className), ...props, children });
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
Text,
|
|
66
|
+
textVariants
|
|
67
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const docs = {
|
|
2
|
+
name: "TextArea",
|
|
3
|
+
description: "Multi-line text input control with control radius (--radius-lg) and custom error state styling.",
|
|
4
|
+
features: [
|
|
5
|
+
"Default rows count: 4",
|
|
6
|
+
"Invalid error state styling (invalid=true)",
|
|
7
|
+
"Uses control radius --radius-lg for input consistency"
|
|
8
|
+
],
|
|
9
|
+
accessibility: [
|
|
10
|
+
"Native <textarea> element with standard focus ring and aria-invalid attributes",
|
|
11
|
+
"Supports full keyboard navigation and multi-line text editing"
|
|
12
|
+
],
|
|
13
|
+
keyboard: "Standard multi-line typing and Enter linebreaks",
|
|
14
|
+
usage: {
|
|
15
|
+
bestPractices: [
|
|
16
|
+
{
|
|
17
|
+
guidance: true,
|
|
18
|
+
description: "Use TextArea for multi-line inputs such as feedback forms, bio descriptions, and comment fields."
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
guidance: false,
|
|
22
|
+
description: "Do not use TextArea for single-line inputs \u2014 reach for TextField instead."
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
examples: [
|
|
27
|
+
{
|
|
28
|
+
title: "Feedback TextArea",
|
|
29
|
+
code: '<TextArea rows={4} placeholder="Describe your experience..." />'
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
docs
|
|
35
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { cn } from "../../lib/cn.js";
|
|
5
|
+
const textAreaVariants = cva(
|
|
6
|
+
"w-full rounded-[var(--radius-lg)] border px-3 py-2 text-base md:text-sm text-fg transition placeholder:text-fg-subtle disabled:cursor-not-allowed disabled:opacity-50",
|
|
7
|
+
{
|
|
8
|
+
variants: {
|
|
9
|
+
/**
|
|
10
|
+
* outline (default): a 3:1 control border (WCAG 1.4.11), for forms on any background.
|
|
11
|
+
* soft: filled, no border, for dense tool panels where a visible label and the value or
|
|
12
|
+
* placeholder identify the field. Both show the 2px focus ring.
|
|
13
|
+
*/
|
|
14
|
+
variant: {
|
|
15
|
+
outline: "bg-surface",
|
|
16
|
+
soft: "bg-surface-hover hover:bg-hairline/60"
|
|
17
|
+
},
|
|
18
|
+
invalid: {
|
|
19
|
+
true: "border-danger focus-visible:outline-danger",
|
|
20
|
+
false: ""
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
compoundVariants: [
|
|
24
|
+
{ variant: "outline", invalid: false, class: "border-border-control" },
|
|
25
|
+
{ variant: "soft", invalid: false, class: "border-transparent" }
|
|
26
|
+
],
|
|
27
|
+
defaultVariants: { variant: "outline", invalid: false }
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
const TextArea = forwardRef(function TextArea2({ className, invalid, variant, rows = 4, ...props }, ref) {
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
32
|
+
"textarea",
|
|
33
|
+
{
|
|
34
|
+
ref,
|
|
35
|
+
rows,
|
|
36
|
+
className: cn(textAreaVariants({ variant, invalid }), className),
|
|
37
|
+
"aria-invalid": invalid || void 0,
|
|
38
|
+
...props
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
});
|
|
42
|
+
export {
|
|
43
|
+
TextArea,
|
|
44
|
+
textAreaVariants
|
|
45
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const docs = {
|
|
2
|
+
name: "TextField",
|
|
3
|
+
description: "Single-line text input control with control radius (--radius-lg), leading/trailing icon slots, and optional label/hint wrapper.",
|
|
4
|
+
features: [
|
|
5
|
+
"Sizes: sm (32px) and md (40px)",
|
|
6
|
+
"Invalid error state styling (invalid=true)",
|
|
7
|
+
"Built-in leadingIcon and trailingIcon slots",
|
|
8
|
+
"Built-in label and helper hint text layout wrapper"
|
|
9
|
+
],
|
|
10
|
+
accessibility: [
|
|
11
|
+
"Uses native <input> element supporting standard browser form handling and focus states",
|
|
12
|
+
"Associates label with input for screen reader announcements",
|
|
13
|
+
"Applies aria-invalid automatically when invalid=true or errorMessage is set",
|
|
14
|
+
"errorMessage shows with an icon and is announced once (polite) when it first appears; announceError={false} turns that off (FormErrorSummary silences it after a failed submit)"
|
|
15
|
+
],
|
|
16
|
+
keyboard: "Standard input typing, Tab to move focus, Escape/Enter in forms",
|
|
17
|
+
usage: {
|
|
18
|
+
bestPractices: [
|
|
19
|
+
{
|
|
20
|
+
guidance: true,
|
|
21
|
+
description: "Use TextField for single-line text inputs (names, emails, search queries)."
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
guidance: false,
|
|
25
|
+
description: "Do not use TextField for multi-line text input \u2014 reach for TextArea instead."
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
structure: [
|
|
30
|
+
'type="otp" makes it a code-entry input; length, separator, separatorIndex, onComplete and slotClassName apply only then.'
|
|
31
|
+
],
|
|
32
|
+
examples: [
|
|
33
|
+
{
|
|
34
|
+
title: "Standard Text Input",
|
|
35
|
+
code: '<TextField label="Email Address" placeholder="alex@company.com" hint="We will never share your email." />'
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
docs
|
|
41
|
+
};
|