Fix/16207/text component storybook (#16214)

feature/default_network_editable
Garrett Bear 2 years ago committed by GitHub
parent c00749dcf7
commit 4581a3ac77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      ui/components/component-library/text/README.mdx
  2. 9
      ui/components/component-library/text/text.stories.js

@ -269,6 +269,7 @@ import { Text } from '../../ui/component-library/text';
<Text as="p">p</Text> <Text as="p">p</Text>
<Text as="span">span</Text> <Text as="span">span</Text>
<Text as="strong">strong</Text> <Text as="strong">strong</Text>
<Text as="input" placeholder="input"></Text>
``` ```
Renders the html: Renders the html:
@ -288,6 +289,7 @@ Renders the html:
<p>p</p> <p>p</p>
<span>span</span> <span>span</span>
<strong>strong</strong> <strong>strong</strong>
<input placeholder="input" />
``` ```
### Box Props ### Box Props

@ -259,12 +259,17 @@ export const Ellipsis = (args) => (
export const As = (args) => ( export const As = (args) => (
<> <>
{Object.values(ValidTags).map((tag) => ( {ValidTags.map((tag) => {
if (tag === 'input') {
return <Text key={tag} {...args} as={tag} placeholder={tag} />;
}
return (
<div key={tag}> <div key={tag}>
<Text {...args} as={tag}> <Text {...args} as={tag}>
{tag} {tag}
</Text> </Text>
</div> </div>
))} );
})}
</> </>
); );

Loading…
Cancel
Save