diff --git a/ui_framework/components/button/__snapshots__/button.test.js.snap b/ui_framework/components/button/__snapshots__/button.test.js.snap index 979451ac42be7..552251b84e508 100644 --- a/ui_framework/components/button/__snapshots__/button.test.js.snap +++ b/ui_framework/components/button/__snapshots__/button.test.js.snap @@ -6,6 +6,7 @@ exports[`KuiButton Baseline HTML attributes are rendered 1`] = ` class="kuiButton testClass1 testClass2" data-test-subj="test subject string" disabled="" + type="submit" > `; +exports[`KuiButton Props buttonType basic renders the basic class 1`] = ` + +`; + +exports[`KuiButton Props buttonType danger renders the danger class 1`] = ` + +`; + +exports[`KuiButton Props buttonType hollow renders the hollow class 1`] = ` + +`; + +exports[`KuiButton Props buttonType primary renders the primary class 1`] = ` + +`; + exports[`KuiButton Props children is rendered 1`] = ` `; - -exports[`KuiButton Props type basic renders the basic class 1`] = ` - -`; - -exports[`KuiButton Props type danger renders the danger class 1`] = ` - -`; - -exports[`KuiButton Props type hollow renders the hollow class 1`] = ` - -`; - -exports[`KuiButton Props type primary renders the primary class 1`] = ` - -`; diff --git a/ui_framework/components/button/__snapshots__/link_button.test.js.snap b/ui_framework/components/button/__snapshots__/link_button.test.js.snap index 8c897a6f25220..03021dd6426db 100644 --- a/ui_framework/components/button/__snapshots__/link_button.test.js.snap +++ b/ui_framework/components/button/__snapshots__/link_button.test.js.snap @@ -7,6 +7,7 @@ exports[`KuiLinkButton Baseline HTML attributes are rendered (and disabled rende data-test-subj="test subject string" href="#" target="_blank" + type="submit" > `; +exports[`KuiLinkButton Props buttonType basic renders the basic class 1`] = ` + + + +`; + +exports[`KuiLinkButton Props buttonType danger renders the danger class 1`] = ` + + + +`; + +exports[`KuiLinkButton Props buttonType hollow renders the hollow class 1`] = ` + + + +`; + +exports[`KuiLinkButton Props buttonType primary renders the primary class 1`] = ` + + + +`; + exports[`KuiLinkButton Props children is rendered 1`] = ` `; - -exports[`KuiLinkButton Props type basic renders the basic class 1`] = ` - - - -`; - -exports[`KuiLinkButton Props type danger renders the danger class 1`] = ` - - - -`; - -exports[`KuiLinkButton Props type hollow renders the hollow class 1`] = ` - - - -`; - -exports[`KuiLinkButton Props type primary renders the primary class 1`] = ` - - - -`; diff --git a/ui_framework/components/button/__snapshots__/submit_button.test.js.snap b/ui_framework/components/button/__snapshots__/submit_button.test.js.snap index 12de82c013601..d65ecc2a506bf 100644 --- a/ui_framework/components/button/__snapshots__/submit_button.test.js.snap +++ b/ui_framework/components/button/__snapshots__/submit_button.test.js.snap @@ -17,38 +17,38 @@ exports[`KuiSubmitButton Baseline is rendered 1`] = ` /> `; -exports[`KuiSubmitButton Props children is rendered as value 1`] = ` +exports[`KuiSubmitButton Props buttonType basic renders the basic class 1`] = ` `; -exports[`KuiSubmitButton Props type basic renders the basic class 1`] = ` +exports[`KuiSubmitButton Props buttonType danger renders the danger class 1`] = ` `; -exports[`KuiSubmitButton Props type danger renders the danger class 1`] = ` +exports[`KuiSubmitButton Props buttonType hollow renders the hollow class 1`] = ` `; -exports[`KuiSubmitButton Props type hollow renders the hollow class 1`] = ` +exports[`KuiSubmitButton Props buttonType primary renders the primary class 1`] = ` `; -exports[`KuiSubmitButton Props type primary renders the primary class 1`] = ` +exports[`KuiSubmitButton Props children is rendered as value 1`] = ` `; diff --git a/ui_framework/components/button/button.js b/ui_framework/components/button/button.js index 32868f2c137a1..1506c7b9e6bfb 100644 --- a/ui_framework/components/button/button.js +++ b/ui_framework/components/button/button.js @@ -26,8 +26,8 @@ const buttonTypeToClassNameMap = { primary: 'kuiButton--primary', }; -const getClassName = ({ className, type, hasIcon = false }) => - classNames('kuiButton', className, buttonTypeToClassNameMap[type], { +const getClassName = ({ className, buttonType, hasIcon = false }) => + classNames('kuiButton', className, buttonTypeToClassNameMap[buttonType], { 'kuiButton--iconText': hasIcon, }); @@ -63,7 +63,7 @@ const KuiButton = ({ isLoading, iconPosition = DEFAULT_ICON_POSITION, className, - type, + buttonType, icon, children, ...rest @@ -72,7 +72,7 @@ const KuiButton = ({