diff --git a/Prezel/app/build.gradle.kts b/Prezel/app/build.gradle.kts index ef75ab70..f16b7d0c 100644 --- a/Prezel/app/build.gradle.kts +++ b/Prezel/app/build.gradle.kts @@ -13,6 +13,7 @@ android { dependencies { implementation(projects.core.data) + implementation(projects.core.designsystem) implementation(libs.androidx.activity.ktx) implementation(libs.androidx.core.ktx) diff --git a/Prezel/app/src/main/java/com/team/prezel/MainActivity.kt b/Prezel/app/src/main/java/com/team/prezel/MainActivity.kt index 0d485ffb..1958c148 100644 --- a/Prezel/app/src/main/java/com/team/prezel/MainActivity.kt +++ b/Prezel/app/src/main/java/com/team/prezel/MainActivity.kt @@ -11,7 +11,7 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview -import com.team.prezel.ui.theme.PrezelTheme +import com.team.prezel.core.designsystem.theme.PrezelTheme class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { diff --git a/Prezel/app/src/main/java/com/team/prezel/ui/theme/Color.kt b/Prezel/app/src/main/java/com/team/prezel/ui/theme/Color.kt deleted file mode 100644 index 08cd935d..00000000 --- a/Prezel/app/src/main/java/com/team/prezel/ui/theme/Color.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.team.prezel.ui.theme - -import androidx.compose.ui.graphics.Color - -val Purple80 = Color(0xFFD0BCFF) -val PurpleGrey80 = Color(0xFFCCC2DC) -val Pink80 = Color(0xFFEFB8C8) - -val Purple40 = Color(0xFF6650a4) -val PurpleGrey40 = Color(0xFF625b71) -val Pink40 = Color(0xFF7D5260) diff --git a/Prezel/app/src/main/java/com/team/prezel/ui/theme/Theme.kt b/Prezel/app/src/main/java/com/team/prezel/ui/theme/Theme.kt deleted file mode 100644 index 8a044460..00000000 --- a/Prezel/app/src/main/java/com/team/prezel/ui/theme/Theme.kt +++ /dev/null @@ -1,56 +0,0 @@ -package com.team.prezel.ui.theme - -import android.os.Build -import androidx.compose.foundation.isSystemInDarkTheme -import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.darkColorScheme -import androidx.compose.material3.dynamicDarkColorScheme -import androidx.compose.material3.dynamicLightColorScheme -import androidx.compose.material3.lightColorScheme -import androidx.compose.runtime.Composable -import androidx.compose.ui.platform.LocalContext - -private val DarkColorScheme = darkColorScheme( - primary = Purple80, - secondary = PurpleGrey80, - tertiary = Pink80, -) - -private val LightColorScheme = lightColorScheme( - primary = Purple40, - secondary = PurpleGrey40, - tertiary = Pink40, - /* Other default colors to override - background = Color(0xFFFFFBFE), - surface = Color(0xFFFFFBFE), - onPrimary = Color.White, - onSecondary = Color.White, - onTertiary = Color.White, - onBackground = Color(0xFF1C1B1F), - onSurface = Color(0xFF1C1B1F), - */ -) - -@Composable -fun PrezelTheme( - darkTheme: Boolean = isSystemInDarkTheme(), - // Dynamic color is available on Android 12+ - dynamicColor: Boolean = true, - content: @Composable () -> Unit, -) { - val colorScheme = when { - dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> { - val context = LocalContext.current - if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context) - } - - darkTheme -> DarkColorScheme - else -> LightColorScheme - } - - MaterialTheme( - colorScheme = colorScheme, - typography = Typography, - content = content, - ) -} diff --git a/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/plugin/AndroidFeatureImplConventionPlugin.kt b/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/plugin/AndroidFeatureImplConventionPlugin.kt index 0f981deb..53fb3bde 100644 --- a/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/plugin/AndroidFeatureImplConventionPlugin.kt +++ b/Prezel/build-logic/convention/src/main/java/com/team/prezel/buildlogic/convention/plugin/AndroidFeatureImplConventionPlugin.kt @@ -20,7 +20,7 @@ class AndroidFeatureImplConventionPlugin : Plugin { dependencies { // "implementation"(project(":core:ui")) -// "implementation"(project(":core:designsystem")) + "implementation"(project(":core:designsystem")) "implementation"(libs.findLibrary("androidx.lifecycle.runtimeCompose").get()) "implementation"(libs.findLibrary("androidx.lifecycle.viewModelCompose").get()) diff --git a/Prezel/core/designsystem/.gitignore b/Prezel/core/designsystem/.gitignore new file mode 100644 index 00000000..42afabfd --- /dev/null +++ b/Prezel/core/designsystem/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/Prezel/core/designsystem/build.gradle.kts b/Prezel/core/designsystem/build.gradle.kts new file mode 100644 index 00000000..41ad2425 --- /dev/null +++ b/Prezel/core/designsystem/build.gradle.kts @@ -0,0 +1,11 @@ +plugins { + alias(libs.plugins.prezel.android.library.compose) +} + +android { + namespace = "com.team.prezel.core.designsystem" +} + +dependencies { + implementation(libs.kotlinx.collections.immutable) +} diff --git a/Prezel/core/designsystem/src/androidTest/java/com/team/prezel/core/designsystem/.gitkeep b/Prezel/core/designsystem/src/androidTest/java/com/team/prezel/core/designsystem/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/foundation/color/ColorTokens.kt b/Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/foundation/color/ColorTokens.kt new file mode 100644 index 00000000..5f7dd572 --- /dev/null +++ b/Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/foundation/color/ColorTokens.kt @@ -0,0 +1,86 @@ +package com.team.prezel.core.designsystem.foundation.color + +import androidx.compose.ui.graphics.Color + +internal object ColorTokens { + val Common0 = Color(0xFFFFFFFF) + val Common1000 = Color(0xFF000205) + + val CoolGray10 = Color(0xFFFAFBFC) + val CoolGray50 = Color(0xFFEBEDF0) + val CoolGray100 = Color(0xFFDCDFE3) + val CoolGray200 = Color(0xFFC6C9CF) + val CoolGray300 = Color(0xFFAFB3BA) + val CoolGray400 = Color(0xFF989DA6) + val CoolGray500 = Color(0xFF838891) + val CoolGray600 = Color(0xFF6E737D) + val CoolGray700 = Color(0xFF5A5F69) + val CoolGray800 = Color(0xFF474C54) + val CoolGray900 = Color(0xFF2F3238) + val CoolGray950 = Color(0xFF232529) + + val Blue10 = Color(0xFFE5F4FF) + val Blue50 = Color(0xFFC2E1FF) + val Blue100 = Color(0xFFA3D0FF) + val Blue200 = Color(0xFF85BCFF) + val Blue300 = Color(0xFF66A6FF) + val Blue400 = Color(0xFF478EFF) + val Blue500 = Color(0xFF2974FF) + val Blue600 = Color(0xFF1855D9) + val Blue700 = Color(0xFF0C3CB2) + val Blue800 = Color(0xFF04268C) + val Blue900 = Color(0xFF001666) + val Blue950 = Color(0xFF000C40) + + val Coral10 = Color(0xFFFFF0F0) + val Coral50 = Color(0xFFFFC7C7) + val Coral100 = Color(0xFFFFA3A3) + val Coral200 = Color(0xFFFF8084) + val Coral300 = Color(0xFFFF5C67) + val Coral400 = Color(0xFFFF384C) + val Coral500 = Color(0xFFFF1A38) + val Coral600 = Color(0xFFD90D28) + val Coral700 = Color(0xFFB20528) + val Coral800 = Color(0xFF8C001C) + val Coral900 = Color(0xFF660018) + val Coral950 = Color(0xFF400011) + + val Orange10 = Color(0xFFFEF6EA) + val Orange50 = Color(0xFFFEE4C1) + val Orange100 = Color(0xFFFFD29E) + val Orange200 = Color(0xFFFFBD7A) + val Orange300 = Color(0xFFFFA557) + val Orange400 = Color(0xFFFF8B33) + val Orange500 = Color(0xFFFF700F) + val Orange600 = Color(0xFFD95509) + val Orange700 = Color(0xFFB23F05) + val Orange800 = Color(0xFF8C2C03) + val Orange900 = Color(0xFF661B00) + val Orange950 = Color(0xFF400F00) + + val Purple10 = Color(0xFFFCF0FF) + val Purple50 = Color(0xFFF2CCFF) + val Purple100 = Color(0xFFE6A8FF) + val Purple200 = Color(0xFFD987FF) + val Purple300 = Color(0xFFC966FF) + val Purple400 = Color(0xFFB845FF) + val Purple500 = Color(0xFFA324FF) + val Purple600 = Color(0xFF9717FF) + val Purple700 = Color(0xFF6109B3) + val Purple800 = Color(0xFF45018C) + val Purple900 = Color(0xFF2E0066) + val Purple950 = Color(0xFF1B0040) + + val Magenta10 = Color(0xFFFFF0F5) + val Magenta50 = Color(0xFFFFC7DB) + val Magenta100 = Color(0xFFFF9EC5) + val Magenta200 = Color(0xFFFF7AB4) + val Magenta300 = Color(0xFFFF57A5) + val Magenta400 = Color(0xFFFF57A5) + val Magenta500 = Color(0xFFFF1091) + val Magenta600 = Color(0xFFD90681) + val Magenta700 = Color(0xFFB2006B) + val Magenta800 = Color(0xFF8B0058) + val Magenta900 = Color(0xFF660044) + val Magenta950 = Color(0xFF40002D) +} diff --git a/Prezel/app/src/main/java/com/team/prezel/ui/theme/Type.kt b/Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/foundation/typography/TypeTokens.kt similarity index 93% rename from Prezel/app/src/main/java/com/team/prezel/ui/theme/Type.kt rename to Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/foundation/typography/TypeTokens.kt index af2fba1e..6bad6594 100644 --- a/Prezel/app/src/main/java/com/team/prezel/ui/theme/Type.kt +++ b/Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/foundation/typography/TypeTokens.kt @@ -1,4 +1,4 @@ -package com.team.prezel.ui.theme +package com.team.prezel.core.designsystem.foundation.typography import androidx.compose.material3.Typography import androidx.compose.ui.text.TextStyle diff --git a/Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/preview/ThemePreview.kt b/Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/preview/ThemePreview.kt new file mode 100644 index 00000000..f1e87aa1 --- /dev/null +++ b/Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/preview/ThemePreview.kt @@ -0,0 +1,16 @@ +package com.team.prezel.core.designsystem.preview + +import android.content.res.Configuration +import androidx.compose.ui.tooling.preview.Preview + +@Preview( + name = "LightTheme", + showBackground = true, + uiMode = Configuration.UI_MODE_NIGHT_NO, +) +@Preview( + name = "DarkTheme", + showBackground = true, + uiMode = Configuration.UI_MODE_NIGHT_YES, +) +annotation class ThemePreview diff --git a/Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/theme/PrezelColorScheme.kt b/Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/theme/PrezelColorScheme.kt new file mode 100644 index 00000000..e918ce90 --- /dev/null +++ b/Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/theme/PrezelColorScheme.kt @@ -0,0 +1,289 @@ +package com.team.prezel.core.designsystem.theme + +import androidx.compose.foundation.background +import androidx.compose.foundation.border +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.foundation.verticalScroll +import androidx.compose.material3.HorizontalDivider +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.toArgb +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import com.team.prezel.core.designsystem.foundation.color.ColorTokens +import com.team.prezel.core.designsystem.preview.ThemePreview +import kotlinx.collections.immutable.ImmutableList +import kotlinx.collections.immutable.persistentListOf +import java.util.Locale + +internal object PrezelColorScheme { + val Light = PrezelColors( + interactiveXSmall = ColorTokens.Blue10, + interactiveSmall = ColorTokens.Blue100, + interactiveRegular = ColorTokens.Blue500, + bgRegular = ColorTokens.Common0, + bgMedium = ColorTokens.CoolGray10, + bgLarge = ColorTokens.CoolGray50, + bgScrim = ColorTokens.Common1000.copy(alpha = 0.32f), + bgDisabled = ColorTokens.CoolGray100, + textSmall = ColorTokens.CoolGray300, + textRegular = ColorTokens.CoolGray500, + textMedium = ColorTokens.CoolGray700, + textLarge = ColorTokens.CoolGray950, + textDisabled = ColorTokens.CoolGray200, + iconRegular = ColorTokens.CoolGray600, + iconMedium = ColorTokens.CoolGray800, + iconDisabled = ColorTokens.CoolGray300, + borderSmall = ColorTokens.CoolGray500, + borderRegular = ColorTokens.CoolGray100, + borderMedium = ColorTokens.CoolGray200, + borderLarge = ColorTokens.CoolGray500, + borderDisabled = ColorTokens.CoolGray300, + feedbackGoodSmall = ColorTokens.Blue10, + feedbackGoodRegular = ColorTokens.Blue500, + feedbackBadSmall = ColorTokens.Coral10, + feedbackBadRegular = ColorTokens.Coral500, + feedbackWarningSmall = ColorTokens.Orange10, + feedbackWarningRegular = ColorTokens.Orange500, + accentPurpleSmall = ColorTokens.Purple10, + accentPurpleRegular = ColorTokens.Purple500, + accentMagentaSmall = ColorTokens.Magenta10, + accentMagentaRegular = ColorTokens.Magenta500, + solidWhite = ColorTokens.Common0, + solidBlack = ColorTokens.Common1000, + ) + + val Dark = PrezelColors( + interactiveXSmall = ColorTokens.Blue10, + interactiveSmall = ColorTokens.Blue100, + interactiveRegular = ColorTokens.Blue500, + bgRegular = ColorTokens.CoolGray950, + bgMedium = ColorTokens.CoolGray900, + bgLarge = ColorTokens.CoolGray800, + bgScrim = ColorTokens.Common1000.copy(alpha = 0.32f), + bgDisabled = ColorTokens.CoolGray700, + textSmall = ColorTokens.CoolGray600, + textRegular = ColorTokens.CoolGray400, + textMedium = ColorTokens.CoolGray200, + textLarge = ColorTokens.CoolGray10, + textDisabled = ColorTokens.CoolGray700, + iconRegular = ColorTokens.CoolGray400, + iconMedium = ColorTokens.CoolGray500, + iconDisabled = ColorTokens.CoolGray600, + borderSmall = ColorTokens.CoolGray900, + borderRegular = ColorTokens.CoolGray800, + borderMedium = ColorTokens.CoolGray700, + borderLarge = ColorTokens.CoolGray400, + borderDisabled = ColorTokens.CoolGray600, + feedbackGoodSmall = ColorTokens.Blue10, + feedbackGoodRegular = ColorTokens.Blue500, + feedbackBadSmall = ColorTokens.Coral10, + feedbackBadRegular = ColorTokens.Coral600, + feedbackWarningSmall = ColorTokens.Orange10, + feedbackWarningRegular = ColorTokens.Orange500, + accentPurpleSmall = ColorTokens.Purple10, + accentPurpleRegular = ColorTokens.Purple500, + accentMagentaSmall = ColorTokens.Magenta10, + accentMagentaRegular = ColorTokens.Magenta500, + solidWhite = ColorTokens.Common0, + solidBlack = ColorTokens.Common1000, + ) +} + +@ThemePreview +@Composable +private fun PrezelColorSchemePreview() { + PrezelTheme { + PrezelColorsPreview() + } +} + +@Composable +@Suppress("LongMethod") +private fun PrezelColorsPreview(colors: PrezelColors = PrezelTheme.colors) { + Column( + modifier = Modifier + .fillMaxSize() + .background(colors.bgRegular) + .verticalScroll(rememberScrollState()) + .padding(16.dp), + verticalArrangement = Arrangement.spacedBy(24.dp), + ) { + ColorSection( + title = "Interactive", + description = "브랜드 색으로 활성화 상태 및 강조가 필요한 요소에 사용하는 색상입니다.", + items = persistentListOf( + "XSmall" to colors.interactiveXSmall, + "Small" to colors.interactiveSmall, + "Regular" to colors.interactiveRegular, + ), + dividerColor = colors.borderRegular, + textColor = colors.textLarge, + ) + + ColorSection( + title = "Background", + description = "콘텐츠의 구조와 계층을 구분하는 색상입니다.", + items = persistentListOf( + "Regular" to colors.bgRegular, + "Medium" to colors.bgMedium, + "Large" to colors.bgLarge, + "Scrim" to colors.bgScrim, + "Disabled" to colors.bgDisabled, + ), + dividerColor = colors.borderRegular, + textColor = colors.textLarge, + ) + + ColorSection( + title = "Text", + description = "정보와 콘텐츠를 명확하게 전달하기 위해 사용하는 색상입니다.", + items = persistentListOf( + "Small" to colors.textSmall, + "Regular" to colors.textRegular, + "Medium" to colors.textMedium, + "Large" to colors.textLarge, + "Disabled" to colors.textDisabled, + ), + dividerColor = colors.borderRegular, + textColor = colors.textLarge, + ) + + ColorSection( + title = "Icon", + description = "기능적 액션과 시각적 커뮤니케이션을 돕기 위해 사용하는 색상입니다.", + items = persistentListOf( + "Regular" to colors.iconRegular, + "Medium" to colors.iconMedium, + "Disabled" to colors.iconDisabled, + ), + dividerColor = colors.borderRegular, + textColor = colors.textLarge, + ) + + ColorSection( + title = "Border", + description = "콘텐츠의 영역과 구조를 구분하는 색상입니다.", + items = persistentListOf( + "Small" to colors.borderSmall, + "Regular" to colors.borderRegular, + "Medium" to colors.borderMedium, + "Large" to colors.borderLarge, + "Disabled" to colors.borderDisabled, + ), + dividerColor = colors.borderRegular, + textColor = colors.textLarge, + ) + + ColorSection( + title = "Feedback", + description = "성공, 오류, 경고 상황을 명확하게 전달하기 위해 의미별로 정의된 색상입니다.", + items = persistentListOf( + "GoodSmall" to colors.feedbackGoodSmall, + "GoodRegular" to colors.feedbackGoodRegular, + "BadSmall" to colors.feedbackBadSmall, + "BadRegular" to colors.feedbackBadRegular, + "WarningSmall" to colors.feedbackWarningSmall, + "WarningRegular" to colors.feedbackWarningRegular, + ), + dividerColor = colors.borderRegular, + textColor = colors.textLarge, + ) + + ColorSection( + title = "Accent", + description = "콘텐츠의 주목성과 인지도를 높이기 위해 버튼, 액션, 강조 요소 등에 사용되는 포인트 색상입니다.", + items = persistentListOf( + "PurpleSmall" to colors.accentPurpleSmall, + "PurpleRegular" to colors.accentPurpleRegular, + "MagentaSmall" to colors.accentMagentaSmall, + "MagentaRegular" to colors.accentMagentaRegular, + ), + dividerColor = colors.borderRegular, + textColor = colors.textLarge, + ) + + ColorSection( + title = "Solid", + description = "흰색과 검정색을 제공하여 시각적 대비, 보조, 구분 등에 활용되는 절대값 색상입니다.", + items = persistentListOf( + "White" to colors.solidWhite, + "Black" to colors.solidBlack, + ), + dividerColor = colors.borderRegular, + textColor = colors.textLarge, + ) + } +} + +@Composable +private fun ColorSection( + title: String, + description: String, + items: ImmutableList>, + dividerColor: Color, + textColor: Color, +) { + Column( + modifier = Modifier.fillMaxWidth(), + verticalArrangement = Arrangement.spacedBy(10.dp), + ) { + HorizontalDivider(color = dividerColor) + + Text(text = title, color = textColor, fontSize = 20.sp, fontWeight = FontWeight.Bold) + + Text(text = description, color = textColor.copy(alpha = 0.7f)) + + HorizontalDivider(color = dividerColor) + + items.forEach { (name, color) -> + ColorRow(color = color, name = name, textColor = textColor) + } + } +} + +@Composable +private fun ColorRow( + color: Color, + name: String, + textColor: Color, +) { + Row( + modifier = Modifier.fillMaxWidth(), + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.spacedBy(12.dp), + ) { + Box( + modifier = Modifier + .size(32.dp) + .clip(RoundedCornerShape(8.dp)) + .border(0.3.dp, PrezelTheme.colors.solidBlack, RoundedCornerShape(8.dp)) + .background(color), + ) + + Text( + text = name, + color = textColor, + modifier = Modifier.weight(1f), + ) + + Text( + text = String.format(Locale.ROOT, "#%08X", color.toArgb()), + color = textColor.copy(alpha = 0.7f), + ) + } +} diff --git a/Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/theme/PrezelColors.kt b/Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/theme/PrezelColors.kt new file mode 100644 index 00000000..aca9e9a4 --- /dev/null +++ b/Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/theme/PrezelColors.kt @@ -0,0 +1,57 @@ +package com.team.prezel.core.designsystem.theme + +import androidx.compose.runtime.Immutable +import androidx.compose.ui.graphics.Color + +@Immutable +data class PrezelColors( + // Interactive + // 브랜드 색으로 활성화 상태 및 강조가 필요한 요소에 사용하는 색상입니다. + val interactiveXSmall: Color, + val interactiveSmall: Color, + val interactiveRegular: Color, + // Background + // 콘텐츠의 구조와 계층을 구분하는 색상입니다. + val bgRegular: Color, + val bgMedium: Color, + val bgLarge: Color, + val bgScrim: Color, + val bgDisabled: Color, + // Text + // 정보와 콘텐츠를 명확하게 전달하기 위해 사용하는 색상입니다. + val textSmall: Color, + val textRegular: Color, + val textMedium: Color, + val textLarge: Color, + val textDisabled: Color, + // Icon + // 기능적 액션과 시각적 커뮤니케이션을 돕기 위해 사용하는 색상입니다. + val iconRegular: Color, + val iconMedium: Color, + val iconDisabled: Color, + // Border + // 콘텐츠의 영역과 구조를 구분하는 색상입니다. + val borderSmall: Color, + val borderRegular: Color, + val borderMedium: Color, + val borderLarge: Color, + val borderDisabled: Color, + // Feedback + // 성공, 오류, 경고 상황을 명확하게 전달하기 위해 의미별로 정의된 색상입니다. + val feedbackGoodSmall: Color, + val feedbackGoodRegular: Color, + val feedbackBadSmall: Color, + val feedbackBadRegular: Color, + val feedbackWarningSmall: Color, + val feedbackWarningRegular: Color, + // Accent + // 콘텐츠의 주목성과 인지도를 높이기 위해 버튼, 액션, 강조 요소 등에 사용되는 포인트 색상입니다. + val accentPurpleSmall: Color, + val accentPurpleRegular: Color, + val accentMagentaSmall: Color, + val accentMagentaRegular: Color, + // Solid + // 흰색과 검정색을 제공하여 시각적 대비, 보조, 구분 등에 활용되는 절대값 색상입니다. + val solidWhite: Color, + val solidBlack: Color, +) diff --git a/Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/theme/PrezelTheme.kt b/Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/theme/PrezelTheme.kt new file mode 100644 index 00000000..68a3a316 --- /dev/null +++ b/Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/theme/PrezelTheme.kt @@ -0,0 +1,29 @@ +package com.team.prezel.core.designsystem.theme + +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.runtime.Composable +import androidx.compose.runtime.CompositionLocalProvider +import androidx.compose.runtime.ReadOnlyComposable +import androidx.compose.runtime.staticCompositionLocalOf + +private val LocalPrezelColors = staticCompositionLocalOf { error("No PrezelColors provided") } + +object PrezelTheme { + val colors: PrezelColors + @Composable + @ReadOnlyComposable + get() = LocalPrezelColors.current +} + +@Composable +fun PrezelTheme( + isDarkTheme: Boolean = isSystemInDarkTheme(), + content: @Composable () -> Unit, +) { + val colorScheme = if (isDarkTheme) PrezelColorScheme.Dark else PrezelColorScheme.Light + + CompositionLocalProvider( + LocalPrezelColors provides colorScheme, + content = content, + ) +} diff --git a/Prezel/core/designsystem/src/test/java/com/team/prezel/core/designsystem/.gitkeep b/Prezel/core/designsystem/src/test/java/com/team/prezel/core/designsystem/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Prezel/detekt-config.yml b/Prezel/detekt-config.yml index c631b0fc..ec6a92e8 100644 --- a/Prezel/detekt-config.yml +++ b/Prezel/detekt-config.yml @@ -19,6 +19,11 @@ style: ReturnCount: active: true max: 3 + UnusedPrivateMember: + active: true + ignoreAnnotated: + - Preview + - ThemePreview WildcardImport: active: true diff --git a/Prezel/gradle/libs.versions.toml b/Prezel/gradle/libs.versions.toml index d779789f..81e69ed1 100644 --- a/Prezel/gradle/libs.versions.toml +++ b/Prezel/gradle/libs.versions.toml @@ -14,8 +14,9 @@ ktlint = "14.0.1" detekt = "1.23.8" ksp = "2.3.4" activityKtx = "1.12.2" -hilt = "2.57.2" -desugarJdk = "2.0.3" +hilt = "2.58" +desugarJdk = "2.1.5" +kotlintxCollectionsImmutable = "0.3.8" ktor = "3.3.3" ktorfit = "2.7.2" kotlinx-serialization = "1.9.0" @@ -45,6 +46,7 @@ hilt-compiler = { group = "com.google.dagger", name = "hilt-compiler", version.r hilt-core = { group = "com.google.dagger", name = "hilt-core", version.ref = "hilt" } kotlin-metadata-jvm = { module = "org.jetbrains.kotlin:kotlin-metadata-jvm", version.ref = "kotlinMetadataJvm" } kotlin-test = { group = "org.jetbrains.kotlin", name = "kotlin-test", version.ref = "kotlin" } +kotlinx-collections-immutable = { module = "org.jetbrains.kotlinx:kotlinx-collections-immutable", version.ref = "kotlintxCollectionsImmutable" } kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "kotlinxCoroutines" } kotlinx-coroutines-android = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-android", version.ref = "kotlinxCoroutines" } kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "kotlinxCoroutines" } diff --git a/Prezel/settings.gradle.kts b/Prezel/settings.gradle.kts index 97683e5d..74841c3d 100644 --- a/Prezel/settings.gradle.kts +++ b/Prezel/settings.gradle.kts @@ -31,5 +31,7 @@ rootProject.name = "Prezel" enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") include(":app") + include(":core:data") include(":core:network") +include(":core:designsystem")