Skip to content

Commit 432412c

Browse files
feat(kit): Status add new component (#8057)
Co-authored-by: taiga-family-bot <taiga-family-bot@users.noreply.github.com>
1 parent ee063a0 commit 432412c

File tree

22 files changed

+169
-40
lines changed

22 files changed

+169
-40
lines changed

projects/demo/src/modules/app/app.routes.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,11 @@ export const ROUTES: Routes = [
584584
loadComponent: async () => import('../components/slider'),
585585
title: 'Slider',
586586
}),
587+
route({
588+
path: DemoRoute.Status,
589+
loadComponent: async () => import('../components/status'),
590+
title: 'Status',
591+
}),
587592
route({
588593
path: DemoRoute.Stepper,
589594
loadComponent: async () => import('../components/stepper'),

projects/demo/src/modules/app/demo-routes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ export const DemoRoute = {
114114
Sheet: '/components/sheet',
115115
SheetDialog: '/components/sheet-dialog',
116116
Slider: '/components/slider',
117+
Status: '/components/status',
117118
Stepper: '/navigation/stepper',
118119
Preview: '/components/preview',
119120
AppBar: '/navigation/app-bar',

projects/demo/src/modules/app/pages.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,12 @@ export const pages: TuiDocRoutePages = [
809809
'предпоказ, показ, pdf, jpg, png, viewer, файл',
810810
route: DemoRoute.Preview,
811811
},
812+
{
813+
section: 'Components',
814+
title: 'Status',
815+
keywords: 'dot, точка, бейдж, badge, success, failure, error',
816+
route: DemoRoute.Status,
817+
},
812818
{
813819
section: 'Components',
814820
title: 'Table',

projects/demo/src/modules/components/badge/examples/1/index.html

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
<tui-badge>Default</tui-badge>
22
<tui-badge appearance="primary">Primary</tui-badge>
33
<tui-badge appearance="accent">Accent</tui-badge>
4-
<tui-badge appearance="success">Success</tui-badge>
5-
<tui-badge appearance="error">Error</tui-badge>
4+
<tui-badge
5+
appearance="success"
6+
tuiStatus
7+
>
8+
Success
9+
</tui-badge>
10+
<tui-badge
11+
appearance="error"
12+
tuiStatus
13+
>
14+
Error
15+
</tui-badge>
616
<tui-badge appearance="warning">Warning</tui-badge>
717
<tui-badge appearance="neutral">Neutral</tui-badge>
818
<tui-badge appearance="info">Info</tui-badge>

projects/demo/src/modules/components/badge/examples/1/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import {Component} from '@angular/core';
22
import {changeDetection} from '@demo/emulate/change-detection';
33
import {encapsulation} from '@demo/emulate/encapsulation';
44
import {TuiRepeatTimes} from '@taiga-ui/cdk';
5-
import {TuiBadge} from '@taiga-ui/kit';
5+
import {TuiBadge, TuiStatus} from '@taiga-ui/kit';
66

77
@Component({
88
standalone: true,
99
selector: 'tui-badge-example-1',
10-
imports: [TuiBadge, TuiRepeatTimes],
10+
imports: [TuiBadge, TuiRepeatTimes, TuiStatus],
1111
templateUrl: './index.html',
1212
styleUrls: ['./index.less'],
1313
encapsulation,

projects/demo/src/modules/components/badge/index.html

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
*ngIf="contentType === 'with icon'"
6363
iconStart="@tui.check"
6464
[appearance]="appearance"
65-
[dot]="dot"
6665
[size]="size"
6766
>
6867
<div tuiFade>Taiga UI</div>
@@ -71,7 +70,6 @@
7170
<tui-badge
7271
*ngIf="contentType === 'text'"
7372
[appearance]="appearance"
74-
[dot]="dot"
7573
[size]="size"
7674
>
7775
Taiga UI
@@ -83,7 +81,6 @@
8381
src="assets/images/avatar.jpg"
8482
tuiBadge
8583
[appearance]="appearance"
86-
[dot]="dot"
8784
[size]="size"
8885
/>
8986
</p>
@@ -100,14 +97,6 @@
10097
/>
10198
</div>
10299
<tui-doc-documentation>
103-
<ng-template
104-
documentationPropertyMode="input"
105-
documentationPropertyName="dot"
106-
documentationPropertyType="boolean"
107-
[(documentationPropertyValue)]="dot"
108-
>
109-
Show dot on the left side
110-
</ng-template>
111100
<ng-template
112101
documentationPropertyMode="input"
113102
documentationPropertyName="size"

projects/demo/src/modules/components/badge/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,4 @@ export default class Page {
6565

6666
protected contentTypeVariants = ['text', 'with icon', 'image'];
6767
protected contentType = this.contentTypeVariants[0];
68-
69-
protected dot = false;
7068
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<span tuiStatus="var(--tui-status-positive)">Success</span>
2+
<p>Status is automatically colored within some badge appearances</p>
3+
<tui-badge
4+
appearance="success"
5+
tuiStatus
6+
>
7+
Success
8+
</tui-badge>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import {Component} from '@angular/core';
2+
import {changeDetection} from '@demo/emulate/change-detection';
3+
import {encapsulation} from '@demo/emulate/encapsulation';
4+
import {TuiBadge, TuiStatus} from '@taiga-ui/kit';
5+
6+
@Component({
7+
standalone: true,
8+
imports: [TuiStatus, TuiBadge],
9+
templateUrl: './index.html',
10+
encapsulation,
11+
changeDetection,
12+
})
13+
export default class Example {}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
```ts
2+
import {Component} from '@angular/core';
3+
import {TuiStatus} from '@taiga-ui/kit';
4+
// ...
5+
6+
@Component({
7+
standalone: true,
8+
imports: [
9+
// ...
10+
TuiStatus,
11+
],
12+
})
13+
export class Example {}
14+
```

0 commit comments

Comments
 (0)