Skip to content

Commit 3e06c8c

Browse files
Storybook: Add read only examples for text and dynamic values
1 parent 5d654c2 commit 3e06c8c

2 files changed

Lines changed: 36 additions & 1 deletion

File tree

assets/src/components/dynamic/Dynamic.stories.tsx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,19 @@ export const TextInsert: Story = {
234234
}
235235
}
236236

237+
/**
238+
* Read-only text field with dynamic values in insert mode
239+
*/
240+
export const TextInsertReadOnly: Story = {
241+
args: {
242+
type: 'text',
243+
label: 'Text (read-only, insert mode)',
244+
value: '[[post_title]]',
245+
readOnly: true,
246+
dynamic: true,
247+
}
248+
}
249+
237250
/**
238251
* Text field with dynamic values in replace mode — fully replaces
239252
* the field value with a single dynamic value
@@ -249,6 +262,21 @@ export const TextReplace: Story = {
249262
}
250263
}
251264

265+
/**
266+
* Read-only text field with dynamic values in replace mode
267+
*/
268+
export const TextReplaceReadOnly: Story = {
269+
args: {
270+
type: 'text',
271+
label: 'Text (read-only, replace mode)',
272+
value: '[[post_title]]',
273+
readOnly: true,
274+
dynamic: {
275+
mode: 'replace',
276+
},
277+
}
278+
}
279+
252280
/**
253281
* Number field with dynamic values (replace mode only)
254282
*/

assets/src/components/field/text/Text.stories.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ export const SimpleTuiInput: Story = {
3838
}
3939
}
4040

41+
export const ReadOnlyInput: Story = {
42+
args: {
43+
label: 'Read only Text',
44+
value: 'Read only value',
45+
readOnly: true
46+
}
47+
}
48+
4149
export const MaskedEnhancedInput: Story = {
4250
args: {
4351
label: 'Masked Text',
@@ -83,4 +91,3 @@ export const InteractiveComparison: Story = {
8391
)
8492
}
8593
}
86-

0 commit comments

Comments
 (0)