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
@@ -4,6 +4,9 @@ import "./Table.css";
4
4
  import { ScrollRegion } from "../../behaviors/ScrollRegion.js";
5
5
  import "../../behaviors/visually-hidden.css";
6
6
  import { warnOnce } from "../../behaviors/devWarning.js";
7
+ import { Skeleton } from "../Skeleton/Skeleton.js";
8
+ const LOADING_ROWS = 5;
9
+ const LOADING_WIDTHS = ["72%", "48%", "84%", "60%"];
7
10
  const Table = React.forwardRef(
8
11
  ({
9
12
  columns,
@@ -17,6 +20,8 @@ const Table = React.forwardRef(
17
20
  outerControl = false,
18
21
  caption,
19
22
  captionHidden = false,
23
+ loading = false,
24
+ loadingLabel = "Loading",
20
25
  className = "",
21
26
  ...rest
22
27
  }, ref) => {
@@ -37,7 +42,7 @@ const Table = React.forwardRef(
37
42
  className
38
43
  ].filter(Boolean).join(" ");
39
44
  const outsideCaption = framed && caption && !captionHidden;
40
- const table = /* @__PURE__ */ jsxs("table", { ...rest, ref, className: classes, children: [
45
+ const table = /* @__PURE__ */ jsxs("table", { ...rest, ref, className: classes, "aria-busy": loading || void 0, children: [
41
46
  caption && /* @__PURE__ */ jsx(
42
47
  "caption",
43
48
  {
@@ -59,33 +64,43 @@ const Table = React.forwardRef(
59
64
  },
60
65
  col.key
61
66
  )) }) }),
62
- /* @__PURE__ */ jsx("tbody", { className: `${baseClass}__body`, children: rows.map((row) => /* @__PURE__ */ jsx(
63
- "tr",
64
- {
65
- className: [
66
- `${baseClass}__row`,
67
- row.selected ? `${baseClass}__row--selected` : "",
68
- row.variant && row.variant !== "default" ? `${baseClass}__row--${row.variant}` : ""
69
- ].filter(Boolean).join(" "),
70
- children: columns.map((col, index) => {
71
- const align = alignOf(col, index);
72
- const content = /* @__PURE__ */ jsx(
73
- "div",
74
- {
75
- className: `${baseClass}__cell-content${col.mono ? ` ${baseClass}__cell-content--mono` : ""}`,
76
- style: {
77
- // flex-start and flex-end follow the reading direction;
78
- // left and right stay on their screen side.
79
- justifyContent: align === "center" ? "center" : align === "end" ? "flex-end" : align === "left" || align === "right" ? align : "flex-start"
80
- },
81
- children: row.cells[col.key]
82
- }
83
- );
84
- return col.rowHeader ? /* @__PURE__ */ jsx("th", { className: `${baseClass}__cell ${baseClass}__cell--row-header`, scope: "row", children: content }, col.key) : /* @__PURE__ */ jsx("td", { className: `${baseClass}__cell`, children: content }, col.key);
85
- })
86
- },
87
- row.id
88
- )) })
67
+ /* @__PURE__ */ jsxs("tbody", { className: `${baseClass}__body`, children: [
68
+ loading && Array.from({ length: rows.length || LOADING_ROWS }, (_, rowIndex) => /* @__PURE__ */ jsx("tr", { className: `${baseClass}__row ${baseClass}__row--loading`, children: columns.map((col, index) => /* @__PURE__ */ jsx("td", { className: `${baseClass}__cell`, children: /* @__PURE__ */ jsx("div", { className: `${baseClass}__cell-content ${baseClass}__cell-content--loading`, children: /* @__PURE__ */ jsx(
69
+ Skeleton,
70
+ {
71
+ variant: "text",
72
+ width: LOADING_WIDTHS[(rowIndex + index) % LOADING_WIDTHS.length],
73
+ ...rowIndex === 0 && index === 0 ? { loadingLabel } : { "aria-hidden": true }
74
+ }
75
+ ) }) }, col.key)) }, rowIndex)),
76
+ !loading && rows.map((row) => /* @__PURE__ */ jsx(
77
+ "tr",
78
+ {
79
+ className: [
80
+ `${baseClass}__row`,
81
+ row.selected ? `${baseClass}__row--selected` : "",
82
+ row.variant && row.variant !== "default" ? `${baseClass}__row--${row.variant}` : ""
83
+ ].filter(Boolean).join(" "),
84
+ children: columns.map((col, index) => {
85
+ const align = alignOf(col, index);
86
+ const content = /* @__PURE__ */ jsx(
87
+ "div",
88
+ {
89
+ className: `${baseClass}__cell-content${col.mono ? ` ${baseClass}__cell-content--mono` : ""}`,
90
+ style: {
91
+ // flex-start and flex-end follow the reading direction;
92
+ // left and right stay on their screen side.
93
+ justifyContent: align === "center" ? "center" : align === "end" ? "flex-end" : align === "left" || align === "right" ? align : "flex-start"
94
+ },
95
+ children: row.cells[col.key]
96
+ }
97
+ );
98
+ return col.rowHeader ? /* @__PURE__ */ jsx("th", { className: `${baseClass}__cell ${baseClass}__cell--row-header`, scope: "row", children: content }, col.key) : /* @__PURE__ */ jsx("td", { className: `${baseClass}__cell`, children: content }, col.key);
99
+ })
100
+ },
101
+ row.id
102
+ ))
103
+ ] })
89
104
  ] });
90
105
  if (framed) {
91
106
  const region = /* @__PURE__ */ jsx(ScrollRegion, { className: `${baseClass}__wrapper`, children: table });
@@ -73,7 +73,9 @@
73
73
  ERROR STATE
74
74
  ============================================ */
75
75
 
76
- .ds-textarea--error .ds-textarea__field {
76
+ /* The hover rule above is more specific, so the error border names it too. */
77
+ .ds-textarea--error .ds-textarea__field,
78
+ .ds-textarea--error .ds-textarea__field:hover:not(:focus):not(:disabled) {
77
79
  border-color: var(--color-status-error-border);
78
80
  }
79
81
 
@@ -82,7 +84,7 @@
82
84
  }
83
85
 
84
86
  .ds-textarea--error .ds-textarea__counter {
85
- color: var(--color-status-error-border);
87
+ color: var(--color-text-error);
86
88
  }
87
89
 
88
90
  /* ============================================
@@ -38,22 +38,30 @@ export type ColorModeScriptOptions = ColorModeOptions & {
38
38
  * The localStorage key a host keeps its chosen theme under, as a preset id
39
39
  * (`plum`, from `SHIPPED_THEMES` in `rift-ds/tokens/values`). When set, the
40
40
  * script also applies it as `data-brand` on `<html>` before first paint, so a
41
- * returning visitor never sees the default theme flash first; an empty
42
- * value, the base theme's id or a value that is not an id leaves the
43
- * attribute as the layout rendered it. The host writes the key when the
41
+ * returning visitor never sees the default theme flash first; the base
42
+ * theme's id removes the attribute, and an empty value or a value that is
43
+ * not an id leaves it as the layout rendered it. The host writes the key when the
44
44
  * visitor picks a theme. Unset by default: the script then never touches
45
45
  * `data-brand`.
46
46
  */
47
47
  brandStorageKey?: string;
48
48
  /** The base theme's id, which applies by removing `data-brand` rather than setting it. Defaults to `tide`, the value of `BASE_THEME_ID` in `rift-ds/tokens/values`. */
49
49
  baseThemeId?: string;
50
+ /**
51
+ * The mode a first-time visitor opens in, before they have chosen one:
52
+ * `dark` for a dark-first app, `light` to ignore the operating system.
53
+ * It applies only while nothing is stored, so a visitor's own choice
54
+ * (`system` included) always wins. Default `system`.
55
+ */
56
+ defaultMode?: ColorModeSetting;
50
57
  };
51
58
  /**
52
59
  * The script that applies the stored choice before first paint: it sets
53
60
  * `data-theme-setting` and `data-theme` on `<html>` and, while the setting
54
61
  * is `system`, keeps `data-theme` following the operating system. Render it
55
62
  * inline in the document head, before anything paints. Storage being
56
- * unavailable (a private window) leaves the page on `system`.
63
+ * unavailable (a private window) leaves the page on `system`, or on
64
+ * `defaultMode` when one is given.
57
65
  *
58
66
  * It also puts the choice back when React wipes it. A hydration failure that
59
67
  * reaches the root (a browser extension editing the page before hydration
@@ -65,4 +73,4 @@ export type ColorModeScriptOptions = ColorModeOptions & {
65
73
  * applies the stored choice again. A ThemeToggle change only ever replaces
66
74
  * the value, so it never trips the repair.
67
75
  */
68
- export declare function colorModeScript({ storageKey, brandStorageKey, baseThemeId, }?: ColorModeScriptOptions): string;
76
+ export declare function colorModeScript({ storageKey, brandStorageKey, baseThemeId, defaultMode, }?: ColorModeScriptOptions): string;
@@ -4,9 +4,11 @@ const isColorModeSetting = (value) => colorModeSettings.includes(value);
4
4
  function colorModeScript({
5
5
  storageKey = DEFAULT_COLOR_MODE_STORAGE_KEY,
6
6
  brandStorageKey,
7
- baseThemeId = "tide"
7
+ baseThemeId = "tide",
8
+ defaultMode = "system"
8
9
  } = {}) {
9
10
  const key = JSON.stringify(storageKey);
11
+ const setting = defaultMode === "light" || defaultMode === "dark" ? `saved === 'light' || saved === 'dark' || saved === 'system' ? saved : '${defaultMode}'` : `saved === 'light' || saved === 'dark' ? saved : 'system'`;
10
12
  const brand = brandStorageKey ? `
11
13
  var brand = null;
12
14
  try { brand = localStorage.getItem(${JSON.stringify(brandStorageKey)}); } catch (e) {}
@@ -18,7 +20,7 @@ function colorModeScript({
18
20
  function apply() {
19
21
  var saved = null;
20
22
  try { saved = localStorage.getItem(${key}); } catch (e) {}
21
- var setting = saved === 'light' || saved === 'dark' ? saved : 'system';
23
+ var setting = ${setting};
22
24
  root.setAttribute('data-theme-setting', setting);
23
25
  root.setAttribute('data-theme', setting === 'system' ? (media.matches ? 'dark' : 'light') : setting);${brand}
24
26
  }
@@ -516,4 +516,15 @@
516
516
  }
517
517
  }
518
518
 
519
+ /* Loading: a title line in a box the size of a thread row, on the row's own
520
+ inset. */
521
+
522
+ .ds-thread-history__row--loading {
523
+ box-sizing: border-box;
524
+ display: flex;
525
+ align-items: center;
526
+ height: 40px; /* ds-allow(spacing): the thread row's own height */
527
+ padding-inline: var(--padding-200) var(--padding-300);
528
+ }
529
+
519
530
  } /* @layer rift.components */
@@ -46,6 +46,10 @@ type ThreadHistoryOwnProps = {
46
46
  collapsedSections?: string[];
47
47
  /** Fires with the full new list of folded groups when a heading is pressed. */
48
48
  onCollapsedSectionsChange?: (collapsedSections: string[]) => void;
49
+ /** Holds five placeholder rows, a title line each, in place of the groups while the threads are being fetched. */
50
+ loading?: boolean;
51
+ /** Accessible name announced while `loading`. */
52
+ loadingLabel?: string;
49
53
  /** Additional CSS classes */
50
54
  className?: string;
51
55
  /**
@@ -78,7 +82,7 @@ export interface ThreadHistoryProps extends ThreadHistoryOwnProps, Omit<React.Co
78
82
  * `aria-label` to name it differently. The ref and unrecognised props
79
83
  * reach it.
80
84
  */
81
- export declare function ThreadHistory({ groups, activeThreadId, onThreadSelect, threadActions, onThreadAction, statusLabels, pinnedLabel, threadMenuLabel, renamingThreadId, onThreadRename, onRenameCancel, renameLabel, moreLabel, onShowMore, collapsibleSections, collapsedSections, onCollapsedSectionsChange, className, linkComponent, ref, ...rest }: ThreadHistoryProps): React.JSX.Element;
85
+ export declare function ThreadHistory({ groups, activeThreadId, onThreadSelect, threadActions, onThreadAction, statusLabels, pinnedLabel, threadMenuLabel, renamingThreadId, onThreadRename, onRenameCancel, renameLabel, moreLabel, onShowMore, collapsibleSections, collapsedSections, onCollapsedSectionsChange, loading, loadingLabel, className, linkComponent, ref, ...rest }: ThreadHistoryProps): React.JSX.Element;
82
86
  /** A labelled run of threads, ThreadPanel's group shape, under ThreadHistory's own name. */
83
87
  export type ThreadHistoryGroup = ThreadPanelGroup;
84
88
  /** One thread row, ThreadPanel's thread shape, under ThreadHistory's own name. */
@@ -2,12 +2,14 @@ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { DropdownMenu } from "../DropdownMenu/DropdownMenu.js";
4
4
  import { StatusDot } from "../StatusDot/StatusDot.js";
5
+ import { Skeleton } from "../Skeleton/Skeleton.js";
5
6
  import "./ThreadHistory.css";
6
7
  import "../../behaviors/direction.css";
7
8
  import "../../behaviors/visually-hidden.css";
8
9
  import "../../fonts/material-symbols.css";
9
10
  import { mirrorClass } from "../../behaviors/direction.js";
10
11
  const baseClass = "ds-thread-history";
12
+ const LOADING_ROW_WIDTHS = ["72%", "54%", "80%", "46%", "64%"];
11
13
  const STATUS_DOTS = {
12
14
  idle: { variant: "neutral", outline: true },
13
15
  working: { variant: "neutral", pulse: true },
@@ -123,6 +125,8 @@ function ThreadHistory({
123
125
  collapsibleSections = false,
124
126
  collapsedSections = [],
125
127
  onCollapsedSectionsChange,
128
+ loading = false,
129
+ loadingLabel = "Loading",
126
130
  className = "",
127
131
  linkComponent,
128
132
  ref,
@@ -172,7 +176,8 @@ function ThreadHistory({
172
176
  ref,
173
177
  className: [baseClass, dotted && `${baseClass}--dotted`, collapsibleSections && `${baseClass}--collapsible-sections`, className].filter(Boolean).join(" "),
174
178
  children: [
175
- groups.map(
179
+ loading && /* @__PURE__ */ jsx("ul", { className: `${baseClass}__list`, "aria-busy": "true", children: LOADING_ROW_WIDTHS.map((width, index) => /* @__PURE__ */ jsx("li", { className: `${baseClass}__row ${baseClass}__row--loading`, children: /* @__PURE__ */ jsx(Skeleton, { variant: "text", width, ...index === 0 ? { loadingLabel } : { "aria-hidden": true } }) }, index)) }),
180
+ !loading && groups.map(
176
181
  (group, index) => group.threads.length > 0 && /* @__PURE__ */ jsxs(
177
182
  "div",
178
183
  {
@@ -182,6 +182,10 @@ type ThreadPanelOwnProps = {
182
182
  footerAction?: React.ReactNode;
183
183
  /** Rendered above the profile row while the panel is collapsed, in `footerSlot`'s place: the same controls at their smallest, such as a SegmentedControl's or ThemeToggle's `cycle` circle, stacked and centred on the rail's axis. AppSidebar's contract: the two forms share one cell and crossfade with the panel, and whichever is hidden is inert. */
184
184
  collapsedFooterSlot?: React.ReactNode;
185
+ /** Holds placeholder rows in the history while the threads are being fetched. The header, search and footer stay. */
186
+ loading?: boolean;
187
+ /** Accessible name announced while `loading`. */
188
+ loadingLabel?: string;
185
189
  /** Additional CSS classes */
186
190
  className?: string;
187
191
  /**
@@ -91,6 +91,8 @@ const ThreadPanel = React.forwardRef(
91
91
  footerSlot,
92
92
  footerAction,
93
93
  collapsedFooterSlot,
94
+ loading = false,
95
+ loadingLabel = "Loading",
94
96
  className = "",
95
97
  linkComponent,
96
98
  ...rest
@@ -330,7 +332,9 @@ const ThreadPanel = React.forwardRef(
330
332
  collapsibleSections: collapsibleSections && expanded,
331
333
  collapsedSections,
332
334
  onCollapsedSectionsChange,
333
- linkComponent
335
+ linkComponent,
336
+ loading,
337
+ loadingLabel
334
338
  }
335
339
  ) }),
336
340
  showFooter && /* @__PURE__ */ jsxs("div", { className: `${baseClass}__footer`, children: [
@@ -175,7 +175,9 @@
175
175
  ERROR STATE
176
176
  ============================================ */
177
177
 
178
- .ds-timepicker--error .ds-timepicker__trigger {
178
+ /* The hover rule above is more specific, so the error border names it too. */
179
+ .ds-timepicker--error .ds-timepicker__trigger,
180
+ .ds-timepicker--error .ds-timepicker__trigger:hover:not(:focus-visible):not(:disabled) {
179
181
  border-color: var(--color-status-error-border);
180
182
  }
181
183
 
@@ -40,10 +40,12 @@ type TimePickerOwnProps = {
40
40
  disabled?: boolean;
41
41
  /** Whether the field is required */
42
42
  required?: boolean;
43
- /** Error state */
43
+ /** Error state: marks the control invalid and, in the older form without `errorText`, recolours the helper text as the error message. */
44
44
  error?: boolean;
45
- /** Helper or error message */
45
+ /** Helper text displayed below the control. With the older `error` flag and no `errorText`, it doubles as the error message. */
46
46
  helperText?: string;
47
+ /** The error message, shown under the control while the helper text keeps its place. Setting it marks the control invalid; Field's spec owns the wiring. */
48
+ errorText?: React.ReactNode;
47
49
  /** Called with the newly selected 24-hour "HH:MM" value */
48
50
  onValueChange?: (value: string) => void;
49
51
  /**
@@ -53,6 +53,7 @@ const TimePicker = React.forwardRef(
53
53
  required = false,
54
54
  error = false,
55
55
  helperText,
56
+ errorText,
56
57
  onValueChange,
57
58
  periodLabels,
58
59
  className = "",
@@ -85,11 +86,13 @@ const TimePicker = React.forwardRef(
85
86
  const generatedId = useId();
86
87
  const inputId = id || generatedId;
87
88
  const baseClass = "ds-timepicker";
89
+ const hasErrorText = errorText != null && errorText !== false && errorText !== "";
90
+ const invalid = error || hasErrorText;
88
91
  const classes = [
89
92
  baseClass,
90
93
  size === "compact" ? `${baseClass}--compact` : "",
91
94
  isOpen ? `${baseClass}--open` : "",
92
- error ? `${baseClass}--error` : "",
95
+ invalid ? `${baseClass}--error` : "",
93
96
  disabled ? `${baseClass}--disabled` : "",
94
97
  className
95
98
  ].filter(Boolean).join(" ");
@@ -211,6 +214,7 @@ const TimePicker = React.forwardRef(
211
214
  className: classes,
212
215
  label,
213
216
  helperText,
217
+ errorText,
214
218
  error,
215
219
  required,
216
220
  disabled,
@@ -231,8 +235,12 @@ const TimePicker = React.forwardRef(
231
235
  "aria-haspopup": "listbox",
232
236
  "aria-controls": isOpen ? `${inputId}-listbox` : void 0,
233
237
  "aria-activedescendant": activeOptionId,
234
- "aria-describedby": [rest["aria-describedby"], helperText ? `${inputId}-helper` : void 0].filter(Boolean).join(" ") || void 0,
235
- "aria-invalid": error || void 0,
238
+ "aria-describedby": [
239
+ rest["aria-describedby"],
240
+ hasErrorText ? `${inputId}-error` : void 0,
241
+ helperText ? `${inputId}-helper` : void 0
242
+ ].filter(Boolean).join(" ") || void 0,
243
+ "aria-invalid": invalid || void 0,
236
244
  disabled,
237
245
  onClick: handleToggle,
238
246
  onKeyDown: handleKeyDown,
@@ -376,4 +376,19 @@
376
376
  overflow-wrap: break-word;
377
377
  }
378
378
 
379
+ /* ============================================
380
+ LOADING — the markers and the line stay, and
381
+ each entry holds two placeholder lines
382
+ ============================================ */
383
+
384
+ .ds-timeline__content--loading {
385
+ flex: 1;
386
+ gap: var(--gap-200);
387
+ }
388
+
389
+ .ds-timeline__marker--logo > .ds-skeleton {
390
+ width: 100%;
391
+ height: 100%;
392
+ }
393
+
379
394
  } /* @layer rift.components */
@@ -47,6 +47,10 @@ export interface TimelineDefaultProps {
47
47
  numbered?: boolean;
48
48
  /** The BCP 47 locale the marker numbers are written in, such as `ar-EG`. Defaults to `en-US`. Timeline can render from a Server Component, so it takes the prop alone and reads no LocaleProvider. */
49
49
  locale?: string;
50
+ /** Holds placeholder entries, a marker beside two lines, while the entries are being fetched: as many as `items` holds, or three when it is empty. */
51
+ loading?: boolean;
52
+ /** Accessible name announced while `loading`. */
53
+ loadingLabel?: string;
50
54
  /** Additional CSS classes */
51
55
  className?: string;
52
56
  }
@@ -58,6 +62,10 @@ export interface TimelineCompanyProps {
58
62
  items: TimelineCompany[];
59
63
  /** Text shown in place of the end date for a role marked `present` */
60
64
  presentLabel?: string;
65
+ /** Holds placeholder entries, a marker beside two lines, while the entries are being fetched: as many as `items` holds, or three when it is empty. */
66
+ loading?: boolean;
67
+ /** Accessible name announced while `loading`. */
68
+ loadingLabel?: string;
61
69
  /** Additional CSS classes */
62
70
  className?: string;
63
71
  }
@@ -4,6 +4,7 @@ import "./Timeline.css";
4
4
  import "../../fonts/material-symbols.css";
5
5
  import { mirrorClass } from "../../behaviors/direction.js";
6
6
  import { DEFAULT_LOCALE, formatNumber } from "../../behaviors/locale.js";
7
+ import { Skeleton } from "../Skeleton/Skeleton.js";
7
8
  const BASE_CLASS = "ds-timeline";
8
9
  const renderRoleDates = (role, presentLabel) => {
9
10
  if (!role.start) return null;
@@ -41,9 +42,29 @@ const Timeline = React.forwardRef(({
41
42
  numbered = false,
42
43
  locale = DEFAULT_LOCALE,
43
44
  presentLabel = "Present",
45
+ loading = false,
46
+ loadingLabel = "Loading",
44
47
  className = "",
45
48
  ...props
46
49
  }, ref) => {
50
+ if (loading) {
51
+ const { variant, items: items2, ...rest2 } = props;
52
+ const company = variant === "company";
53
+ const classes2 = [
54
+ BASE_CLASS,
55
+ `${BASE_CLASS}--${company ? "vertical" : orientation}`,
56
+ company && `${BASE_CLASS}--company`,
57
+ `${BASE_CLASS}--loading`,
58
+ className
59
+ ].filter(Boolean).join(" ");
60
+ return /* @__PURE__ */ jsx("ol", { ...rest2, ref, className: classes2, "aria-busy": "true", children: Array.from({ length: items2.length || 3 }, (_, index) => /* @__PURE__ */ jsxs("li", { className: `${BASE_CLASS}__item`, children: [
61
+ /* @__PURE__ */ jsx("span", { className: `${BASE_CLASS}__marker${company ? ` ${BASE_CLASS}__marker--logo` : ""}`, "aria-hidden": "true", children: company && /* @__PURE__ */ jsx(Skeleton, { variant: "circular", "aria-hidden": "true" }) }),
62
+ /* @__PURE__ */ jsxs("div", { className: `${BASE_CLASS}__content ${BASE_CLASS}__content--loading`, children: [
63
+ /* @__PURE__ */ jsx(Skeleton, { variant: "text", width: "40%", ...index === 0 ? { loadingLabel } : { "aria-hidden": true } }),
64
+ /* @__PURE__ */ jsx(Skeleton, { variant: "text", width: "80%", "aria-hidden": "true" })
65
+ ] })
66
+ ] }, index)) });
67
+ }
47
68
  if (props.variant === "company") {
48
69
  return /* @__PURE__ */ jsx(CompanyTimeline, { ...props, presentLabel, className, ref });
49
70
  }
@@ -87,6 +87,22 @@
87
87
  animation: ds-toast-enter var(--motion-duration-slow) var(--motion-ease-standard) forwards;
88
88
  }
89
89
 
90
+ /* On a phone a toast spans the width less the container's padding, in
91
+ every placement: a fixed minimum left it off-centre against one edge,
92
+ and wider than the smallest screens. */
93
+ @media (max-width: 600px) {
94
+ .ds-toast-container {
95
+ inset-inline: var(--ds-toast-inset-left, 0) var(--ds-toast-inset-right, 0);
96
+ align-items: stretch;
97
+ transform: none;
98
+ }
99
+
100
+ .ds-toast {
101
+ min-width: 0;
102
+ max-width: none;
103
+ }
104
+ }
105
+
90
106
  .ds-toast--exiting {
91
107
  animation: ds-toast-exit var(--motion-duration-base) var(--motion-ease-standard) forwards;
92
108
  }
@@ -39,12 +39,17 @@ export interface ToastContextValue {
39
39
  }
40
40
  /**
41
41
  * Hook to access the toast API.
42
- * Must be used within a ToastProvider.
42
+ * Must be used within a ToastProvider: it throws without one. Where a
43
+ * provider may be missing (a component shared with a page outside it, or a
44
+ * framework pass that renders a page without its root layout), call
45
+ * `useOptionalToast` instead, which returns null there.
43
46
  */
44
47
  export declare const useToast: () => ToastContextValue;
45
48
  /**
46
49
  * The toast API when a ToastProvider surrounds the caller, else null: for a
47
- * component that joins the host's stack if there is one and brings its own if not.
50
+ * component that joins the host's stack if there is one and brings its own
51
+ * if not, and for any caller that may render outside the provider, where
52
+ * `useToast` would throw. Guard the call: `useOptionalToast()?.toast({ ... })`.
48
53
  */
49
54
  export declare const useOptionalToast: () => ToastContextValue | null;
50
55
  /**
@@ -8,13 +8,14 @@
8
8
  @layer rift.components {
9
9
 
10
10
  /* A control strip on the input radius, filled like SegmentedControl's
11
- track, so the group reads as one control rather than a hairline. */
11
+ track, so the group reads as one control rather than a hairline. The
12
+ root never clips: the end items round their own outer corners instead,
13
+ so a focused item's ring can sit outside the strip. */
12
14
  .ds-toggle-group {
13
15
  display: inline-flex;
14
16
  border: var(--border-025) solid var(--color-bg-container-border);
15
17
  border-radius: var(--radius-300);
16
18
  background-color: var(--color-bg-container-primary);
17
- overflow: hidden;
18
19
  /* The row height, border included (--control-height-*); the items fill it. */
19
20
  box-sizing: border-box;
20
21
  height: var(--control-height-default);
@@ -51,6 +52,31 @@
51
52
  --icon-size: var(--icon-size-500);
52
53
  }
53
54
 
55
+ /* The end items follow the strip's curve, one hairline inside it. */
56
+ .ds-toggle-group__item:first-child {
57
+ border-start-start-radius: calc(var(--radius-300) - var(--border-025));
58
+ border-end-start-radius: calc(var(--radius-300) - var(--border-025));
59
+ }
60
+
61
+ .ds-toggle-group__item:last-child {
62
+ border-start-end-radius: calc(var(--radius-300) - var(--border-025));
63
+ border-end-end-radius: calc(var(--radius-300) - var(--border-025));
64
+ }
65
+
66
+ /* ============================================
67
+ ITEM — FOCUS
68
+ The system ring, outside the item. The focused
69
+ item is lifted so a filled neighbour never
70
+ paints over the ring.
71
+ ============================================ */
72
+
73
+ .ds-toggle-group__item:focus-visible {
74
+ position: relative;
75
+ z-index: 1;
76
+ outline: 2px solid var(--color-action-primary-bg);
77
+ outline-offset: 2px;
78
+ }
79
+
54
80
  /* ============================================
55
81
  ITEM — HOVER
56
82
  ============================================ */
@@ -190,7 +190,7 @@
190
190
  }
191
191
 
192
192
  .ds-toggle-switch--error .ds-toggle-switch__helper {
193
- color: var(--color-status-error-border);
193
+ color: var(--color-text-error);
194
194
  }
195
195
 
196
196
  } /* @layer rift.components */
@@ -11,7 +11,12 @@ type ToolbarOwnProps = {
11
11
  * layout (the component never fixes itself to the viewport).
12
12
  */
13
13
  variant?: 'default' | 'floating';
14
- /** The toolbar's controls — group unrelated clusters with `ToolbarSeparator`. */
14
+ /**
15
+ * The toolbar's controls: group unrelated clusters with `ToolbarSeparator`.
16
+ * Usually tertiary `IconButton`s and compact tertiary `Button`s, as in
17
+ * `<Toolbar aria-label="Formatting"><IconButton icon="format_bold" label="Bold" variant="tertiary" /><ToolbarSeparator /><Button label="Share" variant="tertiary" size="compact" /></Toolbar>`;
18
+ * a short run of plain text (a count, a zoom reading) can sit among them.
19
+ */
15
20
  children?: React.ReactNode;
16
21
  /** Additional CSS classes */
17
22
  className?: string;
@@ -40,6 +40,15 @@ export interface TooltipProps extends TooltipOwnProps, Omit<React.ComponentProps
40
40
  * (src/behaviors/useLayer): Escape hides it wherever focus is (WCAG 1.4.13),
41
41
  * and hides only it, so inside a Dialog the first Escape clears the tooltip
42
42
  * and the second closes the Dialog.
43
+ *
44
+ * It stands down for its own trigger's popup. While the trigger has a popup
45
+ * open (`aria-expanded="true"` on a control that declares `aria-haspopup`,
46
+ * which is how Popover, DropdownMenu and the pickers mark theirs), or a
47
+ * modal has opened over it, the tooltip closes and stays closed: the popup
48
+ * says what the control was for, and a tooltip left above it would take the
49
+ * Escape meant for the popup. Nor does it open for focus a modal moved
50
+ * (src/behaviors/quietFocus.ts): the first control of a dialog as it opens,
51
+ * and the opener as it closes.
43
52
  */
44
53
  export declare const Tooltip: React.ForwardRefExoticComponent<TooltipProps & React.RefAttributes<HTMLSpanElement>>;
45
54
  export {};