toggle-button.stories.tsx 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import OLToggleButton from '@/shared/components/ol/ol-toggle-button'
  2. import OLToggleButtonGroup from '@/shared/components/ol/ol-toggle-button-group'
  3. import { figmaDesignUrl } from '../../../.storybook/utils/figma-design-url'
  4. export const Default = () => {
  5. return (
  6. <OLToggleButtonGroup
  7. type="radio"
  8. name="figure-width"
  9. defaultValue="0.5"
  10. aria-label="Image width"
  11. >
  12. <OLToggleButton variant="secondary" id="width-25p" value="0.25">
  13. ¼ width
  14. </OLToggleButton>
  15. <OLToggleButton variant="secondary" id="width-50p" value="0.5">
  16. ½ width
  17. </OLToggleButton>
  18. <OLToggleButton variant="secondary" id="width-75p" value="0.75">
  19. ¾ width
  20. </OLToggleButton>
  21. <OLToggleButton variant="secondary" id="width-100p" value="1.0">
  22. Full width
  23. </OLToggleButton>
  24. </OLToggleButtonGroup>
  25. )
  26. }
  27. export const Disabled = () => {
  28. return (
  29. <OLToggleButtonGroup
  30. type="radio"
  31. name="figure-width"
  32. defaultValue="0.5"
  33. aria-label="Image width"
  34. >
  35. <OLToggleButton variant="secondary" id="width-25p" disabled value="0.25">
  36. ¼ width
  37. </OLToggleButton>
  38. <OLToggleButton variant="secondary" id="width-50p" disabled value="0.5">
  39. ½ width
  40. </OLToggleButton>
  41. <OLToggleButton variant="secondary" id="width-75p" disabled value="0.75">
  42. ¾ width
  43. </OLToggleButton>
  44. <OLToggleButton variant="secondary" id="width-100p" disabled value="1.0">
  45. Full width
  46. </OLToggleButton>
  47. </OLToggleButtonGroup>
  48. )
  49. }
  50. export default {
  51. title: 'Shared / Components / Toggle Button Group',
  52. component: OLToggleButtonGroup,
  53. parameters: figmaDesignUrl(
  54. 'https://www.figma.com/design/V7Ogph1Ocs4ux2A4WMNAh7/Overleaf---Components?node-id=3460-191910&m=dev'
  55. ),
  56. }