import { FormRadioGroup } from './FormRadioGroup';
import { Meta, Story, Canvas, ArgTypes, Source } from '@storybook/addon-docs/blocks';
import * as FormRadioGroupStories from './FormRadioGroup.stories';

<Meta
  title="Forms/Atoms/Radio Group"
  of={FormRadioGroupStories}
  parameters={{ viewMode: 'docs'}}
/>

# Form Radio Group

<Source language="ts" code={`import { FormRadioGroup } from '@batoanng/mui-components';`} />

The `FormRadioGroup` provides a hook-form integration for the switch field.

## Simple use case

<Canvas of={FormRadioGroupStories.Default} />

## With validation rules

Any violation of `rules` will show in a standard error message under the component.

<Canvas of={FormRadioGroupStories.Rules} />

## Disabling individual options

The `RadioGroupOption` allows you to individually disable radio buttons via the `disabled` prop.

<Canvas of={FormRadioGroupStories.Disabled} />

## Support boolean values

<Canvas of={FormRadioGroupStories.BooleanValues} />

## Support number values

<Canvas of={FormRadioGroupStories.NumberValues} />

## Support custom objects

<Canvas of={FormRadioGroupStories.ObjectValue} />

## Adding help text to options

<Canvas of={FormRadioGroupStories.OptionsHelpMessages} />

## Usage of getOptionLabel, getOptionValue, and getOptionKey

<Canvas of={FormRadioGroupStories.CustomOptionDisplay} />

## Arguments

<ArgTypes of={FormRadioGroup} />
