Skip to content

Commit

Permalink
allow inherit to use brand evolution style
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettbear committed Aug 27, 2024
1 parent 2cdc110 commit 11b0a1d
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions ui/components/component-library/text/text.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,23 @@ export const Strong: StoryFn<typeof Text> = (args) => (

export const IsBrandEvolution = (args) => (
<>
{Object.values(TextVariant).map((variant) => (
<Text {...args} variant={variant} key={variant}>
{args.children || variant}
</Text>
))}
{Object.values(TextVariant).map((variant) => {
// Wrap TextVariant.inherit in a span to show it's inherited styles
if (variant === TextVariant.inherit) {
return (
<Text as="span" {...args}>
<Text {...args} variant={variant} key={variant}>
{args.children || variant}
</Text>
</Text>
);
}
return (
<Text {...args} variant={variant} key={variant}>
{args.children || variant}
</Text>
);
})}
</>
);

Expand Down

0 comments on commit 11b0a1d

Please sign in to comment.