|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- import * as React from 'react';
- import type { Meta } from '@storybook/react';
- import { Button } from '@tesseract-design/web-base';
- import { RadioButton as Component, RadioButtonProps as Props } from '.';
-
- const LENGTH = 3 as const;
-
- const meta: Meta<typeof Component> = {
- component: Component,
- argTypes: {
- badge: {
- control: {
- type: 'text',
- },
- },
- variant: {
- control: { type: 'select' },
- options: Button.AVAILABLE_VARIANTS,
- },
- size: {
- control: { type: 'select' },
- options: Button.AVAILABLE_SIZES,
- },
- subtext: {
- control: { type: 'text' },
- },
- onChange: {
- table: {
- disable: true,
- },
- action: 'changed',
- },
- },
- args: {
- ...(Component.defaultProps ?? {}),
- },
- };
-
- export const RadioButton = (args: Omit<Props, 'ref'>) => (
- <>
- {Array.from({ length: LENGTH }).map((_, i) => (
- <Component
- {...args}
- key={i}
- name={Component.displayName}
- value={i + 1}
- >
- {Component.displayName} {i + 1}
- </Component>
- ))}
- </>
- );
-
- export default meta;
|