Skip to content

Commit d83f03c

Browse files
bjarnefiOvergaard
authored andcommitted
Add story for Readonly state
1 parent fc706cd commit d83f03c

File tree

1 file changed

+58
-8
lines changed

1 file changed

+58
-8
lines changed

packages/uui-input/lib/uui-input.story.ts

Lines changed: 58 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,24 @@ export const MinMaxLength: Story = {
103103
minlength="3"
104104
maxlength="4"
105105
minlength-message="Minimum 3"
106-
maxlength-message="Maximum 4"></uui-input>`,
106+
maxlength-message="Maximum 4">
107+
</uui-input>`,
107108
},
108109
},
109110
},
110111
};
111112

112113
export const NumberInput: Story = {
114+
render: props => html`
115+
<uui-input
116+
.type=${props.type}
117+
.placeholder=${props.placeholder}
118+
.step=${props.step}
119+
.min=${props.min}
120+
.max=${props.max}
121+
.value=${props.value}>
122+
</uui-input>
123+
`,
113124
args: {
114125
placeholder: 'Input number',
115126
type: 'number',
@@ -135,6 +146,14 @@ export const NumberInput: Story = {
135146
};
136147

137148
export const DateTimeLocal: Story = {
149+
render: props => html`
150+
<uui-input
151+
.type=${props.type}
152+
.min=${props.min}
153+
.max=${props.max}
154+
.value=${props.value}>
155+
</uui-input>
156+
`,
138157
args: {
139158
type: 'datetime-local',
140159
value: '2023-04-20T10:00',
@@ -147,7 +166,7 @@ export const DateTimeLocal: Story = {
147166
},
148167
docs: {
149168
source: {
150-
code: ` <uui-input
169+
code: `<uui-input
151170
type="datetime-local"
152171
min="2023-04-13T10:00"
153172
value="2023-04-20T10:00"
@@ -159,7 +178,14 @@ export const DateTimeLocal: Story = {
159178
};
160179

161180
export const Disabled: Story = {
162-
args: { disabled: true },
181+
render: props => html`
182+
<uui-input
183+
.type=${props.type}
184+
.value=${props.value}
185+
?disabled=${props.disabled}>
186+
</uui-input>
187+
`,
188+
args: { disabled: true, value: 'Disabled' },
163189
parameters: {
164190
controls: { include: ['disabled', 'type', 'value'] },
165191
docs: {
@@ -170,7 +196,30 @@ export const Disabled: Story = {
170196
},
171197
};
172198

199+
export const Readonly: Story = {
200+
render: props => html`
201+
<uui-input
202+
.type=${props.type}
203+
.value=${props.value}
204+
?readonly=${props.readonly}>
205+
</uui-input>
206+
`,
207+
args: { readonly: true, value: 'Readonly' },
208+
parameters: {
209+
controls: { include: ['readonly', 'type', 'value'] },
210+
docs: {
211+
source: {
212+
code: `<uui-input readonly></uui-input>`,
213+
},
214+
},
215+
},
216+
};
217+
173218
export const Error: Story = {
219+
render: props => html`
220+
<uui-input .type=${props.type} .value=${props.value} ?error=${props.error}>
221+
</uui-input>
222+
`,
174223
args: { error: true, label: 'Error' },
175224
parameters: {
176225
controls: { include: ['error', 'type', 'value'] },
@@ -334,10 +383,10 @@ export const AutoWidth: Story = {
334383
<uui-input
335384
slot="prepend"
336385
placeholder="Prepend auto-width"
337-
?auto-width=${props.autoWidth}></uui-input>
338-
<uui-input
339-
slot="append"
340-
placeholder="Append auto-width false"></uui-input>
386+
?auto-width=${props.autoWidth}>
387+
</uui-input>
388+
<uui-input slot="append" placeholder="Append auto-width false">
389+
</uui-input>
341390
</uui-input>
342391
343392
<br /><br />
@@ -354,7 +403,8 @@ export const AutoWidth: Story = {
354403
style="--auto-width-text-margin-right: 50px"
355404
placeholder="--auto-width-text-margin-right: 50px"
356405
.value=${props.value}
357-
?auto-width=${props.autoWidth}></uui-input>`,
406+
?auto-width=${props.autoWidth}>
407+
</uui-input>`,
358408
args: {
359409
autoWidth: true,
360410
placeholder: 'Start typing...',

0 commit comments

Comments
 (0)