rift-ds 1.36.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 (61) hide show
  1. package/README.md +1 -1
  2. package/behaviors/matchParts.d.ts +9 -0
  3. package/behaviors/matchParts.js +10 -0
  4. package/behaviors/useLayer.d.ts +2 -2
  5. package/bin/templates/blocks/app/landing/page.module.css +50 -0
  6. package/bin/templates/blocks/app/landing/page.tsx +157 -0
  7. package/bin/templates/blocks/app/pricing/page.module.css +15 -0
  8. package/bin/templates/blocks/app/pricing/page.tsx +173 -0
  9. package/bin/templates/blocks/components/blocks/MarketingShell.module.css +66 -0
  10. package/bin/templates/blocks/components/blocks/MarketingShell.tsx +141 -0
  11. package/bin/templates/blocks/components/blocks/emberScene.ts +1 -1
  12. package/bin/templates/blocks/registry.json +24 -0
  13. package/chat/AssistantTurn.js +5 -20
  14. package/components/Chart/ActiveReporter.d.ts +32 -0
  15. package/components/Chart/ActiveReporter.js +31 -0
  16. package/components/Chart/AreaChart.d.ts +7 -1
  17. package/components/Chart/AreaChart.js +8 -3
  18. package/components/Chart/BarChart.d.ts +12 -0
  19. package/components/Chart/BarChart.js +8 -3
  20. package/components/Chart/ComboChart.d.ts +7 -1
  21. package/components/Chart/ComboChart.js +8 -3
  22. package/components/Chart/LineChart.d.ts +7 -1
  23. package/components/Chart/LineChart.js +8 -3
  24. package/components/Chart/StackedBarChart.d.ts +7 -1
  25. package/components/Chart/StackedBarChart.js +8 -3
  26. package/components/Combobox/Combobox.css +26 -0
  27. package/components/Combobox/Combobox.d.ts +10 -0
  28. package/components/Combobox/Combobox.js +10 -0
  29. package/components/CommandPalette/CommandPalette.css +26 -0
  30. package/components/CommandPalette/CommandPalette.d.ts +2 -1
  31. package/components/CommandPalette/CommandPalette.js +21 -4
  32. package/components/Drawer/Drawer.css +49 -7
  33. package/components/Drawer/Drawer.d.ts +17 -1
  34. package/components/Drawer/Drawer.js +27 -5
  35. package/components/Dropdown/Dropdown.css +40 -0
  36. package/components/Dropdown/Dropdown.d.ts +7 -0
  37. package/components/Dropdown/Dropdown.js +23 -38
  38. package/components/Instructions/Instructions.css +21 -0
  39. package/components/Instructions/Instructions.d.ts +5 -2
  40. package/components/Instructions/Instructions.js +1 -1
  41. package/components/Mention/Mention.js +6 -6
  42. package/components/NavList/NavList.d.ts +2 -0
  43. package/components/NavList/NavList.js +1 -0
  44. package/components/ShaderScene/ShaderScene.d.ts +3 -2
  45. package/components/ShaderScene/assemble.js +13 -5
  46. package/components/ShaderScene/renderer.d.ts +2 -2
  47. package/components/ShaderScene/types.d.ts +2 -1
  48. package/components/registry.json +3 -3
  49. package/components/registry.json.d.ts +3 -3
  50. package/components/registry.json.js +1 -1
  51. package/markdown/index.d.ts +8 -0
  52. package/markdown/index.js +10 -0
  53. package/markdown/mappers.d.ts +31 -0
  54. package/markdown/mappers.js +43 -0
  55. package/package.json +7 -2
  56. package/tokens/presets/contrast.css +8 -0
  57. package/tokens/presets/forest.css +8 -0
  58. package/tokens/presets/plum.css +18 -5
  59. package/tokens/presets/warm.css +10 -5
  60. package/tokens/presets/zest.css +22 -5
  61. 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
 
@@ -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
+ };
@@ -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
@@ -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
+ }
@@ -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
+ }
@@ -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