diff --git a/packages/grafana-ui/src/components/QueryField/QueryField.story.tsx b/packages/grafana-ui/src/components/QueryField/QueryField.story.tsx index f6e1adb0bd1..20a760d8afe 100644 --- a/packages/grafana-ui/src/components/QueryField/QueryField.story.tsx +++ b/packages/grafana-ui/src/components/QueryField/QueryField.story.tsx @@ -1,18 +1,51 @@ import { ComponentMeta, ComponentStory } from '@storybook/react'; import React from 'react'; -import { QueryField } from '@grafana/ui'; - +import { TypeaheadInput } from '../../types'; import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; +import { QueryField, QueryFieldProps } from './QueryField'; + const meta: ComponentMeta = { title: 'Data Source/QueryField', component: QueryField, decorators: [withCenteredStory], + parameters: { + controls: { + exclude: [ + 'onTypeahead', + 'onChange', + 'onBlur', + 'onClick', + 'onRunQuery', + 'onRichValueChange', + 'onWillApplySuggestion', + 'portalOrigin', + 'additionalPlugins', + 'cleanText', + 'syntax', + 'syntaxLoaded', + ], + }, + }, + argTypes: { + query: { + control: 'text', + }, + }, }; -export const basic: ComponentStory = () => { - return ; +export const Basic: ComponentStory = (args: Omit) => ( + +); + +Basic.args = { + onTypeahead: async (_input: TypeaheadInput) => ({ + suggestions: [], + }), + query: 'Query text', + placeholder: 'Placeholder text', + disabled: false, }; export default meta;