import { useState } from 'react'; import { action } from 'storybook/actions'; import { Meta } from '@storybook/react-webpack5'; import { FastFlag } from '@transferwise/icons'; import { Nudge, Title, Typography } from '..'; import CheckboxOption, { type CheckboxOptionProps } from './CheckboxOption'; /** * > ⚠️ This component is **deprecated** and superseded by the [new ListItem component](?path=/docs/content-listitem--docs) with the [ListItem.Checkbox control](?path=/docs/content-listitem-listitem-checkbox--docs) * (run codemod to migrate: **`npx @wise/wds-codemods@latest list-item`**). */ const meta: Meta = { component: CheckboxOption, title: 'Option/CheckboxOption', parameters: { docs: { source: { type: 'dynamic' }, }, }, tags: ['deprecated'], }; export default meta; const commonArgs = { disabled: false, title: 'Checkbox option', content: 'Normally, the button and icon are vertically centered.', showMediaAtAllSizes: false, isContainerAligned: false, }; const renderTemplate = (args: Partial = commonArgs) => { const mergedArgs = { ...commonArgs, ...args }; const [checked, setChecked] = useState(true); return ( } showMediaAtAllSizes={mergedArgs.showMediaAtAllSizes} isContainerAligned={mergedArgs.isContainerAligned} onChange={(newValue) => setChecked(newValue)} /> ); }; export const Basic = (args: CheckboxOptionProps) => { return renderTemplate(args); }; export const Multiple = (args: CheckboxOptionProps) => { return ( <> {renderTemplate(args)} {renderTemplate(args)} {renderTemplate(args)} ); }; export const WithContainerContent = (args: CheckboxOptionProps) => ( <> Choose how to pay {renderTemplate(args)} {renderTemplate(args)} {renderTemplate(args)}
);