@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
|
@@ -1 +1,313 @@
|
|
|
1
|
-
|
|
1
|
+
/* Field metrics
|
|
2
|
+
----------------------------------------------------------------------------
|
|
3
|
+
The floating label and the value are placed by where their INK falls — cap
|
|
4
|
+
height down to descender — rather than by their line boxes. A line box
|
|
5
|
+
carries invisible leading on both sides, so centring line boxes pays for
|
|
6
|
+
that leading twice: the pair drifts apart and the block rides high in the
|
|
7
|
+
field. Ratios below (cap 0.72em, ascender 0.80em, descender 0.20em) are
|
|
8
|
+
approximations that hold for Geist and most UI sans faces.
|
|
9
|
+
|
|
10
|
+
Two offsets here are structural rather than typographic. `.base` carries a
|
|
11
|
+
1px border, and Input.tsx / Textarea.tsx render the inner Column with
|
|
12
|
+
padding="4". The label is absolutely positioned against that Column, so it
|
|
13
|
+
measures from the border edge; the value additionally clears the Column's
|
|
14
|
+
padding. Both are named below — if either changes in the TSX, change it
|
|
15
|
+
here too.
|
|
16
|
+
|
|
17
|
+
`--fld-gap` is the label-to-value distance in em of the value. xs and s keep
|
|
18
|
+
the base 0.25; m, l and xl take 0.375, which reads about 2px looser at each
|
|
19
|
+
of those sizes (m 4px to 6px, l 4.5 to 6.75, xl 5 to 7.5). The pair was
|
|
20
|
+
optically tight once the label actually floated — at the small sizes the
|
|
21
|
+
label is scaled down far enough that the base ratio still reads open. The
|
|
22
|
+
field height does not change: a taller ink block re-centres, so the label
|
|
23
|
+
rises by half the increase and the value drops by half.
|
|
24
|
+
|
|
25
|
+
On touch the value is clamped to 16px so iOS Safari does not zoom on focus,
|
|
26
|
+
and its line-height is clamped with it at 1.3 — Once UI's own body-s ratio is
|
|
27
|
+
1.286, and any looser a floor would also lift sizes that never had a problem.
|
|
28
|
+
Flooring font-size alone would put
|
|
29
|
+
16px glyphs in the 16.88px line box that body-s resolves to on mobile. */
|
|
30
|
+
|
|
31
|
+
/* Opt-in via the `focusRing` prop. Fields ship without one on purpose — the
|
|
32
|
+
look is the borderless native field Apple and Revolut settled on — but that
|
|
33
|
+
leaves a keyboard user with no indication of where they are, while `Card`
|
|
34
|
+
and `SmartLink` in this same library do show one. The ring is drawn on the
|
|
35
|
+
field rather than the control because the control sits inside the border and
|
|
36
|
+
the Column's padding, so its own outline would fall within the field.
|
|
37
|
+
|
|
38
|
+
Note that a text field matches `:focus-visible` however it was focused: the
|
|
39
|
+
pseudo-class always matches an element that takes keyboard input, so the
|
|
40
|
+
ring appears on a mouse click too. `:focus-visible` is still the right
|
|
41
|
+
selector — it is what the rest of the library uses, and it is what keeps
|
|
42
|
+
the ring off a field focused programmatically.
|
|
43
|
+
|
|
44
|
+
Two selectors, because focus lands in two places. A plain field focuses its
|
|
45
|
+
own control. `Select` moves focus off the trigger and into the dropdown, so
|
|
46
|
+
for most of the interaction the control is not the focused element at all —
|
|
47
|
+
it tracks focus across the whole widget instead and marks the wrapper, the
|
|
48
|
+
same descendant shape `.error .base` uses below. Same outline as the
|
|
49
|
+
`.focus-ring` utility either way, so an opted-in field matches every other
|
|
50
|
+
focusable thing on the page. */
|
|
51
|
+
.base.focusRing:has(.input:focus-visible),
|
|
52
|
+
.focused .base.focusRing {
|
|
53
|
+
outline: var(--static-space-2) solid var(--brand-solid-strong);
|
|
54
|
+
outline-offset: 2px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.base {
|
|
58
|
+
--fld-border: 1px;
|
|
59
|
+
--fld-well: var(--static-space-4); /* Column padding="4" in the TSX */
|
|
60
|
+
--fld-gap: var(--fld-gap-loose, 0.25); /* label to value, in em of the value */
|
|
61
|
+
|
|
62
|
+
--fld-label-fs: calc(var(--font-size-label-m) * var(--font-size-label-multiplier));
|
|
63
|
+
--fld-label-lh: calc(var(--line-height-label-m) * var(--line-height-label-multiplier));
|
|
64
|
+
|
|
65
|
+
--fld-fs: var(--fld-fs-base);
|
|
66
|
+
--fld-lh: var(--fld-lh-base);
|
|
67
|
+
--fld-h: var(--fld-h-base);
|
|
68
|
+
|
|
69
|
+
--fld-cap-label: calc(var(--fld-label-fs) * 0.72 * var(--fld-label-scale));
|
|
70
|
+
--fld-cap-value: calc(var(--fld-fs) * 0.72);
|
|
71
|
+
--fld-desc-value: calc(var(--fld-fs) * 0.2);
|
|
72
|
+
--fld-gap-size: calc(var(--fld-fs) * var(--fld-gap));
|
|
73
|
+
|
|
74
|
+
--fld-ink: calc(
|
|
75
|
+
var(--fld-cap-label) + var(--fld-gap-size) + var(--fld-cap-value) + var(--fld-desc-value)
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
/* The box the value actually gets: the field less its border and the well. */
|
|
79
|
+
--fld-box: calc(var(--fld-h) - 2 * var(--fld-border) - 2 * var(--fld-well));
|
|
80
|
+
--fld-ink-top: calc((var(--fld-box) - var(--fld-ink)) / 2);
|
|
81
|
+
|
|
82
|
+
/* Inputs centre their ink in a fixed box; textareas grow, so they anchor to a
|
|
83
|
+
fixed top inset and share only the gap below the label. */
|
|
84
|
+
--fld-anchor: var(--fld-ink-top);
|
|
85
|
+
|
|
86
|
+
/* Distance from a text box's top edge to the cap height of its first line. */
|
|
87
|
+
--fld-lead-value: calc((var(--fld-lh) - var(--fld-fs)) / 2 + var(--fld-fs) * 0.08);
|
|
88
|
+
--fld-lead-label: calc(
|
|
89
|
+
((var(--fld-label-lh) - var(--fld-label-fs)) / 2 + var(--fld-label-fs) * 0.08) *
|
|
90
|
+
var(--fld-label-scale)
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
--fld-label-top: calc(var(--fld-well) + var(--fld-anchor) - var(--fld-lead-label));
|
|
94
|
+
--fld-value-top: calc(
|
|
95
|
+
var(--fld-anchor) + var(--fld-cap-label) + var(--fld-gap-size) - var(--fld-lead-value)
|
|
96
|
+
);
|
|
97
|
+
/* A single-line <input> centres its text in its content box, so the box is
|
|
98
|
+
pinched to exactly one line — otherwise the padding above would only move
|
|
99
|
+
the text by half of itself and the ink would sit low. */
|
|
100
|
+
--fld-value-bottom: max(0px, calc(var(--fld-box) - var(--fld-value-top) - var(--fld-lh)));
|
|
101
|
+
|
|
102
|
+
backdrop-filter: var(--backdrop-filter);
|
|
103
|
+
min-height: var(--fld-h);
|
|
104
|
+
|
|
105
|
+
&:has(.textarea) {
|
|
106
|
+
--fld-anchor: var(--static-space-8);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@media (hover: none) and (pointer: coarse) {
|
|
111
|
+
.base {
|
|
112
|
+
--fld-fs: max(var(--fld-fs-base), 16px);
|
|
113
|
+
--fld-lh: max(var(--fld-lh-base), calc(var(--fld-fs) * 1.3));
|
|
114
|
+
--fld-h: max(var(--fld-h-base), var(--fld-h-touch));
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.xs {
|
|
119
|
+
--fld-fs-base: calc(var(--font-size-body-s) * var(--font-size-body-multiplier));
|
|
120
|
+
--fld-lh-base: calc(var(--line-height-body-s) * var(--line-height-body-multiplier));
|
|
121
|
+
--fld-h-base: var(--static-space-40);
|
|
122
|
+
--fld-h-touch: 40px;
|
|
123
|
+
--fld-label-scale: 0.6;
|
|
124
|
+
--fld-inset: var(--static-space-12);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.s {
|
|
128
|
+
--fld-fs-base: calc(var(--font-size-body-s) * var(--font-size-body-multiplier));
|
|
129
|
+
--fld-lh-base: calc(var(--line-height-body-s) * var(--line-height-body-multiplier));
|
|
130
|
+
--fld-h-base: var(--static-space-48);
|
|
131
|
+
--fld-h-touch: 48px;
|
|
132
|
+
--fld-label-scale: 0.75;
|
|
133
|
+
--fld-inset: var(--static-space-12);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.m {
|
|
137
|
+
--fld-fs-base: calc(var(--font-size-body-m) * var(--font-size-body-multiplier));
|
|
138
|
+
--fld-lh-base: calc(var(--line-height-body-m) * var(--line-height-body-multiplier));
|
|
139
|
+
--fld-h-base: var(--static-space-56);
|
|
140
|
+
--fld-h-touch: 0px;
|
|
141
|
+
--fld-label-scale: 0.75;
|
|
142
|
+
--fld-gap-loose: 0.375;
|
|
143
|
+
--fld-inset: var(--static-space-16);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.l {
|
|
147
|
+
--fld-fs-base: calc(var(--font-size-body-l) * var(--font-size-body-multiplier));
|
|
148
|
+
--fld-lh-base: calc(var(--line-height-body-l) * var(--line-height-body-multiplier));
|
|
149
|
+
--fld-h-base: var(--static-space-64);
|
|
150
|
+
--fld-h-touch: 0px;
|
|
151
|
+
--fld-label-scale: 0.75;
|
|
152
|
+
--fld-gap-loose: 0.375;
|
|
153
|
+
--fld-inset: var(--static-space-16);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.xl {
|
|
157
|
+
--fld-fs-base: calc(var(--font-size-body-xl) * var(--font-size-body-multiplier));
|
|
158
|
+
--fld-lh-base: calc(var(--line-height-body-xl) * var(--line-height-body-multiplier));
|
|
159
|
+
--fld-h-base: var(--static-space-72);
|
|
160
|
+
--fld-h-touch: 0px;
|
|
161
|
+
--fld-label-scale: 0.75;
|
|
162
|
+
--fld-gap-loose: 0.375;
|
|
163
|
+
--fld-inset: var(--static-space-16);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.resizeHandle {
|
|
167
|
+
&::after {
|
|
168
|
+
pointer-events: none;
|
|
169
|
+
content: '';
|
|
170
|
+
position: absolute;
|
|
171
|
+
right: 0;
|
|
172
|
+
bottom: 0;
|
|
173
|
+
width: var(--static-space-32);
|
|
174
|
+
height: var(--static-space-32);
|
|
175
|
+
border: 1px solid var(--neutral-border-strong);
|
|
176
|
+
transform: translateX(50%) translateY(50%) rotate(45deg);
|
|
177
|
+
background-color: var(--neutral-alpha-weak);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
::-webkit-resizer {
|
|
181
|
+
display: none;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.label {
|
|
186
|
+
position: absolute;
|
|
187
|
+
left: var(--fld-inset);
|
|
188
|
+
transition: transform 0.3s, top 0.3s, left 0.3s;
|
|
189
|
+
color: var(--neutral-on-background-medium);
|
|
190
|
+
pointer-events: none;
|
|
191
|
+
/* `left top`, not the default `left center`: scaling about the top edge makes
|
|
192
|
+
the floating label's `top` its visual top, so the placement maths above can
|
|
193
|
+
be read directly off the value. */
|
|
194
|
+
transform-origin: left top;
|
|
195
|
+
|
|
196
|
+
&.floating {
|
|
197
|
+
transform: scale(var(--fld-label-scale));
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.inputLabel {
|
|
202
|
+
top: 50%;
|
|
203
|
+
transform: translateY(-50%);
|
|
204
|
+
|
|
205
|
+
&.floating {
|
|
206
|
+
top: var(--fld-label-top);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.textareaLabel {
|
|
211
|
+
top: calc(var(--static-space-16) + var(--static-space-2));
|
|
212
|
+
|
|
213
|
+
&.floating {
|
|
214
|
+
top: var(--fld-label-top);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.input {
|
|
219
|
+
width: 100%;
|
|
220
|
+
height: 100%;
|
|
221
|
+
border: none;
|
|
222
|
+
background: none;
|
|
223
|
+
color: var(--neutral-on-background-strong);
|
|
224
|
+
font-size: var(--fld-fs);
|
|
225
|
+
line-height: var(--fld-lh);
|
|
226
|
+
/* The Column's padding already supplies `--fld-well` of the inset. */
|
|
227
|
+
padding: 0 calc(var(--fld-inset) - var(--fld-well));
|
|
228
|
+
outline: none;
|
|
229
|
+
border-radius: var(--radius-s);
|
|
230
|
+
|
|
231
|
+
&.textarea {
|
|
232
|
+
height: auto;
|
|
233
|
+
padding-bottom: var(--static-space-12);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
&::placeholder {
|
|
237
|
+
color: var(--neutral-on-background-weak);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
&:disabled {
|
|
241
|
+
color: var(--neutral-on-background-weak);
|
|
242
|
+
cursor: not-allowed;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
&:autofill,
|
|
246
|
+
&:-webkit-autofill {
|
|
247
|
+
background-color: var(--static-transparent) !important;
|
|
248
|
+
-webkit-box-shadow: 0 0 0 var(--static-space-32) var(--neutral-background-medium) inset !important;
|
|
249
|
+
-webkit-text-fill-color: var(--neutral-on-background-strong) !important;
|
|
250
|
+
/* The browser fills the field without firing focus, blur or change, so
|
|
251
|
+
React never learns the field is no longer empty and the label stayed on
|
|
252
|
+
top of the filled text. An animation is the one event autofill does
|
|
253
|
+
emit: Input.tsx listens for it by name and sets the filled state. */
|
|
254
|
+
animation: onAutoFill 1ms;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/* The value only clears room for the label once the label is actually floating
|
|
259
|
+
above it — an input with no label keeps its text centred by the UA. */
|
|
260
|
+
.base:has(.label.floating) .input {
|
|
261
|
+
padding-top: var(--fld-value-top);
|
|
262
|
+
|
|
263
|
+
&:not(.textarea) {
|
|
264
|
+
padding-bottom: var(--fld-value-bottom);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.error {
|
|
269
|
+
.base {
|
|
270
|
+
background-color: var(--danger-background-medium);
|
|
271
|
+
border-color: var(--danger-border-medium);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.input,
|
|
275
|
+
.prefix,
|
|
276
|
+
.suffix {
|
|
277
|
+
color: var(--danger-on-background-medium);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.label {
|
|
281
|
+
color: var(--danger-on-background-weak);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.resizeHandle {
|
|
285
|
+
&::after {
|
|
286
|
+
border-color: var(--danger-border-medium);
|
|
287
|
+
background-color: var(--danger-alpha-weak);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.prefix,
|
|
293
|
+
.suffix {
|
|
294
|
+
align-self: center;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.input[type="color"] {
|
|
298
|
+
opacity: 0;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/* Inert by design — the animation exists only so autofill announces itself,
|
|
302
|
+
and nothing reads `--fld-autofill`. A custom property is animated rather
|
|
303
|
+
than a real one so the keyframes cannot fight any declared style, and the
|
|
304
|
+
duration is non-zero so `animationstart` is guaranteed to fire. */
|
|
305
|
+
@keyframes onAutoFill {
|
|
306
|
+
from {
|
|
307
|
+
--fld-autofill: 0;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
to {
|
|
311
|
+
--fld-autofill: 1;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InteractiveDetails.d.ts","sourceRoot":"","sources":["../../src/components/InteractiveDetails.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAA4B,eAAe,EAAO,MAAM,GAAG,CAAC;AAEnE,UAAU,uBAAuB;IAC/B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,QAAA,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,
|
|
1
|
+
{"version":3,"file":"InteractiveDetails.d.ts","sourceRoot":"","sources":["../../src/components/InteractiveDetails.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAA4B,eAAe,EAAO,MAAM,GAAG,CAAC;AAEnE,UAAU,uBAAuB;IAC/B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,QAAA,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAkCxD,CAAC;AAIH,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAC9B,YAAY,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
4
|
import { Text, Column, IconButton, Row } from ".";
|
|
5
5
|
const InteractiveDetails = forwardRef(({ label, description, iconButtonProps, onClick, className, id, disabled }, ref) => {
|
|
6
|
-
return (_jsxs(Column, { ref: ref, cursor: disabled ? "not-allowed" : undefined, className: className, onClick: onClick, id: id, children: [_jsxs(Row, { gap: "4", vertical: "center", children: [_jsx(Text, { as: "span", variant: "label-default-m", onBackground: disabled ? "neutral-weak" : "neutral-strong", children: label }), iconButtonProps?.tooltip && (_jsx("div", { onClick: (e) => e.stopPropagation(), children: _jsx(IconButton, { size: "s", variant: "ghost", icon: "help", ...iconButtonProps }) }))] }), description && (_jsx(Text, { as: "span", variant: "body-default-s", onBackground: "neutral-weak", children: description }))] }));
|
|
6
|
+
return (_jsxs(Column, { ref: ref, cursor: disabled ? "not-allowed" : undefined, className: className, onClick: onClick, id: id, children: [_jsxs(Row, { gap: "4", vertical: "center", children: [_jsx(Text, { as: "span", variant: "label-default-m", onBackground: disabled ? "neutral-weak" : "neutral-strong", children: label }), iconButtonProps?.tooltip && (_jsx("div", { onClick: (e) => e.stopPropagation(), children: _jsx(IconButton, { size: "s", variant: "ghost", icon: "help", "aria-label": "More information", ...iconButtonProps }) }))] }), description && (_jsx(Text, { as: "span", variant: "body-default-s", onBackground: "neutral-weak", children: description }))] }));
|
|
7
7
|
});
|
|
8
8
|
InteractiveDetails.displayName = "InteractiveDetails";
|
|
9
9
|
export { InteractiveDetails };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InteractiveDetails.js","sourceRoot":"","sources":["../../src/components/InteractiveDetails.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAc,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,E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,CAAC;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,QAAA,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"Kbd.d.ts","sourceRoot":"","sources":["../../src/components/Kbd.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAc,MAAM,OAAO,CAAC;AAErD,OAAO,EAAE,IAAI,EAAQ,MAAM,GAAG,CAAC;AAE/B,UAAU,QAAS,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,QAAA,MAAM,GAAG,8FA0BR,CAAC;AAIF,OAAO,EAAE,GAAG,EAAE,CAAC;AACf,YAAY,EAAE,QAAQ,EAAE,CAAC"}
|
package/dist/components/Kbd.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { Flex, Text } from ".";
|
|
4
|
-
const Kbd = forwardRef(({ label, children, className, style, ...rest }, ref) => (_jsx(Flex, { as: "kbd", ref: ref,
|
|
4
|
+
const Kbd = forwardRef(({ label, children, className, style, ...rest }, ref) => (_jsx(Flex, { as: "kbd", ref: ref,
|
|
5
|
+
// A <kbd> belongs in a sentence. Flex is display: flex, so without this
|
|
6
|
+
// one every Kbd in prose broke the line and filled the column.
|
|
7
|
+
inline: true, fit: true, horizontal: "center", minWidth: "32", background: "neutral-strong", radius: "s", paddingX: "4", paddingY: "2", onBackground: "neutral-medium", border: "neutral-strong", className: className, style: style, ...rest, children: _jsx(Text, { as: "span", variant: "label-default-s", children: label || children }) })));
|
|
5
8
|
Kbd.displayName = "Kbd";
|
|
6
9
|
export { Kbd };
|
|
7
10
|
//# sourceMappingURL=Kbd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Kbd.js","sourceRoot":"","sources":["../../src/components/Kbd.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAa,UAAU,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC;AAS/B,MAAM,GAAG,GAAG,UAAU,CACpB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CACvD,KAAC,IAAI,IACH,EAAE,EAAC,KAAK,EACR,GAAG,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"Kbd.js","sourceRoot":"","sources":["../../src/components/Kbd.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAa,UAAU,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC;AAS/B,MAAM,GAAG,GAAG,UAAU,CACpB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CACvD,KAAC,IAAI,IACH,EAAE,EAAC,KAAK,EACR,GAAG,EAAE,GAAG;IACR,wEAAwE;IACxE,+DAA+D;IAC/D,MAAM,QACN,GAAG,QACH,UAAU,EAAC,QAAQ,EACnB,QAAQ,EAAC,IAAI,EACb,UAAU,EAAC,gBAAgB,EAC3B,MAAM,EAAC,GAAG,EACV,QAAQ,EAAC,GAAG,EACZ,QAAQ,EAAC,GAAG,EACZ,YAAY,EAAC,gBAAgB,EAC7B,MAAM,EAAC,gBAAgB,EACvB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,KACR,IAAI,YAER,KAAC,IAAI,IAAC,EAAE,EAAC,MAAM,EAAC,OAAO,EAAC,iBAAiB,YACtC,KAAK,IAAI,QAAQ,GACb,GACF,CACR,CACF,CAAC;AAEF,GAAG,CAAC,WAAW,GAAG,KAAK,CAAC;AAExB,OAAO,EAAE,GAAG,EAAE,CAAC"}
|
|
@@ -1,11 +1,23 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { TShirtSizes } from "../types";
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { TShirtSizes } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* A single asset, or one per theme.
|
|
5
|
+
*
|
|
6
|
+
* Passing `{ light, dark }` renders both and lets CSS pick, so one `<Logo>`
|
|
7
|
+
* covers both themes. Before this you had to render the component twice —
|
|
8
|
+
* once with `light`, once with `dark` — which meant eight elements for four
|
|
9
|
+
* client logos in a row, and two places to keep in sync for every change.
|
|
10
|
+
*/
|
|
11
|
+
type LogoSource = string | {
|
|
12
|
+
light: string;
|
|
13
|
+
dark: string;
|
|
14
|
+
};
|
|
3
15
|
interface LogoProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
4
16
|
className?: string;
|
|
5
17
|
size?: TShirtSizes;
|
|
6
18
|
style?: React.CSSProperties;
|
|
7
|
-
icon?:
|
|
8
|
-
wordmark?:
|
|
19
|
+
icon?: LogoSource;
|
|
20
|
+
wordmark?: LogoSource;
|
|
9
21
|
href?: string;
|
|
10
22
|
dark?: boolean;
|
|
11
23
|
light?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Logo.d.ts","sourceRoot":"","sources":["../../src/components/Logo.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Logo.d.ts","sourceRoot":"","sources":["../../src/components/Logo.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAgB,WAAW,EAAE,MAAM,UAAU,CAAC;AAW1D;;;;;;;GAOG;AACH,KAAK,UAAU,GAAG,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3D,UAAU,SAAU,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,OAAO,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC1C;AAED,QAAA,MAAM,IAAI,kFA8LT,CAAC;AAIF,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
package/dist/components/Logo.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useEffect, forwardRef } from "react";
|
|
4
|
-
import Link from "next/link";
|
|
5
3
|
import classNames from "clsx";
|
|
6
|
-
import {
|
|
7
|
-
import { useToast } from "../contexts";
|
|
4
|
+
import { forwardRef, useEffect } from "react";
|
|
5
|
+
import { useAdapters, useToast } from "../contexts";
|
|
6
|
+
import { Column, ContextMenu, Flex, Icon, Line, Option } from ".";
|
|
8
7
|
const sizeMap = {
|
|
9
8
|
xs: "20",
|
|
10
9
|
s: "24",
|
|
@@ -18,14 +17,33 @@ const Logo = forwardRef(({ size = "m", href, icon, wordmark, className, style, d
|
|
|
18
17
|
console.warn("Both 'icon' and 'wordmark' props are set to false. The logo will not render any content.");
|
|
19
18
|
}
|
|
20
19
|
}, [icon, wordmark]);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
/**
|
|
21
|
+
* One <img> for a plain source; for a per-theme source, both, each gated by
|
|
22
|
+
* the same light-flex / dark-flex classes the `light` and `dark` props use.
|
|
23
|
+
* Rendering both rather than reading the theme at runtime keeps the
|
|
24
|
+
* component server-renderable and avoids a flash on first paint.
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* The copy-to-clipboard actions need one concrete file. A per-theme source
|
|
28
|
+
* has two, so they take the light asset — the one a brand page shows by
|
|
29
|
+
* default and the one someone pasting a logo almost always wants.
|
|
30
|
+
*/
|
|
31
|
+
const resolveSource = (source) => typeof source === "string" ? source : source?.light;
|
|
32
|
+
const renderSource = (source) => {
|
|
33
|
+
if (!source)
|
|
34
|
+
return null;
|
|
35
|
+
const imgStyle = {
|
|
36
|
+
height: `var(--static-space-${sizeMap[size]})`,
|
|
37
|
+
width: "auto",
|
|
38
|
+
};
|
|
39
|
+
if (typeof source === "string") {
|
|
40
|
+
return _jsx("img", { style: imgStyle, alt: "Trademark", src: source });
|
|
41
|
+
}
|
|
42
|
+
return (_jsxs(_Fragment, { children: [_jsx("img", { className: "light-flex", style: imgStyle, alt: "Trademark", src: source.light }), _jsx("img", { className: "dark-flex", style: imgStyle, alt: "Trademark", src: source.dark })] }));
|
|
43
|
+
};
|
|
44
|
+
const content = (_jsxs(_Fragment, { children: [renderSource(icon), renderSource(wordmark)] }));
|
|
28
45
|
const { addToast } = useToast();
|
|
46
|
+
const { Link } = useAdapters();
|
|
29
47
|
const copyIconToClipboard = async () => {
|
|
30
48
|
if (!icon) {
|
|
31
49
|
addToast({
|
|
@@ -35,7 +53,7 @@ const Logo = forwardRef(({ size = "m", href, icon, wordmark, className, style, d
|
|
|
35
53
|
return;
|
|
36
54
|
}
|
|
37
55
|
try {
|
|
38
|
-
const response = await fetch(icon);
|
|
56
|
+
const response = await fetch(resolveSource(icon));
|
|
39
57
|
const svgText = await response.text();
|
|
40
58
|
await navigator.clipboard.writeText(svgText);
|
|
41
59
|
addToast({
|
|
@@ -60,7 +78,7 @@ const Logo = forwardRef(({ size = "m", href, icon, wordmark, className, style, d
|
|
|
60
78
|
return;
|
|
61
79
|
}
|
|
62
80
|
try {
|
|
63
|
-
const response = await fetch(wordmark);
|
|
81
|
+
const response = await fetch(resolveSource(wordmark));
|
|
64
82
|
const svgText = await response.text();
|
|
65
83
|
await navigator.clipboard.writeText(svgText);
|
|
66
84
|
addToast({
|
|
@@ -77,7 +95,7 @@ const Logo = forwardRef(({ size = "m", href, icon, wordmark, className, style, d
|
|
|
77
95
|
}
|
|
78
96
|
};
|
|
79
97
|
const renderDropdownContent = () => {
|
|
80
|
-
return (_jsxs(Column, { fillWidth: true, children: [_jsxs(Column, { fillWidth: true, padding: "4", gap: "4", children: [brand?.copy && icon && (_jsx(Option, { value: "copy-icon", label: "Copy icon as SVG",
|
|
98
|
+
return (_jsxs(Column, { fillWidth: true, children: [_jsxs(Column, { fillWidth: true, padding: "4", gap: "4", children: [brand?.copy && icon && (_jsx(Option, { value: "copy-icon", label: "Copy icon as SVG", prefix: _jsx(Logo, { size: "xs", icon: icon, style: { opacity: 0.5 } }), onClick: copyIconToClipboard })), brand?.copy && wordmark && (_jsx(Option, { value: "copy-wordmark", label: "Copy wordmark as SVG", prefix: _jsx(Icon, { size: "xs", onBackground: "neutral-weak", name: "wordmark" }), onClick: copyWordmarkToClipboard }))] }), brand?.url && (_jsxs(_Fragment, { children: [_jsx(Line, {}), _jsx(Column, { fillWidth: true, padding: "4", children: _jsx(Option, { value: "brand-guidelines", label: "Visit brand guidelines", prefix: _jsx(Icon, { size: "xs", onBackground: "neutral-weak", name: "arrowUpRight" }), href: brand.url }) })] }))] }));
|
|
81
99
|
};
|
|
82
100
|
const enableContext = brand && ((brand.copy && (icon || wordmark)) || brand.url);
|
|
83
101
|
const renderLogo = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Logo.js","sourceRoot":"","sources":["../../src/components/Logo.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,
|
|
1
|
+
{"version":3,"file":"Logo.js","sourceRoot":"","sources":["../../src/components/Logo.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,UAAU,MAAM,MAAM,CAAC;AAE9B,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;AAElE,MAAM,OAAO,GAAiC;IAC5C,EAAE,EAAE,IAAI;IACR,CAAC,EAAE,IAAI;IACP,CAAC,EAAE,IAAI;IACP,CAAC,EAAE,IAAI;IACP,EAAE,EAAE,IAAI;CACT,CAAC;AAwBF,MAAM,IAAI,GAAG,UAAU,CACrB,CAAC,EAAE,IAAI,GAAG,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IAC5F,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACvB,OAAO,CAAC,IAAI,CACV,0FAA0F,CAC3F,CAAC;QACJ,CAAC;IACH,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IAErB;;;;;OAKG;IACH;;;;OAIG;IACH,MAAM,aAAa,GAAG,CAAC,MAA8B,EAAsB,EA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AU,GAAG,GAAG,EAAE;QACtB,IAAI,IAAI,EAAE,CAAC;YACT,OAAO,CACL,KAAC,IAAI,IACH,SAAS,EAAE,UAAU,CACnB,UAAU,EACV,cAAc,EACd,YAAY,EACZ,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,EACvB,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,EACzB,SAAS,CACV,EACD,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,gBACC,WAAW,KAClB,KAAK,YAER,OAAO,GACH,CACR,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,OAAO,CACL,KAAC,IAAI,IACH,SAAS,EAAE,UAAU,CAAC,SAAS,CAAC,EAChC,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,MAAM,EAAC,GAAG,EACV,SAAS,QACT,KAAK,EAAE,KAAK,gBACD,WAAW,YAErB,OAAO,GACH,CACR,CAAC;QACJ,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,aAAa,CAAC,CAAC,CAAC,CACrB,KAAC,WAAW,IAAC,QAAQ,EAAE,qBAAqB,EAAE,EAAE,SAAS,EAAC,cAAc,YACrE,UAAU,EAAE,GACD,CACf,CAAC,CAAC,CAAC,CACF,UAAU,EAAE,CACb,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC;AAE1B,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import { type CSSProperties, type ReactNode } from "react";
|
|
2
3
|
import { Flex } from ".";
|
|
3
4
|
export interface MediaProps extends React.ComponentProps<typeof Flex> {
|
|
4
5
|
aspectRatio?: string;
|
|
@@ -12,7 +13,13 @@ export interface MediaProps extends React.ComponentProps<typeof Flex> {
|
|
|
12
13
|
sizes?: string | number;
|
|
13
14
|
priority?: boolean;
|
|
14
15
|
caption?: ReactNode;
|
|
15
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Drop the intrinsic aspect ratio and let the media stretch to whatever box
|
|
18
|
+
* it is in. Named `stretch` rather than `fill` because `fill` is a layout
|
|
19
|
+
* prop on every Flex-derived component (fillWidth + fillHeight) and shadowing
|
|
20
|
+
* it here meant `<Media fill />` did not do the one thing its name promised.
|
|
21
|
+
*/
|
|
22
|
+
stretch?: boolean;
|
|
16
23
|
fillWidth?: boolean;
|
|
17
24
|
loop?: boolean;
|
|
18
25
|
autoplay?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Media.d.ts","sourceRoot":"","sources":["../../src/components/Media.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Media.d.ts","sourceRoot":"","sources":["../../src/components/Media.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,aAAa,EAAc,KAAK,SAAS,EAA+B,MAAM,OAAO,CAAC;AAEpG,OAAO,EAAU,IAAI,EAA6B,MAAM,GAAG,CAAC;AAG5D,MAAM,WAAW,UAAW,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC;IACnE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IACvC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,KAAK,gGAgQV,CAAC;AAIF,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
package/dist/components/Media.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { useState, useRef, useEffect, forwardRef } from "react";
|
|
4
|
-
import { Column, Flex, Row, Skeleton, ScrollLock } from ".";
|
|
5
|
-
import { MediaVideoPlayer } from "./MediaVideoPlayer";
|
|
6
|
-
import Image from "next/image";
|
|
7
3
|
import classNames from "clsx";
|
|
8
|
-
|
|
4
|
+
import { forwardRef, useEffect, useRef, useState } from "react";
|
|
5
|
+
import { useAdapters } from "../contexts/AdapterProvider";
|
|
6
|
+
import { Column, Flex, Row, ScrollLock, Skeleton } from ".";
|
|
7
|
+
import { MediaVideoPlayer } from "./MediaVideoPlayer";
|
|
8
|
+
const Media = forwardRef(({ src, alt = "", fillWidth = true, stretch = false, loading = false, enlarge = false, unoptimized = false, objectFit = "cover", sizes = "100vw", aspectRatio = "original", height, priority, caption, loop = true, autoplay = true, sound = false, controls = false, style, className, ...rest }, ref) => {
|
|
9
|
+
const { Image } = useAdapters();
|
|
9
10
|
const [isEnlarged, setIsEnlarged] = useState(false);
|
|
10
11
|
const imageRef = useRef(null);
|
|
11
12
|
const handleImageClick = () => {
|
|
@@ -59,11 +60,11 @@ const Media = forwardRef(({ src, alt = "", fillWidth = true, fill = false, loadi
|
|
|
59
60
|
};
|
|
60
61
|
};
|
|
61
62
|
const isYouTubeVideo = (url) => {
|
|
62
|
-
const youtubeRegex = /(?:youtube\.com\/(?:[
|
|
63
|
+
const youtubeRegex = /(?:youtube\.com\/(?:[^/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/;
|
|
63
64
|
return youtubeRegex.test(url);
|
|
64
65
|
};
|
|
65
66
|
const getYouTubeEmbedUrl = (url) => {
|
|
66
|
-
const match = url.match(/(?:youtube\.com\/(?:[
|
|
67
|
+
const match = url.match(/(?:youtube\.com\/(?:[^/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/);
|
|
67
68
|
if (!match)
|
|
68
69
|
return "";
|
|
69
70
|
const id = match[1];
|
|
@@ -86,30 +87,38 @@ const Media = forwardRef(({ src, alt = "", fillWidth = true, fill = false, loadi
|
|
|
86
87
|
const isYouTube = isYouTubeVideo(src);
|
|
87
88
|
const useCustomVideoControls = isVideo && controls;
|
|
88
89
|
const canEnlarge = enlarge && !useCustomVideoControls;
|
|
89
|
-
const resolvedSizes = typeof sizes === "number"
|
|
90
|
-
|
|
91
|
-
: sizes;
|
|
92
|
-
return (_jsxs(_Fragment, { children: [_jsx(ScrollLock, { enabled: isEnlarged }), isEnlarged && canEnlarge && typeof document !== 'undefined' && (_jsx(Flex, { center: true, position: "fixed", background: "overlay", pointerEvents: "auto", onClick: handleOverlayClick, top: "0", left: "0", zIndex: 9, opacity: 100, cursor: "interactive", transition: "macro-medium", className: "cursor-interactive", style: {
|
|
90
|
+
const resolvedSizes = typeof sizes === "number" ? `(max-width: ${sizes}px) 100vw, ${sizes}px` : sizes;
|
|
91
|
+
return (_jsxs(_Fragment, { children: [_jsx(ScrollLock, { enabled: isEnlarged }), isEnlarged && canEnlarge && typeof document !== "undefined" && (_jsx(Flex, { center: true, position: "fixed", background: "overlay", pointerEvents: "auto", onClick: handleOverlayClick, top: "0", left: "0", zIndex: 9, opacity: 100, cursor: "interactive", transition: "macro-medium", className: "cursor-interactive", style: {
|
|
93
92
|
backdropFilter: "blur(0.5rem)",
|
|
94
93
|
width: "100vw",
|
|
95
94
|
height: "100vh",
|
|
96
|
-
} })), _jsxs(_Fragment, { children: [_jsxs(Column, { as: caption ? "figure" : undefined, ref: imageRef, fillWidth:
|
|
95
|
+
} })), _jsxs(_Fragment, { children: [_jsxs(Column, { as: caption ? "figure" : undefined, ref: imageRef, fillWidth: fillWidth, overflow: "hidden", zIndex: 0, margin: "0", style: {
|
|
97
96
|
outline: "none",
|
|
98
97
|
isolation: "isolate",
|
|
99
|
-
height: aspectRatio === "original"
|
|
98
|
+
height: aspectRatio === "original"
|
|
99
|
+
? undefined
|
|
100
|
+
: aspectRatio
|
|
101
|
+
? ""
|
|
102
|
+
: height
|
|
103
|
+
? `${height}rem`
|
|
104
|
+
: "100%",
|
|
100
105
|
aspectRatio: aspectRatio === "original" ? undefined : aspectRatio,
|
|
101
106
|
borderRadius: isEnlarged ? "0" : undefined,
|
|
102
107
|
...calculateTransform(),
|
|
103
108
|
...style,
|
|
104
|
-
}, onClick: handleImageClick, className: classNames(canEnlarge && !isEnlarged
|
|
109
|
+
}, onClick: handleImageClick, className: classNames(canEnlarge && !isEnlarged
|
|
110
|
+
? "cursor-zoom-in"
|
|
111
|
+
: canEnlarge && isEnlarged
|
|
112
|
+
? "cursor-zoom-out"
|
|
113
|
+
: undefined, className), ...rest, children: [loading && _jsx(Skeleton, { shape: "block", radius: rest.radius }), !loading && isVideo && useCustomVideoControls && (_jsx(MediaVideoPlayer, { src: src, autoplay: autoplay, loop: loop, muted: !sound, objectFit: objectFit })), !loading && isVideo && !useCustomVideoControls && (_jsx("video", { src: src, autoPlay: autoplay, loop: loop, muted: !sound, playsInline: true, style: {
|
|
105
114
|
width: "100%",
|
|
106
115
|
height: "100%",
|
|
107
116
|
objectFit: objectFit,
|
|
108
117
|
} })), !loading && isYouTube && (_jsx("iframe", { width: "100%", height: "100%", src: getYouTubeEmbedUrl(src), frameBorder: "0", allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture", allowFullScreen: true, style: {
|
|
109
118
|
objectFit: objectFit,
|
|
110
|
-
} })), !loading && !isVideo && !isYouTube && (_jsx(Image, { src: src, alt: alt, sizes: isEnlarged ? "100vw" : resolvedSizes, priority: priority, unoptimized: unoptimized, fill:
|
|
119
|
+
} })), !loading && !isVideo && !isYouTube && (_jsx(Image, { src: src, alt: alt, sizes: isEnlarged ? "100vw" : resolvedSizes, priority: priority, unoptimized: unoptimized, fill: stretch || !aspectRatio, width: stretch ? undefined : 0, height: stretch ? undefined : 0, style: {
|
|
111
120
|
objectFit: objectFit,
|
|
112
|
-
aspectRatio:
|
|
121
|
+
aspectRatio: stretch ? undefined : aspectRatio,
|
|
113
122
|
width: aspectRatio ? "100%" : undefined,
|
|
114
123
|
height: aspectRatio ? "100%" : undefined,
|
|
115
124
|
} }))] }), caption && (_jsx(Row, { as: "figcaption", fillWidth: true, textVariant: "label-default-s", onBackground: "neutral-weak", paddingY: "12", paddingX: "24", horizontal: "center", align: "center", children: caption }))] })] }));
|