diff --git a/NOTICE.txt b/NOTICE.txt index 87a5c90e..b15ca0f5 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -11,14 +11,47 @@ Any use or displaying shall constitute an infringement under intellectual proper app/src/main/res/drawable/ic_border.xml app/src/main/res/drawable/ic_component_atom.xml app/src/main/res/drawable/ic_design_token_figma.xml +app/src/main/res/drawable/ic_design_token_figma_no_padding.xml +app/src/main/res/drawable/ic_dimension.xml app/src/main/res/drawable/ic_filter_effects.xml app/src/main/res/drawable/ic_info.xml app/src/main/res/drawable/ic_layers.xml +app/src/main/res/drawable/ic_menu_grid.xml app/src/main/res/drawable/ic_solar_palette.xml app/src/main/res/drawable/ic_typography.xml app/src/main/res/drawable/ic_ui_dark_mode.xml app/src/main/res/drawable/ic_ui_light_mode.xml app/src/main/res/drawable/il_opacity_union.xml +app/src/main/res/drawable-hdpi/il_tokens_grid_column_margin.png +app/src/main/res/drawable-hdpi/il_tokens_grid_max_width.png +app/src/main/res/drawable-hdpi/il_tokens_grid_min_width.png +app/src/main/res/drawable-mdpi/il_tokens_grid_column_margin.png +app/src/main/res/drawable-mdpi/il_tokens_grid_max_width.png +app/src/main/res/drawable-mdpi/il_tokens_grid_min_width.png +app/src/main/res/drawable-xhdpi/il_tokens_grid_column_margin.png +app/src/main/res/drawable-xhdpi/il_tokens_grid_max_width.png +app/src/main/res/drawable-xhdpi/il_tokens_grid_min_width.png +app/src/main/res/drawable-xxhdpi/il_tokens_grid_column_margin.png +app/src/main/res/drawable-xxhdpi/il_tokens_grid_max_width.png +app/src/main/res/drawable-xxhdpi/il_tokens_grid_min_width.png +app/src/main/res/drawable-xxxhdpi/il_tokens_grid_column_margin.png +app/src/main/res/drawable-xxxhdpi/il_tokens_grid_max_width.png +app/src/main/res/drawable-xxxhdpi/il_tokens_grid_min_width.png +app/src/main/res/drawable-night-hdpi/il_tokens_grid_column_margin.png +app/src/main/res/drawable-night-hdpi/il_tokens_grid_max_width.png +app/src/main/res/drawable-night-hdpi/il_tokens_grid_min_width.png +app/src/main/res/drawable-night-mdpi/il_tokens_grid_column_margin.png +app/src/main/res/drawable-night-mdpi/il_tokens_grid_max_width.png +app/src/main/res/drawable-night-mdpi/il_tokens_grid_min_width.png +app/src/main/res/drawable-night-xhdpi/il_tokens_grid_column_margin.png +app/src/main/res/drawable-night-xhdpi/il_tokens_grid_max_width.png +app/src/main/res/drawable-night-xhdpi/il_tokens_grid_min_width.png +app/src/main/res/drawable-night-xxhdpi/il_tokens_grid_column_margin.png +app/src/main/res/drawable-night-xxhdpi/il_tokens_grid_max_width.png +app/src/main/res/drawable-night-xxhdpi/il_tokens_grid_min_width.png +app/src/main/res/drawable-night-xxxhdpi/il_tokens_grid_column_margin.png +app/src/main/res/drawable-night-xxxhdpi/il_tokens_grid_max_width.png +app/src/main/res/drawable-night-xxxhdpi/il_tokens_grid_min_width.png docs/images/favicon-16x16.png docs/images/orange-logo.svg diff --git a/app/src/main/java/com/orange/ouds/app/ui/MainScreen.kt b/app/src/main/java/com/orange/ouds/app/ui/MainScreen.kt index 7acf746c..f67a075d 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/MainScreen.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/MainScreen.kt @@ -49,6 +49,7 @@ import com.orange.ouds.app.R import com.orange.ouds.app.ui.navigation.appNavGraph import com.orange.ouds.app.ui.utilities.isDarkModeEnabled import com.orange.ouds.core.theme.OudsTheme +import com.orange.ouds.core.theme.value import com.orange.ouds.core.utilities.OudsPreview import com.orange.ouds.foundation.extensions.orElse import com.orange.ouds.foundation.utilities.UiModePreviews @@ -56,6 +57,8 @@ import com.orange.ouds.theme.OudsThemeContract import com.orange.ouds.theme.orange.ORANGE_THEME_NAME import com.orange.ouds.theme.orange.OrangeTheme import com.orange.ouds.theme.orangecountry.OrangeCountryTheme +import com.orange.ouds.theme.tokens.OudsColorKeyToken +import com.orange.ouds.theme.tokens.OudsSpaceKeyToken import com.orange.ouds.theme.whitelabel.WhiteLabelTheme @Composable @@ -152,15 +155,14 @@ private fun ChangeThemeDialog(themeManager: ThemeManager, dismissDialog: () -> U Dialog(onDismissRequest = dismissDialog) { Column( modifier = Modifier - .background(OudsTheme.colorScheme.surfaceVariant) + .background(OudsColorKeyToken.Background.Secondary.value) .selectableGroup() ) { - //TODO Replace hard coded values by tokens when available and use OUDS typography Text( text = stringResource(R.string.app_themeDialog_label), modifier = Modifier - .padding(top = 16.dp, bottom = 8.dp) - .padding(horizontal = 16.dp), + .padding(top = OudsSpaceKeyToken.Fixed.Medium.value, bottom = OudsSpaceKeyToken.Fixed.Short.value) + .padding(horizontal = OudsSpaceKeyToken.Fixed.Medium.value), style = MaterialTheme.typography.titleLarge ) themeManager.availableThemes.forEach { theme -> @@ -180,7 +182,7 @@ private fun ChangeThemeDialog(themeManager: ThemeManager, dismissDialog: () -> U }, role = Role.RadioButton ) - .padding(horizontal = 16.dp), + .padding(horizontal = OudsSpaceKeyToken.Fixed.Medium.value), verticalAlignment = Alignment.CenterVertically ) { RadioButton( @@ -190,7 +192,7 @@ private fun ChangeThemeDialog(themeManager: ThemeManager, dismissDialog: () -> U Text( text = theme.name, style = MaterialTheme.typography.bodyLarge, - modifier = Modifier.padding(start = 16.dp) + modifier = Modifier.padding(start = OudsSpaceKeyToken.Fixed.Medium.value) ) } } diff --git a/app/src/main/java/com/orange/ouds/app/ui/TopBar.kt b/app/src/main/java/com/orange/ouds/app/ui/TopBar.kt index 70337ec5..e9f457df 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/TopBar.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/TopBar.kt @@ -34,8 +34,8 @@ import com.orange.ouds.app.ui.utilities.isDarkModeEnabled import com.orange.ouds.core.theme.value import com.orange.ouds.core.utilities.OudsPreview import com.orange.ouds.foundation.utilities.UiModePreviews +import com.orange.ouds.theme.tokens.OudsColorKeyToken import com.orange.ouds.theme.tokens.OudsTypographyKeyToken -import com.orange.ouds.theme.tokens.semantic.OudsColorKeyToken @Composable @@ -70,7 +70,7 @@ private fun TopBar( Image( imageVector = Icons.AutoMirrored.Filled.ArrowBack, contentDescription = stringResource(id = R.string.app_common_back_a11y), - colorFilter = ColorFilter.tint(OudsColorKeyToken.OnSurface.value) //TODO use ContentDefault token when available + colorFilter = ColorFilter.tint(OudsColorKeyToken.Content.Default.value) ) } } @@ -78,7 +78,7 @@ private fun TopBar( title = { Text( text = title, - color = OudsColorKeyToken.OnSurface.value, //TODO use ContentDefault token when available + color = OudsColorKeyToken.Content.Default.value, modifier = Modifier.semantics { traversalIndex = -1f }, style = OudsTypographyKeyToken.HeadingMedium.value ) diff --git a/app/src/main/java/com/orange/ouds/app/ui/components/ComponentsScreen.kt b/app/src/main/java/com/orange/ouds/app/ui/components/ComponentsScreen.kt index 5231d3b9..5f2df873 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/components/ComponentsScreen.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/components/ComponentsScreen.kt @@ -27,19 +27,18 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import com.orange.ouds.app.ui.utilities.composable.Screen import com.orange.ouds.core.component.button.OudsButton -import com.orange.ouds.core.theme.OudsTheme import com.orange.ouds.core.theme.value import com.orange.ouds.core.utilities.OudsPreview import com.orange.ouds.foundation.utilities.UiModePreviews +import com.orange.ouds.theme.tokens.OudsColorKeyToken import com.orange.ouds.theme.tokens.OudsGridKeyToken -import com.orange.ouds.theme.tokens.OudsSpacingFixedKeyToken +import com.orange.ouds.theme.tokens.OudsSpaceKeyToken @Composable fun ComponentsScreen() { Screen { Column( - modifier = Modifier - .fillMaxSize(), + modifier = Modifier.fillMaxSize(), horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.Center ) { @@ -49,10 +48,10 @@ fun ComponentsScreen() { Box( modifier = Modifier - .padding(top = OudsSpacingFixedKeyToken.Medium.value) + .padding(top = OudsSpaceKeyToken.Fixed.Medium.value) .width(OudsGridKeyToken.Margin.value) .height(OudsGridKeyToken.ColumnGap.value) - .background(OudsTheme.colorScheme.primary) + .background(OudsColorKeyToken.Background.BrandPrimary.value) ) } } diff --git a/app/src/main/java/com/orange/ouds/app/ui/navigation/AppNavGraph.kt b/app/src/main/java/com/orange/ouds/app/ui/navigation/AppNavGraph.kt index fd7fa9c6..1b99d06b 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/navigation/AppNavGraph.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/navigation/AppNavGraph.kt @@ -28,7 +28,7 @@ import com.orange.ouds.app.ui.tokens.addTokensNavGraph * Root navigation graph of the application */ fun NavGraphBuilder.appNavGraph(navController: NavController) { - addTokensNavGraph() + addTokensNavGraph(navController) addAboutNavGraph() addBottomBarNavGraph(navController) } @@ -38,7 +38,7 @@ fun NavGraphBuilder.appNavGraph(navController: NavController) { */ private fun NavGraphBuilder.addBottomBarNavGraph(navController: NavController) { composable(BottomBarItem.Tokens.route) { from -> - TokensScreen(onTokenClick = { id -> navController.navigateToElement(TokensNavigation.TokenCategoryDetailRoute, id, from) }) + TokensScreen(onTokenCategoryClick = { id -> navController.navigateToElement(TokensNavigation.TokenCategoryDetailRoute, id, from) }) } composable(BottomBarItem.Components.route) { _ -> ComponentsScreen() diff --git a/app/src/main/java/com/orange/ouds/app/ui/tokens/Token.kt b/app/src/main/java/com/orange/ouds/app/ui/tokens/Token.kt new file mode 100644 index 00000000..aa38901e --- /dev/null +++ b/app/src/main/java/com/orange/ouds/app/ui/tokens/Token.kt @@ -0,0 +1,30 @@ +/* + * Software Name: OUDS Android + * SPDX-FileCopyrightText: Copyright (c) Orange SA + * SPDX-License-Identifier: MIT + * + * This software is distributed under the MIT license, + * the text of which is available at https://opensource.org/license/MIT/ + * or see the "LICENSE" file for more details. + * + * Software description: Android library of reusable graphical components + */ + +package com.orange.ouds.app.ui.tokens + +import androidx.compose.runtime.Composable +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.unit.Dp +import com.orange.ouds.app.R + +data class Token(val name: String, val value: T) { + val literalValue: String + @Composable + get() = when (value) { + is Float -> stringResource(id = R.string.app_tokens_floatFormat_label, value) + is Dp -> stringResource(id = R.string.app_tokens_dpFormat_label, value.toString().replace(".0.dp", "").substringBeforeLast(".dp")) + is TextStyle -> stringResource(id = R.string.app_tokens_spFormat_label, value.fontSize.toString().replace(".0.sp", "").substringBeforeLast(".sp")) + else -> value.toString() + } +} diff --git a/app/src/main/java/com/orange/ouds/app/ui/tokens/TokenCategory.kt b/app/src/main/java/com/orange/ouds/app/ui/tokens/TokenCategory.kt index cf533e24..e936d630 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/tokens/TokenCategory.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/tokens/TokenCategory.kt @@ -14,37 +14,8 @@ package com.orange.ouds.app.ui.tokens import androidx.annotation.DrawableRes import androidx.annotation.StringRes -import androidx.compose.foundation.Image -import androidx.compose.foundation.background -import androidx.compose.foundation.border -import androidx.compose.foundation.isSystemInDarkTheme -import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.size -import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material3.Surface -import androidx.compose.runtime.Composable import androidx.compose.runtime.Immutable -import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color -import androidx.compose.ui.res.painterResource -import androidx.compose.ui.res.stringResource -import androidx.compose.ui.text.TextStyle -import androidx.compose.ui.unit.Dp -import androidx.compose.ui.unit.dp import com.orange.ouds.app.R -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.OudsBorderRadiusKeyToken -import com.orange.ouds.theme.tokens.OudsBorderStyleKeyToken -import com.orange.ouds.theme.tokens.OudsBorderWidthKeyToken -import com.orange.ouds.theme.tokens.OudsElevationKeyToken -import com.orange.ouds.theme.tokens.OudsOpacityKeyToken -import com.orange.ouds.theme.tokens.OudsSpacingFixedKeyToken -import com.orange.ouds.theme.tokens.OudsTypographyKeyToken -import com.orange.ouds.theme.tokens.semantic.OudsColorKeyToken val tokenCategories = TokenCategory::class.sealedSubclasses.mapNotNull { it.objectInstance } @@ -53,7 +24,9 @@ sealed class TokenCategory( @StringRes val nameRes: Int, @DrawableRes val imageRes: Int, @StringRes val descriptionRes: Int, - val properties: List + val properties: List = emptyList(), + val subcategories: List = emptyList(), + val subcategory: Boolean = false ) { companion object { @@ -69,6 +42,32 @@ sealed class TokenCategory( listOf(TokenProperty.BorderWidth, TokenProperty.BorderRadius, TokenProperty.BorderStyle) ) + data object Dimension : TokenCategory( + R.string.app_tokens_dimension_label, + R.drawable.ic_dimension, + R.string.app_tokens_dimension_description_text, + subcategories = listOf(Space, Size) + ) { + data object Space : TokenCategory( + R.string.app_tokens_dimension_space_label, + R.drawable.ic_dimension, + R.string.app_tokens_dimension_space_description_text, + listOf( + TokenProperty.SpaceScaled, TokenProperty.SpaceFixed, TokenProperty.SpacePaddingInline, TokenProperty.SpacePaddingStack, + TokenProperty.SpacePaddingInset, TokenProperty.SpaceColumnGap, TokenProperty.SpaceRowGap + ), + subcategory = true + ) + + data object Size : TokenCategory( + R.string.app_tokens_dimension_size_label, + R.drawable.ic_dimension, + R.string.app_tokens_dimension_size_description_text, + listOf(TokenProperty.SizeIconDecorative, TokenProperty.SizeIconWithLabel), + subcategory = true + ) + } + data object Elevation : TokenCategory( R.string.app_tokens_elevation_label, R.drawable.ic_layers, @@ -76,6 +75,13 @@ sealed class TokenCategory( listOf(TokenProperty.Elevation) ) + data object Grid : TokenCategory( + R.string.app_tokens_grid_label, + R.drawable.ic_menu_grid, + R.string.app_tokens_grid_description_text, + listOf(TokenProperty.Grid) + ) + data object Opacity : TokenCategory( R.string.app_tokens_opacity_label, R.drawable.ic_filter_effects, @@ -89,120 +95,4 @@ sealed class TokenCategory( R.string.app_tokens_typography_description_text, listOf(TokenProperty.Typography) ) - -} - -sealed class TokenProperty( - @StringRes val nameRes: Int?, - val tokens: @Composable () -> List> -) { - protected companion object { - val defaultIllustrationSize = 64.dp - } - - data object BorderRadius : TokenProperty( - nameRes = R.string.app_tokens_border_radius_label, - tokens = { OudsBorderRadiusKeyToken.entries.map { Token(it.name, it.value) } } - ) { - @Composable - fun Illustration(radius: Dp) { - Box( - modifier = Modifier - .size(defaultIllustrationSize) - .border( - width = 1.dp, - color = OudsColorKeyToken.OnSurface.value, - shape = RoundedCornerShape(radius) - ) //TODO use ContentDefault token when available - .background(color = OudsColorKeyToken.Surface.value), //TODO use BgDefaultSecondary token when available - ) - } - } - - data object BorderStyle : TokenProperty( - nameRes = R.string.app_tokens_border_style_label, - tokens = { OudsBorderStyleKeyToken.entries.map { Token(it.name, it.value) } } - ) { - @Composable - fun Illustration(style: OudsBorderStyle) { - val borderColor = OudsColorKeyToken.OnSurface.value //TODO use ContentDefault token when available - val borderWidth = 1.dp - val modifier = when (style) { - OudsBorderStyle.None -> Modifier - OudsBorderStyle.Solid -> Modifier.border(width = borderWidth, color = borderColor) - OudsBorderStyle.Dashed -> Modifier.dashedBorder(width = borderWidth, color = borderColor) - OudsBorderStyle.Dotted -> Modifier.dottedBorder(width = borderWidth, color = borderColor) - } - Box( - modifier = modifier - .size(defaultIllustrationSize) - .background(color = OudsColorKeyToken.Surface.value), //TODO use BgDefaultSecondary token when available - ) - } - } - - data object BorderWidth : TokenProperty( - nameRes = R.string.app_tokens_border_width_label, - tokens = { OudsBorderWidthKeyToken.entries.map { Token(it.name, it.value) } } - ) { - @Composable - fun Illustration(width: Dp) { - val borderColor = OudsColorKeyToken.OnSurface.value //TODO use ContentDefault token when available - Box( - modifier = Modifier - .size(defaultIllustrationSize) - .border(width = width, color = borderColor) - .background(color = OudsColorKeyToken.Surface.value), //TODO use BgDefaultSecondary token when available - ) - } - } - - data object Elevation : TokenProperty( - nameRes = null, - tokens = { OudsElevationKeyToken.entries.map { Token(it.name, it.value) } } - ) { - @Composable - fun Illustration(elevation: Dp) { - Surface(shadowElevation = elevation) { - Box( - modifier = Modifier - .size(defaultIllustrationSize) - .background(color = OudsColorKeyToken.Surface.value), //TODO use BgDefaultSecondary token when available - ) - } - } - } - - data object Opacity : TokenProperty( - nameRes = null, - tokens = { OudsOpacityKeyToken.entries.map { Token(it.name, it.value) } } - ) { - @Composable - fun Illustration(opacity: Float) { - val squareColor = if (isSystemInDarkTheme()) Color.White else Color.Black - Box { - Image(painter = painterResource(id = R.drawable.il_opacity_union), contentDescription = null) - Box( - modifier = Modifier - .padding(top = OudsSpacingFixedKeyToken.Medium.value, start = OudsSpacingFixedKeyToken.Medium.value) - .size(48.dp) - .background(color = squareColor.copy(alpha = opacity)) - .border(width = 1.dp, color = squareColor) - ) - } - } - } - - data object Typography : TokenProperty(nameRes = null, tokens = { OudsTypographyKeyToken.entries.map { Token(it.name, it.value) } }) -} - -data class Token(val name: String, val value: T) { - val literalValue: String - @Composable - get() = when (value) { - is Dp -> stringResource(id = R.string.app_tokens_dpFormat_label, value.toString().replace(".0.dp", "").substringBeforeLast(".dp")) - is Float -> stringResource(id = R.string.app_tokens_floatFormat_label, value) - is TextStyle -> stringResource(id = R.string.app_tokens_spFormat_label, value.fontSize.toString().replace(".0.sp", "").substringBeforeLast(".sp")) - else -> value.toString() - } } \ No newline at end of file diff --git a/app/src/main/java/com/orange/ouds/app/ui/tokens/TokenCategoryDetailScreen.kt b/app/src/main/java/com/orange/ouds/app/ui/tokens/TokenCategoryDetailScreen.kt index e0093adc..a5fed052 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/tokens/TokenCategoryDetailScreen.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/tokens/TokenCategoryDetailScreen.kt @@ -12,6 +12,7 @@ package com.orange.ouds.app.ui.tokens +import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.Row @@ -21,92 +22,131 @@ import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items +import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.Dp +import com.orange.ouds.app.R import com.orange.ouds.app.ui.utilities.composable.DetailScreenHeader import com.orange.ouds.app.ui.utilities.composable.Screen import com.orange.ouds.core.theme.value -import com.orange.ouds.theme.OudsBorderStyle import com.orange.ouds.core.utilities.OudsPreview import com.orange.ouds.foundation.utilities.BasicPreviewParameterProvider import com.orange.ouds.foundation.utilities.UiModePreviews -import com.orange.ouds.theme.tokens.OudsSpacingFixedKeyToken +import com.orange.ouds.theme.OudsBorderStyle +import com.orange.ouds.theme.tokens.OudsColorKeyToken +import com.orange.ouds.theme.tokens.OudsSpaceKeyToken import com.orange.ouds.theme.tokens.OudsTypographyKeyToken -import com.orange.ouds.theme.tokens.semantic.OudsColorKeyToken @Composable -fun TokenCategoryDetailScreen(tokenCategory: TokenCategory) { +fun TokenCategoryDetailScreen(tokenCategory: TokenCategory, onSubcategoryClick: (Long) -> Unit) { Screen { - LazyColumn(contentPadding = PaddingValues(bottom = OudsSpacingFixedKeyToken.Medium.value)) { + LazyColumn(contentPadding = PaddingValues(bottom = OudsSpaceKeyToken.Fixed.Medium.value)) { item { DetailScreenHeader( descriptionRes = tokenCategory.descriptionRes, imageRes = tokenCategory.imageRes ) - } - items(tokenCategory.properties) { tokenProperty -> - Spacer(modifier = Modifier.height(OudsSpacingFixedKeyToken.Medium.value)) - - tokenProperty.nameRes?.let { - Text( - modifier = Modifier - .fillMaxWidth() - .padding(OudsSpacingFixedKeyToken.Medium.value), - text = stringResource(id = tokenProperty.nameRes), - maxLines = 1, - overflow = TextOverflow.Ellipsis, - style = OudsTypographyKeyToken.HeadingMedium.value - ) + if (tokenCategory == TokenCategory.Grid) { + GridIllustrations() } + } - tokenProperty.tokens().forEach { token -> + if (tokenCategory.subcategories.isNotEmpty()) { + items(tokenCategory.subcategories) { subcategory -> Row( modifier = Modifier .fillMaxWidth() - .padding(horizontal = OudsSpacingFixedKeyToken.Medium.value, vertical = OudsSpacingFixedKeyToken.Shorter.value) + .padding(top = OudsSpaceKeyToken.Fixed.Medium.value) + .clickable { onSubcategoryClick(subcategory.id) } ) { - when (tokenProperty) { - is TokenProperty.BorderWidth -> tokenProperty.Illustration(width = token.value as Dp) - is TokenProperty.BorderRadius -> tokenProperty.Illustration(radius = token.value as Dp) - is TokenProperty.BorderStyle -> tokenProperty.Illustration(style = token.value as OudsBorderStyle) - is TokenProperty.Elevation -> tokenProperty.Illustration(elevation = token.value as Dp) - is TokenProperty.Opacity -> tokenProperty.Illustration(opacity = token.value as Float) - is TokenProperty.Typography -> Unit - } - - val isTypographyProperty = tokenProperty is TokenProperty.Typography + Text( + modifier = Modifier + .fillMaxWidth() + .padding(OudsSpaceKeyToken.Fixed.Medium.value), + text = stringResource(id = subcategory.nameRes), + maxLines = 1, + overflow = TextOverflow.Ellipsis, + style = OudsTypographyKeyToken.HeadingMedium.value + ) + } + } + } else { + items(tokenCategory.properties) { tokenProperty -> + Spacer(modifier = Modifier.height(OudsSpaceKeyToken.Fixed.Medium.value)) - Column( + tokenProperty.nameRes?.let { + Text( modifier = Modifier - .weight(1f) - .padding(start = if (isTypographyProperty) OudsSpacingFixedKeyToken.None.value else OudsSpacingFixedKeyToken.Medium.value) - ) { - Text( - modifier = Modifier.fillMaxWidth(), - text = token.name, - maxLines = 1, - overflow = TextOverflow.Ellipsis, - style = if (isTypographyProperty) { - token.value as TextStyle - } else { - OudsTypographyKeyToken.BodyStrongLarge.value + .fillMaxWidth() + .padding(OudsSpaceKeyToken.Fixed.Medium.value), + text = stringResource(id = tokenProperty.nameRes), + maxLines = 1, + overflow = TextOverflow.Ellipsis, + style = OudsTypographyKeyToken.HeadingMedium.value + ) + } + + tokenProperty.tokens().forEach { token -> + if (tokenProperty == TokenProperty.SizeIconWithLabel) { + Column( + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = OudsSpaceKeyToken.Fixed.Medium.value, vertical = OudsSpaceKeyToken.Fixed.Shorter.value) + ) { + TokenIllustration(tokenProperty = tokenProperty, token = token) + Text( + modifier = Modifier.fillMaxWidth(), + text = stringResource(id = R.string.app_tokens_dimension_size_iconWithLabelTokenName_label, token.name, token.literalValue), + maxLines = 1, + overflow = TextOverflow.Ellipsis, + style = OudsTypographyKeyToken.BodyDefaultMedium.value, + color = OudsColorKeyToken.Content.Muted.value + ) + } + } else { + val noIllustrationProperty = tokenProperty in listOf(TokenProperty.Typography, TokenProperty.Grid) + + Row( + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = OudsSpaceKeyToken.Fixed.Medium.value, vertical = OudsSpaceKeyToken.Fixed.Shorter.value) + ) { + TokenIllustration(tokenProperty = tokenProperty, token = token) + + Column( + modifier = Modifier + .weight(1f) + .padding(start = if (noIllustrationProperty) OudsSpaceKeyToken.Fixed.None.value else OudsSpaceKeyToken.Fixed.Medium.value) + ) { + Text( + modifier = Modifier.fillMaxWidth(), + text = token.name, + maxLines = 1, + overflow = TextOverflow.Ellipsis, + style = if (tokenProperty == TokenProperty.Typography) { + token.value as TextStyle + } else { + OudsTypographyKeyToken.BodyStrongLarge.value + } + ) + Text( + modifier = Modifier.fillMaxWidth(), + text = token.literalValue, + maxLines = 1, + overflow = TextOverflow.Ellipsis, + style = OudsTypographyKeyToken.BodyDefaultMedium.value.copy(color = OudsColorKeyToken.Content.Muted.value) + ) } - ) - Text( - modifier = Modifier.fillMaxWidth(), - text = token.literalValue, - maxLines = 1, - overflow = TextOverflow.Ellipsis, - style = OudsTypographyKeyToken.BodyDefaultMedium.value.copy(color = OudsColorKeyToken.Tertiary.value) //TODO use ContentMuted token when available - ) + } } } } @@ -115,12 +155,32 @@ fun TokenCategoryDetailScreen(tokenCategory: TokenCategory) { } } +@Composable +private fun TokenIllustration(tokenProperty: TokenProperty, token: Token) = when (tokenProperty) { + is TokenProperty.BorderWidth -> BorderIllustrationBox(width = token.value as Dp) + is TokenProperty.BorderRadius -> BorderIllustrationBox(shape = RoundedCornerShape(token.value as Dp)) + is TokenProperty.BorderStyle -> BorderIllustrationBox(style = token.value as OudsBorderStyle) + is TokenProperty.Opacity -> tokenProperty.Illustration(opacity = token.value as Float) + is TokenProperty.Elevation -> tokenProperty.Illustration(elevation = token.value as Dp) + is TokenProperty.SizeIconDecorative -> tokenProperty.Illustration(size = token.value as Dp) + is TokenProperty.SizeIconWithLabel -> tokenProperty.Illustration(size = token.value as Dp, token.name) + is TokenProperty.SpaceColumnGap, TokenProperty.SpaceFixed, TokenProperty.SpaceScaled -> SpaceIllustrationBox( + size = token.value as Dp, + contentAlignment = Alignment.Center + ) + is TokenProperty.SpacePaddingInline -> tokenProperty.Illustration(size = token.value as Dp, token.name) + is TokenProperty.SpacePaddingInset -> tokenProperty.Illustration(size = token.value as Dp) + is TokenProperty.SpacePaddingStack -> SpaceIllustrationBox(size = token.value as Dp, orientation = SpaceOrientation.Vertical) + is TokenProperty.SpaceRowGap -> SpaceIllustrationBox(size = token.value as Dp, orientation = SpaceOrientation.Vertical, contentAlignment = Alignment.Center) + is TokenProperty.Typography, TokenProperty.Grid -> Unit +} + @UiModePreviews.Default @Composable private fun PreviewTokenCategoryDetailScreen( @PreviewParameter(TokenCategoryDetailScreenPreviewParameterProvider::class) parameter: TokenCategory ) = OudsPreview { - TokenCategoryDetailScreen(parameter) + TokenCategoryDetailScreen(parameter) {} } private class TokenCategoryDetailScreenPreviewParameterProvider : BasicPreviewParameterProvider(*previewParameterValues.toTypedArray()) @@ -128,5 +188,6 @@ private class TokenCategoryDetailScreenPreviewParameterProvider : BasicPreviewPa private val previewParameterValues: List get() = listOf( TokenCategory.Opacity, - TokenCategory.Elevation - ) + TokenCategory.Elevation, + TokenCategory.Grid + ) \ No newline at end of file diff --git a/app/src/main/java/com/orange/ouds/app/ui/tokens/TokenProperty.kt b/app/src/main/java/com/orange/ouds/app/ui/tokens/TokenProperty.kt new file mode 100644 index 00000000..ae2c801e --- /dev/null +++ b/app/src/main/java/com/orange/ouds/app/ui/tokens/TokenProperty.kt @@ -0,0 +1,226 @@ +/* + * Software Name: OUDS Android + * SPDX-FileCopyrightText: Copyright (c) Orange SA + * SPDX-License-Identifier: MIT + * + * This software is distributed under the MIT license, + * the text of which is available at https://opensource.org/license/MIT/ + * or see the "LICENSE" file for more details. + * + * Software description: Android library of reusable graphical components + */ + +package com.orange.ouds.app.ui.tokens + +import androidx.annotation.StringRes +import androidx.compose.foundation.Image +import androidx.compose.foundation.background +import androidx.compose.foundation.border +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxHeight +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width +import androidx.compose.material3.Icon +import androidx.compose.material3.Surface +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.unit.Dp +import androidx.compose.ui.unit.dp +import com.orange.ouds.app.R +import com.orange.ouds.core.theme.value +import com.orange.ouds.foundation.extensions.orElse +import com.orange.ouds.theme.tokens.OudsBorderRadiusKeyToken +import com.orange.ouds.theme.tokens.OudsBorderStyleKeyToken +import com.orange.ouds.theme.tokens.OudsBorderWidthKeyToken +import com.orange.ouds.theme.tokens.OudsColorKeyToken +import com.orange.ouds.theme.tokens.OudsElevationKeyToken +import com.orange.ouds.theme.tokens.OudsGridKeyToken +import com.orange.ouds.theme.tokens.OudsOpacityKeyToken +import com.orange.ouds.theme.tokens.OudsSizeKeyToken +import com.orange.ouds.theme.tokens.OudsSpaceKeyToken +import com.orange.ouds.theme.tokens.OudsTypographyKeyToken + +sealed class TokenProperty( + @StringRes val nameRes: Int?, + val tokens: @Composable () -> List> +) { + data object BorderRadius : TokenProperty( + nameRes = R.string.app_tokens_border_radius_label, + tokens = { OudsBorderRadiusKeyToken.entries.map { Token(it.name, it.value) } } + ) + + data object BorderStyle : TokenProperty( + nameRes = R.string.app_tokens_border_style_label, + tokens = { OudsBorderStyleKeyToken.entries.map { Token(it.name, it.value) } } + ) + + data object BorderWidth : TokenProperty( + nameRes = R.string.app_tokens_border_width_label, + tokens = { OudsBorderWidthKeyToken.entries.map { Token(it.name, it.value) } } + ) + + data object Elevation : TokenProperty( + nameRes = null, + tokens = { OudsElevationKeyToken.entries.map { Token(it.name, it.value) } } + ) { + @Composable + fun Illustration(elevation: Dp) { + Surface(shadowElevation = elevation) { + IllustrationBox(backgroundColor = OudsColorKeyToken.Background.Secondary.value) + } + } + } + + data object Grid : TokenProperty( + nameRes = null, + tokens = { OudsGridKeyToken.entries.map { Token(it.name, it.value) } } + ) + + data object Opacity : TokenProperty( + nameRes = null, + tokens = { OudsOpacityKeyToken.entries.map { Token(it.name, it.value) } } + ) { + @Composable + fun Illustration(opacity: Float) { + val squareColor = if (isSystemInDarkTheme()) Color.White else Color.Black + Box { + Image(painter = painterResource(id = R.drawable.il_opacity_union), contentDescription = null) + Box( + modifier = Modifier + .padding(top = OudsSpaceKeyToken.Fixed.Medium.value, start = OudsSpaceKeyToken.Fixed.Medium.value) + .size(48.dp) + .background(color = squareColor.copy(alpha = opacity)) + .border(width = 1.dp, color = squareColor) + ) + } + } + } + + data object SizeIconDecorative : TokenProperty( + nameRes = R.string.app_tokens_dimension_size_iconDecorative_label, + tokens = { OudsSizeKeyToken.IconDecorative.entries.map { Token(it.name, it.value) } } + ) { + @Composable + fun Illustration(size: Dp) { + IllustrationBox(modifier = Modifier.size(80.dp), contentAlignment = Alignment.Center) { + Icon( + modifier = Modifier.size(size), + painter = painterResource(R.drawable.ic_design_token_figma), + tint = Color(0xFF26B2FF), //TODO use AlwaysInfo token when available + contentDescription = null + ) + } + } + } + + data object SizeIconWithLabel : TokenProperty( + nameRes = R.string.app_tokens_dimension_size_iconWithLabel_label, + tokens = { OudsSizeKeyToken.IconWithText.entries.map { Token(it.name, it.value) } } + ) { + @Composable + fun Illustration(size: Dp, tokenName: String) { + val label = tokenName.substringBefore("Size") + Row( + modifier = Modifier.fillMaxWidth(), + horizontalArrangement = Arrangement.spacedBy(OudsSpaceKeyToken.Fixed.Shorter.value), + verticalAlignment = Alignment.CenterVertically + ) { + Icon( + modifier = Modifier.size(size), + painter = painterResource(R.drawable.ic_design_token_figma), + tint = Color(0xFF26B2FF), //TODO use AlwaysInfo token when available + contentDescription = null + ) + Text( + modifier = Modifier.weight(1f), + text = label, + maxLines = 1, + overflow = TextOverflow.Ellipsis, + style = OudsTypographyKeyToken.entries.firstOrNull { it.name == label }?.value.orElse { OudsTypographyKeyToken.BodyStrongLarge.value } + ) + } + } + } + + data object SpaceColumnGap : TokenProperty( + nameRes = R.string.app_tokens_dimension_space_columnGap_label, + tokens = { OudsSpaceKeyToken.ColumnGap.entries.map { Token(it.name, it.value) } } + ) + + data object SpaceFixed : TokenProperty( + nameRes = R.string.app_tokens_dimension_space_fixed_label, + tokens = { OudsSpaceKeyToken.Fixed.entries.map { Token(it.name, it.value) } } + ) + + data object SpacePaddingInline : TokenProperty( + nameRes = R.string.app_tokens_dimension_space_paddingInline_label, + tokens = { OudsSpaceKeyToken.PaddingInline.entries.map { Token(it.name, it.value) } } + ) { + @Composable + fun Illustration(size: Dp, tokenName: String) = when { + tokenName.contains("WithIcon") -> SpacePaddingInlineWithImageIllustrationRow( + spaceSize = size, + imagePainter = painterResource(R.drawable.ic_design_token_figma_no_padding), + imageModifier = Modifier.padding(horizontal = 1.dp) + ) + tokenName.contains("WithArrow") -> SpacePaddingInlineWithImageIllustrationRow( + spaceSize = size, + imagePainter = painterResource(R.drawable.ic_chevron_down) + ) + else -> SpaceIllustrationBox(size = size) + } + } + + data object SpacePaddingInset : TokenProperty( + nameRes = R.string.app_tokens_dimension_space_paddingInset_label, + tokens = { OudsSpaceKeyToken.Inset.entries.map { Token(it.name, it.value) } } + ) { + + @Composable + fun Illustration(size: Dp) { + IllustrationBox { + Box( + modifier = Modifier + .fillMaxWidth() + .height(height = size) + .background(Color(0xFF26B2FF)) //TODO use AlwaysInfo token when available + ) + Box( + modifier = Modifier + .fillMaxHeight() + .width(width = size) + .background(Color(0xFF26B2FF)) //TODO use AlwaysInfo token when available + ) + } + } + } + + data object SpacePaddingStack : TokenProperty( + nameRes = R.string.app_tokens_dimension_space_paddingStack_label, + tokens = { OudsSpaceKeyToken.PaddingBlock.entries.map { Token(it.name, it.value) } } + ) + + data object SpaceRowGap : TokenProperty( + nameRes = R.string.app_tokens_dimension_space_rowGap_label, + tokens = { OudsSpaceKeyToken.RowGap.entries.map { Token(it.name, it.value) } } + ) + + data object SpaceScaled : TokenProperty( + nameRes = R.string.app_tokens_dimension_space_scaled_label, + tokens = { OudsSpaceKeyToken.Scaled.entries.map { Token(it.name, it.value) } } + ) + + data object Typography : TokenProperty(nameRes = null, tokens = { OudsTypographyKeyToken.entries.map { Token(it.name, it.value) } }) + +} \ No newline at end of file diff --git a/app/src/main/java/com/orange/ouds/app/ui/tokens/TokenPropertyIllustration.kt b/app/src/main/java/com/orange/ouds/app/ui/tokens/TokenPropertyIllustration.kt new file mode 100644 index 00000000..4eda6f90 --- /dev/null +++ b/app/src/main/java/com/orange/ouds/app/ui/tokens/TokenPropertyIllustration.kt @@ -0,0 +1,163 @@ +/* + * Software Name: OUDS Android + * SPDX-FileCopyrightText: Copyright (c) Orange SA + * SPDX-License-Identifier: MIT + * + * This software is distributed under the MIT license, + * the text of which is available at https://opensource.org/license/MIT/ + * or see the "LICENSE" file for more details. + * + * Software description: Android library of reusable graphical components + */ + +package com.orange.ouds.app.ui.tokens + +import androidx.compose.foundation.Image +import androidx.compose.foundation.background +import androidx.compose.foundation.border +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.BoxScope +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxHeight +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.RectangleShape +import androidx.compose.ui.graphics.Shape +import androidx.compose.ui.graphics.painter.Painter +import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.unit.Dp +import androidx.compose.ui.unit.dp +import com.orange.ouds.app.R +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 + +private val defaultIllustrationSize = 64.dp + +@Composable +fun IllustrationBox( + modifier: Modifier = Modifier, + backgroundColor: Color = OudsColorKeyToken.Background.Emphasized.value, + contentAlignment: Alignment = Alignment.TopStart, + content: @Composable BoxScope.() -> Unit = { } +) { + Box( + modifier = modifier + .size(defaultIllustrationSize) + .background(color = backgroundColor), + contentAlignment = contentAlignment, + ) { + content() + } +} + +@Composable +fun BorderIllustrationBox( + width: Dp = 1.dp, + shape: Shape = RectangleShape, + style: OudsBorderStyle = OudsBorderStyle.Solid +) { + 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 = OudsColorKeyToken.Background.Secondary.value) +} + +@Composable +fun SpaceIllustrationBox( + size: Dp, + orientation: SpaceOrientation = SpaceOrientation.Horizontal, + contentAlignment: Alignment = Alignment.TopStart +) { + val dimensionBoxModifier = when (orientation) { + SpaceOrientation.Horizontal -> Modifier + .fillMaxHeight() + .width(width = size) + + SpaceOrientation.Vertical -> Modifier + .fillMaxWidth() + .height(height = size) + } + IllustrationBox(contentAlignment = contentAlignment) { + Box( + modifier = dimensionBoxModifier.background(color = OudsColorKeyToken.Always.Info.value) + ) + } +} + +enum class SpaceOrientation { + Horizontal, Vertical +} + +@Composable +fun SpacePaddingInlineWithImageIllustrationRow( + spaceSize: Dp, + imagePainter: Painter, + modifier: Modifier = Modifier, + imageModifier: Modifier = Modifier +) { + Row( + modifier = modifier + .size(defaultIllustrationSize) + .background(color = OudsColorKeyToken.Background.Emphasized.value), + verticalAlignment = Alignment.CenterVertically + ) { + Box( + modifier = Modifier + .fillMaxHeight() + .width(width = spaceSize) + .background(color = OudsColorKeyToken.Always.Info.value) + ) + Image( + modifier = imageModifier, + painter = imagePainter, + contentDescription = null, + contentScale = ContentScale.None + ) + } +} + +@Composable +fun GridIllustrations() { + Image( + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = OudsSpaceKeyToken.Fixed.Medium.value) + .background(OudsColorKeyToken.Background.Emphasized.value), + painter = painterResource(id = R.drawable.il_tokens_grid_column_margin), + contentDescription = null + ) + Image( + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = OudsSpaceKeyToken.Fixed.Medium.value) + .padding(top = OudsSpaceKeyToken.Fixed.Medium.value) + .background(OudsColorKeyToken.Background.Emphasized.value), + painter = painterResource(id = R.drawable.il_tokens_grid_min_width), + contentDescription = null + ) + Image( + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = OudsSpaceKeyToken.Fixed.Medium.value) + .padding(top = OudsSpaceKeyToken.Fixed.Medium.value) + .background(OudsColorKeyToken.Background.Emphasized.value), + painter = painterResource(id = R.drawable.il_tokens_grid_max_width), + contentDescription = null + ) +} \ No newline at end of file diff --git a/app/src/main/java/com/orange/ouds/app/ui/tokens/TokensNavGraph.kt b/app/src/main/java/com/orange/ouds/app/ui/tokens/TokensNavGraph.kt index 6dee7e28..aa740dd6 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/tokens/TokensNavGraph.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/tokens/TokensNavGraph.kt @@ -13,17 +13,19 @@ package com.orange.ouds.app.ui.tokens import androidx.compose.runtime.remember +import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder import androidx.navigation.NavType import androidx.navigation.compose.composable import androidx.navigation.navArgument +import com.orange.ouds.app.ui.navigation.navigateToElement object TokensNavigation { const val TokenCategoryDetailRoute = "tokenCategory" const val TokenCategoryIdKey = "tokenCategoryId" } -fun NavGraphBuilder.addTokensNavGraph() { +fun NavGraphBuilder.addTokensNavGraph(navController: NavController) { composable( "${TokensNavigation.TokenCategoryDetailRoute}/{${TokensNavigation.TokenCategoryIdKey}}", arguments = listOf(navArgument(TokensNavigation.TokenCategoryIdKey) { type = NavType.LongType }) @@ -33,7 +35,12 @@ fun NavGraphBuilder.addTokensNavGraph() { val tokenCategory = remember(routeTokenCategoryId) { TokenCategory.fromId(routeTokenCategoryId) } tokenCategory?.let { - TokenCategoryDetailScreen(tokenCategory = tokenCategory) + TokenCategoryDetailScreen( + tokenCategory = tokenCategory, + onSubcategoryClick = { id -> + navController.navigateToElement(TokensNavigation.TokenCategoryDetailRoute, id, from) + } + ) } } } diff --git a/app/src/main/java/com/orange/ouds/app/ui/tokens/TokensScreen.kt b/app/src/main/java/com/orange/ouds/app/ui/tokens/TokensScreen.kt index 78916b4f..e7d312c0 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/tokens/TokensScreen.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/tokens/TokensScreen.kt @@ -26,31 +26,31 @@ import com.orange.ouds.app.ui.utilities.composable.Screen import com.orange.ouds.core.theme.value import com.orange.ouds.core.utilities.OudsPreview import com.orange.ouds.foundation.utilities.UiModePreviews -import com.orange.ouds.theme.tokens.OudsSpacingFixedKeyToken +import com.orange.ouds.theme.tokens.OudsSpaceKeyToken @Composable -fun TokensScreen(onTokenClick: (Long) -> Unit) { +fun TokensScreen(onTokenCategoryClick: (Long) -> Unit) { TokensScreen( - tokenCategories = tokenCategories, - onTokenClick = onTokenClick + tokenCategories = tokenCategories.filter { !it.subcategory }, + onTokenCategoryClick = onTokenCategoryClick ) } @Composable -private fun TokensScreen(tokenCategories: List, onTokenClick: (Long) -> Unit) { +private fun TokensScreen(tokenCategories: List, onTokenCategoryClick: (Long) -> Unit) { Screen { Column( modifier = Modifier .fillMaxSize() .verticalScroll(rememberScrollState()) - .padding(OudsSpacingFixedKeyToken.Medium.value), - verticalArrangement = Arrangement.spacedBy(OudsSpacingFixedKeyToken.Medium.value) + .padding(OudsSpaceKeyToken.Fixed.Medium.value), + verticalArrangement = Arrangement.spacedBy(OudsSpaceKeyToken.Fixed.Medium.value) ) { tokenCategories.forEach { token -> LargeCard( title = stringResource(id = token.nameRes), imageRes = token.imageRes, - onClick = { onTokenClick(token.id) } + onClick = { onTokenCategoryClick(token.id) } ) } } diff --git a/app/src/main/java/com/orange/ouds/app/ui/utilities/composable/DetailScreenHeader.kt b/app/src/main/java/com/orange/ouds/app/ui/utilities/composable/DetailScreenHeader.kt index 9d857644..62a6fe74 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/utilities/composable/DetailScreenHeader.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/utilities/composable/DetailScreenHeader.kt @@ -32,9 +32,9 @@ import com.orange.ouds.app.R import com.orange.ouds.core.theme.value import com.orange.ouds.core.utilities.OudsPreview import com.orange.ouds.foundation.utilities.UiModePreviews -import com.orange.ouds.theme.tokens.OudsSpacingFixedKeyToken +import com.orange.ouds.theme.tokens.OudsColorKeyToken +import com.orange.ouds.theme.tokens.OudsSpaceKeyToken import com.orange.ouds.theme.tokens.OudsTypographyKeyToken -import com.orange.ouds.theme.tokens.semantic.OudsColorKeyToken @Composable fun DetailScreenHeader( @@ -44,17 +44,17 @@ fun DetailScreenHeader( Column { Image( painter = painterResource(imageRes), - colorFilter = ColorFilter.tint(OudsColorKeyToken.InverseOnSurface.value), //TODO use OnBgEmphasized token when available + colorFilter = ColorFilter.tint(OudsColorKeyToken.Content.DefaultOnBgEmphasized.value), contentDescription = null, modifier = Modifier .fillMaxWidth() .height(186.dp) - .background(OudsColorKeyToken.OnSurface.value), //TODO use BgEmphasizedPrimary token when available + .background(OudsColorKeyToken.Background.Emphasized.value), contentScale = ContentScale.None ) DetailScreenDescription( - modifier = Modifier.padding(all = OudsSpacingFixedKeyToken.Medium.value), + modifier = Modifier.padding(all = OudsSpaceKeyToken.Fixed.Medium.value), descriptionRes = descriptionRes ) } @@ -68,7 +68,7 @@ private fun DetailScreenDescription( Text( modifier = modifier, text = stringResource(descriptionRes), - color = OudsColorKeyToken.OnSurface.value, //TODO use ContentDefault token when available + color = OudsColorKeyToken.Content.Default.value, style = OudsTypographyKeyToken.BodyDefaultLarge.value ) } diff --git a/app/src/main/java/com/orange/ouds/app/ui/utilities/composable/LargeCard.kt b/app/src/main/java/com/orange/ouds/app/ui/utilities/composable/LargeCard.kt index f3d39646..02713ad7 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/utilities/composable/LargeCard.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/utilities/composable/LargeCard.kt @@ -20,10 +20,12 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.material3.Card +import androidx.compose.material3.CardDefaults.cardElevation import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.ColorFilter +import androidx.compose.ui.graphics.RectangleShape import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.res.painterResource import androidx.compose.ui.text.style.TextOverflow @@ -32,9 +34,10 @@ import com.orange.ouds.app.R import com.orange.ouds.core.theme.value import com.orange.ouds.core.utilities.OudsPreview import com.orange.ouds.foundation.utilities.UiModePreviews -import com.orange.ouds.theme.tokens.OudsSpacingFixedKeyToken +import com.orange.ouds.theme.tokens.OudsColorKeyToken +import com.orange.ouds.theme.tokens.OudsElevationKeyToken +import com.orange.ouds.theme.tokens.OudsSpaceKeyToken import com.orange.ouds.theme.tokens.OudsTypographyKeyToken -import com.orange.ouds.theme.tokens.semantic.OudsColorKeyToken /** * Temporary large card used by the demo app @@ -46,24 +49,24 @@ fun LargeCard( onClick: () -> Unit, modifier: Modifier = Modifier, ) { - Card(modifier = modifier, onClick = onClick) { - Column { + Card(modifier = modifier, shape = RectangleShape, elevation = cardElevation(defaultElevation = OudsElevationKeyToken.Raised.value), onClick = onClick) { + Column(modifier = Modifier.background(OudsColorKeyToken.Elevation.Raised.value)) { Image( painter = painterResource(imageRes), - colorFilter = ColorFilter.tint(OudsColorKeyToken.InverseOnSurface.value), //TODO use OnBgEmphasized token when available + colorFilter = ColorFilter.tint(OudsColorKeyToken.Content.DefaultOnBgEmphasized.value), contentDescription = null, modifier = Modifier .fillMaxWidth() - .height(184.dp) //TODO use token when available - .background(OudsColorKeyToken.OnSurface.value), //TODO use BgEmphasizedPrimary token when available + .height(184.dp) + .background(OudsColorKeyToken.Background.Emphasized.value), contentScale = ContentScale.None ) Column( - modifier = Modifier.padding(OudsSpacingFixedKeyToken.Medium.value) + modifier = Modifier.padding(OudsSpaceKeyToken.Fixed.Medium.value) ) { Text( text = title, - color = OudsColorKeyToken.OnSurface.value, //TODO use ContentDefault token when available + color = OudsColorKeyToken.Content.Default.value, overflow = TextOverflow.Ellipsis, maxLines = 1, style = OudsTypographyKeyToken.HeadingMedium.value diff --git a/app/src/main/java/com/orange/ouds/app/ui/utilities/composable/Screen.kt b/app/src/main/java/com/orange/ouds/app/ui/utilities/composable/Screen.kt index e6198591..fef5b794 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/utilities/composable/Screen.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/utilities/composable/Screen.kt @@ -20,14 +20,14 @@ import androidx.compose.ui.Modifier import com.orange.ouds.core.theme.value import com.orange.ouds.core.utilities.OudsPreview import com.orange.ouds.foundation.utilities.UiModePreviews -import com.orange.ouds.theme.tokens.semantic.OudsColorKeyToken +import com.orange.ouds.theme.tokens.OudsColorKeyToken @Composable fun Screen(content: @Composable () -> Unit) { Box( modifier = Modifier .fillMaxSize() - .background(OudsColorKeyToken.Background.value) //TODO use BgDefaultPrimary token when available + .background(OudsColorKeyToken.Background.Primary.value) ) { content() } diff --git a/app/src/main/res/drawable-hdpi/il_tokens_grid_column_margin.png b/app/src/main/res/drawable-hdpi/il_tokens_grid_column_margin.png new file mode 100644 index 00000000..1ae4ef4a Binary files /dev/null and b/app/src/main/res/drawable-hdpi/il_tokens_grid_column_margin.png differ diff --git a/app/src/main/res/drawable-hdpi/il_tokens_grid_max_width.png b/app/src/main/res/drawable-hdpi/il_tokens_grid_max_width.png new file mode 100644 index 00000000..b285e6a5 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/il_tokens_grid_max_width.png differ diff --git a/app/src/main/res/drawable-hdpi/il_tokens_grid_min_width.png b/app/src/main/res/drawable-hdpi/il_tokens_grid_min_width.png new file mode 100644 index 00000000..b61e5cad Binary files /dev/null and b/app/src/main/res/drawable-hdpi/il_tokens_grid_min_width.png differ diff --git a/app/src/main/res/drawable-mdpi/il_tokens_grid_column_margin.png b/app/src/main/res/drawable-mdpi/il_tokens_grid_column_margin.png new file mode 100644 index 00000000..5b8ac22f Binary files /dev/null and b/app/src/main/res/drawable-mdpi/il_tokens_grid_column_margin.png differ diff --git a/app/src/main/res/drawable-mdpi/il_tokens_grid_max_width.png b/app/src/main/res/drawable-mdpi/il_tokens_grid_max_width.png new file mode 100644 index 00000000..2984b8e8 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/il_tokens_grid_max_width.png differ diff --git a/app/src/main/res/drawable-mdpi/il_tokens_grid_min_width.png b/app/src/main/res/drawable-mdpi/il_tokens_grid_min_width.png new file mode 100644 index 00000000..4ebc3c11 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/il_tokens_grid_min_width.png differ diff --git a/app/src/main/res/drawable-night-hdpi/il_tokens_grid_column_margin.png b/app/src/main/res/drawable-night-hdpi/il_tokens_grid_column_margin.png new file mode 100644 index 00000000..311d3a7c Binary files /dev/null and b/app/src/main/res/drawable-night-hdpi/il_tokens_grid_column_margin.png differ diff --git a/app/src/main/res/drawable-night-hdpi/il_tokens_grid_max_width.png b/app/src/main/res/drawable-night-hdpi/il_tokens_grid_max_width.png new file mode 100644 index 00000000..0daae302 Binary files /dev/null and b/app/src/main/res/drawable-night-hdpi/il_tokens_grid_max_width.png differ diff --git a/app/src/main/res/drawable-night-hdpi/il_tokens_grid_min_width.png b/app/src/main/res/drawable-night-hdpi/il_tokens_grid_min_width.png new file mode 100644 index 00000000..7dda0312 Binary files /dev/null and b/app/src/main/res/drawable-night-hdpi/il_tokens_grid_min_width.png differ diff --git a/app/src/main/res/drawable-night-mdpi/il_tokens_grid_column_margin.png b/app/src/main/res/drawable-night-mdpi/il_tokens_grid_column_margin.png new file mode 100644 index 00000000..aecea085 Binary files /dev/null and b/app/src/main/res/drawable-night-mdpi/il_tokens_grid_column_margin.png differ diff --git a/app/src/main/res/drawable-night-mdpi/il_tokens_grid_max_width.png b/app/src/main/res/drawable-night-mdpi/il_tokens_grid_max_width.png new file mode 100644 index 00000000..0c394643 Binary files /dev/null and b/app/src/main/res/drawable-night-mdpi/il_tokens_grid_max_width.png differ diff --git a/app/src/main/res/drawable-night-mdpi/il_tokens_grid_min_width.png b/app/src/main/res/drawable-night-mdpi/il_tokens_grid_min_width.png new file mode 100644 index 00000000..2c28a0c1 Binary files /dev/null and b/app/src/main/res/drawable-night-mdpi/il_tokens_grid_min_width.png differ diff --git a/app/src/main/res/drawable-night-xhdpi/il_tokens_grid_column_margin.png b/app/src/main/res/drawable-night-xhdpi/il_tokens_grid_column_margin.png new file mode 100644 index 00000000..741f740a Binary files /dev/null and b/app/src/main/res/drawable-night-xhdpi/il_tokens_grid_column_margin.png differ diff --git a/app/src/main/res/drawable-night-xhdpi/il_tokens_grid_max_width.png b/app/src/main/res/drawable-night-xhdpi/il_tokens_grid_max_width.png new file mode 100644 index 00000000..817fb52d Binary files /dev/null and b/app/src/main/res/drawable-night-xhdpi/il_tokens_grid_max_width.png differ diff --git a/app/src/main/res/drawable-night-xhdpi/il_tokens_grid_min_width.png b/app/src/main/res/drawable-night-xhdpi/il_tokens_grid_min_width.png new file mode 100644 index 00000000..0585141b Binary files /dev/null and b/app/src/main/res/drawable-night-xhdpi/il_tokens_grid_min_width.png differ diff --git a/app/src/main/res/drawable-night-xxhdpi/il_tokens_grid_column_margin.png b/app/src/main/res/drawable-night-xxhdpi/il_tokens_grid_column_margin.png new file mode 100644 index 00000000..d1c5bb1b Binary files /dev/null and b/app/src/main/res/drawable-night-xxhdpi/il_tokens_grid_column_margin.png differ diff --git a/app/src/main/res/drawable-night-xxhdpi/il_tokens_grid_max_width.png b/app/src/main/res/drawable-night-xxhdpi/il_tokens_grid_max_width.png new file mode 100644 index 00000000..0dd45f94 Binary files /dev/null and b/app/src/main/res/drawable-night-xxhdpi/il_tokens_grid_max_width.png differ diff --git a/app/src/main/res/drawable-night-xxhdpi/il_tokens_grid_min_width.png b/app/src/main/res/drawable-night-xxhdpi/il_tokens_grid_min_width.png new file mode 100644 index 00000000..5f0d109c Binary files /dev/null and b/app/src/main/res/drawable-night-xxhdpi/il_tokens_grid_min_width.png differ diff --git a/app/src/main/res/drawable-night-xxxhdpi/il_tokens_grid_column_margin.png b/app/src/main/res/drawable-night-xxxhdpi/il_tokens_grid_column_margin.png new file mode 100644 index 00000000..d1c5bb1b Binary files /dev/null and b/app/src/main/res/drawable-night-xxxhdpi/il_tokens_grid_column_margin.png differ diff --git a/app/src/main/res/drawable-night-xxxhdpi/il_tokens_grid_max_width.png b/app/src/main/res/drawable-night-xxxhdpi/il_tokens_grid_max_width.png new file mode 100644 index 00000000..0dd45f94 Binary files /dev/null and b/app/src/main/res/drawable-night-xxxhdpi/il_tokens_grid_max_width.png differ diff --git a/app/src/main/res/drawable-night-xxxhdpi/il_tokens_grid_min_width.png b/app/src/main/res/drawable-night-xxxhdpi/il_tokens_grid_min_width.png new file mode 100644 index 00000000..5f0d109c Binary files /dev/null and b/app/src/main/res/drawable-night-xxxhdpi/il_tokens_grid_min_width.png differ diff --git a/app/src/main/res/drawable-xhdpi/il_tokens_grid_column_margin.png b/app/src/main/res/drawable-xhdpi/il_tokens_grid_column_margin.png new file mode 100644 index 00000000..09f936f9 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/il_tokens_grid_column_margin.png differ diff --git a/app/src/main/res/drawable-xhdpi/il_tokens_grid_max_width.png b/app/src/main/res/drawable-xhdpi/il_tokens_grid_max_width.png new file mode 100644 index 00000000..dd885145 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/il_tokens_grid_max_width.png differ diff --git a/app/src/main/res/drawable-xhdpi/il_tokens_grid_min_width.png b/app/src/main/res/drawable-xhdpi/il_tokens_grid_min_width.png new file mode 100644 index 00000000..d35067db Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/il_tokens_grid_min_width.png differ diff --git a/app/src/main/res/drawable-xxhdpi/il_tokens_grid_column_margin.png b/app/src/main/res/drawable-xxhdpi/il_tokens_grid_column_margin.png new file mode 100644 index 00000000..381ad2f5 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/il_tokens_grid_column_margin.png differ diff --git a/app/src/main/res/drawable-xxhdpi/il_tokens_grid_max_width.png b/app/src/main/res/drawable-xxhdpi/il_tokens_grid_max_width.png new file mode 100644 index 00000000..140a3ea2 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/il_tokens_grid_max_width.png differ diff --git a/app/src/main/res/drawable-xxhdpi/il_tokens_grid_min_width.png b/app/src/main/res/drawable-xxhdpi/il_tokens_grid_min_width.png new file mode 100644 index 00000000..856d1384 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/il_tokens_grid_min_width.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/il_tokens_grid_column_margin.png b/app/src/main/res/drawable-xxxhdpi/il_tokens_grid_column_margin.png new file mode 100644 index 00000000..bca049c3 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/il_tokens_grid_column_margin.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/il_tokens_grid_max_width.png b/app/src/main/res/drawable-xxxhdpi/il_tokens_grid_max_width.png new file mode 100644 index 00000000..5d984120 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/il_tokens_grid_max_width.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/il_tokens_grid_min_width.png b/app/src/main/res/drawable-xxxhdpi/il_tokens_grid_min_width.png new file mode 100644 index 00000000..f189a900 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/il_tokens_grid_min_width.png differ diff --git a/app/src/main/res/drawable/ic_chevron_down.xml b/app/src/main/res/drawable/ic_chevron_down.xml new file mode 100644 index 00000000..1bd51497 --- /dev/null +++ b/app/src/main/res/drawable/ic_chevron_down.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_design_token_figma_no_padding.xml b/app/src/main/res/drawable/ic_design_token_figma_no_padding.xml new file mode 100644 index 00000000..e1a92b39 --- /dev/null +++ b/app/src/main/res/drawable/ic_design_token_figma_no_padding.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_dimension.xml b/app/src/main/res/drawable/ic_dimension.xml new file mode 100644 index 00000000..e6fcd809 --- /dev/null +++ b/app/src/main/res/drawable/ic_dimension.xml @@ -0,0 +1,25 @@ + + + + + + + + diff --git a/app/src/main/res/drawable/ic_menu_grid.xml b/app/src/main/res/drawable/ic_menu_grid.xml new file mode 100644 index 00000000..971d435a --- /dev/null +++ b/app/src/main/res/drawable/ic_menu_grid.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 8124a2fa..3b1491ab 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -41,10 +41,36 @@ Radius Style + + Dimension + Dimension provides standard sizing and spacing to ensure visual consistency across the UI. + + + Size + Size refers to the specific measurements used to define the dimensions of UI elements within the design system. + Icon decorative + Icon with label + %1$s (%2$s) + + + Space + Space refers to the measurements used to define the spacing between UI elements. + Scaled + Fixed + Padding inline + Padding stack + Padding inset + Column gap + Row gap + Elevation Shadows are used to give the impression of distance or elevation between surfaces, which adds depth to our designs. + + Grid + Grids are used to position content and create consistent page layouts. + Opacity Opacity can help distinguish foreground elements from background elements, making content easier to read and important actions more noticeable. diff --git a/core/src/main/java/com/orange/ouds/core/component/button/OudsButton.kt b/core/src/main/java/com/orange/ouds/core/component/button/OudsButton.kt index 115b0873..be40f5ec 100644 --- a/core/src/main/java/com/orange/ouds/core/component/button/OudsButton.kt +++ b/core/src/main/java/com/orange/ouds/core/component/button/OudsButton.kt @@ -28,6 +28,7 @@ import com.orange.ouds.core.theme.value import com.orange.ouds.core.utilities.OudsPreview import com.orange.ouds.foundation.utilities.BasicPreviewParameterProvider import com.orange.ouds.foundation.utilities.UiModePreviews +import com.orange.ouds.theme.tokens.OudsColorKeyToken @Composable fun OudsButton( @@ -64,7 +65,8 @@ fun OudsButton( Text( modifier = modifier, text = text, - style = labelStyle.value + style = labelStyle.value, + color = OudsColorKeyToken.Content.OnActionPrimaryEnabled.value ) } } diff --git a/core/src/main/java/com/orange/ouds/core/theme/OudsColorScheme.kt b/core/src/main/java/com/orange/ouds/core/theme/OudsColorScheme.kt new file mode 100644 index 00000000..fbfac2e1 --- /dev/null +++ b/core/src/main/java/com/orange/ouds/core/theme/OudsColorScheme.kt @@ -0,0 +1,1121 @@ +/* + * Software Name: OUDS Android + * SPDX-FileCopyrightText: Copyright (c) Orange SA + * SPDX-License-Identifier: MIT + * + * This software is distributed under the MIT license, + * the text of which is available at https://opensource.org/license/MIT/ + * or see the "LICENSE" file for more details. + * + * Software description: Android library of reusable graphical components + */ + +package com.orange.ouds.core.theme + +import androidx.compose.material3.ColorScheme +import androidx.compose.material3.darkColorScheme +import androidx.compose.material3.lightColorScheme +import androidx.compose.runtime.Composable +import androidx.compose.runtime.ReadOnlyComposable +import androidx.compose.runtime.Stable +import androidx.compose.ui.graphics.Color +import com.orange.ouds.theme.tokens.OudsColorKeyToken +import com.orange.ouds.theme.tokens.semantic.OudsColorSemanticTokens + +data class OudsColorScheme( + val globalColors: Global, + val actionColors: Action, + val alwaysColors: Always, + val backgroundColors: Background, + val borderColors: Border, + val brandColors: Brand, + val contentColors: Content, + val elevationColors: Elevation, + val gradientColors: Gradient, + val decorativeColors: Decorative, +) { + + data class Global( + val transparentDefault: Color + ) + + data class Action( + val disabled: Color, + val disabledOnBgEmphasized: Color, + val negativeEnabled: Color, + val negativeFocus: Color, + val negativeHover: Color, + val negativeLoading: Color, + val negativePressed: Color, + val primaryEnabled: Color, + val primaryEnabledOnBgEmphasized: Color, + val primaryFocus: Color, + val primaryFocusOnBgEmphasized: Color, + val primaryHover: Color, + val primaryHoverOnBgEmphasized: Color, + val primaryLoading: Color, + val primaryLoadingOnBgEmphasized: Color, + val primaryPressed: Color, + val primaryPressedOnBgEmphasized: Color, + val secondaryEnabled: Color, + val secondaryEnabledOnBgEmphasized: Color, + val secondaryFocus: Color, + val secondaryFocusOnBgEmphasized: Color, + val secondaryHover: Color, + val secondaryHoverOnBgEmphasized: Color, + val secondaryLoading: Color, + val secondaryLoadingOnBgEmphasized: Color, + val secondaryPressed: Color, + val secondaryPressedOnBgEmphasized: Color, + val selected: Color, + val selectedOnBgEmphasized: Color, + val visited: Color, + val visitedOnBgEmphasized: Color, + ) + + data class Always( + val accent: Color, + val black: Color, + val info: Color, + val negative: Color, + val onAccent: Color, + val onBlack: Color, + val onInfo: Color, + val onNegative: Color, + val onPositive: Color, + val onWarning: Color, + val onWhite: Color, + val positive: Color, + val warning: Color, + val white: Color, + ) + + data class Background( + val brandPrimary: Color, + val emphasized: Color, + val primary: Color, + val secondary: Color, + val statusAccentEmphasized: Color, + val statusAccentMuted: Color, + val statusAccentMutedOnBgEmphasized: Color, + val statusInfoEmphasized: Color, + val statusInfoMuted: Color, + val statusInfoMutedOnBgEmphasized: Color, + val statusNegativeEmphasized: Color, + val statusNegativeMuted: Color, + val statusNegativeMutedOnBgEmphasized: Color, + val statusNeutral: Color, + val statusNeutralOnBgEmphasized: Color, + val statusPositiveEmphasized: Color, + val statusPositiveMuted: Color, + val statusPositiveMutedOnBgEmphasized: Color, + val statusWarningEmphasized: Color, + val statusWarningMuted: Color, + val statusWarningMutedOnBgEmphasized: Color, + val tertiary: Color, + ) + + data class Border( + val brandPrimary: Color, + val brandPrimaryOnBgEmphasized: Color, + val default: Color, + val defaultOnBgEmphasized: Color, + val emphasized: Color, + val emphasizedOnBgEmphasized: Color, + val focus: Color, + val focusInset: Color, + val focusInsetOnBgEmphasized: Color, + val focusOnBgEmphasized: Color, + val onBrandPrimary: Color, + ) + + data class Brand( + val accentDefault: Color, + val accentHigh: Color, + val accentHighest: Color, + val accentLowest: Color, + val infoDefault: Color, + val infoHighest: Color, + val infoLowest: Color, + val negativeDefault: Color, + val negativeHigh: Color, + val negativeHigher: Color, + val negativeHighest: Color, + val negativeLowest: Color, + val neutralEmphasizedBlack: Color, + val neutralEmphasizedHigh: Color, + val neutralEmphasizedHigher: Color, + val neutralEmphasizedHighest: Color, + val neutralEmphasizedLow: Color, + val neutralEmphasizedLower: Color, + val neutralEmphasizedLowest: Color, + val neutralEmphasizedMedium: Color, + val neutralMutedHighest: Color, + val neutralMutedLow: Color, + val neutralMutedLower: Color, + val neutralMutedLowest: Color, + val neutralMutedMedium: Color, + val neutralMutedWhite: Color, + val positiveDefault: Color, + val positiveHighest: Color, + val positiveLowest: Color, + val primaryDefault: Color, + val primaryLow: Color, + val warningDefault: Color, + val warningHigh: Color, + val warningHighest: Color, + val warningLowest: Color, + ) + + data class Content( + val brandPrimary: Color, + val brandPrimaryOnBgEmphasized: Color, + val default: Color, + val defaultOnBgEmphasized: Color, + val disabled: Color, + val disabledOnBgEmphasized: Color, + val muted: Color, + val mutedOnBgEmphasized: Color, + val onActionDisabled: Color, + val onActionDisabledOnBgEmphasized: Color, + val onActionNegative: Color, + val onActionPrimaryEnabled: Color, + val onActionPrimaryEnabledOnBgEmphasized: Color, + val onActionPrimaryFocus: Color, + val onActionPrimaryFocusOnBgEmphasized: Color, + val onActionPrimaryHover: Color, + val onActionPrimaryHoverOnBgEmphasized: Color, + val onActionPrimaryLoading: Color, + val onActionPrimaryLoadingOnBgEmphasized: Color, + val onActionPrimaryPressed: Color, + val onActionPrimaryPressedOnBgEmphasized: Color, + val onBrandPrimary: Color, + val onStatusAccentEmphasized: Color, + val onStatusAccentMuted: Color, + val onStatusAccentMutedOnBgEmphasized: Color, + val onStatusInfoEmphasized: Color, + val onStatusInfoMuted: Color, + val onStatusInfoMutedOnBgEmphasized: Color, + val onStatusNegativeEmphasized: Color, + val onStatusNegativeMuted: Color, + val onStatusNegativeMutedOnBgEmphasized: Color, + val onStatusPositiveEmphasized: Color, + val onStatusPositiveMuted: Color, + val onStatusPositiveMutedOnBgEmphasized: Color, + val onStatusWarningEmphasized: Color, + val onStatusWarningMuted: Color, + val onStatusWarningMutedOnBgEmphasized: Color, + val statusInfo: Color, + val statusNegative: Color, + val statusPositive: Color, + val statusWarning: Color, + ) + + data class Elevation( + val drag: Color, + val dragOnBgEmphasized: Color, + val dragOnBgSecondary: Color, + val modal: Color, + val overlayDefault: Color, + val overlayDefaultOnBgEmphasized: Color, + val overlayDefaultOnBgSecondary: Color, + val overlayEmphasized: Color, + val overlayEmphasizedOnBgEmphasized: Color, + val overlayEmphasizedOnBgSecondary: Color, + val raised: Color, + val raisedOnBgEmphasized: Color, + val raisedOnBgSecondary: Color, + ) + + data class Gradient( + val skeletonMiddle: Color, + val skeletonMiddleOnBgEmphasized: Color, + val skeletonStartEnd: Color, + val skeletonStartEndOnBgEmphasized: Color, + ) + + data class Decorative( + val accent1Default: Color, + val accent1Emphasized: Color, + val accent1Muted: Color, + val accent2Default: Color, + val accent2Emphasized: Color, + val accent2Muted: Color, + val accent3Default: Color, + val accent3Emphasized: Color, + val accent3Muted: Color, + val accent4Default: Color, + val accent4Emphasized: Color, + val accent4Muted: Color, + val accent5Default: Color, + val accent5Emphasized: Color, + val accent5Muted: Color, + val brandPrimary: Color, + val brandSecondary: Color, + val brandTertiary: Color, + val neutralDefault: Color, + val neutralEmphasized: Color, + val neutralMuted: Color, + val skinTint100: Color, + val skinTint200: Color, + val skinTint300: Color, + val skinTint400: Color, + val skinTint500: Color, + val skinTint600: Color, + val skinTint700: Color, + val skinTint800: Color, + val skinTint900: Color, + ) +} + +val OudsColorSemanticTokens.lightColorScheme: OudsColorScheme + get() = OudsColorScheme( + globalColors = OudsColorScheme.Global( + transparentDefault = globalColorTokens.transparentDefaultLight, + ), + actionColors = OudsColorScheme.Action( + disabled = actionColorTokens.actionDisabledLight, + disabledOnBgEmphasized = actionColorTokens.actionDisabledOnBgEmphasizedLight, + negativeEnabled = actionColorTokens.actionNegativeEnabledLight, + negativeFocus = actionColorTokens.actionNegativeFocusLight, + negativeHover = actionColorTokens.actionNegativeHoverLight, + negativeLoading = actionColorTokens.actionNegativeLoadingLight, + negativePressed = actionColorTokens.actionNegativePressedLight, + primaryEnabled = actionColorTokens.actionPrimaryEnabledLight, + primaryEnabledOnBgEmphasized = actionColorTokens.actionPrimaryEnabledOnBgEmphasizedLight, + primaryFocus = actionColorTokens.actionPrimaryFocusLight, + primaryFocusOnBgEmphasized = actionColorTokens.actionPrimaryFocusOnBgEmphasizedLight, + primaryHover = actionColorTokens.actionPrimaryHoverLight, + primaryHoverOnBgEmphasized = actionColorTokens.actionPrimaryHoverOnBgEmphasizedLight, + primaryLoading = actionColorTokens.actionPrimaryLoadingLight, + primaryLoadingOnBgEmphasized = actionColorTokens.actionPrimaryLoadingOnBgEmphasizedLight, + primaryPressed = actionColorTokens.actionPrimaryPressedLight, + primaryPressedOnBgEmphasized = actionColorTokens.actionPrimaryPressedOnBgEmphasizedLight, + secondaryEnabled = actionColorTokens.actionSecondaryEnabledLight, + secondaryEnabledOnBgEmphasized = actionColorTokens.actionSecondaryEnabledOnBgEmphasizedLight, + secondaryFocus = actionColorTokens.actionSecondaryFocusLight, + secondaryFocusOnBgEmphasized = actionColorTokens.actionSecondaryFocusOnBgEmphasizedLight, + secondaryHover = actionColorTokens.actionSecondaryHoverLight, + secondaryHoverOnBgEmphasized = actionColorTokens.actionSecondaryHoverOnBgEmphasizedLight, + secondaryLoading = actionColorTokens.actionSecondaryLoadingLight, + secondaryLoadingOnBgEmphasized = actionColorTokens.actionSecondaryLoadingOnBgEmphasizedLight, + secondaryPressed = actionColorTokens.actionSecondaryPressedLight, + secondaryPressedOnBgEmphasized = actionColorTokens.actionSecondaryPressedOnBgEmphasizedLight, + selected = actionColorTokens.actionSelectedLight, + selectedOnBgEmphasized = actionColorTokens.actionSelectedOnBgEmphasizedLight, + visited = actionColorTokens.actionVisitedLight, + visitedOnBgEmphasized = actionColorTokens.actionVisitedOnBgEmphasizedLight, + ), + alwaysColors = OudsColorScheme.Always( + accent = alwaysColorTokens.alwaysAccentLight, + black = alwaysColorTokens.alwaysBlackLight, + info = alwaysColorTokens.alwaysInfoLight, + negative = alwaysColorTokens.alwaysNegativeLight, + onAccent = alwaysColorTokens.alwaysOnAccentLight, + onBlack = alwaysColorTokens.alwaysOnBlackLight, + onInfo = alwaysColorTokens.alwaysOnInfoLight, + onNegative = alwaysColorTokens.alwaysOnNegativeLight, + onPositive = alwaysColorTokens.alwaysOnPositiveLight, + onWarning = alwaysColorTokens.alwaysOnWarningLight, + onWhite = alwaysColorTokens.alwaysOnWhiteLight, + positive = alwaysColorTokens.alwaysPositiveLight, + warning = alwaysColorTokens.alwaysWarningLight, + white = alwaysColorTokens.alwaysWhiteLight, + ), + backgroundColors = OudsColorScheme.Background( + brandPrimary = backgroundColorTokens.bgBrandPrimaryLight, + emphasized = backgroundColorTokens.bgEmphasizedLight, + primary = backgroundColorTokens.bgPrimaryLight, + secondary = backgroundColorTokens.bgSecondaryLight, + statusAccentEmphasized = backgroundColorTokens.bgStatusAccentEmphasizedLight, + statusAccentMuted = backgroundColorTokens.bgStatusAccentMutedLight, + statusAccentMutedOnBgEmphasized = backgroundColorTokens.bgStatusAccentMutedOnBgEmphasizedLight, + statusInfoEmphasized = backgroundColorTokens.bgStatusInfoEmphasizedLight, + statusInfoMuted = backgroundColorTokens.bgStatusInfoMutedLight, + statusInfoMutedOnBgEmphasized = backgroundColorTokens.bgStatusInfoMutedOnBgEmphasizedLight, + statusNegativeEmphasized = backgroundColorTokens.bgStatusNegativeEmphasizedLight, + statusNegativeMuted = backgroundColorTokens.bgStatusNegativeMutedLight, + statusNegativeMutedOnBgEmphasized = backgroundColorTokens.bgStatusNegativeMutedOnBgEmphasizedLight, + statusNeutral = backgroundColorTokens.bgStatusNeutralLight, + statusNeutralOnBgEmphasized = backgroundColorTokens.bgStatusNeutralOnBgEmphasizedLight, + statusPositiveEmphasized = backgroundColorTokens.bgStatusPositiveEmphasizedLight, + statusPositiveMuted = backgroundColorTokens.bgStatusPositiveMutedLight, + statusPositiveMutedOnBgEmphasized = backgroundColorTokens.bgStatusPositiveMutedOnBgEmphasizedLight, + statusWarningEmphasized = backgroundColorTokens.bgStatusWarningEmphasizedLight, + statusWarningMuted = backgroundColorTokens.bgStatusWarningMutedLight, + statusWarningMutedOnBgEmphasized = backgroundColorTokens.bgStatusWarningMutedOnBgEmphasizedLight, + tertiary = backgroundColorTokens.bgTertiaryLight, + ), + borderColors = OudsColorScheme.Border( + brandPrimary = borderColorTokens.borderBrandPrimaryLight, + brandPrimaryOnBgEmphasized = borderColorTokens.borderBrandPrimaryOnBgEmphasizedLight, + default = borderColorTokens.borderDefaultLight, + defaultOnBgEmphasized = borderColorTokens.borderDefaultOnBgEmphasizedLight, + emphasized = borderColorTokens.borderEmphasizedLight, + emphasizedOnBgEmphasized = borderColorTokens.borderEmphasizedOnBgEmphasizedLight, + focus = borderColorTokens.borderFocusLight, + focusInset = borderColorTokens.borderFocusInsetLight, + focusInsetOnBgEmphasized = borderColorTokens.borderFocusInsetOnBgEmphasizedLight, + focusOnBgEmphasized = borderColorTokens.borderFocusOnBgEmphasizedLight, + onBrandPrimary = borderColorTokens.borderOnBrandPrimaryLight, + ), + brandColors = OudsColorScheme.Brand( + accentDefault = brandColorTokens.brandAccentDefaultLight, + accentHigh = brandColorTokens.brandAccentHighLight, + accentHighest = brandColorTokens.brandAccentHighestLight, + accentLowest = brandColorTokens.brandAccentLowestLight, + infoDefault = brandColorTokens.brandInfoDefaultLight, + infoHighest = brandColorTokens.brandInfoHighestLight, + infoLowest = brandColorTokens.brandInfoLowestLight, + negativeDefault = brandColorTokens.brandNegativeDefaultLight, + negativeHigh = brandColorTokens.brandNegativeHighLight, + negativeHigher = brandColorTokens.brandNegativeHigherLight, + negativeHighest = brandColorTokens.brandNegativeHighestLight, + negativeLowest = brandColorTokens.brandNegativeLowestLight, + neutralEmphasizedBlack = brandColorTokens.brandNeutralEmphasizedBlackLight, + neutralEmphasizedHigh = brandColorTokens.brandNeutralEmphasizedHighLight, + neutralEmphasizedHigher = brandColorTokens.brandNeutralEmphasizedHigherLight, + neutralEmphasizedHighest = brandColorTokens.brandNeutralEmphasizedHighestLight, + neutralEmphasizedLow = brandColorTokens.brandNeutralEmphasizedLowLight, + neutralEmphasizedLower = brandColorTokens.brandNeutralEmphasizedLowerLight, + neutralEmphasizedLowest = brandColorTokens.brandNeutralEmphasizedLowestLight, + neutralEmphasizedMedium = brandColorTokens.brandNeutralEmphasizedMediumLight, + neutralMutedHighest = brandColorTokens.brandNeutralMutedHighestLight, + neutralMutedLow = brandColorTokens.brandNeutralMutedLowLight, + neutralMutedLower = brandColorTokens.brandNeutralMutedLowerLight, + neutralMutedLowest = brandColorTokens.brandNeutralMutedLowestLight, + neutralMutedMedium = brandColorTokens.brandNeutralMutedMediumLight, + neutralMutedWhite = brandColorTokens.brandNeutralMutedWhiteLight, + positiveDefault = brandColorTokens.brandPositiveDefaultLight, + positiveHighest = brandColorTokens.brandPositiveHighestLight, + positiveLowest = brandColorTokens.brandPositiveLowestLight, + primaryDefault = brandColorTokens.brandPrimaryDefaultLight, + primaryLow = brandColorTokens.brandPrimaryLowLight, + warningDefault = brandColorTokens.brandWarningDefaultLight, + warningHigh = brandColorTokens.brandWarningHighLight, + warningHighest = brandColorTokens.brandWarningHighestLight, + warningLowest = brandColorTokens.brandWarningLowestLight, + ), + contentColors = OudsColorScheme.Content( + brandPrimary = contentColorTokens.contentBrandPrimaryLight, + brandPrimaryOnBgEmphasized = contentColorTokens.contentBrandPrimaryOnBgEmphasizedLight, + default = contentColorTokens.contentDefaultLight, + defaultOnBgEmphasized = contentColorTokens.contentDefaultOnBgEmphasizedLight, + disabled = contentColorTokens.contentDisabledLight, + disabledOnBgEmphasized = contentColorTokens.contentDisabledOnBgEmphasizedLight, + muted = contentColorTokens.contentMutedLight, + mutedOnBgEmphasized = contentColorTokens.contentMutedOnBgEmphasizedLight, + onActionDisabled = contentColorTokens.contentOnActionDisabledLight, + onActionDisabledOnBgEmphasized = contentColorTokens.contentOnActionDisabledOnBgEmphasizedLight, + onActionNegative = contentColorTokens.contentOnActionNegativeLight, + onActionPrimaryEnabled = contentColorTokens.contentOnActionPrimaryEnabledLight, + onActionPrimaryEnabledOnBgEmphasized = contentColorTokens.contentOnActionPrimaryEnabledOnBgEmphasizedLight, + onActionPrimaryFocus = contentColorTokens.contentOnActionPrimaryFocusLight, + onActionPrimaryFocusOnBgEmphasized = contentColorTokens.contentOnActionPrimaryFocusOnBgEmphasizedLight, + onActionPrimaryHover = contentColorTokens.contentOnActionPrimaryHoverLight, + onActionPrimaryHoverOnBgEmphasized = contentColorTokens.contentOnActionPrimaryHoverOnBgEmphasizedLight, + onActionPrimaryLoading = contentColorTokens.contentOnActionPrimaryLoadingLight, + onActionPrimaryLoadingOnBgEmphasized = contentColorTokens.contentOnActionPrimaryLoadingOnBgEmphasizedLight, + onActionPrimaryPressed = contentColorTokens.contentOnActionPrimaryPressedLight, + onActionPrimaryPressedOnBgEmphasized = contentColorTokens.contentOnActionPrimaryPressedOnBgEmphasizedLight, + onBrandPrimary = contentColorTokens.contentOnBrandPrimaryLight, + onStatusAccentEmphasized = contentColorTokens.contentOnStatusAccentEmphasizedLight, + onStatusAccentMuted = contentColorTokens.contentOnStatusAccentMutedLight, + onStatusAccentMutedOnBgEmphasized = contentColorTokens.contentOnStatusAccentMutedOnBgEmphasizedLight, + onStatusInfoEmphasized = contentColorTokens.contentOnStatusInfoEmphasizedLight, + onStatusInfoMuted = contentColorTokens.contentOnStatusInfoMutedLight, + onStatusInfoMutedOnBgEmphasized = contentColorTokens.contentOnStatusInfoMutedOnBgEmphasizedLight, + onStatusNegativeEmphasized = contentColorTokens.contentOnStatusNegativeEmphasizedLight, + onStatusNegativeMuted = contentColorTokens.contentOnStatusNegativeMutedLight, + onStatusNegativeMutedOnBgEmphasized = contentColorTokens.contentOnStatusNegativeMutedOnBgEmphasizedLight, + onStatusPositiveEmphasized = contentColorTokens.contentOnStatusPositiveEmphasizedLight, + onStatusPositiveMuted = contentColorTokens.contentOnStatusPositiveMutedLight, + onStatusPositiveMutedOnBgEmphasized = contentColorTokens.contentOnStatusPositiveMutedOnBgEmphasizedLight, + onStatusWarningEmphasized = contentColorTokens.contentOnStatusWarningEmphasizedLight, + onStatusWarningMuted = contentColorTokens.contentOnStatusWarningMutedLight, + onStatusWarningMutedOnBgEmphasized = contentColorTokens.contentOnStatusWarningMutedOnBgEmphasizedLight, + statusInfo = contentColorTokens.contentStatusInfoLight, + statusNegative = contentColorTokens.contentStatusNegativeLight, + statusPositive = contentColorTokens.contentStatusPositiveLight, + statusWarning = contentColorTokens.contentStatusWarningLight, + ), + elevationColors = OudsColorScheme.Elevation( + drag = elevationColorTokens.elevationDragLight, + dragOnBgEmphasized = elevationColorTokens.elevationDragOnBgEmphasizedLight, + dragOnBgSecondary = elevationColorTokens.elevationDragOnBgSecondaryLight, + modal = elevationColorTokens.elevationModalLight, + overlayDefault = elevationColorTokens.elevationOverlayDefaultLight, + overlayDefaultOnBgEmphasized = elevationColorTokens.elevationOverlayDefaultOnBgEmphasizedLight, + overlayDefaultOnBgSecondary = elevationColorTokens.elevationOverlayDefaultOnBgSecondaryLight, + overlayEmphasized = elevationColorTokens.elevationOverlayEmphasizedLight, + overlayEmphasizedOnBgEmphasized = elevationColorTokens.elevationOverlayEmphasizedOnBgEmphasizedLight, + overlayEmphasizedOnBgSecondary = elevationColorTokens.elevationOverlayEmphasizedOnBgSecondaryLight, + raised = elevationColorTokens.elevationRaisedLight, + raisedOnBgEmphasized = elevationColorTokens.elevationRaisedOnBgEmphasizedLight, + raisedOnBgSecondary = elevationColorTokens.elevationRaisedOnBgSecondaryLight, + ), + gradientColors = OudsColorScheme.Gradient( + skeletonMiddle = gradientColorTokens.gradientSkeletonMiddleLight, + skeletonMiddleOnBgEmphasized = gradientColorTokens.gradientSkeletonMiddleOnBgEmphasizedLight, + skeletonStartEnd = gradientColorTokens.gradientSkeletonStartEndLight, + skeletonStartEndOnBgEmphasized = gradientColorTokens.gradientSkeletonStartEndOnBgEmphasizedLight, + ), + decorativeColors = OudsColorScheme.Decorative( + accent1Default = decorativeColorTokens.decorativeAccent1DefaultLight, + accent1Emphasized = decorativeColorTokens.decorativeAccent1EmphasizedLight, + accent1Muted = decorativeColorTokens.decorativeAccent1MutedLight, + accent2Default = decorativeColorTokens.decorativeAccent2DefaultLight, + accent2Emphasized = decorativeColorTokens.decorativeAccent2EmphasizedLight, + accent2Muted = decorativeColorTokens.decorativeAccent2MutedLight, + accent3Default = decorativeColorTokens.decorativeAccent3DefaultLight, + accent3Emphasized = decorativeColorTokens.decorativeAccent3EmphasizedLight, + accent3Muted = decorativeColorTokens.decorativeAccent3MutedLight, + accent4Default = decorativeColorTokens.decorativeAccent4DefaultLight, + accent4Emphasized = decorativeColorTokens.decorativeAccent4EmphasizedLight, + accent4Muted = decorativeColorTokens.decorativeAccent4MutedLight, + accent5Default = decorativeColorTokens.decorativeAccent5DefaultLight, + accent5Emphasized = decorativeColorTokens.decorativeAccent5EmphasizedLight, + accent5Muted = decorativeColorTokens.decorativeAccent5MutedLight, + brandPrimary = decorativeColorTokens.decorativeBrandPrimaryLight, + brandSecondary = decorativeColorTokens.decorativeBrandSecondaryLight, + brandTertiary = decorativeColorTokens.decorativeBrandTertiaryLight, + neutralDefault = decorativeColorTokens.decorativeNeutralDefaultLight, + neutralEmphasized = decorativeColorTokens.decorativeNeutralEmphasizedLight, + neutralMuted = decorativeColorTokens.decorativeNeutralMutedLight, + skinTint100 = decorativeColorTokens.decorativeSkinTint100Light, + skinTint200 = decorativeColorTokens.decorativeSkinTint200Light, + skinTint300 = decorativeColorTokens.decorativeSkinTint300Light, + skinTint400 = decorativeColorTokens.decorativeSkinTint400Light, + skinTint500 = decorativeColorTokens.decorativeSkinTint500Light, + skinTint600 = decorativeColorTokens.decorativeSkinTint600Light, + skinTint700 = decorativeColorTokens.decorativeSkinTint700Light, + skinTint800 = decorativeColorTokens.decorativeSkinTint800Light, + skinTint900 = decorativeColorTokens.decorativeSkinTint900Light, + ), + ) + +val OudsColorSemanticTokens.darkColorScheme: OudsColorScheme + get() = OudsColorScheme( + globalColors = OudsColorScheme.Global( + transparentDefault = globalColorTokens.transparentDefaultDark, + ), + actionColors = OudsColorScheme.Action( + disabled = actionColorTokens.actionDisabledDark, + disabledOnBgEmphasized = actionColorTokens.actionDisabledOnBgEmphasizedDark, + negativeEnabled = actionColorTokens.actionNegativeEnabledDark, + negativeFocus = actionColorTokens.actionNegativeFocusDark, + negativeHover = actionColorTokens.actionNegativeHoverDark, + negativeLoading = actionColorTokens.actionNegativeLoadingDark, + negativePressed = actionColorTokens.actionNegativePressedDark, + primaryEnabled = actionColorTokens.actionPrimaryEnabledDark, + primaryEnabledOnBgEmphasized = actionColorTokens.actionPrimaryEnabledOnBgEmphasizedDark, + primaryFocus = actionColorTokens.actionPrimaryFocusDark, + primaryFocusOnBgEmphasized = actionColorTokens.actionPrimaryFocusOnBgEmphasizedDark, + primaryHover = actionColorTokens.actionPrimaryHoverDark, + primaryHoverOnBgEmphasized = actionColorTokens.actionPrimaryHoverOnBgEmphasizedDark, + primaryLoading = actionColorTokens.actionPrimaryLoadingDark, + primaryLoadingOnBgEmphasized = actionColorTokens.actionPrimaryLoadingOnBgEmphasizedDark, + primaryPressed = actionColorTokens.actionPrimaryPressedDark, + primaryPressedOnBgEmphasized = actionColorTokens.actionPrimaryPressedOnBgEmphasizedDark, + secondaryEnabled = actionColorTokens.actionSecondaryEnabledDark, + secondaryEnabledOnBgEmphasized = actionColorTokens.actionSecondaryEnabledOnBgEmphasizedDark, + secondaryFocus = actionColorTokens.actionSecondaryFocusDark, + secondaryFocusOnBgEmphasized = actionColorTokens.actionSecondaryFocusOnBgEmphasizedDark, + secondaryHover = actionColorTokens.actionSecondaryHoverDark, + secondaryHoverOnBgEmphasized = actionColorTokens.actionSecondaryHoverOnBgEmphasizedDark, + secondaryLoading = actionColorTokens.actionSecondaryLoadingDark, + secondaryLoadingOnBgEmphasized = actionColorTokens.actionSecondaryLoadingOnBgEmphasizedDark, + secondaryPressed = actionColorTokens.actionSecondaryPressedDark, + secondaryPressedOnBgEmphasized = actionColorTokens.actionSecondaryPressedOnBgEmphasizedDark, + selected = actionColorTokens.actionSelectedDark, + selectedOnBgEmphasized = actionColorTokens.actionSelectedOnBgEmphasizedDark, + visited = actionColorTokens.actionVisitedDark, + visitedOnBgEmphasized = actionColorTokens.actionVisitedOnBgEmphasizedDark, + ), + alwaysColors = OudsColorScheme.Always( + accent = alwaysColorTokens.alwaysAccentDark, + black = alwaysColorTokens.alwaysBlackDark, + info = alwaysColorTokens.alwaysInfoDark, + negative = alwaysColorTokens.alwaysNegativeDark, + onAccent = alwaysColorTokens.alwaysOnAccentDark, + onBlack = alwaysColorTokens.alwaysOnBlackDark, + onInfo = alwaysColorTokens.alwaysOnInfoDark, + onNegative = alwaysColorTokens.alwaysOnNegativeDark, + onPositive = alwaysColorTokens.alwaysOnPositiveDark, + onWarning = alwaysColorTokens.alwaysOnWarningDark, + onWhite = alwaysColorTokens.alwaysOnWhiteDark, + positive = alwaysColorTokens.alwaysPositiveDark, + warning = alwaysColorTokens.alwaysWarningDark, + white = alwaysColorTokens.alwaysWhiteDark, + ), + backgroundColors = OudsColorScheme.Background( + brandPrimary = backgroundColorTokens.bgBrandPrimaryDark, + emphasized = backgroundColorTokens.bgEmphasizedDark, + primary = backgroundColorTokens.bgPrimaryDark, + secondary = backgroundColorTokens.bgSecondaryDark, + statusAccentEmphasized = backgroundColorTokens.bgStatusAccentEmphasizedDark, + statusAccentMuted = backgroundColorTokens.bgStatusAccentMutedDark, + statusAccentMutedOnBgEmphasized = backgroundColorTokens.bgStatusAccentMutedOnBgEmphasizedDark, + statusInfoEmphasized = backgroundColorTokens.bgStatusInfoEmphasizedDark, + statusInfoMuted = backgroundColorTokens.bgStatusInfoMutedDark, + statusInfoMutedOnBgEmphasized = backgroundColorTokens.bgStatusInfoMutedOnBgEmphasizedDark, + statusNegativeEmphasized = backgroundColorTokens.bgStatusNegativeEmphasizedDark, + statusNegativeMuted = backgroundColorTokens.bgStatusNegativeMutedDark, + statusNegativeMutedOnBgEmphasized = backgroundColorTokens.bgStatusNegativeMutedOnBgEmphasizedDark, + statusNeutral = backgroundColorTokens.bgStatusNeutralDark, + statusNeutralOnBgEmphasized = backgroundColorTokens.bgStatusNeutralOnBgEmphasizedDark, + statusPositiveEmphasized = backgroundColorTokens.bgStatusPositiveEmphasizedDark, + statusPositiveMuted = backgroundColorTokens.bgStatusPositiveMutedDark, + statusPositiveMutedOnBgEmphasized = backgroundColorTokens.bgStatusPositiveMutedOnBgEmphasizedDark, + statusWarningEmphasized = backgroundColorTokens.bgStatusWarningEmphasizedDark, + statusWarningMuted = backgroundColorTokens.bgStatusWarningMutedDark, + statusWarningMutedOnBgEmphasized = backgroundColorTokens.bgStatusWarningMutedOnBgEmphasizedDark, + tertiary = backgroundColorTokens.bgTertiaryDark, + ), + borderColors = OudsColorScheme.Border( + brandPrimary = borderColorTokens.borderBrandPrimaryDark, + brandPrimaryOnBgEmphasized = borderColorTokens.borderBrandPrimaryOnBgEmphasizedDark, + default = borderColorTokens.borderDefaultDark, + defaultOnBgEmphasized = borderColorTokens.borderDefaultOnBgEmphasizedDark, + emphasized = borderColorTokens.borderEmphasizedDark, + emphasizedOnBgEmphasized = borderColorTokens.borderEmphasizedOnBgEmphasizedDark, + focus = borderColorTokens.borderFocusDark, + focusInset = borderColorTokens.borderFocusInsetDark, + focusInsetOnBgEmphasized = borderColorTokens.borderFocusInsetOnBgEmphasizedDark, + focusOnBgEmphasized = borderColorTokens.borderFocusOnBgEmphasizedDark, + onBrandPrimary = borderColorTokens.borderOnBrandPrimaryDark, + ), + brandColors = OudsColorScheme.Brand( + accentDefault = brandColorTokens.brandAccentDefaultDark, + accentHigh = brandColorTokens.brandAccentHighDark, + accentHighest = brandColorTokens.brandAccentHighestDark, + accentLowest = brandColorTokens.brandAccentLowestDark, + infoDefault = brandColorTokens.brandInfoDefaultDark, + infoHighest = brandColorTokens.brandInfoHighestDark, + infoLowest = brandColorTokens.brandInfoLowestDark, + negativeDefault = brandColorTokens.brandNegativeDefaultDark, + negativeHigh = brandColorTokens.brandNegativeHighDark, + negativeHigher = brandColorTokens.brandNegativeHigherDark, + negativeHighest = brandColorTokens.brandNegativeHighestDark, + negativeLowest = brandColorTokens.brandNegativeLowestDark, + neutralEmphasizedBlack = brandColorTokens.brandNeutralEmphasizedBlackDark, + neutralEmphasizedHigh = brandColorTokens.brandNeutralEmphasizedHighDark, + neutralEmphasizedHigher = brandColorTokens.brandNeutralEmphasizedHigherDark, + neutralEmphasizedHighest = brandColorTokens.brandNeutralEmphasizedHighestDark, + neutralEmphasizedLow = brandColorTokens.brandNeutralEmphasizedLowDark, + neutralEmphasizedLower = brandColorTokens.brandNeutralEmphasizedLowerDark, + neutralEmphasizedLowest = brandColorTokens.brandNeutralEmphasizedLowestDark, + neutralEmphasizedMedium = brandColorTokens.brandNeutralEmphasizedMediumDark, + neutralMutedHighest = brandColorTokens.brandNeutralMutedHighestDark, + neutralMutedLow = brandColorTokens.brandNeutralMutedLowDark, + neutralMutedLower = brandColorTokens.brandNeutralMutedLowerDark, + neutralMutedLowest = brandColorTokens.brandNeutralMutedLowestDark, + neutralMutedMedium = brandColorTokens.brandNeutralMutedMediumDark, + neutralMutedWhite = brandColorTokens.brandNeutralMutedWhiteDark, + positiveDefault = brandColorTokens.brandPositiveDefaultDark, + positiveHighest = brandColorTokens.brandPositiveHighestDark, + positiveLowest = brandColorTokens.brandPositiveLowestDark, + primaryDefault = brandColorTokens.brandPrimaryDefaultDark, + primaryLow = brandColorTokens.brandPrimaryLowDark, + warningDefault = brandColorTokens.brandWarningDefaultDark, + warningHigh = brandColorTokens.brandWarningHighDark, + warningHighest = brandColorTokens.brandWarningHighestDark, + warningLowest = brandColorTokens.brandWarningLowestDark, + ), + contentColors = OudsColorScheme.Content( + brandPrimary = contentColorTokens.contentBrandPrimaryDark, + brandPrimaryOnBgEmphasized = contentColorTokens.contentBrandPrimaryOnBgEmphasizedDark, + default = contentColorTokens.contentDefaultDark, + defaultOnBgEmphasized = contentColorTokens.contentDefaultOnBgEmphasizedDark, + disabled = contentColorTokens.contentDisabledDark, + disabledOnBgEmphasized = contentColorTokens.contentDisabledOnBgEmphasizedDark, + muted = contentColorTokens.contentMutedDark, + mutedOnBgEmphasized = contentColorTokens.contentMutedOnBgEmphasizedDark, + onActionDisabled = contentColorTokens.contentOnActionDisabledDark, + onActionDisabledOnBgEmphasized = contentColorTokens.contentOnActionDisabledOnBgEmphasizedDark, + onActionNegative = contentColorTokens.contentOnActionNegativeDark, + onActionPrimaryEnabled = contentColorTokens.contentOnActionPrimaryEnabledDark, + onActionPrimaryEnabledOnBgEmphasized = contentColorTokens.contentOnActionPrimaryEnabledOnBgEmphasizedDark, + onActionPrimaryFocus = contentColorTokens.contentOnActionPrimaryFocusDark, + onActionPrimaryFocusOnBgEmphasized = contentColorTokens.contentOnActionPrimaryFocusOnBgEmphasizedDark, + onActionPrimaryHover = contentColorTokens.contentOnActionPrimaryHoverDark, + onActionPrimaryHoverOnBgEmphasized = contentColorTokens.contentOnActionPrimaryHoverOnBgEmphasizedDark, + onActionPrimaryLoading = contentColorTokens.contentOnActionPrimaryLoadingDark, + onActionPrimaryLoadingOnBgEmphasized = contentColorTokens.contentOnActionPrimaryLoadingOnBgEmphasizedDark, + onActionPrimaryPressed = contentColorTokens.contentOnActionPrimaryPressedDark, + onActionPrimaryPressedOnBgEmphasized = contentColorTokens.contentOnActionPrimaryPressedOnBgEmphasizedDark, + onBrandPrimary = contentColorTokens.contentOnBrandPrimaryDark, + onStatusAccentEmphasized = contentColorTokens.contentOnStatusAccentEmphasizedDark, + onStatusAccentMuted = contentColorTokens.contentOnStatusAccentMutedDark, + onStatusAccentMutedOnBgEmphasized = contentColorTokens.contentOnStatusAccentMutedOnBgEmphasizedDark, + onStatusInfoEmphasized = contentColorTokens.contentOnStatusInfoEmphasizedDark, + onStatusInfoMuted = contentColorTokens.contentOnStatusInfoMutedDark, + onStatusInfoMutedOnBgEmphasized = contentColorTokens.contentOnStatusInfoMutedOnBgEmphasizedDark, + onStatusNegativeEmphasized = contentColorTokens.contentOnStatusNegativeEmphasizedDark, + onStatusNegativeMuted = contentColorTokens.contentOnStatusNegativeMutedDark, + onStatusNegativeMutedOnBgEmphasized = contentColorTokens.contentOnStatusNegativeMutedOnBgEmphasizedDark, + onStatusPositiveEmphasized = contentColorTokens.contentOnStatusPositiveEmphasizedDark, + onStatusPositiveMuted = contentColorTokens.contentOnStatusPositiveMutedDark, + onStatusPositiveMutedOnBgEmphasized = contentColorTokens.contentOnStatusPositiveMutedOnBgEmphasizedDark, + onStatusWarningEmphasized = contentColorTokens.contentOnStatusWarningEmphasizedDark, + onStatusWarningMuted = contentColorTokens.contentOnStatusWarningMutedDark, + onStatusWarningMutedOnBgEmphasized = contentColorTokens.contentOnStatusWarningMutedOnBgEmphasizedDark, + statusInfo = contentColorTokens.contentStatusInfoDark, + statusNegative = contentColorTokens.contentStatusNegativeDark, + statusPositive = contentColorTokens.contentStatusPositiveDark, + statusWarning = contentColorTokens.contentStatusWarningDark, + ), + elevationColors = OudsColorScheme.Elevation( + drag = elevationColorTokens.elevationDragDark, + dragOnBgEmphasized = elevationColorTokens.elevationDragOnBgEmphasizedDark, + dragOnBgSecondary = elevationColorTokens.elevationDragOnBgSecondaryDark, + modal = elevationColorTokens.elevationModalDark, + overlayDefault = elevationColorTokens.elevationOverlayDefaultDark, + overlayDefaultOnBgEmphasized = elevationColorTokens.elevationOverlayDefaultOnBgEmphasizedDark, + overlayDefaultOnBgSecondary = elevationColorTokens.elevationOverlayDefaultOnBgSecondaryDark, + overlayEmphasized = elevationColorTokens.elevationOverlayEmphasizedDark, + overlayEmphasizedOnBgEmphasized = elevationColorTokens.elevationOverlayEmphasizedOnBgEmphasizedDark, + overlayEmphasizedOnBgSecondary = elevationColorTokens.elevationOverlayEmphasizedOnBgSecondaryDark, + raised = elevationColorTokens.elevationRaisedDark, + raisedOnBgEmphasized = elevationColorTokens.elevationRaisedOnBgEmphasizedDark, + raisedOnBgSecondary = elevationColorTokens.elevationRaisedOnBgSecondaryDark, + ), + gradientColors = OudsColorScheme.Gradient( + skeletonMiddle = gradientColorTokens.gradientSkeletonMiddleDark, + skeletonMiddleOnBgEmphasized = gradientColorTokens.gradientSkeletonMiddleOnBgEmphasizedDark, + skeletonStartEnd = gradientColorTokens.gradientSkeletonStartEndDark, + skeletonStartEndOnBgEmphasized = gradientColorTokens.gradientSkeletonStartEndOnBgEmphasizedDark, + ), + decorativeColors = OudsColorScheme.Decorative( + accent1Default = decorativeColorTokens.decorativeAccent1DefaultDark, + accent1Emphasized = decorativeColorTokens.decorativeAccent1EmphasizedDark, + accent1Muted = decorativeColorTokens.decorativeAccent1MutedDark, + accent2Default = decorativeColorTokens.decorativeAccent2DefaultDark, + accent2Emphasized = decorativeColorTokens.decorativeAccent2EmphasizedDark, + accent2Muted = decorativeColorTokens.decorativeAccent2MutedDark, + accent3Default = decorativeColorTokens.decorativeAccent3DefaultDark, + accent3Emphasized = decorativeColorTokens.decorativeAccent3EmphasizedDark, + accent3Muted = decorativeColorTokens.decorativeAccent3MutedDark, + accent4Default = decorativeColorTokens.decorativeAccent4DefaultDark, + accent4Emphasized = decorativeColorTokens.decorativeAccent4EmphasizedDark, + accent4Muted = decorativeColorTokens.decorativeAccent4MutedDark, + accent5Default = decorativeColorTokens.decorativeAccent5DefaultDark, + accent5Emphasized = decorativeColorTokens.decorativeAccent5EmphasizedDark, + accent5Muted = decorativeColorTokens.decorativeAccent5MutedDark, + brandPrimary = decorativeColorTokens.decorativeBrandPrimaryDark, + brandSecondary = decorativeColorTokens.decorativeBrandSecondaryDark, + brandTertiary = decorativeColorTokens.decorativeBrandTertiaryDark, + neutralDefault = decorativeColorTokens.decorativeNeutralDefaultDark, + neutralEmphasized = decorativeColorTokens.decorativeNeutralEmphasizedDark, + neutralMuted = decorativeColorTokens.decorativeNeutralMutedDark, + skinTint100 = decorativeColorTokens.decorativeSkinTint100Dark, + skinTint200 = decorativeColorTokens.decorativeSkinTint200Dark, + skinTint300 = decorativeColorTokens.decorativeSkinTint300Dark, + skinTint400 = decorativeColorTokens.decorativeSkinTint400Dark, + skinTint500 = decorativeColorTokens.decorativeSkinTint500Dark, + skinTint600 = decorativeColorTokens.decorativeSkinTint600Dark, + skinTint700 = decorativeColorTokens.decorativeSkinTint700Dark, + skinTint800 = decorativeColorTokens.decorativeSkinTint800Dark, + skinTint900 = decorativeColorTokens.decorativeSkinTint900Dark, + ), + ) + +@Stable +fun OudsColorScheme.fromToken(token: OudsColorKeyToken.Action): Color { + return when (token) { + OudsColorKeyToken.Action.Disabled -> actionColors.disabled + OudsColorKeyToken.Action.DisabledOnBgEmphasized -> actionColors.disabledOnBgEmphasized + OudsColorKeyToken.Action.NegativeEnabled -> actionColors.negativeEnabled + OudsColorKeyToken.Action.NegativeFocus -> actionColors.negativeFocus + OudsColorKeyToken.Action.NegativeHover -> actionColors.negativeHover + OudsColorKeyToken.Action.NegativeLoading -> actionColors.negativeLoading + OudsColorKeyToken.Action.NegativePressed -> actionColors.negativePressed + OudsColorKeyToken.Action.PrimaryEnabled -> actionColors.primaryEnabled + OudsColorKeyToken.Action.PrimaryEnabledOnBgEmphasized -> actionColors.primaryEnabledOnBgEmphasized + OudsColorKeyToken.Action.PrimaryFocus -> actionColors.primaryFocus + OudsColorKeyToken.Action.PrimaryFocusOnBgEmphasized -> actionColors.primaryFocusOnBgEmphasized + OudsColorKeyToken.Action.PrimaryHover -> actionColors.primaryHover + OudsColorKeyToken.Action.PrimaryHoverOnBgEmphasized -> actionColors.primaryHoverOnBgEmphasized + OudsColorKeyToken.Action.PrimaryLoading -> actionColors.primaryLoading + OudsColorKeyToken.Action.PrimaryLoadingOnBgEmphasized -> actionColors.primaryLoadingOnBgEmphasized + OudsColorKeyToken.Action.PrimaryPressed -> actionColors.primaryPressed + OudsColorKeyToken.Action.PrimaryPressedOnBgEmphasized -> actionColors.primaryPressedOnBgEmphasized + OudsColorKeyToken.Action.SecondaryEnabled -> actionColors.secondaryEnabled + OudsColorKeyToken.Action.SecondaryEnabledOnBgEmphasized -> actionColors.secondaryEnabledOnBgEmphasized + OudsColorKeyToken.Action.SecondaryFocus -> actionColors.secondaryFocus + OudsColorKeyToken.Action.SecondaryFocusOnBgEmphasized -> actionColors.secondaryFocusOnBgEmphasized + OudsColorKeyToken.Action.SecondaryHover -> actionColors.secondaryHover + OudsColorKeyToken.Action.SecondaryHoverOnBgEmphasized -> actionColors.secondaryHoverOnBgEmphasized + OudsColorKeyToken.Action.SecondaryLoading -> actionColors.secondaryLoading + OudsColorKeyToken.Action.SecondaryLoadingOnBgEmphasized -> actionColors.secondaryLoadingOnBgEmphasized + OudsColorKeyToken.Action.SecondaryPressed -> actionColors.secondaryPressed + OudsColorKeyToken.Action.SecondaryPressedOnBgEmphasized -> actionColors.secondaryPressedOnBgEmphasized + OudsColorKeyToken.Action.Selected -> actionColors.selected + OudsColorKeyToken.Action.SelectedOnBgEmphasized -> actionColors.selectedOnBgEmphasized + OudsColorKeyToken.Action.Visited -> actionColors.visited + OudsColorKeyToken.Action.VisitedOnBgEmphasized -> actionColors.visitedOnBgEmphasized + } +} + +@Stable +fun OudsColorScheme.fromToken(token: OudsColorKeyToken.Always): Color { + return when (token) { + OudsColorKeyToken.Always.Accent -> alwaysColors.accent + OudsColorKeyToken.Always.Black -> alwaysColors.black + OudsColorKeyToken.Always.Info -> alwaysColors.info + OudsColorKeyToken.Always.Negative -> alwaysColors.negative + OudsColorKeyToken.Always.OnAccent -> alwaysColors.onAccent + OudsColorKeyToken.Always.OnBlack -> alwaysColors.onBlack + OudsColorKeyToken.Always.OnInfo -> alwaysColors.onInfo + OudsColorKeyToken.Always.OnNegative -> alwaysColors.onNegative + OudsColorKeyToken.Always.OnPositive -> alwaysColors.onPositive + OudsColorKeyToken.Always.OnWarning -> alwaysColors.onWarning + OudsColorKeyToken.Always.OnWhite -> alwaysColors.onWhite + OudsColorKeyToken.Always.Positive -> alwaysColors.positive + OudsColorKeyToken.Always.Warning -> alwaysColors.warning + OudsColorKeyToken.Always.White -> alwaysColors.white + } +} + +@Stable +fun OudsColorScheme.fromToken(token: OudsColorKeyToken.Background): Color { + return when (token) { + OudsColorKeyToken.Background.BrandPrimary -> backgroundColors.brandPrimary + OudsColorKeyToken.Background.Emphasized -> backgroundColors.emphasized + OudsColorKeyToken.Background.Primary -> backgroundColors.primary + OudsColorKeyToken.Background.Secondary -> backgroundColors.secondary + OudsColorKeyToken.Background.StatusAccentEmphasized -> backgroundColors.statusAccentEmphasized + OudsColorKeyToken.Background.StatusAccentMuted -> backgroundColors.statusAccentMuted + OudsColorKeyToken.Background.StatusAccentMutedOnBgEmphasized -> backgroundColors.statusAccentMutedOnBgEmphasized + OudsColorKeyToken.Background.StatusInfoEmphasized -> backgroundColors.statusInfoEmphasized + OudsColorKeyToken.Background.StatusInfoMuted -> backgroundColors.statusInfoMuted + OudsColorKeyToken.Background.StatusInfoMutedOnBgEmphasized -> backgroundColors.statusInfoMutedOnBgEmphasized + OudsColorKeyToken.Background.StatusNegativeEmphasized -> backgroundColors.statusNegativeEmphasized + OudsColorKeyToken.Background.StatusNegativeMuted -> backgroundColors.statusNegativeMuted + OudsColorKeyToken.Background.StatusNegativeMutedOnBgEmphasized -> backgroundColors.statusNegativeMutedOnBgEmphasized + OudsColorKeyToken.Background.StatusNeutral -> backgroundColors.statusNeutral + OudsColorKeyToken.Background.StatusNeutralOnBgEmphasized -> backgroundColors.statusNeutralOnBgEmphasized + OudsColorKeyToken.Background.StatusPositiveEmphasized -> backgroundColors.statusPositiveEmphasized + OudsColorKeyToken.Background.StatusPositiveMuted -> backgroundColors.statusPositiveMuted + OudsColorKeyToken.Background.StatusPositiveMutedOnBgEmphasized -> backgroundColors.statusPositiveMutedOnBgEmphasized + OudsColorKeyToken.Background.StatusWarningEmphasized -> backgroundColors.statusWarningEmphasized + OudsColorKeyToken.Background.StatusWarningMuted -> backgroundColors.statusWarningMuted + OudsColorKeyToken.Background.StatusWarningMutedOnBgEmphasized -> backgroundColors.statusWarningMutedOnBgEmphasized + OudsColorKeyToken.Background.Tertiary -> backgroundColors.tertiary + } +} + +@Stable +fun OudsColorScheme.fromToken(token: OudsColorKeyToken.Border): Color { + return when (token) { + OudsColorKeyToken.Border.BrandPrimary -> borderColors.brandPrimary + OudsColorKeyToken.Border.BrandPrimaryOnBgEmphasized -> borderColors.brandPrimaryOnBgEmphasized + OudsColorKeyToken.Border.Default -> borderColors.default + OudsColorKeyToken.Border.DefaultOnBgEmphasized -> borderColors.defaultOnBgEmphasized + OudsColorKeyToken.Border.Emphasized -> borderColors.emphasized + OudsColorKeyToken.Border.EmphasizedOnBgEmphasized -> borderColors.emphasizedOnBgEmphasized + OudsColorKeyToken.Border.Focus -> borderColors.focus + OudsColorKeyToken.Border.FocusInset -> borderColors.focusInset + OudsColorKeyToken.Border.FocusInsetOnBgEmphasized -> borderColors.focusInsetOnBgEmphasized + OudsColorKeyToken.Border.FocusOnBgEmphasized -> borderColors.focusOnBgEmphasized + OudsColorKeyToken.Border.OnBrandPrimary -> borderColors.onBrandPrimary + } +} + +@Stable +fun OudsColorScheme.fromToken(token: OudsColorKeyToken.Brand): Color { + return when (token) { + OudsColorKeyToken.Brand.AccentDefault -> brandColors.accentDefault + OudsColorKeyToken.Brand.AccentHigh -> brandColors.accentHigh + OudsColorKeyToken.Brand.AccentHighest -> brandColors.accentHighest + OudsColorKeyToken.Brand.AccentLowest -> brandColors.accentLowest + OudsColorKeyToken.Brand.InfoDefault -> brandColors.infoDefault + OudsColorKeyToken.Brand.InfoHighest -> brandColors.infoHighest + OudsColorKeyToken.Brand.InfoLowest -> brandColors.infoLowest + OudsColorKeyToken.Brand.NegativeDefault -> brandColors.negativeDefault + OudsColorKeyToken.Brand.NegativeHigh -> brandColors.negativeHigh + OudsColorKeyToken.Brand.NegativeHigher -> brandColors.negativeHigher + OudsColorKeyToken.Brand.NegativeHighest -> brandColors.negativeHighest + OudsColorKeyToken.Brand.NegativeLowest -> brandColors.negativeLowest + OudsColorKeyToken.Brand.NeutralEmphasizedBlack -> brandColors.neutralEmphasizedBlack + OudsColorKeyToken.Brand.NeutralEmphasizedHigh -> brandColors.neutralEmphasizedHigh + OudsColorKeyToken.Brand.NeutralEmphasizedHigher -> brandColors.neutralEmphasizedHigher + OudsColorKeyToken.Brand.NeutralEmphasizedHighest -> brandColors.neutralEmphasizedHighest + OudsColorKeyToken.Brand.NeutralEmphasizedLow -> brandColors.neutralEmphasizedLow + OudsColorKeyToken.Brand.NeutralEmphasizedLower -> brandColors.neutralEmphasizedLower + OudsColorKeyToken.Brand.NeutralEmphasizedLowest -> brandColors.neutralEmphasizedLowest + OudsColorKeyToken.Brand.NeutralEmphasizedMedium -> brandColors.neutralEmphasizedMedium + OudsColorKeyToken.Brand.NeutralMutedHighest -> brandColors.neutralMutedHighest + OudsColorKeyToken.Brand.NeutralMutedLow -> brandColors.neutralMutedLow + OudsColorKeyToken.Brand.NeutralMutedLower -> brandColors.neutralMutedLower + OudsColorKeyToken.Brand.NeutralMutedLowest -> brandColors.neutralMutedLowest + OudsColorKeyToken.Brand.NeutralMutedMedium -> brandColors.neutralMutedMedium + OudsColorKeyToken.Brand.NeutralMutedWhite -> brandColors.neutralMutedWhite + OudsColorKeyToken.Brand.PositiveDefault -> brandColors.positiveDefault + OudsColorKeyToken.Brand.PositiveHighest -> brandColors.positiveHighest + OudsColorKeyToken.Brand.PositiveLowest -> brandColors.positiveLowest + OudsColorKeyToken.Brand.PrimaryDefault -> brandColors.primaryDefault + OudsColorKeyToken.Brand.PrimaryLow -> brandColors.primaryLow + OudsColorKeyToken.Brand.WarningDefault -> brandColors.warningDefault + OudsColorKeyToken.Brand.WarningHigh -> brandColors.warningHigh + OudsColorKeyToken.Brand.WarningHighest -> brandColors.warningHighest + OudsColorKeyToken.Brand.WarningLowest -> brandColors.warningLowest + } +} + +@Stable +fun OudsColorScheme.fromToken(token: OudsColorKeyToken.Content): Color { + return when (token) { + OudsColorKeyToken.Content.BrandPrimary -> contentColors.brandPrimary + OudsColorKeyToken.Content.BrandPrimaryOnBgEmphasized -> contentColors.brandPrimaryOnBgEmphasized + OudsColorKeyToken.Content.Default -> contentColors.default + OudsColorKeyToken.Content.DefaultOnBgEmphasized -> contentColors.defaultOnBgEmphasized + OudsColorKeyToken.Content.Disabled -> contentColors.disabled + OudsColorKeyToken.Content.DisabledOnBgEmphasized -> contentColors.disabledOnBgEmphasized + OudsColorKeyToken.Content.Muted -> contentColors.muted + OudsColorKeyToken.Content.MutedOnBgEmphasized -> contentColors.mutedOnBgEmphasized + OudsColorKeyToken.Content.OnActionDisabled -> contentColors.onActionDisabled + OudsColorKeyToken.Content.OnActionDisabledOnBgEmphasized -> contentColors.onActionDisabledOnBgEmphasized + OudsColorKeyToken.Content.OnActionNegative -> contentColors.onActionNegative + OudsColorKeyToken.Content.OnActionPrimaryEnabled -> contentColors.onActionPrimaryEnabled + OudsColorKeyToken.Content.OnActionPrimaryEnabledOnBgEmphasized -> contentColors.onActionPrimaryEnabledOnBgEmphasized + OudsColorKeyToken.Content.OnActionPrimaryFocus -> contentColors.onActionPrimaryFocus + OudsColorKeyToken.Content.OnActionPrimaryFocusOnBgEmphasized -> contentColors.onActionPrimaryFocusOnBgEmphasized + OudsColorKeyToken.Content.OnActionPrimaryHover -> contentColors.onActionPrimaryHover + OudsColorKeyToken.Content.OnActionPrimaryHoverOnBgEmphasized -> contentColors.onActionPrimaryHoverOnBgEmphasized + OudsColorKeyToken.Content.OnActionPrimaryLoading -> contentColors.onActionPrimaryLoading + OudsColorKeyToken.Content.OnActionPrimaryLoadingOnBgEmphasized -> contentColors.onActionPrimaryLoadingOnBgEmphasized + OudsColorKeyToken.Content.OnActionPrimaryPressed -> contentColors.onActionPrimaryPressed + OudsColorKeyToken.Content.OnActionPrimaryPressedOnBgEmphasized -> contentColors.onActionPrimaryPressedOnBgEmphasized + OudsColorKeyToken.Content.OnBrandPrimary -> contentColors.onBrandPrimary + OudsColorKeyToken.Content.OnStatusAccentEmphasized -> contentColors.onStatusAccentEmphasized + OudsColorKeyToken.Content.OnStatusAccentMuted -> contentColors.onStatusAccentMuted + OudsColorKeyToken.Content.OnStatusAccentMutedOnBgEmphasized -> contentColors.onStatusAccentMutedOnBgEmphasized + OudsColorKeyToken.Content.OnStatusInfoEmphasized -> contentColors.onStatusInfoEmphasized + OudsColorKeyToken.Content.OnStatusInfoMuted -> contentColors.onStatusInfoMuted + OudsColorKeyToken.Content.OnStatusInfoMutedOnBgEmphasized -> contentColors.onStatusInfoMutedOnBgEmphasized + OudsColorKeyToken.Content.OnStatusNegativeEmphasized -> contentColors.onStatusNegativeEmphasized + OudsColorKeyToken.Content.OnStatusNegativeMuted -> contentColors.onStatusNegativeMuted + OudsColorKeyToken.Content.OnStatusNegativeMutedOnBgEmphasized -> contentColors.onStatusNegativeMutedOnBgEmphasized + OudsColorKeyToken.Content.OnStatusPositiveEmphasized -> contentColors.onStatusPositiveEmphasized + OudsColorKeyToken.Content.OnStatusPositiveMuted -> contentColors.onStatusPositiveMuted + OudsColorKeyToken.Content.OnStatusPositiveMutedOnBgEmphasized -> contentColors.onStatusPositiveMutedOnBgEmphasized + OudsColorKeyToken.Content.OnStatusWarningEmphasized -> contentColors.onStatusWarningEmphasized + OudsColorKeyToken.Content.OnStatusWarningMuted -> contentColors.onStatusWarningMuted + OudsColorKeyToken.Content.OnStatusWarningMutedOnBgEmphasized -> contentColors.onStatusWarningMutedOnBgEmphasized + OudsColorKeyToken.Content.StatusInfo -> contentColors.statusInfo + OudsColorKeyToken.Content.StatusNegative -> contentColors.statusNegative + OudsColorKeyToken.Content.StatusPositive -> contentColors.statusPositive + OudsColorKeyToken.Content.StatusWarning -> contentColors.statusWarning + } +} + +@Stable +fun OudsColorScheme.fromToken(token: OudsColorKeyToken.Elevation): Color { + return when (token) { + OudsColorKeyToken.Elevation.Drag -> elevationColors.drag + OudsColorKeyToken.Elevation.DragOnBgEmphasized -> elevationColors.dragOnBgEmphasized + OudsColorKeyToken.Elevation.DragOnBgSecondary -> elevationColors.dragOnBgSecondary + OudsColorKeyToken.Elevation.Modal -> elevationColors.modal + OudsColorKeyToken.Elevation.OverlayDefault -> elevationColors.overlayDefault + OudsColorKeyToken.Elevation.OverlayDefaultOnBgEmphasized -> elevationColors.overlayDefaultOnBgEmphasized + OudsColorKeyToken.Elevation.OverlayDefaultOnBgSecondary -> elevationColors.overlayDefaultOnBgSecondary + OudsColorKeyToken.Elevation.OverlayEmphasized -> elevationColors.overlayEmphasized + OudsColorKeyToken.Elevation.OverlayEmphasizedOnBgEmphasized -> elevationColors.overlayEmphasizedOnBgEmphasized + OudsColorKeyToken.Elevation.OverlayEmphasizedOnBgSecondary -> elevationColors.overlayEmphasizedOnBgSecondary + OudsColorKeyToken.Elevation.Raised -> elevationColors.raised + OudsColorKeyToken.Elevation.RaisedOnBgEmphasized -> elevationColors.raisedOnBgEmphasized + OudsColorKeyToken.Elevation.RaisedOnBgSecondary -> elevationColors.raisedOnBgSecondary + } +} + +@Stable +fun OudsColorScheme.fromToken(token: OudsColorKeyToken.Gradient): Color { + return when (token) { + OudsColorKeyToken.Gradient.SkeletonMiddle -> gradientColors.skeletonMiddle + OudsColorKeyToken.Gradient.SkeletonMiddleOnBgEmphasized -> gradientColors.skeletonMiddleOnBgEmphasized + OudsColorKeyToken.Gradient.SkeletonStartEnd -> gradientColors.skeletonStartEnd + OudsColorKeyToken.Gradient.SkeletonStartEndOnBgEmphasized -> gradientColors.skeletonStartEndOnBgEmphasized + } +} + +@Stable +fun OudsColorScheme.fromToken(token: OudsColorKeyToken.Decorative): Color { + return when (token) { + OudsColorKeyToken.Decorative.Accent1Default -> decorativeColors.accent1Default + OudsColorKeyToken.Decorative.Accent1Emphasized -> decorativeColors.accent1Emphasized + OudsColorKeyToken.Decorative.Accent1Muted -> decorativeColors.accent1Muted + OudsColorKeyToken.Decorative.Accent2Default -> decorativeColors.accent2Default + OudsColorKeyToken.Decorative.Accent2Emphasized -> decorativeColors.accent2Emphasized + OudsColorKeyToken.Decorative.Accent2Muted -> decorativeColors.accent2Muted + OudsColorKeyToken.Decorative.Accent3Default -> decorativeColors.accent3Default + OudsColorKeyToken.Decorative.Accent3Emphasized -> decorativeColors.accent3Emphasized + OudsColorKeyToken.Decorative.Accent3Muted -> decorativeColors.accent3Muted + OudsColorKeyToken.Decorative.Accent4Default -> decorativeColors.accent4Default + OudsColorKeyToken.Decorative.Accent4Emphasized -> decorativeColors.accent4Emphasized + OudsColorKeyToken.Decorative.Accent4Muted -> decorativeColors.accent4Muted + OudsColorKeyToken.Decorative.Accent5Default -> decorativeColors.accent5Default + OudsColorKeyToken.Decorative.Accent5Emphasized -> decorativeColors.accent5Emphasized + OudsColorKeyToken.Decorative.Accent5Muted -> decorativeColors.accent5Muted + OudsColorKeyToken.Decorative.BrandPrimary -> decorativeColors.brandPrimary + OudsColorKeyToken.Decorative.BrandSecondary -> decorativeColors.brandSecondary + OudsColorKeyToken.Decorative.BrandTertiary -> decorativeColors.brandTertiary + OudsColorKeyToken.Decorative.NeutralDefault -> decorativeColors.neutralDefault + OudsColorKeyToken.Decorative.NeutralEmphasized -> decorativeColors.neutralEmphasized + OudsColorKeyToken.Decorative.NeutralMuted -> decorativeColors.neutralMuted + OudsColorKeyToken.Decorative.SkinTint100 -> decorativeColors.skinTint100 + OudsColorKeyToken.Decorative.SkinTint200 -> decorativeColors.skinTint200 + OudsColorKeyToken.Decorative.SkinTint300 -> decorativeColors.skinTint300 + OudsColorKeyToken.Decorative.SkinTint400 -> decorativeColors.skinTint400 + OudsColorKeyToken.Decorative.SkinTint500 -> decorativeColors.skinTint500 + OudsColorKeyToken.Decorative.SkinTint600 -> decorativeColors.skinTint600 + OudsColorKeyToken.Decorative.SkinTint700 -> decorativeColors.skinTint700 + OudsColorKeyToken.Decorative.SkinTint800 -> decorativeColors.skinTint800 + OudsColorKeyToken.Decorative.SkinTint900 -> decorativeColors.skinTint900 + } +} + +@Stable +fun OudsColorScheme.fromToken(token: OudsColorKeyToken.Global): Color { + return when (token) { + OudsColorKeyToken.Global.TransparentDefault -> globalColors.transparentDefault + } +} + +val OudsColorSemanticTokens.materialLightColorScheme: ColorScheme + get() = lightColorScheme( + primary = backgroundColorTokens.bgBrandPrimaryLight, + onPrimary = contentColorTokens.contentDefaultLight, + primaryContainer = backgroundColorTokens.bgPrimaryLight, + onPrimaryContainer = contentColorTokens.contentDefaultLight, + inversePrimary = backgroundColorTokens.bgBrandPrimaryDark, + secondary = backgroundColorTokens.bgSecondaryLight, + onSecondary = elevationColorTokens.elevationDragOnBgSecondaryLight, + secondaryContainer = backgroundColorTokens.bgEmphasizedLight, + onSecondaryContainer = contentColorTokens.contentDefaultDark, + tertiary = backgroundColorTokens.bgTertiaryLight, + onTertiary = contentColorTokens.contentDefaultDark, + tertiaryContainer = decorativeColorTokens.decorativeBrandTertiaryLight, + onTertiaryContainer = contentColorTokens.contentDefaultOnBgEmphasizedLight, + background = backgroundColorTokens.bgPrimaryLight, + onBackground = contentColorTokens.contentDefaultLight, + surface = elevationColorTokens.elevationRaisedLight, + onSurface = contentColorTokens.contentDefaultLight, + surfaceVariant = elevationColorTokens.elevationModalLight, + onSurfaceVariant = contentColorTokens.contentDefaultLight, + surfaceTint = elevationColorTokens.elevationModalLight, + inverseSurface = elevationColorTokens.elevationRaisedDark, + inverseOnSurface = contentColorTokens.contentDefaultDark, + error = backgroundColorTokens.bgStatusNegativeMutedLight, + onError = contentColorTokens.contentOnActionNegativeLight, + errorContainer = backgroundColorTokens.bgStatusNegativeEmphasizedLight, + onErrorContainer = contentColorTokens.contentOnActionDisabledOnBgEmphasizedLight, + outline = borderColorTokens.borderBrandPrimaryLight, + outlineVariant = borderColorTokens.borderBrandPrimaryLight, + scrim = contentColorTokens.contentBrandPrimaryLight, + ) + +val OudsColorSemanticTokens.materialDarkColorScheme: ColorScheme + get() = darkColorScheme( + primary = backgroundColorTokens.bgBrandPrimaryDark, + onPrimary = contentColorTokens.contentDefaultDark, + primaryContainer = backgroundColorTokens.bgPrimaryDark, + onPrimaryContainer = contentColorTokens.contentDefaultDark, + inversePrimary = backgroundColorTokens.bgBrandPrimaryLight, + secondary = backgroundColorTokens.bgSecondaryDark, + onSecondary = elevationColorTokens.elevationDragOnBgSecondaryDark, + secondaryContainer = backgroundColorTokens.bgEmphasizedDark, + onSecondaryContainer = contentColorTokens.contentDefaultOnBgEmphasizedDark, + tertiary = backgroundColorTokens.bgTertiaryDark, + onTertiary = contentColorTokens.contentDefaultDark, + tertiaryContainer = decorativeColorTokens.decorativeBrandTertiaryDark, + onTertiaryContainer = contentColorTokens.contentDefaultOnBgEmphasizedDark, + background = backgroundColorTokens.bgPrimaryDark, + onBackground = contentColorTokens.contentDefaultDark, + surface = elevationColorTokens.elevationRaisedDark, + onSurface = contentColorTokens.contentDefaultDark, + surfaceVariant = elevationColorTokens.elevationModalDark, + onSurfaceVariant = contentColorTokens.contentDefaultDark, + surfaceTint = elevationColorTokens.elevationModalDark, + inverseSurface = elevationColorTokens.elevationRaisedLight, + inverseOnSurface = contentColorTokens.contentDefaultLight, + error = backgroundColorTokens.bgStatusNegativeMutedDark, + onError = contentColorTokens.contentOnActionNegativeDark, + errorContainer = backgroundColorTokens.bgStatusNegativeEmphasizedDark, + onErrorContainer = contentColorTokens.contentOnStatusNegativeEmphasizedDark, + outline = borderColorTokens.borderBrandPrimaryDark, + outlineVariant = borderColorTokens.borderBrandPrimaryDark, + scrim = contentColorTokens.contentBrandPrimaryDark, + ) + +/** + * Converts an OUDS action color token to the local color value provided by the theme. + */ +val OudsColorKeyToken.Action.value: Color + @ReadOnlyComposable + @Composable + get() = OudsTheme.colorScheme.fromToken(this) + +/** + * Converts an OUDS always color token to the local color value provided by the theme. + */ +val OudsColorKeyToken.Always.value: Color + @ReadOnlyComposable + @Composable + get() = OudsTheme.colorScheme.fromToken(this) + +/** + * Converts an OUDS background color token to the local color value provided by the theme. + */ +val OudsColorKeyToken.Background.value: Color + @ReadOnlyComposable + @Composable + get() = OudsTheme.colorScheme.fromToken(this) + +/** + * Converts an OUDS border color token to the local color value provided by the theme. + */ +val OudsColorKeyToken.Border.value: Color + @ReadOnlyComposable + @Composable + get() = OudsTheme.colorScheme.fromToken(this) + +/** + * Converts an OUDS brand color token to the local color value provided by the theme. + */ +val OudsColorKeyToken.Brand.value: Color + @ReadOnlyComposable + @Composable + get() = OudsTheme.colorScheme.fromToken(this) + +/** + * Converts an OUDS content color token to the local color value provided by the theme. + */ +val OudsColorKeyToken.Content.value: Color + @ReadOnlyComposable + @Composable + get() = OudsTheme.colorScheme.fromToken(this) + +/** + * Converts an OUDS elevation color token to the local color value provided by the theme. + */ +val OudsColorKeyToken.Elevation.value: Color + @ReadOnlyComposable + @Composable + get() = OudsTheme.colorScheme.fromToken(this) + +/** + * Converts an OUDS gradient color token to the local color value provided by the theme. + */ +val OudsColorKeyToken.Gradient.value: Color + @ReadOnlyComposable + @Composable + get() = OudsTheme.colorScheme.fromToken(this) + +/** + * Converts an OUDS decorative color token to the local color value provided by the theme. + */ +val OudsColorKeyToken.Decorative.value: Color + @ReadOnlyComposable + @Composable + get() = OudsTheme.colorScheme.fromToken(this) \ No newline at end of file diff --git a/core/src/main/java/com/orange/ouds/core/theme/OudsColors.kt b/core/src/main/java/com/orange/ouds/core/theme/OudsColors.kt deleted file mode 100644 index 5199430d..00000000 --- a/core/src/main/java/com/orange/ouds/core/theme/OudsColors.kt +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Software Name: OUDS Android - * SPDX-FileCopyrightText: Copyright (c) Orange SA - * SPDX-License-Identifier: MIT - * - * This software is distributed under the MIT license, - * the text of which is available at https://opensource.org/license/MIT/ - * or see the "LICENSE" file for more details. - * - * Software description: Android library of reusable graphical components - */ - -package com.orange.ouds.core.theme - -import androidx.compose.runtime.Composable -import androidx.compose.runtime.ReadOnlyComposable -import androidx.compose.ui.graphics.Color -import com.orange.ouds.theme.fromToken -import com.orange.ouds.theme.tokens.semantic.OudsColorKeyToken - -/** - * Converts an OUDS color token to the local color value provided by the theme. - */ -val OudsColorKeyToken.value: Color - @ReadOnlyComposable - @Composable - get() = OudsTheme.colorScheme.fromToken(this) diff --git a/core/src/main/java/com/orange/ouds/core/theme/OudsSizes.kt b/core/src/main/java/com/orange/ouds/core/theme/OudsSizes.kt index b05b004c..40e7a888 100644 --- a/core/src/main/java/com/orange/ouds/core/theme/OudsSizes.kt +++ b/core/src/main/java/com/orange/ouds/core/theme/OudsSizes.kt @@ -20,9 +20,7 @@ import androidx.compose.ui.unit.dp import com.orange.ouds.theme.OudsAdaptiveTokenValue import com.orange.ouds.theme.OudsAdaptiveWindowType import com.orange.ouds.theme.currentWindowWidth -import com.orange.ouds.theme.tokens.OudsSizeIconDecorativeKeyToken -import com.orange.ouds.theme.tokens.OudsSizeIconWithTextKeyToken -import com.orange.ouds.theme.tokens.OudsSizeMaxWidthTypeKeyToken +import com.orange.ouds.theme.tokens.OudsSizeKeyToken import com.orange.ouds.theme.tokens.semantic.OudsSizeSemanticTokens data class OudsSizes( @@ -260,56 +258,56 @@ fun OudsSizeSemanticTokens.getSizes() = OudsSizes( ) @Stable -fun OudsSizes.fromToken(token: OudsSizeIconDecorativeKeyToken): Dp { +fun OudsSizes.fromToken(token: OudsSizeKeyToken.IconDecorative): Dp { return when (token) { - OudsSizeIconDecorativeKeyToken.Shortest -> iconDecorativeShortest - OudsSizeIconDecorativeKeyToken.Shorter -> iconDecorativeShorter - OudsSizeIconDecorativeKeyToken.Short -> iconDecorativeShort - OudsSizeIconDecorativeKeyToken.Medium -> iconDecorativeMedium - OudsSizeIconDecorativeKeyToken.Tall -> iconDecorativeTall - OudsSizeIconDecorativeKeyToken.Taller -> iconDecorativeTaller - OudsSizeIconDecorativeKeyToken.Tallest -> iconDecorativeTallest + OudsSizeKeyToken.IconDecorative.Shortest -> iconDecorativeShortest + OudsSizeKeyToken.IconDecorative.Shorter -> iconDecorativeShorter + OudsSizeKeyToken.IconDecorative.Short -> iconDecorativeShort + OudsSizeKeyToken.IconDecorative.Medium -> iconDecorativeMedium + OudsSizeKeyToken.IconDecorative.Tall -> iconDecorativeTall + OudsSizeKeyToken.IconDecorative.Taller -> iconDecorativeTaller + OudsSizeKeyToken.IconDecorative.Tallest -> iconDecorativeTallest } } @Stable -fun OudsSizes.fromToken(token: OudsSizeIconWithTextKeyToken, adaptiveWindowType: OudsAdaptiveWindowType): Dp { +fun OudsSizes.fromToken(token: OudsSizeKeyToken.IconWithText, adaptiveWindowType: OudsAdaptiveWindowType): Dp { val dimensionSizeIconWithTextValue: Any = when (token) { - OudsSizeIconWithTextKeyToken.HeadingSmallSizeShort -> iconWithHeadingSmallSizeShort - OudsSizeIconWithTextKeyToken.HeadingSmallSizeMedium -> iconWithHeadingSmallSizeMedium - OudsSizeIconWithTextKeyToken.HeadingSmallSizeTall -> iconWithHeadingSmallSizeTall - OudsSizeIconWithTextKeyToken.HeadingMediumSizeShort -> iconWithHeadingMediumSizeShort - OudsSizeIconWithTextKeyToken.HeadingMediumSizeMedium -> iconWithHeadingMediumSizeMedium - OudsSizeIconWithTextKeyToken.HeadingMediumSizeTall -> iconWithHeadingMediumSizeTall - OudsSizeIconWithTextKeyToken.HeadingLargeSizeShort -> iconWithHeadingLargeSizeShort - OudsSizeIconWithTextKeyToken.HeadingLargeSizeMedium -> iconWithBodyLargeSizeMedium - OudsSizeIconWithTextKeyToken.HeadingLargeSizeTall -> iconWithHeadingLargeSizeTall - OudsSizeIconWithTextKeyToken.HeadingExtraLargeSizeShort -> iconWithHeadingExtraLargeSizeShort - OudsSizeIconWithTextKeyToken.HeadingExtraLargeSizeMedium -> iconWithHeadingExtraLargeSizeMedium - OudsSizeIconWithTextKeyToken.HeadingExtraLargeSizeTall -> iconWithHeadingExtraLargeSizeTall - OudsSizeIconWithTextKeyToken.LabelLargeSizeShorter -> iconWithLabelLargeSizeShorter - OudsSizeIconWithTextKeyToken.LabelLargeSizeShort -> iconWithLabelLargeSizeShort - OudsSizeIconWithTextKeyToken.LabelLargeSizeMedium -> iconWithLabelLargeSizeMedium - OudsSizeIconWithTextKeyToken.LabelLargeSizeTall -> iconWithLabelLargeSizeTall - OudsSizeIconWithTextKeyToken.LabelLargeSizeTaller -> iconWithLabelLargeSizeTaller - OudsSizeIconWithTextKeyToken.LabelMediumSizeShort -> iconWithLabelMediumSizeShort - OudsSizeIconWithTextKeyToken.LabelMediumSizeMedium -> iconWithLabelMediumSizeMedium - OudsSizeIconWithTextKeyToken.LabelMediumSizeTall -> iconWithLabelMediumSizeTall - OudsSizeIconWithTextKeyToken.LabelSmallSizeShort -> iconWithLabelSmallSizeShort - OudsSizeIconWithTextKeyToken.LabelSmallSizeMedium -> iconWithLabelSmallSizeMedium - OudsSizeIconWithTextKeyToken.LabelSmallSizeTall -> iconWithLabelSmallSizeTall - OudsSizeIconWithTextKeyToken.LabelExtraLargeSizeShort -> iconWithLabelExtraLargeSizeShort - OudsSizeIconWithTextKeyToken.LabelExtraLargeSizeMedium -> iconWithLabelExtraLargeSizeMedium - OudsSizeIconWithTextKeyToken.LabelExtraLargeSizeTall -> iconWithLabelExtraLargeSizeTall - OudsSizeIconWithTextKeyToken.BodySmallSizeShort -> iconWithBodySmallSizeShort - OudsSizeIconWithTextKeyToken.BodySmallSizeMedium -> iconWithBodySmallSizeMedium - OudsSizeIconWithTextKeyToken.BodySmallSizeTall -> iconWithBodySmallSizeTall - OudsSizeIconWithTextKeyToken.BodyMediumSizeShort -> iconWithBodyMediumSizeShort - OudsSizeIconWithTextKeyToken.BodyMediumSizeMedium -> iconWithBodyMediumSizeMedium - OudsSizeIconWithTextKeyToken.BodyMediumSizeTall -> iconWithBodyMediumSizeTall - OudsSizeIconWithTextKeyToken.BodyLargeSizeShort -> iconWithBodyLargeSizeShort - OudsSizeIconWithTextKeyToken.BodyLargeSizeMedium -> iconWithBodyLargeSizeMedium - OudsSizeIconWithTextKeyToken.BodyLargeSizeTall -> iconWithBodyLargeSizeTall + OudsSizeKeyToken.IconWithText.HeadingSmallSizeShort -> iconWithHeadingSmallSizeShort + OudsSizeKeyToken.IconWithText.HeadingSmallSizeMedium -> iconWithHeadingSmallSizeMedium + OudsSizeKeyToken.IconWithText.HeadingSmallSizeTall -> iconWithHeadingSmallSizeTall + OudsSizeKeyToken.IconWithText.HeadingMediumSizeShort -> iconWithHeadingMediumSizeShort + OudsSizeKeyToken.IconWithText.HeadingMediumSizeMedium -> iconWithHeadingMediumSizeMedium + OudsSizeKeyToken.IconWithText.HeadingMediumSizeTall -> iconWithHeadingMediumSizeTall + OudsSizeKeyToken.IconWithText.HeadingLargeSizeShort -> iconWithHeadingLargeSizeShort + OudsSizeKeyToken.IconWithText.HeadingLargeSizeMedium -> iconWithBodyLargeSizeMedium + OudsSizeKeyToken.IconWithText.HeadingLargeSizeTall -> iconWithHeadingLargeSizeTall + OudsSizeKeyToken.IconWithText.HeadingExtraLargeSizeShort -> iconWithHeadingExtraLargeSizeShort + OudsSizeKeyToken.IconWithText.HeadingExtraLargeSizeMedium -> iconWithHeadingExtraLargeSizeMedium + OudsSizeKeyToken.IconWithText.HeadingExtraLargeSizeTall -> iconWithHeadingExtraLargeSizeTall + OudsSizeKeyToken.IconWithText.LabelLargeSizeShorter -> iconWithLabelLargeSizeShorter + OudsSizeKeyToken.IconWithText.LabelLargeSizeShort -> iconWithLabelLargeSizeShort + OudsSizeKeyToken.IconWithText.LabelLargeSizeMedium -> iconWithLabelLargeSizeMedium + OudsSizeKeyToken.IconWithText.LabelLargeSizeTall -> iconWithLabelLargeSizeTall + OudsSizeKeyToken.IconWithText.LabelLargeSizeTaller -> iconWithLabelLargeSizeTaller + OudsSizeKeyToken.IconWithText.LabelMediumSizeShort -> iconWithLabelMediumSizeShort + OudsSizeKeyToken.IconWithText.LabelMediumSizeMedium -> iconWithLabelMediumSizeMedium + OudsSizeKeyToken.IconWithText.LabelMediumSizeTall -> iconWithLabelMediumSizeTall + OudsSizeKeyToken.IconWithText.LabelSmallSizeShort -> iconWithLabelSmallSizeShort + OudsSizeKeyToken.IconWithText.LabelSmallSizeMedium -> iconWithLabelSmallSizeMedium + OudsSizeKeyToken.IconWithText.LabelSmallSizeTall -> iconWithLabelSmallSizeTall + OudsSizeKeyToken.IconWithText.LabelExtraLargeSizeShort -> iconWithLabelExtraLargeSizeShort + OudsSizeKeyToken.IconWithText.LabelExtraLargeSizeMedium -> iconWithLabelExtraLargeSizeMedium + OudsSizeKeyToken.IconWithText.LabelExtraLargeSizeTall -> iconWithLabelExtraLargeSizeTall + OudsSizeKeyToken.IconWithText.BodySmallSizeShort -> iconWithBodySmallSizeShort + OudsSizeKeyToken.IconWithText.BodySmallSizeMedium -> iconWithBodySmallSizeMedium + OudsSizeKeyToken.IconWithText.BodySmallSizeTall -> iconWithBodySmallSizeTall + OudsSizeKeyToken.IconWithText.BodyMediumSizeShort -> iconWithBodyMediumSizeShort + OudsSizeKeyToken.IconWithText.BodyMediumSizeMedium -> iconWithBodyMediumSizeMedium + OudsSizeKeyToken.IconWithText.BodyMediumSizeTall -> iconWithBodyMediumSizeTall + OudsSizeKeyToken.IconWithText.BodyLargeSizeShort -> iconWithBodyLargeSizeShort + OudsSizeKeyToken.IconWithText.BodyLargeSizeMedium -> iconWithBodyLargeSizeMedium + OudsSizeKeyToken.IconWithText.BodyLargeSizeTall -> iconWithBodyLargeSizeTall } return if (dimensionSizeIconWithTextValue is OudsAdaptiveTokenValue<*>) { @@ -320,18 +318,18 @@ fun OudsSizes.fromToken(token: OudsSizeIconWithTextKeyToken, adaptiveWindowType: } @Stable -fun OudsSizes.fromToken(token: OudsSizeMaxWidthTypeKeyToken, adaptiveWindowType: OudsAdaptiveWindowType): Dp { +fun OudsSizes.fromToken(token: OudsSizeKeyToken.MaxWidthType, adaptiveWindowType: OudsAdaptiveWindowType): Dp { val dimensionMaxWidthTypeToken = when (token) { - OudsSizeMaxWidthTypeKeyToken.DisplaySmall -> maxWidthTypeDisplaySmall - OudsSizeMaxWidthTypeKeyToken.DisplayMedium -> maxWidthTypeDisplayMedium - OudsSizeMaxWidthTypeKeyToken.DisplayLarge -> maxWidthTypeDisplayLarge - OudsSizeMaxWidthTypeKeyToken.HeadingSmall -> maxWidthTypeHeadingSmall - OudsSizeMaxWidthTypeKeyToken.HeadingMedium -> maxWidthTypeHeadingMedium - OudsSizeMaxWidthTypeKeyToken.HeadingLarge -> maxWidthTypeHeadingLarge - OudsSizeMaxWidthTypeKeyToken.HeadingExtraLarge -> maxWidthTypeHeadingExtraLarge - OudsSizeMaxWidthTypeKeyToken.BodySmall -> maxWidthTypeBodySmall - OudsSizeMaxWidthTypeKeyToken.BodyMedium -> maxWidthTypeBodyMedium - OudsSizeMaxWidthTypeKeyToken.BodyLarge -> maxWidthTypeBodyLarge + OudsSizeKeyToken.MaxWidthType.DisplaySmall -> maxWidthTypeDisplaySmall + OudsSizeKeyToken.MaxWidthType.DisplayMedium -> maxWidthTypeDisplayMedium + OudsSizeKeyToken.MaxWidthType.DisplayLarge -> maxWidthTypeDisplayLarge + OudsSizeKeyToken.MaxWidthType.HeadingSmall -> maxWidthTypeHeadingSmall + OudsSizeKeyToken.MaxWidthType.HeadingMedium -> maxWidthTypeHeadingMedium + OudsSizeKeyToken.MaxWidthType.HeadingLarge -> maxWidthTypeHeadingLarge + OudsSizeKeyToken.MaxWidthType.HeadingExtraLarge -> maxWidthTypeHeadingExtraLarge + OudsSizeKeyToken.MaxWidthType.BodySmall -> maxWidthTypeBodySmall + OudsSizeKeyToken.MaxWidthType.BodyMedium -> maxWidthTypeBodyMedium + OudsSizeKeyToken.MaxWidthType.BodyLarge -> maxWidthTypeBodyLarge } return when (adaptiveWindowType) { @@ -344,7 +342,7 @@ fun OudsSizes.fromToken(token: OudsSizeMaxWidthTypeKeyToken, adaptiveWindowType: /** * Converts an OUDS decorative icon size token to the local decorative icon size value provided by the theme. */ -val OudsSizeIconDecorativeKeyToken.value: Dp +val OudsSizeKeyToken.IconDecorative.value: Dp @ReadOnlyComposable @Composable get() = OudsTheme.sizes.fromToken(this) @@ -352,13 +350,13 @@ val OudsSizeIconDecorativeKeyToken.value: Dp /** * Converts an OUDS icon size with typography token to the local icon size with typography value provided by the theme depending on the window size. */ -val OudsSizeIconWithTextKeyToken.value: Dp +val OudsSizeKeyToken.IconWithText.value: Dp @Composable get() = OudsTheme.sizes.fromToken(this, OudsAdaptiveWindowType.fromWindowWidth(currentWindowWidth())) /** * Converts an OUDS max width with typography token to the local max width with typography value provided by the theme depending on the window size. */ -val OudsSizeMaxWidthTypeKeyToken.value: Dp +val OudsSizeKeyToken.MaxWidthType.value: Dp @Composable get() = OudsTheme.sizes.fromToken(this, OudsAdaptiveWindowType.fromWindowWidth(currentWindowWidth())) \ No newline at end of file diff --git a/core/src/main/java/com/orange/ouds/core/theme/OudsSpacings.kt b/core/src/main/java/com/orange/ouds/core/theme/OudsSpaces.kt similarity index 57% rename from core/src/main/java/com/orange/ouds/core/theme/OudsSpacings.kt rename to core/src/main/java/com/orange/ouds/core/theme/OudsSpaces.kt index e7db845e..5612623b 100644 --- a/core/src/main/java/com/orange/ouds/core/theme/OudsSpacings.kt +++ b/core/src/main/java/com/orange/ouds/core/theme/OudsSpaces.kt @@ -20,16 +20,10 @@ import androidx.compose.ui.unit.dp import com.orange.ouds.theme.OudsAdaptiveTokenValue import com.orange.ouds.theme.OudsAdaptiveWindowType import com.orange.ouds.theme.currentWindowWidth -import com.orange.ouds.theme.tokens.OudsSpacingColumnGapKeyToken -import com.orange.ouds.theme.tokens.OudsSpacingFixedKeyToken -import com.orange.ouds.theme.tokens.OudsSpacingInsetKeyToken -import com.orange.ouds.theme.tokens.OudsSpacingPaddingBlockKeyToken -import com.orange.ouds.theme.tokens.OudsSpacingPaddingInlineKeyToken -import com.orange.ouds.theme.tokens.OudsSpacingRowGapKeyToken -import com.orange.ouds.theme.tokens.OudsSpacingScaledKeyToken -import com.orange.ouds.theme.tokens.semantic.OudsSpacingSemanticTokens +import com.orange.ouds.theme.tokens.OudsSpaceKeyToken +import com.orange.ouds.theme.tokens.semantic.OudsSpaceSemanticTokens -data class OudsSpacings( +data class OudsSpaces( val fixedNone: Dp, val fixedSmash: Dp, val fixedShortest: Dp, @@ -131,7 +125,7 @@ data class OudsSpacings( val rowGapWithIconTall: Dp, ) -fun OudsSpacingSemanticTokens.getSpacings() = OudsSpacings( +fun OudsSpaceSemanticTokens.getSpaces() = OudsSpaces( fixedNone = fixedNone.dp, fixedSmash = fixedSmash.dp, fixedShortest = fixedShortest.dp, @@ -274,36 +268,36 @@ fun OudsSpacingSemanticTokens.getSpacings() = OudsSpacings( ) @Stable -fun OudsSpacings.fromToken(token: OudsSpacingFixedKeyToken): Dp { +fun OudsSpaces.fromToken(token: OudsSpaceKeyToken.Fixed): Dp { return when (token) { - OudsSpacingFixedKeyToken.None -> fixedNone - OudsSpacingFixedKeyToken.Smash -> fixedSmash - OudsSpacingFixedKeyToken.Shortest -> fixedShortest - OudsSpacingFixedKeyToken.Shorter -> fixedShorter - OudsSpacingFixedKeyToken.Short -> fixedShort - OudsSpacingFixedKeyToken.Medium -> fixedMedium - OudsSpacingFixedKeyToken.Tall -> fixedTall - OudsSpacingFixedKeyToken.Taller -> fixedTaller - OudsSpacingFixedKeyToken.Tallest -> fixedTallest - OudsSpacingFixedKeyToken.Spacious -> fixedSpacious - OudsSpacingFixedKeyToken.Huge -> fixedHuge - OudsSpacingFixedKeyToken.Jumbo -> fixedJumbo + OudsSpaceKeyToken.Fixed.None -> fixedNone + OudsSpaceKeyToken.Fixed.Smash -> fixedSmash + OudsSpaceKeyToken.Fixed.Shortest -> fixedShortest + OudsSpaceKeyToken.Fixed.Shorter -> fixedShorter + OudsSpaceKeyToken.Fixed.Short -> fixedShort + OudsSpaceKeyToken.Fixed.Medium -> fixedMedium + OudsSpaceKeyToken.Fixed.Tall -> fixedTall + OudsSpaceKeyToken.Fixed.Taller -> fixedTaller + OudsSpaceKeyToken.Fixed.Tallest -> fixedTallest + OudsSpaceKeyToken.Fixed.Spacious -> fixedSpacious + OudsSpaceKeyToken.Fixed.Huge -> fixedHuge + OudsSpaceKeyToken.Fixed.Jumbo -> fixedJumbo } } @Stable -fun OudsSpacings.fromToken(token: OudsSpacingScaledKeyToken, adaptiveWindowType: OudsAdaptiveWindowType): Dp { +fun OudsSpaces.fromToken(token: OudsSpaceKeyToken.Scaled, adaptiveWindowType: OudsAdaptiveWindowType): Dp { val dimensionAdaptableSpaceToken = when (token) { - OudsSpacingScaledKeyToken.None -> scaledNone - OudsSpacingScaledKeyToken.Smash -> scaledSmash - OudsSpacingScaledKeyToken.Shortest -> scaledShortest - OudsSpacingScaledKeyToken.Shorter -> scaledShorter - OudsSpacingScaledKeyToken.Short -> scaledShort - OudsSpacingScaledKeyToken.Medium -> scaledMedium - OudsSpacingScaledKeyToken.Tall -> scaledTall - OudsSpacingScaledKeyToken.Taller -> scaledTaller - OudsSpacingScaledKeyToken.Tallest -> scaledTallest - OudsSpacingScaledKeyToken.Spacious -> scaledSpacious + OudsSpaceKeyToken.Scaled.None -> scaledNone + OudsSpaceKeyToken.Scaled.Smash -> scaledSmash + OudsSpaceKeyToken.Scaled.Shortest -> scaledShortest + OudsSpaceKeyToken.Scaled.Shorter -> scaledShorter + OudsSpaceKeyToken.Scaled.Short -> scaledShort + OudsSpaceKeyToken.Scaled.Medium -> scaledMedium + OudsSpaceKeyToken.Scaled.Tall -> scaledTall + OudsSpaceKeyToken.Scaled.Taller -> scaledTaller + OudsSpaceKeyToken.Scaled.Tallest -> scaledTallest + OudsSpaceKeyToken.Scaled.Spacious -> scaledSpacious } return when (adaptiveWindowType) { @@ -314,163 +308,163 @@ fun OudsSpacings.fromToken(token: OudsSpacingScaledKeyToken, adaptiveWindowType: } @Stable -fun OudsSpacings.fromToken(token: OudsSpacingPaddingInlineKeyToken): Dp { +fun OudsSpaces.fromToken(token: OudsSpaceKeyToken.PaddingInline): Dp { return when (token) { - OudsSpacingPaddingInlineKeyToken.None -> paddingInlineNone - OudsSpacingPaddingInlineKeyToken.Shorter -> paddingInlineShorter - OudsSpacingPaddingInlineKeyToken.Short -> paddingInlineShort - OudsSpacingPaddingInlineKeyToken.Medium -> paddingInlineMedium - OudsSpacingPaddingInlineKeyToken.Tall -> paddingInlineTall - OudsSpacingPaddingInlineKeyToken.Taller -> paddingInlineTaller - OudsSpacingPaddingInlineKeyToken.Tallest -> paddingInlineTallest - OudsSpacingPaddingInlineKeyToken.WithIconNone -> paddingInlineWithIconNone - OudsSpacingPaddingInlineKeyToken.WithIconShortest -> paddingInlineWithIconShortest - OudsSpacingPaddingInlineKeyToken.WithIconShorter -> paddingInlineWithIconShorter - OudsSpacingPaddingInlineKeyToken.WithIconShort -> paddingInlineWithIconShort - OudsSpacingPaddingInlineKeyToken.WithIconMedium -> paddingInlineWithIconMedium - OudsSpacingPaddingInlineKeyToken.WithIconTall -> paddingInlineWithIconTall - OudsSpacingPaddingInlineKeyToken.WithIconTaller -> paddingInlineWithIconTaller - OudsSpacingPaddingInlineKeyToken.WithIconTallest -> paddingInlineWithIconTallest - OudsSpacingPaddingInlineKeyToken.WithArrowNone -> paddingInlineWithArrowNone - OudsSpacingPaddingInlineKeyToken.WithArrowShortest -> paddingInlineWithArrowShortest - OudsSpacingPaddingInlineKeyToken.WithArrowShorter -> paddingInlineWithArrowShorter - OudsSpacingPaddingInlineKeyToken.WithArrowShort -> paddingInlineWithArrowShort - OudsSpacingPaddingInlineKeyToken.WithArrowMedium -> paddingInlineWithArrowMedium - OudsSpacingPaddingInlineKeyToken.WithArrowTall -> paddingInlineWithArrowTall - OudsSpacingPaddingInlineKeyToken.WithArrowTaller -> paddingInlineWithArrowTaller - OudsSpacingPaddingInlineKeyToken.WithArrowTallest -> paddingInlineWithArrowTallest + OudsSpaceKeyToken.PaddingInline.None -> paddingInlineNone + OudsSpaceKeyToken.PaddingInline.Shorter -> paddingInlineShorter + OudsSpaceKeyToken.PaddingInline.Short -> paddingInlineShort + OudsSpaceKeyToken.PaddingInline.Medium -> paddingInlineMedium + OudsSpaceKeyToken.PaddingInline.Tall -> paddingInlineTall + OudsSpaceKeyToken.PaddingInline.Taller -> paddingInlineTaller + OudsSpaceKeyToken.PaddingInline.Tallest -> paddingInlineTallest + OudsSpaceKeyToken.PaddingInline.WithIconNone -> paddingInlineWithIconNone + OudsSpaceKeyToken.PaddingInline.WithIconShortest -> paddingInlineWithIconShortest + OudsSpaceKeyToken.PaddingInline.WithIconShorter -> paddingInlineWithIconShorter + OudsSpaceKeyToken.PaddingInline.WithIconShort -> paddingInlineWithIconShort + OudsSpaceKeyToken.PaddingInline.WithIconMedium -> paddingInlineWithIconMedium + OudsSpaceKeyToken.PaddingInline.WithIconTall -> paddingInlineWithIconTall + OudsSpaceKeyToken.PaddingInline.WithIconTaller -> paddingInlineWithIconTaller + OudsSpaceKeyToken.PaddingInline.WithIconTallest -> paddingInlineWithIconTallest + OudsSpaceKeyToken.PaddingInline.WithArrowNone -> paddingInlineWithArrowNone + OudsSpaceKeyToken.PaddingInline.WithArrowShortest -> paddingInlineWithArrowShortest + OudsSpaceKeyToken.PaddingInline.WithArrowShorter -> paddingInlineWithArrowShorter + OudsSpaceKeyToken.PaddingInline.WithArrowShort -> paddingInlineWithArrowShort + OudsSpaceKeyToken.PaddingInline.WithArrowMedium -> paddingInlineWithArrowMedium + OudsSpaceKeyToken.PaddingInline.WithArrowTall -> paddingInlineWithArrowTall + OudsSpaceKeyToken.PaddingInline.WithArrowTaller -> paddingInlineWithArrowTaller + OudsSpaceKeyToken.PaddingInline.WithArrowTallest -> paddingInlineWithArrowTallest } } @Stable -fun OudsSpacings.fromToken(token: OudsSpacingPaddingBlockKeyToken): Dp { +fun OudsSpaces.fromToken(token: OudsSpaceKeyToken.PaddingBlock): Dp { return when (token) { - OudsSpacingPaddingBlockKeyToken.None -> paddingBlockNone - OudsSpacingPaddingBlockKeyToken.Shorter -> paddingBlockShorter - OudsSpacingPaddingBlockKeyToken.Short -> paddingBlockShort - OudsSpacingPaddingBlockKeyToken.Medium -> paddingBlockMedium - OudsSpacingPaddingBlockKeyToken.Tall -> paddingBlockTall - OudsSpacingPaddingBlockKeyToken.Taller -> paddingBlockTaller - OudsSpacingPaddingBlockKeyToken.Tallest -> paddingBlockTallest - OudsSpacingPaddingBlockKeyToken.WithIconNone -> paddingBlockWithIconNone - OudsSpacingPaddingBlockKeyToken.WithIconShortest -> paddingBlockWithIconShortest - OudsSpacingPaddingBlockKeyToken.WithIconShorter -> paddingBlockWithIconShorter - OudsSpacingPaddingBlockKeyToken.WithIconShort -> paddingBlockWithIconShort - OudsSpacingPaddingBlockKeyToken.WithIconMedium -> paddingBlockWithIconMedium - OudsSpacingPaddingBlockKeyToken.WithIconTall -> paddingBlockWithIconTall - OudsSpacingPaddingBlockKeyToken.WithIconTaller -> paddingBlockWithIconTaller + OudsSpaceKeyToken.PaddingBlock.None -> paddingBlockNone + OudsSpaceKeyToken.PaddingBlock.Shorter -> paddingBlockShorter + OudsSpaceKeyToken.PaddingBlock.Short -> paddingBlockShort + OudsSpaceKeyToken.PaddingBlock.Medium -> paddingBlockMedium + OudsSpaceKeyToken.PaddingBlock.Tall -> paddingBlockTall + OudsSpaceKeyToken.PaddingBlock.Taller -> paddingBlockTaller + OudsSpaceKeyToken.PaddingBlock.Tallest -> paddingBlockTallest + OudsSpaceKeyToken.PaddingBlock.WithIconNone -> paddingBlockWithIconNone + OudsSpaceKeyToken.PaddingBlock.WithIconShortest -> paddingBlockWithIconShortest + OudsSpaceKeyToken.PaddingBlock.WithIconShorter -> paddingBlockWithIconShorter + OudsSpaceKeyToken.PaddingBlock.WithIconShort -> paddingBlockWithIconShort + OudsSpaceKeyToken.PaddingBlock.WithIconMedium -> paddingBlockWithIconMedium + OudsSpaceKeyToken.PaddingBlock.WithIconTall -> paddingBlockWithIconTall + OudsSpaceKeyToken.PaddingBlock.WithIconTaller -> paddingBlockWithIconTaller } } @Stable -fun OudsSpacings.fromToken(token: OudsSpacingInsetKeyToken): Dp { +fun OudsSpaces.fromToken(token: OudsSpaceKeyToken.Inset): Dp { return when (token) { - OudsSpacingInsetKeyToken.None -> insetNone - OudsSpacingInsetKeyToken.Smash -> insetSmash - OudsSpacingInsetKeyToken.Shortest -> insetShortest - OudsSpacingInsetKeyToken.Shorter -> insetShorter - OudsSpacingInsetKeyToken.Short -> insetShort - OudsSpacingInsetKeyToken.Medium -> insetMedium - OudsSpacingInsetKeyToken.Tall -> insetTall - OudsSpacingInsetKeyToken.Taller -> insetTaller - OudsSpacingInsetKeyToken.Tallest -> insetTallest - OudsSpacingInsetKeyToken.Spacious -> insetSpacious + OudsSpaceKeyToken.Inset.None -> insetNone + OudsSpaceKeyToken.Inset.Smash -> insetSmash + OudsSpaceKeyToken.Inset.Shortest -> insetShortest + OudsSpaceKeyToken.Inset.Shorter -> insetShorter + OudsSpaceKeyToken.Inset.Short -> insetShort + OudsSpaceKeyToken.Inset.Medium -> insetMedium + OudsSpaceKeyToken.Inset.Tall -> insetTall + OudsSpaceKeyToken.Inset.Taller -> insetTaller + OudsSpaceKeyToken.Inset.Tallest -> insetTallest + OudsSpaceKeyToken.Inset.Spacious -> insetSpacious } } @Stable -fun OudsSpacings.fromToken(token: OudsSpacingColumnGapKeyToken): Dp { +fun OudsSpaces.fromToken(token: OudsSpaceKeyToken.ColumnGap): Dp { return when (token) { - OudsSpacingColumnGapKeyToken.None -> columnGapNone - OudsSpacingColumnGapKeyToken.Shorter -> columnGapShorter - OudsSpacingColumnGapKeyToken.Short -> columnGapShort - OudsSpacingColumnGapKeyToken.Medium -> columnGapMedium - OudsSpacingColumnGapKeyToken.Tall -> columnGapTall - OudsSpacingColumnGapKeyToken.Taller -> columnGapTaller - OudsSpacingColumnGapKeyToken.WithIconNone -> columnGapWithIconNone - OudsSpacingColumnGapKeyToken.WithIconShortest -> columnGapWithIconShortest - OudsSpacingColumnGapKeyToken.WithIconShorter -> columnGapWithIconShorter - OudsSpacingColumnGapKeyToken.WithIconShort -> columnGapWithIconShort - OudsSpacingColumnGapKeyToken.WithIconMedium -> columnGapWithIconMedium - OudsSpacingColumnGapKeyToken.WithIconTall -> columnGapWithIconTall - OudsSpacingColumnGapKeyToken.WithArrowNone -> columnGapWithArrowNone - OudsSpacingColumnGapKeyToken.WithArrowShortest -> columnGapWithArrowShortest - OudsSpacingColumnGapKeyToken.WithArrowShorter -> columnGapWithArrowShorter - OudsSpacingColumnGapKeyToken.WithArrowShort -> columnGapWithArrowShort - OudsSpacingColumnGapKeyToken.WithArrowMedium -> columnGapWithArrowMedium - OudsSpacingColumnGapKeyToken.WithArrowTall -> columnGapWithArrowTall + OudsSpaceKeyToken.ColumnGap.None -> columnGapNone + OudsSpaceKeyToken.ColumnGap.Shorter -> columnGapShorter + OudsSpaceKeyToken.ColumnGap.Short -> columnGapShort + OudsSpaceKeyToken.ColumnGap.Medium -> columnGapMedium + OudsSpaceKeyToken.ColumnGap.Tall -> columnGapTall + OudsSpaceKeyToken.ColumnGap.Taller -> columnGapTaller + OudsSpaceKeyToken.ColumnGap.WithIconNone -> columnGapWithIconNone + OudsSpaceKeyToken.ColumnGap.WithIconShortest -> columnGapWithIconShortest + OudsSpaceKeyToken.ColumnGap.WithIconShorter -> columnGapWithIconShorter + OudsSpaceKeyToken.ColumnGap.WithIconShort -> columnGapWithIconShort + OudsSpaceKeyToken.ColumnGap.WithIconMedium -> columnGapWithIconMedium + OudsSpaceKeyToken.ColumnGap.WithIconTall -> columnGapWithIconTall + OudsSpaceKeyToken.ColumnGap.WithArrowNone -> columnGapWithArrowNone + OudsSpaceKeyToken.ColumnGap.WithArrowShortest -> columnGapWithArrowShortest + OudsSpaceKeyToken.ColumnGap.WithArrowShorter -> columnGapWithArrowShorter + OudsSpaceKeyToken.ColumnGap.WithArrowShort -> columnGapWithArrowShort + OudsSpaceKeyToken.ColumnGap.WithArrowMedium -> columnGapWithArrowMedium + OudsSpaceKeyToken.ColumnGap.WithArrowTall -> columnGapWithArrowTall } } @Stable -fun OudsSpacings.fromToken(token: OudsSpacingRowGapKeyToken): Dp { +fun OudsSpaces.fromToken(token: OudsSpaceKeyToken.RowGap): Dp { return when (token) { - OudsSpacingRowGapKeyToken.None -> rowGapNone - OudsSpacingRowGapKeyToken.Shortest -> rowGapShortest - OudsSpacingRowGapKeyToken.Shorter -> rowGapShorter - OudsSpacingRowGapKeyToken.Short -> rowGapShort - OudsSpacingRowGapKeyToken.Medium -> rowGapMedium - OudsSpacingRowGapKeyToken.Tall -> rowGapTall - OudsSpacingRowGapKeyToken.WithIconNone -> rowGapWithIconNone - OudsSpacingRowGapKeyToken.WithIconShortest -> rowGapWithIconShortest - OudsSpacingRowGapKeyToken.WithIconShorter -> rowGapWithIconShorter - OudsSpacingRowGapKeyToken.WithIconShort -> rowGapWithIconShort - OudsSpacingRowGapKeyToken.WithIconMedium -> rowGapWithIconMedium - OudsSpacingRowGapKeyToken.WithIconTall -> rowGapWithIconTall + OudsSpaceKeyToken.RowGap.None -> rowGapNone + OudsSpaceKeyToken.RowGap.Shortest -> rowGapShortest + OudsSpaceKeyToken.RowGap.Shorter -> rowGapShorter + OudsSpaceKeyToken.RowGap.Short -> rowGapShort + OudsSpaceKeyToken.RowGap.Medium -> rowGapMedium + OudsSpaceKeyToken.RowGap.Tall -> rowGapTall + OudsSpaceKeyToken.RowGap.WithIconNone -> rowGapWithIconNone + OudsSpaceKeyToken.RowGap.WithIconShortest -> rowGapWithIconShortest + OudsSpaceKeyToken.RowGap.WithIconShorter -> rowGapWithIconShorter + OudsSpaceKeyToken.RowGap.WithIconShort -> rowGapWithIconShort + OudsSpaceKeyToken.RowGap.WithIconMedium -> rowGapWithIconMedium + OudsSpaceKeyToken.RowGap.WithIconTall -> rowGapWithIconTall } } /** * Converts an OUDS column gap space token to the local column gap space value provided by the theme. */ -val OudsSpacingColumnGapKeyToken.value: Dp +val OudsSpaceKeyToken.ColumnGap.value: Dp @ReadOnlyComposable @Composable - get() = OudsTheme.spacings.fromToken(this) + get() = OudsTheme.spaces.fromToken(this) /** * Converts an OUDS fixed space token to the local space value provided by the theme. */ -val OudsSpacingFixedKeyToken.value: Dp +val OudsSpaceKeyToken.Fixed.value: Dp @ReadOnlyComposable @Composable - get() = OudsTheme.spacings.fromToken(this) + get() = OudsTheme.spaces.fromToken(this) /** * Converts an OUDS block padding token to the local block padding value provided by the theme. */ -val OudsSpacingPaddingBlockKeyToken.value: Dp +val OudsSpaceKeyToken.PaddingBlock.value: Dp @ReadOnlyComposable @Composable - get() = OudsTheme.spacings.fromToken(this) + get() = OudsTheme.spaces.fromToken(this) /** * Converts an OUDS inline padding token to the local inline padding value provided by the theme. */ -val OudsSpacingPaddingInlineKeyToken.value: Dp +val OudsSpaceKeyToken.PaddingInline.value: Dp @ReadOnlyComposable @Composable - get() = OudsTheme.spacings.fromToken(this) + get() = OudsTheme.spaces.fromToken(this) /** * Converts an OUDS inset token to the local inset value provided by the theme. */ -val OudsSpacingInsetKeyToken.value: Dp +val OudsSpaceKeyToken.Inset.value: Dp @ReadOnlyComposable @Composable - get() = OudsTheme.spacings.fromToken(this) + get() = OudsTheme.spaces.fromToken(this) /** * Converts an OUDS row gap space token to the local row gap space value provided by the theme. */ -val OudsSpacingRowGapKeyToken.value: Dp +val OudsSpaceKeyToken.RowGap.value: Dp @ReadOnlyComposable @Composable - get() = OudsTheme.spacings.fromToken(this) + get() = OudsTheme.spaces.fromToken(this) /** * Converts an OUDS scaled space token to the local space value provided by the theme depending on the window size. */ -val OudsSpacingScaledKeyToken.value: Dp +val OudsSpaceKeyToken.Scaled.value: Dp @Composable - get() = OudsTheme.spacings.fromToken(this, OudsAdaptiveWindowType.fromWindowWidth(currentWindowWidth())) + get() = OudsTheme.spaces.fromToken(this, OudsAdaptiveWindowType.fromWindowWidth(currentWindowWidth())) diff --git a/core/src/main/java/com/orange/ouds/core/theme/OudsTheme.kt b/core/src/main/java/com/orange/ouds/core/theme/OudsTheme.kt index 21fba5ae..25fa84b8 100644 --- a/core/src/main/java/com/orange/ouds/core/theme/OudsTheme.kt +++ b/core/src/main/java/com/orange/ouds/core/theme/OudsTheme.kt @@ -18,7 +18,6 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.ReadOnlyComposable import androidx.compose.runtime.staticCompositionLocalOf -import com.orange.ouds.theme.OudsColorScheme import com.orange.ouds.theme.OudsThemeContract import com.orange.ouds.theme.tokens.components.OudsComponentsTokens @@ -32,7 +31,7 @@ private val LocalTypography = staticCompositionLocalOf { missing private val LocalGrids = staticCompositionLocalOf { missingCompositionLocalError("LocalGrids") } private val LocalOpacities = staticCompositionLocalOf { missingCompositionLocalError("LocalOpacities") } private val LocalSizes = staticCompositionLocalOf { missingCompositionLocalError("LocalSizes") } -private val LocalSpacing = staticCompositionLocalOf { missingCompositionLocalError("LocalSpacing") } +private val LocalSpaces = staticCompositionLocalOf { missingCompositionLocalError("LocalSpaces") } private val LocalComponentsTokens = staticCompositionLocalOf { missingCompositionLocalError("LocalComponentsTokens") } object OudsTheme { @@ -71,10 +70,10 @@ object OudsTheme { @ReadOnlyComposable get() = LocalSizes.current - val spacings: OudsSpacings + val spaces: OudsSpaces @Composable @ReadOnlyComposable - get() = LocalSpacing.current + get() = LocalSpaces.current val componentsTokens: OudsComponentsTokens @Composable @@ -106,7 +105,7 @@ fun OudsTheme( LocalGrids provides themeContract.gridTokens.getGrids(), LocalOpacities provides themeContract.opacityTokens.getOpacity(), LocalSizes provides themeContract.sizeTokens.getSizes(), - LocalSpacing provides themeContract.spacingTokens.getSpacings(), + LocalSpaces provides themeContract.spaceTokens.getSpaces(), LocalComponentsTokens provides themeContract.componentsTokens ) { MaterialTheme(colorScheme = if (darkThemeEnabled) themeContract.colorTokens.materialDarkColorScheme else themeContract.colorTokens.materialLightColorScheme) { diff --git a/core/src/main/java/com/orange/ouds/core/utilities/OudsPreview.kt b/core/src/main/java/com/orange/ouds/core/utilities/OudsPreview.kt index 2448d12a..2869283b 100644 --- a/core/src/main/java/com/orange/ouds/core/utilities/OudsPreview.kt +++ b/core/src/main/java/com/orange/ouds/core/utilities/OudsPreview.kt @@ -17,6 +17,8 @@ import androidx.compose.material3.Surface import androidx.compose.runtime.Composable import com.orange.ouds.core.BuildConfig import com.orange.ouds.core.theme.OudsTheme +import com.orange.ouds.core.theme.value +import com.orange.ouds.theme.tokens.OudsColorKeyToken /** * Configures the Compose OUDS preview environment in Android Studio. @@ -27,6 +29,6 @@ import com.orange.ouds.core.theme.OudsTheme @Composable fun OudsPreview(darkThemeEnabled: Boolean = isSystemInDarkTheme(), content: @Composable () -> Unit) { OudsTheme(themeContract = BuildConfig.PREVIEW_THEME, darkThemeEnabled) { - Surface(color = OudsTheme.colorScheme.background, content = content) // Add a surface to be able to see components + Surface(color = OudsColorKeyToken.Background.Primary.value, content = content) // Add a surface to be able to see components } } diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.button_OudsButtonTest_takeOudsButtonDarkThemeSnapshot[0].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.button_OudsButtonTest_takeOudsButtonDarkThemeSnapshot[0].png index 92eca943..7074e427 100644 Binary files a/core/src/test/snapshots/images/com.orange.ouds.core.component.button_OudsButtonTest_takeOudsButtonDarkThemeSnapshot[0].png and b/core/src/test/snapshots/images/com.orange.ouds.core.component.button_OudsButtonTest_takeOudsButtonDarkThemeSnapshot[0].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.button_OudsButtonTest_takeOudsButtonDarkThemeSnapshot[1].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.button_OudsButtonTest_takeOudsButtonDarkThemeSnapshot[1].png index 117bf340..bbaf6908 100644 Binary files a/core/src/test/snapshots/images/com.orange.ouds.core.component.button_OudsButtonTest_takeOudsButtonDarkThemeSnapshot[1].png and b/core/src/test/snapshots/images/com.orange.ouds.core.component.button_OudsButtonTest_takeOudsButtonDarkThemeSnapshot[1].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.button_OudsButtonTest_takeOudsButtonLightThemeSnapshot[1].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.button_OudsButtonTest_takeOudsButtonLightThemeSnapshot[1].png index df7762ee..32ea3bd8 100644 Binary files a/core/src/test/snapshots/images/com.orange.ouds.core.component.button_OudsButtonTest_takeOudsButtonLightThemeSnapshot[1].png and b/core/src/test/snapshots/images/com.orange.ouds.core.component.button_OudsButtonTest_takeOudsButtonLightThemeSnapshot[1].png differ diff --git a/global-raw-tokens/src/main/java/com/orange/ouds/tokens/global/raw/ColorRawTokens.kt b/global-raw-tokens/src/main/java/com/orange/ouds/tokens/global/raw/ColorRawTokens.kt new file mode 100644 index 00000000..1a857c87 --- /dev/null +++ b/global-raw-tokens/src/main/java/com/orange/ouds/tokens/global/raw/ColorRawTokens.kt @@ -0,0 +1,154 @@ +/* + * Software Name: OUDS Android + * SPDX-FileCopyrightText: Copyright (c) Orange SA + * SPDX-License-Identifier: MIT + * + * This software is distributed under the MIT license, + * the text of which is available at https://opensource.org/license/MIT/ + * or see the "LICENSE" file for more details. + * + * Software description: Android library of reusable graphical components + */ + +package com.orange.ouds.tokens.global.raw + +import androidx.compose.ui.graphics.Color + +object ColorRawTokens { + val colorDecorativeAmber100 = Color(0xfffff0cc) + val colorDecorativeAmber200 = Color(0xffffe199) + val colorDecorativeAmber300 = Color(0xffffd266) + val colorDecorativeAmber400 = Color(0xffffc333) + val colorDecorativeAmber500 = Color(0xffffb400) + val colorDecorativeAmber600 = Color(0xffcc9000) + val colorDecorativeAmber700 = Color(0xff996c00) + val colorDecorativeAmber800 = Color(0xff664800) + val colorDecorativeAmber900 = Color(0xff332400) + val colorDecorativeAmethyst100 = Color(0xfff1ecf9) + val colorDecorativeAmethyst200 = Color(0xffe0d4f2) + val colorDecorativeAmethyst300 = Color(0xffc5ade6) + val colorDecorativeAmethyst400 = Color(0xffa885d8) + val colorDecorativeAmethyst500 = Color(0xff8d60cd) + val colorDecorativeAmethyst600 = Color(0xff5b2f98) + val colorDecorativeAmethyst700 = Color(0xff432371) + val colorDecorativeAmethyst800 = Color(0xff2c174a) + val colorDecorativeAmethyst900 = Color(0xff150b23) + val colorDecorativeDeepPeach100 = Color(0xfffbebdf) + val colorDecorativeDeepPeach200 = Color(0xfff4cfb2) + val colorDecorativeDeepPeach300 = Color(0xffe3b591) + val colorDecorativeDeepPeach400 = Color(0xffc19372) + val colorDecorativeDeepPeach500 = Color(0xffcf7e3f) + val colorDecorativeDeepPeach600 = Color(0xffaa6631) + val colorDecorativeDeepPeach700 = Color(0xff7e4f2a) + val colorDecorativeDeepPeach800 = Color(0xff553720) + val colorDecorativeDeepPeach900 = Color(0xff2e2014) + val colorDecorativeEmerald100 = Color(0xffe5f5ed) + val colorDecorativeEmerald200 = Color(0xffc0e8d4) + val colorDecorativeEmerald300 = Color(0xff9bdaba) + val colorDecorativeEmerald400 = Color(0xff75cca1) + val colorDecorativeEmerald500 = Color(0xff50be87) + val colorDecorativeEmerald600 = Color(0xff3ba06e) + val colorDecorativeEmerald700 = Color(0xff2e7b54) + val colorDecorativeEmerald800 = Color(0xff20563b) + val colorDecorativeEmerald900 = Color(0xff123021) + val colorDecorativeShockingPink100 = Color(0xffffe5f6) + val colorDecorativeShockingPink200 = Color(0xffffb4e6) + val colorDecorativeShockingPink300 = Color(0xffff80d4) + val colorDecorativeShockingPink400 = Color(0xffff4dc3) + val colorDecorativeShockingPink500 = Color(0xffff1ab2) + val colorDecorativeShockingPink600 = Color(0xffe50099) + val colorDecorativeShockingPink700 = Color(0xffb20077) + val colorDecorativeShockingPink800 = Color(0xff800055) + val colorDecorativeShockingPink900 = Color(0xff4d0033) + val colorDecorativeSky100 = Color(0xffd2ecf9) + val colorDecorativeSky200 = Color(0xffa5daf3) + val colorDecorativeSky300 = Color(0xff79c7ec) + val colorDecorativeSky400 = Color(0xff4ab4e6) + val colorDecorativeSky500 = Color(0xff1fa2e0) + val colorDecorativeSky600 = Color(0xff1982b3) + val colorDecorativeSky700 = Color(0xff136186) + val colorDecorativeSky800 = Color(0xff0c415a) + val colorDecorativeSky900 = Color(0xff06202d) + val colorFunctionalBlack = Color(0xff000000) + val colorFunctionalDarkGray160 = Color(0xff707070) + val colorFunctionalDarkGray240 = Color(0xff666666) + val colorFunctionalDarkGray320 = Color(0xff5c5c5c) + val colorFunctionalDarkGray400 = Color(0xff555555) + val colorFunctionalDarkGray480 = Color(0xff444444) + val colorFunctionalDarkGray560 = Color(0xff3d3d3d) + val colorFunctionalDarkGray640 = Color(0xff333333) + val colorFunctionalDarkGray720 = Color(0xff272727) + val colorFunctionalDarkGray80 = Color(0xff7a7a7a) + val colorFunctionalDarkGray800 = Color(0xff1f1f1f) + val colorFunctionalDarkGray880 = Color(0xff141414) + val colorFunctionalDarkGray960 = Color(0xff0a0a0a) + val colorFunctionalDodgerBlue100 = Color(0xfff0faff) + val colorFunctionalDodgerBlue200 = Color(0xffbde7ff) + val colorFunctionalDodgerBlue300 = Color(0xff8ad5ff) + val colorFunctionalDodgerBlue400 = Color(0xff57c3ff) + val colorFunctionalDodgerBlue500 = Color(0xff26b2ff) + val colorFunctionalDodgerBlue600 = Color(0xff009bf0) + val colorFunctionalDodgerBlue700 = Color(0xff007abd) + val colorFunctionalDodgerBlue800 = Color(0xff00598a) + val colorFunctionalDodgerBlue900 = Color(0xff003857) + val colorFunctionalLightGray160 = Color(0xffeeeeee) + val colorFunctionalLightGray240 = Color(0xffe0e0e0) + val colorFunctionalLightGray320 = Color(0xffd6d6d6) + val colorFunctionalLightGray400 = Color(0xffcccccc) + val colorFunctionalLightGray480 = Color(0xffc2c2c2) + val colorFunctionalLightGray560 = Color(0xffbbbbbb) + val colorFunctionalLightGray640 = Color(0xffadadad) + val colorFunctionalLightGray720 = Color(0xffa3a3a3) + val colorFunctionalLightGray80 = Color(0xfff4f4f4) + val colorFunctionalLightGray800 = Color(0xff999999) + val colorFunctionalLightGray880 = Color(0xff8f8f8f) + val colorFunctionalLightGray960 = Color(0xff858585) + val colorFunctionalMalachite100 = Color(0xffedfcf0) + val colorFunctionalMalachite200 = Color(0xffc1f6ca) + val colorFunctionalMalachite300 = Color(0xff94f0a4) + val colorFunctionalMalachite400 = Color(0xff67e97e) + val colorFunctionalMalachite500 = Color(0xff3de35a) + val colorFunctionalMalachite600 = Color(0xff1ecd3c) + val colorFunctionalMalachite700 = Color(0xff17a02f) + val colorFunctionalMalachite800 = Color(0xff0e621d) + val colorFunctionalMalachite900 = Color(0xff0a4715) + val colorFunctionalScarlet100 = Color(0xffffe5e6) + val colorFunctionalScarlet200 = Color(0xffffb2b3) + val colorFunctionalScarlet300 = Color(0xffff8081) + val colorFunctionalScarlet400 = Color(0xffff4d4e) + val colorFunctionalScarlet500 = Color(0xffff1a1b) + val colorFunctionalScarlet600 = Color(0xffea0305) + val colorFunctionalScarlet700 = Color(0xffb20002) + val colorFunctionalScarlet800 = Color(0xff800001) + val colorFunctionalScarlet900 = Color(0xff4d0001) + val colorFunctionalSun100 = Color(0xfffff7d6) + val colorFunctionalSun200 = Color(0xffffed99) + val colorFunctionalSun300 = Color(0xffffe270) + val colorFunctionalSun400 = Color(0xffffd73d) + val colorFunctionalSun500 = Color(0xffffd000) + val colorFunctionalSun600 = Color(0xffd6aa00) + val colorFunctionalSun700 = Color(0xffa38200) + val colorFunctionalSun800 = Color(0xff665100) + val colorFunctionalSun900 = Color(0xff3d3100) + val colorFunctionalWhite = Color(0xffffffff) + val colorTransparentBlack0 = Color(0x00000000) + val colorTransparentBlack100 = Color(0x0a000000) + val colorTransparentBlack200 = Color(0x14000000) + val colorTransparentBlack300 = Color(0x29000000) + val colorTransparentBlack400 = Color(0x3d000000) + val colorTransparentBlack500 = Color(0x52000000) + val colorTransparentBlack600 = Color(0x7a000000) + val colorTransparentBlack700 = Color(0xa3000000) + val colorTransparentBlack800 = Color(0xe0000000) + val colorTransparentBlack900 = Color(0xff000000) + val colorTransparentWhite0 = Color(0x00ffffff) + val colorTransparentWhite100 = Color(0x0affffff) + val colorTransparentWhite200 = Color(0x14ffffff) + val colorTransparentWhite300 = Color(0x29ffffff) + val colorTransparentWhite400 = Color(0x3dffffff) + val colorTransparentWhite500 = Color(0x52ffffff) + val colorTransparentWhite600 = Color(0x7affffff) + val colorTransparentWhite700 = Color(0xa3ffffff) + val colorTransparentWhite800 = Color(0xe0ffffff) + val colorTransparentWhite900 = Color(0xffffffff) +} \ No newline at end of file diff --git a/global-raw-tokens/src/main/java/com/orange/ouds/tokens/global/raw/OrangeBrandColorRawTokens.kt b/global-raw-tokens/src/main/java/com/orange/ouds/tokens/global/raw/OrangeBrandColorRawTokens.kt new file mode 100644 index 00000000..af7dab43 --- /dev/null +++ b/global-raw-tokens/src/main/java/com/orange/ouds/tokens/global/raw/OrangeBrandColorRawTokens.kt @@ -0,0 +1,38 @@ +/* + * Software Name: OUDS Android + * SPDX-FileCopyrightText: Copyright (c) Orange SA + * SPDX-License-Identifier: MIT + * + * This software is distributed under the MIT license, + * the text of which is available at https://opensource.org/license/MIT/ + * or see the "LICENSE" file for more details. + * + * Software description: Android library of reusable graphical components + */ + +package com.orange.ouds.tokens.global.raw + +import androidx.compose.ui.graphics.Color + +object OrangeBrandColorRawTokens { + val colorOrange100 = Color(0xffffd5b0) + val colorOrange200 = Color(0xffffc18a) + val colorOrange300 = Color(0xffffa554) + val colorOrange400 = Color(0xffff9433) + val colorOrange50 = Color(0xfffff2e6) + val colorOrange500 = Color(0xffff7900) + val colorOrange550 = Color(0xfff16e00) + val colorOrange600 = Color(0xffe86e00) + val colorOrange700 = Color(0xffb55600) + val colorOrange800 = Color(0xff8c4300) + val colorOrange900 = Color(0xff6b3300) + val colorWarmGray100 = Color(0xfff9f5f0) + val colorWarmGray200 = Color(0xffe9ddce) + val colorWarmGray300 = Color(0xffd6c4ae) + val colorWarmGray400 = Color(0xffc1ab90) + val colorWarmGray500 = Color(0xffa99275) + val colorWarmGray600 = Color(0xff8a7860) + val colorWarmGray700 = Color(0xff685d50) + val colorWarmGray800 = Color(0xff48433d) + val colorWarmGray900 = Color(0xff353228) +} \ No newline at end of file diff --git a/theme-contract/src/main/java/com/orange/ouds/theme/OudsBorderStyle.kt b/theme-contract/src/main/java/com/orange/ouds/theme/OudsBorderStyle.kt index b02db859..67f75c4e 100644 --- a/theme-contract/src/main/java/com/orange/ouds/theme/OudsBorderStyle.kt +++ b/theme-contract/src/main/java/com/orange/ouds/theme/OudsBorderStyle.kt @@ -27,4 +27,4 @@ enum class OudsBorderStyle { } } } -} +} \ No newline at end of file diff --git a/theme-contract/src/main/java/com/orange/ouds/theme/OudsColorScheme.kt b/theme-contract/src/main/java/com/orange/ouds/theme/OudsColorScheme.kt deleted file mode 100644 index 41fe9121..00000000 --- a/theme-contract/src/main/java/com/orange/ouds/theme/OudsColorScheme.kt +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Software Name: OUDS Android - * SPDX-FileCopyrightText: Copyright (c) Orange SA - * SPDX-License-Identifier: MIT - * - * This software is distributed under the MIT license, - * the text of which is available at https://opensource.org/license/MIT/ - * or see the "LICENSE" file for more details. - * - * Software description: Android library of reusable graphical components - */ - -package com.orange.ouds.theme - -import androidx.compose.runtime.Stable -import androidx.compose.ui.graphics.Color -import com.orange.ouds.theme.tokens.semantic.OudsColorKeyToken - -class OudsColorScheme( - val primary: Color, - val onPrimary: Color, - val primaryContainer: Color, - val onPrimaryContainer: Color, - val inversePrimary: Color, - val secondary: Color, - val onSecondary: Color, - val secondaryContainer: Color, - val onSecondaryContainer: Color, - val tertiary: Color, - val onTertiary: Color, - val tertiaryContainer: Color, - val onTertiaryContainer: Color, - val background: Color, - val onBackground: Color, - val surface: Color, - val onSurface: Color, - val surfaceVariant: Color, - val onSurfaceVariant: Color, - val surfaceTint: Color, - val inverseSurface: Color, - val inverseOnSurface: Color, - val error: Color, - val onError: Color, - val errorContainer: Color, - val onErrorContainer: Color, - val outline: Color, - val outlineVariant: Color, - val scrim: Color, - val positive: Color, - val onPositive: Color, - val negative: Color, - val onNegative: Color, - val info: Color, - val alert: Color, -) - -@Stable -fun OudsColorScheme.fromToken(value: OudsColorKeyToken): Color { - return when (value) { - OudsColorKeyToken.Background -> background - OudsColorKeyToken.Error -> error - OudsColorKeyToken.ErrorContainer -> errorContainer - OudsColorKeyToken.InverseOnSurface -> inverseOnSurface - OudsColorKeyToken.InversePrimary -> inversePrimary - OudsColorKeyToken.InverseSurface -> inverseSurface - OudsColorKeyToken.OnBackground -> onBackground - OudsColorKeyToken.OnError -> onError - OudsColorKeyToken.OnErrorContainer -> onErrorContainer - OudsColorKeyToken.OnPrimary -> onPrimary - OudsColorKeyToken.OnPrimaryContainer -> onPrimaryContainer - OudsColorKeyToken.OnSecondary -> onSecondary - OudsColorKeyToken.OnSecondaryContainer -> onSecondaryContainer - OudsColorKeyToken.OnSurface -> onSurface - OudsColorKeyToken.OnSurfaceVariant -> onSurfaceVariant - OudsColorKeyToken.SurfaceTint -> surfaceTint - OudsColorKeyToken.OnTertiary -> onTertiary - OudsColorKeyToken.OnTertiaryContainer -> onTertiaryContainer - OudsColorKeyToken.Outline -> outline - OudsColorKeyToken.OutlineVariant -> outlineVariant - OudsColorKeyToken.Primary -> primary - OudsColorKeyToken.PrimaryContainer -> primaryContainer - OudsColorKeyToken.Scrim -> scrim - OudsColorKeyToken.Secondary -> secondary - OudsColorKeyToken.SecondaryContainer -> secondaryContainer - OudsColorKeyToken.Surface -> surface - OudsColorKeyToken.SurfaceVariant -> surfaceVariant - OudsColorKeyToken.Tertiary -> tertiary - OudsColorKeyToken.TertiaryContainer -> tertiaryContainer - } -} \ No newline at end of file diff --git a/theme-contract/src/main/java/com/orange/ouds/theme/OudsThemeContract.kt b/theme-contract/src/main/java/com/orange/ouds/theme/OudsThemeContract.kt index 10e669c0..bc8952cd 100644 --- a/theme-contract/src/main/java/com/orange/ouds/theme/OudsThemeContract.kt +++ b/theme-contract/src/main/java/com/orange/ouds/theme/OudsThemeContract.kt @@ -16,13 +16,13 @@ import android.os.Parcelable import androidx.compose.ui.text.font.FontFamily import com.orange.ouds.theme.tokens.components.OudsComponentsTokens import com.orange.ouds.theme.tokens.semantic.OudsBorderSemanticTokens -import com.orange.ouds.theme.tokens.semantic.OudsColorTokens +import com.orange.ouds.theme.tokens.semantic.OudsColorSemanticTokens import com.orange.ouds.theme.tokens.semantic.OudsElevationSemanticTokens import com.orange.ouds.theme.tokens.semantic.OudsFontSemanticTokens import com.orange.ouds.theme.tokens.semantic.OudsGridSemanticTokens import com.orange.ouds.theme.tokens.semantic.OudsOpacitySemanticTokens import com.orange.ouds.theme.tokens.semantic.OudsSizeSemanticTokens -import com.orange.ouds.theme.tokens.semantic.OudsSpacingSemanticTokens +import com.orange.ouds.theme.tokens.semantic.OudsSpaceSemanticTokens interface OudsThemeContract : Parcelable { @@ -34,7 +34,8 @@ interface OudsThemeContract : Parcelable { /** * Color semantic tokens values used in the theme */ - val colorTokens: OudsColorTokens + val colorTokens: OudsColorSemanticTokens + get() = OudsColorSemanticTokens() /** * Border semantic tokens values used in the theme @@ -80,10 +81,10 @@ interface OudsThemeContract : Parcelable { get() = OudsSizeSemanticTokens() /** - * Spacing semantic tokens values used in the theme + * Space semantic tokens values used in the theme */ - val spacingTokens: OudsSpacingSemanticTokens - get() = OudsSpacingSemanticTokens() + val spaceTokens: OudsSpaceSemanticTokens + get() = OudsSpaceSemanticTokens() /** * Customization of the OUDS components if needed diff --git a/theme-contract/src/main/java/com/orange/ouds/theme/tokens/OudsColorKeyToken.kt b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/OudsColorKeyToken.kt new file mode 100644 index 00000000..f8347be2 --- /dev/null +++ b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/OudsColorKeyToken.kt @@ -0,0 +1,247 @@ +/* + * Software Name: OUDS Android + * SPDX-FileCopyrightText: Copyright (c) Orange SA + * SPDX-License-Identifier: MIT + * + * This software is distributed under the MIT license + * the text of which is available at https://opensource.org/license/MIT/ + * or see the "LICENSE" file for more details. + * + * Software description: Android library of reusable graphical components + */ + +package com.orange.ouds.theme.tokens + +class OudsColorKeyToken { + enum class Global { + TransparentDefault, + } + + enum class Action { + Disabled, + DisabledOnBgEmphasized, + NegativeEnabled, + NegativeFocus, + NegativeHover, + NegativeLoading, + NegativePressed, + PrimaryEnabled, + PrimaryEnabledOnBgEmphasized, + PrimaryFocus, + PrimaryFocusOnBgEmphasized, + PrimaryHover, + PrimaryHoverOnBgEmphasized, + PrimaryLoading, + PrimaryLoadingOnBgEmphasized, + PrimaryPressed, + PrimaryPressedOnBgEmphasized, + SecondaryEnabled, + SecondaryEnabledOnBgEmphasized, + SecondaryFocus, + SecondaryFocusOnBgEmphasized, + SecondaryHover, + SecondaryHoverOnBgEmphasized, + SecondaryLoading, + SecondaryLoadingOnBgEmphasized, + SecondaryPressed, + SecondaryPressedOnBgEmphasized, + Selected, + SelectedOnBgEmphasized, + Visited, + VisitedOnBgEmphasized, + } + + enum class Always { + Accent, + Black, + Info, + Negative, + OnAccent, + OnBlack, + OnInfo, + OnNegative, + OnPositive, + OnWarning, + OnWhite, + Positive, + Warning, + White, + } + + enum class Background { + BrandPrimary, + Emphasized, + Primary, + Secondary, + StatusAccentEmphasized, + StatusAccentMuted, + StatusAccentMutedOnBgEmphasized, + StatusInfoEmphasized, + StatusInfoMuted, + StatusInfoMutedOnBgEmphasized, + StatusNegativeEmphasized, + StatusNegativeMuted, + StatusNegativeMutedOnBgEmphasized, + StatusNeutral, + StatusNeutralOnBgEmphasized, + StatusPositiveEmphasized, + StatusPositiveMuted, + StatusPositiveMutedOnBgEmphasized, + StatusWarningEmphasized, + StatusWarningMuted, + StatusWarningMutedOnBgEmphasized, + Tertiary, + } + + enum class Border { + BrandPrimary, + BrandPrimaryOnBgEmphasized, + Default, + DefaultOnBgEmphasized, + Emphasized, + EmphasizedOnBgEmphasized, + Focus, + FocusInset, + FocusInsetOnBgEmphasized, + FocusOnBgEmphasized, + OnBrandPrimary, + } + + enum class Brand { + AccentDefault, + AccentHigh, + AccentHighest, + AccentLowest, + InfoDefault, + InfoHighest, + InfoLowest, + NegativeDefault, + NegativeHigh, + NegativeHigher, + NegativeHighest, + NegativeLowest, + NeutralEmphasizedBlack, + NeutralEmphasizedHigh, + NeutralEmphasizedHigher, + NeutralEmphasizedHighest, + NeutralEmphasizedLow, + NeutralEmphasizedLower, + NeutralEmphasizedLowest, + NeutralEmphasizedMedium, + NeutralMutedHighest, + NeutralMutedLow, + NeutralMutedLower, + NeutralMutedLowest, + NeutralMutedMedium, + NeutralMutedWhite, + PositiveDefault, + PositiveHighest, + PositiveLowest, + PrimaryDefault, + PrimaryLow, + WarningDefault, + WarningHigh, + WarningHighest, + WarningLowest, + } + + enum class Content { + BrandPrimary, + BrandPrimaryOnBgEmphasized, + Default, + DefaultOnBgEmphasized, + Disabled, + DisabledOnBgEmphasized, + Muted, + MutedOnBgEmphasized, + OnActionDisabled, + OnActionDisabledOnBgEmphasized, + OnActionNegative, + OnActionPrimaryEnabled, + OnActionPrimaryEnabledOnBgEmphasized, + OnActionPrimaryFocus, + OnActionPrimaryFocusOnBgEmphasized, + OnActionPrimaryHover, + OnActionPrimaryHoverOnBgEmphasized, + OnActionPrimaryLoading, + OnActionPrimaryLoadingOnBgEmphasized, + OnActionPrimaryPressed, + OnActionPrimaryPressedOnBgEmphasized, + OnBrandPrimary, + OnStatusAccentEmphasized, + OnStatusAccentMuted, + OnStatusAccentMutedOnBgEmphasized, + OnStatusInfoEmphasized, + OnStatusInfoMuted, + OnStatusInfoMutedOnBgEmphasized, + OnStatusNegativeEmphasized, + OnStatusNegativeMuted, + OnStatusNegativeMutedOnBgEmphasized, + OnStatusPositiveEmphasized, + OnStatusPositiveMuted, + OnStatusPositiveMutedOnBgEmphasized, + OnStatusWarningEmphasized, + OnStatusWarningMuted, + OnStatusWarningMutedOnBgEmphasized, + StatusInfo, + StatusNegative, + StatusPositive, + StatusWarning, + } + + enum class Elevation { + Drag, + DragOnBgEmphasized, + DragOnBgSecondary, + Modal, + OverlayDefault, + OverlayDefaultOnBgEmphasized, + OverlayDefaultOnBgSecondary, + OverlayEmphasized, + OverlayEmphasizedOnBgEmphasized, + OverlayEmphasizedOnBgSecondary, + Raised, + RaisedOnBgEmphasized, + RaisedOnBgSecondary, + } + + enum class Gradient { + SkeletonMiddle, + SkeletonMiddleOnBgEmphasized, + SkeletonStartEnd, + SkeletonStartEndOnBgEmphasized, + } + + enum class Decorative { + Accent1Default, + Accent1Emphasized, + Accent1Muted, + Accent2Default, + Accent2Emphasized, + Accent2Muted, + Accent3Default, + Accent3Emphasized, + Accent3Muted, + Accent4Default, + Accent4Emphasized, + Accent4Muted, + Accent5Default, + Accent5Emphasized, + Accent5Muted, + BrandPrimary, + BrandSecondary, + BrandTertiary, + NeutralDefault, + NeutralEmphasized, + NeutralMuted, + SkinTint100, + SkinTint200, + SkinTint300, + SkinTint400, + SkinTint500, + SkinTint600, + SkinTint700, + SkinTint800, + SkinTint900, + } +} \ No newline at end of file diff --git a/theme-contract/src/main/java/com/orange/ouds/theme/tokens/OudsSizeKeyToken.kt b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/OudsSizeKeyToken.kt new file mode 100644 index 00000000..305de011 --- /dev/null +++ b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/OudsSizeKeyToken.kt @@ -0,0 +1,76 @@ +/* + * Software Name: OUDS Android + * SPDX-FileCopyrightText: Copyright (c) Orange SA + * SPDX-License-Identifier: MIT + * + * This software is distributed under the MIT license, + * the text of which is available at https://opensource.org/license/MIT/ + * or see the "LICENSE" file for more details. + * + * Software description: Android library of reusable graphical components + */ + +package com.orange.ouds.theme.tokens + +class OudsSizeKeyToken { + enum class IconDecorative { + Shortest, + Shorter, + Short, + Medium, + Tall, + Taller, + Tallest, + } + + enum class IconWithText { + HeadingExtraLargeSizeShort, + HeadingExtraLargeSizeMedium, + HeadingExtraLargeSizeTall, + HeadingLargeSizeShort, + HeadingLargeSizeMedium, + HeadingLargeSizeTall, + HeadingMediumSizeShort, + HeadingMediumSizeMedium, + HeadingMediumSizeTall, + HeadingSmallSizeShort, + HeadingSmallSizeMedium, + HeadingSmallSizeTall, + BodyLargeSizeShort, + BodyLargeSizeMedium, + BodyLargeSizeTall, + BodyMediumSizeShort, + BodyMediumSizeMedium, + BodyMediumSizeTall, + BodySmallSizeShort, + BodySmallSizeMedium, + BodySmallSizeTall, + LabelExtraLargeSizeShort, + LabelExtraLargeSizeMedium, + LabelExtraLargeSizeTall, + LabelLargeSizeShorter, + LabelLargeSizeShort, + LabelLargeSizeMedium, + LabelLargeSizeTall, + LabelLargeSizeTaller, + LabelMediumSizeShort, + LabelMediumSizeMedium, + LabelMediumSizeTall, + LabelSmallSizeShort, + LabelSmallSizeMedium, + LabelSmallSizeTall, + } + + enum class MaxWidthType { + DisplaySmall, + DisplayMedium, + DisplayLarge, + HeadingSmall, + HeadingMedium, + HeadingLarge, + HeadingExtraLarge, + BodySmall, + BodyMedium, + BodyLarge + } +} \ No newline at end of file diff --git a/theme-contract/src/main/java/com/orange/ouds/theme/tokens/OudsSizeKeyTokens.kt b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/OudsSizeKeyTokens.kt deleted file mode 100644 index a531a7fa..00000000 --- a/theme-contract/src/main/java/com/orange/ouds/theme/tokens/OudsSizeKeyTokens.kt +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Software Name: OUDS Android - * SPDX-FileCopyrightText: Copyright (c) Orange SA - * SPDX-License-Identifier: MIT - * - * This software is distributed under the MIT license, - * the text of which is available at https://opensource.org/license/MIT/ - * or see the "LICENSE" file for more details. - * - * Software description: Android library of reusable graphical components - */ - -package com.orange.ouds.theme.tokens - -enum class OudsSizeIconDecorativeKeyToken { - Shortest, - Shorter, - Short, - Medium, - Tall, - Taller, - Tallest, -} - -enum class OudsSizeIconWithTextKeyToken { - HeadingSmallSizeShort, - HeadingSmallSizeMedium, - HeadingSmallSizeTall, - HeadingMediumSizeShort, - HeadingMediumSizeMedium, - HeadingMediumSizeTall, - HeadingLargeSizeShort, - HeadingLargeSizeMedium, - HeadingLargeSizeTall, - HeadingExtraLargeSizeShort, - HeadingExtraLargeSizeMedium, - HeadingExtraLargeSizeTall, - LabelLargeSizeShorter, - LabelLargeSizeShort, - LabelLargeSizeMedium, - LabelLargeSizeTall, - LabelLargeSizeTaller, - LabelMediumSizeShort, - LabelMediumSizeMedium, - LabelMediumSizeTall, - LabelSmallSizeShort, - LabelSmallSizeMedium, - LabelSmallSizeTall, - LabelExtraLargeSizeShort, - LabelExtraLargeSizeMedium, - LabelExtraLargeSizeTall, - BodySmallSizeShort, - BodySmallSizeMedium, - BodySmallSizeTall, - BodyMediumSizeShort, - BodyMediumSizeMedium, - BodyMediumSizeTall, - BodyLargeSizeShort, - BodyLargeSizeMedium, - BodyLargeSizeTall, -} - -enum class OudsSizeMaxWidthTypeKeyToken { - DisplaySmall, - DisplayMedium, - DisplayLarge, - HeadingSmall, - HeadingMedium, - HeadingLarge, - HeadingExtraLarge, - BodySmall, - BodyMedium, - BodyLarge -} diff --git a/theme-contract/src/main/java/com/orange/ouds/theme/tokens/OudsSpaceKeyToken.kt b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/OudsSpaceKeyToken.kt new file mode 100644 index 00000000..7e4efd2b --- /dev/null +++ b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/OudsSpaceKeyToken.kt @@ -0,0 +1,135 @@ +/* + * Software Name: OUDS Android + * SPDX-FileCopyrightText: Copyright (c) Orange SA + * SPDX-License-Identifier: MIT + * + * This software is distributed under the MIT license, + * the text of which is available at https://opensource.org/license/MIT/ + * or see the "LICENSE" file for more details. + * + * Software description: Android library of reusable graphical components + */ + +package com.orange.ouds.theme.tokens + +class OudsSpaceKeyToken { + enum class Fixed { + None, + Smash, + Shortest, + Shorter, + Short, + Medium, + Tall, + Taller, + Tallest, + Spacious, + Huge, + Jumbo + } + + enum class Scaled { + None, + Smash, + Shortest, + Shorter, + Short, + Medium, + Tall, + Taller, + Tallest, + Spacious + } + + enum class PaddingInline { + None, + Shorter, + Short, + Medium, + Tall, + Taller, + Tallest, + WithIconNone, + WithIconShortest, + WithIconShorter, + WithIconShort, + WithIconMedium, + WithIconTall, + WithIconTaller, + WithIconTallest, + WithArrowNone, + WithArrowShortest, + WithArrowShorter, + WithArrowShort, + WithArrowMedium, + WithArrowTall, + WithArrowTaller, + WithArrowTallest, + } + + enum class PaddingBlock { + None, + Shorter, + Short, + Medium, + Tall, + Taller, + Tallest, + WithIconNone, + WithIconShortest, + WithIconShorter, + WithIconShort, + WithIconMedium, + WithIconTall, + WithIconTaller, + } + + enum class Inset { + None, + Smash, + Shortest, + Shorter, + Short, + Medium, + Tall, + Taller, + Tallest, + Spacious, + } + + enum class ColumnGap { + None, + Shorter, + Short, + Medium, + Tall, + Taller, + WithIconNone, + WithIconShortest, + WithIconShorter, + WithIconShort, + WithIconMedium, + WithIconTall, + WithArrowNone, + WithArrowShortest, + WithArrowShorter, + WithArrowShort, + WithArrowMedium, + WithArrowTall, + } + + enum class RowGap { + None, + Shortest, + Shorter, + Short, + Medium, + Tall, + WithIconNone, + WithIconShortest, + WithIconShorter, + WithIconShort, + WithIconMedium, + WithIconTall, + } +} \ No newline at end of file diff --git a/theme-contract/src/main/java/com/orange/ouds/theme/tokens/OudsSpacingKeyTokens.kt b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/OudsSpacingKeyTokens.kt deleted file mode 100644 index 505dd368..00000000 --- a/theme-contract/src/main/java/com/orange/ouds/theme/tokens/OudsSpacingKeyTokens.kt +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Software Name: OUDS Android - * SPDX-FileCopyrightText: Copyright (c) Orange SA - * SPDX-License-Identifier: MIT - * - * This software is distributed under the MIT license, - * the text of which is available at https://opensource.org/license/MIT/ - * or see the "LICENSE" file for more details. - * - * Software description: Android library of reusable graphical components - */ - -package com.orange.ouds.theme.tokens - -enum class OudsSpacingFixedKeyToken { - None, - Smash, - Shortest, - Shorter, - Short, - Medium, - Tall, - Taller, - Tallest, - Spacious, - Huge, - Jumbo -} - -enum class OudsSpacingScaledKeyToken { - None, - Smash, - Shortest, - Shorter, - Short, - Medium, - Tall, - Taller, - Tallest, - Spacious -} - -enum class OudsSpacingPaddingInlineKeyToken { - None, - Shorter, - Short, - Medium, - Tall, - Taller, - Tallest, - WithIconNone, - WithIconShortest, - WithIconShorter, - WithIconShort, - WithIconMedium, - WithIconTall, - WithIconTaller, - WithIconTallest, - WithArrowNone, - WithArrowShortest, - WithArrowShorter, - WithArrowShort, - WithArrowMedium, - WithArrowTall, - WithArrowTaller, - WithArrowTallest, -} - -enum class OudsSpacingPaddingBlockKeyToken { - None, - Shorter, - Short, - Medium, - Tall, - Taller, - Tallest, - WithIconNone, - WithIconShortest, - WithIconShorter, - WithIconShort, - WithIconMedium, - WithIconTall, - WithIconTaller, -} - -enum class OudsSpacingInsetKeyToken { - None, - Smash, - Shortest, - Shorter, - Short, - Medium, - Tall, - Taller, - Tallest, - Spacious, -} - -enum class OudsSpacingColumnGapKeyToken { - None, - Shorter, - Short, - Medium, - Tall, - Taller, - WithIconNone, - WithIconShortest, - WithIconShorter, - WithIconShort, - WithIconMedium, - WithIconTall, - WithArrowNone, - WithArrowShortest, - WithArrowShorter, - WithArrowShort, - WithArrowMedium, - WithArrowTall, -} - -enum class OudsSpacingRowGapKeyToken { - None, - Shortest, - Shorter, - Short, - Medium, - Tall, - WithIconNone, - WithIconShortest, - WithIconShorter, - WithIconShort, - WithIconMedium, - WithIconTall, -} \ No newline at end of file diff --git a/theme-contract/src/main/java/com/orange/ouds/theme/tokens/components/OudsButtonTokens.kt b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/components/OudsButtonTokens.kt index afc4d8bc..79d299d7 100644 --- a/theme-contract/src/main/java/com/orange/ouds/theme/tokens/components/OudsButtonTokens.kt +++ b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/components/OudsButtonTokens.kt @@ -13,16 +13,16 @@ package com.orange.ouds.theme.tokens.components import com.orange.ouds.theme.tokens.OudsBorderRadiusKeyToken +import com.orange.ouds.theme.tokens.OudsColorKeyToken import com.orange.ouds.theme.tokens.OudsElevationKeyToken -import com.orange.ouds.theme.tokens.OudsSpacingFixedKeyToken +import com.orange.ouds.theme.tokens.OudsSpaceKeyToken import com.orange.ouds.theme.tokens.OudsTypographyKeyToken -import com.orange.ouds.theme.tokens.semantic.OudsColorKeyToken open class OudsButtonTokens( - val containerColor: OudsColorKeyToken = OudsColorKeyToken.Primary, - val contentColor: OudsColorKeyToken = OudsColorKeyToken.OnPrimary, - val disabledContainerColor: OudsColorKeyToken = OudsColorKeyToken.Secondary, - val disabledContentColor: OudsColorKeyToken = OudsColorKeyToken.OnSecondary, + val containerColor: OudsColorKeyToken.Background = OudsColorKeyToken.Background.BrandPrimary, + val contentColor: OudsColorKeyToken.Content = OudsColorKeyToken.Content.BrandPrimary, + val disabledContainerColor: OudsColorKeyToken.Action = OudsColorKeyToken.Action.Disabled, + val disabledContentColor: OudsColorKeyToken.Content = OudsColorKeyToken.Content.Disabled, val cornerRadius: OudsBorderRadiusKeyToken = OudsBorderRadiusKeyToken.None, val defaultElevation: OudsElevationKeyToken = OudsElevationKeyToken.None, val pressedElevation: OudsElevationKeyToken = OudsElevationKeyToken.None, @@ -30,6 +30,6 @@ open class OudsButtonTokens( val hoveredElevation: OudsElevationKeyToken = OudsElevationKeyToken.None, val disabledElevation: OudsElevationKeyToken = OudsElevationKeyToken.None, val labelStyle: OudsTypographyKeyToken = OudsTypographyKeyToken.BodyStrongLarge, - val verticalContentPadding: OudsSpacingFixedKeyToken = OudsSpacingFixedKeyToken.Smash, - val horizontalContentPadding: OudsSpacingFixedKeyToken = OudsSpacingFixedKeyToken.Tall + val verticalContentPadding: OudsSpaceKeyToken.Fixed = OudsSpaceKeyToken.Fixed.Smash, + val horizontalContentPadding: OudsSpaceKeyToken.Fixed = OudsSpaceKeyToken.Fixed.Tall ) \ No newline at end of file diff --git a/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorActionSemanticTokens.kt b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorActionSemanticTokens.kt new file mode 100644 index 00000000..adc6ce19 --- /dev/null +++ b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorActionSemanticTokens.kt @@ -0,0 +1,82 @@ +/* + * Software Name: OUDS Android + * SPDX-FileCopyrightText: Copyright (c) Orange SA + * SPDX-License-Identifier: MIT + * + * This software is distributed under the MIT license, + * the text of which is available at https://opensource.org/license/MIT/ + * or see the "LICENSE" file for more details. + * + * Software description: Android library of reusable graphical components + */ + +package com.orange.ouds.theme.tokens.semantic + +import androidx.compose.ui.graphics.Color +import com.orange.ouds.tokens.global.raw.ColorRawTokens +import com.orange.ouds.tokens.global.raw.OrangeBrandColorRawTokens + +data class OudsColorActionSemanticTokens( + val actionDisabledLight: Color = ColorRawTokens.colorFunctionalLightGray400, + val actionDisabledOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalDarkGray400, + val actionNegativeEnabledLight: Color = ColorRawTokens.colorFunctionalScarlet600, + val actionNegativeFocusLight: Color = ColorRawTokens.colorFunctionalScarlet700, + val actionNegativeHoverLight: Color = ColorRawTokens.colorFunctionalScarlet700, + val actionNegativeLoadingLight: Color = ColorRawTokens.colorFunctionalScarlet800, + val actionNegativePressedLight: Color = ColorRawTokens.colorFunctionalScarlet800, + val actionPrimaryEnabledLight: Color = ColorRawTokens.colorFunctionalBlack, + val actionPrimaryEnabledOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalLightGray160, + val actionPrimaryFocusLight: Color = ColorRawTokens.colorFunctionalDarkGray400, + val actionPrimaryFocusOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalLightGray560, + val actionPrimaryHoverLight: Color = ColorRawTokens.colorFunctionalDarkGray400, + val actionPrimaryHoverOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalLightGray560, + val actionPrimaryLoadingLight: Color = OrangeBrandColorRawTokens.colorOrange550, + val actionPrimaryLoadingOnBgEmphasizedLight: Color = OrangeBrandColorRawTokens.colorOrange500, + val actionPrimaryPressedLight: Color = OrangeBrandColorRawTokens.colorOrange550, + val actionPrimaryPressedOnBgEmphasizedLight: Color = OrangeBrandColorRawTokens.colorOrange500, + val actionSecondaryEnabledLight: Color = ColorRawTokens.colorFunctionalLightGray80, + val actionSecondaryEnabledOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalDarkGray720, + val actionSecondaryFocusLight: Color = ColorRawTokens.colorFunctionalLightGray160, + val actionSecondaryFocusOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalDarkGray640, + val actionSecondaryHoverLight: Color = ColorRawTokens.colorFunctionalLightGray160, + val actionSecondaryHoverOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalDarkGray640, + val actionSecondaryLoadingLight: Color = ColorRawTokens.colorFunctionalLightGray160, + val actionSecondaryLoadingOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalDarkGray640, + val actionSecondaryPressedLight: Color = ColorRawTokens.colorFunctionalLightGray160, + val actionSecondaryPressedOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalDarkGray640, + val actionSelectedLight: Color = OrangeBrandColorRawTokens.colorOrange550, + val actionSelectedOnBgEmphasizedLight: Color = OrangeBrandColorRawTokens.colorOrange500, + val actionVisitedLight: Color = ColorRawTokens.colorDecorativeAmethyst600, + val actionVisitedOnBgEmphasizedLight: Color = ColorRawTokens.colorDecorativeAmethyst400, + val actionDisabledDark: Color = ColorRawTokens.colorFunctionalDarkGray400, + val actionDisabledOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalDarkGray400, + val actionNegativeEnabledDark: Color = ColorRawTokens.colorFunctionalScarlet600, + val actionNegativeFocusDark: Color = ColorRawTokens.colorFunctionalScarlet700, + val actionNegativeHoverDark: Color = ColorRawTokens.colorFunctionalScarlet700, + val actionNegativeLoadingDark: Color = ColorRawTokens.colorFunctionalScarlet800, + val actionNegativePressedDark: Color = ColorRawTokens.colorFunctionalScarlet800, + val actionPrimaryEnabledDark: Color = ColorRawTokens.colorFunctionalLightGray160, + val actionPrimaryEnabledOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalLightGray160, + val actionPrimaryFocusDark: Color = ColorRawTokens.colorFunctionalLightGray560, + val actionPrimaryFocusOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalLightGray560, + val actionPrimaryHoverDark: Color = ColorRawTokens.colorFunctionalLightGray560, + val actionPrimaryHoverOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalLightGray560, + val actionPrimaryLoadingDark: Color = OrangeBrandColorRawTokens.colorOrange500, + val actionPrimaryLoadingOnBgEmphasizedDark: Color = OrangeBrandColorRawTokens.colorOrange500, + val actionPrimaryPressedDark: Color = OrangeBrandColorRawTokens.colorOrange500, + val actionPrimaryPressedOnBgEmphasizedDark: Color = OrangeBrandColorRawTokens.colorOrange500, + val actionSecondaryEnabledDark: Color = ColorRawTokens.colorFunctionalDarkGray720, + val actionSecondaryEnabledOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalDarkGray720, + val actionSecondaryFocusDark: Color = ColorRawTokens.colorFunctionalDarkGray640, + val actionSecondaryFocusOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalDarkGray640, + val actionSecondaryHoverDark: Color = ColorRawTokens.colorFunctionalDarkGray640, + val actionSecondaryHoverOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalDarkGray640, + val actionSecondaryLoadingDark: Color = ColorRawTokens.colorFunctionalDarkGray640, + val actionSecondaryLoadingOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalDarkGray640, + val actionSecondaryPressedDark: Color = ColorRawTokens.colorFunctionalDarkGray640, + val actionSecondaryPressedOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalDarkGray640, + val actionSelectedDark: Color = OrangeBrandColorRawTokens.colorOrange500, + val actionSelectedOnBgEmphasizedDark: Color = OrangeBrandColorRawTokens.colorOrange500, + val actionVisitedDark: Color = ColorRawTokens.colorDecorativeAmethyst400, + val actionVisitedOnBgEmphasizedDark: Color = ColorRawTokens.colorDecorativeAmethyst400, +) \ No newline at end of file diff --git a/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorAlwaysSemanticTokens.kt b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorAlwaysSemanticTokens.kt new file mode 100644 index 00000000..7685d943 --- /dev/null +++ b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorAlwaysSemanticTokens.kt @@ -0,0 +1,47 @@ +/* + * Software Name: OUDS Android + * SPDX-FileCopyrightText: Copyright (c) Orange SA + * SPDX-License-Identifier: MIT + * + * This software is distributed under the MIT license, + * the text of which is available at https://opensource.org/license/MIT/ + * or see the "LICENSE" file for more details. + * + * Software description: Android library of reusable graphical components + */ + +package com.orange.ouds.theme.tokens.semantic + +import androidx.compose.ui.graphics.Color +import com.orange.ouds.tokens.global.raw.ColorRawTokens + +data class OudsColorAlwaysSemanticTokens( + val alwaysAccentLight: Color = ColorRawTokens.colorFunctionalSun500, + val alwaysBlackLight: Color = ColorRawTokens.colorFunctionalBlack, + val alwaysInfoLight: Color = ColorRawTokens.colorFunctionalDodgerBlue500, + val alwaysNegativeLight: Color = ColorRawTokens.colorFunctionalScarlet600, + val alwaysOnAccentLight: Color = ColorRawTokens.colorFunctionalBlack, + val alwaysOnBlackLight: Color = ColorRawTokens.colorFunctionalWhite, + val alwaysOnInfoLight: Color = ColorRawTokens.colorFunctionalBlack, + val alwaysOnNegativeLight: Color = ColorRawTokens.colorFunctionalWhite, + val alwaysOnPositiveLight: Color = ColorRawTokens.colorFunctionalBlack, + val alwaysOnWarningLight: Color = ColorRawTokens.colorFunctionalBlack, + val alwaysOnWhiteLight: Color = ColorRawTokens.colorFunctionalBlack, + val alwaysPositiveLight: Color = ColorRawTokens.colorFunctionalMalachite500, + val alwaysWarningLight: Color = ColorRawTokens.colorFunctionalSun500, + val alwaysWhiteLight: Color = ColorRawTokens.colorFunctionalWhite, + val alwaysAccentDark: Color = ColorRawTokens.colorFunctionalSun500, + val alwaysBlackDark: Color = ColorRawTokens.colorFunctionalBlack, + val alwaysInfoDark: Color = ColorRawTokens.colorFunctionalDodgerBlue500, + val alwaysNegativeDark: Color = ColorRawTokens.colorFunctionalScarlet600, + val alwaysOnAccentDark: Color = ColorRawTokens.colorFunctionalDarkGray880, + val alwaysOnBlackDark: Color = ColorRawTokens.colorFunctionalLightGray160, + val alwaysOnInfoDark: Color = ColorRawTokens.colorFunctionalDarkGray880, + val alwaysOnNegativeDark: Color = ColorRawTokens.colorFunctionalLightGray160, + val alwaysOnPositiveDark: Color = ColorRawTokens.colorFunctionalDarkGray880, + val alwaysOnWarningDark: Color = ColorRawTokens.colorFunctionalDarkGray880, + val alwaysOnWhiteDark: Color = ColorRawTokens.colorFunctionalDarkGray880, + val alwaysPositiveDark: Color = ColorRawTokens.colorFunctionalMalachite500, + val alwaysWarningDark: Color = ColorRawTokens.colorFunctionalSun500, + val alwaysWhiteDark: Color = ColorRawTokens.colorFunctionalWhite, +) diff --git a/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorBgSemanticTokens.kt b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorBgSemanticTokens.kt new file mode 100644 index 00000000..79e822d1 --- /dev/null +++ b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorBgSemanticTokens.kt @@ -0,0 +1,64 @@ +/* + * Software Name: OUDS Android + * SPDX-FileCopyrightText: Copyright (c) Orange SA + * SPDX-License-Identifier: MIT + * + * This software is distributed under the MIT license, + * the text of which is available at https://opensource.org/license/MIT/ + * or see the "LICENSE" file for more details. + * + * Software description: Android library of reusable graphical components + */ + +package com.orange.ouds.theme.tokens.semantic + +import androidx.compose.ui.graphics.Color +import com.orange.ouds.tokens.global.raw.ColorRawTokens +import com.orange.ouds.tokens.global.raw.OrangeBrandColorRawTokens + +data class OudsColorBgSemanticTokens( + val bgBrandPrimaryLight: Color = OrangeBrandColorRawTokens.colorOrange550, + val bgEmphasizedLight: Color = ColorRawTokens.colorFunctionalDarkGray880, + val bgPrimaryLight: Color = ColorRawTokens.colorFunctionalWhite, + val bgSecondaryLight: Color = ColorRawTokens.colorFunctionalLightGray80, + val bgStatusAccentEmphasizedLight: Color = ColorRawTokens.colorFunctionalSun500, + val bgStatusAccentMutedLight: Color = OrangeBrandColorRawTokens.colorWarmGray100, + val bgStatusAccentMutedOnBgEmphasizedLight: Color = OrangeBrandColorRawTokens.colorWarmGray900, + val bgStatusInfoEmphasizedLight: Color = ColorRawTokens.colorFunctionalDodgerBlue500, + val bgStatusInfoMutedLight: Color = ColorRawTokens.colorFunctionalDodgerBlue100, + val bgStatusInfoMutedOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalDodgerBlue900, + val bgStatusNegativeEmphasizedLight: Color = ColorRawTokens.colorFunctionalScarlet600, + val bgStatusNegativeMutedLight: Color = ColorRawTokens.colorFunctionalScarlet100, + val bgStatusNegativeMutedOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalScarlet900, + val bgStatusNeutralLight: Color = ColorRawTokens.colorFunctionalLightGray80, + val bgStatusNeutralOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalDarkGray720, + val bgStatusPositiveEmphasizedLight: Color = ColorRawTokens.colorFunctionalMalachite500, + val bgStatusPositiveMutedLight: Color = ColorRawTokens.colorFunctionalMalachite100, + val bgStatusPositiveMutedOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalMalachite900, + val bgStatusWarningEmphasizedLight: Color = ColorRawTokens.colorFunctionalSun500, + val bgStatusWarningMutedLight: Color = ColorRawTokens.colorFunctionalSun100, + val bgStatusWarningMutedOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalSun900, + val bgTertiaryLight: Color = OrangeBrandColorRawTokens.colorWarmGray100, + val bgBrandPrimaryDark: Color = OrangeBrandColorRawTokens.colorOrange500, + val bgEmphasizedDark: Color = ColorRawTokens.colorFunctionalDarkGray640, + val bgPrimaryDark: Color = ColorRawTokens.colorFunctionalDarkGray880, + val bgSecondaryDark: Color = ColorRawTokens.colorFunctionalDarkGray800, + val bgStatusAccentEmphasizedDark: Color = ColorRawTokens.colorFunctionalSun500, + val bgStatusAccentMutedDark: Color = OrangeBrandColorRawTokens.colorWarmGray900, + val bgStatusAccentMutedOnBgEmphasizedDark: Color = OrangeBrandColorRawTokens.colorWarmGray900, + val bgStatusInfoEmphasizedDark: Color = ColorRawTokens.colorFunctionalDodgerBlue500, + val bgStatusInfoMutedDark: Color = ColorRawTokens.colorFunctionalDodgerBlue900, + val bgStatusInfoMutedOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalDodgerBlue900, + val bgStatusNegativeEmphasizedDark: Color = ColorRawTokens.colorFunctionalScarlet600, + val bgStatusNegativeMutedDark: Color = ColorRawTokens.colorFunctionalScarlet900, + val bgStatusNegativeMutedOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalScarlet900, + val bgStatusNeutralDark: Color = ColorRawTokens.colorFunctionalDarkGray720, + val bgStatusNeutralOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalDarkGray720, + val bgStatusPositiveEmphasizedDark: Color = ColorRawTokens.colorFunctionalMalachite500, + val bgStatusPositiveMutedDark: Color = ColorRawTokens.colorFunctionalMalachite900, + val bgStatusPositiveMutedOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalMalachite900, + val bgStatusWarningEmphasizedDark: Color = ColorRawTokens.colorFunctionalSun500, + val bgStatusWarningMutedDark: Color = ColorRawTokens.colorFunctionalSun900, + val bgStatusWarningMutedOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalSun900, + val bgTertiaryDark: Color = OrangeBrandColorRawTokens.colorWarmGray900, +) \ No newline at end of file diff --git a/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorBorderSemanticTokens.kt b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorBorderSemanticTokens.kt new file mode 100644 index 00000000..c731f7b8 --- /dev/null +++ b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorBorderSemanticTokens.kt @@ -0,0 +1,42 @@ +/* + * Software Name: OUDS Android + * SPDX-FileCopyrightText: Copyright (c) Orange SA + * SPDX-License-Identifier: MIT + * + * This software is distributed under the MIT license, + * the text of which is available at https://opensource.org/license/MIT/ + * or see the "LICENSE" file for more details. + * + * Software description: Android library of reusable graphical components + */ + +package com.orange.ouds.theme.tokens.semantic + +import androidx.compose.ui.graphics.Color +import com.orange.ouds.tokens.global.raw.ColorRawTokens +import com.orange.ouds.tokens.global.raw.OrangeBrandColorRawTokens + +data class OudsColorBorderSemanticTokens( + val borderBrandPrimaryLight: Color = OrangeBrandColorRawTokens.colorOrange550, + val borderBrandPrimaryOnBgEmphasizedLight: Color = OrangeBrandColorRawTokens.colorOrange500, + val borderDefaultLight: Color = ColorRawTokens.colorFunctionalLightGray400, + val borderDefaultOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalDarkGray400, + val borderEmphasizedLight: Color = ColorRawTokens.colorFunctionalBlack, + val borderEmphasizedOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalLightGray160, + val borderFocusLight: Color = ColorRawTokens.colorFunctionalBlack, + val borderFocusInsetLight: Color = ColorRawTokens.colorFunctionalWhite, + val borderFocusInsetOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalDarkGray880, + val borderFocusOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalLightGray160, + val borderOnBrandPrimaryLight: Color = ColorRawTokens.colorFunctionalWhite, + val borderBrandPrimaryDark: Color = OrangeBrandColorRawTokens.colorOrange500, + val borderBrandPrimaryOnBgEmphasizedDark: Color = OrangeBrandColorRawTokens.colorOrange500, + val borderDefaultDark: Color = ColorRawTokens.colorFunctionalDarkGray400, + val borderDefaultOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalDarkGray400, + val borderEmphasizedDark: Color = ColorRawTokens.colorFunctionalLightGray160, + val borderEmphasizedOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalLightGray160, + val borderFocusDark: Color = ColorRawTokens.colorFunctionalLightGray160, + val borderFocusInsetDark: Color = ColorRawTokens.colorFunctionalDarkGray880, + val borderFocusInsetOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalLightGray160, + val borderFocusOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalDarkGray880, + val borderOnBrandPrimaryDark: Color = ColorRawTokens.colorFunctionalBlack, +) diff --git a/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorBrandSemanticTokens.kt b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorBrandSemanticTokens.kt new file mode 100644 index 00000000..fa091c93 --- /dev/null +++ b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorBrandSemanticTokens.kt @@ -0,0 +1,90 @@ +/* + * Software Name: OUDS Android + * SPDX-FileCopyrightText: Copyright (c) Orange SA + * SPDX-License-Identifier: MIT + * + * This software is distributed under the MIT license, + * the text of which is available at https://opensource.org/license/MIT/ + * or see the "LICENSE" file for more details. + * + * Software description: Android library of reusable graphical components + */ + +package com.orange.ouds.theme.tokens.semantic + +import androidx.compose.ui.graphics.Color +import com.orange.ouds.tokens.global.raw.ColorRawTokens +import com.orange.ouds.tokens.global.raw.OrangeBrandColorRawTokens + +data class OudsColorBrandSemanticTokens( + val brandAccentDefaultLight: Color = ColorRawTokens.colorFunctionalSun500, + val brandAccentHighLight: Color = ColorRawTokens.colorFunctionalSun600, + val brandAccentHighestLight: Color = OrangeBrandColorRawTokens.colorWarmGray900, + val brandAccentLowestLight: Color = OrangeBrandColorRawTokens.colorWarmGray100, + val brandInfoDefaultLight: Color = ColorRawTokens.colorFunctionalDodgerBlue500, + val brandInfoHighestLight: Color = ColorRawTokens.colorFunctionalDodgerBlue900, + val brandInfoLowestLight: Color = ColorRawTokens.colorFunctionalDodgerBlue100, + val brandNegativeDefaultLight: Color = ColorRawTokens.colorFunctionalScarlet600, + val brandNegativeHighLight: Color = ColorRawTokens.colorFunctionalScarlet700, + val brandNegativeHigherLight: Color = ColorRawTokens.colorFunctionalScarlet800, + val brandNegativeHighestLight: Color = ColorRawTokens.colorFunctionalScarlet900, + val brandNegativeLowestLight: Color = ColorRawTokens.colorFunctionalScarlet100, + val brandNeutralEmphasizedBlackLight: Color = ColorRawTokens.colorFunctionalBlack, + val brandNeutralEmphasizedHighLight: Color = ColorRawTokens.colorFunctionalDarkGray720, + val brandNeutralEmphasizedHigherLight: Color = ColorRawTokens.colorFunctionalDarkGray800, + val brandNeutralEmphasizedHighestLight: Color = ColorRawTokens.colorFunctionalDarkGray880, + val brandNeutralEmphasizedLowLight: Color = ColorRawTokens.colorFunctionalDarkGray560, + val brandNeutralEmphasizedLowerLight: Color = ColorRawTokens.colorFunctionalDarkGray480, + val brandNeutralEmphasizedLowestLight: Color = ColorRawTokens.colorFunctionalDarkGray400, + val brandNeutralEmphasizedMediumLight: Color = ColorRawTokens.colorFunctionalDarkGray640, + val brandNeutralMutedHighestLight: Color = ColorRawTokens.colorFunctionalDarkGray160, + val brandNeutralMutedLowLight: Color = ColorRawTokens.colorFunctionalLightGray400, + val brandNeutralMutedLowerLight: Color = ColorRawTokens.colorFunctionalLightGray160, + val brandNeutralMutedLowestLight: Color = ColorRawTokens.colorFunctionalLightGray80, + val brandNeutralMutedMediumLight: Color = ColorRawTokens.colorFunctionalLightGray560, + val brandNeutralMutedWhiteLight: Color = ColorRawTokens.colorFunctionalWhite, + val brandPositiveDefaultLight: Color = ColorRawTokens.colorFunctionalMalachite500, + val brandPositiveHighestLight: Color = ColorRawTokens.colorFunctionalMalachite900, + val brandPositiveLowestLight: Color = ColorRawTokens.colorFunctionalMalachite100, + val brandPrimaryDefaultLight: Color = OrangeBrandColorRawTokens.colorOrange550, + val brandPrimaryLowLight: Color = OrangeBrandColorRawTokens.colorOrange500, + val brandWarningDefaultLight: Color = ColorRawTokens.colorFunctionalSun500, + val brandWarningHighLight: Color = ColorRawTokens.colorFunctionalSun600, + val brandWarningHighestLight: Color = ColorRawTokens.colorFunctionalSun900, + val brandWarningLowestLight: Color = ColorRawTokens.colorFunctionalSun100, + val brandAccentDefaultDark: Color = ColorRawTokens.colorFunctionalSun500, + val brandAccentHighDark: Color = ColorRawTokens.colorFunctionalSun600, + val brandAccentHighestDark: Color = OrangeBrandColorRawTokens.colorWarmGray900, + val brandAccentLowestDark: Color = OrangeBrandColorRawTokens.colorWarmGray100, + val brandInfoDefaultDark: Color = ColorRawTokens.colorFunctionalDodgerBlue500, + val brandInfoHighestDark: Color = ColorRawTokens.colorFunctionalDodgerBlue900, + val brandInfoLowestDark: Color = ColorRawTokens.colorFunctionalDodgerBlue100, + val brandNegativeDefaultDark: Color = ColorRawTokens.colorFunctionalScarlet600, + val brandNegativeHighDark: Color = ColorRawTokens.colorFunctionalScarlet700, + val brandNegativeHigherDark: Color = ColorRawTokens.colorFunctionalScarlet800, + val brandNegativeHighestDark: Color = ColorRawTokens.colorFunctionalScarlet900, + val brandNegativeLowestDark: Color = ColorRawTokens.colorFunctionalScarlet100, + val brandNeutralEmphasizedBlackDark: Color = ColorRawTokens.colorFunctionalBlack, + val brandNeutralEmphasizedHighDark: Color = ColorRawTokens.colorFunctionalDarkGray720, + val brandNeutralEmphasizedHigherDark: Color = ColorRawTokens.colorFunctionalDarkGray800, + val brandNeutralEmphasizedHighestDark: Color = ColorRawTokens.colorFunctionalDarkGray880, + val brandNeutralEmphasizedLowDark: Color = ColorRawTokens.colorFunctionalDarkGray560, + val brandNeutralEmphasizedLowerDark: Color = ColorRawTokens.colorFunctionalDarkGray480, + val brandNeutralEmphasizedLowestDark: Color = ColorRawTokens.colorFunctionalDarkGray400, + val brandNeutralEmphasizedMediumDark: Color = ColorRawTokens.colorFunctionalDarkGray640, + val brandNeutralMutedHighestDark: Color = ColorRawTokens.colorFunctionalDarkGray160, + val brandNeutralMutedLowDark: Color = ColorRawTokens.colorFunctionalLightGray400, + val brandNeutralMutedLowerDark: Color = ColorRawTokens.colorFunctionalLightGray160, + val brandNeutralMutedLowestDark: Color = ColorRawTokens.colorFunctionalLightGray80, + val brandNeutralMutedMediumDark: Color = ColorRawTokens.colorFunctionalLightGray560, + val brandNeutralMutedWhiteDark: Color = ColorRawTokens.colorFunctionalWhite, + val brandPositiveDefaultDark: Color = ColorRawTokens.colorFunctionalMalachite500, + val brandPositiveHighestDark: Color = ColorRawTokens.colorFunctionalMalachite900, + val brandPositiveLowestDark: Color = ColorRawTokens.colorFunctionalMalachite100, + val brandPrimaryDefaultDark: Color = OrangeBrandColorRawTokens.colorOrange550, + val brandPrimaryLowDark: Color = OrangeBrandColorRawTokens.colorOrange500, + val brandWarningDefaultDark: Color = ColorRawTokens.colorFunctionalSun500, + val brandWarningHighDark: Color = ColorRawTokens.colorFunctionalSun600, + val brandWarningHighestDark: Color = ColorRawTokens.colorFunctionalSun900, + val brandWarningLowestDark: Color = ColorRawTokens.colorFunctionalSun100, +) \ No newline at end of file diff --git a/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorContentSemanticTokens.kt b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorContentSemanticTokens.kt new file mode 100644 index 00000000..90a63b27 --- /dev/null +++ b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorContentSemanticTokens.kt @@ -0,0 +1,102 @@ +/* + * Software Name: OUDS Android + * SPDX-FileCopyrightText: Copyright (c) Orange SA + * SPDX-License-Identifier: MIT + * + * This software is distributed under the MIT license, + * the text of which is available at https://opensource.org/license/MIT/ + * or see the "LICENSE" file for more details. + * + * Software description: Android library of reusable graphical components + */ + +package com.orange.ouds.theme.tokens.semantic + +import androidx.compose.ui.graphics.Color +import com.orange.ouds.tokens.global.raw.ColorRawTokens +import com.orange.ouds.tokens.global.raw.OrangeBrandColorRawTokens + +data class OudsColorContentSemanticTokens( + val contentBrandPrimaryLight: Color = OrangeBrandColorRawTokens.colorOrange550, + val contentBrandPrimaryOnBgEmphasizedLight: Color = OrangeBrandColorRawTokens.colorOrange500, + val contentDefaultLight: Color = ColorRawTokens.colorFunctionalBlack, + val contentDefaultOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalLightGray160, + val contentDisabledLight: Color = ColorRawTokens.colorFunctionalLightGray400, + val contentDisabledOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalDarkGray400, + val contentMutedLight: Color = ColorRawTokens.colorFunctionalDarkGray400, + val contentMutedOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalLightGray560, + val contentOnActionDisabledLight: Color = ColorRawTokens.colorFunctionalWhite, + val contentOnActionDisabledOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalBlack, + val contentOnActionNegativeLight: Color = ColorRawTokens.colorFunctionalWhite, + val contentOnActionPrimaryEnabledLight: Color = ColorRawTokens.colorFunctionalWhite, + val contentOnActionPrimaryEnabledOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalBlack, + val contentOnActionPrimaryFocusLight: Color = ColorRawTokens.colorFunctionalWhite, + val contentOnActionPrimaryFocusOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalBlack, + val contentOnActionPrimaryHoverLight: Color = ColorRawTokens.colorFunctionalWhite, + val contentOnActionPrimaryHoverOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalBlack, + val contentOnActionPrimaryLoadingLight: Color = ColorRawTokens.colorFunctionalWhite, + val contentOnActionPrimaryLoadingOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalBlack, + val contentOnActionPrimaryPressedLight: Color = ColorRawTokens.colorFunctionalWhite, + val contentOnActionPrimaryPressedOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalBlack, + val contentOnBrandPrimaryLight: Color = ColorRawTokens.colorFunctionalWhite, + val contentOnStatusAccentEmphasizedLight: Color = ColorRawTokens.colorFunctionalBlack, + val contentOnStatusAccentMutedLight: Color = ColorRawTokens.colorFunctionalBlack, + val contentOnStatusAccentMutedOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalLightGray160, + val contentOnStatusInfoEmphasizedLight: Color = ColorRawTokens.colorFunctionalBlack, + val contentOnStatusInfoMutedLight: Color = ColorRawTokens.colorFunctionalBlack, + val contentOnStatusInfoMutedOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalLightGray160, + val contentOnStatusNegativeEmphasizedLight: Color = ColorRawTokens.colorFunctionalWhite, + val contentOnStatusNegativeMutedLight: Color = ColorRawTokens.colorFunctionalBlack, + val contentOnStatusNegativeMutedOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalLightGray160, + val contentOnStatusPositiveEmphasizedLight: Color = ColorRawTokens.colorFunctionalBlack, + val contentOnStatusPositiveMutedLight: Color = ColorRawTokens.colorFunctionalBlack, + val contentOnStatusPositiveMutedOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalLightGray160, + val contentOnStatusWarningEmphasizedLight: Color = ColorRawTokens.colorFunctionalBlack, + val contentOnStatusWarningMutedLight: Color = ColorRawTokens.colorFunctionalBlack, + val contentOnStatusWarningMutedOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalLightGray160, + val contentStatusInfoLight: Color = ColorRawTokens.colorFunctionalDodgerBlue500, + val contentStatusNegativeLight: Color = ColorRawTokens.colorFunctionalScarlet600, + val contentStatusPositiveLight: Color = ColorRawTokens.colorFunctionalMalachite500, + val contentStatusWarningLight: Color = ColorRawTokens.colorFunctionalSun500, + val contentBrandPrimaryDark: Color = OrangeBrandColorRawTokens.colorOrange500, + val contentBrandPrimaryOnBgEmphasizedDark: Color = OrangeBrandColorRawTokens.colorOrange500, + val contentDefaultDark: Color = ColorRawTokens.colorFunctionalLightGray160, + val contentDefaultOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalLightGray160, + val contentDisabledDark: Color = ColorRawTokens.colorFunctionalDarkGray400, + val contentDisabledOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalDarkGray400, + val contentMutedDark: Color = ColorRawTokens.colorFunctionalLightGray560, + val contentMutedOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalLightGray560, + val contentOnActionDisabledDark: Color = ColorRawTokens.colorFunctionalBlack, + val contentOnActionDisabledOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalBlack, + val contentOnActionNegativeDark: Color = ColorRawTokens.colorFunctionalWhite, + val contentOnActionPrimaryEnabledDark: Color = ColorRawTokens.colorFunctionalBlack, + val contentOnActionPrimaryEnabledOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalBlack, + val contentOnActionPrimaryFocusDark: Color = ColorRawTokens.colorFunctionalBlack, + val contentOnActionPrimaryFocusOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalBlack, + val contentOnActionPrimaryHoverDark: Color = ColorRawTokens.colorFunctionalBlack, + val contentOnActionPrimaryHoverOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalBlack, + val contentOnActionPrimaryLoadingDark: Color = ColorRawTokens.colorFunctionalBlack, + val contentOnActionPrimaryLoadingOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalBlack, + val contentOnActionPrimaryPressedDark: Color = ColorRawTokens.colorFunctionalBlack, + val contentOnActionPrimaryPressedOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalBlack, + val contentOnBrandPrimaryDark: Color = ColorRawTokens.colorFunctionalBlack, + val contentOnStatusAccentEmphasizedDark: Color = ColorRawTokens.colorFunctionalBlack, + val contentOnStatusAccentMutedDark: Color = ColorRawTokens.colorFunctionalLightGray160, + val contentOnStatusAccentMutedOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalLightGray160, + val contentOnStatusInfoEmphasizedDark: Color = ColorRawTokens.colorFunctionalBlack, + val contentOnStatusInfoMutedDark: Color = ColorRawTokens.colorFunctionalLightGray160, + val contentOnStatusInfoMutedOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalLightGray160, + val contentOnStatusNegativeEmphasizedDark: Color = ColorRawTokens.colorFunctionalWhite, + val contentOnStatusNegativeMutedDark: Color = ColorRawTokens.colorFunctionalLightGray160, + val contentOnStatusNegativeMutedOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalLightGray160, + val contentOnStatusPositiveEmphasizedDark: Color = ColorRawTokens.colorFunctionalBlack, + val contentOnStatusPositiveMutedDark: Color = ColorRawTokens.colorFunctionalLightGray160, + val contentOnStatusPositiveMutedOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalLightGray160, + val contentOnStatusWarningEmphasizedDark: Color = ColorRawTokens.colorFunctionalBlack, + val contentOnStatusWarningMutedDark: Color = ColorRawTokens.colorFunctionalLightGray160, + val contentOnStatusWarningMutedOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalLightGray160, + val contentStatusInfoDark: Color = ColorRawTokens.colorFunctionalDodgerBlue500, + val contentStatusNegativeDark: Color = ColorRawTokens.colorFunctionalScarlet600, + val contentStatusPositiveDark: Color = ColorRawTokens.colorFunctionalMalachite500, + val contentStatusWarningDark: Color = ColorRawTokens.colorFunctionalSun500, +) \ No newline at end of file diff --git a/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorDecorativeSemanticTokens.kt b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorDecorativeSemanticTokens.kt new file mode 100644 index 00000000..4eb09ff3 --- /dev/null +++ b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorDecorativeSemanticTokens.kt @@ -0,0 +1,80 @@ +/* + * Software Name: OUDS Android + * SPDX-FileCopyrightText: Copyright (c) Orange SA + * SPDX-License-Identifier: MIT + * + * This software is distributed under the MIT license, + * the text of which is available at https://opensource.org/license/MIT/ + * or see the "LICENSE" file for more details. + * + * Software description: Android library of reusable graphical components + */ + +package com.orange.ouds.theme.tokens.semantic + +import androidx.compose.ui.graphics.Color +import com.orange.ouds.tokens.global.raw.ColorRawTokens +import com.orange.ouds.tokens.global.raw.OrangeBrandColorRawTokens + +data class OudsColorDecorativeSemanticTokens( + val decorativeAccent1DefaultLight: Color = ColorRawTokens.colorDecorativeEmerald500, + val decorativeAccent1EmphasizedLight: Color = ColorRawTokens.colorDecorativeEmerald700, + val decorativeAccent1MutedLight: Color = ColorRawTokens.colorDecorativeEmerald200, + val decorativeAccent2DefaultLight: Color = ColorRawTokens.colorDecorativeSky400, + val decorativeAccent2EmphasizedLight: Color = ColorRawTokens.colorDecorativeSky700, + val decorativeAccent2MutedLight: Color = ColorRawTokens.colorDecorativeSky200, + val decorativeAccent3DefaultLight: Color = ColorRawTokens.colorFunctionalSun500, + val decorativeAccent3EmphasizedLight: Color = ColorRawTokens.colorDecorativeAmber500, + val decorativeAccent3MutedLight: Color = ColorRawTokens.colorFunctionalSun200, + val decorativeAccent4DefaultLight: Color = ColorRawTokens.colorDecorativeAmethyst400, + val decorativeAccent4EmphasizedLight: Color = ColorRawTokens.colorDecorativeAmethyst800, + val decorativeAccent4MutedLight: Color = ColorRawTokens.colorDecorativeAmethyst200, + val decorativeAccent5DefaultLight: Color = ColorRawTokens.colorDecorativeShockingPink200, + val decorativeAccent5EmphasizedLight: Color = ColorRawTokens.colorDecorativeShockingPink300, + val decorativeAccent5MutedLight: Color = ColorRawTokens.colorDecorativeShockingPink100, + val decorativeBrandPrimaryLight: Color = OrangeBrandColorRawTokens.colorOrange500, + val decorativeBrandSecondaryLight: Color = ColorRawTokens.colorFunctionalBlack, + val decorativeBrandTertiaryLight: Color = ColorRawTokens.colorFunctionalWhite, + val decorativeNeutralDefaultLight: Color = ColorRawTokens.colorFunctionalDarkGray400, + val decorativeNeutralEmphasizedLight: Color = ColorRawTokens.colorFunctionalDarkGray640, + val decorativeNeutralMutedLight: Color = ColorRawTokens.colorFunctionalLightGray160, + val decorativeSkinTint100Light: Color = ColorRawTokens.colorDecorativeDeepPeach100, + val decorativeSkinTint200Light: Color = ColorRawTokens.colorDecorativeDeepPeach200, + val decorativeSkinTint300Light: Color = ColorRawTokens.colorDecorativeDeepPeach300, + val decorativeSkinTint400Light: Color = ColorRawTokens.colorDecorativeDeepPeach400, + val decorativeSkinTint500Light: Color = ColorRawTokens.colorDecorativeDeepPeach500, + val decorativeSkinTint600Light: Color = ColorRawTokens.colorDecorativeDeepPeach600, + val decorativeSkinTint700Light: Color = ColorRawTokens.colorDecorativeDeepPeach700, + val decorativeSkinTint800Light: Color = ColorRawTokens.colorDecorativeDeepPeach800, + val decorativeSkinTint900Light: Color = ColorRawTokens.colorDecorativeDeepPeach900, + val decorativeAccent1DefaultDark: Color = ColorRawTokens.colorDecorativeEmerald500, + val decorativeAccent1EmphasizedDark: Color = ColorRawTokens.colorDecorativeEmerald700, + val decorativeAccent1MutedDark: Color = ColorRawTokens.colorDecorativeEmerald200, + val decorativeAccent2DefaultDark: Color = ColorRawTokens.colorDecorativeSky400, + val decorativeAccent2EmphasizedDark: Color = ColorRawTokens.colorDecorativeSky700, + val decorativeAccent2MutedDark: Color = ColorRawTokens.colorDecorativeSky200, + val decorativeAccent3DefaultDark: Color = ColorRawTokens.colorFunctionalSun500, + val decorativeAccent3EmphasizedDark: Color = ColorRawTokens.colorDecorativeAmber500, + val decorativeAccent3MutedDark: Color = ColorRawTokens.colorFunctionalSun200, + val decorativeAccent4DefaultDark: Color = ColorRawTokens.colorDecorativeAmethyst400, + val decorativeAccent4EmphasizedDark: Color = ColorRawTokens.colorDecorativeAmethyst800, + val decorativeAccent4MutedDark: Color = ColorRawTokens.colorDecorativeAmethyst200, + val decorativeAccent5DefaultDark: Color = ColorRawTokens.colorDecorativeShockingPink200, + val decorativeAccent5EmphasizedDark: Color = ColorRawTokens.colorDecorativeShockingPink300, + val decorativeAccent5MutedDark: Color = ColorRawTokens.colorDecorativeShockingPink100, + val decorativeBrandPrimaryDark: Color = OrangeBrandColorRawTokens.colorOrange500, + val decorativeBrandSecondaryDark: Color = ColorRawTokens.colorFunctionalLightGray160, + val decorativeBrandTertiaryDark: Color = ColorRawTokens.colorFunctionalDarkGray880, + val decorativeNeutralDefaultDark: Color = ColorRawTokens.colorFunctionalLightGray560, + val decorativeNeutralEmphasizedDark: Color = ColorRawTokens.colorFunctionalLightGray160, + val decorativeNeutralMutedDark: Color = ColorRawTokens.colorFunctionalDarkGray720, + val decorativeSkinTint100Dark: Color = ColorRawTokens.colorDecorativeDeepPeach100, + val decorativeSkinTint200Dark: Color = ColorRawTokens.colorDecorativeDeepPeach200, + val decorativeSkinTint300Dark: Color = ColorRawTokens.colorDecorativeDeepPeach300, + val decorativeSkinTint400Dark: Color = ColorRawTokens.colorDecorativeDeepPeach400, + val decorativeSkinTint500Dark: Color = ColorRawTokens.colorDecorativeDeepPeach500, + val decorativeSkinTint600Dark: Color = ColorRawTokens.colorDecorativeDeepPeach600, + val decorativeSkinTint700Dark: Color = ColorRawTokens.colorDecorativeDeepPeach700, + val decorativeSkinTint800Dark: Color = ColorRawTokens.colorDecorativeDeepPeach800, + val decorativeSkinTint900Dark: Color = ColorRawTokens.colorDecorativeDeepPeach900 +) \ No newline at end of file diff --git a/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorElevationSemanticTokens.kt b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorElevationSemanticTokens.kt new file mode 100644 index 00000000..9ea03981 --- /dev/null +++ b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorElevationSemanticTokens.kt @@ -0,0 +1,45 @@ +/* + * Software Name: OUDS Android + * SPDX-FileCopyrightText: Copyright (c) Orange SA + * SPDX-License-Identifier: MIT + * + * This software is distributed under the MIT license, + * the text of which is available at https://opensource.org/license/MIT/ + * or see the "LICENSE" file for more details. + * + * Software description: Android library of reusable graphical components + */ + +package com.orange.ouds.theme.tokens.semantic + +import androidx.compose.ui.graphics.Color +import com.orange.ouds.tokens.global.raw.ColorRawTokens + +data class OudsColorElevationSemanticTokens( + val elevationDragLight: Color = ColorRawTokens.colorFunctionalLightGray80, + val elevationDragOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalDarkGray720, + val elevationDragOnBgSecondaryLight: Color = ColorRawTokens.colorFunctionalLightGray80, + val elevationModalLight: Color = ColorRawTokens.colorFunctionalWhite, + val elevationOverlayDefaultLight: Color = ColorRawTokens.colorFunctionalWhite, + val elevationOverlayDefaultOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalDarkGray720, + val elevationOverlayDefaultOnBgSecondaryLight: Color = ColorRawTokens.colorFunctionalWhite, + val elevationOverlayEmphasizedLight: Color = ColorRawTokens.colorFunctionalDarkGray640, + val elevationOverlayEmphasizedOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalLightGray80, + val elevationOverlayEmphasizedOnBgSecondaryLight: Color = ColorRawTokens.colorFunctionalDarkGray640, + val elevationRaisedLight: Color = ColorRawTokens.colorFunctionalWhite, + val elevationRaisedOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalDarkGray800, + val elevationRaisedOnBgSecondaryLight: Color = ColorRawTokens.colorFunctionalWhite, + val elevationDragDark: Color = ColorRawTokens.colorFunctionalDarkGray720, + val elevationDragOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalDarkGray480, + val elevationDragOnBgSecondaryDark: Color = ColorRawTokens.colorFunctionalDarkGray640, + val elevationModalDark: Color = ColorRawTokens.colorFunctionalDarkGray640, + val elevationOverlayDefaultDark: Color = ColorRawTokens.colorFunctionalDarkGray720, + val elevationOverlayDefaultOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalDarkGray480, + val elevationOverlayDefaultOnBgSecondaryDark: Color = ColorRawTokens.colorFunctionalDarkGray640, + val elevationOverlayEmphasizedDark: Color = ColorRawTokens.colorFunctionalDarkGray480, + val elevationOverlayEmphasizedOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalDarkGray400, + val elevationOverlayEmphasizedOnBgSecondaryDark: Color = ColorRawTokens.colorFunctionalDarkGray480, + val elevationRaisedDark: Color = ColorRawTokens.colorFunctionalDarkGray800, + val elevationRaisedOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalDarkGray560, + val elevationRaisedOnBgSecondaryDark: Color = ColorRawTokens.colorFunctionalDarkGray720, +) \ No newline at end of file diff --git a/theme-orange-country/src/main/java/com/orange/ouds/theme/orangecountry/tokens/OrangeCountryRawColorTokens.kt b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorGlobalSemanticTokens.kt similarity index 58% rename from theme-orange-country/src/main/java/com/orange/ouds/theme/orangecountry/tokens/OrangeCountryRawColorTokens.kt rename to theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorGlobalSemanticTokens.kt index 90e51d72..c51789a3 100644 --- a/theme-orange-country/src/main/java/com/orange/ouds/theme/orangecountry/tokens/OrangeCountryRawColorTokens.kt +++ b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorGlobalSemanticTokens.kt @@ -10,11 +10,12 @@ * Software description: Android library of reusable graphical components */ -package com.orange.ouds.theme.orangecountry.tokens +package com.orange.ouds.theme.tokens.semantic import androidx.compose.ui.graphics.Color +import com.orange.ouds.tokens.global.raw.ColorRawTokens -internal object OrangeCountryRawColorTokens { - val alert100 = Color(0xFFFFCC00) - val alert200 = Color(0xFF8F7200) -} \ No newline at end of file +data class OudsColorGlobalSemanticTokens( + val transparentDefaultLight: Color = ColorRawTokens.colorTransparentBlack0, + val transparentDefaultDark: Color = ColorRawTokens.colorTransparentBlack0, +) \ No newline at end of file diff --git a/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorGradientSemanticTokens.kt b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorGradientSemanticTokens.kt new file mode 100644 index 00000000..53354eb4 --- /dev/null +++ b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorGradientSemanticTokens.kt @@ -0,0 +1,27 @@ +/* + * Software Name: OUDS Android + * SPDX-FileCopyrightText: Copyright (c) Orange SA + * SPDX-License-Identifier: MIT + * + * This software is distributed under the MIT license, + * the text of which is available at https://opensource.org/license/MIT/ + * or see the "LICENSE" file for more details. + * + * Software description: Android library of reusable graphical components + */ + +package com.orange.ouds.theme.tokens.semantic + +import androidx.compose.ui.graphics.Color +import com.orange.ouds.tokens.global.raw.ColorRawTokens + +data class OudsColorGradientSemanticTokens( + val gradientSkeletonMiddleLight: Color = ColorRawTokens.colorFunctionalLightGray160, + val gradientSkeletonMiddleOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalDarkGray640, + val gradientSkeletonStartEndLight: Color = ColorRawTokens.colorFunctionalLightGray80, + val gradientSkeletonStartEndOnBgEmphasizedLight: Color = ColorRawTokens.colorFunctionalDarkGray720, + val gradientSkeletonMiddleDark: Color = ColorRawTokens.colorFunctionalDarkGray720, + val gradientSkeletonMiddleOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalDarkGray560, + val gradientSkeletonStartEndDark: Color = ColorRawTokens.colorFunctionalDarkGray800, + val gradientSkeletonStartEndOnBgEmphasizedDark: Color = ColorRawTokens.colorFunctionalDarkGray640, +) \ No newline at end of file diff --git a/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorSemanticTokens.kt b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorSemanticTokens.kt new file mode 100644 index 00000000..95c1d790 --- /dev/null +++ b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorSemanticTokens.kt @@ -0,0 +1,26 @@ +/* + * Software Name: OUDS Android + * SPDX-FileCopyrightText: Copyright (c) Orange SA + * SPDX-License-Identifier: MIT + * + * This software is distributed under the MIT license, + * the text of which is available at https://opensource.org/license/MIT/ + * or see the "LICENSE" file for more details. + * + * Software description: Android library of reusable graphical components + */ + +package com.orange.ouds.theme.tokens.semantic + +data class OudsColorSemanticTokens( + val globalColorTokens: OudsColorGlobalSemanticTokens = OudsColorGlobalSemanticTokens(), + val actionColorTokens: OudsColorActionSemanticTokens = OudsColorActionSemanticTokens(), + val alwaysColorTokens: OudsColorAlwaysSemanticTokens = OudsColorAlwaysSemanticTokens(), + val backgroundColorTokens: OudsColorBgSemanticTokens = OudsColorBgSemanticTokens(), + val borderColorTokens: OudsColorBorderSemanticTokens = OudsColorBorderSemanticTokens(), + val brandColorTokens: OudsColorBrandSemanticTokens = OudsColorBrandSemanticTokens(), + val contentColorTokens: OudsColorContentSemanticTokens = OudsColorContentSemanticTokens(), + val elevationColorTokens: OudsColorElevationSemanticTokens = OudsColorElevationSemanticTokens(), + val gradientColorTokens: OudsColorGradientSemanticTokens = OudsColorGradientSemanticTokens(), + val decorativeColorTokens: OudsColorDecorativeSemanticTokens = OudsColorDecorativeSemanticTokens(), +) \ No newline at end of file diff --git a/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorTokens.kt b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorTokens.kt deleted file mode 100644 index c6878c4c..00000000 --- a/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsColorTokens.kt +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Software Name: OUDS Android - * SPDX-FileCopyrightText: Copyright (c) Orange SA - * SPDX-License-Identifier: MIT - * - * This software is distributed under the MIT license, - * the text of which is available at https://opensource.org/license/MIT/ - * or see the "LICENSE" file for more details. - * - * Software description: Android library of reusable graphical components - */ - -package com.orange.ouds.theme.tokens.semantic - -import androidx.compose.material3.ColorScheme -import androidx.compose.material3.darkColorScheme -import androidx.compose.material3.lightColorScheme -import androidx.compose.ui.graphics.Color -import com.orange.ouds.theme.OudsColorScheme - -data class OudsColorTokens( - val primary: OudsColorTokenValue, - val onPrimary: OudsColorTokenValue, - val primaryContainer: OudsColorTokenValue, - val onPrimaryContainer: OudsColorTokenValue, - val inversePrimary: OudsColorTokenValue, - val secondary: OudsColorTokenValue, - val onSecondary: OudsColorTokenValue, - val secondaryContainer: OudsColorTokenValue, - val onSecondaryContainer: OudsColorTokenValue, - val tertiary: OudsColorTokenValue, - val onTertiary: OudsColorTokenValue, - val tertiaryContainer: OudsColorTokenValue, - val onTertiaryContainer: OudsColorTokenValue, - val background: OudsColorTokenValue, - val onBackground: OudsColorTokenValue, - val surface: OudsColorTokenValue, - val onSurface: OudsColorTokenValue, - val surfaceVariant: OudsColorTokenValue, - val onSurfaceVariant: OudsColorTokenValue, - val surfaceTint: OudsColorTokenValue, - val inverseSurface: OudsColorTokenValue, - val inverseOnSurface: OudsColorTokenValue, - val error: OudsColorTokenValue, - val onError: OudsColorTokenValue, - val errorContainer: OudsColorTokenValue, - val onErrorContainer: OudsColorTokenValue, - val outline: OudsColorTokenValue, - val outlineVariant: OudsColorTokenValue, - val scrim: OudsColorTokenValue, - val positive: OudsColorTokenValue, - val onPositive: OudsColorTokenValue, - val negative: OudsColorTokenValue, - val onNegative: OudsColorTokenValue, - val info: OudsColorTokenValue, - val alert: OudsColorTokenValue, -) { - - val lightColorScheme: OudsColorScheme - get() = OudsColorScheme( - primary = primary.light, - onPrimary = onPrimary.light, - primaryContainer = primaryContainer.light, - onPrimaryContainer = onPrimaryContainer.light, - inversePrimary = inversePrimary.light, - secondary = secondary.light, - onSecondary = onSecondary.light, - secondaryContainer = secondaryContainer.light, - onSecondaryContainer = onSecondaryContainer.light, - tertiary = tertiary.light, - onTertiary = onTertiary.light, - tertiaryContainer = tertiaryContainer.light, - onTertiaryContainer = onTertiaryContainer.light, - background = background.light, - onBackground = onBackground.light, - surface = surface.light, - onSurface = onSurface.light, - surfaceVariant = surfaceVariant.light, - onSurfaceVariant = onSurfaceVariant.light, - surfaceTint = surfaceTint.light, - inverseSurface = inverseSurface.light, - inverseOnSurface = inverseOnSurface.light, - error = error.light, - onError = onError.light, - errorContainer = errorContainer.light, - onErrorContainer = onErrorContainer.light, - outline = outline.light, - outlineVariant = outlineVariant.light, - scrim = scrim.light, - positive = positive.light, - onPositive = onPositive.light, - negative = negative.light, - onNegative = onNegative.light, - info = info.light, - alert = alert.light - ) - - val darkColorScheme: OudsColorScheme - get() = OudsColorScheme( - primary = primary.dark, - onPrimary = onPrimary.dark, - primaryContainer = primaryContainer.dark, - onPrimaryContainer = onPrimaryContainer.dark, - inversePrimary = inversePrimary.dark, - secondary = secondary.dark, - onSecondary = onSecondary.dark, - secondaryContainer = secondaryContainer.dark, - onSecondaryContainer = onSecondaryContainer.dark, - tertiary = tertiary.dark, - onTertiary = onTertiary.dark, - tertiaryContainer = tertiaryContainer.dark, - onTertiaryContainer = onTertiaryContainer.dark, - background = background.dark, - onBackground = onBackground.dark, - surface = surface.dark, - onSurface = onSurface.dark, - surfaceVariant = surfaceVariant.dark, - onSurfaceVariant = onSurfaceVariant.dark, - surfaceTint = surfaceTint.dark, - inverseSurface = inverseSurface.dark, - inverseOnSurface = inverseOnSurface.dark, - error = error.dark, - onError = onError.dark, - errorContainer = errorContainer.dark, - onErrorContainer = onErrorContainer.dark, - outline = outline.dark, - outlineVariant = outlineVariant.dark, - scrim = scrim.dark, - positive = positive.dark, - onPositive = onPositive.dark, - negative = negative.dark, - onNegative = onNegative.dark, - info = info.dark, - alert = alert.dark - ) - - val materialLightColorScheme: ColorScheme - get() = lightColorScheme( - primary = primary.light, - onPrimary = onPrimary.light, - primaryContainer = primaryContainer.light, - onPrimaryContainer = onPrimaryContainer.light, - inversePrimary = inversePrimary.light, - secondary = secondary.light, - onSecondary = onSecondary.light, - secondaryContainer = secondaryContainer.light, - onSecondaryContainer = onSecondaryContainer.light, - tertiary = tertiary.light, - onTertiary = onTertiary.light, - tertiaryContainer = tertiaryContainer.light, - onTertiaryContainer = onTertiaryContainer.light, - background = background.light, - onBackground = onBackground.light, - surface = surface.light, - onSurface = onSurface.light, - surfaceVariant = surfaceVariant.light, - onSurfaceVariant = onSurfaceVariant.light, - surfaceTint = surfaceTint.light, - inverseSurface = inverseSurface.light, - inverseOnSurface = inverseOnSurface.light, - error = error.light, - onError = onError.light, - errorContainer = errorContainer.light, - onErrorContainer = onErrorContainer.light, - outline = outline.light, - outlineVariant = outlineVariant.light, - scrim = scrim.light, - ) - - val materialDarkColorScheme: ColorScheme - get() = darkColorScheme( - primary = primary.dark, - onPrimary = onPrimary.dark, - primaryContainer = primaryContainer.dark, - onPrimaryContainer = onPrimaryContainer.dark, - inversePrimary = inversePrimary.dark, - secondary = secondary.dark, - onSecondary = onSecondary.dark, - secondaryContainer = secondaryContainer.dark, - onSecondaryContainer = onSecondaryContainer.dark, - tertiary = tertiary.dark, - onTertiary = onTertiary.dark, - tertiaryContainer = tertiaryContainer.dark, - onTertiaryContainer = onTertiaryContainer.dark, - background = background.dark, - onBackground = onBackground.dark, - surface = surface.dark, - onSurface = onSurface.dark, - surfaceVariant = surfaceVariant.dark, - onSurfaceVariant = onSurfaceVariant.dark, - surfaceTint = surfaceTint.dark, - inverseSurface = inverseSurface.dark, - inverseOnSurface = inverseOnSurface.dark, - error = error.dark, - onError = onError.dark, - errorContainer = errorContainer.dark, - onErrorContainer = onErrorContainer.dark, - outline = outline.dark, - outlineVariant = outlineVariant.dark, - scrim = scrim.dark, - ) -} - -data class OudsColorTokenValue(val light: Color, val dark: Color) - -enum class OudsColorKeyToken { - Background, - Error, - ErrorContainer, - InverseOnSurface, - InversePrimary, - InverseSurface, - OnBackground, - OnError, - OnErrorContainer, - OnPrimary, - OnPrimaryContainer, - OnSecondary, - OnSecondaryContainer, - OnSurface, - OnSurfaceVariant, - OnTertiary, - OnTertiaryContainer, - Outline, - OutlineVariant, - Primary, - PrimaryContainer, - Scrim, - Secondary, - SecondaryContainer, - Surface, - SurfaceTint, - SurfaceVariant, - Tertiary, - TertiaryContainer, -} \ No newline at end of file diff --git a/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsSpacingSemanticTokens.kt b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsSpaceSemanticTokens.kt similarity index 99% rename from theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsSpacingSemanticTokens.kt rename to theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsSpaceSemanticTokens.kt index 872f8fd3..6cbd2a48 100644 --- a/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsSpacingSemanticTokens.kt +++ b/theme-contract/src/main/java/com/orange/ouds/theme/tokens/semantic/OudsSpaceSemanticTokens.kt @@ -14,7 +14,7 @@ package com.orange.ouds.theme.tokens.semantic import com.orange.ouds.tokens.global.raw.DimensionRawTokens -data class OudsSpacingSemanticTokens( +data class OudsSpaceSemanticTokens( val fixedNone: Float = DimensionRawTokens.dimension0, val fixedSmash: Float = DimensionRawTokens.dimension25, val fixedShortest: Float = DimensionRawTokens.dimension50, diff --git a/theme-orange-country/src/main/java/com/orange/ouds/theme/orangecountry/OrangeCountryTheme.kt b/theme-orange-country/src/main/java/com/orange/ouds/theme/orangecountry/OrangeCountryTheme.kt index a9a7d202..103f337b 100644 --- a/theme-orange-country/src/main/java/com/orange/ouds/theme/orangecountry/OrangeCountryTheme.kt +++ b/theme-orange-country/src/main/java/com/orange/ouds/theme/orangecountry/OrangeCountryTheme.kt @@ -12,23 +12,32 @@ package com.orange.ouds.theme.orangecountry +import androidx.compose.ui.graphics.Color import com.orange.ouds.theme.orange.OrangeTheme -import com.orange.ouds.theme.orangecountry.tokens.orangeCountrySemanticColorTokens import com.orange.ouds.theme.tokens.OudsBorderRadiusKeyToken +import com.orange.ouds.theme.tokens.OudsColorKeyToken import com.orange.ouds.theme.tokens.components.OudsButtonTokens import com.orange.ouds.theme.tokens.components.OudsComponentsTokens -import com.orange.ouds.theme.tokens.semantic.OudsColorTokens +import com.orange.ouds.theme.tokens.semantic.OudsColorBgSemanticTokens +import com.orange.ouds.theme.tokens.semantic.OudsColorSemanticTokens +import kotlinx.parcelize.Parcelize +@Parcelize class OrangeCountryTheme : OrangeTheme() { override val name: String get() = "Orange country" - override val colorTokens: OudsColorTokens - get() = orangeCountrySemanticColorTokens + override val colorTokens: OudsColorSemanticTokens + get() = OudsColorSemanticTokens( + backgroundColorTokens = OudsColorBgSemanticTokens( + bgBrandPrimaryLight = Color(0xFF34D349), + bgBrandPrimaryDark = Color(0xFF069D1A) + ) + ) override val componentsTokens: OudsComponentsTokens get() = OudsComponentsTokens( - button = OudsButtonTokens(cornerRadius = OudsBorderRadiusKeyToken.Short) + button = OudsButtonTokens(containerColor = OudsColorKeyToken.Background.StatusAccentEmphasized, cornerRadius = OudsBorderRadiusKeyToken.Short) ) } \ No newline at end of file diff --git a/theme-orange-country/src/main/java/com/orange/ouds/theme/orangecountry/tokens/OrangeCountrySemanticColorTokens.kt b/theme-orange-country/src/main/java/com/orange/ouds/theme/orangecountry/tokens/OrangeCountrySemanticColorTokens.kt deleted file mode 100644 index 2dedfb95..00000000 --- a/theme-orange-country/src/main/java/com/orange/ouds/theme/orangecountry/tokens/OrangeCountrySemanticColorTokens.kt +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Software Name: OUDS Android - * SPDX-FileCopyrightText: Copyright (c) Orange SA - * SPDX-License-Identifier: MIT - * - * This software is distributed under the MIT license, - * the text of which is available at https://opensource.org/license/MIT/ - * or see the "LICENSE" file for more details. - * - * Software description: Android library of reusable graphical components - */ - -package com.orange.ouds.theme.orangecountry.tokens - -import com.orange.ouds.theme.orange.tokens.orangeSemanticColorTokens -import com.orange.ouds.theme.tokens.semantic.OudsColorTokenValue - -val orangeCountrySemanticColorTokens - get() = with(OrangeCountryRawColorTokens) { - orangeSemanticColorTokens.copy( - primary = OudsColorTokenValue(alert200, alert100) - ) - } \ No newline at end of file diff --git a/theme-orange/src/main/java/com/orange/ouds/theme/orange/OrangeTheme.kt b/theme-orange/src/main/java/com/orange/ouds/theme/orange/OrangeTheme.kt index 233ff304..37cb5235 100644 --- a/theme-orange/src/main/java/com/orange/ouds/theme/orange/OrangeTheme.kt +++ b/theme-orange/src/main/java/com/orange/ouds/theme/orange/OrangeTheme.kt @@ -13,8 +13,6 @@ package com.orange.ouds.theme.orange import com.orange.ouds.theme.OudsThemeContract -import com.orange.ouds.theme.orange.tokens.orangeSemanticColorTokens -import com.orange.ouds.theme.tokens.semantic.OudsColorTokens import kotlinx.parcelize.Parcelize const val ORANGE_THEME_NAME = "Orange" @@ -25,6 +23,4 @@ open class OrangeTheme : OudsThemeContract { override val name: String get() = ORANGE_THEME_NAME - override val colorTokens: OudsColorTokens - get() = orangeSemanticColorTokens } diff --git a/theme-orange/src/main/java/com/orange/ouds/theme/orange/tokens/OrangeRawColorTokens.kt b/theme-orange/src/main/java/com/orange/ouds/theme/orange/tokens/OrangeRawColorTokens.kt deleted file mode 100644 index 747f21c3..00000000 --- a/theme-orange/src/main/java/com/orange/ouds/theme/orange/tokens/OrangeRawColorTokens.kt +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Software Name: OUDS Android - * SPDX-FileCopyrightText: Copyright (c) Orange SA - * SPDX-License-Identifier: MIT - * - * This software is distributed under the MIT license, - * the text of which is available at https://opensource.org/license/MIT/ - * or see the "LICENSE" file for more details. - * - * Software description: Android library of reusable graphical components - */ - -package com.orange.ouds.theme.orange.tokens - -import androidx.compose.ui.graphics.Color - -internal object OrangeRawColorTokens { - val orange100 = Color(0xFFFF7900) - val orange200 = Color(0xFFF16E00) - val tmpOrangeFFA14D = Color(0xFFFFA14D) - val tmpOrangeFFB68E = Color(0xFFFFB68E) - - val white100 = Color(0xFFFFFFFF) - val black900 = Color(0xFF000000) - - val tmpBrown362F2C = Color(0xFF362F2C) - val tmpBrown9C4500 = Color(0xFF9C4500) - val tmpBrown52443C = Color(0xFF52443C) - val tmpGrey333333 = Color(0xFF333333) - val tmpGrey666666 = Color(0xFF666666) - val tmpGrey999999 = Color(0xFF999999) - val tmpGreyCCCCCC = Color(0xFFCCCCCC) - val tmpGreyEBEBEB = Color(0xFFEBEBEB) - val tmpGreyEEEEEE = Color(0xFFEEEEEE) - - val info100 = Color(0xFF527EDB) - val info200 = Color(0xFF4170D8) - val alert100 = Color(0xFFFFCC00) - val alert200 = Color(0xFF8F7200) - val positive100 = Color(0xFF32C832) - val positive200 = Color(0xFF228722) - val negative100 = Color(0xFFD53F15) - val negative200 = Color(0xFFCD3C14) - - val tmpRedD53F15 = Color(0xFFD53F15) - val tmpRedFFDAD6 = Color(0xFFFFDAD6) - val tmpRed410002 = Color(0xFF410002) - val tmpRed93000A = Color(0xFF93000A) -} \ No newline at end of file diff --git a/theme-orange/src/main/java/com/orange/ouds/theme/orange/tokens/OrangeSemanticColorTokens.kt b/theme-orange/src/main/java/com/orange/ouds/theme/orange/tokens/OrangeSemanticColorTokens.kt deleted file mode 100644 index aebc463c..00000000 --- a/theme-orange/src/main/java/com/orange/ouds/theme/orange/tokens/OrangeSemanticColorTokens.kt +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Software Name: OUDS Android - * SPDX-FileCopyrightText: Copyright (c) Orange SA - * SPDX-License-Identifier: MIT - * - * This software is distributed under the MIT license, - * the text of which is available at https://opensource.org/license/MIT/ - * or see the "LICENSE" file for more details. - * - * Software description: Android library of reusable graphical components - */ - -package com.orange.ouds.theme.orange.tokens - -import com.orange.ouds.theme.tokens.semantic.OudsColorTokenValue -import com.orange.ouds.theme.tokens.semantic.OudsColorTokens - -val orangeSemanticColorTokens - get() = with(OrangeRawColorTokens) { - OudsColorTokens( - primary = OudsColorTokenValue(orange200, orange100), - onPrimary = OudsColorTokenValue(white100, black900), - primaryContainer = OudsColorTokenValue(tmpOrangeFFA14D, tmpOrangeFFA14D), - onPrimaryContainer = OudsColorTokenValue(black900, black900), - inversePrimary = OudsColorTokenValue(tmpOrangeFFB68E, tmpBrown9C4500), - - secondary = OudsColorTokenValue(orange200, white100), - onSecondary = OudsColorTokenValue(black900, black900), - secondaryContainer = OudsColorTokenValue(tmpGrey333333, tmpGreyCCCCCC), - onSecondaryContainer = OudsColorTokenValue(white100, black900), - - tertiary = OudsColorTokenValue(tmpGrey666666, tmpGreyCCCCCC), - onTertiary = OudsColorTokenValue(white100, black900), - tertiaryContainer = OudsColorTokenValue(tmpGreyCCCCCC, tmpGrey333333), - onTertiaryContainer = OudsColorTokenValue(black900, white100), - background = OudsColorTokenValue(white100, black900), - onBackground = OudsColorTokenValue(black900, white100), - surface = OudsColorTokenValue(white100, black900), - onSurface = OudsColorTokenValue(black900, white100), - surfaceVariant = OudsColorTokenValue(tmpGreyEEEEEE, tmpGrey333333), - onSurfaceVariant = OudsColorTokenValue(black900, tmpGreyEEEEEE), - surfaceTint = OudsColorTokenValue(tmpGrey999999, white100), - inverseSurface = OudsColorTokenValue(tmpBrown362F2C, tmpGreyEEEEEE), - inverseOnSurface = OudsColorTokenValue(white100, black900), - error = OudsColorTokenValue(negative200, tmpRedD53F15), - onError = OudsColorTokenValue(white100, black900), - errorContainer = OudsColorTokenValue(tmpRedFFDAD6, tmpRed93000A), - onErrorContainer = OudsColorTokenValue(tmpRed410002, tmpRedFFDAD6), - outline = OudsColorTokenValue(black900, tmpGreyEEEEEE), - outlineVariant = OudsColorTokenValue(tmpGreyEBEBEB, tmpBrown52443C), - scrim = OudsColorTokenValue(black900, black900), - positive = OudsColorTokenValue(positive200, positive100), - onPositive = OudsColorTokenValue(white100, black900), - negative = OudsColorTokenValue(negative200, negative100), - onNegative = OudsColorTokenValue(white100, white100), - info = OudsColorTokenValue(info200, info100), - alert = OudsColorTokenValue(alert200, alert100) - ) - } \ No newline at end of file diff --git a/theme-white-label/src/main/java/com/orange/ouds/theme/whitelabel/WhiteLabelTheme.kt b/theme-white-label/src/main/java/com/orange/ouds/theme/whitelabel/WhiteLabelTheme.kt index fbbdbbf3..d80ef016 100644 --- a/theme-white-label/src/main/java/com/orange/ouds/theme/whitelabel/WhiteLabelTheme.kt +++ b/theme-white-label/src/main/java/com/orange/ouds/theme/whitelabel/WhiteLabelTheme.kt @@ -17,11 +17,11 @@ import androidx.compose.ui.text.font.FontFamily import com.orange.ouds.theme.OudsThemeContract import com.orange.ouds.theme.tokens.OudsBorderRadiusKeyToken import com.orange.ouds.theme.tokens.OudsElevationKeyToken -import com.orange.ouds.theme.tokens.OudsSpacingFixedKeyToken +import com.orange.ouds.theme.tokens.OudsSpaceKeyToken import com.orange.ouds.theme.tokens.OudsTypographyKeyToken import com.orange.ouds.theme.tokens.components.OudsButtonTokens import com.orange.ouds.theme.tokens.components.OudsComponentsTokens -import com.orange.ouds.theme.tokens.semantic.OudsColorTokens +import com.orange.ouds.theme.tokens.semantic.OudsColorSemanticTokens import com.orange.ouds.theme.whitelabel.tokens.whiteLabelSemanticColorTokens import kotlinx.parcelize.Parcelize @@ -31,7 +31,7 @@ open class WhiteLabelTheme : OudsThemeContract { override val name: String get() = "White label" - override val colorTokens: OudsColorTokens + override val colorTokens: OudsColorSemanticTokens get() = whiteLabelSemanticColorTokens override val fontFamily: FontFamily @@ -45,8 +45,8 @@ open class WhiteLabelTheme : OudsThemeContract { focusedElevation = OudsElevationKeyToken.OverlayDefault, hoveredElevation = OudsElevationKeyToken.OverlayDefault, labelStyle = OudsTypographyKeyToken.BodyDefaultLarge, - verticalContentPadding = OudsSpacingFixedKeyToken.Shortest, - horizontalContentPadding = OudsSpacingFixedKeyToken.Short + verticalContentPadding = OudsSpaceKeyToken.Fixed.Shortest, + horizontalContentPadding = OudsSpaceKeyToken.Fixed.Short ) ) } diff --git a/theme-white-label/src/main/java/com/orange/ouds/theme/whitelabel/tokens/WhiteLabelSemanticColorTokens.kt b/theme-white-label/src/main/java/com/orange/ouds/theme/whitelabel/tokens/WhiteLabelSemanticColorTokens.kt index ea30a098..e7161a33 100644 --- a/theme-white-label/src/main/java/com/orange/ouds/theme/whitelabel/tokens/WhiteLabelSemanticColorTokens.kt +++ b/theme-white-label/src/main/java/com/orange/ouds/theme/whitelabel/tokens/WhiteLabelSemanticColorTokens.kt @@ -12,47 +12,17 @@ package com.orange.ouds.theme.whitelabel.tokens -import com.orange.ouds.theme.tokens.semantic.OudsColorTokenValue -import com.orange.ouds.theme.tokens.semantic.OudsColorTokens +import androidx.compose.ui.graphics.Color +import com.orange.ouds.theme.tokens.semantic.OudsColorBgSemanticTokens +import com.orange.ouds.theme.tokens.semantic.OudsColorSemanticTokens val whiteLabelSemanticColorTokens = with(WhiteLabelRawColorTokens) { - OudsColorTokens( - primary = OudsColorTokenValue(primary40, primary80), - onPrimary = OudsColorTokenValue(white, primary20), - primaryContainer = OudsColorTokenValue(primary90, primary30), - onPrimaryContainer = OudsColorTokenValue(white, white), - inversePrimary = OudsColorTokenValue(primary80, primary40), - - secondary = OudsColorTokenValue(secondary40, secondary80), - onSecondary = OudsColorTokenValue(white, secondary20), - secondaryContainer = OudsColorTokenValue(secondary90, secondary30), - onSecondaryContainer = OudsColorTokenValue(secondary10, secondary90), - - tertiary = OudsColorTokenValue(tertiary40, tertiary80), - onTertiary = OudsColorTokenValue(white, tertiary20), - tertiaryContainer = OudsColorTokenValue(tertiary90, tertiary30), - onTertiaryContainer = OudsColorTokenValue(tertiary10, tertiary90), - background = OudsColorTokenValue(white, black), - onBackground = OudsColorTokenValue(black, white), - surface = OudsColorTokenValue(neutral98, neutral6), - onSurface = OudsColorTokenValue(black, neutral90), - surfaceVariant = OudsColorTokenValue(neutral94, neutral24), - onSurfaceVariant = OudsColorTokenValue(black, neutralVariant90), - surfaceTint = OudsColorTokenValue(white, neutral98), - inverseSurface = OudsColorTokenValue(neutral20, neutral90), - inverseOnSurface = OudsColorTokenValue(neutral95, neutral20), - error = OudsColorTokenValue(error40, error80), - onError = OudsColorTokenValue(white, error20), - errorContainer = OudsColorTokenValue(error90, error30), - onErrorContainer = OudsColorTokenValue(white, error90), - outline = OudsColorTokenValue(neutralVariant50, neutralVariant60), - outlineVariant = OudsColorTokenValue(neutralVariant80, neutralVariant30), - scrim = OudsColorTokenValue(black, black), - positive = OudsColorTokenValue(green, green), - onPositive = OudsColorTokenValue(white, white), - negative = OudsColorTokenValue(red, red), - onNegative = OudsColorTokenValue(white, white), - info = OudsColorTokenValue(info, info), - alert = OudsColorTokenValue(yellow, yellow) + OudsColorSemanticTokens( + backgroundColorTokens = OudsColorBgSemanticTokens( + bgBrandPrimaryLight = Color(0xFF34D349), + bgBrandPrimaryDark = Color(0xFF069D1A), + bgSecondaryLight = secondary40, + bgSecondaryDark = secondary80, + ) ) } \ No newline at end of file