Skip to content

Commit

Permalink
feat(experimental): Header add new component
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirpotekhin committed Jan 16, 2024
1 parent 4b0fd0c commit 5f2470b
Show file tree
Hide file tree
Showing 26 changed files with 634 additions and 15 deletions.
8 changes: 8 additions & 0 deletions projects/demo/src/modules/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,14 @@ export const ROUTES: Routes = [
title: 'Fade',
},
},
{
path: 'experimental/header',
loadChildren: async () =>
(await import('../experimental/header/header.module')).ExampleTuiHeaderModule,
data: {
title: 'Header',
},
},
{
path: 'experimental/icon',
loadChildren: async () =>
Expand Down
6 changes: 6 additions & 0 deletions projects/demo/src/modules/app/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,12 @@ export const pages: TuiDocPages = [
keywords: 'overflow, ellipsis, gradient, clamp, line',
route: '/experimental/fade',
},
{
section: 'Experimental',
title: 'Header',
keywords: 'header, заголовок, item',
route: '/experimental/header',
},
{
section: 'Experimental',
title: 'Icon',
Expand Down
108 changes: 108 additions & 0 deletions projects/demo/src/modules/experimental/header/examples/1/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<div tuiHeader="xxl">
<h1 tuiTitle>
Title
<div tuiSubtitle>Subtitle</div>
</h1>

<div tuiAccessories>
<tui-badge-notification size="m">1</tui-badge-notification>
<button
size="l"
tuiButton
>
Button
</button>
</div>
</div>

<div tuiHeader="xl">
<h2 tuiTitle>
Title
<div tuiSubtitle>Subtitle</div>
</h2>

<div tuiAccessories>
<tui-badge-notification size="m">1</tui-badge-notification>
<button
size="m"
tuiButton
>
Button
</button>
</div>
</div>

<div tuiHeader="l">
<h3 tuiTitle>
Title
<div tuiSubtitle>Subtitle</div>
</h3>

<div tuiAccessories>
<tui-badge-notification size="m">1</tui-badge-notification>
<button
size="m"
tuiButton
>
Button
</button>
</div>
</div>

<div tuiHeader="m">
<h4 tuiTitle>
Title
<div tuiSubtitle>Subtitle</div>
</h4>

<div tuiAccessories>
<tui-badge-notification size="m">1</tui-badge-notification>
<button tuiButton>Button</button>
</div>
</div>

<div tuiHeader="s">
<h5 tuiTitle>
Title
<div tuiSubtitle>Subtitle</div>
</h5>

<div tuiAccessories>
<tui-badge-notification size="m">1</tui-badge-notification>
<button tuiButton>Button</button>
</div>
</div>

<div tuiHeader="xs">
<h6 tuiTitle>
Title
<div tuiSubtitle>Subtitle</div>
</h6>

<div tuiAccessories>
<tui-badge-notification size="s">1</tui-badge-notification>
<button
size="xs"
tuiButton
>
Button
</button>
</div>
</div>

<div tuiHeader="xxs">
<span tuiTitle>
Title
<div tuiSubtitle>Subtitle</div>
</span>

<div tuiAccessories>
<tui-badge-notification size="s">1</tui-badge-notification>
<button
size="xs"
tuiButton
>
Button
</button>
</div>
</div>
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 projects/demo/src/modules/experimental/header/examples/1/index.ts
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-header-example-1',
templateUrl: './index.html',
styleUrls: ['./index.less'],
encapsulation,
changeDetection,
})
export class TuiHeaderExample1 {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<div>
<div tuiHeader>
<h5 tuiTitle>
<div tuiCaption>Opensource</div>
Taiga UI
<div tuiSubtitle>Component library</div>
</h5>

<div tuiAccessories>
<tui-badge-notification size="m">1</tui-badge-notification>
<tui-tooltip content="Angular kit"></tui-tooltip>
<tui-avatar
appearance="accent"
src="tuiIconStar"
></tui-avatar>
</div>
</div>
<p class="description">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusantium ad aliquam asperiores atque autem
consequatur cumque cupiditate delectus doloremque doloribus ea earum eius eos error esse est eum eveniet
</p>
</div>

<div>
<div tuiHeader>
<div tuiTitle>
Maskito
<div tuiSubtitle>
Awesome
<span [tuiSensitive]="true">one</span>
</div>
</div>

<div tuiAccessories>
<tui-badge-notification size="m">1</tui-badge-notification>
<tui-tooltip content="Mask it"></tui-tooltip>
<a
href="https://maskito.dev/"
rel="noreferrer"
target="_blank"
tuiButton
>
Support
</a>
</div>
</div>
<p class="description">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusantium ad aliquam asperiores atque autem
consequatur cumque cupiditate delectus doloremque doloribus ea earum eius eos error esse est eum eveniet
</p>
</div>

<div tuiHeader>
<div tuiTitle>
Polymorpheus
<div tuiSubtitle>The power of dreams</div>
</div>

<div tuiAccessories>
<tui-badge>Free tier</tui-badge>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
:host {
display: flex;
flex-direction: column;
gap: 3rem;
}

.description {
font: var(--tui-font-text-l);
margin-top: 0.5rem;
max-width: 30rem;
}
12 changes: 12 additions & 0 deletions projects/demo/src/modules/experimental/header/examples/2/index.ts
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-header-example-2',
templateUrl: './index.html',
styleUrls: ['./index.less'],
encapsulation,
changeDetection,
})
export class TuiHeaderExample2 {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<div tuiHeader="m">
<div tuiTitle>
<span class="interactive-title">
Title
<tui-icon icon="tuiIconChevronRight"></tui-icon>
</span>

<div tuiSubtitle>Subtitle</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@import '@taiga-ui/core/styles/taiga-ui-local';

.interactive-title {
.transition(color);

cursor: pointer;

& > tui-icon {
.transition(transform);
}
}

.interactive-title:hover {
color: var(--tui-link);

& > tui-icon {
transform: translate(0.25rem);
}
}
12 changes: 12 additions & 0 deletions projects/demo/src/modules/experimental/header/examples/3/index.ts
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-header-example-3',
templateUrl: './index.html',
styleUrls: ['./index.less'],
encapsulation,
changeDetection,
})
export class TuiHeaderExample3 {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
```ts
import {NgModule} from '@angular/core';
import {TuiHeaderModule} from '@taiga-ui/experimental';
// ...

@NgModule({
imports: [
// ...
TuiHeaderModule,
],
})
export class MyModule {}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
```html
<div tuiHeader>
<div tuiTitle>
Title
<div tuiSubtitle>Subtitle</div>
</div>

<div tuiAccessories>Accessories</div>
</div>
```
38 changes: 38 additions & 0 deletions projects/demo/src/modules/experimental/header/header.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import {Component, ViewEncapsulation} from '@angular/core';
import {changeDetection} from '@demo/emulate/change-detection';
import {
TuiDocExample,
tuiDocExampleOptionsProvider,
TuiRawLoaderContent,
} from '@taiga-ui/addon-doc';

@Component({
selector: 'example-header',
templateUrl: './header.template.html',
styleUrls: ['./header.styles.less'],
encapsulation: ViewEncapsulation.None,
changeDetection,
providers: [tuiDocExampleOptionsProvider({fullsize: true})],
})
export class ExampleTuiCellComponent {
readonly exampleModule: TuiRawLoaderContent = import(
'./examples/import/import-module.md?raw'
);

readonly exampleHtml: TuiRawLoaderContent = import(
'./examples/import/insert-template.md?raw'
);

readonly example1: TuiDocExample = {
HTML: import('./examples/1/index.html?raw'),
};

readonly example2: TuiDocExample = {
HTML: import('./examples/2/index.html?raw'),
};

readonly example3: TuiDocExample = {
HTML: import('./examples/3/index.html?raw'),
LESS: import('./examples/3/index.less?raw'),
};
}
Loading

0 comments on commit 5f2470b

Please sign in to comment.