@once-ui-system/core 1.8.4 → 2.0.0-alpha.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/ai/catalog.json +166 -78
- package/ai/components/Accordion.json +1 -1
- package/ai/components/BarChart.json +34 -3
- package/ai/components/Book.json +128 -0
- package/ai/components/Button.json +1 -1
- package/ai/components/Card.json +1 -0
- package/ai/components/Carousel.json +1 -1
- package/ai/components/ChartHeader.json +2 -1
- package/ai/components/ChartStatus.json +2 -1
- package/ai/components/Checkbox.json +2 -2
- package/ai/components/CodeBlock.json +23 -2
- package/ai/components/ColorInput.json +1 -1
- package/ai/components/DataTooltip.json +3 -2
- package/ai/components/DatePicker.json +2 -2
- package/ai/components/Dialog.json +1 -1
- package/ai/components/DropdownWrapper.json +6 -4
- package/ai/components/Effect.json +133 -0
- package/ai/components/Fade.json +1 -1
- package/ai/components/Feedback.json +1 -1
- package/ai/components/IconButton.json +1 -1
- package/ai/components/InfoTip.json +125 -0
- package/ai/components/Input.json +5 -4
- package/ai/components/Legend.json +2 -1
- package/ai/components/LineBarChart.json +34 -3
- package/ai/components/LineChart.json +39 -3
- package/ai/components/LinearGauge.json +3 -2
- package/ai/components/LinearGradient.json +2 -1
- package/ai/components/Logo.json +2 -2
- package/ai/components/Media.json +1 -1
- package/ai/components/MediaUpload.json +21 -2
- package/ai/components/Modal.json +1 -1
- package/ai/components/NavGroup.json +130 -0
- package/ai/components/NavIcon.json +1 -1
- package/ai/components/NavItem.json +14 -0
- package/ai/components/Option.json +2 -2
- package/ai/components/Particle.json +1 -1
- package/ai/components/PieChart.json +32 -3
- package/ai/components/ProgressBar.json +1 -1
- package/ai/components/Pulse.json +1 -1
- package/ai/components/RadialGauge.json +4 -3
- package/ai/components/RadialGradient.json +2 -1
- package/ai/components/RadioButton.json +1 -1
- package/ai/components/RevealFx.json +1 -1
- package/ai/components/Scrubber.json +136 -0
- package/ai/components/SegmentedControl.json +3 -3
- package/ai/components/Setting.json +128 -0
- package/ai/components/SettingAxes.json +127 -0
- package/ai/components/SettingGroup.json +129 -0
- package/ai/components/ShineFx.json +1 -1
- package/ai/components/Skeleton.json +2 -3
- package/ai/components/SplitView.json +2 -0
- package/ai/components/StylePanel.json +4 -2
- package/ai/components/Swatch.json +11 -0
- package/ai/components/Swiper.json +1 -1
- package/ai/components/Switch.json +1 -1
- package/ai/components/Tag.json +1 -1
- package/ai/components/Textarea.json +6 -5
- package/ai/components/ThemeSwitcher.json +3 -0
- package/ai/components/Toast.json +1 -1
- package/ai/components/ToggleButton.json +2 -1
- package/ai/eval-tasks.md +8 -0
- package/ai/examples/app-shell.tsx +111 -0
- package/ai/examples/auth.tsx +1 -1
- package/ai/examples/blocks/Dashboard1.tsx +17 -28
- package/ai/examples/blocks/Feed3.tsx +4 -4
- package/ai/examples/blocks/Footer1.tsx +5 -3
- package/ai/examples/blocks/Footer2.tsx +3 -3
- package/ai/examples/blocks/Footer3.tsx +1 -1
- package/ai/examples/blocks/Footer4.tsx +6 -5
- package/ai/examples/blocks/Header1.tsx +7 -6
- package/ai/examples/blocks/Header3.tsx +7 -7
- package/ai/examples/blocks/Header4.tsx +5 -5
- package/ai/examples/blocks/Sidebar4.tsx +1 -1
- package/ai/examples/blocks/Streaming1.tsx +4 -4
- package/ai/examples/blocks/Table1.tsx +6 -6
- package/ai/examples/blocks/Waitlist1.tsx +5 -5
- package/ai/examples/blocks/content/resources.ts +3 -1
- package/ai/examples/dashboard.tsx +8 -9
- package/ai/examples/marketing-hero.tsx +2 -2
- package/ai/examples/pricing.tsx +4 -5
- package/ai/examples/settings.tsx +3 -3
- package/ai/gotchas.json +80 -23
- package/ai/layouts.md +154 -0
- package/ai/manifest.json +3 -2
- package/ai/recipes.md +49 -4
- package/ai/rules.compact.md +18 -3
- package/ai/rules.md +68 -10
- package/ai/spec.json +634 -176
- package/dist/ai/catalog.json +166 -78
- package/dist/ai/components/Accordion.json +1 -1
- package/dist/ai/components/BarChart.json +34 -3
- package/dist/ai/components/Book.json +128 -0
- package/dist/ai/components/Button.json +1 -1
- package/dist/ai/components/Card.json +1 -0
- package/dist/ai/components/Carousel.json +1 -1
- package/dist/ai/components/ChartHeader.json +2 -1
- package/dist/ai/components/ChartStatus.json +2 -1
- package/dist/ai/components/Checkbox.json +2 -2
- package/dist/ai/components/CodeBlock.json +23 -2
- package/dist/ai/components/ColorInput.json +1 -1
- package/dist/ai/components/DataTooltip.json +3 -2
- package/dist/ai/components/DatePicker.json +2 -2
- package/dist/ai/components/Dialog.json +1 -1
- package/dist/ai/components/DropdownWrapper.json +6 -4
- package/dist/ai/components/Effect.json +133 -0
- package/dist/ai/components/Fade.json +1 -1
- package/dist/ai/components/Feedback.json +1 -1
- package/dist/ai/components/IconButton.json +1 -1
- package/dist/ai/components/InfoTip.json +125 -0
- package/dist/ai/components/Input.json +5 -4
- package/dist/ai/components/Legend.json +2 -1
- package/dist/ai/components/LineBarChart.json +34 -3
- package/dist/ai/components/LineChart.json +39 -3
- package/dist/ai/components/LinearGauge.json +3 -2
- package/dist/ai/components/LinearGradient.json +2 -1
- package/dist/ai/components/Logo.json +2 -2
- package/dist/ai/components/Media.json +1 -1
- package/dist/ai/components/MediaUpload.json +21 -2
- package/dist/ai/components/Modal.json +1 -1
- package/dist/ai/components/NavGroup.json +130 -0
- package/dist/ai/components/NavIcon.json +1 -1
- package/dist/ai/components/NavItem.json +14 -0
- package/dist/ai/components/Option.json +2 -2
- package/dist/ai/components/Particle.json +1 -1
- package/dist/ai/components/PieChart.json +32 -3
- package/dist/ai/components/ProgressBar.json +1 -1
- package/dist/ai/components/Pulse.json +1 -1
- package/dist/ai/components/RadialGauge.json +4 -3
- package/dist/ai/components/RadialGradient.json +2 -1
- package/dist/ai/components/RadioButton.json +1 -1
- package/dist/ai/components/RevealFx.json +1 -1
- package/dist/ai/components/Scrubber.json +136 -0
- package/dist/ai/components/SegmentedControl.json +3 -3
- package/dist/ai/components/Setting.json +128 -0
- package/dist/ai/components/SettingAxes.json +127 -0
- package/dist/ai/components/SettingGroup.json +129 -0
- package/dist/ai/components/ShineFx.json +1 -1
- package/dist/ai/components/Skeleton.json +2 -3
- package/dist/ai/components/SplitView.json +2 -0
- package/dist/ai/components/StylePanel.json +4 -2
- package/dist/ai/components/Swatch.json +11 -0
- package/dist/ai/components/Swiper.json +1 -1
- package/dist/ai/components/Switch.json +1 -1
- package/dist/ai/components/Tag.json +1 -1
- package/dist/ai/components/Textarea.json +6 -5
- package/dist/ai/components/ThemeSwitcher.json +3 -0
- package/dist/ai/components/Toast.json +1 -1
- package/dist/ai/components/ToggleButton.json +2 -1
- package/dist/ai/eval-tasks.md +8 -0
- package/dist/ai/gotchas.json +80 -23
- package/dist/ai/layouts.md +154 -0
- package/dist/ai/manifest.json +3 -2
- package/dist/ai/recipes.md +49 -4
- package/dist/ai/rules.compact.md +18 -3
- package/dist/ai/rules.md +68 -10
- package/dist/ai/spec.json +634 -176
- package/dist/components/Accordion.d.ts +2 -1
- package/dist/components/Accordion.d.ts.map +1 -1
- package/dist/components/Accordion.js.map +1 -1
- package/dist/components/Avatar.js +1 -1
- package/dist/components/Avatar.js.map +1 -1
- package/dist/components/Background.d.ts +6 -6
- package/dist/components/Background.d.ts.map +1 -1
- package/dist/components/Book.d.ts +28 -0
- package/dist/components/Book.d.ts.map +1 -0
- package/dist/components/Book.js +24 -0
- package/dist/components/Book.js.map +1 -0
- package/dist/components/Book.module.scss +45 -0
- package/dist/components/Button.d.ts +1 -1
- package/dist/components/Button.d.ts.map +1 -1
- package/dist/components/Button.js +4 -4
- package/dist/components/Button.js.map +1 -1
- package/dist/components/Card.d.ts +8 -0
- package/dist/components/Card.d.ts.map +1 -1
- package/dist/components/Card.js +10 -2
- package/dist/components/Card.js.map +1 -1
- package/dist/components/Card.module.scss +11 -1
- package/dist/components/Carousel.d.ts +7 -1
- package/dist/components/Carousel.d.ts.map +1 -1
- package/dist/components/Carousel.js +7 -7
- package/dist/components/Carousel.js.map +1 -1
- package/dist/components/Carousel.module.scss +1 -8
- package/dist/components/Checkbox.d.ts +3 -3
- package/dist/components/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox.js +5 -5
- package/dist/components/Checkbox.js.map +1 -1
- package/dist/components/ClientFlex.d.ts.map +1 -1
- package/dist/components/ClientFlex.js +5 -10
- package/dist/components/ClientFlex.js.map +1 -1
- package/dist/components/ClientGrid.d.ts.map +1 -1
- package/dist/components/ClientGrid.js +2 -7
- package/dist/components/ClientGrid.js.map +1 -1
- package/dist/components/ColorInput.d.ts +1 -1
- package/dist/components/ColorInput.d.ts.map +1 -1
- package/dist/components/ColorInput.js +7 -13
- package/dist/components/ColorInput.js.map +1 -1
- package/dist/components/CompareImage.d.ts.map +1 -1
- package/dist/components/CompareImage.js +2 -2
- package/dist/components/CompareImage.js.map +1 -1
- package/dist/components/DateInput.d.ts.map +1 -1
- package/dist/components/DateInput.js +10 -1
- package/dist/components/DateInput.js.map +1 -1
- package/dist/components/DatePicker.d.ts +2 -2
- package/dist/components/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker.js +21 -14
- package/dist/components/DatePicker.js.map +1 -1
- package/dist/components/DateRangeInput.js +3 -3
- package/dist/components/DateRangeInput.js.map +1 -1
- package/dist/components/Dialog.d.ts +1 -1
- package/dist/components/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog.js +14 -14
- package/dist/components/Dialog.js.map +1 -1
- package/dist/components/DropdownWrapper.d.ts +8 -3
- package/dist/components/DropdownWrapper.d.ts.map +1 -1
- package/dist/components/DropdownWrapper.js +17 -6
- package/dist/components/DropdownWrapper.js.map +1 -1
- package/dist/components/Effect.d.ts +41 -0
- package/dist/components/Effect.d.ts.map +1 -0
- package/dist/components/Effect.js +30 -0
- package/dist/components/Effect.js.map +1 -0
- package/dist/components/ElementType.d.ts +2 -1
- package/dist/components/ElementType.d.ts.map +1 -1
- package/dist/components/ElementType.js +4 -2
- package/dist/components/ElementType.js.map +1 -1
- package/dist/components/EmojiPicker.d.ts.map +1 -1
- package/dist/components/EmojiPicker.js +1 -1
- package/dist/components/EmojiPicker.js.map +1 -1
- package/dist/components/Feedback.d.ts +1 -1
- package/dist/components/Feedback.d.ts.map +1 -1
- package/dist/components/Feedback.js +2 -2
- package/dist/components/Feedback.js.map +1 -1
- package/dist/components/Flex.d.ts.map +1 -1
- package/dist/components/Flex.js +46 -5
- package/dist/components/Flex.js.map +1 -1
- package/dist/components/Icon.d.ts.map +1 -1
- package/dist/components/Icon.js.map +1 -1
- package/dist/components/IconButton.d.ts +1 -1
- package/dist/components/IconButton.d.ts.map +1 -1
- package/dist/components/IconButton.js +4 -4
- package/dist/components/IconButton.js.map +1 -1
- package/dist/components/InfoTip.d.ts +17 -0
- package/dist/components/InfoTip.d.ts.map +1 -0
- package/dist/components/InfoTip.js +12 -0
- package/dist/components/InfoTip.js.map +1 -0
- package/dist/components/Input.d.ts +11 -5
- package/dist/components/Input.d.ts.map +1 -1
- package/dist/components/Input.js +32 -16
- package/dist/components/Input.js.map +1 -1
- package/dist/components/Input.module.scss +313 -1
- package/dist/components/InteractiveDetails.d.ts.map +1 -1
- package/dist/components/InteractiveDetails.js +1 -1
- package/dist/components/InteractiveDetails.js.map +1 -1
- package/dist/components/Kbd.d.ts.map +1 -1
- package/dist/components/Kbd.js +4 -1
- package/dist/components/Kbd.js.map +1 -1
- package/dist/components/Logo.d.ts +16 -4
- package/dist/components/Logo.d.ts.map +1 -1
- package/dist/components/Logo.js +32 -14
- package/dist/components/Logo.js.map +1 -1
- package/dist/components/Media.d.ts +9 -2
- package/dist/components/Media.d.ts.map +1 -1
- package/dist/components/Media.js +25 -16
- package/dist/components/Media.js.map +1 -1
- package/dist/components/MediaAudioPlayer.d.ts +29 -0
- package/dist/components/MediaAudioPlayer.d.ts.map +1 -0
- package/dist/components/MediaAudioPlayer.js +115 -0
- package/dist/components/MediaAudioPlayer.js.map +1 -0
- package/dist/components/MediaAudioPlayer.module.scss +38 -0
- package/dist/components/Modal.d.ts +1 -1
- package/dist/components/Modal.d.ts.map +1 -1
- package/dist/components/Modal.js +10 -10
- package/dist/components/Modal.js.map +1 -1
- package/dist/components/NavGroup.d.ts +33 -0
- package/dist/components/NavGroup.d.ts.map +1 -0
- package/dist/components/NavGroup.js +27 -0
- package/dist/components/NavGroup.js.map +1 -0
- package/dist/components/NavIcon.d.ts +1 -1
- package/dist/components/NavIcon.d.ts.map +1 -1
- package/dist/components/NavIcon.js +2 -2
- package/dist/components/NavIcon.js.map +1 -1
- package/dist/components/NavItem.d.ts +24 -0
- package/dist/components/NavItem.d.ts.map +1 -0
- package/dist/components/NavItem.js +18 -0
- package/dist/components/NavItem.js.map +1 -0
- package/dist/components/NumberInput.js +1 -1
- package/dist/components/NumberInput.js.map +1 -1
- package/dist/components/OgCard.js +3 -3
- package/dist/components/OgCard.js.map +1 -1
- package/dist/components/Option.d.ts +3 -3
- package/dist/components/Option.d.ts.map +1 -1
- package/dist/components/Option.js +2 -2
- package/dist/components/Option.js.map +1 -1
- package/dist/components/Particle.d.ts +2 -2
- package/dist/components/Particle.d.ts.map +1 -1
- package/dist/components/PasswordInput.d.ts.map +1 -1
- package/dist/components/PasswordInput.js +2 -2
- package/dist/components/PasswordInput.js.map +1 -1
- package/dist/components/ProgressBar.d.ts +1 -1
- package/dist/components/ProgressBar.d.ts.map +1 -1
- package/dist/components/ProgressBar.js +2 -2
- package/dist/components/ProgressBar.js.map +1 -1
- package/dist/components/Pulse.d.ts +1 -1
- package/dist/components/Pulse.d.ts.map +1 -1
- package/dist/components/Pulse.js +2 -2
- package/dist/components/Pulse.js.map +1 -1
- package/dist/components/RadioButton.d.ts +2 -2
- package/dist/components/RadioButton.d.ts.map +1 -1
- package/dist/components/RadioButton.js +1 -1
- package/dist/components/RadioButton.js.map +1 -1
- package/dist/components/RevealFx.d.ts +2 -1
- package/dist/components/RevealFx.d.ts.map +1 -1
- package/dist/components/RevealFx.js +8 -8
- package/dist/components/RevealFx.js.map +1 -1
- package/dist/components/ScrollContainer.d.ts.map +1 -1
- package/dist/components/ScrollContainer.js +1 -1
- package/dist/components/ScrollContainer.js.map +1 -1
- package/dist/components/Scrubber.d.ts +70 -0
- package/dist/components/Scrubber.d.ts.map +1 -0
- package/dist/components/Scrubber.js +161 -0
- package/dist/components/Scrubber.js.map +1 -0
- package/dist/components/SegmentedControl.d.ts +4 -4
- package/dist/components/SegmentedControl.d.ts.map +1 -1
- package/dist/components/SegmentedControl.js +11 -11
- package/dist/components/SegmentedControl.js.map +1 -1
- package/dist/components/Select.d.ts.map +1 -1
- package/dist/components/Select.js +48 -15
- package/dist/components/Select.js.map +1 -1
- package/dist/components/ServerFlex.d.ts +0 -1
- package/dist/components/ServerFlex.d.ts.map +1 -1
- package/dist/components/ServerFlex.js +99 -52
- package/dist/components/ServerFlex.js.map +1 -1
- package/dist/components/ServerGrid.d.ts +0 -1
- package/dist/components/ServerGrid.d.ts.map +1 -1
- package/dist/components/ServerGrid.js +11 -9
- package/dist/components/ServerGrid.js.map +1 -1
- package/dist/components/Setting.d.ts +50 -0
- package/dist/components/Setting.d.ts.map +1 -0
- package/dist/components/Setting.js +43 -0
- package/dist/components/Setting.js.map +1 -0
- package/dist/components/ShineFx.d.ts +1 -0
- package/dist/components/ShineFx.d.ts.map +1 -1
- package/dist/components/ShineFx.js +2 -2
- package/dist/components/ShineFx.js.map +1 -1
- package/dist/components/Skeleton.d.ts +16 -3
- package/dist/components/Skeleton.d.ts.map +1 -1
- package/dist/components/Skeleton.js +2 -2
- package/dist/components/Skeleton.js.map +1 -1
- package/dist/components/Skeleton.module.scss +14 -51
- package/dist/components/SplitView.d.ts +23 -3
- package/dist/components/SplitView.d.ts.map +1 -1
- package/dist/components/SplitView.js +90 -58
- package/dist/components/SplitView.js.map +1 -1
- package/dist/components/StyleOverlay.d.ts.map +1 -1
- package/dist/components/StyleOverlay.js +1 -1
- package/dist/components/StyleOverlay.js.map +1 -1
- package/dist/components/StylePanel.d.ts +47 -6
- package/dist/components/StylePanel.d.ts.map +1 -1
- package/dist/components/StylePanel.js +16 -189
- package/dist/components/StylePanel.js.map +1 -1
- package/dist/components/StylePanel.module.scss +6 -1
- package/dist/components/StylePanelSections.d.ts +117 -0
- package/dist/components/StylePanelSections.d.ts.map +1 -0
- package/dist/components/StylePanelSections.js +175 -0
- package/dist/components/StylePanelSections.js.map +1 -0
- package/dist/components/Swiper.d.ts +7 -1
- package/dist/components/Swiper.d.ts.map +1 -1
- package/dist/components/Swiper.js +7 -7
- package/dist/components/Swiper.js.map +1 -1
- package/dist/components/Switch.d.ts +2 -2
- package/dist/components/Switch.d.ts.map +1 -1
- package/dist/components/Switch.js +4 -4
- package/dist/components/Switch.js.map +1 -1
- package/dist/components/Table.d.ts.map +1 -1
- package/dist/components/Table.js +2 -2
- package/dist/components/Table.js.map +1 -1
- package/dist/components/Tag.d.ts +1 -1
- package/dist/components/Tag.d.ts.map +1 -1
- package/dist/components/Tag.js +2 -2
- package/dist/components/Tag.js.map +1 -1
- package/dist/components/Textarea.d.ts +15 -5
- package/dist/components/Textarea.d.ts.map +1 -1
- package/dist/components/Textarea.js +31 -17
- package/dist/components/Textarea.js.map +1 -1
- package/dist/components/ThemeSwitcher.d.ts +14 -1
- package/dist/components/ThemeSwitcher.d.ts.map +1 -1
- package/dist/components/ThemeSwitcher.js +19 -9
- package/dist/components/ThemeSwitcher.js.map +1 -1
- package/dist/components/ThemeSwitcher.module.scss +54 -0
- package/dist/components/Toast.d.ts +1 -1
- package/dist/components/Toast.d.ts.map +1 -1
- package/dist/components/Toast.js +2 -2
- package/dist/components/Toast.js.map +1 -1
- package/dist/components/ToggleButton.d.ts +9 -2
- package/dist/components/ToggleButton.d.ts.map +1 -1
- package/dist/components/ToggleButton.js +5 -5
- package/dist/components/ToggleButton.js.map +1 -1
- package/dist/components/User.js +1 -1
- package/dist/components/User.js.map +1 -1
- package/dist/components/index.d.ts +7 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +7 -0
- package/dist/components/index.js.map +1 -1
- package/dist/contexts/AdapterProvider.d.ts +50 -0
- package/dist/contexts/AdapterProvider.d.ts.map +1 -0
- package/dist/contexts/AdapterProvider.js +91 -0
- package/dist/contexts/AdapterProvider.js.map +1 -0
- package/dist/contexts/IconProvider.d.ts +2 -2
- package/dist/contexts/IconProvider.d.ts.map +1 -1
- package/dist/contexts/IconProvider.js +2 -2
- package/dist/contexts/IconProvider.js.map +1 -1
- package/dist/contexts/LayoutProvider.d.ts +0 -2
- package/dist/contexts/LayoutProvider.d.ts.map +1 -1
- package/dist/contexts/LayoutProvider.js +15 -10
- package/dist/contexts/LayoutProvider.js.map +1 -1
- package/dist/contexts/ThemeProvider.d.ts +29 -1
- package/dist/contexts/ThemeProvider.d.ts.map +1 -1
- package/dist/contexts/ThemeProvider.js +42 -15
- package/dist/contexts/ThemeProvider.js.map +1 -1
- package/dist/contexts/index.d.ts +3 -2
- package/dist/contexts/index.d.ts.map +1 -1
- package/dist/contexts/index.js +3 -2
- package/dist/contexts/index.js.map +1 -1
- package/dist/css/styles.css +1 -1
- package/dist/css/tokens.css +1 -1
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +0 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/icons/ATTRIBUTION.md +19 -0
- package/dist/icons/data.d.ts +1919 -0
- package/dist/icons/data.d.ts.map +1 -0
- package/dist/icons/data.js +102 -0
- package/dist/icons/data.js.map +1 -0
- package/dist/icons/renderIcon.d.ts +26 -0
- package/dist/icons/renderIcon.d.ts.map +1 -0
- package/dist/icons/renderIcon.js +22 -0
- package/dist/icons/renderIcon.js.map +1 -0
- package/dist/icons.d.ts +35 -4
- package/dist/icons.d.ts.map +1 -1
- package/dist/icons.js +13 -60
- package/dist/icons.js.map +1 -1
- package/dist/modules/code/CodeBlock.impl.d.ts +2 -1
- package/dist/modules/code/CodeBlock.impl.d.ts.map +1 -1
- package/dist/modules/code/CodeBlock.impl.js +7 -2
- package/dist/modules/code/CodeBlock.impl.js.map +1 -1
- package/dist/modules/data/ChartHeader.d.ts.map +1 -1
- package/dist/modules/data/ChartHeader.js +1 -1
- package/dist/modules/data/ChartHeader.js.map +1 -1
- package/dist/modules/data/DataTooltip.d.ts +1 -1
- package/dist/modules/data/DataTooltip.d.ts.map +1 -1
- package/dist/modules/data/DataTooltip.js +2 -2
- package/dist/modules/data/DataTooltip.js.map +1 -1
- package/dist/modules/data/LinearGauge.d.ts +3 -2
- package/dist/modules/data/LinearGauge.d.ts.map +1 -1
- package/dist/modules/data/LinearGauge.js +1 -1
- package/dist/modules/data/LinearGauge.js.map +1 -1
- package/dist/modules/data/PieChart.impl.d.ts +1 -1
- package/dist/modules/data/PieChart.impl.d.ts.map +1 -1
- package/dist/modules/data/PieChart.impl.js +4 -1
- package/dist/modules/data/PieChart.impl.js.map +1 -1
- package/dist/modules/data/RadialGauge.d.ts +3 -2
- package/dist/modules/data/RadialGauge.d.ts.map +1 -1
- package/dist/modules/data/RadialGauge.js +1 -1
- package/dist/modules/data/RadialGauge.js.map +1 -1
- package/dist/modules/data/interfaces.d.ts +12 -3
- package/dist/modules/data/interfaces.d.ts.map +1 -1
- package/dist/modules/index.d.ts +1 -4
- package/dist/modules/index.d.ts.map +1 -1
- package/dist/modules/index.js +9 -3
- package/dist/modules/index.js.map +1 -1
- package/dist/modules/media/MediaUpload.impl.d.ts +1 -1
- package/dist/modules/media/MediaUpload.impl.d.ts.map +1 -1
- package/dist/modules/media/MediaUpload.impl.js +1 -1
- package/dist/modules/media/MediaUpload.impl.js.map +1 -1
- package/dist/modules/navigation/Kbar.d.ts +5 -4
- package/dist/modules/navigation/Kbar.d.ts.map +1 -1
- package/dist/modules/navigation/Kbar.js +32 -35
- package/dist/modules/navigation/Kbar.js.map +1 -1
- package/dist/modules/navigation/MegaMenu.d.ts +5 -3
- package/dist/modules/navigation/MegaMenu.d.ts.map +1 -1
- package/dist/modules/navigation/MegaMenu.js +24 -12
- package/dist/modules/navigation/MegaMenu.js.map +1 -1
- package/dist/modules/navigation/MobileMegaMenu.d.ts +3 -2
- package/dist/modules/navigation/MobileMegaMenu.d.ts.map +1 -1
- package/dist/modules/navigation/MobileMegaMenu.js +1 -1
- package/dist/modules/navigation/MobileMegaMenu.js.map +1 -1
- package/dist/modules/seo/Meta.d.ts +40 -2
- package/dist/modules/seo/Meta.d.ts.map +1 -1
- package/dist/modules/seo/Meta.js.map +1 -1
- package/dist/modules/seo/Schema.d.ts.map +1 -1
- package/dist/modules/seo/Schema.js +1 -2
- package/dist/modules/seo/Schema.js.map +1 -1
- package/dist/next/index.d.ts +35 -0
- package/dist/next/index.d.ts.map +1 -0
- package/dist/next/index.js +56 -0
- package/dist/next/index.js.map +1 -0
- package/dist/package.json +52 -7
- package/dist/scripts/init-agent.js +0 -0
- package/dist/scripts/validate-ai-code.js +74 -10
- package/dist/server/og-utils.d.ts +9 -3
- package/dist/server/og-utils.d.ts.map +1 -1
- package/dist/server/og-utils.js +15 -9
- package/dist/server/og-utils.js.map +1 -1
- package/dist/styles/breakpoints.scss +16 -5
- package/dist/test/setup.js +21 -0
- package/dist/test/setup.js.map +1 -1
- package/dist/types.d.ts +13 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/colorScheme.d.ts +35 -0
- package/dist/utils/colorScheme.d.ts.map +1 -0
- package/dist/utils/colorScheme.js +140 -0
- package/dist/utils/colorScheme.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/navMatch.d.ts +21 -0
- package/dist/utils/navMatch.d.ts.map +1 -0
- package/dist/utils/navMatch.js +26 -0
- package/dist/utils/navMatch.js.map +1 -0
- package/package.json +228 -171
- package/scripts/init-agent.js +0 -0
- package/scripts/validate-ai-code.js +74 -10
- package/LICENSE.md +0 -21
- package/dist/css/styles.css.map +0 -1
- package/dist/css/tokens.css.map +0 -1
- package/dist/hooks/useResponsiveClasses.d.ts +0 -9
- package/dist/hooks/useResponsiveClasses.d.ts.map +0 -1
- package/dist/hooks/useResponsiveClasses.js +0 -293
- package/dist/hooks/useResponsiveClasses.js.map +0 -1
- package/dist/styles/background.scss +0 -423
- package/dist/styles/border.scss +0 -546
- package/dist/styles/color.scss +0 -183
- package/dist/styles/display.scss +0 -391
- package/dist/styles/flex.scss +0 -518
- package/dist/styles/global.scss +0 -36
- package/dist/styles/grid.scss +0 -293
- package/dist/styles/index.scss +0 -14
- package/dist/styles/position.scss +0 -1549
- package/dist/styles/shadow.scss +0 -19
- package/dist/styles/size.scss +0 -53
- package/dist/styles/spacing.scss +0 -1505
- package/dist/styles/typography.scss +0 -223
- package/dist/styles/utilities.scss +0 -23
- package/dist/tokens/border.scss +0 -95
- package/dist/tokens/data.scss +0 -107
- package/dist/tokens/function.scss +0 -742
- package/dist/tokens/index.scss +0 -8
- package/dist/tokens/layout.scss +0 -275
- package/dist/tokens/scheme.scss +0 -352
- package/dist/tokens/shadow.scss +0 -7
- package/dist/tokens/theme.scss +0 -657
- package/dist/tokens/typography.scss +0 -118
- package/next-env.d.ts +0 -5
- package/scripts/copy-files.js +0 -103
- package/scripts/generate-ai-spec.js +0 -464
- package/scripts/generate-emoji-data.js +0 -128
- package/scss.d.ts +0 -4
- package/tsconfig.vitest.json +0 -20
- package/vitest.config.ts +0 -19
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import { type OnceUIAdapters } from "../contexts/AdapterProvider";
|
|
3
|
+
import { LayoutProvider as BaseLayoutProvider } from "../contexts/LayoutProvider";
|
|
4
|
+
export declare const nextAdapters: OnceUIAdapters;
|
|
5
|
+
export interface NextAdapterProviderProps {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare const NextAdapterProvider: React.FC<NextAdapterProviderProps>;
|
|
9
|
+
/**
|
|
10
|
+
* Drop-in replacement for core's `LayoutProvider`, with the Next adapters
|
|
11
|
+
* already installed.
|
|
12
|
+
*
|
|
13
|
+
* This is the whole migration for a Next.js app on 1.8.x: change the import
|
|
14
|
+
* path for `LayoutProvider`, and `SmartLink`, `Button`/`Card`/`ToggleButton`
|
|
15
|
+
* with an `href`, `Media`, `Logo`, `MegaMenu` and `Kbar` keep routing through
|
|
16
|
+
* next/link and next/image exactly as before. No provider is added to the tree
|
|
17
|
+
* and no props change.
|
|
18
|
+
*
|
|
19
|
+
* - import { LayoutProvider } from "@once-ui-system/core";
|
|
20
|
+
* + import { LayoutProvider } from "@once-ui-system/core/next";
|
|
21
|
+
*
|
|
22
|
+
* Detection is deliberately not attempted. The adapters include two hooks whose
|
|
23
|
+
* implementations call different numbers of hooks — the DOM `useNavigate`
|
|
24
|
+
* returns a closure, the Next one calls `useRouter` and `useCallback` — so
|
|
25
|
+
* swapping them after mount breaks the rules of hooks. Resolution has to be
|
|
26
|
+
* settled before the first render, and a browser bundle has no synchronous way
|
|
27
|
+
* to conditionally resolve an optional module. An explicit import is the
|
|
28
|
+
* honest, bundler-independent version of the same thing.
|
|
29
|
+
*
|
|
30
|
+
* Apps that already compose `AdapterProvider` themselves can keep using
|
|
31
|
+
* `NextAdapterProvider` directly; this only removes the boilerplate for the
|
|
32
|
+
* common case.
|
|
33
|
+
*/
|
|
34
|
+
export declare const LayoutProvider: React.FC<React.ComponentProps<typeof BaseLayoutProvider>>;
|
|
35
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/next/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AA4BlF,eAAO,MAAM,YAAY,EAAE,cAK1B,CAAC;AAEF,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAElE,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,CAOpF,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import NextImage from "next/image";
|
|
4
|
+
import NextLink from "next/link";
|
|
5
|
+
import { usePathname, useRouter } from "next/navigation";
|
|
6
|
+
import { forwardRef, useCallback } from "react";
|
|
7
|
+
import { AdapterProvider, } from "../contexts/AdapterProvider";
|
|
8
|
+
import { LayoutProvider as BaseLayoutProvider } from "../contexts/LayoutProvider";
|
|
9
|
+
/**
|
|
10
|
+
* Next.js adapter bindings — the ONLY runtime `next/*` imports in core
|
|
11
|
+
* outside modules/seo and server/ (enforced by framework-boundary.test.ts).
|
|
12
|
+
* Imported via the `@once-ui-system/core/next` subpath, never the root
|
|
13
|
+
* barrel, so non-Next bundlers never resolve `next/*`. This module becomes
|
|
14
|
+
* the seed of `@once-ui-system/nextjs` in 2.0 Phase 4.
|
|
15
|
+
*/
|
|
16
|
+
const NextAdapterLink = forwardRef(({ href, children, ...props }, ref) => (_jsx(NextLink, { href: href, ref: ref, ...props, children: children })));
|
|
17
|
+
NextAdapterLink.displayName = "NextAdapterLink";
|
|
18
|
+
const NextAdapterImage = ({ width, height, ...props }) => (_jsx(NextImage, { width: width, height: height, ...props }));
|
|
19
|
+
const useNextNavigate = () => {
|
|
20
|
+
const router = useRouter();
|
|
21
|
+
return useCallback((href) => router.push(href), [router]);
|
|
22
|
+
};
|
|
23
|
+
export const nextAdapters = {
|
|
24
|
+
Link: NextAdapterLink,
|
|
25
|
+
Image: NextAdapterImage,
|
|
26
|
+
usePathname,
|
|
27
|
+
useNavigate: useNextNavigate,
|
|
28
|
+
};
|
|
29
|
+
export const NextAdapterProvider = ({ children }) => (_jsx(AdapterProvider, { adapters: nextAdapters, children: children }));
|
|
30
|
+
/**
|
|
31
|
+
* Drop-in replacement for core's `LayoutProvider`, with the Next adapters
|
|
32
|
+
* already installed.
|
|
33
|
+
*
|
|
34
|
+
* This is the whole migration for a Next.js app on 1.8.x: change the import
|
|
35
|
+
* path for `LayoutProvider`, and `SmartLink`, `Button`/`Card`/`ToggleButton`
|
|
36
|
+
* with an `href`, `Media`, `Logo`, `MegaMenu` and `Kbar` keep routing through
|
|
37
|
+
* next/link and next/image exactly as before. No provider is added to the tree
|
|
38
|
+
* and no props change.
|
|
39
|
+
*
|
|
40
|
+
* - import { LayoutProvider } from "@once-ui-system/core";
|
|
41
|
+
* + import { LayoutProvider } from "@once-ui-system/core/next";
|
|
42
|
+
*
|
|
43
|
+
* Detection is deliberately not attempted. The adapters include two hooks whose
|
|
44
|
+
* implementations call different numbers of hooks — the DOM `useNavigate`
|
|
45
|
+
* returns a closure, the Next one calls `useRouter` and `useCallback` — so
|
|
46
|
+
* swapping them after mount breaks the rules of hooks. Resolution has to be
|
|
47
|
+
* settled before the first render, and a browser bundle has no synchronous way
|
|
48
|
+
* to conditionally resolve an optional module. An explicit import is the
|
|
49
|
+
* honest, bundler-independent version of the same thing.
|
|
50
|
+
*
|
|
51
|
+
* Apps that already compose `AdapterProvider` themselves can keep using
|
|
52
|
+
* `NextAdapterProvider` directly; this only removes the boilerplate for the
|
|
53
|
+
* common case.
|
|
54
|
+
*/
|
|
55
|
+
export const LayoutProvider = ({ children, ...props }) => (_jsx(NextAdapterProvider, { children: _jsx(BaseLayoutProvider, { ...props, children: children }) }));
|
|
56
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/next/index.tsx"],"names":[],"mappings":"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AC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CACvF,KAAC,eAAe,IAAC,QAAQ,EAAE,YAAY,YAAG,QAAQ,GAAmB,CACtE,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,MAAM,cAAc,GAA8D,CAAC,EACxF,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,EAAE,CAAC,CACJ,KAAC,mBAAmB,cAClB,KAAC,kBAAkB,OAAK,KAAK,YAAG,QAAQ,GAAsB,GAC1C,CACvB,CAAC"}
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@once-ui-system/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-alpha.0",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public",
|
|
6
|
+
"tag": "alpha"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"ai",
|
|
11
|
+
"agent",
|
|
12
|
+
"AGENTS.md",
|
|
13
|
+
"scripts/init-agent.js",
|
|
14
|
+
"scripts/validate-ai-code.js"
|
|
15
|
+
],
|
|
4
16
|
"description": "Once UI for Next.js NPM package",
|
|
5
17
|
"keywords": [
|
|
6
18
|
"once-ui",
|
|
@@ -99,6 +111,11 @@
|
|
|
99
111
|
"import": "./dist/server/index.js",
|
|
100
112
|
"require": "./dist/server/index.js"
|
|
101
113
|
},
|
|
114
|
+
"./next": {
|
|
115
|
+
"types": "./dist/next/index.d.ts",
|
|
116
|
+
"import": "./dist/next/index.js",
|
|
117
|
+
"require": "./dist/next/index.js"
|
|
118
|
+
},
|
|
102
119
|
"./ai/manifest.json": "./ai/manifest.json",
|
|
103
120
|
"./ai/spec.json": "./ai/spec.json",
|
|
104
121
|
"./ai/catalog.json": "./ai/catalog.json",
|
|
@@ -106,20 +123,33 @@
|
|
|
106
123
|
"./ai/rules.compact.md": "./ai/rules.compact.md",
|
|
107
124
|
"./ai/rules.md": "./ai/rules.md",
|
|
108
125
|
"./ai/recipes.md": "./ai/recipes.md",
|
|
126
|
+
"./ai/layouts.md": "./ai/layouts.md",
|
|
109
127
|
"./ai/tasks/*": "./ai/tasks/*",
|
|
110
128
|
"./ai/components/*": "./ai/components/*",
|
|
111
129
|
"./ai/examples/*": "./ai/examples/*",
|
|
112
130
|
"./ai/examples/blocks/*": "./ai/examples/blocks/*",
|
|
113
|
-
"./AGENTS.md": "./AGENTS.md"
|
|
131
|
+
"./AGENTS.md": "./AGENTS.md",
|
|
132
|
+
"./data": {
|
|
133
|
+
"types": "./dist/modules/data/index.d.ts",
|
|
134
|
+
"import": "./dist/modules/data/index.js",
|
|
135
|
+
"require": "./dist/modules/data/index.js"
|
|
136
|
+
},
|
|
137
|
+
"./code": {
|
|
138
|
+
"types": "./dist/modules/code/index.d.ts",
|
|
139
|
+
"import": "./dist/modules/code/index.js",
|
|
140
|
+
"require": "./dist/modules/code/index.js"
|
|
141
|
+
},
|
|
142
|
+
"./media": {
|
|
143
|
+
"types": "./dist/modules/media/index.d.ts",
|
|
144
|
+
"import": "./dist/modules/media/index.js",
|
|
145
|
+
"require": "./dist/modules/media/index.js"
|
|
146
|
+
},
|
|
147
|
+
"./package.json": "./package.json"
|
|
114
148
|
},
|
|
115
149
|
"dependencies": {
|
|
116
150
|
"@floating-ui/react-dom": "^2.1.9",
|
|
117
151
|
"clsx": "^2.1.1",
|
|
118
|
-
"
|
|
119
|
-
"date-fns": "^4.4.0",
|
|
120
|
-
"prismjs": "^1.30.0",
|
|
121
|
-
"react-icons": "^5.7.0",
|
|
122
|
-
"recharts": "^3.10.1"
|
|
152
|
+
"date-fns": "^4.4.0"
|
|
123
153
|
},
|
|
124
154
|
"peerDependencies": {
|
|
125
155
|
"react": ">=18.0.0",
|
|
@@ -127,8 +157,23 @@
|
|
|
127
157
|
"next": ">=13.0.0"
|
|
128
158
|
},
|
|
129
159
|
"peerDependenciesMeta": {
|
|
160
|
+
"next": {
|
|
161
|
+
"optional": true
|
|
162
|
+
},
|
|
163
|
+
"sass": {
|
|
164
|
+
"optional": true
|
|
165
|
+
},
|
|
130
166
|
"sharp": {
|
|
131
167
|
"optional": true
|
|
168
|
+
},
|
|
169
|
+
"recharts": {
|
|
170
|
+
"optional": true
|
|
171
|
+
},
|
|
172
|
+
"prismjs": {
|
|
173
|
+
"optional": true
|
|
174
|
+
},
|
|
175
|
+
"compressorjs": {
|
|
176
|
+
"optional": true
|
|
132
177
|
}
|
|
133
178
|
}
|
|
134
179
|
}
|
|
File without changes
|
|
@@ -34,6 +34,54 @@ function readInput(argv) {
|
|
|
34
34
|
return { source: fs.readFileSync(fileArg, "utf8"), file: fileArg };
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
/**
|
|
38
|
+
* A literal colour in a styling position.
|
|
39
|
+
*
|
|
40
|
+
* The rule used to be a bare `#[0-9a-fA-F]{3,8}` over the whole file, which
|
|
41
|
+
* flagged two things that are not colours at all: any string that happens to
|
|
42
|
+
* look like hex (an order id `"#1024"` is a valid #RGBA literal), and the
|
|
43
|
+
* `fill` / `stroke` of an inline `<svg>`, where a raw value is the only thing
|
|
44
|
+
* that works — which is why 2.0 types those props `ColorValue` rather than
|
|
45
|
+
* `Colors`. So it looks at where the value sits, not only at its shape.
|
|
46
|
+
*/
|
|
47
|
+
function hasLiteralColor(source) {
|
|
48
|
+
const LITERAL = /#[0-9a-fA-F]{3,8}\b|rgba?\s*\(/;
|
|
49
|
+
const SVG_PAINT =
|
|
50
|
+
/^(?:fill|stroke|stopColor|stop-color|floodColor|flood-color|lightingColor|lighting-color)$/;
|
|
51
|
+
|
|
52
|
+
for (const block of source.match(/style=\{\{[\s\S]*?\}\}/g) || []) {
|
|
53
|
+
if (LITERAL.test(block)) return true;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
for (const [, name, value] of source.matchAll(/([A-Za-z-]+)=\{?["']([^"']*)["']/g)) {
|
|
57
|
+
if (SVG_PAINT.test(name)) continue;
|
|
58
|
+
if (!/colou?r|background|border|shadow|gradient/i.test(name)) continue;
|
|
59
|
+
if (LITERAL.test(value)) return true;
|
|
60
|
+
}
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Is `index` inside the braces of a `<prop>={ ... }` value?
|
|
66
|
+
*
|
|
67
|
+
* Counts braces forward from each occurrence of the prop, which is enough for
|
|
68
|
+
* JSX: a `{` inside a string would have to be unbalanced to fool it, and the
|
|
69
|
+
* answer is only used to suppress a warning.
|
|
70
|
+
*/
|
|
71
|
+
function insidePropValue(source, index, prop) {
|
|
72
|
+
for (const m of source.matchAll(new RegExp(`\\b${prop}=\\{`, "g"))) {
|
|
73
|
+
if (m.index > index) return false;
|
|
74
|
+
let depth = 1;
|
|
75
|
+
let i = m.index + m[0].length;
|
|
76
|
+
for (; i < source.length && depth > 0; i++) {
|
|
77
|
+
if (source[i] === "{") depth++;
|
|
78
|
+
else if (source[i] === "}") depth--;
|
|
79
|
+
}
|
|
80
|
+
if (index > m.index && index < i) return true;
|
|
81
|
+
}
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
|
|
37
85
|
function validate(source, spec, iconNames) {
|
|
38
86
|
const issues = [];
|
|
39
87
|
|
|
@@ -63,7 +111,12 @@ function validate(source, spec, iconNames) {
|
|
|
63
111
|
add("layout.defaults", "variant=\"primary\" is the Button default — omit it");
|
|
64
112
|
}
|
|
65
113
|
|
|
66
|
-
|
|
114
|
+
// Scoped to the tag: `lines` is a different prop on Background and CodeBlock.
|
|
115
|
+
if (/<Textarea[^>]*\blines=\{?["']auto["']/.test(source)) {
|
|
116
|
+
add("layout.defaults", "lines=\"auto\" is the Textarea default — omit it");
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (hasLiteralColor(source)) {
|
|
67
120
|
add("color.tokens", "Use semantic color tokens, not hex/rgb");
|
|
68
121
|
}
|
|
69
122
|
|
|
@@ -71,12 +124,14 @@ function validate(source, spec, iconNames) {
|
|
|
71
124
|
add("components.primitives", "Use Once UI components (Media, SmartLink, Button) instead of raw HTML");
|
|
72
125
|
}
|
|
73
126
|
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
127
|
+
for (const match of source.matchAll(/<Card\b[^>]*>/g)) {
|
|
128
|
+
if (/\b(href|onClick)=/.test(match[0])) continue;
|
|
129
|
+
// A card handed to a `trigger` prop is operated by whatever owns it
|
|
130
|
+
// (DropdownWrapper, Dialog), so it carries no handler of its own and is
|
|
131
|
+
// not the static-panel misuse this rule is looking for.
|
|
132
|
+
if (insidePropValue(source, match.index, "trigger")) continue;
|
|
133
|
+
add("Card.interactive", "Card without href/onClick — use Column + surface recipe for static panels");
|
|
134
|
+
break;
|
|
80
135
|
}
|
|
81
136
|
|
|
82
137
|
const iconPropRe = /(?:prefixIcon|suffixIcon|name)=["']([^"']+)["']/g;
|
|
@@ -88,8 +143,14 @@ function validate(source, spec, iconNames) {
|
|
|
88
143
|
}
|
|
89
144
|
}
|
|
90
145
|
|
|
91
|
-
if (
|
|
92
|
-
|
|
146
|
+
if (
|
|
147
|
+
/\b(?:delay|speed)=\{[^}]*\*\s*0?\.\d+/.test(source) ||
|
|
148
|
+
/\b(?:delay|speed)=\{\s*0?\.\d+\s*\}/.test(source)
|
|
149
|
+
) {
|
|
150
|
+
add(
|
|
151
|
+
"RevealFx.delay",
|
|
152
|
+
"RevealFx delay and ShineFx speed are milliseconds — use index * 100, not index * 0.1",
|
|
153
|
+
);
|
|
93
154
|
}
|
|
94
155
|
|
|
95
156
|
if (/<Fade[^>]*>[\s\S]*<(Column|Row)[^>]*overflowY/.test(source)) {
|
|
@@ -146,4 +207,7 @@ function main() {
|
|
|
146
207
|
process.exit(1);
|
|
147
208
|
}
|
|
148
209
|
|
|
149
|
-
|
|
210
|
+
// Importable for tests; the CLI runs only when this file is invoked directly.
|
|
211
|
+
if (require.main === module) main();
|
|
212
|
+
|
|
213
|
+
module.exports = { validate, loadSpec, parseIconNames, hasLiteralColor, insidePropValue };
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Open Graph fetch/proxy handlers.
|
|
3
|
+
*
|
|
4
|
+
* Uses the standard `Response` rather than `NextResponse`: `NextResponse`
|
|
5
|
+
* extends `Response`, so Next route handlers accept these return values
|
|
6
|
+
* unchanged, and the module no longer pulls `next/server` into core.
|
|
7
|
+
*/
|
|
2
8
|
import { type OGUrlValidationOptions } from './og-url-validation';
|
|
3
9
|
export interface OGData {
|
|
4
10
|
url: string;
|
|
@@ -12,12 +18,12 @@ export interface OGFetchOptions extends OGUrlValidationOptions {
|
|
|
12
18
|
userAgent?: string;
|
|
13
19
|
decodeEntities?: boolean;
|
|
14
20
|
}
|
|
15
|
-
export declare function handleOGFetch(request: Request, options?: OGFetchOptions): Promise<
|
|
21
|
+
export declare function handleOGFetch(request: Request, options?: OGFetchOptions): Promise<Response>;
|
|
16
22
|
export interface OGProxyOptions extends OGUrlValidationOptions {
|
|
17
23
|
userAgent?: string;
|
|
18
24
|
cacheMaxAge?: number;
|
|
19
25
|
}
|
|
20
|
-
export declare function handleOGProxy(request: Request, options?: OGProxyOptions): Promise<
|
|
26
|
+
export declare function handleOGProxy(request: Request, options?: OGProxyOptions): Promise<Response>;
|
|
21
27
|
export { OGUrlValidationError, validateOgUrl } from './og-url-validation';
|
|
22
28
|
export type { OGUrlValidationOptions } from './og-url-validation';
|
|
23
29
|
//# sourceMappingURL=og-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"og-utils.d.ts","sourceRoot":"","sources":["../../src/server/og-utils.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"og-utils.d.ts","sourceRoot":"","sources":["../../src/server/og-utils.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAGL,KAAK,sBAAsB,EAE5B,MAAM,qBAAqB,CAAC;AAE7B,MAAM,WAAW,MAAM;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,cAAe,SAAQ,sBAAsB;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AA2DD,wBAAsB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAkFrG;AAED,MAAM,WAAW,cAAe,SAAQ,sBAAsB;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAsB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,QAAQ,CAAC,CA0DrG;AAED,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC1E,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/server/og-utils.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Open Graph fetch/proxy handlers.
|
|
3
|
+
*
|
|
4
|
+
* Uses the standard `Response` rather than `NextResponse`: `NextResponse`
|
|
5
|
+
* extends `Response`, so Next route handlers accept these return values
|
|
6
|
+
* unchanged, and the module no longer pulls `next/server` into core.
|
|
7
|
+
*/
|
|
2
8
|
import { fetchValidatedUrl, OGUrlValidationError, validateOgUrl, } from './og-url-validation';
|
|
3
9
|
function decodeHTMLEntities(text) {
|
|
4
10
|
return text.replace(/&(#?[a-zA-Z0-9]+);/g, (match, entity) => {
|
|
@@ -41,14 +47,14 @@ async function fetchWithTimeout(url, timeout = 5000, userAgent = 'Mozilla/5.0 (c
|
|
|
41
47
|
}
|
|
42
48
|
}
|
|
43
49
|
function validationErrorResponse() {
|
|
44
|
-
return
|
|
50
|
+
return Response.json({ error: 'URL is not allowed' }, { status: 400 });
|
|
45
51
|
}
|
|
46
52
|
export async function handleOGFetch(request, options = {}) {
|
|
47
53
|
const { timeout = 5000, userAgent = 'Mozilla/5.0 (compatible; OG-Fetcher/1.0)', decodeEntities = true, allowedDomains, } = options;
|
|
48
54
|
const { searchParams } = new URL(request.url);
|
|
49
55
|
const url = searchParams.get('url');
|
|
50
56
|
if (!url) {
|
|
51
|
-
return
|
|
57
|
+
return Response.json({ error: 'URL parameter is required' }, { status: 400 });
|
|
52
58
|
}
|
|
53
59
|
const validationOptions = { allowedDomains };
|
|
54
60
|
try {
|
|
@@ -99,11 +105,11 @@ export async function handleOGFetch(request, options = {}) {
|
|
|
99
105
|
ogData.title = decodeHTMLEntities(ogData.title);
|
|
100
106
|
ogData.description = decodeHTMLEntities(ogData.description);
|
|
101
107
|
}
|
|
102
|
-
return
|
|
108
|
+
return Response.json(ogData);
|
|
103
109
|
}
|
|
104
110
|
catch (error) {
|
|
105
111
|
console.error('Error fetching OG data:', error);
|
|
106
|
-
return
|
|
112
|
+
return Response.json({ error: 'Failed to fetch Open Graph data' }, { status: 500 });
|
|
107
113
|
}
|
|
108
114
|
}
|
|
109
115
|
export async function handleOGProxy(request, options = {}) {
|
|
@@ -111,7 +117,7 @@ export async function handleOGProxy(request, options = {}) {
|
|
|
111
117
|
const { searchParams } = new URL(request.url);
|
|
112
118
|
const url = searchParams.get('url');
|
|
113
119
|
if (!url) {
|
|
114
|
-
return
|
|
120
|
+
return Response.json({ error: 'URL parameter is required' }, { status: 400 });
|
|
115
121
|
}
|
|
116
122
|
const validationOptions = { allowedDomains };
|
|
117
123
|
try {
|
|
@@ -130,11 +136,11 @@ export async function handleOGProxy(request, options = {}) {
|
|
|
130
136
|
},
|
|
131
137
|
}, validationOptions);
|
|
132
138
|
if (!response.ok) {
|
|
133
|
-
return
|
|
139
|
+
return Response.json({ error: 'Failed to fetch image' }, { status: response.status >= 400 && response.status < 600 ? response.status : 502 });
|
|
134
140
|
}
|
|
135
141
|
const contentType = response.headers.get('content-type') || 'image/jpeg';
|
|
136
142
|
const buffer = await response.arrayBuffer();
|
|
137
|
-
return new
|
|
143
|
+
return new Response(buffer, {
|
|
138
144
|
headers: {
|
|
139
145
|
'Content-Type': contentType,
|
|
140
146
|
'Cache-Control': `public, max-age=${cacheMaxAge}`,
|
|
@@ -143,7 +149,7 @@ export async function handleOGProxy(request, options = {}) {
|
|
|
143
149
|
}
|
|
144
150
|
catch (error) {
|
|
145
151
|
console.error('Error proxying image:', error);
|
|
146
|
-
return
|
|
152
|
+
return Response.json({ error: 'Failed to proxy image' }, { status: 500 });
|
|
147
153
|
}
|
|
148
154
|
}
|
|
149
155
|
export { OGUrlValidationError, validateOgUrl } from './og-url-validation';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"og-utils.js","sourceRoot":"","sources":["../../src/server/og-utils.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"og-utils.js","sourceRoot":"","sources":["../../src/server/og-utils.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EAEpB,aAAa,GACd,MAAM,qBAAqB,CAAC;AAgB7B,SAAS,kBAAkB,CAAC,IAAY;IACtC,OAAO,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;QAC3D,MAAM,QAAQ,GAA8B;YAC1C,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,GAAG;YACT,IAAI,EAAE,GAAG;YACT,MAAM,EAAE,GAAG;YACX,MAAM,EAAE,GAAG;YACX,MAAM,EAAE,GAAG;YACX,KAAK,EAAE,GAAG;YACV,MA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,MAAM,iBAAiB,CACtC,GAAG,EACH;YACE,OAAO,EAAE;gBACP,YAAY,EAAE,SAAS;aACxB;SACF,EACD,iBAAiB,CAClB,CAAC;QAEF,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,OAAO,QAAQ,CAAC,IAAI,CAClB,EAAE,KAAK,EAAE,uBAAuB,EAAE,EAClC,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,CACpF,CAAC;QACJ,CAAC;QAED,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,YAAY,CAAC;QACzE,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,WAAW,EAAE,CAAC;QAE5C,OAAO,IAAI,QAAQ,CAAC,MAAM,EAAE;YAC1B,OAAO,EAAE;gBACP,cAAc,EAAE,WAAW;gBAC3B,eAAe,EAAE,mBAAmB,WAAW,EAAE;aAClD;SACF,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC;QAC9C,OAAO,QAAQ,CAAC,IAAI,CAClB,EAAE,KAAK,EAAE,uBAAuB,EAAE,EAClC,EAAE,MAAM,EAAE,GAAG,EAAE,CAChB,CAAC;IACJ,CAAC;AACH,CAAC;AAED,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,28 +1,39 @@
|
|
|
1
|
+
/* GENERATED by scripts/generate-utilities.mjs — do not edit.
|
|
2
|
+
* The class matrix lives in scripts/utilities.spec.mjs; change it there and
|
|
3
|
+
* re-run `pnpm generate:utilities`. */
|
|
4
|
+
|
|
1
5
|
$breakpoint-xs: 480px;
|
|
2
6
|
$breakpoint-s: 768px;
|
|
3
7
|
$breakpoint-m: 1024px;
|
|
4
8
|
$breakpoint-l: 1440px;
|
|
9
|
+
$breakpoint-xl: 1441px;
|
|
5
10
|
|
|
6
11
|
@mixin xs {
|
|
7
|
-
@media (max-width:
|
|
12
|
+
@media (max-width: 480px) {
|
|
8
13
|
@content;
|
|
9
14
|
}
|
|
10
15
|
}
|
|
11
16
|
|
|
12
17
|
@mixin s {
|
|
13
|
-
@media (max-width:
|
|
18
|
+
@media (max-width: 768px) {
|
|
14
19
|
@content;
|
|
15
20
|
}
|
|
16
21
|
}
|
|
17
22
|
|
|
18
23
|
@mixin m {
|
|
19
|
-
@media (max-width:
|
|
24
|
+
@media (max-width: 1024px) {
|
|
20
25
|
@content;
|
|
21
26
|
}
|
|
22
27
|
}
|
|
23
28
|
|
|
24
29
|
@mixin l {
|
|
25
|
-
@media (max-width:
|
|
30
|
+
@media (max-width: 1440px) {
|
|
31
|
+
@content;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@mixin xl {
|
|
36
|
+
@media (min-width: 1441px) {
|
|
26
37
|
@content;
|
|
27
38
|
}
|
|
28
|
-
}
|
|
39
|
+
}
|
package/dist/test/setup.js
CHANGED
|
@@ -6,6 +6,20 @@ class ResizeObserverMock {
|
|
|
6
6
|
unobserve() { }
|
|
7
7
|
disconnect() { }
|
|
8
8
|
}
|
|
9
|
+
/** jsdom ships no IntersectionObserver; the canvas effects gate their animation loop on it. */
|
|
10
|
+
class IntersectionObserverMock {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.root = null;
|
|
13
|
+
this.rootMargin = "";
|
|
14
|
+
this.thresholds = [];
|
|
15
|
+
}
|
|
16
|
+
observe() { }
|
|
17
|
+
unobserve() { }
|
|
18
|
+
disconnect() { }
|
|
19
|
+
takeRecords() {
|
|
20
|
+
return [];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
9
23
|
const installBrowserMocks = () => {
|
|
10
24
|
if (!("ResizeObserver" in globalThis)) {
|
|
11
25
|
Object.defineProperty(globalThis, "ResizeObserver", {
|
|
@@ -14,6 +28,13 @@ const installBrowserMocks = () => {
|
|
|
14
28
|
value: ResizeObserverMock,
|
|
15
29
|
});
|
|
16
30
|
}
|
|
31
|
+
if (!("IntersectionObserver" in globalThis)) {
|
|
32
|
+
Object.defineProperty(globalThis, "IntersectionObserver", {
|
|
33
|
+
configurable: true,
|
|
34
|
+
writable: true,
|
|
35
|
+
value: IntersectionObserverMock,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
17
38
|
Object.defineProperty(window, "scrollTo", {
|
|
18
39
|
configurable: true,
|
|
19
40
|
writable: true,
|
package/dist/test/setup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../src/test/setup.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAEvC,MAAM,kBAAkB;IACtB,OAAO,KAAI,CAAC;IACZ,SAAS,KAAI,CAAC;IACd,UAAU,KAAI,CAAC;CAChB;AAED,MAAM,mBAAmB,GAAG,GAAG,EAAE;IAC/B,IAAI,CAAC,CAAC,gBAAgB,IAAI,UAAU,CAAC,EAAE,CAAC;QACtC,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,gBAAgB,EAAE;YAClD,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,kBAAkB;SAC1B,CAAC,CAAC;IACL,CAAC;IAED,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE;QACxC,YAAY,EAAE,IAAI;QAClB,QAAQ,EAAE,IAAI;QACd,KAAK,EAAE,EAAE,CAAC,EAAE,EAAE;KACf,CAAC,CAAC;IAEH,MAAM,CAAC,cAAc,CAAC,MAAM,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64" | "80" | "104" | "128" | "160";
|
|
1
|
+
export type StaticSpacingToken = "0" | "1" | "2" | "4" | "8" | "12" | "16" | "20" | "24" | "32" | "40" | "48" | "56" | "64" | "72" | "80" | "104" | "128" | "160";
|
|
2
2
|
export declare const schemes: string[];
|
|
3
3
|
export type Schemes = "blue" | "indigo" | "violet" | "magenta" | "pink" | "red" | "orange" | "yellow" | "moss" | "green" | "emerald" | "aqua" | "cyan";
|
|
4
4
|
export type CondensedTShirtSizes = "s" | "m" | "l";
|
|
@@ -12,6 +12,18 @@ export type ColorScheme = "neutral" | "brand" | "accent" | "info" | "danger" | "
|
|
|
12
12
|
export type ColorCategory = "on-solid" | "on-background";
|
|
13
13
|
export type ColorWeight = "weak" | "medium" | "strong";
|
|
14
14
|
export type Colors = `${ColorScheme}-${ColorWeight}` | `${ColorScheme}-alpha-${ColorWeight}`;
|
|
15
|
+
/**
|
|
16
|
+
* A design token, or any CSS colour.
|
|
17
|
+
*
|
|
18
|
+
* The `(string & {})` arm is what keeps token autocomplete alive: a bare
|
|
19
|
+
* `Colors | string` collapses to `string` and the editor stops suggesting
|
|
20
|
+
* anything, whereas this keeps the literal union suggestible while still
|
|
21
|
+
* accepting `#fff`, `rgb(...)` or `var(...)`.
|
|
22
|
+
*
|
|
23
|
+
* Used where a value is painted into SVG or canvas rather than through a class,
|
|
24
|
+
* so a raw CSS colour is a legitimate escape hatch rather than a mistake.
|
|
25
|
+
*/
|
|
26
|
+
export type ColorValue = Colors | (string & {});
|
|
15
27
|
export type RadiusSize = TShirtSizes | "full" | "none";
|
|
16
28
|
export type RadiusNest = "4" | "8";
|
|
17
29
|
export type TextType = "body" | "heading" | "display" | "label" | "code";
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAC1B,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,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,MAAM,GACN,OAAO,GACP,UAAU,GACV,MAAM,GACN,KAAK,GACL,UAAU,GACV,gBAAgB,GAChB,MAAM,GACN,MAAM,GACN,KAAK,GACL,MAAM,GACN,OAAO,GACP,QAAQ,GACR,MAAM,GACN,eAAe,GACf,OAAO,GACP,WAAW,GACX,QAAQ,GACR,KAAK,GACL,UAAU,GACV,eAAe,GACf,KAAK,GACL,QAAQ,GACR,YAAY,GACZ,KAAK,GACL,KAAK,GACL,UAAU,GACV,MAAM,GACN,OAAO,GACP,QAAQ,GACR,eAAe,GACf,OAAO,GACP,SAAS,GACT,OAAO,GACP,eAAe,GACf,OAAO,GACP,KAAK,GACL,KAAK,GACL,SAAS,GACT,MAAM,GACN,QAAQ,GACR,KAAK,GACL,KAAK,GACL,QAAQ,GACR,MAAM,GACN,YAAY,GACZ,YAAY,GACZ,cAAc,GACd,SAAS,GACT,KAAK,GACL,GAAG,GACH,MAAM,GACN,OAAO,GACP,UAAU,GACV,SAAS,GACT,MAAM,GACN,KAAK,GACL,cAAc,GACd,YAAY,GACZ,MAAM,GACN,SAAS,GACT,MAAM,GACN,MAAM,GACN,SAAS,GACT,MAAM,GACN,OAAO,GACP,SAAS,GACT,MAAM,GACN,QAAQ,GACR,MAAM,GACN,MAAM,GACN,KAAK,CAAC;AAEV,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAC1B,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,KAAK,GACL,KAAK,GACL,KAAK,CAAC;AAEV,eAAO,MAAM,OAAO,UAcnB,CAAC;AAEF,MAAM,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,GACN,OAAO,GACP,QAAQ,GACR,MAAM,GACN,eAAe,GACf,OAAO,GACP,WAAW,GACX,QAAQ,GACR,KAAK,GACL,UAAU,GACV,eAAe,GACf,KAAK,GACL,QAAQ,GACR,YAAY,GACZ,KAAK,GACL,KAAK,GACL,UAAU,GACV,MAAM,GACN,OAAO,GACP,QAAQ,GACR,eAAe,GACf,OAAO,GACP,SAAS,GACT,OAAO,GACP,eAAe,GACf,OAAO,GACP,KAAK,GACL,KAAK,GACL,SAAS,GACT,MAAM,GACN,QAAQ,GACR,KAAK,GACL,KAAK,GACL,QAAQ,GACR,MAAM,GACN,YAAY,GACZ,YAAY,GACZ,cAAc,GACd,SAAS,GACT,KAAK,GACL,GAAG,GACH,MAAM,GACN,OAAO,GACP,UAAU,GACV,SAAS,GACT,MAAM,GACN,KAAK,GACL,cAAc,GACd,YAAY,GACZ,MAAM,GACN,SAAS,GACT,MAAM,GACN,MAAM,GACN,SAAS,GACT,MAAM,GACN,OAAO,GACP,SAAS,GACT,MAAM,GACN,QAAQ,GACR,MAAM,GACN,MAAM,GACN,KAAK,CAAC;AAEV,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,QAAQ,CAAC"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAqBA,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,MAAM;IACN,KAAK;IACL,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,OAAO;IACP,SAAS;IACT,MAAM;IACN,MAAM;CACP,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate a 12-step Once UI colour ramp from one seed colour.
|
|
3
|
+
*
|
|
4
|
+
* Steps are anchored to a contrast ratio against black rather than to fixed
|
|
5
|
+
* lightness values, so a generated ramp keeps the same contrast relationships
|
|
6
|
+
* as the built-in schemes no matter which hue it is built from.
|
|
7
|
+
*
|
|
8
|
+
* Hue and chroma are taken from the seed and held constant; only lightness
|
|
9
|
+
* moves. That was measured against the 19 hand-tuned schemes rather than
|
|
10
|
+
* assumed: their hue drift averages to nothing across the set (each scheme
|
|
11
|
+
* drifts its own way, so there is no house curve to copy), and reproducing
|
|
12
|
+
* their chroma arc made the match worse, not better.
|
|
13
|
+
*
|
|
14
|
+
* What does matter is staying inside the gamut. A chroma that exists at the
|
|
15
|
+
* seed's lightness usually does not exist at 0.98, and clamping the red,
|
|
16
|
+
* green and blue channels separately — which is what converting an
|
|
17
|
+
* out-of-range colour to hex does — shifts the hue as it clips. Reducing
|
|
18
|
+
* chroma until the colour fits instead cuts the worst error across the
|
|
19
|
+
* built-in schemes from 0.168 to 0.110 in OKLab ΔE, and roughly five-fold on
|
|
20
|
+
* the lightest steps, where clipping is worst.
|
|
21
|
+
*/
|
|
22
|
+
export type SchemeRampWeight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | 1000 | 1100 | 1200;
|
|
23
|
+
export type SchemeRamp = Record<SchemeRampWeight, string>;
|
|
24
|
+
/** Contrast against black for each step, matching the built-in schemes. */
|
|
25
|
+
export declare const defaultContrastRatios: [SchemeRampWeight, number][];
|
|
26
|
+
/**
|
|
27
|
+
* Build a scheme from a seed colour. Accepts hex, `rgb()`/`rgba()` or
|
|
28
|
+
* `oklch()` — which covers what `ColorInput` produces with and without
|
|
29
|
+
* `supportAlpha`. Returns `null` if the seed cannot be parsed, so a caller
|
|
30
|
+
* can leave the current scheme in place rather than apply something wrong.
|
|
31
|
+
*/
|
|
32
|
+
export declare function generateColorScheme(seed: string, ratios?: [SchemeRampWeight, number][]): SchemeRamp | null;
|
|
33
|
+
/** The three translucent variants of step 600 that the token set expects. */
|
|
34
|
+
export declare function schemeAlphaVariants(scheme: SchemeRamp): Record<string, string>;
|
|
35
|
+
//# sourceMappingURL=colorScheme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colorScheme.d.ts","sourceRoot":"","sources":["../../src/utils/colorScheme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,MAAM,gBAAgB,GACxB,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GACjC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEzC,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;AAE1D,2EAA2E;AAC3E,eAAO,MAAM,qBAAqB,EAAE,CAAC,gBAAgB,EAAE,MAAM,CAAC,EAG7D,CAAC;AAsGF;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,MAAM,GAAE,CAAC,gBAAgB,EAAE,MAAM,CAAC,EAA0B,GAC3D,UAAU,GAAG,IAAI,CAUnB;AAED,6EAA6E;AAC7E,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAQ9E"}
|