@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,381 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "./cn.js";
|
|
4
|
+
import { useReducedMotion } from "./useReducedMotion.js";
|
|
5
|
+
import { MotionPauseButton } from "../primitives/Video/PauseToggle.js";
|
|
6
|
+
import { Backdrop } from "../primitives/Backdrop/Backdrop.js";
|
|
7
|
+
import { OVERLAY_PRESET_KEYS, OVERLAY_PRESET_STYLES, parseOverlayShorthand as parseShorthandBase, overlayLayersToShorthand as layersToShorthandBase } from "./media-overlay-presets.js";
|
|
8
|
+
const PRESET_INLINE_STYLES = OVERLAY_PRESET_STYLES;
|
|
9
|
+
const isVideoUrl = (url) => {
|
|
10
|
+
if (!url) return false;
|
|
11
|
+
const trimmed = url.trim().toLowerCase();
|
|
12
|
+
if (/\.(mp4|webm|mov|m4v|ogv|m3u8)(\?.*)?$/i.test(trimmed)) return true;
|
|
13
|
+
if (trimmed.startsWith("data:video/") || trimmed.startsWith("blob:")) return true;
|
|
14
|
+
if (trimmed.includes("video") || trimmed.includes("stream") || trimmed.includes("vimeo.com") || trimmed.includes("youtube.com") || trimmed.includes("youtu.be")) return true;
|
|
15
|
+
return false;
|
|
16
|
+
};
|
|
17
|
+
function bgMediaLayer(props, contentClassName) {
|
|
18
|
+
if (!props.bgVideo && !props.bgImage && !props.bgOverlays) {
|
|
19
|
+
return { hasMedia: false, media: null, content: (children) => children };
|
|
20
|
+
}
|
|
21
|
+
const media = renderBgMedia(props);
|
|
22
|
+
const video = Boolean(props.bgVideo) && props.bgVideoPaused !== "true";
|
|
23
|
+
const fx = parseOverlayLayers(props).some((l) => l.visible && l.type === "fx" && l.fxParams?.paused !== "true");
|
|
24
|
+
const toggle = video || fx ? React.createElement(BgMotionToggle, { fx }) : null;
|
|
25
|
+
return {
|
|
26
|
+
hasMedia: true,
|
|
27
|
+
media,
|
|
28
|
+
content: (children) => React.createElement(
|
|
29
|
+
React.Fragment,
|
|
30
|
+
null,
|
|
31
|
+
React.createElement("div", { className: cn("relative z-10 w-full h-full", contentClassName) }, children),
|
|
32
|
+
toggle
|
|
33
|
+
)
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function withScrim(bgOverlays, preset) {
|
|
37
|
+
const v = (bgOverlays ?? "").trim();
|
|
38
|
+
if (v.startsWith("[")) {
|
|
39
|
+
try {
|
|
40
|
+
const arr = JSON.parse(v);
|
|
41
|
+
arr.push({ id: "readability-scrim", type: "preset", presetKey: preset, opacity: 100, visible: true });
|
|
42
|
+
return JSON.stringify(arr);
|
|
43
|
+
} catch {
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return v ? `${v}, ${preset}` : preset;
|
|
47
|
+
}
|
|
48
|
+
function resolveBgReadability(props) {
|
|
49
|
+
if (props.surface !== void 0) return { surface: props.surface, bgOverlays: props.bgOverlays };
|
|
50
|
+
const layers = parseOverlayLayers({ bgOverlays: props.bgOverlays ?? "" }).filter((l) => l.visible);
|
|
51
|
+
const fx = layers.some((l) => l.type === "fx");
|
|
52
|
+
const photo = Boolean(props.bgImage || props.bgVideo);
|
|
53
|
+
if (!fx && !photo) return { surface: void 0, bgOverlays: props.bgOverlays };
|
|
54
|
+
const preset = layers.filter((l) => l.type === "preset" && l.presetKey).map((l) => l.presetKey);
|
|
55
|
+
if (preset.some((k) => /^light-\d+$/.test(k))) return { surface: void 0, bgOverlays: props.bgOverlays };
|
|
56
|
+
const need = fx ? 50 : 30;
|
|
57
|
+
const dark = preset.some((k) => k === "scrim" || k === "scrim-left" || /^dark-(\d+)$/.test(k) && Number(k.slice(5)) >= need);
|
|
58
|
+
return { surface: "dark-always", bgOverlays: dark ? props.bgOverlays : withScrim(props.bgOverlays, `dark-${need}`) };
|
|
59
|
+
}
|
|
60
|
+
function hexToRgb(hex) {
|
|
61
|
+
let c = (hex || "").replace(/^#/, "");
|
|
62
|
+
if (!c) return { r: 0, g: 0, b: 0, a: 1 };
|
|
63
|
+
if (c.length === 3 || c.length === 4) c = c.split("").map((x) => x + x).join("");
|
|
64
|
+
const alpha = c.length === 8 ? (parseInt(c.slice(6, 8), 16) || 0) / 255 : 1;
|
|
65
|
+
const num = parseInt(c.slice(0, 6), 16) || 0;
|
|
66
|
+
return { r: num >> 16 & 255, g: num >> 8 & 255, b: num & 255, a: alpha };
|
|
67
|
+
}
|
|
68
|
+
function tokenNameToCssColor(token, fallbackHex, alpha = 1) {
|
|
69
|
+
const a = Math.max(0, Math.min(1, alpha));
|
|
70
|
+
if (token) {
|
|
71
|
+
const t = token.toLowerCase().trim();
|
|
72
|
+
if (t.startsWith("n-") || t.startsWith("var(--n-")) {
|
|
73
|
+
const raw = t.replace(/^var\(--/, "").replace(/\)$/, "").split(" ")[0];
|
|
74
|
+
return `rgb(var(--${raw}) / ${a})`;
|
|
75
|
+
}
|
|
76
|
+
if (t === "canvas" || t.includes("canvas")) return `rgb(var(--bg-canvas) / ${a})`;
|
|
77
|
+
if (t === "surface hover" || t.includes("surface-hover")) return `rgb(var(--bg-surface-hover) / ${a})`;
|
|
78
|
+
if (t === "surface" || t.includes("surface")) return `rgb(var(--bg-surface) / ${a})`;
|
|
79
|
+
if (t === "elevated" || t.includes("elevated")) return `rgb(var(--bg-elevated) / ${a})`;
|
|
80
|
+
if (t === "hairline strong" || t.includes("hairline-strong")) return `rgb(var(--hairline-strong) / ${a})`;
|
|
81
|
+
if (t === "hairline" || t.includes("hairline")) return `rgb(var(--hairline) / ${a})`;
|
|
82
|
+
if (t === "fg (text)" || t === "fg" || t === "text") return `rgb(var(--fg) / ${a})`;
|
|
83
|
+
if (t === "fg muted" || t.includes("fg-muted")) return `rgb(var(--fg-muted) / ${a})`;
|
|
84
|
+
if (t === "fg subtle" || t.includes("fg-subtle")) return `rgb(var(--fg-subtle) / ${a})`;
|
|
85
|
+
if (t === "brand" || t.includes("brand")) return `rgb(var(--brand) / ${a})`;
|
|
86
|
+
if (t === "danger") return `rgb(var(--danger) / ${a})`;
|
|
87
|
+
if (t === "success") return `rgb(var(--success) / ${a})`;
|
|
88
|
+
if (t === "warning") return `rgb(var(--warning) / ${a})`;
|
|
89
|
+
}
|
|
90
|
+
const hex = fallbackHex || "#000000";
|
|
91
|
+
const rgb = hexToRgb(hex);
|
|
92
|
+
return `rgb(${rgb.r} ${rgb.g} ${rgb.b} / ${+(a * rgb.a).toFixed(3)})`;
|
|
93
|
+
}
|
|
94
|
+
function tokenNameToCssVar(token) {
|
|
95
|
+
if (!token) return null;
|
|
96
|
+
const t = token.toLowerCase().trim();
|
|
97
|
+
if (t.startsWith("n-") || t.startsWith("var(--n-")) {
|
|
98
|
+
const raw = t.replace(/^var\(--/, "").replace(/\)$/, "").split(" ")[0];
|
|
99
|
+
return `var(--${raw})`;
|
|
100
|
+
}
|
|
101
|
+
if (t === "canvas" || t.includes("canvas")) return "var(--bg-canvas)";
|
|
102
|
+
if (t === "surface hover" || t.includes("surface-hover")) return "var(--bg-surface-hover)";
|
|
103
|
+
if (t === "surface" || t.includes("surface")) return "var(--bg-surface)";
|
|
104
|
+
if (t === "elevated" || t.includes("elevated")) return "var(--bg-elevated)";
|
|
105
|
+
if (t === "hairline strong" || t.includes("hairline-strong")) return "var(--hairline-strong)";
|
|
106
|
+
if (t === "hairline" || t.includes("hairline")) return "var(--hairline)";
|
|
107
|
+
if (t === "fg (text)" || t === "fg" || t === "text") return "var(--fg)";
|
|
108
|
+
if (t === "fg muted" || t.includes("fg-muted")) return "var(--fg-muted)";
|
|
109
|
+
if (t === "fg subtle" || t.includes("fg-subtle")) return "var(--fg-subtle)";
|
|
110
|
+
if (t === "brand" || t.includes("brand")) return "var(--brand)";
|
|
111
|
+
if (t === "danger") return "var(--danger)";
|
|
112
|
+
if (t === "success") return "var(--success)";
|
|
113
|
+
if (t === "warning") return "var(--warning)";
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
function getPresetThumbnailStyle(presetKey) {
|
|
117
|
+
return presetKey && OVERLAY_PRESET_STYLES[presetKey] || { backgroundColor: "rgba(0,0,0,0.4)" };
|
|
118
|
+
}
|
|
119
|
+
function getOverlayThumbnailStyle(layer) {
|
|
120
|
+
if (layer.type === "preset" && layer.presetKey) {
|
|
121
|
+
return getPresetThumbnailStyle(layer.presetKey);
|
|
122
|
+
}
|
|
123
|
+
if (layer.type === "fx") {
|
|
124
|
+
return { background: "conic-gradient(from 200deg at 50% 50%, rgb(var(--brand) / 0.5), rgb(var(--brand) / 0.1), rgb(var(--brand) / 0.5))" };
|
|
125
|
+
}
|
|
126
|
+
return getOverlayLayerStyle(layer) || { backgroundColor: layer.color || "#000000" };
|
|
127
|
+
}
|
|
128
|
+
const parseOverlayShorthand = parseShorthandBase;
|
|
129
|
+
const overlayLayersToShorthand = layersToShorthandBase;
|
|
130
|
+
function parseOverlayLayers(props) {
|
|
131
|
+
if (props.bgOverlays) {
|
|
132
|
+
try {
|
|
133
|
+
const parsed = JSON.parse(props.bgOverlays);
|
|
134
|
+
if (Array.isArray(parsed) && parsed.length > 0) {
|
|
135
|
+
return parsed.map((l, idx) => ({
|
|
136
|
+
...l,
|
|
137
|
+
id: l.id || `overlay-${idx + 1}`
|
|
138
|
+
}));
|
|
139
|
+
}
|
|
140
|
+
} catch {
|
|
141
|
+
const shorthand = parseOverlayShorthand(props.bgOverlays);
|
|
142
|
+
if (shorthand.length > 0) return shorthand;
|
|
143
|
+
if (props.bgOverlays in PRESET_INLINE_STYLES) {
|
|
144
|
+
return [{
|
|
145
|
+
id: "preset-1",
|
|
146
|
+
type: "preset",
|
|
147
|
+
presetKey: props.bgOverlays,
|
|
148
|
+
opacity: 100,
|
|
149
|
+
visible: true
|
|
150
|
+
}];
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
if (props.bgOverlay && props.bgOverlay !== "none") {
|
|
155
|
+
const ov = props.bgOverlay;
|
|
156
|
+
if (ov in PRESET_INLINE_STYLES) {
|
|
157
|
+
return [
|
|
158
|
+
{
|
|
159
|
+
id: "preset-1",
|
|
160
|
+
type: "preset",
|
|
161
|
+
presetKey: ov,
|
|
162
|
+
opacity: 100,
|
|
163
|
+
visible: true
|
|
164
|
+
}
|
|
165
|
+
];
|
|
166
|
+
}
|
|
167
|
+
if (ov.startsWith("#") || ov.startsWith("rgb")) {
|
|
168
|
+
return [
|
|
169
|
+
{
|
|
170
|
+
id: "solid-1",
|
|
171
|
+
type: "solid",
|
|
172
|
+
color: ov,
|
|
173
|
+
opacity: 100,
|
|
174
|
+
visible: true
|
|
175
|
+
}
|
|
176
|
+
];
|
|
177
|
+
}
|
|
178
|
+
if (ov.includes("gradient")) {
|
|
179
|
+
return [
|
|
180
|
+
{
|
|
181
|
+
id: "custom-grad-1",
|
|
182
|
+
type: ov.includes("radial") ? "radial" : "linear",
|
|
183
|
+
color: ov,
|
|
184
|
+
opacity: 100,
|
|
185
|
+
visible: true
|
|
186
|
+
}
|
|
187
|
+
];
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return [];
|
|
191
|
+
}
|
|
192
|
+
function getOverlayLayerClass(layer) {
|
|
193
|
+
return layer.type === "preset" && layer.animated ? "animate-mesh-drift" : "";
|
|
194
|
+
}
|
|
195
|
+
function getOverlayLayerStyle(layer) {
|
|
196
|
+
if (!layer.visible) return void 0;
|
|
197
|
+
if (layer.type === "preset" && layer.presetKey && PRESET_INLINE_STYLES[layer.presetKey]) {
|
|
198
|
+
const baseStyle = PRESET_INLINE_STYLES[layer.presetKey];
|
|
199
|
+
const alpha = (layer.opacity ?? 100) / 100;
|
|
200
|
+
if (alpha < 1) {
|
|
201
|
+
return { ...baseStyle, opacity: alpha };
|
|
202
|
+
}
|
|
203
|
+
return baseStyle;
|
|
204
|
+
}
|
|
205
|
+
if (layer.type === "solid") {
|
|
206
|
+
const alpha = (layer.opacity ?? 100) / 100;
|
|
207
|
+
const colorStr = tokenNameToCssColor(layer.token, layer.color, alpha);
|
|
208
|
+
return {
|
|
209
|
+
backgroundColor: colorStr
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
if (layer.type === "linear" || layer.type === "radial") {
|
|
213
|
+
const stops = layer.stops && layer.stops.length > 0 ? layer.stops : [
|
|
214
|
+
{ color: layer.color || "", offset: 0, opacity: 100, token: layer.token },
|
|
215
|
+
{ color: layer.color || "", offset: 100, opacity: 0, token: layer.token }
|
|
216
|
+
];
|
|
217
|
+
const overallAlpha = (layer.opacity ?? 100) / 100;
|
|
218
|
+
const stopStr = stops.map((s) => {
|
|
219
|
+
const stopAlpha = (s.opacity ?? 100) / 100 * overallAlpha;
|
|
220
|
+
const colorStr = tokenNameToCssColor(s.token, s.color, stopAlpha);
|
|
221
|
+
return `${colorStr} ${s.offset}%`;
|
|
222
|
+
}).join(", ");
|
|
223
|
+
const bg = layer.type === "radial" ? `radial-gradient(circle at ${layer.position || "center"}, ${stopStr})` : `linear-gradient(${layer.angle ?? 180}deg, ${stopStr})`;
|
|
224
|
+
return { background: bg };
|
|
225
|
+
}
|
|
226
|
+
return void 0;
|
|
227
|
+
}
|
|
228
|
+
const renderBgMedia = (props) => {
|
|
229
|
+
const rawUrl = props.bgVideo || props.bgImage;
|
|
230
|
+
const layers = parseOverlayLayers(props);
|
|
231
|
+
const hasOverlay = layers.some((l) => l.visible);
|
|
232
|
+
if (!rawUrl && !hasOverlay) return null;
|
|
233
|
+
const isVid = Boolean(props.bgVideo) || isVideoUrl(rawUrl);
|
|
234
|
+
const videoSrc = isVid ? rawUrl : "";
|
|
235
|
+
const imageSrc = !isVid ? rawUrl : "";
|
|
236
|
+
const isPaused = props.bgVideoPaused === "true";
|
|
237
|
+
return /* @__PURE__ */ jsxs("div", { "data-bg-media": "", className: "pointer-events-none absolute inset-0 z-0 overflow-hidden rounded-[inherit] w-full h-full", children: [
|
|
238
|
+
imageSrc && /* @__PURE__ */ jsx(
|
|
239
|
+
"img",
|
|
240
|
+
{
|
|
241
|
+
src: imageSrc,
|
|
242
|
+
alt: "",
|
|
243
|
+
onError: (e) => {
|
|
244
|
+
e.currentTarget.style.display = "none";
|
|
245
|
+
},
|
|
246
|
+
className: cn("h-full w-full pointer-events-none select-none", props.bgSize === "contain" ? "object-contain" : "object-cover")
|
|
247
|
+
}
|
|
248
|
+
),
|
|
249
|
+
videoSrc && props.bgPoster && /* @__PURE__ */ jsx(
|
|
250
|
+
"img",
|
|
251
|
+
{
|
|
252
|
+
src: props.bgPoster,
|
|
253
|
+
alt: "",
|
|
254
|
+
className: cn("absolute inset-0 h-full w-full pointer-events-none select-none", props.bgSize === "contain" ? "object-contain" : "object-cover")
|
|
255
|
+
}
|
|
256
|
+
),
|
|
257
|
+
videoSrc && /* @__PURE__ */ jsx(
|
|
258
|
+
BgVideo,
|
|
259
|
+
{
|
|
260
|
+
src: videoSrc,
|
|
261
|
+
paused: isPaused,
|
|
262
|
+
poster: props.bgPoster || void 0,
|
|
263
|
+
className: cn("relative h-full w-full pointer-events-none", props.bgPoster && "motion-reduce:hidden", props.bgSize === "contain" ? "object-contain" : "object-cover")
|
|
264
|
+
},
|
|
265
|
+
`${videoSrc}-${isPaused ? "paused" : "playing"}`
|
|
266
|
+
),
|
|
267
|
+
renderOverlayLayers(layers.filter((l) => l.visible))
|
|
268
|
+
] });
|
|
269
|
+
};
|
|
270
|
+
function renderOverlayLayers(layers) {
|
|
271
|
+
return layers.map((l, idx) => {
|
|
272
|
+
if (l.type === "fx") {
|
|
273
|
+
return /* @__PURE__ */ jsx(
|
|
274
|
+
Backdrop,
|
|
275
|
+
{
|
|
276
|
+
variant: l.fxKey || "mesh",
|
|
277
|
+
params: l.fxParams,
|
|
278
|
+
"data-overlay": "true",
|
|
279
|
+
className: "z-[1]",
|
|
280
|
+
style: typeof l.opacity === "number" && l.opacity < 100 ? { opacity: l.opacity / 100 } : void 0
|
|
281
|
+
},
|
|
282
|
+
l.id || idx
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
const cls = getOverlayLayerClass(l);
|
|
286
|
+
const style = getOverlayLayerStyle(l);
|
|
287
|
+
return /* @__PURE__ */ jsx(
|
|
288
|
+
"div",
|
|
289
|
+
{
|
|
290
|
+
"data-overlay": "true",
|
|
291
|
+
className: cn("absolute inset-0 z-[1] pointer-events-none", cls),
|
|
292
|
+
style
|
|
293
|
+
},
|
|
294
|
+
l.id || idx
|
|
295
|
+
);
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
function renderOverlays(overlays) {
|
|
299
|
+
if (!overlays) return [];
|
|
300
|
+
const layers = parseOverlayLayers({ bgOverlays: overlays }).filter((l) => l.visible);
|
|
301
|
+
return layers.length ? renderOverlayLayers(layers) : [];
|
|
302
|
+
}
|
|
303
|
+
function BgVideo({ src, poster, paused, className }) {
|
|
304
|
+
const reduced = useReducedMotion();
|
|
305
|
+
const play = !paused && !reduced;
|
|
306
|
+
return /* @__PURE__ */ jsx(
|
|
307
|
+
"video",
|
|
308
|
+
{
|
|
309
|
+
"data-bg-video": "",
|
|
310
|
+
src,
|
|
311
|
+
autoPlay: play,
|
|
312
|
+
loop: true,
|
|
313
|
+
muted: true,
|
|
314
|
+
playsInline: true,
|
|
315
|
+
"aria-hidden": "true",
|
|
316
|
+
tabIndex: -1,
|
|
317
|
+
poster,
|
|
318
|
+
ref: (el) => {
|
|
319
|
+
if (!el) return;
|
|
320
|
+
if (play) el.play().catch(() => {
|
|
321
|
+
});
|
|
322
|
+
else el.pause();
|
|
323
|
+
},
|
|
324
|
+
className
|
|
325
|
+
}
|
|
326
|
+
);
|
|
327
|
+
}
|
|
328
|
+
function BgMotionToggle({ fx }) {
|
|
329
|
+
const ref = React.useRef(null);
|
|
330
|
+
const reduced = useReducedMotion();
|
|
331
|
+
const [video, setVideo] = React.useState(null);
|
|
332
|
+
const [playing, setPlaying] = React.useState(true);
|
|
333
|
+
const layer = () => ref.current?.parentElement?.querySelector(":scope > [data-bg-media]") ?? null;
|
|
334
|
+
React.useEffect(() => {
|
|
335
|
+
const v = layer()?.querySelector("video[data-bg-video]") ?? null;
|
|
336
|
+
setVideo(v);
|
|
337
|
+
if (!v) return;
|
|
338
|
+
setPlaying(!v.paused);
|
|
339
|
+
const on = () => setPlaying(true);
|
|
340
|
+
const off = () => setPlaying(false);
|
|
341
|
+
v.addEventListener("play", on);
|
|
342
|
+
v.addEventListener("pause", off);
|
|
343
|
+
return () => {
|
|
344
|
+
v.removeEventListener("play", on);
|
|
345
|
+
v.removeEventListener("pause", off);
|
|
346
|
+
};
|
|
347
|
+
}, []);
|
|
348
|
+
if (reduced && !video) return null;
|
|
349
|
+
const toggle = () => {
|
|
350
|
+
const next = !playing;
|
|
351
|
+
if (video) {
|
|
352
|
+
if (next) void video.play().catch(() => {
|
|
353
|
+
});
|
|
354
|
+
else video.pause();
|
|
355
|
+
}
|
|
356
|
+
if (fx) layer()?.toggleAttribute("data-fx-paused", !next);
|
|
357
|
+
setPlaying(next);
|
|
358
|
+
};
|
|
359
|
+
const label = video && fx ? "background motion" : video ? "background video" : "background animation";
|
|
360
|
+
return /* @__PURE__ */ jsx("span", { ref, className: "contents", children: /* @__PURE__ */ jsx(MotionPauseButton, { playing, onToggle: toggle, label, className: "z-20" }) });
|
|
361
|
+
}
|
|
362
|
+
export {
|
|
363
|
+
OVERLAY_PRESET_KEYS,
|
|
364
|
+
OVERLAY_PRESET_STYLES,
|
|
365
|
+
bgMediaLayer,
|
|
366
|
+
getOverlayLayerClass,
|
|
367
|
+
getOverlayLayerStyle,
|
|
368
|
+
getOverlayThumbnailStyle,
|
|
369
|
+
getPresetThumbnailStyle,
|
|
370
|
+
hexToRgb,
|
|
371
|
+
isVideoUrl,
|
|
372
|
+
overlayLayersToShorthand,
|
|
373
|
+
parseOverlayLayers,
|
|
374
|
+
parseOverlayShorthand,
|
|
375
|
+
renderBgMedia,
|
|
376
|
+
renderOverlayLayers,
|
|
377
|
+
renderOverlays,
|
|
378
|
+
resolveBgReadability,
|
|
379
|
+
tokenNameToCssColor,
|
|
380
|
+
tokenNameToCssVar
|
|
381
|
+
};
|
package/dist/lib/meta.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
const SHAVIN_META = {
|
|
2
|
+
version: "0.1.0",
|
|
3
|
+
primitiveCount: 94,
|
|
4
|
+
/** Every tool in the registry. A plain install lists fewer until a Studio session or bridge tab connects (see tool-visibility). */
|
|
5
|
+
mcpToolCount: 36,
|
|
6
|
+
/** Page and section compositions in the layout-compositions skill. */
|
|
7
|
+
compositionCount: 57,
|
|
8
|
+
/** Theme presets in THEME_PRESETS (not the brand colours). */
|
|
9
|
+
themePresetCount: 9,
|
|
10
|
+
skillCount: 9,
|
|
11
|
+
/** Skills a project gets (skillCount minus the maintainer-only ones in packages/skills/internal.json). */
|
|
12
|
+
consumerSkillCount: 7,
|
|
13
|
+
/** Slash commands a project gets (packages/skills/commands). */
|
|
14
|
+
commandCount: 9,
|
|
15
|
+
blockCount: 59,
|
|
16
|
+
manifestCount: 2,
|
|
17
|
+
tokenPurityTarget: 100,
|
|
18
|
+
mcpTools: [
|
|
19
|
+
"audit_source",
|
|
20
|
+
"autofix_code",
|
|
21
|
+
"await_finding",
|
|
22
|
+
"check_page",
|
|
23
|
+
"clear_studio_canvas",
|
|
24
|
+
"compose_to_canvas",
|
|
25
|
+
"connect_studio",
|
|
26
|
+
"disconnect_studio",
|
|
27
|
+
"duplicate_frame",
|
|
28
|
+
"export_frame",
|
|
29
|
+
"get_block_template",
|
|
30
|
+
"get_components",
|
|
31
|
+
"get_guidelines",
|
|
32
|
+
"get_live_audit",
|
|
33
|
+
"get_project_context",
|
|
34
|
+
"get_setup_instructions",
|
|
35
|
+
"get_skill",
|
|
36
|
+
"get_skill_mode",
|
|
37
|
+
"get_studio_schema",
|
|
38
|
+
"get_studio_state",
|
|
39
|
+
"get_tokens",
|
|
40
|
+
"inject_blocks",
|
|
41
|
+
"inspect_environment",
|
|
42
|
+
"install_skills",
|
|
43
|
+
"list_commands",
|
|
44
|
+
"list_findings",
|
|
45
|
+
"list_skills",
|
|
46
|
+
"plan_page",
|
|
47
|
+
"render_check",
|
|
48
|
+
"resize_frame",
|
|
49
|
+
"set_studio_theme",
|
|
50
|
+
"shavin_steer",
|
|
51
|
+
"synthesize_layout",
|
|
52
|
+
"trigger_live_rescan",
|
|
53
|
+
"validate_code",
|
|
54
|
+
"wait_for_live_clean"
|
|
55
|
+
],
|
|
56
|
+
skills: [
|
|
57
|
+
{ name: "layout-choreography", desc: "Scene-based, awwwards-style choreographed motion for web pages (Tier 2) \u2014 pinned scrollytelling, scroll-scrubbed timelines, horizontal-scroll sections, split..." },
|
|
58
|
+
{ name: "layout-compositions", desc: "A library of 57 website section and page layout compositions (structural, hero, features, proof, conversion, gallery, editorial, documentation, expressive) w..." },
|
|
59
|
+
{ name: "layout-motion", desc: "Clean, smooth, restrained motion for web layouts (Tier 1) \u2014 motion tokens (durations, easings, distances, stagger), scroll reveals, hover and press states, t..." },
|
|
60
|
+
{ name: "shavin-app", desc: "Guides the architecture, layout partitioning, interaction patterns, state management, and implementation of SaaS web applications, dashboards, AI chat tools,..." },
|
|
61
|
+
{ name: "shavin-core", desc: "Decides which Shavin skill fires for a request, reads the SHAVIN.md site and mode defaults, explains how skills reference MCP tools with a no-MCP fallback, a..." },
|
|
62
|
+
{ name: "shavin-studio", desc: "Rules for designing live in Shavin Studio through the MCP: only when a Studio session is connected (connect_studio) and you build BlockNode trees for the can..." },
|
|
63
|
+
{ name: "shavin-ui-qa-linter", desc: "Runs automated design-system QA, token enforcement linting, accessibility audits, setup verification, and visual regression checks for @shavin/ui." },
|
|
64
|
+
{ name: "shavin-webpage", desc: "Guides the architecture, visual composition, layout design, and implementation of marketing pages, landing pages, documentation portals, editorial showcases,..." },
|
|
65
|
+
{ name: "visual-compositor", desc: "Precise structural and spatial composition rules for web pages and web apps." }
|
|
66
|
+
]
|
|
67
|
+
};
|
|
68
|
+
export {
|
|
69
|
+
SHAVIN_META
|
|
70
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
async function loadDefaultGsap() {
|
|
2
|
+
let gsapMod;
|
|
3
|
+
let ScrollTrigger;
|
|
4
|
+
try {
|
|
5
|
+
gsapMod = await import("gsap");
|
|
6
|
+
} catch {
|
|
7
|
+
throw new Error("gsap is not installed");
|
|
8
|
+
}
|
|
9
|
+
try {
|
|
10
|
+
ScrollTrigger = (await import("gsap/ScrollTrigger")).ScrollTrigger;
|
|
11
|
+
} catch {
|
|
12
|
+
throw new Error("gsap/ScrollTrigger is not available");
|
|
13
|
+
}
|
|
14
|
+
const gsap = gsapMod.gsap ?? gsapMod.default;
|
|
15
|
+
let SplitText = null;
|
|
16
|
+
try {
|
|
17
|
+
SplitText = (await import("gsap/SplitText")).SplitText ?? null;
|
|
18
|
+
} catch {
|
|
19
|
+
SplitText = null;
|
|
20
|
+
}
|
|
21
|
+
return { gsap, ScrollTrigger, SplitText };
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
loadDefaultGsap
|
|
25
|
+
};
|