diff --git a/core/designsystem/src/main/java/com/susu/core/designsystem/component/button/ClearIconButton.kt b/core/designsystem/src/main/java/com/susu/core/designsystem/component/button/ClearIconButton.kt index f7bf518e..41bd19dd 100644 --- a/core/designsystem/src/main/java/com/susu/core/designsystem/component/button/ClearIconButton.kt +++ b/core/designsystem/src/main/java/com/susu/core/designsystem/component/button/ClearIconButton.kt @@ -3,25 +3,30 @@ package com.susu.core.designsystem.component.button import androidx.compose.foundation.Image import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.CircleShape +import androidx.compose.material3.Icon import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.painterResource import androidx.compose.ui.unit.Dp import com.susu.core.designsystem.R +import com.susu.core.designsystem.theme.Gray30 import com.susu.core.ui.extension.susuClickable @Composable fun ClearIconButton( iconSize: Dp, + tint: Color = Gray30, onClick: () -> Unit, ) { - Image( + Icon( modifier = Modifier .clip(CircleShape) .size(iconSize) .susuClickable(onClick = onClick), painter = painterResource(id = R.drawable.ic_clear), contentDescription = "", + tint = tint, ) } diff --git a/core/designsystem/src/main/java/com/susu/core/designsystem/component/textfieldbutton/SusuTextFieldButton.kt b/core/designsystem/src/main/java/com/susu/core/designsystem/component/textfieldbutton/SusuTextFieldButton.kt index fecf4144..75f81029 100644 --- a/core/designsystem/src/main/java/com/susu/core/designsystem/component/textfieldbutton/SusuTextFieldButton.kt +++ b/core/designsystem/src/main/java/com/susu/core/designsystem/component/textfieldbutton/SusuTextFieldButton.kt @@ -303,11 +303,11 @@ private fun InnerButtons( onClickCloseIcon: () -> Unit = {}, onClickFilledButton: () -> Unit = {}, ) { - val (innerButtonTextColor, innerButtonBackgroundColor) = with(color) { + val (innerButtonTextColor, innerButtonBackgroundColor, clearIconColor) = with(color) { when { - isFocused.not() -> (unFocusedContentColor to unFocusedBackgroundColor) - isActive || isSaved -> (activeContentColor to activeBackgroundColor) - else -> (inactiveContentColor to inactiveBackgroundColor) + isFocused.not() -> listOf(unFocusedContentColor, unFocusedBackgroundColor, activeClearIconColor) + isActive || isSaved -> listOf(activeContentColor, activeBackgroundColor, activeClearIconColor) + else -> listOf(inactiveContentColor, inactiveBackgroundColor, inactiveClearIconColor) } } @@ -317,6 +317,7 @@ private fun InnerButtons( ClearIconButton( iconSize = clearIconSize, onClick = onClickClearIcon, + tint = clearIconColor, ) } } @@ -423,7 +424,7 @@ fun TextFieldButtonPreview() { onClickButton = { isFocused = !isFocused }, showClearIcon = false, showCloseIcon = false, - color = TextFieldButtonColor.Orange, + color = TextFieldButtonColor.Gray, style = LargeTextFieldButtonStyle.height46, onClickFilledButton = { isSaved = isSaved.not() }, onClickClearIcon = { text = "" }, @@ -482,7 +483,7 @@ fun TextFieldButtonFocusedPreview() { ) { Text(text = "텍스트 길이에 딱 맞는 너비 (wrap)") SusuTextFieldWrapContentButton( - color = TextFieldButtonColor.Orange, + color = TextFieldButtonColor.Gray, text = text, onTextChange = { text = it }, placeholder = "", diff --git a/core/designsystem/src/main/java/com/susu/core/designsystem/component/textfieldbutton/TextFieldButtonColor.kt b/core/designsystem/src/main/java/com/susu/core/designsystem/component/textfieldbutton/TextFieldButtonColor.kt index 81a2f245..576cc581 100644 --- a/core/designsystem/src/main/java/com/susu/core/designsystem/component/textfieldbutton/TextFieldButtonColor.kt +++ b/core/designsystem/src/main/java/com/susu/core/designsystem/component/textfieldbutton/TextFieldButtonColor.kt @@ -3,8 +3,11 @@ package com.susu.core.designsystem.component.textfieldbutton import androidx.compose.ui.graphics.Color import com.susu.core.designsystem.theme.Gray10 import com.susu.core.designsystem.theme.Gray100 +import com.susu.core.designsystem.theme.Gray15 import com.susu.core.designsystem.theme.Gray30 import com.susu.core.designsystem.theme.Gray40 +import com.susu.core.designsystem.theme.Gray50 +import com.susu.core.designsystem.theme.Orange10 import com.susu.core.designsystem.theme.Orange20 import com.susu.core.designsystem.theme.Orange60 @@ -38,6 +41,16 @@ enum class TextFieldButtonColor( placeholderColor = Gray30, unFocusedTextColor = Gray10, ), + Gray( + buttonColor = TextButtonInnerButtonColor.Gray, + savedBackgroundColor = Orange10, + editBackgroundColor = Gray15, + unFocusedBackgroundColor = Gray15, + unFocusedTextColor = Gray50, + editTextColor = Gray100, + savedTextColor = Gray100, + placeholderColor = Gray40, + ) } enum class TextButtonInnerButtonColor( @@ -47,6 +60,8 @@ enum class TextButtonInnerButtonColor( val activeBackgroundColor: Color, val inactiveBackgroundColor: Color, val unFocusedBackgroundColor: Color, + val activeClearIconColor: Color, + val inactiveClearIconColor: Color, val rippleColor: Color, ) { Black( @@ -56,6 +71,19 @@ enum class TextButtonInnerButtonColor( activeBackgroundColor = Gray100, inactiveBackgroundColor = Gray40, unFocusedBackgroundColor = Gray40, + activeClearIconColor = Gray30, + inactiveClearIconColor = Gray30, + rippleColor = Gray10, + ), + Gray( + activeContentColor = Gray10, + inactiveContentColor = Gray10, + unFocusedContentColor = Gray10, + activeBackgroundColor = Gray100, + inactiveBackgroundColor = Gray50, + unFocusedBackgroundColor = Gray50, + activeClearIconColor = Gray30, + inactiveClearIconColor = Gray40, rippleColor = Gray10, ), } diff --git a/core/designsystem/src/main/res/drawable/ic_clear.xml b/core/designsystem/src/main/res/drawable/ic_clear.xml index fef3a2ae..740e3cc0 100644 --- a/core/designsystem/src/main/res/drawable/ic_clear.xml +++ b/core/designsystem/src/main/res/drawable/ic_clear.xml @@ -3,10 +3,11 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> + - +