Skip to content

Commit 1fb9fa9

Browse files
committed
Pull request #41: EOA-3161: add 'variants' stories and documentation
Merge in DEV/colibri-docs from feature/EOA-3161_add_text_field_sb_documentation to release/current * commit 'eee9b1f1b3d7e9ed451bd00b08c7632358cea487': EOA-3161: add 'variants' stories and documentation
2 parents cf17442 + eee9b1f commit 1fb9fa9

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

src/components/col-text-field/col-text-field.mdx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,23 @@ import { Callout } from '../../_storybook/components';
112112
</div>
113113
<Canvas of={stories.WithCustomId} />
114114

115+
### Variants
116+
<div>
117+
The `col-text-field` component supports two visual variants to accommodate different design contexts and user preferences.
118+
</div>
119+
120+
121+
#### Outline Variant
122+
<div>
123+
The outline variant displays a full border around the input field, providing clear visual boundaries. This is the default variant and is ideal for most form contexts where clear field separation is important.
124+
</div>
125+
<Canvas of={stories.Variants} />
126+
127+
#### Plain Variant
128+
<div>
129+
The plain variant removes the border entirely, creating a minimal appearance. The field only shows a border when focused or in error states, providing a cleaner, more modern look.
130+
</div>
131+
<Canvas of={stories.PlainVariant} />
115132
</div>
116133
</div>
117134

src/components/col-text-field/col-text-field.stories.tsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ type StoryArgs = {
2323
errorMessage?: string;
2424
validationTiming?: 'blur' | 'change' | 'input' | 'submit';
2525
name: string;
26+
variant: 'outline' | 'plain';
2627
iconVisible: boolean;
2728
iconName: string;
2829
iconSize: string;
@@ -111,6 +112,17 @@ const meta = {
111112
},
112113
if: { arg: 'inputType', neq: '' },
113114
},
115+
variant: {
116+
control: 'select',
117+
options: ['outline', 'plain'],
118+
description: 'The visual variant of the text field.',
119+
table: {
120+
category: 'Core',
121+
type: { summary: "'outline' | 'plain'" },
122+
defaultValue: { summary: 'outline' },
123+
},
124+
if: { arg: 'variant', neq: '' },
125+
},
114126
placeholder: {
115127
control: 'text',
116128
description: 'Placeholder text for the input.',
@@ -334,6 +346,7 @@ const meta = {
334346
subLabel: '',
335347
helper: '',
336348
inputType: 'text',
349+
variant: 'outline',
337350
placeholder: 'Enter text here...',
338351
name: '',
339352
id: '',
@@ -373,6 +386,7 @@ const renderTextField: Story['render'] = args => html`
373386
sub-label=${args.subLabel || nothing}
374387
helper=${args.helper || nothing}
375388
input-type=${args.inputType}
389+
variant=${args.variant}
376390
placeholder=${args.placeholder || nothing}
377391
char-count=${args.charCount || nothing}
378392
pattern=${args.pattern || nothing}
@@ -408,6 +422,7 @@ export const Default: Story = {
408422
required: true,
409423
charCount: 20,
410424
inputType: 'text',
425+
variant: 'outline',
411426
inputMode: 'text',
412427
iconVisible: true,
413428
iconName: 'emoji-circle',
@@ -417,6 +432,22 @@ export const Default: Story = {
417432
render: renderTextField,
418433
};
419434

435+
export const Variants: Story = {
436+
args: {
437+
variant: 'outline',
438+
},
439+
render: renderTextField,
440+
tags: ['!dev'],
441+
};
442+
443+
export const PlainVariant: Story = {
444+
args: {
445+
variant: 'plain',
446+
},
447+
render: renderTextField,
448+
tags: ['!dev'],
449+
};
450+
420451
export const WithLabel: Story = {
421452
args: {
422453
label: 'With Label',

0 commit comments

Comments
 (0)