import React, { useState } from 'react' import { CheckBoxGroup, Flex } from '../' import { FIELD_ARGS, HIDE_CONTROL, Story } from '../helpers/storybook' export default { title: 'CheckBoxGroup', component: CheckBoxGroup, argTypes: { required: HIDE_CONTROL, checked: HIDE_CONTROL, ...FIELD_ARGS, }, } as const export const BasicUsage: Story = (args) => ( ) BasicUsage.args = { label: 'My Label', disabled: false, tooltip: 'Check some boxes', autoTooltip: true, name: 'checkboxes', } BasicUsage.parameters = { cactus: { overrides: { maxWidth: '500px' } } } export const WithValues = (): React.ReactElement => { const [value, setValue] = useState<{ 'option-1': boolean 'option-2': boolean 'option-3': boolean }>({ 'option-1': true, 'option-2': false, 'option-3': false }) return ( setValue((existingValue) => ({ ...existingValue, [target.name]: target.checked })) } > ) } WithValues.parameters = { controls: { disable: true } } const noop = () => undefined // Fix propTypes warning.