UNPKG

@eureca/eureca-ui

Version:

UI component library of Eureca's user and admin apps

78 lines (66 loc) 2.02 kB
import { Meta, Story, Preview, Title, Subtitle, Description, Props, } from '@storybook/addon-docs/blocks'; import { withKnobs } from '@storybook/addon-knobs'; import { Box, ThemeProvider } from '@material-ui/core'; import MuiTheme from '../../../theme/mui'; import { Flex } from '../../Flex'; import { Phone } from '../'; import { PhoneInput } from './phone.stories.js'; <Meta title='Material/Inputs' component={Phone} decorators={[withKnobs]}/> <Title>Phone Input</Title> <Description> Input de números de telefone dos aplicativos Eureca, extendido do `TextField` do `Material-UI`. </Description> <Description> Contém todas as props definidas no [Material-UI](https://material-ui.com/components/text-fields/#text-field) e tem estilo definido pelo tema desta biblioteca. </Description> <Preview> <Story name="Phone Input"> <PhoneInput /> </Story> </Preview> <Subtitle>Props</Subtitle> | Nome | Descrição | Default | |:-------:|:-------------------------------:|:-----------:| | name | Nome do input do Material-UI <br /> string | - | | label | Label input do Material-UI <br /> string | - | | helperText | Texto localizado na parte inferior do input do Material-UI <br /> string | - | | value | Valor do input do Material-UI <br /> string \| number | - | | onChange | Função de onChange do input do Material-UI <br /> func| - | | props | Todas as props aceitas pelo TextField do Material-UI <br /> | - | <Subtitle>Variações</Subtitle> <Preview> <ThemeProvider theme={MuiTheme}> <Phone label='Small' size='small' onChange={() => {}} /> <Box width={300} mt={3}> <Phone label='Largura definida' onChange={() => {}} /> </Box> </ThemeProvider> </Preview> <Subtitle>Exemplo de Aplicação</Subtitle> ```jsx <Phone name='input-name' label="Label" value={value} variant={variant} onChange={handleChange} helperText='Helper text' disabled={isDisabled} error={hasError} /> ```