switcher.stories.tsx 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import OLToggleButton from '@/features/ui/components/ol/ol-toggle-button'
  2. import OLToggleButtonGroup from '@/features/ui/components/ol/ol-toggle-button-group'
  3. export const Base = () => {
  4. return (
  5. <OLToggleButtonGroup
  6. type="radio"
  7. name="figure-width"
  8. defaultValue="0.5"
  9. aria-label="Image width"
  10. >
  11. <OLToggleButton variant="secondary" id="width-25p" value="0.25">
  12. ¼ width
  13. </OLToggleButton>
  14. <OLToggleButton variant="secondary" id="width-50p" value="0.5">
  15. ½ width
  16. </OLToggleButton>
  17. <OLToggleButton variant="secondary" id="width-75p" value="0.75">
  18. ¾ width
  19. </OLToggleButton>
  20. <OLToggleButton variant="secondary" id="width-100p" value="1.0">
  21. Full width
  22. </OLToggleButton>
  23. </OLToggleButtonGroup>
  24. )
  25. }
  26. export const Disabled = () => {
  27. return (
  28. <OLToggleButtonGroup
  29. type="radio"
  30. name="figure-width"
  31. defaultValue="0.5"
  32. aria-label="Image width"
  33. >
  34. <OLToggleButton variant="secondary" id="width-25p" disabled value="0.25">
  35. ¼ width
  36. </OLToggleButton>
  37. <OLToggleButton variant="secondary" id="width-50p" disabled value="0.5">
  38. ½ width
  39. </OLToggleButton>
  40. <OLToggleButton variant="secondary" id="width-75p" disabled value="0.75">
  41. ¾ width
  42. </OLToggleButton>
  43. <OLToggleButton variant="secondary" id="width-100p" disabled value="1.0">
  44. Full width
  45. </OLToggleButton>
  46. </OLToggleButtonGroup>
  47. )
  48. }
  49. export default {
  50. title: 'Shared / Components / Toggle Button Group',
  51. component: OLToggleButtonGroup,
  52. }