diff --git a/core/src/main/java/com/orange/ouds/core/component/contrastedsurface/OudsContrastedSurface.kt b/core/src/main/java/com/orange/ouds/core/component/coloredsurface/OudsColoredSurface.kt similarity index 84% rename from core/src/main/java/com/orange/ouds/core/component/contrastedsurface/OudsContrastedSurface.kt rename to core/src/main/java/com/orange/ouds/core/component/coloredsurface/OudsColoredSurface.kt index da35d9f3..787b7d0b 100644 --- a/core/src/main/java/com/orange/ouds/core/component/contrastedsurface/OudsContrastedSurface.kt +++ b/core/src/main/java/com/orange/ouds/core/component/coloredsurface/OudsColoredSurface.kt @@ -10,7 +10,7 @@ * Software description: Android library of reusable graphical components */ -package com.orange.ouds.core.component.contrastedsurface +package com.orange.ouds.core.component.coloredsurface import androidx.compose.foundation.isSystemInDarkTheme import androidx.compose.foundation.layout.padding @@ -24,7 +24,7 @@ import androidx.compose.ui.graphics.RectangleShape import androidx.compose.ui.graphics.Shape import androidx.compose.ui.tooling.preview.PreviewParameter import com.orange.ouds.core.component.button.OudsButton -import com.orange.ouds.core.theme.LocalContrastedSurface +import com.orange.ouds.core.theme.LocalColoredSurface import com.orange.ouds.core.theme.value import com.orange.ouds.core.utilities.OudsPreview import com.orange.ouds.foundation.utilities.BasicPreviewParameterProvider @@ -44,13 +44,13 @@ import com.orange.ouds.theme.tokens.OudsSpaceKeyToken * @param content The content of this colored surface. */ @Composable -fun OudsContrastedSurface( +fun OudsColoredSurface( color: OudsColorKeyToken.Surface, modifier: Modifier = Modifier, shape: Shape = RectangleShape, content: @Composable () -> Unit ) { - CompositionLocalProvider(LocalContrastedSurface provides color) { + CompositionLocalProvider(LocalColoredSurface provides color) { Surface( modifier = modifier, shape = shape, @@ -83,13 +83,13 @@ private fun contentColorFor(color: OudsColorKeyToken.Surface): Color { @Suppress("PreviewShouldNotBeCalledRecursively") @UiModePreviews.Default @Composable -private fun PreviewOudsContrastedSurface(@PreviewParameter(OudsContrastedSurfacePreviewParameterProvider::class) parameter: OudsColorKeyToken.Surface) { - PreviewOudsContrastedSurface(darkThemeEnabled = isSystemInDarkTheme(), parameter = parameter) +private fun PreviewOudsColoredSurface(@PreviewParameter(OudsColoredSurfacePreviewParameterProvider::class) parameter: OudsColorKeyToken.Surface) { + PreviewOudsColoredSurface(darkThemeEnabled = isSystemInDarkTheme(), parameter = parameter) } @Composable -internal fun PreviewOudsContrastedSurface(darkThemeEnabled: Boolean, parameter: OudsColorKeyToken.Surface) = OudsPreview(darkThemeEnabled = darkThemeEnabled) { - OudsContrastedSurface(color = parameter) { +internal fun PreviewOudsColoredSurface(darkThemeEnabled: Boolean, parameter: OudsColorKeyToken.Surface) = OudsPreview(darkThemeEnabled = darkThemeEnabled) { + OudsColoredSurface(color = parameter) { Text( modifier = Modifier.padding(all = OudsSpaceKeyToken.Fixed.Medium.value), text = parameter.name.removePrefix("OudsColorKeyToken."), @@ -97,7 +97,7 @@ internal fun PreviewOudsContrastedSurface(darkThemeEnabled: Boolean, parameter: } } -internal class OudsContrastedSurfacePreviewParameterProvider : BasicPreviewParameterProvider(*previewParameterValues.toTypedArray()) +internal class OudsColoredSurfacePreviewParameterProvider : BasicPreviewParameterProvider(*previewParameterValues.toTypedArray()) private val previewParameterValues: List get() = listOf( diff --git a/core/src/main/java/com/orange/ouds/core/theme/OudsTheme.kt b/core/src/main/java/com/orange/ouds/core/theme/OudsTheme.kt index 3c59a974..02e35eed 100644 --- a/core/src/main/java/com/orange/ouds/core/theme/OudsTheme.kt +++ b/core/src/main/java/com/orange/ouds/core/theme/OudsTheme.kt @@ -41,7 +41,7 @@ private val LocalOpacities = staticCompositionLocalOf { missingCo private val LocalSizes = staticCompositionLocalOf { missingCompositionLocalError("LocalSizes") } private val LocalSpaces = staticCompositionLocalOf { missingCompositionLocalError("LocalSpaces") } private val LocalComponentsTokens = staticCompositionLocalOf { missingCompositionLocalError("LocalComponentsTokens") } -internal val LocalContrastedSurface = staticCompositionLocalOf { null } +internal val LocalColoredSurface = staticCompositionLocalOf { null } object OudsTheme { diff --git a/core/src/test/java/com/orange/ouds/core/component/contrastedsurface/OudsContrastedSurfaceTest.kt b/core/src/test/java/com/orange/ouds/core/component/coloredsurface/OudsColoredSurfaceTest.kt similarity index 72% rename from core/src/test/java/com/orange/ouds/core/component/contrastedsurface/OudsContrastedSurfaceTest.kt rename to core/src/test/java/com/orange/ouds/core/component/coloredsurface/OudsColoredSurfaceTest.kt index 5d234a83..c6583aaf 100644 --- a/core/src/test/java/com/orange/ouds/core/component/contrastedsurface/OudsContrastedSurfaceTest.kt +++ b/core/src/test/java/com/orange/ouds/core/component/coloredsurface/OudsColoredSurfaceTest.kt @@ -10,7 +10,7 @@ * Software description: Android library of reusable graphical components */ -package com.orange.ouds.core.component.contrastedsurface +package com.orange.ouds.core.component.coloredsurface import app.cash.paparazzi.Paparazzi import com.android.ide.common.rendering.api.SessionParams @@ -21,21 +21,21 @@ import org.junit.runner.RunWith import org.junit.runners.Parameterized @RunWith(Parameterized::class) -internal class OudsContrastedSurfaceTest(private val parameter: OudsColorKeyToken.Surface) { +internal class OudsColoredSurfaceTest(private val parameter: OudsColorKeyToken.Surface) { companion object { @JvmStatic @Parameterized.Parameters - internal fun data() = OudsContrastedSurfacePreviewParameterProvider().values.toList() + internal fun data() = OudsColoredSurfacePreviewParameterProvider().values.toList() } @get:Rule val paparazzi = Paparazzi(renderingMode = SessionParams.RenderingMode.SHRINK, maxPercentDifference = 0.0) @Test - fun takeOudsContrastedSurfaceLightThemeSnapshot() { + fun takeOudsColoredSurfaceLightThemeSnapshot() { paparazzi.snapshot { - PreviewOudsContrastedSurface( + PreviewOudsColoredSurface( darkThemeEnabled = false, parameter = parameter ) @@ -43,9 +43,9 @@ internal class OudsContrastedSurfaceTest(private val parameter: OudsColorKeyToke } @Test - fun takeOudsContrastedSurfaceDarkThemeSnapshot() { + fun takeOudsColoredSurfaceDarkThemeSnapshot() { paparazzi.snapshot { - PreviewOudsContrastedSurface( + PreviewOudsColoredSurface( darkThemeEnabled = true, parameter = parameter ) diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[0].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[0].png new file mode 100644 index 00000000..add825e2 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[0].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[10].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[10].png new file mode 100644 index 00000000..36f26d9c Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[10].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[11].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[11].png new file mode 100644 index 00000000..c1805b28 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[11].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[12].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[12].png new file mode 100644 index 00000000..321d74c2 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[12].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[1].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[1].png new file mode 100644 index 00000000..dc1b32aa Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[1].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[2].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[2].png new file mode 100644 index 00000000..6238d424 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[2].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[3].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[3].png new file mode 100644 index 00000000..d336fe85 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[3].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[4].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[4].png new file mode 100644 index 00000000..72228dc2 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[4].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[5].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[5].png new file mode 100644 index 00000000..4b36c9c2 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[5].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[6].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[6].png new file mode 100644 index 00000000..478a60a9 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[6].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[7].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[7].png new file mode 100644 index 00000000..a834cf89 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[7].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[8].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[8].png new file mode 100644 index 00000000..51e853ef Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[8].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[9].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[9].png new file mode 100644 index 00000000..a95b3dc1 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceDarkThemeSnapshot[9].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[0].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[0].png new file mode 100644 index 00000000..add825e2 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[0].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[10].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[10].png new file mode 100644 index 00000000..cb6ce09f Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[10].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[11].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[11].png new file mode 100644 index 00000000..e8d79e0a Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[11].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[12].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[12].png new file mode 100644 index 00000000..9a998ba5 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[12].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[1].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[1].png new file mode 100644 index 00000000..a5c46a4b Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[1].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[2].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[2].png new file mode 100644 index 00000000..f6ce4d3a Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[2].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[3].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[3].png new file mode 100644 index 00000000..d370cb61 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[3].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[4].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[4].png new file mode 100644 index 00000000..356b5e21 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[4].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[5].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[5].png new file mode 100644 index 00000000..fe4fb4a2 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[5].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[6].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[6].png new file mode 100644 index 00000000..6e1c452c Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[6].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[7].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[7].png new file mode 100644 index 00000000..7760eda4 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[7].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[8].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[8].png new file mode 100644 index 00000000..b7bd3f61 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[8].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[9].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[9].png new file mode 100644 index 00000000..d6a58447 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.coloredsurface_OudsColoredSurfaceTest_takeOudsColoredSurfaceLightThemeSnapshot[9].png differ