diff --git a/packages/grafana-ui/src/components/DateTimePickers/TimeZonePicker.story.tsx b/packages/grafana-ui/src/components/DateTimePickers/TimeZonePicker.story.tsx index 26d404d74c4..856cf6e0635 100644 --- a/packages/grafana-ui/src/components/DateTimePickers/TimeZonePicker.story.tsx +++ b/packages/grafana-ui/src/components/DateTimePickers/TimeZonePicker.story.tsx @@ -1,41 +1,44 @@ import { action } from '@storybook/addon-actions'; -import { ComponentMeta } from '@storybook/react'; +import { useArgs } from '@storybook/client-api'; +import { ComponentMeta, ComponentStory } from '@storybook/react'; import React from 'react'; import { TimeZonePicker } from '@grafana/ui'; -import { UseState } from '../../utils/storybook/UseState'; import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; const meta: ComponentMeta = { title: 'Pickers and Editors/TimePickers/TimeZonePicker', component: TimeZonePicker, decorators: [withCenteredStory], + parameters: { + controls: { + exclude: ['inputId', 'onChange', 'onBlur'], + }, + }, + args: { + value: 'Europe/Stockholm', + }, + argTypes: { + includeInternal: { + control: { + type: 'boolean', + }, + }, + }, }; -export const basic = () => { +export const Basic: ComponentStory = (args) => { + const [, updateArgs] = useArgs(); return ( - { + action('on selected')(newValue); + updateArgs({ value: newValue }); }} - > - {(value, updateValue) => { - return ( - { - if (!newValue) { - return; - } - action('on selected')(newValue); - updateValue({ value: newValue }); - }} - /> - ); - }} - + onBlur={action('onBlur')} + /> ); };