-
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
- Loading branch information
Showing
35 changed files
with
1,042 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import {createComponent, EnvironmentInjector, inject, Type} from '@angular/core'; | ||
import {TuiDirectiveStylesService} from '@taiga-ui/cdk/services'; | ||
|
||
// TODO: Add cleanup with DestroyRef and replace service with just a map from a token | ||
export function tuiWithStyles(component: Type<unknown>): void { | ||
const map = inject(TuiDirectiveStylesService).map; | ||
const environmentInjector = inject(EnvironmentInjector); | ||
|
||
if (!map.has(component)) { | ||
map.set(component, createComponent(component, {environmentInjector})); | ||
} | ||
} |
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
Oops, something went wrong.