import React from 'react' import { Flex, RadioGroup } from '../' import { FIELD_ARGS, HIDE_CONTROL, Story } from '../helpers/storybook' export default { title: 'RadioGroup', component: RadioGroup, argTypes: { required: HIDE_CONTROL, value: HIDE_CONTROL, defaultValue: HIDE_CONTROL, ...FIELD_ARGS, }, } as const type GroupStory = Story export const BasicUsage: GroupStory = ({ buttonLabel, ...args }) => ( ) BasicUsage.args = { label: 'A Label', disabled: false, tooltip: 'Here there be radio buttons', autoTooltip: true, name: 'radios', buttonLabel: 'That is...', } BasicUsage.parameters = { cactus: { overrides: { maxWidth: '500px' } } } export const WithValues = (): React.ReactElement => { const [value, setValue] = React.useState('strong') return ( setValue(e.target.value)} > Strong} value="strong" /> Follower} required onChange={noop} m={0}> ) } WithValues.parameters = { controls: { disable: true } } const noop = () => undefined // Fix propTypes warning. export const WithDefaultValues = (): React.ReactElement => { const group = React.useRef(null) const button = React.useRef(null) return (
) } WithDefaultValues.parameters = { controls: { disable: true } }