Skip to content

Commit

Permalink
[MERGE] #6 -> develop
Browse files Browse the repository at this point in the history
[ADD/#6] Design System ๊ธฐ์ดˆ์„ธํŒ…
  • Loading branch information
Hyobeen-Park authored Jul 5, 2024
2 parents 16e746f + d6a2076 commit f330dce
Show file tree
Hide file tree
Showing 11 changed files with 507 additions and 104 deletions.
39 changes: 39 additions & 0 deletions core/src/main/java/com/terning/core/designsystem/theme/Color.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.terning.core.designsystem.theme

import androidx.compose.ui.graphics.Color

// Grey Scale
val White = Color(0xFFFFFFFF)
val Grey100 = Color(0xFFF5F5F5)
val Grey150 = Color(0xFFE9E9E9)
val Grey200 = Color(0xFFDDDDDD)
val Grey300 = Color(0xFFBCBCBC)
val Grey350 = Color(0xFFADADAD)
val Grey400 = Color(0xFF666666)
val Grey500 = Color(0xFF373737)
val Black = Color(0xFF171717)

// Main Color
val TerningMain = Color(0xFF1EA65E)

// Calendar Color
val CalRed = Color(0xFFED4E54)

val CalOrange1 = Color(0xFFEE7647)
val CalOrange2 = Color(0xFF5397F3)

val CalYellow = Color(0xFFF5E660)

val CalGreen1 = Color(0xFFC4E953)
val CalGreen2 = Color(0xFF84D558)

val CalBlue1 = Color(0xFF45D0CC)
val CalBlue2 = Color(0xFF4119F2)

val CalPurple = Color(0xFF9B64E2)

val CalPink = Color(0xFFF260AC)

// Other
val WarningRed = Color(0xFFF54645)
val SundayRed = Color(0xFFEB1211)
51 changes: 51 additions & 0 deletions core/src/main/java/com/terning/core/designsystem/theme/Theme.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package com.terning.core.designsystem.theme

import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.lightColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.remember
import androidx.compose.runtime.staticCompositionLocalOf

private val LightColorScheme = lightColorScheme(
primary = TerningMain,
)

private val LocalTerningTypography = staticCompositionLocalOf<TerningTypography> {
error("No TerningTypography provided")
}

object TerningTheme {
val typography: TerningTypography
@Composable
get() = LocalTerningTypography.current
}

@Composable
fun ProvideTerningTypography(typography: TerningTypography, content: @Composable () -> Unit) {
val provideTypography = remember { typography.copy() }
provideTypography.update(typography)
CompositionLocalProvider(
LocalTerningTypography provides provideTypography,
content = content
)
}

@Composable
fun TerningTheme(
darkTheme: Boolean = isSystemInDarkTheme(),
// Dynamic color is available on Android 12+
dynamicColor: Boolean = true,
content: @Composable () -> Unit
) {
val colorScheme = LightColorScheme
val typography = TerningTypography()

ProvideTerningTypography(typography = typography) {
MaterialTheme(
colorScheme = colorScheme,
content = content,
)
}
}
Loading

0 comments on commit f330dce

Please sign in to comment.