tooltip.stories.tsx 939 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import OLButton from '@/features/ui/components/ol/ol-button'
  2. import OLTooltip from '@/features/ui/components/ol/ol-tooltip'
  3. import { Meta } from '@storybook/react'
  4. export const Tooltips = () => {
  5. const placements = ['top', 'right', 'bottom', 'left'] as const
  6. return (
  7. <div
  8. style={{
  9. width: '200px',
  10. display: 'flex',
  11. flexDirection: 'column',
  12. margin: '0 auto',
  13. padding: '35px 0',
  14. gap: '35px',
  15. }}
  16. >
  17. {placements.map(placement => (
  18. <OLTooltip
  19. key={placement}
  20. id={`tooltip-${placement}`}
  21. description={`Tooltip on ${placement}`}
  22. overlayProps={{ placement }}
  23. >
  24. <OLButton variant="secondary">Tooltip on {placement}</OLButton>
  25. </OLTooltip>
  26. ))}
  27. </div>
  28. )
  29. }
  30. const meta: Meta<typeof OLTooltip> = {
  31. title: 'Shared / Components / Tooltip',
  32. component: OLTooltip,
  33. }
  34. export default meta