@once-ui-system/core 1.8.5 → 2.0.0-alpha.1
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/AGENTS.md +1 -1
- 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 +10 -1
- package/ai/examples/app-shell.tsx +111 -0
- package/ai/examples/auth.tsx +2 -3
- package/ai/examples/blocks/Dashboard1.tsx +25 -36
- package/ai/examples/blocks/Feed3.tsx +8 -8
- 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/Header2.tsx +1 -1
- package/ai/examples/blocks/Header3.tsx +7 -7
- package/ai/examples/blocks/Header4.tsx +6 -7
- package/ai/examples/blocks/Productivity1.tsx +1 -1
- package/ai/examples/blocks/Roadmap1.tsx +3 -3
- package/ai/examples/blocks/Sidebar1.tsx +1 -1
- package/ai/examples/blocks/Sidebar2.tsx +1 -1
- package/ai/examples/blocks/Sidebar4.tsx +1 -1
- package/ai/examples/blocks/Streaming1.tsx +4 -4
- package/ai/examples/blocks/Table1.tsx +9 -9
- package/ai/examples/blocks/Waitlist1.tsx +5 -5
- package/ai/examples/blocks/content/resources.ts +3 -1
- package/ai/examples/dashboard.tsx +13 -14
- package/ai/examples/marketing-hero.tsx +4 -4
- package/ai/examples/pricing.tsx +7 -8
- package/ai/examples/settings.tsx +7 -7
- package/ai/gotchas.json +99 -25
- package/ai/layouts.md +154 -0
- package/ai/manifest.json +3 -2
- package/ai/recipes.md +50 -5
- package/ai/rules.compact.md +26 -5
- package/ai/rules.md +84 -14
- package/ai/spec.json +634 -176
- package/ai/tasks/settings.json +1 -1
- package/dist/AGENTS.md +1 -1
- 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 +10 -1
- package/dist/ai/gotchas.json +99 -25
- package/dist/ai/layouts.md +154 -0
- package/dist/ai/manifest.json +3 -2
- package/dist/ai/recipes.md +50 -5
- package/dist/ai/rules.compact.md +26 -5
- package/dist/ai/rules.md +84 -14
- package/dist/ai/spec.json +634 -176
- package/dist/ai/tasks/settings.json +1 -1
- 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.d.ts.map +1 -1
- package/dist/components/Avatar.js +2 -2
- 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.d.ts.map +1 -1
- package/dist/components/OgCard.js +7 -4
- 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 +4 -4
- 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/data/emoji-data.json +8 -10
- 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 +156 -0
- package/dist/scripts/validate-ai-code.js +431 -0
- 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 +66 -11
- package/scripts/validate-ai-code.js +309 -27
- 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":"AAAA,YAAY,CAAC;;AAEb,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEzD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAGL,eAAe,GAEhB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAElF;;;;;;GAMG;AAEH,MAAM,eAAe,GAAG,UAAU,CAChC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CACrC,KAAC,QAAQ,IAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,KAAM,KAAK,YACtC,QAAQ,GACA,CACZ,CACF,CAAC;AACF,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC;AAEhD,MAAM,gBAAgB,GAAgC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE,CAAC,CACrF,KAAC,SAAS,IAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,KAAM,KAAK,GAAI,CACvD,CAAC;AAEF,MAAM,eAAe,GAAG,GAA6B,EAAE;IACrD,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,OAAO,WAAW,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;AACpE,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAmB;IAC1C,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE,gBAAgB;IACvB,WAAW;IACX,WAAW,EAAE,eAAe;CAC7B,CAAC;AAMF,MAAM,CAAC,MAAM,mBAAmB,GAAuC,CAAC,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.1",
|
|
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
|
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Scaffold agent harness pointers in a consumer project.
|
|
4
|
+
* Usage: npx once-ui-init-agent [--force] [--dry-run]
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
const fs = require("fs");
|
|
8
|
+
const path = require("path");
|
|
9
|
+
|
|
10
|
+
const PACKAGE_ROOT = path.join(__dirname, "..");
|
|
11
|
+
const MARKER_START = "<!-- once-ui-agent-harness:start -->";
|
|
12
|
+
const MARKER_END = "<!-- once-ui-agent-harness:end -->";
|
|
13
|
+
|
|
14
|
+
const PROJECT_AGENTS_SECTION = `${MARKER_START}
|
|
15
|
+
## Once UI codegen harness
|
|
16
|
+
|
|
17
|
+
Before generating Once UI code, load the harness from your installed package (not full doc pages):
|
|
18
|
+
|
|
19
|
+
1. Read \`node_modules/@once-ui-system/core/ai/manifest.json\`
|
|
20
|
+
2. Load bootstrap: \`ai/rules.compact.md\` + \`ai/catalog.json\`
|
|
21
|
+
3. Match intent via \`ai/tasks/index.json\` → fetch task bundle + component slices
|
|
22
|
+
4. Validate: \`npx once-ui-validate-ai-code path/to/file.tsx\`
|
|
23
|
+
|
|
24
|
+
npm exports: \`@once-ui-system/core/ai/manifest.json\`
|
|
25
|
+
|
|
26
|
+
Remote fallback: https://docs.once-ui.com/ai/manifest.json
|
|
27
|
+
${MARKER_END}
|
|
28
|
+
`;
|
|
29
|
+
|
|
30
|
+
function parseArgs(argv) {
|
|
31
|
+
return {
|
|
32
|
+
force: argv.includes("--force"),
|
|
33
|
+
dryRun: argv.includes("--dry-run"),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function findProjectRoot(startDir = process.cwd()) {
|
|
38
|
+
let dir = path.resolve(startDir);
|
|
39
|
+
|
|
40
|
+
while (true) {
|
|
41
|
+
const pkgPath = path.join(dir, "package.json");
|
|
42
|
+
if (fs.existsSync(pkgPath)) {
|
|
43
|
+
try {
|
|
44
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
|
|
45
|
+
if (pkg.name !== "@once-ui-system/core") {
|
|
46
|
+
return dir;
|
|
47
|
+
}
|
|
48
|
+
} catch {
|
|
49
|
+
// keep walking
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const parent = path.dirname(dir);
|
|
54
|
+
if (parent === dir) {
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
dir = parent;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return path.resolve(startDir);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function upsertMarkedSection(existing, section, force) {
|
|
64
|
+
if (existing.includes(MARKER_START) && existing.includes(MARKER_END)) {
|
|
65
|
+
if (!force) {
|
|
66
|
+
return { content: existing, changed: false, reason: "AGENTS.md already contains Once UI harness section" };
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const start = existing.indexOf(MARKER_START);
|
|
70
|
+
const end = existing.indexOf(MARKER_END) + MARKER_END.length;
|
|
71
|
+
return {
|
|
72
|
+
content: `${existing.slice(0, start)}${section}${existing.slice(end)}`,
|
|
73
|
+
changed: true,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (existing.trim().length === 0) {
|
|
78
|
+
return {
|
|
79
|
+
content: `# AGENTS.md\n\n${section}\n`,
|
|
80
|
+
changed: true,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return {
|
|
85
|
+
content: `${existing.trimEnd()}\n\n${section}\n`,
|
|
86
|
+
changed: true,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function writeFile(root, relativePath, content, { dryRun, force }) {
|
|
91
|
+
const target = path.join(root, relativePath);
|
|
92
|
+
const exists = fs.existsSync(target);
|
|
93
|
+
|
|
94
|
+
if (exists && !force) {
|
|
95
|
+
const current = fs.readFileSync(target, "utf8");
|
|
96
|
+
if (current === content) {
|
|
97
|
+
return { path: target, status: "unchanged" };
|
|
98
|
+
}
|
|
99
|
+
return { path: target, status: "skipped", reason: "already exists (use --force)" };
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (dryRun) {
|
|
103
|
+
return { path: target, status: "would-write" };
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
fs.mkdirSync(path.dirname(target), { recursive: true });
|
|
107
|
+
fs.writeFileSync(target, content, "utf8");
|
|
108
|
+
return { path: target, status: exists ? "updated" : "created" };
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function main() {
|
|
112
|
+
const options = parseArgs(process.argv.slice(2));
|
|
113
|
+
const projectRoot = findProjectRoot();
|
|
114
|
+
const cursorRuleTemplate = fs.readFileSync(
|
|
115
|
+
path.join(PACKAGE_ROOT, "agent", "once-ui-codegen.mdc"),
|
|
116
|
+
"utf8",
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
const agentsPath = path.join(projectRoot, "AGENTS.md");
|
|
120
|
+
let agentsContent = "";
|
|
121
|
+
if (fs.existsSync(agentsPath)) {
|
|
122
|
+
agentsContent = fs.readFileSync(agentsPath, "utf8");
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const agentsResult = upsertMarkedSection(agentsContent, PROJECT_AGENTS_SECTION, options.force);
|
|
126
|
+
const results = [];
|
|
127
|
+
|
|
128
|
+
if (agentsResult.changed) {
|
|
129
|
+
results.push(
|
|
130
|
+
writeFile(projectRoot, "AGENTS.md", agentsResult.content, options),
|
|
131
|
+
);
|
|
132
|
+
} else {
|
|
133
|
+
results.push({
|
|
134
|
+
path: agentsPath,
|
|
135
|
+
status: "unchanged",
|
|
136
|
+
reason: agentsResult.reason,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
results.push(
|
|
141
|
+
writeFile(projectRoot, ".cursor/rules/once-ui-codegen.mdc", cursorRuleTemplate, options),
|
|
142
|
+
);
|
|
143
|
+
|
|
144
|
+
console.log(`Once UI agent harness setup (${options.dryRun ? "dry run" : "applied"})`);
|
|
145
|
+
console.log(`Project root: ${projectRoot}`);
|
|
146
|
+
for (const result of results) {
|
|
147
|
+
const suffix = result.reason ? ` (${result.reason})` : "";
|
|
148
|
+
console.log(`- ${result.status}: ${path.relative(projectRoot, result.path)}${suffix}`);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (!options.dryRun) {
|
|
152
|
+
console.log("\nNext: open a .tsx file and ask your agent to build Once UI — it should load the harness from node_modules/@once-ui-system/core/ai/");
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
main();
|