oneslash-design-system 2.23.1 → 2.25.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 +20 -5
- package/dist/cases/activity-timeline/activity.d.ts +1 -0
- package/dist/cases/activity-timeline/activity.jsx +43 -0
- package/dist/cases/activity-timeline/versions.d.ts +1 -0
- package/dist/cases/activity-timeline/versions.jsx +130 -0
- package/dist/cases/activity-timeline.md +315 -0
- package/dist/cases/agent-plan-proposal.md +1 -0
- package/dist/cases/ask-page/answered.d.ts +1 -0
- package/dist/cases/ask-page/answered.jsx +248 -0
- package/dist/cases/ask-page/first-visit.d.ts +1 -0
- package/dist/cases/ask-page/first-visit.jsx +118 -0
- package/dist/cases/ask-page.md +551 -0
- package/dist/cases/billing-page/self-serve.jsx +4 -4
- package/dist/cases/billing-page/trial.d.ts +1 -0
- package/dist/cases/billing-page/trial.jsx +115 -0
- package/dist/cases/billing-page.md +166 -5
- package/dist/cases/chart/bars.d.ts +1 -0
- package/dist/cases/chart/bars.jsx +83 -0
- package/dist/cases/chart/lines.d.ts +1 -0
- package/dist/cases/chart/lines.jsx +71 -0
- package/dist/cases/chart.md +258 -0
- package/dist/cases/collapsible-search/popover.jsx +1 -1
- package/dist/cases/collapsible-search.md +2 -2
- package/dist/cases/comment-thread/card.d.ts +1 -0
- package/dist/cases/comment-thread/card.jsx +141 -0
- package/dist/cases/comment-thread/thread.d.ts +1 -0
- package/dist/cases/comment-thread/thread.jsx +87 -0
- package/dist/cases/comment-thread.md +349 -0
- package/dist/cases/cookie-choice/banner.d.ts +1 -0
- package/dist/cases/cookie-choice/banner.jsx +82 -0
- package/dist/cases/cookie-choice/settings.d.ts +1 -0
- package/dist/cases/cookie-choice/settings.jsx +75 -0
- package/dist/cases/cookie-choice.md +234 -0
- package/dist/cases/dashboard/numbers-first.jsx +63 -2
- package/dist/cases/dashboard/work-first.jsx +1 -1
- package/dist/cases/dashboard.md +77 -5
- package/dist/cases/data-table-page/all-rows.jsx +1 -1
- package/dist/cases/data-table-page/paged.jsx +1 -1
- package/dist/cases/data-table-page.md +2 -2
- package/dist/cases/invoice-list/table.jsx +21 -9
- package/dist/cases/invoice-list.md +27 -12
- package/dist/cases/leaderboard/ranked.d.ts +1 -0
- package/dist/cases/leaderboard/ranked.jsx +44 -0
- package/dist/cases/leaderboard/table.d.ts +1 -0
- package/dist/cases/leaderboard/table.jsx +87 -0
- package/dist/cases/leaderboard.md +177 -0
- package/dist/cases/message-reactions/picker.jsx +1 -1
- package/dist/cases/message-reactions.md +2 -2
- package/dist/cases/message-row.md +2 -1
- package/dist/cases/newsletter-signup/inline.d.ts +1 -0
- package/dist/cases/newsletter-signup/inline.jsx +72 -0
- package/dist/cases/newsletter-signup/section.d.ts +1 -0
- package/dist/cases/newsletter-signup/section.jsx +72 -0
- package/dist/cases/newsletter-signup.md +234 -0
- package/dist/cases/number-format.md +9 -3
- package/dist/cases/onboarding/checklist.d.ts +1 -0
- package/dist/cases/onboarding/checklist.jsx +92 -0
- package/dist/cases/onboarding/steps.d.ts +3 -0
- package/dist/cases/onboarding/steps.jsx +177 -0
- package/dist/cases/onboarding.md +368 -0
- package/dist/cases/people-row/stack.jsx +1 -1
- package/dist/cases/people-row.md +2 -2
- package/dist/cases/plan-comparison/table.d.ts +1 -0
- package/dist/cases/plan-comparison/table.jsx +47 -0
- package/dist/cases/plan-comparison.md +94 -0
- package/dist/cases/plan-picker.md +1 -0
- package/dist/cases/plan-sign-off/one-approver.d.ts +1 -0
- package/dist/cases/plan-sign-off/one-approver.jsx +129 -0
- package/dist/cases/plan-sign-off/team.d.ts +1 -0
- package/dist/cases/plan-sign-off/team.jsx +213 -0
- package/dist/cases/plan-sign-off.md +541 -0
- package/dist/cases/pricing-section.md +1 -1
- package/dist/cases/site-footer/columns.jsx +2 -1
- package/dist/cases/site-footer.md +3 -1
- package/dist/cases/stat-row/tiles.jsx +2 -1
- package/dist/cases/stat-row.md +5 -2
- package/dist/cases/task-header/agent-sets-status.d.ts +1 -0
- package/dist/cases/task-header/agent-sets-status.jsx +164 -0
- package/dist/cases/task-header/people-change-status.d.ts +1 -0
- package/dist/cases/task-header/people-change-status.jsx +175 -0
- package/dist/cases/task-header.md +576 -0
- package/dist/cases.json +883 -30
- package/dist/components/alert.d.ts +3 -1
- package/dist/components/alert.jsx +5 -5
- package/dist/components/barChart.d.ts +35 -0
- package/dist/components/barChart.jsx +92 -0
- package/dist/components/dateField.jsx +1 -1
- package/dist/components/formatNumber.d.ts +10 -2
- package/dist/components/formatNumber.js +44 -9
- package/dist/components/heading.d.ts +2 -2
- package/dist/components/heading.jsx +5 -3
- package/dist/components/layout.d.ts +4 -2
- package/dist/components/layout.jsx +13 -2
- package/dist/components/lineChart.d.ts +39 -0
- package/dist/components/lineChart.jsx +128 -0
- package/dist/components/markdown.d.ts +24 -0
- package/dist/components/markdown.jsx +81 -0
- package/dist/components/pageShell.d.ts +3 -3
- package/dist/components/pageShell.jsx +6 -5
- package/dist/components/popover.d.ts +5 -1
- package/dist/components/popover.jsx +3 -2
- package/dist/components/progress.jsx +1 -1
- package/dist/components/select.jsx +5 -2
- package/dist/components/statTile.d.ts +1 -1
- package/dist/components/statTile.jsx +7 -2
- package/dist/components/tableCell.d.ts +4 -3
- package/dist/components/tableCell.jsx +2 -2
- package/dist/components/timeline.d.ts +32 -0
- package/dist/components/timeline.jsx +54 -0
- package/dist/components/titleBar.d.ts +3 -1
- package/dist/components/titleBar.jsx +9 -4
- package/dist/components/toaster.jsx +81 -11
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/internal/chart.d.ts +39 -0
- package/dist/internal/chart.js +110 -0
- package/dist/internal/chartFrame.d.ts +29 -0
- package/dist/internal/chartFrame.jsx +57 -0
- package/dist/internal/markdown.d.ts +40 -0
- package/dist/internal/markdown.js +577 -0
- package/dist/internal/toaster.d.ts +2 -0
- package/dist/internal/toaster.js +8 -0
- package/dist/native-mapping.json +28 -4
- package/dist/stories/BarChart.stories.d.ts +10 -0
- package/dist/stories/BarChart.stories.jsx +104 -0
- package/dist/stories/Cases.generated.stories.d.ts +22 -0
- package/dist/stories/Cases.generated.stories.jsx +44 -0
- package/dist/stories/Heading.stories.d.ts +1 -0
- package/dist/stories/Heading.stories.jsx +17 -0
- package/dist/stories/LineChart.stories.d.ts +9 -0
- package/dist/stories/LineChart.stories.jsx +34 -0
- package/dist/stories/Markdown.stories.d.ts +9 -0
- package/dist/stories/Markdown.stories.jsx +66 -0
- package/dist/stories/Onboarding.probe.stories.d.ts +6 -0
- package/dist/stories/Onboarding.probe.stories.jsx +12 -0
- package/dist/stories/Popover.stories.d.ts +2 -0
- package/dist/stories/Popover.stories.jsx +33 -0
- package/dist/stories/StatTile.stories.d.ts +4 -0
- package/dist/stories/StatTile.stories.jsx +47 -2
- package/dist/stories/Timeline.stories.d.ts +8 -0
- package/dist/stories/Timeline.stories.jsx +49 -0
- package/dist/stories/TitleBar.stories.d.ts +1 -0
- package/dist/stories/TitleBar.stories.jsx +13 -0
- package/dist/stories/Toaster.stories.d.ts +4 -0
- package/dist/stories/Toaster.stories.jsx +30 -0
- package/package.json +1 -1
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { useState } from "react";
|
|
2
2
|
import StatTile from "../components/statTile";
|
|
3
3
|
import { Grid } from "../components/layout";
|
|
4
|
+
import AppShell from "../components/appShell";
|
|
5
|
+
import SidePane from "../components/sidePane";
|
|
6
|
+
import Navigation, { NavigationGroup } from "../components/navigation";
|
|
7
|
+
import MenuItem from "../components/menuItem";
|
|
8
|
+
import Paragraph from "../components/paragraph";
|
|
4
9
|
var meta = {
|
|
5
10
|
title: "Components/StatTile",
|
|
6
11
|
component: StatTile,
|
|
@@ -16,7 +21,11 @@ var meta = {
|
|
|
16
21
|
loading: { control: "boolean" },
|
|
17
22
|
size: { control: "select", options: ["default", "large"] },
|
|
18
23
|
},
|
|
19
|
-
|
|
24
|
+
// A story that is a whole page sets `parameters.bleed` and gets no frame
|
|
25
|
+
decorators: [function (Story, _a) {
|
|
26
|
+
var parameters = _a.parameters;
|
|
27
|
+
return (parameters.bleed ? <Story /> : <div style={{ maxWidth: 720, padding: 16 }}><Story /></div>);
|
|
28
|
+
}],
|
|
20
29
|
};
|
|
21
30
|
export default meta;
|
|
22
31
|
export var Default = {
|
|
@@ -53,3 +62,39 @@ export var States = {
|
|
|
53
62
|
export var Large = {
|
|
54
63
|
args: { id: "stattile-large", label: "Monthly revenue", value: 48210, format: "money", previous: 44000, period: "month", size: "large", caption: "7 of 8 seats used" },
|
|
55
64
|
};
|
|
65
|
+
// A percent tile says its change in points: 12% against 9% is 'Up 3 pts', not 'Up 33%'
|
|
66
|
+
export var Percent = {
|
|
67
|
+
args: { id: "stattile-percent", label: "Open rate", value: 0.12, format: "percent", previous: 0.09 },
|
|
68
|
+
};
|
|
69
|
+
// Four tiles at their widest values inside an AppShell. Shot at 768px (the "tablet" tag).
|
|
70
|
+
// The probe arg `pane` opens a SidePane, which tests/interactions.spec.ts uses at 1280px.
|
|
71
|
+
function InAppShellBox(_a) {
|
|
72
|
+
var pane = _a.pane;
|
|
73
|
+
var _b = useState(false), navOpen = _b[0], setNavOpen = _b[1];
|
|
74
|
+
var _c = useState(pane), paneOpen = _c[0], setPaneOpen = _c[1];
|
|
75
|
+
return (<div>
|
|
76
|
+
<AppShell title="Overview" navOpen={navOpen} onNavOpenChange={setNavOpen} sidebar={<Navigation aria-label="Main">
|
|
77
|
+
<NavigationGroup label="Reports">
|
|
78
|
+
<MenuItem size="small" iconName="LayoutDashboard" label="Overview" isSelected aria-current="page"/>
|
|
79
|
+
<MenuItem size="small" iconName="Users" label="People"/>
|
|
80
|
+
</NavigationGroup>
|
|
81
|
+
</Navigation>} pane={paneOpen && <SidePane title="Notes" onClose={function () { return setPaneOpen(false); }}><Paragraph>Numbers update every hour.</Paragraph></SidePane>}>
|
|
82
|
+
<Grid compact columns={4} from="lg">
|
|
83
|
+
<StatTile id="stattile-shell-revenue" label="Revenue" value={12400} format="money" previous={11000}/>
|
|
84
|
+
<StatTile id="stattile-shell-responses" label="Responses" value={1234567} previous={1000000}/>
|
|
85
|
+
<StatTile id="stattile-shell-time" label="Average time" value={8640000} format="duration" previous={9200000}/>
|
|
86
|
+
<StatTile id="stattile-shell-storage" label="Storage" value={1288490188} format="bytes" caption="of 5 GB"/>
|
|
87
|
+
</Grid>
|
|
88
|
+
</AppShell>
|
|
89
|
+
</div>);
|
|
90
|
+
}
|
|
91
|
+
export var InAppShell = {
|
|
92
|
+
tags: ["tablet"],
|
|
93
|
+
parameters: { layout: "fullscreen", bleed: true },
|
|
94
|
+
argTypes: { pane: { control: "boolean" } },
|
|
95
|
+
args: { pane: false },
|
|
96
|
+
render: function (_a) {
|
|
97
|
+
var pane = _a.pane;
|
|
98
|
+
return <InAppShellBox pane={pane}/>;
|
|
99
|
+
},
|
|
100
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Timeline from "../components/timeline";
|
|
3
|
+
declare const meta: Meta<typeof Timeline>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Timeline>;
|
|
6
|
+
export declare const Activity: Story;
|
|
7
|
+
export declare const Versions: Story;
|
|
8
|
+
export declare const Edges: Story;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import Timeline from "../components/timeline";
|
|
3
|
+
var meta = {
|
|
4
|
+
title: "Components/Timeline",
|
|
5
|
+
component: Timeline,
|
|
6
|
+
decorators: [
|
|
7
|
+
function (Story) { return (<div style={{ maxWidth: "480px" }}>
|
|
8
|
+
<Story />
|
|
9
|
+
</div>); },
|
|
10
|
+
],
|
|
11
|
+
};
|
|
12
|
+
export default meta;
|
|
13
|
+
var activity = [
|
|
14
|
+
{ id: "a6", title: "Moved the launch to Friday", when: "Nov 16, 2026, 2:40 PM", dateTime: "2026-11-16T14:40", actor: { name: "Dana Lee" } },
|
|
15
|
+
{ id: "a5", title: "Opened a pull request", when: "Nov 16, 2026, 11:15 AM", dateTime: "2026-11-16T11:15", actor: { name: "Acme Agent", agent: true }, detail: "Updates the billing page and its tests", href: "/pulls/42" },
|
|
16
|
+
{ id: "a4", title: "Flagged a missing test", when: "Nov 15, 2026, 4:05 PM", dateTime: "2026-11-15T16:05", actor: { name: "Ben Carter" }, tag: { label: "Needs a test", color: "warning" } },
|
|
17
|
+
{ id: "a3", title: "Signed off the plan", when: "Nov 15, 2026, 10:30 AM", dateTime: "2026-11-15T10:30", actor: { name: "Omar Reyes" } },
|
|
18
|
+
{ id: "a2", title: "Added Ben Carter to the task", when: "Nov 14, 2026, 3:20 PM", dateTime: "2026-11-14T15:20", actor: { name: "Dana Lee" } },
|
|
19
|
+
{ id: "a1", title: "Created the task", when: "Nov 14, 2026, 9:00 AM", dateTime: "2026-11-14T09:00", actor: { name: "Dana Lee" } },
|
|
20
|
+
];
|
|
21
|
+
export var Activity = {
|
|
22
|
+
render: function () { return <Timeline aria-label="Activity" items={activity}/>; },
|
|
23
|
+
};
|
|
24
|
+
var versions = [
|
|
25
|
+
{ id: "v5", title: "Version 5", when: "Nov 16, 2026, 2:40 PM", dateTime: "2026-11-16T14:40", actor: { name: "Dana Lee" }, tag: { label: "Current" } },
|
|
26
|
+
{ id: "v4", title: "Version 4", when: "Nov 16, 2026, 9:10 AM", dateTime: "2026-11-16T09:10", actor: { name: "Acme Agent", agent: true }, detail: "Added a step to back up the data" },
|
|
27
|
+
{ id: "v3", title: "Version 3", when: "Nov 15, 2026, 5:45 PM", dateTime: "2026-11-15T17:45", actor: { name: "Omar Reyes" } },
|
|
28
|
+
{ id: "v2", title: "Version 2", when: "Nov 15, 2026, 1:00 PM", dateTime: "2026-11-15T13:00", actor: { name: "Acme Agent", agent: true }, detail: "Split the release into two steps" },
|
|
29
|
+
{ id: "v1", title: "Version 1", when: "Nov 14, 2026, 10:20 AM", dateTime: "2026-11-14T10:20", actor: { name: "Acme Agent", agent: true } },
|
|
30
|
+
];
|
|
31
|
+
function VersionsDemo() {
|
|
32
|
+
var _a = useState("v5"), selected = _a[0], setSelected = _a[1];
|
|
33
|
+
return <Timeline id="versions" aria-label="Versions" items={versions} selectedId={selected} onSelect={setSelected}/>;
|
|
34
|
+
}
|
|
35
|
+
export var Versions = {
|
|
36
|
+
render: function () { return <VersionsDemo />; },
|
|
37
|
+
};
|
|
38
|
+
// 120 characters
|
|
39
|
+
var longTitle = "Changed the plan so the billing export runs every night and sends a short report to the finance team before the morning.";
|
|
40
|
+
export var Edges = {
|
|
41
|
+
tags: ["shell"],
|
|
42
|
+
render: function () { return (<div style={{ display: "flex", flexDirection: "column", gap: "32px" }}>
|
|
43
|
+
<Timeline id="edges-one" aria-label="One event" items={[{ id: "e1", title: "Created the task", when: "Nov 16, 2026, 2:40 PM", dateTime: "2026-11-16T14:40", actor: { name: "Dana Lee" } }]}/>
|
|
44
|
+
<Timeline id="edges-long" aria-label="Long title" items={[
|
|
45
|
+
{ id: "e3", title: longTitle, when: "Nov 16, 2026, 2:40 PM", dateTime: "2026-11-16T14:40", actor: { name: "Acme Agent", agent: true } },
|
|
46
|
+
{ id: "e2", title: "Created the task", when: "Nov 15, 2026, 9:00 AM", dateTime: "2026-11-15T09:00", actor: { name: "Ben Carter" } },
|
|
47
|
+
]}/>
|
|
48
|
+
</div>); },
|
|
49
|
+
};
|
|
@@ -3,6 +3,8 @@ import TitleBar from "../components/titleBar";
|
|
|
3
3
|
import Button from "../components/button";
|
|
4
4
|
import IconButton from "../components/iconButton";
|
|
5
5
|
import Tooltip from "../components/tooltip";
|
|
6
|
+
import Tag from "../components/tag";
|
|
7
|
+
import AvatarStack from "../components/avatarStack";
|
|
6
8
|
var meta = {
|
|
7
9
|
title: "Components/TitleBar",
|
|
8
10
|
component: TitleBar,
|
|
@@ -39,3 +41,14 @@ export var ActionsBelow = {
|
|
|
39
41
|
<TitleBar title="Dashboard" actionsBelow actions={<Button size="small" type="secondary" state="enabled" label="Last quarter"/>}/>
|
|
40
42
|
</div>); },
|
|
41
43
|
};
|
|
44
|
+
// One line under the title for the status, the people and a fact. It wraps under the title at every width. Also shot at 375px (the "shell" tag).
|
|
45
|
+
export var WithMeta = {
|
|
46
|
+
tags: ["shell"],
|
|
47
|
+
render: function () { return (<div style={{ maxWidth: 880 }}>
|
|
48
|
+
<TitleBar title="Launch checklist" level={2} actions={more} meta={<>
|
|
49
|
+
<Tag variant="dot" size="small" label="In progress"/>
|
|
50
|
+
<AvatarStack size={24} max={4} people={[{ name: "Dana Lee" }, { name: "Ben Carter" }, { name: "Omar Reyes" }, { name: "Mia Park" }, { name: "Leo Grant" }, { name: "Ana Silva" }]}/>
|
|
51
|
+
<span>Due Nov 20, 2026</span>
|
|
52
|
+
</>}/>
|
|
53
|
+
</div>); },
|
|
54
|
+
};
|
|
@@ -27,3 +27,33 @@ var StackDemo = function () {
|
|
|
27
27
|
export var Stack = {
|
|
28
28
|
render: function () { return <StackDemo />; },
|
|
29
29
|
};
|
|
30
|
+
var AnnouncerProbeDemo = function (_a) {
|
|
31
|
+
var onMount = _a.onMount;
|
|
32
|
+
var ids = useRef([]);
|
|
33
|
+
var show = function (input) { return ids.current.push(toast(input)); };
|
|
34
|
+
useEffect(function () {
|
|
35
|
+
if (onMount)
|
|
36
|
+
show({ type: "success", message: "Workspace ready" });
|
|
37
|
+
return function () {
|
|
38
|
+
ids.current.forEach(dismissToast);
|
|
39
|
+
ids.current = [];
|
|
40
|
+
};
|
|
41
|
+
}, [onMount]);
|
|
42
|
+
return (<div style={{ display: "flex", flexWrap: "wrap", gap: "8px" }}>
|
|
43
|
+
<Button size="small" type="secondary" state="enabled" label="One Toast" onClickButton={function () { return show({ type: "success", message: "Invite sent" }); }}/>
|
|
44
|
+
<Button size="small" type="secondary" state="enabled" label="Three Toasts" onClickButton={function () {
|
|
45
|
+
show({ type: "success", message: "Q3 plan deleted" });
|
|
46
|
+
show({ type: "info", message: "Sync runs every hour", secondMessage: "The next one starts at 1:00 PM." });
|
|
47
|
+
show({ type: "warning", message: "Two seats left" });
|
|
48
|
+
}}/>
|
|
49
|
+
<Button size="small" type="secondary" state="enabled" label="Same Toast Twice" onClickButton={function () { show("Copied"); show("Copied"); }}/>
|
|
50
|
+
<Button size="small" type="secondary" state="enabled" label="Error Toast" onClickButton={function () { return show({ type: "error", message: "Could not upload photo.jpg" }); }}/>
|
|
51
|
+
<Toaster />
|
|
52
|
+
</div>);
|
|
53
|
+
};
|
|
54
|
+
export var AnnouncerProbe = {
|
|
55
|
+
// For tests/interactions.spec.ts only: hidden from the sidebar and the docs, and skipped by the visual gate
|
|
56
|
+
tags: ["!dev", "!autodocs", "test-only"],
|
|
57
|
+
args: { onMount: false },
|
|
58
|
+
render: function (args) { return <AnnouncerProbeDemo {...args}/>; },
|
|
59
|
+
};
|