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,183 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
|
+
import React, { useState, useRef, useEffect } from "react";
|
|
4
|
+
import { PromptSuggestions } from "../PromptSuggestions/PromptSuggestions.js";
|
|
5
|
+
import { Skeleton } from "../Skeleton/Skeleton.js";
|
|
6
|
+
import { StreamingText } from "../StreamingText/StreamingText.js";
|
|
7
|
+
import { MOTION_SUMMARY_THINK_MS, MOTION_SUMMARY_REVEAL_MS, MOTION_HOVER_EXIT_GRACE_MS, MOTION_HOVER_SHOW_DELAY_MS } from "../../tokens/motion.js";
|
|
8
|
+
import "./AiButton.css";
|
|
9
|
+
import "../../fonts/material-symbols.css";
|
|
10
|
+
const AiButton = React.forwardRef(
|
|
11
|
+
({
|
|
12
|
+
label = "Ask AI",
|
|
13
|
+
icon = "auto_awesome",
|
|
14
|
+
size = "default",
|
|
15
|
+
disabled,
|
|
16
|
+
href,
|
|
17
|
+
target,
|
|
18
|
+
rel,
|
|
19
|
+
summary,
|
|
20
|
+
summaryPlacement = "top",
|
|
21
|
+
summaryPinned = false,
|
|
22
|
+
onSummaryDismiss,
|
|
23
|
+
onSummarySuggestion,
|
|
24
|
+
className = "",
|
|
25
|
+
...rest
|
|
26
|
+
}, ref) => {
|
|
27
|
+
const baseClass = "ds-ai-button";
|
|
28
|
+
const [hoverOpen, setHoverOpen] = useState(false);
|
|
29
|
+
const [dismissed, setDismissed] = useState(false);
|
|
30
|
+
const [phase, setPhase] = useState("skeleton");
|
|
31
|
+
const generated = useRef(false);
|
|
32
|
+
const showTimer = useRef(null);
|
|
33
|
+
const hideTimer = useRef(null);
|
|
34
|
+
const panelOpen = Boolean(summary) && !disabled && !dismissed && (summaryPinned || hoverOpen);
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
if (!panelOpen) return;
|
|
37
|
+
if (generated.current) {
|
|
38
|
+
setPhase("cached");
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
setPhase("skeleton");
|
|
42
|
+
const t = window.setTimeout(() => {
|
|
43
|
+
generated.current = true;
|
|
44
|
+
setPhase("typing");
|
|
45
|
+
}, MOTION_SUMMARY_THINK_MS);
|
|
46
|
+
return () => window.clearTimeout(t);
|
|
47
|
+
}, [panelOpen]);
|
|
48
|
+
useEffect(
|
|
49
|
+
() => () => {
|
|
50
|
+
if (showTimer.current) window.clearTimeout(showTimer.current);
|
|
51
|
+
if (hideTimer.current) window.clearTimeout(hideTimer.current);
|
|
52
|
+
},
|
|
53
|
+
[]
|
|
54
|
+
);
|
|
55
|
+
const hostEnter = () => {
|
|
56
|
+
if (hideTimer.current) {
|
|
57
|
+
window.clearTimeout(hideTimer.current);
|
|
58
|
+
hideTimer.current = null;
|
|
59
|
+
}
|
|
60
|
+
if (!hoverOpen && !showTimer.current) {
|
|
61
|
+
showTimer.current = window.setTimeout(() => {
|
|
62
|
+
showTimer.current = null;
|
|
63
|
+
setHoverOpen(true);
|
|
64
|
+
}, MOTION_HOVER_SHOW_DELAY_MS);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
const hostLeave = () => {
|
|
68
|
+
setDismissed(false);
|
|
69
|
+
if (showTimer.current) {
|
|
70
|
+
window.clearTimeout(showTimer.current);
|
|
71
|
+
showTimer.current = null;
|
|
72
|
+
}
|
|
73
|
+
if (hoverOpen && !hideTimer.current) {
|
|
74
|
+
hideTimer.current = window.setTimeout(() => {
|
|
75
|
+
hideTimer.current = null;
|
|
76
|
+
setHoverOpen(false);
|
|
77
|
+
}, MOTION_HOVER_EXIT_GRACE_MS);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
const classes = [
|
|
81
|
+
baseClass,
|
|
82
|
+
`${baseClass}--${size}`,
|
|
83
|
+
disabled && `${baseClass}--disabled`,
|
|
84
|
+
className
|
|
85
|
+
].filter(Boolean).join(" ");
|
|
86
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
87
|
+
icon && (typeof icon === "string" ? /* @__PURE__ */ jsx("span", { className: `${baseClass}__icon material-symbols-rounded`, "aria-hidden": "true", children: icon }) : /* @__PURE__ */ jsx("span", { className: `${baseClass}__icon`, "aria-hidden": "true", children: icon })),
|
|
88
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}__text`, children: label })
|
|
89
|
+
] });
|
|
90
|
+
const control = href && !disabled ? /* @__PURE__ */ jsx(
|
|
91
|
+
"a",
|
|
92
|
+
{
|
|
93
|
+
...rest,
|
|
94
|
+
ref,
|
|
95
|
+
className: classes,
|
|
96
|
+
href,
|
|
97
|
+
target,
|
|
98
|
+
rel,
|
|
99
|
+
children: content
|
|
100
|
+
}
|
|
101
|
+
) : /* @__PURE__ */ jsx(
|
|
102
|
+
"button",
|
|
103
|
+
{
|
|
104
|
+
...rest,
|
|
105
|
+
ref,
|
|
106
|
+
type: "button",
|
|
107
|
+
className: classes,
|
|
108
|
+
disabled,
|
|
109
|
+
children: content
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
if (!summary) return control;
|
|
113
|
+
const panelClass = `${baseClass}__summary`;
|
|
114
|
+
return /* @__PURE__ */ jsxs(
|
|
115
|
+
"div",
|
|
116
|
+
{
|
|
117
|
+
className: [
|
|
118
|
+
`${baseClass}-host`,
|
|
119
|
+
`${baseClass}-host--${summaryPlacement}`,
|
|
120
|
+
panelOpen && `${baseClass}-host--open`
|
|
121
|
+
].filter(Boolean).join(" "),
|
|
122
|
+
onMouseEnter: hostEnter,
|
|
123
|
+
onMouseLeave: hostLeave,
|
|
124
|
+
children: [
|
|
125
|
+
control,
|
|
126
|
+
/* @__PURE__ */ jsxs("aside", { className: panelClass, "aria-label": `Summary: ${summary.title}`, children: [
|
|
127
|
+
/* @__PURE__ */ jsx(
|
|
128
|
+
"button",
|
|
129
|
+
{
|
|
130
|
+
type: "button",
|
|
131
|
+
className: `${panelClass}-dismiss`,
|
|
132
|
+
"aria-label": "Dismiss summary",
|
|
133
|
+
onClick: () => {
|
|
134
|
+
setDismissed(true);
|
|
135
|
+
setHoverOpen(false);
|
|
136
|
+
onSummaryDismiss?.();
|
|
137
|
+
},
|
|
138
|
+
children: /* @__PURE__ */ jsx("span", { className: "material-symbols-rounded", "aria-hidden": "true", children: "close" })
|
|
139
|
+
}
|
|
140
|
+
),
|
|
141
|
+
/* @__PURE__ */ jsxs("span", { className: `${panelClass}-meta`, children: [
|
|
142
|
+
/* @__PURE__ */ jsx("span", { className: `${panelClass}-overline`, children: summary.overline ?? "AI summary" }),
|
|
143
|
+
summary.caption && /* @__PURE__ */ jsx("span", { className: `${panelClass}-caption`, children: summary.caption })
|
|
144
|
+
] }),
|
|
145
|
+
/* @__PURE__ */ jsx("span", { className: `${panelClass}-title`, children: summary.title }),
|
|
146
|
+
/* @__PURE__ */ jsx("span", { className: `${panelClass}-text`, children: phase === "skeleton" ? /* @__PURE__ */ jsx(Skeleton, { variant: "text", lines: 3 }) : phase === "typing" ? (
|
|
147
|
+
/* An invisible ghost of the finished text sizes the
|
|
148
|
+
container, so the type-out never jumps the panel and a
|
|
149
|
+
short summary leaves no reserved space behind it. */
|
|
150
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
151
|
+
/* @__PURE__ */ jsx("span", { className: `${panelClass}-text-ghost`, "aria-hidden": "true", children: summary.text }),
|
|
152
|
+
/* @__PURE__ */ jsx("span", { className: `${panelClass}-text-reveal`, children: /* @__PURE__ */ jsx(
|
|
153
|
+
StreamingText,
|
|
154
|
+
{
|
|
155
|
+
text: summary.text,
|
|
156
|
+
streaming: false,
|
|
157
|
+
cursor: true,
|
|
158
|
+
drainMs: MOTION_SUMMARY_REVEAL_MS,
|
|
159
|
+
onRevealComplete: () => setPhase("cached")
|
|
160
|
+
}
|
|
161
|
+
) })
|
|
162
|
+
] })
|
|
163
|
+
) : summary.text }),
|
|
164
|
+
summary.suggestions && summary.suggestions.length > 0 && phase === "cached" && /* @__PURE__ */ jsx("span", { className: `${panelClass}-actions`, children: /* @__PURE__ */ jsx(
|
|
165
|
+
PromptSuggestions,
|
|
166
|
+
{
|
|
167
|
+
layout: "stack",
|
|
168
|
+
size: "compact",
|
|
169
|
+
ariaLabel: "Suggested prompts",
|
|
170
|
+
suggestions: summary.suggestions,
|
|
171
|
+
onValueChange: onSummarySuggestion
|
|
172
|
+
}
|
|
173
|
+
) })
|
|
174
|
+
] })
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
);
|
|
180
|
+
AiButton.displayName = "AiButton";
|
|
181
|
+
export {
|
|
182
|
+
AiButton
|
|
183
|
+
};
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
/* ============================================
|
|
2
|
+
ALERT COMPONENT
|
|
3
|
+
Contextual feedback with status variants
|
|
4
|
+
============================================ */
|
|
5
|
+
|
|
6
|
+
.ds-alert {
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: flex-start;
|
|
9
|
+
gap: var(--gap-200); /* 8px */
|
|
10
|
+
padding: var(--padding-400); /* 16px */
|
|
11
|
+
border: var(--border-025) solid transparent;
|
|
12
|
+
border-radius: var(--radius-200); /* 8px */
|
|
13
|
+
width: 100%;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/* ============================================
|
|
17
|
+
SIZE — DEFAULT
|
|
18
|
+
============================================ */
|
|
19
|
+
|
|
20
|
+
.ds-alert--default {
|
|
21
|
+
padding: var(--padding-400); /* 16px */
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* ============================================
|
|
25
|
+
SIZE — COMPACT
|
|
26
|
+
============================================ */
|
|
27
|
+
|
|
28
|
+
.ds-alert--compact {
|
|
29
|
+
padding: var(--padding-150) var(--padding-300); /* 6px 12px */
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.ds-alert--compact .ds-alert__icon {
|
|
33
|
+
--icon-size: var(--icon-size-500);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.ds-alert--compact .ds-alert__title {
|
|
37
|
+
font-size: var(--font-paragraph-sm-size);
|
|
38
|
+
line-height: var(--font-paragraph-sm-line-height);
|
|
39
|
+
letter-spacing: var(--font-paragraph-sm-letter-spacing);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.ds-alert--compact .ds-alert__description {
|
|
43
|
+
font-size: var(--font-paragraph-sm-size);
|
|
44
|
+
line-height: var(--font-paragraph-sm-line-height);
|
|
45
|
+
letter-spacing: var(--font-paragraph-sm-letter-spacing);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.ds-alert--compact .ds-alert__dismiss {
|
|
49
|
+
width: 20px;
|
|
50
|
+
height: 20px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.ds-alert--compact .ds-alert__dismiss .material-symbols-rounded {
|
|
54
|
+
--icon-size: var(--icon-size-500);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* ============================================
|
|
58
|
+
ICON
|
|
59
|
+
============================================ */
|
|
60
|
+
|
|
61
|
+
.ds-alert__icon {
|
|
62
|
+
flex-shrink: 0;
|
|
63
|
+
--icon-size: var(--icon-size-600);
|
|
64
|
+
line-height: 1;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* ============================================
|
|
68
|
+
CONTENT
|
|
69
|
+
============================================ */
|
|
70
|
+
|
|
71
|
+
.ds-alert__content {
|
|
72
|
+
flex: 1;
|
|
73
|
+
display: flex;
|
|
74
|
+
flex-direction: column;
|
|
75
|
+
gap: var(--gap-050); /* 2px */
|
|
76
|
+
min-width: 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.ds-alert__title {
|
|
80
|
+
font-family: var(--font-paragraph-emphasis-family);
|
|
81
|
+
font-size: var(--font-paragraph-emphasis-size);
|
|
82
|
+
font-weight: var(--font-paragraph-emphasis-weight);
|
|
83
|
+
line-height: var(--font-paragraph-emphasis-line-height);
|
|
84
|
+
letter-spacing: var(--font-paragraph-emphasis-letter-spacing);
|
|
85
|
+
margin: 0;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.ds-alert__description {
|
|
89
|
+
font-family: var(--font-paragraph-family);
|
|
90
|
+
font-size: var(--font-paragraph-size);
|
|
91
|
+
font-weight: var(--font-paragraph-weight);
|
|
92
|
+
line-height: var(--font-paragraph-line-height);
|
|
93
|
+
letter-spacing: var(--font-paragraph-letter-spacing);
|
|
94
|
+
margin: 0;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* ============================================
|
|
98
|
+
DISMISS BUTTON
|
|
99
|
+
============================================ */
|
|
100
|
+
|
|
101
|
+
.ds-alert__dismiss {
|
|
102
|
+
flex-shrink: 0;
|
|
103
|
+
display: flex;
|
|
104
|
+
align-items: center;
|
|
105
|
+
justify-content: center;
|
|
106
|
+
width: 24px;
|
|
107
|
+
height: 24px;
|
|
108
|
+
padding: 0;
|
|
109
|
+
border: none;
|
|
110
|
+
background: none;
|
|
111
|
+
cursor: pointer;
|
|
112
|
+
border-radius: var(--radius-200); /* 8px */
|
|
113
|
+
transition: background-color var(--motion-duration-base) var(--motion-ease-standard);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.ds-alert__dismiss .material-symbols-rounded {
|
|
117
|
+
--icon-size: var(--icon-size-600);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.ds-alert__dismiss:hover {
|
|
121
|
+
background-color: var(--color-action-passive-bg-hover);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.ds-alert__dismiss:focus-visible {
|
|
125
|
+
outline: 2px solid var(--color-action-primary-bg);
|
|
126
|
+
outline-offset: 2px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* ============================================
|
|
130
|
+
VARIANT — INFO
|
|
131
|
+
============================================ */
|
|
132
|
+
|
|
133
|
+
.ds-alert--info {
|
|
134
|
+
background-color: var(--color-status-info-bg);
|
|
135
|
+
border-color: var(--color-status-info-border);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.ds-alert--info .ds-alert__icon {
|
|
139
|
+
color: var(--color-status-info-border);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.ds-alert--info .ds-alert__title {
|
|
143
|
+
color: var(--color-status-info-text);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.ds-alert--info .ds-alert__description {
|
|
147
|
+
color: var(--color-status-info-text);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.ds-alert--info .ds-alert__dismiss {
|
|
151
|
+
color: var(--color-status-info-text);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/* ============================================
|
|
155
|
+
VARIANT — POSITIVE
|
|
156
|
+
============================================ */
|
|
157
|
+
|
|
158
|
+
.ds-alert--positive {
|
|
159
|
+
background-color: var(--color-status-positive-bg);
|
|
160
|
+
border-color: var(--color-status-positive-border);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.ds-alert--positive .ds-alert__icon {
|
|
164
|
+
color: var(--color-status-positive-border);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.ds-alert--positive .ds-alert__title {
|
|
168
|
+
color: var(--color-status-positive-text);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.ds-alert--positive .ds-alert__description {
|
|
172
|
+
color: var(--color-status-positive-text);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.ds-alert--positive .ds-alert__dismiss {
|
|
176
|
+
color: var(--color-status-positive-text);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/* ============================================
|
|
180
|
+
VARIANT — WARNING
|
|
181
|
+
============================================ */
|
|
182
|
+
|
|
183
|
+
.ds-alert--warning {
|
|
184
|
+
background-color: var(--color-status-warning-bg);
|
|
185
|
+
border-color: var(--color-status-warning-border);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.ds-alert--warning .ds-alert__icon {
|
|
189
|
+
color: var(--color-status-warning-border);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.ds-alert--warning .ds-alert__title {
|
|
193
|
+
color: var(--color-status-warning-text);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.ds-alert--warning .ds-alert__description {
|
|
197
|
+
color: var(--color-status-warning-text);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.ds-alert--warning .ds-alert__dismiss {
|
|
201
|
+
color: var(--color-status-warning-text);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/* ============================================
|
|
205
|
+
VARIANT — ERROR
|
|
206
|
+
============================================ */
|
|
207
|
+
|
|
208
|
+
.ds-alert--error {
|
|
209
|
+
background-color: var(--color-status-error-bg);
|
|
210
|
+
border-color: var(--color-status-error-border);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.ds-alert--error .ds-alert__icon {
|
|
214
|
+
color: var(--color-status-error-border);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.ds-alert--error .ds-alert__title {
|
|
218
|
+
color: var(--color-status-error-text);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.ds-alert--error .ds-alert__description {
|
|
222
|
+
color: var(--color-status-error-text);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.ds-alert--error .ds-alert__dismiss {
|
|
226
|
+
color: var(--color-status-error-text);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/* ============================================
|
|
230
|
+
VARIANT — NEUTRAL
|
|
231
|
+
============================================ */
|
|
232
|
+
|
|
233
|
+
.ds-alert--neutral {
|
|
234
|
+
background-color: var(--color-status-neutral-bg);
|
|
235
|
+
border-color: var(--color-status-neutral-border);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.ds-alert--neutral .ds-alert__icon {
|
|
239
|
+
color: var(--color-status-neutral-text);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.ds-alert--neutral .ds-alert__title {
|
|
243
|
+
color: var(--color-status-neutral-text);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.ds-alert--neutral .ds-alert__description {
|
|
247
|
+
color: var(--color-status-neutral-text);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.ds-alert--neutral .ds-alert__dismiss {
|
|
251
|
+
color: var(--color-status-neutral-text);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/* Icons take the colour of the text around them. Explicit, not just
|
|
255
|
+
inherited by default: a consumer stylesheet that sets a colour on
|
|
256
|
+
.material-symbols-rounded itself (a common global default) would
|
|
257
|
+
otherwise override inheritance and detach the icon from the state
|
|
258
|
+
colours this component sets on its parents. */
|
|
259
|
+
.ds-alert .material-symbols-rounded {
|
|
260
|
+
color: inherit;
|
|
261
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface AlertProps {
|
|
3
|
+
/** Alert title text */
|
|
4
|
+
title?: string;
|
|
5
|
+
/** Alert description / body text */
|
|
6
|
+
description?: string;
|
|
7
|
+
/** Alert variant determines colour and icon */
|
|
8
|
+
variant?: 'info' | 'positive' | 'warning' | 'error' | 'neutral';
|
|
9
|
+
/** Component size */
|
|
10
|
+
size?: 'default' | 'compact';
|
|
11
|
+
/** Whether the alert can be dismissed */
|
|
12
|
+
dismissible?: boolean;
|
|
13
|
+
/** Custom icon override — Material Symbol name (string) or custom element (ReactNode) */
|
|
14
|
+
icon?: string | React.ReactNode;
|
|
15
|
+
/** Callback when dismiss button is clicked */
|
|
16
|
+
onDismiss?: () => void;
|
|
17
|
+
/** Additional CSS classes */
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Alert component for contextual feedback messages.
|
|
22
|
+
* Supports info, positive, warning, error, and neutral variants
|
|
23
|
+
* with optional dismiss functionality.
|
|
24
|
+
*/
|
|
25
|
+
export declare const Alert: ({ title, description, variant, size, dismissible, icon, onDismiss, className, }: AlertProps) => React.JSX.Element;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import "./Alert.css";
|
|
3
|
+
import "../../fonts/material-symbols.css";
|
|
4
|
+
const defaultIcons = {
|
|
5
|
+
info: "info",
|
|
6
|
+
positive: "check_circle",
|
|
7
|
+
warning: "warning",
|
|
8
|
+
error: "error",
|
|
9
|
+
neutral: "info"
|
|
10
|
+
};
|
|
11
|
+
const Alert = ({
|
|
12
|
+
title,
|
|
13
|
+
description,
|
|
14
|
+
variant = "info",
|
|
15
|
+
size = "default",
|
|
16
|
+
dismissible = false,
|
|
17
|
+
icon,
|
|
18
|
+
onDismiss,
|
|
19
|
+
className = ""
|
|
20
|
+
}) => {
|
|
21
|
+
const baseClass = "ds-alert";
|
|
22
|
+
const variantClass = `${baseClass}--${variant}`;
|
|
23
|
+
const sizeClass = `${baseClass}--${size}`;
|
|
24
|
+
const classes = [baseClass, variantClass, sizeClass, className].filter(Boolean).join(" ");
|
|
25
|
+
const iconValue = icon || defaultIcons[variant];
|
|
26
|
+
return /* @__PURE__ */ jsxs("div", { className: classes, role: "alert", children: [
|
|
27
|
+
typeof iconValue === "string" ? /* @__PURE__ */ jsx(
|
|
28
|
+
"span",
|
|
29
|
+
{
|
|
30
|
+
className: `${baseClass}__icon material-symbols-rounded`,
|
|
31
|
+
"aria-hidden": "true",
|
|
32
|
+
children: iconValue
|
|
33
|
+
}
|
|
34
|
+
) : /* @__PURE__ */ jsx("span", { className: `${baseClass}__icon`, "aria-hidden": "true", children: iconValue }),
|
|
35
|
+
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__content`, children: [
|
|
36
|
+
title && /* @__PURE__ */ jsx("p", { className: `${baseClass}__title`, children: title }),
|
|
37
|
+
description && /* @__PURE__ */ jsx("p", { className: `${baseClass}__description`, children: description })
|
|
38
|
+
] }),
|
|
39
|
+
dismissible && /* @__PURE__ */ jsx(
|
|
40
|
+
"button",
|
|
41
|
+
{
|
|
42
|
+
type: "button",
|
|
43
|
+
className: `${baseClass}__dismiss`,
|
|
44
|
+
onClick: onDismiss,
|
|
45
|
+
"aria-label": "Dismiss alert",
|
|
46
|
+
children: /* @__PURE__ */ jsx("span", { className: "material-symbols-rounded", "aria-hidden": "true", children: "close" })
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
] });
|
|
50
|
+
};
|
|
51
|
+
export {
|
|
52
|
+
Alert
|
|
53
|
+
};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/* ============================================
|
|
2
|
+
ALERT DIALOG COMPONENT
|
|
3
|
+
Modal confirmation with backdrop overlay
|
|
4
|
+
============================================ */
|
|
5
|
+
|
|
6
|
+
.ds-alert-dialog {
|
|
7
|
+
position: fixed;
|
|
8
|
+
inset: 0;
|
|
9
|
+
z-index: 100;
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
opacity: 0;
|
|
14
|
+
visibility: hidden; /* keeps panel controls out of the tab order when closed */
|
|
15
|
+
pointer-events: none;
|
|
16
|
+
transition: opacity var(--motion-duration-base) var(--motion-ease-standard), visibility var(--motion-duration-base) var(--motion-ease-standard);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.ds-alert-dialog--open {
|
|
20
|
+
opacity: 1;
|
|
21
|
+
visibility: visible;
|
|
22
|
+
pointer-events: auto;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* ============================================
|
|
26
|
+
BACKDROP
|
|
27
|
+
============================================ */
|
|
28
|
+
|
|
29
|
+
.ds-alert-dialog__backdrop {
|
|
30
|
+
position: absolute;
|
|
31
|
+
inset: 0;
|
|
32
|
+
background-color: var(--color-scrim);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* ============================================
|
|
36
|
+
PANEL
|
|
37
|
+
============================================ */
|
|
38
|
+
|
|
39
|
+
.ds-alert-dialog__panel {
|
|
40
|
+
position: relative;
|
|
41
|
+
z-index: 1;
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-direction: column;
|
|
44
|
+
gap: var(--gap-400); /* 16px */
|
|
45
|
+
min-width: 320px;
|
|
46
|
+
max-width: 480px;
|
|
47
|
+
padding: var(--padding-500); /* 20px */
|
|
48
|
+
border: var(--border-025) solid var(--color-bg-container-border);
|
|
49
|
+
border-radius: var(--radius-300); /* 12px */
|
|
50
|
+
background-color: var(--color-bg-page-primary);
|
|
51
|
+
box-shadow: var(--shadow-modal);
|
|
52
|
+
transform: scale(0.96);
|
|
53
|
+
transition: transform var(--motion-duration-base) var(--motion-ease-standard);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.ds-alert-dialog--open .ds-alert-dialog__panel {
|
|
57
|
+
transform: scale(1);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* ============================================
|
|
61
|
+
HEADER
|
|
62
|
+
============================================ */
|
|
63
|
+
|
|
64
|
+
.ds-alert-dialog__header {
|
|
65
|
+
display: flex;
|
|
66
|
+
align-items: center;
|
|
67
|
+
gap: var(--gap-200); /* 8px */
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.ds-alert-dialog__icon {
|
|
71
|
+
flex-shrink: 0;
|
|
72
|
+
--icon-size: var(--icon-size-600);
|
|
73
|
+
line-height: 1;
|
|
74
|
+
color: var(--color-icon-primary);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.ds-alert-dialog--destructive .ds-alert-dialog__icon {
|
|
78
|
+
color: var(--color-status-error-border);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* ============================================
|
|
82
|
+
TITLE
|
|
83
|
+
============================================ */
|
|
84
|
+
|
|
85
|
+
.ds-alert-dialog__title {
|
|
86
|
+
font-family: var(--font-heading-3-family);
|
|
87
|
+
font-size: var(--font-heading-3-size);
|
|
88
|
+
font-weight: var(--font-heading-3-weight);
|
|
89
|
+
line-height: var(--font-heading-3-line-height);
|
|
90
|
+
letter-spacing: var(--font-heading-3-letter-spacing);
|
|
91
|
+
color: var(--color-text-primary);
|
|
92
|
+
margin: 0;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.ds-alert-dialog--destructive .ds-alert-dialog__title {
|
|
96
|
+
color: var(--color-status-error-border);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* ============================================
|
|
100
|
+
DESCRIPTION
|
|
101
|
+
============================================ */
|
|
102
|
+
|
|
103
|
+
.ds-alert-dialog__description {
|
|
104
|
+
font-family: var(--font-paragraph-family);
|
|
105
|
+
font-size: var(--font-paragraph-size);
|
|
106
|
+
font-weight: var(--font-paragraph-weight);
|
|
107
|
+
line-height: var(--font-paragraph-line-height);
|
|
108
|
+
letter-spacing: var(--font-paragraph-letter-spacing);
|
|
109
|
+
color: var(--color-text-secondary);
|
|
110
|
+
margin: 0;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* ============================================
|
|
114
|
+
ACTIONS
|
|
115
|
+
============================================ */
|
|
116
|
+
|
|
117
|
+
.ds-alert-dialog__actions {
|
|
118
|
+
display: flex;
|
|
119
|
+
justify-content: flex-end;
|
|
120
|
+
gap: var(--gap-200); /* 8px */
|
|
121
|
+
padding-top: var(--padding-150); /* 6px */
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* ============================================
|
|
125
|
+
RESPONSIVE
|
|
126
|
+
============================================ */
|
|
127
|
+
|
|
128
|
+
@media (max-width: 480px) {
|
|
129
|
+
.ds-alert-dialog__panel {
|
|
130
|
+
min-width: auto;
|
|
131
|
+
margin: var(--padding-400);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface AlertDialogProps {
|
|
2
|
+
/** Whether the dialog is open */
|
|
3
|
+
open: boolean;
|
|
4
|
+
/** Callback when dialog requests to close */
|
|
5
|
+
onOpenChange: (open: boolean) => void;
|
|
6
|
+
/** Dialog title */
|
|
7
|
+
title: string;
|
|
8
|
+
/** Dialog description / body text */
|
|
9
|
+
description?: string;
|
|
10
|
+
/** Confirm button label */
|
|
11
|
+
confirmLabel?: string;
|
|
12
|
+
/** Cancel button label */
|
|
13
|
+
cancelLabel?: string;
|
|
14
|
+
/** Callback when confirm is clicked */
|
|
15
|
+
onConfirm?: () => void;
|
|
16
|
+
/** Callback when cancel is clicked */
|
|
17
|
+
onCancel?: () => void;
|
|
18
|
+
/** Destructive variant for dangerous actions */
|
|
19
|
+
variant?: 'default' | 'destructive';
|
|
20
|
+
/** Additional CSS classes */
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* AlertDialog component for important confirmations.
|
|
25
|
+
* Renders a modal overlay with title, description,
|
|
26
|
+
* and confirm / cancel actions. Traps focus and
|
|
27
|
+
* supports ESC key dismissal.
|
|
28
|
+
*/
|
|
29
|
+
export declare const AlertDialog: ({ open, onOpenChange, title, description, confirmLabel, cancelLabel, onConfirm, onCancel, variant, className, }: AlertDialogProps) => import('react').ReactPortal | null;
|