buttons.stories.tsx 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import { Meta, StoryObj } from '@storybook/react'
  2. import OLButton from '@/shared/components/ol/ol-button'
  3. import { ButtonProps } from '@/shared/components/types/button-props'
  4. export default {
  5. title: 'Shared / Components / Button',
  6. component: OLButton,
  7. } satisfies Meta
  8. type Story = StoryObj<typeof OLButton>
  9. const variants: ButtonProps['variant'][] = [
  10. 'primary',
  11. 'secondary',
  12. 'ghost',
  13. 'danger',
  14. 'danger-ghost',
  15. 'premium',
  16. 'premium-secondary',
  17. 'link',
  18. ]
  19. export const Variants: Story = {
  20. render() {
  21. return (
  22. <div className="d-flex flex-column gap-2">
  23. {variants.map(variant => (
  24. <div key={variant} className="d-flex gap-2">
  25. <OLButton variant={variant}>Button</OLButton>
  26. <OLButton variant={variant} isLoading>
  27. Button
  28. </OLButton>
  29. <OLButton variant={variant} disabled>
  30. Button
  31. </OLButton>
  32. <OLButton variant={variant} size="sm">
  33. Button
  34. </OLButton>
  35. </div>
  36. ))}
  37. </div>
  38. )
  39. },
  40. }