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,363 @@
|
|
|
1
|
+
/* ============================================
|
|
2
|
+
EVENT CALENDAR COMPONENT
|
|
3
|
+
Month-at-a-glance grid with event pills.
|
|
4
|
+
Rows share the height of the fullest day in
|
|
5
|
+
their week (grid-auto-rows), so the calendar
|
|
6
|
+
grows with its content instead of fixing a
|
|
7
|
+
cell height.
|
|
8
|
+
|
|
9
|
+
Event accents use the core accent roles —
|
|
10
|
+
never the action teal, which stays reserved
|
|
11
|
+
for actions.
|
|
12
|
+
============================================ */
|
|
13
|
+
|
|
14
|
+
.ds-event-calendar {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
gap: var(--gap-200);
|
|
18
|
+
width: 100%;
|
|
19
|
+
background-color: var(--color-bg-container-primary);
|
|
20
|
+
border: var(--border-025) solid var(--color-bg-container-border);
|
|
21
|
+
border-radius: var(--radius-300);
|
|
22
|
+
padding: var(--padding-400);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* ============================================
|
|
26
|
+
HEADER
|
|
27
|
+
============================================ */
|
|
28
|
+
|
|
29
|
+
.ds-event-calendar__header {
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
gap: var(--gap-200);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.ds-event-calendar__month {
|
|
36
|
+
flex: 1 1 auto;
|
|
37
|
+
min-width: 0;
|
|
38
|
+
color: var(--color-text-primary);
|
|
39
|
+
font-family: var(--font-title-body-family);
|
|
40
|
+
font-size: var(--font-title-body-size);
|
|
41
|
+
font-weight: var(--font-title-body-weight);
|
|
42
|
+
line-height: var(--font-title-body-line-height);
|
|
43
|
+
letter-spacing: var(--font-title-body-letter-spacing);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.ds-event-calendar__nav {
|
|
47
|
+
display: flex;
|
|
48
|
+
gap: var(--gap-050);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.ds-event-calendar__nav-btn {
|
|
52
|
+
--icon-size: var(--icon-size-500);
|
|
53
|
+
|
|
54
|
+
display: inline-flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
justify-content: center;
|
|
57
|
+
padding: var(--padding-100);
|
|
58
|
+
background-color: var(--color-action-passive-bg);
|
|
59
|
+
border: none;
|
|
60
|
+
border-radius: var(--radius-pill);
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
color: var(--color-icon-primary);
|
|
63
|
+
transition: background-color var(--motion-duration-fast) var(--motion-ease-standard);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.ds-event-calendar__nav-btn:hover {
|
|
67
|
+
background-color: var(--color-action-passive-bg-hover);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.ds-event-calendar__nav-btn:focus-visible {
|
|
71
|
+
outline: 2px solid var(--color-action-primary-bg);
|
|
72
|
+
outline-offset: 2px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.ds-event-calendar__actions {
|
|
76
|
+
display: flex;
|
|
77
|
+
align-items: center;
|
|
78
|
+
gap: var(--gap-200);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* ============================================
|
|
82
|
+
WEEKDAY ROW
|
|
83
|
+
============================================ */
|
|
84
|
+
|
|
85
|
+
.ds-event-calendar__weekdays {
|
|
86
|
+
display: grid;
|
|
87
|
+
grid-template-columns: repeat(7, 1fr);
|
|
88
|
+
gap: var(--gap-050);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.ds-event-calendar__weekday {
|
|
92
|
+
padding: var(--padding-100) var(--padding-150);
|
|
93
|
+
color: var(--color-text-tertiary);
|
|
94
|
+
font-family: var(--font-paragraph-sm-emphasis-family);
|
|
95
|
+
font-size: var(--font-paragraph-sm-emphasis-size);
|
|
96
|
+
font-weight: var(--font-paragraph-sm-emphasis-weight);
|
|
97
|
+
line-height: var(--font-paragraph-sm-emphasis-line-height);
|
|
98
|
+
letter-spacing: var(--font-paragraph-sm-emphasis-letter-spacing);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* ============================================
|
|
102
|
+
GRID
|
|
103
|
+
============================================ */
|
|
104
|
+
|
|
105
|
+
.ds-event-calendar__grid {
|
|
106
|
+
display: grid;
|
|
107
|
+
grid-template-columns: repeat(7, 1fr);
|
|
108
|
+
grid-auto-rows: 1fr;
|
|
109
|
+
gap: var(--gap-050);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.ds-event-calendar__cell {
|
|
113
|
+
display: flex;
|
|
114
|
+
flex-direction: column;
|
|
115
|
+
gap: var(--gap-050);
|
|
116
|
+
min-width: 0;
|
|
117
|
+
padding: var(--padding-100);
|
|
118
|
+
background-color: var(--color-calendar-cell-bg);
|
|
119
|
+
border-radius: var(--radius-200);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.ds-event-calendar__cell--outside {
|
|
123
|
+
background-color: var(--color-bg-container-primary-transparent);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.ds-event-calendar__cell--outside .ds-event-calendar__day {
|
|
127
|
+
color: var(--color-text-tertiary);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* With onDateClick the whole cell is a pointer target (the day-number
|
|
131
|
+
button stays the accessible control) — cursor and colour together say
|
|
132
|
+
the day will take the click. The cell keeps its hover while the pointer
|
|
133
|
+
is on an event pill inside it: the pill separates through its hover
|
|
134
|
+
ring and a fill one step off the hovered cell — darker than that cell
|
|
135
|
+
in dark, lighter in light. */
|
|
136
|
+
.ds-event-calendar__cell--clickable {
|
|
137
|
+
cursor: pointer;
|
|
138
|
+
transition: background-color var(--motion-duration-fast) var(--motion-ease-standard);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.ds-event-calendar__cell--clickable:hover {
|
|
142
|
+
background-color: var(--color-calendar-cell-bg-hover);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/* ============================================
|
|
146
|
+
DAY NUMBER
|
|
147
|
+
============================================ */
|
|
148
|
+
|
|
149
|
+
.ds-event-calendar__day {
|
|
150
|
+
display: inline-flex;
|
|
151
|
+
align-items: center;
|
|
152
|
+
justify-content: center;
|
|
153
|
+
align-self: flex-start;
|
|
154
|
+
min-width: var(--icon-size-600);
|
|
155
|
+
height: var(--icon-size-600);
|
|
156
|
+
padding: 0 var(--padding-100);
|
|
157
|
+
background: none;
|
|
158
|
+
border: none;
|
|
159
|
+
border-radius: var(--radius-pill);
|
|
160
|
+
color: var(--color-text-secondary);
|
|
161
|
+
font-family: var(--font-paragraph-sm-family);
|
|
162
|
+
font-size: var(--font-paragraph-sm-size);
|
|
163
|
+
font-weight: var(--font-paragraph-sm-weight);
|
|
164
|
+
line-height: var(--font-paragraph-sm-line-height);
|
|
165
|
+
letter-spacing: var(--font-paragraph-sm-letter-spacing);
|
|
166
|
+
font-variant-numeric: tabular-nums;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
button.ds-event-calendar__day {
|
|
170
|
+
cursor: pointer;
|
|
171
|
+
transition: background-color var(--motion-duration-fast) var(--motion-ease-standard);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
button.ds-event-calendar__day:hover {
|
|
175
|
+
background-color: var(--color-action-passive-bg-hover);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
button.ds-event-calendar__day:focus-visible {
|
|
179
|
+
outline: 2px solid var(--color-action-primary-bg);
|
|
180
|
+
outline-offset: 2px;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/* Today — inverse chip on the day number, like DatePicker's today ring
|
|
184
|
+
but filled so it reads at calendar density */
|
|
185
|
+
.ds-event-calendar__cell--today .ds-event-calendar__day {
|
|
186
|
+
background-color: var(--color-bg-page-inverse);
|
|
187
|
+
color: var(--color-text-on-inverse);
|
|
188
|
+
font-family: var(--font-paragraph-sm-emphasis-family);
|
|
189
|
+
font-weight: var(--font-paragraph-sm-emphasis-weight);
|
|
190
|
+
letter-spacing: var(--font-paragraph-sm-emphasis-letter-spacing);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/* Selected — the teal selection chip (the selected item of a mutually
|
|
194
|
+
exclusive set, DatePicker's convention). Declared after the today block
|
|
195
|
+
so a selected today reads as selected. */
|
|
196
|
+
.ds-event-calendar__cell--selected .ds-event-calendar__day {
|
|
197
|
+
background-color: var(--color-action-primary-bg);
|
|
198
|
+
color: var(--color-action-primary-text);
|
|
199
|
+
font-family: var(--font-paragraph-sm-emphasis-family);
|
|
200
|
+
font-weight: var(--font-paragraph-sm-emphasis-weight);
|
|
201
|
+
letter-spacing: var(--font-paragraph-sm-emphasis-letter-spacing);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.ds-event-calendar__cell--selected button.ds-event-calendar__day:hover {
|
|
205
|
+
background-color: var(--color-action-primary-bg-hover);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/* ============================================
|
|
209
|
+
EVENT PILLS
|
|
210
|
+
============================================ */
|
|
211
|
+
|
|
212
|
+
.ds-event-calendar__events {
|
|
213
|
+
display: flex;
|
|
214
|
+
flex-direction: column;
|
|
215
|
+
gap: var(--gap-050);
|
|
216
|
+
min-width: 0;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.ds-event-calendar__event {
|
|
220
|
+
--ds-event-accent: var(--color-status-neutral-border);
|
|
221
|
+
|
|
222
|
+
display: flex;
|
|
223
|
+
align-items: center;
|
|
224
|
+
gap: var(--gap-050);
|
|
225
|
+
min-width: 0;
|
|
226
|
+
padding: var(--padding-050) var(--padding-150);
|
|
227
|
+
background-color: var(--color-calendar-event-bg);
|
|
228
|
+
/* Transparent at rest so the hover ring appears without a layout shift —
|
|
229
|
+
resting pills stay quiet, only the pill under the pointer gets ringed. */
|
|
230
|
+
border: var(--border-025) solid transparent;
|
|
231
|
+
border-radius: var(--radius-100);
|
|
232
|
+
text-align: left;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
button.ds-event-calendar__event {
|
|
236
|
+
cursor: pointer;
|
|
237
|
+
transition:
|
|
238
|
+
background-color var(--motion-duration-fast) var(--motion-ease-standard),
|
|
239
|
+
border-color var(--motion-duration-fast) var(--motion-ease-standard);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
button.ds-event-calendar__event:hover {
|
|
243
|
+
background-color: var(--color-calendar-event-bg-hover);
|
|
244
|
+
border-color: var(--color-calendar-event-border);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
button.ds-event-calendar__event:focus-visible {
|
|
248
|
+
outline: 2px solid var(--color-action-primary-bg);
|
|
249
|
+
outline-offset: -2px;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.ds-event-calendar__event-dot {
|
|
253
|
+
flex: none;
|
|
254
|
+
width: var(--gap-100);
|
|
255
|
+
height: var(--gap-100);
|
|
256
|
+
border-radius: var(--radius-pill);
|
|
257
|
+
background-color: var(--ds-event-accent);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.ds-event-calendar__event-title {
|
|
261
|
+
flex: 1 1 auto;
|
|
262
|
+
min-width: 0;
|
|
263
|
+
overflow: hidden;
|
|
264
|
+
text-overflow: ellipsis;
|
|
265
|
+
white-space: nowrap;
|
|
266
|
+
color: var(--color-text-primary);
|
|
267
|
+
font-family: var(--font-paragraph-sm-emphasis-family);
|
|
268
|
+
font-size: var(--font-paragraph-sm-emphasis-size);
|
|
269
|
+
font-weight: var(--font-paragraph-sm-emphasis-weight);
|
|
270
|
+
line-height: var(--font-paragraph-sm-emphasis-line-height);
|
|
271
|
+
letter-spacing: var(--font-paragraph-sm-emphasis-letter-spacing);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.ds-event-calendar__event-time {
|
|
275
|
+
flex: none;
|
|
276
|
+
color: var(--color-text-tertiary);
|
|
277
|
+
font-family: var(--font-paragraph-sm-family);
|
|
278
|
+
font-size: var(--font-paragraph-sm-size);
|
|
279
|
+
font-weight: var(--font-paragraph-sm-weight);
|
|
280
|
+
line-height: var(--font-paragraph-sm-line-height);
|
|
281
|
+
letter-spacing: var(--font-paragraph-sm-letter-spacing);
|
|
282
|
+
font-variant-numeric: tabular-nums;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/* ============================================
|
|
286
|
+
EVENT ACCENTS — core accent roles only
|
|
287
|
+
============================================ */
|
|
288
|
+
|
|
289
|
+
.ds-event-calendar__event--coral {
|
|
290
|
+
--ds-event-accent: var(--color-core-accent-coral);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.ds-event-calendar__event--violet {
|
|
294
|
+
--ds-event-accent: var(--color-core-accent-violet);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.ds-event-calendar__event--cobalt {
|
|
298
|
+
--ds-event-accent: var(--color-core-accent-cobalt);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.ds-event-calendar__event--amber {
|
|
302
|
+
--ds-event-accent: var(--color-core-accent-amber);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.ds-event-calendar__event--gold {
|
|
306
|
+
--ds-event-accent: var(--color-core-accent-gold);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.ds-event-calendar__event--mint {
|
|
310
|
+
--ds-event-accent: var(--color-core-accent-mint);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/* ============================================
|
|
314
|
+
OVERFLOW
|
|
315
|
+
============================================ */
|
|
316
|
+
|
|
317
|
+
.ds-event-calendar__more {
|
|
318
|
+
align-self: flex-start;
|
|
319
|
+
padding: var(--padding-050) var(--padding-150);
|
|
320
|
+
background: none;
|
|
321
|
+
border: none;
|
|
322
|
+
color: var(--color-text-tertiary);
|
|
323
|
+
font-family: var(--font-paragraph-sm-emphasis-family);
|
|
324
|
+
font-size: var(--font-paragraph-sm-emphasis-size);
|
|
325
|
+
font-weight: var(--font-paragraph-sm-emphasis-weight);
|
|
326
|
+
line-height: var(--font-paragraph-sm-emphasis-line-height);
|
|
327
|
+
letter-spacing: var(--font-paragraph-sm-emphasis-letter-spacing);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
button.ds-event-calendar__more {
|
|
331
|
+
cursor: pointer;
|
|
332
|
+
border-radius: var(--radius-100);
|
|
333
|
+
transition:
|
|
334
|
+
background-color var(--motion-duration-fast) var(--motion-ease-standard),
|
|
335
|
+
color var(--motion-duration-fast) var(--motion-ease-standard);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
button.ds-event-calendar__more:hover {
|
|
339
|
+
background-color: var(--color-calendar-event-bg-hover);
|
|
340
|
+
color: var(--color-text-secondary);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
button.ds-event-calendar__more:focus-visible {
|
|
344
|
+
outline: 2px solid var(--color-action-primary-bg);
|
|
345
|
+
outline-offset: -2px;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/* ============================================
|
|
349
|
+
RESPONSIVE
|
|
350
|
+
At phone widths the pills drop their time so
|
|
351
|
+
titles keep at least a few characters.
|
|
352
|
+
============================================ */
|
|
353
|
+
|
|
354
|
+
@media (max-width: 768px) {
|
|
355
|
+
.ds-event-calendar__event-time {
|
|
356
|
+
display: none;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.ds-event-calendar__weekday {
|
|
360
|
+
padding: var(--padding-100) 0;
|
|
361
|
+
text-align: center;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type EventCalendarColor = 'neutral' | 'coral' | 'violet' | 'cobalt' | 'amber' | 'gold' | 'mint';
|
|
3
|
+
export interface EventCalendarEvent {
|
|
4
|
+
/** Unique event identifier. */
|
|
5
|
+
id: string;
|
|
6
|
+
/** The day the event falls on (YYYY-MM-DD). */
|
|
7
|
+
date: string;
|
|
8
|
+
/** Short label shown in the event pill. */
|
|
9
|
+
title: string;
|
|
10
|
+
/** Start time as already-formatted text like "09:30". Untimed events sort first. */
|
|
11
|
+
time?: string;
|
|
12
|
+
/** Accent for the pill's dot, from the core accent roles. Defaults to `neutral`. */
|
|
13
|
+
color?: EventCalendarColor;
|
|
14
|
+
}
|
|
15
|
+
/** Props owned by EventCalendar itself — everything else falls through to the root element. */
|
|
16
|
+
type EventCalendarOwnProps = {
|
|
17
|
+
/** The events to place on the grid, including any that fall on the visible leading and trailing days of the neighbouring months. */
|
|
18
|
+
events?: EventCalendarEvent[];
|
|
19
|
+
/** Shown month (YYYY-MM) for controlled use. Pair with `onMonthChange`. */
|
|
20
|
+
month?: string;
|
|
21
|
+
/** Initially shown month (YYYY-MM) for uncontrolled use. Defaults to the current month. */
|
|
22
|
+
defaultMonth?: string;
|
|
23
|
+
/** Fires with the newly shown month (YYYY-MM) after prev/next navigation. */
|
|
24
|
+
onMonthChange?: (month: string) => void;
|
|
25
|
+
/** Event pills shown per day before the rest collapse into "+N more". */
|
|
26
|
+
maxEventsPerDay?: number;
|
|
27
|
+
/** Fires with the clicked event. Pills only render as buttons when this is set. */
|
|
28
|
+
onEventClick?: (event: EventCalendarEvent) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Fires with the clicked day (YYYY-MM-DD) — from anywhere on the cell, the
|
|
31
|
+
* day number, and the "+N more" overflow row. The number and overflow row
|
|
32
|
+
* only become buttons when this is set, and cells only take their pointer
|
|
33
|
+
* cursor and hover feedback with it.
|
|
34
|
+
*/
|
|
35
|
+
onDateClick?: (date: string) => void;
|
|
36
|
+
/**
|
|
37
|
+
* Marks this day (YYYY-MM-DD) as the selected one — the action-colour chip
|
|
38
|
+
* on its number, taking precedence over the today chip. Controlled by the
|
|
39
|
+
* consumer; pair with `onDateClick` to move it.
|
|
40
|
+
*/
|
|
41
|
+
selectedDate?: string;
|
|
42
|
+
/** Trailing header slot, e.g. a "New event" Button. */
|
|
43
|
+
actions?: React.ReactNode;
|
|
44
|
+
/** Additional CSS classes */
|
|
45
|
+
className?: string;
|
|
46
|
+
};
|
|
47
|
+
export interface EventCalendarProps extends EventCalendarOwnProps, Omit<React.ComponentPropsWithoutRef<'div'>, keyof EventCalendarOwnProps> {
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* EventCalendar is the month-at-a-glance view: a full month grid with event
|
|
51
|
+
* pills on their days, an overflow row once a day is full, and prev/next
|
|
52
|
+
* month navigation. DatePicker selects a date; this one shows a schedule.
|
|
53
|
+
*
|
|
54
|
+
* The calendar owns no event data semantics — it places what it is given.
|
|
55
|
+
* Filtering, fetching, and what clicking an event means stay with the
|
|
56
|
+
* consumer.
|
|
57
|
+
*/
|
|
58
|
+
export declare const EventCalendar: React.ForwardRefExoticComponent<EventCalendarProps & React.RefAttributes<HTMLDivElement>>;
|
|
59
|
+
export {};
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
3
|
+
import React, { useMemo, useState } from "react";
|
|
4
|
+
import "./EventCalendar.css";
|
|
5
|
+
import "../../fonts/material-symbols.css";
|
|
6
|
+
const DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
7
|
+
const MONTHS = [
|
|
8
|
+
"January",
|
|
9
|
+
"February",
|
|
10
|
+
"March",
|
|
11
|
+
"April",
|
|
12
|
+
"May",
|
|
13
|
+
"June",
|
|
14
|
+
"July",
|
|
15
|
+
"August",
|
|
16
|
+
"September",
|
|
17
|
+
"October",
|
|
18
|
+
"November",
|
|
19
|
+
"December"
|
|
20
|
+
];
|
|
21
|
+
function parseMonth(str) {
|
|
22
|
+
const [y, m] = str.split("-").map(Number);
|
|
23
|
+
return [y, m - 1];
|
|
24
|
+
}
|
|
25
|
+
function formatMonth(year, monthIndex) {
|
|
26
|
+
return `${year}-${String(monthIndex + 1).padStart(2, "0")}`;
|
|
27
|
+
}
|
|
28
|
+
function formatDate(date) {
|
|
29
|
+
const y = date.getFullYear();
|
|
30
|
+
const m = String(date.getMonth() + 1).padStart(2, "0");
|
|
31
|
+
const d = String(date.getDate()).padStart(2, "0");
|
|
32
|
+
return `${y}-${m}-${d}`;
|
|
33
|
+
}
|
|
34
|
+
const EventCalendar = React.forwardRef(
|
|
35
|
+
({
|
|
36
|
+
events = [],
|
|
37
|
+
month,
|
|
38
|
+
defaultMonth,
|
|
39
|
+
onMonthChange,
|
|
40
|
+
maxEventsPerDay = 3,
|
|
41
|
+
onEventClick,
|
|
42
|
+
onDateClick,
|
|
43
|
+
selectedDate,
|
|
44
|
+
actions,
|
|
45
|
+
className = "",
|
|
46
|
+
...rest
|
|
47
|
+
}, ref) => {
|
|
48
|
+
const baseClass = "ds-event-calendar";
|
|
49
|
+
const today = useMemo(() => /* @__PURE__ */ new Date(), []);
|
|
50
|
+
const isControlled = month !== void 0;
|
|
51
|
+
const [uncontrolledMonth, setUncontrolledMonth] = useState(
|
|
52
|
+
defaultMonth ?? formatMonth(today.getFullYear(), today.getMonth())
|
|
53
|
+
);
|
|
54
|
+
const currentMonth = isControlled ? month : uncontrolledMonth;
|
|
55
|
+
const [viewYear, viewMonth] = parseMonth(currentMonth);
|
|
56
|
+
const navigate = (offset) => {
|
|
57
|
+
const next = new Date(viewYear, viewMonth + offset, 1);
|
|
58
|
+
const value = formatMonth(next.getFullYear(), next.getMonth());
|
|
59
|
+
if (!isControlled) setUncontrolledMonth(value);
|
|
60
|
+
onMonthChange?.(value);
|
|
61
|
+
};
|
|
62
|
+
const eventsByDate = useMemo(() => {
|
|
63
|
+
const map = /* @__PURE__ */ new Map();
|
|
64
|
+
for (const event of events) {
|
|
65
|
+
const list = map.get(event.date) ?? [];
|
|
66
|
+
list.push(event);
|
|
67
|
+
map.set(event.date, list);
|
|
68
|
+
}
|
|
69
|
+
for (const list of map.values()) {
|
|
70
|
+
list.sort((a, b) => {
|
|
71
|
+
if (!a.time && !b.time) return 0;
|
|
72
|
+
if (!a.time) return -1;
|
|
73
|
+
if (!b.time) return 1;
|
|
74
|
+
return a.time.localeCompare(b.time);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
return map;
|
|
78
|
+
}, [events]);
|
|
79
|
+
const firstDay = new Date(viewYear, viewMonth, 1).getDay();
|
|
80
|
+
const daysInMonth = new Date(viewYear, viewMonth + 1, 0).getDate();
|
|
81
|
+
const weekCount = Math.ceil((firstDay + daysInMonth) / 7);
|
|
82
|
+
const cells = [];
|
|
83
|
+
for (let i = 0; i < weekCount * 7; i++) {
|
|
84
|
+
const date = new Date(viewYear, viewMonth, i - firstDay + 1);
|
|
85
|
+
cells.push({ date, inMonth: date.getMonth() === viewMonth });
|
|
86
|
+
}
|
|
87
|
+
const classes = [baseClass, className].filter(Boolean).join(" ");
|
|
88
|
+
return /* @__PURE__ */ jsxs("div", { ...rest, ref, className: classes, children: [
|
|
89
|
+
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__header`, children: [
|
|
90
|
+
/* @__PURE__ */ jsxs("span", { className: `${baseClass}__month`, children: [
|
|
91
|
+
MONTHS[viewMonth],
|
|
92
|
+
" ",
|
|
93
|
+
viewYear
|
|
94
|
+
] }),
|
|
95
|
+
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__nav`, children: [
|
|
96
|
+
/* @__PURE__ */ jsx(
|
|
97
|
+
"button",
|
|
98
|
+
{
|
|
99
|
+
type: "button",
|
|
100
|
+
className: `${baseClass}__nav-btn material-symbols-rounded`,
|
|
101
|
+
onClick: () => navigate(-1),
|
|
102
|
+
"aria-label": "Previous month",
|
|
103
|
+
children: "chevron_left"
|
|
104
|
+
}
|
|
105
|
+
),
|
|
106
|
+
/* @__PURE__ */ jsx(
|
|
107
|
+
"button",
|
|
108
|
+
{
|
|
109
|
+
type: "button",
|
|
110
|
+
className: `${baseClass}__nav-btn material-symbols-rounded`,
|
|
111
|
+
onClick: () => navigate(1),
|
|
112
|
+
"aria-label": "Next month",
|
|
113
|
+
children: "chevron_right"
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
] }),
|
|
117
|
+
actions && /* @__PURE__ */ jsx("div", { className: `${baseClass}__actions`, children: actions })
|
|
118
|
+
] }),
|
|
119
|
+
/* @__PURE__ */ jsx("div", { className: `${baseClass}__weekdays`, "aria-hidden": "true", children: DAYS.map((day) => /* @__PURE__ */ jsx("div", { className: `${baseClass}__weekday`, children: day }, day)) }),
|
|
120
|
+
/* @__PURE__ */ jsx(
|
|
121
|
+
"div",
|
|
122
|
+
{
|
|
123
|
+
className: `${baseClass}__grid`,
|
|
124
|
+
role: "group",
|
|
125
|
+
"aria-label": `${MONTHS[viewMonth]} ${viewYear}`,
|
|
126
|
+
children: cells.map(({ date, inMonth }) => {
|
|
127
|
+
const dateStr = formatDate(date);
|
|
128
|
+
const dayEvents = eventsByDate.get(dateStr) ?? [];
|
|
129
|
+
const visible = dayEvents.slice(0, maxEventsPerDay);
|
|
130
|
+
const overflow = dayEvents.length - visible.length;
|
|
131
|
+
const isToday = date.getFullYear() === today.getFullYear() && date.getMonth() === today.getMonth() && date.getDate() === today.getDate();
|
|
132
|
+
const dayLabel = date.toLocaleDateString(void 0, {
|
|
133
|
+
weekday: "long",
|
|
134
|
+
year: "numeric",
|
|
135
|
+
month: "long",
|
|
136
|
+
day: "numeric"
|
|
137
|
+
});
|
|
138
|
+
const isSelected = dateStr === selectedDate;
|
|
139
|
+
const cellClasses = [
|
|
140
|
+
`${baseClass}__cell`,
|
|
141
|
+
!inMonth ? `${baseClass}__cell--outside` : "",
|
|
142
|
+
isToday ? `${baseClass}__cell--today` : "",
|
|
143
|
+
isSelected ? `${baseClass}__cell--selected` : "",
|
|
144
|
+
onDateClick ? `${baseClass}__cell--clickable` : ""
|
|
145
|
+
].filter(Boolean).join(" ");
|
|
146
|
+
return /* @__PURE__ */ jsxs(
|
|
147
|
+
"div",
|
|
148
|
+
{
|
|
149
|
+
className: cellClasses,
|
|
150
|
+
onClick: onDateClick ? (e) => {
|
|
151
|
+
if (e.target.closest("button")) return;
|
|
152
|
+
onDateClick(dateStr);
|
|
153
|
+
} : void 0,
|
|
154
|
+
children: [
|
|
155
|
+
onDateClick ? /* @__PURE__ */ jsx(
|
|
156
|
+
"button",
|
|
157
|
+
{
|
|
158
|
+
type: "button",
|
|
159
|
+
className: `${baseClass}__day`,
|
|
160
|
+
onClick: () => onDateClick(dateStr),
|
|
161
|
+
"aria-label": dayLabel,
|
|
162
|
+
"aria-current": isToday ? "date" : void 0,
|
|
163
|
+
"aria-pressed": selectedDate !== void 0 ? isSelected : void 0,
|
|
164
|
+
children: date.getDate()
|
|
165
|
+
}
|
|
166
|
+
) : /* @__PURE__ */ jsx(
|
|
167
|
+
"span",
|
|
168
|
+
{
|
|
169
|
+
className: `${baseClass}__day`,
|
|
170
|
+
"aria-label": dayLabel,
|
|
171
|
+
"aria-current": isToday ? "date" : void 0,
|
|
172
|
+
children: date.getDate()
|
|
173
|
+
}
|
|
174
|
+
),
|
|
175
|
+
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__events`, children: [
|
|
176
|
+
visible.map((event) => {
|
|
177
|
+
const pillClasses = [
|
|
178
|
+
`${baseClass}__event`,
|
|
179
|
+
`${baseClass}__event--${event.color ?? "neutral"}`
|
|
180
|
+
].join(" ");
|
|
181
|
+
const pillContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
182
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}__event-dot`, "aria-hidden": "true" }),
|
|
183
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}__event-title`, children: event.title }),
|
|
184
|
+
event.time && /* @__PURE__ */ jsx("span", { className: `${baseClass}__event-time`, children: event.time })
|
|
185
|
+
] });
|
|
186
|
+
return onEventClick ? /* @__PURE__ */ jsx(
|
|
187
|
+
"button",
|
|
188
|
+
{
|
|
189
|
+
type: "button",
|
|
190
|
+
className: pillClasses,
|
|
191
|
+
onClick: () => onEventClick(event),
|
|
192
|
+
"aria-label": `${event.title}${event.time ? `, ${event.time}` : ""}, ${dayLabel}`,
|
|
193
|
+
children: pillContent
|
|
194
|
+
},
|
|
195
|
+
event.id
|
|
196
|
+
) : /* @__PURE__ */ jsx("span", { className: pillClasses, children: pillContent }, event.id);
|
|
197
|
+
}),
|
|
198
|
+
overflow > 0 && (onDateClick ? /* @__PURE__ */ jsxs(
|
|
199
|
+
"button",
|
|
200
|
+
{
|
|
201
|
+
type: "button",
|
|
202
|
+
className: `${baseClass}__more`,
|
|
203
|
+
onClick: () => onDateClick(dateStr),
|
|
204
|
+
"aria-label": `${overflow} more event${overflow === 1 ? "" : "s"}, ${dayLabel}`,
|
|
205
|
+
children: [
|
|
206
|
+
"+",
|
|
207
|
+
overflow,
|
|
208
|
+
" more"
|
|
209
|
+
]
|
|
210
|
+
}
|
|
211
|
+
) : /* @__PURE__ */ jsxs("span", { className: `${baseClass}__more`, children: [
|
|
212
|
+
"+",
|
|
213
|
+
overflow,
|
|
214
|
+
" more"
|
|
215
|
+
] }))
|
|
216
|
+
] })
|
|
217
|
+
]
|
|
218
|
+
},
|
|
219
|
+
dateStr
|
|
220
|
+
);
|
|
221
|
+
})
|
|
222
|
+
}
|
|
223
|
+
)
|
|
224
|
+
] });
|
|
225
|
+
}
|
|
226
|
+
);
|
|
227
|
+
EventCalendar.displayName = "EventCalendar";
|
|
228
|
+
export {
|
|
229
|
+
EventCalendar
|
|
230
|
+
};
|