import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta, Story } from '@storybook/react'; import { ASSETS_URL } from '../../../consts/common'; import { ToggleButton } from '../toggle-button'; import { ToggleButtonGroup } from './index'; import type { ToggleButtonGroupProps } from './index'; export default { component: ToggleButtonGroup, title: 'Forms/Toggle Button Group' } as Meta; const onStateChange = action('onChange'); const Template: Story = args => { const [value, setValue] = React.useState(args.value || null); const onChange: ToggleButtonGroupProps['onChange'] = (event, newValue) => { onStateChange(event, newValue); null !== newValue && setValue(newValue); // simulate radio-button group }; return ; }; export const Primary = Template.bind({}); Primary.args = { children: [ First, Second, Third, Fourth , Fifth ], disabled: false, multiple: false, value: '3rd' }; export const WithIcons = Template.bind({}); WithIcons.args = { children: [ Objects , Lock , Help ], disabled: false, multiple: false, value: 'key' };