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,48 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/** One budgeted quantity in the card — a meter row with an optional reset caption. */
|
|
3
|
+
export interface UsageItem {
|
|
4
|
+
/** What is being budgeted, e.g. the context window or a weekly limit */
|
|
5
|
+
label: string;
|
|
6
|
+
/** Current level */
|
|
7
|
+
value: number;
|
|
8
|
+
/** Upper bound of the budget; defaults to 100 */
|
|
9
|
+
max?: number;
|
|
10
|
+
/** Readout override replacing the default percentage, e.g. a token count */
|
|
11
|
+
valueText?: string;
|
|
12
|
+
/** Caption under the bar's trailing edge, e.g. when the limit resets */
|
|
13
|
+
resetLabel?: string;
|
|
14
|
+
/** Status override; left unset, the fill recolours through the card's thresholds */
|
|
15
|
+
variant?: 'info' | 'positive' | 'warning' | 'error' | 'neutral';
|
|
16
|
+
}
|
|
17
|
+
/** Props owned by UsageCard itself — everything else falls through to the root node. */
|
|
18
|
+
type UsageCardOwnProps = {
|
|
19
|
+
/** The budgets to show, one meter row each */
|
|
20
|
+
items: UsageItem[];
|
|
21
|
+
/** Card title in the shared chart-chrome header */
|
|
22
|
+
title?: string;
|
|
23
|
+
/** Supporting line under the title */
|
|
24
|
+
subtitle?: string;
|
|
25
|
+
/** Fractions of an item's max where its fill recolours to warning and then error */
|
|
26
|
+
thresholds?: {
|
|
27
|
+
warning?: number;
|
|
28
|
+
error?: number;
|
|
29
|
+
};
|
|
30
|
+
/** Chrome off (no border, padding, or fill) for use inside a panel that supplies the surface */
|
|
31
|
+
bare?: boolean;
|
|
32
|
+
/** Additional CSS classes */
|
|
33
|
+
className?: string;
|
|
34
|
+
};
|
|
35
|
+
export interface UsageCardProps extends UsageCardOwnProps, Omit<React.ComponentPropsWithoutRef<'div'>, keyof UsageCardOwnProps> {
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* An agent's budgets at a glance — the context window plus any number of
|
|
39
|
+
* plan or rate limits, one Meter row each, with reset captions. Wears the
|
|
40
|
+
* chart family's card chrome and takes `bare` for use inside a panel.
|
|
41
|
+
*
|
|
42
|
+
* Each fill recolours as its level crosses the card's thresholds (info
|
|
43
|
+
* until warning, then warning, then error), mirroring Gauge's threshold
|
|
44
|
+
* idea; an item's own `variant` overrides the derivation. Purely
|
|
45
|
+
* presentational (no 'use client'), so it renders from a Server Component.
|
|
46
|
+
*/
|
|
47
|
+
export declare const UsageCard: React.ForwardRefExoticComponent<UsageCardProps & React.RefAttributes<HTMLDivElement>>;
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Meter } from "../Meter/Meter.js";
|
|
4
|
+
import "../Chart/Chart.css";
|
|
5
|
+
import "./UsageCard.css";
|
|
6
|
+
const DEFAULT_THRESHOLDS = { warning: 0.8, error: 0.95 };
|
|
7
|
+
const UsageCard = React.forwardRef(
|
|
8
|
+
({
|
|
9
|
+
items,
|
|
10
|
+
title,
|
|
11
|
+
subtitle,
|
|
12
|
+
thresholds,
|
|
13
|
+
bare = false,
|
|
14
|
+
className = "",
|
|
15
|
+
...rest
|
|
16
|
+
}, ref) => {
|
|
17
|
+
const baseClass = "ds-usage-card";
|
|
18
|
+
const limits = { ...DEFAULT_THRESHOLDS, ...thresholds };
|
|
19
|
+
const variantFor = (item) => {
|
|
20
|
+
if (item.variant) return item.variant;
|
|
21
|
+
const max = item.max ?? 100;
|
|
22
|
+
const fraction = max > 0 ? Math.max(0, Math.min(1, item.value / max)) : 0;
|
|
23
|
+
if (fraction >= limits.error) return "error";
|
|
24
|
+
if (fraction >= limits.warning) return "warning";
|
|
25
|
+
return "info";
|
|
26
|
+
};
|
|
27
|
+
const classes = [baseClass, "ds-chart", bare && "ds-chart--bare", className].filter(Boolean).join(" ");
|
|
28
|
+
return /* @__PURE__ */ jsxs("div", { ...rest, ref, className: classes, children: [
|
|
29
|
+
(title || subtitle) && /* @__PURE__ */ jsx("div", { className: "ds-chart__header", children: /* @__PURE__ */ jsxs("div", { className: "ds-chart__header-text", children: [
|
|
30
|
+
title && /* @__PURE__ */ jsx("span", { className: "ds-chart__title", children: title }),
|
|
31
|
+
subtitle && /* @__PURE__ */ jsx("span", { className: "ds-chart__subtitle", children: subtitle })
|
|
32
|
+
] }) }),
|
|
33
|
+
/* @__PURE__ */ jsx("div", { className: `${baseClass}__items`, children: items.map((item, index) => /* @__PURE__ */ jsxs("div", { className: `${baseClass}__item`, children: [
|
|
34
|
+
/* @__PURE__ */ jsx(
|
|
35
|
+
Meter,
|
|
36
|
+
{
|
|
37
|
+
label: item.label,
|
|
38
|
+
value: item.value,
|
|
39
|
+
max: item.max ?? 100,
|
|
40
|
+
valueText: item.valueText,
|
|
41
|
+
showValue: true,
|
|
42
|
+
variant: variantFor(item),
|
|
43
|
+
size: "compact"
|
|
44
|
+
}
|
|
45
|
+
),
|
|
46
|
+
item.resetLabel && /* @__PURE__ */ jsx("span", { className: `${baseClass}__reset`, children: item.resetLabel })
|
|
47
|
+
] }, `${item.label}-${index}`)) })
|
|
48
|
+
] });
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
UsageCard.displayName = "UsageCard";
|
|
52
|
+
export {
|
|
53
|
+
UsageCard
|
|
54
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/* ============================================
|
|
2
|
+
WAVEFORM COMPONENT
|
|
3
|
+
Voice indicator — a row of bars dancing on
|
|
4
|
+
the shared twelve-slot cycle
|
|
5
|
+
============================================ */
|
|
6
|
+
|
|
7
|
+
/* Base — height rides the icon scale, bar width derives from it, and the
|
|
8
|
+
colour routes through one custom property so a consumer can tint the wave. */
|
|
9
|
+
|
|
10
|
+
.ds-waveform {
|
|
11
|
+
display: inline-flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
gap: var(--gap-050);
|
|
14
|
+
height: var(--icon-size-600);
|
|
15
|
+
--ds-waveform-color: var(--color-text-secondary);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.ds-waveform--compact {
|
|
19
|
+
height: var(--icon-size-500);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.ds-waveform__bar {
|
|
23
|
+
width: calc(var(--icon-size-500) / 5); /* 4px, derived from the scale */
|
|
24
|
+
height: 100%;
|
|
25
|
+
flex-shrink: 0;
|
|
26
|
+
border-radius: var(--radius-pill);
|
|
27
|
+
background-color: var(--ds-waveform-color);
|
|
28
|
+
transform: scaleY(0.25);
|
|
29
|
+
transform-origin: center;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* States */
|
|
33
|
+
|
|
34
|
+
/* Idle: parked low in the tertiary tier — present, not performing. */
|
|
35
|
+
.ds-waveform--idle {
|
|
36
|
+
--ds-waveform-color: var(--color-text-tertiary);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* Listening runs the same wave at roughly half height; speaking at full.
|
|
40
|
+
One keyframe set, scaled per state through --ds-waveform-peak. */
|
|
41
|
+
.ds-waveform--listening {
|
|
42
|
+
--ds-waveform-peak: 0.55;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.ds-waveform--speaking {
|
|
46
|
+
--ds-waveform-peak: 1;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.ds-waveform--listening .ds-waveform__bar,
|
|
50
|
+
.ds-waveform--speaking .ds-waveform__bar {
|
|
51
|
+
animation: ds-waveform-wave var(--motion-duration-loop-matrix) var(--motion-ease-standard)
|
|
52
|
+
infinite;
|
|
53
|
+
/* Negative delay by cycle slot: every bar is already mid-wave on mount,
|
|
54
|
+
and the peak travels down the row. */
|
|
55
|
+
animation-delay: calc(var(--ds-waveform-step, 0) * (var(--motion-duration-loop-matrix) / -12));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@keyframes ds-waveform-wave {
|
|
59
|
+
0%,
|
|
60
|
+
100% {
|
|
61
|
+
transform: scaleY(0.25);
|
|
62
|
+
}
|
|
63
|
+
50% {
|
|
64
|
+
transform: scaleY(calc(var(--ds-waveform-amp, 1) * var(--ds-waveform-peak, 1)));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Controlled mode — a real analyser drives the bars; each one eases to its
|
|
69
|
+
level instead of animating. */
|
|
70
|
+
.ds-waveform--levels .ds-waveform__bar {
|
|
71
|
+
animation: none;
|
|
72
|
+
transform: scaleY(var(--ds-waveform-level, 0.25));
|
|
73
|
+
transition: transform var(--motion-duration-fast) var(--motion-ease-standard);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* Visually hidden state text — what a screen reader gets instead of bars. */
|
|
77
|
+
.ds-waveform__sr {
|
|
78
|
+
position: absolute;
|
|
79
|
+
width: 1px;
|
|
80
|
+
height: 1px;
|
|
81
|
+
margin: -1px;
|
|
82
|
+
padding: 0;
|
|
83
|
+
overflow: hidden;
|
|
84
|
+
clip-path: inset(50%);
|
|
85
|
+
white-space: nowrap;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* The looping wave parks on its resting contour rather than strobing
|
|
89
|
+
through the collapsed duration — same treatment as the other looping
|
|
90
|
+
indicators. */
|
|
91
|
+
@media (prefers-reduced-motion: reduce) {
|
|
92
|
+
.ds-waveform--listening .ds-waveform__bar,
|
|
93
|
+
.ds-waveform--speaking .ds-waveform__bar {
|
|
94
|
+
animation: none;
|
|
95
|
+
transform: scaleY(calc(var(--ds-waveform-amp, 1) * 0.6));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/** Props owned by Waveform itself — everything else falls through to the root span. */
|
|
3
|
+
type WaveformOwnProps = {
|
|
4
|
+
/**
|
|
5
|
+
* What the audio channel is doing: `idle` parks the bars low and still,
|
|
6
|
+
* `listening` runs a gentle half-height wave, `speaking` runs the full one.
|
|
7
|
+
* Ignored while `levels` drives the bars.
|
|
8
|
+
*/
|
|
9
|
+
state?: 'idle' | 'listening' | 'speaking';
|
|
10
|
+
/** How many bars the wave has. */
|
|
11
|
+
bars?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Live amplitudes from a real audio analyser, one 0–1 value per bar.
|
|
14
|
+
* Providing them switches the component to controlled mode: the CSS wave
|
|
15
|
+
* stops and each bar tracks its level, easing between updates.
|
|
16
|
+
*/
|
|
17
|
+
levels?: number[];
|
|
18
|
+
/** Bar height scale — `default` sits on the md icon size, `compact` on sm. */
|
|
19
|
+
size?: 'default' | 'compact';
|
|
20
|
+
/**
|
|
21
|
+
* What a screen reader hears the indicator say. Defaults per state
|
|
22
|
+
* ("Listening", "Speaking", "Microphone idle").
|
|
23
|
+
*/
|
|
24
|
+
label?: string;
|
|
25
|
+
/** Additional CSS classes */
|
|
26
|
+
className?: string;
|
|
27
|
+
};
|
|
28
|
+
export interface WaveformProps extends WaveformOwnProps, Omit<React.ComponentPropsWithoutRef<'span'>, keyof WaveformOwnProps> {
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Waveform — the voice indicator: a row of bars that dance while audio is
|
|
32
|
+
* happening. The animated states are pure CSS choreography on the shared
|
|
33
|
+
* twelve-slot cycle (the same loop AgentStatus's dot patterns run on), so
|
|
34
|
+
* every audio indicator in a surface moves to one rhythm; `levels` hands the
|
|
35
|
+
* bars to a real analyser instead. Deliberately monochrome like the agent
|
|
36
|
+
* working states — colour is reserved for meaning, and a consumer can tint
|
|
37
|
+
* the whole wave through `--ds-waveform-color`.
|
|
38
|
+
*
|
|
39
|
+
* Purely presentational: safe to render from a Server Component. The bars
|
|
40
|
+
* are decoration to a screen reader; the state announces as text through a
|
|
41
|
+
* visually hidden live label.
|
|
42
|
+
*/
|
|
43
|
+
export declare const Waveform: React.ForwardRefExoticComponent<WaveformProps & React.RefAttributes<HTMLSpanElement>>;
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import "./Waveform.css";
|
|
4
|
+
const DEFAULT_LABELS = {
|
|
5
|
+
idle: "Microphone idle",
|
|
6
|
+
listening: "Listening",
|
|
7
|
+
speaking: "Speaking"
|
|
8
|
+
};
|
|
9
|
+
const Waveform = React.forwardRef(
|
|
10
|
+
({ state = "idle", bars = 5, levels, size = "default", label, className = "", ...rest }, ref) => {
|
|
11
|
+
const baseClass = "ds-waveform";
|
|
12
|
+
const controlled = Array.isArray(levels);
|
|
13
|
+
const count = controlled ? levels.length : Math.max(bars, 1);
|
|
14
|
+
const classes = [
|
|
15
|
+
baseClass,
|
|
16
|
+
`${baseClass}--${size}`,
|
|
17
|
+
controlled ? `${baseClass}--levels` : `${baseClass}--${state}`,
|
|
18
|
+
className
|
|
19
|
+
].filter(Boolean).join(" ");
|
|
20
|
+
return /* @__PURE__ */ jsxs("span", { ...rest, ref, className: classes, role: "status", children: [
|
|
21
|
+
Array.from({ length: count }, (_, i) => {
|
|
22
|
+
const amp = 0.35 + 0.65 * Math.sin(Math.PI * (i + 1) / (count + 1));
|
|
23
|
+
const step = i * 2 % 12;
|
|
24
|
+
const level = controlled ? Math.min(Math.max(levels[i], 0.08), 1) : void 0;
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
"span",
|
|
27
|
+
{
|
|
28
|
+
className: `${baseClass}__bar`,
|
|
29
|
+
"aria-hidden": "true",
|
|
30
|
+
style: {
|
|
31
|
+
"--ds-waveform-amp": amp,
|
|
32
|
+
"--ds-waveform-step": step,
|
|
33
|
+
...level !== void 0 && { "--ds-waveform-level": level }
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
i
|
|
37
|
+
);
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}__sr`, children: label ?? DEFAULT_LABELS[state] })
|
|
40
|
+
] });
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
Waveform.displayName = "Waveform";
|
|
44
|
+
export {
|
|
45
|
+
Waveform
|
|
46
|
+
};
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/* ============================================
|
|
2
|
+
WORLD MAP COMPONENT
|
|
3
|
+
A flat Mercator map: baked Natural Earth land,
|
|
4
|
+
a quiet graticule, and HTML markers positioned
|
|
5
|
+
over the drawing. Every colour is a token; the
|
|
6
|
+
marker dimensions are drawing geometry, like
|
|
7
|
+
ToggleSwitch's thumb (see the design.md spec).
|
|
8
|
+
============================================ */
|
|
9
|
+
|
|
10
|
+
/* Base — the root crops the frame, which carries the framed window's exact
|
|
11
|
+
aspect ratio so marker percentages line up with the drawing. */
|
|
12
|
+
|
|
13
|
+
.ds-world-map {
|
|
14
|
+
position: relative;
|
|
15
|
+
display: block;
|
|
16
|
+
width: 100%;
|
|
17
|
+
height: 100%;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.ds-world-map:focus-visible {
|
|
22
|
+
outline: var(--border-050) solid var(--color-action-primary-bg);
|
|
23
|
+
outline-offset: var(--padding-100);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.ds-world-map__frame {
|
|
27
|
+
position: absolute;
|
|
28
|
+
top: 50%;
|
|
29
|
+
left: 50%;
|
|
30
|
+
transform: translate(-50%, -50%);
|
|
31
|
+
/* Until the first measurement, fill the root; the SVG's own fitting keeps
|
|
32
|
+
the drawing undistorted for that first frame. */
|
|
33
|
+
width: 100%;
|
|
34
|
+
height: 100%;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* Grabbable whenever there is world beyond the window; the touch lock is
|
|
38
|
+
separate and applies only while zoomed, so an unzoomed map never
|
|
39
|
+
swallows the page's touch scroll. */
|
|
40
|
+
.ds-world-map__frame--pannable {
|
|
41
|
+
cursor: grab;
|
|
42
|
+
user-select: none;
|
|
43
|
+
-webkit-user-select: none;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.ds-world-map__frame--touch-lock {
|
|
47
|
+
touch-action: none;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.ds-world-map__frame--panning {
|
|
51
|
+
cursor: grabbing;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.ds-world-map__svg {
|
|
55
|
+
display: block;
|
|
56
|
+
width: 100%;
|
|
57
|
+
height: 100%;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* Drawing — hairlines stay hairlines at any zoom via non-scaling strokes. */
|
|
61
|
+
|
|
62
|
+
.ds-world-map__land {
|
|
63
|
+
fill: var(--color-bg-container-tertiary);
|
|
64
|
+
stroke: var(--color-divider);
|
|
65
|
+
stroke-width: 1;
|
|
66
|
+
vector-effect: non-scaling-stroke;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.ds-world-map__graticule {
|
|
70
|
+
fill: none;
|
|
71
|
+
stroke: var(--color-divider);
|
|
72
|
+
stroke-width: 1;
|
|
73
|
+
vector-effect: non-scaling-stroke;
|
|
74
|
+
opacity: 0.5;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* Markers — real buttons over the drawing. The 20px hit target wraps a
|
|
78
|
+
10px glyph; both are geometry, not spacing. */
|
|
79
|
+
|
|
80
|
+
.ds-world-map__marker {
|
|
81
|
+
position: absolute;
|
|
82
|
+
transform: translate(-50%, -50%);
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
justify-content: center;
|
|
86
|
+
width: 20px;
|
|
87
|
+
height: 20px;
|
|
88
|
+
padding: 0;
|
|
89
|
+
border: none;
|
|
90
|
+
background: none;
|
|
91
|
+
color: var(--ds-world-map-marker-color, var(--color-text-secondary));
|
|
92
|
+
font: inherit;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* With a hover card, a slot owns the marker's position (the colour custom
|
|
96
|
+
property inherits down to the dot), the HoverCard wrapper keeps its own
|
|
97
|
+
relative layout, and the button sits statically inside it. A hovered or
|
|
98
|
+
focused slot rises above its neighbours so the card is never under a
|
|
99
|
+
later marker. */
|
|
100
|
+
|
|
101
|
+
.ds-world-map__marker-slot {
|
|
102
|
+
position: absolute;
|
|
103
|
+
transform: translate(-50%, -50%);
|
|
104
|
+
color: var(--ds-world-map-marker-color, var(--color-text-secondary));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.ds-world-map__marker-slot:hover,
|
|
108
|
+
.ds-world-map__marker-slot:focus-within {
|
|
109
|
+
z-index: 4;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.ds-world-map__marker-slot .ds-world-map__marker {
|
|
113
|
+
position: static;
|
|
114
|
+
transform: none;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
button.ds-world-map__marker {
|
|
118
|
+
cursor: pointer;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.ds-world-map__marker:focus-visible {
|
|
122
|
+
outline: var(--border-050) solid var(--color-action-primary-bg);
|
|
123
|
+
outline-offset: var(--padding-100);
|
|
124
|
+
border-radius: var(--radius-pill);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.ds-world-map__dot {
|
|
128
|
+
width: 10px;
|
|
129
|
+
height: 10px;
|
|
130
|
+
border-radius: var(--radius-pill);
|
|
131
|
+
background-color: currentColor;
|
|
132
|
+
/* A contrast ring in the surface colour, so a dot stays legible on land
|
|
133
|
+
and water alike — a ring, not an elevation shadow. */
|
|
134
|
+
box-shadow: 0 0 0 2px var(--color-bg-container-primary);
|
|
135
|
+
transition: transform var(--motion-duration-fast) var(--motion-ease-emphasized);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/* An anchor is something fixed: the square from Globe and MapLegend's
|
|
139
|
+
glyph vocabulary, outlined rather than filled. */
|
|
140
|
+
.ds-world-map__marker--anchor .ds-world-map__dot {
|
|
141
|
+
border-radius: var(--radius-050);
|
|
142
|
+
background-color: var(--color-bg-container-primary);
|
|
143
|
+
box-shadow: inset 0 0 0 2px currentColor;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.ds-world-map__marker--active .ds-world-map__dot,
|
|
147
|
+
button.ds-world-map__marker:hover .ds-world-map__dot {
|
|
148
|
+
transform: scale(1.3);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.ds-world-map__marker--active {
|
|
152
|
+
z-index: 1;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.ds-world-map__label {
|
|
156
|
+
position: absolute;
|
|
157
|
+
left: 100%;
|
|
158
|
+
top: 50%;
|
|
159
|
+
transform: translateY(-50%);
|
|
160
|
+
padding-left: var(--padding-100);
|
|
161
|
+
font-family: var(--font-family-code);
|
|
162
|
+
font-size: var(--font-caption-size);
|
|
163
|
+
line-height: var(--font-caption-line-height);
|
|
164
|
+
color: var(--color-text-tertiary);
|
|
165
|
+
white-space: nowrap;
|
|
166
|
+
pointer-events: none;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.ds-world-map__marker--active .ds-world-map__label {
|
|
170
|
+
color: var(--color-text-primary);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/* Zoom controls — the site's diagram pill (the architecture maps and the
|
|
174
|
+
canvas board): a glass pill floating at the bottom centre, holding zoom
|
|
175
|
+
out, the percent readout (resets to 100%), and zoom in. It stays put
|
|
176
|
+
while the map pans under it. */
|
|
177
|
+
|
|
178
|
+
.ds-world-map__zoom {
|
|
179
|
+
position: absolute;
|
|
180
|
+
bottom: var(--padding-400);
|
|
181
|
+
left: 50%;
|
|
182
|
+
transform: translateX(-50%);
|
|
183
|
+
display: flex;
|
|
184
|
+
align-items: center;
|
|
185
|
+
gap: var(--gap-100);
|
|
186
|
+
padding: var(--padding-100) var(--padding-150);
|
|
187
|
+
border-radius: var(--radius-pill);
|
|
188
|
+
background: var(--color-bg-container-primary-semi);
|
|
189
|
+
backdrop-filter: blur(24px);
|
|
190
|
+
border: var(--border-025) solid var(--color-divider);
|
|
191
|
+
box-shadow: var(--shadow-floating);
|
|
192
|
+
z-index: 3;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.ds-world-map__zoom-level {
|
|
196
|
+
min-width: 4em;
|
|
197
|
+
height: var(--gap-1000);
|
|
198
|
+
padding: 0 var(--padding-150);
|
|
199
|
+
border: 0;
|
|
200
|
+
border-radius: var(--radius-pill);
|
|
201
|
+
background: none;
|
|
202
|
+
font-family: var(--font-paragraph-sm-family);
|
|
203
|
+
font-size: var(--font-paragraph-sm-size);
|
|
204
|
+
font-weight: var(--font-paragraph-sm-weight);
|
|
205
|
+
color: var(--color-text-primary);
|
|
206
|
+
font-variant-numeric: tabular-nums;
|
|
207
|
+
cursor: pointer;
|
|
208
|
+
transition: background var(--motion-duration-fast) var(--motion-ease-standard);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.ds-world-map__zoom-level:hover {
|
|
212
|
+
background: var(--color-bg-container-secondary);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.ds-world-map__zoom-level:focus-visible {
|
|
216
|
+
outline: var(--border-050) solid var(--color-action-primary-bg);
|
|
217
|
+
outline-offset: var(--gap-050);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/* Callout overlay — positioned at the marker, opening toward the map's
|
|
221
|
+
centre, where the room is. */
|
|
222
|
+
|
|
223
|
+
.ds-world-map__callout {
|
|
224
|
+
position: absolute;
|
|
225
|
+
pointer-events: none;
|
|
226
|
+
padding: 0 var(--padding-400);
|
|
227
|
+
transform: translate(0, -100%);
|
|
228
|
+
white-space: nowrap;
|
|
229
|
+
z-index: 2;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.ds-world-map__callout[data-side='left'] {
|
|
233
|
+
transform: translate(-100%, -100%);
|
|
234
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/** A place on the map. */
|
|
3
|
+
export interface WorldMapPoint {
|
|
4
|
+
/** Stable identifier, referenced by `activePointId`. */
|
|
5
|
+
id: string;
|
|
6
|
+
/** Latitude in degrees, north positive. */
|
|
7
|
+
lat: number;
|
|
8
|
+
/** Longitude in degrees, east positive. */
|
|
9
|
+
lng: number;
|
|
10
|
+
/** Short label drawn beside the marker when `showLabels` is on, and the marker's accessible name. */
|
|
11
|
+
label?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Marker glyph. `point` is a filled dot (something plotted), `anchor` is
|
|
14
|
+
* an outlined square (something fixed) — the same vocabulary Globe and
|
|
15
|
+
* MapLegend draw.
|
|
16
|
+
*/
|
|
17
|
+
kind?: 'point' | 'anchor';
|
|
18
|
+
/**
|
|
19
|
+
* Marker colour, any CSS colour (`var(--color-chart-series-2)` works) —
|
|
20
|
+
* the flat map's channel for colour-coding a category per point. Omit for
|
|
21
|
+
* the default text colour.
|
|
22
|
+
*/
|
|
23
|
+
color?: string;
|
|
24
|
+
}
|
|
25
|
+
/** The framed window: `[west, south, east, north]` in degrees. */
|
|
26
|
+
export type WorldMapBounds = [number, number, number, number];
|
|
27
|
+
/** Props owned by WorldMap itself — everything else falls through to the root `<div>`. */
|
|
28
|
+
type WorldMapOwnProps = {
|
|
29
|
+
/** The places to mark. A point outside the framed view is simply not drawn. */
|
|
30
|
+
points?: WorldMapPoint[];
|
|
31
|
+
/**
|
|
32
|
+
* The window the map frames: `[west, south, east, north]` in degrees.
|
|
33
|
+
* It must not cross the antimeridian. Defaults to the whole world
|
|
34
|
+
* (Antarctica is not in the land data). Changing it resets any zoom.
|
|
35
|
+
*/
|
|
36
|
+
bounds?: WorldMapBounds;
|
|
37
|
+
/**
|
|
38
|
+
* How the framed window meets the container: `contain` letterboxes so the
|
|
39
|
+
* whole window is visible, `cover` fills the container and crops the
|
|
40
|
+
* window's edges — the full-bleed stage look.
|
|
41
|
+
*/
|
|
42
|
+
fit?: 'contain' | 'cover';
|
|
43
|
+
/**
|
|
44
|
+
* Renders the zoom pill (zoom out, a percent readout that resets the
|
|
45
|
+
* view, zoom in). Zoom steps into `bounds` and out past them — down to
|
|
46
|
+
* the whole world with air around it, the graticule carrying on into
|
|
47
|
+
* the space. Ctrl or ⌘ with the scroll wheel (a trackpad pinch) zooms at
|
|
48
|
+
* the pointer; a plain scroll keeps scrolling the page. Dragging, or the
|
|
49
|
+
* arrow keys with the map focused, moves the view anywhere on the world
|
|
50
|
+
* at any zoom; a finger only drags while zoomed in, so the page keeps
|
|
51
|
+
* its touch scroll too. Needs `interactive`.
|
|
52
|
+
*/
|
|
53
|
+
showZoomControls?: boolean;
|
|
54
|
+
/** How far the zoom controls can step in, as a multiple of `bounds`. */
|
|
55
|
+
maxZoom?: number;
|
|
56
|
+
/** Degrees between graticule lines. `0` removes the graticule. */
|
|
57
|
+
graticuleStep?: number;
|
|
58
|
+
/** Draw each point's `label` beside its marker. */
|
|
59
|
+
showLabels?: boolean;
|
|
60
|
+
/** The point to single out: its marker enlarges and its callout renders. */
|
|
61
|
+
activePointId?: string;
|
|
62
|
+
/** Markers are real buttons: hoverable, focusable, clickable. Off, they become inert glyphs and the map is one image. */
|
|
63
|
+
interactive?: boolean;
|
|
64
|
+
/** Fires as the pointer enters a marker (or it takes focus), and with `null` as it leaves. */
|
|
65
|
+
onPointHover?: (point: WorldMapPoint | null) => void;
|
|
66
|
+
/** Fires when a marker is clicked. */
|
|
67
|
+
onPointClick?: (point: WorldMapPoint) => void;
|
|
68
|
+
/**
|
|
69
|
+
* Renders the annotation for the active (or hovered) point, placed beside
|
|
70
|
+
* its marker in an HTML overlay; MapCallout is the intended filling. The
|
|
71
|
+
* overlay carries `data-side="left"|"right"` for which side of the marker
|
|
72
|
+
* it opens on — toward the map's centre, where the room is.
|
|
73
|
+
*/
|
|
74
|
+
renderCallout?: (point: WorldMapPoint) => React.ReactNode;
|
|
75
|
+
/**
|
|
76
|
+
* Wraps each marker in the library's HoverCard, with this as the card's
|
|
77
|
+
* content — the floating-panel alternative to `renderCallout`'s bare
|
|
78
|
+
* readout, opening on hover or focus with the system's delays and Escape
|
|
79
|
+
* dismissal. Content must be phrasing-level (spans), the panel's own
|
|
80
|
+
* rule. Opens upward, or downward for a marker near the frame's top.
|
|
81
|
+
* Needs `interactive`; when both renderers are given, this one wins.
|
|
82
|
+
*/
|
|
83
|
+
renderHoverCard?: (point: WorldMapPoint) => React.ReactNode;
|
|
84
|
+
/**
|
|
85
|
+
* Accessible name for the map, e.g. "Offices across the network". The
|
|
86
|
+
* point count is appended for screen readers.
|
|
87
|
+
*/
|
|
88
|
+
label?: string;
|
|
89
|
+
/** Additional CSS classes */
|
|
90
|
+
className?: string;
|
|
91
|
+
};
|
|
92
|
+
export interface WorldMapProps extends WorldMapOwnProps, Omit<React.ComponentPropsWithoutRef<'div'>, keyof WorldMapOwnProps | 'children'> {
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* WorldMap — a flat world map drawn in SVG from Natural Earth's land
|
|
96
|
+
* shapes, for plotting where things are: token-coloured continents, a
|
|
97
|
+
* quiet graticule, and lat/lng markers that carry their own colour. The
|
|
98
|
+
* companion to Globe for when the geography should read at a glance rather
|
|
99
|
+
* than turn — still no map library and no tile server: the land ships as
|
|
100
|
+
* one baked path, so the whole map themes with the tokens.
|
|
101
|
+
*
|
|
102
|
+
* The root fills its container: give the wrapper the size, never the root
|
|
103
|
+
* a height through `className` — that would tie with the component's own
|
|
104
|
+
* fill rule at equal specificity and lose in some stylesheet orders.
|
|
105
|
+
* Frame it with `bounds` (a lng/lat window that becomes the viewBox) and
|
|
106
|
+
* `fit` (`cover` fills a stage edge to edge); `showZoomControls` adds zoom
|
|
107
|
+
* into the window, with drag and arrow-key panning while zoomed. Markers
|
|
108
|
+
* are real buttons — hover, focus, and click all work — and the callout
|
|
109
|
+
* overlay places whatever `renderCallout` returns beside the active
|
|
110
|
+
* marker; MapCallout is the intended filling.
|
|
111
|
+
*/
|
|
112
|
+
export declare const WorldMap: React.ForwardRefExoticComponent<WorldMapProps & React.RefAttributes<HTMLDivElement>>;
|
|
113
|
+
export {};
|