|
| 1 | +import {ArgsTable, Canvas, Meta, Story} from '@storybook/addon-docs/blocks'; |
| 2 | +import {Input} from '@ui5/webcomponents-react/lib/Input'; |
| 3 | +import {InputType} from '@ui5/webcomponents-react/lib/InputType'; |
| 4 | +import {ValueState} from '@ui5/webcomponents-react/lib/ValueState'; |
| 5 | +import '@ui5/webcomponents-icons/dist/icons/employee.js'; |
| 6 | +import {Icon} from '@ui5/webcomponents-react/lib/Icon'; |
| 7 | +import {CSSProperties} from 'react'; |
| 8 | +import {SuggestionItem} from '@ui5/webcomponents-react/lib/SuggestionItem'; |
| 9 | +import {createSelectArgTypes} from '@shared/stories/createSelectArgTypes'; |
| 10 | +import {DocsHeader} from '@shared/stories/DocsHeader'; |
| 11 | + |
| 12 | +<Meta |
| 13 | + title="UI5 Web Components / Input" |
| 14 | + component={Input} |
| 15 | + subcomponents={{SuggestionItem}} |
| 16 | + argTypes={{ |
| 17 | + ...createSelectArgTypes({type: InputType, valueState: ValueState}), |
| 18 | + children: {control: {disable: true}}, |
| 19 | + icon: {control: {disable: true}}, |
| 20 | + valueStateMessage: {control: {disable: true}}, |
| 21 | + slot: {control: {disable: true}}, |
| 22 | + ref: {control: {disable: true}}, |
| 23 | + style: { |
| 24 | + type: CSSProperties, |
| 25 | + description: |
| 26 | + 'Element style which will be appended to the most outer element of a component. Use this prop carefully, some css properties might break the component.' |
| 27 | + }, |
| 28 | + className: { |
| 29 | + type: 'string', |
| 30 | + description: |
| 31 | + 'CSS Class Name which will be appended to the most outer element of a component. Use this prop carefully, overwriting CSS rules might break the component.' |
| 32 | + }, |
| 33 | + tooltip: {type: 'string', description: 'A tooltip which will be shown on hover'} |
| 34 | + }} |
| 35 | + args={{ |
| 36 | + type: InputType.Text, |
| 37 | + valueState: ValueState.None, |
| 38 | + icon: <Icon name="employee"/>, |
| 39 | + style: {}, |
| 40 | + className: '', |
| 41 | + tooltip: '', |
| 42 | + slot: '', |
| 43 | + ref: null |
| 44 | + }} |
| 45 | +/> |
| 46 | + |
| 47 | +<DocsHeader/> |
| 48 | + |
| 49 | +<Canvas> |
| 50 | + <Story name="Default"> |
| 51 | + {(args) => { |
| 52 | + return <Input {...args} />; |
| 53 | + }} |
| 54 | + </Story> |
| 55 | +</Canvas> |
| 56 | + |
| 57 | +<ArgsTable story="."/> |
0 commit comments