rift-ds 1.35.0 → 1.37.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 (265) hide show
  1. package/README.md +2 -1
  2. package/behaviors/chat-card.css +6 -0
  3. package/behaviors/direction.css +6 -0
  4. package/behaviors/matchParts.d.ts +9 -0
  5. package/behaviors/matchParts.js +10 -0
  6. package/behaviors/shell.css +6 -0
  7. package/behaviors/shortcuts.js +2 -2
  8. package/behaviors/useLayer.d.ts +2 -2
  9. package/behaviors/visually-hidden.css +6 -0
  10. package/bin/templates/blocks/app/landing/page.module.css +50 -0
  11. package/bin/templates/blocks/app/landing/page.tsx +157 -0
  12. package/bin/templates/blocks/app/pricing/page.module.css +15 -0
  13. package/bin/templates/blocks/app/pricing/page.tsx +173 -0
  14. package/bin/templates/blocks/app/settings/ProfileForm.tsx +1 -1
  15. package/bin/templates/blocks/app/sign-in/page.tsx +3 -3
  16. package/bin/templates/blocks/components/blocks/MarketingShell.module.css +66 -0
  17. package/bin/templates/blocks/components/blocks/MarketingShell.tsx +141 -0
  18. package/bin/templates/blocks/components/blocks/emberScene.ts +1 -1
  19. package/bin/templates/blocks/registry.json +24 -0
  20. package/chat/AssistantTurn.js +5 -20
  21. package/chat/ChatAgentPane.css +6 -0
  22. package/chat/ChatWidget.css +6 -0
  23. package/chat/demo.css +6 -0
  24. package/chat/queries.js +1 -1
  25. package/chat/selection.css +6 -0
  26. package/components/Accordion/Accordion.css +6 -0
  27. package/components/ActionBar/ActionBar.css +6 -0
  28. package/components/ActionCard/ActionCard.css +6 -0
  29. package/components/ActionReadout/ActionReadout.css +6 -0
  30. package/components/AgentPlan/AgentPlan.css +6 -0
  31. package/components/AgentRail/AgentRail.css +6 -0
  32. package/components/AgentStatus/AgentStatus.css +12 -7
  33. package/components/AiButton/AiButton.css +17 -11
  34. package/components/Alert/Alert.css +6 -0
  35. package/components/AlertDialog/AlertDialog.css +6 -0
  36. package/components/AnchorNav/AnchorNav.css +6 -0
  37. package/components/AnimatedNumber/AnimatedNumber.css +5 -0
  38. package/components/AppLayout/AppLayout.css +6 -0
  39. package/components/AppSidebar/AppSidebar.css +19 -1
  40. package/components/AppSidebar/AppSidebar.d.ts +1 -1
  41. package/components/AppSidebar/AppSidebar.js +10 -4
  42. package/components/ArtifactCard/ArtifactCard.css +6 -0
  43. package/components/ArtifactPanel/ArtifactPanel.css +6 -0
  44. package/components/Attachment/Attachment.css +6 -0
  45. package/components/Attachment/AttachmentGroup.js +4 -1
  46. package/components/Avatar/Avatar.css +6 -0
  47. package/components/AvatarGroup/AvatarGroup.css +6 -0
  48. package/components/BackToTop/BackToTop.css +6 -0
  49. package/components/Badge/Badge.css +6 -0
  50. package/components/Banner/Banner.css +6 -0
  51. package/components/BentoTile/BentoTile.css +6 -0
  52. package/components/BottomNav/BottomNav.css +6 -0
  53. package/components/Breadcrumb/Breadcrumb.css +6 -0
  54. package/components/Button/Button.css +6 -0
  55. package/components/Button/Button.d.ts +7 -1
  56. package/components/Button/Button.js +2 -1
  57. package/components/ButtonGroup/ButtonGroup.css +6 -0
  58. package/components/Card/Card.css +6 -0
  59. package/components/CardStack/CardStack.css +5 -0
  60. package/components/Carousel/Carousel.css +6 -0
  61. package/components/Chart/ActiveReporter.d.ts +32 -0
  62. package/components/Chart/ActiveReporter.js +31 -0
  63. package/components/Chart/AreaChart.d.ts +7 -1
  64. package/components/Chart/AreaChart.js +8 -3
  65. package/components/Chart/BarChart.d.ts +12 -0
  66. package/components/Chart/BarChart.js +8 -3
  67. package/components/Chart/Chart.css +9 -1
  68. package/components/Chart/ComboChart.d.ts +7 -1
  69. package/components/Chart/ComboChart.js +8 -3
  70. package/components/Chart/LineChart.d.ts +7 -1
  71. package/components/Chart/LineChart.js +8 -3
  72. package/components/Chart/StackedBarChart.d.ts +7 -1
  73. package/components/Chart/StackedBarChart.js +8 -3
  74. package/components/ChatHeader/ChatHeader.css +6 -0
  75. package/components/ChatMarker/ChatMarker.css +6 -0
  76. package/components/ChatMessage/ChatMessage.css +6 -0
  77. package/components/ChatThread/ChatThread.css +6 -0
  78. package/components/Checkbox/Checkbox.css +6 -0
  79. package/components/Checkbox/Checkbox.js +1 -1
  80. package/components/Checklist/Checklist.css +6 -0
  81. package/components/Chip/Chip.css +6 -0
  82. package/components/CodeBlock/CodeBlock.css +6 -0
  83. package/components/CodeDiff/CodeDiff.css +5 -0
  84. package/components/ColorPicker/ColorPicker.css +6 -0
  85. package/components/ColourSwatch/ColourSwatch.css +6 -0
  86. package/components/Combobox/Combobox.css +32 -0
  87. package/components/Combobox/Combobox.d.ts +10 -0
  88. package/components/Combobox/Combobox.js +10 -0
  89. package/components/CommandPalette/CommandPalette.css +32 -0
  90. package/components/CommandPalette/CommandPalette.d.ts +2 -1
  91. package/components/CommandPalette/CommandPalette.js +21 -4
  92. package/components/CommandPaletteTrigger/CommandPaletteTrigger.css +6 -0
  93. package/components/Composer/Composer.css +6 -0
  94. package/components/ContactCard/ContactCard.css +6 -0
  95. package/components/ContextMenu/ContextMenu.css +6 -0
  96. package/components/ContributionGraph/ContributionGraph.css +6 -0
  97. package/components/CurrencyInput/CurrencyInput.css +6 -0
  98. package/components/DataTable/DataTable.css +6 -0
  99. package/components/DataTable/DataTable.js +6 -2
  100. package/components/DateInput/DateInput.css +6 -0
  101. package/components/DatePicker/DatePicker.css +6 -0
  102. package/components/DateRangePicker/DateRangePicker.css +6 -0
  103. package/components/Deadline/Deadline.css +6 -0
  104. package/components/DecisionRow/DecisionRow.css +6 -0
  105. package/components/DescriptionList/DescriptionList.css +6 -0
  106. package/components/Dialog/Dialog.css +6 -0
  107. package/components/Divider/Divider.css +6 -0
  108. package/components/DocumentChip/DocumentChip.css +6 -0
  109. package/components/DocumentViewer/DocumentViewer.css +6 -0
  110. package/components/Drawer/Drawer.css +55 -7
  111. package/components/Drawer/Drawer.d.ts +17 -1
  112. package/components/Drawer/Drawer.js +27 -5
  113. package/components/Dropdown/ChosenMark.css +6 -0
  114. package/components/Dropdown/Dropdown.css +46 -0
  115. package/components/Dropdown/Dropdown.d.ts +7 -0
  116. package/components/Dropdown/Dropdown.js +23 -38
  117. package/components/DropdownMenu/DropdownMenu.css +6 -0
  118. package/components/EmptyState/EmptyState.css +6 -0
  119. package/components/EntityCard/EntityCard.css +6 -0
  120. package/components/EntitySwitcher/EntitySwitcher.css +6 -0
  121. package/components/ErrorSummary/ErrorSummary.css +6 -0
  122. package/components/ErrorSummary/ErrorSummary.js +3 -1
  123. package/components/EventCalendar/EventCalendar.css +6 -0
  124. package/components/Field/Field.css +6 -0
  125. package/components/Figure/Figure.css +6 -0
  126. package/components/FileInput/FileInput.css +6 -0
  127. package/components/FilterBar/FilterBar.css +9 -1
  128. package/components/FormSection/FormSection.css +6 -0
  129. package/components/FunnelChart/FunnelChart.css +6 -0
  130. package/components/GanttChart/GanttChart.css +6 -0
  131. package/components/Gauge/Gauge.css +6 -0
  132. package/components/Globe/Globe.css +6 -0
  133. package/components/Grid/Grid.css +6 -0
  134. package/components/Heading/Heading.css +6 -0
  135. package/components/HoverCard/HoverCard.css +6 -0
  136. package/components/Icon/Icon.css +6 -0
  137. package/components/IconButton/IconButton.css +6 -0
  138. package/components/IconButton/IconButton.d.ts +7 -1
  139. package/components/IconButton/IconButton.js +2 -1
  140. package/components/ImageCompare/ImageCompare.css +6 -0
  141. package/components/Input/Input.css +22 -4
  142. package/components/Inspector/Inspector.css +6 -0
  143. package/components/Instructions/Instructions.css +27 -0
  144. package/components/Instructions/Instructions.d.ts +5 -2
  145. package/components/Instructions/Instructions.js +1 -1
  146. package/components/InterruptCard/InterruptCard.css +6 -0
  147. package/components/Kbd/Kbd.css +6 -0
  148. package/components/LegendTile/LegendTile.css +6 -0
  149. package/components/Lightbox/Lightbox.css +6 -0
  150. package/components/Link/Link.css +9 -1
  151. package/components/LinkList/LinkList.css +6 -0
  152. package/components/List/List.css +6 -0
  153. package/components/MapCallout/MapCallout.css +6 -0
  154. package/components/MapLegend/MapLegend.css +6 -0
  155. package/components/MaskedInput/MaskedInput.css +6 -0
  156. package/components/MegaMenu/MegaMenu.css +6 -0
  157. package/components/Mention/Mention.css +6 -0
  158. package/components/Mention/Mention.js +7 -7
  159. package/components/Menubar/Menubar.css +6 -0
  160. package/components/MessageActions/MessageActions.css +6 -0
  161. package/components/MessageCard/MessageCard.css +6 -0
  162. package/components/Meter/Meter.css +6 -0
  163. package/components/ModelPicker/ModelPicker.css +6 -0
  164. package/components/MotionSwatch/MotionSwatch.css +6 -0
  165. package/components/Nav/Nav.css +6 -0
  166. package/components/NavList/NavList.css +6 -0
  167. package/components/NavList/NavList.d.ts +2 -0
  168. package/components/NavList/NavList.js +1 -0
  169. package/components/NotificationCenter/NotificationCenter.css +6 -0
  170. package/components/NumberInput/NumberInput.css +6 -0
  171. package/components/OrgChart/OrgChart.css +6 -0
  172. package/components/PageHeader/PageHeader.css +6 -0
  173. package/components/Pagination/Pagination.css +6 -0
  174. package/components/Panel/Panel.css +6 -0
  175. package/components/PinInput/PinInput.css +6 -0
  176. package/components/PixelAvatar/PixelAvatar.css +6 -0
  177. package/components/Popover/Popover.css +6 -0
  178. package/components/ProgressBar/ProgressBar.css +6 -0
  179. package/components/ProgressiveBlur/ProgressiveBlur.css +6 -0
  180. package/components/PromptSuggestions/PromptSuggestions.css +5 -0
  181. package/components/Prose/Prose.css +6 -0
  182. package/components/QuestionCard/QuestionCard.css +5 -0
  183. package/components/Quote/Quote.css +6 -0
  184. package/components/RadioButton/RadioButton.css +6 -0
  185. package/components/Rating/Rating.css +6 -0
  186. package/components/Reasoning/Reasoning.css +6 -0
  187. package/components/ResourceTimeline/ResourceTimeline.css +6 -0
  188. package/components/RichDropdown/RichDropdown.css +6 -0
  189. package/components/SectionTitle/SectionTitle.css +6 -0
  190. package/components/SegmentedControl/SegmentedControl.css +6 -0
  191. package/components/SelectionCard/SelectionCard.css +6 -0
  192. package/components/ShaderField/ShaderField.css +6 -0
  193. package/components/ShaderField/ShaderField.js +2 -0
  194. package/components/ShaderScene/ShaderScene.css +6 -0
  195. package/components/ShaderScene/ShaderScene.d.ts +3 -2
  196. package/components/ShaderScene/assemble.js +13 -5
  197. package/components/ShaderScene/renderer.d.ts +2 -2
  198. package/components/ShaderScene/types.d.ts +2 -1
  199. package/components/SidebarPanel/SidebarPanel.css +6 -0
  200. package/components/SignaturePad/SignaturePad.css +6 -0
  201. package/components/SiteFooter/SiteFooter.css +6 -0
  202. package/components/SiteHeader/SiteHeader.css +6 -0
  203. package/components/SiteLayout/SiteLayout.css +6 -0
  204. package/components/Skeleton/Skeleton.css +6 -0
  205. package/components/Slider/Slider.css +6 -0
  206. package/components/SourceChip/SourceChip.css +6 -0
  207. package/components/SourceTrail/SourceTrail.css +6 -0
  208. package/components/SpacingSwatch/SpacingSwatch.css +6 -0
  209. package/components/Sparkline/Sparkline.css +6 -0
  210. package/components/Spinner/Spinner.css +6 -0
  211. package/components/SplitButton/SplitButton.css +6 -0
  212. package/components/SplitButton/SplitButton.d.ts +7 -1
  213. package/components/SplitButton/SplitButton.js +3 -1
  214. package/components/SplitPane/SplitPane.css +6 -0
  215. package/components/Stack/Stack.css +6 -0
  216. package/components/Stat/Stat.css +13 -1
  217. package/components/StatusDot/StatusDot.css +6 -0
  218. package/components/Stepper/Stepper.css +6 -0
  219. package/components/StreamingText/StreamingText.css +6 -0
  220. package/components/Swatch/Swatch.css +6 -0
  221. package/components/Table/Table.css +15 -1
  222. package/components/TableToolbar/TableToolbar.css +6 -0
  223. package/components/Tabs/Tabs.css +6 -0
  224. package/components/TagInput/TagInput.css +6 -0
  225. package/components/Text/Text.css +6 -0
  226. package/components/Textarea/Textarea.css +5 -0
  227. package/components/ThemePicker/ThemePicker.css +6 -0
  228. package/components/ThemeToggle/ThemeToggle.css +6 -0
  229. package/components/ThreadPanel/ThreadPanel.css +6 -0
  230. package/components/ThreadTabs/ThreadTabs.css +6 -0
  231. package/components/TimePicker/TimePicker.css +6 -0
  232. package/components/Timeline/Timeline.css +18 -18
  233. package/components/Toast/Toast.css +6 -0
  234. package/components/Toast/Toast.js +1 -1
  235. package/components/ToggleGroup/ToggleGroup.css +6 -0
  236. package/components/ToggleSwitch/ToggleSwitch.css +21 -3
  237. package/components/ToggleSwitch/ToggleSwitch.d.ts +1 -1
  238. package/components/ToggleSwitch/ToggleSwitch.js +2 -2
  239. package/components/ToolCall/ToolCall.css +6 -0
  240. package/components/Toolbar/Toolbar.css +6 -0
  241. package/components/Tooltip/Tooltip.css +6 -0
  242. package/components/TopAppBar/TopAppBar.css +6 -0
  243. package/components/TreeView/TreeView.css +6 -0
  244. package/components/TypographySwatch/TypographySwatch.css +6 -0
  245. package/components/UsageCard/UsageCard.css +6 -0
  246. package/components/Waveform/Waveform.css +6 -0
  247. package/components/Widget/Widget.css +6 -0
  248. package/components/Wizard/Wizard.css +6 -0
  249. package/components/WorldMap/WorldMap.css +6 -0
  250. package/components/registry.json +3 -3
  251. package/components/registry.json.d.ts +3 -3
  252. package/components/registry.json.js +1 -1
  253. package/fonts/material-symbols.css +10 -0
  254. package/markdown/index.d.ts +8 -0
  255. package/markdown/index.js +10 -0
  256. package/markdown/mappers.d.ts +31 -0
  257. package/markdown/mappers.js +43 -0
  258. package/package.json +7 -2
  259. package/tokens/base.css +11 -2
  260. package/tokens/presets/contrast.css +8 -0
  261. package/tokens/presets/forest.css +8 -0
  262. package/tokens/presets/plum.css +18 -5
  263. package/tokens/presets/warm.css +10 -5
  264. package/tokens/presets/zest.css +22 -5
  265. package/tokens/values.json.js +1 -1
