Skip to content

Commit 7187725

Browse files
committed
refactor Input main description + story
1 parent 9afca35 commit 7187725

File tree

3 files changed

+58
-58
lines changed

3 files changed

+58
-58
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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="."/>

packages/main/src/webComponents/Input/Input.stories.tsx

Lines changed: 0 additions & 56 deletions
This file was deleted.

packages/main/src/webComponents/Input/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ export interface InputPropTypes extends Omit<WithWebComponentPropTypes, 'onChang
9797
* The <code>Input</code> component allows the user to enter and edit text or numeric values in one line. <br />
9898
Additionally, you can provide <code>suggestionItems</code>, that are displayed in a popover right under the input.
9999
<br /><br />
100-
The text field can be editable or read-only (<code>readonly</code> property), and it can be enabled or disabled (<code >enabled</code
101-
>
100+
The text field can be editable or read-only (<code>readonly</code> property), and it can be enabled or disabled (<code>enabled</code>
102101
property). To visualize semantic states, such as "error" or "warning", the <code>valueState</code> property is provided.
103102
When the user makes changes to the text, the change event is fired, which enables you to react on any text change.
104103
<br /><br />

0 commit comments

Comments
 (0)