oneslash-design-system 2.19.0 → 2.21.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 (264) hide show
  1. package/README.md +1 -1
  2. package/dist/DESIGN.md +62 -5
  3. package/dist/cases/about-page/profile.d.ts +1 -0
  4. package/dist/cases/about-page/profile.jsx +64 -0
  5. package/dist/cases/about-page.md +114 -0
  6. package/dist/cases/admin-inbox/list.d.ts +1 -0
  7. package/dist/cases/admin-inbox/list.jsx +104 -0
  8. package/dist/cases/admin-inbox/split.d.ts +1 -0
  9. package/dist/cases/admin-inbox/split.jsx +68 -0
  10. package/dist/cases/admin-inbox.md +254 -0
  11. package/dist/cases/api-keys.md +1 -1
  12. package/dist/cases/billing-page/billed-elsewhere.d.ts +1 -0
  13. package/dist/cases/billing-page/billed-elsewhere.jsx +28 -0
  14. package/dist/cases/billing-page/self-serve.d.ts +1 -0
  15. package/dist/cases/billing-page/self-serve.jsx +134 -0
  16. package/dist/cases/billing-page.md +247 -0
  17. package/dist/cases/blog-index/cards.d.ts +1 -0
  18. package/dist/cases/blog-index/cards.jsx +45 -0
  19. package/dist/cases/blog-index/list.d.ts +1 -0
  20. package/dist/cases/blog-index/list.jsx +46 -0
  21. package/dist/cases/blog-index.md +160 -0
  22. package/dist/cases/breakdown-list/bars.d.ts +1 -0
  23. package/dist/cases/breakdown-list/bars.jsx +47 -0
  24. package/dist/cases/breakdown-list/table.d.ts +1 -0
  25. package/dist/cases/breakdown-list/table.jsx +69 -0
  26. package/dist/cases/breakdown-list.md +158 -0
  27. package/dist/cases/changelog/by-month.d.ts +1 -0
  28. package/dist/cases/changelog/by-month.jsx +70 -0
  29. package/dist/cases/changelog/one-page.d.ts +1 -0
  30. package/dist/cases/changelog/one-page.jsx +70 -0
  31. package/dist/cases/changelog.md +200 -0
  32. package/dist/cases/code-sample/block.d.ts +1 -0
  33. package/dist/cases/code-sample/block.jsx +19 -0
  34. package/dist/cases/code-sample/command.d.ts +1 -0
  35. package/dist/cases/code-sample/command.jsx +17 -0
  36. package/dist/cases/code-sample.md +96 -0
  37. package/dist/cases/composer-limit/notice-with-action.jsx +3 -3
  38. package/dist/cases/composer-limit/notice.jsx +3 -3
  39. package/dist/cases/composer-limit.md +8 -8
  40. package/dist/cases/contact-page/form.d.ts +1 -0
  41. package/dist/cases/contact-page/form.jsx +83 -0
  42. package/dist/cases/contact-page/links.d.ts +1 -0
  43. package/dist/cases/contact-page/links.jsx +19 -0
  44. package/dist/cases/contact-page.md +142 -0
  45. package/dist/cases/dashboard/numbers-first.d.ts +1 -0
  46. package/dist/cases/dashboard/numbers-first.jsx +165 -0
  47. package/dist/cases/dashboard/work-first.d.ts +1 -0
  48. package/dist/cases/dashboard/work-first.jsx +165 -0
  49. package/dist/cases/dashboard.md +507 -0
  50. package/dist/cases/data-table-page/all-rows.d.ts +1 -0
  51. package/dist/cases/data-table-page/all-rows.jsx +226 -0
  52. package/dist/cases/data-table-page/paged.d.ts +1 -0
  53. package/dist/cases/data-table-page/paged.jsx +284 -0
  54. package/dist/cases/data-table-page.md +771 -0
  55. package/dist/cases/docs-component-page/reference.d.ts +1 -0
  56. package/dist/cases/docs-component-page/reference.jsx +93 -0
  57. package/dist/cases/docs-component-page.md +144 -0
  58. package/dist/cases/faq/accordion.d.ts +1 -0
  59. package/dist/cases/faq/accordion.jsx +25 -0
  60. package/dist/cases/faq/open-list.d.ts +1 -0
  61. package/dist/cases/faq/open-list.jsx +27 -0
  62. package/dist/cases/faq.md +110 -0
  63. package/dist/cases/feature-grid/cards.d.ts +1 -0
  64. package/dist/cases/feature-grid/cards.jsx +33 -0
  65. package/dist/cases/feature-grid/rows.d.ts +1 -0
  66. package/dist/cases/feature-grid/rows.jsx +30 -0
  67. package/dist/cases/feature-grid.md +132 -0
  68. package/dist/cases/image-viewer/gallery.d.ts +1 -0
  69. package/dist/cases/image-viewer/gallery.jsx +32 -0
  70. package/dist/cases/image-viewer/single.d.ts +1 -0
  71. package/dist/cases/image-viewer/single.jsx +25 -0
  72. package/dist/cases/image-viewer.md +123 -0
  73. package/dist/cases/invoice-list/table.d.ts +1 -0
  74. package/dist/cases/invoice-list/table.jsx +64 -0
  75. package/dist/cases/invoice-list/with-upcoming.d.ts +1 -0
  76. package/dist/cases/invoice-list/with-upcoming.jsx +75 -0
  77. package/dist/cases/invoice-list.md +237 -0
  78. package/dist/cases/landing-hero/centered.d.ts +1 -0
  79. package/dist/cases/landing-hero/centered.jsx +22 -0
  80. package/dist/cases/landing-hero/split.d.ts +1 -0
  81. package/dist/cases/landing-hero/split.jsx +30 -0
  82. package/dist/cases/landing-hero.md +114 -0
  83. package/dist/cases/legal-page/sections.d.ts +1 -0
  84. package/dist/cases/legal-page/sections.jsx +61 -0
  85. package/dist/cases/legal-page.md +96 -0
  86. package/dist/cases/load-failure/inline.jsx +2 -2
  87. package/dist/cases/load-failure.md +2 -2
  88. package/dist/cases/long-form-page/article.d.ts +1 -0
  89. package/dist/cases/long-form-page/article.jsx +58 -0
  90. package/dist/cases/long-form-page/with-contents.d.ts +1 -0
  91. package/dist/cases/long-form-page/with-contents.jsx +41 -0
  92. package/dist/cases/long-form-page.md +170 -0
  93. package/dist/cases/members-list/rows.jsx +2 -1
  94. package/dist/cases/members-list/table.jsx +8 -9
  95. package/dist/cases/members-list.md +12 -13
  96. package/dist/cases/message-actions/hover-toolbar.jsx +11 -8
  97. package/dist/cases/message-actions/menu.jsx +10 -7
  98. package/dist/cases/message-actions.md +19 -13
  99. package/dist/cases/message-attachments/in-composer.jsx +2 -2
  100. package/dist/cases/message-attachments/in-message.jsx +16 -11
  101. package/dist/cases/message-attachments.md +29 -17
  102. package/dist/cases/number-format.md +36 -0
  103. package/dist/cases/one-main-action.md +33 -0
  104. package/dist/cases/overflow-menu/in-a-header.jsx +9 -6
  105. package/dist/cases/overflow-menu/on-a-row.jsx +9 -6
  106. package/dist/cases/overflow-menu.md +16 -10
  107. package/dist/cases/page-end/cta-band.d.ts +1 -0
  108. package/dist/cases/page-end/cta-band.jsx +24 -0
  109. package/dist/cases/page-end/next-link.d.ts +1 -0
  110. package/dist/cases/page-end/next-link.jsx +18 -0
  111. package/dist/cases/page-end.md +88 -0
  112. package/dist/cases/paged-card/pager.d.ts +1 -0
  113. package/dist/cases/paged-card/pager.jsx +41 -0
  114. package/dist/cases/paged-card/see-all.d.ts +1 -0
  115. package/dist/cases/paged-card/see-all.jsx +34 -0
  116. package/dist/cases/paged-card.md +147 -0
  117. package/dist/cases/password-gate/inline.d.ts +1 -0
  118. package/dist/cases/password-gate/inline.jsx +94 -0
  119. package/dist/cases/password-gate/modal.d.ts +1 -0
  120. package/dist/cases/password-gate/modal.jsx +81 -0
  121. package/dist/cases/password-gate/page.d.ts +1 -0
  122. package/dist/cases/password-gate/page.jsx +82 -0
  123. package/dist/cases/password-gate.md +351 -0
  124. package/dist/cases/payment-method/none.d.ts +1 -0
  125. package/dist/cases/payment-method/none.jsx +17 -0
  126. package/dist/cases/payment-method/on-file.d.ts +1 -0
  127. package/dist/cases/payment-method/on-file.jsx +92 -0
  128. package/dist/cases/payment-method.md +182 -0
  129. package/dist/cases/plan-change-confirm/blocked.d.ts +1 -0
  130. package/dist/cases/plan-change-confirm/blocked.jsx +48 -0
  131. package/dist/cases/plan-change-confirm/downgrade.d.ts +1 -0
  132. package/dist/cases/plan-change-confirm/downgrade.jsx +52 -0
  133. package/dist/cases/plan-change-confirm/upgrade.d.ts +1 -0
  134. package/dist/cases/plan-change-confirm/upgrade.jsx +51 -0
  135. package/dist/cases/plan-change-confirm.md +261 -0
  136. package/dist/cases/plan-picker/cards.d.ts +1 -0
  137. package/dist/cases/plan-picker/cards.jsx +97 -0
  138. package/dist/cases/plan-picker/list.d.ts +1 -0
  139. package/dist/cases/plan-picker/list.jsx +103 -0
  140. package/dist/cases/plan-picker.md +297 -0
  141. package/dist/cases/pricing-section/cards.d.ts +1 -0
  142. package/dist/cases/pricing-section/cards.jsx +40 -0
  143. package/dist/cases/pricing-section.md +85 -0
  144. package/dist/cases/product-cards/grid.d.ts +1 -0
  145. package/dist/cases/product-cards/grid.jsx +20 -0
  146. package/dist/cases/product-cards.md +71 -0
  147. package/dist/cases/range-switch/segmented.jsx +11 -7
  148. package/dist/cases/range-switch.md +16 -11
  149. package/dist/cases/reply-feedback/thumbs.jsx +11 -8
  150. package/dist/cases/reply-feedback/with-reason.jsx +11 -8
  151. package/dist/cases/reply-feedback.md +20 -14
  152. package/dist/cases/section-index/cards.d.ts +1 -0
  153. package/dist/cases/section-index/cards.jsx +25 -0
  154. package/dist/cases/section-index/list.d.ts +1 -0
  155. package/dist/cases/section-index/list.jsx +56 -0
  156. package/dist/cases/section-index.md +140 -0
  157. package/dist/cases/settings-page/top-tabs.jsx +4 -3
  158. package/dist/cases/settings-page.md +5 -4
  159. package/dist/cases/site-header.md +1 -1
  160. package/dist/cases/site-search/dialog.d.ts +1 -0
  161. package/dist/cases/site-search/dialog.jsx +131 -0
  162. package/dist/cases/site-search.md +176 -0
  163. package/dist/cases/stat-row/featured.d.ts +1 -0
  164. package/dist/cases/stat-row/featured.jsx +17 -0
  165. package/dist/cases/stat-row/tiles.d.ts +1 -0
  166. package/dist/cases/stat-row/tiles.jsx +34 -0
  167. package/dist/cases/stat-row.md +104 -0
  168. package/dist/cases/status-label/dot.d.ts +1 -0
  169. package/dist/cases/status-label/dot.jsx +39 -0
  170. package/dist/cases/status-label/text.d.ts +1 -0
  171. package/dist/cases/status-label/text.jsx +44 -0
  172. package/dist/cases/status-label.md +143 -0
  173. package/dist/cases/tabbed-panels/tabs.d.ts +1 -0
  174. package/dist/cases/tabbed-panels/tabs.jsx +40 -0
  175. package/dist/cases/tabbed-panels.md +81 -0
  176. package/dist/cases/upgrade-prompt/inline.jsx +4 -2
  177. package/dist/cases/upgrade-prompt/modal.jsx +2 -1
  178. package/dist/cases/upgrade-prompt.md +10 -6
  179. package/dist/cases/usage-meters/by-person.d.ts +1 -0
  180. package/dist/cases/usage-meters/by-person.jsx +72 -0
  181. package/dist/cases/usage-meters/meters.d.ts +1 -0
  182. package/dist/cases/usage-meters/meters.jsx +49 -0
  183. package/dist/cases/usage-meters/with-cap.d.ts +1 -0
  184. package/dist/cases/usage-meters/with-cap.jsx +73 -0
  185. package/dist/cases/usage-meters.md +303 -0
  186. package/dist/cases.json +2178 -97
  187. package/dist/components/accordion.d.ts +31 -0
  188. package/dist/components/accordion.jsx +103 -0
  189. package/dist/components/button.d.ts +1 -1
  190. package/dist/components/button.jsx +11 -5
  191. package/dist/components/codeBlock.d.ts +26 -0
  192. package/dist/components/codeBlock.jsx +101 -0
  193. package/dist/components/formatNumber.d.ts +25 -0
  194. package/dist/components/formatNumber.js +125 -0
  195. package/dist/components/iconButton.jsx +12 -7
  196. package/dist/components/lightbox.d.ts +31 -0
  197. package/dist/components/lightbox.jsx +161 -0
  198. package/dist/components/linkCard.d.ts +10 -1
  199. package/dist/components/linkCard.jsx +32 -6
  200. package/dist/components/modal.d.ts +10 -2
  201. package/dist/components/modal.jsx +17 -12
  202. package/dist/components/pageHeader.jsx +1 -1
  203. package/dist/components/pagination.d.ts +28 -0
  204. package/dist/components/pagination.jsx +89 -0
  205. package/dist/components/progress.d.ts +33 -0
  206. package/dist/components/progress.jsx +50 -0
  207. package/dist/components/searchDialog.d.ts +44 -0
  208. package/dist/components/searchDialog.jsx +152 -0
  209. package/dist/components/skeleton.d.ts +21 -0
  210. package/dist/components/skeleton.jsx +41 -0
  211. package/dist/components/statTile.d.ts +32 -0
  212. package/dist/components/statTile.jsx +61 -0
  213. package/dist/components/tab.d.ts +5 -1
  214. package/dist/components/tab.jsx +2 -2
  215. package/dist/components/tabPanel.d.ts +16 -0
  216. package/dist/components/tabPanel.jsx +12 -0
  217. package/dist/components/tableContainer.d.ts +5 -1
  218. package/dist/components/tableContainer.jsx +9 -1
  219. package/dist/components/tableHeaderCell.d.ts +3 -1
  220. package/dist/components/tableHeaderCell.jsx +2 -2
  221. package/dist/components/tabsContainer.d.ts +5 -1
  222. package/dist/components/tabsContainer.jsx +2 -2
  223. package/dist/components/titleBar.d.ts +3 -1
  224. package/dist/components/titleBar.jsx +4 -3
  225. package/dist/index.d.ts +10 -0
  226. package/dist/index.js +10 -0
  227. package/dist/internal/accordion.d.ts +4 -0
  228. package/dist/internal/accordion.js +53 -0
  229. package/dist/internal/combobox.d.ts +20 -0
  230. package/dist/internal/combobox.js +28 -0
  231. package/dist/internal/highlight.d.ts +5 -0
  232. package/dist/internal/highlight.js +18 -0
  233. package/dist/native-mapping.json +57 -3
  234. package/dist/stories/Accordion.stories.d.ts +11 -0
  235. package/dist/stories/Accordion.stories.jsx +93 -0
  236. package/dist/stories/Button.stories.d.ts +1 -0
  237. package/dist/stories/Button.stories.jsx +19 -1
  238. package/dist/stories/Cases.generated.stories.d.ts +60 -0
  239. package/dist/stories/Cases.generated.stories.jsx +120 -0
  240. package/dist/stories/CodeBlock.stories.d.ts +12 -0
  241. package/dist/stories/CodeBlock.stories.jsx +65 -0
  242. package/dist/stories/Lightbox.stories.d.ts +8 -0
  243. package/dist/stories/Lightbox.stories.jsx +40 -0
  244. package/dist/stories/LinkCard.stories.d.ts +6 -0
  245. package/dist/stories/LinkCard.stories.jsx +17 -0
  246. package/dist/stories/PageHeader.stories.d.ts +2 -0
  247. package/dist/stories/PageHeader.stories.jsx +13 -0
  248. package/dist/stories/Pagination.stories.d.ts +9 -0
  249. package/dist/stories/Pagination.stories.jsx +75 -0
  250. package/dist/stories/Progress.stories.d.ts +9 -0
  251. package/dist/stories/Progress.stories.jsx +43 -0
  252. package/dist/stories/SearchDialog.stories.d.ts +17 -0
  253. package/dist/stories/SearchDialog.stories.jsx +111 -0
  254. package/dist/stories/Skeleton.stories.d.ts +7 -0
  255. package/dist/stories/Skeleton.stories.jsx +27 -0
  256. package/dist/stories/StatTile.stories.d.ts +10 -0
  257. package/dist/stories/StatTile.stories.jsx +55 -0
  258. package/dist/stories/TabPanel.stories.d.ts +7 -0
  259. package/dist/stories/TabPanel.stories.jsx +31 -0
  260. package/dist/stories/Table.stories.d.ts +1 -0
  261. package/dist/stories/Table.stories.jsx +49 -1
  262. package/dist/stories/TitleBar.stories.d.ts +1 -0
  263. package/dist/stories/TitleBar.stories.jsx +7 -0
  264. package/package.json +5 -1
