Skip to content

Commit

Permalink
feat(experimental): add tuiButtonGroupCard
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode committed Feb 5, 2024
1 parent 6a25d26 commit bb55522
Show file tree
Hide file tree
Showing 25 changed files with 549 additions and 0 deletions.
9 changes: 9 additions & 0 deletions projects/demo/src/modules/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,15 @@ export const ROUTES: Routes = [
title: 'ButtonClose',
},
},
{
path: 'experimental/button-group-card',
loadChildren: async () =>
(await import('../experimental/button-group-card/button-group-card.module'))
.ExampleTuiButtonGroupCardModule,
data: {
title: 'ButtonGroupCard',
},
},
{
path: 'experimental/cell',
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 @@ -916,6 +916,12 @@ export const pages: TuiDocPages = [
keywords: 'кнопка, button, close, закрыть',
route: '/experimental/button-close',
},
{
section: 'Experimental',
title: 'ButtonGroupCard',
keywords: 'кнопка, button, group, card, группа',
route: '/experimental/button-group-card',
},
],
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import {Component} from '@angular/core';
import {changeDetection} from '@demo/emulate/change-detection';
import {TuiDocExample, TuiRawLoaderContent} from '@taiga-ui/addon-doc';

@Component({
selector: 'example-button-group-card',
templateUrl: './button-group-card.template.html',
changeDetection,
})
export class ExampleTuiButtonGroupCardComponent {
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'),
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import {CommonModule} from '@angular/common';
import {NgModule} from '@angular/core';
import {tuiGetDocModules} from '@taiga-ui/addon-doc';
import {TuiNotificationModule} from '@taiga-ui/core';
import {
TuiBadgedContentModule,
TuiButtonGroupCardModule,
TuiButtonModule,
TuiButtonVerticalModule,
TuiCellModule,
TuiSurfaceModule,
} from '@taiga-ui/experimental';

import {ExampleTuiButtonGroupCardComponent} from './button-group-card.component';
import {TuiButtonGroupCardExample1} from './examples/1';
import {TuiButtonGroupCardExample2} from './examples/2';
import {TuiButtonGroupCardExample3} from './examples/3';

@NgModule({
imports: [
CommonModule,
TuiNotificationModule,
TuiButtonModule,
tuiGetDocModules(ExampleTuiButtonGroupCardComponent),
TuiButtonVerticalModule,
TuiSurfaceModule,
TuiCellModule,
TuiButtonGroupCardModule,
TuiBadgedContentModule,
],
declarations: [
ExampleTuiButtonGroupCardComponent,
TuiButtonGroupCardExample1,
TuiButtonGroupCardExample2,
TuiButtonGroupCardExample3,
],
exports: [ExampleTuiButtonGroupCardComponent],
})
export class ExampleTuiButtonGroupCardModule {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<tui-doc-page
header="ButtonGroupCard"
package="EXPERIMENTAL"
type="directives"
>
<ng-template pageTab>
<tui-notification status="warning">
This code is
<strong>experimental</strong>
and is a subject to change. Expect final solution to be shipped in the next major version
</tui-notification>

<tui-doc-example
id="elevated"
heading="Elevated"
[content]="example1"
>
<tui-button-group-card-example-1></tui-button-group-card-example-1>
</tui-doc-example>

<tui-doc-example
id="flat"
heading="Flat"
[content]="example2"
>
<tui-button-group-card-example-2></tui-button-group-card-example-2>
</tui-doc-example>

<tui-doc-example
id="dark"
heading="Dark"
[content]="example3"
>
<tui-button-group-card-example-3></tui-button-group-card-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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<div
tuiButtonGroupCard
tuiSurface="elevated"
>
<button
appearance="flat"
iconLeft="tuiIconPlusCircleLarge"
tuiButton
tuiButtonVertical
>
Create a payment
</button>

<button
appearance="flat"
iconLeft="tuiIconPlusCircleLarge"
tuiButton
tuiButtonVertical
>
Pay
<br />
the bill
</button>

<button
appearance="flat"
iconLeft="tuiIconStarLarge"
tuiButton
tuiButtonVertical
>
Remove from favorites
</button>
</div>

<div
tuiButtonGroupCard
tuiSurface="elevated"
>
<button
appearance="flat"
iconLeft="tuiIconPlusCircleLarge"
tuiButton
tuiButtonVertical
>
Top up
</button>

<button
appearance="flat"
iconLeft="tuiIconArrowRightCircleLarge"
tuiButton
tuiButtonVertical
>
Take out
</button>
</div>

<div
tuiButtonGroupCard
tuiSurface="elevated"
>
<button
appearance="flat"
iconLeft="tuiIconPlusCircleLarge"
tuiButton
tuiButtonVertical
>
To repay
</button>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
:host {
display: flex;
flex-direction: column;
gap: 1rem;
}
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-button-group-card-example-1',
templateUrl: './index.html',
styleUrls: ['./index.less'],
encapsulation,
changeDetection,
})
export class TuiButtonGroupCardExample1 {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<div
tuiButtonGroupCard
tuiSurface="flat"
>
<button
appearance="flat"
iconLeft="tuiIconPlusCircleLarge"
tuiButton
tuiButtonVertical
>
Create a payment
</button>

<button
appearance="flat"
iconLeft="tuiIconPlusCircleLarge"
tuiButton
tuiButtonVertical
>
Pay
<br />
the bill
</button>

<button
appearance="flat"
iconLeft="tuiIconStarLarge"
tuiButton
tuiButtonVertical
>
Remove from favorites
</button>
</div>

<div
tuiButtonGroupCard
tuiSurface="flat"
>
<button
appearance="flat"
iconLeft="tuiIconPlusCircleLarge"
tuiButton
tuiButtonVertical
>
Top up
</button>

<button
appearance="flat"
iconLeft="tuiIconArrowRightCircleLarge"
tuiButton
tuiButtonVertical
>
Take out
</button>
</div>

<div
tuiButtonGroupCard
tuiSurface="flat"
>
<button
appearance="flat"
iconLeft="tuiIconPlusCircleLarge"
tuiButton
tuiButtonVertical
>
To repay
</button>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
:host {
display: flex;
flex-direction: column;
gap: 1rem;
}
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-button-group-card-example-2',
templateUrl: './index.html',
styleUrls: ['./index.less'],
encapsulation,
changeDetection,
})
export class TuiButtonGroupCardExample2 {}
Loading

0 comments on commit bb55522

Please sign in to comment.