Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(forms): align labels in input states stories #1372

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions .storybook/stories/forms/forms-input-states.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ export default {
const FormInputTemplate: StoryFn = args => ({
template: `
<form class="clr-form clr-form-horizontal">
<div class="clr-form-control" [ngClass]="{ 'clr-form-control-disabled': isDisabled }">
<label class="clr-control-label">Text</label>
<div class="clr-form-control clr-row" [ngClass]="{ 'clr-form-control-disabled': isDisabled }">
<label class="clr-control-label clr-col-12 clr-col-md-2">Text</label>
<div class="clr-control-container" [ngClass]="{ 'clr-success': isSuccess, 'clr-error': isError }">
<div class="clr-input-wrapper">
<input type="text" class="clr-input" name="name" [ngModel]="name" [disabled]="isDisabled" />
Expand All @@ -45,8 +45,8 @@ const FormInputTemplate: StoryFn = args => ({
</div>
</div>

<div class="clr-form-control" [ngClass]="{ 'clr-form-control-disabled': isDisabled }">
<label class="clr-control-label">Number</label>
<div class="clr-form-control clr-row" [ngClass]="{ 'clr-form-control-disabled': isDisabled }">
<label class="clr-control-label clr-col-12 clr-col-md-2">Number</label>
<div class="clr-control-container" [ngClass]="{ 'clr-success': isSuccess, 'clr-error': isError }">
<div class="clr-input-wrapper">
<input type="number" class="clr-input" [ngModel]="age" name="age" [disabled]="isDisabled" />
Expand All @@ -59,8 +59,8 @@ const FormInputTemplate: StoryFn = args => ({
</div>
</div>

<div class="clr-form-control" [ngClass]="{ 'clr-form-control-disabled': isDisabled }">
<label for="example" class="clr-control-label">Password</label>
<div class="clr-form-control clr-row" [ngClass]="{ 'clr-form-control-disabled': isDisabled }">
<label for="example" class="clr-control-label clr-col-12 clr-col-md-2">Password</label>
<div class="clr-control-container" [ngClass]="{ 'clr-success': isSuccess, 'clr-error': isError }">
<div class="clr-input-wrapper">
<input
Expand All @@ -82,8 +82,8 @@ const FormInputTemplate: StoryFn = args => ({
</div>
</div>

<div class="clr-form-control" [ngClass]="{ 'clr-form-control-disabled': isDisabled }">
<label for="textarea-basic-error" class="clr-control-label">Textarea</label>
<div class="clr-form-control clr-row" [ngClass]="{ 'clr-form-control-disabled': isDisabled }">
<label for="textarea-basic-error" class="clr-control-label clr-col-12 clr-col-md-2">Textarea</label>
<div class="clr-control-container" [ngClass]="{ 'clr-success': isSuccess, 'clr-error': isError }">
<div class="clr-textarea-wrapper">
<textarea class="clr-textarea" [ngModel]="description" name="description" [disabled]="isDisabled"></textarea>
Expand All @@ -96,8 +96,8 @@ const FormInputTemplate: StoryFn = args => ({
</div>
</div>

<div class="clr-form-control" [ngClass]="{ 'clr-form-control-disabled': isDisabled }">
<label class="clr-control-label">Basic select</label>
<div class="clr-form-control clr-row" [ngClass]="{ 'clr-form-control-disabled': isDisabled }">
<label class="clr-control-label clr-col-12 clr-col-md-2">Basic select</label>
<div class="clr-control-container" [ngClass]="{ 'clr-success': isSuccess && !isError, 'clr-error': isError }">
<div class="clr-select-wrapper">
<select class="clr-select" [ngModel]="options" name="options" [disabled]="isDisabled" required>
Expand All @@ -114,8 +114,8 @@ const FormInputTemplate: StoryFn = args => ({
</div>
</div>

<div class="clr-form-control" [ngClass]="{ 'clr-form-control-disabled': isDisabled }">
<label class="clr-control-label">Checkbox</label>
<div class="clr-form-control clr-row" [ngClass]="{ 'clr-form-control-disabled': isDisabled }">
<label class="clr-control-label clr-col-12 clr-col-md-2">Checkbox</label>
<div class="clr-control-container" [ngClass]="{ 'clr-success': isSuccess, 'clr-error': isError }">
<div class="clr-checkbox-wrapper">
<input
Expand All @@ -127,7 +127,7 @@ const FormInputTemplate: StoryFn = args => ({
[disabled]="isDisabled"
class="clr-checkbox"
/>
<label for="option1" class="clr-control-label">Option</label>
<label for="option1" class="clr-control-label clr-col-12 clr-col-md-2">Option</label>
</div>
<span class="clr-subtext">Helper Subtext</span>
<div class="clr-subtext-wrapper">
Expand All @@ -144,8 +144,8 @@ const FormInputTemplate: StoryFn = args => ({
<input type="date" autocomplete="off" clrDate [ngModel]="demo" name="demo" [disabled]="isDisabled" />
</clr-date-container>

<div class="clr-form-control" [ngClass]="{ 'clr-form-control-disabled': isDisabled }">
<label class="clr-control-label">Basic radio</label>
<div class="clr-form-control clr-row" [ngClass]="{ 'clr-form-control-disabled': isDisabled }">
<label class="clr-control-label clr-col-12 clr-col-md-2">Basic radio</label>
<div class="clr-control-container" [ngClass]="{ 'clr-success': isSuccess, 'clr-error': isError }">
<div class="clr-radio-wrapper">
<input
Expand All @@ -157,7 +157,7 @@ const FormInputTemplate: StoryFn = args => ({
class="clr-radio"
[disabled]="isDisabled"
/>
<label for="radio1" class="clr-control-label">option1</label>
<label for="radio1" class="clr-control-label clr-col-12 clr-col-md-2">option1</label>
</div>
<div class="clr-radio-wrapper">
<input
Expand All @@ -169,7 +169,7 @@ const FormInputTemplate: StoryFn = args => ({
class="clr-radio"
[disabled]="isDisabled"
/>
<label for="radio2" class="clr-control-label">option2</label>
<label for="radio2" class="clr-control-label clr-col-12 clr-col-md-2">option2</label>
</div>
<div class="clr-radio-wrapper">
<input
Expand All @@ -181,7 +181,7 @@ const FormInputTemplate: StoryFn = args => ({
class="clr-radio"
[disabled]="isDisabled"
/>
<label for="radio3" class="clr-control-label">option3</label>
<label for="radio3" class="clr-control-label clr-col-12 clr-col-md-2">option3</label>
</div>
<span class="clr-subtext">Helper Subtext</span>
<div class="clr-subtext-wrapper">
Expand All @@ -193,8 +193,8 @@ const FormInputTemplate: StoryFn = args => ({
</div>
</div>

<div class="clr-form-control">
<label class="clr-control-label">Full toggle switch</label>
<div class="clr-form-control clr-row">
<label class="clr-control-label clr-col-12 clr-col-md-2">Full toggle switch</label>
<div class="clr-control-container" [ngClass]="{ 'clr-success': isSuccess, 'clr-error': isError }">
<div class="clr-toggle-wrapper">
<input type="checkbox" id="toggle1" name="toggle-full" value="option1" class="clr-toggle" />
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading