diff --git a/JDS-component/src/main/java/com/jusiCool/jds_component/textField/JDSTextField.kt b/JDS-component/src/main/java/com/jusiCool/jds_component/textField/JDSTextField.kt index 75d5b2b..e4a195b 100644 --- a/JDS-component/src/main/java/com/jusiCool/jds_component/textField/JDSTextField.kt +++ b/JDS-component/src/main/java/com/jusiCool/jds_component/textField/JDSTextField.kt @@ -34,13 +34,15 @@ import com.jusiCool.jds_component.typography.JDSTypography fun JDSTextField( modifier: Modifier = Modifier, label: String, - textFieldInfo: String, + placeHolder: String, textState: String, textFieldOutlineColor: Color, + stockUnitText:String = "", isEnabled: Boolean = true, isError: Boolean = false, supportText: String = "", supportTextClick: Boolean = false, + sellStock: Boolean = false, visualTransformation: VisualTransformation = VisualTransformation.None, onTextChange: (String) -> Unit, onClickSupportText: () -> Unit = {} @@ -95,9 +97,16 @@ fun JDSTextField( ) { if (textState.isEmpty()) { Text( - text = textFieldInfo, + text = placeHolder, color = if (textState.isEmpty()) JDSColor.GRAY2 else JDSColor.Black, + style = JDSTypography.bodySmall + ) + } else if(sellStock) { + Text( + text = stockUnitText, + color = JDSColor.GRAY300, style = JDSTypography.bodySmall, + modifier = Modifier.align(Alignment.End) ) } } @@ -126,27 +135,27 @@ fun JDSTextFieldPreview() { Column { JDSTextField( - modifier = Modifier.width(312.dp), + modifier = Modifier.fillMaxWidth(), label = "아이디", - textFieldInfo = "아이디를 입력해주세요", + placeHolder = "아이디를 입력해주세요", textFieldOutlineColor = JDSColor.GRAY100, textState = textState, onTextChange = onTextChange ) JDSTextField( - modifier = Modifier.width(312.dp), + modifier = Modifier.fillMaxWidth(), label = "아이디", - textFieldInfo = "아이디를 입력해주세요", + placeHolder = "아이디를 입력해주세요", textFieldOutlineColor = JDSColor.MAIN, textState = textState, onTextChange = onTextChange ) JDSTextField( - modifier = Modifier.width(312.dp), + modifier = Modifier.fillMaxWidth(), label = "아이디", - textFieldInfo = "아이디를 입력해주세요", + placeHolder = "아이디를 입력해주세요", textFieldOutlineColor = JDSColor.GRAY200, isEnabled = false, textState = textState, @@ -154,9 +163,9 @@ fun JDSTextFieldPreview() { ) JDSTextField( - modifier = Modifier.width(312.dp), + modifier = Modifier.fillMaxWidth(), label = "아이디", - textFieldInfo = "아이디를 입력해주세요", + placeHolder = "아이디를 입력해주세요", textFieldOutlineColor = JDSColor.ERROR, supportText = "Error", isError = true, @@ -165,9 +174,9 @@ fun JDSTextFieldPreview() { ) JDSTextField( - modifier = Modifier.width(312.dp), + modifier = Modifier.fillMaxWidth(), label = "아이디", - textFieldInfo = "아이디를 입력해주세요", + placeHolder = "아이디를 입력해주세요", textFieldOutlineColor = JDSColor.GRAY100, textState = textState, onTextChange = onTextChange, @@ -175,9 +184,9 @@ fun JDSTextFieldPreview() { ) JDSTextField( - modifier = Modifier.width(312.dp), + modifier = Modifier.fillMaxWidth(), label = "아이디", - textFieldInfo = "아이디를 입력해주세요", + placeHolder = "아이디를 입력해주세요", textFieldOutlineColor = JDSColor.ERROR, supportText = "영문, 숫자, 특수문자 중 2개 이상의 조합으로 8글자 이상", textState = textState, @@ -185,9 +194,9 @@ fun JDSTextFieldPreview() { ) JDSTextField( - modifier = Modifier.width(312.dp), + modifier = Modifier.fillMaxWidth(), label = "아이디", - textFieldInfo = "아이디를 입력해주세요", + placeHolder = "아이디를 입력해주세요", textFieldOutlineColor = JDSColor.ERROR, supportText = "이메일 수정하기", textState = textState, @@ -195,5 +204,17 @@ fun JDSTextFieldPreview() { supportTextClick = true, onClickSupportText = {} ) + + JDSTextField( + modifier = Modifier.fillMaxWidth(), + label = "아이디", + placeHolder = "아이디를 입력해주세요", + textFieldOutlineColor = JDSColor.GRAY100, + supportText = "이메일 수정하기", + textState = textState, + onTextChange = onTextChange, + sellStock = true, + stockUnitText = "주" + ) } } diff --git a/JDS-component/src/main/java/com/jusiCool/jds_component/typography/JDSTypography.kt b/JDS-component/src/main/java/com/jusiCool/jds_component/typography/JDSTypography.kt index 8e4bffe..b6c8c36 100644 --- a/JDS-component/src/main/java/com/jusiCool/jds_component/typography/JDSTypography.kt +++ b/JDS-component/src/main/java/com/jusiCool/jds_component/typography/JDSTypography.kt @@ -1,6 +1,5 @@ package com.jusiCool.jds_component.typography -import androidx.compose.material3.Typography import androidx.compose.runtime.Stable import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.font.Font