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.
Files changed (212) hide show
  1. package/README.md +2 -2
  2. package/behaviors/LoadingImage.d.ts +2 -0
  3. package/behaviors/LoadingImage.js +34 -0
  4. package/behaviors/ScrollRegion.js +15 -2
  5. package/behaviors/VisuallyHidden.d.ts +30 -0
  6. package/behaviors/VisuallyHidden.js +17 -0
  7. package/behaviors/loading-image.css +30 -0
  8. package/behaviors/quietFocus.d.ts +4 -0
  9. package/behaviors/quietFocus.js +14 -0
  10. package/behaviors/useFocusScope.d.ts +3 -1
  11. package/behaviors/useFocusScope.js +4 -6
  12. package/bin/rift-ds.mjs +2 -0
  13. package/bin/templates/app/components/rift/ColorModeScript.tsx +3 -1
  14. package/bin/templates/app/components/rift/RiftRoot.tsx +40 -1
  15. package/bin/templates/blocks/app/dashboard/page.module.css +2 -2
  16. package/bin/templates/blocks/app/dashboard/page.tsx +7 -5
  17. package/bin/templates/blocks/app/landing/page.tsx +1 -1
  18. package/bin/templates/blocks/app/notifications/Inbox.tsx +13 -45
  19. package/bin/templates/blocks/app/notifications/page.module.css +5 -0
  20. package/bin/templates/blocks/app/planner/page.tsx +2 -2
  21. package/bin/templates/blocks/app/pricing/page.module.css +15 -1
  22. package/bin/templates/blocks/app/pricing/page.tsx +8 -1
  23. package/bin/templates/blocks/app/settings/Settings.tsx +4 -4
  24. package/bin/templates/blocks/app/sign-in/page.tsx +10 -2
  25. package/bin/templates/blocks/app/sign-up/page.module.css +83 -0
  26. package/bin/templates/blocks/app/sign-up/page.tsx +126 -0
  27. package/bin/templates/blocks/app/starter/page.tsx +1 -1
  28. package/bin/templates/blocks/components/blocks/AppShell.module.css +0 -10
  29. package/bin/templates/blocks/components/blocks/AppShell.tsx +51 -132
  30. package/bin/templates/blocks/components/blocks/DocsShell.tsx +5 -1
  31. package/bin/templates/blocks/components/blocks/notifications.ts +77 -0
  32. package/bin/templates/blocks/registry.json +49 -6
  33. package/chat/ChatWidget.js +2 -1
  34. package/components/AgentPlan/AgentPlan.css +1 -1
  35. package/components/AlertDialog/AlertDialog.css +14 -0
  36. package/components/AlertDialog/AlertDialog.d.ts +35 -3
  37. package/components/AlertDialog/AlertDialog.js +16 -5
  38. package/components/AppLayout/AppLayout.css +6 -0
  39. package/components/AppLayout/AppLayout.d.ts +4 -0
  40. package/components/AppLayout/AppLayout.js +5 -1
  41. package/components/AppSidebar/AppSidebar.css +17 -2
  42. package/components/AppSidebar/AppSidebar.js +9 -2
  43. package/components/AppToolbar/AppToolbar.d.ts +5 -2
  44. package/components/AppToolbar/AppToolbar.js +3 -1
  45. package/components/Attachment/AttachmentGroup.js +2 -1
  46. package/components/Attachment/AttachmentTile.js +2 -1
  47. package/components/Badge/Badge.css +6 -0
  48. package/components/Breadcrumb/Breadcrumb.css +4 -1
  49. package/components/Button/Button.css +20 -1
  50. package/components/Button/Button.js +6 -1
  51. package/components/Card/Card.css +11 -0
  52. package/components/Card/Card.d.ts +9 -3
  53. package/components/Card/Card.js +21 -2
  54. package/components/Chart/AreaChart.d.ts +7 -0
  55. package/components/Chart/AreaChart.js +57 -45
  56. package/components/Chart/BarChart.d.ts +7 -0
  57. package/components/Chart/BarChart.js +52 -46
  58. package/components/Chart/Chart.css +134 -1
  59. package/components/Chart/ChartSkeleton.d.ts +32 -0
  60. package/components/Chart/ChartSkeleton.js +149 -0
  61. package/components/Chart/ComboChart.d.ts +7 -0
  62. package/components/Chart/ComboChart.js +80 -74
  63. package/components/Chart/LineChart.d.ts +17 -3
  64. package/components/Chart/LineChart.js +67 -39
  65. package/components/Chart/PieChart.d.ts +7 -0
  66. package/components/Chart/PieChart.js +41 -34
  67. package/components/Chart/RadarChart.d.ts +7 -0
  68. package/components/Chart/RadarChart.js +39 -32
  69. package/components/Chart/RadialChart.d.ts +7 -0
  70. package/components/Chart/RadialChart.js +5 -1
  71. package/components/Chart/ScatterChart.d.ts +7 -0
  72. package/components/Chart/ScatterChart.js +52 -40
  73. package/components/Chart/StackedBarChart.d.ts +10 -1
  74. package/components/Chart/StackedBarChart.js +57 -43
  75. package/components/Chart/Treemap.d.ts +7 -0
  76. package/components/Chart/Treemap.js +17 -11
  77. package/components/ChatMessage/ChatMessage.css +6 -0
  78. package/components/Checkbox/Checkbox.css +25 -1
  79. package/components/Checkbox/Checkbox.d.ts +8 -4
  80. package/components/Checkbox/Checkbox.js +17 -8
  81. package/components/Chip/Chip.css +5 -3
  82. package/components/ContactCard/ContactCard.css +4 -3
  83. package/components/ContributionGraph/ContributionGraph.css +20 -0
  84. package/components/ContributionGraph/ContributionGraph.d.ts +4 -0
  85. package/components/ContributionGraph/ContributionGraph.js +11 -6
  86. package/components/DataTable/DataTable.css +34 -4
  87. package/components/DataTable/DataTable.d.ts +16 -2
  88. package/components/DataTable/DataTable.js +8 -2
  89. package/components/DateInput/DateInput.css +3 -1
  90. package/components/DatePicker/DatePicker.css +16 -0
  91. package/components/DatePicker/DatePicker.d.ts +13 -0
  92. package/components/DatePicker/DatePicker.js +21 -27
  93. package/components/DatePicker/MonthGrid.d.ts +2 -2
  94. package/components/DatePicker/MonthGrid.js +1 -1
  95. package/components/DatePicker/today.d.ts +15 -0
  96. package/components/DatePicker/today.js +17 -0
  97. package/components/DateRangePicker/DateRangePicker.d.ts +14 -1
  98. package/components/DateRangePicker/DateRangePicker.js +18 -7
  99. package/components/DescriptionList/DescriptionList.css +11 -0
  100. package/components/DescriptionList/DescriptionList.d.ts +5 -1
  101. package/components/DescriptionList/DescriptionList.js +21 -6
  102. package/components/Dialog/Dialog.css +9 -0
  103. package/components/Dialog/Dialog.d.ts +9 -0
  104. package/components/Dialog/Dialog.js +32 -19
  105. package/components/DocumentChip/DocumentChip.css +1 -1
  106. package/components/Drawer/Drawer.d.ts +9 -0
  107. package/components/Drawer/Drawer.js +8 -0
  108. package/components/Dropdown/Dropdown.css +3 -1
  109. package/components/Dropdown/Dropdown.js +8 -0
  110. package/components/EmptyState/EmptyState.css +8 -1
  111. package/components/EventCalendar/EventCalendar.css +12 -0
  112. package/components/Field/Field.css +2 -2
  113. package/components/FileInput/FileInput.css +1 -1
  114. package/components/FilterBar/FilterBar.d.ts +6 -1
  115. package/components/FunnelChart/FunnelChart.d.ts +7 -0
  116. package/components/FunnelChart/FunnelChart.js +44 -30
  117. package/components/GanttChart/GanttChart.css +10 -0
  118. package/components/GanttChart/GanttChart.d.ts +4 -0
  119. package/components/GanttChart/GanttChart.js +66 -33
  120. package/components/Gauge/Gauge.css +23 -0
  121. package/components/Gauge/Gauge.d.ts +4 -0
  122. package/components/Gauge/Gauge.js +14 -8
  123. package/components/ImageCompare/ImageCompare.js +2 -1
  124. package/components/Input/Input.css +15 -1
  125. package/components/Inspector/Inspector.css +4 -1
  126. package/components/List/List.css +1 -1
  127. package/components/NotificationCenter/NotificationCenter.css +152 -27
  128. package/components/NotificationCenter/NotificationCenter.d.ts +71 -8
  129. package/components/NotificationCenter/NotificationCenter.js +120 -13
  130. package/components/NumberInput/NumberInput.css +2 -0
  131. package/components/PageHeader/PageHeader.css +12 -4
  132. package/components/Panel/Panel.d.ts +1 -1
  133. package/components/Popover/Popover.css +3 -0
  134. package/components/Popover/Popover.d.ts +1 -1
  135. package/components/Popover/Popover.js +9 -1
  136. package/components/Prose/Prose.css +1 -1
  137. package/components/QuestionCard/QuestionCard.css +7 -4
  138. package/components/RadioButton/RadioButton.css +1 -1
  139. package/components/RadioButton/RadioButton.d.ts +4 -2
  140. package/components/RadioButton/RadioButton.js +5 -2
  141. package/components/ResourceTimeline/ResourceTimeline.css +12 -0
  142. package/components/ResourceTimeline/ResourceTimeline.d.ts +5 -1
  143. package/components/ResourceTimeline/ResourceTimeline.js +94 -52
  144. package/components/RichDropdown/RichDropdown.css +3 -1
  145. package/components/SegmentedControl/SegmentedControl.css +5 -0
  146. package/components/SelectionCard/SelectionCard.css +29 -0
  147. package/components/SelectionCard/SelectionCard.d.ts +7 -0
  148. package/components/SelectionCard/SelectionCard.js +25 -2
  149. package/components/Sparkline/Sparkline.css +20 -0
  150. package/components/Sparkline/Sparkline.d.ts +4 -0
  151. package/components/Sparkline/Sparkline.js +14 -8
  152. package/components/Stat/Stat.css +39 -0
  153. package/components/Stat/Stat.d.ts +23 -2
  154. package/components/Stat/Stat.js +21 -6
  155. package/components/Table/Table.css +106 -16
  156. package/components/Table/Table.d.ts +4 -0
  157. package/components/Table/Table.js +43 -28
  158. package/components/Textarea/Textarea.css +4 -2
  159. package/components/ThemeToggle/colorMode.d.ts +13 -5
  160. package/components/ThemeToggle/colorMode.js +4 -2
  161. package/components/ThreadHistory/ThreadHistory.css +11 -0
  162. package/components/ThreadHistory/ThreadHistory.d.ts +5 -1
  163. package/components/ThreadHistory/ThreadHistory.js +6 -1
  164. package/components/ThreadPanel/ThreadPanel.d.ts +4 -0
  165. package/components/ThreadPanel/ThreadPanel.js +5 -1
  166. package/components/TimePicker/TimePicker.css +3 -1
  167. package/components/TimePicker/TimePicker.d.ts +4 -2
  168. package/components/TimePicker/TimePicker.js +11 -3
  169. package/components/Timeline/Timeline.css +15 -0
  170. package/components/Timeline/Timeline.d.ts +8 -0
  171. package/components/Timeline/Timeline.js +21 -0
  172. package/components/Toast/Toast.css +16 -0
  173. package/components/Toast/Toast.d.ts +7 -2
  174. package/components/ToggleGroup/ToggleGroup.css +28 -2
  175. package/components/ToggleSwitch/ToggleSwitch.css +1 -1
  176. package/components/Toolbar/Toolbar.d.ts +6 -1
  177. package/components/Tooltip/Tooltip.d.ts +9 -0
  178. package/components/Tooltip/Tooltip.js +34 -8
  179. package/components/TreeView/TreeView.css +12 -0
  180. package/components/TreeView/TreeView.d.ts +4 -0
  181. package/components/TreeView/TreeView.js +20 -0
  182. package/components/UsageCard/UsageCard.css +11 -0
  183. package/components/UsageCard/UsageCard.d.ts +4 -0
  184. package/components/UsageCard/UsageCard.js +25 -16
  185. package/components/Widget/Widget.css +7 -0
  186. package/components/Widget/Widget.d.ts +4 -0
  187. package/components/Widget/Widget.js +14 -2
  188. package/components/Wizard/Wizard.d.ts +8 -3
  189. package/components/Wizard/Wizard.js +4 -1
  190. package/components/registry.json +15 -6
  191. package/components/registry.json.d.ts +15 -6
  192. package/components/registry.json.js +1 -1
  193. package/package.json +7 -2
  194. package/tokens/presets/contrast.css +4 -4
  195. package/tokens/presets/coral.css +3 -4
  196. package/tokens/presets/forest.css +16 -4
  197. package/tokens/presets/gold.css +4 -3
  198. package/tokens/presets/marquee.css +2 -3
  199. package/tokens/presets/mono.css +28 -28
  200. package/tokens/presets/pink.css +5 -4
  201. package/tokens/presets/terminal.css +4 -3
  202. package/tokens/presets/violet.css +3 -4
  203. package/tokens/presets/warm.css +16 -4
  204. package/tokens/presets/zest.css +11 -13
  205. package/tokens/registry.json +1 -0
  206. package/tokens/registry.json.d.ts +1 -0
  207. package/tokens/registry.json.js +1 -1
  208. package/tokens/tokens-dark.css +4 -0
  209. package/tokens/tokens-light.css +4 -0
  210. package/tokens/values.d.ts +24 -4
  211. package/tokens/values.js +25 -6
  212. package/tokens/values.json.js +1 -1
