Skip to content

Commit

Permalink
chore: adjust typography stories
Browse files Browse the repository at this point in the history
  • Loading branch information
Karine Brandelli Padilha committed Dec 30, 2024
1 parent aa1fe83 commit 34b4a76
Showing 1 changed file with 46 additions and 8 deletions.
54 changes: 46 additions & 8 deletions src/core/data-display/typography/typography.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import React from 'react'
import type { Meta, StoryObj } from '@storybook/react'
import Typography from '.'
import { theme } from '@/theme'

const { primary } = theme.colors

const meta: Meta<typeof Typography> = {
title: 'DataDisplay/Typography',
Expand Down Expand Up @@ -29,9 +32,9 @@ const meta: Meta<typeof Typography> = {
control: { type: 'radio' },
description:
'The variants based on the HTML tags. Must be ' +
'`h1 | h2 | h3 | h4 | h5 | h6 | subtitle1 | subtitle2 | body1 | body2`' +
'`| caption | button | overline`. ' +
'If not set, the default is "body1"'
'`h1 | h2 | h3 | h4 | h5 | h6 | subtitle1 | subtitle2 | body1 |` ' +
'` body2 | caption | button | overline`. ' +
'If not set, the default is `body2`.'
},
color: {
options: [
Expand All @@ -40,13 +43,23 @@ const meta: Meta<typeof Typography> = {
'secondary',
'error',
'textPrimary',
'textSecondary'
'textSecondary',
'textDisabled'
],
control: { type: 'radio' },
description:
'The text color. Must be ' +
'`default | primary | secondary | error | textPrimary | textSecondary `. ' +
'If not set, the default is "default"'
'`default | primary | secondary | error |` ' +
'`textPrimary | textSecondary | textDisabled.` ' +
'If not set, the default is `default`.'
},
align: {
options: ['inherit', 'center', 'right', 'left', 'justify'],
control: { type: 'radio' },
description:
'The text alignment. Must be ' +
'`inherit | center | right | left | justify.` ' +
'If not set, the default is `left`.'
},
margin: {
control: 'text',
Expand All @@ -69,12 +82,37 @@ type Story = StoryObj<typeof Typography>

export const typography: Story = {
render: ({ ...args }) => {
return <Typography {...args} />
return (
<>
<Typography
variant='subtitle2'
color='primary'
align='center'
width='70%'
margin='0 auto 48px'>
Como um utilitário CSS, o componente Typography também
suporta todas as propriedades{' '}
<a
target='_blank'
href='https://mui.com/system/properties/'
style={{
color: primary.light,
textDecoration: 'none'
}}>
system
</a>
. Você pode usá-las como props diretamente no componente.
</Typography>

<Typography {...args} />
</>
)
},
args: {
children: 'This is a text!',
children: 'This is Typography component text!',
variant: 'body1',
color: 'default',
align: 'left',
margin: '0px',
padding: '0px',
style: {}
Expand Down

0 comments on commit 34b4a76

Please sign in to comment.