From 17a2b0be3b06f608e515aea3afd26ebaa6e4ac7e Mon Sep 17 00:00:00 2001 From: Florent Maitre Date: Thu, 9 Jan 2025 16:08:14 +0100 Subject: [PATCH] Refactor OudsBorders, OudsColorScheme, OudsSizes and OudsTypography --- .../java/com/orange/ouds/app/ui/BottomBar.kt | 2 +- .../java/com/orange/ouds/app/ui/MainScreen.kt | 2 +- .../java/com/orange/ouds/app/ui/TopBar.kt | 6 +- .../ui/components/button/ButtonDemoScreen.kt | 2 +- .../ui/tokens/TokenCategoryDetailScreen.kt | 24 +- .../ouds/app/ui/tokens/TokenPropertyHeader.kt | 24 +- .../ui/tokens/TokenPropertyIllustration.kt | 16 +- .../orange/ouds/app/ui/tokens/TokensScreen.kt | 2 +- .../composable/CustomizationBottomSheet.kt | 6 +- .../composable/CustomizationElements.kt | 4 +- .../composable/DetailScreenHeader.kt | 8 +- .../app/ui/utilities/composable/LargeCard.kt | 15 +- .../app/ui/utilities/composable/Screen.kt | 2 +- .../ouds/core/component/button/OudsButton.kt | 44 +- .../com/orange/ouds/core/theme/OudsBorders.kt | 116 +- .../orange/ouds/core/theme/OudsColorScheme.kt | 1366 ++++++++++------- .../com/orange/ouds/core/theme/OudsSizes.kt | 208 +-- .../orange/ouds/core/theme/OudsTypography.kt | 420 ++--- 18 files changed, 1318 insertions(+), 949 deletions(-) diff --git a/app/src/main/java/com/orange/ouds/app/ui/BottomBar.kt b/app/src/main/java/com/orange/ouds/app/ui/BottomBar.kt index d6274186..2b6ff633 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/BottomBar.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/BottomBar.kt @@ -31,7 +31,7 @@ import com.orange.ouds.foundation.utilities.UiModePreviews fun BottomBar(currentRoute: String, navigateToRoute: (String) -> Unit) { val items = BottomBarItem.entries.toTypedArray() NavigationBar( - containerColor = OudsTheme.colorScheme.backgroundColors.secondary, //TODO Temporary color. Waiting for Material colors from Maxime. + containerColor = OudsTheme.colorScheme.background.secondary, //TODO Temporary color. Waiting for Material colors from Maxime. content = { items.forEach { item -> NavigationBarItem( 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 4a1efcc9..e8c01ed1 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 @@ -152,7 +152,7 @@ private fun ChangeThemeDialog(themeManager: ThemeManager, dismissDialog: () -> U Dialog(onDismissRequest = dismissDialog) { Column( modifier = Modifier - .background(OudsTheme.colorScheme.backgroundColors.secondary) + .background(OudsTheme.colorScheme.background.secondary) .selectableGroup() ) { Text( 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 1471fbd2..dad546eb 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 @@ -68,7 +68,7 @@ private fun TopBar( Image( imageVector = Icons.AutoMirrored.Filled.ArrowBack, contentDescription = stringResource(id = R.string.app_common_back_a11y), - colorFilter = ColorFilter.tint(OudsTheme.colorScheme.contentColors.default) + colorFilter = ColorFilter.tint(OudsTheme.colorScheme.content.default) ) } } @@ -76,9 +76,9 @@ private fun TopBar( title = { Text( text = title, - color = OudsTheme.colorScheme.contentColors.default, + color = OudsTheme.colorScheme.content.default, modifier = Modifier.semantics { traversalIndex = -1f }, - style = OudsTheme.typography.headingMedium + style = OudsTheme.typography.heading.medium ) }, actions = { diff --git a/app/src/main/java/com/orange/ouds/app/ui/components/button/ButtonDemoScreen.kt b/app/src/main/java/com/orange/ouds/app/ui/components/button/ButtonDemoScreen.kt index 4bc607a8..62018061 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/components/button/ButtonDemoScreen.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/components/button/ButtonDemoScreen.kt @@ -98,7 +98,7 @@ fun ButtonDemoScreen() = DemoScreen(rememberButtonDemoState()) { private fun ButtonDemo(state: ButtonDemoState) { Box( modifier = Modifier - .background(OudsTheme.colorScheme.backgroundColors.primary) + .background(OudsTheme.colorScheme.background.primary) .padding(all = OudsTheme.spaces.fixed.medium) .fillMaxWidth(), contentAlignment = Alignment.Center 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 edee4a30..11de7cd5 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 @@ -110,7 +110,7 @@ fun TokenCategoryDetailScreen(tokenCategory: TokenCategory<*>, onSubcategoryClic text = stringResource(id = subcategory.nameRes), maxLines = 1, overflow = TextOverflow.Ellipsis, - style = OudsTheme.typography.headingMedium + style = OudsTheme.typography.heading.medium ) } } @@ -124,16 +124,16 @@ fun TokenCategoryDetailScreen(tokenCategory: TokenCategory<*>, onSubcategoryClic Text( modifier = Modifier .fillMaxWidth() - .background(color = OudsTheme.colorScheme.backgroundColors.primary) + .background(color = OudsTheme.colorScheme.background.primary) .padding(all = OudsTheme.spaces.fixed.medium) .semantics { heading() }, text = stringResource(id = tokenProperty.nameRes), - color = OudsTheme.colorScheme.contentColors.default, + color = OudsTheme.colorScheme.content.default, maxLines = 1, overflow = TextOverflow.Ellipsis, - style = OudsTheme.typography.headingMedium + style = OudsTheme.typography.heading.medium ) } } @@ -199,7 +199,7 @@ private fun TokenRow(tokenProperty: TokenProperty>, token: style = if (tokenProperty == TokenProperty.Typography) { token.value() as TextStyle } else { - OudsTheme.typography.bodyStrongLarge + OudsTheme.typography.body.strong.large } ) Text( @@ -207,7 +207,7 @@ private fun TokenRow(tokenProperty: TokenProperty>, token: text = token.literalValue, maxLines = 1, overflow = TextOverflow.Ellipsis, - style = OudsTheme.typography.bodyDefaultMedium.copy(color = OudsTheme.colorScheme.contentColors.muted) + style = OudsTheme.typography.body.default.medium.copy(color = OudsTheme.colorScheme.content.muted) ) } } @@ -284,13 +284,13 @@ private fun CodeColumn(codeExample: String, modifier: Modifier = Modifier) { ) { Text( text = stringResource(R.string.app_tokens_viewCodeExample_label), - style = OudsTheme.typography.labelStrongLarge, - color = OudsTheme.colorScheme.contentColors.default + style = OudsTheme.typography.label.strong.large, + color = OudsTheme.colorScheme.content.default ) Icon( modifier = Modifier.rotate(linkArrowRotation), painter = painterResource(R.drawable.ic_chevron_down), - tint = OudsTheme.colorScheme.contentColors.brandPrimary, + tint = OudsTheme.colorScheme.content.brandPrimary, contentDescription = null ) } @@ -298,8 +298,8 @@ private fun CodeColumn(codeExample: String, modifier: Modifier = Modifier) { AnimatedVisibility(visible = isExpanded, enter = fadeIn(tween(delayMillis = 150)) + expandVertically()) { Box( modifier = Modifier - .background(color = OudsTheme.colorScheme.backgroundColors.secondary) - .border(width = 1.dp, color = OudsTheme.colorScheme.borderColors.default, shape = RectangleShape) + .background(color = OudsTheme.colorScheme.background.secondary) + .border(width = 1.dp, color = OudsTheme.colorScheme.border.default, shape = RectangleShape) ) { Row( horizontalArrangement = Arrangement.spacedBy(OudsTheme.spaces.fixed.short), @@ -311,7 +311,7 @@ private fun CodeColumn(codeExample: String, modifier: Modifier = Modifier) { .padding(vertical = OudsTheme.spaces.fixed.medium) .padding(start = OudsTheme.spaces.fixed.medium), text = codeExample, style = TextStyle(fontFamily = FontFamily.Monospace), - color = OudsTheme.colorScheme.contentColors.default + color = OudsTheme.colorScheme.content.default ) IconButton(onClick = { copyCodeToClipboard(context, codeExample, clipboardManager) }) { Icon(painter = painterResource(R.drawable.ic_copy), contentDescription = stringResource(R.string.app_common_copyCode_a11y)) diff --git a/app/src/main/java/com/orange/ouds/app/ui/tokens/TokenPropertyHeader.kt b/app/src/main/java/com/orange/ouds/app/ui/tokens/TokenPropertyHeader.kt index 3f5b87bb..4f192f3f 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/tokens/TokenPropertyHeader.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/tokens/TokenPropertyHeader.kt @@ -64,7 +64,7 @@ fun GridHeader(modifier: Modifier = Modifier) { Image( modifier = Modifier .fillMaxWidth() - .background(OudsTheme.colorScheme.surfaceColors.statusNeutralMuted), + .background(OudsTheme.colorScheme.surface.status.neutral.muted), painter = painterResource(id = resourceId), contentDescription = null ) @@ -80,7 +80,7 @@ fun SizeIconWithTextHeader( ) { Row( modifier = modifier - .background(color = OudsTheme.colorScheme.surfaceColors.statusNeutralMuted) + .background(color = OudsTheme.colorScheme.surface.status.neutral.muted) .padding(all = OudsTheme.spaces.fixed.medium), horizontalArrangement = Arrangement.spacedBy(OudsTheme.spaces.fixed.shorter), verticalAlignment = Alignment.CenterVertically @@ -88,12 +88,12 @@ fun SizeIconWithTextHeader( Icon( modifier = Modifier.size(size), painter = painterResource(R.drawable.ic_design_token_figma), - tint = OudsTheme.colorScheme.contentColors.statusInfo, + tint = OudsTheme.colorScheme.content.status.info, contentDescription = null ) val style = if (LocalInspectionMode.current) { - OudsTheme.typography.headingSmall + OudsTheme.typography.heading.small } else { getTokens() .asOrNull>>() @@ -109,7 +109,7 @@ fun SizeIconWithTextHeader( maxLines = 1, overflow = TextOverflow.Ellipsis, style = style, - color = OudsTheme.colorScheme.contentColors.default + color = OudsTheme.colorScheme.content.default ) } } @@ -121,7 +121,7 @@ fun SpaceHeader( ) { Box( modifier = modifier - .background(color = OudsTheme.colorScheme.surfaceColors.statusNeutralMuted) + .background(color = OudsTheme.colorScheme.surface.status.neutral.muted) .padding(all = OudsTheme.spaces.fixed.medium) ) { SpaceHeaderContent(spaceTokenProperty = spaceTokenProperty) @@ -142,9 +142,9 @@ private fun SpaceHeaderContent(spaceTokenProperty: TokenProperty Unit = { } ) { @@ -65,9 +65,9 @@ fun BorderIllustrationBox( width: Dp = 1.dp, shape: Shape = RectangleShape, style: OudsBorderStyle = OudsBorderStyle.Solid, - backgroundColor: Color = OudsTheme.colorScheme.backgroundColors.secondary + backgroundColor: Color = OudsTheme.colorScheme.background.secondary ) { - val borderColor = OudsTheme.colorScheme.borderColors.emphasized + val borderColor = OudsTheme.colorScheme.border.emphasized val modifier = when (style) { OudsBorderStyle.None -> Modifier OudsBorderStyle.Solid -> Modifier.border(width = width, color = borderColor, shape = shape) @@ -80,7 +80,7 @@ fun BorderIllustrationBox( @Composable fun ElevationIllustrationSurface(elevation: Dp) { Surface(shadowElevation = elevation) { - IllustrationBox(backgroundColor = OudsTheme.colorScheme.backgroundColors.secondary) + IllustrationBox(backgroundColor = OudsTheme.colorScheme.background.secondary) } } @@ -105,7 +105,7 @@ fun SizeIconIllustrationBox(size: Dp) { Icon( modifier = Modifier.size(size), painter = painterResource(R.drawable.ic_design_token_figma), - tint = OudsTheme.colorScheme.contentColors.statusInfo, + tint = OudsTheme.colorScheme.content.status.info, contentDescription = null ) } @@ -118,13 +118,13 @@ fun SpacePaddingInsetIllustrationBox(size: Dp) { modifier = Modifier .fillMaxWidth() .height(height = size) - .background(OudsTheme.colorScheme.contentColors.statusInfo) + .background(OudsTheme.colorScheme.content.status.info) ) Box( modifier = Modifier .fillMaxHeight() .width(width = size) - .background(OudsTheme.colorScheme.contentColors.statusInfo) + .background(OudsTheme.colorScheme.content.status.info) ) } } @@ -146,7 +146,7 @@ fun SpaceIllustrationBox( } IllustrationBox(contentAlignment = contentAlignment) { Box( - modifier = dimensionBoxModifier.background(color = OudsTheme.colorScheme.contentColors.statusInfo) + modifier = dimensionBoxModifier.background(color = OudsTheme.colorScheme.content.status.info) ) } } 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 d5914fef..37911e74 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 @@ -50,7 +50,7 @@ private fun TokensScreen(tokenCategories: List>, onTokenCategor title = stringResource(id = token.nameRes), imageRes = token.imageRes, onClick = { onTokenCategoryClick(token.id) }, - imageTint = OudsTheme.colorScheme.contentColors.default + imageTint = OudsTheme.colorScheme.content.default ) } } diff --git a/app/src/main/java/com/orange/ouds/app/ui/utilities/composable/CustomizationBottomSheet.kt b/app/src/main/java/com/orange/ouds/app/ui/utilities/composable/CustomizationBottomSheet.kt index c354e15e..5dbf8ac3 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/utilities/composable/CustomizationBottomSheet.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/utilities/composable/CustomizationBottomSheet.kt @@ -100,12 +100,12 @@ fun CustomizationBottomSheetScaffold( modifier = Modifier.rotate(angle), painter = painterResource(id = R.drawable.ic_chevron_down), contentDescription = null, - tint = OudsTheme.colorScheme.contentColors.default + tint = OudsTheme.colorScheme.content.default ) Text( modifier = Modifier.padding(start = OudsTheme.spaces.fixed.medium), text = stringResource(id = titleResId), - style = OudsTheme.typography.headingMedium + style = OudsTheme.typography.heading.medium ) } @@ -118,7 +118,7 @@ fun CustomizationBottomSheetScaffold( modifier = Modifier .padding(innerPadding) .fillMaxSize() - .background(OudsTheme.colorScheme.backgroundColors.primary), + .background(OudsTheme.colorScheme.background.primary), content = content ) } diff --git a/app/src/main/java/com/orange/ouds/app/ui/utilities/composable/CustomizationElements.kt b/app/src/main/java/com/orange/ouds/app/ui/utilities/composable/CustomizationElements.kt index bdd46b0f..fe51299a 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/utilities/composable/CustomizationElements.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/utilities/composable/CustomizationElements.kt @@ -40,7 +40,7 @@ fun CustomizationSwitchListItem(label: String, checked: Boolean, onCheckedChange modifier = Modifier .fillMaxWidth() .clickable(enabled = enabled) { onCheckedChange(!checked) }, - headlineContent = { Text(text = label, style = OudsTheme.typography.headingMedium) }, + headlineContent = { Text(text = label, style = OudsTheme.typography.heading.medium) }, trailingContent = { Switch(checked = checked, onCheckedChange = null, enabled = enabled) } ) } @@ -54,7 +54,7 @@ fun CustomizationChoiceChipsColumn( modifier: Modifier = Modifier ) { Column(modifier = modifier.fillMaxWidth()) { - Text(modifier = Modifier.padding(horizontal = OudsTheme.spaces.fixed.medium), text = label, style = OudsTheme.typography.headingMedium) + Text(modifier = Modifier.padding(horizontal = OudsTheme.spaces.fixed.medium), text = label, style = OudsTheme.typography.heading.medium) Row( Modifier .fillMaxWidth() 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 c967201f..389e0d8d 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 @@ -41,12 +41,12 @@ fun DetailScreenHeader( Column { Image( painter = painterResource(imageRes), - colorFilter = ColorFilter.tint(OudsTheme.colorScheme.contentColors.default), + colorFilter = ColorFilter.tint(OudsTheme.colorScheme.content.default), contentDescription = null, modifier = Modifier .fillMaxWidth() .height(186.dp) - .background(OudsTheme.colorScheme.surfaceColors.statusNeutralMuted), + .background(OudsTheme.colorScheme.surface.status.neutral.muted), contentScale = ContentScale.None ) @@ -67,8 +67,8 @@ fun DetailScreenDescription( Text( modifier = modifier, text = stringResource(descriptionRes), - color = OudsTheme.colorScheme.contentColors.default, - style = OudsTheme.typography.bodyDefaultLarge + color = OudsTheme.colorScheme.content.default, + style = OudsTheme.typography.body.default.large ) } 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 f780e948..a90aa805 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 @@ -47,7 +47,7 @@ fun LargeCard( imageTint: Color? = null ) { Card(shape = RectangleShape, elevation = cardElevation(defaultElevation = OudsTheme.elevations.raised), onClick = onClick) { - Column(modifier = Modifier.background(OudsTheme.colorScheme.backgroundColors.primary)) { + Column(modifier = Modifier.background(OudsTheme.colorScheme.background.primary)) { Image( painter = painterResource(imageRes), colorFilter = imageTint?.let { ColorFilter.tint(imageTint) }, @@ -55,25 +55,24 @@ fun LargeCard( modifier = Modifier .fillMaxWidth() .height(184.dp) - .background(OudsTheme.colorScheme.overlayColors.default) - .background(OudsTheme.colorScheme.surfaceColors.statusNeutralMuted), + .background(OudsTheme.colorScheme.overlay.default) + .background(OudsTheme.colorScheme.surface.status.neutral.muted), contentScale = ContentScale.None ) Column( modifier = Modifier .fillMaxWidth() - .background(OudsTheme.colorScheme.overlayColors.default) + .background(OudsTheme.colorScheme.overlay.default) .padding(OudsTheme.spaces.fixed.medium) ) { Text( text = title, - color = OudsTheme.colorScheme.contentColors.default, + color = OudsTheme.colorScheme.content.default, overflow = TextOverflow.Ellipsis, maxLines = 1, - style = OudsTheme.typography.headingMedium + style = OudsTheme.typography.heading.medium ) } - } } } @@ -85,6 +84,6 @@ private fun PreviewLargeCard() = OudsPreview { title = "Title", imageRes = R.drawable.ic_filter_effects, onClick = {}, - imageTint = OudsTheme.colorScheme.contentColors.default + imageTint = OudsTheme.colorScheme.content.default ) } 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 2c36efb2..6a73cb0d 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 @@ -26,7 +26,7 @@ fun Screen(content: @Composable () -> Unit) { Box( modifier = Modifier .fillMaxSize() - .background(OudsTheme.colorScheme.backgroundColors.primary) + .background(OudsTheme.colorScheme.background.primary) ) { content() } 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 c11dfe59..2f61c22b 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 @@ -239,7 +239,7 @@ private fun OudsButton( Text( modifier = modifier, text = text, - style = OudsTheme.typography.labelStrongLarge + style = OudsTheme.typography.label.strong.large ) } } @@ -283,11 +283,11 @@ private fun Modifier.border(hierarchy: OudsButton.Hierarchy, state: OudsButton.S private fun Modifier.outerBorder(state: OudsButton.State, shape: Shape): Modifier { return if (state == OudsButton.State.Focused) { outerBorder( - width = OudsTheme.borders.widthFocus, - color = OudsTheme.colorScheme.borderColors.focus, + width = OudsTheme.borders.width.focus, + color = OudsTheme.colorScheme.border.focus, shape = shape, - insetWidth = OudsTheme.borders.widthFocusInset, - insetColor = OudsTheme.colorScheme.borderColors.focusInset + insetWidth = OudsTheme.borders.width.focusInset, + insetColor = OudsTheme.colorScheme.border.focusInset ) } else { this @@ -304,7 +304,7 @@ private fun borderWidth(hierarchy: OudsButton.Hierarchy, state: OudsButton.State OudsButton.State.Hovered, OudsButton.State.Pressed, OudsButton.State.Loading -> borderWidthDefaultInteraction.value - OudsButton.State.Focused -> OudsTheme.borders.widthFocusInset + OudsButton.State.Focused -> OudsTheme.borders.width.focusInset OudsButton.State.Skeleton -> null } OudsButton.Hierarchy.Minimal -> when (state) { @@ -313,11 +313,11 @@ private fun borderWidth(hierarchy: OudsButton.Hierarchy, state: OudsButton.State OudsButton.State.Hovered, OudsButton.State.Pressed, OudsButton.State.Loading -> borderWidthMinimalInteraction.value - OudsButton.State.Focused -> OudsTheme.borders.widthFocusInset + OudsButton.State.Focused -> OudsTheme.borders.width.focusInset OudsButton.State.Skeleton -> null } OudsButton.Hierarchy.Strong, - OudsButton.Hierarchy.Negative -> if (state == OudsButton.State.Focused) OudsTheme.borders.widthFocusInset else null + OudsButton.Hierarchy.Negative -> if (state == OudsButton.State.Focused) OudsTheme.borders.width.focusInset else null } } } @@ -392,12 +392,12 @@ private fun containerColor(hierarchy: OudsButton.Hierarchy, state: OudsButton.St OudsButton.State.Skeleton -> OudsTheme.componentsTokens.skeleton.colorBg }.value OudsButton.Hierarchy.Negative -> when (state) { - OudsButton.State.Enabled -> OudsTheme.colorScheme.actionColors.negativeEnabled - OudsButton.State.Focused -> OudsTheme.colorScheme.actionColors.negativeFocus - OudsButton.State.Hovered -> OudsTheme.colorScheme.actionColors.negativeHover - OudsButton.State.Pressed -> OudsTheme.colorScheme.actionColors.negativePressed - OudsButton.State.Loading -> OudsTheme.colorScheme.actionColors.negativeLoading - OudsButton.State.Disabled -> OudsTheme.colorScheme.actionColors.disabled + OudsButton.State.Enabled -> OudsTheme.colorScheme.action.negative.enabled + OudsButton.State.Focused -> OudsTheme.colorScheme.action.negative.focus + OudsButton.State.Hovered -> OudsTheme.colorScheme.action.negative.hover + OudsButton.State.Pressed -> OudsTheme.colorScheme.action.negative.pressed + OudsButton.State.Loading -> OudsTheme.colorScheme.action.negative.loading + OudsButton.State.Disabled -> OudsTheme.colorScheme.action.disabled OudsButton.State.Skeleton -> OudsTheme.componentsTokens.skeleton.colorBg.value } } @@ -427,12 +427,12 @@ private fun contentColor(hierarchy: OudsButton.Hierarchy, state: OudsButton.Stat OudsButton.State.Skeleton -> OudsTheme.componentsTokens.skeleton.colorBg }.value OudsButton.Hierarchy.Strong -> when (state) { - OudsButton.State.Enabled -> OudsTheme.colorScheme.contentColors.onActionEnabled - OudsButton.State.Focused -> OudsTheme.colorScheme.contentColors.onActionFocus - OudsButton.State.Hovered -> OudsTheme.colorScheme.contentColors.onActionHover - OudsButton.State.Pressed -> OudsTheme.colorScheme.contentColors.onActionPressed - OudsButton.State.Loading -> OudsTheme.colorScheme.contentColors.onActionLoading - OudsButton.State.Disabled -> OudsTheme.colorScheme.contentColors.onActionDisabled + OudsButton.State.Enabled -> OudsTheme.colorScheme.content.onAction.enabled + OudsButton.State.Focused -> OudsTheme.colorScheme.content.onAction.focus + OudsButton.State.Hovered -> OudsTheme.colorScheme.content.onAction.hover + OudsButton.State.Pressed -> OudsTheme.colorScheme.content.onAction.pressed + OudsButton.State.Loading -> OudsTheme.colorScheme.content.onAction.loading + OudsButton.State.Disabled -> OudsTheme.colorScheme.content.onAction.disabled OudsButton.State.Skeleton -> OudsTheme.componentsTokens.skeleton.colorBg.value } OudsButton.Hierarchy.Negative -> when (state) { @@ -440,8 +440,8 @@ private fun contentColor(hierarchy: OudsButton.Hierarchy, state: OudsButton.Stat OudsButton.State.Hovered, OudsButton.State.Pressed, OudsButton.State.Loading, - OudsButton.State.Focused -> OudsTheme.colorScheme.contentColors.onActionNegative - OudsButton.State.Disabled -> OudsTheme.colorScheme.contentColors.onActionDisabled + OudsButton.State.Focused -> OudsTheme.colorScheme.content.onAction.negative + OudsButton.State.Disabled -> OudsTheme.colorScheme.content.onAction.disabled OudsButton.State.Skeleton -> OudsTheme.componentsTokens.skeleton.colorBg.value } } diff --git a/core/src/main/java/com/orange/ouds/core/theme/OudsBorders.kt b/core/src/main/java/com/orange/ouds/core/theme/OudsBorders.kt index 5ef0a83e..53787224 100644 --- a/core/src/main/java/com/orange/ouds/core/theme/OudsBorders.kt +++ b/core/src/main/java/com/orange/ouds/core/theme/OudsBorders.kt @@ -26,74 +26,92 @@ import com.orange.ouds.theme.tokens.semantic.OudsBorderSemanticTokens * @suppress */ data class OudsBorders( - val widthNone: Dp, - val widthDefault: Dp, - val widthThin: Dp, - val widthMedium: Dp, - val widthThick: Dp, - val widthThicker: Dp, - val widthFocus: Dp, - val widthFocusInset: Dp, - val radiusNone: Dp, - val radiusDefault: Dp, - val radiusShort: Dp, - val radiusMedium: Dp, - val radiusTall: Dp, - val radiusPill: Dp, - val styleDefault: OudsBorderStyle, - val styleDrag: OudsBorderStyle, -) + val width: Width, + val radius: Radius, + val style: Style +) { + data class Width( + val none: Dp, + val default: Dp, + val thin: Dp, + val medium: Dp, + val thick: Dp, + val thicker: Dp, + val focus: Dp, + val focusInset: Dp + ) + + data class Radius( + val none: Dp, + val default: Dp, + val short: Dp, + val medium: Dp, + val tall: Dp, + val pill: Dp + ) + + data class Style( + val default: OudsBorderStyle, + val drag: OudsBorderStyle + ) +} internal fun OudsBorderSemanticTokens.getBorders() = OudsBorders( - widthNone = widthNone.dp, - widthDefault = widthDefault.dp, - widthThin = widthThin.dp, - widthMedium = widthMedium.dp, - widthThick = widthThick.dp, - widthThicker = widthThicker.dp, - widthFocus = widthFocus.dp, - widthFocusInset = widthFocusInset.dp, - radiusNone = radiusNone.dp, - radiusDefault = radiusDefault.dp, - radiusShort = radiusShort.dp, - radiusMedium = radiusMedium.dp, - radiusTall = radiusTall.dp, - radiusPill = radiusPill.dp, - styleDefault = OudsBorderStyle.fromString(styleDefault), - styleDrag = OudsBorderStyle.fromString(styleDrag) + width = OudsBorders.Width( + none = widthNone.dp, + default = widthDefault.dp, + thin = widthThin.dp, + medium = widthMedium.dp, + thick = widthThick.dp, + thicker = widthThicker.dp, + focus = widthFocus.dp, + focusInset = widthFocusInset.dp + ), + radius = OudsBorders.Radius( + none = radiusNone.dp, + default = radiusDefault.dp, + short = radiusShort.dp, + medium = radiusMedium.dp, + tall = radiusTall.dp, + pill = radiusPill.dp + ), + style = OudsBorders.Style( + default = OudsBorderStyle.fromString(styleDefault), + drag = OudsBorderStyle.fromString(styleDrag) + ) ) @Stable private fun OudsBorders.fromToken(token: OudsBorderKeyToken.Width): Dp { return when (token) { - OudsBorderKeyToken.Width.None -> widthNone - OudsBorderKeyToken.Width.Default -> widthDefault - OudsBorderKeyToken.Width.Thin -> widthThin - OudsBorderKeyToken.Width.Medium -> widthMedium - OudsBorderKeyToken.Width.Thick -> widthThick - OudsBorderKeyToken.Width.Thicker -> widthThicker - OudsBorderKeyToken.Width.Focus -> widthFocus - OudsBorderKeyToken.Width.FocusInset -> widthFocusInset + OudsBorderKeyToken.Width.None -> width.none + OudsBorderKeyToken.Width.Default -> width.default + OudsBorderKeyToken.Width.Thin -> width.thin + OudsBorderKeyToken.Width.Medium -> width.medium + OudsBorderKeyToken.Width.Thick -> width.thick + OudsBorderKeyToken.Width.Thicker -> width.thicker + OudsBorderKeyToken.Width.Focus -> width.focus + OudsBorderKeyToken.Width.FocusInset -> width.focusInset } } @Stable private fun OudsBorders.fromToken(token: OudsBorderKeyToken.Radius): Dp { return when (token) { - OudsBorderKeyToken.Radius.None -> radiusNone - OudsBorderKeyToken.Radius.Default -> radiusDefault - OudsBorderKeyToken.Radius.Short -> radiusShort - OudsBorderKeyToken.Radius.Medium -> radiusMedium - OudsBorderKeyToken.Radius.Tall -> radiusTall - OudsBorderKeyToken.Radius.Pill -> radiusPill + OudsBorderKeyToken.Radius.None -> radius.none + OudsBorderKeyToken.Radius.Default -> radius.default + OudsBorderKeyToken.Radius.Short -> radius.short + OudsBorderKeyToken.Radius.Medium -> radius.medium + OudsBorderKeyToken.Radius.Tall -> radius.tall + OudsBorderKeyToken.Radius.Pill -> radius.pill } } @Stable private fun OudsBorders.fromToken(token: OudsBorderKeyToken.Style): OudsBorderStyle { return when (token) { - OudsBorderKeyToken.Style.Default -> styleDefault - OudsBorderKeyToken.Style.Drag -> styleDrag + OudsBorderKeyToken.Style.Default -> style.default + OudsBorderKeyToken.Style.Drag -> style.drag } } 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 index 2ef29087..b0bdaff9 100644 --- a/core/src/main/java/com/orange/ouds/core/theme/OudsColorScheme.kt +++ b/core/src/main/java/com/orange/ouds/core/theme/OudsColorScheme.kt @@ -29,16 +29,16 @@ import com.orange.ouds.theme.tokens.semantic.OudsColorSemanticTokens * @suppress */ data class OudsColorScheme( - val actionColors: Action, - val alwaysColors: Always, - val backgroundColors: Background, - val borderColors: Border, - val contentColors: Content, - val decorativeColors: Decorative, - val opacityColors: Opacity, - val overlayColors: Overlay, - val repositoryColors: Repository, - val surfaceColors: Surface, + val action: Action, + val always: Always, + val background: Background, + val border: Border, + val content: Content, + val decorative: Decorative, + val opacity: Opacity, + val overlay: Overlay, + val repository: Repository, + val surface: Surface ) { data class Action( @@ -48,33 +48,41 @@ data class OudsColorScheme( val highlighted: Color, val hover: Color, val loading: Color, - val negativeEnabled: Color, - val negativeFocus: Color, - val negativeHover: Color, - val negativeLoading: Color, - val negativePressed: Color, + val negative: Negative, val pressed: Color, val selected: Color, - val supportEnabled: Color, - val supportFocus: Color, - val supportHover: Color, - val supportLoading: Color, - val supportPressed: Color, - val visited: Color, - ) + val support: Support, + val visited: Color + ) { + data class Negative( + val enabled: Color, + val focus: Color, + val hover: Color, + val loading: Color, + val pressed: Color + ) + + data class Support( + val enabled: Color, + val focus: Color, + val hover: Color, + val loading: Color, + val pressed: Color + ) + } data class Always( val black: Color, val onBlack: Color, val onWhite: Color, - val white: Color, + val white: Color ) data class Background( val emphasized: Color, val primary: Color, val secondary: Color, - val tertiary: Color, + val tertiary: Color ) data class Border( @@ -83,177 +91,316 @@ data class OudsColorScheme( val emphasized: Color, val focus: Color, val focusInset: Color, - val onBrandPrimary: Color, - ) + val onBrand: OnBrand + ) { + data class OnBrand( + val primary: Color + ) + } data class Content( val brandPrimary: Color, val default: Color, val disabled: Color, val muted: Color, - val onActionDisabled: Color, - val onActionEnabled: Color, - val onActionFocus: Color, - val onActionHighlighted: Color, - val onActionHover: Color, - val onActionLoading: Color, - val onActionNegative: Color, - val onActionPressed: Color, - val onBrandPrimary: Color, - val onOverlayEmphasized: Color, - val onStatusEmphasized: Color, - val onStatusEmphasizedNeutral: Color, - val onStatusMuted: Color, - val statusInfo: Color, - val statusNegative: Color, - val statusPositive: Color, - val statusWarning: Color, - ) + val onAction: OnAction, + val onBrand: OnBrand, + val onOverlay: OnOverlay, + val onStatus: OnStatus, + val status: Status + ) { + data class OnAction( + val disabled: Color, + val enabled: Color, + val focus: Color, + val highlighted: Color, + val hover: Color, + val loading: Color, + val negative: Color, + val pressed: Color + ) + + data class OnBrand( + val primary: Color + ) + + data class OnOverlay( + val emphasized: Color + ) + + data class OnStatus( + val emphasized: Color, + val emphasizedNeutral: Color, + val muted: Color + ) + + data class Status( + val info: Color, + val negative: Color, + val positive: Color, + val warning: 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 accent1: Accent1, + val accent2: Accent2, + val accent3: Accent3, + val accent4: Accent4, + val accent5: Accent5, + val brand: Brand, + val neutral: Neutral, + val skin: Skin + ) { + data class Accent1( + val default: Color, + val emphasized: Color, + val muted: Color + ) + + data class Accent2( + val default: Color, + val emphasized: Color, + val muted: Color + ) + + data class Accent3( + val default: Color, + val emphasized: Color, + val muted: Color + ) + + data class Accent4( + val default: Color, + val emphasized: Color, + val muted: Color + ) + + data class Accent5( + val default: Color, + val emphasized: Color, + val muted: Color + ) + + data class Brand( + val primary: Color, + val secondary: Color, + val tertiary: Color + ) + + data class Neutral( + val default: Color, + val emphasized: Color, + val muted: Color + ) + + data class Skin( + val tint100: Color, + val tint200: Color, + val tint300: Color, + val tint400: Color, + val tint500: Color, + val tint600: Color, + val tint700: Color, + val tint800: Color, + val tint900: Color + ) + } data class Opacity( val transparent: Color, val lowest: Color, - val lower: Color, + val lower: Color ) data class Overlay( val default: Color, val drag: Color, val emphasized: Color, - val modal: Color, + val modal: Color ) data class Repository( - val accentDefault: Color, - val accentHighest: Color, - val accentLow: Color, - val accentLowest: Color, - val infoDefault: Color, - val infoHighest: Color, - val infoLow: Color, - val infoLowest: Color, - val negativeDefault: Color, - val negativeHigh: Color, - val negativeHigher: Color, - val negativeHighest: Color, - val negativeLow: Color, - val negativeLower: Color, - val negativeLowest: Color, - val neutralEmphasizedBlack: Color, - val neutralEmphasizedHigh: Color, - val neutralEmphasizedHigher: Color, - val neutralEmphasizedHighest: Color, - val neutralEmphasizedMedium: Color, - val neutralMutedLower: Color, - val neutralMutedLowest: Color, - val neutralMutedWhite: Color, - val opacityBlackHigher: Color, - val opacityBlackHighest: Color, - val opacityBlackLow: Color, - val opacityBlackLower: Color, - val opacityBlackLowest: Color, - val opacityBlackMedium: Color, - val opacityBlackTransparent: Color, - val opacityInfo: Color, - val opacityNegative: Color, - val opacityPositive: Color, - val opacityWarning: Color, - val opacityWhiteHigh: Color, - val opacityWhiteHigher: Color, - val opacityWhiteHighest: Color, - val opacityWhiteLow: Color, - val opacityWhiteLower: Color, - val opacityWhiteLowest: Color, - val opacityWhiteTransparent: Color, - val positiveDefault: Color, - val positiveHighest: Color, - val positiveLow: Color, - val positiveLowest: Color, - val primaryDefault: Color, - val primaryLow: Color, - val warningDefault: Color, - val warningHighest: Color, - val warningLow: Color, - val warningLowest: Color, - ) + val accent: Accent, + val info: Info, + val negative: Negative, + val neutral: Neutral, + val opacity: Opacity, + val positive: Positive, + val primary: Primary, + val warning: Warning + ) { + data class Accent( + val default: Color, + val highest: Color, + val low: Color, + val lowest: Color + ) + + data class Info( + val default: Color, + val highest: Color, + val low: Color, + val lowest: Color + ) + + data class Negative( + val default: Color, + val high: Color, + val higher: Color, + val highest: Color, + val low: Color, + val lower: Color, + val lowest: Color + ) + + data class Neutral( + val emphasized: Emphasized, + val muted: Muted + ) { + data class Emphasized( + val black: Color, + val high: Color, + val higher: Color, + val highest: Color, + val medium: Color + ) + + data class Muted( + val lower: Color, + val lowest: Color, + val white: Color + ) + } + + data class Opacity( + val black: Black, + val info: Color, + val negative: Color, + val positive: Color, + val warning: Color, + val white: White + ) { + data class Black( + val higher: Color, + val highest: Color, + val low: Color, + val lower: Color, + val lowest: Color, + val medium: Color, + val transparent: Color + ) + + data class White( + val high: Color, + val higher: Color, + val highest: Color, + val low: Color, + val lower: Color, + val lowest: Color, + val transparent: Color + ) + } + + data class Positive( + val default: Color, + val highest: Color, + val low: Color, + val lowest: Color + ) + + data class Primary( + val default: Color, + val low: Color + ) + + data class Warning( + val default: Color, + val highest: Color, + val low: Color, + val lowest: Color + ) + } data class Surface( - val brandPrimary: Color, - val statusAccentEmphasized: Color, - val statusAccentMuted: Color, - val statusInfoEmphasized: Color, - val statusInfoMuted: Color, - val statusNegativeEmphasized: Color, - val statusNegativeMuted: Color, - val statusNeutralEmphasized: Color, - val statusNeutralMuted: Color, - val statusPositiveEmphasized: Color, - val statusPositiveMuted: Color, - val statusWarningEmphasized: Color, - val statusWarningMuted: Color, - ) + val brand: Brand, + val status: Status + ) { + data class Brand( + val primary: Color + ) + data class Status( + val accent: Accent, + val info: Info, + val negative: Negative, + val neutral: Neutral, + val positive: Positive, + val warning: Warning + ) { + data class Accent( + val emphasized: Color, + val muted: Color + ) + + data class Info( + val emphasized: Color, + val muted: Color + ) + + data class Negative( + val emphasized: Color, + val muted: Color + ) + + data class Neutral( + val emphasized: Color, + val muted: Color + ) + + data class Positive( + val emphasized: Color, + val muted: Color + ) + + data class Warning( + val emphasized: Color, + val muted: Color + ) + } + } } internal val OudsColorSemanticTokens.lightColorScheme: OudsColorScheme get() = OudsColorScheme( - actionColors = with(actionColorTokens) { + action = with(actionColorTokens) { OudsColorScheme.Action( disabled = actionDisabledLight, - negativeEnabled = actionNegativeEnabledLight, - negativeFocus = actionNegativeFocusLight, - negativeHover = actionNegativeHoverLight, - negativeLoading = actionNegativeLoadingLight, - negativePressed = actionNegativePressedLight, + negative = OudsColorScheme.Action.Negative( + enabled = actionNegativeEnabledLight, + focus = actionNegativeFocusLight, + hover = actionNegativeHoverLight, + loading = actionNegativeLoadingLight, + pressed = actionNegativePressedLight, + ), enabled = actionEnabledLight, focus = actionFocusLight, highlighted = actionHighlightedLight, hover = actionHoverLight, loading = actionLoadingLight, pressed = actionPressedLight, - supportEnabled = actionSupportEnabledLight, - supportFocus = actionSupportFocusLight, - supportHover = actionSupportHoverLight, - supportLoading = actionSupportLoadingLight, - supportPressed = actionSupportPressedLight, + support = OudsColorScheme.Action.Support( + enabled = actionSupportEnabledLight, + focus = actionSupportFocusLight, + hover = actionSupportHoverLight, + loading = actionSupportLoadingLight, + pressed = actionSupportPressedLight, + ), selected = actionSelectedLight, visited = actionVisitedLight, ) }, - alwaysColors = with(alwaysColorTokens) { + always = with(alwaysColorTokens) { OudsColorScheme.Always( black = alwaysBlackLight, onBlack = alwaysOnBlackLight, @@ -261,7 +408,7 @@ internal val OudsColorSemanticTokens.lightColorScheme: OudsColorScheme white = alwaysWhiteLight, ) }, - backgroundColors = with(backgroundColorTokens) { + background = with(backgroundColorTokens) { OudsColorScheme.Background( emphasized = bgEmphasizedLight, primary = bgPrimaryLight, @@ -269,83 +416,111 @@ internal val OudsColorSemanticTokens.lightColorScheme: OudsColorScheme tertiary = bgTertiaryLight, ) }, - borderColors = with(borderColorTokens) { + border = with(borderColorTokens) { OudsColorScheme.Border( brandPrimary = borderBrandPrimaryLight, default = borderDefaultLight, emphasized = borderEmphasizedLight, focus = borderFocusLight, focusInset = borderFocusInsetLight, - onBrandPrimary = borderOnBrandPrimaryLight, + onBrand = OudsColorScheme.Border.OnBrand( + primary = borderOnBrandPrimaryLight, + ), ) }, - contentColors = with(contentColorTokens) { + content = with(contentColorTokens) { OudsColorScheme.Content( brandPrimary = contentBrandPrimaryLight, default = contentDefaultLight, disabled = contentDisabledLight, muted = contentMutedLight, - onActionDisabled = contentOnActionDisabledLight, - onActionNegative = contentOnActionNegativeLight, - onActionEnabled = contentOnActionEnabledLight, - onActionFocus = contentOnActionFocusLight, - onActionHighlighted = contentOnActionHighlightedLight, - onActionHover = contentOnActionHoverLight, - onActionLoading = contentOnActionLoadingLight, - onActionPressed = contentOnActionPressedLight, - onBrandPrimary = contentOnBrandPrimaryLight, - onOverlayEmphasized = contentOnOverlayEmphasizedLight, - onStatusEmphasized = contentOnStatusEmphasizedLight, - onStatusEmphasizedNeutral = contentOnStatusEmphasizedNeutralLight, - onStatusMuted = contentOnStatusMutedLight, - statusInfo = contentStatusInfoLight, - statusNegative = contentStatusNegativeLight, - statusPositive = contentStatusPositiveLight, - statusWarning = contentStatusWarningLight, + onAction = OudsColorScheme.Content.OnAction( + disabled = contentOnActionDisabledLight, + negative = contentOnActionNegativeLight, + enabled = contentOnActionEnabledLight, + focus = contentOnActionFocusLight, + highlighted = contentOnActionHighlightedLight, + hover = contentOnActionHoverLight, + loading = contentOnActionLoadingLight, + pressed = contentOnActionPressedLight, + ), + onBrand = OudsColorScheme.Content.OnBrand( + primary = contentOnBrandPrimaryLight + ), + onOverlay = OudsColorScheme.Content.OnOverlay( + emphasized = contentOnOverlayEmphasizedLight, + ), + onStatus = OudsColorScheme.Content.OnStatus( + emphasized = contentOnStatusEmphasizedLight, + emphasizedNeutral = contentOnStatusEmphasizedNeutralLight, + muted = contentOnStatusMutedLight, + ), + status = OudsColorScheme.Content.Status( + info = contentStatusInfoLight, + negative = contentStatusNegativeLight, + positive = contentStatusPositiveLight, + warning = contentStatusWarningLight, + ), ) }, - decorativeColors = with(decorativeColorTokens) { + decorative = with(decorativeColorTokens) { OudsColorScheme.Decorative( - accent1Default = decorativeAccent1DefaultLight, - accent1Emphasized = decorativeAccent1EmphasizedLight, - accent1Muted = decorativeAccent1MutedLight, - accent2Default = decorativeAccent2DefaultLight, - accent2Emphasized = decorativeAccent2EmphasizedLight, - accent2Muted = decorativeAccent2MutedLight, - accent3Default = decorativeAccent3DefaultLight, - accent3Emphasized = decorativeAccent3EmphasizedLight, - accent3Muted = decorativeAccent3MutedLight, - accent4Default = decorativeAccent4DefaultLight, - accent4Emphasized = decorativeAccent4EmphasizedLight, - accent4Muted = decorativeAccent4MutedLight, - accent5Default = decorativeAccent5DefaultLight, - accent5Emphasized = decorativeAccent5EmphasizedLight, - accent5Muted = decorativeAccent5MutedLight, - brandPrimary = decorativeBrandPrimaryLight, - brandSecondary = decorativeBrandSecondaryLight, - brandTertiary = decorativeBrandTertiaryLight, - neutralDefault = decorativeNeutralDefaultLight, - neutralEmphasized = decorativeNeutralEmphasizedLight, - neutralMuted = decorativeNeutralMutedLight, - skinTint100 = decorativeSkinTint100Light, - skinTint200 = decorativeSkinTint200Light, - skinTint300 = decorativeSkinTint300Light, - skinTint400 = decorativeSkinTint400Light, - skinTint500 = decorativeSkinTint500Light, - skinTint600 = decorativeSkinTint600Light, - skinTint700 = decorativeSkinTint700Light, - skinTint800 = decorativeSkinTint800Light, - skinTint900 = decorativeSkinTint900Light, + accent1 = OudsColorScheme.Decorative.Accent1( + default = decorativeAccent1DefaultLight, + emphasized = decorativeAccent1EmphasizedLight, + muted = decorativeAccent1MutedLight, + ), + accent2 = OudsColorScheme.Decorative.Accent2( + default = decorativeAccent2DefaultLight, + emphasized = decorativeAccent2EmphasizedLight, + muted = decorativeAccent2MutedLight, + ), + accent3 = OudsColorScheme.Decorative.Accent3( + default = decorativeAccent3DefaultLight, + emphasized = decorativeAccent3EmphasizedLight, + muted = decorativeAccent3MutedLight, + ), + accent4 = OudsColorScheme.Decorative.Accent4( + default = decorativeAccent4DefaultLight, + emphasized = decorativeAccent4EmphasizedLight, + muted = decorativeAccent4MutedLight, + ), + accent5 = OudsColorScheme.Decorative.Accent5( + default = decorativeAccent5DefaultLight, + emphasized = decorativeAccent5EmphasizedLight, + muted = decorativeAccent5MutedLight, + ), + brand = OudsColorScheme.Decorative.Brand( + primary = decorativeBrandPrimaryLight, + secondary = decorativeBrandSecondaryLight, + tertiary = decorativeBrandTertiaryLight, + ), + neutral = OudsColorScheme.Decorative.Neutral( + default = decorativeNeutralDefaultLight, + emphasized = decorativeNeutralEmphasizedLight, + muted = decorativeNeutralMutedLight, + ), + skin = OudsColorScheme.Decorative.Skin( + tint100 = decorativeSkinTint100Light, + tint200 = decorativeSkinTint200Light, + tint300 = decorativeSkinTint300Light, + tint400 = decorativeSkinTint400Light, + tint500 = decorativeSkinTint500Light, + tint600 = decorativeSkinTint600Light, + tint700 = decorativeSkinTint700Light, + tint800 = decorativeSkinTint800Light, + tint900 = decorativeSkinTint900Light, + ), ) }, - opacityColors = with(opacityColorTokens) { + opacity = with(opacityColorTokens) { OudsColorScheme.Opacity( transparent = opacityTransparentLight, lowest = opacityLowestLight, lower = opacityLowerLight, ) }, - overlayColors = with(overlayColorTokens) { + overlay = with(overlayColorTokens) { OudsColorScheme.Overlay( default = overlayDefaultLight, drag = overlayDragLight, @@ -353,106 +528,150 @@ internal val OudsColorSemanticTokens.lightColorScheme: OudsColorScheme modal = overlayModalLight ) }, - repositoryColors = with(repositoryColorTokens) { + repository = with(repositoryColorTokens) { OudsColorScheme.Repository( - accentDefault = repositoryAccentDefaultLight, - accentHighest = repositoryAccentHighestLight, - accentLow = repositoryAccentLowLight, - accentLowest = repositoryAccentLowestLight, - infoDefault = repositoryInfoDefaultLight, - infoHighest = repositoryInfoHighestLight, - infoLow = repositoryInfoLowLight, - infoLowest = repositoryInfoLowestLight, - negativeDefault = repositoryNegativeDefaultLight, - negativeHigh = repositoryNegativeHighLight, - negativeHigher = repositoryNegativeHigherLight, - negativeHighest = repositoryNegativeHighestLight, - negativeLow = repositoryNegativeLowLight, - negativeLower = repositoryNegativeLowerLight, - negativeLowest = repositoryNegativeLowestLight, - neutralEmphasizedBlack = repositoryNeutralEmphasizedBlackLight, - neutralEmphasizedHigh = repositoryNeutralEmphasizedHighLight, - neutralEmphasizedHigher = repositoryNeutralEmphasizedHigherLight, - neutralEmphasizedHighest = repositoryNeutralEmphasizedHighestLight, - neutralEmphasizedMedium = repositoryNeutralEmphasizedMediumLight, - neutralMutedLower = repositoryNeutralMutedLowerLight, - neutralMutedLowest = repositoryNeutralMutedLowestLight, - neutralMutedWhite = repositoryNeutralMutedWhiteLight, - opacityBlackHigher = repositoryOpacityBlackHigherLight, - opacityBlackHighest = repositoryOpacityBlackHighestLight, - opacityBlackLow = repositoryOpacityBlackLowLight, - opacityBlackLower = repositoryOpacityBlackLowerLight, - opacityBlackLowest = repositoryOpacityBlackLowestLight, - opacityBlackMedium = repositoryOpacityBlackMediumLight, - opacityBlackTransparent = repositoryOpacityBlackTransparentLight, - opacityInfo = repositoryOpacityInfoLight, - opacityNegative = repositoryOpacityNegativeLight, - opacityPositive = repositoryOpacityPositiveLight, - opacityWarning = repositoryOpacityWarningLight, - opacityWhiteHigh = repositoryOpacityWhiteHighLight, - opacityWhiteHigher = repositoryOpacityWhiteHigherLight, - opacityWhiteHighest = repositoryOpacityWhiteHighestLight, - opacityWhiteLow = repositoryOpacityWhiteLowLight, - opacityWhiteLower = repositoryOpacityWhiteLowerLight, - opacityWhiteLowest = repositoryOpacityWhiteLowestLight, - opacityWhiteTransparent = repositoryOpacityWhiteTransparentLight, - positiveDefault = repositoryPositiveDefaultLight, - positiveHighest = repositoryPositiveHighestLight, - positiveLow = repositoryPositiveLowLight, - positiveLowest = repositoryPositiveLowestLight, - primaryDefault = repositoryPrimaryDefaultLight, - primaryLow = repositoryPrimaryLowLight, - warningDefault = repositoryWarningDefaultLight, - warningHighest = repositoryWarningHighestLight, - warningLow = repositoryWarningLowLight, - warningLowest = repositoryWarningLowestLight, + accent = OudsColorScheme.Repository.Accent( + default = repositoryAccentDefaultLight, + highest = repositoryAccentHighestLight, + low = repositoryAccentLowLight, + lowest = repositoryAccentLowestLight, + ), + info = OudsColorScheme.Repository.Info( + default = repositoryInfoDefaultLight, + highest = repositoryInfoHighestLight, + low = repositoryInfoLowLight, + lowest = repositoryInfoLowestLight, + ), + negative = OudsColorScheme.Repository.Negative( + default = repositoryNegativeDefaultLight, + high = repositoryNegativeHighLight, + higher = repositoryNegativeHigherLight, + highest = repositoryNegativeHighestLight, + low = repositoryNegativeLowLight, + lower = repositoryNegativeLowerLight, + lowest = repositoryNegativeLowestLight, + ), + neutral = OudsColorScheme.Repository.Neutral( + emphasized = OudsColorScheme.Repository.Neutral.Emphasized( + black = repositoryNeutralEmphasizedBlackLight, + high = repositoryNeutralEmphasizedHighLight, + higher = repositoryNeutralEmphasizedHigherLight, + highest = repositoryNeutralEmphasizedHighestLight, + medium = repositoryNeutralEmphasizedMediumLight, + ), + muted = OudsColorScheme.Repository.Neutral.Muted( + lower = repositoryNeutralMutedLowerLight, + lowest = repositoryNeutralMutedLowestLight, + white = repositoryNeutralMutedWhiteLight, + ) + ), + opacity = OudsColorScheme.Repository.Opacity( + black = OudsColorScheme.Repository.Opacity.Black( + higher = repositoryOpacityBlackHigherLight, + highest = repositoryOpacityBlackHighestLight, + low = repositoryOpacityBlackLowLight, + lower = repositoryOpacityBlackLowerLight, + lowest = repositoryOpacityBlackLowestLight, + medium = repositoryOpacityBlackMediumLight, + transparent = repositoryOpacityBlackTransparentLight, + ), + info = repositoryOpacityInfoLight, + negative = repositoryOpacityNegativeLight, + positive = repositoryOpacityPositiveLight, + warning = repositoryOpacityWarningLight, + white = OudsColorScheme.Repository.Opacity.White( + high = repositoryOpacityWhiteHighLight, + higher = repositoryOpacityWhiteHigherLight, + highest = repositoryOpacityWhiteHighestLight, + low = repositoryOpacityWhiteLowLight, + lower = repositoryOpacityWhiteLowerLight, + lowest = repositoryOpacityWhiteLowestLight, + transparent = repositoryOpacityWhiteTransparentLight, + ) + ), + positive = OudsColorScheme.Repository.Positive( + default = repositoryPositiveDefaultLight, + highest = repositoryPositiveHighestLight, + low = repositoryPositiveLowLight, + lowest = repositoryPositiveLowestLight, + ), + primary = OudsColorScheme.Repository.Primary( + default = repositoryPrimaryDefaultLight, + low = repositoryPrimaryLowLight, + ), + warning = OudsColorScheme.Repository.Warning( + default = repositoryWarningDefaultLight, + highest = repositoryWarningHighestLight, + low = repositoryWarningLowLight, + lowest = repositoryWarningLowestLight, + ), ) }, - surfaceColors = with(surfaceColorTokens) { + surface = with(surfaceColorTokens) { OudsColorScheme.Surface( - brandPrimary = surfaceBrandPrimaryLight, - statusAccentEmphasized = surfaceStatusAccentEmphasizedLight, - statusAccentMuted = surfaceStatusAccentMutedLight, - statusInfoEmphasized = surfaceStatusInfoEmphasizedLight, - statusInfoMuted = surfaceStatusInfoMutedLight, - statusNegativeEmphasized = surfaceStatusNegativeEmphasizedLight, - statusNegativeMuted = surfaceStatusNegativeMutedLight, - statusNeutralEmphasized = surfaceStatusNeutralEmphasizedLight, - statusNeutralMuted = surfaceStatusNeutralMutedLight, - statusPositiveEmphasized = surfaceStatusPositiveEmphasizedLight, - statusPositiveMuted = surfaceStatusPositiveMutedLight, - statusWarningEmphasized = surfaceStatusWarningEmphasizedLight, - statusWarningMuted = surfaceStatusWarningMutedLight, + brand = OudsColorScheme.Surface.Brand( + primary = surfaceBrandPrimaryLight, + ), + status = OudsColorScheme.Surface.Status( + accent = OudsColorScheme.Surface.Status.Accent( + emphasized = surfaceStatusAccentEmphasizedLight, + muted = surfaceStatusAccentMutedLight, + ), + info = OudsColorScheme.Surface.Status.Info( + emphasized = surfaceStatusInfoEmphasizedLight, + muted = surfaceStatusInfoMutedLight, + ), + negative = OudsColorScheme.Surface.Status.Negative( + emphasized = surfaceStatusNegativeEmphasizedLight, + muted = surfaceStatusNegativeMutedLight, + ), + neutral = OudsColorScheme.Surface.Status.Neutral( + emphasized = surfaceStatusNeutralEmphasizedLight, + muted = surfaceStatusNeutralMutedLight, + ), + positive = OudsColorScheme.Surface.Status.Positive( + emphasized = surfaceStatusPositiveEmphasizedLight, + muted = surfaceStatusPositiveMutedLight, + ), + warning = OudsColorScheme.Surface.Status.Warning( + emphasized = surfaceStatusWarningEmphasizedLight, + muted = surfaceStatusWarningMutedLight, + ) + ), ) }, ) internal val OudsColorSemanticTokens.darkColorScheme: OudsColorScheme get() = OudsColorScheme( - actionColors = with(actionColorTokens) { + action = with(actionColorTokens) { OudsColorScheme.Action( disabled = actionDisabledDark, - negativeEnabled = actionNegativeEnabledDark, - negativeFocus = actionNegativeFocusDark, - negativeHover = actionNegativeHoverDark, - negativeLoading = actionNegativeLoadingDark, - negativePressed = actionNegativePressedDark, + negative = OudsColorScheme.Action.Negative( + enabled = actionNegativeEnabledDark, + focus = actionNegativeFocusDark, + hover = actionNegativeHoverDark, + loading = actionNegativeLoadingDark, + pressed = actionNegativePressedDark, + ), enabled = actionEnabledDark, focus = actionFocusDark, highlighted = actionHighlightedDark, hover = actionHoverDark, loading = actionLoadingDark, pressed = actionPressedDark, - supportEnabled = actionSupportEnabledDark, - supportFocus = actionSupportFocusDark, - supportHover = actionSupportHoverDark, - supportLoading = actionSupportLoadingDark, - supportPressed = actionSupportPressedDark, + support = OudsColorScheme.Action.Support( + enabled = actionSupportEnabledDark, + focus = actionSupportFocusDark, + hover = actionSupportHoverDark, + loading = actionSupportLoadingDark, + pressed = actionSupportPressedDark, + ), selected = actionSelectedDark, visited = actionVisitedDark, ) }, - alwaysColors = with(alwaysColorTokens) { + always = with(alwaysColorTokens) { OudsColorScheme.Always( black = alwaysBlackDark, onBlack = alwaysOnBlackDark, @@ -460,7 +679,7 @@ internal val OudsColorSemanticTokens.darkColorScheme: OudsColorScheme white = alwaysWhiteDark, ) }, - backgroundColors = with(backgroundColorTokens) { + background = with(backgroundColorTokens) { OudsColorScheme.Background( emphasized = bgEmphasizedDark, primary = bgPrimaryDark, @@ -468,83 +687,111 @@ internal val OudsColorSemanticTokens.darkColorScheme: OudsColorScheme tertiary = bgTertiaryDark, ) }, - borderColors = with(borderColorTokens) { + border = with(borderColorTokens) { OudsColorScheme.Border( brandPrimary = borderBrandPrimaryDark, default = borderDefaultDark, emphasized = borderEmphasizedDark, focus = borderFocusDark, focusInset = borderFocusInsetDark, - onBrandPrimary = borderOnBrandPrimaryDark, + onBrand = OudsColorScheme.Border.OnBrand( + primary = borderOnBrandPrimaryDark, + ), ) }, - contentColors = with(contentColorTokens) { + content = with(contentColorTokens) { OudsColorScheme.Content( brandPrimary = contentBrandPrimaryDark, default = contentDefaultDark, disabled = contentDisabledDark, muted = contentMutedDark, - onActionDisabled = contentOnActionDisabledDark, - onActionNegative = contentOnActionNegativeDark, - onActionEnabled = contentOnActionEnabledDark, - onActionFocus = contentOnActionFocusDark, - onActionHighlighted = contentOnActionHighlightedDark, - onActionHover = contentOnActionHoverDark, - onActionLoading = contentOnActionLoadingDark, - onActionPressed = contentOnActionPressedDark, - onBrandPrimary = contentOnBrandPrimaryDark, - onOverlayEmphasized = contentOnOverlayEmphasizedDark, - onStatusEmphasized = contentOnStatusEmphasizedDark, - onStatusEmphasizedNeutral = contentOnStatusEmphasizedNeutralDark, - onStatusMuted = contentOnStatusMutedDark, - statusInfo = contentStatusInfoDark, - statusNegative = contentStatusNegativeDark, - statusPositive = contentStatusPositiveDark, - statusWarning = contentStatusWarningDark, + onAction = OudsColorScheme.Content.OnAction( + disabled = contentOnActionDisabledDark, + negative = contentOnActionNegativeDark, + enabled = contentOnActionEnabledDark, + focus = contentOnActionFocusDark, + highlighted = contentOnActionHighlightedDark, + hover = contentOnActionHoverDark, + loading = contentOnActionLoadingDark, + pressed = contentOnActionPressedDark, + ), + onBrand = OudsColorScheme.Content.OnBrand( + primary = contentOnBrandPrimaryDark, + ), + onOverlay = OudsColorScheme.Content.OnOverlay( + emphasized = contentOnOverlayEmphasizedDark, + ), + onStatus = OudsColorScheme.Content.OnStatus( + emphasized = contentOnStatusEmphasizedDark, + emphasizedNeutral = contentOnStatusEmphasizedNeutralDark, + muted = contentOnStatusMutedDark, + ), + status = OudsColorScheme.Content.Status( + info = contentStatusInfoDark, + negative = contentStatusNegativeDark, + positive = contentStatusPositiveDark, + warning = contentStatusWarningDark, + ), ) }, - decorativeColors = with(decorativeColorTokens) { + decorative = with(decorativeColorTokens) { OudsColorScheme.Decorative( - accent1Default = decorativeAccent1DefaultDark, - accent1Emphasized = decorativeAccent1EmphasizedDark, - accent1Muted = decorativeAccent1MutedDark, - accent2Default = decorativeAccent2DefaultDark, - accent2Emphasized = decorativeAccent2EmphasizedDark, - accent2Muted = decorativeAccent2MutedDark, - accent3Default = decorativeAccent3DefaultDark, - accent3Emphasized = decorativeAccent3EmphasizedDark, - accent3Muted = decorativeAccent3MutedDark, - accent4Default = decorativeAccent4DefaultDark, - accent4Emphasized = decorativeAccent4EmphasizedDark, - accent4Muted = decorativeAccent4MutedDark, - accent5Default = decorativeAccent5DefaultDark, - accent5Emphasized = decorativeAccent5EmphasizedDark, - accent5Muted = decorativeAccent5MutedDark, - brandPrimary = decorativeBrandPrimaryDark, - brandSecondary = decorativeBrandSecondaryDark, - brandTertiary = decorativeBrandTertiaryDark, - neutralDefault = decorativeNeutralDefaultDark, - neutralEmphasized = decorativeNeutralEmphasizedDark, - neutralMuted = decorativeNeutralMutedDark, - skinTint100 = decorativeSkinTint100Dark, - skinTint200 = decorativeSkinTint200Dark, - skinTint300 = decorativeSkinTint300Dark, - skinTint400 = decorativeSkinTint400Dark, - skinTint500 = decorativeSkinTint500Dark, - skinTint600 = decorativeSkinTint600Dark, - skinTint700 = decorativeSkinTint700Dark, - skinTint800 = decorativeSkinTint800Dark, - skinTint900 = decorativeSkinTint900Dark, + accent1 = OudsColorScheme.Decorative.Accent1( + default = decorativeAccent1DefaultDark, + emphasized = decorativeAccent1EmphasizedDark, + muted = decorativeAccent1MutedDark, + ), + accent2 = OudsColorScheme.Decorative.Accent2( + default = decorativeAccent2DefaultDark, + emphasized = decorativeAccent2EmphasizedDark, + muted = decorativeAccent2MutedDark, + ), + accent3 = OudsColorScheme.Decorative.Accent3( + default = decorativeAccent3DefaultDark, + emphasized = decorativeAccent3EmphasizedDark, + muted = decorativeAccent3MutedDark, + ), + accent4 = OudsColorScheme.Decorative.Accent4( + default = decorativeAccent4DefaultDark, + emphasized = decorativeAccent4EmphasizedDark, + muted = decorativeAccent4MutedDark, + ), + accent5 = OudsColorScheme.Decorative.Accent5( + default = decorativeAccent5DefaultDark, + emphasized = decorativeAccent5EmphasizedDark, + muted = decorativeAccent5MutedDark, + ), + brand = OudsColorScheme.Decorative.Brand( + primary = decorativeBrandPrimaryDark, + secondary = decorativeBrandSecondaryDark, + tertiary = decorativeBrandTertiaryDark, + ), + neutral = OudsColorScheme.Decorative.Neutral( + default = decorativeNeutralDefaultDark, + emphasized = decorativeNeutralEmphasizedDark, + muted = decorativeNeutralMutedDark, + ), + skin = OudsColorScheme.Decorative.Skin( + tint100 = decorativeSkinTint100Dark, + tint200 = decorativeSkinTint200Dark, + tint300 = decorativeSkinTint300Dark, + tint400 = decorativeSkinTint400Dark, + tint500 = decorativeSkinTint500Dark, + tint600 = decorativeSkinTint600Dark, + tint700 = decorativeSkinTint700Dark, + tint800 = decorativeSkinTint800Dark, + tint900 = decorativeSkinTint900Dark, + ), ) }, - opacityColors = with(opacityColorTokens) { + opacity = with(opacityColorTokens) { OudsColorScheme.Opacity( transparent = opacityTransparentDark, lowest = opacityLowestDark, lower = opacityLowerDark, ) }, - overlayColors = with(overlayColorTokens) { + overlay = with(overlayColorTokens) { OudsColorScheme.Overlay( default = overlayDefaultDark, drag = overlayDragDark, @@ -552,83 +799,124 @@ internal val OudsColorSemanticTokens.darkColorScheme: OudsColorScheme modal = overlayModalLight ) }, - repositoryColors = with(repositoryColorTokens) { + repository = with(repositoryColorTokens) { OudsColorScheme.Repository( - accentDefault = repositoryAccentDefaultDark, - accentHighest = repositoryAccentHighestDark, - accentLow = repositoryAccentLowDark, - accentLowest = repositoryAccentLowestDark, - infoDefault = repositoryInfoDefaultDark, - infoHighest = repositoryInfoHighestDark, - infoLow = repositoryInfoLowDark, - infoLowest = repositoryInfoLowestDark, - negativeDefault = repositoryNegativeDefaultDark, - negativeHigh = repositoryNegativeHighDark, - negativeHigher = repositoryNegativeHigherDark, - negativeHighest = repositoryNegativeHighestDark, - negativeLow = repositoryNegativeLowDark, - negativeLower = repositoryNegativeLowerDark, - negativeLowest = repositoryNegativeLowestDark, - neutralEmphasizedBlack = repositoryNeutralEmphasizedBlackDark, - neutralEmphasizedHigh = repositoryNeutralEmphasizedHighDark, - neutralEmphasizedHigher = repositoryNeutralEmphasizedHigherDark, - neutralEmphasizedHighest = repositoryNeutralEmphasizedHighestDark, - neutralEmphasizedMedium = repositoryNeutralEmphasizedMediumDark, - neutralMutedLower = repositoryNeutralMutedLowerDark, - neutralMutedLowest = repositoryNeutralMutedLowestDark, - neutralMutedWhite = repositoryNeutralMutedWhiteDark, - opacityBlackHigher = repositoryOpacityBlackHigherDark, - opacityBlackHighest = repositoryOpacityBlackHighestDark, - opacityBlackLow = repositoryOpacityBlackLowDark, - opacityBlackLower = repositoryOpacityBlackLowerDark, - opacityBlackLowest = repositoryOpacityBlackLowestDark, - opacityBlackMedium = repositoryOpacityBlackMediumDark, - opacityBlackTransparent = repositoryOpacityBlackTransparentDark, - opacityInfo = repositoryOpacityInfoDark, - opacityNegative = repositoryOpacityNegativeDark, - opacityPositive = repositoryOpacityPositiveDark, - opacityWarning = repositoryOpacityWarningDark, - opacityWhiteHigh = repositoryOpacityWhiteHighDark, - opacityWhiteHigher = repositoryOpacityWhiteHigherDark, - opacityWhiteHighest = repositoryOpacityWhiteHighestDark, - opacityWhiteLow = repositoryOpacityWhiteLowDark, - opacityWhiteLower = repositoryOpacityWhiteLowerDark, - opacityWhiteLowest = repositoryOpacityWhiteLowestDark, - opacityWhiteTransparent = repositoryOpacityWhiteTransparentDark, - positiveDefault = repositoryPositiveDefaultDark, - positiveHighest = repositoryPositiveHighestDark, - positiveLow = repositoryPositiveLowDark, - positiveLowest = repositoryPositiveLowestDark, - primaryDefault = repositoryPrimaryDefaultDark, - primaryLow = repositoryPrimaryLowDark, - warningDefault = repositoryWarningDefaultDark, - warningHighest = repositoryWarningHighestDark, - warningLow = repositoryWarningLowDark, - warningLowest = repositoryWarningLowestDark, + accent = OudsColorScheme.Repository.Accent( + default = repositoryAccentDefaultDark, + highest = repositoryAccentHighestDark, + low = repositoryAccentLowDark, + lowest = repositoryAccentLowestDark, + ), + info = OudsColorScheme.Repository.Info( + default = repositoryInfoDefaultDark, + highest = repositoryInfoHighestDark, + low = repositoryInfoLowDark, + lowest = repositoryInfoLowestDark, + ), + negative = OudsColorScheme.Repository.Negative( + default = repositoryNegativeDefaultDark, + high = repositoryNegativeHighDark, + higher = repositoryNegativeHigherDark, + highest = repositoryNegativeHighestDark, + low = repositoryNegativeLowDark, + lower = repositoryNegativeLowerDark, + lowest = repositoryNegativeLowestDark, + ), + + neutral = OudsColorScheme.Repository.Neutral( + emphasized = OudsColorScheme.Repository.Neutral.Emphasized( + black = repositoryNeutralEmphasizedBlackDark, + high = repositoryNeutralEmphasizedHighDark, + higher = repositoryNeutralEmphasizedHigherDark, + highest = repositoryNeutralEmphasizedHighestDark, + medium = repositoryNeutralEmphasizedMediumDark, + ), + muted = OudsColorScheme.Repository.Neutral.Muted( + lower = repositoryNeutralMutedLowerDark, + lowest = repositoryNeutralMutedLowestDark, + white = repositoryNeutralMutedWhiteDark, + ) + ), + opacity = OudsColorScheme.Repository.Opacity( + black = OudsColorScheme.Repository.Opacity.Black( + higher = repositoryOpacityBlackHigherDark, + highest = repositoryOpacityBlackHighestDark, + low = repositoryOpacityBlackLowDark, + lower = repositoryOpacityBlackLowerDark, + lowest = repositoryOpacityBlackLowestDark, + medium = repositoryOpacityBlackMediumDark, + transparent = repositoryOpacityBlackTransparentDark, + ), + info = repositoryOpacityInfoDark, + negative = repositoryOpacityNegativeDark, + positive = repositoryOpacityPositiveDark, + warning = repositoryOpacityWarningDark, + white = OudsColorScheme.Repository.Opacity.White( + high = repositoryOpacityWhiteHighDark, + higher = repositoryOpacityWhiteHigherDark, + highest = repositoryOpacityWhiteHighestDark, + low = repositoryOpacityWhiteLowDark, + lower = repositoryOpacityWhiteLowerDark, + lowest = repositoryOpacityWhiteLowestDark, + transparent = repositoryOpacityWhiteTransparentDark, + ), + ), + positive = OudsColorScheme.Repository.Positive( + default = repositoryPositiveDefaultDark, + highest = repositoryPositiveHighestDark, + low = repositoryPositiveLowDark, + lowest = repositoryPositiveLowestDark, + ), + primary = OudsColorScheme.Repository.Primary( + default = repositoryPrimaryDefaultDark, + low = repositoryPrimaryLowDark, + ), + warning = OudsColorScheme.Repository.Warning( + default = repositoryWarningDefaultDark, + highest = repositoryWarningHighestDark, + low = repositoryWarningLowDark, + lowest = repositoryWarningLowestDark, + ), ) }, - surfaceColors = with(surfaceColorTokens) { + surface = with(surfaceColorTokens) { OudsColorScheme.Surface( - brandPrimary = surfaceBrandPrimaryDark, - statusAccentEmphasized = surfaceStatusAccentEmphasizedDark, - statusAccentMuted = surfaceStatusAccentMutedDark, - statusInfoEmphasized = surfaceStatusInfoEmphasizedDark, - statusInfoMuted = surfaceStatusInfoMutedDark, - statusNegativeEmphasized = surfaceStatusNegativeEmphasizedDark, - statusNegativeMuted = surfaceStatusNegativeMutedDark, - statusNeutralEmphasized = surfaceStatusNeutralEmphasizedDark, - statusNeutralMuted = surfaceStatusNeutralMutedDark, - statusPositiveEmphasized = surfaceStatusPositiveEmphasizedDark, - statusPositiveMuted = surfaceStatusPositiveMutedDark, - statusWarningEmphasized = surfaceStatusWarningEmphasizedDark, - statusWarningMuted = surfaceStatusWarningMutedDark, + brand = OudsColorScheme.Surface.Brand( + primary = surfaceBrandPrimaryDark, + ), + status = OudsColorScheme.Surface.Status( + accent = OudsColorScheme.Surface.Status.Accent( + emphasized = surfaceStatusAccentEmphasizedDark, + muted = surfaceStatusAccentMutedDark, + ), + info = OudsColorScheme.Surface.Status.Info( + emphasized = surfaceStatusInfoEmphasizedDark, + muted = surfaceStatusInfoMutedDark, + ), + negative = OudsColorScheme.Surface.Status.Negative( + emphasized = surfaceStatusNegativeEmphasizedDark, + muted = surfaceStatusNegativeMutedDark, + ), + neutral = OudsColorScheme.Surface.Status.Neutral( + emphasized = surfaceStatusNeutralEmphasizedDark, + muted = surfaceStatusNeutralMutedDark, + ), + positive = OudsColorScheme.Surface.Status.Positive( + emphasized = surfaceStatusPositiveEmphasizedDark, + muted = surfaceStatusPositiveMutedDark, + ), + warning = OudsColorScheme.Surface.Status.Warning( + emphasized = surfaceStatusWarningEmphasizedDark, + muted = surfaceStatusWarningMutedDark, + ) + ), ) }, ) @Stable private fun OudsColorScheme.fromToken(token: OudsColorKeyToken.Action): Color { - return with(actionColors) { + return with(action) { when (token) { OudsColorKeyToken.Action.Disabled -> disabled OudsColorKeyToken.Action.Enabled -> enabled @@ -636,18 +924,18 @@ private fun OudsColorScheme.fromToken(token: OudsColorKeyToken.Action): Color { OudsColorKeyToken.Action.Highlighted -> highlighted OudsColorKeyToken.Action.Hover -> hover OudsColorKeyToken.Action.Loading -> loading - OudsColorKeyToken.Action.Negative.Enabled -> negativeEnabled - OudsColorKeyToken.Action.Negative.Focus -> negativeFocus - OudsColorKeyToken.Action.Negative.Hover -> negativeHover - OudsColorKeyToken.Action.Negative.Loading -> negativeLoading - OudsColorKeyToken.Action.Negative.Pressed -> negativePressed + OudsColorKeyToken.Action.Negative.Enabled -> negative.enabled + OudsColorKeyToken.Action.Negative.Focus -> negative.focus + OudsColorKeyToken.Action.Negative.Hover -> negative.hover + OudsColorKeyToken.Action.Negative.Loading -> negative.loading + OudsColorKeyToken.Action.Negative.Pressed -> negative.pressed OudsColorKeyToken.Action.Pressed -> pressed OudsColorKeyToken.Action.Selected -> selected - OudsColorKeyToken.Action.Support.Enabled -> supportEnabled - OudsColorKeyToken.Action.Support.Focus -> supportFocus - OudsColorKeyToken.Action.Support.Hover -> supportHover - OudsColorKeyToken.Action.Support.Loading -> supportLoading - OudsColorKeyToken.Action.Support.Pressed -> supportPressed + OudsColorKeyToken.Action.Support.Enabled -> support.enabled + OudsColorKeyToken.Action.Support.Focus -> support.focus + OudsColorKeyToken.Action.Support.Hover -> support.hover + OudsColorKeyToken.Action.Support.Loading -> support.loading + OudsColorKeyToken.Action.Support.Pressed -> support.pressed OudsColorKeyToken.Action.Visited -> visited } } @@ -655,7 +943,7 @@ private fun OudsColorScheme.fromToken(token: OudsColorKeyToken.Action): Color { @Stable private fun OudsColorScheme.fromToken(token: OudsColorKeyToken.Always): Color { - return with(alwaysColors) { + return with(always) { when (token) { OudsColorKeyToken.Always.Black -> black OudsColorKeyToken.Always.OnBlack -> onBlack @@ -667,7 +955,7 @@ private fun OudsColorScheme.fromToken(token: OudsColorKeyToken.Always): Color { @Stable private fun OudsColorScheme.fromToken(token: OudsColorKeyToken.Background): Color { - return with(backgroundColors) { + return with(background) { when (token) { OudsColorKeyToken.Background.Emphasized -> emphasized OudsColorKeyToken.Background.Primary -> primary @@ -679,168 +967,168 @@ private fun OudsColorScheme.fromToken(token: OudsColorKeyToken.Background): Colo @Stable private fun OudsColorScheme.fromToken(token: OudsColorKeyToken.Border): Color { - return with(borderColors) { + return with(border) { when (token) { OudsColorKeyToken.Border.BrandPrimary -> brandPrimary OudsColorKeyToken.Border.Default -> default OudsColorKeyToken.Border.Emphasized -> emphasized OudsColorKeyToken.Border.Focus -> focus OudsColorKeyToken.Border.FocusInset -> focusInset - OudsColorKeyToken.Border.OnBrand.Primary -> onBrandPrimary + OudsColorKeyToken.Border.OnBrand.Primary -> onBrand.primary } } } @Stable private fun OudsColorScheme.fromToken(token: OudsColorKeyToken.Content): Color { - return with(contentColors) { + return with(content) { when (token) { OudsColorKeyToken.Content.BrandPrimary -> brandPrimary OudsColorKeyToken.Content.Default -> default OudsColorKeyToken.Content.Disabled -> disabled OudsColorKeyToken.Content.Muted -> muted - OudsColorKeyToken.Content.OnAction.Disabled -> onActionDisabled - OudsColorKeyToken.Content.OnAction.Negative -> onActionNegative - OudsColorKeyToken.Content.OnAction.Enabled -> onActionEnabled - OudsColorKeyToken.Content.OnAction.Focus -> onActionFocus - OudsColorKeyToken.Content.OnAction.Highlighted -> onActionHighlighted - OudsColorKeyToken.Content.OnAction.Hover -> onActionHover - OudsColorKeyToken.Content.OnAction.Loading -> onActionLoading - OudsColorKeyToken.Content.OnAction.Pressed -> onActionPressed - OudsColorKeyToken.Content.OnBrand.Primary -> onBrandPrimary - OudsColorKeyToken.Content.OnOverlay.Emphasized -> onOverlayEmphasized - OudsColorKeyToken.Content.OnStatus.Emphasized -> onStatusEmphasized - OudsColorKeyToken.Content.OnStatus.EmphasizedNeutral -> onStatusEmphasizedNeutral - OudsColorKeyToken.Content.OnStatus.Muted -> onStatusMuted - OudsColorKeyToken.Content.Status.Info -> statusInfo - OudsColorKeyToken.Content.Status.Negative -> statusNegative - OudsColorKeyToken.Content.Status.Positive -> statusPositive - OudsColorKeyToken.Content.Status.Warning -> statusWarning + OudsColorKeyToken.Content.OnAction.Disabled -> onAction.disabled + OudsColorKeyToken.Content.OnAction.Negative -> onAction.negative + OudsColorKeyToken.Content.OnAction.Enabled -> onAction.enabled + OudsColorKeyToken.Content.OnAction.Focus -> onAction.focus + OudsColorKeyToken.Content.OnAction.Highlighted -> onAction.highlighted + OudsColorKeyToken.Content.OnAction.Hover -> onAction.hover + OudsColorKeyToken.Content.OnAction.Loading -> onAction.loading + OudsColorKeyToken.Content.OnAction.Pressed -> onAction.pressed + OudsColorKeyToken.Content.OnBrand.Primary -> onBrand.primary + OudsColorKeyToken.Content.OnOverlay.Emphasized -> onOverlay.emphasized + OudsColorKeyToken.Content.OnStatus.Emphasized -> onStatus.emphasized + OudsColorKeyToken.Content.OnStatus.EmphasizedNeutral -> onStatus.emphasizedNeutral + OudsColorKeyToken.Content.OnStatus.Muted -> onStatus.muted + OudsColorKeyToken.Content.Status.Info -> status.info + OudsColorKeyToken.Content.Status.Negative -> status.negative + OudsColorKeyToken.Content.Status.Positive -> status.positive + OudsColorKeyToken.Content.Status.Warning -> status.warning } } } @Stable private fun OudsColorScheme.fromToken(token: OudsColorKeyToken.Decorative): Color { - return with(decorativeColors) { + return with(decorative) { when (token) { - OudsColorKeyToken.Decorative.Accent1.Default -> accent1Default - OudsColorKeyToken.Decorative.Accent1.Emphasized -> accent1Emphasized - OudsColorKeyToken.Decorative.Accent1.Muted -> accent1Muted - OudsColorKeyToken.Decorative.Accent2.Default -> accent2Default - OudsColorKeyToken.Decorative.Accent2.Emphasized -> accent2Emphasized - OudsColorKeyToken.Decorative.Accent2.Muted -> accent2Muted - OudsColorKeyToken.Decorative.Accent3.Default -> accent3Default - OudsColorKeyToken.Decorative.Accent3.Emphasized -> accent3Emphasized - OudsColorKeyToken.Decorative.Accent3.Muted -> accent3Muted - OudsColorKeyToken.Decorative.Accent4.Default -> accent4Default - OudsColorKeyToken.Decorative.Accent4.Emphasized -> accent4Emphasized - OudsColorKeyToken.Decorative.Accent4.Muted -> accent4Muted - OudsColorKeyToken.Decorative.Accent5.Default -> accent5Default - OudsColorKeyToken.Decorative.Accent5.Emphasized -> accent5Emphasized - OudsColorKeyToken.Decorative.Accent5.Muted -> accent5Muted - OudsColorKeyToken.Decorative.Brand.Primary -> brandPrimary - OudsColorKeyToken.Decorative.Brand.Secondary -> brandSecondary - OudsColorKeyToken.Decorative.Brand.Tertiary -> brandTertiary - OudsColorKeyToken.Decorative.Neutral.Default -> neutralDefault - OudsColorKeyToken.Decorative.Neutral.Emphasized -> neutralEmphasized - OudsColorKeyToken.Decorative.Neutral.Muted -> neutralMuted - OudsColorKeyToken.Decorative.Skin.Tint100 -> skinTint100 - OudsColorKeyToken.Decorative.Skin.Tint200 -> skinTint200 - OudsColorKeyToken.Decorative.Skin.Tint300 -> skinTint300 - OudsColorKeyToken.Decorative.Skin.Tint400 -> skinTint400 - OudsColorKeyToken.Decorative.Skin.Tint500 -> skinTint500 - OudsColorKeyToken.Decorative.Skin.Tint600 -> skinTint600 - OudsColorKeyToken.Decorative.Skin.Tint700 -> skinTint700 - OudsColorKeyToken.Decorative.Skin.Tint800 -> skinTint800 - OudsColorKeyToken.Decorative.Skin.Tint900 -> skinTint900 + OudsColorKeyToken.Decorative.Accent1.Default -> accent1.default + OudsColorKeyToken.Decorative.Accent1.Emphasized -> accent1.emphasized + OudsColorKeyToken.Decorative.Accent1.Muted -> accent1.muted + OudsColorKeyToken.Decorative.Accent2.Default -> accent2.default + OudsColorKeyToken.Decorative.Accent2.Emphasized -> accent2.emphasized + OudsColorKeyToken.Decorative.Accent2.Muted -> accent2.muted + OudsColorKeyToken.Decorative.Accent3.Default -> accent3.default + OudsColorKeyToken.Decorative.Accent3.Emphasized -> accent3.emphasized + OudsColorKeyToken.Decorative.Accent3.Muted -> accent3.muted + OudsColorKeyToken.Decorative.Accent4.Default -> accent4.default + OudsColorKeyToken.Decorative.Accent4.Emphasized -> accent4.emphasized + OudsColorKeyToken.Decorative.Accent4.Muted -> accent4.muted + OudsColorKeyToken.Decorative.Accent5.Default -> accent5.default + OudsColorKeyToken.Decorative.Accent5.Emphasized -> accent5.emphasized + OudsColorKeyToken.Decorative.Accent5.Muted -> accent5.muted + OudsColorKeyToken.Decorative.Brand.Primary -> brand.primary + OudsColorKeyToken.Decorative.Brand.Secondary -> brand.secondary + OudsColorKeyToken.Decorative.Brand.Tertiary -> brand.tertiary + OudsColorKeyToken.Decorative.Neutral.Default -> neutral.default + OudsColorKeyToken.Decorative.Neutral.Emphasized -> neutral.emphasized + OudsColorKeyToken.Decorative.Neutral.Muted -> neutral.muted + OudsColorKeyToken.Decorative.Skin.Tint100 -> skin.tint100 + OudsColorKeyToken.Decorative.Skin.Tint200 -> skin.tint200 + OudsColorKeyToken.Decorative.Skin.Tint300 -> skin.tint300 + OudsColorKeyToken.Decorative.Skin.Tint400 -> skin.tint400 + OudsColorKeyToken.Decorative.Skin.Tint500 -> skin.tint500 + OudsColorKeyToken.Decorative.Skin.Tint600 -> skin.tint600 + OudsColorKeyToken.Decorative.Skin.Tint700 -> skin.tint700 + OudsColorKeyToken.Decorative.Skin.Tint800 -> skin.tint800 + OudsColorKeyToken.Decorative.Skin.Tint900 -> skin.tint900 } } } @Stable private fun OudsColorScheme.fromToken(token: OudsColorKeyToken.Repository): Color { - return with(repositoryColors) { + return with(repository) { when (token) { - OudsColorKeyToken.Repository.Accent.Default -> accentDefault - OudsColorKeyToken.Repository.Accent.Highest -> accentHighest - OudsColorKeyToken.Repository.Accent.Low -> accentLow - OudsColorKeyToken.Repository.Accent.Lowest -> accentLowest - OudsColorKeyToken.Repository.Info.Default -> infoDefault - OudsColorKeyToken.Repository.Info.Highest -> infoHighest - OudsColorKeyToken.Repository.Info.Low -> infoLow - OudsColorKeyToken.Repository.Info.Lowest -> infoLowest - OudsColorKeyToken.Repository.Negative.Default -> negativeDefault - OudsColorKeyToken.Repository.Negative.High -> negativeHigh - OudsColorKeyToken.Repository.Negative.Higher -> negativeHigher - OudsColorKeyToken.Repository.Negative.Highest -> negativeHighest - OudsColorKeyToken.Repository.Negative.Low -> negativeLow - OudsColorKeyToken.Repository.Negative.Lower -> negativeLower - OudsColorKeyToken.Repository.Negative.Lowest -> negativeLowest - OudsColorKeyToken.Repository.Neutral.Emphasized.Black -> neutralEmphasizedBlack - OudsColorKeyToken.Repository.Neutral.Emphasized.High -> neutralEmphasizedHigh - OudsColorKeyToken.Repository.Neutral.Emphasized.Higher -> neutralEmphasizedHigher - OudsColorKeyToken.Repository.Neutral.Emphasized.Highest -> neutralEmphasizedHighest - OudsColorKeyToken.Repository.Neutral.Emphasized.Medium -> neutralEmphasizedMedium - OudsColorKeyToken.Repository.Neutral.Muted.Lower -> neutralMutedLower - OudsColorKeyToken.Repository.Neutral.Muted.Lowest -> neutralMutedLowest - OudsColorKeyToken.Repository.Neutral.Muted.White -> neutralMutedWhite - OudsColorKeyToken.Repository.Opacity.Black.Higher -> opacityBlackHigher - OudsColorKeyToken.Repository.Opacity.Black.Highest -> opacityBlackHighest - OudsColorKeyToken.Repository.Opacity.Black.Low -> opacityBlackLow - OudsColorKeyToken.Repository.Opacity.Black.Lower -> opacityBlackLower - OudsColorKeyToken.Repository.Opacity.Black.Lowest -> opacityBlackLowest - OudsColorKeyToken.Repository.Opacity.Black.Medium -> opacityBlackMedium - OudsColorKeyToken.Repository.Opacity.Black.Transparent -> opacityBlackTransparent - OudsColorKeyToken.Repository.Opacity.Info -> opacityInfo - OudsColorKeyToken.Repository.Opacity.Negative -> opacityNegative - OudsColorKeyToken.Repository.Opacity.Positive -> opacityPositive - OudsColorKeyToken.Repository.Opacity.Warning -> opacityWarning - OudsColorKeyToken.Repository.Opacity.White.High -> opacityWhiteHigh - OudsColorKeyToken.Repository.Opacity.White.Higher -> opacityWhiteHigher - OudsColorKeyToken.Repository.Opacity.White.Highest -> opacityWhiteHighest - OudsColorKeyToken.Repository.Opacity.White.Low -> opacityWhiteLow - OudsColorKeyToken.Repository.Opacity.White.Lower -> opacityWhiteLower - OudsColorKeyToken.Repository.Opacity.White.Lowest -> opacityWhiteLowest - OudsColorKeyToken.Repository.Opacity.White.Transparent -> opacityWhiteTransparent - OudsColorKeyToken.Repository.Positive.Default -> positiveDefault - OudsColorKeyToken.Repository.Positive.Highest -> positiveHighest - OudsColorKeyToken.Repository.Positive.Low -> positiveLow - OudsColorKeyToken.Repository.Positive.Lowest -> positiveLowest - OudsColorKeyToken.Repository.Primary.Default -> positiveDefault - OudsColorKeyToken.Repository.Primary.Low -> primaryLow - OudsColorKeyToken.Repository.Warning.Default -> warningDefault - OudsColorKeyToken.Repository.Warning.Highest -> warningHighest - OudsColorKeyToken.Repository.Warning.Low -> warningLow - OudsColorKeyToken.Repository.Warning.Lowest -> warningLowest + OudsColorKeyToken.Repository.Accent.Default -> accent.default + OudsColorKeyToken.Repository.Accent.Highest -> accent.highest + OudsColorKeyToken.Repository.Accent.Low -> accent.low + OudsColorKeyToken.Repository.Accent.Lowest -> accent.lowest + OudsColorKeyToken.Repository.Info.Default -> info.default + OudsColorKeyToken.Repository.Info.Highest -> info.highest + OudsColorKeyToken.Repository.Info.Low -> info.low + OudsColorKeyToken.Repository.Info.Lowest -> info.lowest + OudsColorKeyToken.Repository.Negative.Default -> negative.default + OudsColorKeyToken.Repository.Negative.High -> negative.high + OudsColorKeyToken.Repository.Negative.Higher -> negative.higher + OudsColorKeyToken.Repository.Negative.Highest -> negative.highest + OudsColorKeyToken.Repository.Negative.Low -> negative.low + OudsColorKeyToken.Repository.Negative.Lower -> negative.lower + OudsColorKeyToken.Repository.Negative.Lowest -> negative.lowest + OudsColorKeyToken.Repository.Neutral.Emphasized.Black -> neutral.emphasized.black + OudsColorKeyToken.Repository.Neutral.Emphasized.High -> neutral.emphasized.high + OudsColorKeyToken.Repository.Neutral.Emphasized.Higher -> neutral.emphasized.higher + OudsColorKeyToken.Repository.Neutral.Emphasized.Highest -> neutral.emphasized.highest + OudsColorKeyToken.Repository.Neutral.Emphasized.Medium -> neutral.emphasized.medium + OudsColorKeyToken.Repository.Neutral.Muted.Lower -> neutral.muted.lower + OudsColorKeyToken.Repository.Neutral.Muted.Lowest -> neutral.muted.lowest + OudsColorKeyToken.Repository.Neutral.Muted.White -> neutral.muted.white + OudsColorKeyToken.Repository.Opacity.Black.Higher -> opacity.black.higher + OudsColorKeyToken.Repository.Opacity.Black.Highest -> opacity.black.highest + OudsColorKeyToken.Repository.Opacity.Black.Low -> opacity.black.low + OudsColorKeyToken.Repository.Opacity.Black.Lower -> opacity.black.lower + OudsColorKeyToken.Repository.Opacity.Black.Lowest -> opacity.black.lowest + OudsColorKeyToken.Repository.Opacity.Black.Medium -> opacity.black.medium + OudsColorKeyToken.Repository.Opacity.Black.Transparent -> opacity.black.transparent + OudsColorKeyToken.Repository.Opacity.Info -> opacity.info + OudsColorKeyToken.Repository.Opacity.Negative -> opacity.negative + OudsColorKeyToken.Repository.Opacity.Positive -> opacity.positive + OudsColorKeyToken.Repository.Opacity.Warning -> opacity.warning + OudsColorKeyToken.Repository.Opacity.White.High -> opacity.white.high + OudsColorKeyToken.Repository.Opacity.White.Higher -> opacity.white.higher + OudsColorKeyToken.Repository.Opacity.White.Highest -> opacity.white.highest + OudsColorKeyToken.Repository.Opacity.White.Low -> opacity.white.low + OudsColorKeyToken.Repository.Opacity.White.Lower -> opacity.white.lower + OudsColorKeyToken.Repository.Opacity.White.Lowest -> opacity.white.lowest + OudsColorKeyToken.Repository.Opacity.White.Transparent -> opacity.white.transparent + OudsColorKeyToken.Repository.Positive.Default -> positive.default + OudsColorKeyToken.Repository.Positive.Highest -> positive.highest + OudsColorKeyToken.Repository.Positive.Low -> positive.low + OudsColorKeyToken.Repository.Positive.Lowest -> positive.lowest + OudsColorKeyToken.Repository.Primary.Default -> primary.default + OudsColorKeyToken.Repository.Primary.Low -> primary.low + OudsColorKeyToken.Repository.Warning.Default -> warning.default + OudsColorKeyToken.Repository.Warning.Highest -> warning.highest + OudsColorKeyToken.Repository.Warning.Low -> warning.low + OudsColorKeyToken.Repository.Warning.Lowest -> warning.lowest } } } @Stable private fun OudsColorScheme.fromToken(token: OudsColorKeyToken.Surface): Color { - return with(surfaceColors) { + return with(surface) { when (token) { - OudsColorKeyToken.Surface.Brand.Primary -> brandPrimary - OudsColorKeyToken.Surface.Status.Accent.Emphasized -> statusAccentEmphasized - OudsColorKeyToken.Surface.Status.Accent.Muted -> statusAccentMuted - OudsColorKeyToken.Surface.Status.Info.Emphasized -> statusInfoEmphasized - OudsColorKeyToken.Surface.Status.Info.Muted -> statusInfoMuted - OudsColorKeyToken.Surface.Status.Negative.Emphasized -> statusNegativeEmphasized - OudsColorKeyToken.Surface.Status.Negative.Muted -> statusNegativeMuted - OudsColorKeyToken.Surface.Status.Neutral.Emphasized -> statusNeutralEmphasized - OudsColorKeyToken.Surface.Status.Neutral.Muted -> statusNeutralMuted - OudsColorKeyToken.Surface.Status.Positive.Emphasized -> statusPositiveEmphasized - OudsColorKeyToken.Surface.Status.Positive.Muted -> statusPositiveMuted - OudsColorKeyToken.Surface.Status.Warning.Emphasized -> statusWarningEmphasized - OudsColorKeyToken.Surface.Status.Warning.Muted -> statusWarningMuted + OudsColorKeyToken.Surface.Brand.Primary -> brand.primary + OudsColorKeyToken.Surface.Status.Accent.Emphasized -> status.accent.emphasized + OudsColorKeyToken.Surface.Status.Accent.Muted -> status.accent.muted + OudsColorKeyToken.Surface.Status.Info.Emphasized -> status.info.emphasized + OudsColorKeyToken.Surface.Status.Info.Muted -> status.info.muted + OudsColorKeyToken.Surface.Status.Negative.Emphasized -> status.negative.emphasized + OudsColorKeyToken.Surface.Status.Negative.Muted -> status.negative.muted + OudsColorKeyToken.Surface.Status.Neutral.Emphasized -> status.neutral.emphasized + OudsColorKeyToken.Surface.Status.Neutral.Muted -> status.neutral.muted + OudsColorKeyToken.Surface.Status.Positive.Emphasized -> status.positive.emphasized + OudsColorKeyToken.Surface.Status.Positive.Muted -> status.positive.muted + OudsColorKeyToken.Surface.Status.Warning.Emphasized -> status.warning.emphasized + OudsColorKeyToken.Surface.Status.Warning.Muted -> status.warning.muted } } } @Stable private fun OudsColorScheme.fromToken(token: OudsColorKeyToken.Opacity): Color { - return with(opacityColors) { + return with(opacity) { when (token) { OudsColorKeyToken.Opacity.Lower -> lower OudsColorKeyToken.Opacity.Lowest -> lowest @@ -852,7 +1140,7 @@ private fun OudsColorScheme.fromToken(token: OudsColorKeyToken.Opacity): Color { @Stable private fun OudsColorScheme.fromToken(token: OudsColorKeyToken.Overlay): Color { - return with(overlayColors) { + return with(overlay) { when (token) { OudsColorKeyToken.Overlay.Default -> default OudsColorKeyToken.Overlay.Drag -> drag 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 317ffd5b..e1d7e754 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 @@ -25,7 +25,7 @@ import com.orange.ouds.theme.tokens.semantic.OudsSizeSemanticTokens */ data class OudsSizes( val icon: Icon, - val maxWidthType: MaxWidthType + val maxWidth: MaxWidth ) { data class Icon( val decorative: Decorative, @@ -134,29 +134,33 @@ data class OudsSizes( } } - data class MaxWidthType( - val display: Display, - val heading: Heading, - val body: Body + data class MaxWidth( + val type: Type ) { - data class Display( - val small: Dp, - val medium: Dp, - val large: Dp, - ) + data class Type( + val display: Display, + val heading: Heading, + val body: Body + ) { + data class Display( + val small: Dp, + val medium: Dp, + val large: Dp + ) - data class Heading( - val small: Dp, - val medium: Dp, - val large: Dp, - val extraLarge: Dp, - ) + data class Heading( + val small: Dp, + val medium: Dp, + val large: Dp, + val extraLarge: Dp + ) - data class Body( - val small: Dp, - val medium: Dp, - val large: Dp, - ) + data class Body( + val small: Dp, + val medium: Dp, + val large: Dp + ) + } } } @@ -238,22 +242,24 @@ internal fun OudsSizeSemanticTokens.getSizes(windowWidthSizeClass: WindowWidthSi ), ), ), - maxWidthType = OudsSizes.MaxWidthType( - display = OudsSizes.MaxWidthType.Display( - small = getTokenValue(maxWidthTypeDisplaySmallMobile, maxWidthTypeDisplaySmallTablet).dp, - medium = getTokenValue(maxWidthTypeDisplayMediumMobile, maxWidthTypeDisplayMediumTablet).dp, - large = getTokenValue(maxWidthTypeDisplayLargeMobile, maxWidthTypeDisplayLargeTablet).dp, - ), - heading = OudsSizes.MaxWidthType.Heading( - small = getTokenValue(maxWidthTypeHeadingSmallMobile, maxWidthTypeHeadingSmallTablet).dp, - medium = getTokenValue(maxWidthTypeHeadingMediumMobile, maxWidthTypeHeadingMediumTablet).dp, - large = getTokenValue(maxWidthTypeHeadingLargeMobile, maxWidthTypeHeadingLargeTablet).dp, - extraLarge = getTokenValue(maxWidthTypeHeadingXlargeMobile, maxWidthTypeHeadingXlargeTablet).dp, - ), - body = OudsSizes.MaxWidthType.Body( - small = getTokenValue(maxWidthTypeBodySmallMobile, maxWidthTypeBodySmallTablet).dp, - medium = getTokenValue(maxWidthTypeBodyMediumMobile, maxWidthTypeBodyMediumTablet).dp, - large = getTokenValue(maxWidthTypeBodyLargeMobile, maxWidthTypeBodyLargeTablet).dp, + maxWidth = OudsSizes.MaxWidth( + type = OudsSizes.MaxWidth.Type( + display = OudsSizes.MaxWidth.Type.Display( + small = getTokenValue(maxWidthTypeDisplaySmallMobile, maxWidthTypeDisplaySmallTablet).dp, + medium = getTokenValue(maxWidthTypeDisplayMediumMobile, maxWidthTypeDisplayMediumTablet).dp, + large = getTokenValue(maxWidthTypeDisplayLargeMobile, maxWidthTypeDisplayLargeTablet).dp, + ), + heading = OudsSizes.MaxWidth.Type.Heading( + small = getTokenValue(maxWidthTypeHeadingSmallMobile, maxWidthTypeHeadingSmallTablet).dp, + medium = getTokenValue(maxWidthTypeHeadingMediumMobile, maxWidthTypeHeadingMediumTablet).dp, + large = getTokenValue(maxWidthTypeHeadingLargeMobile, maxWidthTypeHeadingLargeTablet).dp, + extraLarge = getTokenValue(maxWidthTypeHeadingXlargeMobile, maxWidthTypeHeadingXlargeTablet).dp, + ), + body = OudsSizes.MaxWidth.Type.Body( + small = getTokenValue(maxWidthTypeBodySmallMobile, maxWidthTypeBodySmallTablet).dp, + medium = getTokenValue(maxWidthTypeBodyMediumMobile, maxWidthTypeBodyMediumTablet).dp, + large = getTokenValue(maxWidthTypeBodyLargeMobile, maxWidthTypeBodyLargeTablet).dp, + ) ) ) ) @@ -261,85 +267,95 @@ internal fun OudsSizeSemanticTokens.getSizes(windowWidthSizeClass: WindowWidthSi @Stable private fun OudsSizes.fromToken(token: OudsSizeKeyToken.Icon.Decorative): Dp { - return when (token) { - OudsSizeKeyToken.Icon.Decorative.ExtraExtraSmall -> icon.decorative.extraExtraSmall - OudsSizeKeyToken.Icon.Decorative.ExtraSmall -> icon.decorative.extraSmall - OudsSizeKeyToken.Icon.Decorative.Small -> icon.decorative.small - OudsSizeKeyToken.Icon.Decorative.Medium -> icon.decorative.medium - OudsSizeKeyToken.Icon.Decorative.Large -> icon.decorative.large - OudsSizeKeyToken.Icon.Decorative.ExtraLarge -> icon.decorative.extraLarge - OudsSizeKeyToken.Icon.Decorative.ExtraExtraLarge -> icon.decorative.extraExtraLarge + return with(icon.decorative) { + when (token) { + OudsSizeKeyToken.Icon.Decorative.ExtraExtraSmall -> extraExtraSmall + OudsSizeKeyToken.Icon.Decorative.ExtraSmall -> extraSmall + OudsSizeKeyToken.Icon.Decorative.Small -> small + OudsSizeKeyToken.Icon.Decorative.Medium -> medium + OudsSizeKeyToken.Icon.Decorative.Large -> large + OudsSizeKeyToken.Icon.Decorative.ExtraLarge -> extraLarge + OudsSizeKeyToken.Icon.Decorative.ExtraExtraLarge -> extraExtraLarge + } } } @Stable private fun OudsSizes.fromToken(token: OudsSizeKeyToken.Icon.WithHeading): Dp { - return when (token) { - OudsSizeKeyToken.Icon.WithHeading.ExtraLarge.SizeSmall -> icon.withHeading.extraLarge.sizeSmall - OudsSizeKeyToken.Icon.WithHeading.ExtraLarge.SizeMedium -> icon.withHeading.extraLarge.sizeMedium - OudsSizeKeyToken.Icon.WithHeading.ExtraLarge.SizeLarge -> icon.withHeading.extraLarge.sizeLarge - OudsSizeKeyToken.Icon.WithHeading.Large.SizeSmall -> icon.withHeading.large.sizeSmall - OudsSizeKeyToken.Icon.WithHeading.Large.SizeMedium -> icon.withHeading.large.sizeMedium - OudsSizeKeyToken.Icon.WithHeading.Large.SizeLarge -> icon.withHeading.large.sizeLarge - OudsSizeKeyToken.Icon.WithHeading.Medium.SizeSmall -> icon.withHeading.medium.sizeSmall - OudsSizeKeyToken.Icon.WithHeading.Medium.SizeMedium -> icon.withHeading.medium.sizeMedium - OudsSizeKeyToken.Icon.WithHeading.Medium.SizeLarge -> icon.withHeading.medium.sizeLarge - OudsSizeKeyToken.Icon.WithHeading.Small.SizeSmall -> icon.withHeading.small.sizeSmall - OudsSizeKeyToken.Icon.WithHeading.Small.SizeMedium -> icon.withHeading.small.sizeMedium - OudsSizeKeyToken.Icon.WithHeading.Small.SizeLarge -> icon.withHeading.small.sizeLarge + return with(icon.withHeading) { + when (token) { + OudsSizeKeyToken.Icon.WithHeading.ExtraLarge.SizeSmall -> extraLarge.sizeSmall + OudsSizeKeyToken.Icon.WithHeading.ExtraLarge.SizeMedium -> extraLarge.sizeMedium + OudsSizeKeyToken.Icon.WithHeading.ExtraLarge.SizeLarge -> extraLarge.sizeLarge + OudsSizeKeyToken.Icon.WithHeading.Large.SizeSmall -> large.sizeSmall + OudsSizeKeyToken.Icon.WithHeading.Large.SizeMedium -> large.sizeMedium + OudsSizeKeyToken.Icon.WithHeading.Large.SizeLarge -> large.sizeLarge + OudsSizeKeyToken.Icon.WithHeading.Medium.SizeSmall -> medium.sizeSmall + OudsSizeKeyToken.Icon.WithHeading.Medium.SizeMedium -> medium.sizeMedium + OudsSizeKeyToken.Icon.WithHeading.Medium.SizeLarge -> medium.sizeLarge + OudsSizeKeyToken.Icon.WithHeading.Small.SizeSmall -> small.sizeSmall + OudsSizeKeyToken.Icon.WithHeading.Small.SizeMedium -> small.sizeMedium + OudsSizeKeyToken.Icon.WithHeading.Small.SizeLarge -> small.sizeLarge + } } } @Stable private fun OudsSizes.fromToken(token: OudsSizeKeyToken.Icon.WithBody): Dp { - return when (token) { - OudsSizeKeyToken.Icon.WithBody.Large.SizeSmall -> icon.withBody.large.sizeSmall - OudsSizeKeyToken.Icon.WithBody.Large.SizeMedium -> icon.withBody.large.sizeMedium - OudsSizeKeyToken.Icon.WithBody.Large.SizeLarge -> icon.withBody.large.sizeLarge - OudsSizeKeyToken.Icon.WithBody.Medium.SizeSmall -> icon.withBody.medium.sizeSmall - OudsSizeKeyToken.Icon.WithBody.Medium.SizeMedium -> icon.withBody.medium.sizeMedium - OudsSizeKeyToken.Icon.WithBody.Medium.SizeLarge -> icon.withBody.medium.sizeLarge - OudsSizeKeyToken.Icon.WithBody.Small.SizeSmall -> icon.withBody.small.sizeSmall - OudsSizeKeyToken.Icon.WithBody.Small.SizeMedium -> icon.withBody.small.sizeMedium - OudsSizeKeyToken.Icon.WithBody.Small.SizeLarge -> icon.withBody.small.sizeLarge + return with(icon.withBody) { + when (token) { + OudsSizeKeyToken.Icon.WithBody.Large.SizeSmall -> large.sizeSmall + OudsSizeKeyToken.Icon.WithBody.Large.SizeMedium -> large.sizeMedium + OudsSizeKeyToken.Icon.WithBody.Large.SizeLarge -> large.sizeLarge + OudsSizeKeyToken.Icon.WithBody.Medium.SizeSmall -> medium.sizeSmall + OudsSizeKeyToken.Icon.WithBody.Medium.SizeMedium -> medium.sizeMedium + OudsSizeKeyToken.Icon.WithBody.Medium.SizeLarge -> medium.sizeLarge + OudsSizeKeyToken.Icon.WithBody.Small.SizeSmall -> small.sizeSmall + OudsSizeKeyToken.Icon.WithBody.Small.SizeMedium -> small.sizeMedium + OudsSizeKeyToken.Icon.WithBody.Small.SizeLarge -> small.sizeLarge + } } } @Stable private fun OudsSizes.fromToken(token: OudsSizeKeyToken.Icon.WithLabel): Dp { - return when (token) { - OudsSizeKeyToken.Icon.WithLabel.ExtraLarge.SizeSmall -> icon.withLabel.extraLarge.sizeSmall - OudsSizeKeyToken.Icon.WithLabel.ExtraLarge.SizeMedium -> icon.withLabel.extraLarge.sizeMedium - OudsSizeKeyToken.Icon.WithLabel.ExtraLarge.SizeLarge -> icon.withLabel.extraLarge.sizeLarge - OudsSizeKeyToken.Icon.WithLabel.Large.SizeExtraSmall -> icon.withLabel.large.sizeExtraSmall - OudsSizeKeyToken.Icon.WithLabel.Large.SizeSmall -> icon.withLabel.large.sizeSmall - OudsSizeKeyToken.Icon.WithLabel.Large.SizeMedium -> icon.withLabel.large.sizeMedium - OudsSizeKeyToken.Icon.WithLabel.Large.SizeLarge -> icon.withLabel.large.sizeLarge - OudsSizeKeyToken.Icon.WithLabel.Large.SizeExtraLarge -> icon.withLabel.large.sizeExtraLarge - OudsSizeKeyToken.Icon.WithLabel.Medium.SizeExtraSmall -> icon.withLabel.medium.sizeExtraSmall - OudsSizeKeyToken.Icon.WithLabel.Medium.SizeSmall -> icon.withLabel.medium.sizeSmall - OudsSizeKeyToken.Icon.WithLabel.Medium.SizeMedium -> icon.withLabel.medium.sizeMedium - OudsSizeKeyToken.Icon.WithLabel.Medium.SizeLarge -> icon.withLabel.medium.sizeLarge - OudsSizeKeyToken.Icon.WithLabel.Small.SizeExtraSmall -> icon.withLabel.small.sizeExtraSmall - OudsSizeKeyToken.Icon.WithLabel.Small.SizeSmall -> icon.withLabel.small.sizeSmall - OudsSizeKeyToken.Icon.WithLabel.Small.SizeMedium -> icon.withLabel.small.sizeMedium - OudsSizeKeyToken.Icon.WithLabel.Small.SizeLarge -> icon.withLabel.small.sizeLarge + return with(icon.withLabel) { + when (token) { + OudsSizeKeyToken.Icon.WithLabel.ExtraLarge.SizeSmall -> extraLarge.sizeSmall + OudsSizeKeyToken.Icon.WithLabel.ExtraLarge.SizeMedium -> extraLarge.sizeMedium + OudsSizeKeyToken.Icon.WithLabel.ExtraLarge.SizeLarge -> extraLarge.sizeLarge + OudsSizeKeyToken.Icon.WithLabel.Large.SizeExtraSmall -> large.sizeExtraSmall + OudsSizeKeyToken.Icon.WithLabel.Large.SizeSmall -> large.sizeSmall + OudsSizeKeyToken.Icon.WithLabel.Large.SizeMedium -> large.sizeMedium + OudsSizeKeyToken.Icon.WithLabel.Large.SizeLarge -> large.sizeLarge + OudsSizeKeyToken.Icon.WithLabel.Large.SizeExtraLarge -> large.sizeExtraLarge + OudsSizeKeyToken.Icon.WithLabel.Medium.SizeExtraSmall -> medium.sizeExtraSmall + OudsSizeKeyToken.Icon.WithLabel.Medium.SizeSmall -> medium.sizeSmall + OudsSizeKeyToken.Icon.WithLabel.Medium.SizeMedium -> medium.sizeMedium + OudsSizeKeyToken.Icon.WithLabel.Medium.SizeLarge -> medium.sizeLarge + OudsSizeKeyToken.Icon.WithLabel.Small.SizeExtraSmall -> small.sizeExtraSmall + OudsSizeKeyToken.Icon.WithLabel.Small.SizeSmall -> small.sizeSmall + OudsSizeKeyToken.Icon.WithLabel.Small.SizeMedium -> small.sizeMedium + OudsSizeKeyToken.Icon.WithLabel.Small.SizeLarge -> small.sizeLarge + } } } @Stable private fun OudsSizes.fromToken(token: OudsSizeKeyToken.MaxWidth): Dp { - return when (token) { - OudsSizeKeyToken.MaxWidth.Type.Display.Small -> maxWidthType.display.small - OudsSizeKeyToken.MaxWidth.Type.Display.Medium -> maxWidthType.display.medium - OudsSizeKeyToken.MaxWidth.Type.Display.Large -> maxWidthType.display.large - OudsSizeKeyToken.MaxWidth.Type.Heading.Small -> maxWidthType.heading.small - OudsSizeKeyToken.MaxWidth.Type.Heading.Medium -> maxWidthType.heading.medium - OudsSizeKeyToken.MaxWidth.Type.Heading.Large -> maxWidthType.heading.large - OudsSizeKeyToken.MaxWidth.Type.Heading.ExtraLarge -> maxWidthType.heading.extraLarge - OudsSizeKeyToken.MaxWidth.Type.Body.Small -> maxWidthType.body.small - OudsSizeKeyToken.MaxWidth.Type.Body.Medium -> maxWidthType.body.medium - OudsSizeKeyToken.MaxWidth.Type.Body.Large -> maxWidthType.body.large + return with(maxWidth.type) { + when (token) { + OudsSizeKeyToken.MaxWidth.Type.Display.Small -> display.small + OudsSizeKeyToken.MaxWidth.Type.Display.Medium -> display.medium + OudsSizeKeyToken.MaxWidth.Type.Display.Large -> display.large + OudsSizeKeyToken.MaxWidth.Type.Heading.Small -> heading.small + OudsSizeKeyToken.MaxWidth.Type.Heading.Medium -> heading.medium + OudsSizeKeyToken.MaxWidth.Type.Heading.Large -> heading.large + OudsSizeKeyToken.MaxWidth.Type.Heading.ExtraLarge -> heading.extraLarge + OudsSizeKeyToken.MaxWidth.Type.Body.Small -> body.small + OudsSizeKeyToken.MaxWidth.Type.Body.Medium -> body.medium + OudsSizeKeyToken.MaxWidth.Type.Body.Large -> body.large + } } } diff --git a/core/src/main/java/com/orange/ouds/core/theme/OudsTypography.kt b/core/src/main/java/com/orange/ouds/core/theme/OudsTypography.kt index 3ae99f5a..9ce422d1 100644 --- a/core/src/main/java/com/orange/ouds/core/theme/OudsTypography.kt +++ b/core/src/main/java/com/orange/ouds/core/theme/OudsTypography.kt @@ -26,177 +26,225 @@ import com.orange.ouds.theme.tokens.semantic.OudsFontSemanticTokens * @suppress */ data class OudsTypography( - val displayLarge: TextStyle, - val displayMedium: TextStyle, - val displaySmall: TextStyle, - val headingExtraLarge: TextStyle, - val headingLarge: TextStyle, - val headingMedium: TextStyle, - val headingSmall: TextStyle, - val bodyDefaultLarge: TextStyle, - val bodyDefaultMedium: TextStyle, - val bodyDefaultSmall: TextStyle, - val bodyStrongLarge: TextStyle, - val bodyStrongMedium: TextStyle, - val bodyStrongSmall: TextStyle, - val labelDefaultExtraLarge: TextStyle, - val labelDefaultLarge: TextStyle, - val labelDefaultMedium: TextStyle, - val labelDefaultSmall: TextStyle, - val labelStrongExtraLarge: TextStyle, - val labelStrongLarge: TextStyle, - val labelStrongMedium: TextStyle, - val labelStrongSmall: TextStyle, -) + val display: Display, + val heading: Heading, + val body: Body, + val label: Label +) { + data class Display( + val large: TextStyle, + val medium: TextStyle, + val small: TextStyle + ) + + data class Heading( + val extraLarge: TextStyle, + val large: TextStyle, + val medium: TextStyle, + val small: TextStyle + ) + + data class Body( + val default: Default, + val strong: Strong + ) { + data class Default( + val large: TextStyle, + val medium: TextStyle, + val small: TextStyle + ) + + data class Strong( + val large: TextStyle, + val medium: TextStyle, + val small: TextStyle + ) + } + + data class Label( + val default: Default, + val strong: Strong + ) { + data class Default( + val extraLarge: TextStyle, + val large: TextStyle, + val medium: TextStyle, + val small: TextStyle + ) + + data class Strong( + val extraLarge: TextStyle, + val large: TextStyle, + val medium: TextStyle, + val small: TextStyle + ) + } +} internal fun OudsFontSemanticTokens.getTypography(fontFamily: FontFamily, windowWidthSizeClass: WindowWidthSizeClass) = with(windowWidthSizeClass) { OudsTypography( - displayLarge = TextStyle( - fontFamily = fontFamily, - fontWeight = FontWeight(weightDisplay), - fontSize = getTokenValue(sizeDisplayLargeMobile, sizeDisplayLargeTablet).sp, - lineHeight = getTokenValue(lineHeightDisplayLargeMobile, lineHeightDisplayLargeTablet).sp, - letterSpacing = getTokenValue(letterSpacingDisplayLargeMobile, letterSpacingDisplayLargeTablet).sp - ), - displayMedium = TextStyle( - fontFamily = fontFamily, - fontWeight = FontWeight(weightDisplay), - fontSize = getTokenValue(sizeDisplayMediumMobile, sizeDisplayMediumTablet).sp, - lineHeight = getTokenValue(lineHeightDisplayMediumMobile, lineHeightDisplayMediumTablet).sp, - letterSpacing = getTokenValue(letterSpacingDisplayMediumMobile, letterSpacingDisplayMediumTablet).sp - ), - displaySmall = TextStyle( - fontFamily = fontFamily, - fontWeight = FontWeight(weightDisplay), - fontSize = getTokenValue(sizeDisplaySmallMobile, sizeDisplaySmallTablet).sp, - lineHeight = getTokenValue(lineHeightDisplaySmallMobile, lineHeightDisplaySmallTablet).sp, - letterSpacing = getTokenValue(letterSpacingDisplaySmallMobile, letterSpacingDisplaySmallTablet).sp - ), - headingExtraLarge = TextStyle( - fontFamily = fontFamily, - fontWeight = FontWeight(weightHeading), - fontSize = getTokenValue(sizeHeadingXlargeMobile, sizeHeadingXlargeTablet).sp, - lineHeight = getTokenValue(lineHeightHeadingXlargeMobile, lineHeightHeadingXlargeTablet).sp, - letterSpacing = getTokenValue(letterSpacingHeadingXlargeMobile, letterSpacingHeadingXlargeTablet).sp - ), - headingLarge = TextStyle( - fontFamily = fontFamily, - fontWeight = FontWeight(weightHeading), - fontSize = getTokenValue(sizeHeadingLargeMobile, sizeHeadingLargeTablet).sp, - lineHeight = getTokenValue(lineHeightHeadingLargeMobile, lineHeightHeadingLargeTablet).sp, - letterSpacing = getTokenValue(letterSpacingHeadingLargeMobile, letterSpacingHeadingLargeTablet).sp - ), - headingMedium = TextStyle( - fontFamily = fontFamily, - fontWeight = FontWeight(weightHeading), - fontSize = getTokenValue(sizeHeadingMediumMobile, sizeHeadingMediumTablet).sp, - lineHeight = getTokenValue(lineHeightHeadingMediumMobile, lineHeightHeadingMediumTablet).sp, - letterSpacing = getTokenValue(letterSpacingHeadingMediumMobile, letterSpacingHeadingMediumTablet).sp - ), - headingSmall = TextStyle( - fontFamily = fontFamily, - fontWeight = FontWeight(weightHeading), - fontSize = getTokenValue(sizeHeadingSmallMobile, sizeHeadingSmallTablet).sp, - lineHeight = getTokenValue(lineHeightHeadingSmallMobile, lineHeightHeadingSmallTablet).sp, - letterSpacing = getTokenValue(letterSpacingHeadingSmallMobile, letterSpacingHeadingSmallTablet).sp - ), - bodyDefaultLarge = TextStyle( - fontFamily = fontFamily, - fontWeight = FontWeight(weightBodyDefault), - fontSize = getTokenValue(sizeBodyLargeMobile, sizeBodyLargeTablet).sp, - lineHeight = getTokenValue(lineHeightBodyLargeMobile, lineHeightBodyLargeTablet).sp, - letterSpacing = getTokenValue(letterSpacingBodyLargeMobile, letterSpacingBodyLargeTablet).sp - ), - bodyDefaultMedium = TextStyle( - fontFamily = fontFamily, - fontWeight = FontWeight(weightBodyDefault), - fontSize = getTokenValue(sizeBodyMediumMobile, sizeBodyMediumTablet).sp, - lineHeight = getTokenValue(lineHeightBodyMediumMobile, lineHeightBodyMediumTablet).sp, - letterSpacing = getTokenValue(letterSpacingBodyMediumMobile, letterSpacingBodyMediumTablet).sp - ), - bodyDefaultSmall = TextStyle( - fontFamily = fontFamily, - fontWeight = FontWeight(weightBodyDefault), - fontSize = getTokenValue(sizeBodySmallMobile, sizeBodySmallTablet).sp, - lineHeight = getTokenValue(lineHeightBodySmallMobile, lineHeightBodySmallTablet).sp, - letterSpacing = getTokenValue(letterSpacingBodySmallMobile, letterSpacingBodySmallTablet).sp - ), - bodyStrongLarge = TextStyle( - fontFamily = fontFamily, - fontWeight = FontWeight(weightBodyStrong), - fontSize = getTokenValue(sizeBodyLargeMobile, sizeBodyLargeTablet).sp, - lineHeight = getTokenValue(lineHeightBodyLargeMobile, lineHeightBodyLargeTablet).sp, - letterSpacing = getTokenValue(letterSpacingBodyLargeMobile, letterSpacingBodyLargeTablet).sp - ), - bodyStrongMedium = TextStyle( - fontFamily = fontFamily, - fontWeight = FontWeight(weightBodyStrong), - fontSize = getTokenValue(sizeBodyMediumMobile, sizeBodyMediumTablet).sp, - lineHeight = getTokenValue(lineHeightBodyMediumMobile, lineHeightBodyMediumTablet).sp, - letterSpacing = getTokenValue(letterSpacingBodyMediumMobile, letterSpacingBodyMediumTablet).sp - ), - bodyStrongSmall = TextStyle( - fontFamily = fontFamily, - fontWeight = FontWeight(weightBodyStrong), - fontSize = getTokenValue(sizeBodySmallMobile, sizeBodySmallTablet).sp, - lineHeight = getTokenValue(lineHeightBodySmallMobile, lineHeightBodySmallTablet).sp, - letterSpacing = getTokenValue(letterSpacingBodySmallMobile, letterSpacingBodySmallTablet).sp - ), - labelDefaultExtraLarge = TextStyle( - fontFamily = fontFamily, - fontWeight = FontWeight(weightLabelDefault), - fontSize = sizeLabelXlarge.sp, - lineHeight = lineHeightLabelXlarge.sp, - letterSpacing = letterSpacingLabelXlarge.sp - ), - labelDefaultLarge = TextStyle( - fontFamily = fontFamily, - fontWeight = FontWeight(weightLabelDefault), - fontSize = sizeLabelLarge.sp, - lineHeight = lineHeightLabelLarge.sp, - letterSpacing = letterSpacingLabelLarge.sp - ), - labelDefaultMedium = TextStyle( - fontFamily = fontFamily, - fontWeight = FontWeight(weightLabelDefault), - fontSize = sizeLabelMedium.sp, - lineHeight = lineHeightLabelMedium.sp, - letterSpacing = letterSpacingLabelMedium.sp - ), - labelDefaultSmall = TextStyle( - fontFamily = fontFamily, - fontWeight = FontWeight(weightLabelDefault), - fontSize = sizeLabelSmall.sp, - lineHeight = lineHeightLabelSmall.sp, - letterSpacing = letterSpacingLabelSmall.sp - ), - labelStrongExtraLarge = TextStyle( - fontFamily = fontFamily, - fontWeight = FontWeight(weightLabelStrong), - fontSize = sizeLabelXlarge.sp, - lineHeight = lineHeightLabelXlarge.sp, - letterSpacing = letterSpacingLabelXlarge.sp + display = OudsTypography.Display( + large = TextStyle( + fontFamily = fontFamily, + fontWeight = FontWeight(weightDisplay), + fontSize = getTokenValue(sizeDisplayLargeMobile, sizeDisplayLargeTablet).sp, + lineHeight = getTokenValue(lineHeightDisplayLargeMobile, lineHeightDisplayLargeTablet).sp, + letterSpacing = getTokenValue(letterSpacingDisplayLargeMobile, letterSpacingDisplayLargeTablet).sp + ), + medium = TextStyle( + fontFamily = fontFamily, + fontWeight = FontWeight(weightDisplay), + fontSize = getTokenValue(sizeDisplayMediumMobile, sizeDisplayMediumTablet).sp, + lineHeight = getTokenValue(lineHeightDisplayMediumMobile, lineHeightDisplayMediumTablet).sp, + letterSpacing = getTokenValue(letterSpacingDisplayMediumMobile, letterSpacingDisplayMediumTablet).sp + ), + small = TextStyle( + fontFamily = fontFamily, + fontWeight = FontWeight(weightDisplay), + fontSize = getTokenValue(sizeDisplaySmallMobile, sizeDisplaySmallTablet).sp, + lineHeight = getTokenValue(lineHeightDisplaySmallMobile, lineHeightDisplaySmallTablet).sp, + letterSpacing = getTokenValue(letterSpacingDisplaySmallMobile, letterSpacingDisplaySmallTablet).sp + ), ), - labelStrongLarge = TextStyle( - fontFamily = fontFamily, - fontWeight = FontWeight(weightLabelStrong), - fontSize = sizeLabelLarge.sp, - lineHeight = lineHeightLabelLarge.sp, - letterSpacing = letterSpacingLabelLarge.sp + heading = OudsTypography.Heading( + extraLarge = TextStyle( + fontFamily = fontFamily, + fontWeight = FontWeight(weightHeading), + fontSize = getTokenValue(sizeHeadingXlargeMobile, sizeHeadingXlargeTablet).sp, + lineHeight = getTokenValue(lineHeightHeadingXlargeMobile, lineHeightHeadingXlargeTablet).sp, + letterSpacing = getTokenValue(letterSpacingHeadingXlargeMobile, letterSpacingHeadingXlargeTablet).sp + ), + large = TextStyle( + fontFamily = fontFamily, + fontWeight = FontWeight(weightHeading), + fontSize = getTokenValue(sizeHeadingLargeMobile, sizeHeadingLargeTablet).sp, + lineHeight = getTokenValue(lineHeightHeadingLargeMobile, lineHeightHeadingLargeTablet).sp, + letterSpacing = getTokenValue(letterSpacingHeadingLargeMobile, letterSpacingHeadingLargeTablet).sp + ), + medium = TextStyle( + fontFamily = fontFamily, + fontWeight = FontWeight(weightHeading), + fontSize = getTokenValue(sizeHeadingMediumMobile, sizeHeadingMediumTablet).sp, + lineHeight = getTokenValue(lineHeightHeadingMediumMobile, lineHeightHeadingMediumTablet).sp, + letterSpacing = getTokenValue(letterSpacingHeadingMediumMobile, letterSpacingHeadingMediumTablet).sp + ), + small = TextStyle( + fontFamily = fontFamily, + fontWeight = FontWeight(weightHeading), + fontSize = getTokenValue(sizeHeadingSmallMobile, sizeHeadingSmallTablet).sp, + lineHeight = getTokenValue(lineHeightHeadingSmallMobile, lineHeightHeadingSmallTablet).sp, + letterSpacing = getTokenValue(letterSpacingHeadingSmallMobile, letterSpacingHeadingSmallTablet).sp + ), ), - labelStrongMedium = TextStyle( - fontFamily = fontFamily, - fontWeight = FontWeight(weightLabelStrong), - fontSize = sizeLabelMedium.sp, - lineHeight = lineHeightLabelMedium.sp, - letterSpacing = letterSpacingLabelMedium.sp + body = OudsTypography.Body( + default = OudsTypography.Body.Default( + large = TextStyle( + fontFamily = fontFamily, + fontWeight = FontWeight(weightBodyDefault), + fontSize = getTokenValue(sizeBodyLargeMobile, sizeBodyLargeTablet).sp, + lineHeight = getTokenValue(lineHeightBodyLargeMobile, lineHeightBodyLargeTablet).sp, + letterSpacing = getTokenValue(letterSpacingBodyLargeMobile, letterSpacingBodyLargeTablet).sp + ), + medium = TextStyle( + fontFamily = fontFamily, + fontWeight = FontWeight(weightBodyDefault), + fontSize = getTokenValue(sizeBodyMediumMobile, sizeBodyMediumTablet).sp, + lineHeight = getTokenValue(lineHeightBodyMediumMobile, lineHeightBodyMediumTablet).sp, + letterSpacing = getTokenValue(letterSpacingBodyMediumMobile, letterSpacingBodyMediumTablet).sp + ), + small = TextStyle( + fontFamily = fontFamily, + fontWeight = FontWeight(weightBodyDefault), + fontSize = getTokenValue(sizeBodySmallMobile, sizeBodySmallTablet).sp, + lineHeight = getTokenValue(lineHeightBodySmallMobile, lineHeightBodySmallTablet).sp, + letterSpacing = getTokenValue(letterSpacingBodySmallMobile, letterSpacingBodySmallTablet).sp + ), + ), + strong = OudsTypography.Body.Strong( + large = TextStyle( + fontFamily = fontFamily, + fontWeight = FontWeight(weightBodyStrong), + fontSize = getTokenValue(sizeBodyLargeMobile, sizeBodyLargeTablet).sp, + lineHeight = getTokenValue(lineHeightBodyLargeMobile, lineHeightBodyLargeTablet).sp, + letterSpacing = getTokenValue(letterSpacingBodyLargeMobile, letterSpacingBodyLargeTablet).sp + ), + medium = TextStyle( + fontFamily = fontFamily, + fontWeight = FontWeight(weightBodyStrong), + fontSize = getTokenValue(sizeBodyMediumMobile, sizeBodyMediumTablet).sp, + lineHeight = getTokenValue(lineHeightBodyMediumMobile, lineHeightBodyMediumTablet).sp, + letterSpacing = getTokenValue(letterSpacingBodyMediumMobile, letterSpacingBodyMediumTablet).sp + ), + small = TextStyle( + fontFamily = fontFamily, + fontWeight = FontWeight(weightBodyStrong), + fontSize = getTokenValue(sizeBodySmallMobile, sizeBodySmallTablet).sp, + lineHeight = getTokenValue(lineHeightBodySmallMobile, lineHeightBodySmallTablet).sp, + letterSpacing = getTokenValue(letterSpacingBodySmallMobile, letterSpacingBodySmallTablet).sp + ), + ) ), - labelStrongSmall = TextStyle( - fontFamily = fontFamily, - fontWeight = FontWeight(weightLabelStrong), - fontSize = sizeLabelSmall.sp, - lineHeight = lineHeightLabelSmall.sp, - letterSpacing = letterSpacingLabelSmall.sp + label = OudsTypography.Label( + default = OudsTypography.Label.Default( + extraLarge = TextStyle( + fontFamily = fontFamily, + fontWeight = FontWeight(weightLabelDefault), + fontSize = sizeLabelXlarge.sp, + lineHeight = lineHeightLabelXlarge.sp, + letterSpacing = letterSpacingLabelXlarge.sp + ), + large = TextStyle( + fontFamily = fontFamily, + fontWeight = FontWeight(weightLabelDefault), + fontSize = sizeLabelLarge.sp, + lineHeight = lineHeightLabelLarge.sp, + letterSpacing = letterSpacingLabelLarge.sp + ), + medium = TextStyle( + fontFamily = fontFamily, + fontWeight = FontWeight(weightLabelDefault), + fontSize = sizeLabelMedium.sp, + lineHeight = lineHeightLabelMedium.sp, + letterSpacing = letterSpacingLabelMedium.sp + ), + small = TextStyle( + fontFamily = fontFamily, + fontWeight = FontWeight(weightLabelDefault), + fontSize = sizeLabelSmall.sp, + lineHeight = lineHeightLabelSmall.sp, + letterSpacing = letterSpacingLabelSmall.sp + ), + ), + strong = OudsTypography.Label.Strong( + extraLarge = TextStyle( + fontFamily = fontFamily, + fontWeight = FontWeight(weightLabelStrong), + fontSize = sizeLabelXlarge.sp, + lineHeight = lineHeightLabelXlarge.sp, + letterSpacing = letterSpacingLabelXlarge.sp + ), + large = TextStyle( + fontFamily = fontFamily, + fontWeight = FontWeight(weightLabelStrong), + fontSize = sizeLabelLarge.sp, + lineHeight = lineHeightLabelLarge.sp, + letterSpacing = letterSpacingLabelLarge.sp + ), + medium = TextStyle( + fontFamily = fontFamily, + fontWeight = FontWeight(weightLabelStrong), + fontSize = sizeLabelMedium.sp, + lineHeight = lineHeightLabelMedium.sp, + letterSpacing = letterSpacingLabelMedium.sp + ), + small = TextStyle( + fontFamily = fontFamily, + fontWeight = FontWeight(weightLabelStrong), + fontSize = sizeLabelSmall.sp, + lineHeight = lineHeightLabelSmall.sp, + letterSpacing = letterSpacingLabelSmall.sp + ), + ) ), ) } @@ -204,27 +252,27 @@ internal fun OudsFontSemanticTokens.getTypography(fontFamily: FontFamily, window @Stable private fun OudsTypography.fromToken(token: OudsTypographyKeyToken): TextStyle { return when (token) { - OudsTypographyKeyToken.Display.Large -> displayLarge - OudsTypographyKeyToken.Display.Medium -> displayMedium - OudsTypographyKeyToken.Display.Small -> displaySmall - OudsTypographyKeyToken.Heading.ExtraLarge -> headingExtraLarge - OudsTypographyKeyToken.Heading.Large -> headingLarge - OudsTypographyKeyToken.Heading.Medium -> headingMedium - OudsTypographyKeyToken.Heading.Small -> headingSmall - OudsTypographyKeyToken.Body.Default.Large -> bodyDefaultLarge - OudsTypographyKeyToken.Body.Default.Medium -> bodyDefaultMedium - OudsTypographyKeyToken.Body.Default.Small -> bodyDefaultSmall - OudsTypographyKeyToken.Body.Strong.Large -> bodyStrongLarge - OudsTypographyKeyToken.Body.Strong.Medium -> bodyStrongMedium - OudsTypographyKeyToken.Body.Strong.Small -> bodyStrongSmall - OudsTypographyKeyToken.Label.Default.ExtraLarge -> labelDefaultExtraLarge - OudsTypographyKeyToken.Label.Default.Large -> labelDefaultLarge - OudsTypographyKeyToken.Label.Default.Medium -> labelDefaultMedium - OudsTypographyKeyToken.Label.Default.Small -> labelDefaultSmall - OudsTypographyKeyToken.Label.Strong.ExtraLarge -> labelStrongExtraLarge - OudsTypographyKeyToken.Label.Strong.Large -> labelStrongLarge - OudsTypographyKeyToken.Label.Strong.Medium -> labelStrongMedium - OudsTypographyKeyToken.Label.Strong.Small -> labelStrongSmall + OudsTypographyKeyToken.Display.Large -> display.large + OudsTypographyKeyToken.Display.Medium -> display.medium + OudsTypographyKeyToken.Display.Small -> display.small + OudsTypographyKeyToken.Heading.ExtraLarge -> heading.extraLarge + OudsTypographyKeyToken.Heading.Large -> heading.large + OudsTypographyKeyToken.Heading.Medium -> heading.medium + OudsTypographyKeyToken.Heading.Small -> heading.small + OudsTypographyKeyToken.Body.Default.Large -> body.default.large + OudsTypographyKeyToken.Body.Default.Medium -> body.default.medium + OudsTypographyKeyToken.Body.Default.Small -> body.default.small + OudsTypographyKeyToken.Body.Strong.Large -> body.strong.large + OudsTypographyKeyToken.Body.Strong.Medium -> body.strong.medium + OudsTypographyKeyToken.Body.Strong.Small -> body.strong.small + OudsTypographyKeyToken.Label.Default.ExtraLarge -> label.default.extraLarge + OudsTypographyKeyToken.Label.Default.Large -> label.default.large + OudsTypographyKeyToken.Label.Default.Medium -> label.default.medium + OudsTypographyKeyToken.Label.Default.Small -> label.default.small + OudsTypographyKeyToken.Label.Strong.ExtraLarge -> label.strong.extraLarge + OudsTypographyKeyToken.Label.Strong.Large -> label.strong.large + OudsTypographyKeyToken.Label.Strong.Medium -> label.strong.medium + OudsTypographyKeyToken.Label.Strong.Small -> label.strong.small } }