diff --git a/libary/src/main/java/com/example/libary/BottomSheet.kt b/libary/src/main/java/com/example/libary/BottomSheet.kt index b773232..7d91fed 100644 --- a/libary/src/main/java/com/example/libary/BottomSheet.kt +++ b/libary/src/main/java/com/example/libary/BottomSheet.kt @@ -10,8 +10,8 @@ import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.ModalBottomSheet import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp +import com.example.libary.theme.WhiteColor @OptIn(ExperimentalMaterial3Api::class) @Composable @@ -22,7 +22,7 @@ fun BottomSheet( ModalBottomSheet( modifier = modifier, onDismissRequest = {}, - containerColor = Color.White, + containerColor = WhiteColor, shape = AbsoluteRoundedCornerShape(24.dp), dragHandle = null ) { diff --git a/libary/src/main/java/com/example/libary/Buttons.kt b/libary/src/main/java/com/example/libary/Buttons.kt index a4c0379..7c4a2f1 100644 --- a/libary/src/main/java/com/example/libary/Buttons.kt +++ b/libary/src/main/java/com/example/libary/Buttons.kt @@ -3,6 +3,7 @@ package com.example.libary import androidx.compose.foundation.BorderStroke import androidx.compose.foundation.Image import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer @@ -23,10 +24,15 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.painterResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.example.libary.theme.AccentColor +import com.example.libary.theme.AccentInactive import com.example.libary.theme.BlackColor +import com.example.libary.theme.Desc +import com.example.libary.theme.InputBGColor +import com.example.libary.theme.InputStroke import com.example.libary.theme.WhiteColor enum class BigButtonState( @@ -40,7 +46,7 @@ enum class BigButtonState( textColor = Color.White, ), Inactive( - containerColor = Color(0xFFC9D4FB), + containerColor = AccentInactive, textColor = WhiteColor, enabled = false ), @@ -50,7 +56,7 @@ enum class BigButtonState( border = BorderStroke(1.dp, AccentColor) ), Tetriary( - containerColor = Color(0xFFF5F5F9), + containerColor = InputBGColor, textColor = BlackColor, ) } @@ -96,7 +102,7 @@ enum class SmallButtonState( textColor = Color.White, ), Inactive( - containerColor = Color(0xFFC9D4FB), + containerColor = AccentInactive, textColor = WhiteColor, enabled = false ), @@ -106,7 +112,7 @@ enum class SmallButtonState( border = BorderStroke(1.dp, AccentColor) ), Tetriary( - containerColor = Color(0xFFF5F5F9), + containerColor = InputBGColor, textColor = BlackColor, ) } @@ -215,7 +221,7 @@ fun LoginButton( .width(335.dp) .height(60.dp), shape = AbsoluteRoundedCornerShape(10.dp), - border = BorderStroke(1.dp, Color(0xFFEBEBEB)), + border = BorderStroke(1.dp, InputStroke), colors = ButtonDefaults.buttonColors( containerColor = Color.White ) @@ -246,7 +252,7 @@ enum class ChipButtonState( val textColor: Color ) { On(AccentColor, Color.White), - Off(Color(0xFFF5F5F9), Color(0xFF7E7E9A)) + Off(InputBGColor, Desc) } @Composable @@ -277,3 +283,17 @@ fun ChipButton( ) } } + +@Preview +@Composable +private fun BigButtonPrev() { + Column { + BigButtonState.entries.forEach { + BigButton( + state = it, + text = "test" + ) + Spacer(Modifier.height(5.dp)) + } + } +} \ No newline at end of file diff --git a/libary/src/main/java/com/example/libary/Cards.kt b/libary/src/main/java/com/example/libary/Cards.kt index 53fed4f..ce2ee70 100644 --- a/libary/src/main/java/com/example/libary/Cards.kt +++ b/libary/src/main/java/com/example/libary/Cards.kt @@ -30,7 +30,12 @@ import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp +import com.example.libary.theme.Black1Color +import com.example.libary.theme.CaptionColor +import com.example.libary.theme.CartShadowColor import com.example.libary.theme.DividerColor +import com.example.libary.theme.InputBGColor +import com.example.libary.theme.White1Color @Composable fun BaseCard( @@ -39,13 +44,12 @@ fun BaseCard( ) { Card( modifier = modifier - .shadow(10.dp, AbsoluteRoundedCornerShape(12.dp), ambientColor = Color(0x99E4E8F5), spotColor = Color( - 0x99E4E8F5 - ) + .shadow(10.dp, AbsoluteRoundedCornerShape(12.dp), + ambientColor = CartShadowColor, spotColor = CartShadowColor ), shape = AbsoluteRoundedCornerShape(12.dp), colors = CardDefaults.cardColors( - containerColor = Color.White + containerColor = White1Color ), border = BorderStroke(1.dp, DividerColor) ) { @@ -71,7 +75,7 @@ fun PrimaryCard( ) { Text( text = name, - color = Color.Black, + color = Black1Color, fontWeight = FontWeight.W500, fontSize = 16.sp ) @@ -86,7 +90,7 @@ fun PrimaryCard( Column { Text( text = category, - color = Color(0xFF939396), + color = CaptionColor, fontWeight = FontWeight.W600, fontSize = 14.sp ) @@ -95,7 +99,7 @@ fun PrimaryCard( Text( text = "$price ₽", - color = Color.Black, + color = Black1Color, fontWeight = FontWeight.W600, fontSize = 17.sp ) @@ -131,7 +135,7 @@ fun CartCard( text = name, fontWeight = FontWeight.W500, fontSize = 16.sp, - color = Color.Black, + color = Black1Color, modifier = Modifier.weight(1.0f) ) @@ -153,7 +157,7 @@ fun CartCard( ) { Text( text = "$price ₽", - color = Color.Black, + color = Black1Color, fontWeight = FontWeight.W500, fontSize = 17.sp ) @@ -165,7 +169,7 @@ fun CartCard( text = "$count штук", fontWeight = FontWeight.W400, fontSize = 15.sp, - color = Color.Black + color = Black1Color ) Spacer(Modifier.width(42.dp)) @@ -174,7 +178,7 @@ fun CartCard( modifier = Modifier .width(64.dp) .height(32.dp) - .background(Color(0xFFF5F5F9), AbsoluteRoundedCornerShape(8.dp)) + .background(InputBGColor, AbsoluteRoundedCornerShape(8.dp)) .clip(AbsoluteRoundedCornerShape(8.dp)), contentAlignment = Alignment.Center ) { @@ -223,7 +227,7 @@ fun ProjectCard( text = name, fontWeight = FontWeight.W500, fontSize = 16.sp, - color = Color.Black + color = Black1Color ) Spacer(Modifier.height(44.dp)) @@ -235,7 +239,7 @@ fun ProjectCard( ) { Text( text = date, - color = Color(0xFF939396), + color = CaptionColor, fontWeight = FontWeight.W600, fontSize = 14.sp ) diff --git a/libary/src/main/java/com/example/libary/Header.kt b/libary/src/main/java/com/example/libary/Header.kt index 5e05e55..39bd39e 100644 --- a/libary/src/main/java/com/example/libary/Header.kt +++ b/libary/src/main/java/com/example/libary/Header.kt @@ -26,6 +26,8 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.example.libary.HeaderState.* +import com.example.libary.theme.Black1Color +import com.example.libary.theme.InputBGColor enum class HeaderState { Big, @@ -69,7 +71,7 @@ fun Header( Text( text = title, - color = Color.Black, + color = Black1Color, fontWeight = FontWeight.W800, fontSize = 24.sp ) @@ -90,7 +92,7 @@ fun Header( Text( text = title, - color = Color.Black, + color = Black1Color, fontWeight = FontWeight.W600, fontSize = 20.sp ) @@ -116,7 +118,7 @@ fun HeaderBt( Box( modifier = modifier .size(32.dp) - .background(Color(0xFFF5F5F9), AbsoluteRoundedCornerShape(8.dp)) + .background(InputBGColor, AbsoluteRoundedCornerShape(8.dp)) .clip(AbsoluteRoundedCornerShape(8.dp)), contentAlignment = Alignment.Center ) { diff --git a/libary/src/main/java/com/example/libary/Input.kt b/libary/src/main/java/com/example/libary/Input.kt index d7b29e8..92f1961 100644 --- a/libary/src/main/java/com/example/libary/Input.kt +++ b/libary/src/main/java/com/example/libary/Input.kt @@ -24,6 +24,11 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.example.libary.theme.AccentColor +import com.example.libary.theme.BlackColor +import com.example.libary.theme.CaptionColor +import com.example.libary.theme.Error1Color +import com.example.libary.theme.InputBGColor +import com.example.libary.theme.InputStroke @Composable fun Input( @@ -56,7 +61,7 @@ fun Input( placeholder = { Text( text = placeholder, - color = Color(0xFF939396), + color = CaptionColor, fontWeight = FontWeight.W400, fontSize = 16.sp ) @@ -85,17 +90,17 @@ fun Input( shape = AbsoluteRoundedCornerShape(10.dp), colors = TextFieldDefaults.colors( cursorColor = AccentColor, - focusedPlaceholderColor = Color(0xFF939396), - unfocusedPlaceholderColor = Color(0xFF939396), + focusedPlaceholderColor = CaptionColor, + unfocusedPlaceholderColor = CaptionColor, - focusedTextColor = Color.Black, - unfocusedTextColor = Color.Black, + focusedTextColor = BlackColor, + unfocusedTextColor = BlackColor, - focusedIndicatorColor = if (errorText.isNotEmpty()) Color(0xFFFD3535) else Color(0xFFEBEBEB), - unfocusedIndicatorColor = if (errorText.isNotEmpty()) Color(0xFFFD3535) else Color(0xFFEBEBEB), + focusedIndicatorColor = if (errorText.isNotEmpty()) Error1Color else InputStroke, + unfocusedIndicatorColor = if (errorText.isNotEmpty()) Error1Color else InputStroke, - focusedContainerColor = if (errorText.isNotEmpty()) Color(0xFFFD3535).copy(0.1f) else Color(0xFFF5F5F9), - unfocusedContainerColor = if (errorText.isNotEmpty()) Color(0xFFFD3535).copy(0.1f) else Color(0xFFF5F5F9) + focusedContainerColor = if (errorText.isNotEmpty()) Error1Color.copy(0.1f) else InputBGColor, + unfocusedContainerColor = if (errorText.isNotEmpty()) Error1Color.copy(0.1f) else InputBGColor ), visualTransformation = if (!vis && pasMode) PasswordVisualTransformation('*') else VisualTransformation.None ) @@ -105,7 +110,7 @@ fun Input( Text( text = errorText, - color = Color(0xFFFD3535), + color = Error1Color, fontSize = 14.sp, fontWeight = FontWeight.W400 ) diff --git a/libary/src/main/java/com/example/libary/SearchInput.kt b/libary/src/main/java/com/example/libary/SearchInput.kt index 63ba21c..2615521 100644 --- a/libary/src/main/java/com/example/libary/SearchInput.kt +++ b/libary/src/main/java/com/example/libary/SearchInput.kt @@ -14,13 +14,16 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.focus.onFocusChanged -import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.painterResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.example.libary.theme.AccentColor +import com.example.libary.theme.BlackColor +import com.example.libary.theme.CaptionColor +import com.example.libary.theme.InputBGColor +import com.example.libary.theme.InputStroke @Composable fun SearchInput( @@ -39,7 +42,7 @@ fun SearchInput( placeholder = { Text( text = "Искать описание", - color = Color(0xFF939396), + color = CaptionColor, fontWeight = FontWeight.W400, fontSize = 16.sp ) @@ -61,17 +64,14 @@ fun SearchInput( shape = AbsoluteRoundedCornerShape(10.dp), colors = TextFieldDefaults.colors( cursorColor = AccentColor, - focusedPlaceholderColor = Color(0xFF939396), - unfocusedPlaceholderColor = Color(0xFF939396), - - focusedTextColor = Color.Black, - unfocusedTextColor = Color.Black, - - focusedIndicatorColor = Color(0xFFEBEBEB), - unfocusedIndicatorColor = Color(0xFFEBEBEB), - - focusedContainerColor = Color(0xFFF5F5F9), - unfocusedContainerColor = Color(0xFFF5F5F9) + focusedPlaceholderColor = CaptionColor, + unfocusedPlaceholderColor = CaptionColor, + focusedTextColor = BlackColor, + unfocusedTextColor = BlackColor, + focusedIndicatorColor = InputStroke, + unfocusedIndicatorColor = InputStroke, + focusedContainerColor = InputBGColor, + unfocusedContainerColor = InputBGColor ) ) } diff --git a/libary/src/main/java/com/example/libary/Select.kt b/libary/src/main/java/com/example/libary/Select.kt index 9e1d180..08e332b 100644 --- a/libary/src/main/java/com/example/libary/Select.kt +++ b/libary/src/main/java/com/example/libary/Select.kt @@ -17,12 +17,15 @@ import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.painterResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp +import com.example.libary.theme.BlackColor +import com.example.libary.theme.CaptionColor +import com.example.libary.theme.InputBGColor +import com.example.libary.theme.InputStroke @Composable fun Select( @@ -43,18 +46,18 @@ fun Select( text = placeholder, fontWeight = FontWeight.W400, fontSize = 16.sp, - color = Color(0xFF939396) + color = CaptionColor ) }, colors = TextFieldDefaults.colors( - focusedPlaceholderColor = Color(0xFF939396), - unfocusedPlaceholderColor = Color(0xFF939396), - focusedTextColor = Color.Black, - unfocusedTextColor = Color.Black, - focusedIndicatorColor = Color(0xFFEBEBEB), - unfocusedIndicatorColor = Color(0xFFEBEBEB), - focusedContainerColor = Color(0xFFF5F5F9), - unfocusedContainerColor = Color(0xFFF5F5F9) + focusedPlaceholderColor = CaptionColor, + unfocusedPlaceholderColor = CaptionColor, + focusedTextColor = BlackColor, + unfocusedTextColor = BlackColor, + focusedIndicatorColor = InputStroke, + unfocusedIndicatorColor = InputStroke, + focusedContainerColor = InputBGColor, + unfocusedContainerColor = InputBGColor ), trailingIcon = { Image( diff --git a/libary/src/main/java/com/example/libary/Tabbar.kt b/libary/src/main/java/com/example/libary/Tabbar.kt index 2d10591..7b739e9 100644 --- a/libary/src/main/java/com/example/libary/Tabbar.kt +++ b/libary/src/main/java/com/example/libary/Tabbar.kt @@ -25,7 +25,9 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.example.libary.theme.AccentColor +import com.example.libary.theme.IconsColor import com.example.libary.theme.InputIconColor +import com.example.libary.theme.TabBarShad data class TabBarData( val icon: Int, @@ -59,9 +61,9 @@ fun TabBar( ) { Column( modifier = modifier - .shadow(10.dp, spotColor = Color(0x4DA0A0A0), ambientColor = Color(0x4DA0A0A0)) + .shadow(10.dp, spotColor = TabBarShad, ambientColor = TabBarShad) ) { - HorizontalDivider(thickness = 1.dp, color = Color(0x4DA0A0A0)) + HorizontalDivider(thickness = 1.dp, color = TabBarShad) NavigationBar( containerColor = Color.White @@ -76,13 +78,13 @@ fun TabBar( Icon( painter = painterResource(it.icon), contentDescription = null, - tint = if (value.value == it) AccentColor else Color(0xFFB8C1CC) + tint = if (value.value == it) AccentColor else IconsColor ) }, label = { Text( text = it.name, - color = if (value.value == it) AccentColor else Color(0xFFB8C1CC), + color = if (value.value == it) AccentColor else IconsColor, fontWeight = FontWeight.W400, fontSize = 12.sp ) diff --git a/libary/src/main/java/com/example/libary/theme/Color.kt b/libary/src/main/java/com/example/libary/theme/Color.kt index 3d5069a..50a53e5 100644 --- a/libary/src/main/java/com/example/libary/theme/Color.kt +++ b/libary/src/main/java/com/example/libary/theme/Color.kt @@ -22,4 +22,17 @@ val InputIconColor = Color(0xFFBFC7D1) val PlaceholderColor = Color(0xFF98989A) val DescriptionColor = Color(0xFF8787A1) val CardStrokeColor = Color(0xFFF2F2F2) -val DividerColor = Color(0xFFF4F4F4) \ No newline at end of file +val DividerColor = Color(0xFFF4F4F4) + +val CartShadowColor = Color(0x99E4E8F5) +val CaptionColor = Color(0xFF939396) +val InputBGColor = Color(0xFFF5F5F9) +val AccentInactive = Color(0xFFC9D4FB) +val Desc = Color(0xFF7E7E9A) +val InputStroke = Color(0xFFEBEBEB) +val IconsColor = Color(0xFFB8C1CC) +val TabBarShad = Color(0x4DA0A0A0) +val Error1Color = Color(0xFFFD3535) + +val White1Color = Color.White +val Black1Color = Color.Black \ No newline at end of file