|
|
|
@ -1,10 +1,10 @@ |
|
|
|
|
import { action } from '@storybook/addon-actions'; |
|
|
|
|
import { ComponentMeta, ComponentStory } from '@storybook/react'; |
|
|
|
|
import React from 'react'; |
|
|
|
|
|
|
|
|
|
import { UnitPicker } from '@grafana/ui'; |
|
|
|
|
|
|
|
|
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; |
|
|
|
|
|
|
|
|
|
import { UnitPicker, UnitPickerProps } from './UnitPicker'; |
|
|
|
|
import mdx from './UnitPicker.mdx'; |
|
|
|
|
|
|
|
|
|
const meta: ComponentMeta<typeof UnitPicker> = { |
|
|
|
@ -12,10 +12,18 @@ const meta: ComponentMeta<typeof UnitPicker> = { |
|
|
|
|
component: UnitPicker, |
|
|
|
|
decorators: [withCenteredStory], |
|
|
|
|
parameters: { |
|
|
|
|
controls: { |
|
|
|
|
exclude: ['onChange', 'value'], |
|
|
|
|
}, |
|
|
|
|
docs: mdx, |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
export const simple: ComponentStory<typeof UnitPicker> = () => <UnitPicker onChange={(val) => console.log(val)} />; |
|
|
|
|
export const Basic: ComponentStory<typeof UnitPicker> = (args: UnitPickerProps) => <UnitPicker {...args} />; |
|
|
|
|
|
|
|
|
|
Basic.args = { |
|
|
|
|
onChange: action('onChange fired'), |
|
|
|
|
width: 30, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
export default meta; |
|
|
|
|