rift-ds 1.29.0 → 1.30.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 (126) hide show
  1. package/README.md +4 -3
  2. package/bin/rift-ds.mjs +1 -1
  3. package/bin/templates/app/components/rift/ColorModeScript.tsx +7 -3
  4. package/bin/templates/blocks/app/settings/ProfileForm.tsx +98 -0
  5. package/bin/templates/blocks/app/settings/page.module.css +11 -0
  6. package/bin/templates/blocks/app/settings/page.tsx +84 -0
  7. package/bin/templates/blocks/components/blocks/AppShell.module.css +8 -41
  8. package/bin/templates/blocks/components/blocks/AppShell.tsx +9 -11
  9. package/bin/templates/blocks/registry.json +13 -0
  10. package/bin/templates/chat/app/api/chat/feedback/route.ts +0 -3
  11. package/bin/templates/chat/app/api/chat/followups/route.ts +0 -3
  12. package/bin/templates/chat/app/api/chat/route.ts +0 -2
  13. package/chat/ChatLauncher.d.ts +9 -1
  14. package/chat/ChatLauncher.js +3 -1
  15. package/components/Alert/Alert.css +12 -0
  16. package/components/Alert/Alert.d.ts +2 -0
  17. package/components/Alert/Alert.js +3 -1
  18. package/components/Attachment/Attachment.css +92 -0
  19. package/components/Attachment/FileRow.d.ts +47 -0
  20. package/components/Attachment/FileRow.js +38 -0
  21. package/components/Avatar/Avatar.css +14 -0
  22. package/components/Avatar/Avatar.d.ts +3 -1
  23. package/components/Avatar/Avatar.js +3 -2
  24. package/components/Chart/AreaChart.d.ts +2 -0
  25. package/components/Chart/AreaChart.js +2 -1
  26. package/components/Chart/BarChart.d.ts +2 -0
  27. package/components/Chart/BarChart.js +2 -1
  28. package/components/Chart/ComboChart.d.ts +4 -0
  29. package/components/Chart/ComboChart.js +4 -2
  30. package/components/Chart/LineChart.d.ts +2 -0
  31. package/components/Chart/LineChart.js +2 -1
  32. package/components/Chart/PieChart.d.ts +4 -4
  33. package/components/Chart/PieChart.js +1 -1
  34. package/components/Chart/ScatterChart.d.ts +2 -0
  35. package/components/Chart/ScatterChart.js +2 -1
  36. package/components/Checklist/Checklist.css +123 -0
  37. package/components/Checklist/Checklist.d.ts +66 -0
  38. package/components/Checklist/Checklist.js +115 -0
  39. package/components/CircularButton/CircularButton.css +39 -0
  40. package/components/CircularButton/CircularButton.d.ts +13 -0
  41. package/components/CircularButton/CircularButton.js +18 -4
  42. package/components/ColourSwatch/ColourSwatch.css +3 -1
  43. package/components/ColourSwatch/ColourSwatch.d.ts +5 -3
  44. package/components/ColourSwatch/ColourSwatch.js +5 -0
  45. package/components/Combobox/Combobox.d.ts +4 -2
  46. package/components/Combobox/Combobox.js +7 -3
  47. package/components/DataTable/DataTable.css +35 -0
  48. package/components/DataTable/DataTable.d.ts +34 -2
  49. package/components/DataTable/DataTable.js +58 -5
  50. package/components/DataTable/columnTypes.d.ts +1 -1
  51. package/components/DataTable/columnTypes.js +1 -1
  52. package/components/DateInput/DateInput.d.ts +4 -2
  53. package/components/DateInput/DateInput.js +7 -3
  54. package/components/DescriptionList/DescriptionList.css +28 -0
  55. package/components/DescriptionList/DescriptionList.d.ts +3 -1
  56. package/components/DescriptionList/DescriptionList.js +4 -3
  57. package/components/DescriptionList/DescriptionListCopy.js +2 -0
  58. package/components/Dropdown/Dropdown.d.ts +4 -2
  59. package/components/Dropdown/Dropdown.js +7 -3
  60. package/components/EmptyState/EmptyState.css +12 -0
  61. package/components/EmptyState/EmptyState.d.ts +7 -0
  62. package/components/EmptyState/EmptyState.js +2 -0
  63. package/components/EventCalendar/EventCalendar.css +59 -0
  64. package/components/EventCalendar/EventCalendar.d.ts +24 -2
  65. package/components/EventCalendar/EventCalendar.js +104 -19
  66. package/components/FormSection/FormSection.css +70 -0
  67. package/components/FormSection/FormSection.d.ts +35 -0
  68. package/components/FormSection/FormSection.js +35 -0
  69. package/components/Grid/Grid.css +52 -0
  70. package/components/Grid/Grid.d.ts +30 -0
  71. package/components/Grid/Grid.js +36 -0
  72. package/components/Icon/Icon.css +55 -0
  73. package/components/Icon/Icon.d.ts +27 -0
  74. package/components/Icon/Icon.js +42 -0
  75. package/components/NumberInput/NumberInput.d.ts +4 -2
  76. package/components/NumberInput/NumberInput.js +7 -3
  77. package/components/OrgChart/OrgChart.css +143 -0
  78. package/components/OrgChart/OrgChart.d.ts +44 -0
  79. package/components/OrgChart/OrgChart.js +26 -0
  80. package/components/PageHeader/PageHeader.css +74 -0
  81. package/components/PageHeader/PageHeader.d.ts +39 -0
  82. package/components/PageHeader/PageHeader.js +33 -0
  83. package/components/Panel/Panel.css +7 -0
  84. package/components/Panel/Panel.d.ts +5 -2
  85. package/components/Panel/Panel.js +2 -1
  86. package/components/ResourceTimeline/ResourceTimeline.css +194 -0
  87. package/components/ResourceTimeline/ResourceTimeline.d.ts +57 -0
  88. package/components/ResourceTimeline/ResourceTimeline.js +129 -0
  89. package/components/ShaderField/useShaderField.js +13 -1
  90. package/components/ShaderScene/ShaderScene.d.ts +3 -2
  91. package/components/ShaderScene/ShaderScene.js +47 -4
  92. package/components/Stack/Stack.css +68 -0
  93. package/components/Stack/Stack.d.ts +37 -0
  94. package/components/Stack/Stack.js +39 -0
  95. package/components/Stat/Stat.css +65 -0
  96. package/components/Stat/Stat.d.ts +7 -1
  97. package/components/Stat/Stat.js +16 -1
  98. package/components/Table/Table.css +11 -0
  99. package/components/Table/Table.d.ts +2 -0
  100. package/components/Table/Table.js +5 -1
  101. package/components/Tabs/Tabs.css +23 -0
  102. package/components/Tabs/Tabs.d.ts +9 -8
  103. package/components/Tabs/Tabs.js +38 -5
  104. package/components/Textarea/Textarea.d.ts +4 -2
  105. package/components/Textarea/Textarea.js +7 -3
  106. package/components/ThemeToggle/colorMode.d.ts +17 -1
  107. package/components/ThemeToggle/colorMode.js +11 -2
  108. package/components/Widget/Widget.css +21 -0
  109. package/components/Widget/Widget.d.ts +4 -0
  110. package/components/Widget/Widget.js +13 -5
  111. package/components/Wizard/Wizard.css +67 -0
  112. package/components/Wizard/Wizard.d.ts +54 -0
  113. package/components/Wizard/Wizard.js +71 -0
  114. package/components/registry.d.ts +25 -0
  115. package/components/registry.js +8 -0
  116. package/components/registry.json +233 -32
  117. package/components/registry.json.d.ts +233 -32
  118. package/components/registry.json.js +1 -1
  119. package/index.d.ts +10 -0
  120. package/index.js +20 -0
  121. package/package.json +1 -1
  122. package/tokens/motion.d.ts +2 -0
  123. package/tokens/motion.js +2 -0
  124. package/tokens/values.d.ts +31 -0
  125. package/tokens/values.js +16 -0
  126. package/tokens/values.json.js +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 -->178<!-- /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 -->188<!-- /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.
