icon-button.stories.tsx 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import IconButton from '@/shared/components/button/icon-button'
  2. import type { Meta } from '@storybook/react-webpack5'
  3. import { useTranslation } from 'react-i18next'
  4. import { figmaDesignUrl } from '../../../.storybook/utils/figma-design-url'
  5. type Args = React.ComponentProps<typeof IconButton>
  6. export const Icon = (args: Args) => {
  7. const { t } = useTranslation()
  8. return <IconButton accessibilityLabel={t('add')} disabled {...args} />
  9. }
  10. const meta: Meta<typeof IconButton> = {
  11. title: 'Shared / Components / IconButton',
  12. component: IconButton,
  13. args: {
  14. disabled: false,
  15. icon: 'add',
  16. isLoading: false,
  17. },
  18. argTypes: {
  19. size: {
  20. control: 'radio',
  21. options: ['small', 'default', 'large'],
  22. },
  23. variant: {
  24. control: 'radio',
  25. options: [
  26. 'primary',
  27. 'secondary',
  28. 'ghost',
  29. 'danger',
  30. 'danger-ghost',
  31. 'premium',
  32. ],
  33. },
  34. },
  35. parameters: figmaDesignUrl(
  36. 'https://www.figma.com/design/V7Ogph1Ocs4ux2A4WMNAh7/Overleaf---Components?node-id=3460-168934&m=dev'
  37. ),
  38. }
  39. export default meta