Skip to content

0.3.0

Compare
Choose a tag to compare
@soulcramer soulcramer released this 11 Jul 14:15
· 512 commits to main since this release
0.3.0
3bf2541

What's Changed

TextField 🧪

TextFields now have a Alert and a Success state and looks more like the current spec for the TextFields.
This is still experimental as there's currently ongoing discussions about the UI.

⚠️ Note that this is a breaking change

  • The leadingIcon/trailingIcon are now named leadingContent/trailingContent.
  • The isError boolean parameter now is state which accept a TextFieldState that defines if the Textfield is in Success, Error or Alert state.
  • The error String param is renamed stateMessage as it doesn't represent only the error message anymore.

These changes result in this api :

TextField(
    value = newEmail,
    error = errorMessage,
    isError = isErrorEnabled,
    onValueChange = onNewEmailChanged,
    leadingIcon = { MarkerIcon() },
)

becoming like this:

TextField(
    value = newEmail,
    stateMessage = errorMessage,
    state = if (isErrorEnabled) TextFieldState.Error else null,
    onValueChange = onNewEmailChanged,
    leadingContent = { MarkerIcon() },
)

Utility

We've added Extension variables on Color and Typography to makes usages of dims and highlight easier:

Now instead of writing:

SparkTheme.colors.primary.copy(alpha = alpha = SparkTheme.colors.dim2)
SparkTheme.typographies.body1.copy(fontWeight = FontWeight.Bold)

You can use the simpler

SparkTheme.colors.primary.dim2
SparkTheme.typographies.body1.highlight

But if you're using the Text API we recommend you to use the provided fontWeight parameter:

Text(
    text = text,
    style = SparkTheme.typographies.body2,
    fontWeight = FontWeight.Bold,
)

Fixes:

Badges

The Badge had only 2 intents Error and Info. It now has all of them.

Before After

Button

The disabled color was following the Material Guideline instead of the spark one, it's now using a DIm3 for the intent color.
image

Tag

When UI testing a Tag component, there was an issue trying to find the text inside of it. Indeed Tag descendants were not merged which forced consumers to dig inside it to fetch these informations while this was not needed.
They're now merged so it will be simpler to test this component.
Fixed by @ThibaultChariere

SnackBar

Even if the snackbar is not specified yet we modified its shape to be similar to the one used in Polaris New UI
_Done by @GoUpNorth

Before After

⚠️ Breaking changes:

Icons

The deprecated icons are now removed from Spark. please refer to either the Spark Figma Foundation or the icons in your screen Figma.


Other Internals changes


New Contributors

Full Changelog: 0.2.0...0.3.0