@@ -101,6 +101,7 @@ import 'rift-ds/tokens/presets/presets.css';
101
101
  ```
102
102
 
103
103
  - **Dark mode**: `data-theme="dark"` on the root element; light is the default.
104
+ - **Theme names**: a preset's id is its `data-brand` value and stylesheet name, which can differ from the name a theme menu shows (Signal ships as `plum`). `SHIPPED_THEMES` from `rift-ds/tokens/values` lists every theme with its name and attribute, and `shippedThemeOptions()` hands ThemePicker the same list with each theme's swatch. To apply a stored theme before first paint, pass `colorModeScript({ brandStorageKey })` the key you keep it under.
104
105
  - **Page colours**: the token stylesheet defines custom properties and styles no element, so paint the page once: set `background: var(--color-bg-page-primary)`, `color: var(--color-text-primary)` and `font-family: var(--font-family-primary)` on `body`. Without it a dark theme lands as dark components on a white page.
105
106
  - **Your own brand**: every semantic token chains to a primitive, so overriding one primitive re-themes everything built on it. The [playground](https://rift-ds.com/playground) restyles the system live and copies out a complete, paste-ready override.
106
107
  - **One part of a shipped theme**: the token and theme stylesheets sit in cascade layers (`rift.tokens`, then `rift.preset`), so any rule of your own outranks them whatever its selector. A plain `:root { --font-family-primary: … }` keeps a preset's colours with your face, in light and dark alike. To set a default that a preset still replaces, declare it inside `@layer rift.tokens { … }`.
@@ -109,13 +110,13 @@ import 'rift-ds/tokens/presets/presets.css';
109
110
 
110
111
  ## Components
111
112
 
112
- <!-- component-count -->178<!-- /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).
113
+ <!-- component-count -->188<!-- /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).
113
114
 
114
115
  <details>
115
116
  <summary>The full list</summary>
116
117
 
117
118
  <!-- component-list:start -->
118
- 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 · 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 · Chip · Circular button · Code block · Code diff · Colour picker · Combo chart · Combobox · Command palette · Command palette trigger · Composer · Contact card · Context menu · Contribution graph · Currency input · Data table · Date input · Date picker · Date range picker · Deadline · 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 · Filter bar · Funnel chart · Gantt chart · Gauge · Globe · Heading · Hover card · 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 · Message actions · Message card · Meter · Model picker · Nav · Nav list · Notification centre · Number input · 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 · Rich dropdown · Scatter chart · Section title · Segmented control · Selection card · Shader field · Shader scene · Sidebar panel · Signature pad · Site header · Skeleton · Slider · Source chip · Source trail · Sparkline · Spinner · Split button · Split pane · 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 · World map
119
+ 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 · 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 · Circular button · Code block · Code diff · Colour picker · Combo chart · Combobox · Command palette · Command palette trigger · Composer · Contact card · Context menu · Contribution graph · Currency input · Data table · Date input · Date picker · Date range picker · Deadline · 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 · 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 · 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 header · 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
119
120
  <!-- component-list:end -->
120
121
 
121
122
  </details>
package/bin/rift-ds.mjs CHANGED
@@ -121,7 +121,7 @@ init chat
121
121
 
122
122
  init block [<name>]
123
123
  Copies a block into a Next.js app router project: a whole starting page
124
- (an app shell, a dashboard, a sign-in, a shader scene) built from the
124
+ (an app shell, a dashboard, a settings page and more) built from the
125
125
  library, its page under app/ and any shared parts under
126
126
  components/blocks/. The files are yours from then on. With no name,
127
127
  lists the blocks. Run init app first. Existing files are never
@@ -1,10 +1,14 @@
1
- import { colorModeScript } from 'rift-ds/components/ThemeToggle/colorMode';
1
+ import { colorModeScript, type ColorModeScriptOptions } from 'rift-ds/components/ThemeToggle/colorMode';
2
2
 
3
3
  /**
4
4
  * Applies the visitor's stored colour mode before first paint, so a
5
5
  * returning visitor never sees the wrong mode flash. Render it in your root
6
6
  * layout's <head>. ThemeToggle reads and changes the same setting.
7
+ *
8
+ * If your app lets the visitor pick a theme, store the preset id under a key
9
+ * of your own and pass it as `brandStorageKey`: the script then applies that
10
+ * theme before first paint too.
7
11
  */
8
- export function ColorModeScript() {
9
- return <script dangerouslySetInnerHTML={{ __html: colorModeScript() }} />;
12
+ export function ColorModeScript(options: ColorModeScriptOptions) {
13
+ return <script dangerouslySetInnerHTML={{ __html: colorModeScript(options) }} />;
10
14
  }
@@ -0,0 +1,98 @@
1
+ 'use client';
2
+
3
+ /**
4
+ * The settings block's profile section: a form that checks every field in
5
+ * one pass when it is saved. The checks write one record of messages by
6
+ * field name; fieldErrorsFrom turns it into ErrorSummary's list and each
7
+ * field's errorText, so the summary and the fields can never disagree.
8
+ * Replace `check` with your own rules, or with the errors your server
9
+ * returns.
10
+ */
11
+
12
+ import { useState } from 'react';
13
+ import { Button } from 'rift-ds/components/Button/Button';
14
+ import { ErrorSummary, fieldErrorsFrom } from 'rift-ds/components/ErrorSummary/ErrorSummary';
15
+ import { FormSection } from 'rift-ds/components/FormSection/FormSection';
16
+ import { Input } from 'rift-ds/components/Input/Input';
17
+
18
+ const FIELDS = ['firstName', 'lastName', 'email'] as const;
19
+ type Field = (typeof FIELDS)[number];
20
+
21
+ function check(values: Record<Field, string>): Partial<Record<Field, string>> {
22
+ const errors: Partial<Record<Field, string>> = {};
23
+ if (!values.firstName.trim()) errors.firstName = 'Enter your first name.';
24
+ if (!values.lastName.trim()) errors.lastName = 'Enter your last name.';
25
+ if (!/^\S+@\S+\.\S+$/.test(values.email)) errors.email = 'Enter an email address like name@example.com.';
26
+ return errors;
27
+ }
28
+
29
+ export function ProfileForm() {
30
+ const [values, setValues] = useState<Record<Field, string>>({
31
+ firstName: 'Ada',
32
+ lastName: 'Lovelace',
33
+ email: 'ada@example.com',
34
+ });
35
+ const [submitted, setSubmitted] = useState(false);
36
+ const [saved, setSaved] = useState(false);
37
+
38
+ const { errors, errorText } = fieldErrorsFrom(submitted ? check(values) : {}, {
39
+ order: [...FIELDS],
40
+ idFor: (name) => `profile-${name}`,
41
+ });
42
+
43
+ const set = (field: Field) => (value: string) => {
44
+ setSaved(false);
45
+ setValues((current) => ({ ...current, [field]: value }));
46
+ };
47
+
48
+ const save = () => {
49
+ setSubmitted(true);
50
+ // Save here when the check passes, and show what your server returns.
51
+ setSaved(Object.keys(check(values)).length === 0);
52
+ };
53
+
54
+ return (
55
+ <form
56
+ noValidate
57
+ onSubmit={(event) => {
58
+ event.preventDefault();
59
+ save();
60
+ }}
61
+ >
62
+ <ErrorSummary errors={errors} />
63
+ <FormSection
64
+ layout="aside"
65
+ columns={2}
66
+ title="Profile"
67
+ description="How you appear to the people you work with."
68
+ actions={<Button label={saved ? 'Saved' : 'Save profile'} onClick={save} />}
69
+ >
70
+ <Input
71
+ id="profile-firstName"
72
+ label="First name"
73
+ value={values.firstName}
74
+ onValueChange={set('firstName')}
75
+ errorText={errorText.firstName}
76
+ required
77
+ />
78
+ <Input
79
+ id="profile-lastName"
80
+ label="Last name"
81
+ value={values.lastName}
82
+ onValueChange={set('lastName')}
83
+ errorText={errorText.lastName}
84
+ required
85
+ />
86
+ <Input
87
+ id="profile-email"
88
+ label="Email"
89
+ type="email"
90
+ value={values.email}
91
+ onValueChange={set('email')}
92
+ errorText={errorText.email}
93
+ required
94
+ />
95
+ </FormSection>
96
+ </form>
97
+ );
98
+ }
@@ -0,0 +1,11 @@
1
+ /* The settings column: one section under another, held to a reading width
2
+ so a row of fields never stretches across a wide screen. Each section
3
+ lays its heading beside its fields once it has the room, and stacks them
4
+ on a phone. */
5
+
6
+ .column {
7
+ display: flex;
8
+ flex-direction: column;
9
+ gap: var(--gap-1000);
10
+ max-width: 880px;
11
+ }
@@ -0,0 +1,84 @@
1
+ /**
2
+ * The settings block: the app shell with a column of FormSections, each a
3
+ * heading and a sentence beside its fields, and each saving on its own. The
4
+ * values are placeholders; read and write your own.
5
+ *
6
+ * The profile section is a client form (ProfileForm.tsx beside this page)
7
+ * that checks every field in one pass on save: the errors go to an
8
+ * ErrorSummary at the top of the form and to each field's errorText, both
9
+ * from one record through fieldErrorsFrom. The other sections render from
10
+ * this server page.
11
+ */
12
+
13
+ import { Button } from 'rift-ds/components/Button/Button';
14
+ import { Dropdown } from 'rift-ds/components/Dropdown/Dropdown';
15
+ import { FormSection } from 'rift-ds/components/FormSection/FormSection';
16
+ import { ToggleSwitch } from 'rift-ds/components/ToggleSwitch/ToggleSwitch';
17
+ import { AppShell } from '../../components/blocks/AppShell';
18
+ import { ProfileForm } from './ProfileForm';
19
+ import styles from './page.module.css';
20
+
21
+ export default function SettingsPage() {
22
+ return (
23
+ <AppShell
24
+ activeKey="settings"
25
+ breadcrumb={[{ label: 'Workspace', href: '#' }, { label: 'Settings' }]}
26
+ title="Settings"
27
+ >
28
+ <div className={styles.column}>
29
+ <ProfileForm />
30
+
31
+ <FormSection
32
+ layout="aside"
33
+ divider
34
+ title="Notifications"
35
+ description="What we email you about. Changes apply from the next message."
36
+ actions={<Button label="Save notifications" />}
37
+ >
38
+ <ToggleSwitch label="A weekly summary" defaultChecked />
39
+ <ToggleSwitch label="When someone mentions you" defaultChecked />
40
+ <ToggleSwitch label="Product news" />
41
+ </FormSection>
42
+
43
+ <FormSection
44
+ layout="aside"
45
+ divider
46
+ columns={2}
47
+ title="Region"
48
+ description="How dates, times and numbers are written for you."
49
+ actions={<Button label="Save region" />}
50
+ >
51
+ <Dropdown
52
+ label="Language"
53
+ defaultValue="en"
54
+ options={[
55
+ { value: 'en', label: 'English' },
56
+ { value: 'de', label: 'Deutsch' },
57
+ { value: 'fr', label: 'Français' },
58
+ ]}
59
+ />
60
+ <Dropdown
61
+ label="Time zone"
62
+ defaultValue="utc"
63
+ options={[
64
+ { value: 'utc', label: 'UTC' },
65
+ { value: 'cet', label: 'Central European' },
66
+ { value: 'pt', label: 'Pacific' },
67
+ ]}
68
+ />
69
+ </FormSection>
70
+
71
+ <FormSection
72
+ layout="aside"
73
+ divider
74
+ title="Delete workspace"
75
+ description="Removes the workspace and everything in it. This cannot be undone."
76
+ >
77
+ <div>
78
+ <Button label="Delete workspace" variant="secondary" tone="destructive" />
79
+ </div>
80
+ </FormSection>
81
+ </div>
82
+ </AppShell>
83
+ );
84
+ }
@@ -145,7 +145,8 @@
145
145
  }
146
146
 
147
147
  /* The folded search: shown only where the field does not fit. */
148
- .searchIcon {
148
+ .searchIcon,
149
+ .aiIcon {
149
150
  display: none;
150
151
  }
151
152
 
@@ -164,39 +165,12 @@
164
165
  min-width: 0;
165
166
  }
166
167
 
168
+ /* PageHeader draws the breadcrumb, the title and the actions, and folds the
169
+ actions under the title when it is narrow; the shell only spaces it. */
167
170
  .pageHead {
168
- display: flex;
169
- align-items: flex-end;
170
- justify-content: space-between;
171
- flex-wrap: wrap;
172
- gap: var(--gap-400);
173
171
  padding-top: var(--padding-400);
174
172
  }
175
173
 
176
- .pageHeadText {
177
- display: flex;
178
- flex-direction: column;
179
- gap: var(--gap-100);
180
- min-width: 0;
181
- }
182
-
183
- .title {
184
- margin: 0;
185
- font-family: var(--font-heading-1-family);
186
- font-size: var(--font-heading-1-size);
187
- font-weight: var(--font-heading-1-weight);
188
- line-height: var(--font-heading-1-line-height);
189
- letter-spacing: var(--font-heading-1-letter-spacing);
190
- color: var(--color-text-primary);
191
- }
192
-
193
- .pageActions {
194
- display: flex;
195
- flex-wrap: wrap;
196
- align-items: center;
197
- gap: var(--gap-200);
198
- }
199
-
200
174
  /* -------------------------------------------------------- responsive */
201
175
 
202
176
  /* Laptop: a tighter side gutter. */
@@ -241,24 +215,17 @@
241
215
  justify-content: flex-end;
242
216
  }
243
217
 
244
- .search {
218
+ .search,
219
+ .ai {
245
220
  display: none;
246
221
  }
247
222
 
248
- .searchIcon {
223
+ .searchIcon,
224
+ .aiIcon {
249
225
  display: inline-flex;
250
226
  }
251
227
 
252
228
  .pageHead {
253
229
  padding-top: 0;
254
230
  }
255
-
256
- /* The actions take the full row under the title, sharing it evenly. */
257
- .pageActions {
258
- width: 100%;
259
- }
260
-
261
- .pageActions > * {
262
- flex: 1;
263
- }
264
231
  }
@@ -25,7 +25,8 @@ import {
25
25
  type AppSidebarProfile,
26
26
  type AppSidebarSection,
27
27
  } from 'rift-ds/components/AppSidebar/AppSidebar';
28
- import { Breadcrumb, type BreadcrumbItem } from 'rift-ds/components/Breadcrumb/Breadcrumb';
28
+ import type { BreadcrumbItem } from 'rift-ds/components/Breadcrumb/Breadcrumb';
29
+ import { PageHeader } from 'rift-ds/components/PageHeader/PageHeader';
29
30
  import { CommandPaletteTrigger } from 'rift-ds/components/CommandPaletteTrigger/CommandPaletteTrigger';
30
31
  import { ProgressiveBlur } from 'rift-ds/components/ProgressiveBlur/ProgressiveBlur';
31
32
  import { ThemeToggle } from 'rift-ds/components/ThemeToggle/ThemeToggle';
@@ -122,21 +123,18 @@ export function AppShell({ activeKey, breadcrumb, title, actions, children }: Ap
122
123
  <CommandPaletteTrigger className={styles.search} />
123
124
  <div className={styles.topBarActions}>
124
125
  <CommandPaletteTrigger iconOnly className={styles.searchIcon} />
125
- {/* The AI entry. Point it at your chat: `npx rift-ds init chat`
126
- scaffolds one, and ChatLauncher opens it. */}
127
- <AiButton />
126
+ {/* The AI entry. Point both at your chat: `npx rift-ds init chat`
127
+ scaffolds one, and ChatLauncher opens it. On a phone the
128
+ labelled button gives way to the icon, as search does, so
129
+ the bar keeps room for the actions you add. */}
130
+ <AiButton className={styles.ai} />
131
+ <AiButton iconOnly className={styles.aiIcon} />
128
132
  <ThemeToggle showLabels={false} />
129
133
  </div>
130
134
  </header>
131
135
 
132
136
  <main className={styles.page}>
133
- <div className={styles.pageHead}>
134
- <div className={styles.pageHeadText}>
135
- {breadcrumb && <Breadcrumb items={breadcrumb} />}
136
- <h1 className={styles.title}>{title}</h1>
137
- </div>
138
- {actions && <div className={styles.pageActions}>{actions}</div>}
139
- </div>
137
+ <PageHeader className={styles.pageHead} breadcrumb={breadcrumb} title={title} actions={actions} />
140
138
  {children}
141
139
  </main>
142
140
  </div>
@@ -25,6 +25,19 @@
25
25
  "app/dashboard/page.module.css"
26
26
  ]
27
27
  },
28
+ {
29
+ "name": "settings",
30
+ "label": "Settings",
31
+ "description": "The app shell with a column of settings sections, each saving on its own, and a profile form checked in one pass.",
32
+ "route": "/settings",
33
+ "files": [
34
+ "components/blocks/AppShell.tsx",
35
+ "components/blocks/AppShell.module.css",
36
+ "app/settings/page.tsx",
37
+ "app/settings/page.module.css",
38
+ "app/settings/ProfileForm.tsx"
39
+ ]
40
+ },
28
41
  {
29
42
  "name": "sign-in",
30
43
  "label": "Sign in",
@@ -1,9 +1,6 @@
1
1
  import { createFeedbackHandler } from 'rift-ds/chat/server';
2
2
  import { guardrails } from '../guardrails';
3
3
 
4
- export const runtime = 'nodejs';
5
- export const dynamic = 'force-dynamic';
6
-
7
4
  /** Thumbs verdicts on answers, stored against the exchange the chat route logged. */
8
5
  const handler = createFeedbackHandler({ guardrails });
9
6
 
@@ -2,9 +2,6 @@ import { createFollowupsHandler } from 'rift-ds/chat/server';
2
2
  import { FOLLOWUP_MODEL } from '../../../../components/chat/models';
3
3
  import { guardrails } from '../guardrails';
4
4
 
5
- export const runtime = 'nodejs';
6
- export const dynamic = 'force-dynamic';
7
-
8
5
  /**
9
6
  * The three follow-up questions offered under a finished answer, written by
10
7
  * a small model from the question-and-answer pair. Say what the chat is
@@ -2,9 +2,7 @@ import { createChatHandler } from 'rift-ds/chat/server';
2
2
  import { CHAT_MODELS, DEFAULT_CHAT_MODEL } from '../../../components/chat/models';
3
3
  import { guardrails } from './guardrails';
4
4
 
5
- export const runtime = 'nodejs';
6
5
  export const maxDuration = 60;
7
- export const dynamic = 'force-dynamic';
8
6
 
9
7
  /**
10
8
  * What the assistant knows and how it behaves. Replace this with your own
@@ -28,6 +28,14 @@ export interface ChatLauncherProps {
28
28
  * Note: not the native `hidden` attribute, which keeps an element mounted and only hides it; the launcher unmounts its button and panel, and spreads no native attributes.
29
29
  */
30
30
  hidden?: boolean;
31
+ /**
32
+ * Whether the closed launcher shows its floating button. Defaults to true.
33
+ * `false` keeps the panel and drops only the button, for a host that opens
34
+ * the chat from a control of its own, such as an AiButton in its top bar:
35
+ * that control calls `setOpen(true)` from `useChatWidget()` and sets
36
+ * `returnFocusRef.current` to itself, so closing the panel hands focus back.
37
+ */
38
+ fab?: boolean;
31
39
  /** The panel's DOM id, for a host control's `aria-controls`. */
32
40
  panelId?: string;
33
41
  /**
@@ -78,4 +86,4 @@ export interface ChatLauncherProps {
78
86
  * touch the host's body). The panel's geometry reads `--ds-chat-width`,
79
87
  * `--ds-chat-inset` and `--ds-chat-float-height`, defaulted on `:root`.
80
88
  */
81
- export declare function ChatLauncher({ label, icon, summary, hidden, panelId, hostAttribute, panelLabel, aiButtonLabels, widget, children, surface, }: ChatLauncherProps): import("react").JSX.Element | null;
89
+ export declare function ChatLauncher({ label, icon, summary, hidden, panelId, hostAttribute, panelLabel, aiButtonLabels, widget, children, surface, fab, }: ChatLauncherProps): import("react").JSX.Element | null;
@@ -44,7 +44,8 @@ function ChatLauncher({
44
44
  aiButtonLabels,
45
45
  widget,
46
46
  children,
47
- surface = "raised"
47
+ surface = "raised",
48
+ fab = true
48
49
  }) {
49
50
  const { open, setOpen, panelPhase, view, side, floating, returnFocusRef, send } = useChatWidget();
50
51
  const agentState = useChatAgentState();
@@ -245,6 +246,7 @@ function ChatLauncher({
245
246
  }, [isFloating, floatPos]);
246
247
  if (hidden) return null;
247
248
  if (!renderPanel) {
249
+ if (!fab) return null;
248
250
  return /* @__PURE__ */ jsx("div", { className: "ds-chat-launcher__fab", children: /* @__PURE__ */ jsx(
249
251
  AiButton,
250
252
  {
@@ -94,6 +94,18 @@
94
94
  margin: 0;
95
95
  }
96
96
 
97
+ /* ============================================
98
+ ACTIONS
99
+ ============================================ */
100
+
101
+ .ds-alert__actions {
102
+ display: flex;
103
+ flex-wrap: wrap;
104
+ align-items: center;
105
+ gap: var(--gap-200); /* 8px */
106
+ margin-block-start: var(--gap-200); /* 8px */
107
+ }
108
+
97
109
  /* ============================================
98
110
  DISMISS BUTTON
99
111
  ============================================ */
@@ -12,6 +12,8 @@ type AlertOwnProps = {
12
12
  variant?: 'info' | 'positive' | 'warning' | 'error' | 'neutral';
13
13
  /** Component size */
14
14
  size?: 'default' | 'compact';
15
+ /** Actions under the description: one or two compact Buttons or a Link that act on what the alert says (retry, review, undo). */
16
+ action?: React.ReactNode;
15
17
  /** Whether the alert can be dismissed */
16
18
  dismissible?: boolean;
17
19
  /** Custom icon override — Material Symbol name (string) or custom element (ReactNode) */
@@ -13,6 +13,7 @@ const Alert = React.forwardRef(
13
13
  ({
14
14
  title,
15
15
  description,
16
+ action,
16
17
  variant = "info",
17
18
  size = "default",
18
19
  dismissible = false,
@@ -38,7 +39,8 @@ const Alert = React.forwardRef(
38
39
  ) : /* @__PURE__ */ jsx("span", { className: `${baseClass}__icon`, "aria-hidden": "true", children: iconValue }),
39
40
  /* @__PURE__ */ jsxs("div", { className: `${baseClass}__content`, children: [
40
41
  title && /* @__PURE__ */ jsx("p", { className: `${baseClass}__title`, children: title }),
41
- description && /* @__PURE__ */ jsx("p", { className: `${baseClass}__description`, children: description })
42
+ description && /* @__PURE__ */ jsx("p", { className: `${baseClass}__description`, children: description }),
43
+ action != null && action !== false && /* @__PURE__ */ jsx("div", { className: `${baseClass}__actions`, children: action })
42
44
  ] }),
43
45
  dismissible && /* @__PURE__ */ jsx(
44
46
  "button",
@@ -1042,3 +1042,95 @@ button.ds-attachment-group__single:focus-visible {
1042
1042
  letter-spacing: var(--font-paragraph-sm-letter-spacing);
1043
1043
  color: var(--color-text-secondary);
1044
1044
  }
1045
+
1046
+ /* ============================================
1047
+ FILE ROW — one file in a list
1048
+ The family's type mark, the name over a line
1049
+ of detail, controls at the end. Rows sit in a
1050
+ list on --color-divider, as a WidgetRow list.
1051
+ ============================================ */
1052
+
1053
+ .ds-file-row {
1054
+ --ds-attachment-mark-size: var(--icon-size-800);
1055
+
1056
+ display: flex;
1057
+ align-items: center;
1058
+ gap: var(--gap-300);
1059
+ min-width: 0;
1060
+ padding-block: var(--padding-300);
1061
+ }
1062
+
1063
+ .ds-file-row--compact {
1064
+ --ds-attachment-mark-size: var(--icon-size-600);
1065
+
1066
+ gap: var(--gap-200);
1067
+ padding-block: var(--padding-200);
1068
+ }
1069
+
1070
+ .ds-file-row + .ds-file-row {
1071
+ border-block-start: var(--border-025) solid var(--color-divider);
1072
+ }
1073
+
1074
+ .ds-file-row__main {
1075
+ display: flex;
1076
+ flex: 1 1 auto;
1077
+ flex-direction: column;
1078
+ gap: var(--gap-050);
1079
+ min-width: 0;
1080
+ }
1081
+
1082
+ .ds-file-row__name {
1083
+ overflow: hidden;
1084
+ text-overflow: ellipsis;
1085
+ white-space: nowrap;
1086
+ font-family: var(--font-paragraph-sm-emphasis-family);
1087
+ font-size: var(--font-paragraph-sm-emphasis-size);
1088
+ font-weight: var(--font-paragraph-sm-emphasis-weight);
1089
+ line-height: var(--font-paragraph-sm-emphasis-line-height);
1090
+ letter-spacing: var(--font-paragraph-sm-emphasis-letter-spacing);
1091
+ color: var(--color-text-primary);
1092
+ }
1093
+
1094
+ /* The name that opens the file reads as the row's own text, underlined on
1095
+ hover and focus the way a link answers. */
1096
+ .ds-file-row__name--action {
1097
+ display: block;
1098
+ max-width: 100%;
1099
+ margin: 0;
1100
+ padding: 0;
1101
+ border: none;
1102
+ background: none;
1103
+ text-align: start;
1104
+ text-decoration: none;
1105
+ cursor: pointer;
1106
+ border-radius: var(--radius-100);
1107
+ }
1108
+
1109
+ .ds-file-row__name--action:hover,
1110
+ .ds-file-row__name--action:focus-visible {
1111
+ text-decoration: underline;
1112
+ }
1113
+
1114
+ .ds-file-row__name--action:focus-visible {
1115
+ outline: 2px solid var(--color-action-primary-bg);
1116
+ outline-offset: 2px;
1117
+ }
1118
+
1119
+ .ds-file-row__meta {
1120
+ overflow: hidden;
1121
+ text-overflow: ellipsis;
1122
+ white-space: nowrap;
1123
+ font-family: var(--font-caption-family);
1124
+ font-size: var(--font-caption-size);
1125
+ font-weight: var(--font-caption-weight);
1126
+ line-height: var(--font-caption-line-height);
1127
+ letter-spacing: var(--font-caption-letter-spacing);
1128
+ color: var(--color-text-tertiary);
1129
+ }
1130
+
1131
+ .ds-file-row__actions {
1132
+ display: inline-flex;
1133
+ flex-shrink: 0;
1134
+ align-items: center;
1135
+ gap: var(--gap-100);
1136
+ }