@@ -1,15 +1,18 @@
1
1
  "use client";
2
2
  import { jsxs, jsx } from "react/jsx-runtime";
3
- import React, { useState, useId } from "react";
3
+ import React, { useRef, useState, useEffect, useId, useLayoutEffect } from "react";
4
+ import { MOTION_EXIT_SYNC_MS } from "../../tokens/motion.js";
4
5
  import { EmptyState } from "../EmptyState/EmptyState.js";
5
6
  import { Badge } from "../Badge/Badge.js";
6
7
  import { Button } from "../Button/Button.js";
8
+ import { Icon } from "../Icon/Icon.js";
7
9
  import { IconButton } from "../IconButton/IconButton.js";
8
10
  import { Tabs } from "../Tabs/Tabs.js";
9
11
  import { DropdownMenu } from "../DropdownMenu/DropdownMenu.js";
10
12
  import "./NotificationCenter.css";
11
13
  import "../../behaviors/visually-hidden.css";
12
14
  import "../../fonts/material-symbols.css";
15
+ import { Skeleton } from "../Skeleton/Skeleton.js";
13
16
  import { useLocale } from "../../behaviors/LocaleProvider.js";
14
17
  import { useLinkComponent } from "../../behaviors/LinkProvider.js";
15
18
  const NotificationItem = React.forwardRef(
@@ -23,7 +26,14 @@ const NotificationItem = React.forwardRef(
23
26
  onSelect,
24
27
  href,
25
28
  onDismiss,
26
- dismissLabel = (itemTitle) => `Dismiss ${itemTitle}`,
29
+ dismissItemLabel = "Dismiss",
30
+ dismissLabel: _dismissLabel,
31
+ onMarkRead,
32
+ markReadLabel = "Mark as read",
33
+ onMarkUnread,
34
+ markUnreadLabel = "Mark as unread",
35
+ menuItems = [],
36
+ optionsLabel = (itemTitle) => `Options for ${itemTitle}`,
27
37
  linkComponent,
28
38
  className = "",
29
39
  children,
@@ -32,15 +42,59 @@ const NotificationItem = React.forwardRef(
32
42
  const baseClass = "ds-notification-item";
33
43
  const Link = useLinkComponent(linkComponent);
34
44
  const interactive = Boolean(href || onSelect);
35
- const classes = [baseClass, unread ? `${baseClass}--unread` : "", interactive ? `${baseClass}--interactive` : "", className].filter(Boolean).join(" ");
36
- return /* @__PURE__ */ jsxs("article", { ...rest, ref, className: classes, children: [
37
- media && /* @__PURE__ */ jsx("span", { className: `${baseClass}__media`, "aria-hidden": "true", children: typeof media === "string" ? /* @__PURE__ */ jsx("span", { className: "material-symbols-rounded", children: media }) : media }),
45
+ const rowRef = useRef(null);
46
+ const setRowRef = (node) => {
47
+ rowRef.current = node;
48
+ if (typeof ref === "function") ref(node);
49
+ else if (ref) ref.current = node;
50
+ };
51
+ const [leaving, setLeaving] = useState(false);
52
+ const leaveTimer = useRef(void 0);
53
+ useEffect(() => () => clearTimeout(leaveTimer.current), []);
54
+ const dismiss = () => {
55
+ if (!onDismiss || leaving) return;
56
+ const row = rowRef.current;
57
+ if (row) row.style.setProperty("--ds-notification-item-height", `${row.offsetHeight}px`);
58
+ setLeaving(true);
59
+ leaveTimer.current = setTimeout(onDismiss, MOTION_EXIT_SYNC_MS);
60
+ };
61
+ const lead = [
62
+ ...unread && onMarkRead ? [{ label: markReadLabel, icon: "mark_email_read", onClick: onMarkRead }] : [],
63
+ ...!unread && onMarkUnread ? [{ label: markUnreadLabel, icon: "mark_email_unread", onClick: onMarkUnread }] : [],
64
+ ...menuItems
65
+ ];
66
+ const options = [
67
+ ...lead,
68
+ ...onDismiss ? [
69
+ ...lead.length > 0 ? [{ type: "separator" }] : [],
70
+ { label: dismissItemLabel, icon: "close", onClick: dismiss }
71
+ ] : []
72
+ ];
73
+ const hasOptions = options.length > 0;
74
+ const classes = [baseClass, unread ? `${baseClass}--unread` : "", interactive ? `${baseClass}--interactive` : "", leaving ? `${baseClass}--leaving` : "", className].filter(Boolean).join(" ");
75
+ return /* @__PURE__ */ jsxs("article", { ...rest, ref: setRowRef, className: classes, children: [
76
+ media && /* @__PURE__ */ jsx("span", { className: `${baseClass}__media`, "aria-hidden": "true", children: typeof media === "string" ? /* @__PURE__ */ jsx(Icon, { name: media, size: "500", tile: true }) : media }),
38
77
  /* @__PURE__ */ jsxs("div", { className: `${baseClass}__body`, children: [
39
78
  /* @__PURE__ */ jsxs("div", { className: `${baseClass}__top`, children: [
40
- href ? /* @__PURE__ */ jsx(Link, { href, className: `${baseClass}__title ${baseClass}__open`, onClick: onSelect, children: title }) : onSelect ? /* @__PURE__ */ jsx("button", { type: "button", className: `${baseClass}__title ${baseClass}__open`, onClick: onSelect, children: title }) : /* @__PURE__ */ jsx("span", { className: `${baseClass}__title`, children: title }),
41
- onDismiss && /* @__PURE__ */ jsx("span", { className: `${baseClass}__dismiss`, children: /* @__PURE__ */ jsx(IconButton, { icon: "close", label: dismissLabel(title), variant: "tertiary", size: "compact", onClick: onDismiss }) }),
42
- time && /* @__PURE__ */ jsx("span", { className: `${baseClass}__time`, children: time }),
43
- unread && /* @__PURE__ */ jsx("span", { className: `${baseClass}__dot`, children: /* @__PURE__ */ jsx("span", { className: "ds-visually-hidden", children: unreadLabel }) })
79
+ href ? /* @__PURE__ */ jsx(Link, { href, className: `${baseClass}__title ${baseClass}__open`, title, onClick: onSelect, children: title }) : onSelect ? /* @__PURE__ */ jsx("button", { type: "button", className: `${baseClass}__title ${baseClass}__open`, title, onClick: onSelect, children: title }) : /* @__PURE__ */ jsx("span", { className: `${baseClass}__title`, title, children: title }),
80
+ (hasOptions || time || unread) && /* @__PURE__ */ jsxs("span", { className: `${baseClass}__end`, children: [
81
+ hasOptions && /* @__PURE__ */ jsx(
82
+ "span",
83
+ {
84
+ className: `${baseClass}__dismiss${time || unread ? ` ${baseClass}__dismiss--over` : ""}`,
85
+ children: /* @__PURE__ */ jsx(
86
+ DropdownMenu,
87
+ {
88
+ align: "end",
89
+ items: options,
90
+ trigger: /* @__PURE__ */ jsx(IconButton, { icon: "more_horiz", label: optionsLabel(title), variant: "tertiary", size: "compact" })
91
+ }
92
+ )
93
+ }
94
+ ),
95
+ time && /* @__PURE__ */ jsx("span", { className: `${baseClass}__time`, children: time }),
96
+ unread && /* @__PURE__ */ jsx("span", { className: `${baseClass}__dot`, children: /* @__PURE__ */ jsx("span", { className: "ds-visually-hidden", children: unreadLabel }) })
97
+ ] })
44
98
  ] }),
45
99
  children && /* @__PURE__ */ jsx("div", { className: `${baseClass}__text`, children }),
46
100
  actions && /* @__PURE__ */ jsx("div", { className: `${baseClass}__actions`, children: actions })
@@ -49,6 +103,11 @@ const NotificationItem = React.forwardRef(
49
103
  }
50
104
  );
51
105
  NotificationItem.displayName = "NotificationItem";
106
+ const LOADING_ROW_WIDTHS = [
107
+ ["58%", "82%"],
108
+ ["46%", "70%"],
109
+ ["64%", "76%"]
110
+ ];
52
111
  const NotificationCenter = React.forwardRef(
53
112
  ({
54
113
  title = "Notifications",
@@ -57,6 +116,8 @@ const NotificationCenter = React.forwardRef(
57
116
  tabsLabel,
58
117
  onMarkAllRead,
59
118
  markAllLabel = "Mark all as read",
119
+ onMarkAllUnread,
120
+ markAllUnreadLabel = "Mark all as unread",
60
121
  onClearAll,
61
122
  clearAllLabel = "Clear all",
62
123
  menuItems = [],
@@ -75,6 +136,10 @@ const NotificationCenter = React.forwardRef(
75
136
  seeAllLabel = "See all",
76
137
  linkComponent,
77
138
  locale: localeProp,
139
+ maxVisibleItems = 6,
140
+ roundMarks = true,
141
+ loading = false,
142
+ loadingLabel = "Loading",
78
143
  className = "",
79
144
  children,
80
145
  ...rest
@@ -97,19 +162,46 @@ const NotificationCenter = React.forwardRef(
97
162
  onTabChange?.(next);
98
163
  };
99
164
  const hasItems = React.Children.count(children) > 0;
165
+ const listRef = useRef(null);
166
+ useLayoutEffect(() => {
167
+ const list = listRef.current;
168
+ if (!list) return;
169
+ const measure = () => {
170
+ const rows = list.querySelectorAll(":scope > .ds-notification-item");
171
+ if (loading || !(maxVisibleItems >= 1) || rows.length <= maxVisibleItems) {
172
+ list.style.maxHeight = "";
173
+ return;
174
+ }
175
+ const last = rows[Math.floor(maxVisibleItems) - 1];
176
+ const inset = parseFloat(getComputedStyle(list).paddingBottom) || 0;
177
+ const height = last.getBoundingClientRect().bottom - list.getBoundingClientRect().top + list.scrollTop + inset;
178
+ list.style.maxHeight = `${Math.ceil(height)}px`;
179
+ };
180
+ measure();
181
+ if (typeof ResizeObserver === "undefined") return;
182
+ let width = list.clientWidth;
183
+ const observer = new ResizeObserver(() => {
184
+ if (list.clientWidth === width) return;
185
+ width = list.clientWidth;
186
+ measure();
187
+ });
188
+ observer.observe(list);
189
+ return () => observer.disconnect();
190
+ });
100
191
  const options = [
101
192
  ...onMarkAllRead ? [{ label: markAllLabel, icon: "done_all", onClick: onMarkAllRead, disabled: unreadCount === 0 }] : [],
193
+ ...onMarkAllUnread ? [{ label: markAllUnreadLabel, icon: "mark_email_unread", onClick: onMarkAllUnread, disabled: !hasItems }] : [],
102
194
  ...menuItems,
103
195
  ...onClearAll ? [
104
- ...onMarkAllRead || menuItems.length > 0 ? [{ type: "separator" }] : [],
196
+ ...onMarkAllRead || onMarkAllUnread || menuItems.length > 0 ? [{ type: "separator" }] : [],
105
197
  { label: clearAllLabel, icon: "delete_sweep", onClick: onClearAll, destructive: true, disabled: !hasItems }
106
198
  ] : []
107
199
  ];
108
- const classes = [baseClass, className].filter(Boolean).join(" ");
200
+ const classes = [baseClass, roundMarks ? `${baseClass}--round-marks` : "", className].filter(Boolean).join(" ");
109
201
  return /* @__PURE__ */ jsxs("section", { ...rest, ref, className: classes, children: [
110
202
  /* @__PURE__ */ jsxs("header", { className: `${baseClass}__header`, children: [
111
203
  /* @__PURE__ */ jsxs("div", { className: `${baseClass}__heading`, children: [
112
- /* @__PURE__ */ jsx("span", { className: `${baseClass}__title`, children: title }),
204
+ /* @__PURE__ */ jsx("span", { className: `${baseClass}__title`, title, children: title }),
113
205
  /* @__PURE__ */ jsx("span", { className: hasTabs ? "ds-visually-hidden" : `${baseClass}__unread`, "aria-live": "polite", children: unreadCount !== void 0 && unreadCount > 0 ? hasTabs ? unreadCountLabel(unreadCount) : /* @__PURE__ */ jsx(Badge, { variant: "info", label: unreadCountLabel(unreadCount) }) : null })
114
206
  ] }),
115
207
  options.length > 0 ? /* @__PURE__ */ jsx(
@@ -139,11 +231,26 @@ const NotificationCenter = React.forwardRef(
139
231
  /* @__PURE__ */ jsx(
140
232
  "div",
141
233
  {
234
+ ref: listRef,
142
235
  className: `${baseClass}__list`,
143
236
  role: hasTabs ? "tabpanel" : void 0,
144
237
  id: hasTabs ? panelId : void 0,
145
238
  "aria-label": hasTabs && activeTabIndex >= 0 ? tabs[activeTabIndex].label : void 0,
146
- children: hasItems ? children : emptyState ?? /* @__PURE__ */ jsx(
239
+ "aria-busy": loading || void 0,
240
+ children: loading ? LOADING_ROW_WIDTHS.map(([titleWidth, bodyWidth], index) => /* @__PURE__ */ jsxs("div", { className: "ds-notification-item ds-notification-item--loading", children: [
241
+ /* @__PURE__ */ jsx("span", { className: "ds-notification-item__media", children: /* @__PURE__ */ jsx(Skeleton, { variant: "circular", "aria-hidden": "true" }) }),
242
+ /* @__PURE__ */ jsxs("div", { className: `${baseClass}__placeholder`, children: [
243
+ /* @__PURE__ */ jsx(
244
+ Skeleton,
245
+ {
246
+ variant: "text",
247
+ width: titleWidth,
248
+ ...index === 0 ? { loadingLabel } : { "aria-hidden": true }
249
+ }
250
+ ),
251
+ /* @__PURE__ */ jsx(Skeleton, { variant: "text", width: bodyWidth, "aria-hidden": "true" })
252
+ ] })
253
+ ] }, index)) : hasItems ? children : emptyState ?? /* @__PURE__ */ jsx(
147
254
  EmptyState,
148
255
  {
149
256
  icon: "notifications",
@@ -119,7 +119,9 @@
119
119
  ERROR STATE
120
120
  ============================================ */
121
121
 
122
+ /* The hover rule above is more specific, so the error border names it too. */
122
123
  .ds-numberinput--error .ds-numberinput__shell,
124
+ .ds-numberinput--error .ds-numberinput__shell:hover:not(:focus-within),
123
125
  .ds-numberinput--error .ds-numberinput__shell:focus-within {
124
126
  border-color: var(--color-status-error-border);
125
127
  }
@@ -66,15 +66,23 @@
66
66
  align-items: stretch;
67
67
  }
68
68
 
69
- .ds-page-header__actions {
70
- justify-content: stretch;
71
- }
72
-
73
69
  /* Each action starts at its own width and grows to share the row, so a
74
70
  label never squeezes: actions that cannot fit side by side wrap. */
75
71
  .ds-page-header__actions > * {
76
72
  flex: 1 1 auto;
77
73
  }
74
+
75
+ /* An action inside a Tooltip grows with its wrapper, or the wrapper
76
+ takes the room and the button sits at one end of it. */
77
+ .ds-page-header__actions > .ds-tooltip > .ds-button {
78
+ flex: 1 1 auto;
79
+ }
80
+
81
+ /* An icon-only action keeps its own box: the labelled ones share the row. */
82
+ .ds-page-header__actions > .ds-icon-button,
83
+ .ds-page-header__actions > .ds-tooltip:has(> .ds-icon-button) {
84
+ flex: 0 0 auto;
85
+ }
78
86
  }
79
87
 
80
88
  } /* @layer rift.components */
@@ -3,7 +3,7 @@ import { default as React } from 'react';
3
3
  type PanelOwnProps = {
4
4
  /** Interior padding: 'default' uses --padding-500, 'compact' uses --padding-400, 'none' removes it */
5
5
  padding?: 'default' | 'compact' | 'none';
6
- /** Draws the container border the Widget tile wears, so the panel keeps a visible edge in a theme whose page fill matches the panel's. */
6
+ /** Draws the container border the Widget tile wears. Pass it whenever the panel sits on a surface of its own fill, such as an app's content surface or a theme whose page matches the panel, so a KPI tile or a chart card keeps a visible edge. */
7
7
  bordered?: boolean;
8
8
  /** Additional CSS classes */
9
9
  className?: string;
@@ -28,6 +28,9 @@
28
28
  .ds-popover__panel {
29
29
  z-index: var(--layer-dropdown);
30
30
  min-width: 200px;
31
+ /* Never wider than the screen less the margin it keeps on both sides: a
32
+ wider panel cannot be shifted back into view, and ran off the far edge. */
33
+ max-width: calc(100vw - 2 * var(--gap-200));
31
34
  padding: var(--padding-400); /* 16px */
32
35
  border: var(--border-025) solid var(--color-bg-container-border);
33
36
  border-radius: var(--radius-200); /* 8px */
@@ -30,7 +30,7 @@ type PopoverOwnProps = {
30
30
  /** Callback when open state changes */
31
31
  onOpenChange?: (open: boolean) => void;
32
32
  /**
33
- * Legacy accessible-name prop for the trigger and the panel. A native `aria-label` wins when both are passed, and names those two rather than the wrapper; with neither, the panel is named "Popover".
33
+ * Legacy accessible-name prop for the trigger and the panel. A native `aria-label` wins when both are passed, and names those two rather than the wrapper; a trigger whose own label, `aria-label` or text is not part of it keeps its own name, and the label names the panel alone. With neither, the panel is named "Popover".
34
34
  *
35
35
  * @deprecated Pass the native `aria-label` attribute instead.
36
36
  */
@@ -7,6 +7,14 @@ import { MOTION_HOVER_HIDE_DELAY_MS } from "../../tokens/motion.js";
7
7
  import "./Popover.css";
8
8
  const INTERACTIVE_TAGS = /* @__PURE__ */ new Set(["button", "a", "input", "select", "textarea", "summary"]);
9
9
  const canCarryPopoverSemantics = (el) => typeof el.type === "string" ? INTERACTIVE_TAGS.has(el.type) : true;
10
+ const keepsOwnName = (el, popoverLabel) => {
11
+ const props = el.props;
12
+ const own = [props.label, props["aria-label"], props.children].find(
13
+ (value) => typeof value === "string" && value.trim() !== "" || typeof value === "number"
14
+ );
15
+ if (own === void 0) return false;
16
+ return !popoverLabel.toLowerCase().includes(String(own).trim().toLowerCase());
17
+ };
10
18
  const Popover = React.forwardRef(
11
19
  ({
12
20
  children,
@@ -102,7 +110,7 @@ const Popover = React.forwardRef(
102
110
  /* @__PURE__ */ jsx("div", { ref: triggerRef, className: `${baseClass}__trigger`, onClick: handleClick, children: React.isValidElement(children) && canCarryPopoverSemantics(children) ? React.cloneElement(children, {
103
111
  "aria-expanded": isOpen,
104
112
  "aria-haspopup": "dialog",
105
- ...ariaLabel ? { "aria-label": ariaLabel } : {}
113
+ ...ariaLabel && !keepsOwnName(children, ariaLabel) ? { "aria-label": ariaLabel } : {}
106
114
  }) : trigger === "click" ? /* @__PURE__ */ jsx(
107
115
  "button",
108
116
  {
@@ -247,7 +247,7 @@
247
247
  border-collapse: separate;
248
248
  border-spacing: 0;
249
249
  border: var(--border-025) solid var(--color-table-border);
250
- border-radius: var(--radius-300);
250
+ border-radius: var(--radius-600);
251
251
  background-color: var(--color-table-body-bg);
252
252
  }
253
253
 
@@ -335,10 +335,13 @@ button.ds-question-card__option--chosen:hover {
335
335
  color: var(--color-text-tertiary);
336
336
  }
337
337
 
338
- /* On a bubble's fill the tertiary ink sits too close to the surface; the
339
- secondary keeps the prompt quiet and legible. */
340
- .ds-question-summary--plain .ds-question-summary__prompt {
341
- color: var(--color-text-secondary);
338
+ /* Plain sits on a surface that brings its own fill and ink, and a theme
339
+ may make that fill a colour the page's text ramp was never measured
340
+ against. So the quiet lines are the surface's own ink, stepped back,
341
+ and stay legible on any bubble. */
342
+ .ds-question-summary--plain .ds-question-summary__prompt,
343
+ .ds-question-summary--plain .ds-question-summary__answer--missing {
344
+ color: color-mix(in srgb, currentColor 84%, transparent);
342
345
  }
343
346
 
344
347
  .ds-question-summary__answer {
@@ -147,7 +147,7 @@
147
147
  }
148
148
 
149
149
  .ds-radio--error .ds-radio__helper {
150
- color: var(--color-status-error-border);
150
+ color: var(--color-text-error);
151
151
  }
152
152
 
153
153
  /* ============================================
@@ -48,10 +48,12 @@ export declare const RadioButton: React.ForwardRefExoticComponent<RadioButtonPro
48
48
  type RadioGroupOwnProps = {
49
49
  /** Group label */
50
50
  label?: string;
51
- /** Helper or error message rendered below the group */
51
+ /** Helper text rendered below the group. With the older `error` flag and no `errorText`, it doubles as the error message. */
52
52
  helperText?: string;
53
- /** Error state — recolours the helper text and marks the group invalid */
53
+ /** Error state: marks the group invalid and, in the older form without `errorText`, recolours the helper text as the error message. */
54
54
  error?: boolean;
55
+ /** The error message, shown under the group while the helper text keeps its place. Setting it marks the group invalid; Field's spec owns the wiring. */
56
+ errorText?: React.ReactNode;
55
57
  /** Marks the group required and renders the required marker on its label */
56
58
  required?: boolean;
57
59
  /**
@@ -82,6 +82,7 @@ const RadioGroup = React.forwardRef(
82
82
  label,
83
83
  helperText,
84
84
  error = false,
85
+ errorText,
85
86
  required = false,
86
87
  value: valueProp,
87
88
  defaultValue,
@@ -102,7 +103,8 @@ const RadioGroup = React.forwardRef(
102
103
  const generatedId = useId();
103
104
  const groupId = id || generatedId;
104
105
  const labelId = label ? `${groupId}-label` : void 0;
105
- const describedBy = helperText ? `${groupId}-helper` : rest["aria-describedby"];
106
+ const hasErrorText = errorText != null && errorText !== false && errorText !== "";
107
+ const describedBy = [hasErrorText ? `${groupId}-error` : void 0, helperText ? `${groupId}-helper` : void 0].filter(Boolean).join(" ") || rest["aria-describedby"];
106
108
  const handleSelect = (next) => {
107
109
  if (!isControlled) setInternalValue(next);
108
110
  onValueChange?.(next);
@@ -132,13 +134,14 @@ const RadioGroup = React.forwardRef(
132
134
  group: true,
133
135
  label,
134
136
  helperText,
137
+ errorText,
135
138
  error,
136
139
  required,
137
140
  id: groupId,
138
141
  role: "radiogroup",
139
142
  "aria-labelledby": labelId,
140
143
  "aria-describedby": describedBy,
141
- "aria-invalid": error || void 0,
144
+ "aria-invalid": error || hasErrorText || void 0,
142
145
  children: /* @__PURE__ */ jsx("div", { className: `${baseClass}__options`, onKeyDown: handleOptionsKeyDown, children: options.map((option) => /* @__PURE__ */ jsx(
143
146
  RadioButton,
144
147
  {
@@ -197,4 +197,16 @@ button.ds-resource-timeline__bar:focus-visible {
197
197
  --ds-resource-timeline-accent: var(--color-core-accent-mint);
198
198
  }
199
199
 
200
+ /* Loading: the hour grid stays, and each row holds placeholder bars where
201
+ bookings will sit, in the Skeleton fill with no accent edge. */
202
+
203
+ .ds-resource-timeline__bar.ds-resource-timeline__bar--loading {
204
+ position: absolute;
205
+ display: block;
206
+ height: auto;
207
+ padding: 0;
208
+ border: 0;
209
+ background-color: var(--color-bg-container-secondary);
210
+ }
211
+
200
212
  } /* @layer rift.components */
@@ -41,6 +41,10 @@ type ResourceTimelineOwnProps = {
41
41
  onBarClick?: (bar: ResourceTimelineBar, row: ResourceTimelineRow) => void;
42
42
  /** The BCP 47 locale the times are written in, such as `de-DE`. Defaults to `en-US`. This component can render from a Server Component, so it takes the prop alone and reads no LocaleProvider. */
43
43
  locale?: string;
44
+ /** Holds placeholder rows, a label line beside placeholder bars on the hour grid, while the rows are being fetched: as many as `rows` holds, or four when it is empty. The axis stays. */
45
+ loading?: boolean;
46
+ /** Accessible name announced while `loading`. */
47
+ loadingLabel?: string;
44
48
  /** Additional CSS classes */
45
49
  className?: string;
46
50
  };
@@ -53,5 +57,5 @@ export interface ResourceTimelineProps extends ResourceTimelineOwnProps, Omit<Re
53
57
  * and its label sits on the calendar's event fill, so it reads in every
54
58
  * theme whatever the accent. Server-renderable.
55
59
  */
56
- export declare function ResourceTimeline({ rows, startHour, endHour, now, label, rowHeaderLabel, onBarClick, locale, className, style, ref, ...rest }: ResourceTimelineProps): React.JSX.Element;
60
+ export declare function ResourceTimeline({ rows, startHour, endHour, now, label, rowHeaderLabel, onBarClick, locale, loading, loadingLabel, className, style, ref, ...rest }: ResourceTimelineProps): React.JSX.Element;
57
61
  export {};
@@ -4,7 +4,14 @@ import { DEFAULT_LOCALE, plainSpaces } from "../../behaviors/locale.js";
4
4
  import { ScrollRegion } from "../../behaviors/ScrollRegion.js";
5
5
  import "../../behaviors/visually-hidden.css";
6
6
  import "../../behaviors/direction.css";
7
+ import { Skeleton } from "../Skeleton/Skeleton.js";
7
8
  import "./ResourceTimeline.css";
9
+ const LOADING_BARS = [
10
+ [[6, 26], [48, 18]],
11
+ [[22, 34]],
12
+ [[10, 16], [38, 30]],
13
+ [[30, 22], [64, 20]]
14
+ ];
8
15
  const minutesOf = (time) => {
9
16
  const match = /^(\d{1,2}):(\d{2})$/.exec(time);
10
17
  if (!match) return null;
@@ -19,6 +26,8 @@ function ResourceTimeline({
19
26
  rowHeaderLabel = "Name",
20
27
  onBarClick,
21
28
  locale = DEFAULT_LOCALE,
29
+ loading = false,
30
+ loadingLabel = "Loading",
22
31
  className = "",
23
32
  style,
24
33
  ref,
@@ -64,62 +73,95 @@ function ResourceTimeline({
64
73
  h
65
74
  )) })
66
75
  ] }),
67
- /* @__PURE__ */ jsx("ul", { className: "ds-resource-timeline__rows", children: rows.map((row) => /* @__PURE__ */ jsxs("li", { className: "ds-resource-timeline__row", children: [
68
- /* @__PURE__ */ jsx("span", { className: "ds-resource-timeline__label", children: row.label }),
69
- /* @__PURE__ */ jsxs("div", { className: "ds-resource-timeline__track", children: [
70
- hours.map((h) => /* @__PURE__ */ jsx(
71
- "span",
76
+ /* @__PURE__ */ jsxs("ul", { className: "ds-resource-timeline__rows", "aria-busy": loading || void 0, children: [
77
+ loading && Array.from({ length: rows.length || 4 }, (_, index) => /* @__PURE__ */ jsxs("li", { className: "ds-resource-timeline__row ds-resource-timeline__row--loading", children: [
78
+ /* @__PURE__ */ jsx("span", { className: "ds-resource-timeline__label", children: /* @__PURE__ */ jsx(
79
+ Skeleton,
72
80
  {
73
- className: "ds-resource-timeline__gridline",
74
- style: { insetInlineStart: `${at(h * 60)}%` },
75
- "aria-hidden": "true"
76
- },
77
- h
78
- )),
79
- nowMinutes !== null && nowMinutes >= from && nowMinutes <= to && /* @__PURE__ */ jsx(
80
- "span",
81
- {
82
- className: "ds-resource-timeline__now",
83
- style: { insetInlineStart: `${at(nowMinutes)}%` },
84
- "aria-hidden": "true"
81
+ variant: "text",
82
+ width: "70%",
83
+ ...index === 0 ? { loadingLabel } : { "aria-hidden": true }
85
84
  }
86
- ),
87
- row.bars.map((bar) => {
88
- const start = minutesOf(bar.start);
89
- const end = minutesOf(bar.end);
90
- if (start === null || end === null || end <= start)
91
- return null;
92
- const name = `${row.label}, ${bar.label ? `${bar.label}, ` : ""}${range(start, end)}`;
93
- const barClass = `ds-resource-timeline__bar ds-resource-timeline__bar--${bar.color ?? "neutral"}`;
94
- const barStyle = {
95
- insetInlineStart: `${at(start)}%`,
96
- inlineSize: `${at(end) - at(start)}%`
97
- };
98
- const content = /* @__PURE__ */ jsxs(Fragment, { children: [
99
- /* @__PURE__ */ jsx(
100
- "span",
101
- {
102
- className: "ds-resource-timeline__bar-label",
103
- "aria-hidden": "true",
104
- children: bar.label ?? range(start, end)
105
- }
106
- ),
107
- /* @__PURE__ */ jsx("span", { className: "ds-visually-hidden", children: name })
108
- ] });
109
- return onBarClick ? /* @__PURE__ */ jsx(
110
- "button",
85
+ ) }),
86
+ /* @__PURE__ */ jsxs("div", { className: "ds-resource-timeline__track", children: [
87
+ hours.map((h) => /* @__PURE__ */ jsx(
88
+ "span",
89
+ {
90
+ className: "ds-resource-timeline__gridline",
91
+ style: { insetInlineStart: `${at(h * 60)}%` },
92
+ "aria-hidden": "true"
93
+ },
94
+ h
95
+ )),
96
+ LOADING_BARS[index % LOADING_BARS.length].map(([start, size]) => /* @__PURE__ */ jsx(
97
+ Skeleton,
111
98
  {
112
- type: "button",
113
- className: barClass,
114
- style: barStyle,
115
- onClick: () => onBarClick(bar, row),
116
- children: content
99
+ variant: "rectangular",
100
+ className: "ds-resource-timeline__bar ds-resource-timeline__bar--loading",
101
+ style: { insetInlineStart: `${start}%`, inlineSize: `${size}%` },
102
+ "aria-hidden": "true"
117
103
  },
118
- bar.id
119
- ) : /* @__PURE__ */ jsx("span", { className: barClass, style: barStyle, children: content }, bar.id);
120
- })
121
- ] })
122
- ] }, row.id)) })
104
+ start
105
+ ))
106
+ ] })
107
+ ] }, index)),
108
+ !loading && rows.map((row) => /* @__PURE__ */ jsxs("li", { className: "ds-resource-timeline__row", children: [
109
+ /* @__PURE__ */ jsx("span", { className: "ds-resource-timeline__label", children: row.label }),
110
+ /* @__PURE__ */ jsxs("div", { className: "ds-resource-timeline__track", children: [
111
+ hours.map((h) => /* @__PURE__ */ jsx(
112
+ "span",
113
+ {
114
+ className: "ds-resource-timeline__gridline",
115
+ style: { insetInlineStart: `${at(h * 60)}%` },
116
+ "aria-hidden": "true"
117
+ },
118
+ h
119
+ )),
120
+ nowMinutes !== null && nowMinutes >= from && nowMinutes <= to && /* @__PURE__ */ jsx(
121
+ "span",
122
+ {
123
+ className: "ds-resource-timeline__now",
124
+ style: { insetInlineStart: `${at(nowMinutes)}%` },
125
+ "aria-hidden": "true"
126
+ }
127
+ ),
128
+ row.bars.map((bar) => {
129
+ const start = minutesOf(bar.start);
130
+ const end = minutesOf(bar.end);
131
+ if (start === null || end === null || end <= start)
132
+ return null;
133
+ const name = `${row.label}, ${bar.label ? `${bar.label}, ` : ""}${range(start, end)}`;
134
+ const barClass = `ds-resource-timeline__bar ds-resource-timeline__bar--${bar.color ?? "neutral"}`;
135
+ const barStyle = {
136
+ insetInlineStart: `${at(start)}%`,
137
+ inlineSize: `${at(end) - at(start)}%`
138
+ };
139
+ const content = /* @__PURE__ */ jsxs(Fragment, { children: [
140
+ /* @__PURE__ */ jsx(
141
+ "span",
142
+ {
143
+ className: "ds-resource-timeline__bar-label",
144
+ "aria-hidden": "true",
145
+ children: bar.label ?? range(start, end)
146
+ }
147
+ ),
148
+ /* @__PURE__ */ jsx("span", { className: "ds-visually-hidden", children: name })
149
+ ] });
150
+ return onBarClick ? /* @__PURE__ */ jsx(
151
+ "button",
152
+ {
153
+ type: "button",
154
+ className: barClass,
155
+ style: barStyle,
156
+ onClick: () => onBarClick(bar, row),
157
+ children: content
158
+ },
159
+ bar.id
160
+ ) : /* @__PURE__ */ jsx("span", { className: barClass, style: barStyle, children: content }, bar.id);
161
+ })
162
+ ] })
163
+ ] }, row.id))
164
+ ] })
123
165
  ] })
124
166
  }
125
167
  );
@@ -222,7 +222,9 @@
222
222
  ERROR STATE
223
223
  ============================================ */
224
224
 
225
- .ds-rich-dropdown--error .ds-rich-dropdown__trigger {
225
+ /* The hover rule above is more specific, so the error border names it too. */
226
+ .ds-rich-dropdown--error .ds-rich-dropdown__trigger,
227
+ .ds-rich-dropdown--error .ds-rich-dropdown__trigger:hover:not(:focus-visible) {
226
228
  border-color: var(--color-status-error-border);
227
229
  }
228
230
 
@@ -23,6 +23,10 @@
23
23
  border-radius: calc(var(--radius-pill) + var(--padding-100) + var(--border-025));
24
24
  background-color: var(--color-bg-container-primary);
25
25
  border: var(--border-025) solid var(--color-bg-container-border);
26
+ /* A grid cell would stretch the track across its column and leave the
27
+ segments at one end: the control hugs its segments unless it is asked
28
+ to fill. */
29
+ justify-self: start;
26
30
  }
27
31
 
28
32
  /* ============================================
@@ -88,6 +92,7 @@
88
92
 
89
93
  .ds-segmented-control--full-width {
90
94
  width: 100%;
95
+ justify-self: stretch;
91
96
  }
92
97
 
93
98
  .ds-segmented-control--full-width .ds-segmented-control__segment {