UNPKG

wix-style-react

Version:
39 lines (32 loc) 1.05 kB
import React from 'react'; import ToggleSwitch from 'wix-style-react/ToggleSwitch'; import { SKINS, SIZES } from 'wix-ui-backoffice/dist/src/components/ToggleSwitch/constants'; import CodeExample from 'wix-storybook-utils/CodeExample'; import ExampleFormField from './ExampleFormField'; import ExampleFormFieldRaw from '!raw-loader!./ExampleFormField'; export default { category: '4. Selection', storyName: '4.4 ToggleSwitch', component: ToggleSwitch, componentPath: '../../src/ToggleSwitch', componentProps: function componentProps(setState, getState) { return { checked: false, onChange: function onChange() { return setState({ checked: !getState().checked }); } }; }, exampleProps: { size: Object.keys(SIZES), skin: Object.keys(SKINS), onChange: function onChange() { return 'changed'; } }, examples: React.createElement( CodeExample, { title: 'Composition with FormField', code: ExampleFormFieldRaw }, React.createElement(ExampleFormField, null) ) };