Skip to content

Commit bd2923e

Browse files
Merge pull request #364 from storybookjs/update/all-icons
Update every icon (and add a few new ones)
2 parents 1dc31b1 + 5f00c3a commit bd2923e

10 files changed

Lines changed: 1038 additions & 360 deletions

File tree

src/components/Icon.stories.tsx

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,14 @@ const Item = styled.li<{ minimal?: boolean }>`
1313
display: inline-flex;
1414
flex-direction: row;
1515
align-items: center;
16-
flex: 0 1 20%;
16+
flex: 0 1 16%;
1717
min-width: 120px;
18-
19-
padding: 0px 7.5px 20px;
18+
margin: 16px;
2019
2120
svg {
22-
margin-right: 10px;
23-
width: 24px;
24-
height: 24px;
21+
margin-right: 6px;
22+
width: 14px;
23+
height: 14px;
2524
}
2625
2726
${(props) =>
@@ -31,13 +30,13 @@ const Item = styled.li<{ minimal?: boolean }>`
3130
min-width: auto;
3231
padding: 0;
3332
background: #fff;
34-
border: 1px solid #666;
33+
margin: 16px;
3534
3635
svg {
3736
display: block;
3837
margin-right: 0;
39-
width: 48px;
40-
height: 48px;
38+
width: 14px;
39+
height: 14px;
4140
}
4241
`};
4342
`;
@@ -46,6 +45,13 @@ const List = styled.ul`
4645
display: flex;
4746
flex-flow: row wrap;
4847
list-style: none;
48+
padding: 0;
49+
margin: 0;
50+
`;
51+
52+
const Header = styled.h2`
53+
font-size: 16px;
54+
margin: 16px;
4955
`;
5056

5157
export default {
@@ -58,7 +64,7 @@ Basic.args = { icon: 'watch' };
5864

5965
export const Labels = () => (
6066
<>
61-
There are {Object.keys(icons).length} icons
67+
<Header>{Object.keys(icons).length} icons</Header>
6268
<List>
6369
{Object.keys(icons).map((key) => (
6470
<Item key={key}>
@@ -71,11 +77,14 @@ export const Labels = () => (
7177
);
7278

7379
export const NoLabels = () => (
74-
<List>
75-
{Object.keys(icons).map((key) => (
76-
<Item minimal key={key}>
77-
<Icon icon={key as keyof typeof icons} aria-label={key} />
78-
</Item>
79-
))}
80-
</List>
80+
<>
81+
<Header>{Object.keys(icons).length} icons</Header>
82+
<List>
83+
{Object.keys(icons).map((key) => (
84+
<Item minimal key={key}>
85+
<Icon icon={key as keyof typeof icons} aria-label={key} />
86+
</Item>
87+
))}
88+
</List>
89+
</>
8190
);

src/components/Icon.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ const Svg = styled.svg`
2222
*/
2323
export const Icon: FunctionComponent<Props> = ({ icon, ...props }: Props) => {
2424
return (
25-
<Svg viewBox="0 0 1024 1024" width="20px" height="20px" {...props}>
26-
<path d={icons[icon]} />
25+
<Svg viewBox="0 0 14 14" width="14px" height="14px" {...props}>
26+
<>{icons[icon]}</>
2727
</Svg>
2828
);
2929
};
3030

31-
interface Props {
31+
export interface Props {
3232
icon: keyof typeof icons;
3333
}

src/components/Input.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ const InputWrapper = styled.div<Pick<Props, 'error' | 'stackLevel' | 'appearance
159159
` : css `
160160
font-size: ${typography.size.s2}px;
161161
`}
162-
height: 1em;
163-
width: 1em;
164-
margin-top: -.525em;
162+
height: 12px;
163+
width: 12px;
164+
margin-top: -6px;
165165
z-index: 3;
166166
${props.appearance === 'pill' || props.appearance === 'code' ? css`
167167
left: 10px;

src/components/Link.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ const LinkInner = styled.span<{ withArrow: boolean }>`
1010
props.withArrow &&
1111
css`
1212
> svg:last-of-type {
13-
height: 0.7em;
14-
width: 0.7em;
13+
height: 0.65em;
14+
width: 0.65em;
1515
margin-right: 0;
1616
margin-left: 0.25em;
1717
bottom: auto;

src/components/clipboard/ClipboardCode.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ const Code = styled.pre`
1818

1919
const StyledClipboardIcon = styled(ClipboardIcon)`
2020
position: absolute;
21-
top: 8px;
22-
right: 8px;
21+
top: 4px;
22+
right: 4px;
2323
`;
2424

2525
interface ClipboardCodeProps {

src/components/clipboard/ClipboardIcon.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { Icon } from '../Icon';
55
import { Clipboard } from './Clipboard';
66

77
const StyledClipboard = styled(Clipboard)`
8-
line-height: 14px;
9-
padding: 5px;
8+
line-height: 10px;
9+
padding: 10px;
1010
color: ${color.mediumdark};
1111
&:hover {
1212
color: ${color.darker};
@@ -18,8 +18,8 @@ interface StyledIconProps {
1818
}
1919

2020
const StyledIcon = styled(Icon)<StyledIconProps>`
21-
width: 14px;
22-
height: 14px;
21+
width: 12px;
22+
height: 12px;
2323
vertical-align: top;
2424
color: ${(props) => (props.copied ? color.positive : 'inherit')};
2525
`;

src/components/clipboard/ClipboardInput.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
};
88

99
export const Default = () => (
10-
<div style={{ padding: '3em', width: 300 }}>
10+
<div style={{ padding: '3em', width: 320 }}>
1111
<ClipboardInput label="Label" value="https://www.chromatic.com" />
1212
</div>
1313
);

src/components/clipboard/ClipboardInput.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ const StyledInput = styled(Input as any)`
1111
width: 100%;
1212
display: block;
1313
&& input {
14-
padding-right: 26px !important;
14+
padding-right: 32px !important;
1515
}
1616
`;
1717

1818
const StyledClipboardIcon = styled(ClipboardIcon)`
1919
position: absolute;
20-
top: 4px;
21-
right: 4px;
20+
top: 0px;
21+
right: 0px;
2222
`;
2323

2424
type SubProps = React.ComponentPropsWithoutRef<typeof Input>;

src/components/shared/icons.ts

Lines changed: 0 additions & 325 deletions
This file was deleted.

0 commit comments

Comments
 (0)