Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/dataDisplay/IconText/index.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,30 @@ export const IconMargin = (): React.ReactElement => {
</>
);
};

export const Color = (): React.ReactElement => {
return (
<>
<IconText
iconSize="sm"
margin="sm"
textSize="xl"
iconType="alert"
iconColor="warning"
text="Alert message"
iconSide="left"
color="error"
/>
<IconText
iconSize="sm"
margin="sm"
textSize="xl"
iconType="externalLink"
iconColor="primary"
text="External link"
iconSide="right"
color="text"
/>
</>
);
};
6 changes: 4 additions & 2 deletions src/dataDisplay/IconText/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import Text from '../Text';
type Props = {
iconType: keyof IconType;
iconSize: ThemeIconSize;
iconColor?: ThemeColors;
margin?: ThemeMargin;
textSize: ThemeTextSize;
color?: ThemeColors;
Expand Down Expand Up @@ -45,6 +46,7 @@ const IconText = ({
margin = 'xs',
textSize,
iconType,
iconColor,
text,
iconSide = 'left',
color,
Expand All @@ -55,11 +57,11 @@ const IconText = ({
<Text size={textSize} color={color}>
{text}
</Text>
<Icon size={iconSize} type={iconType} color={color} />
<Icon size={iconSize} type={iconType} color={iconColor} />
</RightIconText>
) : (
<LeftIconText className={className} margin={margin}>
<Icon size={iconSize} type={iconType} color={color} />
<Icon size={iconSize} type={iconType} color={iconColor} />
<Text size={textSize} color={color}>
{text}
</Text>
Expand Down
Loading