From d2cae0370ff60c71cab95e0939fe8da62ae82bb1 Mon Sep 17 00:00:00 2001 From: Marco D'Auria Date: Tue, 20 Jan 2026 13:09:27 +0100 Subject: [PATCH] docs(buttons): update buttons examples --- ...s-element-examples-chromium-dark-linux.png | 4 +- ...-element-examples-chromium-light-linux.png | 4 +- .../buttons--button-groups.yaml | 47 ++- ...s-element-examples-chromium-dark-linux.png | 4 +- ...-element-examples-chromium-light-linux.png | 4 +- ...s-element-examples-chromium-dark-linux.png | 4 +- ...-element-examples-chromium-light-linux.png | 4 +- .../buttons--selection-buttons.yaml | 58 ++- .../buttons--split-button.yaml | 4 +- .../src/styles/bootstrap/_button-group.scss | 4 + src/app/examples/buttons/button-groups.html | 173 +++++++-- src/app/examples/buttons/button-groups.ts | 3 +- .../examples/buttons/buttoncategories.html | 39 -- src/app/examples/buttons/buttoncategories.ts | 12 - .../examples/buttons/buttons-placement.html | 112 ++++-- src/app/examples/buttons/buttons.html | 6 +- src/app/examples/buttons/buttontypes.html | 156 -------- src/app/examples/buttons/buttontypes.ts | 17 - .../examples/buttons/selection-buttons.html | 334 +++++++++++++++--- src/app/examples/buttons/selection-buttons.ts | 3 + src/app/examples/buttons/split-button.html | 20 +- src/app/examples/buttons/split-button.ts | 3 +- 22 files changed, 621 insertions(+), 394 deletions(-) delete mode 100644 src/app/examples/buttons/buttoncategories.html delete mode 100644 src/app/examples/buttons/buttoncategories.ts delete mode 100644 src/app/examples/buttons/buttontypes.html delete mode 100644 src/app/examples/buttons/buttontypes.ts diff --git a/playwright/snapshots/static.spec.ts-snapshots/buttons--button-groups-element-examples-chromium-dark-linux.png b/playwright/snapshots/static.spec.ts-snapshots/buttons--button-groups-element-examples-chromium-dark-linux.png index cddb5f67c..13cc50b63 100644 --- a/playwright/snapshots/static.spec.ts-snapshots/buttons--button-groups-element-examples-chromium-dark-linux.png +++ b/playwright/snapshots/static.spec.ts-snapshots/buttons--button-groups-element-examples-chromium-dark-linux.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3f24ad8a5f32c127c3e171c4b8e527df66609175bab0a7b5ca24b88257a889e2 -size 28384 +oid sha256:dab25dfd0b1911a9cb7b606ccbf4e14d24c11a15c996f4ab146a2133eb8b0e3f +size 33554 diff --git a/playwright/snapshots/static.spec.ts-snapshots/buttons--button-groups-element-examples-chromium-light-linux.png b/playwright/snapshots/static.spec.ts-snapshots/buttons--button-groups-element-examples-chromium-light-linux.png index 6b3e45060..7e4dd7649 100644 --- a/playwright/snapshots/static.spec.ts-snapshots/buttons--button-groups-element-examples-chromium-light-linux.png +++ b/playwright/snapshots/static.spec.ts-snapshots/buttons--button-groups-element-examples-chromium-light-linux.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1e4d8da30cc8fe9f204092438f62e63a3745af2377bbe180267d39718c3c8e35 -size 34136 +oid sha256:80286b56e334f8d51188a57b964f4504d1882f22638928909db815eb9e86eca6 +size 39376 diff --git a/playwright/snapshots/static.spec.ts-snapshots/buttons--button-groups.yaml b/playwright/snapshots/static.spec.ts-snapshots/buttons--button-groups.yaml index 2ca04075d..960d39628 100644 --- a/playwright/snapshots/static.spec.ts-snapshots/buttons--button-groups.yaml +++ b/playwright/snapshots/static.spec.ts-snapshots/buttons--button-groups.yaml @@ -23,6 +23,19 @@ - button "Start" - button "Middle" - button "End" +- heading "With icons" [level=4] +- group "Primary group with icon and text": + - button "Edit" + - button "Copy" + - button "Delete" +- group "Secondary group with icon and text": + - button "Edit" + - button "Copy" + - button "Delete" +- group "Tertiary group with icon and text": + - button "Edit" + - button "Copy" + - button "Delete" - group "Primary group": - button "Edit" - button "Copy" @@ -35,16 +48,20 @@ - button "Edit" - button "Copy" - button "Delete" +- group "Ghost group": + - button "Edit" + - button "Copy" + - button "Delete" - heading "Sizing" [level=4] -- group "Large group": +- group "Large group with icon and text": - button "Large" - button "Group" - button "Size" -- group "Default group": +- group "Default group with icon and text": - button "Default" - button "Group" - button "Size" -- group "Small group": +- group "Small group with icon and text": - button "Small" - button "Group" - button "Size" @@ -60,15 +77,15 @@ - button "Small" - button "Group" - button "Size" -- group "Large group": - - button "Large" - - button "Group" - - button "Size" -- group "Default group": - - button "Default" - - button "Group" - - button "Size" -- group "Small group": - - button "Small" - - button "Group" - - button "Size" \ No newline at end of file +- group "Large icon group": + - button "Edit" + - button "Copy" + - button "Delete" +- group "Default icon group": + - button "Edit" + - button "Copy" + - button "Delete" +- group "Small icon group": + - button "Edit" + - button "Copy" + - button "Delete" \ No newline at end of file diff --git a/playwright/snapshots/static.spec.ts-snapshots/buttons--buttons-element-examples-chromium-dark-linux.png b/playwright/snapshots/static.spec.ts-snapshots/buttons--buttons-element-examples-chromium-dark-linux.png index 5af427bfe..8e2845da5 100644 --- a/playwright/snapshots/static.spec.ts-snapshots/buttons--buttons-element-examples-chromium-dark-linux.png +++ b/playwright/snapshots/static.spec.ts-snapshots/buttons--buttons-element-examples-chromium-dark-linux.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:818b4ca102f636df3edb111494cf73eba171ff6cdcf1d983953b131a38b69f59 -size 58168 +oid sha256:99a1ba7bac55ccdcccdeb9d77ba3874acd7420682a571b2c5edd62c3cb7f5ee9 +size 58023 diff --git a/playwright/snapshots/static.spec.ts-snapshots/buttons--buttons-element-examples-chromium-light-linux.png b/playwright/snapshots/static.spec.ts-snapshots/buttons--buttons-element-examples-chromium-light-linux.png index 3a1c4e165..9b819f058 100644 --- a/playwright/snapshots/static.spec.ts-snapshots/buttons--buttons-element-examples-chromium-light-linux.png +++ b/playwright/snapshots/static.spec.ts-snapshots/buttons--buttons-element-examples-chromium-light-linux.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2abe80bb54f546ac9aa3c83e596810ea37506c5e29a841df9e19f4bdf861a2cc -size 61528 +oid sha256:55052e2a17ccc4ed3bf0fe722549b063d3afa10428734c4c5259579c92b9a515 +size 61339 diff --git a/playwright/snapshots/static.spec.ts-snapshots/buttons--selection-buttons-element-examples-chromium-dark-linux.png b/playwright/snapshots/static.spec.ts-snapshots/buttons--selection-buttons-element-examples-chromium-dark-linux.png index 615e4eaea..6dd4063ec 100644 --- a/playwright/snapshots/static.spec.ts-snapshots/buttons--selection-buttons-element-examples-chromium-dark-linux.png +++ b/playwright/snapshots/static.spec.ts-snapshots/buttons--selection-buttons-element-examples-chromium-dark-linux.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e47780f1d62841758b43a670b7ff8a78118d8e1dfda1e1e87402a57ad95eb7ac -size 22194 +oid sha256:3c5bdaa7c2759dd1a2c064e96d029ee2744bc22d27001f25891d54acf74e2ef9 +size 34984 diff --git a/playwright/snapshots/static.spec.ts-snapshots/buttons--selection-buttons-element-examples-chromium-light-linux.png b/playwright/snapshots/static.spec.ts-snapshots/buttons--selection-buttons-element-examples-chromium-light-linux.png index af33bbe60..20121eaec 100644 --- a/playwright/snapshots/static.spec.ts-snapshots/buttons--selection-buttons-element-examples-chromium-light-linux.png +++ b/playwright/snapshots/static.spec.ts-snapshots/buttons--selection-buttons-element-examples-chromium-light-linux.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:43ab07bf96fa6f42958a55823215deb51ec9ac4d9b7e3c68998304d5adddaf2f -size 23270 +oid sha256:28f0c7547b2fd08e03f3c409eb870a75bb7d7d91f5affead2a03c334be2fffa2 +size 37262 diff --git a/playwright/snapshots/static.spec.ts-snapshots/buttons--selection-buttons.yaml b/playwright/snapshots/static.spec.ts-snapshots/buttons--selection-buttons.yaml index 6eb0c0992..f7ecb6614 100644 --- a/playwright/snapshots/static.spec.ts-snapshots/buttons--selection-buttons.yaml +++ b/playwright/snapshots/static.spec.ts-snapshots/buttons--selection-buttons.yaml @@ -1,4 +1,3 @@ -- heading "Single-select" [level=4] - group "Basic radio toggle button group": - radio "Day" [checked] - text: "" @@ -6,17 +5,33 @@ - text: "" - radio "Month" - text: "" -- group "Radio toggle button group with icon": +- group "Temperature mode selection": - radio "Comfort" [checked] - text: "" - radio "Pre-comfort" - text: "" - radio "Economy" - text: "" -- group "Layout selection toggle": +- group "Layout selection": - radio "One pane" [checked] - radio "Two panes" - radio "Three panes" +- heading "Multi-select" [level=4] +- group "Email status filter": + - checkbox "Read" [checked] + - text: "" + - checkbox "Unread" + - text: "" + - checkbox "Archived" [checked] + - text: "" + - checkbox "Deleted" + - text: "" +- group "Category filter": + - checkbox "Garden" [checked] + - checkbox "Mobile" + - checkbox "Cloud" [checked] + - checkbox "AI" + - checkbox "Network" - heading "Sizing" [level=4] - group "Basic radio toggle button group": - radio "Large" [checked] @@ -39,11 +54,36 @@ - text: "" - radio "Size" - text: "" -- heading "Multi-select" [level=4] -- group "Basic checkbox toggle button group": - - checkbox "€" +- group "Basic radio toggle button group": + - radio "Large" [checked] + - text: "" + - radio "Group" - text: "" - - checkbox "€€" + - radio "Size" + - text: "" +- group "Basic radio toggle button group": + - radio "Default" [checked] + - text: "" + - radio "Group" + - text: "" + - radio "Size" + - text: "" +- group "Basic radio toggle button group": + - radio "Small" [checked] + - text: "" + - radio "Group" + - text: "" + - radio "Size" - text: "" - - checkbox "€€€" - - text: "" \ No newline at end of file +- group "Climate control mode": + - radio "Heating" + - radio "Water" + - radio "Cooling" +- group "Climate control mode": + - radio "Heating" + - radio "Water" + - radio "Cooling" +- group "Climate control mode": + - radio "Heating" + - radio "Water" + - radio "Cooling" \ No newline at end of file diff --git a/playwright/snapshots/static.spec.ts-snapshots/buttons--split-button.yaml b/playwright/snapshots/static.spec.ts-snapshots/buttons--split-button.yaml index ea5635378..de1f2cbad 100644 --- a/playwright/snapshots/static.spec.ts-snapshots/buttons--split-button.yaml +++ b/playwright/snapshots/static.spec.ts-snapshots/buttons--split-button.yaml @@ -1,8 +1,8 @@ - group "Split button primary": - - button " Button" + - button "Button" - button "Dropdown toggle" - group "Split button secondary": - - button " Button" + - button "Button" - button "Dropdown toggle" - group "Split button primary label only": - button "Button" diff --git a/projects/element-theme/src/styles/bootstrap/_button-group.scss b/projects/element-theme/src/styles/bootstrap/_button-group.scss index 41b267ed8..d4769d76e 100644 --- a/projects/element-theme/src/styles/bootstrap/_button-group.scss +++ b/projects/element-theme/src/styles/bootstrap/_button-group.scss @@ -76,6 +76,10 @@ $btn-size-sm: 24px !default; &.btn-lg { inline-size: $btn-size-lg; } + + &.btn-sm { + inline-size: $btn-size-sm; + } } // Dropdown toggle styling for split buttons diff --git a/src/app/examples/buttons/button-groups.html b/src/app/examples/buttons/button-groups.html index e8ec48a10..989df6595 100644 --- a/src/app/examples/buttons/button-groups.html +++ b/src/app/examples/buttons/button-groups.html @@ -40,62 +40,149 @@ +

