diff --git a/src/test/java/com/vaadin/flow/component/button/demo/ButtonView.java b/src/test/java/com/vaadin/flow/component/button/demo/ButtonView.java index dd62c2c..184ce05 100644 --- a/src/test/java/com/vaadin/flow/component/button/demo/ButtonView.java +++ b/src/test/java/com/vaadin/flow/component/button/demo/ButtonView.java @@ -18,6 +18,8 @@ import com.vaadin.flow.component.ClickEvent; import com.vaadin.flow.component.Component; import com.vaadin.flow.component.button.Button; +import com.vaadin.flow.component.button.ButtonVariant; +import com.vaadin.flow.component.button.GeneratedVaadinButton; import com.vaadin.flow.component.html.Div; import com.vaadin.flow.component.html.Image; import com.vaadin.flow.component.icon.Icon; @@ -40,6 +42,7 @@ public void initView() { createImageButtonWithAccessibleLabel(); createButtonsWithTabIndex(); createDisabledButton(); + addVariantsFeature(); message = new Div(); message.setId("buttonMessage"); @@ -143,6 +146,20 @@ private void createDisabledButton() { button.setId("disabled-button"); } + private void addVariantsFeature() { + // begin-source-example + // source-example-heading: Theme variants usage + Button button = new Button(); + button.addThemeVariants(ButtonVariant.LUMO_PRIMARY); + // end-source-example + + addVariantsDemo(Button::new, + GeneratedVaadinButton::addThemeVariants, + GeneratedVaadinButton::removeThemeVariants, + ButtonVariant::getVariantName, ButtonVariant.LUMO_SMALL, + ButtonVariant.LUMO_PRIMARY); + } + private void showButtonClickedMessage(ClickEvent