@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,35 @@
|
|
|
1
|
+
import { collectPage } from "./collect.js";
|
|
2
|
+
import { analyzePage } from "./rules.js";
|
|
3
|
+
import { contextLabel, uniqueSelector } from "./selector.js";
|
|
4
|
+
function domHooks(doc) {
|
|
5
|
+
const selectors = /* @__PURE__ */ new WeakMap();
|
|
6
|
+
const contexts = /* @__PURE__ */ new WeakMap();
|
|
7
|
+
return {
|
|
8
|
+
selectorOf(ref) {
|
|
9
|
+
if (!ref || typeof ref !== "object") return String(ref);
|
|
10
|
+
let s = selectors.get(ref);
|
|
11
|
+
if (s === void 0) {
|
|
12
|
+
s = uniqueSelector(ref, doc);
|
|
13
|
+
selectors.set(ref, s);
|
|
14
|
+
}
|
|
15
|
+
return s;
|
|
16
|
+
},
|
|
17
|
+
contextOf(ref) {
|
|
18
|
+
if (!ref || typeof ref !== "object") return "";
|
|
19
|
+
let s = contexts.get(ref);
|
|
20
|
+
if (s === void 0) {
|
|
21
|
+
s = contextLabel(ref);
|
|
22
|
+
contexts.set(ref, s);
|
|
23
|
+
}
|
|
24
|
+
return s;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function inspectDocument(options = {}) {
|
|
29
|
+
const doc = options.doc ?? document;
|
|
30
|
+
return analyzePage(collectPage({ ...options, doc }), domHooks(doc));
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
domHooks,
|
|
34
|
+
inspectDocument
|
|
35
|
+
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
const FINDING_CAPS = {
|
|
2
|
+
message: 300,
|
|
3
|
+
fixHint: 300,
|
|
4
|
+
selector: 500,
|
|
5
|
+
context: 200,
|
|
6
|
+
text: 60,
|
|
7
|
+
comment: 2e3,
|
|
8
|
+
rule: 60,
|
|
9
|
+
evidenceValue: 300,
|
|
10
|
+
propValue: 120,
|
|
11
|
+
props: 12,
|
|
12
|
+
/** Findings kept per scan; the rest are dropped after sorting errors first. */
|
|
13
|
+
perScan: 200
|
|
14
|
+
};
|
|
15
|
+
const CONTROL_CHARS = new RegExp("[\\u0000-\\u0008\\u000b\\u000c\\u000e-\\u001f\\u007f-\\u009f\\u2028\\u2029\\u202a-\\u202e\\u2066-\\u2069]", "g");
|
|
16
|
+
function clampText(value, max) {
|
|
17
|
+
const s = String(value ?? "").replace(CONTROL_CHARS, "").replace(/\s+/g, " ").trim();
|
|
18
|
+
return s.length > max ? `${s.slice(0, Math.max(0, max - 1))}\u2026` : s;
|
|
19
|
+
}
|
|
20
|
+
function clampNote(value, max) {
|
|
21
|
+
const s = String(value ?? "").replace(CONTROL_CHARS, "").replace(/\r\n?/g, "\n").trim();
|
|
22
|
+
return s.length > max ? s.slice(0, max) : s;
|
|
23
|
+
}
|
|
24
|
+
function fnv1a(input, seed) {
|
|
25
|
+
let h = seed >>> 0;
|
|
26
|
+
for (let i = 0; i < input.length; i++) {
|
|
27
|
+
h ^= input.charCodeAt(i);
|
|
28
|
+
h = Math.imul(h, 16777619) >>> 0;
|
|
29
|
+
}
|
|
30
|
+
return h >>> 0;
|
|
31
|
+
}
|
|
32
|
+
function fingerprint(detector, rule, selector, text = "") {
|
|
33
|
+
const key = [detector, rule, selector, text.slice(0, 24)].join("|");
|
|
34
|
+
return `f_${fnv1a(key, 2166136261).toString(16).padStart(8, "0")}`;
|
|
35
|
+
}
|
|
36
|
+
const FINDING_ID = /^f_[0-9a-f]{8}$/;
|
|
37
|
+
const isFindingId = (value) => typeof value === "string" && FINDING_ID.test(value);
|
|
38
|
+
const round = (n) => Math.round(n * 10) / 10;
|
|
39
|
+
function cleanRect(rect) {
|
|
40
|
+
if (!rect) return null;
|
|
41
|
+
const vals = [rect.x, rect.y, rect.w, rect.h, rect.scrollX, rect.scrollY];
|
|
42
|
+
if (!vals.every((v) => typeof v === "number" && Number.isFinite(v))) return null;
|
|
43
|
+
return { x: round(rect.x), y: round(rect.y), w: round(rect.w), h: round(rect.h), scrollX: round(rect.scrollX), scrollY: round(rect.scrollY) };
|
|
44
|
+
}
|
|
45
|
+
function makeFinding(input) {
|
|
46
|
+
const selector = clampText(input.selector, FINDING_CAPS.selector) || "(page)";
|
|
47
|
+
const text = input.text ? clampText(input.text, FINDING_CAPS.text) : "";
|
|
48
|
+
const evidence = {};
|
|
49
|
+
for (const [k, v] of Object.entries(input.evidence ?? {})) {
|
|
50
|
+
if (v === void 0) continue;
|
|
51
|
+
evidence[clampText(k, 40)] = clampText(v, FINDING_CAPS.evidenceValue);
|
|
52
|
+
}
|
|
53
|
+
const finding = {
|
|
54
|
+
id: fingerprint(input.detector, input.rule, selector, text),
|
|
55
|
+
detector: input.detector,
|
|
56
|
+
rule: clampText(input.rule, FINDING_CAPS.rule),
|
|
57
|
+
severity: input.severity,
|
|
58
|
+
message: clampText(input.message, FINDING_CAPS.message),
|
|
59
|
+
evidence,
|
|
60
|
+
fixHint: clampText(input.fixHint, FINDING_CAPS.fixHint),
|
|
61
|
+
selector,
|
|
62
|
+
context: clampText(input.context ?? "", FINDING_CAPS.context),
|
|
63
|
+
rect: cleanRect(input.rect),
|
|
64
|
+
source: "inspector@1",
|
|
65
|
+
at: input.at ?? Date.now()
|
|
66
|
+
};
|
|
67
|
+
if (text) finding.text = text;
|
|
68
|
+
if (input.comment) finding.comment = clampNote(input.comment, FINDING_CAPS.comment);
|
|
69
|
+
if (input.props) {
|
|
70
|
+
const props = {};
|
|
71
|
+
for (const [k, v] of Object.entries(input.props).slice(0, FINDING_CAPS.props)) {
|
|
72
|
+
props[clampText(k, 40)] = clampText(v, FINDING_CAPS.propValue);
|
|
73
|
+
}
|
|
74
|
+
if (Object.keys(props).length) finding.props = props;
|
|
75
|
+
}
|
|
76
|
+
return finding;
|
|
77
|
+
}
|
|
78
|
+
const SEVERITY_RANK = { error: 0, warning: 1 };
|
|
79
|
+
function rankFindings(list, cap = FINDING_CAPS.perScan) {
|
|
80
|
+
const seen = /* @__PURE__ */ new Set();
|
|
81
|
+
const unique = [];
|
|
82
|
+
for (const f of list) {
|
|
83
|
+
if (seen.has(f.id)) continue;
|
|
84
|
+
seen.add(f.id);
|
|
85
|
+
unique.push(f);
|
|
86
|
+
}
|
|
87
|
+
unique.sort((a, b) => SEVERITY_RANK[a.severity] - SEVERITY_RANK[b.severity]);
|
|
88
|
+
return { findings: unique.slice(0, cap), dropped: Math.max(0, unique.length - cap) };
|
|
89
|
+
}
|
|
90
|
+
function countFindings(list, ignored = /* @__PURE__ */ new Set()) {
|
|
91
|
+
let errors = 0;
|
|
92
|
+
let warnings = 0;
|
|
93
|
+
for (const f of list) {
|
|
94
|
+
if (ignored.has(f.id)) continue;
|
|
95
|
+
if (f.severity === "error") errors++;
|
|
96
|
+
else warnings++;
|
|
97
|
+
}
|
|
98
|
+
const total = errors + warnings;
|
|
99
|
+
return { total, errors, warnings, clean: total === 0 };
|
|
100
|
+
}
|
|
101
|
+
export {
|
|
102
|
+
FINDING_CAPS,
|
|
103
|
+
clampNote,
|
|
104
|
+
clampText,
|
|
105
|
+
countFindings,
|
|
106
|
+
fingerprint,
|
|
107
|
+
isFindingId,
|
|
108
|
+
makeFinding,
|
|
109
|
+
rankFindings
|
|
110
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
const MAX_DEPTH = 8;
|
|
2
|
+
function esc(value) {
|
|
3
|
+
const css = globalThis.CSS;
|
|
4
|
+
if (css?.escape) return css.escape(value);
|
|
5
|
+
return value.replace(/[^a-zA-Z0-9_\u00a0-\uffff-]/g, (c) => `\\${c}`);
|
|
6
|
+
}
|
|
7
|
+
function looksGenerated(token) {
|
|
8
|
+
if (/^:r[0-9a-z]+:$/i.test(token)) return true;
|
|
9
|
+
if (/\d{4,}/.test(token)) return true;
|
|
10
|
+
if (/^[a-z]{1,4}[-_][0-9a-f]{5,}$/i.test(token)) return true;
|
|
11
|
+
if (/[0-9a-f]{8,}$/i.test(token) && /\d/.test(token)) return true;
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
function stableClasses(el) {
|
|
15
|
+
const out = [];
|
|
16
|
+
for (const c of Array.from(el.classList)) {
|
|
17
|
+
if (c.length > 28 || /[:[\]/%.!]/.test(c) || looksGenerated(c)) continue;
|
|
18
|
+
out.push(c);
|
|
19
|
+
if (out.length === 2) break;
|
|
20
|
+
}
|
|
21
|
+
return out;
|
|
22
|
+
}
|
|
23
|
+
function matchCount(root, selector) {
|
|
24
|
+
try {
|
|
25
|
+
return root.querySelectorAll(selector).length;
|
|
26
|
+
} catch {
|
|
27
|
+
return Infinity;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function anchor(el) {
|
|
31
|
+
const id = el.getAttribute("id");
|
|
32
|
+
if (id && /^[A-Za-z][\w-]*$/.test(id) && !looksGenerated(id)) return `#${esc(id)}`;
|
|
33
|
+
for (const attr of ["data-testid", "data-test", "data-cy"]) {
|
|
34
|
+
const v = el.getAttribute(attr);
|
|
35
|
+
if (v && v.length <= 60 && !/["\\]/.test(v)) return `[${attr}="${v}"]`;
|
|
36
|
+
}
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
function nthOfType(el) {
|
|
40
|
+
let n = 1;
|
|
41
|
+
for (let s = el.previousElementSibling; s; s = s.previousElementSibling) if (s.tagName === el.tagName) n++;
|
|
42
|
+
return n;
|
|
43
|
+
}
|
|
44
|
+
function hasSameTypeSibling(el) {
|
|
45
|
+
const parent = el.parentElement;
|
|
46
|
+
if (!parent) return false;
|
|
47
|
+
for (const s of Array.from(parent.children)) if (s !== el && s.tagName === el.tagName) return true;
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
function segment(el, withNth) {
|
|
51
|
+
const tag = el.tagName.toLowerCase();
|
|
52
|
+
const classes = stableClasses(el).map((c) => `.${esc(c)}`).join("");
|
|
53
|
+
const base = `${tag}${classes}`;
|
|
54
|
+
return withNth && hasSameTypeSibling(el) ? `${base}:nth-of-type(${nthOfType(el)})` : base;
|
|
55
|
+
}
|
|
56
|
+
function uniqueSelector(el, root = el.ownerDocument) {
|
|
57
|
+
if (!el || el.nodeType !== 1) return "";
|
|
58
|
+
const own = anchor(el);
|
|
59
|
+
if (own && matchCount(root, own) === 1) return own;
|
|
60
|
+
for (const withNth of [false, true]) {
|
|
61
|
+
const parts = [];
|
|
62
|
+
let node2 = el;
|
|
63
|
+
for (let depth = 0; node2 && depth < MAX_DEPTH; depth++) {
|
|
64
|
+
const a = depth > 0 ? anchor(node2) : null;
|
|
65
|
+
if (a && matchCount(root, a) === 1) {
|
|
66
|
+
parts.unshift(a);
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
parts.unshift(segment(node2, withNth));
|
|
70
|
+
const candidate2 = parts.join(" > ");
|
|
71
|
+
if (matchCount(root, candidate2) === 1 && root.querySelector(candidate2) === el) return candidate2;
|
|
72
|
+
node2 = node2.parentElement;
|
|
73
|
+
if (!node2 || node2 === (el.ownerDocument?.documentElement ?? null)) break;
|
|
74
|
+
}
|
|
75
|
+
const candidate = parts.join(" > ");
|
|
76
|
+
if (candidate && matchCount(root, candidate) === 1 && root.querySelector(candidate) === el) return candidate;
|
|
77
|
+
}
|
|
78
|
+
const path = [];
|
|
79
|
+
let node = el;
|
|
80
|
+
while (node && node.tagName !== "BODY" && node.tagName !== "HTML" && path.length < 24) {
|
|
81
|
+
const parent = node.parentElement;
|
|
82
|
+
const index = parent ? Array.from(parent.children).indexOf(node) + 1 : 1;
|
|
83
|
+
path.unshift(`${node.tagName.toLowerCase()}:nth-child(${index})`);
|
|
84
|
+
node = parent;
|
|
85
|
+
}
|
|
86
|
+
return `body > ${path.join(" > ")}`;
|
|
87
|
+
}
|
|
88
|
+
function describeElement(el) {
|
|
89
|
+
const tag = el.tagName.toLowerCase();
|
|
90
|
+
const classes = stableClasses(el).map((c) => `.${c}`).join("");
|
|
91
|
+
return `${tag}${classes}`;
|
|
92
|
+
}
|
|
93
|
+
function contextLabel(el) {
|
|
94
|
+
const parent = el.parentElement;
|
|
95
|
+
const self = describeElement(el);
|
|
96
|
+
if (!parent || parent.tagName === "BODY" || parent.tagName === "HTML") return self;
|
|
97
|
+
return `${describeElement(parent)} > ${self}`;
|
|
98
|
+
}
|
|
99
|
+
export {
|
|
100
|
+
contextLabel,
|
|
101
|
+
describeElement,
|
|
102
|
+
uniqueSelector
|
|
103
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { makeFinding } from "./schema.js";
|
|
2
|
+
const RULE_BY_CATEGORY = {
|
|
3
|
+
"Token Purity": "tokens.purity",
|
|
4
|
+
"Semantic Tokens": "tokens.semantic",
|
|
5
|
+
"Concentric Radius": "tokens.radius",
|
|
6
|
+
"Surface Elevation": "tokens.surface",
|
|
7
|
+
"Typography Scale": "tokens.type"
|
|
8
|
+
};
|
|
9
|
+
function tokenFindings(issues, hooks) {
|
|
10
|
+
const out = [];
|
|
11
|
+
for (const issue of issues) {
|
|
12
|
+
const node = issue.node;
|
|
13
|
+
if (!node || node.nodeType !== 1) continue;
|
|
14
|
+
const r = node.getBoundingClientRect();
|
|
15
|
+
out.push(
|
|
16
|
+
makeFinding({
|
|
17
|
+
detector: "tokens",
|
|
18
|
+
rule: RULE_BY_CATEGORY[issue.category] ?? "tokens.purity",
|
|
19
|
+
severity: issue.severity,
|
|
20
|
+
message: "Style bypasses the design tokens.",
|
|
21
|
+
evidence: { measured: issue.detail, expected: "a semantic token", category: issue.category },
|
|
22
|
+
fixHint: "Use the semantic token (bg-surface, text-fg, border-hairline, shadow-card, rounded-[var(--radius-panel)]).",
|
|
23
|
+
selector: hooks.selectorOf(node),
|
|
24
|
+
context: hooks.contextOf(node),
|
|
25
|
+
rect: { x: r.x, y: r.y, w: r.width, h: r.height, scrollX: hooks.scroll.x, scrollY: hooks.scroll.y },
|
|
26
|
+
text: (node.textContent ?? "").trim().slice(0, 40)
|
|
27
|
+
})
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
return out;
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
tokenFindings
|
|
34
|
+
};
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
const OVERLAY_PRESET_STYLES = {
|
|
2
|
+
"gradient-bottom": { background: "linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.8) 100%)" },
|
|
3
|
+
"gradient-top": { background: "linear-gradient(to top, rgba(0,0,0,0) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.8) 100%)" },
|
|
4
|
+
"gradient-radial": { background: "radial-gradient(circle at center, rgba(0,0,0,0) 0%, rgba(0,0,0,0.4) 60%, rgba(0,0,0,0.85) 100%)" },
|
|
5
|
+
"vignette": { background: "radial-gradient(circle at center, rgba(0,0,0,0) 40%, rgba(0,0,0,0.85) 100%)" },
|
|
6
|
+
"scrim": { background: "linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0.85) 100%)" },
|
|
7
|
+
"dark-20": { backgroundColor: "rgba(0,0,0,0.2)" },
|
|
8
|
+
"dark-30": { backgroundColor: "rgba(0,0,0,0.3)" },
|
|
9
|
+
"dark-50": { backgroundColor: "rgba(0,0,0,0.5)" },
|
|
10
|
+
"dark-75": { backgroundColor: "rgba(0,0,0,0.75)" },
|
|
11
|
+
"light-20": { backgroundColor: "rgba(255,255,255,0.2)" },
|
|
12
|
+
"light-30": { backgroundColor: "rgba(255,255,255,0.3)" },
|
|
13
|
+
"light-50": { backgroundColor: "rgba(255,255,255,0.5)" },
|
|
14
|
+
// Directional scrim for left-aligned copy over media (dense left, clear right).
|
|
15
|
+
"scrim-left": { background: "linear-gradient(to right, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.5) 45%, rgba(0,0,0,0) 85%)" },
|
|
16
|
+
// Dissolves media into the page canvas — theme-aware, for photos that bleed into the next section.
|
|
17
|
+
"fade-canvas": { background: "linear-gradient(to bottom, rgb(var(--bg-canvas) / 0) 35%, rgb(var(--bg-canvas) / 0.85) 80%, rgb(var(--bg-canvas)) 100%)" },
|
|
18
|
+
// Mesh backdrops. mesh-brand follows the theme brand; the others are fixed pastel palettes
|
|
19
|
+
// (Lummi-style atmosphere) that read well under both light and dark copy with a scrim.
|
|
20
|
+
"mesh-brand": { background: "radial-gradient(at 12% 18%, rgb(var(--brand) / 0.16) 0px, transparent 55%), radial-gradient(at 88% 12%, rgb(var(--brand) / 0.08) 0px, transparent 50%), radial-gradient(at 70% 92%, rgb(var(--brand) / 0.12) 0px, transparent 55%), rgb(var(--bg-canvas))" },
|
|
21
|
+
"mesh-mint": { background: "radial-gradient(at 10% 10%, rgba(167,243,208,0.7) 0px, transparent 55%), radial-gradient(at 90% 20%, rgba(186,230,253,0.7) 0px, transparent 50%), radial-gradient(at 50% 90%, rgba(254,240,138,0.55) 0px, transparent 55%), rgb(248 250 252)" },
|
|
22
|
+
// Wave meshes — wide elliptical washes (no hard blobs), tuned by eye on real hero backgrounds.
|
|
23
|
+
"mesh-dawn": { background: "radial-gradient(ellipse 70% 55% at 88% 8%, hsla(13, 100%, 88%, 0.75) 0%, transparent 70%), radial-gradient(ellipse 85% 60% at 62% 40%, hsla(323, 100%, 90%, 0.7) 0%, transparent 72%), radial-gradient(ellipse 90% 65% at 30% 92%, hsla(268, 100%, 90%, 0.75) 0%, transparent 70%), radial-gradient(ellipse 60% 50% at 5% 20%, hsla(190, 90%, 92%, 0.6) 0%, transparent 70%), rgb(253 251 255)" },
|
|
24
|
+
"mesh-night": { background: "radial-gradient(ellipse 80% 60% at 15% 85%, hsla(257, 91%, 30%, 0.55) 0%, transparent 70%), radial-gradient(ellipse 70% 55% at 85% 15%, hsla(227, 98%, 55%, 0.45) 0%, transparent 70%), radial-gradient(ellipse 60% 50% at 100% 60%, hsla(166, 71%, 60%, 0.18) 0%, transparent 70%), radial-gradient(ellipse 90% 70% at 40% 105%, hsla(212, 100%, 50%, 0.3) 0%, transparent 70%), rgb(6 7 14)" },
|
|
25
|
+
"mesh-lime": { background: "radial-gradient(ellipse 75% 55% at 18% 0%, hsla(82, 85%, 55%, 0.22) 0%, transparent 70%), radial-gradient(ellipse 70% 60% at 92% 30%, hsla(165, 70%, 45%, 0.2) 0%, transparent 70%), radial-gradient(ellipse 95% 65% at 50% 110%, hsla(140, 60%, 30%, 0.35) 0%, transparent 72%), radial-gradient(ellipse 50% 40% at 70% 70%, hsla(82, 85%, 60%, 0.08) 0%, transparent 70%), rgb(8 10 9)" },
|
|
26
|
+
// Ported 1:1 from the Shavin website's rose gradients.
|
|
27
|
+
"mesh-rose": { background: "radial-gradient(circle at 93% 93%, hsla(0, 0%, 0%, 1) 14.5%, transparent 72%), radial-gradient(circle at 26% 9%, hsla(0, 0%, 0%, 1) 0%, transparent 45%), radial-gradient(circle at 15% 79%, hsla(325, 80%, 65%, 0.16) 3%, transparent 35%), radial-gradient(circle at 40% 104%, hsla(14, 85%, 65%, 0.14) 4%, transparent 50%), radial-gradient(circle at 0% 60%, hsla(268, 75%, 68%, 0.16) 2%, transparent 38%), radial-gradient(circle at 92% 37%, hsla(330, 70%, 55%, 0.12) 3%, transparent 35%), radial-gradient(circle at 101% 16%, hsla(18, 90%, 68%, 0.10) 13%, transparent 40%), radial-gradient(circle at 90% 13%, hsla(280, 80%, 68%, 0.14) 1%, transparent 35%), radial-gradient(circle at 104% 56%, hsla(340, 85%, 68%, 0.12) 4%, transparent 25%), radial-gradient(circle at 97% 19%, hsla(260, 65%, 50%, 0.10) 18%, transparent 35%), hsla(0, 0%, 0%, 1)" },
|
|
28
|
+
"mesh-rose-vibrant": { background: "radial-gradient(circle at 93% 93%, hsla(320, 0%, 0%, 1) 14.5%, transparent 72%), radial-gradient(circle at 26% 9%, hsla(320, 0%, 0%, 1) 0%, transparent 45%), radial-gradient(circle at 15% 79%, hsla(323, 90%, 36%, 0.45) 3%, transparent 35%), radial-gradient(circle at 40% 104%, hsla(13, 95%, 52%, 0.42) 4%, transparent 50%), radial-gradient(circle at 0% 60%, hsla(268, 75%, 38%, 0.65) 2%, transparent 38%), radial-gradient(circle at 92% 37%, hsla(335, 78%, 28%, 0.75) 3%, transparent 35%), radial-gradient(circle at 101% 16%, hsla(18, 92%, 58%, 0.28) 13%, transparent 40%), radial-gradient(circle at 90% 13%, hsla(285, 88%, 52%, 0.55) 1%, transparent 35%), radial-gradient(circle at 104% 56%, hsla(340, 85%, 58%, 0.38) 4%, transparent 25%), radial-gradient(circle at 97% 19%, hsla(260, 70%, 25%, 0.35) 18%, transparent 35%), hsla(320, 10%, 2%, 1)" },
|
|
29
|
+
"mesh-peach": { background: "radial-gradient(at 15% 20%, rgba(254,205,211,0.8) 0px, transparent 55%), radial-gradient(at 85% 15%, rgba(253,230,138,0.6) 0px, transparent 50%), radial-gradient(at 60% 95%, rgba(221,214,254,0.75) 0px, transparent 55%), rgb(255 251 245)" }
|
|
30
|
+
};
|
|
31
|
+
const ANIMATABLE_PRESET_PREFIX = "mesh-";
|
|
32
|
+
const ANIMATED_SUFFIX = "-animated";
|
|
33
|
+
const OVERLAY_PRESET_KEYS = Object.keys(OVERLAY_PRESET_STYLES);
|
|
34
|
+
const FX_TOKEN_RE = /^fx:([A-Za-z0-9][\w-]*)(?:\s*\(([\s\S]*)\))?$/;
|
|
35
|
+
const FX_BARE_VALUE_RE = /^[\w.#%+-]+$/;
|
|
36
|
+
function parseFxParams(raw) {
|
|
37
|
+
const out = {};
|
|
38
|
+
let i = 0;
|
|
39
|
+
const n = raw.length;
|
|
40
|
+
while (i < n) {
|
|
41
|
+
while (i < n && /[\s,]/.test(raw[i])) i++;
|
|
42
|
+
if (i >= n) break;
|
|
43
|
+
const keyMatch = /^[A-Za-z_][\w-]*/.exec(raw.slice(i));
|
|
44
|
+
if (!keyMatch) return null;
|
|
45
|
+
const key = keyMatch[0];
|
|
46
|
+
i += key.length;
|
|
47
|
+
if (raw[i] !== "=") return null;
|
|
48
|
+
i++;
|
|
49
|
+
let value = "";
|
|
50
|
+
if (raw[i] === "'") {
|
|
51
|
+
i++;
|
|
52
|
+
while (i < n && raw[i] !== "'") {
|
|
53
|
+
if (raw[i] === "\\" && i + 1 < n) i++;
|
|
54
|
+
value += raw[i++];
|
|
55
|
+
}
|
|
56
|
+
if (raw[i] !== "'") return null;
|
|
57
|
+
i++;
|
|
58
|
+
} else {
|
|
59
|
+
while (i < n && !/[\s,]/.test(raw[i])) value += raw[i++];
|
|
60
|
+
}
|
|
61
|
+
out[key] = value;
|
|
62
|
+
}
|
|
63
|
+
return out;
|
|
64
|
+
}
|
|
65
|
+
function printFxParamValue(v) {
|
|
66
|
+
return FX_BARE_VALUE_RE.test(v) ? v : `'${v.replace(/\\/g, "\\\\").replace(/'/g, "\\'")}'`;
|
|
67
|
+
}
|
|
68
|
+
function parseShorthandToken(token, index) {
|
|
69
|
+
const { core, opacity } = splitTrailingOpacity(token);
|
|
70
|
+
const id = `overlay-${index + 1}`;
|
|
71
|
+
const fxMatch = core.match(FX_TOKEN_RE);
|
|
72
|
+
if (fxMatch) {
|
|
73
|
+
const fxParams = fxMatch[2] !== void 0 ? parseFxParams(fxMatch[2]) : {};
|
|
74
|
+
if (!fxParams) return null;
|
|
75
|
+
return {
|
|
76
|
+
id,
|
|
77
|
+
type: "fx",
|
|
78
|
+
fxKey: fxMatch[1],
|
|
79
|
+
...Object.keys(fxParams).length ? { fxParams } : {},
|
|
80
|
+
opacity,
|
|
81
|
+
visible: true
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
if (core in OVERLAY_PRESET_STYLES) {
|
|
85
|
+
return { id, type: "preset", presetKey: core, opacity, visible: true };
|
|
86
|
+
}
|
|
87
|
+
if (core.endsWith(ANIMATED_SUFFIX)) {
|
|
88
|
+
const base = core.slice(0, -ANIMATED_SUFFIX.length);
|
|
89
|
+
if (base in OVERLAY_PRESET_STYLES && base.startsWith(ANIMATABLE_PRESET_PREFIX)) {
|
|
90
|
+
return { id, type: "preset", presetKey: base, animated: true, opacity, visible: true };
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (/^#[0-9a-fA-F]{3,8}$/.test(core)) {
|
|
94
|
+
return { id, type: "solid", color: core, opacity, visible: true };
|
|
95
|
+
}
|
|
96
|
+
const tokenMatch = core.match(/^\((.+)\)$/);
|
|
97
|
+
if (tokenMatch) {
|
|
98
|
+
return { id, type: "solid", token: tokenMatch[1].trim(), opacity, visible: true };
|
|
99
|
+
}
|
|
100
|
+
const gradMatch = core.match(/^(linear|radial)\s*\(([\s\S]*)\)$/i);
|
|
101
|
+
if (gradMatch) {
|
|
102
|
+
const gradType = gradMatch[1].toLowerCase();
|
|
103
|
+
const inner = gradMatch[2].trim();
|
|
104
|
+
let angle;
|
|
105
|
+
let position;
|
|
106
|
+
let stopsStr = inner;
|
|
107
|
+
if (gradType === "radial") {
|
|
108
|
+
const posMatch = inner.match(/^at\s+([^,]+?)\s*,\s*([\s\S]*)$/);
|
|
109
|
+
if (posMatch) {
|
|
110
|
+
position = posMatch[1].trim();
|
|
111
|
+
stopsStr = posMatch[2];
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (gradType === "linear") {
|
|
115
|
+
const angleMatch = inner.match(/^(\d+)deg\s*,\s*([\s\S]*)$/);
|
|
116
|
+
if (angleMatch) {
|
|
117
|
+
angle = parseInt(angleMatch[1], 10);
|
|
118
|
+
stopsStr = angleMatch[2];
|
|
119
|
+
} else {
|
|
120
|
+
angle = 180;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
const stops = parseGradientStops(stopsStr);
|
|
124
|
+
if (stops.length >= 2) {
|
|
125
|
+
return {
|
|
126
|
+
id,
|
|
127
|
+
type: gradType,
|
|
128
|
+
angle,
|
|
129
|
+
position,
|
|
130
|
+
stops,
|
|
131
|
+
opacity,
|
|
132
|
+
visible: true
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
function splitTrailingOpacity(token) {
|
|
139
|
+
let depth = 0;
|
|
140
|
+
let slashIdx = -1;
|
|
141
|
+
let quoted = false;
|
|
142
|
+
for (let i = token.length - 1; i >= 0; i--) {
|
|
143
|
+
const ch = token[i];
|
|
144
|
+
if (ch === "'" && token[i - 1] !== "\\") {
|
|
145
|
+
quoted = !quoted;
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
if (quoted) continue;
|
|
149
|
+
if (ch === ")") depth++;
|
|
150
|
+
else if (ch === "(") depth--;
|
|
151
|
+
else if (ch === "/" && depth === 0) {
|
|
152
|
+
slashIdx = i;
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
if (slashIdx > 0) {
|
|
157
|
+
const core = token.slice(0, slashIdx).trim();
|
|
158
|
+
const opStr = token.slice(slashIdx + 1).trim();
|
|
159
|
+
const opVal = parseInt(opStr, 10);
|
|
160
|
+
if (!isNaN(opVal)) {
|
|
161
|
+
return { core, opacity: Math.max(0, Math.min(100, opVal)) };
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return { core: token.trim(), opacity: 100 };
|
|
165
|
+
}
|
|
166
|
+
function parseGradientStops(stopsStr) {
|
|
167
|
+
const stops = [];
|
|
168
|
+
const parts = splitByCommaRespectingParens(stopsStr);
|
|
169
|
+
for (const part of parts) {
|
|
170
|
+
const trimmed = part.trim();
|
|
171
|
+
if (!trimmed) continue;
|
|
172
|
+
const segs = trimmed.split("/").map((s) => s.trim());
|
|
173
|
+
if (segs.length < 2 || segs.length > 3) continue;
|
|
174
|
+
const [colorPart, offsetStr, stopOpStr] = segs;
|
|
175
|
+
const offsetMatch = offsetStr.match(/^(\d+(?:\.\d+)?)%?$/);
|
|
176
|
+
if (!offsetMatch) continue;
|
|
177
|
+
const offset = parseFloat(offsetMatch[1]);
|
|
178
|
+
let opacity = 100;
|
|
179
|
+
if (stopOpStr !== void 0) {
|
|
180
|
+
const opMatch = stopOpStr.match(/^(\d+(?:\.\d+)?)$/);
|
|
181
|
+
if (!opMatch) continue;
|
|
182
|
+
opacity = Math.max(0, Math.min(100, parseFloat(opMatch[1])));
|
|
183
|
+
}
|
|
184
|
+
const tokenMatch = colorPart.match(/^\((.+)\)$/);
|
|
185
|
+
if (tokenMatch) {
|
|
186
|
+
stops.push({ color: "", token: tokenMatch[1].trim(), offset, opacity });
|
|
187
|
+
} else if (/^#[0-9a-fA-F]{3,8}$/.test(colorPart)) {
|
|
188
|
+
stops.push({ color: colorPart, offset, opacity });
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return stops;
|
|
192
|
+
}
|
|
193
|
+
function splitByCommaRespectingParens(str) {
|
|
194
|
+
const parts = [];
|
|
195
|
+
let depth = 0;
|
|
196
|
+
let current = "";
|
|
197
|
+
let quoted = false;
|
|
198
|
+
for (let i = 0; i < str.length; i++) {
|
|
199
|
+
const ch = str[i];
|
|
200
|
+
if (quoted) {
|
|
201
|
+
current += ch;
|
|
202
|
+
if (ch === "\\" && i + 1 < str.length) current += str[++i];
|
|
203
|
+
else if (ch === "'") quoted = false;
|
|
204
|
+
continue;
|
|
205
|
+
}
|
|
206
|
+
if (ch === "'") quoted = true;
|
|
207
|
+
else if (ch === "(") depth++;
|
|
208
|
+
else if (ch === ")") depth--;
|
|
209
|
+
if (ch === "," && depth === 0) {
|
|
210
|
+
parts.push(current);
|
|
211
|
+
current = "";
|
|
212
|
+
} else {
|
|
213
|
+
current += ch;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
if (current.trim()) parts.push(current);
|
|
217
|
+
return parts;
|
|
218
|
+
}
|
|
219
|
+
function parseOverlayShorthand(raw) {
|
|
220
|
+
const tokens = splitByCommaRespectingParens(raw);
|
|
221
|
+
if (tokens.length === 0) return [];
|
|
222
|
+
const layers = [];
|
|
223
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
224
|
+
const token = tokens[i].trim();
|
|
225
|
+
if (!token) continue;
|
|
226
|
+
const layer = parseShorthandToken(token, i);
|
|
227
|
+
if (!layer) return [];
|
|
228
|
+
layers.push(layer);
|
|
229
|
+
}
|
|
230
|
+
return layers;
|
|
231
|
+
}
|
|
232
|
+
function overlayLayersToShorthand(layers) {
|
|
233
|
+
if (layers.length === 0) return null;
|
|
234
|
+
const parts = [];
|
|
235
|
+
for (const layer of layers) {
|
|
236
|
+
if (layer.visible === false) return null;
|
|
237
|
+
const op = layer.opacity ?? 100;
|
|
238
|
+
const opSuffix = op === 100 ? "" : `/${op}`;
|
|
239
|
+
if (layer.type === "preset") {
|
|
240
|
+
if (!layer.presetKey || !(layer.presetKey in OVERLAY_PRESET_STYLES)) return null;
|
|
241
|
+
parts.push(`${layer.presetKey}${layer.animated ? ANIMATED_SUFFIX : ""}${opSuffix}`);
|
|
242
|
+
} else if (layer.type === "solid") {
|
|
243
|
+
if (layer.token) {
|
|
244
|
+
parts.push(`(${layer.token})${opSuffix}`);
|
|
245
|
+
} else if (layer.color) {
|
|
246
|
+
parts.push(`${layer.color}${opSuffix}`);
|
|
247
|
+
} else {
|
|
248
|
+
return null;
|
|
249
|
+
}
|
|
250
|
+
} else if (layer.type === "linear" || layer.type === "radial") {
|
|
251
|
+
if (!layer.stops || layer.stops.length < 2) return null;
|
|
252
|
+
const stopStr = layer.stops.map((s) => {
|
|
253
|
+
const c = s.token ? `(${s.token})` : s.color;
|
|
254
|
+
const stopOp = s.opacity !== void 0 && s.opacity !== 100 ? `/${s.opacity}` : "";
|
|
255
|
+
return `${c}/${s.offset}%${stopOp}`;
|
|
256
|
+
}).join(", ");
|
|
257
|
+
if (layer.type === "linear") {
|
|
258
|
+
const angle = layer.angle ?? 180;
|
|
259
|
+
parts.push(`linear(${angle}deg, ${stopStr})${opSuffix}`);
|
|
260
|
+
} else {
|
|
261
|
+
const at = layer.position && layer.position !== "center" ? `at ${layer.position}, ` : "";
|
|
262
|
+
parts.push(`radial(${at}${stopStr})${opSuffix}`);
|
|
263
|
+
}
|
|
264
|
+
} else if (layer.type === "fx") {
|
|
265
|
+
if (!layer.fxKey || !/^[A-Za-z0-9][\w-]*$/.test(layer.fxKey)) return null;
|
|
266
|
+
const params = Object.entries(layer.fxParams ?? {}).filter(
|
|
267
|
+
([k, v]) => v !== "" && v != null && /^[A-Za-z_][\w-]*$/.test(k)
|
|
268
|
+
);
|
|
269
|
+
const paramStr = params.length ? `(${params.map(([k, v]) => `${k}=${printFxParamValue(String(v))}`).join(" ")})` : "";
|
|
270
|
+
parts.push(`fx:${layer.fxKey}${paramStr}${opSuffix}`);
|
|
271
|
+
} else {
|
|
272
|
+
return null;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
return parts.join(", ");
|
|
276
|
+
}
|
|
277
|
+
export {
|
|
278
|
+
ANIMATABLE_PRESET_PREFIX,
|
|
279
|
+
ANIMATED_SUFFIX,
|
|
280
|
+
OVERLAY_PRESET_KEYS,
|
|
281
|
+
OVERLAY_PRESET_STYLES,
|
|
282
|
+
overlayLayersToShorthand,
|
|
283
|
+
parseOverlayShorthand
|
|
284
|
+
};
|