|
| 1 | +import React from 'react' |
| 2 | +import { StoryFn as Story, Meta } from '@storybook/react' |
| 3 | + |
| 4 | +import Join, { JoinProps } from '.' |
| 5 | +import Button from '../Button' |
| 6 | +import Input from '../Input' |
| 7 | +import Select from '../Select' |
| 8 | +import Indicator from '../Indicator' |
| 9 | +import Badge from '../Badge' |
| 10 | + |
| 11 | +export default { |
| 12 | + title: 'Layout/Join (group items)', |
| 13 | + component: Join, |
| 14 | +} as Meta |
| 15 | + |
| 16 | +export const Default: Story<JoinProps> = (args) => { |
| 17 | + return ( |
| 18 | + <Join {...args}> |
| 19 | + <Button className="join-item">Button</Button> |
| 20 | + <Button className="join-item">Button</Button> |
| 21 | + <Button className="join-item">Button</Button> |
| 22 | + </Join> |
| 23 | + ) |
| 24 | +} |
| 25 | +Default.args = {} |
| 26 | + |
| 27 | +export const Vertically: Story<JoinProps> = (args) => { |
| 28 | + return ( |
| 29 | + <Join {...args}> |
| 30 | + <Button className="join-item">Button</Button> |
| 31 | + <Button className="join-item">Button</Button> |
| 32 | + <Button className="join-item">Button</Button> |
| 33 | + </Join> |
| 34 | + ) |
| 35 | +} |
| 36 | +Vertically.args = { |
| 37 | + vertical: true, |
| 38 | +} |
| 39 | + |
| 40 | +export const ExtraElementsInTheGroup: Story<JoinProps> = (args) => { |
| 41 | + return ( |
| 42 | + <Join {...args}> |
| 43 | + <div> |
| 44 | + <div> |
| 45 | + <Input className="join-item" placeholder="Search..." /> |
| 46 | + </div> |
| 47 | + </div> |
| 48 | + <Select className="join-item"> |
| 49 | + <Select.Option selected disabled> |
| 50 | + Category |
| 51 | + </Select.Option> |
| 52 | + <Select.Option>Sci-fi</Select.Option> |
| 53 | + <Select.Option>Drama</Select.Option> |
| 54 | + <Select.Option>Action</Select.Option> |
| 55 | + </Select> |
| 56 | + <Indicator item={<Badge color="secondary">new</Badge>}> |
| 57 | + <Button className="join-item">Search</Button> |
| 58 | + </Indicator> |
| 59 | + </Join> |
| 60 | + ) |
| 61 | +} |
| 62 | +ExtraElementsInTheGroup.args = {} |
| 63 | + |
| 64 | +export const CustomBorderRadius: Story<JoinProps> = (args) => { |
| 65 | + return ( |
| 66 | + <Join {...args}> |
| 67 | + <Input className="join-item" placeholder="Email" /> |
| 68 | + <Button className="join-item rounded-r-full">Subscribe</Button> |
| 69 | + </Join> |
| 70 | + ) |
| 71 | +} |
| 72 | +CustomBorderRadius.args = {} |
| 73 | + |
| 74 | +export const RadioInputsWithBtnStyle: Story<JoinProps> = (args) => { |
| 75 | + return ( |
| 76 | + <Join {...args}> |
| 77 | + <Input |
| 78 | + className="join-item btn" |
| 79 | + type="radio" |
| 80 | + name="options" |
| 81 | + aria-label="Radio 1" |
| 82 | + /> |
| 83 | + <Input |
| 84 | + className="join-item btn" |
| 85 | + type="radio" |
| 86 | + name="options" |
| 87 | + aria-label="Radio 2" |
| 88 | + /> |
| 89 | + <Input |
| 90 | + className="join-item btn" |
| 91 | + type="radio" |
| 92 | + name="options" |
| 93 | + aria-label="Radio 3" |
| 94 | + /> |
| 95 | + </Join> |
| 96 | + ) |
| 97 | +} |
| 98 | +RadioInputsWithBtnStyle.args = {} |
0 commit comments