@@ -0,0 +1,141 @@
1
+ /**
2
+ * The shell the marketing blocks sit in: rift-ds's SiteHeader over the page
3
+ * and a SiteFooter under it, sharing one page width. `Band` is the
4
+ * full-width strip every section of a marketing page is: a surface running
5
+ * edge to edge with its content held to one centred width. This file is
6
+ * yours: rename the product, replace the sections and the footer's columns
7
+ * with your own.
8
+ *
9
+ * A page is a stack of bands. Alternate `surface` between `page` and
10
+ * `raised` to separate one section from the next with no rule between
11
+ * them, and pass `width="narrow"` for a band of reading copy (a FAQ, a
12
+ * closing line).
13
+ */
14
+
15
+ import type { ReactNode } from 'react';
16
+ import { Button } from 'rift-ds/components/Button/Button';
17
+ import { SiteFooter, type SiteFooterColumn } from 'rift-ds/components/SiteFooter/SiteFooter';
18
+ import { SiteHeader, type SiteHeaderSection } from 'rift-ds/components/SiteHeader/SiteHeader';
19
+ import { ThemeToggle } from 'rift-ds/components/ThemeToggle/ThemeToggle';
20
+ import styles from './MarketingShell.module.css';
21
+
22
+ /** The product's name, shown in the header and the footer. */
23
+ const PRODUCT_NAME = 'Acme';
24
+
25
+ /**
26
+ * How wide the page's column runs: `narrow` (1200px), `default` (1440px)
27
+ * or `wide` (1680px). The header, every band and the footer read it, so
28
+ * they share one pair of edges.
29
+ */
30
+ const PAGE_WIDTH: 'narrow' | 'default' | 'wide' = 'narrow';
31
+
32
+ /**
33
+ * The header's sections. Point each `href` at the route it opens in your
34
+ * app (the placeholders are fragments, so the block works before those
35
+ * routes exist), and give one a `mega` menu when it has pages of its own.
36
+ */
37
+ const SECTIONS: SiteHeaderSection[] = [
38
+ { id: 'product', label: 'Product', href: '#product' },
39
+ { id: 'pricing', label: 'Pricing', href: '#pricing' },
40
+ { id: 'docs', label: 'Docs', href: '#docs' },
41
+ ];
42
+
43
+ /** The footer's sitemap. */
44
+ const FOOTER_COLUMNS: SiteFooterColumn[] = [
45
+ {
46
+ label: 'Product',
47
+ links: [
48
+ { label: 'Overview', href: '#' },
49
+ { label: 'Pricing', href: '#' },
50
+ { label: 'Changelog', href: '#' },
51
+ ],
52
+ },
53
+ {
54
+ label: 'Resources',
55
+ links: [
56
+ { label: 'Docs', href: '#' },
57
+ { label: 'Guides', href: '#' },
58
+ { label: 'Status', href: '#' },
59
+ ],
60
+ },
61
+ {
62
+ label: 'Company',
63
+ links: [
64
+ { label: 'About', href: '#' },
65
+ { label: 'Careers', href: '#' },
66
+ { label: 'Contact', href: '#' },
67
+ ],
68
+ },
69
+ ];
70
+
71
+ export interface MarketingShellProps {
72
+ /** The path of the page being shown, which marks its section in the header. */
73
+ currentHref?: string;
74
+ /** The page: a stack of bands. */
75
+ children: ReactNode;
76
+ }
77
+
78
+ export function MarketingShell({ currentHref, children }: MarketingShellProps) {
79
+ return (
80
+ <div className={styles.shell} data-ds-width="contained" data-ds-contained={PAGE_WIDTH}>
81
+ <SiteHeader
82
+ brand={<span className={styles.brand}>{PRODUCT_NAME}</span>}
83
+ sections={SECTIONS}
84
+ currentHref={currentHref}
85
+ width="contained"
86
+ actions={<ThemeToggle size="compact" cycle />}
87
+ wideActions={
88
+ <>
89
+ <Button variant="tertiary" label="Sign in" href="#" />
90
+ <Button variant="primary" label="Get started" href="#" />
91
+ </>
92
+ }
93
+ drawerFooter={
94
+ <>
95
+ <Button variant="secondary" tone="neutral" label="Sign in" href="#" />
96
+ <Button variant="primary" label="Get started" href="#" />
97
+ </>
98
+ }
99
+ />
100
+ <main className={styles.main}>{children}</main>
101
+ {/* The footer sits in the same column as the bands. */}
102
+ <div className={`${styles.inner} ${styles.footer}`}>
103
+ <SiteFooter
104
+ brand={<span className={styles.brand}>{PRODUCT_NAME}</span>}
105
+ description="The one place your team plans, ships and learns."
106
+ columns={FOOTER_COLUMNS}
107
+ legal={`© ${PRODUCT_NAME}, Inc.`}
108
+ />
109
+ </div>
110
+ </div>
111
+ );
112
+ }
113
+
114
+ export interface BandProps {
115
+ /** The strip's fill: the page's own, or the raised surface that sets a section apart. */
116
+ surface?: 'page' | 'raised';
117
+ /** How wide the content runs: the page's width, or a reading measure. */
118
+ width?: 'default' | 'narrow';
119
+ /** How much room the strip gives above and below its content. */
120
+ spacing?: 'default' | 'large';
121
+ /** An id on the section, for a link to it. */
122
+ id?: string;
123
+ /** Names the section for assistive technology when it has no heading of its own. */
124
+ 'aria-label'?: string;
125
+ children: ReactNode;
126
+ }
127
+
128
+ export function Band({ surface = 'page', width = 'default', spacing = 'default', id, children, ...rest }: BandProps) {
129
+ const classes = [
130
+ styles.band,
131
+ surface === 'raised' ? styles.bandRaised : '',
132
+ spacing === 'large' ? styles.bandLarge : '',
133
+ ]
134
+ .filter(Boolean)
135
+ .join(' ');
136
+ return (
137
+ <section id={id} className={classes} aria-label={rest['aria-label']}>
138
+ <div className={width === 'narrow' ? `${styles.inner} ${styles.innerNarrow}` : styles.inner}>{children}</div>
139
+ </section>
140
+ );
141
+ }
@@ -14,7 +14,7 @@
14
14
  * to call.
