rift-ds 1.41.0 → 1.43.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 -2
- package/behaviors/LoadingImage.d.ts +2 -0
- package/behaviors/LoadingImage.js +34 -0
- package/behaviors/ScrollRegion.js +15 -2
- package/behaviors/VisuallyHidden.d.ts +30 -0
- package/behaviors/VisuallyHidden.js +17 -0
- package/behaviors/loading-image.css +30 -0
- package/behaviors/quietFocus.d.ts +4 -0
- package/behaviors/quietFocus.js +14 -0
- package/behaviors/useFocusScope.d.ts +3 -1
- package/behaviors/useFocusScope.js +4 -6
- package/bin/rift-ds.mjs +2 -0
- package/bin/templates/app/components/rift/ColorModeScript.tsx +3 -1
- package/bin/templates/app/components/rift/RiftRoot.tsx +40 -1
- package/bin/templates/blocks/app/dashboard/page.module.css +2 -2
- package/bin/templates/blocks/app/dashboard/page.tsx +7 -5
- package/bin/templates/blocks/app/landing/page.tsx +1 -1
- package/bin/templates/blocks/app/notifications/Inbox.tsx +13 -45
- package/bin/templates/blocks/app/notifications/page.module.css +5 -0
- package/bin/templates/blocks/app/planner/page.tsx +2 -2
- package/bin/templates/blocks/app/pricing/page.module.css +15 -1
- package/bin/templates/blocks/app/pricing/page.tsx +8 -1
- package/bin/templates/blocks/app/settings/Settings.tsx +4 -4
- package/bin/templates/blocks/app/sign-in/page.tsx +10 -2
- package/bin/templates/blocks/app/sign-up/page.module.css +83 -0
- package/bin/templates/blocks/app/sign-up/page.tsx +126 -0
- package/bin/templates/blocks/app/starter/page.tsx +1 -1
- package/bin/templates/blocks/components/blocks/AppShell.module.css +0 -10
- package/bin/templates/blocks/components/blocks/AppShell.tsx +51 -132
- package/bin/templates/blocks/components/blocks/DocsShell.tsx +5 -1
- package/bin/templates/blocks/components/blocks/notifications.ts +77 -0
- package/bin/templates/blocks/registry.json +49 -6
- package/chat/ChatWidget.js +2 -1
- package/components/AgentPlan/AgentPlan.css +1 -1
- package/components/AlertDialog/AlertDialog.css +14 -0
- package/components/AlertDialog/AlertDialog.d.ts +35 -3
- package/components/AlertDialog/AlertDialog.js +16 -5
- package/components/AppLayout/AppLayout.css +6 -0
- package/components/AppLayout/AppLayout.d.ts +4 -0
- package/components/AppLayout/AppLayout.js +5 -1
- package/components/AppSidebar/AppSidebar.css +17 -2
- package/components/AppSidebar/AppSidebar.js +9 -2
- package/components/AppToolbar/AppToolbar.d.ts +5 -2
- package/components/AppToolbar/AppToolbar.js +3 -1
- package/components/Attachment/AttachmentGroup.js +2 -1
- package/components/Attachment/AttachmentTile.js +2 -1
- package/components/Badge/Badge.css +6 -0
- package/components/Breadcrumb/Breadcrumb.css +4 -1
- package/components/Button/Button.css +20 -1
- package/components/Button/Button.js +6 -1
- package/components/Card/Card.css +11 -0
- package/components/Card/Card.d.ts +9 -3
- package/components/Card/Card.js +21 -2
- package/components/Chart/AreaChart.d.ts +7 -0
- package/components/Chart/AreaChart.js +57 -45
- package/components/Chart/BarChart.d.ts +7 -0
- package/components/Chart/BarChart.js +52 -46
- package/components/Chart/Chart.css +134 -1
- package/components/Chart/ChartSkeleton.d.ts +32 -0
- package/components/Chart/ChartSkeleton.js +149 -0
- package/components/Chart/ComboChart.d.ts +7 -0
- package/components/Chart/ComboChart.js +80 -74
- package/components/Chart/LineChart.d.ts +17 -3
- package/components/Chart/LineChart.js +67 -39
- package/components/Chart/PieChart.d.ts +7 -0
- package/components/Chart/PieChart.js +41 -34
- package/components/Chart/RadarChart.d.ts +7 -0
- package/components/Chart/RadarChart.js +39 -32
- package/components/Chart/RadialChart.d.ts +7 -0
- package/components/Chart/RadialChart.js +5 -1
- package/components/Chart/ScatterChart.d.ts +7 -0
- package/components/Chart/ScatterChart.js +52 -40
- package/components/Chart/StackedBarChart.d.ts +10 -1
- package/components/Chart/StackedBarChart.js +57 -43
- package/components/Chart/Treemap.d.ts +7 -0
- package/components/Chart/Treemap.js +17 -11
- package/components/ChatMessage/ChatMessage.css +6 -0
- package/components/Checkbox/Checkbox.css +25 -1
- package/components/Checkbox/Checkbox.d.ts +8 -4
- package/components/Checkbox/Checkbox.js +17 -8
- package/components/Chip/Chip.css +5 -3
- package/components/ContactCard/ContactCard.css +4 -3
- package/components/ContributionGraph/ContributionGraph.css +20 -0
- package/components/ContributionGraph/ContributionGraph.d.ts +4 -0
- package/components/ContributionGraph/ContributionGraph.js +11 -6
- package/components/DataTable/DataTable.css +34 -4
- package/components/DataTable/DataTable.d.ts +16 -2
- package/components/DataTable/DataTable.js +8 -2
- package/components/DateInput/DateInput.css +3 -1
- package/components/DatePicker/DatePicker.css +16 -0
- package/components/DatePicker/DatePicker.d.ts +13 -0
- package/components/DatePicker/DatePicker.js +21 -27
- package/components/DatePicker/MonthGrid.d.ts +2 -2
- package/components/DatePicker/MonthGrid.js +1 -1
- package/components/DatePicker/today.d.ts +15 -0
- package/components/DatePicker/today.js +17 -0
- package/components/DateRangePicker/DateRangePicker.d.ts +14 -1
- package/components/DateRangePicker/DateRangePicker.js +18 -7
- package/components/DescriptionList/DescriptionList.css +11 -0
- package/components/DescriptionList/DescriptionList.d.ts +5 -1
- package/components/DescriptionList/DescriptionList.js +21 -6
- package/components/Dialog/Dialog.css +9 -0
- package/components/Dialog/Dialog.d.ts +9 -0
- package/components/Dialog/Dialog.js +32 -19
- package/components/DocumentChip/DocumentChip.css +1 -1
- package/components/Drawer/Drawer.d.ts +9 -0
- package/components/Drawer/Drawer.js +8 -0
- package/components/Dropdown/Dropdown.css +3 -1
- package/components/Dropdown/Dropdown.js +8 -0
- package/components/EmptyState/EmptyState.css +8 -1
- package/components/EventCalendar/EventCalendar.css +12 -0
- package/components/Field/Field.css +2 -2
- package/components/FileInput/FileInput.css +1 -1
- package/components/FilterBar/FilterBar.d.ts +6 -1
- package/components/FunnelChart/FunnelChart.d.ts +7 -0
- package/components/FunnelChart/FunnelChart.js +44 -30
- package/components/GanttChart/GanttChart.css +10 -0
- package/components/GanttChart/GanttChart.d.ts +4 -0
- package/components/GanttChart/GanttChart.js +66 -33
- package/components/Gauge/Gauge.css +23 -0
- package/components/Gauge/Gauge.d.ts +4 -0
- package/components/Gauge/Gauge.js +14 -8
- package/components/ImageCompare/ImageCompare.js +2 -1
- package/components/Input/Input.css +15 -1
- package/components/Inspector/Inspector.css +4 -1
- package/components/List/List.css +1 -1
- package/components/NotificationCenter/NotificationCenter.css +152 -27
- package/components/NotificationCenter/NotificationCenter.d.ts +71 -8
- package/components/NotificationCenter/NotificationCenter.js +120 -13
- package/components/NumberInput/NumberInput.css +2 -0
- package/components/PageHeader/PageHeader.css +12 -4
- package/components/Panel/Panel.d.ts +1 -1
- package/components/Popover/Popover.css +3 -0
- package/components/Popover/Popover.d.ts +1 -1
- package/components/Popover/Popover.js +9 -1
- package/components/Prose/Prose.css +1 -1
- package/components/QuestionCard/QuestionCard.css +7 -4
- package/components/RadioButton/RadioButton.css +1 -1
- package/components/RadioButton/RadioButton.d.ts +4 -2
- package/components/RadioButton/RadioButton.js +5 -2
- package/components/ResourceTimeline/ResourceTimeline.css +12 -0
- package/components/ResourceTimeline/ResourceTimeline.d.ts +5 -1
- package/components/ResourceTimeline/ResourceTimeline.js +94 -52
- package/components/RichDropdown/RichDropdown.css +3 -1
- package/components/SegmentedControl/SegmentedControl.css +5 -0
- package/components/SelectionCard/SelectionCard.css +29 -0
- package/components/SelectionCard/SelectionCard.d.ts +7 -0
- package/components/SelectionCard/SelectionCard.js +25 -2
- package/components/Sparkline/Sparkline.css +20 -0
- package/components/Sparkline/Sparkline.d.ts +4 -0
- package/components/Sparkline/Sparkline.js +14 -8
- package/components/Stat/Stat.css +39 -0
- package/components/Stat/Stat.d.ts +23 -2
- package/components/Stat/Stat.js +21 -6
- package/components/Table/Table.css +106 -16
- package/components/Table/Table.d.ts +4 -0
- package/components/Table/Table.js +43 -28
- package/components/Textarea/Textarea.css +4 -2
- package/components/ThemeToggle/colorMode.d.ts +13 -5
- package/components/ThemeToggle/colorMode.js +4 -2
- package/components/ThreadHistory/ThreadHistory.css +11 -0
- package/components/ThreadHistory/ThreadHistory.d.ts +5 -1
- package/components/ThreadHistory/ThreadHistory.js +6 -1
- package/components/ThreadPanel/ThreadPanel.d.ts +4 -0
- package/components/ThreadPanel/ThreadPanel.js +5 -1
- package/components/TimePicker/TimePicker.css +3 -1
- package/components/TimePicker/TimePicker.d.ts +4 -2
- package/components/TimePicker/TimePicker.js +11 -3
- package/components/Timeline/Timeline.css +15 -0
- package/components/Timeline/Timeline.d.ts +8 -0
- package/components/Timeline/Timeline.js +21 -0
- package/components/Toast/Toast.css +16 -0
- package/components/Toast/Toast.d.ts +7 -2
- package/components/ToggleGroup/ToggleGroup.css +28 -2
- package/components/ToggleSwitch/ToggleSwitch.css +1 -1
- package/components/Toolbar/Toolbar.d.ts +6 -1
- package/components/Tooltip/Tooltip.d.ts +9 -0
- package/components/Tooltip/Tooltip.js +34 -8
- package/components/TreeView/TreeView.css +12 -0
- package/components/TreeView/TreeView.d.ts +4 -0
- package/components/TreeView/TreeView.js +20 -0
- package/components/UsageCard/UsageCard.css +11 -0
- package/components/UsageCard/UsageCard.d.ts +4 -0
- package/components/UsageCard/UsageCard.js +25 -16
- package/components/Widget/Widget.css +7 -0
- package/components/Widget/Widget.d.ts +4 -0
- package/components/Widget/Widget.js +14 -2
- package/components/Wizard/Wizard.d.ts +8 -3
- package/components/Wizard/Wizard.js +4 -1
- package/components/registry.json +15 -6
- package/components/registry.json.d.ts +15 -6
- package/components/registry.json.js +1 -1
- package/package.json +7 -2
- package/tokens/presets/contrast.css +4 -4
- package/tokens/presets/coral.css +3 -4
- package/tokens/presets/forest.css +16 -4
- package/tokens/presets/gold.css +4 -3
- package/tokens/presets/marquee.css +2 -3
- package/tokens/presets/mono.css +28 -28
- package/tokens/presets/pink.css +5 -4
- package/tokens/presets/terminal.css +4 -3
- package/tokens/presets/violet.css +3 -4
- package/tokens/presets/warm.css +16 -4
- package/tokens/presets/zest.css +11 -13
- package/tokens/registry.json +1 -0
- package/tokens/registry.json.d.ts +1 -0
- package/tokens/registry.json.js +1 -1
- package/tokens/tokens-dark.css +4 -0
- package/tokens/tokens-light.css +4 -0
- package/tokens/values.d.ts +24 -4
- package/tokens/values.js +25 -6
- package/tokens/values.json.js +1 -1
|
@@ -22,6 +22,15 @@ type DialogOwnProps = {
|
|
|
22
22
|
dismissible?: boolean;
|
|
23
23
|
/** Accessible name of the close button. */
|
|
24
24
|
closeLabel?: string;
|
|
25
|
+
/**
|
|
26
|
+
* The element that takes focus when the panel opens: a ref to a field or
|
|
27
|
+
* button inside it. Without one, a child that focused itself on mount
|
|
28
|
+
* (`autoFocus`, when the dialog is mounted already open) keeps focus, and
|
|
29
|
+
* otherwise focus lands on the first control, which is the close button.
|
|
30
|
+
* The dialog stays mounted while closed, so `autoFocus` alone cannot move
|
|
31
|
+
* focus on a later open; pass this ref for that.
|
|
32
|
+
*/
|
|
33
|
+
initialFocus?: React.RefObject<HTMLElement | null>;
|
|
25
34
|
/** Additional CSS classes — applied to the portal container, not the panel */
|
|
26
35
|
className?: string;
|
|
27
36
|
};
|
|
@@ -20,6 +20,7 @@ const Dialog = React.forwardRef(
|
|
|
20
20
|
size = "md",
|
|
21
21
|
dismissible = true,
|
|
22
22
|
closeLabel = "Close dialog",
|
|
23
|
+
initialFocus,
|
|
23
24
|
className = "",
|
|
24
25
|
...rest
|
|
25
26
|
}, ref) => {
|
|
@@ -34,7 +35,13 @@ const Dialog = React.forwardRef(
|
|
|
34
35
|
};
|
|
35
36
|
const mounted = useMounted();
|
|
36
37
|
const layer = useLayer({ open, dismissOnEscape: dismissible, onDismiss: () => onOpenChange(false) });
|
|
37
|
-
|
|
38
|
+
const resolveInitialFocus = () => {
|
|
39
|
+
if (initialFocus?.current) return initialFocus.current;
|
|
40
|
+
const active = document.activeElement;
|
|
41
|
+
const panel = panelRef.current;
|
|
42
|
+
return active instanceof HTMLElement && panel && panel !== active && panel.contains(active) ? active : null;
|
|
43
|
+
};
|
|
44
|
+
useFocusScope(panelRef, { active: open, initialFocus: resolveInitialFocus });
|
|
38
45
|
useScrollLock(open);
|
|
39
46
|
const handleBackdropClick = () => {
|
|
40
47
|
if (dismissible && layer.ownsPress()) onOpenChange(false);
|
|
@@ -59,24 +66,30 @@ const Dialog = React.forwardRef(
|
|
|
59
66
|
"aria-describedby": description ? descId : rest["aria-describedby"],
|
|
60
67
|
tabIndex: -1,
|
|
61
68
|
children: [
|
|
62
|
-
/* @__PURE__ */ jsxs(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
69
|
+
/* @__PURE__ */ jsxs(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
className: [`${baseClass}__header`, dismissible ? "" : `${baseClass}__header--no-close`].filter(Boolean).join(" "),
|
|
73
|
+
children: [
|
|
74
|
+
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__heading`, children: [
|
|
75
|
+
/* @__PURE__ */ jsx("h2", { className: `${baseClass}__title`, id: titleId, children: title }),
|
|
76
|
+
description && /* @__PURE__ */ jsx("p", { className: `${baseClass}__description`, id: descId, children: description })
|
|
77
|
+
] }),
|
|
78
|
+
dismissible && /* @__PURE__ */ jsx(
|
|
79
|
+
IconButton,
|
|
80
|
+
{
|
|
81
|
+
className: `${baseClass}__close`,
|
|
82
|
+
icon: "close",
|
|
83
|
+
variant: "tertiary",
|
|
84
|
+
size: "compact",
|
|
85
|
+
tooltip: false,
|
|
86
|
+
label: closeLabel,
|
|
87
|
+
onClick: () => onOpenChange(false)
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
),
|
|
80
93
|
children && // Scrollable when content is long; without a tab stop a keyboard
|
|
81
94
|
// user cannot reach that scroll. The initial-focus query below
|
|
82
95
|
// still prefers a real control, so this does not steal focus.
|
|
@@ -49,6 +49,15 @@ type DrawerOwnProps = {
|
|
|
49
49
|
layout?: 'flush' | 'floating';
|
|
50
50
|
/** Accessible name of the close button. */
|
|
51
51
|
closeLabel?: string;
|
|
52
|
+
/**
|
|
53
|
+
* The element that takes focus when the panel opens: a ref to a field or
|
|
54
|
+
* button inside it. Without one, a child that focused itself on mount
|
|
55
|
+
* (`autoFocus`, when the drawer is mounted already open) keeps focus, and
|
|
56
|
+
* otherwise focus lands on the first control, which is the close button.
|
|
57
|
+
* The drawer stays mounted while closed, so `autoFocus` alone cannot move
|
|
58
|
+
* focus on a later open; pass this ref for that.
|
|
59
|
+
*/
|
|
60
|
+
initialFocus?: React.RefObject<HTMLElement | null>;
|
|
52
61
|
/** Additional CSS classes — applied to the portal container, not the panel */
|
|
53
62
|
className?: string;
|
|
54
63
|
};
|
|
@@ -26,6 +26,7 @@ const Drawer = React.forwardRef(
|
|
|
26
26
|
modal = true,
|
|
27
27
|
layout = "flush",
|
|
28
28
|
closeLabel = "Close drawer",
|
|
29
|
+
initialFocus,
|
|
29
30
|
className = "",
|
|
30
31
|
...rest
|
|
31
32
|
}, ref) => {
|
|
@@ -46,8 +47,15 @@ const Drawer = React.forwardRef(
|
|
|
46
47
|
passive: !modal,
|
|
47
48
|
getElements: modal ? void 0 : () => [panelRef.current]
|
|
48
49
|
});
|
|
50
|
+
const resolveInitialFocus = () => {
|
|
51
|
+
if (initialFocus?.current) return initialFocus.current;
|
|
52
|
+
const active = document.activeElement;
|
|
53
|
+
const panel = panelRef.current;
|
|
54
|
+
return active instanceof HTMLElement && panel && panel !== active && panel.contains(active) ? active : null;
|
|
55
|
+
};
|
|
49
56
|
useFocusScope(panelRef, {
|
|
50
57
|
active: open,
|
|
58
|
+
initialFocus: resolveInitialFocus,
|
|
51
59
|
trap: modal,
|
|
52
60
|
inertOutside: modal,
|
|
53
61
|
// The page stays live beside a non-modal drawer, so by the time it
|
|
@@ -282,7 +282,9 @@
|
|
|
282
282
|
ERROR STATE
|
|
283
283
|
============================================ */
|
|
284
284
|
|
|
285
|
-
|
|
285
|
+
/* The hover rule above is more specific, so the error border names it too. */
|
|
286
|
+
.ds-dropdown--error .ds-dropdown__trigger,
|
|
287
|
+
.ds-dropdown--error .ds-dropdown__trigger:hover:not(:focus-visible) {
|
|
286
288
|
border-color: var(--color-status-error-border);
|
|
287
289
|
}
|
|
288
290
|
|
|
@@ -221,11 +221,19 @@ const Dropdown = React.forwardRef(
|
|
|
221
221
|
disabled,
|
|
222
222
|
size,
|
|
223
223
|
id: inputId,
|
|
224
|
+
onClick: (event) => {
|
|
225
|
+
rest.onClick?.(event);
|
|
226
|
+
if (disabled || event.defaultPrevented) return;
|
|
227
|
+
if (event.target instanceof Element && event.target.closest(`#${CSS.escape(`${inputId}-label`)}`)) {
|
|
228
|
+
triggerRef.current?.focus();
|
|
229
|
+
}
|
|
230
|
+
},
|
|
224
231
|
children: [
|
|
225
232
|
/* @__PURE__ */ jsxs(
|
|
226
233
|
"div",
|
|
227
234
|
{
|
|
228
235
|
ref: triggerRef,
|
|
236
|
+
id: inputId,
|
|
229
237
|
className: `${baseClass}__trigger`,
|
|
230
238
|
role: "combobox",
|
|
231
239
|
"aria-expanded": isOpen,
|
|
@@ -34,6 +34,10 @@
|
|
|
34
34
|
justify-content: center;
|
|
35
35
|
width: 48px;
|
|
36
36
|
height: 48px;
|
|
37
|
+
/* A hairline, so the tile keeps its edge on a surface that shares its
|
|
38
|
+
fill: an empty state inside a Panel sits on the container colour the
|
|
39
|
+
tile is filled with. */
|
|
40
|
+
border: var(--border-025) solid var(--color-bg-container-border);
|
|
37
41
|
border-radius: var(--radius-pill);
|
|
38
42
|
background-color: var(--color-bg-container-primary);
|
|
39
43
|
color: var(--color-icon-primary);
|
|
@@ -47,11 +51,13 @@
|
|
|
47
51
|
/* Tones: the icon tile takes a status role, for a result that worked or a
|
|
48
52
|
step that failed; the copy stays in the page's text colours. */
|
|
49
53
|
.ds-empty-state--positive .ds-empty-state__icon {
|
|
54
|
+
border-color: transparent;
|
|
50
55
|
background-color: var(--color-status-positive-bg);
|
|
51
56
|
color: var(--color-status-positive-icon);
|
|
52
57
|
}
|
|
53
58
|
|
|
54
59
|
.ds-empty-state--error .ds-empty-state__icon {
|
|
60
|
+
border-color: transparent;
|
|
55
61
|
background-color: var(--color-status-error-bg);
|
|
56
62
|
color: var(--color-status-error-icon);
|
|
57
63
|
}
|
|
@@ -106,7 +112,8 @@
|
|
|
106
112
|
|
|
107
113
|
.ds-empty-state--bordered {
|
|
108
114
|
border: var(--border-025) dashed var(--color-bg-container-border);
|
|
109
|
-
|
|
115
|
+
/* The content-card corner, Panel's and Widget's. */
|
|
116
|
+
border-radius: var(--radius-600); /* 24px */
|
|
110
117
|
}
|
|
111
118
|
|
|
112
119
|
/* ============================================
|
|
@@ -229,6 +229,8 @@ button.ds-event-calendar__day:focus-visible {
|
|
|
229
229
|
flex-direction: column;
|
|
230
230
|
gap: var(--gap-050);
|
|
231
231
|
min-width: 0;
|
|
232
|
+
/* A day's pills answer to the day's own width, whatever the screen's. */
|
|
233
|
+
container-type: inline-size;
|
|
232
234
|
}
|
|
233
235
|
|
|
234
236
|
.ds-event-calendar__event {
|
|
@@ -245,6 +247,8 @@ button.ds-event-calendar__day:focus-visible {
|
|
|
245
247
|
border: var(--border-025) solid transparent;
|
|
246
248
|
border-radius: var(--radius-100);
|
|
247
249
|
text-align: start;
|
|
250
|
+
/* Nothing a pill holds runs past its edge. */
|
|
251
|
+
overflow: hidden;
|
|
248
252
|
}
|
|
249
253
|
|
|
250
254
|
button.ds-event-calendar__event {
|
|
@@ -297,6 +301,14 @@ button.ds-event-calendar__event:focus-visible {
|
|
|
297
301
|
font-variant-numeric: tabular-nums;
|
|
298
302
|
}
|
|
299
303
|
|
|
304
|
+
/* The title comes first: in a day too narrow for both, the time gives way
|
|
305
|
+
and the title takes the pill. The time stays in the pill's name. */
|
|
306
|
+
@container (max-width: 200px) {
|
|
307
|
+
.ds-event-calendar__event-time {
|
|
308
|
+
display: none;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
300
312
|
/* ============================================
|
|
301
313
|
SPANS — an event over several days
|
|
302
314
|
Its pill on each day squares off the side the
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
============================================ */
|
|
64
64
|
|
|
65
65
|
.ds-field--error .ds-field__helper {
|
|
66
|
-
color: var(--color-
|
|
66
|
+
color: var(--color-text-error);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
/* The newer form: the error is a message of its own under the control,
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
font-weight: var(--font-paragraph-sm-weight);
|
|
76
76
|
line-height: var(--font-paragraph-sm-line-height);
|
|
77
77
|
letter-spacing: var(--font-paragraph-sm-letter-spacing);
|
|
78
|
-
color: var(--color-
|
|
78
|
+
color: var(--color-text-error);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
/* ============================================
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
font-weight: var(--font-paragraph-sm-weight);
|
|
162
162
|
line-height: var(--font-paragraph-sm-line-height);
|
|
163
163
|
letter-spacing: var(--font-paragraph-sm-letter-spacing);
|
|
164
|
-
color: var(--color-
|
|
164
|
+
color: var(--color-text-error);
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
/* ============================================
|
|
@@ -52,9 +52,14 @@ export interface FilterBarProps extends FilterBarOwnProps, Omit<React.ComponentP
|
|
|
52
52
|
* opens a popover of options, active filters show their choice and grow a
|
|
53
53
|
* clear button, and a clear-all appears once anything is active. State is one
|
|
54
54
|
* map of filter id to active values, controlled or uncontrolled, so wiring it
|
|
55
|
-
* to a
|
|
55
|
+
* to a list is a single callback. Popovers are real listboxes: arrow
|
|
56
56
|
* keys move, Enter and Space toggle, Escape closes, focus never leaves the
|
|
57
57
|
* chip.
|
|
58
|
+
*
|
|
59
|
+
* It is for a collection that is not a DataTable: a card grid, a feed, a
|
|
60
|
+
* list. A DataTable's filters belong in its own bar, `TableToolbar` in the
|
|
61
|
+
* table's `toolbar` slot, which reads the table's columns and shares one
|
|
62
|
+
* filter list with its headers.
|
|
58
63
|
*/
|
|
59
64
|
export declare const FilterBar: React.ForwardRefExoticComponent<FilterBarProps & React.RefAttributes<HTMLDivElement>>;
|
|
60
65
|
export {};
|
|
@@ -45,6 +45,13 @@ type FunnelChartOwnProps = {
|
|
|
45
45
|
* height floor no longer applies; the prop is ignored.
|
|
46
46
|
*/
|
|
47
47
|
minStageShare?: number;
|
|
48
|
+
/**
|
|
49
|
+
* Holds the chart's placeholder, the outline of this chart type, in place of the chart while its data is still being fetched.
|
|
50
|
+
* Before its first draw the chart shows the same placeholder by itself, so this is only for a wait the host knows about.
|
|
51
|
+
*/
|
|
52
|
+
loading?: boolean;
|
|
53
|
+
/** Accessible name announced while `loading`. */
|
|
54
|
+
loadingLabel?: string;
|
|
48
55
|
/** Additional CSS classes */
|
|
49
56
|
className?: string;
|
|
50
57
|
};
|
|
@@ -4,6 +4,7 @@ import React, { useCallback } from "react";
|
|
|
4
4
|
import { ResponsiveContainer, FunnelChart as FunnelChart$1, Tooltip, Funnel, LabelList } from "recharts";
|
|
5
5
|
import { getChartSeriesColors } from "../Chart/palette.js";
|
|
6
6
|
import { useChartAnimation } from "../Chart/useChartAnimation.js";
|
|
7
|
+
import { ChartSkeleton } from "../Chart/ChartSkeleton.js";
|
|
7
8
|
import "../Chart/Chart.css";
|
|
8
9
|
import "./FunnelChart.css";
|
|
9
10
|
import { useLocale } from "../../behaviors/LocaleProvider.js";
|
|
@@ -42,6 +43,8 @@ const FunnelChart = React.forwardRef(
|
|
|
42
43
|
summaryLabel,
|
|
43
44
|
emptyLabel = "Funnel, no data",
|
|
44
45
|
minStageShare,
|
|
46
|
+
loading = false,
|
|
47
|
+
loadingLabel = "Loading chart",
|
|
45
48
|
className = "",
|
|
46
49
|
locale: localeProp,
|
|
47
50
|
...rest
|
|
@@ -73,42 +76,53 @@ const FunnelChart = React.forwardRef(
|
|
|
73
76
|
title && /* @__PURE__ */ jsx("h3", { className: `${chartClass}__title`, children: title }),
|
|
74
77
|
subtitle && /* @__PURE__ */ jsx("p", { className: `${chartClass}__subtitle`, children: subtitle })
|
|
75
78
|
] }) }),
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
-
|
|
79
|
+
/* @__PURE__ */ jsxs(
|
|
80
|
+
"div",
|
|
78
81
|
{
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
bottom: 4,
|
|
83
|
-
left: 4
|
|
84
|
-
},
|
|
82
|
+
className: `${chartClass}__body`,
|
|
83
|
+
role: loading ? void 0 : "img",
|
|
84
|
+
"aria-label": loading ? void 0 : ariaLabel,
|
|
85
85
|
children: [
|
|
86
|
-
/* @__PURE__ */ jsx(
|
|
87
|
-
/* @__PURE__ */ jsx(
|
|
88
|
-
|
|
86
|
+
/* @__PURE__ */ jsx(ChartSkeleton, { shape: "funnel", height, loading, loadingLabel }),
|
|
87
|
+
!loading && /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxs(
|
|
88
|
+
FunnelChart$1,
|
|
89
89
|
{
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
90
|
+
margin: {
|
|
91
|
+
top: 4,
|
|
92
|
+
right: showLabels ? Math.ceil(Math.max(0, ...stages.map((s) => s.name.length)) * 12 * 0.6) + 12 : 4,
|
|
93
|
+
bottom: 4,
|
|
94
|
+
left: 4
|
|
95
|
+
},
|
|
96
|
+
children: [
|
|
97
|
+
/* @__PURE__ */ jsx(Tooltip, { content: renderTooltip }),
|
|
98
|
+
/* @__PURE__ */ jsx(
|
|
99
|
+
Funnel,
|
|
100
|
+
{
|
|
101
|
+
...animation,
|
|
102
|
+
dataKey: "value",
|
|
103
|
+
nameKey: "name",
|
|
104
|
+
data: stages,
|
|
105
|
+
lastShapeType: "rectangle",
|
|
106
|
+
stroke: surfaceColor,
|
|
107
|
+
strokeWidth: 2,
|
|
108
|
+
children: showLabels && /* @__PURE__ */ jsx(
|
|
109
|
+
LabelList,
|
|
110
|
+
{
|
|
111
|
+
position: "right",
|
|
112
|
+
dataKey: "name",
|
|
113
|
+
fill: textSecondary,
|
|
114
|
+
stroke: "none",
|
|
115
|
+
fontSize: 12
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
]
|
|
107
121
|
}
|
|
108
|
-
)
|
|
122
|
+
) })
|
|
109
123
|
]
|
|
110
124
|
}
|
|
111
|
-
)
|
|
125
|
+
)
|
|
112
126
|
] });
|
|
113
127
|
}
|
|
114
128
|
);
|
|
@@ -317,4 +317,14 @@ button.ds-gantt__bar:focus-visible {
|
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
319
|
|
|
320
|
+
/* Loading: a label line beside a placeholder bar on each row, in the
|
|
321
|
+
Skeleton fill. */
|
|
322
|
+
|
|
323
|
+
.ds-gantt__bar.ds-gantt__bar--loading {
|
|
324
|
+
position: absolute;
|
|
325
|
+
height: var(--ds-gantt-bar-height);
|
|
326
|
+
border-radius: var(--radius-pill);
|
|
327
|
+
background-color: var(--color-bg-container-secondary);
|
|
328
|
+
}
|
|
329
|
+
|
|
320
330
|
} /* @layer rift.components */
|
|
@@ -79,6 +79,10 @@ type GanttChartOwnProps = {
|
|
|
79
79
|
progressLabel?: (percent: number) => string;
|
|
80
80
|
/** The word a `projected` bar's tooltip and accessible text carries. Defaults to "projected". */
|
|
81
81
|
projectedLabel?: string;
|
|
82
|
+
/** Holds placeholder rows, a label line beside a placeholder bar, in place of the timeline while the plan is being fetched: as many as `items` holds, or four when it is empty. */
|
|
83
|
+
loading?: boolean;
|
|
84
|
+
/** Accessible name announced while `loading`. */
|
|
85
|
+
loadingLabel?: string;
|
|
82
86
|
/** Additional CSS classes */
|
|
83
87
|
className?: string;
|
|
84
88
|
};
|
|
@@ -2,9 +2,16 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { DEFAULT_LOCALE } from "../../behaviors/locale.js";
|
|
4
4
|
import "../Chart/Chart.css";
|
|
5
|
+
import { Skeleton } from "../Skeleton/Skeleton.js";
|
|
5
6
|
import "./GanttChart.css";
|
|
6
7
|
import "../../behaviors/visually-hidden.css";
|
|
7
8
|
const MS_PER_DAY = 24 * 60 * 60 * 1e3;
|
|
9
|
+
const LOADING_BARS = [
|
|
10
|
+
[4, 30],
|
|
11
|
+
[22, 26],
|
|
12
|
+
[40, 34],
|
|
13
|
+
[62, 28]
|
|
14
|
+
];
|
|
8
15
|
const parseDay = (date) => /* @__PURE__ */ new Date(`${date}T00:00:00`);
|
|
9
16
|
const isValidDay = (date) => !Number.isNaN(date.getTime());
|
|
10
17
|
const daysBetween = (from, to) => Math.round((to.getTime() - from.getTime()) / MS_PER_DAY);
|
|
@@ -45,6 +52,8 @@ const GanttChart = React.forwardRef(
|
|
|
45
52
|
rangeLabel = defaultRangeLabel,
|
|
46
53
|
progressLabel = defaultProgressLabel,
|
|
47
54
|
projectedLabel = "projected",
|
|
55
|
+
loading = false,
|
|
56
|
+
loadingLabel = "Loading",
|
|
48
57
|
className = "",
|
|
49
58
|
...rest
|
|
50
59
|
}, ref) => {
|
|
@@ -171,39 +180,63 @@ const GanttChart = React.forwardRef(
|
|
|
171
180
|
title && /* @__PURE__ */ jsx("h3", { className: `${chartClass}__title`, children: title }),
|
|
172
181
|
subtitle && /* @__PURE__ */ jsx("p", { className: `${chartClass}__subtitle`, children: subtitle })
|
|
173
182
|
] }) }),
|
|
174
|
-
/* @__PURE__ */
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
-
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
"
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
183
|
+
/* @__PURE__ */ jsxs("div", { className: `${chartClass}__body ${baseClass}__body`, children: [
|
|
184
|
+
loading && /* @__PURE__ */ jsx("div", { className: `${baseClass}__scroll`, children: /* @__PURE__ */ jsx("div", { className: `${baseClass}__canvas`, children: /* @__PURE__ */ jsx("ul", { className: `${baseClass}__list`, "aria-busy": "true", children: Array.from({ length: items.length || 4 }, (_, index) => {
|
|
185
|
+
const [left, width] = LOADING_BARS[index % LOADING_BARS.length];
|
|
186
|
+
return /* @__PURE__ */ jsxs("li", { className: `${baseClass}__row`, children: [
|
|
187
|
+
/* @__PURE__ */ jsx("div", { className: `${baseClass}__label`, children: /* @__PURE__ */ jsx(
|
|
188
|
+
Skeleton,
|
|
189
|
+
{
|
|
190
|
+
variant: "text",
|
|
191
|
+
width: "70%",
|
|
192
|
+
...index === 0 ? { loadingLabel } : { "aria-hidden": true }
|
|
193
|
+
}
|
|
194
|
+
) }),
|
|
195
|
+
/* @__PURE__ */ jsx("div", { className: `${baseClass}__track`, children: /* @__PURE__ */ jsx(
|
|
196
|
+
Skeleton,
|
|
197
|
+
{
|
|
198
|
+
variant: "rectangular",
|
|
199
|
+
className: `${baseClass}__bar ${baseClass}__bar--loading`,
|
|
200
|
+
style: { left: `${left}%`, width: `${width}%` },
|
|
201
|
+
"aria-hidden": "true"
|
|
202
|
+
}
|
|
203
|
+
) })
|
|
204
|
+
] }, index);
|
|
205
|
+
}) }) }) }),
|
|
206
|
+
drawable && !loading && /* @__PURE__ */ jsx("div", { className: `${baseClass}__scroll`, children: /* @__PURE__ */ jsxs("div", { className: `${baseClass}__canvas`, children: [
|
|
207
|
+
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__axis`, "aria-hidden": "true", children: [
|
|
208
|
+
/* @__PURE__ */ jsx("div", { className: `${baseClass}__corner` }),
|
|
209
|
+
/* @__PURE__ */ jsx("div", { className: `${baseClass}__months`, children: months.map((month) => /* @__PURE__ */ jsx(
|
|
210
|
+
"span",
|
|
211
|
+
{
|
|
212
|
+
className: `${baseClass}__month-label`,
|
|
213
|
+
style: { left: `${month.left}%` },
|
|
214
|
+
children: month.label
|
|
215
|
+
},
|
|
216
|
+
month.label + month.left
|
|
217
|
+
)) })
|
|
218
|
+
] }),
|
|
219
|
+
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__rows`, children: [
|
|
220
|
+
overlay,
|
|
221
|
+
blocks.map((block, blockIndex) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
222
|
+
block.group && /* @__PURE__ */ jsxs("div", { className: `${baseClass}__group-row`, children: [
|
|
223
|
+
/* @__PURE__ */ jsx("div", { className: `${baseClass}__group-label`, children: block.group }),
|
|
224
|
+
/* @__PURE__ */ jsx("div", { className: `${baseClass}__track` })
|
|
225
|
+
] }),
|
|
226
|
+
/* @__PURE__ */ jsxs("ul", { className: `${baseClass}__list`, "aria-label": block.group, children: [
|
|
227
|
+
block.items.map((item) => /* @__PURE__ */ jsxs("li", { className: `${baseClass}__row`, children: [
|
|
228
|
+
/* @__PURE__ */ jsx("div", { className: `${baseClass}__label`, children: item.label }),
|
|
229
|
+
/* @__PURE__ */ jsx("div", { className: `${baseClass}__track`, children: renderBar(item) })
|
|
230
|
+
] }, item.id)),
|
|
231
|
+
block.milestones.map((milestone) => /* @__PURE__ */ jsxs("li", { className: `${baseClass}__row`, children: [
|
|
232
|
+
/* @__PURE__ */ jsx("div", { className: `${baseClass}__label ${baseClass}__label--milestone`, children: milestone.label }),
|
|
233
|
+
/* @__PURE__ */ jsx("div", { className: `${baseClass}__track`, children: renderMilestone(milestone) })
|
|
234
|
+
] }, milestone.id))
|
|
235
|
+
] })
|
|
236
|
+
] }, block.group ?? `block-${blockIndex}`))
|
|
237
|
+
] })
|
|
238
|
+
] }) })
|
|
239
|
+
] })
|
|
207
240
|
] });
|
|
208
241
|
}
|
|
209
242
|
);
|
|
@@ -123,4 +123,27 @@
|
|
|
123
123
|
color: var(--color-text-secondary);
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
+
/* ============================================
|
|
127
|
+
LOADING — the empty dial, pulsing, with a
|
|
128
|
+
placeholder where the reading goes
|
|
129
|
+
============================================ */
|
|
130
|
+
|
|
131
|
+
.ds-gauge--loading .ds-gauge__track {
|
|
132
|
+
/* ds-allow(motion): the pulse needs a symmetric in-out curve and no
|
|
133
|
+
--motion-ease-* token provides one; the duration is tokenized. */
|
|
134
|
+
animation: ds-gauge-pulse var(--motion-duration-loop-shimmer) ease-in-out infinite alternate;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.ds-gauge__value > .ds-skeleton {
|
|
138
|
+
width: 3ch;
|
|
139
|
+
height: calc(1lh - var(--padding-300));
|
|
140
|
+
margin-block: var(--padding-150);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
@keyframes ds-gauge-pulse {
|
|
144
|
+
to {
|
|
145
|
+
opacity: 0.5;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
126
149
|
} /* @layer rift.components */
|
|
@@ -50,6 +50,10 @@ type GaugeOwnProps = {
|
|
|
50
50
|
strokeWidth?: number;
|
|
51
51
|
/** The BCP 47 locale the value is written in when no `formatValue` is given, such as `ar-EG`. Defaults to `en-US`. This component can render from a Server Component, so it takes the prop alone and reads no LocaleProvider. */
|
|
52
52
|
locale?: string;
|
|
53
|
+
/** Draws the empty dial, pulsing, with a placeholder where the reading goes, while the value is being fetched. The label stays. */
|
|
54
|
+
loading?: boolean;
|
|
55
|
+
/** Accessible name announced while `loading`. */
|
|
56
|
+
loadingLabel?: string;
|
|
53
57
|
/** Additional CSS classes */
|
|
54
58
|
className?: string;
|
|
55
59
|
};
|