With icons

+
+
+ + + +
+ +
+ + + +
+ +
+ + + +
+
+
+
+ +
+ + +

Sizing

-
- - - +
+ + +
-
- - - +
+ + +
-
- - - +
+ + +
@@ -119,23 +206,41 @@

Sizing

-
-
- - - +
+
+ + +
-
- - - +
+ + +
-
- - - +
+ + +
diff --git a/src/app/examples/buttons/button-groups.ts b/src/app/examples/buttons/button-groups.ts index 19a7de80f..a5aaedeba 100644 --- a/src/app/examples/buttons/button-groups.ts +++ b/src/app/examples/buttons/button-groups.ts @@ -3,10 +3,11 @@ * SPDX-License-Identifier: MIT */ import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { SiIconComponent } from '@siemens/element-ng/icon'; @Component({ selector: 'app-sample', - imports: [], + imports: [SiIconComponent], templateUrl: './button-groups.html', changeDetection: ChangeDetectionStrategy.OnPush }) diff --git a/src/app/examples/buttons/buttoncategories.html b/src/app/examples/buttons/buttoncategories.html deleted file mode 100644 index fc4f978de..000000000 --- a/src/app/examples/buttons/buttoncategories.html +++ /dev/null @@ -1,39 +0,0 @@ -
-
- - - -
- -
-
- - -
-
- - - -
-
-
diff --git a/src/app/examples/buttons/buttoncategories.ts b/src/app/examples/buttons/buttoncategories.ts deleted file mode 100644 index bc927932b..000000000 --- a/src/app/examples/buttons/buttoncategories.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Copyright (c) Siemens 2016 - 2025 - * SPDX-License-Identifier: MIT - */ -import { ChangeDetectionStrategy, Component } from '@angular/core'; - -@Component({ - selector: 'app-sample', - templateUrl: './buttoncategories.html', - changeDetection: ChangeDetectionStrategy.OnPush -}) -export class SampleComponent {} diff --git a/src/app/examples/buttons/buttons-placement.html b/src/app/examples/buttons/buttons-placement.html index 24f68bac0..bbe319159 100644 --- a/src/app/examples/buttons/buttons-placement.html +++ b/src/app/examples/buttons/buttons-placement.html @@ -1,44 +1,78 @@ -
- - -
+
+
+
+
+ + +
+
+
-
- - -
+
+
+

