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.
 
 
 

41 lines
739 B

  1. import * as React from 'react';
  2. import type { Meta } from '@storybook/react';
  3. import { RadioTickBox as Component, RadioTickBoxProps as Props } from '.';
  4. const LENGTH = 3 as const;
  5. const meta: Meta<typeof Component> = {
  6. component: Component,
  7. argTypes: {
  8. subtext: {
  9. control: { type: 'text' },
  10. },
  11. onChange: {
  12. table: {
  13. disable: true,
  14. },
  15. action: 'changed',
  16. },
  17. },
  18. args: {
  19. ...(Component.defaultProps ?? {}),
  20. },
  21. };
  22. export const RadioTickBox = (args: Omit<Props, 'ref'>) => (
  23. <>
  24. {Array.from({ length: LENGTH }).map((_, i) => (
  25. <Component
  26. {...args}
  27. key={i}
  28. name={Component.displayName}
  29. value={i + 1}
  30. >
  31. {Component.displayName} {i + 1}
  32. </Component>
  33. ))}
  34. </>
  35. );
  36. export default meta;