diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 10cf1e879..27c253dd8 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -104,6 +104,9 @@ lint-api = { module = "com.android.tools.lint:lint-api", version.ref = "lint" }
lint-checks = { module = "com.android.tools.lint:lint-checks", version.ref = "lint" }
lint-tests = { module = "com.android.tools.lint:lint-tests", version.ref = "lint" }
+# https://github.com/robolectric/robolectric
+robolectric = { module = "org.robolectric:robolectric", version = "4.11.1" }
+
slack-lint-compose = { module = "com.slack.lint.compose:compose-lint-checks", version.ref = "slackLint" }
# https://github.com/google/TestParameterInjector
diff --git a/spark-screenshot-testing/src/main/res/values-fr/strings.xml b/spark-screenshot-testing/src/main/res/values-fr/strings.xml
new file mode 100644
index 000000000..32917cf86
--- /dev/null
+++ b/spark-screenshot-testing/src/main/res/values-fr/strings.xml
@@ -0,0 +1,27 @@
+
+
+
+
+ Tappe moi 👁️🫦👁️
+ Découvre ce formidable language de programation qu’est Kotlin https://kotlinlang.org
+
\ No newline at end of file
diff --git a/spark-screenshot-testing/src/main/res/values/strings.xml b/spark-screenshot-testing/src/main/res/values/strings.xml
index 0cb1e2c7d..6672ab330 100644
--- a/spark-screenshot-testing/src/main/res/values/strings.xml
+++ b/spark-screenshot-testing/src/main/res/values/strings.xml
@@ -22,5 +22,6 @@
SOFTWARE.
-->
+ Tap me 👁️🫦👁️
Learn Kotlin Programming https://kotlinlang.org
\ No newline at end of file
diff --git a/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/PaparazziRule.kt b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/PaparazziRule.kt
new file mode 100644
index 000000000..51d85bfec
--- /dev/null
+++ b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/PaparazziRule.kt
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2023 Adevinta
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+package com.adevinta.spark
+
+import app.cash.paparazzi.DeviceConfig
+import app.cash.paparazzi.Paparazzi
+import app.cash.paparazzi.RenderExtension
+import app.cash.paparazzi.detectEnvironment
+import com.android.ide.common.rendering.api.SessionParams
+import com.android.resources.Density
+import com.android.resources.Keyboard
+import com.android.resources.KeyboardState
+import com.android.resources.Navigation
+import com.android.resources.ScreenOrientation
+import com.android.resources.ScreenRatio
+import com.android.resources.ScreenSize
+import com.android.resources.TouchScreen
+
+fun paparazziRule(
+ renderingMode: SessionParams.RenderingMode = SessionParams.RenderingMode.SHRINK,
+ deviceConfig: DeviceConfig = DefaultTestDevices.Phone,
+ renderExtensions: Set = setOf(),
+) = Paparazzi(
+ environment = patchedEnvironment(),
+ deviceConfig = deviceConfig,
+ renderingMode = renderingMode,
+ renderExtensions = renderExtensions,
+ maxPercentDifference = MaxPercentDifference,
+ theme = PaparazziTheme,
+)
+
+/**
+ * Defaults devices configuration taken from NiA
+ */
+object DefaultTestDevices {
+ /**
+ * Pixel 6 Pro
+ */
+ val Phone = DeviceConfig(
+ screenHeight = 3120,
+ screenWidth = 1440,
+ xdpi = 512,
+ ydpi = 512,
+ orientation = ScreenOrientation.PORTRAIT,
+ density = Density.DPI_560,
+ ratio = ScreenRatio.LONG,
+ size = ScreenSize.NORMAL,
+ keyboard = Keyboard.NOKEY,
+ touchScreen = TouchScreen.FINGER,
+ keyboardState = KeyboardState.SOFT,
+ softButtons = true,
+ navigation = Navigation.NONAV,
+ released = "October 28, 2021",
+ locale = "en-rXA",
+ )
+ val Foldable = DeviceConfig(
+ screenHeight = 2480,
+ screenWidth = 2200,
+ xdpi = 420,
+ ydpi = 420,
+ orientation = ScreenOrientation.PORTRAIT,
+ density = Density.DPI_420,
+ ratio = ScreenRatio.NOTLONG,
+ size = ScreenSize.XLARGE,
+ keyboard = Keyboard.NOKEY,
+ touchScreen = TouchScreen.FINGER,
+ keyboardState = KeyboardState.SOFT,
+ softButtons = true,
+ navigation = Navigation.NONAV,
+ released = "October 31, 2013",
+ locale = "en-rXA",
+ )
+
+ /**
+ * Pixel C
+ */
+ val Tablet = DeviceConfig(
+ screenHeight = 1800,
+ screenWidth = 2560,
+ xdpi = 308,
+ ydpi = 308,
+ orientation = ScreenOrientation.LANDSCAPE,
+ density = Density.XHIGH,
+ ratio = ScreenRatio.NOTLONG,
+ size = ScreenSize.XLARGE,
+ keyboard = Keyboard.QWERTY,
+ touchScreen = TouchScreen.FINGER,
+ keyboardState = KeyboardState.SOFT,
+ softButtons = true,
+ navigation = Navigation.NONAV,
+ released = "December 8, 2015",
+ locale = "en-rXA",
+ )
+ internal val devices = listOf(Phone, Foldable, Tablet)
+}
+
+data class TestDeviceSpecs(val width: Int, val height: Int, val dpi: Int)
+
+/**
+ * Lower the current Paparazzi Environment from API level 34 to 33 to work around new resource conflicts:
+ *
+ * ```
+ * SEVERE: resources.format: Hexadecimal color expected, found Color State List for @android:color/system_bar_background_semi_transparent
+ * java.lang.NumberFormatException: Color value '/usr/local/lib/android/sdk/platforms/android-34/data/res/color/system_bar_background_semi_transparent.xml' has wrong size. Format is either#AARRGGBB, #RRGGBB, #RGB, or #ARGB
+ * ```
+ *
+ * GitHub issue: https://github.com/cashapp/paparazzi/issues/1025
+ */
+internal fun patchedEnvironment() = with(detectEnvironment()) {
+ copy(compileSdkVersion = 33, platformDir = platformDir.replace("34", "33"))
+}
+
+internal const val MaxPercentDifference: Double = 0.01
+internal const val PaparazziTheme: String = "android:Theme.MaterialComponent.Light.NoActionBar"
diff --git a/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/PaparazziUtils.kt b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/PaparazziUtils.kt
index b7f509e70..39b9bd8c3 100644
--- a/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/PaparazziUtils.kt
+++ b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/PaparazziUtils.kt
@@ -29,16 +29,22 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalInspectionMode
import app.cash.paparazzi.Paparazzi
-import app.cash.paparazzi.detectEnvironment
+import com.adevinta.spark.tokens.darkSparkColors
+import com.adevinta.spark.tokens.lightSparkColors
+import com.adevinta.spark.tools.preview.ThemeVariant
internal fun Paparazzi.sparkSnapshot(
name: String? = null,
drawBackground: Boolean = true,
+ isDark: Boolean = false,
composable: @Composable () -> Unit,
): Unit = snapshot(name) {
// Behave like in Android Studio Preview renderer
CompositionLocalProvider(LocalInspectionMode provides true) {
- SparkTheme(useLegacyStyle = false) {
+ SparkTheme(
+ useLegacyStyle = false,
+ colors = if (isDark) darkSparkColors() else lightSparkColors(),
+ ) {
// The first box acts as a shield from ComposeView which forces the first layout node
// to match it's size. This allows the content below to wrap as needed.
Box {
@@ -54,18 +60,31 @@ internal fun Paparazzi.sparkSnapshot(
}
/**
- * Lower the current Paparazzi Environment from API level 34 to 33 to work around new resource conflicts:
- *
- * ```
- * SEVERE: resources.format: Hexadecimal color expected, found Color State List for @android:color/system_bar_background_semi_transparent
- * java.lang.NumberFormatException: Color value '/usr/local/lib/android/sdk/platforms/android-34/data/res/color/system_bar_background_semi_transparent.xml' has wrong size. Format is either#AARRGGBB, #RRGGBB, #RGB, or #ARGB
- * ```
- *
- * GitHub issue: https://github.com/cashapp/paparazzi/issues/1025
+ * Generate 3 screenshots for each device: phone, tablet and foldable
*/
-internal fun patchedEnvironment() = with(detectEnvironment()) {
- copy(compileSdkVersion = 33, platformDir = platformDir.replace("34", "33"))
+internal fun Paparazzi.sparkSnapshotDevices(
+ name: String? = null,
+ drawBackground: Boolean = true,
+ isDark: Boolean = false,
+ composable: @Composable () -> Unit,
+) {
+ DefaultTestDevices.devices.forEach { deviceConfig ->
+ unsafeUpdateConfig(
+ deviceConfig = deviceConfig,
+ )
+ sparkSnapshot(name.orEmpty() + "_${deviceConfig.screenWidth}", drawBackground, isDark, composable)
+ }
}
-internal const val MaxPercentDifference: Double = 0.01
-internal const val PaparazziTheme: String = "android:Theme.MaterialComponent.Light.NoActionBar"
+/**
+ * Generate 2 screenshots for each theme: light and dark
+ */
+internal fun Paparazzi.sparkSnapshotNightMode(
+ name: String? = null,
+ drawBackground: Boolean = true,
+ composable: @Composable () -> Unit,
+) {
+ ThemeVariant.entries.forEach {
+ sparkSnapshot(name.orEmpty() + "_${it.name}", drawBackground, it == ThemeVariant.Dark, composable)
+ }
+}
diff --git a/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/PreviewScreenshotTests.kt b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/PreviewScreenshotTests.kt
index 7d52d6197..f1ff68f13 100644
--- a/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/PreviewScreenshotTests.kt
+++ b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/PreviewScreenshotTests.kt
@@ -22,10 +22,8 @@
package com.adevinta.spark
import app.cash.paparazzi.DeviceConfig
-import app.cash.paparazzi.Paparazzi
import com.airbnb.android.showkase.models.Showkase
import com.airbnb.android.showkase.models.ShowkaseBrowserComponent
-import com.android.ide.common.rendering.api.SessionParams
import org.junit.Rule
import org.junit.Test
@@ -43,13 +41,7 @@ internal class PreviewScreenshotTests {
}
@get:Rule
- val paparazzi = Paparazzi(
- maxPercentDifference = MaxPercentDifference,
- theme = PaparazziTheme,
- renderingMode = SessionParams.RenderingMode.SHRINK,
- showSystemUi = false,
- environment = patchedEnvironment(),
- )
+ val paparazzi = paparazziRule()
@Test
fun preview_tests() {
diff --git a/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/iconbutton/IconButtonScreenshot.kt b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/iconbutton/IconButtonScreenshot.kt
index 323088946..f50357bda 100644
--- a/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/iconbutton/IconButtonScreenshot.kt
+++ b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/iconbutton/IconButtonScreenshot.kt
@@ -23,12 +23,12 @@ package com.adevinta.spark.iconbutton
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.ExperimentalLayoutApi
+import androidx.compose.foundation.layout.FlowColumn
import androidx.compose.foundation.layout.Row
+import androidx.compose.runtime.Composable
import androidx.compose.ui.unit.dp
-import app.cash.paparazzi.DeviceConfig
-import app.cash.paparazzi.Paparazzi
-import com.adevinta.spark.MaxPercentDifference
-import com.adevinta.spark.PaparazziTheme
+import com.adevinta.spark.DefaultTestDevices
import com.adevinta.spark.SparkTheme
import com.adevinta.spark.components.buttons.ButtonShape
import com.adevinta.spark.components.iconbuttons.IconButtonContrast
@@ -39,105 +39,140 @@ import com.adevinta.spark.components.iconbuttons.IconButtonOutlined
import com.adevinta.spark.components.iconbuttons.IconButtonSize
import com.adevinta.spark.components.iconbuttons.IconButtonTinted
import com.adevinta.spark.components.surface.Surface
-import com.adevinta.spark.components.text.Text
import com.adevinta.spark.icons.AccountOutline
import com.adevinta.spark.icons.SparkIcons
-import com.adevinta.spark.patchedEnvironment
+import com.adevinta.spark.paparazziRule
import com.adevinta.spark.sparkSnapshot
import com.android.ide.common.rendering.api.SessionParams
-import com.google.testing.junit.testparameterinjector.TestParameterInjector
import org.junit.Rule
import org.junit.Test
-import org.junit.runner.RunWith
-@RunWith(TestParameterInjector::class)
internal class IconButtonScreenshot {
- private val shapes: Array = ButtonShape.entries.toTypedArray()
+ private val shapes = ButtonShape.entries
- private val sizes = IconButtonSize.entries.toTypedArray()
+ private val sizes = IconButtonSize.entries
- private val enableList: List = listOf(true, false)
-
- private val intents = IconButtonIntent.entries.toTypedArray()
+ private val intents = IconButtonIntent.entries
@get:Rule
- val paparazzi = Paparazzi(
- maxPercentDifference = MaxPercentDifference,
- theme = PaparazziTheme,
+ val paparazzi = paparazziRule(
renderingMode = SessionParams.RenderingMode.SHRINK,
- showSystemUi = true,
- environment = patchedEnvironment(),
- deviceConfig = DeviceConfig.PIXEL_C.copy(
- softButtons = false,
- locale = "fr-rFR",
- ),
+ deviceConfig = DefaultTestDevices.Tablet,
)
+ @OptIn(ExperimentalLayoutApi::class)
@Test
- fun test() {
- // shapes.forEach { shape -> TODO: Uncomment after Polaris app adapt new @ButtonShape class
- sizes.forEach { size ->
- paparazzi.sparkSnapshot(name = "$size") {
- Row {
- enableList.forEach { isEnabled ->
- Column(
- verticalArrangement = Arrangement.spacedBy(8.dp),
- ) {
- Text(
- text = "Enabled: $isEnabled",
- )
- intents.forEach { intent ->
- Surface(
- color = if (intent == IconButtonIntent.Surface) {
- SparkTheme.colors.surfaceInverse
- } else {
- SparkTheme.colors.surface
- },
- ) {
- Row {
- IconButtonFilled(
- onClick = {},
- icon = SparkIcons.AccountOutline,
- size = size,
- intent = intent,
- enabled = isEnabled,
- )
- IconButtonOutlined(
- onClick = {},
- icon = SparkIcons.AccountOutline,
- size = size,
- intent = intent,
- enabled = isEnabled,
- )
- IconButtonTinted(
- onClick = {},
- icon = SparkIcons.AccountOutline,
- size = size,
- intent = intent,
- enabled = isEnabled,
- )
- IconButtonContrast(
- onClick = {},
- icon = SparkIcons.AccountOutline,
- size = size,
- intent = intent,
- enabled = isEnabled,
- )
- IconButtonGhost(
- onClick = {},
- icon = SparkIcons.AccountOutline,
- size = size,
- intent = intent,
- enabled = isEnabled,
- )
- }
- }
- }
+ fun shape() {
+ paparazzi.sparkSnapshot {
+ FlowColumn {
+ shapes.forEach { shape ->
+ Column(
+ verticalArrangement = Arrangement.spacedBy(8.dp),
+ ) {
+ sizes.forEach { size ->
+ Buttons(size = size, shape = shape, enabled = true)
}
}
}
}
}
}
+
+ @OptIn(ExperimentalLayoutApi::class)
+ @Test
+ fun enabled() {
+ paparazzi.sparkSnapshot {
+ FlowColumn {
+ intents.forEach { intent ->
+ Column(
+ verticalArrangement = Arrangement.spacedBy(8.dp),
+ ) {
+ sizes.forEach { size ->
+ Buttons(size = size, intent = intent, enabled = true)
+ }
+ }
+ }
+ }
+ }
+ }
+
+ @OptIn(ExperimentalLayoutApi::class)
+ @Test
+ fun disabled() {
+ paparazzi.sparkSnapshot {
+ FlowColumn {
+ intents.forEach { intent ->
+ Column(
+ verticalArrangement = Arrangement.spacedBy(8.dp),
+ ) {
+ sizes.forEach { size ->
+ Buttons(size = size, intent = intent, enabled = false)
+ }
+ }
+ }
+ }
+ }
+ }
+
+ @Composable
+ private fun Buttons(
+ size: IconButtonSize,
+ shape: ButtonShape = ButtonShape.Rounded,
+ intent: IconButtonIntent = IconButtonIntent.Main,
+ enabled: Boolean,
+ ) {
+ Surface(
+ color = if (intent == IconButtonIntent.Surface) {
+ SparkTheme.colors.surfaceInverse
+ } else {
+ SparkTheme.colors.surface
+ },
+ ) {
+ Row(
+ horizontalArrangement = Arrangement.spacedBy(4.dp),
+ ) {
+ IconButtonFilled(
+ onClick = {},
+ icon = SparkIcons.AccountOutline,
+ size = size,
+ shape = shape,
+ intent = intent,
+ enabled = enabled,
+ )
+ IconButtonOutlined(
+ onClick = {},
+ icon = SparkIcons.AccountOutline,
+ size = size,
+ shape = shape,
+ intent = intent,
+ enabled = enabled,
+ )
+ IconButtonTinted(
+ onClick = {},
+ icon = SparkIcons.AccountOutline,
+ size = size,
+ shape = shape,
+ intent = intent,
+ enabled = enabled,
+ )
+ IconButtonContrast(
+ onClick = {},
+ icon = SparkIcons.AccountOutline,
+ size = size,
+ shape = shape,
+ intent = intent,
+ enabled = enabled,
+ )
+ IconButtonGhost(
+ onClick = {},
+ icon = SparkIcons.AccountOutline,
+ size = size,
+ shape = shape,
+ intent = intent,
+ enabled = enabled,
+ )
+ }
+ }
+ }
}
diff --git a/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/iconbutton/IconToggleButtonScreenshot.kt b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/iconbutton/IconToggleButtonScreenshot.kt
index d9e663fe6..98fa0b9f7 100644
--- a/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/iconbutton/IconToggleButtonScreenshot.kt
+++ b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/iconbutton/IconToggleButtonScreenshot.kt
@@ -23,13 +23,13 @@ package com.adevinta.spark.iconbutton
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.ExperimentalLayoutApi
+import androidx.compose.foundation.layout.FlowColumn
import androidx.compose.foundation.layout.Row
+import androidx.compose.runtime.Composable
import androidx.compose.ui.unit.dp
-import app.cash.paparazzi.DeviceConfig
-import app.cash.paparazzi.Paparazzi
+import com.adevinta.spark.DefaultTestDevices
import com.adevinta.spark.ExperimentalSparkApi
-import com.adevinta.spark.MaxPercentDifference
-import com.adevinta.spark.PaparazziTheme
import com.adevinta.spark.SparkTheme
import com.adevinta.spark.components.buttons.ButtonShape
import com.adevinta.spark.components.iconbuttons.IconButtonIntent
@@ -40,128 +40,179 @@ import com.adevinta.spark.components.iconbuttons.toggle.IconToggleButtonGhost
import com.adevinta.spark.components.iconbuttons.toggle.IconToggleButtonIcons
import com.adevinta.spark.components.iconbuttons.toggle.IconToggleButtonOutlined
import com.adevinta.spark.components.iconbuttons.toggle.IconToggleButtonTinted
+import com.adevinta.spark.components.icons.IconDefaults.intent
import com.adevinta.spark.components.surface.Surface
-import com.adevinta.spark.components.text.Text
import com.adevinta.spark.icons.AccountFill
import com.adevinta.spark.icons.AccountOutline
import com.adevinta.spark.icons.SparkIcons
-import com.adevinta.spark.patchedEnvironment
+import com.adevinta.spark.paparazziRule
import com.adevinta.spark.sparkSnapshot
import com.android.ide.common.rendering.api.SessionParams
-import com.google.testing.junit.testparameterinjector.TestParameterInjector
import org.junit.Rule
import org.junit.Test
-import org.junit.runner.RunWith
-@RunWith(TestParameterInjector::class)
internal class IconToggleButtonScreenshot {
private val icons: IconToggleButtonIcons = IconToggleButtonIcons(SparkIcons.AccountOutline, SparkIcons.AccountFill)
- private val shapes = ButtonShape.entries.toTypedArray()
+ private val shapes = ButtonShape.entries
- private val sizes = IconButtonSize.entries.toTypedArray()
+ private val sizes = IconButtonSize.entries
- private val checkList: List = listOf(true, false)
-
- private val enableList: List = listOf(true, false)
-
- private val intents = IconButtonIntent.entries.toTypedArray()
+ private val intents = IconButtonIntent.entries
@get:Rule
- val paparazzi = Paparazzi(
- maxPercentDifference = MaxPercentDifference,
- theme = PaparazziTheme,
- renderingMode = SessionParams.RenderingMode.SHRINK,
- showSystemUi = true,
- environment = patchedEnvironment(),
- deviceConfig = DeviceConfig.PIXEL_C.copy(
- softButtons = false,
- locale = "fr-rFR",
- ),
+ val paparazzi = paparazziRule(
+ renderingMode = SessionParams.RenderingMode.H_SCROLL,
+ deviceConfig = DefaultTestDevices.Tablet,
)
- @OptIn(ExperimentalSparkApi::class)
+ @OptIn(ExperimentalLayoutApi::class)
+ @Test
+ fun shape() {
+ paparazzi.sparkSnapshot {
+ FlowColumn {
+ shapes.forEach { shape ->
+ Column(
+ verticalArrangement = Arrangement.spacedBy(8.dp),
+ ) {
+ sizes.forEach { size ->
+ IconToggleButtons(
+ checked = true,
+ size = size,
+ shape = shape,
+ enabled = true,
+ )
+ }
+ }
+ }
+ }
+ }
+ }
+
+ @OptIn(ExperimentalLayoutApi::class)
+ @Test
+ fun enabled() {
+ paparazzi.sparkSnapshot {
+ FlowColumn {
+ intents.forEach { intent ->
+ Column(
+ verticalArrangement = Arrangement.spacedBy(8.dp),
+ ) {
+ sizes.forEach { size ->
+ IconToggleButtons(
+ checked = true,
+ size = size,
+ intent = intent,
+ enabled = true,
+ )
+ IconToggleButtons(
+ checked = false,
+ size = size,
+ intent = intent,
+ enabled = true,
+ )
+ }
+ }
+ }
+ }
+ }
+ }
+
+ @OptIn(ExperimentalLayoutApi::class)
@Test
- fun test() {
- shapes.forEach { shape ->
- sizes.forEach { size ->
- paparazzi.sparkSnapshot(
- name = "$shape" +
- "_$size",
- ) {
- Row {
- enableList.forEach { isEnabled ->
- checkList.forEach { isChecked ->
- Column(
- verticalArrangement = Arrangement.spacedBy(8.dp),
- ) {
- Text(
- text = "Enabled: $isEnabled, Checked: $isChecked",
- )
- intents.forEach { intent ->
- Surface(
- color = if (intent == IconButtonIntent.Surface) {
- SparkTheme.colors.surfaceInverse
- } else {
- SparkTheme.colors.surface
- },
- ) {
- Row {
- IconToggleButtonFilled(
- checked = isChecked,
- onCheckedChange = {},
- icons = icons,
- shape = shape,
- size = size,
- intent = intent,
- enabled = isEnabled,
- )
- IconToggleButtonOutlined(
- checked = isChecked,
- onCheckedChange = {},
- icons = icons,
- shape = shape,
- size = size,
- intent = intent,
- enabled = isEnabled,
- )
- IconToggleButtonTinted(
- checked = isChecked,
- onCheckedChange = {},
- icons = icons,
- shape = shape,
- size = size,
- intent = intent,
- enabled = isEnabled,
- )
- IconToggleButtonContrast(
- checked = isChecked,
- onCheckedChange = {},
- icons = icons,
- shape = shape,
- size = size,
- intent = intent,
- enabled = isEnabled,
- )
- IconToggleButtonGhost(
- checked = isChecked,
- onCheckedChange = {},
- icons = icons,
- shape = shape,
- size = size,
- intent = intent,
- enabled = isEnabled,
- )
- }
- }
- }
- }
- }
+ fun disabled() {
+ paparazzi.sparkSnapshot {
+ FlowColumn {
+ intents.forEach { intent ->
+ Column(
+ verticalArrangement = Arrangement.spacedBy(8.dp),
+ ) {
+ sizes.forEach { size ->
+ IconToggleButtons(
+ checked = true,
+ size = size,
+ intent = intent,
+ enabled = false,
+ )
+ IconToggleButtons(
+ checked = false,
+ size = size,
+ intent = intent,
+ enabled = false,
+ )
}
}
}
}
}
}
+
+ @OptIn(ExperimentalSparkApi::class)
+ @Composable
+ private fun IconToggleButtons(
+ checked: Boolean,
+ size: IconButtonSize,
+ shape: ButtonShape = ButtonShape.Rounded,
+ intent: IconButtonIntent = IconButtonIntent.Main,
+ enabled: Boolean,
+ ) {
+ Surface(
+ color = if (intent == IconButtonIntent.Surface) {
+ SparkTheme.colors.surfaceInverse
+ } else {
+ SparkTheme.colors.surface
+ },
+ ) {
+ Row(
+ horizontalArrangement = Arrangement.spacedBy(4.dp),
+ ) {
+ IconToggleButtonFilled(
+ checked = checked,
+ onCheckedChange = {},
+ icons = icons,
+ shape = shape,
+ size = size,
+ intent = intent,
+ enabled = enabled,
+ )
+ IconToggleButtonOutlined(
+ checked = checked,
+ onCheckedChange = {},
+ icons = icons,
+ shape = shape,
+ size = size,
+ intent = intent,
+ enabled = enabled,
+ )
+ IconToggleButtonTinted(
+ checked = checked,
+ onCheckedChange = {},
+ icons = icons,
+ shape = shape,
+ size = size,
+ intent = intent,
+ enabled = enabled,
+ )
+ IconToggleButtonContrast(
+ checked = checked,
+ onCheckedChange = {},
+ icons = icons,
+ shape = shape,
+ size = size,
+ intent = intent,
+ enabled = enabled,
+ )
+ IconToggleButtonGhost(
+ checked = checked,
+ onCheckedChange = {},
+ icons = icons,
+ shape = shape,
+ size = size,
+ intent = intent,
+ enabled = enabled,
+ )
+ }
+ }
+ }
}
diff --git a/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/icons/IconsScreenshot.kt b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/icons/IconsScreenshot.kt
index 69dca0ec5..b2b3b2308 100644
--- a/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/icons/IconsScreenshot.kt
+++ b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/icons/IconsScreenshot.kt
@@ -21,14 +21,9 @@
*/
package com.adevinta.spark.icons
-import app.cash.paparazzi.DeviceConfig.Companion.PIXEL_6_PRO
-import app.cash.paparazzi.Paparazzi
-import com.adevinta.spark.MaxPercentDifference
-import com.adevinta.spark.PaparazziTheme
import com.adevinta.spark.components.icons.Icon
import com.adevinta.spark.components.icons.IconSize
-import com.adevinta.spark.patchedEnvironment
-import com.android.ide.common.rendering.api.SessionParams.RenderingMode.SHRINK
+import com.adevinta.spark.paparazziRule
import com.google.testing.junit.testparameterinjector.TestParameter
import com.google.testing.junit.testparameterinjector.TestParameter.TestParameterValuesProvider
import com.google.testing.junit.testparameterinjector.TestParameterInjector
@@ -40,13 +35,7 @@ import org.junit.runner.RunWith
internal class IconsScreenshot {
@get:Rule
- val paparazzi = Paparazzi(
- maxPercentDifference = MaxPercentDifference,
- theme = PaparazziTheme,
- renderingMode = SHRINK,
- deviceConfig = PIXEL_6_PRO,
- environment = patchedEnvironment(),
- )
+ val paparazzi = paparazziRule()
internal object SparkIconProvider : TestParameterValuesProvider {
override fun provideValues() = Class.forName("com.adevinta.spark.icons.SparkIconsKt")
diff --git a/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/popover/PopoverScreenshot.kt b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/popover/PopoverScreenshot.kt
deleted file mode 100644
index fab1f21cb..000000000
--- a/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/popover/PopoverScreenshot.kt
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (c) 2023 Adevinta
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-package com.adevinta.spark.popover
-
-import android.annotation.SuppressLint
-import androidx.compose.foundation.interaction.MutableInteractionSource
-import androidx.compose.foundation.interaction.PressInteraction
-import androidx.compose.foundation.layout.Column
-import androidx.compose.foundation.layout.padding
-import androidx.compose.material3.ExperimentalMaterial3Api
-import androidx.compose.runtime.remember
-import androidx.compose.runtime.rememberCoroutineScope
-import androidx.compose.ui.Modifier
-import androidx.compose.ui.geometry.Offset
-import androidx.compose.ui.text.font.FontWeight
-import androidx.compose.ui.text.style.TextDecoration
-import androidx.compose.ui.unit.dp
-import app.cash.paparazzi.DeviceConfig
-import app.cash.paparazzi.Paparazzi
-import com.adevinta.spark.ExperimentalSparkApi
-import com.adevinta.spark.MaxPercentDifference
-import com.adevinta.spark.PaparazziTheme
-import com.adevinta.spark.SparkTheme
-import com.adevinta.spark.components.buttons.ButtonFilled
-import com.adevinta.spark.components.popover.Popover
-import com.adevinta.spark.components.popover.newapi.rememberTooltipState
-import com.adevinta.spark.components.text.Text
-import com.adevinta.spark.patchedEnvironment
-import com.adevinta.spark.sparkSnapshot
-import com.android.ide.common.rendering.api.SessionParams
-import com.google.testing.junit.testparameterinjector.TestParameterInjector
-import kotlinx.coroutines.delay
-import kotlinx.coroutines.launch
-import org.junit.Rule
-import org.junit.Test
-import org.junit.runner.RunWith
-
-@OptIn(ExperimentalMaterial3Api::class, ExperimentalSparkApi::class)
-@RunWith(TestParameterInjector::class)
-internal class PopoverScreenshot {
-
- private val enableList: List = listOf(true, false)
-
- @get:Rule
- val paparazzi = Paparazzi(
- maxPercentDifference = MaxPercentDifference,
- theme = PaparazziTheme,
- renderingMode = SessionParams.RenderingMode.SHRINK,
- showSystemUi = true,
- environment = patchedEnvironment(),
- deviceConfig = DeviceConfig.PIXEL_C.copy(
- softButtons = false,
- locale = "fr-rFR",
- ),
- )
-
- @SuppressLint("CoroutineCreationDuringComposition")
- @Test
- fun test() {
- enableList.forEach { isEnabled ->
- paparazzi.sparkSnapshot(name = "Popover_isDismissEnabled_$isEnabled", true) {
- val state = rememberTooltipState(isPersistent = true)
- val scope = rememberCoroutineScope()
- val interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }
-
- scope.launch {
- val press = PressInteraction.Press(Offset.Zero)
- interactionSource.emit(press)
- state.show()
- delay(300)
- interactionSource.emit(PressInteraction.Release(press))
- }
-
- Column {
- Popover(
- popoverContent = {
- Column {
- Text(
- text = "Title",
- modifier = Modifier.padding(bottom = 16.dp),
- style = SparkTheme.typography.headline1.copy(fontWeight = FontWeight.Bold),
- )
- Text(
- text = "Do you want to have this cookie now?",
- modifier = Modifier.padding(bottom = 16.dp),
- style = SparkTheme.typography.body2.copy(fontWeight = FontWeight.Bold),
- )
- Text(
- text = "Text Link",
- textDecoration = TextDecoration.Underline,
- style = SparkTheme.typography.body1.copy(fontWeight = FontWeight.Bold)
- .copy(color = SparkTheme.colors.accent),
- )
- }
- },
- isDismissButtonEnabled = isEnabled,
- popoverState = state.apply {
- scope.launch {
- show()
- }
- },
- ) {
- scope.launch { state.show() }
- ButtonFilled(
- text = "Display Popover",
- onClick = { scope.launch { state.show() } },
- interactionSource = interactionSource,
- )
- }
- }
- }
- }
- }
-}
diff --git a/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/progress/ProgressScreenshot.kt b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/progress/ProgressScreenshot.kt
index e42b8f602..1a3080640 100644
--- a/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/progress/ProgressScreenshot.kt
+++ b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/progress/ProgressScreenshot.kt
@@ -22,76 +22,93 @@
package com.adevinta.spark.progress
import androidx.compose.foundation.layout.Arrangement
+import androidx.compose.foundation.layout.Arrangement.Absolute.spacedBy
import androidx.compose.foundation.layout.Column
-import androidx.compose.foundation.layout.Row
-import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
+import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
-import app.cash.paparazzi.Paparazzi
-import com.adevinta.spark.MaxPercentDifference
-import com.adevinta.spark.PaparazziTheme
-import com.adevinta.spark.SparkTheme
+import com.adevinta.spark.DefaultTestDevices
import com.adevinta.spark.components.progressbar.Progressbar
import com.adevinta.spark.components.progressbar.ProgressbarIntent
-import com.adevinta.spark.components.surface.Surface
-import com.adevinta.spark.components.text.Text
-import com.adevinta.spark.patchedEnvironment
+import com.adevinta.spark.paparazziRule
import com.adevinta.spark.sparkSnapshot
-import com.android.ide.common.rendering.api.SessionParams
-import com.google.testing.junit.testparameterinjector.TestParameterInjector
+import com.android.ide.common.rendering.api.SessionParams.RenderingMode.SHRINK
import org.junit.Rule
import org.junit.Test
-import org.junit.runner.RunWith
-@RunWith(TestParameterInjector::class)
internal class ProgressScreenshot {
- private val isRoundedList: List = listOf(true, false)
-
private val intents = ProgressbarIntent.entries
@get:Rule
- val paparazzi = Paparazzi(
- maxPercentDifference = MaxPercentDifference,
- theme = PaparazziTheme,
- renderingMode = SessionParams.RenderingMode.SHRINK,
- showSystemUi = true,
- environment = patchedEnvironment(),
- deviceConfig = app.cash.paparazzi.DeviceConfig.PIXEL_6_PRO.copy(
- softButtons = false,
- locale = "fr-rFR",
- ),
+ val paparazzi = paparazziRule(
+ renderingMode = SHRINK,
+ deviceConfig = DefaultTestDevices.Tablet,
)
@Test
- fun test() {
- isRoundedList.forEach { isRounded ->
- intents.forEach { intent ->
- paparazzi.sparkSnapshot(
- name = "Intent_${intent.name}" + "_Rounded_Border_$isRounded",
- ) {
- Surface(
- color = SparkTheme.colors.surface,
- ) {
- Row(modifier = Modifier.padding(24.dp)) {
- Column(
- verticalArrangement = Arrangement.spacedBy(8.dp),
- ) {
- Text(
- text = "Intent: ${intent.name}, Rounded_Border: $isRounded",
- )
- Progressbar(
- intent = intent,
- modifier = Modifier.fillMaxWidth(),
- progress = 0.5f,
- isRounded = isRounded,
- )
- }
- }
- }
+ fun normal() {
+ paparazzi.sparkSnapshot {
+ Column(
+ modifier = Modifier.padding(8.dp),
+ verticalArrangement = spacedBy(16.dp),
+ ) {
+ intents.forEach { intent ->
+ ProgressBars(
+ intent = intent,
+ isRounded = false,
+ )
+ }
+ }
+ }
+ }
+
+ @Test
+ fun rounded() {
+ paparazzi.sparkSnapshot {
+ Column(
+ modifier = Modifier.padding(8.dp),
+ verticalArrangement = spacedBy(16.dp),
+ ) {
+ intents.forEach { intent ->
+ ProgressBars(
+ intent = intent,
+ isRounded = true,
+ )
}
}
}
}
+
+ @Composable
+ private fun ProgressBars(
+ intent: ProgressbarIntent,
+ isRounded: Boolean,
+ ) {
+ Column(
+ verticalArrangement = Arrangement.spacedBy(8.dp),
+ ) {
+ Progressbar(
+ intent = intent,
+ progress = 0.001f,
+ isRounded = isRounded,
+ )
+ Progressbar(
+ intent = intent,
+ progress = 0.25f,
+ isRounded = isRounded,
+ )
+ Progressbar(
+ intent = intent,
+ progress = 0.9f,
+ isRounded = isRounded,
+ )
+ Progressbar(
+ intent = intent,
+ progress = 1f,
+ isRounded = isRounded,
+ )
+ }
+ }
}
diff --git a/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/snackbar/SnackbarDocScreenshot.kt b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/snackbar/SnackbarDocScreenshot.kt
new file mode 100644
index 000000000..c4df865c4
--- /dev/null
+++ b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/snackbar/SnackbarDocScreenshot.kt
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2023 Adevinta
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+package com.adevinta.spark.snackbar
+
+import androidx.compose.foundation.layout.Column
+import com.adevinta.spark.components.snackbars.Snackbar
+import com.adevinta.spark.components.snackbars.SnackbarColors
+import com.adevinta.spark.components.text.Text
+import com.adevinta.spark.paparazziRule
+import com.adevinta.spark.sparkSnapshotNightMode
+import org.junit.Rule
+import org.junit.Test
+
+internal class SnackbarDocScreenshot {
+
+ @get:Rule
+ val paparazzi = paparazziRule()
+
+ @Test
+ fun snackbarColorsShowcase() {
+ paparazzi.sparkSnapshotNightMode {
+ Column {
+ SnackbarColors.entries.forEach {
+ Snackbar(
+ colors = it,
+ actionLabel = "Action",
+ ) {
+ Text("Lorem ipsum dolor sit amet")
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/snackbar/SnackbarScreenshot.kt b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/snackbar/SnackbarScreenshot.kt
new file mode 100644
index 000000000..14c3fc022
--- /dev/null
+++ b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/snackbar/SnackbarScreenshot.kt
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2023 Adevinta
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+package com.adevinta.spark.snackbar
+
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.Row
+import androidx.compose.material3.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import com.adevinta.spark.DefaultTestDevices
+import com.adevinta.spark.components.icons.Icon
+import com.adevinta.spark.components.snackbars.Snackbar
+import com.adevinta.spark.components.snackbars.SnackbarColors
+import com.adevinta.spark.components.snackbars.SnackbarSparkVisuals
+import com.adevinta.spark.icons.AlarmOnOutline
+import com.adevinta.spark.icons.SparkIcons
+import com.adevinta.spark.paparazziRule
+import com.adevinta.spark.sparkSnapshotNightMode
+import org.junit.Rule
+import org.junit.Test
+
+class SnackbarScreenshot {
+
+ @get:Rule
+ val paparazzi = paparazziRule(
+ // fixme: fix to make it portrait while #1190 is not released
+ deviceConfig = DefaultTestDevices.Tablet.copy(
+ screenHeight = 2560,
+ screenWidth = 1800,
+ ),
+ )
+
+ private val stubtitle = "Title"
+ private val stubShortBody = "Lorem ipsum dolor sit amet"
+ private val stubBody =
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi lacus dolor, " +
+ "pulvinar eu nulla sit amet, iaculis interdum."
+ private val stubAction = "Action"
+
+ private val BodySnackbar = SnackbarSparkVisuals(stubShortBody)
+ private val BodyActionSnackbar = SnackbarSparkVisuals(stubShortBody, actionLabel = stubAction)
+ private val BodyIconActionSnackbar = SnackbarSparkVisuals(
+ stubShortBody,
+ actionLabel = stubAction,
+ icon = SparkIcons.AlarmOnOutline,
+ )
+ private val BodyIconSnackbar = SnackbarSparkVisuals(stubShortBody, icon = SparkIcons.AlarmOnOutline)
+ private val BodyIconActionNewLineSnackbar = SnackbarSparkVisuals(
+ stubBody,
+ actionLabel = stubAction,
+ icon = SparkIcons.AlarmOnOutline,
+ )
+ private val BodyTitleSnackbar = SnackbarSparkVisuals(stubBody, title = stubtitle)
+ private val BodyTitleActionSnackbar =
+ SnackbarSparkVisuals(stubBody, title = stubtitle, actionLabel = stubAction)
+
+ private val data = listOf(
+ BodySnackbar,
+ BodyActionSnackbar,
+ BodyIconActionSnackbar,
+ BodyIconSnackbar,
+ BodyIconActionNewLineSnackbar,
+ BodyTitleSnackbar,
+ BodyTitleActionSnackbar,
+ )
+
+ @Test
+ fun snackBar() {
+ paparazzi.sparkSnapshotNightMode {
+ Row {
+ SnackbarColors.entries.forEach { color ->
+ Column(
+ modifier = Modifier.weight(1f),
+ ) {
+ data.forEach { visual ->
+
+ val iconComposable: (@Composable (iconModifier: Modifier) -> Unit)? =
+ visual.icon?.let { icon ->
+ @Composable { iconModifier ->
+ Icon(icon, modifier = iconModifier, contentDescription = null)
+ }
+ }
+ Snackbar(
+ actionOnNewLine = visual.message == stubBody,
+ colors = color,
+ icon = iconComposable,
+ title = visual.title,
+ actionLabel = visual.actionLabel,
+ ) { Text(visual.message) }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/tab/TabsDocScreenshot.kt b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/tab/TabsDocScreenshot.kt
new file mode 100644
index 000000000..e1300f5df
--- /dev/null
+++ b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/tab/TabsDocScreenshot.kt
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2023 Adevinta
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+package com.adevinta.spark.tab
+
+import androidx.compose.foundation.layout.Column
+import androidx.compose.runtime.Composable
+import com.adevinta.spark.components.badge.Badge
+import com.adevinta.spark.components.tab.Tab
+import com.adevinta.spark.components.tab.TabGroup
+import com.adevinta.spark.components.tab.TabIntent
+import com.adevinta.spark.components.tab.TabSize
+import com.adevinta.spark.icons.MessageOutline
+import com.adevinta.spark.icons.SparkIcons
+import com.adevinta.spark.paparazziRule
+import com.adevinta.spark.sparkSnapshot
+import com.adevinta.spark.sparkSnapshotNightMode
+import org.junit.Rule
+import org.junit.Test
+
+internal class TabsDocScreenshot {
+
+ @get:Rule
+ val paparazzi = paparazziRule()
+
+ @Test
+ fun tabsIntentShowcase() {
+ paparazzi.sparkSnapshotNightMode {
+ Column {
+ TabIntent.entries.forEach {
+ Tabs(intent = it)
+ }
+ }
+ }
+ }
+
+ @Test
+ fun tabsSizeShowcase() {
+ paparazzi.sparkSnapshot {
+ Column {
+ TabSize.entries.forEach {
+ Tabs(size = it)
+ }
+ }
+ }
+ }
+
+ @Test
+ fun tabsSpacingShowcase() {
+ paparazzi.sparkSnapshot {
+ Column {
+ Tabs(spacedEvenly = true)
+ Tabs(spacedEvenly = false)
+ }
+ }
+ }
+
+ @Composable
+ private fun Tabs(
+ intent: TabIntent = TabIntent.Basic,
+ size: TabSize = TabSize.Medium,
+ spacedEvenly: Boolean = true,
+ ) {
+ TabGroup(
+ selectedTabIndex = 0,
+ intent = intent,
+ spacedEvenly = spacedEvenly,
+ ) {
+ Tab(
+ selected = true,
+ onClick = {},
+ intent = intent,
+ size = size,
+ text = "Home",
+ enabled = false,
+ )
+ Tab(
+ selected = false,
+ onClick = {},
+ intent = intent,
+ size = size,
+ text = "Message",
+ icon = SparkIcons.MessageOutline,
+ enabled = false,
+ trailingContent = {
+ Badge(count = 5)
+ },
+ )
+ }
+ }
+}
diff --git a/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/tab/TabsScreenshot.kt b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/tab/TabsScreenshot.kt
new file mode 100644
index 000000000..486bf6b6e
--- /dev/null
+++ b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/tab/TabsScreenshot.kt
@@ -0,0 +1,189 @@
+/*
+ * Copyright (c) 2023 Adevinta
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+package com.adevinta.spark.tab
+
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.ExperimentalLayoutApi
+import androidx.compose.foundation.layout.FlowColumn
+import androidx.compose.foundation.layout.padding
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.unit.dp
+import com.adevinta.spark.DefaultTestDevices
+import com.adevinta.spark.components.badge.Badge
+import com.adevinta.spark.components.tab.Tab
+import com.adevinta.spark.components.tab.TabGroup
+import com.adevinta.spark.components.tab.TabIntent
+import com.adevinta.spark.components.tab.TabSize
+import com.adevinta.spark.icons.MessageOutline
+import com.adevinta.spark.icons.SparkIcons
+import com.adevinta.spark.paparazziRule
+import com.adevinta.spark.sparkSnapshot
+import com.android.ide.common.rendering.api.SessionParams
+import org.junit.Rule
+import org.junit.Test
+
+internal class TabsScreenshot {
+
+ private val sizes = TabSize.entries
+
+ private val intents = TabIntent.entries
+
+ @get:Rule
+ val paparazzi = paparazziRule(
+ renderingMode = SessionParams.RenderingMode.SHRINK,
+ deviceConfig = DefaultTestDevices.Phone,
+ )
+
+ @OptIn(ExperimentalLayoutApi::class)
+ @Test
+ fun enabled() {
+ paparazzi.sparkSnapshot {
+ sizes.forEach { size ->
+ FlowColumn {
+ intents.forEach { intent ->
+ Column {
+ TabGroup(
+ selectedTabIndex = 0,
+ intent = intent,
+ ) {
+ Tab(
+ selected = true,
+ onClick = {},
+ intent = intent,
+ size = size,
+ enabled = true,
+ text = "Home",
+ )
+ Tab(
+ selected = false,
+ onClick = {},
+ intent = intent,
+ size = size,
+ text = "Message",
+ enabled = true,
+ icon = SparkIcons.MessageOutline,
+ trailingContent = {
+ Badge(count = 5)
+ },
+ )
+ }
+ TabGroup(
+ selectedTabIndex = 0,
+ intent = intent,
+ spacedEvenly = false,
+ ) {
+ Tab(
+ selected = true,
+ onClick = {},
+ intent = intent,
+ size = size,
+ enabled = true,
+ text = "Home",
+ )
+ Tab(
+ selected = false,
+ onClick = {},
+ intent = intent,
+ size = size,
+ text = "Message",
+ enabled = true,
+ icon = SparkIcons.MessageOutline,
+ trailingContent = {
+ Badge(count = 5)
+ },
+ )
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ @OptIn(ExperimentalLayoutApi::class)
+ @Test
+ fun disabled() {
+ paparazzi.sparkSnapshot {
+ sizes.forEach { size ->
+ FlowColumn(
+ modifier = Modifier.padding(bottom = 8.dp),
+ ) {
+ intents.forEach { intent ->
+ Column {
+ TabGroup(
+ selectedTabIndex = 0,
+ intent = intent,
+ ) {
+ Tab(
+ selected = true,
+ onClick = {},
+ intent = intent,
+ size = size,
+ text = "Home",
+ enabled = false,
+ )
+ Tab(
+ selected = false,
+ onClick = {},
+ intent = intent,
+ size = size,
+ text = "Message",
+ icon = SparkIcons.MessageOutline,
+ enabled = false,
+ trailingContent = {
+ Badge(count = 5)
+ },
+ )
+ }
+ TabGroup(
+ selectedTabIndex = 0,
+ intent = intent,
+ spacedEvenly = false,
+ ) {
+ Tab(
+ selected = true,
+ onClick = {},
+ intent = intent,
+ size = size,
+ text = "Home",
+ enabled = false,
+ )
+ Tab(
+ selected = false,
+ onClick = {},
+ intent = intent,
+ size = size,
+ text = "Message",
+ icon = SparkIcons.MessageOutline,
+ enabled = false,
+ trailingContent = {
+ Badge(count = 5)
+ },
+ )
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/tags/TagsScreenshot.kt b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/tags/TagsScreenshot.kt
index 7376d67de..28d838a0b 100644
--- a/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/tags/TagsScreenshot.kt
+++ b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/tags/TagsScreenshot.kt
@@ -32,10 +32,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
-import app.cash.paparazzi.DeviceConfig
-import app.cash.paparazzi.Paparazzi
-import com.adevinta.spark.MaxPercentDifference
-import com.adevinta.spark.PaparazziTheme
+import com.adevinta.spark.DefaultTestDevices
import com.adevinta.spark.SparkTheme
import com.adevinta.spark.components.surface.Surface
import com.adevinta.spark.components.tags.TagFilled
@@ -46,6 +43,7 @@ import com.adevinta.spark.components.text.Text
import com.adevinta.spark.icons.FireFill
import com.adevinta.spark.icons.SparkIcon
import com.adevinta.spark.icons.SparkIcons
+import com.adevinta.spark.paparazziRule
import com.adevinta.spark.sparkSnapshot
import com.adevinta.spark.tags.TagsScreenshot.Style.Filled
import com.adevinta.spark.tags.TagsScreenshot.Style.Outlined
@@ -54,7 +52,7 @@ import com.adevinta.spark.tokens.darkSparkColors
import com.adevinta.spark.tokens.lightSparkColors
import com.adevinta.spark.tools.preview.ThemeVariant
import com.adevinta.spark.tools.preview.ThemeVariant.Light
-import com.android.ide.common.rendering.api.SessionParams
+import com.android.ide.common.rendering.api.SessionParams.RenderingMode.V_SCROLL
import org.junit.Rule
import org.junit.Test
@@ -70,15 +68,9 @@ internal class TagsScreenshot {
}
@get:Rule
- val paparazzi = Paparazzi(
- maxPercentDifference = MaxPercentDifference,
- theme = PaparazziTheme,
- renderingMode = SessionParams.RenderingMode.V_SCROLL,
- deviceConfig = DeviceConfig.PIXEL_C.copy(
- softButtons = false,
- locale = "fr-rFR",
- ),
- showSystemUi = true,
+ val paparazzi = paparazziRule(
+ deviceConfig = DefaultTestDevices.Tablet,
+ renderingMode = V_SCROLL,
)
@Test
diff --git a/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/text/TextLinkScreenshot.kt b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/text/TextLinkScreenshot.kt
index daab1ddd1..4fa4cd69c 100644
--- a/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/text/TextLinkScreenshot.kt
+++ b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/text/TextLinkScreenshot.kt
@@ -23,47 +23,42 @@ package com.adevinta.spark.text
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
-import app.cash.paparazzi.Paparazzi
-import com.adevinta.spark.MaxPercentDifference
-import com.adevinta.spark.PaparazziTheme
+import androidx.compose.ui.res.stringResource
+import com.adevinta.spark.DefaultTestDevices
import com.adevinta.spark.SparkTheme
import com.adevinta.spark.components.buttons.ButtonIntent
import com.adevinta.spark.components.buttons.IconSide
-import com.adevinta.spark.components.surface.Surface
import com.adevinta.spark.components.text.TextLink
import com.adevinta.spark.components.text.TextLinkButton
import com.adevinta.spark.icons.InfoOutline
import com.adevinta.spark.icons.SparkIcons
-import com.adevinta.spark.patchedEnvironment
+import com.adevinta.spark.paparazziRule
import com.adevinta.spark.screenshot.testing.R
-import com.adevinta.spark.sparkSnapshot
-import com.android.ide.common.rendering.api.SessionParams
+import com.adevinta.spark.sparkSnapshotNightMode
import org.junit.Rule
import org.junit.Test
+import java.util.Locale
internal class TextLinkScreenshot {
@get:Rule
- val paparazzi = Paparazzi(
- maxPercentDifference = MaxPercentDifference,
- theme = PaparazziTheme,
- renderingMode = SessionParams.RenderingMode.SHRINK,
- showSystemUi = true,
- environment = patchedEnvironment(),
- deviceConfig = app.cash.paparazzi.DeviceConfig.PIXEL_6_PRO.copy(
- softButtons = false,
- locale = "en-rUS",
- ),
- )
+ val paparazzi = paparazziRule()
@Test
fun testTextLink() {
- paparazzi.sparkSnapshot(
- name = "TextLink",
- ) {
- Surface(
- color = SparkTheme.colors.surface,
- ) {
+ paparazzi.sparkSnapshotNightMode {
+ Column {
+ IconSide.entries.forEach { iconSide ->
+ Row {
+ TextLinkButton(
+ text = "Click me",
+ icon = SparkIcons.InfoOutline,
+ intent = ButtonIntent.Accent,
+ iconSide = iconSide,
+ onClick = {},
+ )
+ }
+ }
TextLink(
style = SparkTheme.typography.subhead,
text = R.string.spark_text_link_short_example,
@@ -75,26 +70,31 @@ internal class TextLinkScreenshot {
}
@Test
- fun testTextLinkButton() {
- paparazzi.sparkSnapshot(
- name = "TextLinkButton",
- ) {
- Surface(
- color = SparkTheme.colors.backgroundVariant,
- ) {
- Column {
- IconSide.entries.forEach { iconSide ->
- Row {
- TextLinkButton(
- text = "Click me",
- icon = SparkIcons.InfoOutline,
- intent = ButtonIntent.Accent,
- iconSide = iconSide,
- onClick = {},
- )
- }
+ fun frenchVariant() {
+ paparazzi.unsafeUpdateConfig(
+ deviceConfig = DefaultTestDevices.Phone.copy(
+ locale = Locale.FRENCH.toLanguageTag(),
+ ),
+ )
+ paparazzi.sparkSnapshotNightMode {
+ Column {
+ IconSide.entries.forEach { iconSide ->
+ Row {
+ TextLinkButton(
+ text = stringResource(id = R.string.spark_text_link_button_example),
+ icon = SparkIcons.InfoOutline,
+ intent = ButtonIntent.Accent,
+ iconSide = iconSide,
+ onClick = {},
+ )
}
}
+ TextLink(
+ style = SparkTheme.typography.subhead,
+ text = R.string.spark_text_link_short_example,
+ onClickLabel = "textLink",
+ onClick = {},
+ )
}
}
}
diff --git a/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/textfields/MultilineTextFieldScreenshot.kt b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/textfields/MultilineTextFieldScreenshot.kt
new file mode 100644
index 000000000..e02e9d392
--- /dev/null
+++ b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/textfields/MultilineTextFieldScreenshot.kt
@@ -0,0 +1,346 @@
+/*
+ * Copyright (c) 2023 Adevinta
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+package com.adevinta.spark.textfields
+
+import androidx.compose.foundation.interaction.FocusInteraction
+import androidx.compose.foundation.interaction.Interaction
+import androidx.compose.foundation.interaction.MutableInteractionSource
+import androidx.compose.foundation.interaction.PressInteraction
+import androidx.compose.foundation.layout.Arrangement
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.ExperimentalLayoutApi
+import androidx.compose.foundation.layout.FlowColumn
+import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.widthIn
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.geometry.Offset
+import androidx.compose.ui.unit.dp
+import com.adevinta.spark.DefaultTestDevices
+import com.adevinta.spark.components.icons.Icon
+import com.adevinta.spark.components.icons.IconSize
+import com.adevinta.spark.components.text.Text
+import com.adevinta.spark.components.textfields.AddonScope
+import com.adevinta.spark.components.textfields.MultilineTextField
+import com.adevinta.spark.components.textfields.TextFieldCharacterCounter
+import com.adevinta.spark.components.textfields.TextFieldState
+import com.adevinta.spark.icons.Check
+import com.adevinta.spark.icons.LikeFill
+import com.adevinta.spark.icons.SparkIcon
+import com.adevinta.spark.icons.SparkIcons
+import com.adevinta.spark.paparazziRule
+import com.adevinta.spark.sparkSnapshot
+import com.adevinta.spark.sparkSnapshotNightMode
+import com.android.ide.common.rendering.api.SessionParams.RenderingMode.SHRINK
+import kotlinx.coroutines.flow.flowOf
+import org.junit.Rule
+import org.junit.Test
+
+internal class MultilineTextFieldScreenshot {
+
+ private val icons: List = listOf(SparkIcons.Check, null)
+
+ private val helpers: List = listOf(null, stubBody)
+
+ @get:Rule
+ val paparazzi = paparazziRule(
+ deviceConfig = DefaultTestDevices.Tablet,
+ renderingMode = SHRINK,
+ )
+
+ @Test
+ fun showcase() {
+ paparazzi.sparkSnapshotNightMode {
+ Row {
+ ShowcasedMultilineTextfield(
+ state = null,
+ stateMessage = "Helper text",
+ )
+ ShowcasedMultilineTextfield(
+ state = TextFieldState.Error,
+ stateMessage = "Error text",
+ )
+ ShowcasedMultilineTextfield(
+ state = TextFieldState.Alert,
+ stateMessage = "Alert text",
+ )
+ ShowcasedMultilineTextfield(
+ state = TextFieldState.Success,
+ stateMessage = "Success text",
+ )
+ }
+ }
+ }
+
+ @Composable
+ private fun ShowcasedMultilineTextfield(
+ state: TextFieldState?,
+ stateMessage: String?,
+ ) {
+ Column(
+ modifier = Modifier.padding(8.dp),
+ verticalArrangement = Arrangement.spacedBy(8.dp),
+ ) {
+ val icon: @Composable (AddonScope.() -> Unit) = @Composable {
+ Icon(
+ sparkIcon = SparkIcons.LikeFill,
+ contentDescription = null,
+ size = IconSize.Medium,
+ )
+ }
+
+ Text("Unfocused with value")
+
+ MultilineTextField(
+ value = "Input",
+ onValueChange = {},
+ onCancelClick = {},
+ enabled = true,
+ state = state,
+ stateMessage = stateMessage,
+ required = true,
+ label = "Label",
+ placeholder = "Placeholder",
+ counter = TextFieldCharacterCounter(12, 24),
+ maxLines = 3,
+ helper = "Helper text",
+ leadingContent = icon,
+ )
+
+ Text("Focused without value")
+
+ MultilineTextField(
+ value = "",
+ onValueChange = {},
+ onCancelClick = {},
+ enabled = true,
+ state = state,
+ stateMessage = stateMessage,
+ required = true,
+ label = "Label",
+ placeholder = "Placeholder",
+ helper = "Helper text",
+ leadingContent = icon,
+ interactionSource = object : DefaultMutableInteractionSource() {
+ override val interactions =
+ flowOf(FocusInteraction.Focus(), PressInteraction.Press(Offset.Zero))
+ },
+ )
+
+ Text("Unfocused without value")
+
+ MultilineTextField(
+ value = "",
+ onValueChange = {},
+ onCancelClick = {},
+ enabled = true,
+ state = state,
+ stateMessage = stateMessage,
+ required = true,
+ label = "Label",
+ placeholder = "Placeholder",
+ helper = "Helper text",
+ leadingContent = icon,
+ minLines = 3,
+ )
+ }
+ }
+
+ @OptIn(ExperimentalLayoutApi::class)
+ @Test
+ fun bigValue() {
+ paparazzi.sparkSnapshot {
+ FlowColumn(
+ modifier = Modifier.padding(8.dp),
+ verticalArrangement = Arrangement.spacedBy(8.dp),
+ horizontalArrangement = Arrangement.spacedBy(8.dp),
+ ) {
+ icons.forEach { icon ->
+ helpers.forEach { helper ->
+ TextFields(
+ modifier = Modifier.widthIn(max = 400.dp),
+ icon = icon,
+ value = stubBody,
+ enabled = true,
+ helper = helper,
+ )
+ }
+ }
+ }
+ }
+ }
+
+ @OptIn(ExperimentalLayoutApi::class)
+ @Test
+ fun smallValue() {
+ paparazzi.sparkSnapshot {
+ FlowColumn(
+ modifier = Modifier.padding(8.dp),
+ verticalArrangement = Arrangement.spacedBy(8.dp),
+ horizontalArrangement = Arrangement.spacedBy(8.dp),
+ ) {
+ icons.forEach { icon ->
+ helpers.forEach { helper ->
+ TextFields(
+ icon = icon,
+ value = stubShortBody,
+ enabled = true,
+ helper = helper,
+ )
+ }
+ }
+ }
+ }
+ }
+
+ @OptIn(ExperimentalLayoutApi::class)
+ @Test
+ fun enabled() {
+ paparazzi.sparkSnapshot {
+ FlowColumn(
+ modifier = Modifier.padding(8.dp),
+ verticalArrangement = Arrangement.spacedBy(8.dp),
+ horizontalArrangement = Arrangement.spacedBy(8.dp),
+ ) {
+ icons.forEach { icon ->
+ helpers.forEach { helper ->
+ TextFields(
+ icon = icon,
+ enabled = true,
+ helper = helper,
+ )
+ }
+ }
+ }
+ }
+ }
+
+ @OptIn(ExperimentalLayoutApi::class)
+ @Test
+ fun disabled() {
+ paparazzi.sparkSnapshot {
+ FlowColumn(
+ modifier = Modifier.padding(8.dp),
+ verticalArrangement = Arrangement.spacedBy(8.dp),
+ horizontalArrangement = Arrangement.spacedBy(8.dp),
+ ) {
+ icons.forEach { icon ->
+ helpers.forEach { helper ->
+ TextFields(
+ icon = icon,
+ enabled = false,
+ helper = helper,
+ )
+ }
+ }
+ }
+ }
+ }
+
+ @Composable
+ private fun TextFields(
+ modifier: Modifier = Modifier,
+ icon: SparkIcon?,
+ value: String = "",
+ enabled: Boolean,
+ helper: String?,
+ ) {
+ val leadingContent: (@Composable AddonScope.() -> Unit)? = icon?.let {
+ @Composable {
+ Icon(icon, contentDescription = null)
+ }
+ }
+ Column(
+ verticalArrangement = Arrangement.spacedBy(8.dp),
+ ) {
+ MultilineTextField(
+ modifier = modifier,
+ value = value,
+ onValueChange = {},
+ onCancelClick = {},
+ label = "Label",
+ leadingContent = leadingContent,
+ required = true,
+ enabled = enabled,
+ stateMessage = "short state message for textfield",
+ helper = helper,
+ minLines = 2,
+ )
+ MultilineTextField(
+ modifier = modifier,
+ value = value,
+ onValueChange = {},
+ onCancelClick = {},
+ label = "Label",
+ leadingContent = leadingContent,
+ state = TextFieldState.Error,
+ required = true,
+ enabled = enabled,
+ stateMessage = "short state message for textfield",
+ helper = helper,
+ minLines = 2,
+ )
+ MultilineTextField(
+ modifier = modifier,
+ value = value,
+ onValueChange = {},
+ onCancelClick = {},
+ label = "Label",
+ leadingContent = leadingContent,
+ state = TextFieldState.Alert,
+ required = true,
+ enabled = enabled,
+ stateMessage = "short state message for textfield",
+ helper = helper,
+ minLines = 2,
+ )
+ MultilineTextField(
+ modifier = modifier,
+ value = value,
+ onValueChange = {},
+ onCancelClick = {},
+ label = "Label",
+ leadingContent = leadingContent,
+ state = TextFieldState.Success,
+ required = true,
+ enabled = enabled,
+ stateMessage = "short state message for textfield",
+ helper = helper,
+ minLines = 2,
+ )
+ }
+ }
+
+ companion object {
+ private const val stubShortBody = "Lorem ipsum"
+ private const val stubBody = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi lacus dolor, " +
+ "pulvinar eu nulla sit amet, iaculis interdum."
+ }
+
+ internal abstract class DefaultMutableInteractionSource : MutableInteractionSource {
+ override suspend fun emit(interaction: Interaction) {
+ }
+
+ override fun tryEmit(interaction: Interaction): Boolean = true
+ }
+}
diff --git a/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/textfields/TextFieldDocScreenshot.kt b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/textfields/TextFieldDocScreenshot.kt
new file mode 100644
index 000000000..8f2b3fe15
--- /dev/null
+++ b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/textfields/TextFieldDocScreenshot.kt
@@ -0,0 +1,367 @@
+/*
+ * Copyright (c) 2023 Adevinta
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+package com.adevinta.spark.textfields
+
+import androidx.compose.foundation.interaction.FocusInteraction
+import androidx.compose.foundation.interaction.Interaction
+import androidx.compose.foundation.interaction.MutableInteractionSource
+import androidx.compose.foundation.interaction.PressInteraction
+import androidx.compose.foundation.layout.Arrangement
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.padding
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.geometry.Offset
+import androidx.compose.ui.unit.dp
+import com.adevinta.spark.DefaultTestDevices
+import com.adevinta.spark.components.icons.Icon
+import com.adevinta.spark.components.icons.IconSize
+import com.adevinta.spark.components.text.Text
+import com.adevinta.spark.components.textfields.AddonScope
+import com.adevinta.spark.components.textfields.MultilineTextField
+import com.adevinta.spark.components.textfields.SelectTextField
+import com.adevinta.spark.components.textfields.TextField
+import com.adevinta.spark.components.textfields.TextFieldCharacterCounter
+import com.adevinta.spark.components.textfields.TextFieldState
+import com.adevinta.spark.icons.LikeFill
+import com.adevinta.spark.icons.SparkIcons
+import com.adevinta.spark.paparazziRule
+import com.adevinta.spark.sparkSnapshotNightMode
+import com.android.ide.common.rendering.api.SessionParams.RenderingMode.SHRINK
+import kotlinx.coroutines.flow.flowOf
+import org.junit.Rule
+import org.junit.Test
+
+internal class TextFieldDocScreenshot {
+
+ @get:Rule
+ val paparazzi = paparazziRule(
+ deviceConfig = DefaultTestDevices.Tablet,
+ renderingMode = SHRINK,
+ )
+
+ @Test
+ fun textFieldShowcase() {
+ paparazzi.sparkSnapshotNightMode {
+ Row {
+ Textfields(
+ state = null,
+ stateMessage = "Helper text",
+ )
+ Textfields(
+ state = TextFieldState.Error,
+ stateMessage = "Error text",
+ )
+ Textfields(
+ state = TextFieldState.Alert,
+ stateMessage = "Alert text",
+ )
+ Textfields(
+ state = TextFieldState.Success,
+ stateMessage = "Success text",
+ )
+ }
+ }
+ }
+
+ @Test
+ fun multilineTextFieldShowcase() {
+ paparazzi.sparkSnapshotNightMode {
+ Row {
+ MultilineTextfields(
+ state = null,
+ stateMessage = "Helper text",
+ )
+ MultilineTextfields(
+ state = TextFieldState.Error,
+ stateMessage = "Error text",
+ )
+ MultilineTextfields(
+ state = TextFieldState.Alert,
+ stateMessage = "Alert text",
+ )
+ MultilineTextfields(
+ state = TextFieldState.Success,
+ stateMessage = "Success text",
+ )
+ }
+ }
+ }
+
+ @Test
+ fun selectTextFieldShowcase() {
+ paparazzi.sparkSnapshotNightMode {
+ Row {
+ SelectTextfields(
+ state = null,
+ stateMessage = "Helper text",
+ )
+ SelectTextfields(
+ state = TextFieldState.Error,
+ stateMessage = "Error text",
+ )
+ SelectTextfields(
+ state = TextFieldState.Alert,
+ stateMessage = "Alert text",
+ )
+ SelectTextfields(
+ state = TextFieldState.Success,
+ stateMessage = "Success text",
+ )
+ }
+ }
+ }
+
+ @Composable
+ private fun Textfields(
+ state: TextFieldState?,
+ stateMessage: String?,
+ ) {
+ Column(
+ modifier = Modifier.padding(8.dp),
+ verticalArrangement = Arrangement.spacedBy(8.dp),
+ ) {
+ val icon: @Composable (AddonScope.() -> Unit) = @Composable {
+ Icon(
+ sparkIcon = SparkIcons.LikeFill,
+ contentDescription = null,
+ size = IconSize.Medium,
+ )
+ }
+
+ Text("Unfocused with value")
+
+ TextField(
+ value = "Input",
+ onValueChange = {},
+ enabled = true,
+ state = state,
+ stateMessage = stateMessage,
+ required = true,
+ label = "Label",
+ placeholder = "Placeholder",
+ helper = "Helper text",
+ leadingContent = icon,
+ trailingContent = icon,
+ )
+
+ Text("Focused without value")
+
+ TextField(
+ value = "",
+ onValueChange = {},
+ enabled = true,
+ state = state,
+ stateMessage = stateMessage,
+ required = true,
+ label = "Label",
+ placeholder = "Placeholder",
+ helper = "Helper text",
+ leadingContent = icon,
+ trailingContent = icon,
+ interactionSource = object : DefaultMutableInteractionSource() {
+ override val interactions =
+ flowOf(FocusInteraction.Focus(), PressInteraction.Press(Offset.Zero))
+ },
+ )
+
+ Text("Unfocused without value")
+
+ TextField(
+ value = "",
+ onValueChange = {},
+ enabled = true,
+ state = state,
+ stateMessage = stateMessage,
+ required = true,
+ label = "Label",
+ placeholder = "Placeholder",
+ helper = "Helper text",
+ leadingContent = icon,
+ trailingContent = icon,
+ )
+ }
+ }
+
+ @Composable
+ private fun MultilineTextfields(
+ state: TextFieldState?,
+ stateMessage: String?,
+ ) {
+ Column(
+ modifier = Modifier.padding(8.dp),
+ verticalArrangement = Arrangement.spacedBy(8.dp),
+ ) {
+ val icon: @Composable (AddonScope.() -> Unit) = @Composable {
+ Icon(
+ sparkIcon = SparkIcons.LikeFill,
+ contentDescription = null,
+ size = IconSize.Medium,
+ )
+ }
+
+ Text("Unfocused with value")
+
+ MultilineTextField(
+ value = "Input",
+ onValueChange = {},
+ onCancelClick = {},
+ enabled = true,
+ state = state,
+ stateMessage = stateMessage,
+ required = true,
+ label = "Label",
+ placeholder = "Placeholder",
+ counter = TextFieldCharacterCounter(12, 24),
+ minLines = 3,
+ helper = "Helper text",
+ leadingContent = icon,
+ )
+
+ Text("Focused without value")
+
+ MultilineTextField(
+ value = "",
+ onValueChange = {},
+ onCancelClick = {},
+ enabled = true,
+ state = state,
+ stateMessage = stateMessage,
+ required = true,
+ label = "Label",
+ placeholder = "Placeholder",
+ helper = "Helper text",
+ leadingContent = icon,
+ minLines = 3,
+ interactionSource = object : DefaultMutableInteractionSource() {
+ override val interactions =
+ flowOf(FocusInteraction.Focus(), PressInteraction.Press(Offset.Zero))
+ },
+ )
+
+ Text("Unfocused without value")
+
+ MultilineTextField(
+ value = "",
+ onValueChange = {},
+ onCancelClick = {},
+ enabled = true,
+ state = state,
+ stateMessage = stateMessage,
+ required = true,
+ label = "Label",
+ placeholder = "Placeholder",
+ helper = "Helper text",
+ leadingContent = icon,
+ minLines = 3,
+ )
+ }
+ }
+
+ @Composable
+ private fun SelectTextfields(
+ state: TextFieldState?,
+ stateMessage: String?,
+ ) {
+ Column(
+ modifier = Modifier.padding(8.dp),
+ verticalArrangement = Arrangement.spacedBy(8.dp),
+ ) {
+ val icon: @Composable (AddonScope.() -> Unit) = @Composable {
+ Icon(
+ sparkIcon = SparkIcons.LikeFill,
+ contentDescription = null,
+ size = IconSize.Medium,
+ )
+ }
+
+ Text("Unfocused with value")
+
+ SelectTextField(
+ value = "Input",
+ onValueChange = {},
+ expanded = false,
+ onExpandedChange = {},
+ onDismissRequest = {},
+ enabled = true,
+ state = state,
+ stateMessage = stateMessage,
+ required = true,
+ label = "Label",
+ placeholder = "Placeholder",
+ helper = "Helper text",
+ leadingContent = icon,
+ dropdownContent = {},
+ )
+
+ Text("Focused without value")
+
+ SelectTextField(
+ value = "",
+ onValueChange = {},
+ expanded = false,
+ onExpandedChange = {},
+ onDismissRequest = {},
+ enabled = true,
+ state = state,
+ stateMessage = stateMessage,
+ required = true,
+ label = "Label",
+ placeholder = "Placeholder",
+ helper = "Helper text",
+ leadingContent = icon,
+ interactionSource = object : DefaultMutableInteractionSource() {
+ override val interactions =
+ flowOf(FocusInteraction.Focus(), PressInteraction.Press(Offset.Zero))
+ },
+ dropdownContent = {},
+ )
+
+ Text("Unfocused without value")
+
+ SelectTextField(
+ value = "",
+ onValueChange = {},
+ expanded = false,
+ onExpandedChange = {},
+ onDismissRequest = {},
+ enabled = true,
+ state = state,
+ stateMessage = stateMessage,
+ required = true,
+ label = "Label",
+ placeholder = "Placeholder",
+ helper = "Helper text",
+ leadingContent = icon,
+ dropdownContent = {},
+ )
+ }
+ }
+
+ internal abstract class DefaultMutableInteractionSource : MutableInteractionSource {
+ override suspend fun emit(interaction: Interaction) {
+ }
+
+ override fun tryEmit(interaction: Interaction): Boolean = true
+ }
+}
diff --git a/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/textfields/TextFieldScreenshot.kt b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/textfields/TextFieldScreenshot.kt
index a9e34be1f..3c3b8eb71 100644
--- a/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/textfields/TextFieldScreenshot.kt
+++ b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/textfields/TextFieldScreenshot.kt
@@ -23,148 +23,208 @@ package com.adevinta.spark.textfields
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.ExperimentalLayoutApi
+import androidx.compose.foundation.layout.FlowColumn
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.widthIn
import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
-import app.cash.paparazzi.Paparazzi
-import com.adevinta.spark.MaxPercentDifference
-import com.adevinta.spark.PaparazziTheme
+import com.adevinta.spark.DefaultTestDevices
import com.adevinta.spark.components.icons.Icon
import com.adevinta.spark.components.textfields.AddonScope
import com.adevinta.spark.components.textfields.TextField
import com.adevinta.spark.components.textfields.TextFieldState
import com.adevinta.spark.icons.Check
-import com.adevinta.spark.icons.EyeOffFill
import com.adevinta.spark.icons.SparkIcon
import com.adevinta.spark.icons.SparkIcons
-import com.adevinta.spark.patchedEnvironment
+import com.adevinta.spark.paparazziRule
import com.adevinta.spark.sparkSnapshot
-import com.android.ide.common.rendering.api.SessionParams
-import com.google.testing.junit.testparameterinjector.TestParameterInjector
-import org.junit.Ignore
+import com.android.ide.common.rendering.api.SessionParams.RenderingMode.SHRINK
import org.junit.Rule
import org.junit.Test
-import org.junit.runner.RunWith
-@RunWith(TestParameterInjector::class)
internal class TextFieldScreenshot {
- private val values: List = listOf("", stubShortBody, stubBody)
+ private val icons: List = listOf(SparkIcons.Check, null)
- private val leadingIcons: List = listOf(SparkIcons.Check, null)
-
- private val trailingIcons: List = listOf(SparkIcons.EyeOffFill, null)
-
- private val enableds: List = listOf(true, false)
private val helpers: List = listOf(null, stubBody)
@get:Rule
- val paparazzi = Paparazzi(
- maxPercentDifference = MaxPercentDifference,
- theme = PaparazziTheme,
- renderingMode = SessionParams.RenderingMode.SHRINK,
- showSystemUi = false,
- environment = patchedEnvironment(),
+ val paparazzi = paparazziRule(
+ deviceConfig = DefaultTestDevices.Tablet,
+ renderingMode = SHRINK,
)
+ @OptIn(ExperimentalLayoutApi::class)
+ @Test
+ fun bigValue() {
+ paparazzi.sparkSnapshot {
+ FlowColumn(
+ modifier = Modifier.padding(8.dp),
+ verticalArrangement = Arrangement.spacedBy(8.dp),
+ horizontalArrangement = Arrangement.spacedBy(8.dp),
+ ) {
+ icons.forEach { icon ->
+ helpers.forEach { helper ->
+ TextFields(
+ modifier = Modifier.widthIn(max = 400.dp),
+ icon = icon,
+ value = stubBody,
+ enabled = true,
+ helper = helper,
+ )
+ }
+ }
+ }
+ }
+ }
+
+ @OptIn(ExperimentalLayoutApi::class)
+ @Test
+ fun smallValue() {
+ paparazzi.sparkSnapshot {
+ FlowColumn(
+ modifier = Modifier.padding(8.dp),
+ verticalArrangement = Arrangement.spacedBy(8.dp),
+ horizontalArrangement = Arrangement.spacedBy(8.dp),
+ ) {
+ icons.forEach { icon ->
+ helpers.forEach { helper ->
+ TextFields(
+ icon = icon,
+ value = stubShortBody,
+ enabled = true,
+ helper = helper,
+ )
+ }
+ }
+ }
+ }
+ }
+
+ @OptIn(ExperimentalLayoutApi::class)
+ @Test
+ fun enabled() {
+ paparazzi.sparkSnapshot {
+ FlowColumn(
+ modifier = Modifier.padding(8.dp),
+ verticalArrangement = Arrangement.spacedBy(8.dp),
+ horizontalArrangement = Arrangement.spacedBy(8.dp),
+ ) {
+ icons.forEach { icon ->
+ helpers.forEach { helper ->
+ TextFields(
+ icon = icon,
+ enabled = true,
+ helper = helper,
+ )
+ }
+ }
+ }
+ }
+ }
+
+ @OptIn(ExperimentalLayoutApi::class)
@Test
- @Ignore("This needs to be re-worked to avoid generating 48 PNGs that are almost identical.")
- fun test() {
- values.forEach { value ->
- leadingIcons.forEach { leadingIcon ->
- trailingIcons.forEach { trailingIcon ->
- enableds.forEach { enabled ->
- helpers.forEach { helper ->
- paparazzi.sparkSnapshot(
- name = "_value.${value.count()}" +
- leadingIcon?.let { "_leadingIcon" }.orEmpty() +
- trailingIcon?.let { "_trailingIcon" }.orEmpty() +
- "_enabled".takeIf { enabled }.orEmpty() +
- helper?.let { "_helper.${helper.count()}" }.orEmpty(),
- ) {
- val leadingContent: (@Composable AddonScope.() -> Unit)? = leadingIcon?.let {
- @Composable {
- Icon(it, contentDescription = null)
- }
- }
- val trailingContent: (@Composable AddonScope.() -> Unit)? = trailingIcon?.let {
- @Composable {
- Icon(it, contentDescription = null)
- }
- }
- Column(
- verticalArrangement = Arrangement.spacedBy(8.dp),
- ) {
- TextField(
- value = value,
- onValueChange = {},
- label = "Label",
- leadingContent = leadingContent,
- trailingContent = trailingContent,
- required = true,
- enabled = enabled,
- stateMessage = "short state message for textfield",
- helper = helper,
- )
- TextField(
- value = value,
- onValueChange = {},
- label = "Label",
- leadingContent = leadingContent,
- trailingContent = trailingContent,
- state = TextFieldState.Error,
- required = true,
- enabled = enabled,
- stateMessage = "short state message for textfield",
- helper = helper,
- )
- TextField(
- value = value,
- onValueChange = {},
- label = "Label",
- leadingContent = leadingContent,
- trailingContent = trailingContent,
- state = TextFieldState.Alert,
- required = true,
- enabled = enabled,
- stateMessage = "short state message for textfield",
- helper = helper,
- )
- TextField(
- value = value,
- onValueChange = {},
- label = "Label",
- leadingContent = leadingContent,
- trailingContent = trailingContent,
- state = TextFieldState.Success,
- required = true,
- enabled = enabled,
- stateMessage = "short state message for textfield",
- helper = helper,
- )
- }
- }
- }
+ fun disabled() {
+ paparazzi.sparkSnapshot {
+ FlowColumn(
+ modifier = Modifier.padding(8.dp),
+ verticalArrangement = Arrangement.spacedBy(8.dp),
+ horizontalArrangement = Arrangement.spacedBy(8.dp),
+ ) {
+ icons.forEach { icon ->
+ helpers.forEach { helper ->
+ TextFields(
+ icon = icon,
+ enabled = false,
+ helper = helper,
+ )
}
}
}
}
}
+ @Composable
+ private fun TextFields(
+ modifier: Modifier = Modifier,
+ icon: SparkIcon?,
+ value: String = "",
+ enabled: Boolean,
+ helper: String?,
+ ) {
+ val leadingContent: (@Composable AddonScope.() -> Unit)? = icon?.let {
+ @Composable {
+ Icon(icon, contentDescription = null)
+ }
+ }
+ val trailingContent: (@Composable AddonScope.() -> Unit)? = icon?.let {
+ @Composable {
+ Icon(icon, contentDescription = null)
+ }
+ }
+ Column(
+ verticalArrangement = Arrangement.spacedBy(8.dp),
+ ) {
+ TextField(
+ modifier = modifier,
+ value = value,
+ onValueChange = {},
+ label = "Label",
+ leadingContent = leadingContent,
+ trailingContent = trailingContent,
+ required = true,
+ enabled = enabled,
+ stateMessage = "short state message for textfield",
+ helper = helper,
+ )
+ TextField(
+ modifier = modifier,
+ value = value,
+ onValueChange = {},
+ label = "Label",
+ leadingContent = leadingContent,
+ trailingContent = trailingContent,
+ state = TextFieldState.Error,
+ required = true,
+ enabled = enabled,
+ stateMessage = "short state message for textfield",
+ helper = helper,
+ )
+ TextField(
+ modifier = modifier,
+ value = value,
+ onValueChange = {},
+ label = "Label",
+ leadingContent = leadingContent,
+ trailingContent = trailingContent,
+ state = TextFieldState.Alert,
+ required = true,
+ enabled = enabled,
+ stateMessage = "short state message for textfield",
+ helper = helper,
+ )
+ TextField(
+ modifier = modifier,
+ value = value,
+ onValueChange = {},
+ label = "Label",
+ leadingContent = leadingContent,
+ trailingContent = trailingContent,
+ state = TextFieldState.Success,
+ required = true,
+ enabled = enabled,
+ stateMessage = "short state message for textfield",
+ helper = helper,
+ )
+ }
+ }
+
companion object {
private const val stubShortBody = "Lorem ipsum"
private const val stubBody = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi lacus dolor, " +
"pulvinar eu nulla sit amet, iaculis interdum."
}
}
-
-public class LeadingIcon(public val icon: SparkIcon?) {
- override fun toString(): String = icon?.let { "_leadingIcon" }.orEmpty()
-}
-
-public class TrailingIcon(public val icon: SparkIcon?) {
- override fun toString(): String = icon?.let { "_trailingIcon" }.orEmpty()
-}
-
-public class StringValue(public val value: String?) {
- override fun toString(): String = value?.let { "_string.${value.count()}" }.orEmpty()
-}
diff --git a/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/tokens/ColorsScreenshot.kt b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/tokens/ColorsScreenshot.kt
index 5726c60a3..263156f13 100644
--- a/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/tokens/ColorsScreenshot.kt
+++ b/spark-screenshot-testing/src/test/kotlin/com/adevinta/spark/tokens/ColorsScreenshot.kt
@@ -40,17 +40,14 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalInspectionMode
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
-import app.cash.paparazzi.DeviceConfig
-import app.cash.paparazzi.Paparazzi
-import com.adevinta.spark.MaxPercentDifference
-import com.adevinta.spark.PaparazziTheme
+import com.adevinta.spark.DefaultTestDevices
import com.adevinta.spark.SparkTheme
import com.adevinta.spark.components.surface.Surface
import com.adevinta.spark.components.text.Text
+import com.adevinta.spark.paparazziRule
import com.adevinta.spark.sparkSnapshot
import com.adevinta.spark.tools.preview.ThemeVariant
import com.adevinta.spark.tools.preview.ThemeVariant.Light
-import com.android.ide.common.rendering.api.SessionParams
import org.junit.Rule
import org.junit.Test
import kotlin.reflect.KProperty0
@@ -58,15 +55,8 @@ import kotlin.reflect.KProperty0
internal class ColorsScreenshot {
@get:Rule
- val paparazzi = Paparazzi(
- maxPercentDifference = MaxPercentDifference,
- theme = PaparazziTheme,
- renderingMode = SessionParams.RenderingMode.SHRINK,
- deviceConfig = DeviceConfig.PIXEL_C.copy(
- softButtons = false,
- locale = "fr-rFR",
- ),
- showSystemUi = true,
+ val paparazzi = paparazziRule(
+ deviceConfig = DefaultTestDevices.Tablet,
)
private val colors
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconButtonScreenshot_disabled.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconButtonScreenshot_disabled.png
new file mode 100644
index 000000000..ee7419fff
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconButtonScreenshot_disabled.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:21a2cf87ca58d32b29c41b20f20e0f0c0fb6cd320166e8aa33f06173930a5be2
+size 113192
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconButtonScreenshot_enabled.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconButtonScreenshot_enabled.png
new file mode 100644
index 000000000..2ee7c4d4d
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconButtonScreenshot_enabled.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9128c1d5f44188d6f59210b3ae449365f2e544d992df60c338b3f5e74c79cdf3
+size 128128
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconButtonScreenshot_shape.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconButtonScreenshot_shape.png
new file mode 100644
index 000000000..c353459c7
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconButtonScreenshot_shape.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:16bb835c9bb8d3e6923e86196400d736a46a5a246dd22b9bd7fe44eb5acaa828
+size 46498
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconButtonScreenshot_test_large.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconButtonScreenshot_test_large.png
deleted file mode 100644
index f19c997d7..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconButtonScreenshot_test_large.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:76c1c0d1deddcde10ca5b7dbb20464312f85a0c95e22fa48a596f3d0a84efbd2
-size 162543
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconButtonScreenshot_test_medium.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconButtonScreenshot_test_medium.png
deleted file mode 100644
index 7993b6891..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconButtonScreenshot_test_medium.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:76f5256108bcbc659c67cdfa94bfb44c8e0f9f85107540754f2daa92930278b2
-size 175479
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconButtonScreenshot_test_small.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconButtonScreenshot_test_small.png
deleted file mode 100644
index 7ea497788..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconButtonScreenshot_test_small.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:c2da0f6ad553df18034ee3bb9fdd82930aed94497c38962adae98452dba1fdc5
-size 168226
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_disabled.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_disabled.png
new file mode 100644
index 000000000..256837079
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_disabled.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f27298d47aa7ac752e299efc973486059586ac29d18b28603726c5705ace3aed
+size 128949
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_enabled.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_enabled.png
new file mode 100644
index 000000000..bbd137e00
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_enabled.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d53d42a25dea1fca53f8597b97be4003572d72235c722d11b269b479efaff4aa
+size 148729
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_shape.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_shape.png
new file mode 100644
index 000000000..7b00eea17
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_shape.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c980be64539858eaa30dae7dd8066604000aac0e65bdffda5f3a7c459127d6d7
+size 30164
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_test_pill_large.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_test_pill_large.png
deleted file mode 100644
index 9ab67476f..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_test_pill_large.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:55ac8c6d21d5903aefc15f5a0d95de790eb887e93aeb1858be093e0b0bf1f92d
-size 113019
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_test_pill_medium.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_test_pill_medium.png
deleted file mode 100644
index 06ce57809..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_test_pill_medium.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:964943e6849d8846080470df697b83fce922656a78f91bcfd1cf045f28aa736b
-size 102152
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_test_pill_small.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_test_pill_small.png
deleted file mode 100644
index 94d9bf85d..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_test_pill_small.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:e9ac37f91ec6579828546474193bb9f87f7b0ef013a731e44db639091572592a
-size 88611
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_test_rounded_large.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_test_rounded_large.png
deleted file mode 100644
index 26167a7d7..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_test_rounded_large.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:f2d86e8849882f690f4b62bc727e1813a4751c713cbc42579d1b2a9ab52140e5
-size 99122
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_test_rounded_medium.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_test_rounded_medium.png
deleted file mode 100644
index 7e7c50fab..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_test_rounded_medium.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:657ca8052b41e2cebb80a37f1c46bb49ff7a47d0932cba6dd36465e446804910
-size 94083
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_test_rounded_small.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_test_rounded_small.png
deleted file mode 100644
index 94d9bf85d..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_test_rounded_small.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:e9ac37f91ec6579828546474193bb9f87f7b0ef013a731e44db639091572592a
-size 88611
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_test_square_large.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_test_square_large.png
deleted file mode 100644
index 827265e1a..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_test_square_large.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:0e92400abe1e5770dd114a92355b03c71bf9b2437cae332b4ee3f1d092e4d578
-size 74581
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_test_square_medium.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_test_square_medium.png
deleted file mode 100644
index cfec50a39..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_test_square_medium.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:cf1a1139100c11f96c61a5d0264f64fdb6eec2f9d5149c3d4b524fa66213f73f
-size 69265
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_test_square_small.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_test_square_small.png
deleted file mode 100644
index e6705428f..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.iconbutton_IconToggleButtonScreenshot_test_square_small.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:6eaaa35f37f20687443e566267448e7c42599427651512cb5e7146c821e6d14d
-size 70285
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[Bath].png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[Bath].png
index d8611fe38..247b83e4e 100644
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[Bath].png
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[Bath].png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:562208fda8d7255f26a139077b4cd6167d4ad88877031da2488e9afe53304c80
-size 1268
+oid sha256:2dc8751964c6b18a2cb2da6dda5e41901a116cc1f664b292842540e7ccdd4f0b
+size 1266
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[ClockOutline].png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[ClockOutline].png
index a8b72544f..2093b189d 100644
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[ClockOutline].png
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[ClockOutline].png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:8743d78de194c27fa4e2f3051c667fdc8ba56fc5926a2875ebfeaf58b4752ee8
-size 3151
+oid sha256:9c4703dce959a5916e672dab8a7c7969e828aec55a65cdf22eb895b164468ad4
+size 3148
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[DissatisfiedFill].png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[DissatisfiedFill].png
index b02f05ebf..e225e7e45 100644
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[DissatisfiedFill].png
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[DissatisfiedFill].png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:d4304bb3d482efb26dbed19043b247b9bbe9351b2d5bf4d6032755280634297d
-size 1872
+oid sha256:6f063bde0fca5541a3714ec4d57b1aaff88be576b3168d7ad90540b136c88862
+size 1873
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[DumpTruck].png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[DumpTruck].png
index 7810aa275..3a2b0af3c 100644
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[DumpTruck].png
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[DumpTruck].png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:4561abb10789c13053f766d8017b140361e1da2e08fc549f222f2c93cb70c4ba
-size 2584
+oid sha256:477dcaf655ad3d11917c6aee1c494e08c7b93144af974f6964bcfcae435783f8
+size 2585
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[House].png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[House].png
index 4d331b6ab..d6b3ee60b 100644
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[House].png
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[House].png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:092f9643ff32093680b26cae388d5a908aafb6a0c9acce2e0b4bfc60bf481766
-size 2272
+oid sha256:52892d93e649044ad639d10595a453c522275b13324b01ea1bfed3c02ddf0106
+size 2270
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[MoneyOutline].png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[MoneyOutline].png
index 2ff1f880d..a9d7e6ab9 100644
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[MoneyOutline].png
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[MoneyOutline].png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:c742f3c309b548dbe2000f4108068976d47a0b6f514ac17f9d1e01b2095a9bc3
+oid sha256:24a193f52873d1f4fce399124ae0e7089648dc6b857070e739c3c947580a645a
size 2777
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[PauseOutline].png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[PauseOutline].png
index 593594221..8113dc76a 100644
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[PauseOutline].png
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[PauseOutline].png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:f999c7b4d48278161f5b6ca3375eb6600417950fcd10e20e5ce5a719e5d622d3
-size 3418
+oid sha256:4539ee592e2da1e0680385fd4d875c6fe601952f6adaeb2bfa387acb27632bc4
+size 3415
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[Pinterest].png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[Pinterest].png
index 153f25ed6..f46118325 100644
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[Pinterest].png
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[Pinterest].png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:80d8f9b6183610e321062aeaea274be8a8a5a75ae254071e9e1cb151c94dab7d
-size 2658
+oid sha256:04c4ae739ad471423e5c7072056175dba566df2af4ced1ad6a97edad4558c98c
+size 2657
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[VoiceOffFill].png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[VoiceOffFill].png
index c88221858..b31464de1 100644
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[VoiceOffFill].png
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[VoiceOffFill].png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:5fa4b2a0202e61c4eb10d33f2873c5f215ec8be4b27c9d37c289bbc5fabd0c31
+oid sha256:430521b8f0c85171c24e34667d0c2b170d4cc93c4c74fe76ab6fa06932012ff1
size 2235
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[WheelRim].png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[WheelRim].png
index 5367d95af..a98757234 100644
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[WheelRim].png
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.icons_IconsScreenshot_render[WheelRim].png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:0fdeae50f34e42e6f8344f67da080966a2a20ff77a3636775c6c6ad53a0cd4a3
-size 3561
+oid sha256:760e5b0eb0abda14eaf9297a473b45e44bd896970cbaec6f4c8e5780c5129e18
+size 3560
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.popover_PopoverScreenshot_test_popover_isdismissenabled_false.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.popover_PopoverScreenshot_test_popover_isdismissenabled_false.png
deleted file mode 100644
index decdb27ca..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.popover_PopoverScreenshot_test_popover_isdismissenabled_false.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:ffec2ea8b5c3f3dc2b62b23c2c6d2ea4568771ed1db7487e540d9a80e4865bde
-size 7051
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.popover_PopoverScreenshot_test_popover_isdismissenabled_true.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.popover_PopoverScreenshot_test_popover_isdismissenabled_true.png
deleted file mode 100644
index 040838951..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.popover_PopoverScreenshot_test_popover_isdismissenabled_true.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:058ad83322661d5eecc9f9098c40b0aabc552c135f4f23d993a88370cca090ac
-size 7210
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_normal.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_normal.png
new file mode 100644
index 000000000..2ba8a7909
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_normal.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c45fae8dadea20ec95f3910571f7af93e24be93a63b0a5203e8a4c60ad5ed84d
+size 7065
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_rounded.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_rounded.png
new file mode 100644
index 000000000..610014ff2
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_rounded.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8a028395d5115b63ff159f1401263726b6f53b95ac759286d9288cfd4d51f8d9
+size 16341
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_accent_rounded_border_false.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_accent_rounded_border_false.png
deleted file mode 100644
index 75ccd6905..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_accent_rounded_border_false.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:47c77b3933df33fe89c86068f57015b9428e9ab570188aaceb850de27f3664f0
-size 12673
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_accent_rounded_border_true.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_accent_rounded_border_true.png
deleted file mode 100644
index b14c3a108..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_accent_rounded_border_true.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:d4f6145842efc21d32f09a095be9bde91bd01ca66d97a5625abd29937265675a
-size 12412
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_alert_rounded_border_false.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_alert_rounded_border_false.png
deleted file mode 100644
index f489f07e9..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_alert_rounded_border_false.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:497624b94526275f67ccbacbe40000c28a82854ce9cdf8f72686c817fe361139
-size 11942
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_alert_rounded_border_true.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_alert_rounded_border_true.png
deleted file mode 100644
index 8a2819daa..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_alert_rounded_border_true.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:7c5b79a2ec97189da9be13e287324c01cabaeb08ab99d51c09805dcc81809b5d
-size 11630
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_basic_rounded_border_false.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_basic_rounded_border_false.png
deleted file mode 100644
index cff432705..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_basic_rounded_border_false.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:0aaf49d3b4cde958bea37eecbf5d855e13ece8062950d0903eaf1719f75a3728
-size 12461
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_basic_rounded_border_true.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_basic_rounded_border_true.png
deleted file mode 100644
index 277776b4b..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_basic_rounded_border_true.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:113d5b55bd59b694743c2fbe753b4ecf667dcc5c45d81eb587761df198bd65db
-size 12113
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_danger_rounded_border_false.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_danger_rounded_border_false.png
deleted file mode 100644
index ffe302fa8..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_danger_rounded_border_false.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:840b25f85294c9ee91666c6138a64c6eb37daedcc9d51160f8831fe5971d27c1
-size 12720
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_danger_rounded_border_true.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_danger_rounded_border_true.png
deleted file mode 100644
index e7062e6a2..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_danger_rounded_border_true.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:f27af4592ce75b31429545da2d85a33f0a22c2ec73ed09eaf0e0219f4b01495e
-size 12356
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_info_rounded_border_false.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_info_rounded_border_false.png
deleted file mode 100644
index 738f1e978..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_info_rounded_border_false.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:f2d3eb5adf07bce0239cc62bc6d62280da0403ae83a2c33eaf3d444ce2ce860b
-size 11374
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_info_rounded_border_true.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_info_rounded_border_true.png
deleted file mode 100644
index ea6c8bf71..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_info_rounded_border_true.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:1cb5e544be160f1301d0e5b576c0edf7572e90b5aac0db37b263095a536c3d00
-size 11115
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_main_rounded_border_false.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_main_rounded_border_false.png
deleted file mode 100644
index dfe98771f..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_main_rounded_border_false.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:37502d4bddee8c2bb008b5d4929b27a8f2d2837230464c3e2129e3cd0585a9d8
-size 11343
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_main_rounded_border_true.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_main_rounded_border_true.png
deleted file mode 100644
index 9d9c5f3c5..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_main_rounded_border_true.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:d8d8c09968c88f37ef896894f8b550526520fe2e952f6f50e5d113c78bca8eab
-size 11344
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_neutral_rounded_border_false.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_neutral_rounded_border_false.png
deleted file mode 100644
index 6132ff0b4..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_neutral_rounded_border_false.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:1fb7ac94ef579cd554fb82ae20bea7e12a0371d13a596ce6e2d3ee82777a5556
-size 12379
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_neutral_rounded_border_true.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_neutral_rounded_border_true.png
deleted file mode 100644
index 3e512394c..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_neutral_rounded_border_true.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:5bd113c04fa59b1aba2c11ab8fdea37147d6da6c1548342bf79d3a9cdf89a014
-size 12143
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_success_rounded_border_false.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_success_rounded_border_false.png
deleted file mode 100644
index 2b7f4ac7e..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_success_rounded_border_false.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:566bd99107be7dc48c4e85fe18f67771f5e0150ed0cab2f2a5e91da80892c405
-size 13063
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_success_rounded_border_true.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_success_rounded_border_true.png
deleted file mode 100644
index a39be56a8..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_success_rounded_border_true.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:9905e0abd85690d8de63584f1fc39080becc568113cac1d45c1ac1f28d20025b
-size 12838
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_support_rounded_border_false.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_support_rounded_border_false.png
deleted file mode 100644
index dec8aa0a9..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_support_rounded_border_false.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:7af2a3e2d9890dfdb2ddf841b202f0d85630b50079be1a5bed889edb17602642
-size 12945
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_support_rounded_border_true.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_support_rounded_border_true.png
deleted file mode 100644
index 392354034..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.progress_ProgressScreenshot_test_intent_support_rounded_border_true.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:52f9b5b44baee25778794fbbcbacbe83ecd16e3d1e2d6a31dd5daff0c0efe450
-size 12490
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.snackbar_SnackbarDocScreenshot_snackbarColorsShowcase__dark.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.snackbar_SnackbarDocScreenshot_snackbarColorsShowcase__dark.png
new file mode 100644
index 000000000..fac96617e
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.snackbar_SnackbarDocScreenshot_snackbarColorsShowcase__dark.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6f31623d69cba32956d8be1a7ea8989cd09b0c92cec53a255bfdcc23cbfd2c01
+size 38141
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.snackbar_SnackbarDocScreenshot_snackbarColorsShowcase__light.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.snackbar_SnackbarDocScreenshot_snackbarColorsShowcase__light.png
new file mode 100644
index 000000000..3dbcd2348
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.snackbar_SnackbarDocScreenshot_snackbarColorsShowcase__light.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a3225c1ee1b3905bea9d2909e78e0182e5d2f32682739de05d86531d7a546398
+size 37691
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.snackbar_SnackbarScreenshot_snackBar__dark.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.snackbar_SnackbarScreenshot_snackBar__dark.png
new file mode 100644
index 000000000..ba3c92e58
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.snackbar_SnackbarScreenshot_snackBar__dark.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:69443c2b8c0bff7ec8d25b1c8f19284dd84f4d26fccfd7fe06f30468b003df1b
+size 187593
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.snackbar_SnackbarScreenshot_snackBar__light.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.snackbar_SnackbarScreenshot_snackBar__light.png
new file mode 100644
index 000000000..fc1a8bccf
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.snackbar_SnackbarScreenshot_snackBar__light.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:fd7319732dda2048cdd047987722329e83374c0f6e0f00af54f719399dbf155c
+size 180265
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.tab_TabsDocScreenshot_tabsIntentShowcase__dark.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.tab_TabsDocScreenshot_tabsIntentShowcase__dark.png
new file mode 100644
index 000000000..3c74bc72a
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.tab_TabsDocScreenshot_tabsIntentShowcase__dark.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9b776f2ae51d4f505158e18b0ca4dea4cd207253d6f15d7bfa422afd75193153
+size 28003
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.tab_TabsDocScreenshot_tabsIntentShowcase__light.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.tab_TabsDocScreenshot_tabsIntentShowcase__light.png
new file mode 100644
index 000000000..48281ffed
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.tab_TabsDocScreenshot_tabsIntentShowcase__light.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:068d12a246ab61090db89172e60114658d120fdf29a886e506724776ad205396
+size 27891
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.tab_TabsDocScreenshot_tabsSizeShowcase.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.tab_TabsDocScreenshot_tabsSizeShowcase.png
new file mode 100644
index 000000000..69d3f9a11
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.tab_TabsDocScreenshot_tabsSizeShowcase.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:939bc00b0885c9d6ce36dee83650c76197b7f2367a102d48f1f070629ebc740c
+size 25788
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.tab_TabsDocScreenshot_tabsSpacingShowcase.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.tab_TabsDocScreenshot_tabsSpacingShowcase.png
new file mode 100644
index 000000000..2ce3a6be8
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.tab_TabsDocScreenshot_tabsSpacingShowcase.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:03db60ec7fa3c2de74d0c938b91646cb9d4b0700cc76f748481827b65d9b4c08
+size 18672
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.tab_TabsScreenshot_disabled.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.tab_TabsScreenshot_disabled.png
new file mode 100644
index 000000000..dc44e7fe3
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.tab_TabsScreenshot_disabled.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1bf89925d3f4e4bd2f6bbccc5a0a7619d4695c1d261ab6a44201763c245ea4a1
+size 55986
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.tab_TabsScreenshot_enabled.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.tab_TabsScreenshot_enabled.png
new file mode 100644
index 000000000..7e3513028
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.tab_TabsScreenshot_enabled.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0c91554a6d86584d4c219004ce5eafe001a4d82bb4925fe6e63152f3ea7357bd
+size 62556
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.text_TextLinkScreenshot_frenchVariant__dark.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.text_TextLinkScreenshot_frenchVariant__dark.png
new file mode 100644
index 000000000..61f41e860
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.text_TextLinkScreenshot_frenchVariant__dark.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d7205421e286aaf493fb1c39730ce3981e925feb480cb8da998f0e036bf50106
+size 53062
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.text_TextLinkScreenshot_frenchVariant__light.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.text_TextLinkScreenshot_frenchVariant__light.png
new file mode 100644
index 000000000..f0fbadaa1
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.text_TextLinkScreenshot_frenchVariant__light.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0fbeffedb7b5d90d3ca504d3a10125961f33dfe9f66ef8c79bf7ad61c907ea92
+size 49979
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.text_TextLinkScreenshot_testTextLinkButton_textlinkbutton.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.text_TextLinkScreenshot_testTextLinkButton_textlinkbutton.png
deleted file mode 100644
index ab2dc7471..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.text_TextLinkScreenshot_testTextLinkButton_textlinkbutton.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:611b69087e0706d2968e5a782d06fa0bb63aa68c4cfe99492bb83df3f5ef83cc
-size 9282
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.text_TextLinkScreenshot_testTextLink__dark.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.text_TextLinkScreenshot_testTextLink__dark.png
new file mode 100644
index 000000000..e1d0269d4
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.text_TextLinkScreenshot_testTextLink__dark.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:defe442eba3f371c760f78ef13a7076090ed1bbbcaa40340af78a4037bbe91a7
+size 27545
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.text_TextLinkScreenshot_testTextLink__light.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.text_TextLinkScreenshot_testTextLink__light.png
new file mode 100644
index 000000000..08bd88500
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.text_TextLinkScreenshot_testTextLink__light.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a66dbbf6e19692d1d5cdfefb01e97e1b6931ab922711e0eabba22d451630fb79
+size 25186
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.text_TextLinkScreenshot_testTextLink_textlink.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.text_TextLinkScreenshot_testTextLink_textlink.png
deleted file mode 100644
index 375ca265d..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.text_TextLinkScreenshot_testTextLink_textlink.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:f9ed8b37d036f64efcca367debfb72921391e2af82f9e4332365b318ae5da2b9
-size 15497
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_MultilineTextFieldScreenshot_bigValue.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_MultilineTextFieldScreenshot_bigValue.png
new file mode 100644
index 000000000..13233c3ed
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_MultilineTextFieldScreenshot_bigValue.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:952ea3b44411e8da7c329923a8fbcb98ebf771bb15308b7b1fb6b68d95115df9
+size 169836
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_MultilineTextFieldScreenshot_disabled.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_MultilineTextFieldScreenshot_disabled.png
new file mode 100644
index 000000000..37bd8b0c4
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_MultilineTextFieldScreenshot_disabled.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e43f31dd9a07a5259482b5f032008a754fd21a224df6d206d8cb6223bed8c5d1
+size 93378
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_MultilineTextFieldScreenshot_enabled.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_MultilineTextFieldScreenshot_enabled.png
new file mode 100644
index 000000000..ec07ed9fe
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_MultilineTextFieldScreenshot_enabled.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d83cb09512d43488296b25b7cbcf4228f56fe9d9357a28ea7c2522964abf11d5
+size 98841
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_MultilineTextFieldScreenshot_showcase__dark.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_MultilineTextFieldScreenshot_showcase__dark.png
new file mode 100644
index 000000000..38e1c7555
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_MultilineTextFieldScreenshot_showcase__dark.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:41cdae1970a67370c0e52ae1f66ae75f0c2c710e19aadc165be274ada03d0bf3
+size 52177
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_MultilineTextFieldScreenshot_showcase__light.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_MultilineTextFieldScreenshot_showcase__light.png
new file mode 100644
index 000000000..9f5e9103c
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_MultilineTextFieldScreenshot_showcase__light.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8ae2f99cf7a55e0df87d388681955549e7a56318daaca9b1240e71997bc97f2a
+size 49822
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_MultilineTextFieldScreenshot_smallValue.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_MultilineTextFieldScreenshot_smallValue.png
new file mode 100644
index 000000000..6d5643352
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_MultilineTextFieldScreenshot_smallValue.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c2f4629fe47124f2f116779d37b1ff3935433387448452a0db0bbb938b706548
+size 123988
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_TextFieldDocScreenshot_multilineTextFieldShowcase__dark.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_TextFieldDocScreenshot_multilineTextFieldShowcase__dark.png
new file mode 100644
index 000000000..abd54b640
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_TextFieldDocScreenshot_multilineTextFieldShowcase__dark.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a0278e1b7052dad67acb87fa540d4effbee7160425fc3a5fe2f145bf3c0c6b00
+size 54152
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_TextFieldDocScreenshot_multilineTextFieldShowcase__light.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_TextFieldDocScreenshot_multilineTextFieldShowcase__light.png
new file mode 100644
index 000000000..89756c374
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_TextFieldDocScreenshot_multilineTextFieldShowcase__light.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4d50cc7e66c5a8634492e7bb46f7adfa3bb73cf9afcc371db0711b661f0129e7
+size 51744
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_TextFieldDocScreenshot_selectTextFieldShowcase__dark.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_TextFieldDocScreenshot_selectTextFieldShowcase__dark.png
new file mode 100644
index 000000000..707fc52ec
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_TextFieldDocScreenshot_selectTextFieldShowcase__dark.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6967a133d7a46352ce0d817498963203c17adf3c0bf3ecb032a0ebfcdb67153f
+size 49925
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_TextFieldDocScreenshot_selectTextFieldShowcase__light.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_TextFieldDocScreenshot_selectTextFieldShowcase__light.png
new file mode 100644
index 000000000..416ea3082
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_TextFieldDocScreenshot_selectTextFieldShowcase__light.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:53d7436d7985ca437b365176e2bd3eb37102780466d2e5d1f5f25122e7f867a9
+size 47671
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_TextFieldDocScreenshot_textFieldShowcase__dark.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_TextFieldDocScreenshot_textFieldShowcase__dark.png
new file mode 100644
index 000000000..2448e1236
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_TextFieldDocScreenshot_textFieldShowcase__dark.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ee1da6eddf3c09a4ed434f4b02f7eef04ecf75aa24e9672a5652831707a633be
+size 50066
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_TextFieldDocScreenshot_textFieldShowcase__light.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_TextFieldDocScreenshot_textFieldShowcase__light.png
new file mode 100644
index 000000000..fb9aef16f
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_TextFieldDocScreenshot_textFieldShowcase__light.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ccb567a978d432dd1eadfd1fca4e55dec0e5ac96986244a9d1fd73975eea54ad
+size 47786
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_TextFieldScreenshot_bigValue.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_TextFieldScreenshot_bigValue.png
new file mode 100644
index 000000000..43ed2ffb5
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_TextFieldScreenshot_bigValue.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5c8ab563860b5c99c653a2bd4a6f8f6acc820bdc2a1146fa2aa3ac839390a791
+size 188120
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_TextFieldScreenshot_disabled.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_TextFieldScreenshot_disabled.png
new file mode 100644
index 000000000..8c5f6afa0
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_TextFieldScreenshot_disabled.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f889903a0d931c099fccea904a60fd1851408b02df7bde7fd0558a52a75adefd
+size 136673
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_TextFieldScreenshot_enabled.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_TextFieldScreenshot_enabled.png
new file mode 100644
index 000000000..c6484b269
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_TextFieldScreenshot_enabled.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7aabfcf45c0ffa8cf77fae599ffecef05771d5b6eebaf7d185dc63a41c6536c5
+size 148438
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_TextFieldScreenshot_smallValue.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_TextFieldScreenshot_smallValue.png
new file mode 100644
index 000000000..a0a620e5b
--- /dev/null
+++ b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark.textfields_TextFieldScreenshot_smallValue.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:970aef54caa43309fb1e21cebaee6c00db7be60422c17458cf8178aebc753367
+size 182947
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_icon_icon_dark.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_icon_icon_dark.png
deleted file mode 100644
index dec486d73..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_icon_icon_dark.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:35228caf59b93fd0388d05afcc9e852968bdccb9a60e3148fdbf391049f2bb63
-size 59048
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_icon_icon_light.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_icon_icon_light.png
deleted file mode 100644
index 1cc89b489..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_icon_icon_light.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:a9c7aec80cfef7e7cd8cf17ac3bef869f10ea55a056b3891d6aca0aa35e30a78
-size 58370
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_tabs_fixedsizetabgroup_dark.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_tabs_fixedsizetabgroup_dark.png
deleted file mode 100644
index 3167c4c44..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_tabs_fixedsizetabgroup_dark.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:a01dab6b9ee167f9819f9cf6f919abd4d091175312bf9290ab23b2f11cfdd869
-size 54086
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_tabs_fixedsizetabgroup_light.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_tabs_fixedsizetabgroup_light.png
deleted file mode 100644
index 5ce2d4d3f..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_tabs_fixedsizetabgroup_light.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:e593e5c60a20f8fac2fa4ddaad16c58ed12d7b044f69acade63f04afef823495
-size 53411
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_tabs_scrollabletabgroup_dark.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_tabs_scrollabletabgroup_dark.png
deleted file mode 100644
index 31915bb71..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_tabs_scrollabletabgroup_dark.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:528e02b1ebed0fca500b85301499a8026a4c78fcbba10fa90cbb74f8b43b6d7c
-size 66940
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_tabs_scrollabletabgroup_light.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_tabs_scrollabletabgroup_light.png
deleted file mode 100644
index 6ee1fd42b..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_tabs_scrollabletabgroup_light.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:694cef4094c17133b15f9d7c2e4db55de906676efdda5c03301ce4019d8ef2fb
-size 66232
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_tabs_tab_dark.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_tabs_tab_dark.png
deleted file mode 100644
index f77aa1eaa..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_tabs_tab_dark.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:246febeb0c688d4e731ad52e49a9928906cd32c8030c5854629309803a511314
-size 18021
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_tabs_tab_light.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_tabs_tab_light.png
deleted file mode 100644
index 1ab75677d..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_tabs_tab_light.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:513d1276633e456ff493f16b9dfddcf9502f943e46986eb51a076cf2573830ea
-size 17967
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_multilinetextfieldintents_dark.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_multilinetextfieldintents_dark.png
deleted file mode 100644
index 518647054..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_multilinetextfieldintents_dark.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:2c9e0ab0a3e8b99c48a0b5336f90290a9bbe68b367b793bf75b096678404c029
-size 62451
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_multilinetextfieldintents_light.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_multilinetextfieldintents_light.png
deleted file mode 100644
index 0d604bd56..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_multilinetextfieldintents_light.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:1373fbed9e70902c65b6abc66622c08c5cce886eed26573a8d2838ea6603ce3a
-size 60204
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_multilinetextfieldintentsalert_dark.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_multilinetextfieldintentsalert_dark.png
deleted file mode 100644
index a68147dc9..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_multilinetextfieldintentsalert_dark.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:b9d1e1bb46ffdd901977baabe4b82d0689ae297dc4b036e4a8d2fdf470207dc9
-size 66255
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_multilinetextfieldintentsalert_light.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_multilinetextfieldintentsalert_light.png
deleted file mode 100644
index 3681c9233..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_multilinetextfieldintentsalert_light.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:f8fe241e0e791e768446c387dc81d87e4a7ca810dd381a005489668e0195a93b
-size 62378
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_multilinetextfieldintentserror_dark.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_multilinetextfieldintentserror_dark.png
deleted file mode 100644
index 7fa332e99..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_multilinetextfieldintentserror_dark.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:0c1ea65e380c326076bbaae69ba4e2ca8ab84e2a569418733121484839d7b1c6
-size 65527
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_multilinetextfieldintentserror_light.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_multilinetextfieldintentserror_light.png
deleted file mode 100644
index 590ba8475..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_multilinetextfieldintentserror_light.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:40681d8488de2a3685bc099a7a9200026416738c73f4cc58cbc6d82e3bb49d4f
-size 63654
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_multilinetextfieldintentssuccess_dark.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_multilinetextfieldintentssuccess_dark.png
deleted file mode 100644
index 3ff527f3b..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_multilinetextfieldintentssuccess_dark.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:6404df0433db5bace55eae5e521dcb824b01422497de67f59a1287d28b0305ec
-size 65360
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_multilinetextfieldintentssuccess_light.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_multilinetextfieldintentssuccess_light.png
deleted file mode 100644
index e4772f92d..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_multilinetextfieldintentssuccess_light.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:e01bba52dbbfa621b58429971456f1d90d9e34ba6bd235f4c7a2a41d32a090f5
-size 65779
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_selecttextfieldintents_dark.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_selecttextfieldintents_dark.png
deleted file mode 100644
index bd1dbdce5..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_selecttextfieldintents_dark.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:85e9f5997501a646fcf276ff7615f2a7cb9f5dcbd853bf5e8b13f7af2d0ea02e
-size 71661
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_selecttextfieldintents_light.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_selecttextfieldintents_light.png
deleted file mode 100644
index d01b27d87..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_selecttextfieldintents_light.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:07a376cd699c3360cd1ee2b79a9ab27b6f5330c4f092bdc3b091649293376da3
-size 69510
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_selecttextfieldintentsalert_dark.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_selecttextfieldintentsalert_dark.png
deleted file mode 100644
index b27e79883..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_selecttextfieldintentsalert_dark.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:3e1538ea1144ece761387e03d7b62e0e716e0ec6a17b472eef36e9b9e5c84991
-size 76085
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_selecttextfieldintentsalert_light.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_selecttextfieldintentsalert_light.png
deleted file mode 100644
index 620cf6daa..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_selecttextfieldintentsalert_light.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:c113aee9c4fe3daeb35542a053840116fd36c7e0248df469d513910d6ad52ade
-size 72059
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_selecttextfieldintentserror_dark.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_selecttextfieldintentserror_dark.png
deleted file mode 100644
index e5aefa9e8..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_selecttextfieldintentserror_dark.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:e7ca417738aead2202864bdc66df4c840c3bd5510e846ba38028083c868ad2a3
-size 74819
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_selecttextfieldintentserror_light.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_selecttextfieldintentserror_light.png
deleted file mode 100644
index 12235f448..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_selecttextfieldintentserror_light.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:552aa1a61f40a5ae275d67ea4752b97d0b2a59396669f8aa9256e6d445532f4a
-size 72825
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_selecttextfieldintentssuccess_dark.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_selecttextfieldintentssuccess_dark.png
deleted file mode 100644
index ad9fffab6..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_selecttextfieldintentssuccess_dark.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:c248e72fc78093bcdfcc0d235a98f7fb5b04611a0dd9ec760ca8f7772c7fe662
-size 75143
diff --git a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_selecttextfieldintentssuccess_light.png b/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_selecttextfieldintentssuccess_light.png
deleted file mode 100644
index 2a3e92cb6..000000000
--- a/spark-screenshot-testing/src/test/snapshots/images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_textfields_selecttextfieldintentssuccess_light.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:1d2857b954299ee59adfcd92efe0ebc2d4d79a28b1440810d7bdecc116ab4351
-size 75880
diff --git a/spark/build.gradle.kts b/spark/build.gradle.kts
index 43bf0f0c7..edcf4fab4 100644
--- a/spark/build.gradle.kts
+++ b/spark/build.gradle.kts
@@ -32,6 +32,11 @@ android {
namespace = "com.adevinta.spark"
resourcePrefix = "spark_"
+ testOptions {
+ unitTests.isIncludeAndroidResources = true
+ unitTests.isReturnDefaultValues = true
+ }
+
kotlinOptions {
freeCompilerArgs += listOf(
"-opt-in=com.adevinta.spark.InternalSparkApi",
@@ -73,4 +78,7 @@ dependencies {
testImplementation(libs.junit)
testImplementation(libs.kotlin.test)
testImplementation(libs.testParameterInjector)
+ testImplementation(libs.robolectric)
+ testImplementation(libs.androidx.compose.ui.test)
+ testImplementation(libs.androidx.compose.ui.testManifest)
}
diff --git a/spark/src/main/kotlin/com/adevinta/spark/components/dialog/ModalScaffold.kt b/spark/src/main/kotlin/com/adevinta/spark/components/dialog/ModalScaffold.kt
index 378ad7bd8..e25d2e217 100644
--- a/spark/src/main/kotlin/com/adevinta/spark/components/dialog/ModalScaffold.kt
+++ b/spark/src/main/kotlin/com/adevinta/spark/components/dialog/ModalScaffold.kt
@@ -78,7 +78,6 @@ import com.adevinta.spark.components.IntentColors
import com.adevinta.spark.components.appbar.TopAppBar
import com.adevinta.spark.components.buttons.ButtonFilled
import com.adevinta.spark.components.buttons.ButtonOutlined
-import com.adevinta.spark.components.chips.ChipDefaults.MaxWidth
import com.adevinta.spark.components.dialog.ModalDefault.DialogPadding
import com.adevinta.spark.components.iconbuttons.IconButtonDefaults
import com.adevinta.spark.components.iconbuttons.SparkIconButton
diff --git a/spark/src/main/kotlin/com/adevinta/spark/components/icons/Icons.kt b/spark/src/main/kotlin/com/adevinta/spark/components/icons/Icons.kt
index 3da6019cd..ccb302526 100644
--- a/spark/src/main/kotlin/com/adevinta/spark/components/icons/Icons.kt
+++ b/spark/src/main/kotlin/com/adevinta/spark/components/icons/Icons.kt
@@ -36,7 +36,6 @@ import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.graphics.vector.rememberVectorPainter
import androidx.compose.ui.platform.LocalContext
-import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.tooling.preview.PreviewParameter
import com.adevinta.spark.PreviewTheme
import com.adevinta.spark.SparkTheme
@@ -193,12 +192,8 @@ public fun rememberSparkIconPainter(sparkIcon: SparkIcon): Painter = when (spark
is SparkIcon.DrawableRes -> rememberDrawablePainter(getDrawable(LocalContext.current, sparkIcon.drawableId))
}
-@Preview(
- group = "Icon",
- name = "Icon",
-)
@Composable
-internal fun IconPreview(
+private fun IconPreview(
@PreviewParameter(ThemeProvider::class) theme: ThemeVariant,
) {
PreviewTheme(theme) {
diff --git a/spark/src/main/kotlin/com/adevinta/spark/components/snackbars/Snackbar.kt b/spark/src/main/kotlin/com/adevinta/spark/components/snackbars/Snackbar.kt
index ad39e4f9e..a4938df41 100644
--- a/spark/src/main/kotlin/com/adevinta/spark/components/snackbars/Snackbar.kt
+++ b/spark/src/main/kotlin/com/adevinta/spark/components/snackbars/Snackbar.kt
@@ -172,24 +172,23 @@ public fun Snackbar(
public fun Snackbar(
data: SnackbarData,
modifier: Modifier = Modifier,
- colors: SnackbarColors = SnackbarColors.Default,
actionOnNewLine: Boolean = false,
) {
val visuals = data.visuals
- val brikkeVisuals = data.visuals as? SnackbarSparkVisuals
+ val sparkVisuals = data.visuals as? SnackbarSparkVisuals
- val iconComposable: (@Composable (iconModifier: Modifier) -> Unit)? = brikkeVisuals?.icon?.let { icon ->
+ val iconComposable: (@Composable (iconModifier: Modifier) -> Unit)? = sparkVisuals?.icon?.let { icon ->
@Composable {
Icon(icon, modifier = it, contentDescription = null)
}
}
SparkSnackbar(
- colors = colors,
+ colors = sparkVisuals?.colors ?: SnackbarColors.Default,
modifier = modifier,
actionOnNewLine = actionOnNewLine,
icon = iconComposable,
- title = brikkeVisuals?.title,
+ title = sparkVisuals?.title,
actionLabel = visuals.actionLabel,
onActionClick = { data.performAction() },
) { Text(visuals.message) }
diff --git a/spark/src/main/kotlin/com/adevinta/spark/components/snackbars/Snackbar.md b/spark/src/main/kotlin/com/adevinta/spark/components/snackbars/Snackbar.md
new file mode 100644
index 000000000..22e1d51bb
--- /dev/null
+++ b/spark/src/main/kotlin/com/adevinta/spark/components/snackbars/Snackbar.md
@@ -0,0 +1,37 @@
+# Package com.adevinta.spark.components.snackbar
+
+[Snackbars](https://spark.adevinta.com/1186e1705/p/36d4af-snack-bar--toast/b/380770)
+inform users of a process that an app has performed or will perform
+They appear temporarily, towards the bottom of the screen.
+They shouldn’t interrupt the user experience, and they don’t require user input to disappear.
+
+Only one snackbar may be displayed at a time.
+
+## Usage
+
+### Snackbar
+
+| Light | Dark |
+|-------|------------------------------------------------------------------------------------------------------|
+| ![](../../images/com.adevinta.spark.snackbar_SnackbarDocScreenshot_snackbarColorsShowcase__light.png) | ![](../../images/com.adevinta.spark.snackbar_SnackbarDocScreenshot_snackbarColorsShowcase__dark.png) |
+
+
+```kotlin
+val snackbarHostState = remember { SnackbarHostState() }
+LaunchedEffect(conversationsState) {
+ if (shouldShowSnackbar) {
+ snackbarHostState.showSnackbar(
+ message = "Message",
+ duration = SnackbarDuration.Short,
+ )
+ }
+}
+Scaffold(
+ snackbarHost = {
+ SnackbarHost(hostState = snackbarHostState)
+ },
+) { innerPadding ->
+ // Content
+}
+
+```
diff --git a/spark/src/main/kotlin/com/adevinta/spark/components/snackbars/SnackbarColors.kt b/spark/src/main/kotlin/com/adevinta/spark/components/snackbars/SnackbarColors.kt
index 1b367576c..f12a75802 100644
--- a/spark/src/main/kotlin/com/adevinta/spark/components/snackbars/SnackbarColors.kt
+++ b/spark/src/main/kotlin/com/adevinta/spark/components/snackbars/SnackbarColors.kt
@@ -25,29 +25,29 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import com.adevinta.spark.SparkTheme
-public sealed class SnackbarColors {
+public enum class SnackbarColors {
- @get:Composable
- public abstract val baseColor: Color
-
- public object Default : SnackbarColors() {
+ Default {
override val baseColor: Color
@Composable get() {
return SparkTheme.colors.supportContainer
}
- }
+ },
- public object Error : SnackbarColors() {
+ Error {
override val baseColor: Color
@Composable get() {
return SparkTheme.colors.errorContainer
}
- }
+ },
- public object Valid : SnackbarColors() {
+ Valid {
override val baseColor: Color
@Composable get() {
return SparkTheme.colors.successContainer
}
- }
+ }, ;
+
+ @get:Composable
+ public abstract val baseColor: Color
}
diff --git a/spark/src/main/kotlin/com/adevinta/spark/components/snackbars/SnackbarDefault.kt b/spark/src/main/kotlin/com/adevinta/spark/components/snackbars/SnackbarDefault.kt
index d25e69c9a..648df3583 100644
--- a/spark/src/main/kotlin/com/adevinta/spark/components/snackbars/SnackbarDefault.kt
+++ b/spark/src/main/kotlin/com/adevinta/spark/components/snackbars/SnackbarDefault.kt
@@ -21,7 +21,6 @@
*/
package com.adevinta.spark.components.snackbars
-import androidx.compose.material3.SnackbarData
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
@@ -72,17 +71,3 @@ public fun SnackbarDefault(
content = content,
)
}
-
-@Composable
-public fun SnackbarDefault(
- data: SnackbarData,
- modifier: Modifier = Modifier,
- actionOnNewLine: Boolean = false,
-) {
- Snackbar(
- data = data,
- colors = SnackbarColors.Default,
- modifier = modifier,
- actionOnNewLine = actionOnNewLine,
- )
-}
diff --git a/spark/src/main/kotlin/com/adevinta/spark/components/snackbars/SnackbarError.kt b/spark/src/main/kotlin/com/adevinta/spark/components/snackbars/SnackbarError.kt
index 702a89192..152fc144b 100644
--- a/spark/src/main/kotlin/com/adevinta/spark/components/snackbars/SnackbarError.kt
+++ b/spark/src/main/kotlin/com/adevinta/spark/components/snackbars/SnackbarError.kt
@@ -21,7 +21,6 @@
*/
package com.adevinta.spark.components.snackbars
-import androidx.compose.material3.SnackbarData
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
@@ -72,17 +71,3 @@ public fun SnackbarError(
content = content,
)
}
-
-@Composable
-public fun SnackbarError(
- data: SnackbarData,
- modifier: Modifier = Modifier,
- actionOnNewLine: Boolean = false,
-) {
- Snackbar(
- data = data,
- colors = SnackbarColors.Error,
- modifier = modifier,
- actionOnNewLine = actionOnNewLine,
- )
-}
diff --git a/spark/src/main/kotlin/com/adevinta/spark/components/snackbars/SnackbarValid.kt b/spark/src/main/kotlin/com/adevinta/spark/components/snackbars/SnackbarValid.kt
index 74630de7c..5900b7e85 100644
--- a/spark/src/main/kotlin/com/adevinta/spark/components/snackbars/SnackbarValid.kt
+++ b/spark/src/main/kotlin/com/adevinta/spark/components/snackbars/SnackbarValid.kt
@@ -21,7 +21,6 @@
*/
package com.adevinta.spark.components.snackbars
-import androidx.compose.material3.SnackbarData
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
@@ -72,17 +71,3 @@ public fun SnackbarValid(
content = content,
)
}
-
-@Composable
-public fun SnackbarValid(
- data: SnackbarData,
- modifier: Modifier = Modifier,
- actionOnNewLine: Boolean = false,
-) {
- Snackbar(
- data = data,
- colors = SnackbarColors.Valid,
- modifier = modifier,
- actionOnNewLine = actionOnNewLine,
- )
-}
diff --git a/spark/src/main/kotlin/com/adevinta/spark/components/tab/Tab.kt b/spark/src/main/kotlin/com/adevinta/spark/components/tab/Tab.kt
index 96bd78bc0..3112d82d1 100644
--- a/spark/src/main/kotlin/com/adevinta/spark/components/tab/Tab.kt
+++ b/spark/src/main/kotlin/com/adevinta/spark/components/tab/Tab.kt
@@ -307,7 +307,7 @@ public fun Tab(
name = "Tab",
)
@Composable
-internal fun TabPreview(
+private fun TabPreview(
@PreviewParameter(ThemeProvider::class) theme: ThemeVariant,
) {
PreviewTheme(theme) {
diff --git a/spark/src/main/kotlin/com/adevinta/spark/components/tab/Tab.md b/spark/src/main/kotlin/com/adevinta/spark/components/tab/Tab.md
index f8bc9a8ea..189c2004e 100644
--- a/spark/src/main/kotlin/com/adevinta/spark/components/tab/Tab.md
+++ b/spark/src/main/kotlin/com/adevinta/spark/components/tab/Tab.md
@@ -5,10 +5,7 @@ related content, allowing users to navigate views without leaving the page. They
least two items and one tab is active at a time. Tabs can be used on full page layouts or in
components such as modals, cards, or side panels.
-| | Scrollable tabs | Fixed Size Tabs |
-|-------|--------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------|
-| Light | ![](../../images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_scrollabletabgroup_light.png) | ![](../../images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_fixedsizetabgroup_light.png) |
-| Dark | ![](../../images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_scrollabletabgroup_dark.png) | ![](../../images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_fixedsizetabgroup_dark.png) |
+![](../../images/com.adevinta.spark.tab_TabsDocScreenshot_tabsIntentShowcase__light.png)
Most commonly chip contains an `leadingIcon` and/ or the `text`, but you can also provide a
custom `trailingContent`. It is mandatory to provide `contentDescription` for `icon` only tabs.
@@ -21,6 +18,8 @@ The tab can have one of the [TabSize](TabDefaults.kt), that will affect the Tabs
- `Small`
- `Medium` (default size)
+![](../../images/com.adevinta.spark.tab_TabsDocScreenshot_tabsSizeShowcase.png)
+
The size of the icon is the same as the size of the text. For icon-only tabs the icon size
is `IconSize.Small`.
@@ -30,23 +29,9 @@ The tabs accept 2 colors [TabIntent](TabDefaults.kt)s:
- Main
- Support
-Part:
-
-| Style | Light | Dark |
-|----------|--------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|
-| Outlined | ![](../../images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_chips_chipsoutlined_part_light.png) | ![](../../images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_chips_chipsoutlined_part_dark.png) |
-| Filled | ![](../../images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_chips_chipsfilled_part_light.png) | ![](../../images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_chips_chipsfilled_part_dark.png) |
-| Tinted | ![](../../images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_chips_chipstinted_part_light.png) | ![](../../images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_chips_chipstinted_part_dark.png) |
-| Dashed | ![](../../images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_chips_chipsdashed_part_light.png) | ![](../../images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_chips_chipsdashed_part_dark.png) |
-
-Pro:
-
-| Style | Light | Dark |
-|----------|-------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------|
-| Outlined | ![](../../images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_chips_chipsoutlined_pro_light.png) | ![](../../images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_chips_chipsoutlined_pro_dark.png) |
-| Filled | ![](../../images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_chips_chipsfilled_pro_light.png) | ![](../../images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_chips_chipsfilled_pro_dark.png) |
-| Tinted | ![](../../images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_chips_chipstinted_pro_light.png) | ![](../../images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_chips_chipstinted_pro_dark.png) |
-| Dashed | ![](../../images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_chips_chipsdashed_pro_light.png) | ![](../../images/com.adevinta.spark_PreviewScreenshotTests_preview_tests_chips_chipsdashed_pro_dark.png) |
+| Light | Dark |
+|------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|
+| ![](../../images/com.adevinta.spark.tab_TabsDocScreenshot_tabsIntentShowcase__light.png) | ![](../../images/com.adevinta.spark.tab_TabsDocScreenshot_tabsIntentShowcase__dark.png) |
### TabGroup
diff --git a/spark/src/main/kotlin/com/adevinta/spark/components/tab/TabGroup.kt b/spark/src/main/kotlin/com/adevinta/spark/components/tab/TabGroup.kt
index a74f54a53..875c0665f 100644
--- a/spark/src/main/kotlin/com/adevinta/spark/components/tab/TabGroup.kt
+++ b/spark/src/main/kotlin/com/adevinta/spark/components/tab/TabGroup.kt
@@ -342,7 +342,7 @@ public fun TabGroup(
name = "Scrollable TabGroup",
)
@Composable
-internal fun TabGroupPreview(
+private fun TabGroupPreview(
@PreviewParameter(ThemeProvider::class) theme: ThemeVariant,
) {
val tabs = mutableListOf(
@@ -353,32 +353,25 @@ internal fun TabGroupPreview(
)
var selectedIndex by remember { mutableIntStateOf(0) }
PreviewTheme(theme) {
- TabSize.values().forEach { tabSize ->
- TabIntent.values().forEach { intent ->
- TabGroup(
- selectedTabIndex = selectedIndex,
- intent = intent,
- ) {
- tabs.forEachIndexed { index, (tab, unread) ->
- Tab(
- intent = intent,
- selected = selectedIndex == index,
- onClick = { selectedIndex = index },
- enabled = true,
- icon = tab.second,
- text = tab.first,
- size = tabSize,
- trailingContent = {
- if (unread > 0) {
- Badge(count = unread)
- } else {
- Unit
- }
- },
- contentDescription = if (tab.first == null) "icon content description" else null,
- )
- }
- }
+ TabGroup(
+ selectedTabIndex = selectedIndex,
+ ) {
+ tabs.forEachIndexed { index, (tab, unread) ->
+ Tab(
+ selected = selectedIndex == index,
+ onClick = { selectedIndex = index },
+ enabled = true,
+ icon = tab.second,
+ text = tab.first,
+ trailingContent = {
+ if (unread > 0) {
+ Badge(count = unread)
+ } else {
+ Unit
+ }
+ },
+ contentDescription = if (tab.first == null) "icon content description" else null,
+ )
}
}
}
@@ -389,7 +382,7 @@ internal fun TabGroupPreview(
name = "Fixed Size TabGroup",
)
@Composable
-internal fun TabGroupFixedSizePreview(
+private fun TabGroupFixedSizePreview(
@PreviewParameter(ThemeProvider::class) theme: ThemeVariant,
) {
val tabs = mutableListOf(
@@ -398,31 +391,24 @@ internal fun TabGroupFixedSizePreview(
)
var selectedIndex by remember { mutableIntStateOf(0) }
PreviewTheme(theme) {
- TabSize.values().forEach { tabSize ->
- TabIntent.values().forEach { intent ->
- TabGroup(
- selectedTabIndex = selectedIndex,
- intent = intent,
- ) {
- tabs.forEachIndexed { index, (tab, unread) ->
- Tab(
- intent = intent,
- selected = selectedIndex == index,
- onClick = { selectedIndex = index },
- enabled = true,
- icon = tab.second,
- text = tab.first,
- size = tabSize,
- trailingContent = {
- if (unread > 0) {
- Badge(count = unread)
- } else {
- Unit
- }
- },
- )
- }
- }
+ TabGroup(
+ selectedTabIndex = selectedIndex,
+ ) {
+ tabs.forEachIndexed { index, (tab, unread) ->
+ Tab(
+ selected = selectedIndex == index,
+ onClick = { selectedIndex = index },
+ enabled = true,
+ icon = tab.second,
+ text = tab.first,
+ trailingContent = {
+ if (unread > 0) {
+ Badge(count = unread)
+ } else {
+ Unit
+ }
+ },
+ )
}
}
}
diff --git a/spark/src/main/kotlin/com/adevinta/spark/components/textfields/MultilineTextField.kt b/spark/src/main/kotlin/com/adevinta/spark/components/textfields/MultilineTextField.kt
index a0eeaf8d8..b648ea764 100644
--- a/spark/src/main/kotlin/com/adevinta/spark/components/textfields/MultilineTextField.kt
+++ b/spark/src/main/kotlin/com/adevinta/spark/components/textfields/MultilineTextField.kt
@@ -304,7 +304,7 @@ public fun MultilineTextField(
name = "MultilineTextField intents",
)
@Composable
-internal fun MultilineTextFieldIntentPreview(
+private fun MultilineTextFieldIntentPreview(
@PreviewParameter(ThemeProvider::class) theme: ThemeVariant,
) {
PreviewTheme(theme) {
@@ -315,54 +315,6 @@ internal fun MultilineTextFieldIntentPreview(
}
}
-@Preview(
- group = "TextFields",
- name = "MultilineTextField intents error",
-)
-@Composable
-internal fun MultilineTextFieldIntentErrorPreview(
- @PreviewParameter(ThemeProvider::class) theme: ThemeVariant,
-) {
- PreviewTheme(theme) {
- PreviewTextFields(
- state = TextFieldState.Error,
- stateMessage = "Error text",
- )
- }
-}
-
-@Preview(
- group = "TextFields",
- name = "MultilineTextField intents alert",
-)
-@Composable
-internal fun MultilineTextFieldIntentAlertPreview(
- @PreviewParameter(ThemeProvider::class) theme: ThemeVariant,
-) {
- PreviewTheme(theme) {
- PreviewTextFields(
- state = TextFieldState.Alert,
- stateMessage = "Alert text",
- )
- }
-}
-
-@Preview(
- group = "TextFields",
- name = "MultilineTextField intents success",
-)
-@Composable
-internal fun MultilineTextFieldIntentSuccessPreview(
- @PreviewParameter(ThemeProvider::class) theme: ThemeVariant,
-) {
- PreviewTheme(theme) {
- PreviewTextFields(
- state = TextFieldState.Success,
- stateMessage = "Success text",
- )
- }
-}
-
@Composable
private fun ColumnScope.PreviewTextFields(
state: TextFieldState?,
diff --git a/spark/src/main/kotlin/com/adevinta/spark/components/textfields/SelectTextField.kt b/spark/src/main/kotlin/com/adevinta/spark/components/textfields/SelectTextField.kt
index ff09f2946..985807288 100644
--- a/spark/src/main/kotlin/com/adevinta/spark/components/textfields/SelectTextField.kt
+++ b/spark/src/main/kotlin/com/adevinta/spark/components/textfields/SelectTextField.kt
@@ -321,7 +321,7 @@ public fun SparkSelectTrailingIcon(
name = "SelectTextField intents",
)
@Composable
-internal fun SelectTextFieldIntentPreview(
+private fun SelectTextFieldIntentPreview(
@PreviewParameter(ThemeProvider::class) theme: ThemeVariant,
) {
PreviewTheme(theme) {
@@ -332,54 +332,6 @@ internal fun SelectTextFieldIntentPreview(
}
}
-@Preview(
- group = "TextFields",
- name = "SelectTextField intents error",
-)
-@Composable
-internal fun SelectTextFieldIntentErrorPreview(
- @PreviewParameter(ThemeProvider::class) theme: ThemeVariant,
-) {
- PreviewTheme(theme) {
- PreviewTextFields(
- state = TextFieldState.Error,
- stateMessage = "Error text",
- )
- }
-}
-
-@Preview(
- group = "TextFields",
- name = "SelectTextField intents alert",
-)
-@Composable
-internal fun SelectTextFieldIntentAlertPreview(
- @PreviewParameter(ThemeProvider::class) theme: ThemeVariant,
-) {
- PreviewTheme(theme) {
- PreviewTextFields(
- state = TextFieldState.Alert,
- stateMessage = "Alert text",
- )
- }
-}
-
-@Preview(
- group = "TextFields",
- name = "SelectTextField intents success",
-)
-@Composable
-internal fun SelectTextFieldIntentSuccessPreview(
- @PreviewParameter(ThemeProvider::class) theme: ThemeVariant,
-) {
- PreviewTheme(theme) {
- PreviewTextFields(
- state = TextFieldState.Success,
- stateMessage = "Success text",
- )
- }
-}
-
@Composable
private fun ColumnScope.PreviewTextFields(
state: TextFieldState?,
diff --git a/spark/src/main/kotlin/com/adevinta/spark/components/textfields/TextField.kt b/spark/src/main/kotlin/com/adevinta/spark/components/textfields/TextField.kt
index 688c60ab3..ace9d63f2 100644
--- a/spark/src/main/kotlin/com/adevinta/spark/components/textfields/TextField.kt
+++ b/spark/src/main/kotlin/com/adevinta/spark/components/textfields/TextField.kt
@@ -256,54 +256,6 @@ private fun TextFieldIntentPreview(
}
}
-@Preview(
- group = "TextFields",
- name = "TextField intents error",
-)
-@Composable
-private fun TextFieldIntentErrorPreview(
- @PreviewParameter(ThemeProvider::class) theme: ThemeVariant,
-) {
- PreviewTheme(theme) {
- PreviewTextFields(
- state = TextFieldState.Error,
- stateMessage = "Error text",
- )
- }
-}
-
-@Preview(
- group = "TextFields",
- name = "TextField intents alert",
-)
-@Composable
-private fun TextFieldIntentAlertPreview(
- @PreviewParameter(ThemeProvider::class) theme: ThemeVariant,
-) {
- PreviewTheme(theme) {
- PreviewTextFields(
- state = TextFieldState.Alert,
- stateMessage = "Alert text",
- )
- }
-}
-
-@Preview(
- group = "TextFields",
- name = "TextField intents success",
-)
-@Composable
-private fun TextFieldIntentSuccessPreview(
- @PreviewParameter(ThemeProvider::class) theme: ThemeVariant,
-) {
- PreviewTheme(theme) {
- PreviewTextFields(
- state = TextFieldState.Success,
- stateMessage = "Success text",
- )
- }
-}
-
@Composable
private fun ColumnScope.PreviewTextFields(
state: TextFieldState?,
diff --git a/spark/src/main/res/values/strings.xml b/spark/src/main/res/values/strings.xml
index 17fb13a83..0dd2ef31f 100644
--- a/spark/src/main/res/values/strings.xml
+++ b/spark/src/main/res/values/strings.xml
@@ -41,7 +41,8 @@
Profile photo
- More than %1$d new notifications
+ More than %1$d new notifications
New notification
- %d new notification
diff --git a/spark/src/test/kotlin/com/adevinta/spark/button/ButtonTest.kt b/spark/src/test/kotlin/com/adevinta/spark/button/ButtonTest.kt
new file mode 100644
index 000000000..4109e7eba
--- /dev/null
+++ b/spark/src/test/kotlin/com/adevinta/spark/button/ButtonTest.kt
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2023 Adevinta
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+package com.adevinta.spark.button
+
+import androidx.compose.ui.test.assertIsDisplayed
+import androidx.compose.ui.test.junit4.createComposeRule
+import androidx.compose.ui.test.onNodeWithTag
+import com.adevinta.spark.SparkTheme
+import com.adevinta.spark.components.buttons.ButtonFilled
+import com.adevinta.spark.components.buttons.SparkButtonTags
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.robolectric.RobolectricTestRunner
+
+@RunWith(RobolectricTestRunner::class)
+class ButtonTest {
+
+ @get:Rule
+ val composeTestRule = createComposeRule()
+
+ @Test
+ fun givenIsLoading_ThenProgressIndicatorShouldBeVisible() {
+ composeTestRule.setContent {
+ SparkTheme {
+ ButtonFilled(
+ text = "buttonText",
+ onClick = { },
+ isLoading = true,
+ )
+ }
+ }
+
+ composeTestRule.onNodeWithTag(SparkButtonTags.TAG_PROGRESS_INDICATOR, useUnmergedTree = true)
+ .assertIsDisplayed()
+ }
+
+ @Test
+ fun givenIsNotLoading_ThenProgressIndicatorShouldBeHidden() {
+ composeTestRule.setContent {
+ SparkTheme {
+ ButtonFilled(
+ text = "buttonText",
+ onClick = { },
+ isLoading = false,
+ )
+ }
+ }
+
+ composeTestRule.onNodeWithTag(SparkButtonTags.TAG_PROGRESS_INDICATOR, useUnmergedTree = true)
+ .assertDoesNotExist()
+ }
+}