With text truncation

+
+ + +
+
+
-
-
- -
-
- -
-
+
+
+

Responsive grid: vertical layout + < 576px

+
+
+
+ +
+
+ +
+
+
+
+
- +
+
+

Modal footer layout using + .modal-footer

+ +
+
-
- - - +
+
+

Footer with Bootstrap utilities

+
+ + + +
+
+
diff --git a/src/app/examples/buttons/buttons.html b/src/app/examples/buttons/buttons.html index 56e763e7a..6f58d5cba 100644 --- a/src/app/examples/buttons/buttons.html +++ b/src/app/examples/buttons/buttons.html @@ -19,13 +19,13 @@

Buttons with icons

-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
-
-
- -
-
- -
-
-
diff --git a/src/app/examples/buttons/buttontypes.ts b/src/app/examples/buttons/buttontypes.ts deleted file mode 100644 index f571e90d8..000000000 --- a/src/app/examples/buttons/buttontypes.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Copyright (c) Siemens 2016 - 2025 - * SPDX-License-Identifier: MIT - */ -import { ChangeDetectionStrategy, Component } from '@angular/core'; - -@Component({ - selector: 'app-sample', - templateUrl: './buttontypes.html', - changeDetection: ChangeDetectionStrategy.OnPush, - host: { - class: 'bg-base-1' - } -}) -export class SampleComponent { - disabled = false; -} diff --git a/src/app/examples/buttons/selection-buttons.html b/src/app/examples/buttons/selection-buttons.html index 1d242cac5..f26c47e6a 100644 --- a/src/app/examples/buttons/selection-buttons.html +++ b/src/app/examples/buttons/selection-buttons.html @@ -1,56 +1,207 @@ -

