-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add color tokens #152
Draft
paulinea
wants to merge
33
commits into
develop
Choose a base branch
from
108-tokens-colors
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 7 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
4384ce7
Add border tokens in the demo app
paulinea 6a862e3
Review: Change dashedBorder modifier signature
paulinea 5d0f34a
Review: Move defaultIllustrationSize variable in the companion object…
paulinea c81a14b
Add ic_spacing icon
paulinea 858ae97
Start adding dimension tokens in demo app
paulinea 8254ed5
Fix subcategories detail display
paulinea 457a2b6
Reorder OudsSizeIconWithTextKeyToken
paulinea 378812b
Display dimension size tokens
paulinea 1d6cbcd
Display all spacing tokens in the demo app
paulinea 3da3c0d
Apply filter before calling private composable
paulinea 057b1c7
Reorder properties
paulinea a04f3d3
Update illustrations for spacing inline with icon
paulinea 0b22f2b
Rename spacing into space
paulinea 7f91d84
Rename strings
paulinea 9b76204
Add WithArrow tokens illustrations
paulinea b696f73
Replace hardcoded spaces by tokens
paulinea 79ca7ab
Factorize some code
paulinea 3776da3
Improve size and space key tokens organization
paulinea d42faf4
Start adding dimension tokens in demo app
paulinea 2629b8e
Add grid icon
paulinea 116c516
Display grid tokens in demo app
paulinea cb5932d
Add grid illustrations
paulinea 45db7e5
Replace Spacing by Space
paulinea f02c08f
Add header
paulinea d846e48
Move grid illustrations in TokenPropertyIllustration file
paulinea 7fabe55
Fix broken build during rebase
paulinea 133e5cb
Add grid illustrations
paulinea ae85afa
Add color tokens to the library and use them in the demo app
paulinea b1891e8
Split color semantic tokens file in several files
paulinea 5fa3502
Fix colors to match demo app design
paulinea 4d1a863
Update paparazzi snapshots
paulinea ee0f866
Split color tokens keys in several enums
paulinea f6ee355
Improve color key tokens organization
paulinea File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -40,15 +40,15 @@ import com.orange.ouds.core.theme.value | |||||
import com.orange.ouds.theme.OudsBorderStyle | ||||||
import com.orange.ouds.theme.dashedBorder | ||||||
import com.orange.ouds.theme.dottedBorder | ||||||
import com.orange.ouds.theme.tokens.OudsColorKeyToken | ||||||
import com.orange.ouds.theme.tokens.OudsSpaceKeyToken | ||||||
import com.orange.ouds.theme.tokens.semantic.OudsColorKeyToken | ||||||
|
||||||
private val defaultIllustrationSize = 64.dp | ||||||
|
||||||
@Composable | ||||||
fun IllustrationBox( | ||||||
modifier: Modifier = Modifier, | ||||||
backgroundColor: Color = OudsColorKeyToken.OnSurface.value, | ||||||
backgroundColor: Color = OudsColorKeyToken.Background.Emphasized.value, | ||||||
contentAlignment: Alignment = Alignment.TopStart, | ||||||
content: @Composable BoxScope.() -> Unit = { } | ||||||
) { | ||||||
|
@@ -68,14 +68,14 @@ fun BorderIllustrationBox( | |||||
shape: Shape = RectangleShape, | ||||||
style: OudsBorderStyle = OudsBorderStyle.Solid | ||||||
) { | ||||||
val borderColor = OudsColorKeyToken.OnSurface.value //TODO use ContentDefault token when available | ||||||
val borderColor = OudsColorKeyToken.Content.Default.value | ||||||
val modifier = when (style) { | ||||||
OudsBorderStyle.None -> Modifier | ||||||
OudsBorderStyle.Solid -> Modifier.border(width = width, color = borderColor, shape = shape) | ||||||
OudsBorderStyle.Dashed -> Modifier.dashedBorder(width = width, color = borderColor, shape = shape) | ||||||
OudsBorderStyle.Dotted -> Modifier.dottedBorder(width = width, color = borderColor, shape = shape) | ||||||
} | ||||||
IllustrationBox(modifier = modifier, backgroundColor = Color.Transparent) | ||||||
IllustrationBox(modifier = modifier, backgroundColor = OudsColorKeyToken.Background.Secondary.value) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is an issue with the pill radius background because it is not clipped to the border: Here is the fix:
Suggested change
|
||||||
} | ||||||
|
||||||
@Composable | ||||||
|
@@ -95,7 +95,7 @@ fun SpaceIllustrationBox( | |||||
} | ||||||
IllustrationBox(contentAlignment = contentAlignment) { | ||||||
Box( | ||||||
modifier = dimensionBoxModifier.background(Color(0xFF26B2FF)) //TODO use AlwaysInfo token when available | ||||||
modifier = dimensionBoxModifier.background(color = OudsColorKeyToken.Always.Info.value) | ||||||
) | ||||||
} | ||||||
} | ||||||
|
@@ -114,14 +114,14 @@ fun SpacePaddingInlineWithImageIllustrationRow( | |||||
Row( | ||||||
modifier = modifier | ||||||
.size(defaultIllustrationSize) | ||||||
.background(color = OudsColorKeyToken.OnSurface.value), //TODO use BgEmphasizedPrimary token when available | ||||||
.background(color = OudsColorKeyToken.Background.Emphasized.value), | ||||||
verticalAlignment = Alignment.CenterVertically | ||||||
) { | ||||||
Box( | ||||||
modifier = Modifier | ||||||
.fillMaxHeight() | ||||||
.width(width = spaceSize) | ||||||
.background(Color(0xFF26B2FF)) //TODO use AlwaysInfo token when available | ||||||
.background(color = OudsColorKeyToken.Always.Info.value) | ||||||
) | ||||||
Image( | ||||||
modifier = imageModifier, | ||||||
|
@@ -138,7 +138,7 @@ fun GridIllustrations() { | |||||
modifier = Modifier | ||||||
.fillMaxWidth() | ||||||
.padding(horizontal = OudsSpaceKeyToken.Fixed.Medium.value) | ||||||
.background(OudsColorKeyToken.OnSurface.value), //TODO use BgEmphasizedPrimary token when available | ||||||
.background(OudsColorKeyToken.Background.Emphasized.value), | ||||||
painter = painterResource(id = R.drawable.il_tokens_grid_column_margin), | ||||||
contentDescription = null | ||||||
) | ||||||
|
@@ -147,7 +147,7 @@ fun GridIllustrations() { | |||||
.fillMaxWidth() | ||||||
.padding(horizontal = OudsSpaceKeyToken.Fixed.Medium.value) | ||||||
.padding(top = OudsSpaceKeyToken.Fixed.Medium.value) | ||||||
.background(OudsColorKeyToken.OnSurface.value), //TODO use BgEmphasizedPrimary token when available | ||||||
.background(OudsColorKeyToken.Background.Emphasized.value), | ||||||
painter = painterResource(id = R.drawable.il_tokens_grid_min_width), | ||||||
contentDescription = null | ||||||
) | ||||||
|
@@ -156,7 +156,7 @@ fun GridIllustrations() { | |||||
.fillMaxWidth() | ||||||
.padding(horizontal = OudsSpaceKeyToken.Fixed.Medium.value) | ||||||
.padding(top = OudsSpaceKeyToken.Fixed.Medium.value) | ||||||
.background(OudsColorKeyToken.OnSurface.value), //TODO use BgEmphasizedPrimary token when available | ||||||
.background(OudsColorKeyToken.Background.Emphasized.value), | ||||||
painter = painterResource(id = R.drawable.il_tokens_grid_max_width), | ||||||
contentDescription = null | ||||||
) | ||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some TODOs left in this file.