15
15
  *
16
16
  * `mode: 'dark'` says it only adds light: on a light page the component
17
- * lays that light on as a pale tint. Leave it out for a scene that paints
17
+ * lays that light on as colour and ink. Leave it out for a scene that paints
18
18
  * both modes itself.
19
19
  */
20
20
 
@@ -85,6 +85,30 @@
85
85
  "app/guide/page.module.css",
86
86
  "app/guide/PageFeedback.tsx"
87
87
  ]
88
+ },
89
+ {
90
+ "name": "landing",
91
+ "label": "Landing page",
92
+ "description": "A product's front page in bands: a hero, customer names, features, numbers, quotes, questions and a closing call to act, under a site header and footer.",
93
+ "route": "/landing",
94
+ "files": [
95
+ "components/blocks/MarketingShell.tsx",
96
+ "components/blocks/MarketingShell.module.css",
97
+ "app/landing/page.tsx",
98
+ "app/landing/page.module.css"
99
+ ]
100
+ },
101
+ {
102
+ "name": "pricing",
103
+ "label": "Pricing",
104
+ "description": "Plans side by side with a monthly or yearly choice, each price written for a locale, over a table comparing every feature.",
105
+ "route": "/pricing",
106
+ "files": [
107
+ "components/blocks/MarketingShell.tsx",
108
+ "components/blocks/MarketingShell.module.css",
109
+ "app/pricing/page.tsx",
110
+ "app/pricing/page.module.css"
111
+ ]
88
112
  }
