rift-ds 1.35.0 → 1.37.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/README.md +2 -1
- package/behaviors/chat-card.css +6 -0
- package/behaviors/direction.css +6 -0
- package/behaviors/matchParts.d.ts +9 -0
- package/behaviors/matchParts.js +10 -0
- package/behaviors/shell.css +6 -0
- package/behaviors/shortcuts.js +2 -2
- package/behaviors/useLayer.d.ts +2 -2
- package/behaviors/visually-hidden.css +6 -0
- package/bin/templates/blocks/app/landing/page.module.css +50 -0
- package/bin/templates/blocks/app/landing/page.tsx +157 -0
- package/bin/templates/blocks/app/pricing/page.module.css +15 -0
- package/bin/templates/blocks/app/pricing/page.tsx +173 -0
- package/bin/templates/blocks/app/settings/ProfileForm.tsx +1 -1
- package/bin/templates/blocks/app/sign-in/page.tsx +3 -3
- package/bin/templates/blocks/components/blocks/MarketingShell.module.css +66 -0
- package/bin/templates/blocks/components/blocks/MarketingShell.tsx +141 -0
- package/bin/templates/blocks/components/blocks/emberScene.ts +1 -1
- package/bin/templates/blocks/registry.json +24 -0
- package/chat/AssistantTurn.js +5 -20
- package/chat/ChatAgentPane.css +6 -0
- package/chat/ChatWidget.css +6 -0
- package/chat/demo.css +6 -0
- package/chat/queries.js +1 -1
- package/chat/selection.css +6 -0
- package/components/Accordion/Accordion.css +6 -0
- package/components/ActionBar/ActionBar.css +6 -0
- package/components/ActionCard/ActionCard.css +6 -0
- package/components/ActionReadout/ActionReadout.css +6 -0
- package/components/AgentPlan/AgentPlan.css +6 -0
- package/components/AgentRail/AgentRail.css +6 -0
- package/components/AgentStatus/AgentStatus.css +12 -7
- package/components/AiButton/AiButton.css +17 -11
- package/components/Alert/Alert.css +6 -0
- package/components/AlertDialog/AlertDialog.css +6 -0
- package/components/AnchorNav/AnchorNav.css +6 -0
- package/components/AnimatedNumber/AnimatedNumber.css +5 -0
- package/components/AppLayout/AppLayout.css +6 -0
- package/components/AppSidebar/AppSidebar.css +19 -1
- package/components/AppSidebar/AppSidebar.d.ts +1 -1
- package/components/AppSidebar/AppSidebar.js +10 -4
- package/components/ArtifactCard/ArtifactCard.css +6 -0
- package/components/ArtifactPanel/ArtifactPanel.css +6 -0
- package/components/Attachment/Attachment.css +6 -0
- package/components/Attachment/AttachmentGroup.js +4 -1
- package/components/Avatar/Avatar.css +6 -0
- package/components/AvatarGroup/AvatarGroup.css +6 -0
- package/components/BackToTop/BackToTop.css +6 -0
- package/components/Badge/Badge.css +6 -0
- package/components/Banner/Banner.css +6 -0
- package/components/BentoTile/BentoTile.css +6 -0
- package/components/BottomNav/BottomNav.css +6 -0
- package/components/Breadcrumb/Breadcrumb.css +6 -0
- package/components/Button/Button.css +6 -0
- package/components/Button/Button.d.ts +7 -1
- package/components/Button/Button.js +2 -1
- package/components/ButtonGroup/ButtonGroup.css +6 -0
- package/components/Card/Card.css +6 -0
- package/components/CardStack/CardStack.css +5 -0
- package/components/Carousel/Carousel.css +6 -0
- package/components/Chart/ActiveReporter.d.ts +32 -0
- package/components/Chart/ActiveReporter.js +31 -0
- package/components/Chart/AreaChart.d.ts +7 -1
- package/components/Chart/AreaChart.js +8 -3
- package/components/Chart/BarChart.d.ts +12 -0
- package/components/Chart/BarChart.js +8 -3
- package/components/Chart/Chart.css +9 -1
- package/components/Chart/ComboChart.d.ts +7 -1
- package/components/Chart/ComboChart.js +8 -3
- package/components/Chart/LineChart.d.ts +7 -1
- package/components/Chart/LineChart.js +8 -3
- package/components/Chart/StackedBarChart.d.ts +7 -1
- package/components/Chart/StackedBarChart.js +8 -3
- package/components/ChatHeader/ChatHeader.css +6 -0
- package/components/ChatMarker/ChatMarker.css +6 -0
- package/components/ChatMessage/ChatMessage.css +6 -0
- package/components/ChatThread/ChatThread.css +6 -0
- package/components/Checkbox/Checkbox.css +6 -0
- package/components/Checkbox/Checkbox.js +1 -1
- package/components/Checklist/Checklist.css +6 -0
- package/components/Chip/Chip.css +6 -0
- package/components/CodeBlock/CodeBlock.css +6 -0
- package/components/CodeDiff/CodeDiff.css +5 -0
- package/components/ColorPicker/ColorPicker.css +6 -0
- package/components/ColourSwatch/ColourSwatch.css +6 -0
- package/components/Combobox/Combobox.css +32 -0
- package/components/Combobox/Combobox.d.ts +10 -0
- package/components/Combobox/Combobox.js +10 -0
- package/components/CommandPalette/CommandPalette.css +32 -0
- package/components/CommandPalette/CommandPalette.d.ts +2 -1
- package/components/CommandPalette/CommandPalette.js +21 -4
- package/components/CommandPaletteTrigger/CommandPaletteTrigger.css +6 -0
- package/components/Composer/Composer.css +6 -0
- package/components/ContactCard/ContactCard.css +6 -0
- package/components/ContextMenu/ContextMenu.css +6 -0
- package/components/ContributionGraph/ContributionGraph.css +6 -0
- package/components/CurrencyInput/CurrencyInput.css +6 -0
- package/components/DataTable/DataTable.css +6 -0
- package/components/DataTable/DataTable.js +6 -2
- package/components/DateInput/DateInput.css +6 -0
- package/components/DatePicker/DatePicker.css +6 -0
- package/components/DateRangePicker/DateRangePicker.css +6 -0
- package/components/Deadline/Deadline.css +6 -0
- package/components/DecisionRow/DecisionRow.css +6 -0
- package/components/DescriptionList/DescriptionList.css +6 -0
- package/components/Dialog/Dialog.css +6 -0
- package/components/Divider/Divider.css +6 -0
- package/components/DocumentChip/DocumentChip.css +6 -0
- package/components/DocumentViewer/DocumentViewer.css +6 -0
- package/components/Drawer/Drawer.css +55 -7
- package/components/Drawer/Drawer.d.ts +17 -1
- package/components/Drawer/Drawer.js +27 -5
- package/components/Dropdown/ChosenMark.css +6 -0
- package/components/Dropdown/Dropdown.css +46 -0
- package/components/Dropdown/Dropdown.d.ts +7 -0
- package/components/Dropdown/Dropdown.js +23 -38
- package/components/DropdownMenu/DropdownMenu.css +6 -0
- package/components/EmptyState/EmptyState.css +6 -0
- package/components/EntityCard/EntityCard.css +6 -0
- package/components/EntitySwitcher/EntitySwitcher.css +6 -0
- package/components/ErrorSummary/ErrorSummary.css +6 -0
- package/components/ErrorSummary/ErrorSummary.js +3 -1
- package/components/EventCalendar/EventCalendar.css +6 -0
- package/components/Field/Field.css +6 -0
- package/components/Figure/Figure.css +6 -0
- package/components/FileInput/FileInput.css +6 -0
- package/components/FilterBar/FilterBar.css +9 -1
- package/components/FormSection/FormSection.css +6 -0
- package/components/FunnelChart/FunnelChart.css +6 -0
- package/components/GanttChart/GanttChart.css +6 -0
- package/components/Gauge/Gauge.css +6 -0
- package/components/Globe/Globe.css +6 -0
- package/components/Grid/Grid.css +6 -0
- package/components/Heading/Heading.css +6 -0
- package/components/HoverCard/HoverCard.css +6 -0
- package/components/Icon/Icon.css +6 -0
- package/components/IconButton/IconButton.css +6 -0
- package/components/IconButton/IconButton.d.ts +7 -1
- package/components/IconButton/IconButton.js +2 -1
- package/components/ImageCompare/ImageCompare.css +6 -0
- package/components/Input/Input.css +22 -4
- package/components/Inspector/Inspector.css +6 -0
- package/components/Instructions/Instructions.css +27 -0
- package/components/Instructions/Instructions.d.ts +5 -2
- package/components/Instructions/Instructions.js +1 -1
- package/components/InterruptCard/InterruptCard.css +6 -0
- package/components/Kbd/Kbd.css +6 -0
- package/components/LegendTile/LegendTile.css +6 -0
- package/components/Lightbox/Lightbox.css +6 -0
- package/components/Link/Link.css +9 -1
- package/components/LinkList/LinkList.css +6 -0
- package/components/List/List.css +6 -0
- package/components/MapCallout/MapCallout.css +6 -0
- package/components/MapLegend/MapLegend.css +6 -0
- package/components/MaskedInput/MaskedInput.css +6 -0
- package/components/MegaMenu/MegaMenu.css +6 -0
- package/components/Mention/Mention.css +6 -0
- package/components/Mention/Mention.js +7 -7
- package/components/Menubar/Menubar.css +6 -0
- package/components/MessageActions/MessageActions.css +6 -0
- package/components/MessageCard/MessageCard.css +6 -0
- package/components/Meter/Meter.css +6 -0
- package/components/ModelPicker/ModelPicker.css +6 -0
- package/components/MotionSwatch/MotionSwatch.css +6 -0
- package/components/Nav/Nav.css +6 -0
- package/components/NavList/NavList.css +6 -0
- package/components/NavList/NavList.d.ts +2 -0
- package/components/NavList/NavList.js +1 -0
- package/components/NotificationCenter/NotificationCenter.css +6 -0
- package/components/NumberInput/NumberInput.css +6 -0
- package/components/OrgChart/OrgChart.css +6 -0
- package/components/PageHeader/PageHeader.css +6 -0
- package/components/Pagination/Pagination.css +6 -0
- package/components/Panel/Panel.css +6 -0
- package/components/PinInput/PinInput.css +6 -0
- package/components/PixelAvatar/PixelAvatar.css +6 -0
- package/components/Popover/Popover.css +6 -0
- package/components/ProgressBar/ProgressBar.css +6 -0
- package/components/ProgressiveBlur/ProgressiveBlur.css +6 -0
- package/components/PromptSuggestions/PromptSuggestions.css +5 -0
- package/components/Prose/Prose.css +6 -0
- package/components/QuestionCard/QuestionCard.css +5 -0
- package/components/Quote/Quote.css +6 -0
- package/components/RadioButton/RadioButton.css +6 -0
- package/components/Rating/Rating.css +6 -0
- package/components/Reasoning/Reasoning.css +6 -0
- package/components/ResourceTimeline/ResourceTimeline.css +6 -0
- package/components/RichDropdown/RichDropdown.css +6 -0
- package/components/SectionTitle/SectionTitle.css +6 -0
- package/components/SegmentedControl/SegmentedControl.css +6 -0
- package/components/SelectionCard/SelectionCard.css +6 -0
- package/components/ShaderField/ShaderField.css +6 -0
- package/components/ShaderField/ShaderField.js +2 -0
- package/components/ShaderScene/ShaderScene.css +6 -0
- package/components/ShaderScene/ShaderScene.d.ts +3 -2
- package/components/ShaderScene/assemble.js +13 -5
- package/components/ShaderScene/renderer.d.ts +2 -2
- package/components/ShaderScene/types.d.ts +2 -1
- package/components/SidebarPanel/SidebarPanel.css +6 -0
- package/components/SignaturePad/SignaturePad.css +6 -0
- package/components/SiteFooter/SiteFooter.css +6 -0
- package/components/SiteHeader/SiteHeader.css +6 -0
- package/components/SiteLayout/SiteLayout.css +6 -0
- package/components/Skeleton/Skeleton.css +6 -0
- package/components/Slider/Slider.css +6 -0
- package/components/SourceChip/SourceChip.css +6 -0
- package/components/SourceTrail/SourceTrail.css +6 -0
- package/components/SpacingSwatch/SpacingSwatch.css +6 -0
- package/components/Sparkline/Sparkline.css +6 -0
- package/components/Spinner/Spinner.css +6 -0
- package/components/SplitButton/SplitButton.css +6 -0
- package/components/SplitButton/SplitButton.d.ts +7 -1
- package/components/SplitButton/SplitButton.js +3 -1
- package/components/SplitPane/SplitPane.css +6 -0
- package/components/Stack/Stack.css +6 -0
- package/components/Stat/Stat.css +13 -1
- package/components/StatusDot/StatusDot.css +6 -0
- package/components/Stepper/Stepper.css +6 -0
- package/components/StreamingText/StreamingText.css +6 -0
- package/components/Swatch/Swatch.css +6 -0
- package/components/Table/Table.css +15 -1
- package/components/TableToolbar/TableToolbar.css +6 -0
- package/components/Tabs/Tabs.css +6 -0
- package/components/TagInput/TagInput.css +6 -0
- package/components/Text/Text.css +6 -0
- package/components/Textarea/Textarea.css +5 -0
- package/components/ThemePicker/ThemePicker.css +6 -0
- package/components/ThemeToggle/ThemeToggle.css +6 -0
- package/components/ThreadPanel/ThreadPanel.css +6 -0
- package/components/ThreadTabs/ThreadTabs.css +6 -0
- package/components/TimePicker/TimePicker.css +6 -0
- package/components/Timeline/Timeline.css +18 -18
- package/components/Toast/Toast.css +6 -0
- package/components/Toast/Toast.js +1 -1
- package/components/ToggleGroup/ToggleGroup.css +6 -0
- package/components/ToggleSwitch/ToggleSwitch.css +21 -3
- package/components/ToggleSwitch/ToggleSwitch.d.ts +1 -1
- package/components/ToggleSwitch/ToggleSwitch.js +2 -2
- package/components/ToolCall/ToolCall.css +6 -0
- package/components/Toolbar/Toolbar.css +6 -0
- package/components/Tooltip/Tooltip.css +6 -0
- package/components/TopAppBar/TopAppBar.css +6 -0
- package/components/TreeView/TreeView.css +6 -0
- package/components/TypographySwatch/TypographySwatch.css +6 -0
- package/components/UsageCard/UsageCard.css +6 -0
- package/components/Waveform/Waveform.css +6 -0
- package/components/Widget/Widget.css +6 -0
- package/components/Wizard/Wizard.css +6 -0
- package/components/WorldMap/WorldMap.css +6 -0
- package/components/registry.json +3 -3
- package/components/registry.json.d.ts +3 -3
- package/components/registry.json.js +1 -1
- package/fonts/material-symbols.css +10 -0
- package/markdown/index.d.ts +8 -0
- package/markdown/index.js +10 -0
- package/markdown/mappers.d.ts +31 -0
- package/markdown/mappers.js +43 -0
- package/package.json +7 -2
- package/tokens/base.css +11 -2
- package/tokens/presets/contrast.css +8 -0
- package/tokens/presets/forest.css +8 -0
- package/tokens/presets/plum.css +18 -5
- package/tokens/presets/warm.css +10 -5
- package/tokens/presets/zest.css +22 -5
- package/tokens/values.json.js +1 -1
|
@@ -5,7 +5,7 @@ import { useLinkComponent } from "../../behaviors/LinkProvider.js";
|
|
|
5
5
|
import { useLayer } from "../../behaviors/useLayer.js";
|
|
6
6
|
import { useFocusScope } from "../../behaviors/useFocusScope.js";
|
|
7
7
|
import { useScrollLock } from "../../behaviors/useScrollLock.js";
|
|
8
|
-
import { mediaAbove, mediaBelow,
|
|
8
|
+
import { mediaAbove, mediaBelow, BREAKPOINT_MOBILE_PX, BREAKPOINT_TABLET_PX } from "../../tokens/breakpoints.js";
|
|
9
9
|
import { Avatar } from "../Avatar/Avatar.js";
|
|
10
10
|
import { PixelAvatar } from "../PixelAvatar/PixelAvatar.js";
|
|
11
11
|
import { SidebarPanel } from "../SidebarPanel/SidebarPanel.js";
|
|
@@ -349,7 +349,13 @@ const AppSidebar = React.forwardRef(function AppSidebar2({
|
|
|
349
349
|
const isOpen = openKeys.has(item.key);
|
|
350
350
|
const feedsPanel = isPanelMode && hasChildren;
|
|
351
351
|
const isSource = feedsPanel && item.key === panelSourceKey;
|
|
352
|
-
const
|
|
352
|
+
const childCurrent = Boolean(
|
|
353
|
+
hasChildren && item.children.some(
|
|
354
|
+
(sub) => sub.key === activeSubKey || sub.children?.some((leaf) => leaf.key === activeTertiaryKey)
|
|
355
|
+
)
|
|
356
|
+
);
|
|
357
|
+
const childShows = childCurrent && !isPanelMode && (isExpanded || mobileOpen) && isOpen;
|
|
358
|
+
const isActive = (isPanelMode && panelVisible ? isSource : activeKey === item.key) && !childShows;
|
|
353
359
|
const isLink = Boolean(item.href) && !hasChildren;
|
|
354
360
|
const itemClasses = [
|
|
355
361
|
`${baseClass}__btn`,
|
|
@@ -413,7 +419,7 @@ const AppSidebar = React.forwardRef(function AppSidebar2({
|
|
|
413
419
|
},
|
|
414
420
|
"aria-expanded": feedsPanel ? mobileOpen ? void 0 : isSource && panelVisible : hasChildren ? isOpen : void 0,
|
|
415
421
|
"aria-controls": feedsPanel && !mobileOpen ? panelId : void 0,
|
|
416
|
-
"aria-current": activeKey === item.key ? "page" : void 0,
|
|
422
|
+
"aria-current": activeKey === item.key && !childCurrent ? "page" : void 0,
|
|
417
423
|
"data-panel-source": isSource ? "true" : void 0,
|
|
418
424
|
title: !isExpanded && !isPanelMode ? item.label : void 0,
|
|
419
425
|
children: itemContent
|
|
@@ -459,7 +465,7 @@ const AppSidebar = React.forwardRef(function AppSidebar2({
|
|
|
459
465
|
},
|
|
460
466
|
"aria-expanded": mobileOpen ? void 0 : subIsSource && panelVisible,
|
|
461
467
|
"aria-controls": mobileOpen ? void 0 : panelId,
|
|
462
|
-
"aria-current": activeSubKey === sub.key ? "page" : void 0,
|
|
468
|
+
"aria-current": activeSubKey === sub.key && !sub.children?.some((leaf) => leaf.key === activeTertiaryKey) ? "page" : void 0,
|
|
463
469
|
"data-panel-source": subIsSource ? "true" : void 0,
|
|
464
470
|
children: subLabel
|
|
465
471
|
}
|
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
toggle button: pressed while its artifact is on stage in the panel.
|
|
6
6
|
============================================ */
|
|
7
7
|
|
|
8
|
+
@layer rift.tokens, rift.preset, rift.components;
|
|
9
|
+
|
|
10
|
+
@layer rift.components {
|
|
11
|
+
|
|
8
12
|
/* Base */
|
|
9
13
|
|
|
10
14
|
.ds-artifact-card {
|
|
@@ -105,3 +109,5 @@
|
|
|
105
109
|
opacity: 0.4;
|
|
106
110
|
cursor: not-allowed;
|
|
107
111
|
}
|
|
112
|
+
|
|
113
|
+
} /* @layer rift.components */
|
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
never leave with the content.
|
|
11
11
|
============================================ */
|
|
12
12
|
|
|
13
|
+
@layer rift.tokens, rift.preset, rift.components;
|
|
14
|
+
|
|
15
|
+
@layer rift.components {
|
|
16
|
+
|
|
13
17
|
/* Base */
|
|
14
18
|
|
|
15
19
|
.ds-artifact-panel {
|
|
@@ -203,3 +207,5 @@
|
|
|
203
207
|
.ds-artifact-panel--inline .ds-artifact-panel__frame {
|
|
204
208
|
min-height: var(--ds-artifact-panel-stage-height, calc(6 * var(--control-height-default)));
|
|
205
209
|
}
|
|
210
|
+
|
|
211
|
+
} /* @layer rift.components */
|
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
One stylesheet, shared by every member.
|
|
8
8
|
============================================ */
|
|
9
9
|
|
|
10
|
+
@layer rift.tokens, rift.preset, rift.components;
|
|
11
|
+
|
|
12
|
+
@layer rift.components {
|
|
13
|
+
|
|
10
14
|
/* ============================================
|
|
11
15
|
TYPE MARK — what kind of file this is
|
|
12
16
|
Shared by the tile and the viewer. Every mark, and every glyph a tile
|
|
@@ -1134,3 +1138,5 @@ button.ds-attachment-group__single:focus-visible {
|
|
|
1134
1138
|
align-items: center;
|
|
1135
1139
|
gap: var(--gap-100);
|
|
1136
1140
|
}
|
|
1141
|
+
|
|
1142
|
+
} /* @layer rift.components */
|
|
@@ -7,6 +7,7 @@ import { renderTypeMark } from "./typeMark.js";
|
|
|
7
7
|
import { AttachmentViewer } from "./AttachmentViewer.js";
|
|
8
8
|
import "./Attachment.css";
|
|
9
9
|
import { useLocale } from "../../behaviors/LocaleProvider.js";
|
|
10
|
+
import { revokeAttachmentUrls, useAttachments } from "./useAttachments.js";
|
|
10
11
|
const isPicture = (item) => item.status === "ready" && item.kind === "image" && Boolean(item.previewSrc);
|
|
11
12
|
const AttachmentGroup = React.forwardRef(
|
|
12
13
|
({
|
|
@@ -192,5 +193,7 @@ const AttachmentGroup = React.forwardRef(
|
|
|
192
193
|
);
|
|
193
194
|
AttachmentGroup.displayName = "AttachmentGroup";
|
|
194
195
|
export {
|
|
195
|
-
AttachmentGroup
|
|
196
|
+
AttachmentGroup,
|
|
197
|
+
revokeAttachmentUrls,
|
|
198
|
+
useAttachments
|
|
196
199
|
};
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
User profile image with initials fallback
|
|
4
4
|
============================================ */
|
|
5
5
|
|
|
6
|
+
@layer rift.tokens, rift.preset, rift.components;
|
|
7
|
+
|
|
8
|
+
@layer rift.components {
|
|
9
|
+
|
|
6
10
|
.ds-avatar {
|
|
7
11
|
position: relative;
|
|
8
12
|
display: inline-flex;
|
|
@@ -199,3 +203,5 @@
|
|
|
199
203
|
.ds-avatar__status--busy {
|
|
200
204
|
background-color: var(--color-status-error-border);
|
|
201
205
|
}
|
|
206
|
+
|
|
207
|
+
} /* @layer rift.components */
|
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
so the counter circle sits flush in the row.
|
|
6
6
|
============================================ */
|
|
7
7
|
|
|
8
|
+
@layer rift.tokens, rift.preset, rift.components;
|
|
9
|
+
|
|
10
|
+
@layer rift.components {
|
|
11
|
+
|
|
8
12
|
/* Base */
|
|
9
13
|
|
|
10
14
|
.ds-avatar-group {
|
|
@@ -59,3 +63,5 @@
|
|
|
59
63
|
height: 56px;
|
|
60
64
|
font-size: 18px; /* ds-allow(typography): matches Avatar's box-sized initials */
|
|
61
65
|
}
|
|
66
|
+
|
|
67
|
+
} /* @layer rift.components */
|
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
fading and rising in once the page has scrolled.
|
|
5
5
|
============================================ */
|
|
6
6
|
|
|
7
|
+
@layer rift.tokens, rift.preset, rift.components;
|
|
8
|
+
|
|
9
|
+
@layer rift.components {
|
|
10
|
+
|
|
7
11
|
.ds-back-to-top {
|
|
8
12
|
position: fixed;
|
|
9
13
|
inset-block-end: var(--ds-back-to-top-inset, var(--gap-500));
|
|
@@ -26,3 +30,5 @@
|
|
|
26
30
|
.ds-back-to-top .ds-icon-button {
|
|
27
31
|
box-shadow: var(--shadow-floating);
|
|
28
32
|
}
|
|
33
|
+
|
|
34
|
+
} /* @layer rift.components */
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
Small inline status labels
|
|
4
4
|
============================================ */
|
|
5
5
|
|
|
6
|
+
@layer rift.tokens, rift.preset, rift.components;
|
|
7
|
+
|
|
8
|
+
@layer rift.components {
|
|
9
|
+
|
|
6
10
|
.ds-badge {
|
|
7
11
|
display: inline-flex;
|
|
8
12
|
align-items: center;
|
|
@@ -65,3 +69,5 @@
|
|
|
65
69
|
background-color: var(--color-status-neutral-bg);
|
|
66
70
|
color: var(--color-status-neutral-text);
|
|
67
71
|
}
|
|
72
|
+
|
|
73
|
+
} /* @layer rift.components */
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
Full-width page-level status strip
|
|
4
4
|
============================================ */
|
|
5
5
|
|
|
6
|
+
@layer rift.tokens, rift.preset, rift.components;
|
|
7
|
+
|
|
8
|
+
@layer rift.components {
|
|
9
|
+
|
|
6
10
|
.ds-banner {
|
|
7
11
|
display: flex;
|
|
8
12
|
align-items: center;
|
|
@@ -108,3 +112,5 @@
|
|
|
108
112
|
background-color: var(--color-status-neutral-bg);
|
|
109
113
|
color: var(--color-status-neutral-text);
|
|
110
114
|
}
|
|
115
|
+
|
|
116
|
+
} /* @layer rift.components */
|
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
texture together) and
|
|
6
6
|
--ds-bento-tile-panel-width (the open overlay's width). */
|
|
7
7
|
|
|
8
|
+
@layer rift.tokens, rift.preset, rift.components;
|
|
9
|
+
|
|
10
|
+
@layer rift.components {
|
|
11
|
+
|
|
8
12
|
/* ------------------------------------------------------------- base */
|
|
9
13
|
|
|
10
14
|
/* No overflow clip on the tile itself: the surface and the body clip
|
|
@@ -540,3 +544,5 @@
|
|
|
540
544
|
.ds-bento-tile-overlay__body,
|
|
541
545
|
.ds-bento-tile-art { animation: none; }
|
|
542
546
|
}
|
|
547
|
+
|
|
548
|
+
} /* @layer rift.components */
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
is carried per platform (tint, lens, pill).
|
|
9
9
|
============================================ */
|
|
10
10
|
|
|
11
|
+
@layer rift.tokens, rift.preset, rift.components;
|
|
12
|
+
|
|
13
|
+
@layer rift.components {
|
|
14
|
+
|
|
11
15
|
/* ============================================
|
|
12
16
|
BASE (shared by every platform)
|
|
13
17
|
============================================ */
|
|
@@ -406,3 +410,5 @@
|
|
|
406
410
|
top: 4px;
|
|
407
411
|
inset-inline-start: calc(50% + 6px);
|
|
408
412
|
}
|
|
413
|
+
|
|
414
|
+
} /* @layer rift.components */
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
Hierarchical navigation trail
|
|
4
4
|
============================================ */
|
|
5
5
|
|
|
6
|
+
@layer rift.tokens, rift.preset, rift.components;
|
|
7
|
+
|
|
8
|
+
@layer rift.components {
|
|
9
|
+
|
|
6
10
|
.ds-breadcrumb {
|
|
7
11
|
width: 100%;
|
|
8
12
|
}
|
|
@@ -98,3 +102,5 @@
|
|
|
98
102
|
color: var(--color-text-tertiary);
|
|
99
103
|
user-select: none;
|
|
100
104
|
}
|
|
105
|
+
|
|
106
|
+
} /* @layer rift.components */
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
Figma design system button component
|
|
4
4
|
============================================ */
|
|
5
5
|
|
|
6
|
+
@layer rift.tokens, rift.preset, rift.components;
|
|
7
|
+
|
|
8
|
+
@layer rift.components {
|
|
9
|
+
|
|
6
10
|
.ds-button {
|
|
7
11
|
/* Layout */
|
|
8
12
|
display: inline-flex;
|
|
@@ -646,3 +650,5 @@
|
|
|
646
650
|
outline: 2px solid var(--color-action-primary-bg);
|
|
647
651
|
outline-offset: 2px;
|
|
648
652
|
}
|
|
653
|
+
|
|
654
|
+
} /* @layer rift.components */
|
|
@@ -58,6 +58,12 @@ type ButtonOwnProps = {
|
|
|
58
58
|
* and `tone`.
|
|
59
59
|
*/
|
|
60
60
|
glass?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* The button's native type. Defaults to `button`, so a button inside a form
|
|
63
|
+
* never submits it by accident; set `submit` on the form's submit button, or
|
|
64
|
+
* `reset`. Ignored when `href` renders a link.
|
|
65
|
+
*/
|
|
66
|
+
type?: 'button' | 'submit' | 'reset';
|
|
61
67
|
/** Optional href — renders as <a> instead of <button> */
|
|
62
68
|
href?: string;
|
|
63
69
|
/** Optional target attribute for links */
|
|
@@ -103,7 +109,7 @@ type ButtonOwnProps = {
|
|
|
103
109
|
*/
|
|
104
110
|
text?: boolean;
|
|
105
111
|
};
|
|
106
|
-
export interface ButtonProps extends ButtonOwnProps, Omit<React.ComponentPropsWithoutRef<'button'>, keyof ButtonOwnProps
|
|
112
|
+
export interface ButtonProps extends ButtonOwnProps, Omit<React.ComponentPropsWithoutRef<'button'>, keyof ButtonOwnProps> {
|
|
107
113
|
}
|
|
108
114
|
/**
|
|
109
115
|
* Button component from Figma design system.
|
|
@@ -37,6 +37,7 @@ const Button = React.forwardRef(
|
|
|
37
37
|
disabled,
|
|
38
38
|
loading,
|
|
39
39
|
glass,
|
|
40
|
+
type = "button",
|
|
40
41
|
href,
|
|
41
42
|
target,
|
|
42
43
|
rel,
|
|
@@ -112,7 +113,7 @@ const Button = React.forwardRef(
|
|
|
112
113
|
{
|
|
113
114
|
...rest,
|
|
114
115
|
ref,
|
|
115
|
-
type
|
|
116
|
+
type,
|
|
116
117
|
className: classes,
|
|
117
118
|
disabled: isDisabled || isLoading,
|
|
118
119
|
"aria-busy": isLoading || void 0,
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
Container for grouped buttons in nav/subnav
|
|
4
4
|
============================================ */
|
|
5
5
|
|
|
6
|
+
@layer rift.tokens, rift.preset, rift.components;
|
|
7
|
+
|
|
8
|
+
@layer rift.components {
|
|
9
|
+
|
|
6
10
|
.ds-button-group {
|
|
7
11
|
/* Layout */
|
|
8
12
|
display: inline-flex; /* Hug content instead of stretch */
|
|
@@ -46,3 +50,5 @@
|
|
|
46
50
|
width: auto; /* Hug content instead of stretch */
|
|
47
51
|
display: inline-flex; /* Hug content */
|
|
48
52
|
}
|
|
53
|
+
|
|
54
|
+
} /* @layer rift.components */
|
package/components/Card/Card.css
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
Content card with preview area and title
|
|
4
4
|
============================================ */
|
|
5
5
|
|
|
6
|
+
@layer rift.tokens, rift.preset, rift.components;
|
|
7
|
+
|
|
8
|
+
@layer rift.components {
|
|
9
|
+
|
|
6
10
|
.ds-card {
|
|
7
11
|
/* Layout */
|
|
8
12
|
display: flex;
|
|
@@ -188,3 +192,5 @@
|
|
|
188
192
|
color: var(--color-text-secondary);
|
|
189
193
|
margin: 0;
|
|
190
194
|
}
|
|
195
|
+
|
|
196
|
+
} /* @layer rift.components */
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
deck holds.
|
|
9
9
|
============================================ */
|
|
10
10
|
|
|
11
|
+
@layer rift.tokens, rift.preset, rift.components;
|
|
12
|
+
|
|
13
|
+
@layer rift.components {
|
|
14
|
+
|
|
11
15
|
/* Base */
|
|
12
16
|
|
|
13
17
|
.ds-card-stack {
|
|
@@ -93,3 +97,4 @@
|
|
|
93
97
|
|
|
94
98
|
/* Screen-reader announcement of the deck position. */
|
|
95
99
|
|
|
100
|
+
} /* @layer rift.components */
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
Sliding content viewer with navigation
|
|
4
4
|
============================================ */
|
|
5
5
|
|
|
6
|
+
@layer rift.tokens, rift.preset, rift.components;
|
|
7
|
+
|
|
8
|
+
@layer rift.components {
|
|
9
|
+
|
|
6
10
|
.ds-carousel {
|
|
7
11
|
position: relative;
|
|
8
12
|
width: 100%;
|
|
@@ -122,3 +126,5 @@
|
|
|
122
126
|
.ds-carousel .material-symbols-rounded {
|
|
123
127
|
color: inherit;
|
|
124
128
|
}
|
|
129
|
+
|
|
130
|
+
} /* @layer rift.components */
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ChartActiveHandler } from './BarChart';
|
|
2
|
+
interface ActiveReporterProps {
|
|
3
|
+
/** Whether recharts has a point active: the pointer over the plot, or the keyboard cursor on a point. */
|
|
4
|
+
active?: boolean;
|
|
5
|
+
/** The tooltip's entries; each carries the row of `data` it was drawn from. */
|
|
6
|
+
payload?: {
|
|
7
|
+
payload?: Record<string, unknown>;
|
|
8
|
+
}[];
|
|
9
|
+
/** The active point's x-axis value, the fallback for finding its row. */
|
|
10
|
+
label?: string | number;
|
|
11
|
+
/** The chart's data, as the consumer passed it. */
|
|
12
|
+
data: Record<string, unknown>[];
|
|
13
|
+
/** The chart's x-axis key. */
|
|
14
|
+
xKey: string;
|
|
15
|
+
/** The consumer's callback. */
|
|
16
|
+
onActiveChange: ChartActiveHandler;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Reports the active point of a cartesian chart to the consumer: the row of
|
|
20
|
+
* `data` under the pointer or the keyboard cursor, and null once neither is
|
|
21
|
+
* on the plot.
|
|
22
|
+
*
|
|
23
|
+
* It renders nothing and sits inside each chart's tooltip content, because
|
|
24
|
+
* that is the one place recharts hands over the active point for a pointer
|
|
25
|
+
* and for its keyboard layer alike, in every 3.x release. The row is found
|
|
26
|
+
* by identity first (recharts passes the consumer's own object through) and
|
|
27
|
+
* by the x-axis value as the fallback. The callback fires only when the
|
|
28
|
+
* active row changes, never per pointer move, and once more with null when
|
|
29
|
+
* the chart unmounts while a point is active.
|
|
30
|
+
*/
|
|
31
|
+
export declare function ActiveReporter({ active, payload, label, data, xKey, onActiveChange }: ActiveReporterProps): null;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useRef, useEffect } from "react";
|
|
3
|
+
function ActiveReporter({ active, payload, label, data, xKey, onActiveChange }) {
|
|
4
|
+
const handlerRef = useRef(onActiveChange);
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
handlerRef.current = onActiveChange;
|
|
7
|
+
});
|
|
8
|
+
let index = -1;
|
|
9
|
+
if (active && payload?.length) {
|
|
10
|
+
const row = payload[0]?.payload;
|
|
11
|
+
index = row ? data.indexOf(row) : -1;
|
|
12
|
+
if (index === -1 && label !== void 0) index = data.findIndex((entry) => entry[xKey] === label);
|
|
13
|
+
}
|
|
14
|
+
const lastIndex = useRef(-1);
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (index === lastIndex.current) return;
|
|
17
|
+
lastIndex.current = index;
|
|
18
|
+
if (index >= 0) handlerRef.current(data[index], index);
|
|
19
|
+
else handlerRef.current(null, null);
|
|
20
|
+
}, [index, data]);
|
|
21
|
+
useEffect(
|
|
22
|
+
() => () => {
|
|
23
|
+
if (lastIndex.current !== -1) handlerRef.current(null, null);
|
|
24
|
+
},
|
|
25
|
+
[]
|
|
26
|
+
);
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
ActiveReporter
|
|
31
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { ChartSummaryItem } from './BarChart';
|
|
2
|
+
import { ChartActiveHandler, ChartSummaryItem } from './BarChart';
|
|
3
3
|
export interface AreaSeriesConfig {
|
|
4
4
|
/** Key in data for this series */
|
|
5
5
|
dataKey: string;
|
|
@@ -39,6 +39,12 @@ type AreaChartOwnProps = {
|
|
|
39
39
|
showLegend?: boolean;
|
|
40
40
|
/** Strip the card chrome (border, padding, fill) when the chart sits inside another panel that supplies the surface */
|
|
41
41
|
bare?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Called when the active point changes: with the row of `data` under the
|
|
44
|
+
* pointer or the keyboard cursor and its index, and with `null, null` once
|
|
45
|
+
* neither is on the plot. For a headline figure that follows the cursor.
|
|
46
|
+
*/
|
|
47
|
+
onActiveChange?: ChartActiveHandler;
|
|
42
48
|
/** Additional CSS classes on the wrapper */
|
|
43
49
|
className?: string;
|
|
44
50
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
3
3
|
import React, { useCallback, useId } from "react";
|
|
4
4
|
import { ResponsiveContainer, AreaChart as AreaChart$1, CartesianGrid, XAxis, YAxis, Tooltip, Area, Legend } from "recharts";
|
|
5
|
+
import { ActiveReporter } from "./ActiveReporter.js";
|
|
5
6
|
import { readTokenPx, getChartSeriesColors } from "./palette.js";
|
|
6
7
|
import { useChartAnimation } from "./useChartAnimation.js";
|
|
7
8
|
import "./Chart.css";
|
|
@@ -33,6 +34,7 @@ const AreaChart = React.forwardRef(({
|
|
|
33
34
|
showLegend = true,
|
|
34
35
|
bare = false,
|
|
35
36
|
className = "",
|
|
37
|
+
onActiveChange,
|
|
36
38
|
yAxisFormatter,
|
|
37
39
|
locale: localeProp,
|
|
38
40
|
...rest
|
|
@@ -53,8 +55,11 @@ const AreaChart = React.forwardRef(({
|
|
|
53
55
|
const seriesColors = getChartSeriesColors();
|
|
54
56
|
const renderTooltip = useCallback(
|
|
55
57
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
56
|
-
(props) => /* @__PURE__ */
|
|
57
|
-
|
|
58
|
+
(props) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
59
|
+
onActiveChange && /* @__PURE__ */ jsx(ActiveReporter, { ...props, data, xKey, onActiveChange }),
|
|
60
|
+
/* @__PURE__ */ jsx(AreaTooltip, { ...props, locale })
|
|
61
|
+
] }),
|
|
62
|
+
[locale, data, xKey, onActiveChange]
|
|
58
63
|
);
|
|
59
64
|
return /* @__PURE__ */ jsxs(
|
|
60
65
|
"div",
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The `onActiveChange` callback of the charts drawn from one `data` array
|
|
4
|
+
* over a shared x-axis (Area, Line, Bar, StackedBar, Combo): the active row
|
|
5
|
+
* of `data` and its index, or `null, null` when no point is active.
|
|
6
|
+
*/
|
|
7
|
+
export type ChartActiveHandler = (datum: Record<string, unknown> | null, index: number | null) => void;
|
|
2
8
|
export interface ChartSummaryItem {
|
|
3
9
|
/** Label shown above the value */
|
|
4
10
|
label: string;
|
|
@@ -34,6 +40,12 @@ type BarChartOwnProps = {
|
|
|
34
40
|
yAxisFormatter?: (value: number) => string;
|
|
35
41
|
/** Strip the card chrome (border, padding, fill) when the chart sits inside another panel that supplies the surface */
|
|
36
42
|
bare?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Called when the active point changes: with the row of `data` under the
|
|
45
|
+
* pointer or the keyboard cursor and its index, and with `null, null` once
|
|
46
|
+
* neither is on the plot. For a headline figure that follows the cursor.
|
|
47
|
+
*/
|
|
48
|
+
onActiveChange?: ChartActiveHandler;
|
|
37
49
|
/** Additional CSS classes on the wrapper */
|
|
38
50
|
className?: string;
|
|
39
51
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
3
3
|
import React, { useCallback, useId } from "react";
|
|
4
4
|
import { ResponsiveContainer, BarChart as BarChart$1, CartesianGrid, XAxis, YAxis, Tooltip, Bar } from "recharts";
|
|
5
5
|
import { useChartAnimation } from "./useChartAnimation.js";
|
|
6
6
|
import "./Chart.css";
|
|
7
|
+
import { ActiveReporter } from "./ActiveReporter.js";
|
|
7
8
|
import { readTokenPx } from "./palette.js";
|
|
8
9
|
import { useLocale } from "../../behaviors/LocaleProvider.js";
|
|
9
10
|
import { formatAxisNumber, formatNumber } from "../../behaviors/locale.js";
|
|
@@ -40,6 +41,7 @@ const BarChart = React.forwardRef(({
|
|
|
40
41
|
height = 350,
|
|
41
42
|
bare = false,
|
|
42
43
|
className = "",
|
|
44
|
+
onActiveChange,
|
|
43
45
|
yAxisFormatter,
|
|
44
46
|
locale: localeProp,
|
|
45
47
|
...rest
|
|
@@ -61,8 +63,11 @@ const BarChart = React.forwardRef(({
|
|
|
61
63
|
const cursorColor = getCSSVar("--color-bg-container-secondary", "#F1F1F1");
|
|
62
64
|
const renderTooltip = useCallback(
|
|
63
65
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
64
|
-
(props) => /* @__PURE__ */
|
|
65
|
-
|
|
66
|
+
(props) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
67
|
+
onActiveChange && /* @__PURE__ */ jsx(ActiveReporter, { ...props, data, xKey, onActiveChange }),
|
|
68
|
+
/* @__PURE__ */ jsx(ChartTooltip, { ...props, locale, barColor: resolvedBarColor, dataLabel })
|
|
69
|
+
] }),
|
|
70
|
+
[resolvedBarColor, dataLabel, locale, data, xKey, onActiveChange]
|
|
66
71
|
);
|
|
67
72
|
return /* @__PURE__ */ jsxs(
|
|
68
73
|
"div",
|
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
used across all chart types (bar, line, pie…).
|
|
5
5
|
============================================ */
|
|
6
6
|
|
|
7
|
+
@layer rift.tokens, rift.preset, rift.components;
|
|
8
|
+
|
|
9
|
+
@layer rift.components {
|
|
10
|
+
|
|
7
11
|
/* ============================================
|
|
8
12
|
WRAPPER
|
|
9
13
|
============================================ */
|
|
@@ -209,7 +213,9 @@
|
|
|
209
213
|
|
|
210
214
|
/* ds-allow(breakpoint): the phone step on its other edge (below 600px, not at or below it); aligning it would change this rule at exactly 600px. */
|
|
211
215
|
@media (max-width: 599px) {
|
|
212
|
-
|
|
216
|
+
/* A bare chart keeps no padding on a phone either: its host supplies the
|
|
217
|
+
surface. :where() keeps the specificity where it was. */
|
|
218
|
+
.ds-chart:not(:where(.ds-chart--bare)) {
|
|
213
219
|
padding: var(--padding-400);
|
|
214
220
|
}
|
|
215
221
|
|
|
@@ -229,3 +235,5 @@
|
|
|
229
235
|
padding: var(--padding-150) 0;
|
|
230
236
|
}
|
|
231
237
|
}
|
|
238
|
+
|
|
239
|
+
} /* @layer rift.components */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { ChartSummaryItem } from './BarChart';
|
|
2
|
+
import { ChartActiveHandler, ChartSummaryItem } from './BarChart';
|
|
3
3
|
/** Props owned by ComboChart itself; everything else falls through to the root div. */
|
|
4
4
|
type ComboChartOwnProps = {
|
|
5
5
|
/** The BCP 47 locale the values, tooltips and value axis are written in, such as `de-DE`. Defaults to the nearest LocaleProvider's, else `en-US`. */
|
|
@@ -39,6 +39,12 @@ type ComboChartOwnProps = {
|
|
|
39
39
|
secondaryAxisFormatter?: (value: number) => string;
|
|
40
40
|
/** Strip the card chrome (border, padding, fill) when the chart sits inside another panel that supplies the surface */
|
|
41
41
|
bare?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Called when the active point changes: with the row of `data` under the
|
|
44
|
+
* pointer or the keyboard cursor and its index, and with `null, null` once
|
|
45
|
+
* neither is on the plot. For a headline figure that follows the cursor.
|
|
46
|
+
*/
|
|
47
|
+
onActiveChange?: ChartActiveHandler;
|
|
42
48
|
/** Additional CSS classes on the wrapper */
|
|
43
49
|
className?: string;
|
|
44
50
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
3
3
|
import React, { useCallback, useId } from "react";
|
|
4
4
|
import { ResponsiveContainer, ComposedChart, CartesianGrid, XAxis, YAxis, Tooltip, Bar, Line } from "recharts";
|
|
5
|
+
import { ActiveReporter } from "./ActiveReporter.js";
|
|
5
6
|
import { readTokenPx, getChartSeriesColors } from "./palette.js";
|
|
6
7
|
import { useChartAnimation } from "./useChartAnimation.js";
|
|
7
8
|
import "./Chart.css";
|
|
@@ -43,6 +44,7 @@ const ComboChart = React.forwardRef(({
|
|
|
43
44
|
height = 350,
|
|
44
45
|
bare = false,
|
|
45
46
|
className = "",
|
|
47
|
+
onActiveChange,
|
|
46
48
|
yAxisFormatter,
|
|
47
49
|
secondaryAxisFormatter,
|
|
48
50
|
locale: localeProp,
|
|
@@ -69,8 +71,11 @@ const ComboChart = React.forwardRef(({
|
|
|
69
71
|
const resolvedLineLabel = lineLabel || lineKey;
|
|
70
72
|
const renderTooltip = useCallback(
|
|
71
73
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
72
|
-
(props) => /* @__PURE__ */
|
|
73
|
-
|
|
74
|
+
(props) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
75
|
+
onActiveChange && /* @__PURE__ */ jsx(ActiveReporter, { ...props, data, xKey, onActiveChange }),
|
|
76
|
+
/* @__PURE__ */ jsx(ComboTooltip, { ...props, locale })
|
|
77
|
+
] }),
|
|
78
|
+
[locale, data, xKey, onActiveChange]
|
|
74
79
|
);
|
|
75
80
|
return /* @__PURE__ */ jsxs(
|
|
76
81
|
"div",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { ChartSummaryItem } from './BarChart';
|
|
2
|
+
import { ChartActiveHandler, ChartSummaryItem } from './BarChart';
|
|
3
3
|
export interface LineSeriesConfig {
|
|
4
4
|
/** Key in data for this series */
|
|
5
5
|
dataKey: string;
|
|
@@ -35,6 +35,12 @@ type LineChartOwnProps = {
|
|
|
35
35
|
yAxisFormatter?: (value: number) => string;
|
|
36
36
|
/** Strip the card chrome (border, padding, fill) when the chart sits inside another panel that supplies the surface */
|
|
37
37
|
bare?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Called when the active point changes: with the row of `data` under the
|
|
40
|
+
* pointer or the keyboard cursor and its index, and with `null, null` once
|
|
41
|
+
* neither is on the plot. For a headline figure that follows the cursor.
|
|
42
|
+
*/
|
|
43
|
+
onActiveChange?: ChartActiveHandler;
|
|
38
44
|
/** Additional CSS classes on the wrapper */
|
|
39
45
|
className?: string;
|
|
40
46
|
};
|