2021-11-16 12:33:01 +00:00
|
|
|
import { Meta, Story } from '@storybook/react';
|
|
|
|
import { PropsWithChildren } from 'react';
|
2022-11-28 02:00:28 +00:00
|
|
|
import { Play, RefreshCw, Square, Trash2 } from 'lucide-react';
|
2021-11-16 12:33:01 +00:00
|
|
|
|
|
|
|
import { Button } from './Button';
|
|
|
|
import { ButtonGroup, Props } from './ButtonGroup';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
component: ButtonGroup,
|
|
|
|
title: 'Components/Buttons/ButtonGroup',
|
|
|
|
} as Meta;
|
|
|
|
|
|
|
|
function Template({
|
|
|
|
size,
|
|
|
|
}: JSX.IntrinsicAttributes & PropsWithChildren<Props>) {
|
|
|
|
return (
|
|
|
|
<ButtonGroup size={size}>
|
2022-11-28 02:00:28 +00:00
|
|
|
<Button icon={Play} color="primary" onClick={() => {}}>
|
2021-11-16 12:33:01 +00:00
|
|
|
Start
|
|
|
|
</Button>
|
2022-11-28 02:00:28 +00:00
|
|
|
<Button icon={Square} color="danger" onClick={() => {}}>
|
2021-11-16 12:33:01 +00:00
|
|
|
Stop
|
|
|
|
</Button>
|
2022-11-28 02:00:28 +00:00
|
|
|
<Button icon={RefreshCw} color="primary" onClick={() => {}}>
|
2021-11-16 12:33:01 +00:00
|
|
|
Restart
|
|
|
|
</Button>
|
2022-11-28 02:00:28 +00:00
|
|
|
<Button icon={Play} color="primary" disabled onClick={() => {}}>
|
2021-11-16 12:33:01 +00:00
|
|
|
Resume
|
|
|
|
</Button>
|
2022-11-28 02:00:28 +00:00
|
|
|
<Button icon={Trash2} color="danger" onClick={() => {}}>
|
2021-11-16 12:33:01 +00:00
|
|
|
Remove
|
|
|
|
</Button>
|
|
|
|
</ButtonGroup>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export const Primary: Story<PropsWithChildren<Props>> = Template.bind({});
|
|
|
|
Primary.args = {
|
|
|
|
size: 'small',
|
|
|
|
};
|
|
|
|
|
|
|
|
export function Xsmall() {
|
|
|
|
return (
|
|
|
|
<ButtonGroup size="xsmall">
|
2022-11-28 02:00:28 +00:00
|
|
|
<Button icon={Play} color="primary" onClick={() => {}}>
|
2021-11-16 12:33:01 +00:00
|
|
|
Start
|
|
|
|
</Button>
|
2022-11-28 02:00:28 +00:00
|
|
|
<Button icon={Square} color="danger" onClick={() => {}}>
|
2021-11-16 12:33:01 +00:00
|
|
|
Stop
|
|
|
|
</Button>
|
2022-11-28 02:00:28 +00:00
|
|
|
<Button icon={Play} color="primary" onClick={() => {}}>
|
2021-11-16 12:33:01 +00:00
|
|
|
Start
|
|
|
|
</Button>
|
2022-11-28 02:00:28 +00:00
|
|
|
<Button icon={RefreshCw} color="primary" onClick={() => {}}>
|
2021-11-16 12:33:01 +00:00
|
|
|
Restart
|
|
|
|
</Button>
|
|
|
|
</ButtonGroup>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export function Small() {
|
|
|
|
return (
|
|
|
|
<ButtonGroup size="small">
|
2022-11-28 02:00:28 +00:00
|
|
|
<Button icon={Play} color="primary" onClick={() => {}}>
|
2021-11-16 12:33:01 +00:00
|
|
|
Start
|
|
|
|
</Button>
|
2022-11-28 02:00:28 +00:00
|
|
|
<Button icon={Square} color="danger" onClick={() => {}}>
|
2021-11-16 12:33:01 +00:00
|
|
|
Stop
|
|
|
|
</Button>
|
2022-11-28 02:00:28 +00:00
|
|
|
<Button icon={Play} color="primary" onClick={() => {}}>
|
2021-11-16 12:33:01 +00:00
|
|
|
Start
|
|
|
|
</Button>
|
2022-11-28 02:00:28 +00:00
|
|
|
<Button icon={RefreshCw} color="primary" onClick={() => {}}>
|
2021-11-16 12:33:01 +00:00
|
|
|
Restart
|
|
|
|
</Button>
|
|
|
|
</ButtonGroup>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export function Large() {
|
|
|
|
return (
|
|
|
|
<ButtonGroup size="large">
|
2022-11-28 02:00:28 +00:00
|
|
|
<Button icon={Play} color="primary" onClick={() => {}}>
|
2021-11-16 12:33:01 +00:00
|
|
|
Start
|
|
|
|
</Button>
|
2022-11-28 02:00:28 +00:00
|
|
|
<Button icon={Square} color="danger" onClick={() => {}}>
|
2021-11-16 12:33:01 +00:00
|
|
|
Stop
|
|
|
|
</Button>
|
2022-11-28 02:00:28 +00:00
|
|
|
<Button icon={Play} color="light" onClick={() => {}}>
|
2021-11-16 12:33:01 +00:00
|
|
|
Start
|
|
|
|
</Button>
|
2022-11-28 02:00:28 +00:00
|
|
|
<Button icon={RefreshCw} color="primary" onClick={() => {}}>
|
2021-11-16 12:33:01 +00:00
|
|
|
Restart
|
|
|
|
</Button>
|
|
|
|
</ButtonGroup>
|
|
|
|
);
|
|
|
|
}
|