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
package/README.md CHANGED
@@ -44,7 +44,7 @@ import 'rift-ds/tokens/base.css'; // the reset and page every component is tuned
44
44
  import { Button, Card, Badge } from 'rift-ds';
45
45
  ```
46
46
 
47
- React 19+ is a peer dependency. The package's own runtime dependencies, TanStack Table and TanStack Virtual (the headless engine under `DataTable` and the windowing behind its long tables), install with it. The package is ESM-only and resolved via `exports` subpaths: use a bundler that handles CSS and font imports from `node_modules` (Vite, Next.js, webpack) and set TypeScript's `moduleResolution` to `"bundler"` or `"nodenext"`. The Recharts-backed charts live behind `rift-ds/charts`, so the optional `recharts` peer dependency is only needed if you use them. The chat widget's subpaths bring their own optional peers (`react-markdown` and `remark-gfm` for the panel, `@anthropic-ai/sdk` for the server handlers, `@upstash/ratelimit` and `@upstash/redis` for the guardrails), needed only if you use them. Code highlighting is the same: `rift-ds/code/highlight` needs the optional `shiki` peer, while `rift-ds/code`'s `packageManagerTabs` needs nothing. Prefer owning the source? Pull single components through the shadcn CLI (`npx shadcn@latest add https://rift-ds.com/r/button.json`, with details in the [get-started guide](https://rift-ds.com/docs/get-started)), or clone this repo and build on it directly; all of it is MIT.
47
+ React 19+ is a peer dependency. The package's own runtime dependencies, TanStack Table and TanStack Virtual (the headless engine under `DataTable` and the windowing behind its long tables), install with it. The package is ESM-only and resolved via `exports` subpaths: use a bundler that handles CSS and font imports from `node_modules` (Vite, Next.js, webpack) and set TypeScript's `moduleResolution` to `"bundler"` or `"nodenext"`. The Recharts-backed charts live behind `rift-ds/charts`, so the optional `recharts` peer dependency is only needed if you use them. The chat widget's subpaths bring their own optional peers (`react-markdown` and `remark-gfm` for the panel, `@anthropic-ai/sdk` for the server handlers, `@upstash/ratelimit` and `@upstash/redis` for the guardrails), needed only if you use them. Code highlighting is the same: `rift-ds/code/highlight` needs the optional `shiki` peer, while `rift-ds/code`'s `packageManagerTabs` needs nothing. Rendering markdown? `rift-ds/markdown` gives your renderer the two elements `Prose` cannot draw alone (a fenced block as `CodeBlock`, a table you can scroll from the keyboard) and needs no peer. Prefer owning the source? Pull single components through the shadcn CLI (`npx shadcn@latest add https://rift-ds.com/r/button.json`, with details in the [get-started guide](https://rift-ds.com/docs/get-started)), or clone this repo and build on it directly; all of it is MIT.
48
48
 
49
49
  ## The chat widget
50
50
 
@@ -107,6 +107,7 @@ import 'rift-ds/tokens/presets/presets.css';
107
107
  - **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.
108
108
  - **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.
109
109
  - **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 { … }`.
110
+ - **Overriding component styles**: component styles sit in a third layer, `rift.components`, after the two token layers, so your own CSS outside a layer always beats them, whatever its selector and in whatever order your bundler loads the sheets. `className` is the supported hook: `.my-table { … }` on `<Table className="my-table" />` holds in development and production alike. That reaches your resets too: a bare `* { margin: 0 }` would strip the components' spacing, so put a reset inside `@layer rift.tokens { … }`, or import `tokens/base.css`, which is already there.
110
111
  - **Fonts**: the base theme bundles no text face, and the whole scale chains to `--font-family-primary` (split heading and body faces via `--font-family-heading` and `--font-family-body`); point them at any font you load. Only the preset stylesheets carry faces, each self-hosting its own, and only the presets you import pull them in.
111
112
  - **Icons**: a Material Symbols Rounded variable font is bundled and components import it themselves, with every Google axis exposed as a custom property. Every icon prop also takes your own element, so any icon set drops in.
112
113
 
@@ -24,6 +24,10 @@
24
24
  the decision's read-out.
25
25
  ============================================ */
26
26
 
27
+ @layer rift.tokens, rift.preset, rift.components;
28
+
29
+ @layer rift.components {
30
+
27
31
  :where(
28
32
  .ds-interrupt-card,
29
33
  .ds-question-card,
@@ -141,3 +145,5 @@
141
145
 
142
146
  color: inherit;
143
147
  }
148
+
149
+ } /* @layer rift.components */
@@ -10,6 +10,10 @@
10
10
  design.md's "Layout follows the reading direction" owns the contract.
11
11
  ============================================ */
12
12
 
13
+ @layer rift.tokens, rift.preset, rift.components;
14
+
15
+ @layer rift.components {
16
+
13
17
  :dir(ltr) {
14
18
  --ds-inline-sign: 1;
15
19
  }
@@ -17,3 +21,5 @@
17
21
  :dir(rtl) {
18
22
  --ds-inline-sign: -1;
19
23
  }
24
+
25
+ } /* @layer rift.components */
@@ -0,0 +1,9 @@
1
+ /**
2
+ * matchParts: where a typed query sits inside a piece of text, as the three
3
+ * runs a list draws: what comes before the match, the match itself in the
4
+ * text's own casing, and what comes after. Null when the query is empty or
5
+ * the text does not hold it. The one home of the rule, so every list that
6
+ * marks what a person typed (a mention menu, a command palette) finds the
7
+ * same run; each component draws the middle part in its own match class.
8
+ */
9
+ export declare const matchParts: (text: string, query: string) => [string, string, string] | null;
@@ -0,0 +1,10 @@
1
+ const matchParts = (text, query) => {
2
+ const needle = query.trim().toLowerCase();
3
+ if (needle === "") return null;
4
+ const at = text.toLowerCase().indexOf(needle);
5
+ if (at < 0) return null;
6
+ return [text.slice(0, at), text.slice(at, at + needle.length), text.slice(at + needle.length)];
7
+ };
8
+ export {
9
+ matchParts
10
+ };
@@ -47,6 +47,10 @@
47
47
  rules these encode.
48
48
  ============================================ */
49
49
 
50
+ @layer rift.tokens, rift.preset, rift.components;
51
+
52
+ @layer rift.components {
53
+
50
54
  :where([data-ds-shell]) {
51
55
  /* The two gaps. The inset gap's value lives with AppSidebar's root rule
52
56
  (--ds-shell-inset) and the float gap's with the floating rail
@@ -214,3 +218,5 @@ html[data-chat='docked-left'] :where([data-ds-shell]:not(.ds-chat-widget__rails)
214
218
  html[data-chat-resizing] :where([data-ds-shell]) {
215
219
  transition: none;
216
220
  }
221
+
222
+ } /* @layer rift.components */
@@ -1,10 +1,10 @@
1
1
  "use client";
2
- import { useSyncExternalStore, useRef, useEffect } from "react";
2
+ import { useRef, useEffect, useSyncExternalStore } from "react";
3
3
  import { MOTION_SHORTCUT_SEQUENCE_MS } from "../tokens/motion.js";
4
4
  import { warnOnce } from "./devWarning.js";
5
5
  import { activeModalPanel } from "./useFocusScope.js";
6
6
  import { hasOpenLayer, openLayerContains } from "./useLayer.js";
7
- import { detectPlatform, parseShortcut, KEY_ALIASES } from "./shortcut-keys.js";
7
+ import { parseShortcut, detectPlatform, KEY_ALIASES } from "./shortcut-keys.js";
8
8
  import { formatShortcut, shortcutAria, shortcutKeys } from "./shortcut-keys.js";
9
9
  const noSubscription = () => () => {
10
10
  };
@@ -54,8 +54,8 @@ type LayerOptions = {
54
54
  */
55
55
  getElements?: () => (HTMLElement | null | undefined)[];
56
56
  /**
57
- * A layer that only listens for Escape and never owns a press: a tooltip
58
- * or a hover card. (Not addEventListener's `passive`.)
57
+ * A layer that only listens for Escape and never owns a press: a tooltip,
58
+ * a hover card or a non-modal Drawer. (Not addEventListener's `passive`.)
59
59
  * The outside-press walk passes through it to the layers beneath, and it is
60
60
  * never the press owner, so a tooltip showing over an open menu (its own
61
61
  * trigger hovered, say) never keeps that menu open or a modal's backdrop
@@ -11,6 +11,10 @@
11
11
  keeps its own rule, with the reason beside it.
12
12
  ============================================ */
13
13
 
14
+ @layer rift.tokens, rift.preset, rift.components;
15
+
16
+ @layer rift.components {
17
+
14
18
  .ds-visually-hidden {
15
19
  position: absolute;
16
20
  width: 1px;
@@ -22,3 +26,5 @@
22
26
  white-space: nowrap;
23
27
  border: 0;
24
28
  }
29
+
30
+ } /* @layer rift.components */
@@ -0,0 +1,50 @@
1
+ /* The landing page's own layout: the type, colour and spacing inside each
2
+ section come from the components, so this file only holds the measures
3
+ a section is set to and the row of customer names. */
4
+
5
+ .hero {
6
+ max-width: 720px; /* the hero's column: the headline and the line under it share one measure */
7
+ margin-inline: auto;
8
+ }
9
+
10
+ .sectionHead {
11
+ max-width: 800px; /* a section's heading column: two lines at the display tier */
12
+ }
13
+
14
+ .plainList {
15
+ list-style: none;
16
+ margin: 0;
17
+ padding: 0;
18
+ }
19
+
20
+ .feature {
21
+ height: 100%;
22
+ }
23
+
24
+ /* The customer names, in a row that wraps and centres. Replace each name
25
+ with a logo image of one height and keep the row. */
26
+
27
+ .customers {
28
+ display: flex;
29
+ flex-wrap: wrap;
30
+ align-items: center;
31
+ justify-content: center;
32
+ gap: var(--gap-500) var(--gap-1500);
33
+ list-style: none;
34
+ margin: 0;
35
+ padding: 0;
36
+ }
37
+
38
+ .customer {
39
+ font-family: var(--font-title-body-family);
40
+ font-size: var(--font-title-body-size);
41
+ font-weight: var(--font-title-body-weight);
42
+ line-height: var(--font-title-body-line-height);
43
+ color: var(--color-text-tertiary);
44
+ }
45
+
46
+ @media (max-width: 600px) {
47
+ .customers {
48
+ gap: var(--gap-300) var(--gap-1000);
49
+ }
50
+ }
@@ -0,0 +1,157 @@
1
+ /**
2
+ * The landing block: a product's front page as a stack of bands. A hero,
3
+ * the names that vouch for it, what it does, the numbers, what customers
4
+ * say, the questions people ask, and a closing call to act. Every section
5
+ * is composed from rift-ds components; the copy is placeholder for a
6
+ * fictional product. Replace the constants below with your own.
7
+ */
8
+
9
+ import { Accordion, type AccordionItem } from 'rift-ds/components/Accordion/Accordion';
10
+ import { Button } from 'rift-ds/components/Button/Button';
11
+ import { Grid } from 'rift-ds/components/Grid/Grid';
12
+ import { Heading } from 'rift-ds/components/Heading/Heading';
13
+ import { Icon } from 'rift-ds/components/Icon/Icon';
14
+ import { Panel } from 'rift-ds/components/Panel/Panel';
15
+ import { Quote } from 'rift-ds/components/Quote/Quote';
16
+ import { Stack } from 'rift-ds/components/Stack/Stack';
17
+ import { Stat } from 'rift-ds/components/Stat/Stat';
18
+ import { Text } from 'rift-ds/components/Text/Text';
19
+ import { Band, MarketingShell } from '../../components/blocks/MarketingShell';
20
+ import styles from './page.module.css';
21
+
22
+ /** The companies named under the hero. Swap the names for logo images of one height. */
23
+ const CUSTOMERS = ['Northwind', 'Lumen', 'Harbor', 'Fieldstone', 'Juniper', 'Atlas'];
24
+
25
+ /** What the product does, three to six at a time. */
26
+ const FEATURES = [
27
+ { icon: 'bolt', title: 'Fast from the first click', body: 'Pages open in a blink, so the team stays in the work and out of the spinner.' },
28
+ { icon: 'hub', title: 'Everything in one place', body: 'Plans, tasks and notes share one home, with nothing to copy between tools.' },
29
+ { icon: 'lock', title: 'Private by default', body: 'Your data stays yours, with access you set per person and per project.' },
30
+ { icon: 'insights', title: 'Answers, not dashboards', body: 'Ask a question in plain words and get the number, with where it came from.' },
31
+ { icon: 'sync', title: 'Works with what you use', body: 'Connect the tools you already run and keep them in step both ways.' },
32
+ { icon: 'support_agent', title: 'People when you need them', body: 'A real person answers within the hour, every working day.' },
33
+ ];
34
+
35
+ /** The numbers that make the case. */
36
+ const STATS = [
37
+ { value: '12,000+', label: 'Teams on Acme' },
38
+ { value: '99.99%', label: 'Uptime over the last year' },
39
+ { value: '38%', label: 'Less time in status meetings' },
40
+ { value: '4.8 / 5', label: 'Average customer rating' },
41
+ ];
42
+
43
+ /** What customers say. Use real words from real people, with their say-so. */
44
+ const QUOTES = [
45
+ { body: 'We replaced three tools in a week, and nobody asked for the old ones back.', attribution: 'Dana Whitfield', detail: 'Head of Operations, Northwind' },
46
+ { body: 'It is the first planning tool the engineers opened without being told to.', attribution: 'Marcus Oyelaran', detail: 'VP Engineering, Lumen' },
47
+ { body: 'Setup took an afternoon. The Monday meeting has not happened since.', attribution: 'Priya Raman', detail: 'Founder, Fieldstone' },
48
+ ];
49
+
50
+ /** The questions people ask before they sign up. */
51
+ const FAQ: AccordionItem[] = [
52
+ { id: 'trial', title: 'Is there a free trial?', content: 'Yes. Every plan starts with 14 days free, with no card needed until you choose to stay.' },
53
+ { id: 'import', title: 'Can I bring my existing data?', content: 'You can import from a spreadsheet or from the tools most teams start on, and we will help with anything larger.' },
54
+ { id: 'security', title: 'How is my data protected?', content: 'Data is encrypted in transit and at rest, and access is set per person and per project.' },
55
+ { id: 'cancel', title: 'What happens if I cancel?', content: 'You keep access until the end of the period you paid for, and you can export everything at any time.' },
56
+ ];
57
+
58
+ export default function LandingPage() {
59
+ return (
60
+ <MarketingShell currentHref="#product">
61
+ {/* Hero: one line that says what it is, one that says why, two ways forward. */}
62
+ <Band spacing="large" aria-label="Introduction">
63
+ <Stack gap="500" align="center" className={styles.hero}>
64
+ <Text tier="overline" tone="neutral">New: answers in plain words</Text>
65
+ <Heading level={1} tier="display-1" align="center" balance>
66
+ Plan, ship and learn in one place
67
+ </Heading>
68
+ <Text align="center" tone="neutral">
69
+ Acme brings your plans, your tasks and your numbers together, so the whole team sees the same picture and moves on it.
70
+ </Text>
71
+ <Stack direction="row" gap="300" justify="center" wrap>
72
+ <Button variant="primary" label="Start free" href="#" />
73
+ <Button variant="secondary" tone="neutral" label="See how it works" href="#features" />
74
+ </Stack>
75
+ </Stack>
76
+ </Band>
77
+
78
+ {/* The names that vouch for it. */}
79
+ <Band surface="raised" aria-label="Customers">
80
+ <Stack gap="400" align="center">
81
+ <Text tier="paragraph-sm" tone="neutral" align="center">Trusted by teams at</Text>
82
+ <ul className={styles.customers}>
83
+ {CUSTOMERS.map((name) => (
84
+ <li key={name} className={styles.customer}>{name}</li>
85
+ ))}
86
+ </ul>
87
+ </Stack>
88
+ </Band>
89
+
90
+ {/* What it does. */}
91
+ <Band id="features">
92
+ <Stack gap="1000">
93
+ <Stack gap="500" className={styles.sectionHead}>
94
+ <Heading level={2} tier="display-2" balance>Everything a team needs to move</Heading>
95
+ <Text tone="neutral">Six things Acme does well, so you can stop holding the rest together by hand.</Text>
96
+ </Stack>
97
+ <Grid minColumnWidth="280px" gap="500" as="ul" className={styles.plainList}>
98
+ {FEATURES.map((feature) => (
99
+ <li key={feature.title}>
100
+ <Panel className={styles.feature}>
101
+ <Icon name={feature.icon} size="800" tile />
102
+ <Heading level={3}>{feature.title}</Heading>
103
+ <Text tone="neutral">{feature.body}</Text>
104
+ </Panel>
105
+ </li>
106
+ ))}
107
+ </Grid>
108
+ </Stack>
109
+ </Band>
110
+
111
+ {/* The numbers. */}
112
+ <Band surface="raised" aria-label="Acme in numbers">
113
+ <Grid columns={4} minColumnWidth="180px" gap="500">
114
+ {STATS.map((stat) => (
115
+ <Stat key={stat.label} size="large" value={stat.value} label={stat.label} />
116
+ ))}
117
+ </Grid>
118
+ </Band>
119
+
120
+ {/* What customers say. */}
121
+ <Band>
122
+ <Stack gap="1000">
123
+ <Heading level={2} tier="display-2" balance className={styles.sectionHead}>
124
+ Teams that switched, in their words
125
+ </Heading>
126
+ <Grid minColumnWidth="280px" gap="1000">
127
+ {QUOTES.map((quote) => (
128
+ <Quote key={quote.attribution} attribution={quote.attribution} detail={quote.detail}>
129
+ {quote.body}
130
+ </Quote>
131
+ ))}
132
+ </Grid>
133
+ </Stack>
134
+ </Band>
135
+
136
+ {/* The questions people ask. */}
137
+ <Band surface="raised" width="narrow">
138
+ <Stack gap="1000">
139
+ <Heading level={2} tier="display-2">Questions, answered</Heading>
140
+ <Accordion items={FAQ} />
141
+ </Stack>
142
+ </Band>
143
+
144
+ {/* The closing call to act. */}
145
+ <Band spacing="large" width="narrow" aria-label="Get started">
146
+ <Stack gap="500" align="center">
147
+ <Heading level={2} tier="display-2" align="center" balance>Ready when your team is</Heading>
148
+ <Text align="center" tone="neutral">Start free for 14 days. No card, no call, no catch.</Text>
149
+ <Stack direction="row" gap="300" justify="center" wrap>
150
+ <Button variant="primary" label="Start free" href="#" />
151
+ <Button variant="tertiary" label="See pricing" href="#" iconRight="arrow_forward" />
152
+ </Stack>
153
+ </Stack>
154
+ </Band>
155
+ </MarketingShell>
156
+ );
157
+ }
@@ -0,0 +1,15 @@
1
+ /* The pricing page's own layout is two rules. The plans' grid, the cards
2
+ and the table come from the components. */
3
+
4
+ /* A plan's button runs the width of its card. */
5
+ .full {
6
+ width: 100%;
7
+ }
8
+
9
+ /* The featured plan's badge sits in its card's header without making that
10
+ header taller than its neighbours': it gives back its own block padding
11
+ and border, so every plan's summary, price and button stay level. */
12
+ .tag {
13
+ display: inline-flex;
14
+ margin-block: calc(-1 * (var(--padding-050) + var(--border-025)));
15
+ }
@@ -0,0 +1,173 @@
1
+ 'use client';
2
+
3
+ /**
4
+ * The pricing block: the plans side by side with a monthly or yearly
5
+ * choice, then every feature compared in one table. Prices are decimal
6
+ * strings written through rift-ds/format, so a currency or a locale is one
7
+ * value changed. The plans and features are placeholder for a fictional
8
+ * product. Replace the constants below with your own.
9
+ */
10
+
11
+ import { useState } from 'react';
12
+ import { Badge } from 'rift-ds/components/Badge/Badge';
13
+ import { Button } from 'rift-ds/components/Button/Button';
14
+ import { Grid } from 'rift-ds/components/Grid/Grid';
15
+ import { Heading } from 'rift-ds/components/Heading/Heading';
16
+ import { Icon } from 'rift-ds/components/Icon/Icon';
17
+ import { List, ListItem } from 'rift-ds/components/List/List';
18
+ import { SegmentedControl } from 'rift-ds/components/SegmentedControl/SegmentedControl';
19
+ import { Stack } from 'rift-ds/components/Stack/Stack';
20
+ import { Stat } from 'rift-ds/components/Stat/Stat';
21
+ import { Table, type TableColumn, type TableRow } from 'rift-ds/components/Table/Table';
22
+ import { Text } from 'rift-ds/components/Text/Text';
23
+ import { Widget } from 'rift-ds/components/Widget/Widget';
24
+ import { formatMoney } from 'rift-ds/format';
25
+ import { Band, MarketingShell } from '../../components/blocks/MarketingShell';
26
+ import styles from './page.module.css';
27
+
28
+ /** The currency and locale every price is written in. */
29
+ const CURRENCY = 'USD';
30
+ const LOCALE = 'en-US';
31
+
32
+ type Period = 'monthly' | 'yearly';
33
+
34
+ interface Plan {
35
+ id: string;
36
+ name: string;
37
+ summary: string;
38
+ /** The price per seat per month in each period, as a decimal string; none for a plan sold by quote. */
39
+ price?: Record<Period, string>;
40
+ features: string[];
41
+ action: string;
42
+ /** The plan most teams pick: it takes the badge and the primary button. */
43
+ featured?: boolean;
44
+ }
45
+
46
+ const PLANS: Plan[] = [
47
+ {
48
+ id: 'starter',
49
+ name: 'Starter',
50
+ summary: 'For a small team finding its feet.',
51
+ price: { monthly: '0', yearly: '0' },
52
+ features: ['Up to 5 people', '3 projects', 'Community support'],
53
+ action: 'Start free',
54
+ },
55
+ {
56
+ id: 'team',
57
+ name: 'Team',
58
+ summary: 'For a team that ships every week.',
59
+ price: { monthly: '15', yearly: '12' },
60
+ features: ['Unlimited people', 'Unlimited projects', 'Answers in plain words', 'Support within the hour'],
61
+ action: 'Start free trial',
62
+ featured: true,
63
+ },
64
+ {
65
+ id: 'enterprise',
66
+ name: 'Enterprise',
67
+ summary: 'For a company with rules to meet.',
68
+ features: ['Everything in Team', 'Single sign-on', 'Audit log', 'A named contact'],
69
+ action: 'Talk to sales',
70
+ },
71
+ ];
72
+
73
+ const yes = <Icon name="check" size="500" label="Included" />;
74
+ const no = <Icon name="remove" size="500" tone="neutral" label="Not included" />;
75
+
76
+ const COMPARE_COLUMNS: TableColumn[] = [
77
+ { key: 'feature', header: 'Feature', rowHeader: true },
78
+ { key: 'starter', header: 'Starter', align: 'center' },
79
+ { key: 'team', header: 'Team', align: 'center' },
80
+ { key: 'enterprise', header: 'Enterprise', align: 'center' },
81
+ ];
82
+
83
+ const COMPARE_ROWS: TableRow[] = [
84
+ { id: 'people', cells: { feature: 'People', starter: 'Up to 5', team: 'Unlimited', enterprise: 'Unlimited' } },
85
+ { id: 'projects', cells: { feature: 'Projects', starter: '3', team: 'Unlimited', enterprise: 'Unlimited' } },
86
+ { id: 'answers', cells: { feature: 'Answers in plain words', starter: no, team: yes, enterprise: yes } },
87
+ { id: 'integrations', cells: { feature: 'Integrations', starter: '2', team: 'All', enterprise: 'All, plus your own' } },
88
+ { id: 'sso', cells: { feature: 'Single sign-on', starter: no, team: no, enterprise: yes } },
89
+ { id: 'audit', cells: { feature: 'Audit log', starter: no, team: no, enterprise: yes } },
90
+ { id: 'support', cells: { feature: 'Support', starter: 'Community', team: 'Within the hour', enterprise: 'A named contact' } },
91
+ ];
92
+
93
+ export default function PricingPage() {
94
+ const [period, setPeriod] = useState<Period>('yearly');
95
+
96
+ return (
97
+ <MarketingShell currentHref="#pricing">
98
+ <Band spacing="large" aria-label="Plans">
99
+ <Stack gap="1000">
100
+ <Stack gap="500" align="center">
101
+ <Heading level={1} tier="display-1" align="center" balance>
102
+ A plan for every size of team
103
+ </Heading>
104
+ <Text align="center" tone="neutral">
105
+ Start free and move up when you need to. Pay yearly and keep two months.
106
+ </Text>
107
+ <SegmentedControl
108
+ aria-label="Billing period"
109
+ segments={[
110
+ { value: 'monthly', label: 'Monthly' },
111
+ { value: 'yearly', label: 'Yearly' },
112
+ ]}
113
+ value={period}
114
+ onValueChange={(value) => setPeriod(value as Period)}
115
+ />
116
+ </Stack>
117
+
118
+ <Grid minColumnWidth="280px" gap="500" align="stretch">
119
+ {PLANS.map((plan) => (
120
+ <Widget
121
+ key={plan.id}
122
+ title={plan.name}
123
+ titleAs="h2"
124
+ action={
125
+ plan.featured ? (
126
+ <span className={styles.tag}>
127
+ <Badge label="Most popular" variant="info" />
128
+ </span>
129
+ ) : undefined
130
+ }
131
+ >
132
+ {/* The summary, the price and the button come before the
133
+ features, so they sit level across the cards however
134
+ many features a plan lists. */}
135
+ <Stack gap="500">
136
+ <Text tone="neutral">{plan.summary}</Text>
137
+ {plan.price ? (
138
+ <Stat
139
+ size="large"
140
+ value={formatMoney(plan.price[period], { currency: CURRENCY, locale: LOCALE, fractionDigits: 0 })}
141
+ label={period === 'yearly' ? 'per person each month, billed yearly' : 'per person each month'}
142
+ />
143
+ ) : (
144
+ <Stat size="large" value="Custom" label="priced to fit your company" />
145
+ )}
146
+ <Button
147
+ variant={plan.featured ? 'primary' : 'secondary'}
148
+ tone={plan.featured ? 'default' : 'neutral'}
149
+ label={plan.action}
150
+ href="#"
151
+ className={styles.full}
152
+ />
153
+ <List variant="unordered" marker="check">
154
+ {plan.features.map((feature) => (
155
+ <ListItem key={feature}>{feature}</ListItem>
156
+ ))}
157
+ </List>
158
+ </Stack>
159
+ </Widget>
160
+ ))}
161
+ </Grid>
162
+ </Stack>
163
+ </Band>
164
+
165
+ <Band surface="raised">
166
+ <Stack gap="1000">
167
+ <Heading level={2} tier="display-2">Compare the plans</Heading>
168
+ <Table columns={COMPARE_COLUMNS} rows={COMPARE_ROWS} bordered caption="What each plan includes" captionHidden />
169
+ </Stack>
170
+ </Band>
171
+ </MarketingShell>
172
+ );
173
+ }
@@ -65,7 +65,7 @@ export function ProfileForm() {
65
65
  columns={2}
66
66
  title="Profile"
67
67
  description="How you appear to the people you work with."
68
- actions={<Button label={saved ? 'Saved' : 'Save profile'} onClick={save} />}
68
+ actions={<Button type="submit" label={saved ? 'Saved' : 'Save profile'} />}
69
69
  >
70
70
  <Input
71
71
  id="profile-firstName"
@@ -32,8 +32,8 @@ export default function SignInPage() {
32
32
  // Hand { email, password, remember } to your auth provider here.
33
33
  };
34
34
 
35
- /* Button renders type="button", so the form submits through Enter in a
36
- field (onSubmit) and the button calls the same function on click. */
35
+ /* The Sign in button is the form's submit button, so a click and Enter in
36
+ a field both arrive here. */
37
37
  const handleSubmit = (event: FormEvent<HTMLFormElement>) => {
38
38
  event.preventDefault();
39
39
  signIn();
@@ -73,7 +73,7 @@ export default function SignInPage() {
73
73
  <Checkbox label="Remember me" checked={remember} onCheckedChange={setRemember} />
74
74
  <Button variant="tertiary" size="compact" label="Forgot password?" href="#" />
75
75
  </div>
76
- <Button variant="primary" label="Sign in" className={styles.full} onClick={signIn} />
76
+ <Button type="submit" variant="primary" label="Sign in" className={styles.full} />
77
77
  </form>
78
78
 
79
79
  <Divider label="or" labelPosition="center" spacing="none" />
@@ -0,0 +1,66 @@
1
+ /* The marketing shell: the header, the page's bands and the footer in one
2
+ column the height of the window, so a short page still puts its footer
3
+ at the bottom. */
4
+
5
+ .shell {
6
+ min-height: 100dvh;
7
+ display: flex;
8
+ flex-direction: column;
9
+ background-color: var(--color-bg-page-primary);
10
+ }
11
+
12
+ .main {
13
+ flex: 1;
14
+ display: flex;
15
+ flex-direction: column;
16
+ }
17
+
18
+ .brand {
19
+ font-family: var(--font-title-body-family);
20
+ font-size: var(--font-title-body-size);
21
+ font-weight: var(--font-title-body-weight);
22
+ color: var(--color-text-primary);
23
+ }
24
+
25
+ /* A band runs the window's width and holds its content to one centred
26
+ column, a gutter in from each edge. The column's width and gutter are
27
+ the library's page width, set on the shell (data-ds-width and
28
+ data-ds-contained), which the header and the footer read too, so a
29
+ band's content starts under the brand. */
30
+
31
+ .band {
32
+ padding-block: var(--gap-2000);
33
+ }
34
+
35
+ .bandLarge {
36
+ padding-block: var(--gap-3000);
37
+ }
38
+
39
+ .bandRaised {
40
+ background-color: var(--color-bg-container-primary);
41
+ }
42
+
43
+ .inner {
44
+ width: 100%;
45
+ max-width: var(--ds-shell-contained-width);
46
+ margin-inline: auto;
47
+ padding-inline: var(--ds-shell-gutter);
48
+ }
49
+
50
+ .footer {
51
+ padding-block: var(--gap-1000);
52
+ }
53
+
54
+ .innerNarrow {
55
+ max-width: 720px; /* a reading measure, for a band of copy */
56
+ }
57
+
58
+ @media (max-width: 768px) {
59
+ .band {
60
+ padding-block: var(--gap-1500);
61
+ }
62
+
63
+ .bandLarge {
64
+ padding-block: var(--gap-2000);
65
+ }
66
+ }