@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,283 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
let booted = false;
|
|
3
|
+
const motionConfig = { gsap: true };
|
|
4
|
+
let gsapLoader = null;
|
|
5
|
+
function loadGsap() {
|
|
6
|
+
if (gsapLoader) return gsapLoader;
|
|
7
|
+
gsapLoader = (async () => {
|
|
8
|
+
try {
|
|
9
|
+
const mods = motionConfig.loadGsap ? await motionConfig.loadGsap() : await import("./motion-gsap.js").then((m) => m.loadDefaultGsap());
|
|
10
|
+
const { gsap, ScrollTrigger, SplitText } = mods;
|
|
11
|
+
if (ScrollTrigger) gsap.registerPlugin(ScrollTrigger);
|
|
12
|
+
if (SplitText) gsap.registerPlugin(SplitText);
|
|
13
|
+
return { gsap, SplitText: SplitText ?? null };
|
|
14
|
+
} catch {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
})();
|
|
18
|
+
return gsapLoader;
|
|
19
|
+
}
|
|
20
|
+
const hasDom = () => typeof window !== "undefined" && typeof document !== "undefined";
|
|
21
|
+
const supportsViewTimeline = () => {
|
|
22
|
+
try {
|
|
23
|
+
return typeof CSS !== "undefined" && CSS.supports("animation-timeline", "view()");
|
|
24
|
+
} catch {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const prefersReduced = () => {
|
|
29
|
+
try {
|
|
30
|
+
return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
31
|
+
} catch {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const isPaused = (el) => !!el.closest("[data-motion-paused]");
|
|
36
|
+
const cssEscape = (s) => {
|
|
37
|
+
try {
|
|
38
|
+
return typeof CSS !== "undefined" && CSS.escape ? CSS.escape(s) : s;
|
|
39
|
+
} catch {
|
|
40
|
+
return s;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const DIST_PX = { xs: 4, sm: 8, md: 16, lg: 24 };
|
|
44
|
+
const DUR_MS = { instant: 100, fast: 160, base: 240, slow: 400, enter: 560 };
|
|
45
|
+
const GSAP_EASE = { standard: "power2.inOut", out: "power3.out", in: "power2.in", overshoot: "back.out(1.6)" };
|
|
46
|
+
const distPx = (t) => DIST_PX[t] ?? 16;
|
|
47
|
+
const durSec = (t) => (DUR_MS[t] ?? 560) / 1e3;
|
|
48
|
+
const easeOf = (t) => GSAP_EASE[t] ?? "power3.out";
|
|
49
|
+
function effectFrom(effect, dist) {
|
|
50
|
+
switch (effect) {
|
|
51
|
+
case "fade":
|
|
52
|
+
return { autoAlpha: 0 };
|
|
53
|
+
case "fade-down":
|
|
54
|
+
return { autoAlpha: 0, y: -dist };
|
|
55
|
+
case "scale-in":
|
|
56
|
+
return { autoAlpha: 0, scale: 0.94 };
|
|
57
|
+
case "blur-in":
|
|
58
|
+
return { autoAlpha: 0, filter: "blur(8px)" };
|
|
59
|
+
case "mask-up":
|
|
60
|
+
return { autoAlpha: 0, yPercent: 30 };
|
|
61
|
+
case "fade-up":
|
|
62
|
+
default:
|
|
63
|
+
return { autoAlpha: 0, y: dist };
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function effectTo(effect) {
|
|
67
|
+
switch (effect) {
|
|
68
|
+
case "scale-in":
|
|
69
|
+
return { autoAlpha: 1, scale: 1 };
|
|
70
|
+
case "blur-in":
|
|
71
|
+
return { autoAlpha: 1, filter: "blur(0px)" };
|
|
72
|
+
case "mask-up":
|
|
73
|
+
return { autoAlpha: 1, yPercent: 0 };
|
|
74
|
+
case "fade-up":
|
|
75
|
+
case "fade-down":
|
|
76
|
+
return { autoAlpha: 1, y: 0 };
|
|
77
|
+
case "fade":
|
|
78
|
+
default:
|
|
79
|
+
return { autoAlpha: 1 };
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
let revealObserver = null;
|
|
83
|
+
function ensureObserver() {
|
|
84
|
+
if (revealObserver) return revealObserver;
|
|
85
|
+
revealObserver = new IntersectionObserver(
|
|
86
|
+
(entries) => {
|
|
87
|
+
for (const e of entries) {
|
|
88
|
+
if (!e.isIntersecting) continue;
|
|
89
|
+
const el = e.target;
|
|
90
|
+
el.setAttribute("data-motion-in", "");
|
|
91
|
+
if (el.getAttribute("data-motion-entry-once") !== "0") revealObserver.unobserve(el);
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
{ rootMargin: "0px 0px -10% 0px", threshold: 0.01 }
|
|
95
|
+
);
|
|
96
|
+
return revealObserver;
|
|
97
|
+
}
|
|
98
|
+
function armEntry(el) {
|
|
99
|
+
if (el.hasAttribute("data-motion-armed") || el.hasAttribute("data-motion-in")) return;
|
|
100
|
+
if (el.hasAttribute("data-motion-tl-member")) return;
|
|
101
|
+
if (isPaused(el)) return;
|
|
102
|
+
const delayAttr = el.getAttribute("data-motion-entry-delay");
|
|
103
|
+
let delayMs = delayAttr ? parseInt(delayAttr, 10) || 0 : 0;
|
|
104
|
+
const staggerParent = el.closest("[data-motion-entry-stagger='1']");
|
|
105
|
+
if (staggerParent && staggerParent !== el) {
|
|
106
|
+
const sibs = Array.from(staggerParent.querySelectorAll("[data-motion-entry]"));
|
|
107
|
+
const idx = sibs.indexOf(el);
|
|
108
|
+
if (idx > 0) delayMs += idx * 60;
|
|
109
|
+
}
|
|
110
|
+
if (delayMs) el.style.setProperty("--motion-delay", `${delayMs}ms`);
|
|
111
|
+
el.setAttribute("data-motion-armed", "");
|
|
112
|
+
ensureObserver().observe(el);
|
|
113
|
+
}
|
|
114
|
+
function initScrollScenes(root) {
|
|
115
|
+
if (!motionConfig.gsap || prefersReduced()) return;
|
|
116
|
+
const scenes = [...root.querySelectorAll?.("[data-motion-scroll='scrub'],[data-motion-scroll='pin']") ?? []].filter((el) => !el.hasAttribute("data-motion-wired") && !el.hasAttribute("data-motion-tl-member") && !isPaused(el));
|
|
117
|
+
if (!scenes.length) return;
|
|
118
|
+
void loadGsap().then((lib) => {
|
|
119
|
+
if (!lib) return;
|
|
120
|
+
const { gsap } = lib;
|
|
121
|
+
for (const el of scenes) {
|
|
122
|
+
if (el.hasAttribute("data-motion-wired")) continue;
|
|
123
|
+
el.setAttribute("data-motion-wired", "");
|
|
124
|
+
const effect = el.getAttribute("data-motion-scroll");
|
|
125
|
+
const start = el.getAttribute("data-motion-scroll-start") || void 0;
|
|
126
|
+
const end = el.getAttribute("data-motion-scroll-end") || void 0;
|
|
127
|
+
if (effect === "pin") {
|
|
128
|
+
gsap.to(el, { scrollTrigger: { trigger: el, start: start || "top top", end: end || "+=100%", pin: true, pinSpacing: true } });
|
|
129
|
+
} else if (effect === "scrub") {
|
|
130
|
+
gsap.fromTo(
|
|
131
|
+
el,
|
|
132
|
+
effectFrom("fade-up", distPx("lg")),
|
|
133
|
+
{ ...effectTo("fade-up"), ease: "none", scrollTrigger: { trigger: el, start: start || "top bottom", end: end || "top center", scrub: true } }
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
function revealMembers(rootEl) {
|
|
140
|
+
rootEl.querySelectorAll("[data-motion-tl-member]").forEach((el) => {
|
|
141
|
+
el.style.opacity = "1";
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
function initTimelines(root) {
|
|
145
|
+
if (!motionConfig.gsap) return;
|
|
146
|
+
const roots = [...root.querySelectorAll?.("[data-motion-tl]") ?? []].filter((el) => !el.hasAttribute("data-motion-tl-wired") && !isPaused(el));
|
|
147
|
+
if (!roots.length) return;
|
|
148
|
+
if (prefersReduced()) {
|
|
149
|
+
for (const r of roots) {
|
|
150
|
+
revealMembers(r);
|
|
151
|
+
r.setAttribute("data-motion-tl-wired", "");
|
|
152
|
+
}
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
void loadGsap().then((lib) => {
|
|
156
|
+
if (!lib) {
|
|
157
|
+
for (const r of roots) {
|
|
158
|
+
revealMembers(r);
|
|
159
|
+
r.setAttribute("data-motion-tl-wired", "");
|
|
160
|
+
}
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
const { gsap } = lib;
|
|
164
|
+
for (const rootEl of roots) {
|
|
165
|
+
if (rootEl.hasAttribute("data-motion-tl-wired")) continue;
|
|
166
|
+
rootEl.setAttribute("data-motion-tl-wired", "");
|
|
167
|
+
const id = rootEl.getAttribute("data-motion-tl");
|
|
168
|
+
if (!id) continue;
|
|
169
|
+
const members = [...rootEl.querySelectorAll(`[data-motion-tl-member="${cssEscape(id)}"]`)];
|
|
170
|
+
if (!members.length) continue;
|
|
171
|
+
const trigger = rootEl.getAttribute("data-motion-tl-trigger") || "load";
|
|
172
|
+
const mode = rootEl.getAttribute("data-motion-tl-mode") || "reveal";
|
|
173
|
+
const start = rootEl.getAttribute("data-motion-tl-start") || void 0;
|
|
174
|
+
const end = rootEl.getAttribute("data-motion-tl-end") || void 0;
|
|
175
|
+
const pin = rootEl.getAttribute("data-motion-tl-pin") === "1";
|
|
176
|
+
const isScrub = trigger === "scroll" && mode === "scrub";
|
|
177
|
+
const vars = {};
|
|
178
|
+
if (trigger === "scroll") {
|
|
179
|
+
vars.scrollTrigger = isScrub ? { trigger: rootEl, start: start || "top top", end: end || "+=100%", scrub: true, pin } : { trigger: rootEl, start: start || "top 80%", toggleActions: "play none none none", once: true };
|
|
180
|
+
}
|
|
181
|
+
if (trigger === "click") vars.paused = true;
|
|
182
|
+
const tl = gsap.timeline(vars);
|
|
183
|
+
for (const m of members) {
|
|
184
|
+
const at = parseFloat(m.getAttribute("data-motion-tl-at") || "0") || 0;
|
|
185
|
+
const effect = m.getAttribute("data-motion-tl-effect") || "fade";
|
|
186
|
+
const from = effectFrom(effect, distPx(m.getAttribute("data-motion-tl-dist") || "md"));
|
|
187
|
+
const to = { ...effectTo(effect) };
|
|
188
|
+
if (isScrub) {
|
|
189
|
+
to.ease = "none";
|
|
190
|
+
to.duration = 0.5;
|
|
191
|
+
} else {
|
|
192
|
+
to.ease = easeOf(m.getAttribute("data-motion-tl-ease") || "out");
|
|
193
|
+
to.duration = durSec(m.getAttribute("data-motion-tl-dur") || "enter");
|
|
194
|
+
}
|
|
195
|
+
const pos = isScrub ? at / 100 : at / 1e3;
|
|
196
|
+
const staggerMs = parseFloat(m.getAttribute("data-motion-tl-stagger") || "0") || 0;
|
|
197
|
+
const split = m.getAttribute("data-motion-tl-split");
|
|
198
|
+
if (split && lib.SplitText) {
|
|
199
|
+
m.style.opacity = "1";
|
|
200
|
+
const st = new lib.SplitText(m, { type: split });
|
|
201
|
+
const pieces = split === "words" ? st.words : split === "chars" ? st.chars : st.lines;
|
|
202
|
+
const list = m.getAttribute("data-motion-tl-stagger-order") === "reverse" ? [...pieces].reverse() : pieces;
|
|
203
|
+
const step = isScrub ? staggerMs / 100 : staggerMs / 1e3;
|
|
204
|
+
list.forEach((u, i) => tl.fromTo(u, from, to, pos + i * step));
|
|
205
|
+
} else if (staggerMs > 0 && m.children.length > 1) {
|
|
206
|
+
m.style.opacity = "1";
|
|
207
|
+
const order = m.getAttribute("data-motion-tl-stagger-order") || "forward";
|
|
208
|
+
let items = Array.from(m.children);
|
|
209
|
+
if (order === "reverse") items.reverse();
|
|
210
|
+
else if (order === "cols") items = colMajorOrder(m, items);
|
|
211
|
+
const step = isScrub ? staggerMs / 100 : staggerMs / 1e3;
|
|
212
|
+
items.forEach((it, i) => tl.fromTo(it, from, to, pos + i * step));
|
|
213
|
+
} else {
|
|
214
|
+
tl.fromTo(m, from, to, pos);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
if (trigger === "click") {
|
|
218
|
+
const btn = rootEl.querySelector("[data-motion-tl-play]") || rootEl;
|
|
219
|
+
const play = () => tl.restart();
|
|
220
|
+
btn.addEventListener("click", play);
|
|
221
|
+
btn.addEventListener("keydown", (e) => {
|
|
222
|
+
const k = e.key;
|
|
223
|
+
if (k === "Enter" || k === " ") {
|
|
224
|
+
e.preventDefault();
|
|
225
|
+
play();
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
function colMajorOrder(parent, items) {
|
|
233
|
+
let cols = 1;
|
|
234
|
+
try {
|
|
235
|
+
cols = (getComputedStyle(parent).gridTemplateColumns || "").split(/\s+/).filter(Boolean).length || 1;
|
|
236
|
+
} catch {
|
|
237
|
+
cols = 1;
|
|
238
|
+
}
|
|
239
|
+
if (cols <= 1) return items;
|
|
240
|
+
const rows = Math.ceil(items.length / cols);
|
|
241
|
+
const out = [];
|
|
242
|
+
for (let c = 0; c < cols; c++) for (let r = 0; r < rows; r++) {
|
|
243
|
+
const i = r * cols + c;
|
|
244
|
+
if (i < items.length) out.push(items[i]);
|
|
245
|
+
}
|
|
246
|
+
return out;
|
|
247
|
+
}
|
|
248
|
+
function scan(root) {
|
|
249
|
+
if (!supportsViewTimeline() && !prefersReduced()) {
|
|
250
|
+
const entries = root.querySelectorAll?.("[data-motion-entry]");
|
|
251
|
+
entries?.forEach((el) => armEntry(el));
|
|
252
|
+
}
|
|
253
|
+
initScrollScenes(root);
|
|
254
|
+
initTimelines(root);
|
|
255
|
+
}
|
|
256
|
+
function initMotionRuntime() {
|
|
257
|
+
if (!hasDom()) return;
|
|
258
|
+
const run = () => scan(document);
|
|
259
|
+
if (!booted) {
|
|
260
|
+
booted = true;
|
|
261
|
+
if (!prefersReduced()) {
|
|
262
|
+
try {
|
|
263
|
+
document.documentElement.classList.add("shavin-motion-js");
|
|
264
|
+
} catch {
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", run, { once: true });
|
|
268
|
+
else run();
|
|
269
|
+
if (!supportsViewTimeline()) {
|
|
270
|
+
const mo = new MutationObserver(() => {
|
|
271
|
+
if (hasDom()) scan(document);
|
|
272
|
+
});
|
|
273
|
+
mo.observe(document.documentElement, { childList: true, subtree: true });
|
|
274
|
+
}
|
|
275
|
+
} else {
|
|
276
|
+
run();
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
if (hasDom()) initMotionRuntime();
|
|
280
|
+
export {
|
|
281
|
+
initMotionRuntime,
|
|
282
|
+
motionConfig
|
|
283
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { hexToOklch, rgbTripletToOklch, oklchToRgbTriplet, oklchToCss } from "./color-space.js";
|
|
2
|
+
const NEUTRALS_AMOUNTS = ["subtle", "medium"];
|
|
3
|
+
const DEFAULT_NEUTRALS_MODE = "neutral";
|
|
4
|
+
const DEFAULT_NEUTRALS_AMOUNT = "subtle";
|
|
5
|
+
function isNeutralsAmount(v) {
|
|
6
|
+
return v === "subtle" || v === "medium";
|
|
7
|
+
}
|
|
8
|
+
const BASE_NEUTRALS = {
|
|
9
|
+
0: "255 255 255",
|
|
10
|
+
50: "250 250 250",
|
|
11
|
+
100: "244 244 245",
|
|
12
|
+
200: "228 228 231",
|
|
13
|
+
300: "212 212 216",
|
|
14
|
+
400: "161 161 170",
|
|
15
|
+
450: "137 137 146",
|
|
16
|
+
500: "110 110 119",
|
|
17
|
+
600: "82 82 91",
|
|
18
|
+
700: "63 63 70",
|
|
19
|
+
800: "39 39 42",
|
|
20
|
+
850: "30 30 33",
|
|
21
|
+
900: "24 24 27",
|
|
22
|
+
950: "10 10 12",
|
|
23
|
+
1e3: "0 0 0"
|
|
24
|
+
};
|
|
25
|
+
const NEUTRAL_STEPS = Object.keys(BASE_NEUTRALS).map(Number);
|
|
26
|
+
const PEAK_CHROMA = { subtle: 7e-3, medium: 0.015 };
|
|
27
|
+
const STEP_WEIGHT = {
|
|
28
|
+
0: 0,
|
|
29
|
+
50: 0.55,
|
|
30
|
+
100: 0.85,
|
|
31
|
+
200: 1,
|
|
32
|
+
300: 1,
|
|
33
|
+
400: 0.9,
|
|
34
|
+
450: 0.85,
|
|
35
|
+
500: 0.85,
|
|
36
|
+
600: 0.85,
|
|
37
|
+
700: 0.8,
|
|
38
|
+
800: 0.8,
|
|
39
|
+
850: 0.8,
|
|
40
|
+
900: 0.8,
|
|
41
|
+
950: 0.75,
|
|
42
|
+
1e3: 0
|
|
43
|
+
};
|
|
44
|
+
const GREY_BELOW = 0.02;
|
|
45
|
+
const FULL_AT = 0.07;
|
|
46
|
+
function relLum(triplet) {
|
|
47
|
+
const lin = (c) => c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
|
|
48
|
+
const [r, g, b] = triplet.split(" ").map((v) => lin(Number(v) / 255));
|
|
49
|
+
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
50
|
+
}
|
|
51
|
+
function neutralsBrandStrength(hex) {
|
|
52
|
+
const c = hexToOklch(hex).C;
|
|
53
|
+
const t = Math.min(1, Math.max(0, (c - GREY_BELOW) / (FULL_AT - GREY_BELOW)));
|
|
54
|
+
return t * t * (3 - 2 * t);
|
|
55
|
+
}
|
|
56
|
+
function tintedNeutralTriplets(hex, amount = DEFAULT_NEUTRALS_AMOUNT) {
|
|
57
|
+
const strength = neutralsBrandStrength(hex);
|
|
58
|
+
if (strength <= 0) return void 0;
|
|
59
|
+
const hue = hexToOklch(hex).H;
|
|
60
|
+
const out = {};
|
|
61
|
+
for (const step of NEUTRAL_STEPS) {
|
|
62
|
+
const base = BASE_NEUTRALS[step];
|
|
63
|
+
const chroma = PEAK_CHROMA[amount] * STEP_WEIGHT[step] * strength;
|
|
64
|
+
if (chroma <= 0) {
|
|
65
|
+
out[step] = base;
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
const target = relLum(base);
|
|
69
|
+
let lo = 0;
|
|
70
|
+
let hi = 1;
|
|
71
|
+
let best = base;
|
|
72
|
+
let bestErr = Infinity;
|
|
73
|
+
for (let i = 0; i < 28; i++) {
|
|
74
|
+
const mid = (lo + hi) / 2;
|
|
75
|
+
const triplet = oklchToRgbTriplet({ L: mid, C: chroma, H: hue });
|
|
76
|
+
const y = relLum(triplet);
|
|
77
|
+
const err = Math.abs(y - target);
|
|
78
|
+
if (err < bestErr) {
|
|
79
|
+
bestErr = err;
|
|
80
|
+
best = triplet;
|
|
81
|
+
}
|
|
82
|
+
if (y < target) lo = mid;
|
|
83
|
+
else hi = mid;
|
|
84
|
+
}
|
|
85
|
+
out[step] = best;
|
|
86
|
+
}
|
|
87
|
+
return out;
|
|
88
|
+
}
|
|
89
|
+
function tintedNeutralVars(hex, amount, colorSpace = "rgb") {
|
|
90
|
+
const scale = tintedNeutralTriplets(hex, amount);
|
|
91
|
+
if (!scale) return {};
|
|
92
|
+
const vars = {};
|
|
93
|
+
for (const step of NEUTRAL_STEPS) {
|
|
94
|
+
vars[`--n-${step}`] = colorSpace === "oklch" ? oklchToCss(rgbTripletToOklch(scale[step])) : scale[step];
|
|
95
|
+
}
|
|
96
|
+
return vars;
|
|
97
|
+
}
|
|
98
|
+
export {
|
|
99
|
+
BASE_NEUTRALS,
|
|
100
|
+
DEFAULT_NEUTRALS_AMOUNT,
|
|
101
|
+
DEFAULT_NEUTRALS_MODE,
|
|
102
|
+
NEUTRALS_AMOUNTS,
|
|
103
|
+
NEUTRAL_STEPS,
|
|
104
|
+
isNeutralsAmount,
|
|
105
|
+
neutralsBrandStrength,
|
|
106
|
+
tintedNeutralTriplets,
|
|
107
|
+
tintedNeutralVars
|
|
108
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext, useContext } from "react";
|
|
3
|
+
const PortalContainerContext = createContext(null);
|
|
4
|
+
const PortalContainerProvider = PortalContainerContext.Provider;
|
|
5
|
+
function usePortalContainer() {
|
|
6
|
+
return useContext(PortalContainerContext) ?? void 0;
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
PortalContainerContext,
|
|
10
|
+
PortalContainerProvider,
|
|
11
|
+
usePortalContainer
|
|
12
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
|
+
const FADE_PX = 28;
|
|
4
|
+
function useScrollEdges() {
|
|
5
|
+
const ref = useRef(null);
|
|
6
|
+
const [edges, setEdges] = useState({ start: false, end: false });
|
|
7
|
+
const update = useCallback(() => {
|
|
8
|
+
const el = ref.current;
|
|
9
|
+
if (!el) return;
|
|
10
|
+
const max = el.scrollWidth - el.clientWidth;
|
|
11
|
+
const next = { start: max > 1 && el.scrollLeft > 1, end: max > 1 && el.scrollLeft < max - 1 };
|
|
12
|
+
setEdges((prev) => prev.start === next.start && prev.end === next.end ? prev : next);
|
|
13
|
+
}, []);
|
|
14
|
+
const setRef = useCallback(
|
|
15
|
+
(el) => {
|
|
16
|
+
ref.current = el;
|
|
17
|
+
if (el) update();
|
|
18
|
+
},
|
|
19
|
+
[update]
|
|
20
|
+
);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
const el = ref.current;
|
|
23
|
+
if (!el) return;
|
|
24
|
+
update();
|
|
25
|
+
el.addEventListener("scroll", update, { passive: true });
|
|
26
|
+
const ro = typeof ResizeObserver !== "undefined" ? new ResizeObserver(update) : null;
|
|
27
|
+
ro?.observe(el);
|
|
28
|
+
for (const child of Array.from(el.children)) ro?.observe(child);
|
|
29
|
+
return () => {
|
|
30
|
+
el.removeEventListener("scroll", update);
|
|
31
|
+
ro?.disconnect();
|
|
32
|
+
};
|
|
33
|
+
}, [update]);
|
|
34
|
+
const scrollable = edges.start || edges.end;
|
|
35
|
+
const mask = scrollable ? `linear-gradient(to right, transparent 0, black ${edges.start ? FADE_PX : 0}px, black calc(100% - ${edges.end ? FADE_PX : 0}px), transparent 100%)` : void 0;
|
|
36
|
+
const fadeStyle = mask ? { maskImage: mask, WebkitMaskImage: mask } : void 0;
|
|
37
|
+
return { ref: setRef, edges, scrollable, fadeStyle };
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
useScrollEdges
|
|
41
|
+
};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
const JS_TSX_RULES = [
|
|
3
|
+
{ className: "text-code-comment italic", re: /(\/\/[^\n]*|\/\*[\s\S]*?\*\/)/ },
|
|
4
|
+
{ className: "text-code-string", re: /(`(?:\\.|[^`])*`|"(?:\\.|[^"])*"|'(?:\\.|[^'])*')/ },
|
|
5
|
+
{ className: "text-code-keyword font-medium", re: /\b(import|from|export|default|const|let|var|return|function|new|async|await|type|interface|class|extends|implements|try|catch|finally|throw|if|else|switch|case|break|continue|for|while|do|in|of|typeof|instanceof|as|enum|namespace|declare|readonly|public|private|protected|static|override|satisfies)\b/ },
|
|
6
|
+
{ className: "text-code-type font-medium", re: /\b(string|number|boolean|any|void|unknown|never|object|symbol|bigint|Record|Array|Promise|Partial|Required|Readonly|Pick|Omit|Exclude|Extract|NonNullable|Parameters|ReturnType|InstanceType|ReactNode|JSX\.Element|HTMLAttributes|ComponentProps)\b/ },
|
|
7
|
+
{ className: "text-code-num", re: /\b(true|false|null|undefined|NaN|Infinity|\d+(?:\.\d+)?)\b/ },
|
|
8
|
+
{ className: "text-code-type font-semibold", re: /(<\/?[A-Z][\w.-]*(?:\.[A-Z][\w.-]*)?)/ },
|
|
9
|
+
{ className: "text-code-tag", re: /(<\/?[a-z][\w.-]*)/ },
|
|
10
|
+
{ className: "text-code-attr", re: /(\b[a-zA-Z_][\w-]*(?=\s*=))/ },
|
|
11
|
+
{ className: "text-code-fn", re: /(\b[a-zA-Z_$][\w$]*(?=\s*\())/ },
|
|
12
|
+
{ className: "text-code-punct", re: /(\/>|<\/?|>=|=>|===|!==|==|!=|<=|&&|\|\||\?\?|\?|:|\+\+|--|\+|-|\*|\/|%|\^|&|\||~|!|=|[-+*\/=<>!&|{}()\[\];,])/ }
|
|
13
|
+
];
|
|
14
|
+
const HTML_RULES = [
|
|
15
|
+
{ className: "text-code-comment italic", re: /(<!--[\s\S]*?-->)/ },
|
|
16
|
+
{ className: "text-code-string", re: /("(?:\\.|[^"])*"|'(?:\\.|[^'])*')/ },
|
|
17
|
+
{ className: "text-code-tag font-semibold", re: /(<\/?[a-zA-Z0-9:-]+)/ },
|
|
18
|
+
{ className: "text-code-attr", re: /(\b[a-zA-Z0-9_:-]+(?=\s*=))/ },
|
|
19
|
+
{ className: "text-code-keyword", re: /(&[a-zA-Z0-9#]+;)/ },
|
|
20
|
+
{ className: "text-code-punct", re: /(\/?>|<\/?|=)/ }
|
|
21
|
+
];
|
|
22
|
+
const CSS_RULES = [
|
|
23
|
+
{ className: "text-code-comment italic", re: /(\/\*[\s\S]*?\*\/|\/\/[^\n]*)/ },
|
|
24
|
+
{ className: "text-code-string", re: /("(?:\\.|[^"])*"|'(?:\\.|[^'])*')/ },
|
|
25
|
+
{ className: "text-code-keyword font-semibold", re: /(@[a-zA-Z_-]+|\.[a-zA-Z0-9_-]+|#[a-zA-Z0-9_-]+|::?[a-zA-Z0-9_-]+)/ },
|
|
26
|
+
{ className: "text-code-prop", re: /(\b[a-z-]+(?=\s*:))/ },
|
|
27
|
+
{ className: "text-code-fn", re: /\b(var|calc|rgb|rgba|hsl|hsla|linear-gradient|radial-gradient|url|min|max|clamp)(?=\()/ },
|
|
28
|
+
{ className: "text-code-num", re: /(-?\b\d+(?:\.\d+)?(?:px|rem|em|vh|vw|%|s|ms|deg|fr|ch|dvh)?\b|#[0-9a-fA-F]{3,8}\b)/ },
|
|
29
|
+
{ className: "text-code-punct", re: /([{}():;,\/!*+>~])/ }
|
|
30
|
+
];
|
|
31
|
+
const JSON_RULES = [
|
|
32
|
+
{ className: "text-code-prop font-medium", re: /("(?:\\.|[^"])*")(?=\s*:)/ },
|
|
33
|
+
{ className: "text-code-string", re: /("(?:\\.|[^"])*")/ },
|
|
34
|
+
{ className: "text-code-num", re: /(-?\b\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b)/ },
|
|
35
|
+
{ className: "text-code-keyword font-semibold", re: /\b(true|false|null)\b/ },
|
|
36
|
+
{ className: "text-code-punct", re: /([{}[\]:,])/ }
|
|
37
|
+
];
|
|
38
|
+
const BASH_RULES = [
|
|
39
|
+
{ className: "text-code-comment italic", re: /(#[^\n]*)/ },
|
|
40
|
+
{ className: "text-code-string", re: /("(?:\\.|[^"])*"|'(?:\\.|[^'])*'|`[^`]*`)/ },
|
|
41
|
+
{ className: "text-code-keyword font-semibold", re: /\b(npm|npx|pnpm|yarn|bun|git|cd|mkdir|rm|cp|mv|echo|cat|grep|node|curl|wget|chmod|export|if|then|fi|for|do|done|while|case|esac|source|sudo|code)\b/ },
|
|
42
|
+
{ className: "text-code-attr", re: /(-{1,2}[a-zA-Z0-9_-]+)/ },
|
|
43
|
+
{ className: "text-code-type font-medium", re: /(\$[a-zA-Z0-9_]+|\$\{[^}]+\})/ },
|
|
44
|
+
{ className: "text-code-num", re: /\b\d+\b/ },
|
|
45
|
+
{ className: "text-code-punct", re: /([|&;><=\\()\[\]{}])/ }
|
|
46
|
+
];
|
|
47
|
+
const PYTHON_RULES = [
|
|
48
|
+
{ className: "text-code-comment italic", re: /(#[^\n]*)/ },
|
|
49
|
+
{ className: "text-code-string", re: /("""[\s\S]*?"""|'''[\s\S]*?'''|"(?:\\.|[^"])*"|'(?:\\.|[^'])*')/ },
|
|
50
|
+
{ className: "text-code-keyword font-medium", re: /\b(def|class|return|import|from|as|if|elif|else|for|while|try|except|finally|with|lambda|yield|raise|pass|break|continue|global|nonlocal|async|await|and|or|not|in|is)\b/ },
|
|
51
|
+
{ className: "text-code-fn", re: /\b(print|len|range|str|int|float|list|dict|set|tuple|bool|open|type|isinstance|enumerate|zip|map|filter|super|getattr|setattr|hasattr)\b/ },
|
|
52
|
+
{ className: "text-code-num", re: /\b(True|False|None|\d+(?:\.\d+)?)\b/ },
|
|
53
|
+
{ className: "text-code-type font-semibold", re: /\b[A-Z][a-zA-Z0-9_]*\b/ },
|
|
54
|
+
{ className: "text-code-punct", re: /([+\-*/%=<>!&|^~:;,\.()\[\]{}@])/ }
|
|
55
|
+
];
|
|
56
|
+
const SQL_RULES = [
|
|
57
|
+
{ className: "text-code-comment italic", re: /(--[^\n]*|\/\*[\s\S]*?\*\/)/ },
|
|
58
|
+
{ className: "text-code-string", re: /('(?:\\.|[^'])*'|"(?:\\.|[^"])*")/ },
|
|
59
|
+
{ className: "text-code-keyword font-semibold", re: /\b(SELECT|FROM|WHERE|INSERT|INTO|UPDATE|DELETE|JOIN|LEFT|RIGHT|INNER|OUTER|FULL|CROSS|GROUP|BY|ORDER|HAVING|LIMIT|OFFSET|AS|ON|AND|OR|NOT|IN|IS|NULL|CREATE|TABLE|DROP|ALTER|PRIMARY|KEY|FOREIGN|REFERENCES|UNION|ALL|DISTINCT|VALUES|SET|INDEX|VIEW|DATABASE|SCHEMA|CASE|WHEN|THEN|ELSE|END|EXISTS|BETWEEN|LIKE|ASC|DESC)\b/i },
|
|
60
|
+
{ className: "text-code-fn", re: /\b(COUNT|SUM|AVG|MIN|MAX|COALESCE|CONCAT|NOW|DATE|LOWER|UPPER|TRIM|SUBSTRING|ROUND|CAST)\b(?=\()/i },
|
|
61
|
+
{ className: "text-code-num", re: /\b\d+(?:\.\d+)?\b/ },
|
|
62
|
+
{ className: "text-code-punct", re: /([,;.()=*<>+-])/ }
|
|
63
|
+
];
|
|
64
|
+
function getLanguageRules(languageOrFilename) {
|
|
65
|
+
if (!languageOrFilename) return JS_TSX_RULES;
|
|
66
|
+
const lang = languageOrFilename.toLowerCase().trim();
|
|
67
|
+
if (lang === "html" || lang === "xml" || lang === "svg" || lang.endsWith(".html") || lang.endsWith(".xml") || lang.endsWith(".svg")) {
|
|
68
|
+
return HTML_RULES;
|
|
69
|
+
}
|
|
70
|
+
if (lang === "css" || lang === "scss" || lang === "postcss" || lang.endsWith(".css") || lang.endsWith(".scss")) {
|
|
71
|
+
return CSS_RULES;
|
|
72
|
+
}
|
|
73
|
+
if (lang === "json" || lang.endsWith(".json")) {
|
|
74
|
+
return JSON_RULES;
|
|
75
|
+
}
|
|
76
|
+
if (lang === "bash" || lang === "sh" || lang === "shell" || lang === "zsh" || lang === "terminal" || lang.endsWith(".sh") || lang.endsWith(".bash")) {
|
|
77
|
+
return BASH_RULES;
|
|
78
|
+
}
|
|
79
|
+
if (lang === "python" || lang === "py" || lang.endsWith(".py")) {
|
|
80
|
+
return PYTHON_RULES;
|
|
81
|
+
}
|
|
82
|
+
if (lang === "sql" || lang.endsWith(".sql")) {
|
|
83
|
+
return SQL_RULES;
|
|
84
|
+
}
|
|
85
|
+
return JS_TSX_RULES;
|
|
86
|
+
}
|
|
87
|
+
function highlightCode(code, languageOrFilename) {
|
|
88
|
+
if (!code) return [];
|
|
89
|
+
const rules = getLanguageRules(languageOrFilename);
|
|
90
|
+
const combinedRegex = new RegExp(rules.map((r) => r.re.source).join("|"), "g");
|
|
91
|
+
const out = [];
|
|
92
|
+
let last = 0;
|
|
93
|
+
let m;
|
|
94
|
+
let key = 0;
|
|
95
|
+
combinedRegex.lastIndex = 0;
|
|
96
|
+
while (m = combinedRegex.exec(code)) {
|
|
97
|
+
if (m.index > last) {
|
|
98
|
+
out.push(code.slice(last, m.index));
|
|
99
|
+
}
|
|
100
|
+
const matchIndex = rules.findIndex((_, i) => m[i + 1] !== void 0);
|
|
101
|
+
out.push(
|
|
102
|
+
/* @__PURE__ */ jsx("span", { className: rules[matchIndex]?.className, children: m[0] }, key++)
|
|
103
|
+
);
|
|
104
|
+
last = m.index + m[0].length;
|
|
105
|
+
if (m[0].length === 0) combinedRegex.lastIndex++;
|
|
106
|
+
}
|
|
107
|
+
if (last < code.length) {
|
|
108
|
+
out.push(code.slice(last));
|
|
109
|
+
}
|
|
110
|
+
return out;
|
|
111
|
+
}
|
|
112
|
+
export {
|
|
113
|
+
getLanguageRules,
|
|
114
|
+
highlightCode
|
|
115
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { b as BODY_FONTS, c as BRAND_PRESETS, f as BRAND_SOLID_MODES, g as BrandSolid, B as BrandSolidMode, a7 as DEFAULT_BRAND_SOLID, D as DISPLAY_FONTS, G as GRAY_PRESETS, h as GRAY_STEPS, R as RADIUS_PRESETS, a8 as ResolvedThemeConfig, S as SCALING_PRESETS, T as THEME_PRESETS, a9 as ThemeConfigInput, i as ThemePreset, k as applyBodyFontPreset, l as applyBrandColor, m as applyDisplayFontPreset, n as applyGrayColor, aa as applyNeutralsTint, o as applyPanelBackground, p as applyRadiusPreset, q as applyScalingPreset, r as applySubheadingFont, s as applyThemePreset, t as brandForegroundFor, u as brandForegroundForOklch, v as brandHoverFor, w as brandHoverForOklch, x as brandSolidFor, y as brandSolidForOklch, z as brandTextFor, A as brandTextForOklch, ab as contrastRatio, H as hexToTriplet, ac as isBrandSolidMode, I as loadGoogleFont, Z as parseGoogleFontEmbed, _ as perceptualAaFailures, $ as preloadGoogleFontsBundle, ad as reapplyBrandColor, a0 as resolveBrand, a1 as resolveBrandTriplet, ae as resolveThemeConfig, a3 as scopedThemeVars, a4 as setBrandSolidMode, af as themeCss, a6 as tripletToHex } from '../theme-presets-BVWZ_TxX.js';
|