oneslash-design-system 2.20.0 → 2.22.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.
- package/README.md +1 -1
- package/dist/DESIGN.md +34 -1
- package/dist/cases/about-page/profile.d.ts +1 -0
- package/dist/cases/about-page/profile.jsx +64 -0
- package/dist/cases/about-page.md +114 -0
- package/dist/cases/admin-inbox/list.d.ts +1 -0
- package/dist/cases/admin-inbox/list.jsx +104 -0
- package/dist/cases/admin-inbox/split.d.ts +1 -0
- package/dist/cases/admin-inbox/split.jsx +68 -0
- package/dist/cases/admin-inbox.md +254 -0
- package/dist/cases/api-keys.md +1 -1
- package/dist/cases/app-shell/top-tabs.jsx +10 -4
- package/dist/cases/app-shell.md +13 -5
- package/dist/cases/blog-index/cards.d.ts +1 -0
- package/dist/cases/blog-index/cards.jsx +45 -0
- package/dist/cases/blog-index/list.d.ts +1 -0
- package/dist/cases/blog-index/list.jsx +46 -0
- package/dist/cases/blog-index.md +160 -0
- package/dist/cases/changelog/by-month.d.ts +1 -0
- package/dist/cases/changelog/by-month.jsx +70 -0
- package/dist/cases/changelog/one-page.d.ts +1 -0
- package/dist/cases/changelog/one-page.jsx +70 -0
- package/dist/cases/changelog.md +200 -0
- package/dist/cases/code-sample/block.d.ts +1 -0
- package/dist/cases/code-sample/block.jsx +19 -0
- package/dist/cases/code-sample/command.d.ts +1 -0
- package/dist/cases/code-sample/command.jsx +17 -0
- package/dist/cases/code-sample.md +96 -0
- package/dist/cases/contact-page/form.d.ts +1 -0
- package/dist/cases/contact-page/form.jsx +83 -0
- package/dist/cases/contact-page/links.d.ts +1 -0
- package/dist/cases/contact-page/links.jsx +19 -0
- package/dist/cases/contact-page.md +142 -0
- package/dist/cases/docs-component-page/reference.d.ts +1 -0
- package/dist/cases/docs-component-page/reference.jsx +93 -0
- package/dist/cases/docs-component-page.md +144 -0
- package/dist/cases/faq/accordion.d.ts +1 -0
- package/dist/cases/faq/accordion.jsx +25 -0
- package/dist/cases/faq/open-list.d.ts +1 -0
- package/dist/cases/faq/open-list.jsx +27 -0
- package/dist/cases/faq.md +110 -0
- package/dist/cases/feature-grid/cards.d.ts +1 -0
- package/dist/cases/feature-grid/cards.jsx +33 -0
- package/dist/cases/feature-grid/rows.d.ts +1 -0
- package/dist/cases/feature-grid/rows.jsx +30 -0
- package/dist/cases/feature-grid.md +132 -0
- package/dist/cases/image-viewer/gallery.d.ts +1 -0
- package/dist/cases/image-viewer/gallery.jsx +32 -0
- package/dist/cases/image-viewer/single.d.ts +1 -0
- package/dist/cases/image-viewer/single.jsx +25 -0
- package/dist/cases/image-viewer.md +123 -0
- package/dist/cases/landing-hero/centered.d.ts +1 -0
- package/dist/cases/landing-hero/centered.jsx +22 -0
- package/dist/cases/landing-hero/split.d.ts +1 -0
- package/dist/cases/landing-hero/split.jsx +30 -0
- package/dist/cases/landing-hero.md +114 -0
- package/dist/cases/legal-page/sections.d.ts +1 -0
- package/dist/cases/legal-page/sections.jsx +61 -0
- package/dist/cases/legal-page.md +96 -0
- package/dist/cases/long-form-page/article.d.ts +1 -0
- package/dist/cases/long-form-page/article.jsx +58 -0
- package/dist/cases/long-form-page/with-contents.d.ts +1 -0
- package/dist/cases/long-form-page/with-contents.jsx +41 -0
- package/dist/cases/long-form-page.md +170 -0
- package/dist/cases/message-actions/hover-toolbar.jsx +11 -8
- package/dist/cases/message-actions/menu.jsx +10 -7
- package/dist/cases/message-actions.md +19 -13
- package/dist/cases/message-attachments/in-composer.jsx +2 -2
- package/dist/cases/message-attachments/in-message.jsx +16 -11
- package/dist/cases/message-attachments.md +29 -17
- package/dist/cases/one-main-action.md +33 -0
- package/dist/cases/overflow-menu/in-a-header.jsx +9 -6
- package/dist/cases/overflow-menu/on-a-row.jsx +9 -6
- package/dist/cases/overflow-menu.md +16 -10
- package/dist/cases/page-end/cta-band.d.ts +1 -0
- package/dist/cases/page-end/cta-band.jsx +24 -0
- package/dist/cases/page-end/next-link.d.ts +1 -0
- package/dist/cases/page-end/next-link.jsx +18 -0
- package/dist/cases/page-end.md +88 -0
- package/dist/cases/password-gate/inline.d.ts +1 -0
- package/dist/cases/password-gate/inline.jsx +94 -0
- package/dist/cases/password-gate/modal.d.ts +1 -0
- package/dist/cases/password-gate/modal.jsx +81 -0
- package/dist/cases/password-gate/page.d.ts +1 -0
- package/dist/cases/password-gate/page.jsx +82 -0
- package/dist/cases/password-gate.md +351 -0
- package/dist/cases/pricing-section/cards.d.ts +1 -0
- package/dist/cases/pricing-section/cards.jsx +41 -0
- package/dist/cases/pricing-section.md +87 -0
- package/dist/cases/product-cards/grid.d.ts +1 -0
- package/dist/cases/product-cards/grid.jsx +20 -0
- package/dist/cases/product-cards.md +71 -0
- package/dist/cases/reply-feedback/thumbs.jsx +11 -8
- package/dist/cases/reply-feedback/with-reason.jsx +11 -8
- package/dist/cases/reply-feedback.md +20 -14
- package/dist/cases/section-index/cards.d.ts +1 -0
- package/dist/cases/section-index/cards.jsx +25 -0
- package/dist/cases/section-index/list.d.ts +1 -0
- package/dist/cases/section-index/list.jsx +56 -0
- package/dist/cases/section-index.md +140 -0
- package/dist/cases/settings-page/top-tabs.jsx +9 -6
- package/dist/cases/settings-page.md +13 -7
- package/dist/cases/site-header.md +1 -1
- package/dist/cases/site-search/dialog.d.ts +1 -0
- package/dist/cases/site-search/dialog.jsx +131 -0
- package/dist/cases/site-search.md +176 -0
- package/dist/cases/tabbed-panels/tabs.d.ts +1 -0
- package/dist/cases/tabbed-panels/tabs.jsx +40 -0
- package/dist/cases/tabbed-panels.md +81 -0
- package/dist/cases.json +1177 -31
- package/dist/components/accordion.d.ts +31 -0
- package/dist/components/accordion.jsx +103 -0
- package/dist/components/button.d.ts +2 -0
- package/dist/components/button.jsx +2 -2
- package/dist/components/codeBlock.d.ts +26 -0
- package/dist/components/codeBlock.jsx +101 -0
- package/dist/components/lightbox.d.ts +34 -0
- package/dist/components/lightbox.jsx +206 -0
- package/dist/components/linkCard.d.ts +10 -1
- package/dist/components/linkCard.jsx +32 -6
- package/dist/components/menuItem.jsx +1 -1
- package/dist/components/modal.d.ts +10 -2
- package/dist/components/modal.jsx +17 -12
- package/dist/components/pageHeader.jsx +1 -1
- package/dist/components/searchDialog.d.ts +44 -0
- package/dist/components/searchDialog.jsx +152 -0
- package/dist/components/siteHeader.d.ts +13 -2
- package/dist/components/siteHeader.jsx +21 -12
- package/dist/components/tab.d.ts +5 -1
- package/dist/components/tab.jsx +2 -2
- package/dist/components/tabPanel.d.ts +16 -0
- package/dist/components/tabPanel.jsx +12 -0
- package/dist/components/tabsContainer.d.ts +5 -1
- package/dist/components/tabsContainer.jsx +2 -2
- package/dist/components/tag.d.ts +6 -1
- package/dist/components/tag.jsx +10 -5
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/internal/accordion.d.ts +4 -0
- package/dist/internal/accordion.js +53 -0
- package/dist/internal/combobox.d.ts +20 -0
- package/dist/internal/combobox.js +28 -0
- package/dist/internal/highlight.d.ts +5 -0
- package/dist/internal/highlight.js +18 -0
- package/dist/native-mapping.json +31 -1
- package/dist/stories/Accordion.stories.d.ts +11 -0
- package/dist/stories/Accordion.stories.jsx +93 -0
- package/dist/stories/Button.stories.jsx +12 -8
- package/dist/stories/Cases.generated.stories.d.ts +34 -0
- package/dist/stories/Cases.generated.stories.jsx +68 -0
- package/dist/stories/CodeBlock.stories.d.ts +12 -0
- package/dist/stories/CodeBlock.stories.jsx +65 -0
- package/dist/stories/Lightbox.stories.d.ts +11 -0
- package/dist/stories/Lightbox.stories.jsx +83 -0
- package/dist/stories/LinkCard.stories.d.ts +6 -0
- package/dist/stories/LinkCard.stories.jsx +17 -0
- package/dist/stories/MenuItem.stories.d.ts +1 -0
- package/dist/stories/MenuItem.stories.jsx +8 -0
- package/dist/stories/PageHeader.stories.d.ts +2 -0
- package/dist/stories/PageHeader.stories.jsx +13 -0
- package/dist/stories/SearchDialog.stories.d.ts +17 -0
- package/dist/stories/SearchDialog.stories.jsx +111 -0
- package/dist/stories/SiteHeader.stories.d.ts +4 -0
- package/dist/stories/SiteHeader.stories.jsx +89 -0
- package/dist/stories/TabPanel.stories.d.ts +7 -0
- package/dist/stories/TabPanel.stories.jsx +31 -0
- package/package.json +1 -1
|
@@ -15,10 +15,10 @@ A person adds files to a message, and people open the files in a message that wa
|
|
|
15
15
|
- Pass `canSubmit` so a message with files and no text can be sent.
|
|
16
16
|
- Keep the files and the text when a send fails. Show an inline error Alert above the message box, as the rule 'A form error shows next to the problem' says.
|
|
17
17
|
- Move focus to the next chip after a chip is removed, or to the message box when none is left, since the chip that had it is gone.
|
|
18
|
-
- Show images in a sent message as thumbnails: a `Grid` of
|
|
18
|
+
- Show images in a sent message as thumbnails: a `Grid` of `LightboxThumbnail`s. Write `alt` text that says what the image shows.
|
|
19
19
|
- Show other files as `FileChip`s that open the file, with the kind ('PDF'), the name and the size.
|
|
20
|
-
-
|
|
21
|
-
-
|
|
20
|
+
- Keep each image's file reachable: when an image fails to load, the `Lightbox` shows 'This image could not be loaded.' with its alt text.
|
|
21
|
+
- Open an image at full size in a `Lightbox`: render one with the list of images, the `index`, `onIndexChange`, `isOpen` and `onClose`, as the case 'Image viewer' says. Closing it gives focus back to the thumbnail.
|
|
22
22
|
|
|
23
23
|
## Don't
|
|
24
24
|
|
|
@@ -55,8 +55,8 @@ type Upload = { id: string; name: string; kind: string; size: string; state: 're
|
|
|
55
55
|
type Row = { id: string; from: string; at: Date; text: string; files?: Upload[] };
|
|
56
56
|
|
|
57
57
|
const firstThread: Row[] = [
|
|
58
|
-
{ id: 'm1', from: 'Ben Carter', at: new Date('
|
|
59
|
-
{ id: 'm2', from: 'Omar Reyes', at: new Date('
|
|
58
|
+
{ id: 'm1', from: 'Ben Carter', at: new Date('2026-11-16T11:40:00Z'), text: 'Can someone send the launch assets?' },
|
|
59
|
+
{ id: 'm2', from: 'Omar Reyes', at: new Date('2026-11-16T11:42:00Z'), text: 'Dana has the final versions.' },
|
|
60
60
|
];
|
|
61
61
|
|
|
62
62
|
// Opens with one file ready, one still uploading and one the server refused.
|
|
@@ -228,18 +228,18 @@ export default function MessageAttachmentsInComposer() {
|
|
|
228
228
|
|
|
229
229
|
Use when: Files are part of a message in the thread.
|
|
230
230
|
|
|
231
|
-
Uses: `Center`, `Cluster`, `
|
|
231
|
+
Uses: `Center`, `Cluster`, `FileChip`, `Grid`, `Heading`, `Lightbox`, `LightboxThumbnail`, `Message`, `Paragraph`, `Stack`, `TimeStamp`, `UserImage`
|
|
232
232
|
|
|
233
233
|
```tsx
|
|
234
234
|
'use client';
|
|
235
|
+
import { useState } from 'react';
|
|
235
236
|
import Message from 'oneslash-design-system/components/message';
|
|
236
237
|
import UserImage from 'oneslash-design-system/components/userImage';
|
|
237
238
|
import TimeStamp from 'oneslash-design-system/components/timeStamp';
|
|
238
239
|
import Heading from 'oneslash-design-system/components/heading';
|
|
239
240
|
import Paragraph from 'oneslash-design-system/components/paragraph';
|
|
240
241
|
import FileChip from 'oneslash-design-system/components/fileChip';
|
|
241
|
-
import
|
|
242
|
-
import Image from 'oneslash-design-system/components/image';
|
|
242
|
+
import Lightbox, { LightboxThumbnail } from 'oneslash-design-system/components/lightbox';
|
|
243
243
|
import { Center, Cluster, Grid, Stack } from 'oneslash-design-system/components/layout';
|
|
244
244
|
|
|
245
245
|
// Two small drawings stand in for the uploaded photos.
|
|
@@ -248,12 +248,19 @@ const hillside =
|
|
|
248
248
|
const desk =
|
|
249
249
|
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 120'%3E%3Crect width='160' height='120' fill='%23efe6da'/%3E%3Crect x='30' y='30' width='100' height='60' rx='6' fill='%23333d47'/%3E%3Crect x='38' y='38' width='84' height='44' rx='2' fill='%2389b4d9'/%3E%3Crect x='20' y='92' width='120' height='6' rx='3' fill='%238a6d4b'/%3E%3C/svg%3E";
|
|
250
250
|
|
|
251
|
+
const photos = [
|
|
252
|
+
{ src: hillside, alt: 'Hero option A, a green hillside under a pale sky with the sun on the right' },
|
|
253
|
+
{ src: desk, alt: 'Hero option B, a laptop on a wooden desk, its screen blue' },
|
|
254
|
+
];
|
|
255
|
+
|
|
251
256
|
type Row = { id: string; from: string; at: Date; text: string };
|
|
252
257
|
|
|
253
|
-
const before: Row = { id: 'm1', from: 'Ben Carter', at: new Date('
|
|
254
|
-
const withFiles: Row = { id: 'm2', from: 'Dana Lee', at: new Date('
|
|
258
|
+
const before: Row = { id: 'm1', from: 'Ben Carter', at: new Date('2026-11-16T11:40:00Z'), text: 'Can someone send the launch assets?' };
|
|
259
|
+
const withFiles: Row = { id: 'm2', from: 'Dana Lee', at: new Date('2026-11-16T11:44:00Z'), text: 'Here are the two hero options and the brief.' };
|
|
255
260
|
|
|
256
261
|
export default function MessageAttachmentsInMessage() {
|
|
262
|
+
const [open, setOpen] = useState(false);
|
|
263
|
+
const [index, setIndex] = useState(0);
|
|
257
264
|
return (
|
|
258
265
|
<Center width="page">
|
|
259
266
|
<Stack gap="large">
|
|
@@ -275,14 +282,18 @@ export default function MessageAttachmentsInMessage() {
|
|
|
275
282
|
meta={<TimeStamp createdAt={withFiles.at} dateFormat="absolute" data="time" />}
|
|
276
283
|
footer={
|
|
277
284
|
<Stack gap="small">
|
|
278
|
-
{/* Small thumbnails: four columns, two of them used.
|
|
285
|
+
{/* Small thumbnails: four columns, two of them used. Each opens the Lightbox; closing it gives focus back to that thumbnail. */}
|
|
279
286
|
<Grid columns={4} compact gap="small">
|
|
280
|
-
|
|
281
|
-
<
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
287
|
+
{photos.map((photo, i) => (
|
|
288
|
+
<LightboxThumbnail
|
|
289
|
+
key={photo.alt}
|
|
290
|
+
image={photo}
|
|
291
|
+
onOpen={() => {
|
|
292
|
+
setIndex(i);
|
|
293
|
+
setOpen(true);
|
|
294
|
+
}}
|
|
295
|
+
/>
|
|
296
|
+
))}
|
|
286
297
|
</Grid>
|
|
287
298
|
<Cluster gap="small">
|
|
288
299
|
{/* Each chip opens the file. */}
|
|
@@ -296,6 +307,7 @@ export default function MessageAttachmentsInMessage() {
|
|
|
296
307
|
</Message>
|
|
297
308
|
</Stack>
|
|
298
309
|
</Stack>
|
|
310
|
+
<Lightbox images={photos} index={index} onIndexChange={setIndex} isOpen={open} onClose={() => setOpen(false)} aria-label="Launch images" />
|
|
299
311
|
</Center>
|
|
300
312
|
);
|
|
301
313
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# A marketing page asks for one main action, in the same words everywhere
|
|
2
|
+
|
|
3
|
+
A marketing page asks the visitor to do something: sign up, open the app, buy a plan.
|
|
4
|
+
|
|
5
|
+
## Answer
|
|
6
|
+
|
|
7
|
+
A page has one main action. It is a primary `Button` with the same label in the header, the hero, the pricing section and the end of the page: 'Sign Up', or 'Sign Up for Pro' on a plan. A second action is a secondary `Button`, or a `Link` that teaches, such as 'See How It Works'. It is never a second primary. Write the label as the move, in Title Case, with short prepositions lowercase. Do not write 'Get Started Free' in one place and 'Try It' in another. The main action and the second action open in the same tab, unless one goes to a store or starts a download. A link to another site, in a list or a footer, uses `external`, as the case 'Site footer' says.
|
|
8
|
+
|
|
9
|
+
## Why
|
|
10
|
+
|
|
11
|
+
A visitor who sees three names for one move wonders if they are three moves. One label everywhere tells them where every button goes, and one primary Button tells them which one matters.
|
|
12
|
+
|
|
13
|
+
## Do
|
|
14
|
+
|
|
15
|
+
- Give the page one primary `Button`: 'Sign Up'. Use the same label in the header, the hero, the pricing section and the end of the page.
|
|
16
|
+
- Name the action for a plan with the plan: 'Sign Up for Pro'. Keep short prepositions lowercase.
|
|
17
|
+
- Make a second action a secondary `Button` or a `Link` that teaches: 'See How It Works'.
|
|
18
|
+
- Write each label as the move, in Title Case, and use the same words for the same move on every page.
|
|
19
|
+
- Name where an action goes when it leaves the site: 'Download the Desktop App'. Keep the main and second action in the same tab, unless one goes to a store or starts a download. Then use `openInNewTab`.
|
|
20
|
+
- Put the header's main action in `SiteHeader` as `phoneAction`, as the case 'Site header' says, so it stays in the bar on a phone.
|
|
21
|
+
- Use a `Button` with `href` for an action that goes to a page. Use `onClickButton` only for an action that stays on the page.
|
|
22
|
+
|
|
23
|
+
## Don't
|
|
24
|
+
|
|
25
|
+
- Do not call one move 'Get Started Free' in one place and 'Try It' in another.
|
|
26
|
+
- Do not give a second, different move a primary Button. The header and the hero may both show 'Sign Up'.
|
|
27
|
+
- Do not open the main action or the second action in a new tab, unless it goes to a store or starts a download.
|
|
28
|
+
- Do not build your own call-to-action button for one section. Use `Button`.
|
|
29
|
+
- Do not leave a Button with no action. If it has nowhere to go, it is not on the page yet.
|
|
30
|
+
|
|
31
|
+
## Native
|
|
32
|
+
|
|
33
|
+
On Apple an app has no marketing page. A product page in the App Store is the store. On Android the same holds for Google Play.
|
|
@@ -29,12 +29,15 @@ export default function OverflowMenuInAHeader() {
|
|
|
29
29
|
// The clipboard answers later; by then the example may be gone.
|
|
30
30
|
var mounted = useRef(true);
|
|
31
31
|
// On unmount it stops the request and closes every toast it opened.
|
|
32
|
-
useEffect(function () {
|
|
33
|
-
mounted.current =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
useEffect(function () {
|
|
33
|
+
mounted.current = true;
|
|
34
|
+
return function () {
|
|
35
|
+
mounted.current = false;
|
|
36
|
+
clearTimeout(timer.current);
|
|
37
|
+
toastIds.current.forEach(function (id) { return dismissToast(id); });
|
|
38
|
+
toastIds.current = [];
|
|
39
|
+
};
|
|
40
|
+
}, []);
|
|
38
41
|
useEffect(function () {
|
|
39
42
|
var move = focusNext.current;
|
|
40
43
|
focusNext.current = undefined;
|
|
@@ -52,12 +52,15 @@ export default function OverflowMenuOnARow() {
|
|
|
52
52
|
// Gives each copy its own id, so no two rows share a key.
|
|
53
53
|
var copies = useRef(0);
|
|
54
54
|
// On unmount it stops the request and closes every toast it opened.
|
|
55
|
-
useEffect(function () {
|
|
56
|
-
mounted.current =
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
useEffect(function () {
|
|
56
|
+
mounted.current = true;
|
|
57
|
+
return function () {
|
|
58
|
+
mounted.current = false;
|
|
59
|
+
clearTimeout(timer.current);
|
|
60
|
+
toastIds.current.forEach(function (id) { return dismissToast(id); });
|
|
61
|
+
toastIds.current = [];
|
|
62
|
+
};
|
|
63
|
+
}, []);
|
|
61
64
|
useEffect(function () {
|
|
62
65
|
var move = focusNext.current;
|
|
63
66
|
focusNext.current = undefined;
|
|
@@ -84,11 +84,14 @@ export default function OverflowMenuOnARow() {
|
|
|
84
84
|
const copies = useRef(0);
|
|
85
85
|
|
|
86
86
|
// On unmount it stops the request and closes every toast it opened.
|
|
87
|
-
useEffect(() =>
|
|
88
|
-
mounted.current =
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
mounted.current = true;
|
|
89
|
+
return () => {
|
|
90
|
+
mounted.current = false;
|
|
91
|
+
clearTimeout(timer.current);
|
|
92
|
+
toastIds.current.forEach((id) => dismissToast(id));
|
|
93
|
+
toastIds.current = [];
|
|
94
|
+
};
|
|
92
95
|
}, []);
|
|
93
96
|
|
|
94
97
|
useEffect(() => {
|
|
@@ -280,11 +283,14 @@ export default function OverflowMenuInAHeader() {
|
|
|
280
283
|
const mounted = useRef(true);
|
|
281
284
|
|
|
282
285
|
// On unmount it stops the request and closes every toast it opened.
|
|
283
|
-
useEffect(() =>
|
|
284
|
-
mounted.current =
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
286
|
+
useEffect(() => {
|
|
287
|
+
mounted.current = true;
|
|
288
|
+
return () => {
|
|
289
|
+
mounted.current = false;
|
|
290
|
+
clearTimeout(timer.current);
|
|
291
|
+
toastIds.current.forEach((id) => dismissToast(id));
|
|
292
|
+
toastIds.current = [];
|
|
293
|
+
};
|
|
288
294
|
}, []);
|
|
289
295
|
|
|
290
296
|
useEffect(() => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function PageEndCtaBand(): import("react").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import PageShell from '../../components/pageShell';
|
|
3
|
+
import Surface from '../../components/surface';
|
|
4
|
+
import Heading from '../../components/heading';
|
|
5
|
+
import Paragraph from '../../components/paragraph';
|
|
6
|
+
import Button from '../../components/button';
|
|
7
|
+
import { Cluster, Stack } from '../../components/layout';
|
|
8
|
+
export default function PageEndCtaBand() {
|
|
9
|
+
return (<PageShell>
|
|
10
|
+
{/* The last block of the page: one statement, one line, and the same actions as the header and the hero. */}
|
|
11
|
+
<Surface padding="xlarge">
|
|
12
|
+
<Stack gap="xlarge">
|
|
13
|
+
<Stack gap="medium">
|
|
14
|
+
<Heading level={2} size="h4">Bring your team and its agent together</Heading>
|
|
15
|
+
<Paragraph tone="secondary" measure="lede">Start on Free with 3 members, and add people when you need them.</Paragraph>
|
|
16
|
+
</Stack>
|
|
17
|
+
<Cluster>
|
|
18
|
+
<Button size="large" type="primary" state="enabled" label="Sign Up" href="#sign-up"/>
|
|
19
|
+
<Button size="large" type="secondary" state="enabled" label="See How It Works" href="#how-it-works"/>
|
|
20
|
+
</Cluster>
|
|
21
|
+
</Stack>
|
|
22
|
+
</Surface>
|
|
23
|
+
</PageShell>);
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function PageEndNextLink(): import("react").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import PageShell from '../../components/pageShell';
|
|
3
|
+
import PageHeader from '../../components/pageHeader';
|
|
4
|
+
import Paragraph from '../../components/paragraph';
|
|
5
|
+
import LinkCard from '../../components/linkCard';
|
|
6
|
+
import { Stack } from '../../components/layout';
|
|
7
|
+
export default function PageEndNextLink() {
|
|
8
|
+
return (<PageShell>
|
|
9
|
+
<Stack gap="giant">
|
|
10
|
+
<Stack gap="xxlarge">
|
|
11
|
+
<PageHeader level={1} title="How channels work" lede="A channel is a place for one subject. Everyone in it sees every message."/>
|
|
12
|
+
<Paragraph tone="secondary">Make a channel for each team or project. Pin the messages people need to find again. Turn a message into a task when it needs an owner.</Paragraph>
|
|
13
|
+
</Stack>
|
|
14
|
+
{/* A reading page ends by pointing to the next page to read, and not to a sign-up. */}
|
|
15
|
+
<LinkCard href="#task-threads" title="Task threads" caption="Next: Task threads"/>
|
|
16
|
+
</Stack>
|
|
17
|
+
</PageShell>);
|
|
18
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Page end
|
|
2
|
+
|
|
3
|
+
A page has said what it had to say, and its last block decides what the visitor does next.
|
|
4
|
+
|
|
5
|
+
## Do
|
|
6
|
+
|
|
7
|
+
- Follow the rule 'A marketing page asks for one main action, in the same words everywhere'. The closing block uses the same labels as the header and the hero.
|
|
8
|
+
- Use a `Surface` for `cta-band`, with a level 2 `Heading`, one line of lede and the page's actions: a primary 'Sign Up' and one secondary.
|
|
9
|
+
- Write the heading as a statement the visitor can say yes to, and the lede as the one doubt it removes.
|
|
10
|
+
- Use one `LinkCard` for `next-link`, with the next page's title and a caption that says it is next: 'Next: Task threads'.
|
|
11
|
+
- Put the block after the last section and before the `SiteFooter`.
|
|
12
|
+
|
|
13
|
+
## Don't
|
|
14
|
+
|
|
15
|
+
- Do not use both blocks on one page. A page ends one way.
|
|
16
|
+
- Do not add a new action that the header and the hero do not have.
|
|
17
|
+
- Do not close a reading page on a sign-up banner.
|
|
18
|
+
- Do not name the link 'Next'. Name the page.
|
|
19
|
+
|
|
20
|
+
## Option: Closing call to action
|
|
21
|
+
|
|
22
|
+
Use when: A marketing page closes on its main action.
|
|
23
|
+
|
|
24
|
+
Uses: `Button`, `Cluster`, `Heading`, `PageShell`, `Paragraph`, `Stack`, `Surface`
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
'use client';
|
|
28
|
+
import PageShell from 'oneslash-design-system/components/pageShell';
|
|
29
|
+
import Surface from 'oneslash-design-system/components/surface';
|
|
30
|
+
import Heading from 'oneslash-design-system/components/heading';
|
|
31
|
+
import Paragraph from 'oneslash-design-system/components/paragraph';
|
|
32
|
+
import Button from 'oneslash-design-system/components/button';
|
|
33
|
+
import { Cluster, Stack } from 'oneslash-design-system/components/layout';
|
|
34
|
+
|
|
35
|
+
export default function PageEndCtaBand() {
|
|
36
|
+
return (
|
|
37
|
+
<PageShell>
|
|
38
|
+
{/* The last block of the page: one statement, one line, and the same actions as the header and the hero. */}
|
|
39
|
+
<Surface padding="xlarge">
|
|
40
|
+
<Stack gap="xlarge">
|
|
41
|
+
<Stack gap="medium">
|
|
42
|
+
<Heading level={2} size="h4">Bring your team and its agent together</Heading>
|
|
43
|
+
<Paragraph tone="secondary" measure="lede">Start on Free with 3 members, and add people when you need them.</Paragraph>
|
|
44
|
+
</Stack>
|
|
45
|
+
<Cluster>
|
|
46
|
+
<Button size="large" type="primary" state="enabled" label="Sign Up" href="#sign-up" />
|
|
47
|
+
<Button size="large" type="secondary" state="enabled" label="See How It Works" href="#how-it-works" />
|
|
48
|
+
</Cluster>
|
|
49
|
+
</Stack>
|
|
50
|
+
</Surface>
|
|
51
|
+
</PageShell>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Option: Link to the next page
|
|
57
|
+
|
|
58
|
+
Use when: A reading page leads to the next thing to read.
|
|
59
|
+
|
|
60
|
+
Uses: `LinkCard`, `PageHeader`, `PageShell`, `Paragraph`, `Stack`
|
|
61
|
+
|
|
62
|
+
```tsx
|
|
63
|
+
'use client';
|
|
64
|
+
import PageShell from 'oneslash-design-system/components/pageShell';
|
|
65
|
+
import PageHeader from 'oneslash-design-system/components/pageHeader';
|
|
66
|
+
import Paragraph from 'oneslash-design-system/components/paragraph';
|
|
67
|
+
import LinkCard from 'oneslash-design-system/components/linkCard';
|
|
68
|
+
import { Stack } from 'oneslash-design-system/components/layout';
|
|
69
|
+
|
|
70
|
+
export default function PageEndNextLink() {
|
|
71
|
+
return (
|
|
72
|
+
<PageShell>
|
|
73
|
+
<Stack gap="giant">
|
|
74
|
+
<Stack gap="xxlarge">
|
|
75
|
+
<PageHeader level={1} title="How channels work" lede="A channel is a place for one subject. Everyone in it sees every message." />
|
|
76
|
+
<Paragraph tone="secondary">Make a channel for each team or project. Pin the messages people need to find again. Turn a message into a task when it needs an owner.</Paragraph>
|
|
77
|
+
</Stack>
|
|
78
|
+
{/* A reading page ends by pointing to the next page to read, and not to a sign-up. */}
|
|
79
|
+
<LinkCard href="#task-threads" title="Task threads" caption="Next: Task threads" />
|
|
80
|
+
</Stack>
|
|
81
|
+
</PageShell>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Native
|
|
87
|
+
|
|
88
|
+
On Apple a screen ends with its content. A flow moves on with a `NavigationLink` or a toolbar button. On Android use the same with a navigation bar.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function PasswordGateInline(): import("react").JSX.Element;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import PageShell from '../../components/pageShell';
|
|
4
|
+
import PageHeader from '../../components/pageHeader';
|
|
5
|
+
import Figure from '../../components/figure';
|
|
6
|
+
import Image from '../../components/image';
|
|
7
|
+
import Surface from '../../components/surface';
|
|
8
|
+
import Heading from '../../components/heading';
|
|
9
|
+
import Paragraph from '../../components/paragraph';
|
|
10
|
+
import Link from '../../components/link';
|
|
11
|
+
import Form from '../../components/form';
|
|
12
|
+
import TextField from '../../components/textField';
|
|
13
|
+
import Button from '../../components/button';
|
|
14
|
+
import { Stack } from '../../components/layout';
|
|
15
|
+
// The example checks nothing real and sends nothing. It accepts one made-up passphrase, 'acme-demo', so you can see both outcomes.
|
|
16
|
+
// 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.
|
|
17
|
+
// A stand-in for a screen. A real page passes its own picture.
|
|
18
|
+
var screen = "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";
|
|
19
|
+
var PASSPHRASE = 'acme-demo';
|
|
20
|
+
export default function PasswordGateInline() {
|
|
21
|
+
var _a = useState(''), password = _a[0], setPassword = _a[1];
|
|
22
|
+
var _b = useState(''), error = _b[0], setError = _b[1];
|
|
23
|
+
var _c = useState(false), checking = _c[0], setChecking = _c[1];
|
|
24
|
+
var _d = useState(false), unlocked = _d[0], setUnlocked = _d[1];
|
|
25
|
+
// 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.
|
|
26
|
+
var _e = useState(0), attempt = _e[0], setAttempt = _e[1];
|
|
27
|
+
var timer = useRef();
|
|
28
|
+
var lockAgain = useRef(null);
|
|
29
|
+
// Stops the request if the example goes away before it ends.
|
|
30
|
+
useEffect(function () { return function () { return clearTimeout(timer.current); }; }, []);
|
|
31
|
+
// The field is gone once the work shows, so focus moves to the first control in it.
|
|
32
|
+
useEffect(function () {
|
|
33
|
+
var _a;
|
|
34
|
+
if (unlocked)
|
|
35
|
+
(_a = lockAgain.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
36
|
+
}, [unlocked]);
|
|
37
|
+
function handleSubmit() {
|
|
38
|
+
if (checking)
|
|
39
|
+
return;
|
|
40
|
+
if (!password.trim()) {
|
|
41
|
+
setError('Enter the password.');
|
|
42
|
+
setAttempt(function (n) { return n + 1; });
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
setError('');
|
|
46
|
+
setChecking(true);
|
|
47
|
+
// Stands in for the request to the server.
|
|
48
|
+
timer.current = setTimeout(function () {
|
|
49
|
+
setChecking(false);
|
|
50
|
+
if (password === PASSPHRASE) {
|
|
51
|
+
setUnlocked(true);
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
setError('That password is not right.');
|
|
55
|
+
setAttempt(function (n) { return n + 1; });
|
|
56
|
+
}
|
|
57
|
+
}, 600);
|
|
58
|
+
}
|
|
59
|
+
var header = (<PageHeader level={1} title="Plan changes, a case study" lede="How we made a plan change clear before anyone pays." facts={[
|
|
60
|
+
{ label: 'Role', value: 'Lead designer' },
|
|
61
|
+
{ label: 'Team', value: '4 people' },
|
|
62
|
+
{ label: 'Year', value: '2026' },
|
|
63
|
+
]}/>);
|
|
64
|
+
return (<PageShell>
|
|
65
|
+
<Stack gap="giant">
|
|
66
|
+
{/* The summary and the facts stay readable. Only the screens are behind the gate. */}
|
|
67
|
+
<Stack gap="xlarge">
|
|
68
|
+
{header}
|
|
69
|
+
<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>
|
|
70
|
+
</Stack>
|
|
71
|
+
{unlocked ? (<Stack gap="xlarge">
|
|
72
|
+
<Figure crop={16 / 9} caption="The plan change, before the person pays.">
|
|
73
|
+
<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}/>
|
|
74
|
+
</Figure>
|
|
75
|
+
<Stack align="start">
|
|
76
|
+
<Button ref={lockAgain} size="medium" type="secondary" state="enabled" label="Lock Again" onClickButton={function () { setUnlocked(false); setPassword(''); }}/>
|
|
77
|
+
</Stack>
|
|
78
|
+
</Stack>) : (<Surface padding="large">
|
|
79
|
+
<Stack gap="large">
|
|
80
|
+
<Heading level={2} size="h6">This case study needs a password</Heading>
|
|
81
|
+
<Paragraph>
|
|
82
|
+
The password comes by email. <Link href="#contact">Ask for the password</Link>.
|
|
83
|
+
</Paragraph>
|
|
84
|
+
<Form aria-label="Private work" onSubmit={handleSubmit}>
|
|
85
|
+
<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={function (e) { setPassword(e.target.value); setError(''); }}/>
|
|
86
|
+
<Stack align="start">
|
|
87
|
+
<Button size="medium" type="primary" state="enabled" label="View Work" htmlType="submit" loading={checking}/>
|
|
88
|
+
</Stack>
|
|
89
|
+
</Form>
|
|
90
|
+
</Stack>
|
|
91
|
+
</Surface>)}
|
|
92
|
+
</Stack>
|
|
93
|
+
</PageShell>);
|
|
94
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function PasswordGateModal(): import("react").JSX.Element;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import PageShell from '../../components/pageShell';
|
|
4
|
+
import PageHeader from '../../components/pageHeader';
|
|
5
|
+
import Modal from '../../components/modal';
|
|
6
|
+
import Form from '../../components/form';
|
|
7
|
+
import TextField from '../../components/textField';
|
|
8
|
+
import Paragraph from '../../components/paragraph';
|
|
9
|
+
import Link from '../../components/link';
|
|
10
|
+
import Button from '../../components/button';
|
|
11
|
+
import { Stack } from '../../components/layout';
|
|
12
|
+
// The example checks nothing real and sends nothing. It accepts one made-up passphrase, 'acme-demo', so you can see both outcomes.
|
|
13
|
+
// 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.
|
|
14
|
+
var PASSPHRASE = 'acme-demo';
|
|
15
|
+
export default function PasswordGateModal() {
|
|
16
|
+
var _a = useState(false), open = _a[0], setOpen = _a[1];
|
|
17
|
+
var _b = useState(false), unlocked = _b[0], setUnlocked = _b[1];
|
|
18
|
+
var _c = useState(''), password = _c[0], setPassword = _c[1];
|
|
19
|
+
var _d = useState(''), error = _d[0], setError = _d[1];
|
|
20
|
+
var _e = useState(false), checking = _e[0], setChecking = _e[1];
|
|
21
|
+
// 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.
|
|
22
|
+
var _f = useState(0), attempt = _f[0], setAttempt = _f[1];
|
|
23
|
+
var timer = useRef();
|
|
24
|
+
// Stops the request if the example goes away before it ends.
|
|
25
|
+
useEffect(function () { return function () { return clearTimeout(timer.current); }; }, []);
|
|
26
|
+
// Escape, a click outside and Cancel all close it, except while the request runs.
|
|
27
|
+
function handleClose() {
|
|
28
|
+
if (checking)
|
|
29
|
+
return;
|
|
30
|
+
setOpen(false);
|
|
31
|
+
setPassword('');
|
|
32
|
+
setError('');
|
|
33
|
+
}
|
|
34
|
+
function handleSubmit() {
|
|
35
|
+
if (checking)
|
|
36
|
+
return;
|
|
37
|
+
if (!password.trim()) {
|
|
38
|
+
setError('Enter the password.');
|
|
39
|
+
setAttempt(function (n) { return n + 1; });
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
setError('');
|
|
43
|
+
setChecking(true);
|
|
44
|
+
// Stands in for the request to the server.
|
|
45
|
+
timer.current = setTimeout(function () {
|
|
46
|
+
setChecking(false);
|
|
47
|
+
if (password === PASSPHRASE) {
|
|
48
|
+
setUnlocked(true);
|
|
49
|
+
setOpen(false);
|
|
50
|
+
setPassword('');
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
setError('That password is not right.');
|
|
54
|
+
setAttempt(function (n) { return n + 1; });
|
|
55
|
+
}
|
|
56
|
+
}, 600);
|
|
57
|
+
}
|
|
58
|
+
return (<PageShell>
|
|
59
|
+
<Stack gap="xlarge">
|
|
60
|
+
<PageHeader level={1} title="Selected work" lede="Three case studies. The first is open. The others need a password."/>
|
|
61
|
+
<Stack gap="large" align="start">
|
|
62
|
+
<Link href="#how-we-write-errors">How we write error messages</Link>
|
|
63
|
+
{/* 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. */}
|
|
64
|
+
<Button size="medium" type="textOnly" state="enabled" label="Read the Plan Changes Case Study" onClickButton={function () { if (!unlocked)
|
|
65
|
+
setOpen(true); }}/>
|
|
66
|
+
{unlocked && <Paragraph>It is open for you now.</Paragraph>}
|
|
67
|
+
</Stack>
|
|
68
|
+
</Stack>
|
|
69
|
+
<Modal isOpen={open} size="small" initialFocus="body" title="View Work" onClose={handleClose} actions={<>
|
|
70
|
+
<Button size="small" type="tertiary" state={checking ? 'disabled' : 'enabled'} label="Cancel" onClickButton={handleClose}/>
|
|
71
|
+
<Button size="small" type="primary" state="enabled" label="View Work" loading={checking} onClickButton={handleSubmit}/>
|
|
72
|
+
</>}>
|
|
73
|
+
<Form aria-label="Private work" onSubmit={handleSubmit}>
|
|
74
|
+
<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={function (e) { setPassword(e.target.value); setError(''); }}/>
|
|
75
|
+
<Paragraph tone="secondary" size="body2" measure="none">
|
|
76
|
+
This case study needs a password, and it comes by email. <Link href="#contact">Ask for the password</Link>.
|
|
77
|
+
</Paragraph>
|
|
78
|
+
</Form>
|
|
79
|
+
</Modal>
|
|
80
|
+
</PageShell>);
|
|
81
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function PasswordGatePage(): import("react").JSX.Element;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import PageShell from '../../components/pageShell';
|
|
4
|
+
import PageHeader from '../../components/pageHeader';
|
|
5
|
+
import Surface from '../../components/surface';
|
|
6
|
+
import Heading from '../../components/heading';
|
|
7
|
+
import Paragraph from '../../components/paragraph';
|
|
8
|
+
import Link from '../../components/link';
|
|
9
|
+
import Form from '../../components/form';
|
|
10
|
+
import TextField from '../../components/textField';
|
|
11
|
+
import Button from '../../components/button';
|
|
12
|
+
import { Stack } from '../../components/layout';
|
|
13
|
+
// The example checks nothing real and sends nothing. It accepts one made-up passphrase, 'acme-demo', so you can see both outcomes.
|
|
14
|
+
// 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.
|
|
15
|
+
var PASSPHRASE = 'acme-demo';
|
|
16
|
+
export default function PasswordGatePage() {
|
|
17
|
+
var _a = useState(''), password = _a[0], setPassword = _a[1];
|
|
18
|
+
var _b = useState(''), error = _b[0], setError = _b[1];
|
|
19
|
+
var _c = useState(false), checking = _c[0], setChecking = _c[1];
|
|
20
|
+
var _d = useState(false), unlocked = _d[0], setUnlocked = _d[1];
|
|
21
|
+
// 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.
|
|
22
|
+
var _e = useState(0), attempt = _e[0], setAttempt = _e[1];
|
|
23
|
+
var timer = useRef();
|
|
24
|
+
var lockAgain = useRef(null);
|
|
25
|
+
// Stops the request if the example goes away before it ends.
|
|
26
|
+
useEffect(function () { return function () { return clearTimeout(timer.current); }; }, []);
|
|
27
|
+
// The field is gone once the work shows, so focus moves to the first control in it.
|
|
28
|
+
useEffect(function () {
|
|
29
|
+
var _a;
|
|
30
|
+
if (unlocked)
|
|
31
|
+
(_a = lockAgain.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
32
|
+
}, [unlocked]);
|
|
33
|
+
function handleSubmit() {
|
|
34
|
+
if (checking)
|
|
35
|
+
return;
|
|
36
|
+
if (!password.trim()) {
|
|
37
|
+
setError('Enter the password.');
|
|
38
|
+
setAttempt(function (n) { return n + 1; });
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
setError('');
|
|
42
|
+
setChecking(true);
|
|
43
|
+
// Stands in for the request to the server.
|
|
44
|
+
timer.current = setTimeout(function () {
|
|
45
|
+
setChecking(false);
|
|
46
|
+
if (password === PASSPHRASE) {
|
|
47
|
+
setUnlocked(true);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
setError('That password is not right.');
|
|
51
|
+
setAttempt(function (n) { return n + 1; });
|
|
52
|
+
}
|
|
53
|
+
}, 600);
|
|
54
|
+
}
|
|
55
|
+
if (unlocked) {
|
|
56
|
+
return (<PageShell>
|
|
57
|
+
<Stack gap="xlarge">
|
|
58
|
+
<PageHeader level={1} title="Plan changes, a case study" lede="How we made a plan change clear before anyone pays."/>
|
|
59
|
+
<Paragraph tone="secondary">The screens, the notes and the decisions for this case study are here.</Paragraph>
|
|
60
|
+
<Stack align="start">
|
|
61
|
+
<Button ref={lockAgain} size="medium" type="secondary" state="enabled" label="Lock Again" onClickButton={function () { setUnlocked(false); setPassword(''); }}/>
|
|
62
|
+
</Stack>
|
|
63
|
+
</Stack>
|
|
64
|
+
</PageShell>);
|
|
65
|
+
}
|
|
66
|
+
return (<PageShell>
|
|
67
|
+
<Surface padding="xlarge" minHeight="tall" align="center">
|
|
68
|
+
<Stack gap="large">
|
|
69
|
+
<Heading level={1} size="h5">This case study needs a password</Heading>
|
|
70
|
+
<Paragraph>
|
|
71
|
+
The password comes by email. <Link href="#contact">Ask for the password</Link>.
|
|
72
|
+
</Paragraph>
|
|
73
|
+
<Form aria-label="Private work" onSubmit={handleSubmit}>
|
|
74
|
+
<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={function (e) { setPassword(e.target.value); setError(''); }}/>
|
|
75
|
+
<Stack align="start">
|
|
76
|
+
<Button size="medium" type="primary" state="enabled" label="View Work" htmlType="submit" loading={checking}/>
|
|
77
|
+
</Stack>
|
|
78
|
+
</Form>
|
|
79
|
+
</Stack>
|
|
80
|
+
</Surface>
|
|
81
|
+
</PageShell>);
|
|
82
|
+
}
|