rift-ds 1.0.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/LICENSE +21 -0
- package/README.md +107 -0
- package/behaviors/focusable.d.ts +26 -0
- package/behaviors/focusable.js +18 -0
- package/behaviors/useFocusScope.d.ts +38 -0
- package/behaviors/useFocusScope.js +82 -0
- package/behaviors/useLayer.d.ts +43 -0
- package/behaviors/useLayer.js +55 -0
- package/behaviors/useMounted.d.ts +7 -0
- package/behaviors/useMounted.js +14 -0
- package/behaviors/useScrollLock.d.ts +55 -0
- package/behaviors/useScrollLock.js +59 -0
- package/bin/rift-ds.mjs +82 -0
- package/charts.d.ts +16 -0
- package/charts.js +24 -0
- package/components/Accordion/Accordion.css +119 -0
- package/components/Accordion/Accordion.d.ts +24 -0
- package/components/Accordion/Accordion.js +76 -0
- package/components/AgentPlan/AgentPlan.css +251 -0
- package/components/AgentPlan/AgentPlan.d.ts +41 -0
- package/components/AgentPlan/AgentPlan.js +100 -0
- package/components/AgentRail/AgentRail.css +282 -0
- package/components/AgentRail/AgentRail.d.ts +72 -0
- package/components/AgentRail/AgentRail.js +101 -0
- package/components/AgentStatus/AgentStatus.css +511 -0
- package/components/AgentStatus/AgentStatus.d.ts +41 -0
- package/components/AgentStatus/AgentStatus.js +86 -0
- package/components/AgentStatus/AgentStatusPatterns.d.ts +17 -0
- package/components/AgentStatus/AgentStatusPatterns.js +20 -0
- package/components/AiButton/AiButton.css +559 -0
- package/components/AiButton/AiButton.d.ts +79 -0
- package/components/AiButton/AiButton.js +183 -0
- package/components/Alert/Alert.css +261 -0
- package/components/Alert/Alert.d.ts +25 -0
- package/components/Alert/Alert.js +53 -0
- package/components/AlertDialog/AlertDialog.css +133 -0
- package/components/AlertDialog/AlertDialog.d.ts +29 -0
- package/components/AlertDialog/AlertDialog.js +98 -0
- package/components/AnchorNav/AnchorNav.css +137 -0
- package/components/AnchorNav/AnchorNav.d.ts +40 -0
- package/components/AnchorNav/AnchorNav.js +135 -0
- package/components/AnimatedNumber/AnimatedNumber.css +31 -0
- package/components/AnimatedNumber/AnimatedNumber.d.ts +36 -0
- package/components/AnimatedNumber/AnimatedNumber.js +55 -0
- package/components/AppLayout/AppLayout.css +52 -0
- package/components/AppLayout/AppLayout.d.ts +33 -0
- package/components/AppLayout/AppLayout.js +47 -0
- package/components/AppSidebar/AppSidebar.css +592 -0
- package/components/AppSidebar/AppSidebar.d.ts +90 -0
- package/components/AppSidebar/AppSidebar.js +295 -0
- package/components/Avatar/Avatar.css +133 -0
- package/components/Avatar/Avatar.d.ts +20 -0
- package/components/Avatar/Avatar.js +58 -0
- package/components/Avatar/demoAvatars.d.ts +18 -0
- package/components/Avatar/demoAvatars.js +16 -0
- package/components/AvatarGroup/AvatarGroup.css +61 -0
- package/components/AvatarGroup/AvatarGroup.d.ts +32 -0
- package/components/AvatarGroup/AvatarGroup.js +31 -0
- package/components/Badge/Badge.css +67 -0
- package/components/Badge/Badge.d.ts +13 -0
- package/components/Badge/Badge.js +15 -0
- package/components/Banner/Banner.css +110 -0
- package/components/Banner/Banner.d.ts +36 -0
- package/components/Banner/Banner.js +59 -0
- package/components/Breadcrumb/Breadcrumb.css +100 -0
- package/components/Breadcrumb/Breadcrumb.d.ts +25 -0
- package/components/Breadcrumb/Breadcrumb.js +40 -0
- package/components/Button/Button.css +473 -0
- package/components/Button/Button.d.ts +73 -0
- package/components/Button/Button.js +91 -0
- package/components/ButtonGroup/ButtonGroup.css +39 -0
- package/components/ButtonGroup/ButtonGroup.d.ts +13 -0
- package/components/ButtonGroup/ButtonGroup.js +30 -0
- package/components/Card/Card.css +190 -0
- package/components/Card/Card.d.ts +48 -0
- package/components/Card/Card.js +113 -0
- package/components/CardStack/CardStack.css +106 -0
- package/components/CardStack/CardStack.d.ts +44 -0
- package/components/CardStack/CardStack.js +140 -0
- package/components/Carousel/Carousel.css +121 -0
- package/components/Carousel/Carousel.d.ts +25 -0
- package/components/Carousel/Carousel.js +160 -0
- package/components/Chart/AreaChart.d.ts +40 -0
- package/components/Chart/AreaChart.js +101 -0
- package/components/Chart/BarChart.d.ts +36 -0
- package/components/Chart/BarChart.js +107 -0
- package/components/Chart/Chart.css +224 -0
- package/components/Chart/ComboChart.d.ts +40 -0
- package/components/Chart/ComboChart.js +142 -0
- package/components/Chart/LineChart.d.ts +36 -0
- package/components/Chart/LineChart.js +91 -0
- package/components/Chart/PieChart.d.ts +36 -0
- package/components/Chart/PieChart.js +93 -0
- package/components/Chart/RadarChart.d.ts +36 -0
- package/components/Chart/RadarChart.js +92 -0
- package/components/Chart/RadialChart.d.ts +43 -0
- package/components/Chart/RadialChart.js +114 -0
- package/components/Chart/ScatterChart.d.ts +38 -0
- package/components/Chart/ScatterChart.js +99 -0
- package/components/Chart/StackedBarChart.d.ts +36 -0
- package/components/Chart/StackedBarChart.js +98 -0
- package/components/Chart/Treemap.d.ts +35 -0
- package/components/Chart/Treemap.js +95 -0
- package/components/Chart/palette.d.ts +1 -0
- package/components/Chart/palette.js +17 -0
- package/components/ChatHeader/ChatHeader.css +35 -0
- package/components/ChatHeader/ChatHeader.d.ts +30 -0
- package/components/ChatHeader/ChatHeader.js +17 -0
- package/components/ChatMarker/ChatMarker.css +61 -0
- package/components/ChatMarker/ChatMarker.d.ts +22 -0
- package/components/ChatMarker/ChatMarker.js +18 -0
- package/components/ChatMessage/ChatMessage.css +326 -0
- package/components/ChatMessage/ChatMessage.d.ts +74 -0
- package/components/ChatMessage/ChatMessage.js +71 -0
- package/components/ChatThread/ChatThread.css +171 -0
- package/components/ChatThread/ChatThread.d.ts +41 -0
- package/components/ChatThread/ChatThread.js +175 -0
- package/components/Checkbox/Checkbox.css +183 -0
- package/components/Checkbox/Checkbox.d.ts +81 -0
- package/components/Checkbox/Checkbox.js +176 -0
- package/components/Chip/Chip.css +231 -0
- package/components/Chip/Chip.d.ts +27 -0
- package/components/Chip/Chip.js +80 -0
- package/components/CircularButton/CircularButton.css +263 -0
- package/components/CircularButton/CircularButton.d.ts +68 -0
- package/components/CircularButton/CircularButton.js +72 -0
- package/components/CodeBlock/CodeBlock.css +189 -0
- package/components/CodeBlock/CodeBlock.d.ts +23 -0
- package/components/CodeBlock/CodeBlock.js +96 -0
- package/components/CodeDiff/CodeDiff.css +175 -0
- package/components/CodeDiff/CodeDiff.d.ts +58 -0
- package/components/CodeDiff/CodeDiff.js +114 -0
- package/components/ColorPicker/ColorPicker.css +278 -0
- package/components/ColorPicker/ColorPicker.d.ts +50 -0
- package/components/ColorPicker/ColorPicker.js +349 -0
- package/components/ColourSwatch/ColourSwatch.css +88 -0
- package/components/ColourSwatch/ColourSwatch.d.ts +34 -0
- package/components/ColourSwatch/ColourSwatch.js +42 -0
- package/components/Combobox/Combobox.css +384 -0
- package/components/Combobox/Combobox.d.ts +93 -0
- package/components/Combobox/Combobox.js +331 -0
- package/components/CommandPalette/CommandPalette.css +342 -0
- package/components/CommandPalette/CommandPalette.d.ts +62 -0
- package/components/CommandPalette/CommandPalette.js +247 -0
- package/components/Composer/Composer.css +427 -0
- package/components/Composer/Composer.d.ts +97 -0
- package/components/Composer/Composer.js +146 -0
- package/components/ContactCard/ContactCard.css +132 -0
- package/components/ContactCard/ContactCard.d.ts +24 -0
- package/components/ContactCard/ContactCard.js +79 -0
- package/components/ContextMenu/ContextMenu.css +258 -0
- package/components/ContextMenu/ContextMenu.d.ts +26 -0
- package/components/ContextMenu/ContextMenu.js +387 -0
- package/components/ContributionGraph/ContributionGraph.css +169 -0
- package/components/ContributionGraph/ContributionGraph.d.ts +34 -0
- package/components/ContributionGraph/ContributionGraph.js +149 -0
- package/components/DataTable/DataTable.css +109 -0
- package/components/DataTable/DataTable.d.ts +81 -0
- package/components/DataTable/DataTable.js +236 -0
- package/components/DateInput/DateInput.css +127 -0
- package/components/DateInput/DateInput.d.ts +44 -0
- package/components/DateInput/DateInput.js +82 -0
- package/components/DatePicker/DatePicker.css +198 -0
- package/components/DatePicker/DatePicker.d.ts +29 -0
- package/components/DatePicker/DatePicker.js +196 -0
- package/components/Dialog/Dialog.css +178 -0
- package/components/Dialog/Dialog.d.ts +39 -0
- package/components/Dialog/Dialog.js +99 -0
- package/components/Divider/Divider.css +100 -0
- package/components/Divider/Divider.d.ts +18 -0
- package/components/Divider/Divider.js +31 -0
- package/components/DocumentChip/DocumentChip.css +190 -0
- package/components/DocumentChip/DocumentChip.d.ts +41 -0
- package/components/DocumentChip/DocumentChip.js +78 -0
- package/components/Drawer/Drawer.css +262 -0
- package/components/Drawer/Drawer.d.ts +41 -0
- package/components/Drawer/Drawer.js +101 -0
- package/components/Dropdown/Dropdown.css +288 -0
- package/components/Dropdown/Dropdown.d.ts +85 -0
- package/components/Dropdown/Dropdown.js +308 -0
- package/components/DropdownMenu/DropdownMenu.css +301 -0
- package/components/DropdownMenu/DropdownMenu.d.ts +42 -0
- package/components/DropdownMenu/DropdownMenu.js +371 -0
- package/components/EmptyState/EmptyState.css +136 -0
- package/components/EmptyState/EmptyState.d.ts +27 -0
- package/components/EmptyState/EmptyState.js +32 -0
- package/components/EntityCard/EntityCard.css +69 -0
- package/components/EntityCard/EntityCard.d.ts +19 -0
- package/components/EntityCard/EntityCard.js +26 -0
- package/components/EventCalendar/EventCalendar.css +363 -0
- package/components/EventCalendar/EventCalendar.d.ts +59 -0
- package/components/EventCalendar/EventCalendar.js +230 -0
- package/components/Field/Field.css +80 -0
- package/components/Field/Field.d.ts +57 -0
- package/components/Field/Field.js +70 -0
- package/components/Field/FieldContext.d.ts +42 -0
- package/components/Field/FieldContext.js +8 -0
- package/components/Figure/Figure.css +71 -0
- package/components/Figure/Figure.d.ts +17 -0
- package/components/Figure/Figure.js +26 -0
- package/components/FileInput/FileInput.css +281 -0
- package/components/FileInput/FileInput.d.ts +54 -0
- package/components/FileInput/FileInput.js +205 -0
- package/components/FilterBar/FilterBar.css +202 -0
- package/components/FilterBar/FilterBar.d.ts +55 -0
- package/components/FilterBar/FilterBar.js +249 -0
- package/components/FunnelChart/FunnelChart.css +17 -0
- package/components/FunnelChart/FunnelChart.d.ts +51 -0
- package/components/FunnelChart/FunnelChart.js +96 -0
- package/components/GanttChart/GanttChart.css +326 -0
- package/components/GanttChart/GanttChart.d.ts +82 -0
- package/components/GanttChart/GanttChart.js +202 -0
- package/components/Gauge/Gauge.css +120 -0
- package/components/Gauge/Gauge.d.ts +64 -0
- package/components/Gauge/Gauge.js +111 -0
- package/components/Globe/Globe.css +155 -0
- package/components/Globe/Globe.d.ts +103 -0
- package/components/Globe/Globe.js +416 -0
- package/components/HoverCard/HoverCard.css +125 -0
- package/components/HoverCard/HoverCard.d.ts +29 -0
- package/components/HoverCard/HoverCard.js +83 -0
- package/components/ImageCompare/ImageCompare.css +112 -0
- package/components/ImageCompare/ImageCompare.d.ts +40 -0
- package/components/ImageCompare/ImageCompare.js +134 -0
- package/components/Input/Input.css +150 -0
- package/components/Input/Input.d.ts +45 -0
- package/components/Input/Input.js +99 -0
- package/components/Instructions/Instructions.css +216 -0
- package/components/Instructions/Instructions.d.ts +29 -0
- package/components/Instructions/Instructions.js +32 -0
- package/components/InterruptCard/InterruptCard.css +164 -0
- package/components/InterruptCard/InterruptCard.d.ts +54 -0
- package/components/InterruptCard/InterruptCard.js +57 -0
- package/components/Kbd/Kbd.css +28 -0
- package/components/Kbd/Kbd.d.ts +19 -0
- package/components/Kbd/Kbd.js +14 -0
- package/components/LegendTile/LegendTile.css +60 -0
- package/components/LegendTile/LegendTile.d.ts +30 -0
- package/components/LegendTile/LegendTile.js +21 -0
- package/components/Lightbox/Lightbox.css +210 -0
- package/components/Lightbox/Lightbox.d.ts +45 -0
- package/components/Lightbox/Lightbox.js +109 -0
- package/components/LinkList/LinkList.css +71 -0
- package/components/LinkList/LinkList.d.ts +24 -0
- package/components/LinkList/LinkList.js +42 -0
- package/components/MapCallout/MapCallout.css +46 -0
- package/components/MapCallout/MapCallout.d.ts +29 -0
- package/components/MapCallout/MapCallout.js +17 -0
- package/components/MapLegend/MapLegend.css +88 -0
- package/components/MapLegend/MapLegend.d.ts +40 -0
- package/components/MapLegend/MapLegend.js +68 -0
- package/components/MessageActions/MessageActions.css +85 -0
- package/components/MessageActions/MessageActions.d.ts +38 -0
- package/components/MessageActions/MessageActions.js +40 -0
- package/components/MessageCard/MessageCard.css +163 -0
- package/components/MessageCard/MessageCard.d.ts +35 -0
- package/components/MessageCard/MessageCard.js +30 -0
- package/components/Meter/Meter.css +98 -0
- package/components/Meter/Meter.d.ts +36 -0
- package/components/Meter/Meter.js +48 -0
- package/components/ModelPicker/ModelPicker.css +243 -0
- package/components/ModelPicker/ModelPicker.d.ts +60 -0
- package/components/ModelPicker/ModelPicker.js +261 -0
- package/components/MotionSwatch/MotionSwatch.css +176 -0
- package/components/MotionSwatch/MotionSwatch.d.ts +25 -0
- package/components/MotionSwatch/MotionSwatch.js +74 -0
- package/components/Nav/Nav.css +51 -0
- package/components/Nav/Nav.d.ts +19 -0
- package/components/Nav/Nav.js +26 -0
- package/components/NavList/NavList.css +155 -0
- package/components/NavList/NavList.d.ts +56 -0
- package/components/NavList/NavList.js +100 -0
- package/components/NotificationCenter/NotificationCenter.css +279 -0
- package/components/NotificationCenter/NotificationCenter.d.ts +72 -0
- package/components/NotificationCenter/NotificationCenter.js +145 -0
- package/components/NumberInput/NumberInput.css +163 -0
- package/components/NumberInput/NumberInput.d.ts +44 -0
- package/components/NumberInput/NumberInput.js +147 -0
- package/components/Pagination/Pagination.css +126 -0
- package/components/Pagination/Pagination.d.ts +22 -0
- package/components/Pagination/Pagination.js +84 -0
- package/components/Panel/Panel.css +26 -0
- package/components/Panel/Panel.d.ts +22 -0
- package/components/Panel/Panel.js +19 -0
- package/components/PinInput/PinInput.css +92 -0
- package/components/PinInput/PinInput.d.ts +46 -0
- package/components/PinInput/PinInput.js +161 -0
- package/components/Popover/Popover.css +118 -0
- package/components/Popover/Popover.d.ts +22 -0
- package/components/Popover/Popover.js +113 -0
- package/components/ProgressBar/ProgressBar.css +60 -0
- package/components/ProgressBar/ProgressBar.d.ts +16 -0
- package/components/ProgressBar/ProgressBar.js +27 -0
- package/components/PromptSuggestions/PromptSuggestions.css +264 -0
- package/components/PromptSuggestions/PromptSuggestions.d.ts +68 -0
- package/components/PromptSuggestions/PromptSuggestions.js +87 -0
- package/components/Prose/Prose.css +269 -0
- package/components/Prose/Prose.d.ts +21 -0
- package/components/Prose/Prose.js +14 -0
- package/components/Quote/Quote.css +78 -0
- package/components/Quote/Quote.d.ts +18 -0
- package/components/Quote/Quote.js +26 -0
- package/components/RadioButton/RadioButton.css +151 -0
- package/components/RadioButton/RadioButton.d.ts +90 -0
- package/components/RadioButton/RadioButton.js +138 -0
- package/components/Rating/Rating.css +74 -0
- package/components/Rating/Rating.d.ts +41 -0
- package/components/Rating/Rating.js +124 -0
- package/components/Reasoning/Reasoning.css +291 -0
- package/components/Reasoning/Reasoning.d.ts +55 -0
- package/components/Reasoning/Reasoning.js +99 -0
- package/components/RichDropdown/RichDropdown.css +239 -0
- package/components/RichDropdown/RichDropdown.d.ts +78 -0
- package/components/RichDropdown/RichDropdown.js +227 -0
- package/components/SectionTitle/SectionTitle.css +45 -0
- package/components/SectionTitle/SectionTitle.d.ts +12 -0
- package/components/SectionTitle/SectionTitle.js +22 -0
- package/components/SegmentedControl/SegmentedControl.css +231 -0
- package/components/SegmentedControl/SegmentedControl.d.ts +44 -0
- package/components/SegmentedControl/SegmentedControl.js +240 -0
- package/components/SelectionCard/SelectionCard.css +255 -0
- package/components/SelectionCard/SelectionCard.d.ts +36 -0
- package/components/SelectionCard/SelectionCard.js +102 -0
- package/components/ShaderField/ShaderField.css +24 -0
- package/components/ShaderField/ShaderField.d.ts +68 -0
- package/components/ShaderField/ShaderField.js +55 -0
- package/components/ShaderField/field.glsl.d.ts +39 -0
- package/components/ShaderField/field.glsl.js +178 -0
- package/components/ShaderField/useShaderField.d.ts +103 -0
- package/components/ShaderField/useShaderField.js +410 -0
- package/components/Skeleton/Skeleton.css +81 -0
- package/components/Skeleton/Skeleton.d.ts +16 -0
- package/components/Skeleton/Skeleton.js +30 -0
- package/components/Slider/Slider.css +104 -0
- package/components/Slider/Slider.d.ts +48 -0
- package/components/Slider/Slider.js +86 -0
- package/components/SourceChip/SourceChip.css +111 -0
- package/components/SourceChip/SourceChip.d.ts +32 -0
- package/components/SourceChip/SourceChip.js +31 -0
- package/components/SourceTrail/SourceTrail.css +209 -0
- package/components/SourceTrail/SourceTrail.d.ts +49 -0
- package/components/SourceTrail/SourceTrail.js +108 -0
- package/components/SpacingSwatch/SpacingSwatch.css +108 -0
- package/components/SpacingSwatch/SpacingSwatch.d.ts +20 -0
- package/components/SpacingSwatch/SpacingSwatch.js +50 -0
- package/components/Sparkline/Sparkline.css +76 -0
- package/components/Sparkline/Sparkline.d.ts +51 -0
- package/components/Sparkline/Sparkline.js +116 -0
- package/components/Spinner/Spinner.css +84 -0
- package/components/Spinner/Spinner.d.ts +14 -0
- package/components/Spinner/Spinner.js +42 -0
- package/components/SplitButton/SplitButton.css +93 -0
- package/components/SplitButton/SplitButton.d.ts +43 -0
- package/components/SplitButton/SplitButton.js +67 -0
- package/components/SplitPane/SplitPane.css +106 -0
- package/components/SplitPane/SplitPane.d.ts +36 -0
- package/components/SplitPane/SplitPane.js +130 -0
- package/components/Stat/Stat.css +121 -0
- package/components/Stat/Stat.d.ts +22 -0
- package/components/Stat/Stat.js +36 -0
- package/components/StatusDot/StatusDot.css +104 -0
- package/components/StatusDot/StatusDot.d.ts +34 -0
- package/components/StatusDot/StatusDot.js +23 -0
- package/components/Stepper/Stepper.css +216 -0
- package/components/Stepper/Stepper.d.ts +41 -0
- package/components/Stepper/Stepper.js +61 -0
- package/components/StreamingText/StreamingText.css +40 -0
- package/components/StreamingText/StreamingText.d.ts +62 -0
- package/components/StreamingText/StreamingText.js +49 -0
- package/components/StreamingText/useStreamReveal.d.ts +70 -0
- package/components/StreamingText/useStreamReveal.js +121 -0
- package/components/Swatch/Swatch.css +52 -0
- package/components/Swatch/Swatch.d.ts +34 -0
- package/components/Swatch/Swatch.js +44 -0
- package/components/Table/Table.css +223 -0
- package/components/Table/Table.d.ts +53 -0
- package/components/Table/Table.js +65 -0
- package/components/Tabs/Tabs.css +140 -0
- package/components/Tabs/Tabs.d.ts +28 -0
- package/components/Tabs/Tabs.js +78 -0
- package/components/TagInput/TagInput.css +169 -0
- package/components/TagInput/TagInput.d.ts +43 -0
- package/components/TagInput/TagInput.js +137 -0
- package/components/Textarea/Textarea.css +109 -0
- package/components/Textarea/Textarea.d.ts +43 -0
- package/components/Textarea/Textarea.js +86 -0
- package/components/ThreadPanel/ThreadPanel.css +862 -0
- package/components/ThreadPanel/ThreadPanel.d.ts +175 -0
- package/components/ThreadPanel/ThreadPanel.js +466 -0
- package/components/ThreadTabs/ThreadTabs.css +252 -0
- package/components/ThreadTabs/ThreadTabs.d.ts +54 -0
- package/components/ThreadTabs/ThreadTabs.js +201 -0
- package/components/TimePicker/TimePicker.css +230 -0
- package/components/TimePicker/TimePicker.d.ts +46 -0
- package/components/TimePicker/TimePicker.js +250 -0
- package/components/Timeline/Timeline.css +366 -0
- package/components/Timeline/Timeline.d.ts +67 -0
- package/components/Timeline/Timeline.js +73 -0
- package/components/Toast/Toast.css +363 -0
- package/components/Toast/Toast.d.ts +63 -0
- package/components/Toast/Toast.js +215 -0
- package/components/ToggleGroup/ToggleGroup.css +110 -0
- package/components/ToggleGroup/ToggleGroup.d.ts +50 -0
- package/components/ToggleGroup/ToggleGroup.js +73 -0
- package/components/ToggleSwitch/ToggleSwitch.css +172 -0
- package/components/ToggleSwitch/ToggleSwitch.d.ts +43 -0
- package/components/ToggleSwitch/ToggleSwitch.js +76 -0
- package/components/ToolCall/ToolCall.css +234 -0
- package/components/ToolCall/ToolCall.d.ts +43 -0
- package/components/ToolCall/ToolCall.js +90 -0
- package/components/Toolbar/Toolbar.css +56 -0
- package/components/Toolbar/Toolbar.d.ts +35 -0
- package/components/Toolbar/Toolbar.js +62 -0
- package/components/Tooltip/Tooltip.css +175 -0
- package/components/Tooltip/Tooltip.d.ts +22 -0
- package/components/Tooltip/Tooltip.js +74 -0
- package/components/TreeView/TreeView.css +119 -0
- package/components/TreeView/TreeView.d.ts +45 -0
- package/components/TreeView/TreeView.js +232 -0
- package/components/TypographySwatch/TypographySwatch.css +81 -0
- package/components/TypographySwatch/TypographySwatch.d.ts +24 -0
- package/components/TypographySwatch/TypographySwatch.js +40 -0
- package/components/UsageCard/UsageCard.css +30 -0
- package/components/UsageCard/UsageCard.d.ts +48 -0
- package/components/UsageCard/UsageCard.js +54 -0
- package/components/Waveform/Waveform.css +97 -0
- package/components/Waveform/Waveform.d.ts +44 -0
- package/components/Waveform/Waveform.js +46 -0
- package/components/WorldMap/WorldMap.css +234 -0
- package/components/WorldMap/WorldMap.d.ts +113 -0
- package/components/WorldMap/WorldMap.js +427 -0
- package/components/WorldMap/land.d.ts +14 -0
- package/components/WorldMap/land.js +4 -0
- package/components/registry.d.ts +79 -0
- package/components/registry.js +13 -0
- package/components/registry.json +1153 -0
- package/components/registry.json.d.ts +1156 -0
- package/components/registry.json.js +11 -0
- package/fonts/MaterialSymbolsRounded-VariableFont_FILL,GRAD,opsz,wght.woff2 +0 -0
- package/fonts/material-symbols.css +94 -0
- package/fonts/presets/dm-sans-300-700-latin-ext.woff2 +0 -0
- package/fonts/presets/dm-sans-300-700-latin.woff2 +0 -0
- package/fonts/presets/fraunces-300-700-latin-ext.woff2 +0 -0
- package/fonts/presets/fraunces-300-700-latin.woff2 +0 -0
- package/fonts/presets/ibm-plex-mono-300-latin-ext.woff2 +0 -0
- package/fonts/presets/ibm-plex-mono-300-latin.woff2 +0 -0
- package/fonts/presets/ibm-plex-mono-400-latin-ext.woff2 +0 -0
- package/fonts/presets/ibm-plex-mono-400-latin.woff2 +0 -0
- package/fonts/presets/ibm-plex-mono-500-latin-ext.woff2 +0 -0
- package/fonts/presets/ibm-plex-mono-500-latin.woff2 +0 -0
- package/fonts/presets/ibm-plex-mono-600-latin-ext.woff2 +0 -0
- package/fonts/presets/ibm-plex-mono-600-latin.woff2 +0 -0
- package/fonts/presets/ibm-plex-mono-700-latin-ext.woff2 +0 -0
- package/fonts/presets/ibm-plex-mono-700-latin.woff2 +0 -0
- package/fonts/presets/ibm-plex-sans-300-700-latin-ext.woff2 +0 -0
- package/fonts/presets/ibm-plex-sans-300-700-latin.woff2 +0 -0
- package/fonts/presets/inter-300-700-latin-ext.woff2 +0 -0
- package/fonts/presets/inter-300-700-latin.woff2 +0 -0
- package/fonts/presets/inter-tight-300-900-latin-ext.woff2 +0 -0
- package/fonts/presets/inter-tight-300-900-latin.woff2 +0 -0
- package/fonts/presets/lora-400-700-latin-ext.woff2 +0 -0
- package/fonts/presets/lora-400-700-latin.woff2 +0 -0
- package/fonts/presets/montserrat-300-700-latin-ext.woff2 +0 -0
- package/fonts/presets/montserrat-300-700-latin.woff2 +0 -0
- package/fonts/presets/poppins-300-latin-ext.woff2 +0 -0
- package/fonts/presets/poppins-300-latin.woff2 +0 -0
- package/fonts/presets/poppins-400-latin-ext.woff2 +0 -0
- package/fonts/presets/poppins-400-latin.woff2 +0 -0
- package/fonts/presets/poppins-500-latin-ext.woff2 +0 -0
- package/fonts/presets/poppins-500-latin.woff2 +0 -0
- package/fonts/presets/poppins-600-latin-ext.woff2 +0 -0
- package/fonts/presets/poppins-600-latin.woff2 +0 -0
- package/fonts/presets/poppins-700-latin-ext.woff2 +0 -0
- package/fonts/presets/poppins-700-latin.woff2 +0 -0
- package/fonts/presets/source-sans-3-300-700-latin-ext.woff2 +0 -0
- package/fonts/presets/source-sans-3-300-700-latin.woff2 +0 -0
- package/fonts/presets/space-grotesk-300-700-latin-ext.woff2 +0 -0
- package/fonts/presets/space-grotesk-300-700-latin.woff2 +0 -0
- package/fonts/presets/work-sans-300-700-latin-ext.woff2 +0 -0
- package/fonts/presets/work-sans-300-700-latin.woff2 +0 -0
- package/index.d.ts +132 -0
- package/index.js +277 -0
- package/package.json +87 -0
- package/tokens/motion.d.ts +44 -0
- package/tokens/motion.js +32 -0
- package/tokens/presets/contrast.css +316 -0
- package/tokens/presets/coral.css +356 -0
- package/tokens/presets/forest.css +334 -0
- package/tokens/presets/gold.css +303 -0
- package/tokens/presets/mono.css +286 -0
- package/tokens/presets/pink.css +349 -0
- package/tokens/presets/presets.css +17 -0
- package/tokens/presets/terminal.css +378 -0
- package/tokens/presets/violet.css +314 -0
- package/tokens/presets/warm.css +320 -0
- package/tokens/presets/zest.css +359 -0
- package/tokens/registry.d.ts +22 -0
- package/tokens/registry.js +14 -0
- package/tokens/registry.json +276 -0
- package/tokens/registry.json.d.ts +279 -0
- package/tokens/registry.json.js +8 -0
- package/tokens/tokens-dark.css +186 -0
- package/tokens/tokens-light.css +276 -0
- package/tokens/tokens-motion.css +72 -0
- package/tokens/tokens-primitives.css +213 -0
- package/tokens/tokens-typography.css +210 -0
- package/tokens/tokens.css +11 -0
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
/* ============================================
|
|
2
|
+
SELECTION CARD COMPONENT
|
|
3
|
+
Large selectable option cards with radio or
|
|
4
|
+
checkbox indicators. Used for high-visibility
|
|
5
|
+
choice interfaces like settings and onboarding.
|
|
6
|
+
============================================ */
|
|
7
|
+
|
|
8
|
+
/* ============================================
|
|
9
|
+
GROUP — vertical stack of cards
|
|
10
|
+
============================================ */
|
|
11
|
+
|
|
12
|
+
.ds-selection-card-group {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
gap: var(--gap-200); /* 8px */
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* ============================================
|
|
19
|
+
CARD — single option
|
|
20
|
+
============================================ */
|
|
21
|
+
|
|
22
|
+
.ds-selection-card {
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: space-between;
|
|
26
|
+
gap: var(--gap-500); /* 20px */
|
|
27
|
+
padding: var(--padding-400); /* 16px */
|
|
28
|
+
border: var(--border-025) solid var(--color-bg-container-border);
|
|
29
|
+
border-radius: var(--radius-300); /* 12px */
|
|
30
|
+
background-color: transparent;
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
user-select: none;
|
|
33
|
+
transition: border-color var(--motion-duration-base) var(--motion-ease-standard), background-color var(--motion-duration-base) var(--motion-ease-standard);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* ============================================
|
|
37
|
+
HOVER STATE
|
|
38
|
+
============================================ */
|
|
39
|
+
|
|
40
|
+
.ds-selection-card:not(.ds-selection-card--disabled):hover {
|
|
41
|
+
border-color: var(--color-action-primary-border);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* ============================================
|
|
45
|
+
SELECTED STATE
|
|
46
|
+
============================================ */
|
|
47
|
+
|
|
48
|
+
.ds-selection-card--selected {
|
|
49
|
+
border-color: var(--color-action-primary-border);
|
|
50
|
+
background-color: var(--color-bg-container-primary-semi);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* ============================================
|
|
54
|
+
DISABLED STATE
|
|
55
|
+
============================================ */
|
|
56
|
+
|
|
57
|
+
.ds-selection-card--disabled {
|
|
58
|
+
opacity: 0.4;
|
|
59
|
+
cursor: not-allowed;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* ============================================
|
|
63
|
+
FOCUS STATE
|
|
64
|
+
============================================ */
|
|
65
|
+
|
|
66
|
+
.ds-selection-card:focus-visible {
|
|
67
|
+
outline: 2px solid var(--color-action-primary-bg);
|
|
68
|
+
outline-offset: 2px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* ============================================
|
|
72
|
+
CONTENT — label + description
|
|
73
|
+
============================================ */
|
|
74
|
+
|
|
75
|
+
.ds-selection-card__content {
|
|
76
|
+
display: flex;
|
|
77
|
+
flex-direction: column;
|
|
78
|
+
gap: var(--gap-050); /* 4px */
|
|
79
|
+
min-width: 0;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.ds-selection-card__label {
|
|
83
|
+
font-family: var(--font-paragraph-emphasis-family);
|
|
84
|
+
font-size: var(--font-paragraph-emphasis-size);
|
|
85
|
+
font-weight: var(--font-paragraph-emphasis-weight);
|
|
86
|
+
line-height: var(--font-paragraph-emphasis-line-height);
|
|
87
|
+
letter-spacing: var(--font-paragraph-emphasis-letter-spacing);
|
|
88
|
+
color: var(--color-text-primary);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.ds-selection-card__description {
|
|
92
|
+
font-family: var(--font-paragraph-sm-family);
|
|
93
|
+
font-size: var(--font-paragraph-sm-size);
|
|
94
|
+
font-weight: var(--font-paragraph-sm-weight);
|
|
95
|
+
line-height: var(--font-paragraph-sm-line-height);
|
|
96
|
+
letter-spacing: var(--font-paragraph-sm-letter-spacing);
|
|
97
|
+
color: var(--color-text-secondary);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* ============================================
|
|
101
|
+
INDICATOR — radio, checkbox, or toggle
|
|
102
|
+
============================================ */
|
|
103
|
+
|
|
104
|
+
.ds-selection-card__indicator {
|
|
105
|
+
flex-shrink: 0;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* ============================================
|
|
109
|
+
RADIO INDICATOR
|
|
110
|
+
============================================ */
|
|
111
|
+
|
|
112
|
+
.ds-selection-card__radio {
|
|
113
|
+
width: 24px;
|
|
114
|
+
height: 24px;
|
|
115
|
+
border: var(--border-050) solid var(--color-bg-container-border);
|
|
116
|
+
border-radius: var(--radius-pill);
|
|
117
|
+
background-color: var(--color-bg-container-primary-transparent);
|
|
118
|
+
display: flex;
|
|
119
|
+
align-items: center;
|
|
120
|
+
justify-content: center;
|
|
121
|
+
transition: border-color var(--motion-duration-base) var(--motion-ease-standard);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.ds-selection-card__radio-dot {
|
|
125
|
+
width: 12px;
|
|
126
|
+
height: 12px;
|
|
127
|
+
border-radius: var(--radius-pill);
|
|
128
|
+
background-color: var(--color-action-primary-bg);
|
|
129
|
+
transform: scale(0);
|
|
130
|
+
transition: transform var(--motion-duration-base) var(--motion-ease-standard);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/* Selected radio */
|
|
134
|
+
.ds-selection-card--selected .ds-selection-card__radio {
|
|
135
|
+
border-color: var(--color-action-primary-bg);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.ds-selection-card--selected .ds-selection-card__radio-dot {
|
|
139
|
+
transform: scale(1);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* Hover radio (unselected) */
|
|
143
|
+
.ds-selection-card:not(.ds-selection-card--disabled):not(.ds-selection-card--selected):hover .ds-selection-card__radio {
|
|
144
|
+
border-color: var(--color-action-primary-bg);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/* Hover radio (selected) */
|
|
148
|
+
.ds-selection-card--selected:not(.ds-selection-card--disabled):hover .ds-selection-card__radio {
|
|
149
|
+
border-color: var(--color-action-primary-bg-hover);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.ds-selection-card--selected:not(.ds-selection-card--disabled):hover .ds-selection-card__radio-dot {
|
|
153
|
+
background-color: var(--color-action-primary-bg-hover);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/* ============================================
|
|
157
|
+
CHECKBOX INDICATOR
|
|
158
|
+
============================================ */
|
|
159
|
+
|
|
160
|
+
.ds-selection-card__checkbox {
|
|
161
|
+
width: 24px;
|
|
162
|
+
height: 24px;
|
|
163
|
+
box-sizing: border-box;
|
|
164
|
+
border: var(--border-050) solid var(--color-bg-container-border);
|
|
165
|
+
border-radius: var(--radius-200); /* 8px */
|
|
166
|
+
background-color: var(--color-bg-container-primary-transparent);
|
|
167
|
+
display: flex;
|
|
168
|
+
align-items: center;
|
|
169
|
+
justify-content: center;
|
|
170
|
+
transition: background-color var(--motion-duration-base) var(--motion-ease-standard), border-color var(--motion-duration-base) var(--motion-ease-standard);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.ds-selection-card__check-icon {
|
|
174
|
+
width: 14px;
|
|
175
|
+
height: 14px;
|
|
176
|
+
color: var(--color-action-primary-text-active);
|
|
177
|
+
opacity: 0;
|
|
178
|
+
transition: opacity var(--motion-duration-base) var(--motion-ease-standard);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/* Selected checkbox */
|
|
182
|
+
.ds-selection-card--selected .ds-selection-card__checkbox {
|
|
183
|
+
background-color: var(--color-action-primary-bg);
|
|
184
|
+
border-color: var(--color-action-primary-bg);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.ds-selection-card--selected .ds-selection-card__check-icon {
|
|
188
|
+
opacity: 1;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/* Hover checkbox (unselected) */
|
|
192
|
+
.ds-selection-card:not(.ds-selection-card--disabled):not(.ds-selection-card--selected):hover .ds-selection-card__checkbox {
|
|
193
|
+
border-color: var(--color-action-primary-bg);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/* Hover checkbox (selected) */
|
|
197
|
+
.ds-selection-card--selected:not(.ds-selection-card--disabled):hover .ds-selection-card__checkbox {
|
|
198
|
+
background-color: var(--color-action-primary-bg-hover);
|
|
199
|
+
border-color: var(--color-action-primary-bg-hover);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/* ============================================
|
|
203
|
+
TOGGLE INDICATOR
|
|
204
|
+
Matches ToggleSwitch component styling
|
|
205
|
+
============================================ */
|
|
206
|
+
|
|
207
|
+
.ds-selection-card__toggle {
|
|
208
|
+
position: relative;
|
|
209
|
+
width: 42px;
|
|
210
|
+
height: 24px;
|
|
211
|
+
border-radius: var(--radius-pill);
|
|
212
|
+
background: var(--color-action-primary-bg);
|
|
213
|
+
transition: background-color var(--motion-duration-base) var(--motion-ease-standard);
|
|
214
|
+
flex-shrink: 0;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.ds-selection-card__toggle-thumb {
|
|
218
|
+
position: absolute;
|
|
219
|
+
top: 2px;
|
|
220
|
+
right: 2px;
|
|
221
|
+
width: 20px;
|
|
222
|
+
height: 20px;
|
|
223
|
+
background: var(--color-control-thumb);
|
|
224
|
+
border-radius: 50%;
|
|
225
|
+
display: flex;
|
|
226
|
+
align-items: center;
|
|
227
|
+
justify-content: center;
|
|
228
|
+
overflow: hidden;
|
|
229
|
+
transition: transform var(--motion-duration-base) var(--motion-ease-standard);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.ds-selection-card__toggle-icon {
|
|
233
|
+
/* Intentionally off the --icon-size-* scale — same reason as ToggleSwitch:
|
|
234
|
+
this glyph lives inside the 20x20 toggle thumb, and the smallest scale
|
|
235
|
+
step (20px) would fill it completely. Sized via --icon-size, not
|
|
236
|
+
font-size, so the icon's box shrinks with the glyph (see ToggleSwitch).
|
|
237
|
+
|
|
238
|
+
ds-allow(icon-size): 14px glyph inside the 20px thumb — the smallest
|
|
239
|
+
scale step would fill it edge to edge. */
|
|
240
|
+
--icon-size: 14px;
|
|
241
|
+
color: var(--color-action-primary-bg);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/* Off state — thumb moves left, track goes grey */
|
|
245
|
+
.ds-selection-card__toggle--off {
|
|
246
|
+
background: var(--color-text-secondary);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.ds-selection-card__toggle--off .ds-selection-card__toggle-thumb {
|
|
250
|
+
transform: translateX(-18px);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.ds-selection-card__toggle--off .ds-selection-card__toggle-icon {
|
|
254
|
+
color: var(--color-text-secondary);
|
|
255
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface SelectionCardOption {
|
|
3
|
+
/** Unique value for this option */
|
|
4
|
+
value: string;
|
|
5
|
+
/** Primary label */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Optional description text below the label */
|
|
8
|
+
description?: string;
|
|
9
|
+
/** Whether this option is disabled */
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** Props owned by SelectionCard itself — everything else falls through to the group. */
|
|
13
|
+
type SelectionCardOwnProps = {
|
|
14
|
+
/** Selection mode — radio (single), checkbox (multi), or toggle (each card is an on/off switch) */
|
|
15
|
+
mode?: 'radio' | 'checkbox' | 'toggle';
|
|
16
|
+
/** Available options */
|
|
17
|
+
options: SelectionCardOption[];
|
|
18
|
+
/** Currently selected value(s) — string for radio, string[] for checkbox */
|
|
19
|
+
value?: string | string[];
|
|
20
|
+
/** Called with the next selection — a string in radio mode, an array otherwise */
|
|
21
|
+
onValueChange?: (value: string | string[]) => void;
|
|
22
|
+
/** Group name (used for aria-label on the group) */
|
|
23
|
+
name?: string;
|
|
24
|
+
/** Additional CSS classes */
|
|
25
|
+
className?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Legacy change handler, kept for backwards compatibility.
|
|
28
|
+
*
|
|
29
|
+
* @deprecated Use `onValueChange` instead.
|
|
30
|
+
*/
|
|
31
|
+
onChange?: (value: string | string[]) => void;
|
|
32
|
+
};
|
|
33
|
+
export interface SelectionCardProps extends SelectionCardOwnProps, Omit<React.ComponentPropsWithoutRef<'div'>, keyof SelectionCardOwnProps> {
|
|
34
|
+
}
|
|
35
|
+
export declare const SelectionCard: React.ForwardRefExoticComponent<SelectionCardProps & React.RefAttributes<HTMLDivElement>>;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import "./SelectionCard.css";
|
|
5
|
+
const CheckIcon = () => /* @__PURE__ */ jsx(
|
|
6
|
+
"svg",
|
|
7
|
+
{
|
|
8
|
+
className: "ds-selection-card__check-icon",
|
|
9
|
+
width: "14",
|
|
10
|
+
height: "14",
|
|
11
|
+
viewBox: "0 0 14 14",
|
|
12
|
+
fill: "none",
|
|
13
|
+
"aria-hidden": "true",
|
|
14
|
+
children: /* @__PURE__ */ jsx(
|
|
15
|
+
"path",
|
|
16
|
+
{
|
|
17
|
+
d: "M2 7.5L5.5 11L12 3",
|
|
18
|
+
stroke: "currentColor",
|
|
19
|
+
strokeWidth: "2",
|
|
20
|
+
strokeLinecap: "round",
|
|
21
|
+
strokeLinejoin: "round"
|
|
22
|
+
}
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
const SelectionCard = React.forwardRef(
|
|
27
|
+
({ mode = "radio", options, value, onValueChange, onChange, name, className = "", ...rest }, ref) => {
|
|
28
|
+
const baseClass = "ds-selection-card";
|
|
29
|
+
const selectedValues = Array.isArray(value) ? value : value !== void 0 ? [value] : [];
|
|
30
|
+
const isSelected = (optionValue) => selectedValues.includes(optionValue);
|
|
31
|
+
const handleSelect = (option) => {
|
|
32
|
+
if (option.disabled) return;
|
|
33
|
+
const next = mode === "radio" ? option.value : isSelected(option.value) ? selectedValues.filter((v) => v !== option.value) : [...selectedValues, option.value];
|
|
34
|
+
onValueChange?.(next);
|
|
35
|
+
onChange?.(next);
|
|
36
|
+
};
|
|
37
|
+
const handleKeyDown = (e, option) => {
|
|
38
|
+
if (e.key === " " || e.key === "Enter") {
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
handleSelect(option);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const groupRole = mode === "radio" ? "radiogroup" : "group";
|
|
44
|
+
const itemRole = mode === "radio" ? "radio" : mode === "toggle" ? "switch" : "checkbox";
|
|
45
|
+
const groupClasses = [`${baseClass}-group`, className].filter(Boolean).join(" ");
|
|
46
|
+
return /* @__PURE__ */ jsx(
|
|
47
|
+
"div",
|
|
48
|
+
{
|
|
49
|
+
...rest,
|
|
50
|
+
ref,
|
|
51
|
+
className: groupClasses,
|
|
52
|
+
role: groupRole,
|
|
53
|
+
"aria-label": name || rest["aria-label"],
|
|
54
|
+
children: options.map((option) => {
|
|
55
|
+
const selected = isSelected(option.value);
|
|
56
|
+
const cardClasses = [
|
|
57
|
+
baseClass,
|
|
58
|
+
selected ? `${baseClass}--selected` : "",
|
|
59
|
+
option.disabled ? `${baseClass}--disabled` : ""
|
|
60
|
+
].filter(Boolean).join(" ");
|
|
61
|
+
return /* @__PURE__ */ jsxs(
|
|
62
|
+
"div",
|
|
63
|
+
{
|
|
64
|
+
className: cardClasses,
|
|
65
|
+
role: itemRole,
|
|
66
|
+
"aria-checked": selected,
|
|
67
|
+
"aria-disabled": option.disabled,
|
|
68
|
+
tabIndex: option.disabled ? -1 : 0,
|
|
69
|
+
onClick: () => handleSelect(option),
|
|
70
|
+
onKeyDown: (e) => handleKeyDown(e, option),
|
|
71
|
+
children: [
|
|
72
|
+
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__content`, children: [
|
|
73
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}__label`, children: option.label }),
|
|
74
|
+
option.description && /* @__PURE__ */ jsx("span", { className: `${baseClass}__description`, children: option.description })
|
|
75
|
+
] }),
|
|
76
|
+
/* @__PURE__ */ jsx("div", { className: `${baseClass}__indicator`, children: mode === "radio" ? /* @__PURE__ */ jsx("div", { className: `${baseClass}__radio`, children: /* @__PURE__ */ jsx("div", { className: `${baseClass}__radio-dot` }) }) : mode === "toggle" ? /* @__PURE__ */ jsx(
|
|
77
|
+
"div",
|
|
78
|
+
{
|
|
79
|
+
className: `${baseClass}__toggle ${selected ? "" : `${baseClass}__toggle--off`}`,
|
|
80
|
+
children: /* @__PURE__ */ jsx("div", { className: `${baseClass}__toggle-thumb`, children: /* @__PURE__ */ jsx(
|
|
81
|
+
"span",
|
|
82
|
+
{
|
|
83
|
+
className: "material-symbols-rounded ds-selection-card__toggle-icon",
|
|
84
|
+
"aria-hidden": "true",
|
|
85
|
+
children: "check"
|
|
86
|
+
}
|
|
87
|
+
) })
|
|
88
|
+
}
|
|
89
|
+
) : /* @__PURE__ */ jsx("div", { className: `${baseClass}__checkbox`, children: /* @__PURE__ */ jsx(CheckIcon, {}) }) })
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
option.value
|
|
93
|
+
);
|
|
94
|
+
})
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
SelectionCard.displayName = "SelectionCard";
|
|
100
|
+
export {
|
|
101
|
+
SelectionCard
|
|
102
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/* ShaderField — the canvas only.
|
|
2
|
+
Placement, clipping and any fade-to-page mask belong to the positioned
|
|
3
|
+
ancestor the caller provides: where the field sits is a layout decision,
|
|
4
|
+
and baking one in would make the component unusable anywhere else. */
|
|
5
|
+
|
|
6
|
+
.ds-shader-field {
|
|
7
|
+
position: absolute;
|
|
8
|
+
inset: 0;
|
|
9
|
+
width: 100%;
|
|
10
|
+
height: 100%;
|
|
11
|
+
display: block;
|
|
12
|
+
/* Scenery, never a target — a full-bleed canvas that swallowed clicks would
|
|
13
|
+
make whatever it covers unreachable. */
|
|
14
|
+
pointer-events: none;
|
|
15
|
+
/* Reveals only once a context is live and the first frame is drawn, so a
|
|
16
|
+
machine that cannot run the shader never shows an empty canvas — it stays
|
|
17
|
+
on the caller's fallback instead. */
|
|
18
|
+
opacity: 0;
|
|
19
|
+
transition: opacity var(--motion-duration-slower) var(--motion-ease-entrance);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.ds-shader-field[data-status='active'] {
|
|
23
|
+
opacity: 1;
|
|
24
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ShaderBlob, ShaderParams } from './useShaderField';
|
|
3
|
+
export type { ShaderBlob, ShaderParams, ShaderFieldParams, ShaderFieldState, } from './useShaderField';
|
|
4
|
+
export { useShaderField, DEFAULT_SHADER_BLOBS, DEFAULT_SHADER_PARAMS } from './useShaderField';
|
|
5
|
+
export { BLOB_COUNT } from './field.glsl';
|
|
6
|
+
/**
|
|
7
|
+
* How the renderer has resolved.
|
|
8
|
+
*
|
|
9
|
+
* `pending` is the one that matters to a caller: the context is still coming
|
|
10
|
+
* up, so neither the field nor a fallback should be painted yet — showing a
|
|
11
|
+
* fallback here and swapping it a frame later reads as two backgrounds loading
|
|
12
|
+
* in sequence.
|
|
13
|
+
*/
|
|
14
|
+
export type ShaderFieldStatus = 'pending' | 'active' | 'unavailable';
|
|
15
|
+
/** Props owned by ShaderField itself — everything else falls through to the canvas. */
|
|
16
|
+
type ShaderFieldOwnProps = {
|
|
17
|
+
/**
|
|
18
|
+
* Field parameters, merged over the shipped defaults, so passing one
|
|
19
|
+
* property changes one thing. Changing them never rebuilds the GL state.
|
|
20
|
+
*/
|
|
21
|
+
params?: Partial<ShaderParams>;
|
|
22
|
+
/**
|
|
23
|
+
* The light sources. Defaults to an eight-source composition on the core
|
|
24
|
+
* accent tokens. Fewer than `BLOB_COUNT` entries is fine — unused slots park
|
|
25
|
+
* off-field; more are ignored, because the shader's uniform arrays are
|
|
26
|
+
* fixed-size.
|
|
27
|
+
*/
|
|
28
|
+
blobs?: readonly ShaderBlob[];
|
|
29
|
+
/**
|
|
30
|
+
* False keeps WebGL entirely unmounted and reports `unavailable`, so the
|
|
31
|
+
* caller's fallback is the whole background. This is the kill switch: a
|
|
32
|
+
* config lever, or an A/B against the fallback.
|
|
33
|
+
*/
|
|
34
|
+
enabled?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Called whenever the renderer's status changes. Drive the fallback layer's
|
|
37
|
+
* visibility from this — the component deliberately does not own one, since
|
|
38
|
+
* what to paint instead is a design decision, not a rendering one.
|
|
39
|
+
*/
|
|
40
|
+
onStatusChange?: (status: ShaderFieldStatus) => void;
|
|
41
|
+
/** Additional CSS classes */
|
|
42
|
+
className?: string;
|
|
43
|
+
};
|
|
44
|
+
export interface ShaderFieldProps extends ShaderFieldOwnProps, Omit<React.ComponentPropsWithoutRef<'canvas'>, keyof ShaderFieldOwnProps> {
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* ShaderField paints an ambient WebGL2 field of soft Gaussian light sources,
|
|
48
|
+
* each sampling a semantic colour token at runtime — so the whole thing
|
|
49
|
+
* re-themes with `data-theme`, and with any scoped custom-property override,
|
|
50
|
+
* without the caller wiring anything up.
|
|
51
|
+
*
|
|
52
|
+
* It is scenery, not interface: nothing about it is a signal, so its motion
|
|
53
|
+
* cannot be mistaken for feedback. Two consequences follow, and both are
|
|
54
|
+
* handled here rather than left to the caller.
|
|
55
|
+
*
|
|
56
|
+
* It honours reduced motion in JavaScript. The system's motion tokens collapse
|
|
57
|
+
* under `prefers-reduced-motion`, but that guard is CSS-only and cannot see a
|
|
58
|
+
* `requestAnimationFrame` loop; a GPU-driven surface has to check the query
|
|
59
|
+
* itself. This one renders a single static frame and never starts its loop.
|
|
60
|
+
*
|
|
61
|
+
* And it always reports how it resolved. No WebGL2, a blocked or lost GPU
|
|
62
|
+
* context, a renderer that stalls before its first frame, or `enabled={false}`
|
|
63
|
+
* all arrive at `unavailable` through `onStatusChange`, so the caller can keep
|
|
64
|
+
* a plain CSS fallback painted underneath. The canvas fills its positioned
|
|
65
|
+
* ancestor and is inert to pointer events; give that ancestor the placement,
|
|
66
|
+
* the clipping and any mask.
|
|
67
|
+
*/
|
|
68
|
+
export declare const ShaderField: React.ForwardRefExoticComponent<ShaderFieldProps & React.RefAttributes<HTMLCanvasElement>>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import React, { useRef, useMemo, useState, useEffect } from "react";
|
|
4
|
+
import { DEFAULT_SHADER_BLOBS, DEFAULT_SHADER_PARAMS, useShaderField } from "./useShaderField.js";
|
|
5
|
+
import "./ShaderField.css";
|
|
6
|
+
const WATCHDOG_MS = 1500;
|
|
7
|
+
const ShaderField = React.forwardRef(
|
|
8
|
+
({
|
|
9
|
+
params,
|
|
10
|
+
blobs = DEFAULT_SHADER_BLOBS,
|
|
11
|
+
enabled = true,
|
|
12
|
+
onStatusChange,
|
|
13
|
+
className = "",
|
|
14
|
+
...rest
|
|
15
|
+
}, ref) => {
|
|
16
|
+
const canvasRef = useRef(null);
|
|
17
|
+
React.useImperativeHandle(ref, () => canvasRef.current);
|
|
18
|
+
const fieldParams = useMemo(
|
|
19
|
+
() => ({ ...DEFAULT_SHADER_PARAMS, ...params, blobs }),
|
|
20
|
+
[params, blobs]
|
|
21
|
+
);
|
|
22
|
+
const { supported, active } = useShaderField(canvasRef, fieldParams, enabled);
|
|
23
|
+
const [gaveUp, setGaveUp] = useState(false);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (!enabled || active || !supported) return;
|
|
26
|
+
const timer = window.setTimeout(() => setGaveUp(true), WATCHDOG_MS);
|
|
27
|
+
return () => window.clearTimeout(timer);
|
|
28
|
+
}, [enabled, active, supported]);
|
|
29
|
+
const status = !enabled || !supported ? "unavailable" : active ? "active" : gaveUp ? "unavailable" : "pending";
|
|
30
|
+
const notify = useRef(onStatusChange);
|
|
31
|
+
notify.current = onStatusChange;
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
notify.current?.(status);
|
|
34
|
+
}, [status]);
|
|
35
|
+
if (!enabled) return null;
|
|
36
|
+
const classes = ["ds-shader-field", className].filter(Boolean).join(" ");
|
|
37
|
+
return /* @__PURE__ */ jsx(
|
|
38
|
+
"canvas",
|
|
39
|
+
{
|
|
40
|
+
...rest,
|
|
41
|
+
ref: canvasRef,
|
|
42
|
+
className: classes,
|
|
43
|
+
"data-status": status,
|
|
44
|
+
"aria-hidden": "true"
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
ShaderField.displayName = "ShaderField";
|
|
50
|
+
export {
|
|
51
|
+
DEFAULT_SHADER_BLOBS,
|
|
52
|
+
DEFAULT_SHADER_PARAMS,
|
|
53
|
+
ShaderField,
|
|
54
|
+
useShaderField
|
|
55
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GLSL sources for ShaderField, the system's ambient background field.
|
|
3
|
+
*
|
|
4
|
+
* This file owns the shader and BLOB_COUNT only. The blob table and every
|
|
5
|
+
* tuneable parameter are data, passed in by the caller, so a look can be
|
|
6
|
+
* retuned without touching GLSL.
|
|
7
|
+
*
|
|
8
|
+
* The field is a sum of soft Gaussian sources. It computes the true Gaussian
|
|
9
|
+
* falloff a stack of blurred CSS discs only approximates, blends in linear
|
|
10
|
+
* space so midpoints keep their saturation, warps the field with fbm noise so
|
|
11
|
+
* it flows instead of translating rigidly, and dithers away the 8-bit banding
|
|
12
|
+
* these wide, soft ramps otherwise produce.
|
|
13
|
+
*
|
|
14
|
+
* Coordinate space is chosen to match a CSS blob layer exactly, so a fallback
|
|
15
|
+
* built from absolutely-positioned discs lines up with it: origin at the
|
|
16
|
+
* container centre (`left`/`top: 50%`), one unit = the field's reference
|
|
17
|
+
* width (discs are vw-sized, and CSS percentage margins — top included —
|
|
18
|
+
* resolve against the containing block's width). Centres are therefore
|
|
19
|
+
* constants that never need re-uploading on resize.
|
|
20
|
+
*
|
|
21
|
+
* That reference width is the container's own width until `crop` holds it
|
|
22
|
+
* back on a narrow viewport, where the field keeps more of the scale it was
|
|
23
|
+
* composed at and the viewport crops into it instead. The hook resolves it to
|
|
24
|
+
* `u_unit`, in drawing-buffer pixels, so the shader itself never has to know
|
|
25
|
+
* which of the two it is looking at.
|
|
26
|
+
*
|
|
27
|
+
* Colours arrive already converted to linear RGB (the hook does the sRGB
|
|
28
|
+
* decode once per theme change); the shader only encodes back at the end.
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* Sizes the shader's uniform arrays, so it is a compile-time constant here
|
|
32
|
+
* rather than a length read from data. A caller may pass fewer blobs — unused
|
|
33
|
+
* slots are parked off-field — but never more; ShaderField's own default table
|
|
34
|
+
* fills it exactly, and scripts/validate-shader-background.mjs reads this
|
|
35
|
+
* number out of this file to hold the website's config to it.
|
|
36
|
+
*/
|
|
37
|
+
export declare const BLOB_COUNT = 8;
|
|
38
|
+
export declare const vertexSource = "#version 300 es\n// Fullscreen triangle \u2014 no buffers, three vertices from gl_VertexID.\nvoid main() {\n vec2 p = vec2((gl_VertexID << 1) & 2, gl_VertexID & 2);\n gl_Position = vec4(p * 2.0 - 1.0, 0.0, 1.0);\n}\n";
|
|
39
|
+
export declare const fragmentSource = "#version 300 es\nprecision highp float;\n\nuniform vec2 u_resolution; // drawing-buffer size in pixels\nuniform float u_unit; // pixels per field unit (see coordinate space)\nuniform float u_time; // field time, seconds (speed applied JS-side)\nuniform vec3 u_color[8]; // linear RGB per blob\nuniform vec4 u_blob[8]; // xy = centre, z = sigma, w = emission weight\nuniform vec4 u_motion[8]; // xy = angular speeds, zw = phases\nuniform float u_intensity; // peak-alpha ceiling\nuniform float u_warp; // domain-warp strength\nuniform float u_scale; // noise frequency\nuniform float u_grain; // film-grain strength\nuniform float u_streak; // anisotropic stretch: 0 = blobs, 1 = light streams\nuniform vec2 u_mouse; // pointer in field coordinates (smoothed JS-side)\nuniform float u_mvel; // smoothed pointer speed, width units/s\nuniform float u_react; // cursor-reactivity strength\n\nout vec4 outColor;\n\n// Integer hash \u2014 WebGL2 has real uint ops, so no fract(sin()) precision\n// lottery on mobile GPUs.\nuint ihash(uvec2 p) {\n p = p * uvec2(73333u, 7777u) ^ (p.yx >> 3u);\n uint h = p.x ^ (p.y * 2654435761u);\n h ^= h >> 15u;\n h *= 2246822519u;\n h ^= h >> 13u;\n return h;\n}\n\nfloat rnd(ivec2 p) {\n return float(ihash(uvec2(p)) >> 8) * (1.0 / 16777216.0);\n}\n\nfloat vnoise(vec2 p) {\n vec2 i = floor(p);\n vec2 f = fract(p);\n vec2 u = f * f * f * (f * (f * 6.0 - 15.0) + 10.0);\n ivec2 c = ivec2(i);\n return mix(\n mix(rnd(c), rnd(c + ivec2(1, 0)), u.x),\n mix(rnd(c + ivec2(0, 1)), rnd(c + ivec2(1, 1)), u.x),\n u.y\n );\n}\n\n// 3 octaves; a 4th is invisible at this softness.\nfloat fbm(vec2 p) {\n float s = 0.0;\n float a = 0.5;\n for (int i = 0; i < 3; i++) {\n s += a * vnoise(p);\n p = p * 2.02 + vec2(17.0, 9.0);\n a *= 0.5;\n }\n return s;\n}\n\nvoid main() {\n // CSS coordinate space: origin at container centre, one unit = the\n // reference width the hook resolved, y running downward.\n vec2 p = (gl_FragCoord.xy - 0.5 * u_resolution) / u_unit;\n p.y = -p.y;\n\n // Light-stream axis: a fixed diagonal. Distances across the axis are\n // magnified before the Gaussian, so every source stretches along it and\n // the field reads as rays instead of discs.\n float ca = cos(0.5);\n float sa = sin(0.5);\n mat2 toStreak = mat2(ca, -sa, sa, ca);\n float squeeze = 1.0 + u_streak * 4.0;\n\n // Domain warp: the field flows rather than drifts. The noise is sampled\n // in the same anisotropic space, so the flow lines follow the streams.\n float t = u_time;\n vec2 ps = toStreak * p;\n ps.y *= squeeze;\n vec2 q = vec2(\n fbm(ps * u_scale + vec2(0.0, t * 0.030)),\n fbm(ps * u_scale + vec2(5.2, 1.3) - t * 0.024)\n );\n vec2 w = p + u_warp * (q - 0.5);\n\n // Cursor wake: a smooth vortex around the pointer, amplified by speed.\n // The displacement is built from the *unnormalised* offset so it falls to\n // zero at the cursor itself. Normalising here (md/mr) made the direction\n // spin through 360 degrees at full strength across the centre pixel, which\n // rendered as a pinch \u2014 a cone converging to a point.\n vec2 md = p - u_mouse;\n float mr2 = dot(md, md);\n float minf = exp(-mr2 / (2.0 * 0.22 * 0.22));\n vec2 swirl = vec2(-md.y, md.x);\n // smoothstep, not min(): a hard clamp stepped visibly as speed crossed it.\n float stir = 0.25 + 1.3 * smoothstep(0.0, 0.8, u_mvel);\n w += u_react * minf * stir * (swirl * 0.9 + md * 0.35);\n\n // Accumulate true Gaussians in linear space. Positive weights emit;\n // negative weights absorb (shadows \u2014 the eclipse disc).\n vec3 acc = vec3(0.0);\n float cov = 0.0;\n float shade = 0.0;\n for (int i = 0; i < 8; i++) {\n vec2 c = u_blob[i].xy + 0.045 * vec2(\n cos(u_motion[i].x * t + u_motion[i].z),\n sin(u_motion[i].y * t + u_motion[i].w)\n );\n vec2 d = toStreak * (w - c);\n d.y *= squeeze;\n float s = u_blob[i].z;\n float g = exp(-dot(d, d) / (2.0 * s * s));\n float wgt = u_blob[i].w;\n if (wgt >= 0.0) {\n acc += u_color[i] * (g * wgt);\n cov += g * wgt;\n } else {\n shade += g * -wgt;\n }\n }\n\n // Glow trail: wider and softer than the swirl, and mostly velocity-driven,\n // so a resting cursor does not park a bright dot on the field.\n //\n // The wake brightens whatever colour it is passing over rather than adding\n // one of its own. Injecting u_color[0] meant the trail always wore the\n // first blob's token \u2014 gold in the site palette, violet in beam \u2014 which\n // read as a stray colour with no relationship to the field beneath it.\n // Weighting by the local hue keeps the wake colour-neutral: it reads as\n // light falling on the field, and it stays correct for any palette.\n vec3 local = acc / max(cov, 1e-4);\n float gfall = exp(-mr2 / (2.0 * 0.3 * 0.3));\n float glow = u_react * gfall * (0.12 + 0.5 * smoothstep(0.0, 0.8, u_mvel));\n acc += local * glow;\n cov += glow;\n\n vec3 lin = acc / max(cov, 1e-4);\n float lit = max(cov - shade, 0.0);\n float alpha = u_intensity * (1.0 - exp(-lit * 0.9));\n\n vec3 srgb = pow(max(lin, vec3(0.0)), vec3(1.0 / 2.2));\n\n // Film grain: animated hash noise. At u_grain 0 this degenerates to the\n // \u00B11/255 dither that kills banding, so the two share one lookup.\n uvec2 gp = uvec2(gl_FragCoord.xy) + uvec2(\n uint(fract(t * 7.31) * 1024.0) * 7919u,\n uint(fract(t * 3.17) * 1024.0) * 104729u\n );\n float gr = float(ihash(gp) & 255u) / 255.0 - 0.5;\n srgb += gr * (1.0 / 255.0 + u_grain * 0.35);\n // A small grain-driven alpha floor lets the sparkle read even where the\n // field itself is empty (the reference's grainy dark scene).\n float grainFloor = u_grain * 0.1 * (gr + 0.5);\n alpha = clamp(alpha * (1.0 + gr * u_grain * 0.5) + grainFloor, 0.0, 1.0);\n srgb = clamp(srgb, 0.0, 1.0);\n\n // Premultiplied output (context is created with premultipliedAlpha: true).\n outColor = vec4(srgb * alpha, alpha);\n}\n";
|