oneslash-design-system 2.16.0 → 2.17.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 +26 -3
- package/dist/cases/accept-invite/signed-in.jsx +1 -1
- package/dist/cases/accept-invite/signed-out.jsx +1 -1
- package/dist/cases/accept-invite.md +2 -2
- package/dist/cases/agent-options/cards.d.ts +1 -0
- package/dist/cases/agent-options/cards.jsx +91 -0
- package/dist/cases/agent-options.md +168 -0
- package/dist/cases/agent-pending-reply/steps.d.ts +1 -0
- package/dist/cases/agent-pending-reply/steps.jsx +149 -0
- package/dist/cases/agent-pending-reply/streaming.d.ts +1 -0
- package/dist/cases/agent-pending-reply/streaming.jsx +146 -0
- package/dist/cases/agent-pending-reply.md +432 -0
- package/dist/cases/agent-plan-proposal/changes.d.ts +1 -0
- package/dist/cases/agent-plan-proposal/changes.jsx +224 -0
- package/dist/cases/agent-plan-proposal/steps.d.ts +1 -0
- package/dist/cases/agent-plan-proposal/steps.jsx +211 -0
- package/dist/cases/agent-plan-proposal.md +656 -0
- package/dist/cases/agent-question/choices.d.ts +1 -0
- package/dist/cases/agent-question/choices.jsx +132 -0
- package/dist/cases/agent-question/free-text.d.ts +1 -0
- package/dist/cases/agent-question/free-text.jsx +81 -0
- package/dist/cases/agent-question.md +338 -0
- package/dist/cases/agent-shows-sources.md +2 -2
- package/dist/cases/artifact-card/card.d.ts +1 -0
- package/dist/cases/artifact-card/card.jsx +45 -0
- package/dist/cases/artifact-card.md +103 -0
- package/dist/cases/composer-limit/notice-with-action.d.ts +1 -0
- package/dist/cases/composer-limit/notice-with-action.jsx +87 -0
- package/dist/cases/composer-limit/notice.d.ts +1 -0
- package/dist/cases/composer-limit/notice.jsx +84 -0
- package/dist/cases/composer-limit.md +286 -0
- package/dist/cases/conversation-starters/chips.d.ts +1 -0
- package/dist/cases/conversation-starters/chips.jsx +69 -0
- package/dist/cases/conversation-starters/none.d.ts +1 -0
- package/dist/cases/conversation-starters/none.jsx +45 -0
- package/dist/cases/conversation-starters.md +208 -0
- package/dist/cases/mention-list/in-composer.d.ts +1 -0
- package/dist/cases/mention-list/in-composer.jsx +169 -0
- package/dist/cases/mention-list.md +252 -0
- package/dist/cases/message-actions/hover-toolbar.d.ts +1 -0
- package/dist/cases/message-actions/hover-toolbar.jsx +229 -0
- package/dist/cases/message-actions/menu.d.ts +1 -0
- package/dist/cases/message-actions/menu.jsx +258 -0
- package/dist/cases/message-actions.md +651 -0
- package/dist/cases/message-attachments/in-composer.d.ts +1 -0
- package/dist/cases/message-attachments/in-composer.jsx +134 -0
- package/dist/cases/message-attachments/in-message.d.ts +1 -0
- package/dist/cases/message-attachments/in-message.jsx +46 -0
- package/dist/cases/message-attachments.md +310 -0
- package/dist/cases/message-composer/plain.d.ts +1 -0
- package/dist/cases/message-composer/plain.jsx +57 -0
- package/dist/cases/message-composer/with-tools.d.ts +1 -0
- package/dist/cases/message-composer/with-tools.jsx +182 -0
- package/dist/cases/message-composer.md +356 -0
- package/dist/cases/message-edit/in-place.d.ts +1 -0
- package/dist/cases/message-edit/in-place.jsx +99 -0
- package/dist/cases/message-edit.md +179 -0
- package/dist/cases/message-reactions/chips.d.ts +1 -0
- package/dist/cases/message-reactions/chips.jsx +118 -0
- package/dist/cases/message-reactions/quick-pick.d.ts +1 -0
- package/dist/cases/message-reactions/quick-pick.jsx +155 -0
- package/dist/cases/message-reactions.md +371 -0
- package/dist/cases/message-row/grouped.d.ts +1 -0
- package/dist/cases/message-row/grouped.jsx +56 -0
- package/dist/cases/message-row/person-and-agent.d.ts +1 -0
- package/dist/cases/message-row/person-and-agent.jsx +41 -0
- package/dist/cases/message-row.md +189 -0
- package/dist/cases/reply-feedback/thumbs.d.ts +1 -0
- package/dist/cases/reply-feedback/thumbs.jsx +191 -0
- package/dist/cases/reply-feedback/with-reason.d.ts +1 -0
- package/dist/cases/reply-feedback/with-reason.jsx +221 -0
- package/dist/cases/reply-feedback.md +552 -0
- package/dist/cases/reply-sources/cards.d.ts +1 -0
- package/dist/cases/reply-sources/cards.jsx +83 -0
- package/dist/cases/reply-sources/tag-only.d.ts +1 -0
- package/dist/cases/reply-sources/tag-only.jsx +45 -0
- package/dist/cases/reply-sources.md +247 -0
- package/dist/cases/slash-command-list/in-composer.d.ts +1 -0
- package/dist/cases/slash-command-list/in-composer.jsx +162 -0
- package/dist/cases/slash-command-list.md +247 -0
- package/dist/cases/success-feedback.md +1 -1
- package/dist/cases/typing-and-status/line.d.ts +1 -0
- package/dist/cases/typing-and-status/line.jsx +50 -0
- package/dist/cases/typing-and-status.md +96 -0
- package/dist/cases.json +1276 -14
- package/dist/components/button.d.ts +3 -2
- package/dist/components/button.jsx +9 -7
- package/dist/components/composer.d.ts +74 -0
- package/dist/components/composer.jsx +122 -0
- package/dist/components/fileChip.d.ts +33 -0
- package/dist/components/fileChip.jsx +61 -0
- package/dist/components/iconButton.d.ts +3 -3
- package/dist/components/iconButton.jsx +9 -7
- package/dist/components/layout.d.ts +7 -1
- package/dist/components/layout.jsx +5 -2
- package/dist/components/menu.d.ts +21 -0
- package/dist/components/menu.jsx +27 -3
- package/dist/components/menuItem.d.ts +9 -1
- package/dist/components/menuItem.jsx +5 -4
- package/dist/components/message.d.ts +28 -0
- package/dist/components/message.jsx +25 -0
- package/dist/components/paragraph.d.ts +3 -1
- package/dist/components/paragraph.jsx +2 -2
- package/dist/components/popover.d.ts +7 -1
- package/dist/components/popover.jsx +35 -9
- package/dist/components/radioGroup.d.ts +8 -1
- package/dist/components/radioGroup.jsx +19 -8
- package/dist/components/sourceCard.d.ts +23 -0
- package/dist/components/sourceCard.jsx +56 -0
- package/dist/components/stepList.d.ts +17 -0
- package/dist/components/stepList.jsx +79 -0
- package/dist/components/tag.d.ts +9 -1
- package/dist/components/tag.jsx +6 -4
- package/dist/components/textarea.jsx +3 -18
- package/dist/components/userImage.d.ts +9 -1
- package/dist/components/userImage.jsx +10 -3
- package/dist/internal/autoGrow.d.ts +11 -0
- package/dist/internal/autoGrow.js +28 -0
- package/dist/internal/composer.d.ts +16 -0
- package/dist/internal/composer.js +18 -0
- package/dist/internal/menu.d.ts +6 -0
- package/dist/internal/menu.js +31 -0
- package/dist/native-mapping.json +32 -1
- package/dist/stories/Button.stories.d.ts +1 -0
- package/dist/stories/Button.stories.jsx +17 -1
- package/dist/stories/Cases.generated.stories.d.ts +30 -0
- package/dist/stories/Cases.generated.stories.jsx +60 -0
- package/dist/stories/Composer.stories.d.ts +23 -0
- package/dist/stories/Composer.stories.jsx +121 -0
- package/dist/stories/FileChip.stories.d.ts +7 -0
- package/dist/stories/FileChip.stories.jsx +35 -0
- package/dist/stories/IconButton.stories.d.ts +1 -0
- package/dist/stories/IconButton.stories.jsx +18 -1
- package/dist/stories/Menu.stories.d.ts +4 -0
- package/dist/stories/Menu.stories.jsx +46 -1
- package/dist/stories/MenuItem.stories.d.ts +1 -0
- package/dist/stories/MenuItem.stories.jsx +8 -0
- package/dist/stories/Message.stories.d.ts +10 -0
- package/dist/stories/Message.stories.jsx +77 -0
- package/dist/stories/PageComponents.stories.d.ts +1 -0
- package/dist/stories/PageComponents.stories.jsx +21 -0
- package/dist/stories/RadioGroup.stories.d.ts +2 -0
- package/dist/stories/RadioGroup.stories.jsx +40 -1
- package/dist/stories/SourceCard.stories.d.ts +8 -0
- package/dist/stories/SourceCard.stories.jsx +33 -0
- package/dist/stories/StepList.stories.d.ts +8 -0
- package/dist/stories/StepList.stories.jsx +35 -0
- package/dist/stories/UserImage.stories.d.ts +2 -0
- package/dist/stories/UserImage.stories.jsx +19 -0
- package/package.json +4 -3
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Message from "../components/message";
|
|
3
|
+
declare const meta: Meta<typeof Message>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Message>;
|
|
6
|
+
export declare const Person: Story;
|
|
7
|
+
export declare const Agent: Story;
|
|
8
|
+
export declare const Compact: Story;
|
|
9
|
+
export declare const WithActions: Story;
|
|
10
|
+
export declare const ActionsVisible: Story;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from "react";
|
|
2
|
+
import { Bot } from "lucide-react";
|
|
3
|
+
import Message from "../components/message";
|
|
4
|
+
import UserImage from "../components/userImage";
|
|
5
|
+
import Tag from "../components/tag";
|
|
6
|
+
import TimeStamp from "../components/timeStamp";
|
|
7
|
+
import Paragraph from "../components/paragraph";
|
|
8
|
+
import IconButton from "../components/iconButton";
|
|
9
|
+
import { Cluster } from "../components/layout";
|
|
10
|
+
var meta = {
|
|
11
|
+
title: "Components/Message",
|
|
12
|
+
component: Message,
|
|
13
|
+
decorators: [
|
|
14
|
+
function (Story) { return (<div style={{ maxWidth: "560px" }}>
|
|
15
|
+
<Story />
|
|
16
|
+
</div>); },
|
|
17
|
+
],
|
|
18
|
+
};
|
|
19
|
+
export default meta;
|
|
20
|
+
var at = function (time) { return <TimeStamp createdAt={new Date("2025-01-15T".concat(time, ":00Z"))} dateFormat="absolute" data="time"/>; };
|
|
21
|
+
var rowActions = (<>
|
|
22
|
+
<IconButton color="iconOnly" state="enabled" size="tiny" iconName="Copy" ariaLabel="Copy message"/>
|
|
23
|
+
<IconButton color="iconOnly" state="enabled" size="tiny" iconName="Ellipsis" ariaLabel="More actions"/>
|
|
24
|
+
</>);
|
|
25
|
+
export var Person = {
|
|
26
|
+
render: function () { return (<Message avatar={<UserImage userHandle="Alice Brown"/>} name="Alice Brown" meta={at("10:42")}>
|
|
27
|
+
<Paragraph>Can someone check the numbers in the Q3 plan before Friday?</Paragraph>
|
|
28
|
+
</Message>); },
|
|
29
|
+
};
|
|
30
|
+
export var Agent = {
|
|
31
|
+
render: function () { return (<Message avatar={<UserImage userHandle="Acme Agent" icon={Bot}/>} name="Acme Agent" meta={<>
|
|
32
|
+
<Tag variant="contained" size="small" label="Agent"/>
|
|
33
|
+
{at("10:43")}
|
|
34
|
+
<Paragraph size="caption" tone="secondary">Model name</Paragraph>
|
|
35
|
+
</>}>
|
|
36
|
+
<Paragraph>The totals match the sheet. Two rows in March use last year's rate.</Paragraph>
|
|
37
|
+
</Message>); },
|
|
38
|
+
};
|
|
39
|
+
export var Compact = {
|
|
40
|
+
render: function () { return (<>
|
|
41
|
+
<Message avatar={<UserImage userHandle="Alice Brown"/>} name="Alice Brown" meta={at("10:42")}>
|
|
42
|
+
<Paragraph>Can someone check the numbers in the Q3 plan before Friday?</Paragraph>
|
|
43
|
+
</Message>
|
|
44
|
+
<Message compact>
|
|
45
|
+
<Paragraph>The sheet is in the shared folder.</Paragraph>
|
|
46
|
+
</Message>
|
|
47
|
+
<Message compact footer={<Cluster gap="small"><Tag variant="contained" size="small" label="Q3 plan.xlsx" iconName="Paperclip"/></Cluster>}>
|
|
48
|
+
<Paragraph>Here it is.</Paragraph>
|
|
49
|
+
</Message>
|
|
50
|
+
</>); },
|
|
51
|
+
};
|
|
52
|
+
// The visual test cannot hover, so focus in the first row reveals its actions, as a keyboard user sees them.
|
|
53
|
+
// Narrow, to show the actions keep to their own column and leave the name line whole.
|
|
54
|
+
var FocusedActions = function () {
|
|
55
|
+
var ref = useRef(null);
|
|
56
|
+
useEffect(function () {
|
|
57
|
+
var _a, _b;
|
|
58
|
+
(_b = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.querySelector("button")) === null || _b === void 0 ? void 0 : _b.focus();
|
|
59
|
+
}, []);
|
|
60
|
+
return (<div ref={ref} style={{ width: "320px" }}>
|
|
61
|
+
<Message avatar={<UserImage userHandle="Alice Brown"/>} name="Alice Brown" meta={at("10:42")} actions={rowActions}>
|
|
62
|
+
<Paragraph>Can someone check the numbers in the Q3 plan before Friday?</Paragraph>
|
|
63
|
+
</Message>
|
|
64
|
+
<Message avatar={<UserImage userHandle="Ben Carter"/>} name="Ben Carter" meta={at("10:44")} actions={rowActions} tone="highlight">
|
|
65
|
+
<Paragraph>On it. I will send the fixes by noon.</Paragraph>
|
|
66
|
+
</Message>
|
|
67
|
+
</div>);
|
|
68
|
+
};
|
|
69
|
+
export var WithActions = {
|
|
70
|
+
render: function () { return <FocusedActions />; },
|
|
71
|
+
};
|
|
72
|
+
// Shown with no hover and no focus, as when a menu opened from More is open
|
|
73
|
+
export var ActionsVisible = {
|
|
74
|
+
render: function () { return (<Message avatar={<UserImage userHandle="Alice Brown"/>} name="Alice Brown" meta={at("10:42")} actions={rowActions} actionsVisible>
|
|
75
|
+
<Paragraph>Can someone check the numbers in the Q3 plan before Friday?</Paragraph>
|
|
76
|
+
</Message>); },
|
|
77
|
+
};
|
|
@@ -88,3 +88,24 @@ export var TwoHalves = {
|
|
|
88
88
|
</Center>
|
|
89
89
|
</Split>); },
|
|
90
90
|
};
|
|
91
|
+
// `justify` moves the row's ends apart or packs it to the right; `align="start"` keeps a tall child from centering the rest.
|
|
92
|
+
export var ClusterJustify = {
|
|
93
|
+
render: function () { return (<Stack gap="xxlarge">
|
|
94
|
+
<Cluster justify="between">
|
|
95
|
+
<Paragraph>Between: first child</Paragraph>
|
|
96
|
+
<Tag variant="contained" size="medium" state="enabled" label="Middle"/>
|
|
97
|
+
<Paragraph>last child</Paragraph>
|
|
98
|
+
</Cluster>
|
|
99
|
+
<Cluster justify="end">
|
|
100
|
+
<Tag variant="contained" size="medium" state="enabled" label="Cancel"/>
|
|
101
|
+
<Tag variant="contained" size="medium" state="enabled" label="Save"/>
|
|
102
|
+
</Cluster>
|
|
103
|
+
<Cluster align="start">
|
|
104
|
+
<Paragraph>Start: the row lines up along the top.</Paragraph>
|
|
105
|
+
<Surface>
|
|
106
|
+
<Paragraph tone="secondary">A taller child sits beside it.</Paragraph>
|
|
107
|
+
<Paragraph tone="secondary">Two lines.</Paragraph>
|
|
108
|
+
</Surface>
|
|
109
|
+
</Cluster>
|
|
110
|
+
</Stack>); },
|
|
111
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
1
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
2
2
|
import RadioGroup from "../components/radioGroup";
|
|
3
3
|
var meta = {
|
|
4
4
|
title: "Components/RadioGroup",
|
|
@@ -65,3 +65,42 @@ export var Labelled = {
|
|
|
65
65
|
direction: "vertical",
|
|
66
66
|
},
|
|
67
67
|
};
|
|
68
|
+
// Each option is a bordered card that is the radio's label. The selected card has the accent border.
|
|
69
|
+
export var Cards = {
|
|
70
|
+
render: function (args) { return <RadioGroupWrapper {...args}/>; },
|
|
71
|
+
args: {
|
|
72
|
+
"aria-label": "Plan",
|
|
73
|
+
variant: "card",
|
|
74
|
+
options: [
|
|
75
|
+
{ label: "Starter", secondLabel: "For one person", value: "starter" },
|
|
76
|
+
{ label: "Team", secondLabel: "Shared workspace and agents", value: "team", badge: "Recommended" },
|
|
77
|
+
{ label: "Enterprise", secondLabel: "Talk to us", value: "enterprise", disabled: true },
|
|
78
|
+
],
|
|
79
|
+
selectedValue: "team",
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
// Keyboard focus on the selected card (where Tab lands): a ring just outside the card, and the accent border stays. The radio mark keeps its outline.
|
|
83
|
+
export var CardFocused = {
|
|
84
|
+
render: function (args) {
|
|
85
|
+
var Focused = function () {
|
|
86
|
+
var ref = useRef(null);
|
|
87
|
+
useEffect(function () {
|
|
88
|
+
var _a, _b;
|
|
89
|
+
(_b = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.querySelector('input[value="team"]')) === null || _b === void 0 ? void 0 : _b.focus();
|
|
90
|
+
}, []);
|
|
91
|
+
return (<div ref={ref}>
|
|
92
|
+
<RadioGroupWrapper {...args}/>
|
|
93
|
+
</div>);
|
|
94
|
+
};
|
|
95
|
+
return <Focused />;
|
|
96
|
+
},
|
|
97
|
+
args: {
|
|
98
|
+
"aria-label": "Plan",
|
|
99
|
+
variant: "card",
|
|
100
|
+
options: [
|
|
101
|
+
{ label: "Starter", secondLabel: "For one person", value: "starter" },
|
|
102
|
+
{ label: "Team", secondLabel: "Shared workspace and agents", value: "team", badge: "Recommended" },
|
|
103
|
+
],
|
|
104
|
+
selectedValue: "team",
|
|
105
|
+
},
|
|
106
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import SourceCard from "../components/sourceCard";
|
|
3
|
+
declare const meta: Meta<typeof SourceCard>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof SourceCard>;
|
|
6
|
+
export declare const Grid: Story;
|
|
7
|
+
export declare const Static: Story;
|
|
8
|
+
export declare const WithAction: Story;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CheckSquare, FileText, MessageSquare, Paperclip } from "lucide-react";
|
|
3
|
+
import SourceCard from "../components/sourceCard";
|
|
4
|
+
import { Grid as CardGrid } from "../components/layout";
|
|
5
|
+
var meta = {
|
|
6
|
+
title: "Components/SourceCard",
|
|
7
|
+
component: SourceCard,
|
|
8
|
+
decorators: [
|
|
9
|
+
function (Story) { return (<div style={{ maxWidth: "560px" }}>
|
|
10
|
+
<Story />
|
|
11
|
+
</div>); },
|
|
12
|
+
],
|
|
13
|
+
};
|
|
14
|
+
export default meta;
|
|
15
|
+
export var Grid = {
|
|
16
|
+
render: function () { return (<CardGrid columns={2}>
|
|
17
|
+
<SourceCard icon={FileText} title="Pricing notes" meta="Knowledge base · Updated Mar 4" href="/docs/pricing"/>
|
|
18
|
+
<SourceCard icon={Paperclip} title="q3-budget.xlsx" meta="Files" href="/files/q3-budget"/>
|
|
19
|
+
<SourceCard icon={MessageSquare} title="Launch plan thread" meta="Chat · #launch" href="/chat/launch"/>
|
|
20
|
+
<SourceCard icon={CheckSquare} title="Write the release notes" meta="Task · Due Friday" onClick={function () { }}/>
|
|
21
|
+
<SourceCard icon={FileText} title="A very long document title that cannot fit on one line of the card" meta="A very long place name that cannot fit on one line of the card either" href="https://example.com/long"/>
|
|
22
|
+
<SourceCard icon={FileText} title="Roadmap" href="/docs/roadmap"/>
|
|
23
|
+
</CardGrid>); },
|
|
24
|
+
};
|
|
25
|
+
export var Static = {
|
|
26
|
+
render: function () { return <SourceCard icon={FileText} title="Weekly summary" meta="Made by Acme Agent · Today"/>; },
|
|
27
|
+
};
|
|
28
|
+
export var WithAction = {
|
|
29
|
+
render: function () { return (<CardGrid columns={2}>
|
|
30
|
+
<SourceCard icon={FileText} title="Pricing notes" meta="Knowledge base" action="Open" href="/docs/pricing"/>
|
|
31
|
+
<SourceCard icon={CheckSquare} title="Write the release notes" meta="Task" action="Show" onClick={function () { }}/>
|
|
32
|
+
</CardGrid>); },
|
|
33
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import StepList from "../components/stepList";
|
|
3
|
+
declare const meta: Meta<typeof StepList>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof StepList>;
|
|
6
|
+
export declare const Progress: Story;
|
|
7
|
+
export declare const Plan: Story;
|
|
8
|
+
export declare const Ended: Story;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import StepList from "../components/stepList";
|
|
3
|
+
var meta = {
|
|
4
|
+
title: "Components/StepList",
|
|
5
|
+
component: StepList,
|
|
6
|
+
decorators: [
|
|
7
|
+
function (Story) { return (<div style={{ maxWidth: "400px" }}>
|
|
8
|
+
<Story />
|
|
9
|
+
</div>); },
|
|
10
|
+
],
|
|
11
|
+
};
|
|
12
|
+
export default meta;
|
|
13
|
+
export var Progress = {
|
|
14
|
+
render: function () { return (<StepList aria-label="Acme Agent progress" steps={[
|
|
15
|
+
{ label: "Read the file", status: "done" },
|
|
16
|
+
{ label: "Find the failing test", status: "done" },
|
|
17
|
+
{ label: "Edit the code", status: "running", detail: "src/billing.ts" },
|
|
18
|
+
{ label: "Run the tests" },
|
|
19
|
+
{ label: "Write a summary" },
|
|
20
|
+
]}/>); },
|
|
21
|
+
};
|
|
22
|
+
export var Plan = {
|
|
23
|
+
render: function () { return (<StepList numbered aria-label="Plan" steps={[
|
|
24
|
+
{ label: "Back up the project" },
|
|
25
|
+
{ label: "Update the billing code", detail: "Changes 3 files" },
|
|
26
|
+
{ label: "Run the tests" },
|
|
27
|
+
]}/>); },
|
|
28
|
+
};
|
|
29
|
+
export var Ended = {
|
|
30
|
+
render: function () { return (<StepList aria-label="Import" steps={[
|
|
31
|
+
{ label: "Read the file", status: "done" },
|
|
32
|
+
{ label: "Check the rows", status: "failed", detail: "Row 12 has no email address" },
|
|
33
|
+
{ label: "Save the people", status: "cancelled" },
|
|
34
|
+
]}/>); },
|
|
35
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import UserImage from "../components/userImage";
|
|
3
|
+
import Surface from "../components/surface";
|
|
3
4
|
var meta = {
|
|
4
5
|
title: "Components/UserImage",
|
|
5
6
|
component: UserImage,
|
|
@@ -54,3 +55,21 @@ export var Sizes = {
|
|
|
54
55
|
<UserImage userHandle="Jane Smith" userImgUrl="https://i.pravatar.cc/150?img=5" size={48} referrerPolicy="no-referrer"/>
|
|
55
56
|
</div>); },
|
|
56
57
|
};
|
|
58
|
+
// An agent shows an icon on the panel background, never a photo or an initial. `userHandle` is its accessible name.
|
|
59
|
+
export var Icon = {
|
|
60
|
+
render: function () { return (<div style={{ display: "flex", gap: "8px", alignItems: "center" }}>
|
|
61
|
+
<UserImage userHandle="Acme Agent" icon="Bot"/>
|
|
62
|
+
<UserImage userHandle="Acme Agent" icon="Bot" size={32}/>
|
|
63
|
+
<UserImage userHandle="Acme Agent" icon="Sparkles" size={48}/>
|
|
64
|
+
</div>); },
|
|
65
|
+
};
|
|
66
|
+
// The icon circle reads on the page and on a panel, in light and dark.
|
|
67
|
+
export var IconOnPanel = {
|
|
68
|
+
render: function () { return (<Surface>
|
|
69
|
+
<div style={{ display: "flex", gap: "8px", alignItems: "center" }}>
|
|
70
|
+
<UserImage userHandle="Acme Agent" icon="Bot"/>
|
|
71
|
+
<UserImage userHandle="Acme Agent" icon="Bot" size={32}/>
|
|
72
|
+
<UserImage userHandle="Acme Agent" icon="Sparkles" size={48}/>
|
|
73
|
+
</div>
|
|
74
|
+
</Surface>); },
|
|
75
|
+
};
|
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.17.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -47,8 +47,9 @@
|
|
|
47
47
|
"pretest": "npm run build",
|
|
48
48
|
"test": "node --test scripts/*.test.js scripts/tokens/*.test.js scripts/cases/*.test.js",
|
|
49
49
|
"check:contrast": "node scripts/check-contrast.js",
|
|
50
|
-
"test:visual": "playwright test",
|
|
51
|
-
"test:visual:update": "playwright test --update-snapshots"
|
|
50
|
+
"test:visual": "playwright test tests/stories.spec.ts",
|
|
51
|
+
"test:visual:update": "playwright test tests/stories.spec.ts --update-snapshots",
|
|
52
|
+
"test:interactions": "playwright test tests/interactions.spec.ts"
|
|
52
53
|
},
|
|
53
54
|
"dependencies": {
|
|
54
55
|
"@popperjs/core": "^2.11.8",
|