rift-ds 1.34.0 → 1.35.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 (69) hide show
  1. package/README.md +3 -3
  2. package/behaviors/locale.d.ts +9 -0
  3. package/behaviors/locale.js +2 -0
  4. package/bin/templates/blocks/app/dashboard/page.tsx +1 -1
  5. package/bin/templates/blocks/components/blocks/AppShell.module.css +10 -6
  6. package/chat/ChatTabs.js +1 -1
  7. package/chat/ChatWidget.d.ts +2 -2
  8. package/chat/ChatWidget.js +1 -1
  9. package/chat/DemoWelcome.js +2 -2
  10. package/chat/FollowupSuggestions.js +1 -1
  11. package/components/ActionBar/ActionBar.css +78 -0
  12. package/components/ActionBar/ActionBar.d.ts +40 -0
  13. package/components/ActionBar/ActionBar.js +29 -0
  14. package/components/AiButton/AiButton.js +1 -1
  15. package/components/Alert/Alert.css +16 -0
  16. package/components/Alert/Alert.d.ts +2 -2
  17. package/components/Alert/Alert.js +3 -1
  18. package/components/AppSidebar/AppSidebar.css +140 -4
  19. package/components/AppSidebar/AppSidebar.d.ts +12 -0
  20. package/components/AppSidebar/AppSidebar.js +7 -3
  21. package/components/ChatThread/ChatThread.d.ts +5 -1
  22. package/components/ChatThread/ChatThread.js +1 -1
  23. package/components/ContextMenu/ContextMenu.d.ts +5 -1
  24. package/components/ContextMenu/ContextMenu.js +2 -1
  25. package/components/ContributionGraph/ContributionGraph.d.ts +7 -1
  26. package/components/ContributionGraph/ContributionGraph.js +4 -18
  27. package/components/ContributionGraph/weeks.d.ts +8 -0
  28. package/components/ContributionGraph/weeks.js +25 -0
  29. package/components/DataTable/DataTable.js +1 -1
  30. package/components/DocumentChip/DocumentChip.js +1 -1
  31. package/components/EntitySwitcher/EntitySwitcher.css +11 -3
  32. package/components/EntitySwitcher/EntitySwitcher.js +1 -1
  33. package/components/EventCalendar/EventCalendar.css +152 -0
  34. package/components/EventCalendar/EventCalendar.d.ts +50 -4
  35. package/components/EventCalendar/EventCalendar.js +154 -23
  36. package/components/EventCalendar/eventTime.d.ts +31 -0
  37. package/components/EventCalendar/eventTime.js +42 -0
  38. package/components/FileInput/FileInput.d.ts +12 -4
  39. package/components/FileInput/FileInput.js +27 -4
  40. package/components/Input/Input.css +30 -0
  41. package/components/Input/Input.d.ts +8 -0
  42. package/components/Input/Input.js +3 -0
  43. package/components/Popover/Popover.d.ts +5 -1
  44. package/components/Popover/Popover.js +3 -1
  45. package/components/ProgressBar/ProgressBar.d.ts +5 -1
  46. package/components/ProgressBar/ProgressBar.js +1 -1
  47. package/components/PromptSuggestions/PromptSuggestions.d.ts +5 -1
  48. package/components/PromptSuggestions/PromptSuggestions.js +1 -1
  49. package/components/ResourceTimeline/ResourceTimeline.js +2 -2
  50. package/components/SegmentedControl/SegmentedControl.css +120 -3
  51. package/components/SegmentedControl/SegmentedControl.d.ts +9 -0
  52. package/components/SegmentedControl/SegmentedControl.js +11 -1
  53. package/components/ShaderScene/ShaderScene.d.ts +3 -3
  54. package/components/ShaderScene/scenes.d.ts +17 -0
  55. package/components/ShaderScene/scenes.js +175 -1
  56. package/components/Stat/Stat.css +12 -0
  57. package/components/Stat/Stat.d.ts +5 -0
  58. package/components/Stat/Stat.js +9 -3
  59. package/components/TableToolbar/TableToolbar.js +2 -2
  60. package/components/ThemeToggle/ThemeToggle.d.ts +1 -1
  61. package/components/ThreadTabs/ThreadTabs.d.ts +5 -1
  62. package/components/ThreadTabs/ThreadTabs.js +2 -1
  63. package/components/ToggleGroup/ToggleGroup.d.ts +5 -1
  64. package/components/registry.json +21 -4
  65. package/components/registry.json.d.ts +21 -4
  66. package/components/registry.json.js +1 -1
  67. package/index.d.ts +1 -0
  68. package/index.js +2 -0
  69. package/package.json +1 -1
package/README.md CHANGED
@@ -13,7 +13,7 @@ An open source React design system built for AI products and coding agents: comp
13
13
 
14
14
  ## Why Rift DS
15
15
 
