-
Notifications
You must be signed in to change notification settings - Fork 472
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: taiga-family-bot <[email protected]>
- Loading branch information
1 parent
de7eda6
commit f46ea6f
Showing
35 changed files
with
548 additions
and
0 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
31 changes: 31 additions & 0 deletions
31
projects/demo/src/modules/components/block-details/block-details.component.ts
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,31 @@ | ||
import {Component} from '@angular/core'; | ||
import {changeDetection} from '@demo/emulate/change-detection'; | ||
import {TuiExamplePipe, TuiSetupComponent} from '@demo/utils'; | ||
import type {TuiRawLoaderContent} from '@taiga-ui/addon-doc'; | ||
import {TuiAddonDocModule} from '@taiga-ui/addon-doc'; | ||
|
||
import {TuiBlockDetailsExample1} from './examples/1'; | ||
import {TuiBlockDetailsExample2} from './examples/2'; | ||
|
||
@Component({ | ||
standalone: true, | ||
selector: 'example-block-details', | ||
imports: [ | ||
TuiExamplePipe, | ||
TuiBlockDetailsExample1, | ||
TuiBlockDetailsExample2, | ||
TuiAddonDocModule, | ||
TuiSetupComponent, | ||
], | ||
templateUrl: './block-details.template.html', | ||
changeDetection, | ||
}) | ||
export default class ExampleTuiBlockDetailsComponent { | ||
protected readonly import: TuiRawLoaderContent = import( | ||
'./examples/import/import-module.md?raw' | ||
); | ||
|
||
protected readonly template: TuiRawLoaderContent = import( | ||
'./examples/import/insert-template.md?raw' | ||
); | ||
} |
32 changes: 32 additions & 0 deletions
32
projects/demo/src/modules/components/block-details/block-details.template.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,32 @@ | ||
<tui-doc-page | ||
header="BlockDetails" | ||
package="LAYOUT" | ||
type="components" | ||
> | ||
<ng-template pageTab> | ||
<p>Layout directive for describing details. For example, transaction details</p> | ||
|
||
<tui-doc-example | ||
id="full" | ||
heading="Full" | ||
[content]="1 | tuiExample: 'html,ts'" | ||
> | ||
<tui-block-details-example-1></tui-block-details-example-1> | ||
</tui-doc-example> | ||
|
||
<tui-doc-example | ||
id="customization" | ||
heading="Customization" | ||
[content]="2 | tuiExample" | ||
> | ||
<tui-block-details-example-2></tui-block-details-example-2> | ||
</tui-doc-example> | ||
</ng-template> | ||
|
||
<ng-template pageTab="Setup"> | ||
<tui-setup | ||
[import]="import" | ||
[template]="template" | ||
/> | ||
</ng-template> | ||
</tui-doc-page> |
18 changes: 18 additions & 0 deletions
18
projects/demo/src/modules/components/block-details/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,18 @@ | ||
<div tuiBlockDetails> | ||
<tui-avatar | ||
src="JW" | ||
[size]="isMobile ? 'xl' : 'xxl'" | ||
></tui-avatar> | ||
<h2 tuiTitle> | ||
John W | ||
<div tuiSubtitle>money transfers</div> | ||
</h2> | ||
|
||
<span>{{ -1050 | tuiAmount: 'USD' | async }}</span> | ||
<span tuiSubtitle>today</span> | ||
<span tuiComment>Birthday gift</span> | ||
<div tuiAccessories> | ||
<tui-badge appearance="neutral">private</tui-badge> | ||
<tui-badge appearance="default">fast</tui-badge> | ||
</div> | ||
</div> |
27 changes: 27 additions & 0 deletions
27
projects/demo/src/modules/components/block-details/examples/1/index.ts
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,27 @@ | ||
import {AsyncPipe} from '@angular/common'; | ||
import {Component, inject} from '@angular/core'; | ||
import {changeDetection} from '@demo/emulate/change-detection'; | ||
import {encapsulation} from '@demo/emulate/encapsulation'; | ||
import {TuiAmountPipe} from '@taiga-ui/addon-commerce'; | ||
import {TUI_IS_MOBILE} from '@taiga-ui/cdk'; | ||
import {TuiAvatarComponent, TuiBadgeDirective, TuiCommentDirective} from '@taiga-ui/kit'; | ||
import {TuiBlockDetailsDirective} from '@taiga-ui/layout'; | ||
|
||
@Component({ | ||
standalone: true, | ||
selector: 'tui-block-details-example-1', | ||
imports: [ | ||
AsyncPipe, | ||
TuiAvatarComponent, | ||
TuiCommentDirective, | ||
TuiAmountPipe, | ||
TuiBlockDetailsDirective, | ||
TuiBadgeDirective, | ||
], | ||
templateUrl: './index.html', | ||
encapsulation, | ||
changeDetection, | ||
}) | ||
export class TuiBlockDetailsExample1 { | ||
protected readonly isMobile = inject(TUI_IS_MOBILE); | ||
} |
33 changes: 33 additions & 0 deletions
33
projects/demo/src/modules/components/block-details/examples/2/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,33 @@ | ||
<div tuiBlockDetails> | ||
<tui-avatar | ||
src="tuiIconGiftLarge" | ||
[size]="isMobile ? 'xl' : 'xxl'" | ||
></tui-avatar> | ||
<h2 tuiTitle> | ||
Auchan | ||
<div tuiSubtitle>grocery • MMC 5350</div> | ||
</h2> | ||
|
||
<span [style.color]="'var(--tui-positive)'">{{ 0.5 | tuiAmount: 'USD' | async }}</span> | ||
<span | ||
tuiFade | ||
tuiSubtitle | ||
> | ||
promotion (long value with fade) | ||
</span> | ||
|
||
<tui-badge appearance="neutral">cashback</tui-badge> | ||
</div> | ||
|
||
<div tuiBlockDetails> | ||
<tui-avatar | ||
src="tuiIconStarLarge" | ||
[size]="isMobile ? 'xl' : 'xxl'" | ||
></tui-avatar> | ||
<h2 tuiTitle> | ||
Uber | ||
<div tuiSubtitle>taxi • MMC 5550</div> | ||
</h2> | ||
|
||
<span [style.color]="'var(--tui-negative)'">{{ -10.5 | tuiAmount: 'USD' | async }}</span> | ||
</div> |
10 changes: 10 additions & 0 deletions
10
projects/demo/src/modules/components/block-details/examples/2/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,10 @@ | ||
:host { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 5rem; | ||
} | ||
|
||
[tuiSubtitle] { | ||
white-space: nowrap; | ||
max-width: 11rem; | ||
} |
28 changes: 28 additions & 0 deletions
28
projects/demo/src/modules/components/block-details/examples/2/index.ts
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,28 @@ | ||
import {AsyncPipe} from '@angular/common'; | ||
import {Component, inject} from '@angular/core'; | ||
import {changeDetection} from '@demo/emulate/change-detection'; | ||
import {encapsulation} from '@demo/emulate/encapsulation'; | ||
import {tuiAmountOptionsProvider, TuiAmountPipe} from '@taiga-ui/addon-commerce'; | ||
import {TUI_IS_MOBILE} from '@taiga-ui/cdk'; | ||
import {TuiAvatarComponent, TuiBadgeDirective} from '@taiga-ui/kit'; | ||
import {TuiBlockDetailsDirective} from '@taiga-ui/layout'; | ||
|
||
@Component({ | ||
standalone: true, | ||
selector: 'tui-block-details-example-2', | ||
imports: [ | ||
AsyncPipe, | ||
TuiAvatarComponent, | ||
TuiAmountPipe, | ||
TuiBlockDetailsDirective, | ||
TuiBadgeDirective, | ||
], | ||
templateUrl: './index.html', | ||
styleUrls: ['./index.less'], | ||
encapsulation, | ||
changeDetection, | ||
providers: [tuiAmountOptionsProvider({sign: 'always'})], | ||
}) | ||
export class TuiBlockDetailsExample2 { | ||
protected readonly isMobile = inject(TUI_IS_MOBILE); | ||
} |
14 changes: 14 additions & 0 deletions
14
...ects/demo/src/modules/components/block-details/examples/import/import-module.md
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,14 @@ | ||
```ts | ||
import {NgModule} from '@angular/core'; | ||
import {TuiBlockDetailsDirective} from '@taiga-ui/layout'; | ||
// ... | ||
|
||
@Component({ | ||
standalone: true, | ||
imports: [ | ||
// ... | ||
TuiBlockDetailsDirective, | ||
], | ||
}) | ||
export class MyComponent {} | ||
``` |
14 changes: 14 additions & 0 deletions
14
...ts/demo/src/modules/components/block-details/examples/import/insert-template.md
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,14 @@ | ||
```html | ||
<div tuiBlockDetails> | ||
<tui-avatar></tui-avatar> | ||
<h2 tuiTitle> | ||
Title | ||
<div tuiSubtitle>Subtitle</div> | ||
</h2> | ||
|
||
<span>{{ amount }} | tuiAmount: 'USD' | async }}</span> | ||
<span tuiAmountDescription>description</span> | ||
<span tuiComment>comment</span> | ||
<tui-badge appearance="neutral">Badge</tui-badge> | ||
</div> | ||
``` |
31 changes: 31 additions & 0 deletions
31
projects/demo/src/modules/directives/comment/comment.component.ts
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,31 @@ | ||
import {Component} from '@angular/core'; | ||
import {changeDetection} from '@demo/emulate/change-detection'; | ||
import {TuiExamplePipe, TuiSetupComponent} from '@demo/utils'; | ||
import type {TuiRawLoaderContent} from '@taiga-ui/addon-doc'; | ||
import {TuiAddonDocModule} from '@taiga-ui/addon-doc'; | ||
|
||
import {TuiCommentExample1} from './examples/1'; | ||
import {TuiCommentExample2} from './examples/2'; | ||
|
||
@Component({ | ||
standalone: true, | ||
selector: 'example-comment', | ||
imports: [ | ||
TuiCommentExample1, | ||
TuiCommentExample2, | ||
TuiExamplePipe, | ||
TuiAddonDocModule, | ||
TuiSetupComponent, | ||
], | ||
templateUrl: './comment.template.html', | ||
changeDetection, | ||
}) | ||
export default class ExampleTuiCommentComponent { | ||
protected readonly import: TuiRawLoaderContent = import( | ||
'./examples/import/import-module.md?raw' | ||
); | ||
|
||
protected readonly template: TuiRawLoaderContent = import( | ||
'./examples/import/insert-template.md?raw' | ||
); | ||
} |
30 changes: 30 additions & 0 deletions
30
projects/demo/src/modules/directives/comment/comment.template.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,30 @@ | ||
<tui-doc-page | ||
header="Comment" | ||
package="KIT" | ||
type="directives" | ||
> | ||
<ng-template pageTab> | ||
<tui-doc-example | ||
id="basic" | ||
heading="Basic" | ||
[content]="1 | tuiExample: 'html,ts'" | ||
> | ||
<tui-comment-example-1></tui-comment-example-1> | ||
</tui-doc-example> | ||
|
||
<tui-doc-example | ||
id="customization" | ||
heading="Customization" | ||
[content]="2 | tuiExample" | ||
> | ||
<tui-comment-example-2></tui-comment-example-2> | ||
</tui-doc-example> | ||
</ng-template> | ||
|
||
<ng-template pageTab="Setup"> | ||
<tui-setup | ||
[import]="import" | ||
[template]="template" | ||
/> | ||
</ng-template> | ||
</tui-doc-page> |
1 change: 1 addition & 0 deletions
1
projects/demo/src/modules/directives/comment/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 @@ | ||
<span tuiComment>Birthday gift</span> |
14 changes: 14 additions & 0 deletions
14
projects/demo/src/modules/directives/comment/examples/1/index.ts
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,14 @@ | ||
import {Component} from '@angular/core'; | ||
import {changeDetection} from '@demo/emulate/change-detection'; | ||
import {encapsulation} from '@demo/emulate/encapsulation'; | ||
import {TuiCommentDirective} from '@taiga-ui/kit'; | ||
|
||
@Component({ | ||
standalone: true, | ||
selector: 'tui-comment-example-1', | ||
imports: [TuiCommentDirective], | ||
templateUrl: './index.html', | ||
encapsulation, | ||
changeDetection, | ||
}) | ||
export class TuiCommentExample1 {} |
17 changes: 17 additions & 0 deletions
17
projects/demo/src/modules/directives/comment/examples/2/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,17 @@ | ||
<div tuiComment="top">Good job</div> | ||
|
||
<div | ||
tuiComment="bottom" | ||
class="success" | ||
> | ||
Cashback | ||
</div> | ||
|
||
<div | ||
tuiComment="left" | ||
class="primary" | ||
> | ||
Extra payment | ||
</div> | ||
|
||
<div tuiComment="right">Check it out</div> |
13 changes: 13 additions & 0 deletions
13
projects/demo/src/modules/directives/comment/examples/2/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,13 @@ | ||
:host { | ||
display: flex; | ||
gap: 1.25rem; | ||
flex-wrap: wrap; | ||
} | ||
|
||
.success { | ||
background: var(--tui-success-fill); | ||
} | ||
|
||
.primary { | ||
background: var(--tui-primary); | ||
} |
15 changes: 15 additions & 0 deletions
15
projects/demo/src/modules/directives/comment/examples/2/index.ts
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,15 @@ | ||
import {Component} from '@angular/core'; | ||
import {changeDetection} from '@demo/emulate/change-detection'; | ||
import {encapsulation} from '@demo/emulate/encapsulation'; | ||
import {TuiCommentDirective} from '@taiga-ui/kit'; | ||
|
||
@Component({ | ||
standalone: true, | ||
selector: 'tui-comment-example-2', | ||
imports: [TuiCommentDirective], | ||
templateUrl: './index.html', | ||
styleUrls: ['./index.less'], | ||
encapsulation, | ||
changeDetection, | ||
}) | ||
export class TuiCommentExample2 {} |
Oops, something went wrong.