mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Storybook: Add controls to InlineLabel story (#54604)
This commit is contained in:
parent
05c16d1da3
commit
ce1221cd59
@ -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<typeof InlineLabel> = {
|
||||
@ -11,19 +11,44 @@ const meta: ComponentMeta<typeof InlineLabel> = {
|
||||
docs: {
|
||||
page: mdx,
|
||||
},
|
||||
controls: {
|
||||
exclude: ['as'],
|
||||
},
|
||||
},
|
||||
argTypes: {
|
||||
children: {
|
||||
control: 'text',
|
||||
},
|
||||
tooltip: {
|
||||
control: 'text',
|
||||
},
|
||||
width: {
|
||||
control: 'text',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const basic = () => {
|
||||
return <InlineLabel width="auto">Simple label</InlineLabel>;
|
||||
export const Basic = (args: Props) => <InlineLabel {...args} />;
|
||||
|
||||
Basic.args = {
|
||||
children: 'Simple text',
|
||||
width: 'auto',
|
||||
tooltip: undefined,
|
||||
transparent: false,
|
||||
interactive: false,
|
||||
};
|
||||
|
||||
export const withTooltip = () => {
|
||||
return (
|
||||
<InlineLabel width="auto" tooltip="Tooltip content">
|
||||
Simple label
|
||||
</InlineLabel>
|
||||
);
|
||||
Basic.parameters = {
|
||||
controls: {
|
||||
exclude: ['as', 'tooltip', 'interactive'],
|
||||
},
|
||||
};
|
||||
|
||||
export const WithTooltip = (args: Props) => <InlineLabel {...args} />;
|
||||
|
||||
WithTooltip.args = {
|
||||
...Basic.args,
|
||||
tooltip: 'Info text',
|
||||
};
|
||||
|
||||
export default meta;
|
||||
|
Loading…
Reference in New Issue
Block a user