Skip to content

Commit d3d7121

Browse files
Merge pull request #374 from storybookjs/update-cardinal-icon
Update cardinal icon
2 parents 7cf67e5 + 30cca78 commit d3d7121

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

src/components/Cardinal.stories.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { action } from '@storybook/addon-actions';
22
import React from 'react';
33

44
import { Cardinal } from './Cardinal';
5+
import { Icon } from './Icon';
56

67
const onHover = action('hover');
78
const onClick = action('click');
@@ -179,3 +180,20 @@ export const LargePlural = () => <Cardinal size="large" count={2} text="Story" /
179180
LargePlural.story = {
180181
name: 'large plural',
181182
};
183+
184+
export const WithIcon = () => (
185+
<Cardinal
186+
size="small"
187+
count={14}
188+
TextWrapper={() => (
189+
<span>
190+
Changes
191+
<Icon icon="question" aria-label="More info" />
192+
</span>
193+
)}
194+
/>
195+
);
196+
197+
WithIcon.story = {
198+
name: 'with icon',
199+
};

src/components/Cardinal.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ const CardinalInner = styled.div<CardinalInnerProps>`
7878
text-align: ${(props) => props.alignment};
7979
8080
svg {
81+
width: 12px;
8182
height: 12px;
82-
margin: 1px 0;
83+
margin: 1px 0 0 4px;
8384
vertical-align: top;
8485
color: inherit;
8586
}

0 commit comments

Comments
 (0)