Single-select

-
- - +
+
+ + + + + + + + +
+ +
+ + + + + + + + +
+ +
+ - - + - - + +
-

-
- - +

Multi-select

+
+
+ + + + + - -
+
+ +
+ - -
-

-
- -
-

Sizing

+
+
+ + + + + + + + +
+ +
+ + + + + + + + +
+ +
+ + + + + + + + +
+
+
-

Multi-select

-
- - +
+
+ - - + - - + +
+ +
+ + + + + +
+ +
+ + + + + +
diff --git a/src/app/examples/buttons/selection-buttons.ts b/src/app/examples/buttons/selection-buttons.ts index d21479e79..8d91756c3 100644 --- a/src/app/examples/buttons/selection-buttons.ts +++ b/src/app/examples/buttons/selection-buttons.ts @@ -3,9 +3,12 @@ * SPDX-License-Identifier: MIT */ import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { SiIconComponent } from '@siemens/element-ng/icon'; +import { SiTooltipDirective } from '@siemens/element-ng/tooltip'; @Component({ selector: 'app-sample', + imports: [SiIconComponent, SiTooltipDirective], templateUrl: './selection-buttons.html', changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'p-5' } diff --git a/src/app/examples/buttons/split-button.html b/src/app/examples/buttons/split-button.html index 6271507db..353351dab 100644 --- a/src/app/examples/buttons/split-button.html +++ b/src/app/examples/buttons/split-button.html @@ -2,7 +2,7 @@
@@ -49,7 +49,7 @@ (cdkMenuOpened)="splitOpen4 = true" (cdkMenuClosed)="splitOpen4 = false" > - +
@@ -64,7 +64,7 @@ (cdkMenuOpened)="splitOpen5 = true" (cdkMenuClosed)="splitOpen5 = false" > - +
@@ -72,7 +72,7 @@
diff --git a/src/app/examples/buttons/split-button.ts b/src/app/examples/buttons/split-button.ts index 2aae79a3b..08382d788 100644 --- a/src/app/examples/buttons/split-button.ts +++ b/src/app/examples/buttons/split-button.ts @@ -4,11 +4,12 @@ */ import { CdkMenuTrigger } from '@angular/cdk/menu'; import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { SiIconComponent } from '@siemens/element-ng/icon'; import { SiMenuModule } from '@siemens/element-ng/menu'; @Component({ selector: 'app-sample', - imports: [SiMenuModule, CdkMenuTrigger], + imports: [SiMenuModule, CdkMenuTrigger, SiIconComponent], templateUrl: './split-button.html', changeDetection: ChangeDetectionStrategy.OnPush })