Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ds/scrim on bottom sheets #2297

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ data class ColorScheme(
val highlightPurpleFill1: Color,
val highlightPurpleFill2: Color,
val highlightPurpleFill3: Color,
val scrim: Color,
val transparent: Color,
)

Expand Down Expand Up @@ -219,6 +220,7 @@ internal val lightColorScheme: ColorScheme = ColorScheme(
highlightPurpleFill1 = ColorLightTokens.HighlightPurpleFill1,
highlightPurpleFill2 = ColorLightTokens.HighlightPurpleFill2,
highlightPurpleFill3 = ColorLightTokens.HighlightPurpleFill3,
scrim = ColorLightTokens.Scrim,
transparent = ColorLightTokens.Transparent,
)

Expand Down Expand Up @@ -324,6 +326,7 @@ internal val darkColorScheme: ColorScheme = ColorScheme(
highlightRedFill1 = ColorDarkTokens.HighlightRedFill1,
highlightRedFill2 = ColorDarkTokens.HighlightRedFill2,
highlightRedFill3 = ColorDarkTokens.HighlightRedFill3,
scrim = ColorDarkTokens.Scrim,
transparent = ColorDarkTokens.Transparent,
)

Expand Down Expand Up @@ -455,6 +458,7 @@ internal fun ColorScheme.fromToken(value: ColorSchemeKeyTokens): Color {
ColorSchemeKeyTokens.HighlightPurpleFill1 -> highlightPurpleFill1
ColorSchemeKeyTokens.HighlightPurpleFill2 -> highlightPurpleFill2
ColorSchemeKeyTokens.HighlightPurpleFill3 -> highlightPurpleFill3
ColorSchemeKeyTokens.Scrim -> scrim
ColorSchemeKeyTokens.Transparent -> transparent
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import com.hedvig.android.design.system.hedvig.ButtonDefaults.ButtonStyle.Ghost
import com.hedvig.android.design.system.hedvig.icon.ArrowDown
import com.hedvig.android.design.system.hedvig.icon.HedvigIcons
import com.hedvig.android.design.system.hedvig.tokens.BottomSheetTokens
import com.hedvig.android.design.system.hedvig.tokens.ScrimTokens
import eu.wewox.modalsheet.ExperimentalSheetApi
import eu.wewox.modalsheet.ModalSheet

Expand Down Expand Up @@ -272,7 +273,7 @@ internal val bottomSheetColors: BottomSheetColors
get() = with(HedvigTheme.colorScheme) {
remember(this) {
BottomSheetColors(
scrimColor = fromToken(BottomSheetTokens.ScrimColor),
scrimColor = fromToken(ScrimTokens.ContainerColor).copy(ScrimTokens.ContainerOpacity),
bottomSheetBackgroundColor = fromToken(BottomSheetTokens.BottomSheetBackgroundColor),
contentColor = fromToken(BottomSheetTokens.ContentColor),
chipColor = fromToken(BottomSheetTokens.UpperChipColor),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.hedvig.android.design.system.hedvig.tokens
import androidx.compose.ui.unit.dp

internal object BottomSheetTokens {
val ScrimColor = ColorSchemeKeyTokens.SurfacePrimary
val UpperChipColor = ColorSchemeKeyTokens.SurfaceSecondary
val ArrowColor = ColorSchemeKeyTokens.FillNegative
val ArrowColorBackground = ColorSchemeKeyTokens.FillPrimary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,6 @@ internal object ColorDarkTokens {
val HighlightPurpleFill1: Color = PaletteTokens.Purple200
val HighlightPurpleFill2: Color = PaletteTokens.Purple300
val HighlightPurpleFill3: Color = PaletteTokens.Purple500
val Scrim: Color = PaletteTokens.G100
val Transparent: Color = PaletteTokens.Transparent
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,6 @@ internal object ColorLightTokens {
val HighlightPurpleFill1: Color = PaletteTokens.Purple100
val HighlightPurpleFill2: Color = PaletteTokens.Purple200
val HighlightPurpleFill3: Color = PaletteTokens.Purple300
val Scrim: Color = PaletteTokens.Neutral
val Transparent: Color = PaletteTokens.Transparent
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,6 @@ internal enum class ColorSchemeKeyTokens {
HighlightPurpleFill1,
HighlightPurpleFill2,
HighlightPurpleFill3,
Scrim,
Transparent,
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,6 @@ internal object PaletteTokens {
val Purple800 = Color(0xFF54446A)
val Purple900 = Color(0xFF3D2D53)

val Neutral = Color(0xFF000000)
val Transparent = Color.Transparent
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.hedvig.android.design.system.hedvig.tokens

internal object ScrimTokens {
val ContainerColor = ColorSchemeKeyTokens.Scrim
const val ContainerOpacity = 0.32f
}
Loading