From ce1221cd59758f1cb9cb97933e31598234ad6dd9 Mon Sep 17 00:00:00 2001 From: Tima Gixe <60817786+timagixe@users.noreply.github.com> Date: Tue, 6 Sep 2022 17:18:38 +0300 Subject: [PATCH] Storybook: Add controls to InlineLabel story (#54604) --- .../components/Forms/InlineLabel.story.tsx | 43 +++++++++++++++---- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/packages/grafana-ui/src/components/Forms/InlineLabel.story.tsx b/packages/grafana-ui/src/components/Forms/InlineLabel.story.tsx index 23b1b9b4c07..56b855936bf 100644 --- a/packages/grafana-ui/src/components/Forms/InlineLabel.story.tsx +++ b/packages/grafana-ui/src/components/Forms/InlineLabel.story.tsx @@ -1,7 +1,7 @@ import { ComponentMeta } from '@storybook/react'; import React from 'react'; -import { InlineLabel } from './InlineLabel'; +import { InlineLabel, Props } from './InlineLabel'; import mdx from './InlineLabel.mdx'; const meta: ComponentMeta = { @@ -11,19 +11,44 @@ const meta: ComponentMeta = { docs: { page: mdx, }, + controls: { + exclude: ['as'], + }, + }, + argTypes: { + children: { + control: 'text', + }, + tooltip: { + control: 'text', + }, + width: { + control: 'text', + }, }, }; -export const basic = () => { - return Simple label; +export const Basic = (args: Props) => ; + +Basic.args = { + children: 'Simple text', + width: 'auto', + tooltip: undefined, + transparent: false, + interactive: false, }; -export const withTooltip = () => { - return ( - - Simple label - - ); +Basic.parameters = { + controls: { + exclude: ['as', 'tooltip', 'interactive'], + }, +}; + +export const WithTooltip = (args: Props) => ; + +WithTooltip.args = { + ...Basic.args, + tooltip: 'Info text', }; export default meta;