-
Notifications
You must be signed in to change notification settings - Fork 474
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(experimental): add
tuiButtonGroupCard
- Loading branch information
Showing
25 changed files
with
549 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
30 changes: 30 additions & 0 deletions
30
projects/demo/src/modules/experimental/button-group-card/button-group-card.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,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'), | ||
}; | ||
} |
39 changes: 39 additions & 0 deletions
39
projects/demo/src/modules/experimental/button-group-card/button-group-card.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,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 {} |
59 changes: 59 additions & 0 deletions
59
projects/demo/src/modules/experimental/button-group-card/button-group-card.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,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> |
70 changes: 70 additions & 0 deletions
70
projects/demo/src/modules/experimental/button-group-card/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,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> |
5 changes: 5 additions & 0 deletions
5
projects/demo/src/modules/experimental/button-group-card/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: 1rem; | ||
} |
12 changes: 12 additions & 0 deletions
12
projects/demo/src/modules/experimental/button-group-card/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-button-group-card-example-1', | ||
templateUrl: './index.html', | ||
styleUrls: ['./index.less'], | ||
encapsulation, | ||
changeDetection, | ||
}) | ||
export class TuiButtonGroupCardExample1 {} |
70 changes: 70 additions & 0 deletions
70
projects/demo/src/modules/experimental/button-group-card/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,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> |
5 changes: 5 additions & 0 deletions
5
projects/demo/src/modules/experimental/button-group-card/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: 1rem; | ||
} |
12 changes: 12 additions & 0 deletions
12
projects/demo/src/modules/experimental/button-group-card/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-button-group-card-example-2', | ||
templateUrl: './index.html', | ||
styleUrls: ['./index.less'], | ||
encapsulation, | ||
changeDetection, | ||
}) | ||
export class TuiButtonGroupCardExample2 {} |
Oops, something went wrong.