|
| 1 | +import { storiesOf } from '@storybook/vue' |
| 2 | +import centered from '@storybook/addon-centered/vue' |
| 3 | +import { Alert, AlertIcon, AlertTitle, AlertDescription } from '../src/components/Alert' |
| 4 | + |
| 5 | +storiesOf('UI | Alert', module) |
| 6 | + .addDecorator(centered) |
| 7 | + .add('Default Alert', () => ({ |
| 8 | + components: { Alert }, |
| 9 | + template: ` |
| 10 | + <div> |
| 11 | + <Alert>Kiwi is the best Vue component library</Alert> |
| 12 | + </div> |
| 13 | + ` |
| 14 | + })) |
| 15 | + .add('With icon', () => ({ |
| 16 | + components: { Alert, AlertIcon }, |
| 17 | + template: ` |
| 18 | + <div> |
| 19 | + <Alert mb="3" status="info"> |
| 20 | + <AlertIcon /> |
| 21 | + Kiwi is the best Vue component library |
| 22 | + </Alert> |
| 23 | + </div> |
| 24 | + ` |
| 25 | + })) |
| 26 | + .add('With status', () => ({ |
| 27 | + components: { Alert, AlertIcon }, |
| 28 | + template: ` |
| 29 | + <div> |
| 30 | + <Alert mb="3" status="error"> |
| 31 | + <AlertIcon /> |
| 32 | + There was an error processing your request |
| 33 | + </Alert> |
| 34 | +
|
| 35 | + <Alert mb="3" status="success"> |
| 36 | + <AlertIcon /> |
| 37 | + Data uploaded to the server. Fire on! |
| 38 | + </Alert> |
| 39 | +
|
| 40 | + <Alert mb="3" status="warning"> |
| 41 | + <AlertIcon /> |
| 42 | + Seems your account is about expire, upgrade now |
| 43 | + </Alert> |
| 44 | +
|
| 45 | + <Alert mb="3" status="info"> |
| 46 | + <AlertIcon /> |
| 47 | + Kiwi is going live on December 31st. Get ready! |
| 48 | + </Alert> |
| 49 | + </div> |
| 50 | + ` |
| 51 | + })) |
| 52 | + .add('With composed description', () => ({ |
| 53 | + components: { Alert, AlertIcon, AlertTitle, AlertDescription }, |
| 54 | + template: ` |
| 55 | + <div> |
| 56 | + <Alert |
| 57 | + status="success" |
| 58 | + variant="subtle" |
| 59 | + flexDirection="column" |
| 60 | + justifyContent="center" |
| 61 | + textAlign="center" |
| 62 | + height="200px" |
| 63 | + > |
| 64 | + <AlertIcon size="40px" mr="0" /> |
| 65 | + <AlertTitle mt="4" mb="1" fontSize="lg"> |
| 66 | + Event created! |
| 67 | + </AlertTitle> |
| 68 | + <AlertDescription maxWidth="sm"> |
| 69 | + Your event has been successfully created. Our team will get back to you soon. |
| 70 | + </AlertDescription> |
| 71 | + </Alert> |
| 72 | + </div> |
| 73 | + ` |
| 74 | + })) |
0 commit comments