|
| 1 | +import React from 'react'; |
| 2 | +import { ComponentStory, ComponentMeta } from '@storybook/react'; |
| 3 | +import { Accordion } from '../..'; |
| 4 | + |
| 5 | +const description = 'Accordion component is use to display large amount of content in a compress and progressive way.'; |
| 6 | + |
| 7 | +export default { |
| 8 | + title: 'Components/Accordion', |
| 9 | + component: Accordion, |
| 10 | + parameters: { |
| 11 | + docs: { |
| 12 | + description: { |
| 13 | + component: description |
| 14 | + } |
| 15 | + } |
| 16 | + }, |
| 17 | + argTypes: { |
| 18 | + onExpand: { table: { disable: true } }, |
| 19 | + onCollapse: { table: { disable: true } }, |
| 20 | + heading: { description: 'Sets the heading text' }, |
| 21 | + description: { description: 'Sets the description text' }, |
| 22 | + info: { description: 'Sets the info text' }, |
| 23 | + buttonLabel: { description: 'Sets the button text' }, |
| 24 | + defaultExpanded: { |
| 25 | + description: 'Sets if the component should be expanded or collapsed by default', |
| 26 | + options: [true, false], |
| 27 | + control: { type: 'radio' } |
| 28 | + }, |
| 29 | + variant: { |
| 30 | + description: 'Sets the accordion variant', |
| 31 | + options: ['default', 'compact'], |
| 32 | + control: { type: 'radio' } |
| 33 | + } |
| 34 | + } |
| 35 | +} as ComponentMeta<typeof Accordion>; |
| 36 | + |
| 37 | +const Template: ComponentStory<typeof Accordion> = args => <Accordion {...args} />; |
| 38 | + |
| 39 | +export const Default = Template.bind({}); |
| 40 | +Default.args = { |
| 41 | + heading: 'A Headline', |
| 42 | + description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', |
| 43 | + info: 'Lorem ipsum', |
| 44 | + buttonLabel: 'Expand/Collapse', |
| 45 | + children: |
| 46 | + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis lobortis ante lectus, eget condimentum libero suscipit vitae. Nunc vestibulum eleifend turpis, sed tempus lectus. Etiam a facilisis felis, at molestie enim.' |
| 47 | +}; |
| 48 | + |
| 49 | +export const Compact = Template.bind({}); |
| 50 | +Compact.args = { |
| 51 | + variant: 'compact', |
| 52 | + heading: 'A Headline', |
| 53 | + description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', |
| 54 | + children: |
| 55 | + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis lobortis ante lectus, eget condimentum libero suscipit vitae. Nunc vestibulum eleifend turpis, sed tempus lectus. Etiam a facilisis felis, at molestie enim.' |
| 56 | +}; |
0 commit comments