Skip to content

Commit b540fce

Browse files
committed
feat(stories): Add CTA icon stories thing
Looks like this <img alt="clipboard.png" width="835" src="https://i.imgur.com/LBFUqEX.png" /> Based off of this ![clipboard.png](https://i.imgur.com/DDn88Nd.png)
1 parent 15f0d52 commit b540fce

File tree

1 file changed

+121
-0
lines changed

1 file changed

+121
-0
lines changed

static/app/icons/ctas.stories.tsx

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
import {Fragment} from 'react';
2+
import styled from '@emotion/styled';
3+
4+
import {PanelTable} from 'sentry/components/panels/panelTable';
5+
import {
6+
IconAdd,
7+
IconChevron,
8+
IconClock,
9+
IconClose,
10+
IconDelete,
11+
IconDocs,
12+
IconEdit,
13+
IconOpen,
14+
IconStar,
15+
IconSubtract,
16+
} from 'sentry/icons';
17+
18+
const FixedWidth = styled('div')`
19+
max-width: 800px;
20+
`;
21+
22+
interface CTAItem {
23+
ctaName: string;
24+
description: string;
25+
icon: React.ReactNode;
26+
}
27+
28+
const CTA_RECOMENDATIONS: CTAItem[] = [
29+
{
30+
icon: <IconAdd isCircled />,
31+
ctaName: 'Create',
32+
description: 'Spawn something from nothing',
33+
},
34+
{
35+
icon: <IconAdd isCircled />,
36+
ctaName: 'Add',
37+
description: 'Append another thing in the group',
38+
},
39+
{icon: <IconDelete />, ctaName: 'Delete', description: 'Destroy thing in the group'},
40+
{
41+
icon: <IconSubtract isCircled />,
42+
ctaName: 'Remove',
43+
description: 'Disconnect thing in the group',
44+
},
45+
{
46+
icon: null,
47+
ctaName: 'Manage',
48+
description: 'Broader meaning, includes bulk order, add, remove, etc.',
49+
},
50+
{
51+
icon: <IconEdit />,
52+
ctaName: 'Edit',
53+
description: 'Modifies fundamental attribute of the thing',
54+
},
55+
{
56+
icon: <IconOpen />,
57+
ctaName: 'Open in [Product]',
58+
description: 'Leaves existing view and goes to another product',
59+
},
60+
{
61+
icon: <IconClose />,
62+
ctaName: 'Close',
63+
description: 'Potentially reopen this again later',
64+
},
65+
{
66+
icon: <IconDocs />,
67+
ctaName: 'Read Docs',
68+
description: 'Sim to Open in but always goes to Sentry Docs',
69+
},
70+
{
71+
icon: null,
72+
ctaName: 'More [Samples]',
73+
description: 'See more samples of the same thing',
74+
},
75+
{
76+
icon: null,
77+
ctaName: 'Show More',
78+
description: 'Accordions down to reveal more content',
79+
},
80+
{
81+
icon: <IconChevron direction="down" />,
82+
ctaName: 'Expand',
83+
description: 'Content is completely hidden except for title',
84+
},
85+
{
86+
icon: <IconChevron direction="up" />,
87+
ctaName: 'Collapse',
88+
description: 'Content is completely shown and need to hide except title',
89+
},
90+
{icon: null, ctaName: 'Dismiss', description: 'Get rid of forever'},
91+
{
92+
icon: <IconClock />,
93+
ctaName: 'Remind Me Later',
94+
description: 'Pop something up again later',
95+
},
96+
{
97+
icon: <IconStar />,
98+
ctaName: 'Pin/Bookmark/Star',
99+
description: 'Favoriting/saving something',
100+
},
101+
];
102+
103+
export default function CTAs() {
104+
return (
105+
<FixedWidth>
106+
<h3>Call to Action recommendations</h3>
107+
<p>Here is some recomended iconography to use with call to actions.</p>
108+
<PanelTable headers={['Icon', 'CTA', 'Meaning']}>
109+
{CTA_RECOMENDATIONS.map(({icon, ctaName, description}) => {
110+
return (
111+
<Fragment key={ctaName}>
112+
<div>{icon}</div>
113+
<div>{ctaName}</div>
114+
<div>{description}</div>
115+
</Fragment>
116+
);
117+
})}
118+
</PanelTable>
119+
</FixedWidth>
120+
);
121+
}

0 commit comments

Comments
 (0)