-
Notifications
You must be signed in to change notification settings - Fork 473
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(experimental):
Textfield
add new component (#6298)
Co-authored-by: taiga-family-bot <[email protected]>
- Loading branch information
1 parent
b92feb5
commit f72522b
Showing
32 changed files
with
982 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@import '../../taiga-ui-local.less'; | ||
|
||
[tuiAppearance][data-appearance='textfield'] { | ||
--t-shadow: 0 0.125rem 0.1875rem rgba(0, 0, 0, 0.1); | ||
background: var(--tui-base-01); | ||
color: var(--tui-text-01); | ||
box-shadow: var(--t-shadow); | ||
outline: 1px solid var(--tui-base-03); | ||
outline-offset: -1px; | ||
|
||
&:valid[data-invalid='true'], | ||
&:invalid:not([data-invalid='false']) { | ||
outline-color: var(--tui-negative); | ||
} | ||
|
||
&:read-only { | ||
box-shadow: none; | ||
outline-color: var(--tui-base-04) !important; | ||
} | ||
.transition(~'box-shadow, background, outline-color'); | ||
|
||
.appearance-hover({ | ||
--t-shadow: 0 0.125rem 0.3125rem rgba(0, 0, 0, 0.16); | ||
}); | ||
|
||
.appearance-focus({ | ||
box-shadow: none; | ||
outline: 0.125rem solid var(--tui-primary); | ||
outline-offset: -0.125rem; | ||
}); | ||
|
||
.appearance-disabled({ | ||
box-shadow: none; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
195 changes: 195 additions & 0 deletions
195
projects/demo/src/modules/experimental/textfield/examples/1/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,195 @@ | ||
<div [tuiTextfieldCleaner]="true"> | ||
<h2 class="tui-heading-5">Label inside</h2> | ||
<tui-textfield | ||
*ngFor="let size of sizes" | ||
iconLeft="tuiIconSearchLarge" | ||
iconRight="tuiIconSettingsLarge" | ||
[filler]="filler" | ||
[tuiTextfieldSize]="size" | ||
> | ||
<label tuiLabel>I am a label</label> | ||
<input | ||
placeholder="I am placeholder" | ||
tuiTextfieldd | ||
[(ngModel)]="value" | ||
/> | ||
<tui-icon icon="tuiIconBellLarge"></tui-icon> | ||
<tui-tooltip content="I am a hint"></tui-tooltip> | ||
</tui-textfield> | ||
|
||
<h2 class="tui-heading-5">Label outside</h2> | ||
<label | ||
*ngFor="let size of sizes" | ||
tuiLabel | ||
> | ||
For long labels it is better to use label outside as it can wrap to multiple lines | ||
<tui-textfield | ||
#textfield | ||
iconLeft="tuiIconSearchLarge" | ||
iconRight="tuiIconSettingsLarge" | ||
[filler]="filler" | ||
[tuiTextfieldSize]="size" | ||
> | ||
<input | ||
tuiTextfieldd | ||
[placeholder]="textfield.focused ? 'I am placeholder' : 'I am a short label'" | ||
[(ngModel)]="value" | ||
/> | ||
<tui-icon icon="tuiIconBellLarge"></tui-icon> | ||
<tui-tooltip content="I am a hint"></tui-tooltip> | ||
</tui-textfield> | ||
</label> | ||
|
||
<h2 class="tui-heading-5">Disabled</h2> | ||
<tui-textfield | ||
iconLeft="tuiIconSearchLarge" | ||
iconRight="tuiIconSettingsLarge" | ||
[filler]="filler" | ||
> | ||
<label tuiLabel>I am a label</label> | ||
<input | ||
placeholder="I am placeholder" | ||
tuiTextfieldd | ||
[disabled]="true" | ||
[(ngModel)]="value" | ||
/> | ||
<tui-icon icon="tuiIconBellLarge"></tui-icon> | ||
<tui-tooltip content="I am a hint"></tui-tooltip> | ||
</tui-textfield> | ||
|
||
<h2 class="tui-heading-5">Read only</h2> | ||
<tui-textfield | ||
iconLeft="tuiIconSearchLarge" | ||
iconRight="tuiIconSettingsLarge" | ||
[filler]="filler" | ||
> | ||
<label tuiLabel>I am a label</label> | ||
<input | ||
placeholder="I am placeholder" | ||
tuiTextfieldd | ||
[readOnly]="true" | ||
[(ngModel)]="value" | ||
/> | ||
<tui-icon icon="tuiIconBellLarge"></tui-icon> | ||
<tui-tooltip content="I am a hint"></tui-tooltip> | ||
</tui-textfield> | ||
|
||
<h2 class="tui-heading-5">Invalid</h2> | ||
<tui-textfield | ||
iconLeft="tuiIconSearchLarge" | ||
iconRight="tuiIconSettingsLarge" | ||
[filler]="filler" | ||
> | ||
<label tuiLabel>I am a label</label> | ||
<input | ||
placeholder="I am placeholder" | ||
tuiTextfieldd | ||
[invalid]="true" | ||
[(ngModel)]="value" | ||
/> | ||
<tui-icon icon="tuiIconBellLarge"></tui-icon> | ||
<tui-tooltip content="I am a hint"></tui-tooltip> | ||
</tui-textfield> | ||
<tui-textfield | ||
#textfield | ||
iconLeft="tuiIconSearchLarge" | ||
iconRight="tuiIconSettingsLarge" | ||
[filler]="filler" | ||
> | ||
<input | ||
tuiTextfieldd | ||
[invalid]="true" | ||
[placeholder]="textfield.focused ? 'I am placeholder' : 'I am a short label'" | ||
[(ngModel)]="value" | ||
/> | ||
<tui-icon icon="tuiIconBellLarge"></tui-icon> | ||
<tui-tooltip content="I am a hint"></tui-tooltip> | ||
</tui-textfield> | ||
</div> | ||
|
||
<div [tuiTextfieldCleaner]="true"> | ||
<h2 class="tui-heading-5"> </h2> | ||
<tui-primitive-textfield | ||
*ngFor="let size of sizes" | ||
tuiHintContent="I am a hint" | ||
tuiTextfieldCustomContent="tuiIconBellLarge" | ||
tuiTextfieldIcon="tuiIconSettingsLarge" | ||
tuiTextfieldIconLeft="tuiIconSearchLarge" | ||
[tuiTextfieldFiller]="filler" | ||
[tuiTextfieldSize]="size" | ||
[(value)]="value" | ||
> | ||
I am a label | ||
</tui-primitive-textfield> | ||
|
||
<h2 class="tui-heading-5"> </h2> | ||
<label | ||
*ngFor="let size of sizes" | ||
tuiLabel | ||
> | ||
For long labels it is better to use label outside as it can wrap to multiple lines | ||
<tui-primitive-textfield | ||
tuiHintContent="I am a hint" | ||
tuiTextfieldCustomContent="tuiIconBellLarge" | ||
tuiTextfieldIcon="tuiIconSettingsLarge" | ||
tuiTextfieldIconLeft="tuiIconSearchLarge" | ||
[tuiTextfieldFiller]="filler" | ||
[tuiTextfieldLabelOutside]="true" | ||
[tuiTextfieldSize]="size" | ||
[(value)]="value" | ||
> | ||
I am a label | ||
</tui-primitive-textfield> | ||
</label> | ||
|
||
<h2 class="tui-heading-5"> </h2> | ||
<tui-primitive-textfield | ||
tuiHintContent="I am a hint" | ||
tuiTextfieldCustomContent="tuiIconBellLarge" | ||
tuiTextfieldIcon="tuiIconSettingsLarge" | ||
tuiTextfieldIconLeft="tuiIconSearchLarge" | ||
[disabled]="true" | ||
[tuiTextfieldFiller]="filler" | ||
[(value)]="value" | ||
> | ||
I am a label | ||
</tui-primitive-textfield> | ||
|
||
<h2 class="tui-heading-5"> </h2> | ||
<tui-primitive-textfield | ||
tuiHintContent="I am a hint" | ||
tuiTextfieldCustomContent="tuiIconBellLarge" | ||
tuiTextfieldIcon="tuiIconSettingsLarge" | ||
tuiTextfieldIconLeft="tuiIconSearchLarge" | ||
[readOnly]="true" | ||
[tuiTextfieldFiller]="filler" | ||
[(value)]="value" | ||
> | ||
I am a label | ||
</tui-primitive-textfield> | ||
|
||
<h2 class="tui-heading-5"> </h2> | ||
<tui-primitive-textfield | ||
tuiHintContent="I am a hint" | ||
tuiTextfieldCustomContent="tuiIconBellLarge" | ||
tuiTextfieldIcon="tuiIconSettingsLarge" | ||
tuiTextfieldIconLeft="tuiIconSearchLarge" | ||
[invalid]="true" | ||
[tuiTextfieldFiller]="filler" | ||
[(value)]="value" | ||
> | ||
I am a label | ||
</tui-primitive-textfield> | ||
<tui-primitive-textfield | ||
tuiHintContent="I am a hint" | ||
tuiTextfieldCustomContent="tuiIconBellLarge" | ||
tuiTextfieldIcon="tuiIconSettingsLarge" | ||
tuiTextfieldIconLeft="tuiIconSearchLarge" | ||
[invalid]="true" | ||
[tuiTextfieldFiller]="filler" | ||
[tuiTextfieldLabelOutside]="true" | ||
[(value)]="value" | ||
> | ||
I am a label | ||
</tui-primitive-textfield> | ||
</div> |
12 changes: 12 additions & 0 deletions
12
projects/demo/src/modules/experimental/textfield/examples/1/index.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
:host { | ||
display: flex; | ||
gap: 1rem; | ||
width: 40rem; | ||
} | ||
|
||
div { | ||
flex: 1; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
} |
Oops, something went wrong.