16
- - **<!-- component-count -->194<!-- /component-count --> components.** Buttons, forms and tables through to charts, navigation and overlays, each typed and documented with live examples. Every one forwards a ref and your own attributes to its element, state you can own works controlled or uncontrolled (a modal opens when your app says so, by design), and every word a component writes has a prop you can localise. The build checks the first two on every component, and the words wherever they sit in markup. React and React DOM are the only required peer dependencies.
16
+ - **<!-- component-count -->195<!-- /component-count --> components.** Buttons, forms and tables through to charts, navigation and overlays, each typed and documented with live examples. Every one forwards a ref and your own attributes to its element, state you can own works controlled or uncontrolled (a modal opens when your app says so, by design), and every word a component writes has a prop you can localise. The build checks the first two on every component, and the words wherever they sit in markup. React and React DOM are the only required peer dependencies.
17
17
  - **A matching <!-- figma-kit-link -->[Figma kit](https://www.figma.com/community/file/1701820123445795117)<!-- /figma-kit-link -->.** Every component has a page in it, with a sticker sheet of its states, built on variables named after the same tokens. Duplicate it from the Figma Community to design with the same system.
18
18
  - **AI patterns, the whole chat and templates, ready to use.** Composer, streaming chat thread, tool calls, reasoning and thread panel are in the box, the complete AI chat ships assembled as one widget that one command scaffolds, and the docs site has complete template screens built from them.
19
19
  - **Fully themeable.** The shipped themes are complete looks to start from, each in light and dark. One `data-brand` attribute applies a theme, and a few CSS overrides make your own.
@@ -112,13 +112,13 @@ import 'rift-ds/tokens/presets/presets.css';
112
112
 
113
113
  ## Components
114
114
 
115
- <!-- component-count -->194<!-- /component-count --> components, including a chat set for AI products (Chat thread, Composer, Tool call, Reasoning, Thread panel) and Shader field, a WebGL2 ambient background whose light sources read your colour tokens at runtime, so it re-themes with everything else. Details and live examples are on the [docs site](https://rift-ds.com/components).
115
+ <!-- component-count -->195<!-- /component-count --> components, including a chat set for AI products (Chat thread, Composer, Tool call, Reasoning, Thread panel) and Shader field, a WebGL2 ambient background whose light sources read your colour tokens at runtime, so it re-themes with everything else. Details and live examples are on the [docs site](https://rift-ds.com/components).
116
116
 
117
117
  <details>
118
118
  <summary>The full list</summary>
119
119
 
120
120
  <!-- component-list:start -->
121
- Accordion · Action card · Action readout · Agent plan · Agent rail · Agent status · AI button · Alert · Alert dialog · Anchor nav · Animated number · App layout · App sidebar · Area chart · Artifact card · Artifact panel · Attachment drop zone · Attachment group · Attachment tile · Attachment viewer · Avatar · Avatar group · Back to top · Badge · Banner · Bar chart · Bento tile · Bento tile art · Bottom nav · Breadcrumb · Button · Button group · Card · Card stack · Carousel · Chat header · Chat marker · Chat message · Chat thread · Checkbox · Checklist · Chip · Code block · Code diff · Colour picker · Combo chart · Combobox · Command palette · Command palette trigger · Composer · Contact card · Context menu · Contribution graph · Copy button · Currency input · Data table · Date input · Date picker · Date range picker · Deadline · Decision row · Description list · Dialog · Divider · Document chip · Document viewer · Drawer · Dropdown · Dropdown menu · Empty state · Entity card · Entity switcher · Error summary · Event calendar · Field · Figure · File input · File row · Filter bar · Form section · Funnel chart · Gantt chart · Gauge · Globe · Grid · Heading · Hover card · Icon · Icon button · Image compare · Input · Inspector colour picker · Inspector dropdown · Inspector input · Inspector section · Inspector segments · Inspector slider · Inspector toggle switch · Instructions · Interrupt card · Kbd · Legend tile · Lightbox · Line chart · Link · Link list · List · Map callout · Map legend · Masked input · Mega menu · Mention · Menu bar · Message actions · Message card · Meter · Model picker · Nav · Nav list · Notification centre · Number input · Org chart · Page header · Pagination · Panel · Pie chart · Pin input · Pixel avatar · Popover · Progress bar · Progressive blur · Prompt suggestions · Prose · Question card · Quote · Radar chart · Radial chart · Radio button · Rating · Reasoning · Resource timeline · Rich dropdown · Scatter chart · Section title · Segmented control · Selection card · Shader field · Shader scene · Sidebar panel · Signature pad · Site footer · Site header · Site layout · Skeleton · Slider · Source chip · Source trail · Sparkline · Spinner · Split button · Split pane · Stack · Stacked bar chart · Stat · Status dot · Stepper · Streaming text · Swatch · Table · Table toolbar · Tabs · Tag input · Text · Textarea · Theme picker · Theme toggle · Thread panel · Thread tabs · Time picker · Timeline · Toast · Toggle group · Toggle switch · Tool call · Toolbar · Tooltip · Top app bar · Tree view · Treemap · Usage card · Waveform · Widget · Wizard · World map
121
+ Accordion · Action bar · Action card · Action readout · Agent plan · Agent rail · Agent status · AI button · Alert · Alert dialog · Anchor nav · Animated number · App layout · App sidebar · Area chart · Artifact card · Artifact panel · Attachment drop zone · Attachment group · Attachment tile · Attachment viewer · Avatar · Avatar group · Back to top · Badge · Banner · Bar chart · Bento tile · Bento tile art · Bottom nav · Breadcrumb · Button · Button group · Card · Card stack · Carousel · Chat header · Chat marker · Chat message · Chat thread · Checkbox · Checklist · Chip · Code block · Code diff · Colour picker · Combo chart · Combobox · Command palette · Command palette trigger · Composer · Contact card · Context menu · Contribution graph · Copy button · Currency input · Data table · Date input · Date picker · Date range picker · Deadline · Decision row · Description list · Dialog · Divider · Document chip · Document viewer · Drawer · Dropdown · Dropdown menu · Empty state · Entity card · Entity switcher · Error summary · Event calendar · Field · Figure · File input · File row · Filter bar · Form section · Funnel chart · Gantt chart · Gauge · Globe · Grid · Heading · Hover card · Icon · Icon button · Image compare · Input · Inspector colour picker · Inspector dropdown · Inspector input · Inspector section · Inspector segments · Inspector slider · Inspector toggle switch · Instructions · Interrupt card · Kbd · Legend tile · Lightbox · Line chart · Link · Link list · List · Map callout · Map legend · Masked input · Mega menu · Mention · Menu bar · Message actions · Message card · Meter · Model picker · Nav · Nav list · Notification centre · Number input · Org chart · Page header · Pagination · Panel · Pie chart · Pin input · Pixel avatar · Popover · Progress bar · Progressive blur · Prompt suggestions · Prose · Question card · Quote · Radar chart · Radial chart · Radio button · Rating · Reasoning · Resource timeline · Rich dropdown · Scatter chart · Section title · Segmented control · Selection card · Shader field · Shader scene · Sidebar panel · Signature pad · Site footer · Site header · Site layout · Skeleton · Slider · Source chip · Source trail · Sparkline · Spinner · Split button · Split pane · Stack · Stacked bar chart · Stat · Status dot · Stepper · Streaming text · Swatch · Table · Table toolbar · Tabs · Tag input · Text · Textarea · Theme picker · Theme toggle · Thread panel · Thread tabs · Time picker · Timeline · Toast · Toggle group · Toggle switch · Tool call · Toolbar · Tooltip · Top app bar · Tree view · Treemap · Usage card · Waveform · Widget · Wizard · World map
122
122
  <!-- component-list:end -->
123
123
 
124
124
  </details>
@@ -38,6 +38,15 @@ export declare function weekdayHeadersIn(locale: string): string[];
38
38
  /** Whether `locale` is written in English, the language every built-in label defaults to. */
39
39
  export declare function isEnglish(locale: string): boolean;
40
40
  /** Whether `locale` writes times on a 12-hour clock (en-US) rather than a 24-hour one (en-GB, de-DE). */
41
+ /**
42
+ * Formatted date or time text with its spaces made plain. ICU writes thin
43
+ * and narrow no-break spaces around a range's dash and before a day period
44
+ * ("November 16 – 22", "1:40 PM"), and Node and browsers ship different ICU
45
+ * versions, so one call can print different spaces on the server and in the
46
+ * browser and break hydration. Every range a component prints goes through
47
+ * this.
48
+ */
49
+ export declare const plainSpaces: (text: string) => string;
41
50
  export declare function uses12HourClock(locale: string): boolean;
42
51
  /**
43
52
  * A number as `locale` writes it, grouped and with its own decimal mark:
@@ -42,6 +42,7 @@ function isEnglish(locale) {
42
42
  return false;
43
43
  }
44
44
  }
45
+ const plainSpaces = (text) => text.replace(/[\u00A0\u2009\u202F]/g, " ");
45
46
  function uses12HourClock(locale) {
46
47
  const cycle = new Intl.DateTimeFormat(locale, { hour: "numeric" }).resolvedOptions().hourCycle;
47
48
  return cycle === "h11" || cycle === "h12";
@@ -83,6 +84,7 @@ export {
83
84
  formatNumber,
84
85
  formatPercent,
85
86
  isEnglish,
87
+ plainSpaces,
86
88
  rotateWeek,
87
89
  uses12HourClock,
88
90
  weekStartOf,
@@ -101,7 +101,7 @@ export default function DashboardPage() {
101
101
  <span>{row.name}</span>
102
102
  <span className={styles.muted}>{row.done}%</span>
103
103
  </div>
104
- <ProgressBar value={row.done} size="compact" ariaLabel={`${row.name} progress`} />
104
+ <ProgressBar value={row.done} size="compact" aria-label={`${row.name} progress`} />
105
105
  </li>
106
106
  ))}
107
107
  </ul>
@@ -11,6 +11,9 @@
11
11
  --ds-sidebar-float-inset: var(--shell-inset);
12
12
  /* The rail's width, which the main column clears. */
13
13
  --shell-rail: 64px;
14
+ /* The content's side gutter, which the top bar's fill and blur reach
15
+ across too, so nothing scrolls past them at the surface's corners. */
16
+ --shell-gutter: var(--padding-1000);
14
17
 
15
18
  display: flex;
16
19
  min-width: 0;
@@ -79,7 +82,7 @@
79
82
  display: flex;
80
83
  flex-direction: column;
81
84
  gap: var(--gap-500);
82
- padding: var(--shell-inset) var(--padding-1000) var(--padding-1500);
85
+ padding: var(--shell-inset) var(--shell-gutter) var(--padding-1500);
83
86
  }
84
87
 
85
88
  /* ---------------------------------------------------------- top bar */
@@ -106,7 +109,7 @@
106
109
  position: absolute;
107
110
  top: calc(-1 * var(--shell-inset));
108
111
  bottom: 0;
109
- inset-inline: calc(-1 * var(--padding-400));
112
+ inset-inline: calc(-1 * var(--shell-gutter));
110
113
  z-index: -1;
111
114
  background: linear-gradient(to bottom, var(--ds-shell-surface) var(--shell-inset), transparent);
112
115
  pointer-events: none;
@@ -122,7 +125,7 @@
122
125
  position: absolute;
123
126
  top: calc(-1 * var(--shell-inset));
124
127
  bottom: calc(-1 * var(--gap-1000));
125
- inset-inline: calc(-1 * var(--padding-400));
128
+ inset-inline: calc(-1 * var(--shell-gutter));
126
129
  height: auto;
127
130
  z-index: -1;
128
131
  opacity: 0;
@@ -184,8 +187,8 @@
184
187
 
185
188
  /* Laptop: a tighter side gutter. */
186
189
  @media (max-width: 1279px) {
187
- .content {
188
- padding-inline: var(--padding-500);
190
+ .shell {
191
+ --shell-gutter: var(--padding-500);
189
192
  }
190
193
  }
191
194
 
@@ -194,6 +197,7 @@
194
197
  @media (max-width: 768px) {
195
198
  .shell {
196
199
  --shell-inset: var(--padding-400);
200
+ --shell-gutter: var(--shell-inset);
197
201
  }
198
202
 
199
203
  .shell .main,
@@ -215,7 +219,7 @@
215
219
  }
216
220
 
217
221
  .content {
218
- padding: var(--shell-inset) var(--shell-inset) var(--padding-1000);
222
+ padding: var(--shell-inset) var(--shell-gutter) var(--padding-1000);
219
223
  }
220
224
 
221
225
  /* Clear the menu button (40px) at the bar's left end. */
package/chat/ChatTabs.js CHANGED
@@ -16,7 +16,7 @@ function ChatTabs({ ariaLabel = "Open chats", closeLabel = "Close chat", statusL
16
16
  addLabel: threads.newThreadLabel,
17
17
  closeLabel,
18
18
  statusLabels,
19
- ariaLabel
19
+ "aria-label": ariaLabel
20
20
  }
21
21
  );
22
22
  }
@@ -266,8 +266,8 @@ export interface ChatWidgetProps {
266
266
  onAttachmentDownload?: AttachmentGroupProps['onDownload'];
267
267
  /** The words of the files on a sent message, over AttachmentGroup's English defaults: the list's name ("Attachments"), the overflow buttons ("Show 3 more", "Show fewer"), the tiles' status lines (`attachmentTileLabels`) and the viewer a pressed file opens in (`attachmentViewerLabels`). */
268
268
  attachmentGroupLabels?: Pick<AttachmentGroupProps, 'label' | 'showMoreLabel' | 'showLessLabel' | 'attachmentTileLabels' | 'attachmentViewerLabels'>;
269
- /** The conversation's names, over ChatThread's English defaults: the scrolling region ("Conversation") and the scroll-to-latest control ("Scroll to the latest message"). */
270
- chatThreadLabels?: Pick<ChatThreadProps, 'ariaLabel' | 'jumpLabel'>;
269
+ /** The conversation's names, over ChatThread's English defaults: the scrolling region ("Conversation", as `aria-label`; the deprecated `ariaLabel` still works) and the scroll-to-latest control ("Scroll to the latest message"). */
270
+ chatThreadLabels?: Pick<ChatThreadProps, 'aria-label' | 'ariaLabel' | 'jumpLabel'>;
271
271
  /** The model picker's words, over ModelPicker's English defaults: the open list's name ("Model") and the trigger's text when nothing is selected ("Choose a model"). The trigger's own name is `modelPickerLabel`. */
272
272
  modelPickerLabels?: Pick<ModelPickerProps, 'listLabel' | 'placeholder'>;
273
273
  /** The artifact panel's words, over ArtifactPanel's English defaults: the view switch ("Preview", "Code", "Artifact view"), the expand and close buttons ("Expand the artifact", "Collapse the artifact", "Close the artifact") and the code view's CodeBlock (`codeBlockLabels`). */
@@ -442,7 +442,7 @@ function ChatWidget({
442
442
  PromptSuggestions,
443
443
  {
444
444
  layout: "stack",
445
- ariaLabel: startersLabel,
445
+ "aria-label": startersLabel,
446
446
  pending: startersThinking,
447
447
  entrance: startersEntrance,
448
448
  suggestions: starters,
@@ -129,10 +129,10 @@ function DemoWelcome({
129
129
  onAsk
130
130
  }) {
131
131
  if (variant === "links") {
132
- return /* @__PURE__ */ jsx(PromptSuggestions, { layout: "tiles", ariaLabel: "Places to start", suggestions: LINKS, onValueChange: onAsk });
132
+ return /* @__PURE__ */ jsx(PromptSuggestions, { layout: "tiles", "aria-label": "Places to start", suggestions: LINKS, onValueChange: onAsk });
133
133
  }
134
134
  if (variant === "cards") {
135
- return /* @__PURE__ */ jsx(PromptSuggestions, { layout: "cards", ariaLabel: "Things to ask", suggestions: CARDS, onValueChange: onAsk });
135
+ return /* @__PURE__ */ jsx(PromptSuggestions, { layout: "cards", "aria-label": "Things to ask", suggestions: CARDS, onValueChange: onAsk });
136
136
  }
137
137
  if (variant === "dashboard") return /* @__PURE__ */ jsx(DemoBoard, { onAsk });
138
138
  return null;
@@ -23,7 +23,7 @@ function FollowupSuggestions({
23
23
  {
24
24
  className: "ds-chat-widget__followups",
25
25
  layout: "stack",
26
- ariaLabel: rowLabel,
26
+ "aria-label": rowLabel,
27
27
  chosenLabel,
28
28
  pending,
29
29
  entrance,
@@ -0,0 +1,78 @@
1
+ /* ============================================
2
+ ACTION BAR
3
+ A summary line and the primary actions, docked
4
+ to the bottom of a long list or form
5
+ ============================================ */
6
+
7
+ /* Base */
8
+ .ds-action-bar {
9
+ /* The surface the bar reads as one with: the blur's tint with the blur
10
+ on, the fill with it off. An override hook: a bar over a container
11
+ points it at that container's fill. */
12
+ --ds-action-bar-surface: var(--color-bg-page-primary);
13
+ /* How far above the bar the blur reaches, so the content dissolves into
14
+ it rather than stopping at its edge. */
15
+ --ds-action-bar-blur-reach: var(--gap-1500);
16
+ position: relative;
17
+ /* Its own stacking context, so the blur's z-index of -1 paints behind
18
+ the summary and the actions but never behind the content it covers. */
19
+ isolation: isolate;
20
+ display: flex;
21
+ flex-wrap: wrap;
22
+ align-items: center;
23
+ gap: var(--gap-300) var(--gap-500);
24
+ box-sizing: border-box;
25
+ inline-size: 100%;
26
+ padding-block: var(--padding-400);
27
+ padding-inline: var(--padding-500);
28
+ }
29
+
30
+ /* Sticky: holds to the bottom edge of its scroll container. */
31
+ .ds-action-bar--sticky {
32
+ position: sticky;
33
+ inset-block-end: 0;
34
+ z-index: var(--layer-sticky);
35
+ }
36
+
37
+ /* Blur: the stack reaches above the bar, behind its content. The space
38
+ above the bar in flow is the same reach, so at the end of the scroll
39
+ the last row clears the blur instead of resting under it. */
40
+ .ds-action-bar--blur {
41
+ margin-block-start: var(--ds-action-bar-blur-reach);
42
+ }
43
+
44
+ .ds-action-bar__blur.ds-progressive-blur {
45
+ --ds-progressive-blur-tint: var(--ds-action-bar-surface);
46
+ inset-block-start: calc(var(--ds-action-bar-blur-reach) * -1);
47
+ z-index: -1;
48
+ }
49
+
50
+ /* Solid: the bar's own surface, parted from the content by a hairline. */
51
+ .ds-action-bar--solid {
52
+ background-color: var(--ds-action-bar-surface);
53
+ border-block-start: var(--border-025) solid var(--color-divider);
54
+ }
55
+
56
+ /* Summary: takes the room at the start; a long line wraps rather than
57
+ pushing the actions off the bar. */
58
+ .ds-action-bar__summary {
59
+ flex: 1 1 auto;
60
+ min-inline-size: 0;
61
+ font-family: var(--font-paragraph-family);
62
+ font-size: var(--font-paragraph-size);
63
+ font-weight: var(--font-paragraph-weight);
64
+ line-height: var(--font-paragraph-line-height);
65
+ letter-spacing: var(--font-paragraph-letter-spacing);
66
+ color: var(--color-text-primary);
67
+ overflow-wrap: anywhere;
68
+ }
69
+
70
+ /* Actions: hold the end edge, on the summary's row or wrapped below it. */
71
+ .ds-action-bar__actions {
72
+ display: flex;
73
+ flex-wrap: wrap;
74
+ align-items: center;
75
+ justify-content: flex-end;
76
+ gap: var(--gap-300);
77
+ margin-inline-start: auto;
78
+ }
@@ -0,0 +1,40 @@
1
+ import { default as React } from 'react';
2
+ /** Props owned by ActionBar itself; everything else falls through to the root `<div>`. */
3
+ type ActionBarOwnProps = {
4
+ /**
5
+ * The summary line at the bar's start, such as "23 students still to
6
+ * mark". It is a polite live region, so a count that changes while the
7
+ * reader works is announced once it settles.
8
+ */
9
+ summary?: React.ReactNode;
10
+ /**
11
+ * The actions at the bar's end, typically one or two Buttons with the
12
+ * primary action last. On a narrow bar they wrap below the summary and
13
+ * hold the end edge.
14
+ */
15
+ actions?: React.ReactNode;
16
+ /**
17
+ * Whether the bar holds to the bottom of its scroll container while the
18
+ * content scrolls under it. Off, it sits in flow after the content.
19
+ */
20
+ sticky?: boolean;
21
+ /**
22
+ * Whether the content fades under a progressive blur that reaches above
23
+ * the bar. Off, the bar is a solid surface with a hairline at its top
24
+ * edge.
25
+ */
26
+ blur?: boolean;
27
+ /** Additional CSS classes on the root. */
28
+ className?: string;
29
+ };
30
+ export interface ActionBarProps extends ActionBarOwnProps, Omit<React.ComponentPropsWithRef<'div'>, keyof ActionBarOwnProps> {
31
+ }
32
+ /**
33
+ * A bar docked to the bottom of a long list or form, holding a summary
34
+ * line and the primary actions, with the content fading under a
35
+ * progressive blur rather than being cut off at the bar's edge. The
36
+ * forwarded ref and any unrecognised props target the root `<div>`, so a
37
+ * host that wants a landmark passes `role="region"` with an `aria-label`.
38
+ */
39
+ export declare function ActionBar({ summary, actions, sticky, blur, className, ref, ...rest }: ActionBarProps): React.JSX.Element;
40
+ export {};
@@ -0,0 +1,29 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import "react";
3
+ import { ProgressiveBlur } from "../ProgressiveBlur/ProgressiveBlur.js";
4
+ import "./ActionBar.css";
5
+ function ActionBar({
6
+ summary,
7
+ actions,
8
+ sticky = true,
9
+ blur = true,
10
+ className = "",
11
+ ref,
12
+ ...rest
13
+ }) {
14
+ const baseClass = "ds-action-bar";
15
+ const classes = [
16
+ baseClass,
17
+ sticky && `${baseClass}--sticky`,
18
+ blur ? `${baseClass}--blur` : `${baseClass}--solid`,
19
+ className
20
+ ].filter(Boolean).join(" ");
21
+ return /* @__PURE__ */ jsxs("div", { ...rest, ref, className: classes, children: [
22
+ blur && /* @__PURE__ */ jsx(ProgressiveBlur, { side: "bottom", tinted: true, className: `${baseClass}__blur` }),
23
+ /* @__PURE__ */ jsx("div", { className: `${baseClass}__summary`, "aria-live": "polite", "aria-atomic": "true", children: summary }),
24
+ actions != null && actions !== false && /* @__PURE__ */ jsx("div", { className: `${baseClass}__actions`, children: actions })
25
+ ] });
26
+ }
27
+ export {
28
+ ActionBar
29
+ };
@@ -300,7 +300,7 @@ const AiButton = React.forwardRef(
300
300
  {
301
301
  layout: "stack",
302
302
  size: "compact",
303
- ariaLabel: suggestionsLabel,
303
+ "aria-label": suggestionsLabel,
304
304
  suggestions: summary.suggestions,
305
305
  onValueChange: onSummarySuggestion
306
306
  }
@@ -94,6 +94,22 @@
94
94
  margin: 0;
95
95
  }
96
96
 
97
+ /* Markup in the description: paragraphs and lists stack at the content's
98
+ own gap, with no browser margins, and a list keeps its markers inside the
99
+ content column. Links are the Link component's inline form, which already
100
+ takes the sentence's colour. */
101
+ .ds-alert__description > :where(p, ul, ol) {
102
+ margin: 0;
103
+ }
104
+
105
+ .ds-alert__description > * + :where(p, ul, ol) {
106
+ margin-block-start: var(--gap-100); /* 4px */
107
+ }
108
+
109
+ .ds-alert__description :where(ul, ol) {
110
+ padding-inline-start: var(--padding-500); /* 20px */
111
+ }
112
+
97
113
  /* ============================================
98
114
  ACTIONS
99
115
  ============================================ */
@@ -6,8 +6,8 @@ type AlertOwnProps = {
6
6
  * Note: this shadows the native `title` tooltip attribute, which Alert does not expose.
7
7
  */
8
8
  title?: string;
9
- /** Alert description / body text */
10
- description?: string;
9
+ /** The body under the title. Plain text is the usual case; it also takes a short run of markup, such as a sentence with a Link in it or a list of two or three items. */
10
+ description?: React.ReactNode;
11
11
  /** Alert variant determines colour and icon */
12
12
  variant?: 'info' | 'positive' | 'warning' | 'error' | 'neutral';
13
13
  /** Component size */
@@ -39,7 +39,9 @@ const Alert = React.forwardRef(
39
39
  ) : /* @__PURE__ */ jsx("span", { className: `${baseClass}__icon`, "aria-hidden": "true", children: iconValue }),
40
40
  /* @__PURE__ */ jsxs("div", { className: `${baseClass}__content`, children: [
41
41
  title && /* @__PURE__ */ jsx("p", { className: `${baseClass}__title`, children: title }),
42
- description && /* @__PURE__ */ jsx("p", { className: `${baseClass}__description`, children: description }),
42
+ description != null && description !== false && description !== "" && // Text sits in a paragraph; markup gets a div, since a paragraph
43
+ // cannot hold another paragraph or a list.
44
+ (typeof description === "string" || typeof description === "number" ? /* @__PURE__ */ jsx("p", { className: `${baseClass}__description`, children: description }) : /* @__PURE__ */ jsx("div", { className: `${baseClass}__description`, children: description })),
43
45
  action != null && action !== false && /* @__PURE__ */ jsx("div", { className: `${baseClass}__actions`, children: action })
44
46
  ] }),
45
47
  dismissible && /* @__PURE__ */ jsx(
@@ -233,10 +233,10 @@
233
233
  justify-content: space-between;
234
234
  height: 40px;
235
235
  min-width: 0;
236
- /* The same inset in both states: in the collapsed 64px rail the 12px
237
- margins leave a 40px row, so the hover pill is a perfect circle clear
238
- of the rail edges, with the icon centred (12 + 8 + 24 + 8 + 12 = 64);
239
- expanded, these are the pill's edge inset. Nothing to transition. */
236
+ /* Collapsed, the 12px margins leave a 40px row in the 64px rail, so the
237
+ hover pill is a perfect circle clear of the rail edges, with the icon
238
+ centred (12 + 8 + 24 + 8 + 12 = 64). Expanded, the start side trades
239
+ 4px of margin for 4px of padding (the --expanded rule below). */
240
240
  margin: 0 var(--padding-300);
241
241
  padding: var(--padding-200);
242
242
  border-radius: var(--radius-pill);
@@ -255,6 +255,18 @@
255
255
  before), so the pill floats off the rail edges while the icon and label
256
256
  keep their exact x-positions against the category labels above. */
257
257
 
258
+ /* Expanded, the pill's start curve bent right up to the icon 8px in, and
259
+ the icon read as crammed against the highlight's edge. The start side
260
+ trades 4px of margin for 4px of padding (8 + 12, still 20), so the icon
261
+ holds its x and the pill reaches a step toward the rail's edge. Margin
262
+ and padding glide on the same duration and easing, so their sum stays 20
263
+ through the sweep and the icon never moves. Not panel mode, whose rows
264
+ keep one seat of their own. */
265
+ .ds-app-sidebar--expanded:not(.ds-app-sidebar--panel-mode) .ds-app-sidebar__btn {
266
+ margin-inline-start: var(--padding-200);
267
+ padding-inline-start: var(--padding-300);
268
+ }
269
+
258
270
  .ds-app-sidebar__btn:hover {
259
271
  background-color: var(--color-action-passive-bg-hover);
260
272
  }
@@ -778,6 +790,82 @@
778
790
  border-inline-end-color: transparent;
779
791
  }
780
792
 
793
+ /* ============================================
794
+ CONTAINED — the rail laid out in its parent
795
+ (fixed={false}), for a framed preview
796
+ or a layout that is not the whole page. The
797
+ parent is a flex row with a definite height.
798
+ Every piece that is fixed to the viewport
799
+ above takes its place in that row instead,
800
+ held there by position: sticky, and a piece
801
+ that overlays (the panel while hidden, the
802
+ phone drawer, its scrim) gives its width
803
+ back with a negative end margin, so none of
804
+ them needs a positioned ancestor. Small
805
+ local stacking values, not the layer tokens:
806
+ the rail stacks only against its own
807
+ neighbours in the frame, never the page.
808
+ ============================================ */
809
+ .ds-app-sidebar--contained {
810
+ position: sticky;
811
+ top: 0;
812
+ /* Sticky honours an inline offset too, which would pin the rail against
813
+ a scrolling ancestor's edge; the row places it instead. */
814
+ inset-inline-start: auto;
815
+ z-index: 3;
816
+ flex: none;
817
+ height: 100%;
818
+ }
819
+
820
+ .ds-app-sidebar--contained.ds-app-sidebar--floating {
821
+ top: var(--ds-sidebar-float-inset, 20px);
822
+ inset-inline-start: auto;
823
+ height: calc(100% - var(--ds-sidebar-float-inset, 20px) * 2);
824
+ margin-block: var(--ds-sidebar-float-inset, 20px);
825
+ margin-inline-start: var(--ds-sidebar-float-inset, 20px);
826
+ }
827
+
828
+ /* The panel follows the rail in the row, so it tracks the rail's width
829
+ with no offsets of its own. Shown, it takes its width beside the rail
830
+ and the content gives way, as AppLayout reserves it; hidden, its end
831
+ margin hands the width back on the same glide. */
832
+ .ds-app-sidebar__panel--contained {
833
+ position: sticky;
834
+ top: 0;
835
+ inset-inline-start: auto;
836
+ z-index: 2;
837
+ flex: none;
838
+ height: 100%;
839
+ margin-inline-end: calc(-1 * var(--ds-sidebar-panel-width, 240px));
840
+ transition:
841
+ margin var(--motion-duration-slow) var(--motion-ease-emphasized),
842
+ opacity var(--motion-duration-base) var(--motion-ease-standard),
843
+ transform var(--motion-duration-slow) var(--motion-ease-emphasized),
844
+ visibility 0s linear var(--motion-duration-base);
845
+ }
846
+
847
+ .ds-app-sidebar__panel--contained.ds-app-sidebar__panel--visible {
848
+ margin-inline-end: 0;
849
+ transition:
850
+ margin var(--motion-duration-slow) var(--motion-ease-emphasized),
851
+ opacity var(--motion-duration-base) var(--motion-ease-standard),
852
+ transform var(--motion-duration-slow) var(--motion-ease-emphasized),
853
+ visibility 0s linear 0s;
854
+ }
855
+
856
+ .ds-app-sidebar__panel--contained.ds-app-sidebar__panel--floating {
857
+ top: var(--ds-sidebar-float-inset, 20px);
858
+ inset-inline-start: auto;
859
+ height: calc(100% - var(--ds-sidebar-float-inset, 20px) * 2);
860
+ margin-block: var(--ds-sidebar-float-inset, 20px);
861
+ margin-inline-start: var(--gap-300);
862
+ margin-inline-end: calc(-1 * (var(--ds-sidebar-panel-width, 240px) + var(--gap-300)));
863
+ }
864
+
865
+ .ds-app-sidebar__panel--contained.ds-app-sidebar__panel--floating.ds-app-sidebar__panel--visible {
866
+ margin-inline-end: 0;
867
+ }
868
+
781
869
  /* ============================================
782
870
  PANEL MODE RAIL — labels under icons
783
871
  With the second level in the panel, the
@@ -835,6 +923,12 @@
835
923
  height: 40px;
836
924
  }
837
925
 
926
+ /* A collapsed EntitySwitcher in the top slot centres its mark on the row
927
+ icons' axis, so it takes the panel rows' deeper icon inset. */
928
+ .ds-app-sidebar--panel-mode .ds-app-sidebar__top-slot {
929
+ --ds-entity-switcher-rail-inset: var(--padding-400);
930
+ }
931
+
838
932
  .ds-app-sidebar--panel-mode .ds-app-sidebar__btn-left {
839
933
  height: 24px;
840
934
  }
@@ -1017,6 +1111,48 @@
1017
1111
  }
1018
1112
  }
1019
1113
 
1114
+ /* Contained, the phone drawer stays in its parent: the trigger sits at
1115
+ the parent's top start corner (an absolute box with no offsets keeps its
1116
+ place in the row and takes none of it), and the scrim and the drawer
1117
+ cover the parent's height from its start, each handing its width back
1118
+ with an end margin. The drawer's body scroll lock still holds the page. */
1119
+ @media (max-width: 768px) {
1120
+ .ds-app-sidebar--contained.ds-app-sidebar--floating:not(.ds-app-sidebar--mobile-open) {
1121
+ margin: 0;
1122
+ }
1123
+
1124
+ .ds-app-sidebar__mobile-trigger--contained {
1125
+ position: absolute;
1126
+ top: auto;
1127
+ inset-inline-start: auto;
1128
+ z-index: 1;
1129
+ margin-block-start: var(--padding-400);
1130
+ margin-inline-start: var(--padding-400);
1131
+ }
1132
+
1133
+ .ds-app-sidebar__scrim--contained {
1134
+ position: sticky;
1135
+ inset: auto;
1136
+ top: 0;
1137
+ z-index: 2;
1138
+ flex: none;
1139
+ width: 100%;
1140
+ height: 100%;
1141
+ margin-inline-end: -100%;
1142
+ }
1143
+
1144
+ .ds-app-sidebar--contained.ds-app-sidebar--mobile-open {
1145
+ position: sticky;
1146
+ top: 0;
1147
+ bottom: auto;
1148
+ inset-inline-start: auto;
1149
+ z-index: 3;
1150
+ height: 100%;
1151
+ margin: 0;
1152
+ margin-inline-end: -280px; /* ds-allow(spacing): the drawer's own 280px width, handed back to the row */
1153
+ }
1154
+ }
1155
+
1020
1156
  @keyframes ds-app-sidebar-slide-in {
1021
1157
  from {
1022
1158
  transform: translateX(calc(-100% * var(--ds-inline-sign, 1)));
@@ -117,6 +117,18 @@ type AppSidebarOwnProps = {
117
117
  * @deprecated Use `layout="floating"`.
118
118
  */
119
119
  floating?: boolean;
120
+ /**
121
+ * Pin the rail to the viewport. `true` (the default) fixes it to the
122
+ * viewport's start edge at the viewport's height, with the side panel and
123
+ * the phone drawer fixed beside it, as a full-page app wants. `false`
124
+ * lays it out in its parent instead, for a framed preview or a layout that
125
+ * is not the whole page: the parent is a flex row with a definite height,
126
+ * the rail is its first item at the parent's height (sticky, so it holds
127
+ * while the parent scrolls), and the content beside it gives way as the
128
+ * rail expands and the side panel opens. On a phone the trigger, the scrim
129
+ * and the drawer stay inside the parent too.
130
+ */
131
+ fixed?: boolean;
120
132
  /** Rendered under the logo row, above the nav; fades out while collapsed */
121
133
  topSlot?: React.ReactNode;
122
134
  /** Keeps `topSlot` shown while collapsed instead of fading it, clipped by the sweeping rail as the nav rows are, for content that draws its own collapsed form: a switcher that holds its mark on the rail's axis and fades the rest. The slot carries `data-expanded`, so its content can key off the rail's state */