From 28619d7a552c55fd28159e017eee2ff036e10950 Mon Sep 17 00:00:00 2001 From: Orlando Ortega Jr <38387174+orlandoortegajr@users.noreply.github.com> Date: Mon, 12 Sep 2022 07:03:25 -0400 Subject: [PATCH] Chore: Added controls to IconButton & renamed Simple story to Examples (#54371) --- .../IconButton/IconButton.story.tsx | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/packages/grafana-ui/src/components/IconButton/IconButton.story.tsx b/packages/grafana-ui/src/components/IconButton/IconButton.story.tsx index 174b735c5ee..8d4ac9298ba 100644 --- a/packages/grafana-ui/src/components/IconButton/IconButton.story.tsx +++ b/packages/grafana-ui/src/components/IconButton/IconButton.story.tsx @@ -1,5 +1,5 @@ import { css } from '@emotion/css'; -import { ComponentMeta } from '@storybook/react'; +import { ComponentStory, ComponentMeta } from '@storybook/react'; import React from 'react'; import { useTheme2 } from '../../themes'; @@ -7,7 +7,7 @@ import { IconSize, IconName } from '../../types'; import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import { VerticalGroup } from '../Layout/Layout'; -import { IconButton, IconButtonVariant } from './IconButton'; +import { IconButton, IconButtonVariant, Props as IconButtonProps } from './IconButton'; import mdx from './IconButton.mdx'; const meta: ComponentMeta = { @@ -19,9 +19,23 @@ const meta: ComponentMeta = { page: mdx, }, }, + args: { + name: 'apps', + size: 'md', + iconType: 'default', + tooltip: 'sample tooltip message', + tooltipPlacement: 'top', + variant: 'secondary', + ariaLabel: 'sample aria-label content', + }, + argTypes: { + tooltip: { + control: 'text', + }, + }, }; -export const Simple = () => { +export const Examples = () => { return (
@@ -31,6 +45,10 @@ export const Simple = () => { ); }; +export const Basic: ComponentStory = (args: IconButtonProps) => { + return ; +}; + interface ScenarioProps { background: 'canvas' | 'primary' | 'secondary'; }