Design system.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

55 lines
1015 B

  1. import * as React from 'react';
  2. import type { Meta } from '@storybook/react';
  3. import { Button } from '@tesseract-design/web-base';
  4. import { RadioButton as Component, RadioButtonProps as Props } from '.';
  5. const LENGTH = 3 as const;
  6. const meta: Meta<typeof Component> = {
  7. component: Component,
  8. argTypes: {
  9. badge: {
  10. control: {
  11. type: 'text',
  12. },
  13. },
  14. variant: {
  15. control: { type: 'select' },
  16. options: Button.AVAILABLE_VARIANTS,
  17. },
  18. size: {
  19. control: { type: 'select' },
  20. options: Button.AVAILABLE_SIZES,
  21. },
  22. subtext: {
  23. control: { type: 'text' },
  24. },
  25. onChange: {
  26. table: {
  27. disable: true,
  28. },
  29. action: 'changed',
  30. },
  31. },
  32. args: {
  33. ...(Component.defaultProps ?? {}),
  34. },
  35. };
  36. export const RadioButton = (args: Omit<Props, 'ref'>) => (
  37. <>
  38. {Array.from({ length: LENGTH }).map((_, i) => (
  39. <Component
  40. {...args}
  41. key={i}
  42. name={Component.displayName}
  43. value={i + 1}
  44. >
  45. {Component.displayName} {i + 1}
  46. </Component>
  47. ))}
  48. </>
  49. );
  50. export default meta;