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,5 +1,5 @@
1
1
  {
2
- "$comment": "The blocks: whole starting pages the init bin copies into a consumer's app, composed from the library alone. Each lists every file it writes, at its target path (app/** lands in the app router folder, components/** beside it). A file may belong to more than one block; init never overwrites, so the shared shell is written once. scripts/validate-blocks.mjs holds this file to the tree and the site's previews.",
2
+ "$comment": "The blocks: whole starting pages the init bin copies into a consumer's app, composed from the library alone. Each lists every file it writes, at its target path (app/** lands in the app router folder, components/** beside it). A file may belong to more than one block; init never overwrites, so the shared shell is written once. A block lists every page its own links reach, so nothing it writes points at a page that is not there: each app shell block carries the settings and notifications pages the shell's toolbar opens, and sign-in and sign-up carry each other. scripts/validate-blocks.mjs holds this file to the tree and the site's previews.",
3
3
  "blocks": [
4
4
  {
5
5
  "name": "app-shell",
@@ -9,8 +9,15 @@
9
9
  "files": [
10
10
  "components/blocks/AppShell.tsx",
11
11
  "components/blocks/AppShell.module.css",
12
+ "components/blocks/notifications.ts",
12
13
  "app/starter/page.tsx",
13
- "app/starter/page.module.css"
14
+ "app/starter/page.module.css",
15
+ "app/settings/page.tsx",
16
+ "app/settings/page.module.css",
17
+ "app/settings/Settings.tsx",
18
+ "app/notifications/page.tsx",
19
+ "app/notifications/page.module.css",
20
+ "app/notifications/Inbox.tsx"
14
21
  ]
15
22
  },
16
23
  {
@@ -21,8 +28,15 @@
21
28
  "files": [
22
29
  "components/blocks/AppShell.tsx",
23
30
  "components/blocks/AppShell.module.css",
31
+ "components/blocks/notifications.ts",
24
32
  "app/dashboard/page.tsx",
25
- "app/dashboard/page.module.css"
33
+ "app/dashboard/page.module.css",
34
+ "app/settings/page.tsx",
35
+ "app/settings/page.module.css",
36
+ "app/settings/Settings.tsx",
37
+ "app/notifications/page.tsx",
38
+ "app/notifications/page.module.css",
39
+ "app/notifications/Inbox.tsx"
26
40
  ]
27
41
  },
28
42
  {
@@ -33,9 +47,13 @@
33
47
  "files": [
34
48
  "components/blocks/AppShell.tsx",
35
49
  "components/blocks/AppShell.module.css",
50
+ "components/blocks/notifications.ts",
36
51
  "app/settings/page.tsx",
37
52
  "app/settings/page.module.css",
38
- "app/settings/Settings.tsx"
53
+ "app/settings/Settings.tsx",
54
+ "app/notifications/page.tsx",
55
+ "app/notifications/page.module.css",
56
+ "app/notifications/Inbox.tsx"
39
57
  ]
40
58
  },
41
59
  {
@@ -46,9 +64,13 @@
46
64
  "files": [
47
65
  "components/blocks/AppShell.tsx",
48
66
  "components/blocks/AppShell.module.css",
67
+ "components/blocks/notifications.ts",
49
68
  "app/notifications/page.tsx",
50
69
  "app/notifications/page.module.css",
51
- "app/notifications/Inbox.tsx"
70
+ "app/notifications/Inbox.tsx",
71
+ "app/settings/page.tsx",
72
+ "app/settings/page.module.css",
73
+ "app/settings/Settings.tsx"
52
74
  ]
53
75
  },
54
76
  {
@@ -59,10 +81,17 @@
59
81
  "files": [
60
82
  "components/blocks/AppShell.tsx",
61
83
  "components/blocks/AppShell.module.css",
84
+ "components/blocks/notifications.ts",
62
85
  "app/planner/page.tsx",
63
86
  "app/planner/page.module.css",
64
87
  "app/planner/PlannerGrid.tsx",
65
- "app/planner/Requests.tsx"
88
+ "app/planner/Requests.tsx",
89
+ "app/settings/page.tsx",
90
+ "app/settings/page.module.css",
91
+ "app/settings/Settings.tsx",
92
+ "app/notifications/page.tsx",
93
+ "app/notifications/page.module.css",
94
+ "app/notifications/Inbox.tsx"
66
95
  ]
67
96
  },
68
97
  {
@@ -71,6 +100,20 @@
71
100
  "description": "A centred sign-in card with email and password, remember me and a single sign-on route.",
72
101
  "route": "/sign-in",
73
102
  "files": [
103
+ "app/sign-in/page.tsx",
104
+ "app/sign-in/page.module.css",
105
+ "app/sign-up/page.tsx",
106
+ "app/sign-up/page.module.css"
107
+ ]
108
+ },
109
+ {
110
+ "name": "sign-up",
111
+ "label": "Sign up",
112
+ "description": "The sign-in card for a new account: name, email and a new password, agreement to the terms and a single sign-on route.",
113
+ "route": "/sign-up",
114
+ "files": [
115
+ "app/sign-up/page.tsx",
116
+ "app/sign-up/page.module.css",
74
117
  "app/sign-in/page.tsx",
75
118
  "app/sign-in/page.module.css"
76
119
  ]
@@ -396,6 +396,7 @@ function ChatWidget({
396
396
  }, [artifacts, turns, openArtifact]);
397
397
  const trailingUp = artifactInline || Boolean(renderAside) && asideOpen && asideWide;
398
398
  const threadsInline = threadsWide && !(trailingUp && !asideRoomy);
399
+ const railNamesChat = builtInThreads && threadsInline && (threadsProps?.logoText ?? title) === title;
399
400
  useEffect(() => {
400
401
  if (!artifacts) return;
401
402
  const host = railsHostRef.current;
@@ -628,7 +629,7 @@ function ChatWidget({
628
629
  }
629
630
  ),
630
631
  typeof logo === "string" ? /* @__PURE__ */ jsx("img", { src: logo, alt: "", width: 20, height: 20 }) : logo,
631
- /* @__PURE__ */ jsx("span", { className: "ds-chat-widget__brand-name", children: title })
632
+ !railNamesChat && /* @__PURE__ */ jsx("span", { className: "ds-chat-widget__brand-name", children: title })
632
633
  ] }),
633
634
  actions: (
634
635
  /* With the agent rail seated inline the cluster moves to the
@@ -234,7 +234,7 @@
234
234
  }
235
235
 
236
236
  .ds-agent-plan__step--failed .ds-agent-plan__label {
237
- color: var(--color-status-error-text);
237
+ color: var(--color-text-error);
238
238
  }
239
239
 
240
240
  /* ============================================
@@ -114,6 +114,20 @@
114
114
  margin: 0;
115
115
  }
116
116
 
117
+ /* ============================================
118
+ BODY
119
+ What the decision needs between the words and
120
+ the actions: a confirm field, a checkbox. It
121
+ only stacks; the content brings its own type.
122
+ ============================================ */
123
+
124
+ .ds-alert-dialog__body {
125
+ display: flex;
126
+ flex-direction: column;
127
+ gap: var(--gap-300); /* 12px */
128
+ min-width: 0;
129
+ }
130
+
117
131
  /* ============================================
118
132
  ACTIONS
119
133
  ============================================ */
@@ -11,6 +11,12 @@ type AlertDialogOwnProps = {
11
11
  title: string;
12
12
  /** Dialog description / body text */
13
13
  description?: string;
14
+ /**
15
+ * Content between the description and the actions: a type-to-confirm
16
+ * field, a checkbox, a short list of what will be removed. Keep it to what
17
+ * the decision needs; a form of its own belongs in a Dialog.
18
+ */
19
+ children?: React.ReactNode;
14
20
  /** Confirm button label */
15
21
  confirmLabel?: string;
16
22
  /** Cancel button label */
@@ -19,6 +25,31 @@ type AlertDialogOwnProps = {
19
25
  onConfirm?: () => void;
20
26
  /** Callback when cancel is clicked */
21
27
  onCancel?: () => void;
28
+ /**
29
+ * Whether the confirm action is unavailable, for a decision that needs
30
+ * something first: the name typed into a confirm field, a box ticked.
31
+ */
32
+ confirmDisabled?: boolean;
33
+ /**
34
+ * Whether the confirmed action is in flight. The confirm button shows its
35
+ * spinner and takes no press, and Cancel, Escape and the backdrop are held
36
+ * until it finishes, so the dialog cannot close under the work. Pair it
37
+ * with `closeOnConfirm={false}`.
38
+ */
39
+ confirmLoading?: boolean;
40
+ /**
41
+ * Whether pressing confirm also asks the dialog to close. `true` (the
42
+ * default) calls `onConfirm` and then `onOpenChange(false)`. `false` calls
43
+ * `onConfirm` only, so the host keeps the dialog open while the action
44
+ * runs (`confirmLoading`) and closes it when the action settles.
45
+ */
46
+ closeOnConfirm?: boolean;
47
+ /**
48
+ * The element that takes focus when the dialog opens: a ref to a field
49
+ * inside it, such as a type-to-confirm input. Without one, focus lands on
50
+ * Cancel, the safe action.
51
+ */
52
+ initialFocus?: React.RefObject<HTMLElement | null>;
22
53
  /**
23
54
  * Colour of the dialog's icon, title and confirm action: `destructive`
24
55
  * for dangerous or irreversible actions.
@@ -33,13 +64,14 @@ type AlertDialogOwnProps = {
33
64
  /** Additional CSS classes on the overlay container (the ref and native attributes go on the panel) */
34
65
  className?: string;
35
66
  };
36
- export interface AlertDialogProps extends AlertDialogOwnProps, Omit<React.ComponentPropsWithoutRef<'div'>, keyof AlertDialogOwnProps | 'children' | 'role'> {
67
+ export interface AlertDialogProps extends AlertDialogOwnProps, Omit<React.ComponentPropsWithoutRef<'div'>, keyof AlertDialogOwnProps | 'role'> {
37
68
  }
38
69
  /**
39
70
  * AlertDialog component for important confirmations.
40
71
  * Renders a modal overlay with title, description,
41
- * and confirm / cancel actions. Traps focus and
42
- * supports ESC key dismissal.
72
+ * optional content the decision needs, and confirm /
73
+ * cancel actions. Traps focus and supports ESC key
74
+ * dismissal.
43
75
  */
44
76
  export declare const AlertDialog: React.ForwardRefExoticComponent<AlertDialogProps & React.RefAttributes<HTMLDivElement>>;
45
77
  export {};
@@ -14,10 +14,15 @@ const AlertDialog = React.forwardRef(({
14
14
  onOpenChange,
15
15
  title,
16
16
  description,
17
+ children,
17
18
  confirmLabel = "Confirm",
18
19
  cancelLabel = "Cancel",
19
20
  onConfirm,
20
21
  onCancel,
22
+ confirmDisabled = false,
23
+ confirmLoading = false,
24
+ closeOnConfirm = true,
25
+ initialFocus,
21
26
  tone,
22
27
  variant,
23
28
  className = "",
@@ -34,17 +39,19 @@ const AlertDialog = React.forwardRef(({
34
39
  const baseClass = "ds-alert-dialog";
35
40
  const mounted = useMounted();
36
41
  const handleCancel = useCallback(() => {
42
+ if (confirmLoading) return;
37
43
  onCancel?.();
38
44
  onOpenChange(false);
39
- }, [onCancel, onOpenChange]);
45
+ }, [confirmLoading, onCancel, onOpenChange]);
40
46
  const handleConfirm = useCallback(() => {
47
+ if (confirmDisabled || confirmLoading) return;
41
48
  onConfirm?.();
42
- onOpenChange(false);
43
- }, [onConfirm, onOpenChange]);
44
- const layer = useLayer({ open, onDismiss: handleCancel });
49
+ if (closeOnConfirm) onOpenChange(false);
50
+ }, [confirmDisabled, confirmLoading, closeOnConfirm, onConfirm, onOpenChange]);
51
+ const layer = useLayer({ open, dismissOnEscape: !confirmLoading, onDismiss: handleCancel });
45
52
  useFocusScope(panelRef, {
46
53
  active: open,
47
- initialFocus: () => panelRef.current?.querySelector(`.${baseClass}__actions button:first-child`) ?? null
54
+ initialFocus: () => initialFocus?.current ?? panelRef.current?.querySelector(`.${baseClass}__actions button:first-child`) ?? null
48
55
  });
49
56
  useScrollLock(open);
50
57
  const resolvedTone = tone ?? variant ?? "default";
@@ -85,12 +92,14 @@ const AlertDialog = React.forwardRef(({
85
92
  /* @__PURE__ */ jsx("h2", { className: `${baseClass}__title`, id: titleId, children: title })
86
93
  ] }),
87
94
  description && /* @__PURE__ */ jsx("p", { className: `${baseClass}__description`, id: descId, children: description }),
95
+ children != null && children !== false && /* @__PURE__ */ jsx("div", { className: `${baseClass}__body`, children }),
88
96
  /* @__PURE__ */ jsxs("div", { className: `${baseClass}__actions`, children: [
89
97
  /* @__PURE__ */ jsx(
90
98
  Button,
91
99
  {
92
100
  label: cancelLabel,
93
101
  variant: "tertiary",
102
+ disabled: confirmLoading,
94
103
  onClick: handleCancel
95
104
  }
96
105
  ),
@@ -100,6 +109,8 @@ const AlertDialog = React.forwardRef(({
100
109
  label: confirmLabel,
101
110
  variant: resolvedTone === "destructive" ? "secondary" : "primary",
102
111
  tone: resolvedTone,
112
+ disabled: confirmDisabled,
113
+ loading: confirmLoading,
103
114
  onClick: handleConfirm
104
115
  }
105
116
  )
@@ -20,6 +20,12 @@
20
20
  /* ============================================
21
21
  MAIN CONTENT AREA
22
22
  ============================================ */
23
+ /* The skip link lands here: the region takes the focus without a ring of
24
+ its own around the whole page. */
25
+ .ds-app-layout__main:focus {
26
+ outline: none;
27
+ }
28
+
23
29
  .ds-app-layout__main {
24
30
  flex: 1;
25
31
  display: flex;
@@ -79,6 +79,10 @@ type AppLayoutOwnProps = {
79
79
  * component and the rail's seat) are its own.
80
80
  */
81
81
  sidebarProps?: AppLayoutSidebarProps;
82
+ /** The id of the main region, the skip link's target. */
83
+ mainId?: string;
84
+ /** The skip link's text, the page's first stop, which jumps past the sidebar and toolbar to the content. Pass an empty string for none. */
85
+ skipLinkLabel?: string;
82
86
  /** Additional CSS classes on outer wrapper */
83
87
  className?: string;
84
88
  };
@@ -3,6 +3,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
3
3
  import React, { useState, useCallback, useRef, useEffect } from "react";
4
4
  import { AppSidebar } from "../AppSidebar/AppSidebar.js";
5
5
  import { MOTION_SCROLL_SETTLE_MS } from "../../tokens/motion.js";
6
+ import { Link } from "../Link/Link.js";
6
7
  import "../../behaviors/shell.css";
7
8
  import "./AppLayout.css";
8
9
  const AppLayout = React.forwardRef(
@@ -23,6 +24,8 @@ const AppLayout = React.forwardRef(
23
24
  theme = "dark",
24
25
  linkComponent,
25
26
  sidebarProps,
27
+ mainId = "main",
28
+ skipLinkLabel = "Skip to content",
26
29
  className = "",
27
30
  ...rest
28
31
  }, ref) => {
@@ -61,6 +64,7 @@ const AppLayout = React.forwardRef(
61
64
  "data-ds-shell": layout,
62
65
  "data-ds-width": width,
63
66
  children: [
67
+ skipLinkLabel && /* @__PURE__ */ jsx(Link, { variant: "skip", href: `#${mainId}`, children: skipLinkLabel }),
64
68
  /* @__PURE__ */ jsx(
65
69
  AppSidebar,
66
70
  {
@@ -79,7 +83,7 @@ const AppLayout = React.forwardRef(
79
83
  linkComponent
80
84
  }
81
85
  ),
82
- /* @__PURE__ */ jsx("main", { className: `${baseClass}__main`, children: layout === "inset" ? (
86
+ /* @__PURE__ */ jsx("main", { id: mainId, className: `${baseClass}__main`, tabIndex: -1, children: layout === "inset" ? (
83
87
  // The surface clips to its rounded corners and the scroller
84
88
  // inside it scrolls, so the scrollbar never squares a corner.
85
89
  /* @__PURE__ */ jsx("div", { className: `${baseClass}__surface`, children: /* @__PURE__ */ jsx("div", { className: `${baseClass}__scroller`, onScroll: handleSurfaceScroll, children: content }) })
@@ -31,8 +31,9 @@
31
31
  shell sets both; a rail standing alone takes the same look. */
32
32
  background-color: var(--ds-shell-rail-bg, var(--color-bg-app-shell));
33
33
  border-inline-end: var(--border-025) solid var(--ds-shell-rail-divider, var(--color-bg-container-border));
34
- /* The logo mark draws in currentColor; without a colour of its own the
35
- rail inherited the host's, and the mark vanished on a dark host. */
34
+ /* A logo a host passes may draw in currentColor; without a colour of its
35
+ own the rail inherited the host's, and the mark vanished on a dark
36
+ host. The built-in mark wears the brand mark roles instead (below). */
36
37
  color: var(--color-text-primary);
37
38
  overflow: hidden;
38
39
  transition: width var(--motion-duration-slow) var(--motion-ease-emphasized);
@@ -179,6 +180,9 @@
179
180
  align-items: center;
180
181
  gap: var(--gap-500);
181
182
  min-width: 0;
183
+ /* In the rail the logo is the button that opens the sidebar, and its
184
+ focus ring follows the round controls beside it. */
185
+ border-radius: var(--radius-pill);
182
186
  }
183
187
 
184
188
  .ds-app-sidebar__logo-icon {
@@ -187,6 +191,16 @@
187
191
  flex-shrink: 0;
188
192
  }
189
193
 
194
+ /* The built-in mark's gradient: the logo's own roles, which follow the
195
+ action colour until a theme gives the logo a tone apart from it. */
196
+ .ds-app-sidebar__mark-start {
197
+ stop-color: var(--color-brand-mark);
198
+ }
199
+
200
+ .ds-app-sidebar__mark-end {
201
+ stop-color: var(--color-brand-mark-end);
202
+ }
203
+
190
204
  .ds-app-sidebar__logo-text {
191
205
  font-family: var(--font-paragraph-emphasis-family);
192
206
  font-size: var(--font-paragraph-emphasis-size);
@@ -1411,6 +1425,7 @@
1411
1425
  /* The rail's standalone controls (the collapse toggle, the profile menu
1412
1426
  button, the mobile trigger) take the same ring, outside their round box as
1413
1427
  Button's sits, rather than the browser's default. */
1428
+ .ds-app-sidebar__logo-inner:focus-visible,
1414
1429
  .ds-app-sidebar__toggle:focus-visible,
1415
1430
  .ds-app-sidebar__profile-more:focus-visible,
1416
1431
  .ds-app-sidebar__mobile-trigger:focus-visible {
@@ -26,6 +26,7 @@ function isCount(badge) {
26
26
  return typeof badge === "number" || /^\d+\+?$/.test(badge.trim());
27
27
  }
28
28
  function DefaultLogo() {
29
+ const gradientId = `ds-app-sidebar-mark-${useId().replace(/:/g, "")}`;
29
30
  return /* @__PURE__ */ jsxs(
30
31
  "svg",
31
32
  {
@@ -35,14 +36,18 @@ function DefaultLogo() {
35
36
  xmlns: "http://www.w3.org/2000/svg",
36
37
  "aria-hidden": "true",
37
38
  children: [
39
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: gradientId, gradientUnits: "userSpaceOnUse", x1: "0", y1: "5", x2: "0", y2: "91", children: [
40
+ /* @__PURE__ */ jsx("stop", { offset: "0", className: "ds-app-sidebar__mark-start" }),
41
+ /* @__PURE__ */ jsx("stop", { offset: "1", className: "ds-app-sidebar__mark-end" })
42
+ ] }) }),
38
43
  /* @__PURE__ */ jsx(
39
44
  "path",
40
45
  {
41
46
  d: "M20.5 31L31.5 25L31.5 50.28L17.78 64L2.22 64L20.5 45.72ZM64.5 31L75.5 25L75.5 45.72L93.78 64L78.22 64L64.5 50.28Z",
42
- fill: "currentColor"
47
+ fill: `url(#${gradientId})`
43
48
  }
44
49
  ),
45
- /* @__PURE__ */ jsx("path", { d: "M42 11L54 5L54 85L42 91Z", fill: "currentColor" })
50
+ /* @__PURE__ */ jsx("path", { d: "M42 11L54 5L54 85L42 91Z", fill: `url(#${gradientId})` })
46
51
  ]
47
52
  }
48
53
  );
@@ -504,6 +509,8 @@ const AppSidebar = React.forwardRef(function AppSidebar2({
504
509
  className: `${baseClass}__toggle`,
505
510
  onClick: mobileOpen ? closeMobile : toggleExpanded,
506
511
  "aria-label": toggleLabel,
512
+ tabIndex: isExpanded || mobileOpen ? void 0 : -1,
513
+ "aria-hidden": isExpanded || mobileOpen ? void 0 : true,
507
514
  children: /* @__PURE__ */ jsx("span", { className: "material-symbols-rounded ds-mirror-rtl", children: mobileOpen ? "close" : isExpanded ? "left_panel_close" : "left_panel_open" })
508
515
  }
509
516
  ) })
@@ -42,7 +42,9 @@ type AppToolbarOwnProps = {
42
42
  /**
43
43
  * Opens the app's search, usually a CommandPalette. When given, the bar
44
44
  * starts with a search field, never narrower than a usable field, folded
45
- * to its icon when the bar is narrow.
45
+ * to its icon when the bar is narrow. The field is a CommandPaletteTrigger
46
+ * the bar draws itself: pass this handler rather than seating a trigger
47
+ * of your own beside the bar, which the bar cannot fold.
46
48
  */
47
49
  onSearch?: React.MouseEventHandler<HTMLButtonElement>;
48
50
  /** The search field's prompt and accessible name. Default "Search or ask anything". */
@@ -62,7 +64,8 @@ type AppToolbarOwnProps = {
62
64
  /**
63
65
  * The icon controls at the end, borderless: notifications, a calendar,
64
66
  * help, settings. On a narrow bar every one after the first moves into a
65
- * More menu, except those that open a panel or are links.
67
+ * More menu, except those that open a panel or are links, and except
68
+ * when only one could move, which stays in the bar.
66
69
  */
67
70
  actions?: AppToolbarAction[];
68
71
  /**
@@ -27,7 +27,9 @@ function AppToolbar({
27
27
  ...rest
28
28
  }) {
29
29
  const baseClass = "ds-app-toolbar";
30
- const folds = (action, index) => index > 0 && !action.panel && !action.href;
30
+ const canFold = (action, index) => index > 0 && !action.panel && !action.href;
31
+ const foldsAny = actions.filter(canFold).length > 1;
32
+ const folds = (action, index) => foldsAny && canFold(action, index);
31
33
  const foldable = actions.filter(folds);
32
34
  const moreItems = foldable.map((action) => ({
33
35
  id: action.id,
@@ -7,6 +7,7 @@ import { renderTypeMark } from "./typeMark.js";
7
7
  import { AttachmentViewer } from "./AttachmentViewer.js";
8
8
  import "./Attachment.css";
9
9
  import { useLocale } from "../../behaviors/LocaleProvider.js";
10
+ import { LoadingImage } from "../../behaviors/LoadingImage.js";
10
11
  import { revokeAttachmentUrls, useAttachments } from "./useAttachments.js";
11
12
  const isPicture = (item) => item.status === "ready" && item.kind === "image" && Boolean(item.previewSrc);
12
13
  const AttachmentGroup = React.forwardRef(
@@ -71,7 +72,7 @@ const AttachmentGroup = React.forwardRef(
71
72
  const onClick = clickHandler(single);
72
73
  const sized = Boolean(single.width && single.height);
73
74
  const image = /* @__PURE__ */ jsx(
74
- "img",
75
+ LoadingImage,
75
76
  {
76
77
  className: [`${baseClass}__single-image`, sized && `${baseClass}__single-image--sized`].filter(Boolean).join(" "),
77
78
  src: single.previewSrc,
@@ -6,6 +6,7 @@ import { renderTypeMark } from "./typeMark.js";
6
6
  import "../../fonts/material-symbols.css";
7
7
  import "./Attachment.css";
8
8
  import "../../behaviors/visually-hidden.css";
9
+ import { LoadingImage } from "../../behaviors/LoadingImage.js";
9
10
  const AttachmentTile = React.forwardRef(
10
11
  ({
11
12
  name,
@@ -107,7 +108,7 @@ const AttachmentTile = React.forwardRef(
107
108
  let content = stack;
108
109
  if (showPreview) {
109
110
  content = /* @__PURE__ */ jsxs(Fragment, { children: [
110
- /* @__PURE__ */ jsx("img", { className: `${baseClass}__preview`, src: previewSrc, alt: previewAlt ?? name }),
111
+ /* @__PURE__ */ jsx(LoadingImage, { className: `${baseClass}__preview`, src: previewSrc, alt: previewAlt ?? name }),
111
112
  (previewMark ?? kind !== "image") && /* @__PURE__ */ jsx("span", { className: `${baseClass}__corner`, children: cornerMark })
112
113
  ] });
113
114
  } else if (showExcerpt) {
@@ -65,8 +65,14 @@
65
65
  VARIANT — NEUTRAL
66
66
  ============================================ */
67
67
 
68
+ /* The neutral fill is the grey a hovered and a striped table row are
69
+ painted in, so on those rows the badge would lose its shape. It alone
70
+ colours the hairline every badge reserves, in the container border: an
71
+ edge, not a status signal, so the fill still carries the meaning. On a
72
+ selected row, which is the border's own grey, the fill shows instead. */
68
73
  .ds-badge--neutral {
69
74
  background-color: var(--color-status-neutral-bg);
75
+ border-color: var(--color-bg-container-border);
70
76
  color: var(--color-status-neutral-text);
71
77
  }
72
78
 
@@ -7,8 +7,11 @@
7
7
 
8
8
  @layer rift.components {
9
9
 
10
+ /* As wide as its trail and never wider than its container, so a host can
11
+ centre it or set it beside something; in normal flow it still fills the
12
+ row, as any block does. */
10
13
  .ds-breadcrumb {
11
- width: 100%;
14
+ max-width: 100%;
12
15
  }
13
16
 
14
17
  /* ============================================
@@ -579,7 +579,8 @@
579
579
  /* ============================================
580
580
  LOADING
581
581
  Keeps the variant's full-colour appearance (no disabled dim);
582
- the spinner occupies the left icon slot and inherits its colour.
582
+ the spinner occupies the left icon slot and inherits its colour, or
583
+ sits over the label when the button has no left icon.
583
584
  ============================================ */
584
585
 
585
586
  .ds-button--loading {
@@ -597,6 +598,24 @@
597
598
  justify-content: center;
598
599
  }
599
600
 
601
+ /* A button with text and no left icon keeps its width while loading: the
602
+ spinner sits centred over the label, and the label and any trailing icon
603
+ keep their room unseen. Opacity, never visibility: a hidden label would
604
+ leave the button with no accessible name. */
605
+ .ds-button--loading-over {
606
+ position: relative;
607
+ }
608
+
609
+ .ds-button--loading-over .ds-button__spinner {
610
+ position: absolute;
611
+ inset: 0;
612
+ }
613
+
614
+ .ds-button--loading-over .ds-button__text,
615
+ .ds-button--loading-over .ds-button__icon--right {
616
+ opacity: 0;
617
+ }
618
+
600
619
  /* The generic icon-slot svg sizing must not distort the spinner —
601
620
  it sizes itself from the Spinner size prop */
602
621
  .ds-button .ds-button__icon .ds-spinner__circle {
@@ -65,13 +65,17 @@ const Button = React.forwardRef(
65
65
  const resolvedState = state ?? (isDisabled ? "disabled" : "default");
66
66
  const isLoading = Boolean(loading);
67
67
  const spinnerSize = size === "compact" ? "sm" : "md";
68
- const leftIcon = isLoading ? /* @__PURE__ */ jsx(Spinner, { size: spinnerSize, tone: "inherit" }) : iconLeft || icon;
68
+ const spinner = /* @__PURE__ */ jsx(Spinner, { size: spinnerSize, tone: "inherit" });
69
+ const startIcon = iconLeft || icon;
70
+ const spinnerOverLabel = isLoading && !startIcon && text && Boolean(label);
71
+ const leftIcon = isLoading && !spinnerOverLabel ? spinner : startIcon;
69
72
  const classes = [
70
73
  baseClass,
71
74
  `${baseClass}--${resolvedVariant}`,
72
75
  `${baseClass}--${resolvedState}`,
73
76
  `${baseClass}--${size}`,
74
77
  isLoading && `${baseClass}--loading`,
78
+ spinnerOverLabel && `${baseClass}--loading-over`,
75
79
  glass && `${baseClass}--glass`,
76
80
  text && label && leftIcon && `${baseClass}--icon-start`,
77
81
  text && label && iconRight && `${baseClass}--icon-end`,
@@ -89,6 +93,7 @@ const Button = React.forwardRef(
89
93
  const fallbackAriaLabel = needsAccessibleName && label && !rest["aria-label"] ? label : void 0;
90
94
  const content = /* @__PURE__ */ jsxs(Fragment, { children: [
91
95
  leftIcon && renderIcon(leftIcon),
96
+ spinnerOverLabel && /* @__PURE__ */ jsx("span", { className: `${baseClass}__icon ${baseClass}__spinner`, "aria-hidden": "true", children: spinner }),
92
97
  text && /* @__PURE__ */ jsx("span", { className: `${baseClass}__text`, children: label }),
93
98
  iconRight && renderIcon(iconRight, "right")
94
99
  ] });
@@ -106,6 +106,17 @@
106
106
  box-shadow: none;
107
107
  }
108
108
 
109
+ /* A case-study card with no href goes nowhere, so it does not lift or
110
+ offer a pointer; it keeps its full colour, unlike a placeholder. */
111
+ .ds-card--case-study--static {
112
+ cursor: default;
113
+ }
114
+
115
+ .ds-card--case-study--static:hover {
116
+ transform: none;
117
+ box-shadow: none;
118
+ }
119
+
109
120
  .ds-card--case-study__cover-wrap {
110
121
  width: 100%;
111
122
  aspect-ratio: 940 / 480;
@@ -15,7 +15,13 @@ type CardOwnProps = {
15
15
  interactive?: boolean;
16
16
  /** Additional CSS classes */
17
17
  className?: string;
18
- /** Navigation href — renders the card as an <a> tag */
18
+ /**
19
+ * Where the card goes. With it the card renders as a link in either
20
+ * variant, through `linkComponent`: the default variant becomes a link
21
+ * named by its title and wears the interactive lift, and the case-study
22
+ * variant links its whole tile. A case-study card without it, or one
23
+ * marked `placeholder`, is a still tile that does not lift.
24
+ */
19
25
  href?: string;
20
26
  /** Cover image src */
21
27
  coverSrc?: string;
@@ -47,8 +53,8 @@ export interface CardProps extends CardOwnProps, Omit<React.ComponentPropsWithou
47
53
  /**
48
54
  * Card renders a preview tile, or a case-study tile when `variant="case-study"`.
49
55
  *
50
- * Renders a `<div>`, or an `<a>` in the case-study variant when `href` is
51
- * supplied. Forwards a ref to whichever element it renders and spreads
56
+ * Renders a `<div>`, or a link in either variant when `href` is supplied.
57
+ * Forwards a ref to whichever element it renders and spreads
52
58
  * unrecognised props onto it.
53
59
  */
54
60
  export declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement | HTMLAnchorElement>>;