import React, { useState } from 'react'; import { Button } from '@douyinfe/semi-ui/'; import { Switch } from '../../index'; export default { title: 'Switch' } export const _Switch = () => (
console.log(v)} aria-label='power-switch'> console.log(v)} aria-label='mode-switch'>
); _Switch.story = { name: 'switch', }; export const SwitchSize = () => (
console.log(v)} aria-label='power-switch'> console.log(v)} size="small" aria-label='power-switch'> console.log(v)} size="large" aria-label='power-switch'>
); SwitchSize.story = { name: 'switch size', }; export const SwitchCheckedTextUncheckedText = () => (






); SwitchCheckedTextUncheckedText.story = { name: 'switch checkedText & uncheckedText', }; export const SwitchDisabled = () => ( <> disabled console.log(v)} aria-label='power-switch'> ); SwitchDisabled.story = { name: 'switch disabled', }; const ControlledSwitch = () => { const [checked, onChange] = useState(true); return onChange(v)} aria-label='power-switch'/>; }; export const SwitchCheckedOnChange = () => ; SwitchCheckedOnChange.story = { name: 'switch checked + onChange', }; const UnControlledSwitch = () => { const onChange = checked => { console.log(checked); }; return ( <> {/* */} ); }; export const SwitchDefaultCheckedOnChange = () => ; SwitchDefaultCheckedOnChange.story = { name: 'switch defaultChecked + onChange', }; class LoadingDemo extends React.Component { constructor() { super(); this.state = { checked: true, loading: false, }; this.onChange = this.onChange.bind(this); } onChange(checked) { this.setState({ checked }); } render() { return ( <>












); } } export const Loading = () => ; Loading.story = { name: 'loading', };