oneslash-design-system 2.14.2 → 2.16.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 +15 -0
- package/dist/DESIGN.md +138 -1
- package/dist/cases/accept-invite/signed-in.d.ts +1 -0
- package/dist/cases/accept-invite/signed-in.jsx +57 -0
- package/dist/cases/accept-invite/signed-out.d.ts +1 -0
- package/dist/cases/accept-invite/signed-out.jsx +33 -0
- package/dist/cases/accept-invite.md +161 -0
- package/dist/cases/agent-asks-before-risky-action.md +29 -0
- package/dist/cases/agent-cancels-when-unanswered.md +27 -0
- package/dist/cases/agent-refuses-clearly.md +31 -0
- package/dist/cases/agent-says-what-it-is.md +29 -0
- package/dist/cases/agent-shows-progress.md +30 -0
- package/dist/cases/agent-shows-sources.md +26 -0
- package/dist/cases/auth-gate-loading/spinner-with-line.d.ts +1 -0
- package/dist/cases/auth-gate-loading/spinner-with-line.jsx +10 -0
- package/dist/cases/auth-gate-loading/spinner.d.ts +1 -0
- package/dist/cases/auth-gate-loading/spinner.jsx +10 -0
- package/dist/cases/auth-gate-loading.md +70 -0
- package/dist/cases/check-your-email/alert-on-login.d.ts +1 -0
- package/dist/cases/check-your-email/alert-on-login.jsx +78 -0
- package/dist/cases/check-your-email/page.d.ts +1 -0
- package/dist/cases/check-your-email/page.jsx +49 -0
- package/dist/cases/check-your-email.md +184 -0
- package/dist/cases/confirm-destructive-action/inline.d.ts +1 -0
- package/dist/cases/confirm-destructive-action/inline.jsx +69 -0
- package/dist/cases/confirm-destructive-action/modal.d.ts +1 -0
- package/dist/cases/confirm-destructive-action/modal.jsx +66 -0
- package/dist/cases/confirm-destructive-action.md +211 -0
- package/dist/cases/confirm-dialogs.md +36 -0
- package/dist/cases/create-modal/quick.d.ts +1 -0
- package/dist/cases/create-modal/quick.jsx +80 -0
- package/dist/cases/create-modal/with-settings.d.ts +1 -0
- package/dist/cases/create-modal/with-settings.jsx +99 -0
- package/dist/cases/create-modal.md +244 -0
- package/dist/cases/device-login/popup.d.ts +1 -0
- package/dist/cases/device-login/popup.jsx +14 -0
- package/dist/cases/device-login/provider-first.d.ts +1 -0
- package/dist/cases/device-login/provider-first.jsx +98 -0
- package/dist/cases/device-login.md +171 -0
- package/dist/cases/email-confirmed/alert-on-login.d.ts +1 -0
- package/dist/cases/email-confirmed/alert-on-login.jsx +78 -0
- package/dist/cases/email-confirmed/page.d.ts +1 -0
- package/dist/cases/email-confirmed/page.jsx +21 -0
- package/dist/cases/email-confirmed.md +151 -0
- package/dist/cases/empty-list/region.d.ts +1 -0
- package/dist/cases/empty-list/region.jsx +13 -0
- package/dist/cases/empty-list/section.d.ts +1 -0
- package/dist/cases/empty-list/section.jsx +17 -0
- package/dist/cases/empty-list.md +77 -0
- package/dist/cases/empty-lists.md +35 -0
- package/dist/cases/empty-not-set-up/action.d.ts +1 -0
- package/dist/cases/empty-not-set-up/action.jsx +16 -0
- package/dist/cases/empty-not-set-up/pointer.d.ts +1 -0
- package/dist/cases/empty-not-set-up/pointer.jsx +13 -0
- package/dist/cases/empty-not-set-up.md +88 -0
- package/dist/cases/empty-search/clear-search.d.ts +1 -0
- package/dist/cases/empty-search/clear-search.jsx +29 -0
- package/dist/cases/empty-search.md +77 -0
- package/dist/cases/error-page/full-page.d.ts +1 -0
- package/dist/cases/error-page/full-page.jsx +19 -0
- package/dist/cases/error-page/in-shell.d.ts +1 -0
- package/dist/cases/error-page/in-shell.jsx +39 -0
- package/dist/cases/error-page.md +107 -0
- package/dist/cases/feedback-form/modal.d.ts +1 -0
- package/dist/cases/feedback-form/modal.jsx +89 -0
- package/dist/cases/feedback-form.md +139 -0
- package/dist/cases/forgot-password/in-place.d.ts +1 -0
- package/dist/cases/forgot-password/in-place.jsx +155 -0
- package/dist/cases/forgot-password/own-page.d.ts +1 -0
- package/dist/cases/forgot-password/own-page.jsx +99 -0
- package/dist/cases/forgot-password.md +328 -0
- package/dist/cases/form-errors.md +32 -0
- package/dist/cases/import-checklist/modal.d.ts +1 -0
- package/dist/cases/import-checklist/modal.jsx +125 -0
- package/dist/cases/import-checklist.md +188 -0
- package/dist/cases/inline-form-feedback/button-label.d.ts +1 -0
- package/dist/cases/inline-form-feedback/button-label.jsx +54 -0
- package/dist/cases/inline-form-feedback/inline-alert.d.ts +1 -0
- package/dist/cases/inline-form-feedback/inline-alert.jsx +49 -0
- package/dist/cases/inline-form-feedback/toast.d.ts +1 -0
- package/dist/cases/inline-form-feedback/toast.jsx +66 -0
- package/dist/cases/inline-form-feedback.md +237 -0
- package/dist/cases/invite-member/by-email.d.ts +1 -0
- package/dist/cases/invite-member/by-email.jsx +98 -0
- package/dist/cases/invite-member/by-link.d.ts +1 -0
- package/dist/cases/invite-member/by-link.jsx +122 -0
- package/dist/cases/invite-member.md +321 -0
- package/dist/cases/load-failure/inline.d.ts +1 -0
- package/dist/cases/load-failure/inline.jsx +52 -0
- package/dist/cases/load-failure/region.d.ts +1 -0
- package/dist/cases/load-failure/region.jsx +34 -0
- package/dist/cases/load-failure.md +155 -0
- package/dist/cases/log-out-confirm/modal.d.ts +1 -0
- package/dist/cases/log-out-confirm/modal.jsx +57 -0
- package/dist/cases/log-out-confirm.md +106 -0
- package/dist/cases/login-page/centered.d.ts +1 -0
- package/dist/cases/login-page/centered.jsx +72 -0
- package/dist/cases/login-page/email-only.d.ts +1 -0
- package/dist/cases/login-page/email-only.jsx +59 -0
- package/dist/cases/login-page/provider-first.d.ts +1 -0
- package/dist/cases/login-page/provider-first.jsx +66 -0
- package/dist/cases/login-page/split.d.ts +1 -0
- package/dist/cases/login-page/split.jsx +79 -0
- package/dist/cases/login-page.md +373 -0
- package/dist/cases/not-found-page/full-page.d.ts +1 -0
- package/dist/cases/not-found-page/full-page.jsx +16 -0
- package/dist/cases/not-found-page/in-shell.d.ts +1 -0
- package/dist/cases/not-found-page/in-shell.jsx +36 -0
- package/dist/cases/not-found-page.md +98 -0
- package/dist/cases/oauth-consent/simple.d.ts +1 -0
- package/dist/cases/oauth-consent/simple.jsx +73 -0
- package/dist/cases/oauth-consent/with-scope.d.ts +1 -0
- package/dist/cases/oauth-consent/with-scope.jsx +89 -0
- package/dist/cases/oauth-consent.md +233 -0
- package/dist/cases/rename/inline.d.ts +1 -0
- package/dist/cases/rename/inline.jsx +58 -0
- package/dist/cases/rename/modal.d.ts +1 -0
- package/dist/cases/rename/modal.jsx +70 -0
- package/dist/cases/rename.md +205 -0
- package/dist/cases/route-loading/full-screen.d.ts +1 -0
- package/dist/cases/route-loading/full-screen.jsx +8 -0
- package/dist/cases/route-loading/region.d.ts +1 -0
- package/dist/cases/route-loading/region.jsx +26 -0
- package/dist/cases/route-loading.md +84 -0
- package/dist/cases/set-new-password/form.d.ts +1 -0
- package/dist/cases/set-new-password/form.jsx +130 -0
- package/dist/cases/set-new-password/invalid-link.d.ts +1 -0
- package/dist/cases/set-new-password/invalid-link.jsx +50 -0
- package/dist/cases/set-new-password.md +247 -0
- package/dist/cases/sign-up-page/centered.d.ts +1 -0
- package/dist/cases/sign-up-page/centered.jsx +124 -0
- package/dist/cases/sign-up-page/provider-first.d.ts +1 -0
- package/dist/cases/sign-up-page/provider-first.jsx +124 -0
- package/dist/cases/sign-up-page/split.d.ts +1 -0
- package/dist/cases/sign-up-page/split.jsx +134 -0
- package/dist/cases/sign-up-page.md +478 -0
- package/dist/cases/success-feedback.md +35 -0
- package/dist/cases/type-to-confirm/inline.d.ts +1 -0
- package/dist/cases/type-to-confirm/inline.jsx +69 -0
- package/dist/cases/type-to-confirm/modal.d.ts +1 -0
- package/dist/cases/type-to-confirm/modal.jsx +73 -0
- package/dist/cases/type-to-confirm.md +222 -0
- package/dist/cases/unsaved-changes-guard/discard.d.ts +1 -0
- package/dist/cases/unsaved-changes-guard/discard.jsx +81 -0
- package/dist/cases/unsaved-changes-guard/save-or-discard.d.ts +1 -0
- package/dist/cases/unsaved-changes-guard/save-or-discard.jsx +85 -0
- package/dist/cases/unsaved-changes-guard.md +239 -0
- package/dist/cases/upgrade-prompt/inline.d.ts +1 -0
- package/dist/cases/upgrade-prompt/inline.jsx +52 -0
- package/dist/cases/upgrade-prompt/modal.d.ts +1 -0
- package/dist/cases/upgrade-prompt/modal.jsx +43 -0
- package/dist/cases/upgrade-prompt.md +174 -0
- package/dist/cases.json +2073 -0
- package/dist/components/alert.d.ts +3 -1
- package/dist/components/alert.jsx +6 -4
- package/dist/components/brandIcon.d.ts +12 -0
- package/dist/components/brandIcon.jsx +24 -0
- package/dist/components/emptyBox.d.ts +6 -1
- package/dist/components/emptyBox.jsx +4 -2
- package/dist/components/form.d.ts +11 -0
- package/dist/components/form.jsx +22 -0
- package/dist/components/heading.d.ts +2 -2
- package/dist/components/image.d.ts +14 -0
- package/dist/components/image.jsx +6 -0
- package/dist/components/layout.d.ts +18 -1
- package/dist/components/layout.jsx +16 -0
- package/dist/components/line.d.ts +3 -1
- package/dist/components/line.jsx +8 -1
- package/dist/components/loadingScreen.d.ts +5 -1
- package/dist/components/loadingScreen.jsx +4 -2
- package/dist/components/modal.d.ts +2 -1
- package/dist/components/modal.jsx +20 -8
- package/dist/components/radioGroup.d.ts +2 -1
- package/dist/components/radioGroup.jsx +2 -2
- package/dist/components/select.d.ts +2 -1
- package/dist/components/select.jsx +4 -2
- package/dist/components/tab.jsx +3 -2
- package/dist/components/tabsContainer.d.ts +4 -1
- package/dist/components/tabsContainer.jsx +11 -5
- package/dist/components/textField.d.ts +5 -1
- package/dist/components/textField.jsx +7 -3
- package/dist/components/toaster.d.ts +12 -0
- package/dist/components/toaster.jsx +103 -0
- package/dist/components/tooltip.jsx +3 -1
- package/dist/designTokens.d.ts +1 -0
- package/dist/designTokens.js +1 -0
- package/dist/internal/alert.d.ts +4 -0
- package/dist/internal/alert.js +6 -0
- package/dist/internal/modal.d.ts +2 -0
- package/dist/internal/modal.js +21 -0
- package/dist/internal/toaster.d.ts +19 -0
- package/dist/internal/toaster.js +50 -0
- package/dist/native-mapping.json +23 -1
- package/dist/stories/Alert.stories.d.ts +1 -0
- package/dist/stories/Alert.stories.jsx +16 -0
- package/dist/stories/BrandIcon.stories.d.ts +9 -0
- package/dist/stories/BrandIcon.stories.jsx +19 -0
- package/dist/stories/Cases.generated.stories.d.ts +60 -0
- package/dist/stories/Cases.generated.stories.jsx +116 -0
- package/dist/stories/EmptyBox.stories.d.ts +2 -0
- package/dist/stories/EmptyBox.stories.jsx +16 -0
- package/dist/stories/Form.stories.d.ts +6 -0
- package/dist/stories/Form.stories.jsx +26 -0
- package/dist/stories/Heading.stories.d.ts +6 -0
- package/dist/stories/Heading.stories.jsx +10 -0
- package/dist/stories/Image.stories.d.ts +7 -0
- package/dist/stories/Image.stories.jsx +18 -0
- package/dist/stories/Line.stories.d.ts +1 -0
- package/dist/stories/Line.stories.jsx +12 -0
- package/dist/stories/LoadingScreen.stories.d.ts +1 -0
- package/dist/stories/LoadingScreen.stories.jsx +8 -0
- package/dist/stories/Modal.stories.d.ts +2 -0
- package/dist/stories/Modal.stories.jsx +36 -0
- package/dist/stories/PageComponents.stories.d.ts +2 -0
- package/dist/stories/PageComponents.stories.jsx +15 -1
- package/dist/stories/RadioGroup.stories.d.ts +1 -0
- package/dist/stories/RadioGroup.stories.jsx +14 -0
- package/dist/stories/Select.stories.d.ts +1 -0
- package/dist/stories/Select.stories.jsx +14 -0
- package/dist/stories/TabsContainer.stories.d.ts +1 -0
- package/dist/stories/TabsContainer.stories.jsx +12 -0
- package/dist/stories/TextField.stories.d.ts +2 -0
- package/dist/stories/TextField.stories.jsx +22 -0
- package/dist/stories/Toaster.stories.d.ts +6 -0
- package/dist/stories/Toaster.stories.jsx +29 -0
- package/dist/tailwind-preset-auto.js +2 -1
- package/dist/tailwind-preset.js +2 -1
- package/dist/theme-auto.css +1 -0
- package/dist/theme.css +1 -0
- package/dist/tokens.css +1 -0
- package/dist/tokens.json +7 -0
- package/package.json +4 -2
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# Email confirmed
|
|
2
|
+
|
|
3
|
+
A person opened the link that confirms their email.
|
|
4
|
+
|
|
5
|
+
**Not built yet:** Scindo on the web shows its success Alert above the login form with a close button. Commentify has no confirmed page and no Alert for it: the link goes straight to the dashboard.
|
|
6
|
+
|
|
7
|
+
## Do
|
|
8
|
+
|
|
9
|
+
- Name the page 'Email confirmed' in a `Heading` with `level={1}`.
|
|
10
|
+
- Say in one line that the person can close the tab or go on here.
|
|
11
|
+
- Offer one Button, 'Continue', to where the person was going.
|
|
12
|
+
- Put the success Alert above the login form with no close button and `autoDismiss={false}`: 'Your email is confirmed. Log in to continue.' It stays until the person submits the form.
|
|
13
|
+
|
|
14
|
+
## Don't
|
|
15
|
+
|
|
16
|
+
- Do not ask the person to log in again in the browser where they are already logged in.
|
|
17
|
+
- Do not make the person close the success Alert.
|
|
18
|
+
|
|
19
|
+
## Option: Confirmed page
|
|
20
|
+
|
|
21
|
+
Use when: The link opened a new tab in the browser where the person is logged in.
|
|
22
|
+
|
|
23
|
+
Uses: `Button`, `Center`, `Heading`, `Image`, `Paragraph`, `Stack`
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
'use client';
|
|
27
|
+
import Image from 'oneslash-design-system/components/image';
|
|
28
|
+
import Heading from 'oneslash-design-system/components/heading';
|
|
29
|
+
import Paragraph from 'oneslash-design-system/components/paragraph';
|
|
30
|
+
import Button from 'oneslash-design-system/components/button';
|
|
31
|
+
import { Center, Stack } from 'oneslash-design-system/components/layout';
|
|
32
|
+
|
|
33
|
+
// The product's mark. A real app passes its own file.
|
|
34
|
+
const productMark =
|
|
35
|
+
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Crect width='40' height='40' rx='10' fill='%232f6b4f'/%3E%3Cpath d='M20 9 31 31h-6l-5-11-5 11H9z' fill='%23fff'/%3E%3C/svg%3E";
|
|
36
|
+
|
|
37
|
+
// A real app passes the router from its framework, such as Next's useRouter().
|
|
38
|
+
const router = { push: (url: string) => console.info(`Go to ${url}`) };
|
|
39
|
+
|
|
40
|
+
export default function EmailConfirmedPage() {
|
|
41
|
+
return (
|
|
42
|
+
<Center fill>
|
|
43
|
+
<Image src={productMark} alt="Acme" width={40} height={40} />
|
|
44
|
+
<Stack gap="medium">
|
|
45
|
+
<Heading level={1} size="h5">Email confirmed</Heading>
|
|
46
|
+
<Paragraph tone="secondary" measure="none">You can close this tab and go back to Acme, or continue here.</Paragraph>
|
|
47
|
+
</Stack>
|
|
48
|
+
{/* A real app sends the person on to where they were going, such as an invite they opened before signing up. */}
|
|
49
|
+
<Button size="medium" type="primary" state="enabled" label="Continue" onClickButton={() => router.push('/')} />
|
|
50
|
+
</Center>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Option: Alert above the login form
|
|
56
|
+
|
|
57
|
+
Use when: The link opened in another browser, so the person must log in.
|
|
58
|
+
|
|
59
|
+
Uses: `Alert`, `BrandIcon`, `Button`, `Center`, `Form`, `Image`, `Line`, `Tab`, `TabsContainer`, `TextField`
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
'use client';
|
|
63
|
+
import { useEffect, useRef, useState } from 'react';
|
|
64
|
+
import Image from 'oneslash-design-system/components/image';
|
|
65
|
+
import TabsContainer from 'oneslash-design-system/components/tabsContainer';
|
|
66
|
+
import Tab from 'oneslash-design-system/components/tab';
|
|
67
|
+
import Form from 'oneslash-design-system/components/form';
|
|
68
|
+
import Alert from 'oneslash-design-system/components/alert';
|
|
69
|
+
import TextField from 'oneslash-design-system/components/textField';
|
|
70
|
+
import Button from 'oneslash-design-system/components/button';
|
|
71
|
+
import Line from 'oneslash-design-system/components/line';
|
|
72
|
+
import BrandIcon from 'oneslash-design-system/components/brandIcon';
|
|
73
|
+
import { Center } from 'oneslash-design-system/components/layout';
|
|
74
|
+
|
|
75
|
+
// The product's mark. A real app passes its own file.
|
|
76
|
+
const productMark =
|
|
77
|
+
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Crect width='40' height='40' rx='10' fill='%232f6b4f'/%3E%3Cpath d='M20 9 31 31h-6l-5-11-5 11H9z' fill='%23fff'/%3E%3C/svg%3E";
|
|
78
|
+
|
|
79
|
+
// A real app passes the router from its framework, such as Next's useRouter().
|
|
80
|
+
const router = { push: (url: string) => console.info(`Go to ${url}`) };
|
|
81
|
+
|
|
82
|
+
// A small check: some text, an @, then some text.
|
|
83
|
+
function looksLikeEmail(value: string) {
|
|
84
|
+
return /^[^@\s]+@[^@\s]+$/.test(value);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export default function EmailConfirmedAlertOnLogin() {
|
|
88
|
+
// Opens as the login page does when the link was opened in another browser.
|
|
89
|
+
const [notice, setNotice] = useState('Your email is confirmed. Log in to continue.');
|
|
90
|
+
// This browser does not know the address yet, so the field starts empty.
|
|
91
|
+
const [email, setEmail] = useState('');
|
|
92
|
+
const [password, setPassword] = useState('');
|
|
93
|
+
const [error, setError] = useState('');
|
|
94
|
+
const [emailError, setEmailError] = useState('');
|
|
95
|
+
const [passwordError, setPasswordError] = useState('');
|
|
96
|
+
const [loading, setLoading] = useState(false);
|
|
97
|
+
const timer = useRef<ReturnType<typeof setTimeout>>();
|
|
98
|
+
|
|
99
|
+
// Stops the request if the example goes away before it ends.
|
|
100
|
+
useEffect(() => () => clearTimeout(timer.current), []);
|
|
101
|
+
|
|
102
|
+
function handleSubmit() {
|
|
103
|
+
if (loading) return;
|
|
104
|
+
setNotice('');
|
|
105
|
+
setError('');
|
|
106
|
+
setEmailError('');
|
|
107
|
+
setPasswordError('');
|
|
108
|
+
if (!email.trim()) {
|
|
109
|
+
setEmailError('Enter your email.');
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
if (!looksLikeEmail(email.trim())) {
|
|
113
|
+
setEmailError('Enter an email address, like name@example.com.');
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (!password) {
|
|
117
|
+
setPasswordError('Enter your password.');
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
setLoading(true);
|
|
121
|
+
// Stands in for the request to the server.
|
|
122
|
+
timer.current = setTimeout(() => {
|
|
123
|
+
setLoading(false);
|
|
124
|
+
setError('That email and password do not match.');
|
|
125
|
+
}, 1200);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return (
|
|
129
|
+
<Center fill>
|
|
130
|
+
<Image src={productMark} alt="Acme" width={40} height={40} />
|
|
131
|
+
<TabsContainer fill>
|
|
132
|
+
<Tab label="Log In" isSelected onClickTab={() => {}} />
|
|
133
|
+
<Tab label="Sign Up" isSelected={false} href="/sign-up" router={router} onClickTab={() => {}} />
|
|
134
|
+
</TabsContainer>
|
|
135
|
+
<Form aria-label="Log in" onSubmit={handleSubmit}>
|
|
136
|
+
{/* It says what to do next, so it stays until the person submits the form: no close button, and it does not close on its own. */}
|
|
137
|
+
{notice && <Alert type="success" variant="inline" message={notice} autoDismiss={false} />}
|
|
138
|
+
{error && <Alert type="error" variant="inline" message={error} showCloseButton onClose={() => setError('')} />}
|
|
139
|
+
<TextField id="email-confirmed-login-email" label="Email" type="email" autoComplete="username" value={email} disabled={loading} error={Boolean(emailError)} errorText={emailError} onChange={(e) => { setEmail(e.target.value); setEmailError(''); }} />
|
|
140
|
+
<TextField id="email-confirmed-login-password" label="Password" type="password" autoComplete="current-password" value={password} disabled={loading} error={Boolean(passwordError)} errorText={passwordError} onChange={(e) => { setPassword(e.target.value); setPasswordError(''); }} />
|
|
141
|
+
<Button size="medium" type="primary" state="enabled" label="Log In" htmlType="submit" loading={loading} />
|
|
142
|
+
<Button size="medium" type="textOnly" state="enabled" label="Forgot Password?" />
|
|
143
|
+
</Form>
|
|
144
|
+
<Line label="or" />
|
|
145
|
+
<Button size="medium" type="secondary" state="enabled" label="Continue with Google" decoIcon={<BrandIcon name="google" />} />
|
|
146
|
+
</Center>
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Seen in: Commentify, Scindo.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function EmptyListRegion(): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import Surface from '../../components/surface';
|
|
3
|
+
import Heading from '../../components/heading';
|
|
4
|
+
import EmptyBox from '../../components/emptyBox';
|
|
5
|
+
import { Stack } from '../../components/layout';
|
|
6
|
+
export default function EmptyListRegion() {
|
|
7
|
+
return (<Stack gap="large">
|
|
8
|
+
<Heading level={2} size="h5">Archive</Heading>
|
|
9
|
+
<Surface minHeight="tall" align="center">
|
|
10
|
+
<EmptyBox size="large" text="No archived projects" secondText="Projects you archive appear here."/>
|
|
11
|
+
</Surface>
|
|
12
|
+
</Stack>);
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function EmptyListSection(): import("react").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import Surface from '../../components/surface';
|
|
3
|
+
import Heading from '../../components/heading';
|
|
4
|
+
import Paragraph from '../../components/paragraph';
|
|
5
|
+
import EmptyBox from '../../components/emptyBox';
|
|
6
|
+
import { Center, Stack } from '../../components/layout';
|
|
7
|
+
export default function EmptyListSection() {
|
|
8
|
+
return (<Center width="page">
|
|
9
|
+
<Surface padding="large">
|
|
10
|
+
<Stack gap="medium">
|
|
11
|
+
<Heading level={2} size="h6">Logged-in devices</Heading>
|
|
12
|
+
<Paragraph tone="secondary" size="body2" measure="none">Devices where you are logged in to Acme, other than this one.</Paragraph>
|
|
13
|
+
<EmptyBox size="small" text="No other devices" secondText="Devices you log in on appear here."/>
|
|
14
|
+
</Stack>
|
|
15
|
+
</Surface>
|
|
16
|
+
</Center>);
|
|
17
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Empty list
|
|
2
|
+
|
|
3
|
+
A list has loaded, and there is nothing in it yet.
|
|
4
|
+
|
|
5
|
+
**Not built yet:** Commentify writes most of its empty lists in Title Case, such as 'No Comments Available', and gives them no `secondText`.
|
|
6
|
+
|
|
7
|
+
## Do
|
|
8
|
+
|
|
9
|
+
- Use `size="large"` when the list is the whole pane, and `size="small"` inside a section.
|
|
10
|
+
- Say what is empty in the person's words: 'No archived projects'.
|
|
11
|
+
- Say in `secondText` what will appear here: 'Projects you archive appear here.'
|
|
12
|
+
|
|
13
|
+
## Don't
|
|
14
|
+
|
|
15
|
+
- Do not show a bare line of text, or nothing at all.
|
|
16
|
+
- Do not use the system's words, such as 'No data' or 'No items found'.
|
|
17
|
+
- Do not show the empty text while the list is still loading.
|
|
18
|
+
|
|
19
|
+
## Option: Whole pane
|
|
20
|
+
|
|
21
|
+
Use when: The list is the whole pane, such as a page of projects.
|
|
22
|
+
|
|
23
|
+
Uses: `EmptyBox`, `Heading`, `Stack`, `Surface`
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
'use client';
|
|
27
|
+
import Surface from 'oneslash-design-system/components/surface';
|
|
28
|
+
import Heading from 'oneslash-design-system/components/heading';
|
|
29
|
+
import EmptyBox from 'oneslash-design-system/components/emptyBox';
|
|
30
|
+
import { Stack } from 'oneslash-design-system/components/layout';
|
|
31
|
+
|
|
32
|
+
export default function EmptyListRegion() {
|
|
33
|
+
return (
|
|
34
|
+
<Stack gap="large">
|
|
35
|
+
<Heading level={2} size="h5">Archive</Heading>
|
|
36
|
+
<Surface minHeight="tall" align="center">
|
|
37
|
+
<EmptyBox size="large" text="No archived projects" secondText="Projects you archive appear here." />
|
|
38
|
+
</Surface>
|
|
39
|
+
</Stack>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Option: Inside a section
|
|
45
|
+
|
|
46
|
+
Use when: The list sits inside a settings section or a card, next to other things.
|
|
47
|
+
|
|
48
|
+
Uses: `Center`, `EmptyBox`, `Heading`, `Paragraph`, `Stack`, `Surface`
|
|
49
|
+
|
|
50
|
+
```tsx
|
|
51
|
+
'use client';
|
|
52
|
+
import Surface from 'oneslash-design-system/components/surface';
|
|
53
|
+
import Heading from 'oneslash-design-system/components/heading';
|
|
54
|
+
import Paragraph from 'oneslash-design-system/components/paragraph';
|
|
55
|
+
import EmptyBox from 'oneslash-design-system/components/emptyBox';
|
|
56
|
+
import { Center, Stack } from 'oneslash-design-system/components/layout';
|
|
57
|
+
|
|
58
|
+
export default function EmptyListSection() {
|
|
59
|
+
return (
|
|
60
|
+
<Center width="page">
|
|
61
|
+
<Surface padding="large">
|
|
62
|
+
<Stack gap="medium">
|
|
63
|
+
<Heading level={2} size="h6">Logged-in devices</Heading>
|
|
64
|
+
<Paragraph tone="secondary" size="body2" measure="none">Devices where you are logged in to Acme, other than this one.</Paragraph>
|
|
65
|
+
<EmptyBox size="small" text="No other devices" secondText="Devices you log in on appear here." />
|
|
66
|
+
</Stack>
|
|
67
|
+
</Surface>
|
|
68
|
+
</Center>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Native
|
|
74
|
+
|
|
75
|
+
On Apple use `ContentUnavailableView`, with the same words.
|
|
76
|
+
|
|
77
|
+
Seen in: Commentify, Scindo.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# An empty list says what will fill it
|
|
2
|
+
|
|
3
|
+
A list, table or pane has nothing to show.
|
|
4
|
+
|
|
5
|
+
## Answer
|
|
6
|
+
|
|
7
|
+
Use `EmptyBox`, never a bare line of text. Its `size` is `large` when the list fills the whole region and `small` inside a section. The `text` says what is empty, in the person's words and in sentence case: 'No saved comments'. The `secondText` says what will appear here or what to do. When the person can fix it, pass the Button as `action`. The action Button is primary when it fills the list or tries again, and secondary when it is 'Clear Search'. An empty search shows the words searched for and a 'Clear Search' Button. A failed load is not an empty list: say that loading failed and offer a 'Try Again' Button. `EmptyBox` may hold that message, with 'Try Again' as its `action`, but never the empty text.
|
|
8
|
+
|
|
9
|
+
**Not built yet:** Scindo on the web uses `EmptyBox` in three places and bare text elsewhere, such as 'No API keys yet.' Commentify uses `EmptyBox` in most lists and bare text in a few. Commentify admin and jinhwankim.com show bare text. No product passes an `action` yet.
|
|
10
|
+
|
|
11
|
+
## Why
|
|
12
|
+
|
|
13
|
+
An empty space looks like something is broken. Saying what is missing and what will fill it tells the person nothing is wrong and what to do next.
|
|
14
|
+
|
|
15
|
+
## Do
|
|
16
|
+
|
|
17
|
+
- Say what is empty in the person's words: 'No saved comments'.
|
|
18
|
+
- Say in `secondText` what will appear here or what to do: 'Comments you save appear here.'
|
|
19
|
+
- Pass the Button that fills the list as `action`, such as 'Create Project'.
|
|
20
|
+
- Make the action Button primary when it fills the list or tries again, and secondary for 'Clear Search'.
|
|
21
|
+
- Show the words searched for and a 'Clear Search' Button when a search finds nothing.
|
|
22
|
+
- Say that loading failed and offer a 'Try Again' Button when the list could not load.
|
|
23
|
+
|
|
24
|
+
## Don't
|
|
25
|
+
|
|
26
|
+
- Do not show a bare line of text, or nothing at all, when a list is empty.
|
|
27
|
+
- Do not show the empty text when the list failed to load.
|
|
28
|
+
- Do not use the system's words, such as 'No data' or 'No records found'.
|
|
29
|
+
- Do not pass an `action` the person is not allowed to use.
|
|
30
|
+
|
|
31
|
+
## Native
|
|
32
|
+
|
|
33
|
+
On Apple use `ContentUnavailableView`, with the same words.
|
|
34
|
+
|
|
35
|
+
Seen in: Commentify, Commentify admin, Scindo, jinhwankim.com.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function EmptyNotSetUpAction(): import("react").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import Surface from '../../components/surface';
|
|
3
|
+
import Heading from '../../components/heading';
|
|
4
|
+
import EmptyBox from '../../components/emptyBox';
|
|
5
|
+
import Button from '../../components/button';
|
|
6
|
+
import { Stack } from '../../components/layout';
|
|
7
|
+
// A real app passes the router from its framework, such as Next's useRouter().
|
|
8
|
+
var router = { push: function (url) { return console.info("Go to ".concat(url)); } };
|
|
9
|
+
export default function EmptyNotSetUpAction() {
|
|
10
|
+
return (<Stack gap="large">
|
|
11
|
+
<Heading level={2} size="h5">Calendar</Heading>
|
|
12
|
+
<Surface minHeight="tall" align="center">
|
|
13
|
+
<EmptyBox size="large" icon="CalendarOff" text="No calendar connected" secondText="Connect a calendar to see your meetings next to your tasks." action={<Button size="medium" type="primary" state="enabled" label="Connect Calendar" onClickButton={function () { return router.push('/settings/calendar'); }}/>}/>
|
|
14
|
+
</Surface>
|
|
15
|
+
</Stack>);
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function EmptyNotSetUpPointer(): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import Surface from '../../components/surface';
|
|
3
|
+
import Heading from '../../components/heading';
|
|
4
|
+
import EmptyBox from '../../components/emptyBox';
|
|
5
|
+
import { Stack } from '../../components/layout';
|
|
6
|
+
export default function EmptyNotSetUpPointer() {
|
|
7
|
+
return (<Stack gap="large">
|
|
8
|
+
<Heading level={2} size="h5">Calendar</Heading>
|
|
9
|
+
<Surface minHeight="tall" align="center">
|
|
10
|
+
<EmptyBox size="large" icon="CalendarOff" text="No calendar connected" secondText="An admin can connect one in Settings, under Integrations."/>
|
|
11
|
+
</Surface>
|
|
12
|
+
</Stack>);
|
|
13
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Empty until set up
|
|
2
|
+
|
|
3
|
+
A pane is empty because something it needs is not set up yet, such as a connected account.
|
|
4
|
+
|
|
5
|
+
**Not built yet:** Commentify puts its 'Open Settings' Button under `EmptyBox`, not in its `action`, and writes the text in Title Case: 'No App, Team, or User Connected'.
|
|
6
|
+
|
|
7
|
+
## Do
|
|
8
|
+
|
|
9
|
+
- Say what is missing: 'No calendar connected'.
|
|
10
|
+
- Pass one Button as `action`, named for what it sets up: 'Connect Calendar'.
|
|
11
|
+
- Say where the fix lives when it is not here: 'An admin can connect one in Settings, under Integrations.'
|
|
12
|
+
|
|
13
|
+
## Don't
|
|
14
|
+
|
|
15
|
+
- Do not put the Button outside `EmptyBox`. Pass it as `action`.
|
|
16
|
+
- Do not offer a Button the person is not allowed to use.
|
|
17
|
+
- Do not offer more than one Button.
|
|
18
|
+
|
|
19
|
+
## Option: Fix it here
|
|
20
|
+
|
|
21
|
+
Use when: The person can fix it here, with one Button.
|
|
22
|
+
|
|
23
|
+
Uses: `Button`, `EmptyBox`, `Heading`, `Stack`, `Surface`
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
'use client';
|
|
27
|
+
import Surface from 'oneslash-design-system/components/surface';
|
|
28
|
+
import Heading from 'oneslash-design-system/components/heading';
|
|
29
|
+
import EmptyBox from 'oneslash-design-system/components/emptyBox';
|
|
30
|
+
import Button from 'oneslash-design-system/components/button';
|
|
31
|
+
import { Stack } from 'oneslash-design-system/components/layout';
|
|
32
|
+
|
|
33
|
+
// A real app passes the router from its framework, such as Next's useRouter().
|
|
34
|
+
const router = { push: (url: string) => console.info(`Go to ${url}`) };
|
|
35
|
+
|
|
36
|
+
export default function EmptyNotSetUpAction() {
|
|
37
|
+
return (
|
|
38
|
+
<Stack gap="large">
|
|
39
|
+
<Heading level={2} size="h5">Calendar</Heading>
|
|
40
|
+
<Surface minHeight="tall" align="center">
|
|
41
|
+
<EmptyBox
|
|
42
|
+
size="large"
|
|
43
|
+
icon="CalendarOff"
|
|
44
|
+
text="No calendar connected"
|
|
45
|
+
secondText="Connect a calendar to see your meetings next to your tasks."
|
|
46
|
+
action={<Button size="medium" type="primary" state="enabled" label="Connect Calendar" onClickButton={() => router.push('/settings/calendar')} />}
|
|
47
|
+
/>
|
|
48
|
+
</Surface>
|
|
49
|
+
</Stack>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Option: Say where to fix it
|
|
55
|
+
|
|
56
|
+
Use when: The fix lives somewhere else, or someone else has to do it. Say where in `secondText`.
|
|
57
|
+
|
|
58
|
+
Uses: `EmptyBox`, `Heading`, `Stack`, `Surface`
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
'use client';
|
|
62
|
+
import Surface from 'oneslash-design-system/components/surface';
|
|
63
|
+
import Heading from 'oneslash-design-system/components/heading';
|
|
64
|
+
import EmptyBox from 'oneslash-design-system/components/emptyBox';
|
|
65
|
+
import { Stack } from 'oneslash-design-system/components/layout';
|
|
66
|
+
|
|
67
|
+
export default function EmptyNotSetUpPointer() {
|
|
68
|
+
return (
|
|
69
|
+
<Stack gap="large">
|
|
70
|
+
<Heading level={2} size="h5">Calendar</Heading>
|
|
71
|
+
<Surface minHeight="tall" align="center">
|
|
72
|
+
<EmptyBox
|
|
73
|
+
size="large"
|
|
74
|
+
icon="CalendarOff"
|
|
75
|
+
text="No calendar connected"
|
|
76
|
+
secondText="An admin can connect one in Settings, under Integrations."
|
|
77
|
+
/>
|
|
78
|
+
</Surface>
|
|
79
|
+
</Stack>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Native
|
|
85
|
+
|
|
86
|
+
On Apple use `ContentUnavailableView`, with the Button in its `actions`.
|
|
87
|
+
|
|
88
|
+
Seen in: Commentify, Scindo.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function EmptySearchClearSearch(): import("react").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import Surface from '../../components/surface';
|
|
4
|
+
import TextField from '../../components/textField';
|
|
5
|
+
import EmptyBox from '../../components/emptyBox';
|
|
6
|
+
import List from '../../components/list';
|
|
7
|
+
import Button from '../../components/button';
|
|
8
|
+
import { Stack } from '../../components/layout';
|
|
9
|
+
var projects = ['Website refresh', 'Hiring plan', 'Q4 budget', 'Office move'];
|
|
10
|
+
export default function EmptySearchClearSearch() {
|
|
11
|
+
var _a = useState('q3 plan'), query = _a[0], setQuery = _a[1];
|
|
12
|
+
// Bumped by 'Clear Search'. It remounts the search field with `autoFocus`, so focus goes
|
|
13
|
+
// back to the field instead of being lost with the Button that the list replaces.
|
|
14
|
+
var _b = useState(0), searchKey = _b[0], setSearchKey = _b[1];
|
|
15
|
+
var words = query.trim();
|
|
16
|
+
var found = projects.filter(function (name) { return name.toLowerCase().includes(words.toLowerCase()); });
|
|
17
|
+
function clearSearch() {
|
|
18
|
+
setQuery('');
|
|
19
|
+
setSearchKey(function (k) { return k + 1; });
|
|
20
|
+
}
|
|
21
|
+
return (<Stack gap="large">
|
|
22
|
+
<TextField key={searchKey} autoFocus={searchKey > 0} id="empty-search-query" label="Search projects" type="search" value={query} onChange={function (e) { return setQuery(e.target.value); }}/>
|
|
23
|
+
{found.length > 0 ? (<Surface minHeight="tall">
|
|
24
|
+
<List items={found} size="body1"/>
|
|
25
|
+
</Surface>) : (<Surface minHeight="tall" align="center">
|
|
26
|
+
<EmptyBox size="large" icon="Search" text={"No projects match \"".concat(words, "\"")} secondText="Check the spelling, or search for fewer words." action={<Button size="medium" type="secondary" state="enabled" label="Clear Search" onClickButton={clearSearch}/>}/>
|
|
27
|
+
</Surface>)}
|
|
28
|
+
</Stack>);
|
|
29
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Empty search
|
|
2
|
+
|
|
3
|
+
A search or a filter finds nothing.
|
|
4
|
+
|
|
5
|
+
**Not built yet:** Scindo on the web shows a bare line, 'No results found', with no words and no way to clear them. Scindo on Apple shows 'No results found' in a `ContentUnavailableView`, without the words. Commentify shows the words in an `EmptyBox`, with no Clear Search Button.
|
|
6
|
+
|
|
7
|
+
## Do
|
|
8
|
+
|
|
9
|
+
- Use `icon="Search"`, so it reads as a search and not an empty list.
|
|
10
|
+
- Show the words searched for, as `No <things> match "<words>"`: 'No projects match "q3 plan"'.
|
|
11
|
+
- Pass a 'Clear Search' Button as `action`. It empties the field and shows the whole list again.
|
|
12
|
+
- Put focus back in the search field after 'Clear Search'.
|
|
13
|
+
- Keep the words in the search field.
|
|
14
|
+
|
|
15
|
+
## Don't
|
|
16
|
+
|
|
17
|
+
- Do not say 'No results found' without the words searched for.
|
|
18
|
+
- Do not show the list's own empty text, such as 'No projects yet'.
|
|
19
|
+
- Do not clear the search field unless the person asks.
|
|
20
|
+
|
|
21
|
+
## Example: The words and a way to clear them
|
|
22
|
+
|
|
23
|
+
Uses: `Button`, `EmptyBox`, `List`, `Stack`, `Surface`, `TextField`
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
'use client';
|
|
27
|
+
import { useState } from 'react';
|
|
28
|
+
import Surface from 'oneslash-design-system/components/surface';
|
|
29
|
+
import TextField from 'oneslash-design-system/components/textField';
|
|
30
|
+
import EmptyBox from 'oneslash-design-system/components/emptyBox';
|
|
31
|
+
import List from 'oneslash-design-system/components/list';
|
|
32
|
+
import Button from 'oneslash-design-system/components/button';
|
|
33
|
+
import { Stack } from 'oneslash-design-system/components/layout';
|
|
34
|
+
|
|
35
|
+
const projects = ['Website refresh', 'Hiring plan', 'Q4 budget', 'Office move'];
|
|
36
|
+
|
|
37
|
+
export default function EmptySearchClearSearch() {
|
|
38
|
+
const [query, setQuery] = useState('q3 plan');
|
|
39
|
+
// Bumped by 'Clear Search'. It remounts the search field with `autoFocus`, so focus goes
|
|
40
|
+
// back to the field instead of being lost with the Button that the list replaces.
|
|
41
|
+
const [searchKey, setSearchKey] = useState(0);
|
|
42
|
+
const words = query.trim();
|
|
43
|
+
const found = projects.filter((name) => name.toLowerCase().includes(words.toLowerCase()));
|
|
44
|
+
|
|
45
|
+
function clearSearch() {
|
|
46
|
+
setQuery('');
|
|
47
|
+
setSearchKey((k) => k + 1);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<Stack gap="large">
|
|
52
|
+
<TextField key={searchKey} autoFocus={searchKey > 0} id="empty-search-query" label="Search projects" type="search" value={query} onChange={(e) => setQuery(e.target.value)} />
|
|
53
|
+
{found.length > 0 ? (
|
|
54
|
+
<Surface minHeight="tall">
|
|
55
|
+
<List items={found} size="body1" />
|
|
56
|
+
</Surface>
|
|
57
|
+
) : (
|
|
58
|
+
<Surface minHeight="tall" align="center">
|
|
59
|
+
<EmptyBox
|
|
60
|
+
size="large"
|
|
61
|
+
icon="Search"
|
|
62
|
+
text={`No projects match "${words}"`}
|
|
63
|
+
secondText="Check the spelling, or search for fewer words."
|
|
64
|
+
action={<Button size="medium" type="secondary" state="enabled" label="Clear Search" onClickButton={clearSearch} />}
|
|
65
|
+
/>
|
|
66
|
+
</Surface>
|
|
67
|
+
)}
|
|
68
|
+
</Stack>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Native
|
|
74
|
+
|
|
75
|
+
On Apple use `ContentUnavailableView.search(text:)`.
|
|
76
|
+
|
|
77
|
+
Seen in: Commentify, Scindo.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function ErrorPageFullPage(): import("react").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import Heading from '../../components/heading';
|
|
3
|
+
import Paragraph from '../../components/paragraph';
|
|
4
|
+
import Button from '../../components/button';
|
|
5
|
+
import { Center, Cluster, Stack } from '../../components/layout';
|
|
6
|
+
// A real app passes the reset() its framework gives the error page, such as Next's error.tsx.
|
|
7
|
+
var reset = function () { return console.info('Render the page again'); };
|
|
8
|
+
export default function ErrorPageFullPage() {
|
|
9
|
+
return (<Center fill>
|
|
10
|
+
<Stack gap="medium">
|
|
11
|
+
<Heading level={1} size="h5">Something went wrong</Heading>
|
|
12
|
+
<Paragraph tone="secondary" measure="none">Acme could not load. Try again, or go back to the home page.</Paragraph>
|
|
13
|
+
</Stack>
|
|
14
|
+
<Cluster>
|
|
15
|
+
<Button size="medium" type="primary" state="enabled" label="Try Again" onClickButton={reset}/>
|
|
16
|
+
<Button size="medium" type="secondary" state="enabled" label="Go Home" href="/"/>
|
|
17
|
+
</Cluster>
|
|
18
|
+
</Center>);
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function ErrorPageInShell(): import("react").JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import Image from '../../components/image';
|
|
3
|
+
import TabsContainer from '../../components/tabsContainer';
|
|
4
|
+
import Tab from '../../components/tab';
|
|
5
|
+
import Surface from '../../components/surface';
|
|
6
|
+
import Heading from '../../components/heading';
|
|
7
|
+
import Paragraph from '../../components/paragraph';
|
|
8
|
+
import Button from '../../components/button';
|
|
9
|
+
import { Cluster, Stack } from '../../components/layout';
|
|
10
|
+
// The product's mark. A real app passes its own file.
|
|
11
|
+
var productMark = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Crect width='40' height='40' rx='10' fill='%232f6b4f'/%3E%3Cpath d='M20 9 31 31h-6l-5-11-5 11H9z' fill='%23fff'/%3E%3C/svg%3E";
|
|
12
|
+
// A real app passes the router from its framework, such as Next's useRouter().
|
|
13
|
+
var router = { push: function (url) { return console.info("Go to ".concat(url)); } };
|
|
14
|
+
// A real app passes the reset() its framework gives the error page, such as Next's error.tsx.
|
|
15
|
+
var reset = function () { return console.info('Render the page again'); };
|
|
16
|
+
export default function ErrorPageInShell() {
|
|
17
|
+
return (<Stack gap="large">
|
|
18
|
+
<Cluster gap="large">
|
|
19
|
+
<Image src={productMark} alt="Acme" width={32} height={32}/>
|
|
20
|
+
<TabsContainer>
|
|
21
|
+
<Tab label="Home" isSelected={false} href="/" router={router} onClickTab={function () { }}/>
|
|
22
|
+
<Tab label="Projects" isSelected href="/projects" router={router} onClickTab={function () { }}/>
|
|
23
|
+
<Tab label="Settings" isSelected={false} href="/settings" router={router} onClickTab={function () { }}/>
|
|
24
|
+
</TabsContainer>
|
|
25
|
+
</Cluster>
|
|
26
|
+
<Surface minHeight="tall" align="center">
|
|
27
|
+
<Stack gap="xlarge">
|
|
28
|
+
<Stack gap="medium">
|
|
29
|
+
<Heading level={1} size="h5">Something went wrong</Heading>
|
|
30
|
+
<Paragraph tone="secondary" measure="none">This page could not load. Try again, or go back to the home page.</Paragraph>
|
|
31
|
+
</Stack>
|
|
32
|
+
<Cluster>
|
|
33
|
+
<Button size="medium" type="primary" state="enabled" label="Try Again" onClickButton={reset}/>
|
|
34
|
+
<Button size="medium" type="secondary" state="enabled" label="Go Home" href="/"/>
|
|
35
|
+
</Cluster>
|
|
36
|
+
</Stack>
|
|
37
|
+
</Surface>
|
|
38
|
+
</Stack>);
|
|
39
|
+
}
|