button.stories.tsx 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import { Meta } from '@storybook/react-webpack5'
  2. import { figmaDesignUrl } from '../../../.storybook/utils/figma-design-url'
  3. import OLButton from '@/shared/components/ol/ol-button'
  4. type Args = React.ComponentProps<typeof OLButton>
  5. export const NewButton = (args: Args) => {
  6. return <OLButton {...args} />
  7. }
  8. export const ButtonWithLeadingIcon = (args: Args) => {
  9. return <OLButton leadingIcon="add" {...args} />
  10. }
  11. export const ButtonWithTrailingIcon = (args: Args) => {
  12. return <OLButton trailingIcon="add" {...args} />
  13. }
  14. export const ButtonWithIcons = (args: Args) => {
  15. return <OLButton trailingIcon="add" leadingIcon="add" {...args} />
  16. }
  17. const meta: Meta<typeof OLButton> = {
  18. title: 'Shared / Components / Button',
  19. component: OLButton,
  20. args: {
  21. children: 'Button',
  22. disabled: false,
  23. isLoading: false,
  24. },
  25. argTypes: {
  26. size: {
  27. control: 'radio',
  28. options: ['lg', 'md', 'sm'],
  29. },
  30. variant: {
  31. control: 'radio',
  32. options: [
  33. 'primary',
  34. 'secondary',
  35. 'ghost',
  36. 'danger',
  37. 'danger-ghost',
  38. 'premium',
  39. 'premium-secondary',
  40. 'link',
  41. ],
  42. },
  43. },
  44. parameters: {
  45. controls: {
  46. include: ['children', 'disabled', 'isLoading', 'size', 'variant'],
  47. },
  48. ...figmaDesignUrl(
  49. 'https://www.figma.com/design/V7Ogph1Ocs4ux2A4WMNAh7/Overleaf---Components?node-id=3458-22412&m=dev'
  50. ),
  51. },
  52. }
  53. export default meta