diff --git a/buildSrc/src/main/kotlin/com/gabrieldrn/carbon/Configuration.kt b/buildSrc/src/main/kotlin/com/gabrieldrn/carbon/Configuration.kt index 1c0e90e4..b6de7f5b 100644 --- a/buildSrc/src/main/kotlin/com/gabrieldrn/carbon/Configuration.kt +++ b/buildSrc/src/main/kotlin/com/gabrieldrn/carbon/Configuration.kt @@ -19,9 +19,9 @@ package com.gabrieldrn.carbon object Configuration { const val majorVersion = 0 const val minorVersion = 3 - const val patchVersion = 0 + const val patchVersion = 1 const val versionName = "$majorVersion.$minorVersion.$patchVersion" - const val versionCode = 1 + const val versionCode = 4 const val snapshotVersionName = "$majorVersion.$minorVersion.${patchVersion + 1}-SNAPSHOT" const val artifactGroup = "io.github.gabrieldrn" } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/button/ButtonColors.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/button/ButtonColors.kt index 3f0f6d8d..030b7286 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/button/ButtonColors.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/button/ButtonColors.kt @@ -113,17 +113,13 @@ internal class ButtonColors private constructor( else -> theme.textOnColorDisabled } - val iconColor: Color = if (isIconButton) { - theme.iconPrimary - } else { - when (buttonType) { - ButtonType.Tertiary -> theme.buttonTertiary - ButtonType.Ghost -> theme.linkPrimary - ButtonType.PrimaryDanger -> theme.iconOnColor - ButtonType.TertiaryDanger, - ButtonType.GhostDanger -> theme.buttonDangerSecondary - else -> theme.iconOnColor - } + val iconColor: Color = when (buttonType) { + ButtonType.Tertiary -> theme.buttonTertiary + ButtonType.Ghost -> if (isIconButton) theme.iconPrimary else theme.linkPrimary + ButtonType.PrimaryDanger -> theme.iconOnColor + ButtonType.TertiaryDanger, + ButtonType.GhostDanger -> theme.buttonDangerSecondary + else -> theme.iconOnColor } val iconActiveColor: Color = if (isIconButton) { @@ -150,7 +146,7 @@ internal class ButtonColors private constructor( ButtonType.Primary, ButtonType.Secondary, ButtonType.PrimaryDanger -> theme.iconOnColorDisabled - else -> theme.iconDisabled // Issue in documentation for Ghost? + else -> theme.iconDisabled } override fun equals(other: Any?): Boolean { diff --git a/carbon/src/commonTest/kotlin/com/gabrieldrn/carbon/button/ButtonColorsTest.kt b/carbon/src/commonTest/kotlin/com/gabrieldrn/carbon/button/ButtonColorsTest.kt index dd2ea6b6..7e68a8fc 100644 --- a/carbon/src/commonTest/kotlin/com/gabrieldrn/carbon/button/ButtonColorsTest.kt +++ b/carbon/src/commonTest/kotlin/com/gabrieldrn/carbon/button/ButtonColorsTest.kt @@ -148,17 +148,13 @@ class ButtonColorsTest : BaseColorsTest() { ) assertEquals( - expected = if (isIconButton) { - theme.iconPrimary - } else { - when (buttonType) { - ButtonType.Tertiary -> theme.buttonTertiary - ButtonType.Ghost -> theme.linkPrimary - ButtonType.PrimaryDanger -> theme.iconOnColor - ButtonType.TertiaryDanger, - ButtonType.GhostDanger -> theme.buttonDangerSecondary - else -> theme.iconOnColor - } + expected = when (buttonType) { + ButtonType.Tertiary -> theme.buttonTertiary + ButtonType.Ghost -> if (isIconButton) theme.iconPrimary else theme.linkPrimary + ButtonType.PrimaryDanger -> theme.iconOnColor + ButtonType.TertiaryDanger, + ButtonType.GhostDanger -> theme.buttonDangerSecondary + else -> theme.iconOnColor }, actual = colors.iconColor ) @@ -194,7 +190,7 @@ class ButtonColorsTest : BaseColorsTest() { ButtonType.Primary, ButtonType.Secondary, ButtonType.PrimaryDanger -> theme.iconOnColorDisabled - else -> theme.iconDisabled // Issue in documentation for Ghost + else -> theme.iconDisabled }, actual = colors.iconDisabledColor )