@@ -0,0 +1,351 @@
1
+ # Password gate
2
+
3
+ Some work is private. A visitor needs the password to read it, and someone who does not have it needs to know how to ask.
4
+
5
+ ## Do
6
+
7
+ - Put the gate in a `Surface` with a heading that says what is behind it: 'This case study needs a password'. It is the h1 on a whole page and an h2 inside a page.
8
+ - Say in one line how to get access, with a `Link` to the contact page.
9
+ - Use a password `TextField` and a Button named 'View Work'. Put them in a `Form`, so Enter submits.
10
+ - Show a wrong password under the field: 'That password is not right.' Keep focus in the field and keep what was typed.
11
+ - Keep the Button's label while it checks, and make it `loading`.
12
+ - Keep the field enabled while it checks. A disabled field loses focus, and after a wrong password the cursor must still be in the field.
13
+ - Show the work when the password is right, and move focus to the first control in it.
14
+ - Follow the rule 'A confirm says exactly what will happen' for `modal`. Put 'Cancel' first and make the Modal title and its action the same words: 'View Work'.
15
+ - Let the server check the password and set the cookie. The server sends the private content only to a visitor with the cookie. The page never holds the password.
16
+ - Keep the summary and the facts in the page for `inline`, and leave the private part out of the HTML sent to a visitor without the cookie.
17
+
18
+ ## Don't
19
+
20
+ - Do not send private content to the browser and hide it there, with a style or a check in the page. A visitor can still read it.
21
+ - Do not put the password in the page, in a script or in the address.
22
+ - Do not say which part of a password was wrong.
23
+ - Do not show a bare field with no word on what is behind it or how to ask.
24
+ - Do not change the Button's label while it checks.
25
+
26
+ ## Option: The whole page is private
27
+
28
+ Use when: The whole page is private, and nothing on it is public.
29
+
30
+ Uses: `Button`, `Form`, `Heading`, `Link`, `PageHeader`, `PageShell`, `Paragraph`, `Stack`, `Surface`, `TextField`
31
+
32
+ ```tsx
33
+ 'use client';
34
+ import { useEffect, useRef, useState } from 'react';
35
+ import PageShell from 'oneslash-design-system/components/pageShell';
36
+ import PageHeader from 'oneslash-design-system/components/pageHeader';
37
+ import Surface from 'oneslash-design-system/components/surface';
38
+ import Heading from 'oneslash-design-system/components/heading';
39
+ import Paragraph from 'oneslash-design-system/components/paragraph';
40
+ import Link from 'oneslash-design-system/components/link';
41
+ import Form from 'oneslash-design-system/components/form';
42
+ import TextField from 'oneslash-design-system/components/textField';
43
+ import Button from 'oneslash-design-system/components/button';
44
+ import { Stack } from 'oneslash-design-system/components/layout';
45
+
46
+ // The example checks nothing real and sends nothing. It accepts one made-up passphrase, 'acme-demo', so you can see both outcomes.
47
+ // A real page asks its server. The server checks the password and sets a cookie, and it sends the private content only to a visitor with that cookie. The page never holds the secret.
48
+ const PASSPHRASE = 'acme-demo';
49
+
50
+ export default function PasswordGatePage() {
51
+ const [password, setPassword] = useState('');
52
+ const [error, setError] = useState('');
53
+ const [checking, setChecking] = useState(false);
54
+ const [unlocked, setUnlocked] = useState(false);
55
+ // A new key remounts the field with focus, so a wrong password leaves the cursor in the field, even after a click on the Button.
56
+ const [attempt, setAttempt] = useState(0);
57
+ const timer = useRef<ReturnType<typeof setTimeout>>();
58
+ const lockAgain = useRef<HTMLButtonElement | HTMLAnchorElement>(null);
59
+
60
+ // Stops the request if the example goes away before it ends.
61
+ useEffect(() => () => clearTimeout(timer.current), []);
62
+
63
+ // The field is gone once the work shows, so focus moves to the first control in it.
64
+ useEffect(() => {
65
+ if (unlocked) lockAgain.current?.focus();
66
+ }, [unlocked]);
67
+
68
+ function handleSubmit() {
69
+ if (checking) return;
70
+ if (!password.trim()) {
71
+ setError('Enter the password.');
72
+ setAttempt((n) => n + 1);
73
+ return;
74
+ }
75
+ setError('');
76
+ setChecking(true);
77
+ // Stands in for the request to the server.
78
+ timer.current = setTimeout(() => {
79
+ setChecking(false);
80
+ if (password === PASSPHRASE) {
81
+ setUnlocked(true);
82
+ } else {
83
+ setError('That password is not right.');
84
+ setAttempt((n) => n + 1);
85
+ }
86
+ }, 600);
87
+ }
88
+
89
+ if (unlocked) {
90
+ return (
91
+ <PageShell>
92
+ <Stack gap="xlarge">
93
+ <PageHeader level={1} title="Plan changes, a case study" lede="How we made a plan change clear before anyone pays." />
94
+ <Paragraph tone="secondary">The screens, the notes and the decisions for this case study are here.</Paragraph>
95
+ <Stack align="start">
96
+ <Button ref={lockAgain} size="medium" type="secondary" state="enabled" label="Lock Again" onClickButton={() => { setUnlocked(false); setPassword(''); }} />
97
+ </Stack>
98
+ </Stack>
99
+ </PageShell>
100
+ );
101
+ }
102
+
103
+ return (
104
+ <PageShell>
105
+ <Surface padding="xlarge" minHeight="tall" align="center">
106
+ <Stack gap="large">
107
+ <Heading level={1} size="h5">This case study needs a password</Heading>
108
+ <Paragraph>
109
+ The password comes by email. <Link href="#contact">Ask for the password</Link>.
110
+ </Paragraph>
111
+ <Form aria-label="Private work" onSubmit={handleSubmit}>
112
+ <TextField key={attempt} id="password-gate-password" label="Password" type="password" autoComplete="current-password" autoFocus={attempt > 0} value={password} error={Boolean(error)} errorText={error} onChange={(e) => { setPassword(e.target.value); setError(''); }} />
113
+ <Stack align="start">
114
+ <Button size="medium" type="primary" state="enabled" label="View Work" htmlType="submit" loading={checking} />
115
+ </Stack>
116
+ </Form>
117
+ </Stack>
118
+ </Surface>
119
+ </PageShell>
120
+ );
121
+ }
122
+ ```
123
+
124
+ ## Option: Part of the page is private
125
+
126
+ Use when: The summary and the facts stay readable, and the rest is behind the gate.
127
+
128
+ Uses: `Button`, `Figure`, `Form`, `Heading`, `Image`, `Link`, `PageHeader`, `PageShell`, `Paragraph`, `Stack`, `Surface`, `TextField`
129
+
130
+ ```tsx
131
+ 'use client';
132
+ import { useEffect, useRef, useState } from 'react';
133
+ import PageShell from 'oneslash-design-system/components/pageShell';
134
+ import PageHeader from 'oneslash-design-system/components/pageHeader';
135
+ import Figure from 'oneslash-design-system/components/figure';
136
+ import Image from 'oneslash-design-system/components/image';
137
+ import Surface from 'oneslash-design-system/components/surface';
138
+ import Heading from 'oneslash-design-system/components/heading';
139
+ import Paragraph from 'oneslash-design-system/components/paragraph';
140
+ import Link from 'oneslash-design-system/components/link';
141
+ import Form from 'oneslash-design-system/components/form';
142
+ import TextField from 'oneslash-design-system/components/textField';
143
+ import Button from 'oneslash-design-system/components/button';
144
+ import { Stack } from 'oneslash-design-system/components/layout';
145
+
146
+ // The example checks nothing real and sends nothing. It accepts one made-up passphrase, 'acme-demo', so you can see both outcomes.
147
+ // A real page asks its server. The server checks the password and sets a cookie, and it sends the private content only to a visitor with that cookie. The page never holds the secret.
148
+
149
+ // A stand-in for a screen. A real page passes its own picture.
150
+ const screen =
151
+ "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1280 720'%3E%3Crect width='1280' height='720' fill='%23eef2f6'/%3E%3Crect x='120' y='120' width='460' height='480' rx='24' fill='%23ffffff'/%3E%3Crect x='680' y='120' width='480' height='220' rx='24' fill='%23dfe7ef'/%3E%3Crect x='680' y='380' width='480' height='220' rx='24' fill='%232f6b4f'/%3E%3C/svg%3E";
152
+
153
+ const PASSPHRASE = 'acme-demo';
154
+
155
+ export default function PasswordGateInline() {
156
+ const [password, setPassword] = useState('');
157
+ const [error, setError] = useState('');
158
+ const [checking, setChecking] = useState(false);
159
+ const [unlocked, setUnlocked] = useState(false);
160
+ // A new key remounts the field with focus, so a wrong password leaves the cursor in the field, even after a click on the Button.
161
+ const [attempt, setAttempt] = useState(0);
162
+ const timer = useRef<ReturnType<typeof setTimeout>>();
163
+ const lockAgain = useRef<HTMLButtonElement | HTMLAnchorElement>(null);
164
+
165
+ // Stops the request if the example goes away before it ends.
166
+ useEffect(() => () => clearTimeout(timer.current), []);
167
+
168
+ // The field is gone once the work shows, so focus moves to the first control in it.
169
+ useEffect(() => {
170
+ if (unlocked) lockAgain.current?.focus();
171
+ }, [unlocked]);
172
+
173
+ function handleSubmit() {
174
+ if (checking) return;
175
+ if (!password.trim()) {
176
+ setError('Enter the password.');
177
+ setAttempt((n) => n + 1);
178
+ return;
179
+ }
180
+ setError('');
181
+ setChecking(true);
182
+ // Stands in for the request to the server.
183
+ timer.current = setTimeout(() => {
184
+ setChecking(false);
185
+ if (password === PASSPHRASE) {
186
+ setUnlocked(true);
187
+ } else {
188
+ setError('That password is not right.');
189
+ setAttempt((n) => n + 1);
190
+ }
191
+ }, 600);
192
+ }
193
+
194
+ const header = (
195
+ <PageHeader
196
+ level={1}
197
+ title="Plan changes, a case study"
198
+ lede="How we made a plan change clear before anyone pays."
199
+ facts={[
200
+ { label: 'Role', value: 'Lead designer' },
201
+ { label: 'Team', value: '4 people' },
202
+ { label: 'Year', value: '2026' },
203
+ ]}
204
+ />
205
+ );
206
+
207
+ return (
208
+ <PageShell>
209
+ <Stack gap="giant">
210
+ {/* The summary and the facts stay readable. Only the screens are behind the gate. */}
211
+ <Stack gap="xlarge">
212
+ {header}
213
+ <Paragraph tone="secondary">People could not tell what a new plan would cost them. We showed the new price and the day it starts before the last step, and fewer people wrote to ask.</Paragraph>
214
+ </Stack>
215
+ {unlocked ? (
216
+ <Stack gap="xlarge">
217
+ <Figure crop={16 / 9} caption="The plan change, before the person pays.">
218
+ <Image src={screen} alt="A plan change screen: the current plan beside the new plan, with the new price in green" width={1280} height={720} />
219
+ </Figure>
220
+ <Stack align="start">
221
+ <Button ref={lockAgain} size="medium" type="secondary" state="enabled" label="Lock Again" onClickButton={() => { setUnlocked(false); setPassword(''); }} />
222
+ </Stack>
223
+ </Stack>
224
+ ) : (
225
+ <Surface padding="large">
226
+ <Stack gap="large">
227
+ <Heading level={2} size="h6">This case study needs a password</Heading>
228
+ <Paragraph>
229
+ The password comes by email. <Link href="#contact">Ask for the password</Link>.
230
+ </Paragraph>
231
+ <Form aria-label="Private work" onSubmit={handleSubmit}>
232
+ <TextField key={attempt} id="password-gate-inline-password" label="Password" type="password" autoComplete="current-password" autoFocus={attempt > 0} value={password} error={Boolean(error)} errorText={error} onChange={(e) => { setPassword(e.target.value); setError(''); }} />
233
+ <Stack align="start">
234
+ <Button size="medium" type="primary" state="enabled" label="View Work" htmlType="submit" loading={checking} />
235
+ </Stack>
236
+ </Form>
237
+ </Stack>
238
+ </Surface>
239
+ )}
240
+ </Stack>
241
+ </PageShell>
242
+ );
243
+ }
244
+ ```
245
+
246
+ ## Option: A link to private work asks first
247
+
248
+ Use when: A list links to private work, and the gate should not leave the list.
249
+
250
+ Uses: `Button`, `Form`, `Link`, `Modal`, `PageHeader`, `PageShell`, `Paragraph`, `Stack`, `TextField`
251
+
252
+ ```tsx
253
+ 'use client';
254
+ import { useEffect, useRef, useState } from 'react';
255
+ import PageShell from 'oneslash-design-system/components/pageShell';
256
+ import PageHeader from 'oneslash-design-system/components/pageHeader';
257
+ import Modal from 'oneslash-design-system/components/modal';
258
+ import Form from 'oneslash-design-system/components/form';
259
+ import TextField from 'oneslash-design-system/components/textField';
260
+ import Paragraph from 'oneslash-design-system/components/paragraph';
261
+ import Link from 'oneslash-design-system/components/link';
262
+ import Button from 'oneslash-design-system/components/button';
263
+ import { Stack } from 'oneslash-design-system/components/layout';
264
+
265
+ // The example checks nothing real and sends nothing. It accepts one made-up passphrase, 'acme-demo', so you can see both outcomes.
266
+ // A real page asks its server. The server checks the password and sets a cookie, and it sends the private content only to a visitor with that cookie. The page never holds the secret.
267
+ const PASSPHRASE = 'acme-demo';
268
+
269
+ export default function PasswordGateModal() {
270
+ const [open, setOpen] = useState(false);
271
+ const [unlocked, setUnlocked] = useState(false);
272
+ const [password, setPassword] = useState('');
273
+ const [error, setError] = useState('');
274
+ const [checking, setChecking] = useState(false);
275
+ // A new key remounts the field with focus, so a wrong password leaves the cursor in the field, even after a click on the Button.
276
+ const [attempt, setAttempt] = useState(0);
277
+ const timer = useRef<ReturnType<typeof setTimeout>>();
278
+
279
+ // Stops the request if the example goes away before it ends.
280
+ useEffect(() => () => clearTimeout(timer.current), []);
281
+
282
+ // Escape, a click outside and Cancel all close it, except while the request runs.
283
+ function handleClose() {
284
+ if (checking) return;
285
+ setOpen(false);
286
+ setPassword('');
287
+ setError('');
288
+ }
289
+
290
+ function handleSubmit() {
291
+ if (checking) return;
292
+ if (!password.trim()) {
293
+ setError('Enter the password.');
294
+ setAttempt((n) => n + 1);
295
+ return;
296
+ }
297
+ setError('');
298
+ setChecking(true);
299
+ // Stands in for the request to the server.
300
+ timer.current = setTimeout(() => {
301
+ setChecking(false);
302
+ if (password === PASSPHRASE) {
303
+ setUnlocked(true);
304
+ setOpen(false);
305
+ setPassword('');
306
+ } else {
307
+ setError('That password is not right.');
308
+ setAttempt((n) => n + 1);
309
+ }
310
+ }, 600);
311
+ }
312
+
313
+ return (
314
+ <PageShell>
315
+ <Stack gap="xlarge">
316
+ <PageHeader level={1} title="Selected work" lede="Three case studies. The first is open. The others need a password." />
317
+ <Stack gap="large" align="start">
318
+ <Link href="#how-we-write-errors">How we write error messages</Link>
319
+ {/* A link to private work asks for the password first. A real page keeps the link's address, so the work opens there after the check. The trigger stays, so focus has somewhere to go back to. */}
320
+ <Button size="medium" type="textOnly" state="enabled" label="Read the Plan Changes Case Study" onClickButton={() => { if (!unlocked) setOpen(true); }} />
321
+ {unlocked && <Paragraph>It is open for you now.</Paragraph>}
322
+ </Stack>
323
+ </Stack>
324
+ <Modal
325
+ isOpen={open}
326
+ size="small"
327
+ initialFocus="body"
328
+ title="View Work"
329
+ onClose={handleClose}
330
+ actions={
331
+ <>
332
+ <Button size="small" type="tertiary" state={checking ? 'disabled' : 'enabled'} label="Cancel" onClickButton={handleClose} />
333
+ <Button size="small" type="primary" state="enabled" label="View Work" loading={checking} onClickButton={handleSubmit} />
334
+ </>
335
+ }
336
+ >
337
+ <Form aria-label="Private work" onSubmit={handleSubmit}>
338
+ <TextField key={attempt} id="password-gate-modal-password" label="Password" type="password" autoComplete="current-password" autoFocus={attempt > 0} value={password} error={Boolean(error)} errorText={error} onChange={(e) => { setPassword(e.target.value); setError(''); }} />
339
+ <Paragraph tone="secondary" size="body2" measure="none">
340
+ This case study needs a password, and it comes by email. <Link href="#contact">Ask for the password</Link>.
341
+ </Paragraph>
342
+ </Form>
343
+ </Modal>
344
+ </PageShell>
345
+ );
346
+ }
347
+ ```
348
+
349
+ ## Native
350
+
351
+ On Apple use a `SecureField` in a grouped form, and let the server check it. A locked item opens a sheet with the field and Cancel first.
@@ -0,0 +1 @@
1
+ export default function PaymentMethodNone(): import("react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ 'use client';
2
+ import Paragraph from '../../components/paragraph';
3
+ import Button from '../../components/button';
4
+ import SettingsSection from '../../components/settingsSection';
5
+ import { Center, Stack } from '../../components/layout';
6
+ export default function PaymentMethodNone() {
7
+ return (<Center width="page">
8
+ <SettingsSection title="Payment method" description="Pays for Acme's plan.">
9
+ <Stack gap="medium" align="start">
10
+ <Paragraph measure="none">No payment method.</Paragraph>
11
+ <Paragraph tone="secondary" size="body2" measure="none">Acme is on Free, so it needs none. Add one to upgrade.</Paragraph>
12
+ {/* A real app hands off to its payment provider's own page here. The page never takes card details. */}
13
+ <Button size="small" type="secondary" state="enabled" label="Add Payment Method" aria-label="Add payment method, opens in a new tab" actionIcon="ExternalLink" href="https://acme.example/billing/payment-method" openInNewTab/>
14
+ </Stack>
15
+ </SettingsSection>
16
+ </Center>);
17
+ }
@@ -0,0 +1 @@
1
+ export default function PaymentMethodOnFile(): import("react").JSX.Element;
@@ -0,0 +1,92 @@
1
+ 'use client';
2
+ import { useEffect, useRef, useState } from 'react';
3
+ import Toaster, { toast, dismissToast } from '../../components/toaster';
4
+ import Alert from '../../components/alert';
5
+ import Modal from '../../components/modal';
6
+ import Surface from '../../components/surface';
7
+ import Paragraph from '../../components/paragraph';
8
+ import Button from '../../components/button';
9
+ import SettingsSection from '../../components/settingsSection';
10
+ import { Center, Cluster, Stack } from '../../components/layout';
11
+ // A real app reads these from the server. Only the brand, the last four digits and the expiry ever reach the page.
12
+ var card = { brand: 'Visa', last4: '4821', month: 8, year: 2028 };
13
+ var today = { month: 11, year: 2026 };
14
+ var plan = 'Free';
15
+ // A paid plan needs a card, so Remove is not offered. The Free plan needs none.
16
+ var planNeedsCard = plan !== 'Free';
17
+ var monthsLeft = (card.year - today.year) * 12 + (card.month - today.month);
18
+ var expiry = "".concat(String(card.month).padStart(2, '0'), "/").concat(String(card.year % 100).padStart(2, '0'));
19
+ var name = "".concat(card.brand, " ending in ").concat(card.last4);
20
+ export default function PaymentMethodOnFile() {
21
+ var _a = useState(false), removed = _a[0], setRemoved = _a[1];
22
+ var _b = useState(false), confirming = _b[0], setConfirming = _b[1];
23
+ var _c = useState(false), removing = _c[0], setRemoving = _c[1];
24
+ var timer = useRef();
25
+ var toastIds = useRef([]);
26
+ var addRef = useRef(null);
27
+ // On unmount it stops the request and closes every toast it opened.
28
+ useEffect(function () { return function () {
29
+ clearTimeout(timer.current);
30
+ toastIds.current.forEach(function (id) { return dismissToast(id); });
31
+ toastIds.current = [];
32
+ }; }, []);
33
+ // The Remove Button is gone with the card, so focus moves to what takes its place.
34
+ useEffect(function () {
35
+ var _a;
36
+ if (removed)
37
+ (_a = addRef.current) === null || _a === void 0 ? void 0 : _a.focus();
38
+ }, [removed]);
39
+ // Escape, a click outside and Cancel all close it, except while the request runs. The Modal gives focus back to Remove.
40
+ function handleClose() {
41
+ if (removing)
42
+ return;
43
+ setConfirming(false);
44
+ }
45
+ function handleRemove() {
46
+ if (removing)
47
+ return;
48
+ setRemoving(true);
49
+ // Stands in for the request to the server.
50
+ timer.current = setTimeout(function () {
51
+ setRemoving(false);
52
+ setConfirming(false);
53
+ setRemoved(true);
54
+ toastIds.current.push(toast({ type: 'success', message: "".concat(name, " removed.") }));
55
+ }, 1200);
56
+ }
57
+ return (<Center width="page">
58
+ {/* A real app mounts one Toaster near its root. */}
59
+ <Toaster />
60
+ <SettingsSection title="Payment method" description="Pays for Acme's plan.">
61
+ {removed ? (<Stack gap="medium" align="start">
62
+ <Paragraph measure="none">No payment method.</Paragraph>
63
+ {/* A real app hands off to its payment provider's own page here. The page never takes card details. */}
64
+ <Button ref={addRef} size="small" type="secondary" state="enabled" label="Add Payment Method" aria-label="Add payment method, opens in a new tab" actionIcon="ExternalLink" href="https://acme.example/billing/payment-method" openInNewTab/>
65
+ </Stack>) : (<Stack gap="medium">
66
+ {/* A month ahead of the expiry, the page says so. */}
67
+ {monthsLeft <= 1 && monthsLeft >= 0 && (<Alert type="warning" variant="inline" autoDismiss={false} message={"This card expires on ".concat(expiry, ". Update it before then.")}/>)}
68
+ <Surface padding="small">
69
+ <Cluster justify="between" gap="medium">
70
+ <Stack gap="small">
71
+ <Paragraph measure="none">{name}</Paragraph>
72
+ <Paragraph tone="secondary" size="body2" measure="none">{"Expires ".concat(expiry)}</Paragraph>
73
+ </Stack>
74
+ <Cluster gap="small">
75
+ {/* Updating the card happens on the provider's page, so Update is a link out. */}
76
+ <Button size="small" type="tertiary" state="enabled" label="Update" aria-label={"Update ".concat(name, ", opens in a new tab")} actionIcon="ExternalLink" href="https://acme.example/billing/payment-method" openInNewTab/>
77
+ {!planNeedsCard && (<Button size="small" type="tertiary" state="enabled" label="Remove" aria-label={"Remove ".concat(name)} onClickButton={function () { return setConfirming(true); }}/>)}
78
+ </Cluster>
79
+ </Cluster>
80
+ </Surface>
81
+ {planNeedsCard && <Paragraph tone="secondary" size="body2" measure="none">Pro needs a card on file. Downgrade to Free to remove it.</Paragraph>}
82
+ </Stack>)}
83
+ </SettingsSection>
84
+ {/* One card is not a dense list, so the confirm is a small Modal. */}
85
+ <Modal isOpen={confirming} size="small" title="Remove Card" onClose={handleClose} actions={<>
86
+ <Button size="small" type="tertiary" state={removing ? 'disabled' : 'enabled'} label="Cancel" onClickButton={handleClose}/>
87
+ <Button size="small" type="primary" color="danger" state="enabled" label="Remove" loading={removing} onClickButton={handleRemove}/>
88
+ </>}>
89
+ <Paragraph measure="none">{"This removes ".concat(name, " from Acme. Your plan and invoices are not changed.")}</Paragraph>
90
+ </Modal>
91
+ </Center>);
92
+ }
@@ -0,0 +1,182 @@
1
+ # Payment method
2
+
3
+ A workspace pays by card. The admin sees which card, changes it or removes it.
4
+
5
+ ## Do
6
+
7
+ - Follow the rule 'A number shows its unit and never shows 0 for unknown'.
8
+ - Show only the brand as text, the last four digits and the expiry: 'Visa ending in 4821' and 'Expires 08/28'. Nothing else about the card is on the page.
9
+ - Make 'Update' and 'Add Payment Method' links to the payment provider's own page: a `Button` with `href`, `openInNewTab` and an external-link `actionIcon`. Name it with where it goes: 'Update Visa ending in 4821, opens in a new tab'.
10
+ - Confirm 'Remove' in a small `Modal` titled 'Remove Card', as the case 'Delete confirm' says: 'This removes Visa ending in 4821 from Acme. Your plan and invoices are not changed.' 'Cancel' comes first, then a danger 'Remove'.
11
+ - Name the card in the Remove Button's `aria-label`: 'Remove Visa ending in 4821'.
12
+ - Show a toast that names the card when it is removed: 'Visa ending in 4821 removed.' Then show the empty state in the same place.
13
+ - Offer no Remove while a paid plan needs a card, and say why in one line: 'Pro needs a card on file. Downgrade to Free to remove it.'
14
+ - Add an inline warning `Alert` above the row a month before the card expires: 'This card expires on 08/28. Update it before then.'
15
+ - Say in one line that there is no card, say whether one is needed, and offer 'Add Payment Method'.
16
+
17
+ ## Don't
18
+
19
+ - Do not add a `TextField` for a card number, a security code, a bank account or an address. ODS has no payment form.
20
+ - Do not show a full card number, or part of it beyond the last four digits.
21
+ - Do not name the payment provider, or copy the look or the words of its page.
22
+ - Do not show a card-network logo. The brand is the word.
23
+ - Do not title the Modal 'Are you sure?'. Name the action: 'Remove Card'.
24
+ - Do not remove the card on the first click.
25
+ - Do not offer Remove while a paid plan needs the card.
26
+ - Do not show Update or Remove to a person who cannot change billing.
27
+
28
+ ## Option: A card is saved
29
+
30
+ Use when: The workspace has a card on file.
31
+
32
+ Uses: `Alert`, `Button`, `Center`, `Cluster`, `Modal`, `Paragraph`, `SettingsSection`, `Stack`, `Surface`, `Toaster`, `dismissToast`, `toast`
33
+
34
+ ```tsx
35
+ 'use client';
36
+ import { useEffect, useRef, useState } from 'react';
37
+ import Toaster, { toast, dismissToast } from 'oneslash-design-system/components/toaster';
38
+ import Alert from 'oneslash-design-system/components/alert';
39
+ import Modal from 'oneslash-design-system/components/modal';
40
+ import Surface from 'oneslash-design-system/components/surface';
41
+ import Paragraph from 'oneslash-design-system/components/paragraph';
42
+ import Button from 'oneslash-design-system/components/button';
43
+ import SettingsSection from 'oneslash-design-system/components/settingsSection';
44
+ import { Center, Cluster, Stack } from 'oneslash-design-system/components/layout';
45
+
46
+ // A real app reads these from the server. Only the brand, the last four digits and the expiry ever reach the page.
47
+ const card = { brand: 'Visa', last4: '4821', month: 8, year: 2028 };
48
+ const today = { month: 11, year: 2026 };
49
+ const plan: 'Free' | 'Pro' = 'Free';
50
+
51
+ // A paid plan needs a card, so Remove is not offered. The Free plan needs none.
52
+ const planNeedsCard = plan !== 'Free';
53
+ const monthsLeft = (card.year - today.year) * 12 + (card.month - today.month);
54
+ const expiry = `${String(card.month).padStart(2, '0')}/${String(card.year % 100).padStart(2, '0')}`;
55
+ const name = `${card.brand} ending in ${card.last4}`;
56
+
57
+ export default function PaymentMethodOnFile() {
58
+ const [removed, setRemoved] = useState(false);
59
+ const [confirming, setConfirming] = useState(false);
60
+ const [removing, setRemoving] = useState(false);
61
+ const timer = useRef<ReturnType<typeof setTimeout>>();
62
+ const toastIds = useRef<string[]>([]);
63
+ const addRef = useRef<HTMLButtonElement | HTMLAnchorElement>(null);
64
+
65
+ // On unmount it stops the request and closes every toast it opened.
66
+ useEffect(() => () => {
67
+ clearTimeout(timer.current);
68
+ toastIds.current.forEach((id) => dismissToast(id));
69
+ toastIds.current = [];
70
+ }, []);
71
+
72
+ // The Remove Button is gone with the card, so focus moves to what takes its place.
73
+ useEffect(() => {
74
+ if (removed) addRef.current?.focus();
75
+ }, [removed]);
76
+
77
+ // Escape, a click outside and Cancel all close it, except while the request runs. The Modal gives focus back to Remove.
78
+ function handleClose() {
79
+ if (removing) return;
80
+ setConfirming(false);
81
+ }
82
+
83
+ function handleRemove() {
84
+ if (removing) return;
85
+ setRemoving(true);
86
+ // Stands in for the request to the server.
87
+ timer.current = setTimeout(() => {
88
+ setRemoving(false);
89
+ setConfirming(false);
90
+ setRemoved(true);
91
+ toastIds.current.push(toast({ type: 'success', message: `${name} removed.` }));
92
+ }, 1200);
93
+ }
94
+
95
+ return (
96
+ <Center width="page">
97
+ {/* A real app mounts one Toaster near its root. */}
98
+ <Toaster />
99
+ <SettingsSection title="Payment method" description="Pays for Acme's plan.">
100
+ {removed ? (
101
+ <Stack gap="medium" align="start">
102
+ <Paragraph measure="none">No payment method.</Paragraph>
103
+ {/* A real app hands off to its payment provider's own page here. The page never takes card details. */}
104
+ <Button ref={addRef} size="small" type="secondary" state="enabled" label="Add Payment Method" aria-label="Add payment method, opens in a new tab" actionIcon="ExternalLink" href="https://acme.example/billing/payment-method" openInNewTab />
105
+ </Stack>
106
+ ) : (
107
+ <Stack gap="medium">
108
+ {/* A month ahead of the expiry, the page says so. */}
109
+ {monthsLeft <= 1 && monthsLeft >= 0 && (
110
+ <Alert type="warning" variant="inline" autoDismiss={false} message={`This card expires on ${expiry}. Update it before then.`} />
111
+ )}
112
+ <Surface padding="small">
113
+ <Cluster justify="between" gap="medium">
114
+ <Stack gap="small">
115
+ <Paragraph measure="none">{name}</Paragraph>
116
+ <Paragraph tone="secondary" size="body2" measure="none">{`Expires ${expiry}`}</Paragraph>
117
+ </Stack>
118
+ <Cluster gap="small">
119
+ {/* Updating the card happens on the provider's page, so Update is a link out. */}
120
+ <Button size="small" type="tertiary" state="enabled" label="Update" aria-label={`Update ${name}, opens in a new tab`} actionIcon="ExternalLink" href="https://acme.example/billing/payment-method" openInNewTab />
121
+ {!planNeedsCard && (
122
+ <Button size="small" type="tertiary" state="enabled" label="Remove" aria-label={`Remove ${name}`} onClickButton={() => setConfirming(true)} />
123
+ )}
124
+ </Cluster>
125
+ </Cluster>
126
+ </Surface>
127
+ {planNeedsCard && <Paragraph tone="secondary" size="body2" measure="none">Pro needs a card on file. Downgrade to Free to remove it.</Paragraph>}
128
+ </Stack>
129
+ )}
130
+ </SettingsSection>
131
+ {/* One card is not a dense list, so the confirm is a small Modal. */}
132
+ <Modal
133
+ isOpen={confirming}
134
+ size="small"
135
+ title="Remove Card"
136
+ onClose={handleClose}
137
+ actions={
138
+ <>
139
+ <Button size="small" type="tertiary" state={removing ? 'disabled' : 'enabled'} label="Cancel" onClickButton={handleClose} />
140
+ <Button size="small" type="primary" color="danger" state="enabled" label="Remove" loading={removing} onClickButton={handleRemove} />
141
+ </>
142
+ }
143
+ >
144
+ <Paragraph measure="none">{`This removes ${name} from Acme. Your plan and invoices are not changed.`}</Paragraph>
145
+ </Modal>
146
+ </Center>
147
+ );
148
+ }
149
+ ```
150
+
151
+ ## Option: No card yet
152
+
153
+ Use when: The workspace has never added a card, or removed it.
154
+
155
+ Uses: `Button`, `Center`, `Paragraph`, `SettingsSection`, `Stack`
156
+
157
+ ```tsx
158
+ 'use client';
159
+ import Paragraph from 'oneslash-design-system/components/paragraph';
160
+ import Button from 'oneslash-design-system/components/button';
161
+ import SettingsSection from 'oneslash-design-system/components/settingsSection';
162
+ import { Center, Stack } from 'oneslash-design-system/components/layout';
163
+
164
+ export default function PaymentMethodNone() {
165
+ return (
166
+ <Center width="page">
167
+ <SettingsSection title="Payment method" description="Pays for Acme's plan.">
168
+ <Stack gap="medium" align="start">
169
+ <Paragraph measure="none">No payment method.</Paragraph>
170
+ <Paragraph tone="secondary" size="body2" measure="none">Acme is on Free, so it needs none. Add one to upgrade.</Paragraph>
171
+ {/* A real app hands off to its payment provider's own page here. The page never takes card details. */}
172
+ <Button size="small" type="secondary" state="enabled" label="Add Payment Method" aria-label="Add payment method, opens in a new tab" actionIcon="ExternalLink" href="https://acme.example/billing/payment-method" openInNewTab />
173
+ </Stack>
174
+ </SettingsSection>
175
+ </Center>
176
+ );
177
+ }
178
+ ```
179
+
180
+ ## Native
181
+
182
+ On Apple a plan bought in the app has no card on the page: open the system subscription sheet. For a web card, show the same text and a `Link` out.
@@ -0,0 +1 @@
1
+ export default function PlanChangeConfirmBlocked(): import("react").JSX.Element;