-
Notifications
You must be signed in to change notification settings - Fork 473
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(layout):
Title
add new component (#5743)
- Loading branch information
Showing
32 changed files
with
399 additions
and
9 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
17 changes: 17 additions & 0 deletions
17
projects/demo/src/modules/directives/title/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,17 @@ | ||
<h2 tuiTitle>I am a title</h2> | ||
|
||
<h2 tuiTitle> | ||
I am a title | ||
<div tuiSubtitle>I'm a subtitle</div> | ||
</h2> | ||
|
||
<h2 tuiTitle> | ||
<div tuiSubtitle>Caption</div> | ||
I am a title | ||
</h2> | ||
|
||
<h2 tuiTitle> | ||
<div tuiSubtitle>Caption</div> | ||
I am a title | ||
<div tuiSubtitle>I'm a subtitle</div> | ||
</h2> |
5 changes: 5 additions & 0 deletions
5
projects/demo/src/modules/directives/title/examples/1/index.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
:host { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 2rem; | ||
} |
12 changes: 12 additions & 0 deletions
12
projects/demo/src/modules/directives/title/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,12 @@ | ||
import {Component} from '@angular/core'; | ||
import {changeDetection} from '@demo/emulate/change-detection'; | ||
import {encapsulation} from '@demo/emulate/encapsulation'; | ||
|
||
@Component({ | ||
selector: 'tui-title-example-1', | ||
templateUrl: './index.html', | ||
styleUrls: ['./index.less'], | ||
changeDetection, | ||
encapsulation, | ||
}) | ||
export class TuiTitleExample1 {} |
15 changes: 15 additions & 0 deletions
15
projects/demo/src/modules/directives/title/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,15 @@ | ||
<h2 tuiTitle="s"> | ||
<div tuiSubtitle>Caption</div> | ||
I am a title | ||
<div tuiSubtitle>I'm a subtitle</div> | ||
</h2> | ||
|
||
<h2 tuiTitle="m"> | ||
<div tuiSubtitle>Caption</div> | ||
I am a title | ||
</h2> | ||
|
||
<h2 tuiTitle="l"> | ||
I am a title | ||
<div tuiSubtitle>I'm a subtitle</div> | ||
</h2> |
5 changes: 5 additions & 0 deletions
5
projects/demo/src/modules/directives/title/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,5 @@ | ||
:host { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 2rem; | ||
} |
12 changes: 12 additions & 0 deletions
12
projects/demo/src/modules/directives/title/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,12 @@ | ||
import {Component} from '@angular/core'; | ||
import {changeDetection} from '@demo/emulate/change-detection'; | ||
import {encapsulation} from '@demo/emulate/encapsulation'; | ||
|
||
@Component({ | ||
selector: 'tui-title-example-2', | ||
templateUrl: './index.html', | ||
styleUrls: ['./index.less'], | ||
changeDetection, | ||
encapsulation, | ||
}) | ||
export class TuiTitleExample2 {} |
36 changes: 36 additions & 0 deletions
36
projects/demo/src/modules/directives/title/examples/3/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,36 @@ | ||
<h2 tuiTitle> | ||
<b>I am a title</b> | ||
<div | ||
tuiSubtitle | ||
[style.color]="'var(--tui-text-02)'" | ||
> | ||
I'm a subtitle | ||
</div> | ||
</h2> | ||
|
||
<a | ||
href="https://github.com/taiga-family/taiga-ui" | ||
tuiLink | ||
tuiTitle | ||
[style.font-size.rem]="1" | ||
[style.line-height.rem]="1.25" | ||
> | ||
Taiga UI — GitHub | ||
<div | ||
tuiSubtitle | ||
[style.font]="'var(--tui-font-text-s)'" | ||
> | ||
Drop us a star! | ||
</div> | ||
</a> | ||
|
||
<label class="flex"> | ||
<tui-avatar | ||
size="s" | ||
src="/assets/images/avatar.jpg" | ||
></tui-avatar> | ||
<div tuiTitle="s"> | ||
<strong>Alex Inkin</strong> | ||
<div tuiSubtitle>Available</div> | ||
</div> | ||
</label> |
14 changes: 14 additions & 0 deletions
14
projects/demo/src/modules/directives/title/examples/3/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,14 @@ | ||
:host { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 2rem; | ||
} | ||
|
||
.flex { | ||
display: flex; | ||
gap: 0.5rem; | ||
|
||
[tuiSubtitle] { | ||
color: var(--tui-positive); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
projects/demo/src/modules/directives/title/examples/3/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,12 @@ | ||
import {Component} from '@angular/core'; | ||
import {changeDetection} from '@demo/emulate/change-detection'; | ||
import {encapsulation} from '@demo/emulate/encapsulation'; | ||
|
||
@Component({ | ||
selector: 'tui-title-example-3', | ||
templateUrl: './index.html', | ||
styleUrls: ['./index.less'], | ||
changeDetection, | ||
encapsulation, | ||
}) | ||
export class TuiTitleExample3 {} |
14 changes: 14 additions & 0 deletions
14
projects/demo/src/modules/directives/title/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 {TuiTitleModule} from '@taiga-ui/layout'; | ||
|
||
// ... | ||
|
||
@NgModule({ | ||
imports: [ | ||
// ... | ||
TuiTitleModule, | ||
], | ||
// ... | ||
}) | ||
export class MyModule {} | ||
``` |
16 changes: 16 additions & 0 deletions
16
projects/demo/src/modules/directives/title/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,16 @@ | ||
```html | ||
<tui-block-status [card]="card"> | ||
<img | ||
tuiSlot="top" | ||
src="src" | ||
/> | ||
<h4>Title</h4> | ||
Description | ||
<button | ||
tuiButton | ||
tuiItem | ||
> | ||
Button | ||
</button> | ||
</tui-block-status> | ||
``` |
29 changes: 29 additions & 0 deletions
29
projects/demo/src/modules/directives/title/title.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,29 @@ | ||
import {Component} from '@angular/core'; | ||
import {changeDetection} from '@demo/emulate/change-detection'; | ||
import {TuiDocExample} from '@taiga-ui/addon-doc'; | ||
|
||
@Component({ | ||
selector: 'example-title', | ||
templateUrl: './title.template.html', | ||
changeDetection, | ||
}) | ||
export class ExampleTuiTitleComponent { | ||
readonly exampleModule = import('./examples/import/import-module.md?raw'); | ||
readonly exampleHtml = import('./examples/import/insert-template.md?raw'); | ||
|
||
readonly example1: TuiDocExample = { | ||
TypeScript: import('./examples/1/index.ts?raw'), | ||
HTML: import('./examples/1/index.html?raw'), | ||
}; | ||
|
||
readonly example2: TuiDocExample = { | ||
TypeScript: import('./examples/2/index.ts?raw'), | ||
HTML: import('./examples/3/index.html?raw'), | ||
}; | ||
|
||
readonly example3: TuiDocExample = { | ||
TypeScript: import('./examples/3/index.ts?raw'), | ||
HTML: import('./examples/3/index.html?raw'), | ||
LESS: import('./examples/3/index.less?raw'), | ||
}; | ||
} |
31 changes: 31 additions & 0 deletions
31
projects/demo/src/modules/directives/title/title.module.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 {CommonModule} from '@angular/common'; | ||
import {NgModule} from '@angular/core'; | ||
import {tuiGetDocModules} from '@taiga-ui/addon-doc'; | ||
import {TuiLinkModule, TuiWrapperModule} from '@taiga-ui/core'; | ||
import {TuiAvatarModule, TuiCheckboxModule} from '@taiga-ui/experimental'; | ||
import {TuiTitleModule} from '@taiga-ui/layout'; | ||
|
||
import {TuiTitleExample1} from './examples/1'; | ||
import {TuiTitleExample2} from './examples/2'; | ||
import {TuiTitleExample3} from './examples/3'; | ||
import {ExampleTuiTitleComponent} from './title.component'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule, | ||
TuiTitleModule, | ||
tuiGetDocModules(ExampleTuiTitleComponent), | ||
TuiLinkModule, | ||
TuiCheckboxModule, | ||
TuiWrapperModule, | ||
TuiAvatarModule, | ||
], | ||
declarations: [ | ||
ExampleTuiTitleComponent, | ||
TuiTitleExample1, | ||
TuiTitleExample2, | ||
TuiTitleExample3, | ||
], | ||
exports: [ExampleTuiTitleComponent], | ||
}) | ||
export class ExampleTuiTitleModule {} |
55 changes: 55 additions & 0 deletions
55
projects/demo/src/modules/directives/title/title.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,55 @@ | ||
<tui-doc-page | ||
header="Title" | ||
package="LAYOUT" | ||
type="components" | ||
> | ||
<ng-template pageTab> | ||
<p>A directive for title with optional subtitle</p> | ||
|
||
<tui-doc-example | ||
id="base" | ||
heading="Basic" | ||
[content]="example1" | ||
> | ||
<tui-title-example-1></tui-title-example-1> | ||
</tui-doc-example> | ||
|
||
<tui-doc-example | ||
id="sizes" | ||
heading="Sizes" | ||
[content]="example2" | ||
> | ||
<tui-title-example-2></tui-title-example-2> | ||
</tui-doc-example> | ||
|
||
<tui-doc-example | ||
id="custom" | ||
heading="Custom" | ||
[content]="example3" | ||
> | ||
<tui-title-example-3></tui-title-example-3> | ||
</tui-doc-example> | ||
</ng-template> | ||
|
||
<ng-template pageTab="Setup"> | ||
<ol class="b-demo-steps"> | ||
<li> | ||
<p>Import module:</p> | ||
|
||
<tui-doc-code | ||
filename="myComponent.module.ts" | ||
[code]="exampleModule" | ||
></tui-doc-code> | ||
</li> | ||
|
||
<li> | ||
<p>Add to the template:</p> | ||
|
||
<tui-doc-code | ||
filename="myComponent.template.html" | ||
[code]="exampleHtml" | ||
></tui-doc-code> | ||
</li> | ||
</ol> | ||
</ng-template> | ||
</tui-doc-page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from '@taiga-ui/layout/components/block-status'; | ||
export * from '@taiga-ui/layout/components/title'; |
Oops, something went wrong.