89
113
  ]
90
114
  }
@@ -4,7 +4,7 @@ import { createContext, useContext } from "react";
4
4
  import ReactMarkdown from "react-markdown";
5
5
  import remarkGfm from "remark-gfm";
6
6
  import { AgentStatus } from "../components/AgentStatus/AgentStatus.js";
7
- import { CodeBlock } from "../components/CodeBlock/CodeBlock.js";
7
+ import { MarkdownScrollTable, MarkdownCode } from "../markdown/mappers.js";
8
8
  import { ChatMessage } from "../components/ChatMessage/ChatMessage.js";
9
9
  import { Prose } from "../components/Prose/Prose.js";
10
10
  import { Reasoning } from "../components/Reasoning/Reasoning.js";
@@ -30,29 +30,14 @@ function MarkdownLink({ href, children }) {
30
30
  }
31
31
  }) });
32
32
  }
33
- const hastText = (node) => node.type === "text" ? node.value ?? "" : (node.children ?? []).map(hastText).join("");
34
- function MarkdownPre({ node, children, ...props }) {
35
- const { codeLabel, ...labels } = useContext(CodeBlockLabelsContext) ?? {};
36
- const code = node?.children?.find(
37
- (child) => child.type === "element" && child.tagName === "code"
38
- );
39
- if (!code) return /* @__PURE__ */ jsx("pre", { ...props, children });
40
- const classes = code.properties?.className;
41
- const language = (Array.isArray(classes) ? classes : []).map(String).find((name) => name.startsWith("language-"))?.slice("language-".length);
42
- return /* @__PURE__ */ jsx(
43
- CodeBlock,
44
- {
45
- ...labels,
46
- codeLabel: codeLabel?.(language),
47
- code: hastText(code).replace(/\n$/, ""),
48
- language
49
- }
50
- );
33
+ function MarkdownPre(props) {
34
+ const labels = useContext(CodeBlockLabelsContext);
35
+ return /* @__PURE__ */ jsx(MarkdownCode, { ...props, labels });
51
36
  }
52
37
  const markdownComponents = {
53
38
  a: MarkdownLink,
54
39
  pre: MarkdownPre,
55
- table: ({ children, ...props }) => /* @__PURE__ */ jsx("table", { tabIndex: 0, ...props, children })
40
+ table: MarkdownScrollTable
56
41
  };
57
42
  function AssistantTurn({
58
43
  turn,
@@ -1,3 +1,7 @@
1
+ @layer rift.tokens, rift.preset, rift.components;
2
+
3
+ @layer rift.components {
4
+
1
5
  /* The built-in agent pane. The rail owns its shell; this only says how it
2
6
  sits in the widget's bottom sheet, where it fills the width rather than
3
7
  holding its own column and the sheet's rounded top edge is the surface. */
@@ -58,3 +62,5 @@
58
62
  line-height: var(--font-paragraph-sm-emphasis-line-height);
59
63
  color: var(--color-text-primary);
60
64
  }
65
+
66
+ } /* @layer rift.components */
@@ -13,6 +13,10 @@
13
13
  <html> by the widen grip), --ds-chat-inset and --ds-chat-float-height.
14
14
  ============================================ */
15
15
 
16
+ @layer rift.tokens, rift.preset, rift.components;
17
+
18
+ @layer rift.components {
19
+
16
20
  :root {
17
21
  /* The docked panel's resting width; DOCK_MIN_WIDTH in placement.ts mirrors it. */
18
22
  --ds-chat-width: 420px;
@@ -1692,3 +1696,5 @@ html[data-chat-resizing] .ds-chat-launcher__panel--floating .ds-chat-header {
1692
1696
  pointer-events: none;
1693
1697
  background: linear-gradient(to bottom, transparent, var(--ds-shell-surface));
1694
1698
  }
1699
+
1700
+ } /* @layer rift.components */
package/chat/demo.css CHANGED
@@ -3,6 +3,10 @@
3
3
  disc a source chip wears for a logo. Chart-series tokens keep it on-theme
4
4
  in both modes and re-theme with the rest of a theme like every chart. */
5
5
 
6
+ @layer rift.tokens, rift.preset, rift.components;
7
+
8
+ @layer rift.components {
9
+
6
10
  .ds-chat-demo__card-media {
7
11
  height: 120px;
8
12
  background: linear-gradient(135deg, var(--color-chart-series-1), var(--color-chart-series-2));
@@ -50,3 +54,5 @@
50
54
  .ds-chat-demo__artifact-board {
51
55
  padding: var(--padding-400);
52
56
  }
57
+
58
+ } /* @layer rift.components */
package/chat/queries.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { useSyncExternalStore } from "react";
3
- import { mediaAbove, mediaBelow, BREAKPOINT_CHAT_TAKEOVER_PX, BREAKPOINT_CHAT_DOCK_PX } from "../tokens/breakpoints.js";
3
+ import { mediaAbove, BREAKPOINT_CHAT_DOCK_PX, mediaBelow, BREAKPOINT_CHAT_TAKEOVER_PX } from "../tokens/breakpoints.js";
4
4
  import { DOCK_MIN_WIDTH, dockFits } from "./placement.js";
5
5
  const DOCK_QUERY = mediaAbove(BREAKPOINT_CHAT_DOCK_PX);
6
6
  const TAKEOVER_QUERY = mediaBelow(BREAKPOINT_CHAT_TAKEOVER_PX);
@@ -1,3 +1,7 @@
1
+ @layer rift.tokens, rift.preset, rift.components;
2
+
3
+ @layer rift.components {
4
+
1
5
  /* The highlight a chat holds on the page while it is the chat's context
2
6
  (useHeldHighlight in selection.ts): the context note's own fill, so the
3
7
  passage and the note that names it read as one thing, and quieter than a
@@ -6,3 +10,5 @@
6
10
  background-color: var(--color-chat-context-bg);
7
11
  color: var(--color-text-primary);
8
12
  }
13
+
14
+ } /* @layer rift.components */
@@ -3,6 +3,10 @@
3
3
  Collapsible content sections
4
4
  ============================================ */
5
5
 
6
+ @layer rift.tokens, rift.preset, rift.components;
7
+
8
+ @layer rift.components {
9
+
6
10
  /* The standard card surface (container fill, hairline border,
7
11
  --radius-300), the one SelectionCard's and QuestionCard's option rows
8
12
  share, so a collapsible section reads as a card on the page rather than
@@ -132,3 +136,5 @@
132
136
  .ds-accordion__trigger {
133
137
  padding-inline-end: var(--padding-400);
134
138
  }
139
+
140
+ } /* @layer rift.components */
@@ -4,6 +4,10 @@
4
4
  to the bottom of a long list or form
5
5
  ============================================ */
6
6
 
7
+ @layer rift.tokens, rift.preset, rift.components;
8
+
9
+ @layer rift.components {
10
+
7
11
  /* Base */
8
12
  .ds-action-bar {
9
13
  /* The surface the bar reads as one with: the blur's tint with the blur
@@ -76,3 +80,5 @@
76
80
  gap: var(--gap-300);
77
81
  margin-inline-start: auto;
78
82
  }
83
+
84
+ } /* @layer rift.components */
@@ -12,6 +12,10 @@
12
12
  starts where the reply's own text does.
13
13
  ============================================ */
14
14
 
15
+ @layer rift.tokens, rift.preset, rift.components;
16
+
17
+ @layer rift.components {
18
+
15
19
  .ds-action-card {
16
20
  box-sizing: border-box;
17
21
  display: flex;
@@ -145,3 +149,5 @@
145
149
  .ds-action-card .material-symbols-rounded {
146
150
  color: inherit;
147
151
  }
152
+
153
+ } /* @layer rift.components */
@@ -7,6 +7,10 @@
7
7
  its readout read as one family.
8
8
  ============================================ */
9
9
 
10
+ @layer rift.tokens, rift.preset, rift.components;
11
+
12
+ @layer rift.components {
13
+
10
14
  .ds-action-readout {
11
15
  box-sizing: border-box;
12
16
  display: flex;
@@ -45,3 +49,5 @@
45
49
  .ds-action-readout .material-symbols-rounded {
46
50
  color: inherit;
47
51
  }
52
+
53
+ } /* @layer rift.components */
@@ -10,6 +10,10 @@
10
10
  indicators into one path through the task.
11
11
  ============================================ */
12
12
 
13
+ @layer rift.tokens, rift.preset, rift.components;
14
+
15
+ @layer rift.components {
16
+
13
17
  .ds-agent-plan {
14
18
  display: flex;
15
19
  flex-direction: column;
@@ -255,3 +259,5 @@
255
259
  .ds-agent-plan__header:has(.ds-agent-plan__chevron) {
256
260
  padding-inline-end: calc(var(--ds-chat-card-inset) - var(--padding-100));
257
261
  }
262
+
263
+ } /* @layer rift.components */
@@ -9,6 +9,10 @@
9
9
  stay put, so switching tabs never moves the agent's face.
10
10
  ============================================ */
11
11
 
12
+ @layer rift.tokens, rift.preset, rift.components;
13
+
14
+ @layer rift.components {
15
+
12
16
  .ds-agent-rail {
13
17
  /* Width and padding combine on the root, so the component declares its
14
18
  own sizing model rather than leaning on a host reset — ThreadPanel's
@@ -289,3 +293,5 @@
289
293
  padding-top: var(--padding-200);
290
294
  border-top: var(--border-025) solid var(--color-divider);
291
295
  }
296
+
297
+ } /* @layer rift.components */
@@ -19,6 +19,16 @@
19
19
  changes the indicator's footprint or rhythm.
20
20
  ============================================ */
21
21
 
22
+ @layer rift.tokens, rift.preset, rift.components;
23
+
24
+ @property --ds-agent-ring-angle {
25
+ syntax: '<angle>';
26
+ initial-value: 0deg;
27
+ inherits: false;
28
+ }
29
+
30
+ @layer rift.components {
31
+
22
32
  .ds-agent-status {
23
33
  --ds-agent-color: var(--color-text-secondary);
24
34
  --ds-agent-label-color: var(--color-text-secondary);
@@ -918,7 +928,6 @@
918
928
  .ds-agent-status-mark--diagonal-swipe .ds-agent-status-mark__dot:nth-child(15) { --ds-agent-step: 7.5; }
919
929
  .ds-agent-status-mark--diagonal-swipe .ds-agent-status-mark__dot:nth-child(16) { --ds-agent-step: 9; }
920
930
 
921
-
922
931
  /* Twinkle: solid, one or two dots dipping on a fixed scatter */
923
932
  .ds-agent-status-mark--animated.ds-agent-status-mark--twinkle .ds-agent-status-mark__dot:nth-child(n) {
924
933
  opacity: 1;
@@ -963,12 +972,6 @@
963
972
  element's own edge and radius.
964
973
  ============================================ */
965
974
 
966
- @property --ds-agent-ring-angle {
967
- syntax: '<angle>';
968
- initial-value: 0deg;
969
- inherits: false;
970
- }
971
-
972
975
  /* Zero specificity, so a host's own position always wins: the ring only
973
976
  needs a containing block, which absolute and fixed already are. */
974
977
  :where(.ds-agent-ring) {
@@ -1238,3 +1241,5 @@
1238
1241
  animation: none;
1239
1242
  }
1240
1243
  }
1244
+
1245
+ } /* @layer rift.components */
@@ -9,6 +9,8 @@
9
9
  the flat action colour.
10
10
  ============================================ */
11
11
 
12
+ @layer rift.tokens, rift.preset, rift.components;
13
+
12
14
  /* The rotation animates a registered custom property: a conic gradient's
13
15
  angle cannot tween otherwise. Browsers without @property render the ring
14
16
  at its initial angle, static — a correct, quieter fallback. */
@@ -18,6 +20,19 @@
18
20
  inherits: false;
19
21
  }
20
22
 
23
+ /* The opening signature: the AI gradient sweeps once around the whole
24
+ border — the button's masked conic ring, run as a single swoosh — then
25
+ fades away, leaving the regular border. The rotation animates a
26
+ registered custom property; without @property support the ring still
27
+ fades in and out, just without turning. */
28
+ @property --ds-ai-summary-ring-angle {
29
+ syntax: '<angle>';
30
+ initial-value: 0deg;
31
+ inherits: false;
32
+ }
33
+
34
+ @layer rift.components {
35
+
21
36
  /* Base */
22
37
  .ds-ai-button {
23
38
  /* Layout */
@@ -505,17 +520,6 @@
505
520
  }
506
521
  }
507
522
 
508
- /* The opening signature: the AI gradient sweeps once around the whole
509
- border — the button's masked conic ring, run as a single swoosh — then
510
- fades away, leaving the regular border. The rotation animates a
511
- registered custom property; without @property support the ring still
512
- fades in and out, just without turning. */
513
- @property --ds-ai-summary-ring-angle {
514
- syntax: '<angle>';
515
- initial-value: 0deg;
516
- inherits: false;
517
- }
518
-
519
523
  .ds-ai-button__summary::before,
520
524
  .ds-ai-button__request::before {
521
525
  content: '';
@@ -762,3 +766,5 @@
762
766
  .ds-tooltip:has(> .ds-ai-button[aria-expanded='true']) .ds-tooltip__panel {
763
767
  display: none;
764
768
  }
769
+
770
+ } /* @layer rift.components */
@@ -3,6 +3,10 @@
3
3
  Contextual feedback with status variants
4
4
  ============================================ */
5
5
 
6
+ @layer rift.tokens, rift.preset, rift.components;
7
+
8
+ @layer rift.components {
9
+
6
10
  .ds-alert {
7
11
  display: flex;
8
12
  align-items: flex-start;
@@ -287,3 +291,5 @@
287
291
  .ds-alert .material-symbols-rounded {
288
292
  color: inherit;
289
293
  }
294
+
295
+ } /* @layer rift.components */
@@ -3,6 +3,10 @@
3
3
  Modal confirmation with backdrop overlay
4
4
  ============================================ */
5
5
 
6
+ @layer rift.tokens, rift.preset, rift.components;
7
+
8
+ @layer rift.components {
9
+
6
10
  .ds-alert-dialog {
7
11
  position: fixed;
8
12
  inset: 0;
@@ -131,3 +135,5 @@
131
135
  margin: var(--padding-400);
132
136
  }
133
137
  }
138
+
139
+ } /* @layer rift.components */
@@ -1,3 +1,7 @@
1
+ @layer rift.tokens, rift.preset, rift.components;
2
+
3
+ @layer rift.components {
4
+
1
5
  /* ============================================
2
6
  ANCHOR NAV
3
7
  "On this page" list of anchor links with a
@@ -135,3 +139,5 @@
135
139
  pointer-events: auto;
136
140
  transform: translate(0, -50%);
137
141
  }
142
+
143
+ } /* @layer rift.components */
@@ -3,6 +3,10 @@
3
3
  A number that counts to its value
4
4
  ============================================ */
5
5
 
6
+ @layer rift.tokens, rift.preset, rift.components;
7
+
8
+ @layer rift.components {
9
+
6
10
  /* Base — inherits the surrounding type entirely: the component is a number
7
11
  inside someone else's composition (a Stat, a table cell, a sentence), so
8
12
  it owns no face, size, or colour of its own. */
@@ -17,3 +21,4 @@
17
21
  font-variant-numeric: tabular-nums;
18
22
  }
19
23
 
24
+ } /* @layer rift.components */
@@ -3,6 +3,10 @@
3
3
  Sidebar rail on the left, centered content area
4
4
  ============================================ */
5
5
 
6
+ @layer rift.tokens, rift.preset, rift.components;
7
+
8
+ @layer rift.components {
9
+
6
10
  .ds-app-layout {
7
11
  /* The contained width, AppLayout's own: an app's working column. */
8
12
  --ds-shell-contained-width: 1120px;
@@ -165,3 +169,5 @@
165
169
  padding: var(--padding-500) var(--padding-400);
166
170
  }
167
171
  }
172
+
173
+ } /* @layer rift.components */
@@ -4,6 +4,10 @@
4
4
  Expanded: 280px with labels, accordion, profile
5
5
  ============================================ */
6
6
 
7
+ @layer rift.tokens, rift.preset, rift.components;
8
+
9
+ @layer rift.components {
10
+
7
11
  /* ============================================
8
12
  WRAPPER
9
13
  ============================================ */
@@ -1005,6 +1009,16 @@
1005
1009
  outline-offset: -2px;
1006
1010
  }
1007
1011
 
1012
+ /* The rail's standalone controls (the collapse toggle, the profile menu
1013
+ button, the mobile trigger) take the same ring, outside their round box as
1014
+ Button's sits, rather than the browser's default. */
1015
+ .ds-app-sidebar__toggle:focus-visible,
1016
+ .ds-app-sidebar__profile-more:focus-visible,
1017
+ .ds-app-sidebar__mobile-trigger:focus-visible {
1018
+ outline: 2px solid var(--color-action-primary-bg);
1019
+ outline-offset: 2px;
1020
+ }
1021
+
1008
1022
  /* ============================================
1009
1023
  DRAWER DRILL-IN — the panel's level as a
1010
1024
  second screen inside the mobile drawer
@@ -1074,7 +1088,9 @@
1074
1088
  width: 40px;
1075
1089
  height: 40px;
1076
1090
  padding: 0;
1077
- background: var(--color-bg-container-primary);
1091
+ /* Opaque: the trigger floats over the page's own content, and the
1092
+ container fill is translucent in dark mode. */
1093
+ background: var(--color-bg-page-primary);
1078
1094
  border: var(--border-025) solid var(--color-bg-container-border);
1079
1095
  border-radius: var(--radius-pill);
1080
1096
  color: var(--color-text-primary);
@@ -1225,3 +1241,5 @@
1225
1241
  .ds-app-sidebar__toggle:active::before {
1226
1242
  background-color: var(--color-action-passive-bg-active);
1227
1243
  }
1244
+
1245
+ } /* @layer rift.components */
@@ -69,7 +69,7 @@ type AppSidebarOwnProps = {
69
69
  sections: AppSidebarSection[];
70
70
  /** Profile data for the bottom section */
71
71
  profile?: AppSidebarProfile;
72
- /** Key of the currently active item */
72
+ /** Key of the currently active item. When one of its children is the current page (`activeSubKey` or `activeTertiaryKey`), that child carries `aria-current` instead, and this row drops its fill while the child shows below it. */
73
73
  activeKey?: string;
74
74
  /** Key of the currently active sub-item */
75
75
  activeSubKey?: string;