-
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
tuiButtonGroup
- Loading branch information
Showing
24 changed files
with
528 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'), | ||
}; | ||
} |
35 changes: 35 additions & 0 deletions
35
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,35 @@ | ||
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, | ||
TuiIconModule, | ||
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, | ||
tuiGetDocModules(ExampleTuiButtonGroupComponent), | ||
TuiSurfaceModule, | ||
TuiButtonGroupModule, | ||
TuiBadgedContentModule, | ||
TuiIconModule, | ||
], | ||
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> |
44 changes: 44 additions & 0 deletions
44
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,44 @@ | ||
<div | ||
tuiButtonGroup | ||
tuiSurface="elevated" | ||
> | ||
<button> | ||
<tui-icon icon="tuiIconPlusCircleLarge"></tui-icon> | ||
Create a payment | ||
</button> | ||
|
||
<button> | ||
<tui-icon icon="tuiIconPlusCircleLarge"></tui-icon> | ||
Pay the bill | ||
</button> | ||
|
||
<button> | ||
<tui-icon icon="tuiIconPlusCircleLarge"></tui-icon> | ||
Remove from favorites | ||
</button> | ||
</div> | ||
|
||
<div | ||
tuiButtonGroup | ||
tuiSurface="elevated" | ||
> | ||
<button> | ||
<tui-icon icon="tuiIconPlusCircleLarge"></tui-icon> | ||
Top up | ||
</button> | ||
|
||
<button> | ||
<tui-icon icon="tuiIconArrowRightCircleLarge"></tui-icon> | ||
Take out | ||
</button> | ||
</div> | ||
|
||
<div | ||
tuiSurface | ||
class="shadow" | ||
> | ||
<button> | ||
<tui-icon icon="tuiIconPlusCircleLarge"></tui-icon> | ||
To repay | ||
</button> | ||
</div> |
28 changes: 28 additions & 0 deletions
28
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,28 @@ | ||
@import '@taiga-ui/core/styles/taiga-ui-local'; | ||
|
||
:host { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
} | ||
|
||
button { | ||
color: var(--tui-link); | ||
} | ||
|
||
.shadow { | ||
box-shadow: var(--tui-shadow); | ||
border-radius: 1rem; | ||
|
||
button { | ||
.button-base(); | ||
|
||
padding: 1.125rem 0.25rem 1.125rem 0.25rem; | ||
font-size: 1.0625rem; | ||
font-weight: normal; | ||
width: 100%; | ||
display: flex; | ||
justify-content: center; | ||
gap: 0.5rem; | ||
} | ||
} |
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 {} |
44 changes: 44 additions & 0 deletions
44
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,44 @@ | ||
<div | ||
tuiButtonGroup | ||
tuiSurface="flat" | ||
> | ||
<button> | ||
<tui-icon icon="tuiIconPlusCircleLarge"></tui-icon> | ||
Create a payment | ||
</button> | ||
|
||
<button> | ||
<tui-icon icon="tuiIconPlusCircleLarge"></tui-icon> | ||
Pay the bill | ||
</button> | ||
|
||
<button> | ||
<tui-icon icon="tuiIconPlusCircleLarge"></tui-icon> | ||
Remove from favorites | ||
</button> | ||
</div> | ||
|
||
<div | ||
tuiButtonGroup | ||
tuiSurface="flat" | ||
> | ||
<button> | ||
<tui-icon icon="tuiIconPlusCircleLarge"></tui-icon> | ||
Top up | ||
</button> | ||
|
||
<button> | ||
<tui-icon icon="tuiIconArrowRightCircleLarge"></tui-icon> | ||
Take out | ||
</button> | ||
</div> | ||
|
||
<div | ||
tuiSurface | ||
class="shadow" | ||
> | ||
<button> | ||
<tui-icon icon="tuiIconPlusCircleLarge"></tui-icon> | ||
To repay | ||
</button> | ||
</div> |
28 changes: 28 additions & 0 deletions
28
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,28 @@ | ||
@import '@taiga-ui/core/styles/taiga-ui-local'; | ||
|
||
:host { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
} | ||
|
||
button { | ||
color: var(--tui-link); | ||
} | ||
|
||
.shadow { | ||
background: var(--tui-clear); | ||
border-radius: 1rem; | ||
|
||
button { | ||
.button-base(); | ||
|
||
padding: 1.125rem 0.25rem 1.125rem 0.25rem; | ||
font-size: 1.0625rem; | ||
font-weight: normal; | ||
width: 100%; | ||
display: flex; | ||
justify-content: center; | ||
gap: 0.5rem; | ||
} | ||
} |
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 {} |
44 changes: 44 additions & 0 deletions
44
projects/demo/src/modules/experimental/button-group/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,44 @@ | ||
<div | ||
tuiButtonGroup | ||
tuiSurface="custom" | ||
> | ||
<button> | ||
<tui-icon icon="tuiIconPlusCircleLarge"></tui-icon> | ||
Create a payment | ||
</button> | ||
|
||
<button> | ||
<tui-icon icon="tuiIconPlusCircleLarge"></tui-icon> | ||
Pay the bill | ||
</button> | ||
|
||
<button> | ||
<tui-icon icon="tuiIconPlusCircleLarge"></tui-icon> | ||
Remove from favorites | ||
</button> | ||
</div> | ||
|
||
<div | ||
tuiButtonGroup | ||
tuiSurface="custom" | ||
> | ||
<button> | ||
<tui-icon icon="tuiIconPlusCircleLarge"></tui-icon> | ||
Top up | ||
</button> | ||
|
||
<button> | ||
<tui-icon icon="tuiIconArrowRightCircleLarge"></tui-icon> | ||
Take out | ||
</button> | ||
</div> | ||
|
||
<div | ||
tuiSurface | ||
class="shadow" | ||
> | ||
<button> | ||
<tui-icon icon="tuiIconPlusCircleLarge"></tui-icon> | ||
To repay | ||
</button> | ||
</div> |
Oops, something went wrong.