+ [round]="true"
+ >
+ {{ 'Placeholder' | tuiInitials }}
+
Label
Placeholder
diff --git a/projects/demo/src/modules/components/combo-box/combo-box.module.ts b/projects/demo/src/modules/components/combo-box/combo-box.module.ts
index 1b2aeee3051ee..83f1e413898b5 100644
--- a/projects/demo/src/modules/components/combo-box/combo-box.module.ts
+++ b/projects/demo/src/modules/components/combo-box/combo-box.module.ts
@@ -21,8 +21,9 @@ import {
TuiSvgModule,
TuiTextfieldControllerModule,
} from '@taiga-ui/core';
+import {TuiInitialsModule} from '@taiga-ui/experimental';
import {
- TuiAvatarModule,
+ TuiAvatarComponent,
TuiComboBoxModule,
TuiDataListWrapperModule,
TuiFilterByInputPipeModule,
@@ -52,7 +53,7 @@ import {TuiComboBoxExample8} from './examples/8';
TuiComboBoxModule,
TuiButtonModule,
TuiLinkModule,
- TuiAvatarModule,
+ TuiAvatarComponent,
TuiSvgModule,
TuiDataListModule,
TuiLoaderModule,
@@ -69,6 +70,7 @@ import {TuiComboBoxExample8} from './examples/8';
InheritedDocumentationModule,
RouterModule.forChild(tuiGenerateRoutes(ExampleTuiComboBoxComponent)),
TuiTextCodeModule,
+ TuiInitialsModule,
],
declarations: [
ExampleTuiComboBoxComponent,
diff --git a/projects/demo/src/modules/components/combo-box/examples/1/index.html b/projects/demo/src/modules/components/combo-box/examples/1/index.html
index 7cd996495fa3c..4fc75fc881dad 100644
--- a/projects/demo/src/modules/components/combo-box/examples/1/index.html
+++ b/projects/demo/src/modules/components/combo-box/examples/1/index.html
@@ -63,11 +63,12 @@
>
+ [src]="data.avatarUrl"
+ >
+ {{ data.toString() | tuiInitials }}
+
{{ data }}
diff --git a/projects/demo/src/modules/components/combo-box/examples/2/index.html b/projects/demo/src/modules/components/combo-box/examples/2/index.html
index 28abfca7c87e6..6c2d4382f12e2 100644
--- a/projects/demo/src/modules/components/combo-box/examples/2/index.html
+++ b/projects/demo/src/modules/components/combo-box/examples/2/index.html
@@ -21,9 +21,10 @@
+ [src]="item.avatarUrl"
+ >
+ {{ item.toString() | tuiInitials }}
+
{{ item }}
@@ -37,9 +38,10 @@
+ [src]="item.avatarUrl"
+ >
+ {{ item.toString() | tuiInitials }}
+
{{ item }}
diff --git a/projects/demo/src/modules/components/input-phone/examples/3/index.html b/projects/demo/src/modules/components/input-phone/examples/3/index.html
index 00ce62f5b54d2..0b48e9312dab8 100644
--- a/projects/demo/src/modules/components/input-phone/examples/3/index.html
+++ b/projects/demo/src/modules/components/input-phone/examples/3/index.html
@@ -19,9 +19,10 @@
+ [src]="item.avatarUrl"
+ >
+ {{ item.firstName | tuiInitials }}
+
{{ item.firstName }} {{ item.lastName }}
{{ item.phone }}
@@ -34,9 +35,10 @@
+ [round]="true"
+ [src]="user.avatarUrl"
+ >
+ {{ user.firstName | tuiInitials }}
+
Value: {{ value }}
diff --git a/projects/demo/src/modules/components/input-phone/input-phone.module.ts b/projects/demo/src/modules/components/input-phone/input-phone.module.ts
index b07e16b169a04..c816810f37016 100644
--- a/projects/demo/src/modules/components/input-phone/input-phone.module.ts
+++ b/projects/demo/src/modules/components/input-phone/input-phone.module.ts
@@ -14,7 +14,8 @@ import {
TuiSvgModule,
TuiTextfieldControllerModule,
} from '@taiga-ui/core';
-import {TuiAvatarModule, TuiInputPhoneModule} from '@taiga-ui/kit';
+import {TuiInitialsModule} from '@taiga-ui/experimental';
+import {TuiAvatarComponent, TuiInputPhoneModule} from '@taiga-ui/kit';
import {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';
import {InheritedDocumentationModule} from '../abstract/inherited-documentation/inherited-documentation.module';
@@ -33,7 +34,7 @@ import {ExampleTuiInputPhoneComponent} from './input-phone.component';
TuiDataListModule,
TuiButtonModule,
TuiSvgModule,
- TuiAvatarModule,
+ TuiAvatarComponent,
TuiDropdownModule,
TuiTextfieldControllerModule,
TuiHintModule,
@@ -43,6 +44,7 @@ import {ExampleTuiInputPhoneComponent} from './input-phone.component';
InheritedDocumentationModule,
TuiAddonDocModule,
RouterModule.forChild(tuiGenerateRoutes(ExampleTuiInputPhoneComponent)),
+ TuiInitialsModule,
],
declarations: [
ExampleTuiInputPhoneComponent,
diff --git a/projects/demo/src/modules/components/input/examples/4/index.html b/projects/demo/src/modules/components/input/examples/4/index.html
index aec4c4cc69bd2..fd22cc4cf3e21 100644
--- a/projects/demo/src/modules/components/input/examples/4/index.html
+++ b/projects/demo/src/modules/components/input/examples/4/index.html
@@ -23,9 +23,10 @@
{{ user }}
+ [src]="user.avatarUrl"
+ >
+ {{ user.toString() | tuiInitials }}
+
@@ -34,10 +35,11 @@
+ [round]="true"
+ [src]="lastUser.avatarUrl"
+ >
+ {{ lastUser.toString() | tuiInitials }}
+
+ [src]="item.avatarUrl"
+ >
+ {{ item.toString() | tuiInitials }}
+
{{ item }}
diff --git a/projects/demo/src/modules/components/input/input.module.ts b/projects/demo/src/modules/components/input/input.module.ts
index 3109565172755..9cc15c37a5b8d 100644
--- a/projects/demo/src/modules/components/input/input.module.ts
+++ b/projects/demo/src/modules/components/input/input.module.ts
@@ -24,8 +24,9 @@ import {
TuiSvgModule,
TuiTextfieldControllerModule,
} from '@taiga-ui/core';
+import {TuiInitialsModule} from '@taiga-ui/experimental';
import {
- TuiAvatarModule,
+ TuiAvatarComponent,
TuiDataListWrapperModule,
TuiInputDateModule,
TuiInputModule,
@@ -72,7 +73,7 @@ import {ExampleTuiInputComponent} from './input.component';
TuiRadioListModule,
TuiButtonModule,
TuiInputCardModule,
- TuiAvatarModule,
+ TuiAvatarComponent,
TuiPrimitiveTextfieldModule,
TuiTextfieldControllerModule,
TuiHintModule,
@@ -86,6 +87,7 @@ import {ExampleTuiInputComponent} from './input.component';
TuiTextCodeModule,
MaskitoModule,
TuiUnmaskHandlerModule,
+ TuiInitialsModule,
],
declarations: [
ExampleTuiInputComponent,
diff --git a/projects/demo/src/modules/components/multi-select/examples/2/index.html b/projects/demo/src/modules/components/multi-select/examples/2/index.html
index 32d0e2a4ab738..a68e76d63656c 100644
--- a/projects/demo/src/modules/components/multi-select/examples/2/index.html
+++ b/projects/demo/src/modules/components/multi-select/examples/2/index.html
@@ -26,9 +26,10 @@
+ [src]="data.avatarUrl"
+ >
+ {{ data.toString() | tuiInitials }}
+
{{ data }}
diff --git a/projects/demo/src/modules/components/multi-select/multi-select.module.ts b/projects/demo/src/modules/components/multi-select/multi-select.module.ts
index 3a0650c65991f..e8af2fd5a4e9f 100644
--- a/projects/demo/src/modules/components/multi-select/multi-select.module.ts
+++ b/projects/demo/src/modules/components/multi-select/multi-select.module.ts
@@ -15,8 +15,9 @@ import {
TuiScrollbarModule,
TuiTextfieldControllerModule,
} from '@taiga-ui/core';
+import {TuiInitialsModule} from '@taiga-ui/experimental';
import {
- TuiAvatarModule,
+ TuiAvatarComponent,
TuiDataListWrapperModule,
TuiMultiSelectModule,
TuiRadioListModule,
@@ -49,7 +50,7 @@ import {ExampleTuiMultiSelectComponent} from './multi-select.component';
TuiRadioListModule,
TuiButtonModule,
TuiLinkModule,
- TuiAvatarModule,
+ TuiAvatarComponent,
TuiDataListModule,
TuiDataListWrapperModule,
TuiLetModule,
@@ -62,6 +63,7 @@ import {ExampleTuiMultiSelectComponent} from './multi-select.component';
TuiLabelModule,
RouterModule.forChild(tuiGenerateRoutes(ExampleTuiMultiSelectComponent)),
PolymorpheusModule,
+ TuiInitialsModule,
],
declarations: [
ExampleTuiMultiSelectComponent,
diff --git a/projects/demo/src/modules/components/primitive-textfield/primitive-textfield.module.ts b/projects/demo/src/modules/components/primitive-textfield/primitive-textfield.module.ts
index 958b2d42b1e67..153714f848f63 100644
--- a/projects/demo/src/modules/components/primitive-textfield/primitive-textfield.module.ts
+++ b/projects/demo/src/modules/components/primitive-textfield/primitive-textfield.module.ts
@@ -14,7 +14,8 @@ import {
TuiTextfieldControllerModule,
TuiWrapperModule,
} from '@taiga-ui/core';
-import {TuiAvatarModule, TuiRadioListModule} from '@taiga-ui/kit';
+import {TuiInitialsModule} from '@taiga-ui/experimental';
+import {TuiAvatarComponent, TuiRadioListModule} from '@taiga-ui/kit';
import {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';
import {TuiCustomizationModule} from '../../app/customization/customization.module';
@@ -37,7 +38,7 @@ import {ExampleTuiPrimitiveTextfieldComponent} from './primitive-textfield.compo
TuiPrimitiveTextfieldModule,
TuiTextfieldControllerModule,
TuiNotificationModule,
- TuiAvatarModule,
+ TuiAvatarComponent,
TuiLinkModule,
TuiSvgModule,
TuiButtonModule,
@@ -50,6 +51,7 @@ import {ExampleTuiPrimitiveTextfieldComponent} from './primitive-textfield.compo
ThemesModule,
TuiAddonDocModule,
RouterModule.forChild(tuiGenerateRoutes(ExampleTuiPrimitiveTextfieldComponent)),
+ TuiInitialsModule,
],
declarations: [
ExampleTuiPrimitiveTextfieldComponent,
diff --git a/projects/demo/src/modules/components/primitive-textfield/primitive-textfield.template.html b/projects/demo/src/modules/components/primitive-textfield/primitive-textfield.template.html
index 85060cae8d7d9..b18c8a6b25ef6 100644
--- a/projects/demo/src/modules/components/primitive-textfield/primitive-textfield.template.html
+++ b/projects/demo/src/modules/components/primitive-textfield/primitive-textfield.template.html
@@ -86,8 +86,9 @@
+ >
+ {{ item | tuiInitials }}
+
{{ item }}
diff --git a/projects/demo/src/modules/components/radio-block/examples/3/index.html b/projects/demo/src/modules/components/radio-block/examples/3/index.html
index d79793e88005a..fc4dec2c2e564 100644
--- a/projects/demo/src/modules/components/radio-block/examples/3/index.html
+++ b/projects/demo/src/modules/components/radio-block/examples/3/index.html
@@ -11,10 +11,11 @@
+ [round]="true"
+ >
+ {{ 'Heading' | tuiInitials }}
+
Heading
@@ -28,10 +29,11 @@
+ [round]="true"
+ >
+ {{ 'Heading' | tuiInitials }}
+
Label
Placeholder
diff --git a/projects/demo/src/modules/components/radio-block/radio-block.module.ts b/projects/demo/src/modules/components/radio-block/radio-block.module.ts
index b910fd5a5bd20..552adec8e0239 100644
--- a/projects/demo/src/modules/components/radio-block/radio-block.module.ts
+++ b/projects/demo/src/modules/components/radio-block/radio-block.module.ts
@@ -4,7 +4,8 @@ import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {RouterModule} from '@angular/router';
import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc';
import {TuiButtonModule, TuiGroupModule, TuiTooltipModule} from '@taiga-ui/core';
-import {TuiAvatarModule, TuiRadioBlockModule, TuiRadioListModule} from '@taiga-ui/kit';
+import {TuiInitialsModule} from '@taiga-ui/experimental';
+import {TuiAvatarComponent, TuiRadioBlockModule, TuiRadioListModule} from '@taiga-ui/kit';
import {InheritedDocumentationModule} from '../abstract/inherited-documentation/inherited-documentation.module';
import {TuiRadioBlockExample1} from './examples/1';
@@ -19,7 +20,7 @@ import {ExampleTuiRadioBlockComponent} from './radio-block.component';
FormsModule,
TuiRadioBlockModule,
ReactiveFormsModule,
- TuiAvatarModule,
+ TuiAvatarComponent,
TuiRadioListModule,
TuiButtonModule,
TuiGroupModule,
@@ -27,6 +28,7 @@ import {ExampleTuiRadioBlockComponent} from './radio-block.component';
InheritedDocumentationModule,
TuiAddonDocModule,
RouterModule.forChild(tuiGenerateRoutes(ExampleTuiRadioBlockComponent)),
+ TuiInitialsModule,
],
declarations: [
TuiRadioBlockExample1,
diff --git a/projects/demo/src/modules/components/select/examples/6/index.html b/projects/demo/src/modules/components/select/examples/6/index.html
index e96b7daa1bf16..b207891869f3e 100644
--- a/projects/demo/src/modules/components/select/examples/6/index.html
+++ b/projects/demo/src/modules/components/select/examples/6/index.html
@@ -21,9 +21,10 @@
+ [src]="data.avatarUrl"
+ >
+ {{ data.toString() | tuiInitials }}
+
{{ data }}
diff --git a/projects/demo/src/modules/components/select/select.module.ts b/projects/demo/src/modules/components/select/select.module.ts
index a95330b0145b6..a18e06615d4de 100644
--- a/projects/demo/src/modules/components/select/select.module.ts
+++ b/projects/demo/src/modules/components/select/select.module.ts
@@ -19,8 +19,9 @@ import {
TuiSvgModule,
TuiTextfieldControllerModule,
} from '@taiga-ui/core';
+import {TuiInitialsModule} from '@taiga-ui/experimental';
import {
- TuiAvatarModule,
+ TuiAvatarComponent,
TuiDataListWrapperModule,
TuiMarkerIconModule,
TuiMultiSelectModule,
@@ -61,7 +62,7 @@ import {ExampleTuiSelectComponent} from './select.component';
TuiButtonModule,
TuiLinkModule,
TuiMoneyModule,
- TuiAvatarModule,
+ TuiAvatarComponent,
TuiSvgModule,
TuiDropdownModule,
TuiTextfieldControllerModule,
@@ -78,6 +79,7 @@ import {ExampleTuiSelectComponent} from './select.component';
TuiMarkerIconModule,
TuiMapperPipeModule,
RouterModule.forChild(tuiGenerateRoutes(ExampleTuiSelectComponent)),
+ TuiInitialsModule,
],
declarations: [
ExampleTuiSelectComponent,
diff --git a/projects/demo/src/modules/components/sheet-dialog/examples/4/index.html b/projects/demo/src/modules/components/sheet-dialog/examples/4/index.html
index 5f38b49d4c711..93d360cd21b08 100644
--- a/projects/demo/src/modules/components/sheet-dialog/examples/4/index.html
+++ b/projects/demo/src/modules/components/sheet-dialog/examples/4/index.html
@@ -30,11 +30,7 @@
class="item"
(click)="toggle(false)"
>
-
+
{{ user | tuiInitials }}
{{ user }}
diff --git a/projects/demo/src/modules/components/sheet-dialog/sheet-dialog.module.ts b/projects/demo/src/modules/components/sheet-dialog/sheet-dialog.module.ts
index 99bba319c781f..6c2102be73002 100644
--- a/projects/demo/src/modules/components/sheet-dialog/sheet-dialog.module.ts
+++ b/projects/demo/src/modules/components/sheet-dialog/sheet-dialog.module.ts
@@ -12,7 +12,8 @@ import {
TuiNotificationModule,
TuiTextfieldControllerModule,
} from '@taiga-ui/core';
-import {TuiAvatarModule, TuiInputModule} from '@taiga-ui/kit';
+import {TuiInitialsModule} from '@taiga-ui/experimental';
+import {TuiAvatarComponent, TuiInputModule} from '@taiga-ui/kit';
import {TuiSheetDialogExample1} from './examples/1';
import {TuiSheetDialogExample2} from './examples/2';
@@ -29,12 +30,13 @@ import {ExampleTuiSheetDialogComponent} from './sheet-dialog.component';
TuiButtonModule,
TuiLabelModule,
TuiMoneyModule,
- TuiAvatarModule,
+ TuiAvatarComponent,
TuiNotificationModule,
TuiSheetDialogModule,
TuiAddonDocModule,
RouterModule.forChild(tuiGenerateRoutes(ExampleTuiSheetDialogComponent)),
TuiSwipeModule,
+ TuiInitialsModule,
],
declarations: [
ExampleTuiSheetDialogComponent,
diff --git a/projects/demo/src/modules/components/sheet-dialog/sheet-dialog.template.html b/projects/demo/src/modules/components/sheet-dialog/sheet-dialog.template.html
index ed675a66b5208..28480b42d3e1e 100644
--- a/projects/demo/src/modules/components/sheet-dialog/sheet-dialog.template.html
+++ b/projects/demo/src/modules/components/sheet-dialog/sheet-dialog.template.html
@@ -59,9 +59,10 @@
+ [round]="true"
+ >
+ {{ 'Karl Gambolputty' | tuiInitials }}
+
Karl Gambolputty
diff --git a/projects/demo/src/modules/components/sheet/sheet.module.ts b/projects/demo/src/modules/components/sheet/sheet.module.ts
index 275b77e6efa75..09d9457eb5e61 100644
--- a/projects/demo/src/modules/components/sheet/sheet.module.ts
+++ b/projects/demo/src/modules/components/sheet/sheet.module.ts
@@ -11,7 +11,8 @@ import {
TuiLinkModule,
TuiNotificationModule,
} from '@taiga-ui/core';
-import {TuiAvatarModule} from '@taiga-ui/kit';
+import {TuiInitialsModule} from '@taiga-ui/experimental';
+import {TuiAvatarComponent} from '@taiga-ui/kit';
import {TuiSheetExample1} from './examples/1';
import {TuiSheetExample2} from './examples/2';
@@ -27,7 +28,7 @@ import {ExampleTuiSheetComponent} from './sheet.component';
TuiButtonModule,
TuiLabelModule,
TuiMoneyModule,
- TuiAvatarModule,
+ TuiAvatarComponent,
TuiNotificationModule,
TuiLinkModule,
TuiElasticStickyModule,
@@ -35,6 +36,7 @@ import {ExampleTuiSheetComponent} from './sheet.component';
IntersectionObserverModule,
TuiAddonDocModule,
RouterModule.forChild(tuiGenerateRoutes(ExampleTuiSheetComponent)),
+ TuiInitialsModule,
],
declarations: [
ExampleTuiSheetComponent,
diff --git a/projects/demo/src/modules/components/sheet/sheet.template.html b/projects/demo/src/modules/components/sheet/sheet.template.html
index 8b88ab2eecf12..7e0cd5d1a5e3e 100644
--- a/projects/demo/src/modules/components/sheet/sheet.template.html
+++ b/projects/demo/src/modules/components/sheet/sheet.template.html
@@ -104,9 +104,10 @@
+ [round]="true"
+ >
+ {{ 'Karl Gambolputty' | tuiInitials }}
+
Karl Gambolputty
diff --git a/projects/demo/src/modules/components/tooltip/examples/2/index.html b/projects/demo/src/modules/components/tooltip/examples/2/index.html
index 833ddb7f90b6f..2919c2a1776e6 100644
--- a/projects/demo/src/modules/components/tooltip/examples/2/index.html
+++ b/projects/demo/src/modules/components/tooltip/examples/2/index.html
@@ -12,13 +12,14 @@
+>
+ ❤
+
What is
diff --git a/projects/demo/src/modules/components/tooltip/tooltip.module.ts b/projects/demo/src/modules/components/tooltip/tooltip.module.ts
index 53e06c0f851fb..4a65df9c43c9b 100644
--- a/projects/demo/src/modules/components/tooltip/tooltip.module.ts
+++ b/projects/demo/src/modules/components/tooltip/tooltip.module.ts
@@ -11,7 +11,8 @@ import {
TuiTextfieldControllerModule,
TuiTooltipModule,
} from '@taiga-ui/core';
-import {TuiAvatarModule, TuiInputModule} from '@taiga-ui/kit';
+import {TuiAutoColorModule} from '@taiga-ui/experimental';
+import {TuiAvatarComponent, TuiInputModule} from '@taiga-ui/kit';
import {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';
import {TuiTooltipExample1} from './examples/1';
@@ -25,7 +26,7 @@ import {ExampleTuiTooltipComponent} from './tooltip.component';
TuiTooltipModule,
TuiHintModule,
TuiLinkModule,
- TuiAvatarModule,
+ TuiAvatarComponent,
TuiLoaderModule,
TuiInputModule,
PolymorpheusModule,
@@ -35,6 +36,7 @@ import {ExampleTuiTooltipComponent} from './tooltip.component';
FormsModule,
TuiTextfieldControllerModule,
RouterModule.forChild(tuiGenerateRoutes(ExampleTuiTooltipComponent)),
+ TuiAutoColorModule,
],
declarations: [
ExampleTuiTooltipComponent,
diff --git a/projects/demo/src/modules/customization/dialogs/dialogs.module.ts b/projects/demo/src/modules/customization/dialogs/dialogs.module.ts
index 01324546dd144..bad9238e703d2 100644
--- a/projects/demo/src/modules/customization/dialogs/dialogs.module.ts
+++ b/projects/demo/src/modules/customization/dialogs/dialogs.module.ts
@@ -3,7 +3,7 @@ import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router';
import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc';
import {TuiButtonModule} from '@taiga-ui/core';
-import {TuiAvatarModule} from '@taiga-ui/kit';
+import {TuiAvatarComponent} from '@taiga-ui/kit';
import {DialogsComponent} from './dialogs.component';
import {TuiDialogsExample1} from './examples/1';
@@ -14,7 +14,7 @@ import {PromptModule} from './examples/1/prompt/prompt.module';
CommonModule,
PromptModule,
TuiButtonModule,
- TuiAvatarModule,
+ TuiAvatarComponent,
TuiAddonDocModule,
RouterModule.forChild(tuiGenerateRoutes(DialogsComponent)),
],
diff --git a/projects/demo/src/modules/customization/dialogs/examples/1/index.html b/projects/demo/src/modules/customization/dialogs/examples/1/index.html
index c4bb5ea5fc40a..ffc7b7025c867 100644
--- a/projects/demo/src/modules/customization/dialogs/examples/1/index.html
+++ b/projects/demo/src/modules/customization/dialogs/examples/1/index.html
@@ -8,10 +8,10 @@
«Choose wisely»
@@ -19,9 +19,9 @@
«You chose poorly»
@@ -30,9 +30,9 @@
«You have chosen wisely»
diff --git a/projects/demo/src/modules/customization/portals/portals.module.ts b/projects/demo/src/modules/customization/portals/portals.module.ts
index 716787e66671c..efa0107942a90 100644
--- a/projects/demo/src/modules/customization/portals/portals.module.ts
+++ b/projects/demo/src/modules/customization/portals/portals.module.ts
@@ -3,7 +3,7 @@ import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router';
import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc';
import {TuiButtonModule, TuiSvgModule} from '@taiga-ui/core';
-import {TuiAvatarModule} from '@taiga-ui/kit';
+import {TuiAvatarComponent} from '@taiga-ui/kit';
import {TuiPortalsExample1} from './examples/1';
import {CustomHostModule} from './examples/1/portal/custom-host.module';
@@ -14,7 +14,7 @@ import {PortalsComponent} from './portals.component';
CommonModule,
CustomHostModule,
TuiButtonModule,
- TuiAvatarModule,
+ TuiAvatarComponent,
TuiAddonDocModule,
TuiSvgModule,
RouterModule.forChild(tuiGenerateRoutes(PortalsComponent)),
diff --git a/projects/demo/src/modules/directives/dropdown-selection/dropdown-selection.module.ts b/projects/demo/src/modules/directives/dropdown-selection/dropdown-selection.module.ts
index c17db17fb0a19..fce97c3f46339 100644
--- a/projects/demo/src/modules/directives/dropdown-selection/dropdown-selection.module.ts
+++ b/projects/demo/src/modules/directives/dropdown-selection/dropdown-selection.module.ts
@@ -4,7 +4,8 @@ import {FormsModule} from '@angular/forms';
import {RouterModule} from '@angular/router';
import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc';
import {TuiButtonModule, TuiDataListModule, TuiDropdownModule} from '@taiga-ui/core';
-import {TuiAvatarModule, TuiTextareaModule} from '@taiga-ui/kit';
+import {TuiInitialsModule} from '@taiga-ui/experimental';
+import {TuiAvatarComponent, TuiTextareaModule} from '@taiga-ui/kit';
import {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';
import {DropdownDocumentationModule} from '../../components/abstract/dropdown-documentation/dropdown-documentation.module';
@@ -20,11 +21,12 @@ import {TuiDropdownSelectionExample2} from './examples/2';
TuiDropdownModule,
TuiButtonModule,
TuiTextareaModule,
- TuiAvatarModule,
+ TuiAvatarComponent,
TuiDataListModule,
TuiAddonDocModule,
RouterModule.forChild(tuiGenerateRoutes(ExampleTuiDropdownSelectionComponent)),
DropdownDocumentationModule,
+ TuiInitialsModule,
],
declarations: [
ExampleTuiDropdownSelectionComponent,
diff --git a/projects/demo/src/modules/directives/dropdown-selection/examples/2/index.html b/projects/demo/src/modules/directives/dropdown-selection/examples/2/index.html
index 7329bdfbcc38e..160ac20eeb3a3 100644
--- a/projects/demo/src/modules/directives/dropdown-selection/examples/2/index.html
+++ b/projects/demo/src/modules/directives/dropdown-selection/examples/2/index.html
@@ -24,10 +24,11 @@
{{ item.name }}
+ [round]="true"
+ [src]="item.avatar"
+ >
+ {{ item.name | tuiInitials }}
+
diff --git a/projects/demo/src/modules/directives/dropdown/dropdown.module.ts b/projects/demo/src/modules/directives/dropdown/dropdown.module.ts
index 6e4fc34f0e0a7..48f2e67af1f51 100644
--- a/projects/demo/src/modules/directives/dropdown/dropdown.module.ts
+++ b/projects/demo/src/modules/directives/dropdown/dropdown.module.ts
@@ -11,7 +11,7 @@ import {
TuiNotificationModule,
} from '@taiga-ui/core';
import {
- TuiAvatarModule,
+ TuiAvatarComponent,
TuiInputModule,
TuiSelectModule,
TuiToggleModule,
@@ -31,7 +31,7 @@ import {TuiDropdownExample4} from './examples/4';
FormsModule,
PolymorpheusModule,
TuiLinkModule,
- TuiAvatarModule,
+ TuiAvatarComponent,
TuiButtonModule,
TuiDropdownModule,
TuiSelectModule,
diff --git a/projects/demo/src/modules/directives/dropdown/examples/2/index.html b/projects/demo/src/modules/directives/dropdown/examples/2/index.html
index 28e4fea8508e2..cce1a6a67126a 100644
--- a/projects/demo/src/modules/directives/dropdown/examples/2/index.html
+++ b/projects/demo/src/modules/directives/dropdown/examples/2/index.html
@@ -30,8 +30,8 @@
Taiga UI developer
diff --git a/projects/demo/src/modules/directives/hint/examples/1/index.html b/projects/demo/src/modules/directives/hint/examples/1/index.html
index 11dcacc3798ae..0f15553897e5c 100644
--- a/projects/demo/src/modules/directives/hint/examples/1/index.html
+++ b/projects/demo/src/modules/directives/hint/examples/1/index.html
@@ -1,12 +1,13 @@
+>
+ ❤
+
What is
diff --git a/projects/demo/src/modules/directives/hint/examples/2/index.html b/projects/demo/src/modules/directives/hint/examples/2/index.html
index c4ec32e940f43..7029216458bbd 100644
--- a/projects/demo/src/modules/directives/hint/examples/2/index.html
+++ b/projects/demo/src/modules/directives/hint/examples/2/index.html
@@ -1,10 +1,10 @@
+ ❤
= [
- 'xxs',
- 'xs',
- 's',
- 'm',
- 'l',
- 'xl',
- 'xxl',
- ];
-
- size = this.sizes[3];
-
- readonly srcVariants: ReadonlyArray = [
- 'MW',
- 'https://avatars.githubusercontent.com/u/11832552',
- 'https://taiga-ui.dev/assets/images/test-not-found.png',
- 'tuiIconUserLarge',
- this.sanitizer.bypassSecurityTrustResourceUrl(
- 'https://avatars.githubusercontent.com/u/10106368',
- ),
- ];
-
- src = this.srcVariants[0];
-
- round = true;
-
- constructor(@Inject(DomSanitizer) private readonly sanitizer: DomSanitizer) {}
-}
diff --git a/projects/demo/src/modules/experimental/avatar/avatar.module.ts b/projects/demo/src/modules/experimental/avatar/avatar.module.ts
deleted file mode 100644
index c611215885c3a..0000000000000
--- a/projects/demo/src/modules/experimental/avatar/avatar.module.ts
+++ /dev/null
@@ -1,47 +0,0 @@
-import {CommonModule} from '@angular/common';
-import {NgModule} from '@angular/core';
-import {tuiGetDocModules} from '@taiga-ui/addon-doc';
-import {TuiNotificationModule} from '@taiga-ui/core';
-import {
- TuiAutoColorModule,
- TuiAvatarLabeledComponent,
- TuiAvatarModule,
- TuiAvatarStackModule,
- TuiFadeModule,
- TuiFallbackSrcModule,
- TuiInitialsModule,
-} from '@taiga-ui/experimental';
-
-import {ExampleTuiAvatarComponent} from './avatar.component';
-import {TuiAvatarExample1} from './examples/1';
-import {TuiAvatarExample2} from './examples/2';
-import {TuiAvatarExample3} from './examples/3';
-import {TuiAvatarExample4} from './examples/4';
-import {TuiAvatarExample5} from './examples/5';
-import {TuiAvatarExample6} from './examples/6';
-
-@NgModule({
- imports: [
- CommonModule,
- TuiAvatarModule,
- TuiAvatarStackModule,
- TuiAvatarLabeledComponent,
- TuiAutoColorModule,
- TuiInitialsModule,
- TuiNotificationModule,
- TuiFallbackSrcModule,
- TuiFadeModule,
- tuiGetDocModules(ExampleTuiAvatarComponent),
- ],
- declarations: [
- ExampleTuiAvatarComponent,
- TuiAvatarExample1,
- TuiAvatarExample2,
- TuiAvatarExample3,
- TuiAvatarExample4,
- TuiAvatarExample5,
- TuiAvatarExample6,
- ],
- exports: [ExampleTuiAvatarComponent],
-})
-export class ExampleTuiAvatarModule {}
diff --git a/projects/demo/src/modules/experimental/avatar/avatar.template.html b/projects/demo/src/modules/experimental/avatar/avatar.template.html
deleted file mode 100644
index 4e3de6c00bd4c..0000000000000
--- a/projects/demo/src/modules/experimental/avatar/avatar.template.html
+++ /dev/null
@@ -1,137 +0,0 @@
-
-
-
- This code is
- experimental
- and is a subject to change. Expect final solution to be shipped in the next major version
-
-
- New version for Avatar component following updated design specs for displaying text, pictures and icons.
-
-
-
- This example requires import of
- TuiFallbackSrcModule
-
-
-
-
-
-
- This example requires import of
- TuiFadeModule
-
-
-
-
-
-
-
-
-
-
- This example requires import of
- TuiAvatarStackModule
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Use round shape
-
-
- Size
-
-
- Initials, image URL, or icon name. Alternatively you can pass text as
- ng-content
- which would be styled differently from initials and fade if overflown
-
-
-
-
-
-
-
- Import module:
-
-
-
-
-
- Add to the template:
-
-
-
-
-
-
diff --git a/projects/demo/src/modules/experimental/avatar/examples/1/index.html b/projects/demo/src/modules/experimental/avatar/examples/1/index.html
deleted file mode 100644
index eaf75bc5fed59..0000000000000
--- a/projects/demo/src/modules/experimental/avatar/examples/1/index.html
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-99+
-
-
-
-
-
-
-
-
-
-
-
diff --git a/projects/demo/src/modules/experimental/avatar/examples/1/index.ts b/projects/demo/src/modules/experimental/avatar/examples/1/index.ts
deleted file mode 100644
index 3c402abf8d9fc..0000000000000
--- a/projects/demo/src/modules/experimental/avatar/examples/1/index.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import {Component} from '@angular/core';
-import {changeDetection} from '@demo/emulate/change-detection';
-import {encapsulation} from '@demo/emulate/encapsulation';
-
-@Component({
- selector: 'tui-avatar-example-1',
- templateUrl: './index.html',
- styleUrls: ['./index.less'],
- encapsulation,
- changeDetection,
-})
-export class TuiAvatarExample1 {}
diff --git a/projects/demo/src/modules/experimental/avatar/examples/2/index.html b/projects/demo/src/modules/experimental/avatar/examples/2/index.html
deleted file mode 100644
index 3c93cc27b5562..0000000000000
--- a/projects/demo/src/modules/experimental/avatar/examples/2/index.html
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
- Fading
-
diff --git a/projects/demo/src/modules/experimental/avatar/examples/2/index.less b/projects/demo/src/modules/experimental/avatar/examples/2/index.less
deleted file mode 100644
index 7c34c000eadfe..0000000000000
--- a/projects/demo/src/modules/experimental/avatar/examples/2/index.less
+++ /dev/null
@@ -1,9 +0,0 @@
-:host {
- display: flex;
- gap: 1rem;
-}
-
-.text {
- background: var(--tui-base-05);
- color: var(--tui-text-01-night);
-}
diff --git a/projects/demo/src/modules/experimental/avatar/examples/2/index.ts b/projects/demo/src/modules/experimental/avatar/examples/2/index.ts
deleted file mode 100644
index e75c6c3ef780d..0000000000000
--- a/projects/demo/src/modules/experimental/avatar/examples/2/index.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import {Component} from '@angular/core';
-import {changeDetection} from '@demo/emulate/change-detection';
-import {encapsulation} from '@demo/emulate/encapsulation';
-
-@Component({
- selector: 'tui-avatar-example-2',
- templateUrl: './index.html',
- styleUrls: ['./index.less'],
- encapsulation,
- changeDetection,
-})
-export class TuiAvatarExample2 {}
diff --git a/projects/demo/src/modules/experimental/avatar/examples/3/index.html b/projects/demo/src/modules/experimental/avatar/examples/3/index.html
deleted file mode 100644
index 58b3e218997aa..0000000000000
--- a/projects/demo/src/modules/experimental/avatar/examples/3/index.html
+++ /dev/null
@@ -1,7 +0,0 @@
-XXL
-XL
-L
-M
-S
-XS
-XXS
diff --git a/projects/demo/src/modules/experimental/avatar/examples/3/index.ts b/projects/demo/src/modules/experimental/avatar/examples/3/index.ts
deleted file mode 100644
index f5226c0d218d2..0000000000000
--- a/projects/demo/src/modules/experimental/avatar/examples/3/index.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import {Component} from '@angular/core';
-import {changeDetection} from '@demo/emulate/change-detection';
-import {encapsulation} from '@demo/emulate/encapsulation';
-
-@Component({
- selector: 'tui-avatar-example-3',
- templateUrl: './index.html',
- styleUrls: ['./index.less'],
- encapsulation,
- changeDetection,
-})
-export class TuiAvatarExample3 {
- readonly names = ['Jason Statham', 'Silvester Stallone', 'Jackie Chan'];
-}
diff --git a/projects/demo/src/modules/experimental/avatar/examples/4/index.html b/projects/demo/src/modules/experimental/avatar/examples/4/index.html
deleted file mode 100644
index c73e5d628a62a..0000000000000
--- a/projects/demo/src/modules/experimental/avatar/examples/4/index.html
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
- 99+
-
-
diff --git a/projects/demo/src/modules/experimental/avatar/examples/4/index.ts b/projects/demo/src/modules/experimental/avatar/examples/4/index.ts
deleted file mode 100644
index 8fdc73d4baedf..0000000000000
--- a/projects/demo/src/modules/experimental/avatar/examples/4/index.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import {Component} from '@angular/core';
-import {changeDetection} from '@demo/emulate/change-detection';
-import {encapsulation} from '@demo/emulate/encapsulation';
-import {TuiSizeXXL, TuiSizeXXS} from '@taiga-ui/core';
-
-@Component({
- selector: 'tui-avatar-example-4',
- templateUrl: './index.html',
- encapsulation,
- changeDetection,
-})
-export class TuiAvatarExample4 {
- readonly names = ['Jason Statham', 'Silvester Stallone', 'Jackie Chan'];
- readonly sizes: ReadonlyArray = [
- 'xxl',
- 'xl',
- 'l',
- 'm',
- 's',
- 'xs',
- 'xxs',
- ];
-}
diff --git a/projects/demo/src/modules/experimental/avatar/examples/5/index.html b/projects/demo/src/modules/experimental/avatar/examples/5/index.html
deleted file mode 100644
index 2b74bf735f1a2..0000000000000
--- a/projects/demo/src/modules/experimental/avatar/examples/5/index.html
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/projects/demo/src/modules/experimental/avatar/examples/5/index.ts b/projects/demo/src/modules/experimental/avatar/examples/5/index.ts
deleted file mode 100644
index c034bf7fe61b0..0000000000000
--- a/projects/demo/src/modules/experimental/avatar/examples/5/index.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import {Component} from '@angular/core';
-import {changeDetection} from '@demo/emulate/change-detection';
-import {encapsulation} from '@demo/emulate/encapsulation';
-import {tuiAvatarOptionsProvider} from '@taiga-ui/experimental';
-
-@Component({
- selector: 'tui-avatar-example-5',
- templateUrl: './index.html',
- encapsulation,
- changeDetection,
- providers: [tuiAvatarOptionsProvider({size: 'l'})],
-})
-export class TuiAvatarExample5 {}
diff --git a/projects/demo/src/modules/experimental/avatar/examples/6/index.html b/projects/demo/src/modules/experimental/avatar/examples/6/index.html
deleted file mode 100644
index 09cdaa5b4fa51..0000000000000
--- a/projects/demo/src/modules/experimental/avatar/examples/6/index.html
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
- MarsiBarsi
-
-
-
-
-
- Inkin
- Alexander
-
-
-
-
-
- Potekhin
- Vladimir
-
-
-
-
-
- Barsukov
- Nikita
-
diff --git a/projects/demo/src/modules/experimental/avatar/examples/6/index.less b/projects/demo/src/modules/experimental/avatar/examples/6/index.less
deleted file mode 100644
index d8787b7d1879d..0000000000000
--- a/projects/demo/src/modules/experimental/avatar/examples/6/index.less
+++ /dev/null
@@ -1,8 +0,0 @@
-:host {
- display: flex;
- gap: 1rem;
-}
-
-tui-avatar {
- border: 1px solid var(--tui-base-04);
-}
diff --git a/projects/demo/src/modules/experimental/avatar/examples/6/index.ts b/projects/demo/src/modules/experimental/avatar/examples/6/index.ts
deleted file mode 100644
index 9d34e62df8e93..0000000000000
--- a/projects/demo/src/modules/experimental/avatar/examples/6/index.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import {Component} from '@angular/core';
-import {changeDetection} from '@demo/emulate/change-detection';
-import {encapsulation} from '@demo/emulate/encapsulation';
-
-@Component({
- selector: 'tui-avatar-example-6',
- templateUrl: './index.html',
- styleUrls: ['./index.less'],
- encapsulation,
- changeDetection,
-})
-export class TuiAvatarExample6 {}
diff --git a/projects/demo/src/modules/experimental/avatar/examples/import/import-module.md b/projects/demo/src/modules/experimental/avatar/examples/import/import-module.md
deleted file mode 100644
index a876a347a7676..0000000000000
--- a/projects/demo/src/modules/experimental/avatar/examples/import/import-module.md
+++ /dev/null
@@ -1,13 +0,0 @@
-```ts
-import {NgModule} from '@angular/core';
-import {TuiAvatarModule} from '@taiga-ui/experimental';
-// ...
-
-@NgModule({
- imports: [
- // ...
- TuiAvatarModule,
- ],
-})
-export class MyModule {}
-```
diff --git a/projects/demo/src/modules/experimental/avatar/examples/import/insert-template.md b/projects/demo/src/modules/experimental/avatar/examples/import/insert-template.md
deleted file mode 100644
index 741200be77b21..0000000000000
--- a/projects/demo/src/modules/experimental/avatar/examples/import/insert-template.md
+++ /dev/null
@@ -1,3 +0,0 @@
-```html
-"Batman"
-```
diff --git a/projects/demo/src/modules/experimental/button-vertical/button-vertical.module.ts b/projects/demo/src/modules/experimental/button-vertical/button-vertical.module.ts
index e52de204c0d28..7842555c72a7c 100644
--- a/projects/demo/src/modules/experimental/button-vertical/button-vertical.module.ts
+++ b/projects/demo/src/modules/experimental/button-vertical/button-vertical.module.ts
@@ -3,11 +3,11 @@ import {NgModule} from '@angular/core';
import {tuiGetDocModules} from '@taiga-ui/addon-doc';
import {TuiNotificationModule, TuiSvgModule} from '@taiga-ui/core';
import {
- TuiAvatarModule,
TuiButtonModule,
TuiButtonVerticalModule,
TuiFadeModule,
} from '@taiga-ui/experimental';
+import {TuiAvatarComponent} from '@taiga-ui/kit';
import {ExampleTuiButtonVerticalComponent} from './button-vertical.component';
import {TuiButtonVerticalExample1} from './examples/1';
@@ -19,7 +19,7 @@ import {TuiButtonVerticalExample2} from './examples/2';
TuiButtonModule,
TuiButtonVerticalModule,
TuiFadeModule,
- TuiAvatarModule,
+ TuiAvatarComponent,
TuiNotificationModule,
TuiSvgModule,
tuiGetDocModules(ExampleTuiButtonVerticalComponent),
diff --git a/projects/demo/src/modules/experimental/button/button.module.ts b/projects/demo/src/modules/experimental/button/button.module.ts
index 54d12d1f7ffff..69431c4ee8f7b 100644
--- a/projects/demo/src/modules/experimental/button/button.module.ts
+++ b/projects/demo/src/modules/experimental/button/button.module.ts
@@ -2,7 +2,8 @@ import {CommonModule} from '@angular/common';
import {NgModule} from '@angular/core';
import {tuiGetDocModules} from '@taiga-ui/addon-doc';
import {TuiNotificationModule} from '@taiga-ui/core';
-import {TuiAvatarModule, TuiButtonModule, TuiIconModule} from '@taiga-ui/experimental';
+import {TuiButtonModule, TuiIconModule} from '@taiga-ui/experimental';
+import {TuiAvatarComponent} from '@taiga-ui/kit';
import {ExampleTuiButtonComponent} from './button.component';
import {TuiButtonExample1} from './examples/1';
@@ -17,7 +18,7 @@ import {TuiButtonExample5} from './examples/5';
TuiButtonModule,
TuiNotificationModule,
TuiIconModule,
- TuiAvatarModule,
+ TuiAvatarComponent,
tuiGetDocModules(ExampleTuiButtonComponent),
],
declarations: [
diff --git a/projects/demo/src/modules/experimental/card/card.module.ts b/projects/demo/src/modules/experimental/card/card.module.ts
index cfd9854b228c3..1fbb6901aaa4d 100644
--- a/projects/demo/src/modules/experimental/card/card.module.ts
+++ b/projects/demo/src/modules/experimental/card/card.module.ts
@@ -11,8 +11,6 @@ import {
} from '@taiga-ui/core';
import {
TuiAutoColorModule,
- TuiAvatarModule,
- TuiAvatarStackModule,
TuiCardModule,
TuiFadeModule,
TuiFallbackSrcModule,
@@ -22,7 +20,11 @@ import {
TuiThumbnailCardModule,
TuiTitleModule,
} from '@taiga-ui/experimental';
-import {TuiBadgeDirective} from '@taiga-ui/kit';
+import {
+ TuiAvatarComponent,
+ TuiAvatarStackComponent,
+ TuiBadgeDirective,
+} from '@taiga-ui/kit';
import {ExampleTuiCardComponent} from './card.component';
import {TuiCardExample1} from './examples/1';
@@ -36,7 +38,7 @@ import {TuiCardExample7} from './examples/7';
@NgModule({
imports: [
CommonModule,
- TuiAvatarStackModule,
+ TuiAvatarStackComponent,
TuiAutoColorModule,
TuiInitialsModule,
TuiNotificationModule,
@@ -47,7 +49,7 @@ import {TuiCardExample7} from './examples/7';
TuiSvgModule,
TuiBadgeDirective,
TuiTitleModule,
- TuiAvatarModule,
+ TuiAvatarComponent,
TuiScrollbarModule,
TuiHintModule,
FormsModule,
diff --git a/projects/demo/src/modules/experimental/cell/cell.module.ts b/projects/demo/src/modules/experimental/cell/cell.module.ts
index c69e9f1c2b974..83012400587fc 100644
--- a/projects/demo/src/modules/experimental/cell/cell.module.ts
+++ b/projects/demo/src/modules/experimental/cell/cell.module.ts
@@ -13,8 +13,6 @@ import {
TuiTooltipModule,
} from '@taiga-ui/core';
import {
- TuiAvatarModule,
- TuiAvatarStackModule,
TuiBadgeNotificationModule,
TuiButtonModule,
TuiCellModule,
@@ -28,6 +26,8 @@ import {
TuiToggleModule,
} from '@taiga-ui/experimental';
import {
+ TuiAvatarComponent,
+ TuiAvatarStackComponent,
TuiBadgedContentComponent,
TuiBadgeDirective,
TuiDataListWrapperModule,
@@ -48,8 +48,8 @@ import {TuiCellExample7} from './examples/7';
imports: [
CommonModule,
FormsModule,
- TuiAvatarModule,
- TuiAvatarStackModule,
+ TuiAvatarComponent,
+ TuiAvatarStackComponent,
TuiBadgeDirective,
TuiBadgeNotificationModule,
TuiBadgedContentComponent,
diff --git a/projects/demo/src/modules/experimental/chip/chip.module.ts b/projects/demo/src/modules/experimental/chip/chip.module.ts
index 74478eab2e14e..4f1188562a700 100644
--- a/projects/demo/src/modules/experimental/chip/chip.module.ts
+++ b/projects/demo/src/modules/experimental/chip/chip.module.ts
@@ -6,14 +6,13 @@ import {TuiRepeatTimesModule} from '@taiga-ui/cdk';
import {TuiNotificationModule} from '@taiga-ui/core';
import {
TuiAmountPipeModule,
- TuiAvatarModule,
TuiBadgeNotificationModule,
TuiButtonModule,
TuiCheckboxModule,
TuiChipModule,
TuiFadeModule,
} from '@taiga-ui/experimental';
-import {TuiBadgedContentComponent} from '@taiga-ui/kit';
+import {TuiAvatarComponent, TuiBadgedContentComponent} from '@taiga-ui/kit';
import {ExampleTuiChipComponent} from './chip.component';
import {TuiChipExample1} from './examples/1';
@@ -30,7 +29,7 @@ import {TuiChipExample4} from './examples/4';
TuiFadeModule,
TuiNotificationModule,
TuiButtonModule,
- TuiAvatarModule,
+ TuiAvatarComponent,
TuiCheckboxModule,
TuiAmountPipeModule,
TuiBadgedContentComponent,
diff --git a/projects/demo/src/modules/experimental/header/header.module.ts b/projects/demo/src/modules/experimental/header/header.module.ts
index 44d571fdfa9d7..3d5df5193dd03 100644
--- a/projects/demo/src/modules/experimental/header/header.module.ts
+++ b/projects/demo/src/modules/experimental/header/header.module.ts
@@ -8,7 +8,6 @@ import {
TuiTooltipModule,
} from '@taiga-ui/core';
import {
- TuiAvatarModule,
TuiBadgeNotificationModule,
TuiButtonModule,
TuiHeaderDirective,
@@ -18,6 +17,7 @@ import {
TuiToggleModule,
} from '@taiga-ui/experimental';
import {
+ TuiAvatarComponent,
TuiBadgeDirective,
TuiDataListWrapperModule,
TuiSelectModule,
@@ -46,7 +46,7 @@ import {ExampleTuiCellComponent} from './header.component';
TuiButtonModule,
tuiGetDocModules(ExampleTuiCellComponent),
TuiNotificationModule,
- TuiAvatarModule,
+ TuiAvatarComponent,
],
declarations: [
ExampleTuiCellComponent,
diff --git a/projects/demo/src/modules/experimental/surface/surface.module.ts b/projects/demo/src/modules/experimental/surface/surface.module.ts
index 7968e2b2117dc..303e803119eca 100644
--- a/projects/demo/src/modules/experimental/surface/surface.module.ts
+++ b/projects/demo/src/modules/experimental/surface/surface.module.ts
@@ -12,8 +12,8 @@ import {
TuiNotificationModule,
TuiScrollbarModule,
} from '@taiga-ui/core';
-import {TuiAvatarModule, TuiButtonModule, TuiSurfaceModule} from '@taiga-ui/experimental';
-import {TuiBadgeDirective} from '@taiga-ui/kit';
+import {TuiButtonModule, TuiSurfaceModule} from '@taiga-ui/experimental';
+import {TuiAvatarComponent, TuiBadgeDirective} from '@taiga-ui/kit';
import {TuiSurfaceExample1} from './examples/1';
import {TuiSurfaceExample2} from './examples/2';
@@ -36,7 +36,7 @@ import {ExampleTuiSurfaceComponent} from './surface.component';
TuiScrollbarModule,
TuiButtonModule,
TuiLinkModule,
- TuiAvatarModule,
+ TuiAvatarComponent,
TuiLabelModule,
TuiModeModule,
TuiMoneyModule,
diff --git a/projects/demo/src/modules/experimental/title/title.module.ts b/projects/demo/src/modules/experimental/title/title.module.ts
index 29b5e8830a895..0dadf0e468334 100644
--- a/projects/demo/src/modules/experimental/title/title.module.ts
+++ b/projects/demo/src/modules/experimental/title/title.module.ts
@@ -2,7 +2,8 @@ import {CommonModule} from '@angular/common';
import {NgModule} from '@angular/core';
import {tuiGetDocModules} from '@taiga-ui/addon-doc';
import {TuiLinkModule, TuiNotificationModule} from '@taiga-ui/core';
-import {TuiAvatarModule, TuiTitleModule} from '@taiga-ui/experimental';
+import {TuiTitleModule} from '@taiga-ui/experimental';
+import {TuiAvatarComponent} from '@taiga-ui/kit';
import {TuiTitleExample1} from './examples/1';
import {TuiTitleExample2} from './examples/2';
@@ -14,7 +15,7 @@ import {ExampleTuiTitleComponent} from './title.component';
CommonModule,
TuiTitleModule,
TuiLinkModule,
- TuiAvatarModule,
+ TuiAvatarComponent,
TuiNotificationModule,
tuiGetDocModules(ExampleTuiTitleComponent),
],
diff --git a/projects/experimental/components/avatar-stack/avatar-stack.module.ts b/projects/experimental/components/avatar-stack/avatar-stack.module.ts
deleted file mode 100644
index 9e7a5c1616808..0000000000000
--- a/projects/experimental/components/avatar-stack/avatar-stack.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import {NgModule} from '@angular/core';
-import {
- TuiAvatarComponent,
- TuiAvatarModule,
-} from '@taiga-ui/experimental/components/avatar';
-
-import {TuiAvatarStackComponent} from './avatar-stack.component';
-
-@NgModule({
- imports: [TuiAvatarModule],
- declarations: [TuiAvatarStackComponent],
- exports: [TuiAvatarStackComponent, TuiAvatarComponent],
-})
-export class TuiAvatarStackModule {}
diff --git a/projects/experimental/components/avatar/avatar.component.ts b/projects/experimental/components/avatar/avatar.component.ts
deleted file mode 100644
index 4b1d6e5f47fef..0000000000000
--- a/projects/experimental/components/avatar/avatar.component.ts
+++ /dev/null
@@ -1,69 +0,0 @@
-import {ChangeDetectionStrategy, Component, Inject, Input} from '@angular/core';
-import {SafeResourceUrl} from '@angular/platform-browser';
-import {tuiIsString, TuiStringHandler} from '@taiga-ui/cdk';
-import {
- TUI_ICON_RESOLVER,
- TuiAppearanceDirective,
- tuiAppearanceOptionsProvider,
-} from '@taiga-ui/core';
-
-import {TUI_AVATAR_OPTIONS, TuiAvatarOptions} from './avatar.options';
-
-@Component({
- selector: 'tui-avatar',
- templateUrl: './avatar.template.html',
- styleUrls: ['./avatar.style.less'],
- changeDetection: ChangeDetectionStrategy.OnPush,
- providers: [tuiAppearanceOptionsProvider(TUI_AVATAR_OPTIONS)],
- hostDirectives: [
- {
- directive: TuiAppearanceDirective,
- inputs: [
- 'tuiAppearance: appearance',
- 'tuiAppearanceState',
- 'tuiAppearanceFocus',
- ],
- },
- ],
- host: {
- '[attr.data-size]': 'size',
- '[attr.data-type]': 'type',
- '[style.--t-mask]': '"url(" + resolver(src) + ")"',
- '[class._round]': 'round',
- },
-})
-export class TuiAvatarComponent {
- @Input()
- size = this.options.size;
-
- @Input()
- round = this.options.round;
-
- @Input()
- src: SafeResourceUrl | string | null = null;
-
- constructor(
- @Inject(TUI_AVATAR_OPTIONS) private readonly options: TuiAvatarOptions,
- @Inject(TUI_ICON_RESOLVER) readonly resolver: TuiStringHandler,
- ) {}
-
- get value(): SafeResourceUrl | string {
- return this.src || '';
- }
-
- get type(): 'content' | 'icon' | 'img' | 'text' {
- if (this.value && !tuiIsString(this.value)) {
- return 'img';
- }
-
- if (this.value.startsWith('tuiIcon') || this.value.endsWith('.svg')) {
- return 'icon';
- }
-
- if (this.value.length > 0 && this.value.length < 3) {
- return 'text';
- }
-
- return this.value.length ? 'img' : 'content';
- }
-}
diff --git a/projects/experimental/components/avatar/avatar.module.ts b/projects/experimental/components/avatar/avatar.module.ts
deleted file mode 100644
index 34bd1777dcedc..0000000000000
--- a/projects/experimental/components/avatar/avatar.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import {CommonModule} from '@angular/common';
-import {NgModule} from '@angular/core';
-import {TuiIconModule} from '@taiga-ui/experimental/components/icon';
-import {TuiLazyLoadingModule} from '@taiga-ui/kit';
-
-import {TuiAvatarComponent} from './avatar.component';
-
-@NgModule({
- imports: [CommonModule, TuiIconModule, TuiLazyLoadingModule],
- declarations: [TuiAvatarComponent],
- exports: [TuiAvatarComponent],
-})
-export class TuiAvatarModule {}
diff --git a/projects/experimental/components/avatar/avatar.options.ts b/projects/experimental/components/avatar/avatar.options.ts
deleted file mode 100644
index a0e27313d111f..0000000000000
--- a/projects/experimental/components/avatar/avatar.options.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import {Provider} from '@angular/core';
-import {tuiCreateToken, tuiProvideOptions} from '@taiga-ui/cdk';
-import {TuiAppearanceOptions, TuiSizeXXL, TuiSizeXXS} from '@taiga-ui/core';
-
-export interface TuiAvatarOptions extends TuiAppearanceOptions {
- readonly round: boolean;
- readonly size: TuiSizeXXL | TuiSizeXXS;
-}
-
-export const TUI_AVATAR_DEFAULT_OPTIONS: TuiAvatarOptions = {
- appearance: '',
- round: true,
- size: 'm',
-};
-
-export const TUI_AVATAR_OPTIONS = tuiCreateToken(TUI_AVATAR_DEFAULT_OPTIONS);
-
-export function tuiAvatarOptionsProvider(options: Partial): Provider {
- return tuiProvideOptions(TUI_AVATAR_OPTIONS, options, TUI_AVATAR_DEFAULT_OPTIONS);
-}
diff --git a/projects/experimental/components/avatar/avatar.style.less b/projects/experimental/components/avatar/avatar.style.less
deleted file mode 100644
index 04ddadb26ecb9..0000000000000
--- a/projects/experimental/components/avatar/avatar.style.less
+++ /dev/null
@@ -1,124 +0,0 @@
-@import '@taiga-ui/core/styles/taiga-ui-local';
-
-:host {
- --t-size: 3.5rem;
- --t-radius: 0.75rem;
- position: relative;
- display: inline-flex;
- flex-shrink: 0;
- width: var(--t-size);
- height: var(--t-size);
- align-items: center;
- justify-content: center;
- overflow: hidden;
- white-space: nowrap;
- border-radius: var(--t-radius);
- background: var(--tui-secondary);
- color: var(--tui-text-02);
- vertical-align: middle;
- box-sizing: border-box;
- padding: 0.25rem;
- opacity: 0.999; // Kick in hardware rendering layer to avoid artifacts on the edges
-
- &:before {
- .fullsize();
- background: currentColor;
- mask: var(--t-mask) no-repeat center/60%;
- }
-
- &[data-size='xxs'] {
- --t-size: 1.5rem;
- --t-radius: 0.5rem;
- font: var(--tui-font-text-xs);
- font-weight: bold;
-
- &[data-type='content'] {
- font: var(--tui-font-text-m);
- font-size: 0.5625rem;
- }
- }
-
- &[data-size='xs'] {
- --t-size: 2rem;
- --t-radius: 0.5rem;
- font: var(--tui-font-text-s);
- font-weight: bold;
-
- &[data-type='content'] {
- font: var(--tui-font-text-xs);
- font-weight: bold;
- }
- }
-
- &[data-size='s'] {
- --t-size: 2.5rem;
- --t-radius: 0.75rem;
- font: var(--tui-font-text-l);
- font-weight: bold;
-
- &[data-type='content'] {
- font: var(--tui-font-text-m);
- font-weight: bold;
- }
- }
-
- &[data-size='m'] {
- --t-size: 3.5rem;
- --t-radius: 0.75rem;
- font: var(--tui-font-heading-5);
-
- &[data-type='content'] {
- font: var(--tui-font-text-l);
- font-weight: bold;
- }
- }
-
- &[data-size='l'] {
- --t-size: 5rem;
- --t-radius: 0.75rem;
- font: var(--tui-font-heading-3);
-
- &[data-type='content'] {
- font: var(--tui-font-heading-4);
- }
- }
-
- &[data-size='xl'] {
- --t-size: 6rem;
- --t-radius: 1rem;
- font: var(--tui-font-heading-3);
-
- &[data-type='content'] {
- font: var(--tui-font-heading-3);
- }
- }
-
- &[data-size='xxl'] {
- --t-size: 8rem;
- --t-radius: 1.25rem;
- font: var(--tui-font-heading-2);
-
- &[data-type='content'] {
- font: var(--tui-font-heading-3);
- }
- }
-
- &[data-type='img'] {
- background: transparent;
- }
-
- &[data-type='icon']:before {
- content: '';
- }
-
- &._round {
- --t-radius: calc(var(--t-size) / 2);
- }
-
- ::ng-deep img,
- ::ng-deep picture,
- ::ng-deep video {
- .fullsize();
- object-fit: cover;
- }
-}
diff --git a/projects/experimental/components/avatar/avatar.template.html b/projects/experimental/components/avatar/avatar.template.html
deleted file mode 100644
index e706a7e346897..0000000000000
--- a/projects/experimental/components/avatar/avatar.template.html
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
- {{ value }}
-
-
-
-
diff --git a/projects/experimental/components/avatar/index.ts b/projects/experimental/components/avatar/index.ts
deleted file mode 100644
index 75e00732d4245..0000000000000
--- a/projects/experimental/components/avatar/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from './avatar.component';
-export * from './avatar.module';
-export * from './avatar.options';
diff --git a/projects/experimental/components/avatar/ng-package.json b/projects/experimental/components/avatar/ng-package.json
deleted file mode 100644
index bebf62dcb5e51..0000000000000
--- a/projects/experimental/components/avatar/ng-package.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "lib": {
- "entryFile": "index.ts"
- }
-}
diff --git a/projects/experimental/components/chip/chip.directive.ts b/projects/experimental/components/chip/chip.directive.ts
index 0595bc786af24..13c147400cb48 100644
--- a/projects/experimental/components/chip/chip.directive.ts
+++ b/projects/experimental/components/chip/chip.directive.ts
@@ -6,10 +6,10 @@ import {
TuiIconsDirective,
TuiSizeXXS,
} from '@taiga-ui/core';
-import {tuiAvatarOptionsProvider} from '@taiga-ui/experimental/components/avatar';
import {tuiButtonOptionsProvider} from '@taiga-ui/experimental/components/button';
import {tuiCheckboxOptionsProvider} from '@taiga-ui/experimental/components/checkbox';
import {tuiToggleOptionsProvider} from '@taiga-ui/experimental/components/toggle';
+import {tuiAvatarOptionsProvider} from '@taiga-ui/kit';
import {TuiChipComponent} from './chip.component';
import {TUI_CHIP_OPTIONS, TuiChipOptions} from './chip.options';
diff --git a/projects/experimental/components/index.ts b/projects/experimental/components/index.ts
index ba1c2e3c2b771..04aa5099da695 100644
--- a/projects/experimental/components/index.ts
+++ b/projects/experimental/components/index.ts
@@ -1,6 +1,3 @@
-export * from '@taiga-ui/experimental/components/avatar';
-export * from '@taiga-ui/experimental/components/avatar-labeled';
-export * from '@taiga-ui/experimental/components/avatar-stack';
export * from '@taiga-ui/experimental/components/badge-notification';
export * from '@taiga-ui/experimental/components/button';
export * from '@taiga-ui/experimental/components/checkbox';
diff --git a/projects/experimental/directives/cell/cell.directive.ts b/projects/experimental/directives/cell/cell.directive.ts
index d9b890b19319c..e9b16bf18a1a3 100644
--- a/projects/experimental/directives/cell/cell.directive.ts
+++ b/projects/experimental/directives/cell/cell.directive.ts
@@ -1,10 +1,8 @@
import {Directive, Inject, Input} from '@angular/core';
import {TuiDirectiveStylesService} from '@taiga-ui/cdk';
import {TuiSizeL, TuiSizeS} from '@taiga-ui/core';
-import {
- tuiAvatarOptionsProvider,
- tuiButtonOptionsProvider,
-} from '@taiga-ui/experimental/components';
+import {tuiButtonOptionsProvider} from '@taiga-ui/experimental/components';
+import {tuiAvatarOptionsProvider} from '@taiga-ui/kit';
import {TuiCellComponent} from './cell.component';
diff --git a/projects/experimental/directives/header/header.directive.ts b/projects/experimental/directives/header/header.directive.ts
index 07d09b1f4d483..00e4895933e57 100644
--- a/projects/experimental/directives/header/header.directive.ts
+++ b/projects/experimental/directives/header/header.directive.ts
@@ -1,11 +1,8 @@
import {Directive, Input} from '@angular/core';
import {tuiWithStyles} from '@taiga-ui/cdk';
import {TuiSizeXXL, TuiSizeXXS} from '@taiga-ui/core';
-import {
- tuiAvatarOptionsProvider,
- tuiButtonOptionsProvider,
-} from '@taiga-ui/experimental/components';
-import {tuiBadgeOptionsProvider} from '@taiga-ui/kit';
+import {tuiButtonOptionsProvider} from '@taiga-ui/experimental/components';
+import {tuiAvatarOptionsProvider, tuiBadgeOptionsProvider} from '@taiga-ui/kit';
import {TuiHeaderComponent} from './header.component';
diff --git a/projects/experimental/components/avatar-labeled/avatar-labeled.component.ts b/projects/kit/components/avatar-labeled/avatar-labeled.component.ts
similarity index 100%
rename from projects/experimental/components/avatar-labeled/avatar-labeled.component.ts
rename to projects/kit/components/avatar-labeled/avatar-labeled.component.ts
diff --git a/projects/experimental/components/avatar-labeled/avatar-labeled.styles.less b/projects/kit/components/avatar-labeled/avatar-labeled.styles.less
similarity index 100%
rename from projects/experimental/components/avatar-labeled/avatar-labeled.styles.less
rename to projects/kit/components/avatar-labeled/avatar-labeled.styles.less
diff --git a/projects/experimental/components/avatar-labeled/index.ts b/projects/kit/components/avatar-labeled/index.ts
similarity index 100%
rename from projects/experimental/components/avatar-labeled/index.ts
rename to projects/kit/components/avatar-labeled/index.ts
diff --git a/projects/experimental/components/avatar-labeled/ng-package.json b/projects/kit/components/avatar-labeled/ng-package.json
similarity index 100%
rename from projects/experimental/components/avatar-labeled/ng-package.json
rename to projects/kit/components/avatar-labeled/ng-package.json
diff --git a/projects/experimental/components/avatar-stack/avatar-stack.component.ts b/projects/kit/components/avatar-stack/avatar-stack.component.ts
similarity index 81%
rename from projects/experimental/components/avatar-stack/avatar-stack.component.ts
rename to projects/kit/components/avatar-stack/avatar-stack.component.ts
index cb52ec419a148..25bf0c86aae35 100644
--- a/projects/experimental/components/avatar-stack/avatar-stack.component.ts
+++ b/projects/kit/components/avatar-stack/avatar-stack.component.ts
@@ -6,9 +6,12 @@ import {
ViewEncapsulation,
} from '@angular/core';
import {TuiHorizontalDirection} from '@taiga-ui/core';
+import {TuiAvatarComponent} from '@taiga-ui/kit/components/avatar';
@Component({
+ standalone: true,
selector: 'tui-avatar-stack',
+ imports: [TuiAvatarComponent],
template: ' ',
styleUrls: ['./avatar-stack.style.less'],
encapsulation: ViewEncapsulation.None,
diff --git a/projects/experimental/components/avatar-stack/avatar-stack.style.less b/projects/kit/components/avatar-stack/avatar-stack.style.less
similarity index 100%
rename from projects/experimental/components/avatar-stack/avatar-stack.style.less
rename to projects/kit/components/avatar-stack/avatar-stack.style.less
diff --git a/projects/experimental/components/avatar-stack/index.ts b/projects/kit/components/avatar-stack/index.ts
similarity index 51%
rename from projects/experimental/components/avatar-stack/index.ts
rename to projects/kit/components/avatar-stack/index.ts
index ad04b50530161..9949099017cef 100644
--- a/projects/experimental/components/avatar-stack/index.ts
+++ b/projects/kit/components/avatar-stack/index.ts
@@ -1,2 +1 @@
export * from './avatar-stack.component';
-export * from './avatar-stack.module';
diff --git a/projects/experimental/components/avatar-stack/ng-package.json b/projects/kit/components/avatar-stack/ng-package.json
similarity index 100%
rename from projects/experimental/components/avatar-stack/ng-package.json
rename to projects/kit/components/avatar-stack/ng-package.json
diff --git a/projects/kit/components/avatar/avatar.component.ts b/projects/kit/components/avatar/avatar.component.ts
index d736ee46ceeaa..a1a3de9275765 100644
--- a/projects/kit/components/avatar/avatar.component.ts
+++ b/projects/kit/components/avatar/avatar.component.ts
@@ -1,93 +1,75 @@
-import {
- ChangeDetectionStrategy,
- Component,
- HostBinding,
- Inject,
- Input,
-} from '@angular/core';
+import {CommonModule} from '@angular/common';
+import {ChangeDetectionStrategy, Component, Inject, Input} from '@angular/core';
import {SafeResourceUrl} from '@angular/platform-browser';
-import {tuiIsString, tuiPure, TuiSafeHtml} from '@taiga-ui/cdk';
-import {tuiSizeBigger, TuiSizeXXL, TuiSizeXXS} from '@taiga-ui/core';
-import {tuiStringHashToHsl} from '@taiga-ui/kit/utils/format';
+import {tuiIsString, TuiStringHandler} from '@taiga-ui/cdk';
+import {
+ TUI_ICON_RESOLVER,
+ TuiAppearanceDirective,
+ tuiAppearanceOptionsProvider,
+} from '@taiga-ui/core';
+// eslint-disable-next-line @taiga-ui/experience/no-deep-imports
+import {TuiIconModule} from '@taiga-ui/experimental/components/icon';
+import {TuiLazyLoadingModule} from '@taiga-ui/kit/directives';
import {TUI_AVATAR_OPTIONS, TuiAvatarOptions} from './avatar.options';
@Component({
+ standalone: true,
selector: 'tui-avatar',
+ imports: [CommonModule, TuiLazyLoadingModule, TuiIconModule],
templateUrl: './avatar.template.html',
styleUrls: ['./avatar.style.less'],
changeDetection: ChangeDetectionStrategy.OnPush,
+ providers: [tuiAppearanceOptionsProvider(TUI_AVATAR_OPTIONS)],
+ hostDirectives: [
+ {
+ directive: TuiAppearanceDirective,
+ inputs: [
+ 'tuiAppearance: appearance',
+ 'tuiAppearanceState',
+ 'tuiAppearanceFocus',
+ ],
+ },
+ ],
+ host: {
+ '[attr.data-size]': 'size',
+ '[attr.data-type]': 'type',
+ '[style.--t-mask]': '"url(" + resolver(src) + ")"',
+ '[class._round]': 'round',
+ },
})
export class TuiAvatarComponent {
@Input()
- @HostBinding('attr.data-size')
size = this.options.size;
- @Input('avatarUrl')
- set avatarUrlSetter(avatarUrl: SafeResourceUrl | string | null) {
- this.avatarUrl = avatarUrl;
- this.isUrlValid = !!avatarUrl && !this.iconAvatar;
- }
-
- @Input()
- text = '';
-
- @Input()
- fallback: TuiSafeHtml | null = null;
-
@Input()
- autoColor: boolean = this.options.autoColor;
+ round = this.options.round;
@Input()
- @HostBinding('class._rounded')
- rounded: boolean = this.options.rounded;
-
- avatarUrl: SafeResourceUrl | string | null = null;
-
- isUrlValid = false;
+ src: SafeResourceUrl | string | null = null;
- constructor(@Inject(TUI_AVATAR_OPTIONS) private readonly options: TuiAvatarOptions) {}
+ constructor(
+ @Inject(TUI_AVATAR_OPTIONS) private readonly options: TuiAvatarOptions,
+ @Inject(TUI_ICON_RESOLVER) readonly resolver: TuiStringHandler,
+ ) {}
- @HostBinding('style.background')
- get bgColor(): string {
- return this.autoColor ? tuiStringHashToHsl(this.text) : '';
+ get value(): SafeResourceUrl | string {
+ return this.src || '';
}
- @HostBinding('class._has-avatar')
- get hasAvatar(): boolean {
- return this.avatarUrl !== null && this.isUrlValid;
- }
-
- get iconAvatar(): boolean {
- return tuiIsString(this.avatarUrl) && !!this.avatarUrl?.startsWith('tuiIcon');
- }
-
- get useFallback(): boolean {
- return (
- !!this.fallback && !!this.avatarUrl && !this.isUrlValid && !this.text.length
- );
- }
+ get type(): 'content' | 'icon' | 'img' | 'text' {
+ if (this.value && !tuiIsString(this.value)) {
+ return 'img';
+ }
- get computedText(): string {
- return this.hasAvatar || this.iconAvatar || this.text === ''
- ? ''
- : this.getSlicedText(this.text, this.size);
- }
-
- get stringAvatar(): string {
- return this.iconAvatar ? String(this.avatarUrl) : '';
- }
-
- onError(): void {
- this.isUrlValid = false;
- }
+ if (this.value.startsWith('tuiIcon') || this.value.endsWith('.svg')) {
+ return 'icon';
+ }
- @tuiPure
- private getSlicedText(text: string, size: TuiSizeXXL | TuiSizeXXS): string {
- const words = text.split(' ');
+ if (this.value.length > 0 && this.value.length < 3) {
+ return 'text';
+ }
- return words.length > 1 && tuiSizeBigger(size)
- ? words[0].slice(0, 1) + words[1].slice(0, 1)
- : words[0].slice(0, 1);
+ return this.value.length ? 'img' : 'content';
}
}
diff --git a/projects/kit/components/avatar/avatar.module.ts b/projects/kit/components/avatar/avatar.module.ts
deleted file mode 100644
index f79a911196739..0000000000000
--- a/projects/kit/components/avatar/avatar.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import {CommonModule} from '@angular/common';
-import {NgModule} from '@angular/core';
-import {TuiSvgModule} from '@taiga-ui/core';
-import {TuiLazyLoadingModule} from '@taiga-ui/kit/directives';
-
-import {TuiAvatarComponent} from './avatar.component';
-
-@NgModule({
- imports: [CommonModule, TuiLazyLoadingModule, TuiSvgModule],
- declarations: [TuiAvatarComponent],
- exports: [TuiAvatarComponent],
-})
-export class TuiAvatarModule {}
diff --git a/projects/kit/components/avatar/avatar.options.ts b/projects/kit/components/avatar/avatar.options.ts
index 3bf4b008fadfc..a0e27313d111f 100644
--- a/projects/kit/components/avatar/avatar.options.ts
+++ b/projects/kit/components/avatar/avatar.options.ts
@@ -1,23 +1,18 @@
import {Provider} from '@angular/core';
import {tuiCreateToken, tuiProvideOptions} from '@taiga-ui/cdk';
-import {TuiSizeXXL, TuiSizeXXS} from '@taiga-ui/core';
+import {TuiAppearanceOptions, TuiSizeXXL, TuiSizeXXS} from '@taiga-ui/core';
-export interface TuiAvatarOptions {
- readonly autoColor: boolean;
- readonly rounded: boolean;
+export interface TuiAvatarOptions extends TuiAppearanceOptions {
+ readonly round: boolean;
readonly size: TuiSizeXXL | TuiSizeXXS;
}
-/** Default values for the avatar options. */
export const TUI_AVATAR_DEFAULT_OPTIONS: TuiAvatarOptions = {
+ appearance: '',
+ round: true,
size: 'm',
- autoColor: false,
- rounded: false,
};
-/**
- * Default parameters for avatar component
- */
export const TUI_AVATAR_OPTIONS = tuiCreateToken(TUI_AVATAR_DEFAULT_OPTIONS);
export function tuiAvatarOptionsProvider(options: Partial): Provider {
diff --git a/projects/kit/components/avatar/avatar.style.less b/projects/kit/components/avatar/avatar.style.less
index 0ac201b25df6b..04ddadb26ecb9 100644
--- a/projects/kit/components/avatar/avatar.style.less
+++ b/projects/kit/components/avatar/avatar.style.less
@@ -1,210 +1,124 @@
@import '@taiga-ui/core/styles/taiga-ui-local';
-@size-xs: 1.5rem;
-@size-s: 2rem;
-@size-m: 3rem;
-@size-l: 4rem;
-@size-xl: 6rem;
-@size-xxl: 9rem;
-
:host {
+ --t-size: 3.5rem;
+ --t-radius: 0.75rem;
position: relative;
- display: flex;
+ display: inline-flex;
flex-shrink: 0;
- border-radius: var(--tui-radius-m);
- color: var(--tui-secondary-active);
- text-align: center;
- text-transform: uppercase;
- justify-content: center;
+ width: var(--t-size);
+ height: var(--t-size);
align-items: center;
- background: var(--tui-avatar-background, currentColor);
- user-select: none;
+ justify-content: center;
overflow: hidden;
+ white-space: nowrap;
+ border-radius: var(--t-radius);
+ background: var(--tui-secondary);
+ color: var(--tui-text-02);
+ vertical-align: middle;
+ box-sizing: border-box;
+ padding: 0.25rem;
+ opacity: 0.999; // Kick in hardware rendering layer to avoid artifacts on the edges
+
+ &:before {
+ .fullsize();
+ background: currentColor;
+ mask: var(--t-mask) no-repeat center/60%;
+ }
+
+ &[data-size='xxs'] {
+ --t-size: 1.5rem;
+ --t-radius: 0.5rem;
+ font: var(--tui-font-text-xs);
+ font-weight: bold;
+
+ &[data-type='content'] {
+ font: var(--tui-font-text-m);
+ font-size: 0.5625rem;
+ }
+ }
&[data-size='xs'] {
+ --t-size: 2rem;
+ --t-radius: 0.5rem;
font: var(--tui-font-text-s);
- width: @size-xs;
- height: @size-xs;
- }
+ font-weight: bold;
- &[data-size='s'] {
- font: var(--tui-font-text-m);
- width: @size-s;
- height: @size-s;
+ &[data-type='content'] {
+ font: var(--tui-font-text-xs);
+ font-weight: bold;
+ }
}
- &[data-size='m'] {
+ &[data-size='s'] {
+ --t-size: 2.5rem;
+ --t-radius: 0.75rem;
font: var(--tui-font-text-l);
- width: @size-m;
- height: @size-m;
- }
-
- &[data-size='l'] {
- font: var(--tui-font-heading-5);
- width: @size-l;
- height: @size-l;
- border-radius: var(--tui-radius-xl);
- }
-
- &[data-size='xl'] {
- font: var(--tui-font-heading-3);
- width: @size-xl;
- height: @size-xl;
- border-radius: var(--tui-radius-xl);
- }
-
- &[data-size='xxl'] {
- font: var(--tui-font-heading-1);
- width: @size-xxl;
- height: @size-xxl;
- border-radius: var(--tui-radius-l);
- }
-
- &[new] {
- &[data-size='xxs'] {
- width: 1.5rem;
- height: 1.5rem;
- border-radius: var(--tui-radius-s);
-
- .t-icon {
- transform: scale(0.58);
- }
- }
-
- &[data-size='xs'] {
- width: 2rem;
- height: 2rem;
- border-radius: var(--tui-radius-s);
-
- .t-icon {
- transform: scale(0.83);
- }
- }
-
- &[data-size='s'] {
- width: 2.5rem;
- height: 2.5rem;
- border-radius: calc(1.5 * var(--tui-radius-s));
-
- .t-icon {
- transform: scale(1);
- }
- }
-
- &[data-size='m'] {
- width: 3rem;
- height: 3rem;
- border-radius: calc(2 * var(--tui-radius-s));
+ font-weight: bold;
- .t-icon {
- transform: scale(1.17);
- }
+ &[data-type='content'] {
+ font: var(--tui-font-text-m);
+ font-weight: bold;
}
-
- &[data-size='l'] {
- width: 4rem;
- height: 4rem;
- border-radius: calc(2 * var(--tui-radius-s));
-
- .t-icon {
- transform: scale(1.67);
- }
- }
-
- &[data-size='xl'] {
- width: 6rem;
- height: 6rem;
- border-radius: calc(3 * var(--tui-radius-s));
-
- .t-icon {
- transform: scale(2.33);
- }
- }
-
- &[data-size='xxl'] {
- width: 8rem;
- height: 8rem;
- border-radius: calc(4 * var(--tui-radius-s));
-
- .t-icon {
- transform: scale(3.33);
- }
- }
- }
-
- &._has-avatar {
- background-color: transparent;
- }
-
- &._rounded {
- border-radius: 100% !important;
- }
-}
-
-::ng-deep .tui-avatar-stack {
- display: flex;
- width: min-content;
-}
-
-:host-context(.tui-avatar-stack) {
- &[data-size='xs'] {
- margin-right: -0.625rem;
- box-shadow: 0 0 0 1px var(--tui-avatar-border, var(--tui-base-01));
- }
-
- &[data-size='s'] {
- margin-right: -0.875rem;
- box-shadow: 0 0 0 1px var(--tui-avatar-border, var(--tui-base-01));
}
&[data-size='m'] {
- margin-right: -1.25rem;
- box-shadow: 0 0 0 2px var(--tui-avatar-border, var(--tui-base-01));
+ --t-size: 3.5rem;
+ --t-radius: 0.75rem;
+ font: var(--tui-font-heading-5);
+
+ &[data-type='content'] {
+ font: var(--tui-font-text-l);
+ font-weight: bold;
+ }
}
&[data-size='l'] {
- margin-right: -1.625rem;
- box-shadow: 0 0 0 2px var(--tui-avatar-border, var(--tui-base-01));
+ --t-size: 5rem;
+ --t-radius: 0.75rem;
+ font: var(--tui-font-heading-3);
+
+ &[data-type='content'] {
+ font: var(--tui-font-heading-4);
+ }
}
&[data-size='xl'] {
- margin-right: -2.25rem;
- box-shadow: 0 0 0 3px var(--tui-avatar-border, var(--tui-base-01));
- }
+ --t-size: 6rem;
+ --t-radius: 1rem;
+ font: var(--tui-font-heading-3);
- &[data-size='xxl'] {
- margin-right: -3.375rem;
- box-shadow: 0 0 0 3px var(--tui-avatar-border, var(--tui-base-01));
+ &[data-type='content'] {
+ font: var(--tui-font-heading-3);
+ }
}
-}
-
-.t-image {
- width: 100%;
- height: 100%;
- object-fit: cover;
-}
-.t-text {
- color: var(--tui-avatar-color, var(--tui-text-01));
-}
+ &[data-size='xxl'] {
+ --t-size: 8rem;
+ --t-radius: 1.25rem;
+ font: var(--tui-font-heading-2);
-.t-icon {
- .fullsize();
- color: var(--tui-avatar-color, var(--tui-text-01));
+ &[data-type='content'] {
+ font: var(--tui-font-heading-3);
+ }
+ }
- :host[data-size='xs'] & {
- transform: scale(0.5);
+ &[data-type='img'] {
+ background: transparent;
}
- :host[data-size='m'] & {
- transform: scale(1.6);
+ &[data-type='icon']:before {
+ content: '';
}
- :host[data-size='l'] & {
- transform: scale(2);
+ &._round {
+ --t-radius: calc(var(--t-size) / 2);
}
- :host[data-size='xl'] & {
- transform: scale(3.2);
+ ::ng-deep img,
+ ::ng-deep picture,
+ ::ng-deep video {
+ .fullsize();
+ object-fit: cover;
}
}
diff --git a/projects/kit/components/avatar/avatar.template.html b/projects/kit/components/avatar/avatar.template.html
index 65ef632d5c330..e706a7e346897 100644
--- a/projects/kit/components/avatar/avatar.template.html
+++ b/projects/kit/components/avatar/avatar.template.html
@@ -1,19 +1,12 @@
-
-
-
-{{ computedText }}
+
+
+ {{ value }}
+
+
+
+
diff --git a/projects/kit/components/avatar/index.ts b/projects/kit/components/avatar/index.ts
index 75e00732d4245..34f2945ff0d86 100644
--- a/projects/kit/components/avatar/index.ts
+++ b/projects/kit/components/avatar/index.ts
@@ -1,3 +1,2 @@
export * from './avatar.component';
-export * from './avatar.module';
export * from './avatar.options';
diff --git a/projects/kit/components/avatar/tests/avatar-options.spec.ts b/projects/kit/components/avatar/tests/avatar-options.spec.ts
deleted file mode 100644
index b87a683954ea2..0000000000000
--- a/projects/kit/components/avatar/tests/avatar-options.spec.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-import {Component, ViewChild} from '@angular/core';
-import {ComponentFixture, TestBed} from '@angular/core/testing';
-import {
- TuiAvatarComponent,
- TuiAvatarModule,
- tuiAvatarOptionsProvider,
-} from '@taiga-ui/kit';
-
-describe('Avatar component options', () => {
- let fixture: ComponentFixture;
- let testComponent: TestComponent;
-
- @Component({
- template: `
-
- `,
- })
- class TestComponent {
- @ViewChild(TuiAvatarComponent, {static: true})
- component!: TuiAvatarComponent;
- }
-
- beforeEach(() => {
- TestBed.configureTestingModule({
- imports: [TuiAvatarModule],
- declarations: [TestComponent],
- providers: [
- tuiAvatarOptionsProvider({
- size: 'l',
- autoColor: true,
- rounded: true,
- }),
- ],
- });
-
- fixture = TestBed.createComponent(TestComponent);
- testComponent = fixture.componentInstance;
- fixture.detectChanges();
- });
-
- it('override by custom options', () => {
- expect(testComponent.component.size).toBe('l');
- expect(testComponent.component.autoColor).toBe(true);
- expect(testComponent.component.rounded).toBe(true);
- });
-});
diff --git a/projects/kit/components/avatar/tests/avatar.component.spec.ts b/projects/kit/components/avatar/tests/avatar.component.spec.ts
deleted file mode 100644
index 8896297b66345..0000000000000
--- a/projects/kit/components/avatar/tests/avatar.component.spec.ts
+++ /dev/null
@@ -1,110 +0,0 @@
-import {HarnessLoader} from '@angular/cdk/testing';
-import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed';
-import {Component} from '@angular/core';
-import {ComponentFixture, TestBed} from '@angular/core/testing';
-import {TuiAvatarModule} from '@taiga-ui/kit';
-import {TuiAvatarHarness, TuiPageObject} from '@taiga-ui/testing';
-
-describe('Avatar', () => {
- @Component({
- template: `
-
-
-
-
-
- `,
- })
- class TestComponent {}
-
- let fixture: ComponentFixture;
- let loader: HarnessLoader;
- let pageObject: TuiPageObject;
- const testContext = {
- get prefix() {
- return 'tui-avatar__';
- },
- };
-
- function getAvatar(): HTMLElement {
- return pageObject.getByAutomationId(`${testContext.prefix}component`)!
- .nativeElement;
- }
-
- beforeEach(async () => {
- TestBed.configureTestingModule({
- imports: [TuiAvatarModule],
- declarations: [TestComponent],
- });
- await TestBed.compileComponents();
- fixture = TestBed.createComponent(TestComponent);
- loader = TestbedHarnessEnvironment.loader(fixture);
- });
-
- describe('computedText', () => {
- it('if there is an avatar, the text value is empty', async () => {
- const avatar = await loader.getHarness(TuiAvatarHarness);
-
- expect(await avatar.text()).toBe('');
- });
-
- it('if there is no avatar, the text value is taken from the first letters of the words in text', async () => {
- const avatar = await loader.getHarness(
- TuiAvatarHarness.with({selector: '#null-url'}),
- );
-
- expect(await avatar.text()).toBe('JC');
- });
-
- it('if the avatar is absent, and there is one word in text, its first letter is taken', async () => {
- const avatar = await loader.getHarness(
- TuiAvatarHarness.with({selector: '#null-url-with-text'}),
- );
-
- expect(await avatar.text()).toBe('J');
- });
-
- it('for xs sizes only one letter is taken', async () => {
- const avatar = await loader.getHarness(
- TuiAvatarHarness.with({selector: '#null-url-xs'}),
- );
-
- expect(await avatar.text()).toBe('J');
- });
- });
-
- // TODO: Jest doesn't support intersection observe
- xdescribe('Avatar color', () => {
- it('if there is an avatarUrl the color is rgba(0, 0, 0, 0)', () => {
- expect(getComputedStyle(getAvatar()).backgroundColor).toBe(
- 'rgba(0, 0, 0, 0)',
- );
- });
-
- it('when autoColor is on, the color will be - rgb(160, 170, 228)', () => {
- expect(getComputedStyle(getAvatar()).backgroundColor).toBe(
- 'rgb(160, 170, 228)',
- );
- });
- });
-});
diff --git a/projects/kit/components/index.ts b/projects/kit/components/index.ts
index fa89cfd4513fa..3fbe7a999b1a7 100644
--- a/projects/kit/components/index.ts
+++ b/projects/kit/components/index.ts
@@ -2,6 +2,8 @@ export * from '@taiga-ui/kit/components/accordion';
export * from '@taiga-ui/kit/components/action';
export * from '@taiga-ui/kit/components/arrow';
export * from '@taiga-ui/kit/components/avatar';
+export * from '@taiga-ui/kit/components/avatar-labeled';
+export * from '@taiga-ui/kit/components/avatar-stack';
export * from '@taiga-ui/kit/components/badge';
export * from '@taiga-ui/kit/components/badged-content';
export * from '@taiga-ui/kit/components/breadcrumbs';