diff --git a/packages/grafana-ui/src/components/Switch/Switch.story.tsx b/packages/grafana-ui/src/components/Switch/Switch.story.tsx index d9a9bd5b3cf..2dda4906400 100644 --- a/packages/grafana-ui/src/components/Switch/Switch.story.tsx +++ b/packages/grafana-ui/src/components/Switch/Switch.story.tsx @@ -1,5 +1,5 @@ import React, { useState, useCallback } from 'react'; -import { boolean } from '@storybook/addon-knobs'; +import { Meta, Story } from '@storybook/react'; import { withCenteredStory, withHorizontallyCenteredStory } from '../../utils/storybook/withCenteredStory'; import { InlineField, Switch, InlineSwitch } from '@grafana/ui'; import mdx from './Switch.mdx'; @@ -14,41 +14,50 @@ export default { docs: { page: mdx, }, + knobs: { + disable: true, + }, }, -}; - -export const Controlled = () => { - const [checked, setChecked] = useState(false); - const onChange = useCallback((e) => setChecked(e.currentTarget.checked), [setChecked]); - const BEHAVIOUR_GROUP = 'Behaviour props'; - const disabled = boolean('Disabled', false, BEHAVIOUR_GROUP); + args: { + disabled: false, + value: false, + transparent: false, + }, +} as Meta; +export const Controlled: Story = (args) => { return (