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,10 @@
|
|
|
1
|
+
import Heading from "../components/heading";
|
|
2
|
+
var meta = {
|
|
3
|
+
title: "Components/Heading",
|
|
4
|
+
component: Heading,
|
|
5
|
+
};
|
|
6
|
+
export default meta;
|
|
7
|
+
// `level` is the element in the page's outline; `size` is how large it looks
|
|
8
|
+
export var Level1 = {
|
|
9
|
+
args: { level: 1, size: "h4", children: "Account settings" },
|
|
10
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Image from "../components/image";
|
|
3
|
+
declare const meta: Meta<typeof Image>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Image>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Decoration: Story;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Image from "../components/image";
|
|
2
|
+
var meta = {
|
|
3
|
+
title: "Components/Image",
|
|
4
|
+
component: Image,
|
|
5
|
+
argTypes: {
|
|
6
|
+
fit: { control: "select", options: [undefined, "cover", "contain"] },
|
|
7
|
+
loading: { control: "select", options: [undefined, "lazy", "eager"] },
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
var src = "data:image/svg+xml;utf8," +
|
|
12
|
+
encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="320" height="180"><rect width="320" height="180" fill="#888"/></svg>');
|
|
13
|
+
export var Default = {
|
|
14
|
+
args: { src: src, alt: "A grey rectangle", width: 320, height: 180 },
|
|
15
|
+
};
|
|
16
|
+
export var Decoration = {
|
|
17
|
+
args: { src: src, alt: "", width: 160, height: 90, fit: "cover" },
|
|
18
|
+
};
|
|
@@ -4,6 +4,7 @@ declare const meta: Meta<typeof Line>;
|
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof Line>;
|
|
6
6
|
export declare const Horizontal: Story;
|
|
7
|
+
export declare const WithLabel: Story;
|
|
7
8
|
export declare const Vertical: Story;
|
|
8
9
|
export declare const InFlexContainer: Story;
|
|
9
10
|
export declare const BetweenSections: Story;
|
|
@@ -4,6 +4,7 @@ var meta = {
|
|
|
4
4
|
title: "Components/Line",
|
|
5
5
|
component: Line,
|
|
6
6
|
argTypes: {
|
|
7
|
+
label: { control: "text" },
|
|
7
8
|
direction: {
|
|
8
9
|
control: "select",
|
|
9
10
|
options: ["horizontal", "vertical"],
|
|
@@ -23,6 +24,17 @@ export var Horizontal = {
|
|
|
23
24
|
</div>); },
|
|
24
25
|
],
|
|
25
26
|
};
|
|
27
|
+
export var WithLabel = {
|
|
28
|
+
args: {
|
|
29
|
+
direction: "horizontal",
|
|
30
|
+
label: "or",
|
|
31
|
+
},
|
|
32
|
+
decorators: [
|
|
33
|
+
function (Story) { return (<div style={{ width: "100%", padding: "16px" }}>
|
|
34
|
+
<Story />
|
|
35
|
+
</div>); },
|
|
36
|
+
],
|
|
37
|
+
};
|
|
26
38
|
export var Vertical = {
|
|
27
39
|
args: {
|
|
28
40
|
direction: "vertical",
|
|
@@ -4,6 +4,7 @@ declare const meta: Meta<typeof LoadingScreen>;
|
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof LoadingScreen>;
|
|
6
6
|
export declare const Default: Story;
|
|
7
|
+
export declare const WithLabel: Story;
|
|
7
8
|
export declare const Small: StoryObj<typeof LoadingSmall>;
|
|
8
9
|
export declare const Medium: StoryObj<typeof LoadingSmall>;
|
|
9
10
|
export declare const Large: StoryObj<typeof LoadingSmall>;
|
|
@@ -12,6 +12,14 @@ export var Default = {
|
|
|
12
12
|
</div>); },
|
|
13
13
|
],
|
|
14
14
|
};
|
|
15
|
+
export var WithLabel = {
|
|
16
|
+
args: { label: "Checking invite…" },
|
|
17
|
+
decorators: [
|
|
18
|
+
function (Story) { return (<div style={{ height: "300px" }}>
|
|
19
|
+
<Story />
|
|
20
|
+
</div>); },
|
|
21
|
+
],
|
|
22
|
+
};
|
|
15
23
|
export var Small = {
|
|
16
24
|
render: function () { return <LoadingSmall size="small"/>; },
|
|
17
25
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
2
|
import Modal from "../components/modal";
|
|
3
3
|
import Button from "../components/button";
|
|
4
|
+
import Select from "../components/select";
|
|
5
|
+
import TextField from "../components/textField";
|
|
4
6
|
var meta = {
|
|
5
7
|
title: "Components/Modal",
|
|
6
8
|
component: Modal,
|
|
@@ -75,3 +77,37 @@ export var LongContent = {
|
|
|
75
77
|
size: "medium",
|
|
76
78
|
},
|
|
77
79
|
};
|
|
80
|
+
// Open on first render: with initialFocus="body" the cursor starts in the field, not on Cancel.
|
|
81
|
+
var FocusInBodyModal = function (args) {
|
|
82
|
+
var _a = useState(""), name = _a[0], setName = _a[1];
|
|
83
|
+
return (<Modal {...args} isOpen onClose={function () { }}>
|
|
84
|
+
<TextField id="focus-in-body-name" label="Project name" value={name} onChange={function (e) { return setName(e.target.value); }}/>
|
|
85
|
+
</Modal>);
|
|
86
|
+
};
|
|
87
|
+
export var FocusInBody = {
|
|
88
|
+
render: function (args) { return <FocusInBodyModal {...args}/>; },
|
|
89
|
+
args: {
|
|
90
|
+
title: "New Project",
|
|
91
|
+
size: "small",
|
|
92
|
+
initialFocus: "body",
|
|
93
|
+
actions: (<div style={{ display: "flex", gap: "8px" }}>
|
|
94
|
+
<Button size="medium" type="tertiary" state="enabled" label="Cancel"/>
|
|
95
|
+
<Button size="medium" type="primary" state="enabled" label="Create"/>
|
|
96
|
+
</div>),
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
// Open on first render with the list closed; Escape closes an open list first, then the Modal.
|
|
100
|
+
var WithSelectModal = function (args) {
|
|
101
|
+
var _a = useState(true), isOpen = _a[0], setIsOpen = _a[1];
|
|
102
|
+
var _b = useState(""), category = _b[0], setCategory = _b[1];
|
|
103
|
+
return (<Modal {...args} isOpen={isOpen} onClose={function () { return setIsOpen(false); }}>
|
|
104
|
+
<Select aria-label="Category" placeholder="Select a category" value={category} onChange={function (v) { return setCategory(v); }} options={[
|
|
105
|
+
{ value: "work", label: "Work" },
|
|
106
|
+
{ value: "personal", label: "Personal" },
|
|
107
|
+
]}/>
|
|
108
|
+
</Modal>);
|
|
109
|
+
};
|
|
110
|
+
export var WithSelect = {
|
|
111
|
+
render: function (args) { return <WithSelectModal {...args}/>; },
|
|
112
|
+
args: { title: "Move Project", size: "small" },
|
|
113
|
+
};
|
|
@@ -9,7 +9,7 @@ import FactsRow from "../components/factsRow";
|
|
|
9
9
|
import LinkCard from "../components/linkCard";
|
|
10
10
|
import Figure from "../components/figure";
|
|
11
11
|
import Tag from "../components/tag";
|
|
12
|
-
import { Cluster, Grid, PageSection, Stack } from "../components/layout";
|
|
12
|
+
import { Center, Cluster, Grid, PageSection, Split, Stack } from "../components/layout";
|
|
13
13
|
var meta = {
|
|
14
14
|
title: "Pages/Page components",
|
|
15
15
|
};
|
|
@@ -74,3 +74,17 @@ export var FactsAndFigures = {
|
|
|
74
74
|
</Grid>
|
|
75
75
|
</Stack>); },
|
|
76
76
|
};
|
|
77
|
+
export var CenteredColumn = {
|
|
78
|
+
render: function () { return (<Center>
|
|
79
|
+
<SectionIntro name="Sign in"/>
|
|
80
|
+
<Paragraph tone="secondary">A narrow column in the middle of the page.</Paragraph>
|
|
81
|
+
</Center>); },
|
|
82
|
+
};
|
|
83
|
+
export var TwoHalves = {
|
|
84
|
+
render: function () { return (<Split aside={<Paragraph>The aside shows from the medium breakpoint up.</Paragraph>}>
|
|
85
|
+
<Center fill>
|
|
86
|
+
<SectionIntro name="Sign in"/>
|
|
87
|
+
<Paragraph tone="secondary">The other half holds the page.</Paragraph>
|
|
88
|
+
</Center>
|
|
89
|
+
</Split>); },
|
|
90
|
+
};
|
|
@@ -51,3 +51,17 @@ export var PaymentOptions = {
|
|
|
51
51
|
direction: "vertical",
|
|
52
52
|
},
|
|
53
53
|
};
|
|
54
|
+
// A group with no visible heading still needs a name for a screen reader.
|
|
55
|
+
export var Labelled = {
|
|
56
|
+
render: function (args) { return <RadioGroupWrapper {...args}/>; },
|
|
57
|
+
args: {
|
|
58
|
+
"aria-label": "Category",
|
|
59
|
+
options: [
|
|
60
|
+
{ label: "Work", value: "work" },
|
|
61
|
+
{ label: "Personal", value: "personal" },
|
|
62
|
+
{ label: "Other", value: "other" },
|
|
63
|
+
],
|
|
64
|
+
selectedValue: "work",
|
|
65
|
+
direction: "vertical",
|
|
66
|
+
},
|
|
67
|
+
};
|
|
@@ -142,3 +142,17 @@ export var InsideClippingContainer = {
|
|
|
142
142
|
],
|
|
143
143
|
},
|
|
144
144
|
};
|
|
145
|
+
// A Select with no visible label still needs a name for a screen reader.
|
|
146
|
+
export var Labelled = {
|
|
147
|
+
render: function (args) { return <SelectWrapper {...args}/>; },
|
|
148
|
+
args: {
|
|
149
|
+
"aria-label": "Category",
|
|
150
|
+
placeholder: "Select a category",
|
|
151
|
+
options: [
|
|
152
|
+
{ value: "work", label: "Work" },
|
|
153
|
+
{ value: "personal", label: "Personal" },
|
|
154
|
+
{ value: "other", label: "Other" },
|
|
155
|
+
],
|
|
156
|
+
width: 200,
|
|
157
|
+
},
|
|
158
|
+
};
|
|
@@ -13,6 +13,12 @@ var TabsWrapper = function (_a) {
|
|
|
13
13
|
{tabs.map(function (tab, index) { return (<Tab key={tab} label={tab} size={size} isSelected={selected === index} onClickTab={function () { return setSelected(index); }}/>); })}
|
|
14
14
|
</TabsContainer>);
|
|
15
15
|
};
|
|
16
|
+
var TabsFillWrapper = function () {
|
|
17
|
+
var _a = useState(0), selected = _a[0], setSelected = _a[1];
|
|
18
|
+
return (<TabsContainer fill>
|
|
19
|
+
{["Log In", "Sign Up"].map(function (tab, index) { return (<Tab key={tab} label={tab} isSelected={selected === index} onClickTab={function () { return setSelected(index); }}/>); })}
|
|
20
|
+
</TabsContainer>);
|
|
21
|
+
};
|
|
16
22
|
export var Default = {
|
|
17
23
|
render: function () { return <TabsWrapper tabs={["Tab 1", "Tab 2", "Tab 3"]}/>; },
|
|
18
24
|
};
|
|
@@ -62,3 +68,9 @@ export var Overflowing = {
|
|
|
62
68
|
<TabsWrapper tabs={["Overview", "Analytics", "Reports", "Settings", "Users", "Billing"]}/>
|
|
63
69
|
</div>); },
|
|
64
70
|
};
|
|
71
|
+
// `fill`: as wide as the parent, every tab an equal share
|
|
72
|
+
export var Fill = {
|
|
73
|
+
render: function () { return (<div style={{ width: 360 }}>
|
|
74
|
+
<TabsFillWrapper />
|
|
75
|
+
</div>); },
|
|
76
|
+
};
|
|
@@ -7,6 +7,7 @@ export declare const Default: Story;
|
|
|
7
7
|
export declare const WithValue: Story;
|
|
8
8
|
export declare const Disabled: Story;
|
|
9
9
|
export declare const WithError: Story;
|
|
10
|
+
export declare const HelperText: Story;
|
|
10
11
|
export declare const LargeSize: Story;
|
|
11
12
|
export declare const SmallSize: Story;
|
|
12
13
|
export declare const Multiline: Story;
|
|
@@ -17,3 +18,4 @@ export declare const Required: Story;
|
|
|
17
18
|
export declare const Number: Story;
|
|
18
19
|
export declare const Autofill: Story;
|
|
19
20
|
export declare const LengthLimits: Story;
|
|
21
|
+
export declare const ReadOnly: Story;
|
|
@@ -63,6 +63,17 @@ export var WithError = {
|
|
|
63
63
|
size: "medium",
|
|
64
64
|
},
|
|
65
65
|
};
|
|
66
|
+
export var HelperText = {
|
|
67
|
+
render: function (args) { return <TextFieldWrapper {...args}/>; },
|
|
68
|
+
args: {
|
|
69
|
+
id: "helper-textfield",
|
|
70
|
+
label: "Password",
|
|
71
|
+
type: "password",
|
|
72
|
+
value: "",
|
|
73
|
+
helperText: "Use at least 8 characters.",
|
|
74
|
+
size: "medium",
|
|
75
|
+
},
|
|
76
|
+
};
|
|
66
77
|
export var LargeSize = {
|
|
67
78
|
render: function (args) { return <TextFieldWrapper {...args}/>; },
|
|
68
79
|
args: {
|
|
@@ -169,3 +180,14 @@ export var LengthLimits = {
|
|
|
169
180
|
size: "medium",
|
|
170
181
|
},
|
|
171
182
|
};
|
|
183
|
+
// `readOnly` keeps the normal colors; the text can be focused and selected but not changed
|
|
184
|
+
export var ReadOnly = {
|
|
185
|
+
render: function (args) { return <TextFieldWrapper {...args}/>; },
|
|
186
|
+
args: {
|
|
187
|
+
id: "readonly-textfield",
|
|
188
|
+
label: "Invite link",
|
|
189
|
+
value: "https://acme.example.com/invite/4f9k2",
|
|
190
|
+
readOnly: true,
|
|
191
|
+
size: "medium",
|
|
192
|
+
},
|
|
193
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from "react";
|
|
2
|
+
import Toaster, { toast, dismissToast } from "../components/toaster";
|
|
3
|
+
import Button from "../components/button";
|
|
4
|
+
var meta = {
|
|
5
|
+
title: "Components/Toaster",
|
|
6
|
+
component: Toaster,
|
|
7
|
+
};
|
|
8
|
+
export default meta;
|
|
9
|
+
// Opens three toasts on first render and closes every toast it opened when the story unmounts
|
|
10
|
+
var StackDemo = function () {
|
|
11
|
+
var ids = useRef([]);
|
|
12
|
+
var show = function (input) { return ids.current.push(toast(input)); };
|
|
13
|
+
useEffect(function () {
|
|
14
|
+
show({ type: "success", message: "Q3 plan deleted" });
|
|
15
|
+
show({ type: "info", message: "Sync runs every hour", secondMessage: "The next one starts at 1:00 PM." });
|
|
16
|
+
show({ type: "error", message: "Could not upload photo.jpg" });
|
|
17
|
+
return function () {
|
|
18
|
+
ids.current.forEach(dismissToast);
|
|
19
|
+
ids.current = [];
|
|
20
|
+
};
|
|
21
|
+
}, []);
|
|
22
|
+
return (<div>
|
|
23
|
+
<Button size="medium" type="primary" state="enabled" label="Show a toast" onClickButton={function () { return show({ type: "success", message: "Invite sent" }); }}/>
|
|
24
|
+
<Toaster />
|
|
25
|
+
</div>);
|
|
26
|
+
};
|
|
27
|
+
export var Stack = {
|
|
28
|
+
render: function () { return <StackDemo />; },
|
|
29
|
+
};
|
|
@@ -290,7 +290,8 @@ module.exports = {
|
|
|
290
290
|
"measure-body": "var(--os-measure-body)",
|
|
291
291
|
"measure-wide": "var(--os-measure-wide)",
|
|
292
292
|
"page": "var(--os-container-page)",
|
|
293
|
-
"page-wide": "var(--os-container-page-wide)"
|
|
293
|
+
"page-wide": "var(--os-container-page-wide)",
|
|
294
|
+
"form": "var(--os-container-form)"
|
|
294
295
|
},
|
|
295
296
|
"fontSize": {
|
|
296
297
|
"h1": [
|
package/dist/tailwind-preset.js
CHANGED
|
@@ -284,7 +284,8 @@ module.exports = {
|
|
|
284
284
|
"measure-body": "var(--os-measure-body)",
|
|
285
285
|
"measure-wide": "var(--os-measure-wide)",
|
|
286
286
|
"page": "var(--os-container-page)",
|
|
287
|
-
"page-wide": "var(--os-container-page-wide)"
|
|
287
|
+
"page-wide": "var(--os-container-page-wide)",
|
|
288
|
+
"form": "var(--os-container-form)"
|
|
288
289
|
},
|
|
289
290
|
"fontSize": {
|
|
290
291
|
"h1": [
|
package/dist/theme-auto.css
CHANGED
package/dist/theme.css
CHANGED
package/dist/tokens.css
CHANGED
package/dist/tokens.json
CHANGED
|
@@ -20361,6 +20361,13 @@
|
|
|
20361
20361
|
"value": 64,
|
|
20362
20362
|
"unit": "rem"
|
|
20363
20363
|
}
|
|
20364
|
+
},
|
|
20365
|
+
"form": {
|
|
20366
|
+
"$type": "dimension",
|
|
20367
|
+
"$value": {
|
|
20368
|
+
"value": 24,
|
|
20369
|
+
"unit": "rem"
|
|
20370
|
+
}
|
|
20364
20371
|
}
|
|
20365
20372
|
},
|
|
20366
20373
|
"stage": {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oneslash-design-system",
|
|
3
3
|
"description": "A design system for the Oneslash projects",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.16.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
"./tokens.json": "./dist/tokens.json",
|
|
19
19
|
"./native-mapping.json": "./dist/native-mapping.json",
|
|
20
20
|
"./DESIGN.md": "./dist/DESIGN.md",
|
|
21
|
+
"./cases.json": "./dist/cases.json",
|
|
22
|
+
"./cases/*": "./dist/cases/*",
|
|
21
23
|
"./tokens": {
|
|
22
24
|
"types": "./dist/designTokens.d.ts",
|
|
23
25
|
"default": "./dist/designTokens.js"
|
|
@@ -43,7 +45,7 @@
|
|
|
43
45
|
"storybook": "storybook dev -p 6006",
|
|
44
46
|
"build-storybook": "storybook build",
|
|
45
47
|
"pretest": "npm run build",
|
|
46
|
-
"test": "node --test scripts/*.test.js scripts/tokens/*.test.js",
|
|
48
|
+
"test": "node --test scripts/*.test.js scripts/tokens/*.test.js scripts/cases/*.test.js",
|
|
47
49
|
"check:contrast": "node scripts/check-contrast.js",
|
|
48
50
|
"test:visual": "playwright test",
|
|
49
51
|
"test:visual:update": "playwright test --update-snapshots"
|