Skip to content

Commit 368a82d

Browse files
feat(demo): show label highlighting for each color variant
1 parent 7a46f66 commit 368a82d

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

src/test/java/com/flowingcode/vaadin/addons/fctogglebutton/FCToggleButtonDemo.java

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,23 +78,26 @@ public FCToggleButtonDemo() {
7878
.setRightIcon(new Icon(VaadinIcon.SUN_O))
7979
.withIconsInside();
8080

81-
FCToggleButton highlightLabels = new FCToggleButton()
82-
.setLeftLabel("Off")
83-
.setRightLabel("On")
84-
.withHighlightLabel();
81+
FCToggleButton highlightPrimary = new FCToggleButton(true).setLeftLabel("Off").setRightLabel("On").withHighlightLabel();
82+
highlightPrimary.addThemeVariants(FCToggleButtonVariant.PRIMARY);
8583

86-
FCToggleButton highlightWithIcons = new FCToggleButton()
87-
.setLeftIcon(new Icon(VaadinIcon.MOON))
88-
.setLeftLabel("Dark")
89-
.setRightLabel("Light")
90-
.setRightIcon(new Icon(VaadinIcon.SUN_O))
91-
.withHighlightLabel();
84+
FCToggleButton highlightSuccess = new FCToggleButton(true).setLeftLabel("Off").setRightLabel("On").withHighlightLabel();
85+
highlightSuccess.addThemeVariants(FCToggleButtonVariant.SUCCESS);
86+
87+
FCToggleButton highlightWarning = new FCToggleButton(true).setLeftLabel("Off").setRightLabel("On").withHighlightLabel();
88+
highlightWarning.addThemeVariants(FCToggleButtonVariant.WARNING);
89+
90+
FCToggleButton highlightError = new FCToggleButton(true).setLeftLabel("Off").setRightLabel("On").withHighlightLabel();
91+
highlightError.addThemeVariants(FCToggleButtonVariant.ERROR);
92+
93+
FCToggleButton highlightContrast = new FCToggleButton(true).setLeftLabel("Off").setRightLabel("On").withHighlightLabel();
94+
highlightContrast.addThemeVariants(FCToggleButtonVariant.CONTRAST);
9295

9396
HorizontalLayout fieldLabelRow = new HorizontalLayout(withLabel, withLabelAndInitialValue);
9497
HorizontalLayout labelsRow = new HorizontalLayout(withLeftLabel, withRightLabel, withBothLabels);
9598
HorizontalLayout iconsRow = new HorizontalLayout(withLeftIcon, withRightIcon, withBothIcons);
9699
HorizontalLayout labelsAndIconsRow = new HorizontalLayout(withLabelsAndIcons, withIconsInside);
97-
HorizontalLayout highlightRow = new HorizontalLayout(highlightLabels, highlightWithIcons);
100+
HorizontalLayout highlightRow = new HorizontalLayout(highlightPrimary, highlightSuccess, highlightWarning, highlightError, highlightContrast);
98101
fieldLabelRow.getStyle().set("gap", "var(--lumo-space-l)");
99102
labelsRow.getStyle().set("gap", "var(--lumo-space-l)");
100103
iconsRow.getStyle().set("gap", "var(--lumo-space-l)");

0 commit comments

Comments
 (0)