button.stories.tsx 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import Button from '@/features/ui/components/bootstrap-5/button'
  2. import { Meta } from '@storybook/react'
  3. type Args = React.ComponentProps<typeof Button>
  4. export const NewButton = (args: Args) => {
  5. return <Button {...args} />
  6. }
  7. export const ButtonWithLeadingIcon = (args: Args) => {
  8. return <Button leadingIcon="add" {...args} />
  9. }
  10. export const ButtonWithTrailingIcon = (args: Args) => {
  11. return <Button trailingIcon="add" {...args} />
  12. }
  13. export const ButtonWithIcons = (args: Args) => {
  14. return <Button trailingIcon="add" leadingIcon="add" {...args} />
  15. }
  16. const meta: Meta<typeof Button> = {
  17. title: 'Shared / Components / Button',
  18. component: Button,
  19. args: {
  20. children: 'A Button',
  21. disabled: false,
  22. isLoading: false,
  23. },
  24. argTypes: {
  25. size: {
  26. control: 'radio',
  27. options: ['small', 'default', 'large'],
  28. },
  29. variant: {
  30. control: 'radio',
  31. options: [
  32. 'primary',
  33. 'secondary',
  34. 'ghost',
  35. 'danger',
  36. 'danger-ghost',
  37. 'premium',
  38. 'premium-secondary',
  39. ],
  40. },
  41. },
  42. }
  43. export default meta