Skip to content

Commit

Permalink
fix: fixes for release 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
soulcramer committed Aug 17, 2023
1 parent c11b72e commit 2f8c354
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 45 deletions.
27 changes: 0 additions & 27 deletions spark/src/main/kotlin/com/adevinta/spark/Spark.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import androidx.compose.ui.unit.Dp
import com.adevinta.spark.ExperimentalSparkApi
import com.adevinta.spark.PreviewTheme
import com.adevinta.spark.SparkTheme
import com.adevinta.spark.tokens.DisabledAlpha
import com.adevinta.spark.tokens.dim3
import com.adevinta.spark.tools.preview.ThemeProvider
import com.adevinta.spark.tools.preview.ThemeVariant
import androidx.compose.material3.Divider as MaterialDivider
Expand All @@ -58,14 +58,18 @@ internal fun SparkDivider(
* ![Divider image](https://developer.android.com/images/reference/androidx/compose/material3/divider.png)
*
* @param modifier the [Modifier] to be applied to this divider line.
* @param color the color of the divider, we recommend to use either outline or onSurface dim 3.
*/
@ExperimentalSparkApi
@Composable
public fun Divider(modifier: Modifier = Modifier) {
public fun Divider(
modifier: Modifier = Modifier,
color: Color = SparkTheme.colors.onSurface.dim3,
) {
SparkDivider(
modifier = modifier,
thickness = DividerDefaults.Thickness,
color = SparkTheme.colors.onSurface.copy(DisabledAlpha),
color = color,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.tooling.preview.PreviewParameter
import com.adevinta.spark.ExperimentalSparkApi
import com.adevinta.spark.PreviewTheme
import com.adevinta.spark.icons.SparkIcon
import com.adevinta.spark.tools.preview.ThemeProvider
Expand All @@ -44,7 +43,6 @@ import com.adevinta.spark.tools.preview.ThemeVariant
* @param leadingIcon The spark icon shown at the start of the tag
* @param tint The tint color for the icon. Use Color.Unspecified to not apply tint.
*/
@ExperimentalSparkApi
@Composable
public fun TagFilled(
text: String,
Expand All @@ -63,11 +61,13 @@ public fun TagFilled(
}

/**
* Filled tag can be used to identify your brand DNA inside a list.
* Filled tag represent main information
* @param text The styled item label
* @param modifier The [Modifier] to be applied to the component
* @param content The item label
* @param intent The [TagIntent] color to use
* @param leadingIcon The spark icon shown at the start of the tag
* @param tint The tint color for the icon. Use Color.Unspecified to not apply tint.
*/
@ExperimentalSparkApi
@Composable
public fun TagFilled(
text: AnnotatedString,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import androidx.compose.ui.tooling.preview.Preview
device = "id:pixel_6",
uiMode = UI_MODE_NIGHT_NO or UI_MODE_TYPE_NORMAL,
)
public annotation class SparkBasePreview
internal annotation class SparkBasePreview

@Preview(
name = "small font",
Expand All @@ -49,7 +49,7 @@ public annotation class SparkBasePreview
locale = "fr-rFR",
fontScale = 1.5f,
)
public annotation class FontScalePreviews
internal annotation class FontScalePreviews

@Preview(
name = "phone",
Expand Down Expand Up @@ -83,7 +83,7 @@ public annotation class FontScalePreviews
locale = "fr-rFR",
device = Devices.DESKTOP,
)
public annotation class DevicePreviews
internal annotation class DevicePreviews

@Preview(
name = "light",
Expand All @@ -97,8 +97,8 @@ public annotation class DevicePreviews
locale = "fr-rFR",
uiMode = UI_MODE_NIGHT_YES,
)
public annotation class ThemesPreviews
internal annotation class ThemesPreviews

@DevicePreviews
@ThemesPreviews
public annotation class SparkPreviews
internal annotation class SparkPreviews
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ import androidx.compose.ui.tooling.preview.PreviewParameterProvider
import androidx.compose.ui.tooling.preview.datasource.CollectionPreviewParameterProvider
import kotlin.reflect.KClass

public class SparkPreviewProvider : PreviewParameterProvider<Pair<ThemeVariant, UserType>> by compositeProvider(
ThemeProvider::class,
UserProProvider::class,
)

public class SparkPreviewParamProvider : CollectionPreviewParameterProvider<SparkPreviewParam>(
listOf(
SparkPreviewParam(ThemeVariant.Light, UserType.Part, isLegacy = false),
Expand Down

0 comments on commit 2f8c354

Please sign in to comment.