-
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(experimental): add
tuiButtonGroup
- Loading branch information
Showing
24 changed files
with
533 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/button-group.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.template.html', | ||
changeDetection, | ||
}) | ||
export class ExampleTuiButtonGroupComponent { | ||
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'), | ||
}; | ||
} |
37 changes: 37 additions & 0 deletions
37
projects/demo/src/modules/experimental/button-group/button-group.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,37 @@ | ||
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, | ||
TuiButtonGroupModule, | ||
TuiButtonModule, | ||
TuiButtonVerticalModule, | ||
TuiSurfaceModule, | ||
} from '@taiga-ui/experimental'; | ||
|
||
import {ExampleTuiButtonGroupComponent} from './button-group.component'; | ||
import {TuiButtonGroupExample1} from './examples/1'; | ||
import {TuiButtonGroupExample2} from './examples/2'; | ||
import {TuiButtonGroupExample3} from './examples/3'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule, | ||
TuiNotificationModule, | ||
TuiButtonModule, | ||
tuiGetDocModules(ExampleTuiButtonGroupComponent), | ||
TuiButtonVerticalModule, | ||
TuiSurfaceModule, | ||
TuiButtonGroupModule, | ||
TuiBadgedContentModule, | ||
], | ||
declarations: [ | ||
ExampleTuiButtonGroupComponent, | ||
TuiButtonGroupExample1, | ||
TuiButtonGroupExample2, | ||
TuiButtonGroupExample3, | ||
], | ||
exports: [ExampleTuiButtonGroupComponent], | ||
}) | ||
export class ExampleTuiButtonGroupModule {} |
59 changes: 59 additions & 0 deletions
59
projects/demo/src/modules/experimental/button-group/button-group.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="ButtonGroup" | ||
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-example-1></tui-button-group-example-1> | ||
</tui-doc-example> | ||
|
||
<tui-doc-example | ||
id="flat" | ||
heading="Flat" | ||
[content]="example2" | ||
> | ||
<tui-button-group-example-2></tui-button-group-example-2> | ||
</tui-doc-example> | ||
|
||
<tui-doc-example | ||
id="dark" | ||
heading="Dark" | ||
[content]="example3" | ||
> | ||
<tui-button-group-example-3></tui-button-group-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> |
67 changes: 67 additions & 0 deletions
67
projects/demo/src/modules/experimental/button-group/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,67 @@ | ||
<div | ||
tuiButtonGroup | ||
tuiSurface="elevated" | ||
> | ||
<button | ||
appearance="link" | ||
iconLeft="tuiIconPlusCircleLarge" | ||
tuiButton | ||
tuiButtonVertical | ||
> | ||
Create a payment | ||
</button> | ||
|
||
<button | ||
appearance="link" | ||
iconLeft="tuiIconPlusCircleLarge" | ||
tuiButton | ||
tuiButtonVertical | ||
> | ||
Pay the bill | ||
</button> | ||
|
||
<button | ||
appearance="link" | ||
iconLeft="tuiIconStarLarge" | ||
tuiButton | ||
tuiButtonVertical | ||
> | ||
Remove from favorites | ||
</button> | ||
</div> | ||
|
||
<div | ||
tuiButtonGroup | ||
tuiSurface="elevated" | ||
> | ||
<button | ||
appearance="link" | ||
iconLeft="tuiIconPlusCircleLarge" | ||
tuiButton | ||
tuiButtonVertical | ||
> | ||
Top up | ||
</button> | ||
|
||
<button | ||
appearance="link" | ||
iconLeft="tuiIconArrowRightCircleLarge" | ||
tuiButton | ||
tuiButtonVertical | ||
> | ||
Take out | ||
</button> | ||
</div> | ||
|
||
<div | ||
tuiSurface | ||
class="shadow" | ||
> | ||
<button | ||
appearance="link" | ||
iconLeft="tuiIconPlusCircleLarge" | ||
tuiButton | ||
> | ||
To repay | ||
</button> | ||
</div> |
15 changes: 15 additions & 0 deletions
15
projects/demo/src/modules/experimental/button-group/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,15 @@ | ||
:host { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
} | ||
|
||
.shadow { | ||
box-shadow: var(--tui-shadow); | ||
border-radius: 1rem; | ||
|
||
[tuiButton] { | ||
font-size: 0.8125rem; | ||
width: 100%; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
projects/demo/src/modules/experimental/button-group/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-example-1', | ||
templateUrl: './index.html', | ||
styleUrls: ['./index.less'], | ||
encapsulation, | ||
changeDetection, | ||
}) | ||
export class TuiButtonGroupExample1 {} |
67 changes: 67 additions & 0 deletions
67
projects/demo/src/modules/experimental/button-group/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,67 @@ | ||
<div | ||
tuiButtonGroup | ||
tuiSurface="flat" | ||
> | ||
<button | ||
appearance="link" | ||
iconLeft="tuiIconPlusCircleLarge" | ||
tuiButton | ||
tuiButtonVertical | ||
> | ||
Create a payment | ||
</button> | ||
|
||
<button | ||
appearance="link" | ||
iconLeft="tuiIconPlusCircleLarge" | ||
tuiButton | ||
tuiButtonVertical | ||
> | ||
Pay the bill | ||
</button> | ||
|
||
<button | ||
appearance="link" | ||
iconLeft="tuiIconStarLarge" | ||
tuiButton | ||
tuiButtonVertical | ||
> | ||
Remove from favorites | ||
</button> | ||
</div> | ||
|
||
<div | ||
tuiButtonGroup | ||
tuiSurface="flat" | ||
> | ||
<button | ||
appearance="link" | ||
iconLeft="tuiIconPlusCircleLarge" | ||
tuiButton | ||
tuiButtonVertical | ||
> | ||
Top up | ||
</button> | ||
|
||
<button | ||
appearance="link" | ||
iconLeft="tuiIconArrowRightCircleLarge" | ||
tuiButton | ||
tuiButtonVertical | ||
> | ||
Take out | ||
</button> | ||
</div> | ||
|
||
<div | ||
tuiSurface | ||
class="shadow" | ||
> | ||
<button | ||
appearance="link" | ||
iconLeft="tuiIconPlusCircleLarge" | ||
tuiButton | ||
> | ||
To repay | ||
</button> | ||
</div> |
15 changes: 15 additions & 0 deletions
15
projects/demo/src/modules/experimental/button-group/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,15 @@ | ||
:host { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
} | ||
|
||
.shadow { | ||
background: var(--tui-clear); | ||
border-radius: 1rem; | ||
|
||
[tuiButton] { | ||
font-size: 0.8125rem; | ||
width: 100%; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
projects/demo/src/modules/experimental/button-group/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-example-2', | ||
templateUrl: './index.html', | ||
styleUrls: ['./index.less'], | ||
encapsulation, | ||
changeDetection, | ||
}) | ||
export class TuiButtonGroupExample2 {} |
Oops, something went wrong.