@wonderflow/react-components
Version:
UI components from Wonderflow's Wanda design system
32 lines (31 loc) • 1.15 kB
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { Card } from '../..';
import { Toggle } from './toggle';
const story = {
title: 'Inputs/Toggle',
component: Toggle,
argTypes: {
onChange: {
action: 'changed',
table: {
disable: true,
},
},
disabled: {
options: [true, false],
control: { type: 'inline-radio' },
},
},
};
export default story;
export const Default = args => _jsx(Toggle, { ...args });
export const Checked = args => _jsx(Toggle, { defaultChecked: true, ...args });
export const DisabledChecked = args => _jsx(Toggle, { defaultChecked: true, disabled: true, ...args });
export const withLabel = args => _jsx(Toggle, { defaultChecked: true, label: "Label", ...args });
const ConstraintTemplate = args => (_jsx(Card, { dimmed: 0, bordered: true, style: { width: '300px' }, children: _jsx(Toggle, { ...args }) }));
export const withConstraint = ConstraintTemplate.bind({});
withConstraint.args = {
defaultChecked: true,
disabled: false,
label: 'myVeryLongUsernameUnspacedLabel@wonderflow.ai',
};