diff --git a/README.md b/README.md index f5d23b67..21781b9c 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ ![Carbon catalog pres](https://github.com/user-attachments/assets/d55e6893-ab18-498f-abec-1e2998dfe293) -[![Kotlin](https://img.shields.io/badge/2.0.0-blue?logo=kotlin&logoColor=white&color=7F52FF)](http://kotlinlang.org) -[![Compose Multiplatform](https://img.shields.io/badge/1.6.11-green?logo=jetpackcompose&logoColor=white&color=4284F3)](https://www.jetbrains.com/lp/compose-multiplatform) +[![Kotlin](https://img.shields.io/badge/2.0.20-blue?logo=kotlin&logoColor=white&color=7F52FF)](http://kotlinlang.org) +[![Compose Multiplatform](https://img.shields.io/badge/1.7.0-green?logo=jetpackcompose&logoColor=white&color=4284F3)](https://www.jetbrains.com/lp/compose-multiplatform) [![CI | compile & tests](https://github.com/gabrieldrn/carbon-compose/actions/workflows/ci-lib-workflow.yml/badge.svg)](https://github.com/gabrieldrn/carbon-compose/actions/workflows/ci-lib-workflow.yml) diff --git a/build-logic/convention/src/main/kotlin/CarbonApplicationConventionPlugin.kt b/build-logic/convention/src/main/kotlin/CarbonApplicationConventionPlugin.kt index 80ae29b6..88cb1f73 100644 --- a/build-logic/convention/src/main/kotlin/CarbonApplicationConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/CarbonApplicationConventionPlugin.kt @@ -1,12 +1,13 @@ +import com.android.build.gradle.internal.dsl.BaseAppModuleExtension import com.gabrieldrn.carbon.buildlogic.Constants import com.gabrieldrn.carbon.buildlogic.configureKotlinAndroidCommon import com.gabrieldrn.carbon.buildlogic.getPlugin import com.gabrieldrn.carbon.buildlogic.libs -import com.android.build.gradle.internal.dsl.BaseAppModuleExtension import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.kotlin.dsl.configure import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi +import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension /** @@ -14,7 +15,7 @@ import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension */ class CarbonApplicationConventionPlugin : Plugin { - @OptIn(ExperimentalKotlinGradlePluginApi::class) + @OptIn(ExperimentalKotlinGradlePluginApi::class, ExperimentalWasmDsl::class) override fun apply(target: Project) = with(target) { val libs = libs diff --git a/build-logic/convention/src/main/kotlin/CarbonMultiplatformLibraryConventionPlugin.kt b/build-logic/convention/src/main/kotlin/CarbonMultiplatformLibraryConventionPlugin.kt index fd21c71d..6ecb1e24 100644 --- a/build-logic/convention/src/main/kotlin/CarbonMultiplatformLibraryConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/CarbonMultiplatformLibraryConventionPlugin.kt @@ -9,9 +9,9 @@ import org.gradle.api.Project import org.gradle.kotlin.dsl.configure import org.jetbrains.kotlin.compose.compiler.gradle.ComposeCompilerGradlePluginExtension import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi +import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetTree -import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl /** * A plugin used by kmp libraries modules from Carbon to configure themselves. It diff --git a/carbon/api/android/carbon.api b/carbon/api/android/carbon.api index 8a7b6af4..3dfa6b56 100644 --- a/carbon/api/android/carbon.api +++ b/carbon/api/android/carbon.api @@ -1578,7 +1578,14 @@ public final class com/gabrieldrn/carbon/toggle/ToggleKt { public static final fun Toggle (ZLkotlin/jvm/functions/Function1;Landroidx/compose/ui/Modifier;Ljava/lang/String;Ljava/lang/String;ZZLandroidx/compose/foundation/interaction/MutableInteractionSource;Landroidx/compose/runtime/Composer;II)V } +public final class com/gabrieldrn/carbon/uishell/ComposableSingletons$UIShellHeaderKt { + public static final field INSTANCE Lcom/gabrieldrn/carbon/uishell/ComposableSingletons$UIShellHeaderKt; + public static field lambda-1 Lkotlin/jvm/functions/Function3; + public fun ()V + public final fun getLambda-1$carbon_release ()Lkotlin/jvm/functions/Function3; +} + public final class com/gabrieldrn/carbon/uishell/UIShellHeaderKt { - public static final fun UiShellHeader (Ljava/lang/String;Landroidx/compose/ui/Modifier;Landroidx/compose/ui/graphics/painter/Painter;Lkotlin/jvm/functions/Function0;Landroidx/compose/foundation/layout/WindowInsets;Lcom/gabrieldrn/carbon/foundation/color/Theme;Landroidx/compose/runtime/Composer;II)V + public static final fun UiShellHeader (Ljava/lang/String;Landroidx/compose/ui/Modifier;Landroidx/compose/ui/graphics/painter/Painter;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function0;Landroidx/compose/foundation/layout/WindowInsets;Lcom/gabrieldrn/carbon/foundation/color/Theme;Landroidx/compose/runtime/Composer;II)V } diff --git a/carbon/api/desktop/carbon.api b/carbon/api/desktop/carbon.api index 4c847f3f..6cd22111 100644 --- a/carbon/api/desktop/carbon.api +++ b/carbon/api/desktop/carbon.api @@ -1578,7 +1578,14 @@ public final class com/gabrieldrn/carbon/toggle/ToggleKt { public static final fun Toggle (ZLkotlin/jvm/functions/Function1;Landroidx/compose/ui/Modifier;Ljava/lang/String;Ljava/lang/String;ZZLandroidx/compose/foundation/interaction/MutableInteractionSource;Landroidx/compose/runtime/Composer;II)V } +public final class com/gabrieldrn/carbon/uishell/ComposableSingletons$UIShellHeaderKt { + public static final field INSTANCE Lcom/gabrieldrn/carbon/uishell/ComposableSingletons$UIShellHeaderKt; + public static field lambda-1 Lkotlin/jvm/functions/Function3; + public fun ()V + public final fun getLambda-1$carbon ()Lkotlin/jvm/functions/Function3; +} + public final class com/gabrieldrn/carbon/uishell/UIShellHeaderKt { - public static final fun UiShellHeader (Ljava/lang/String;Landroidx/compose/ui/Modifier;Landroidx/compose/ui/graphics/painter/Painter;Lkotlin/jvm/functions/Function0;Landroidx/compose/foundation/layout/WindowInsets;Lcom/gabrieldrn/carbon/foundation/color/Theme;Landroidx/compose/runtime/Composer;II)V + public static final fun UiShellHeader (Ljava/lang/String;Landroidx/compose/ui/Modifier;Landroidx/compose/ui/graphics/painter/Painter;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function0;Landroidx/compose/foundation/layout/WindowInsets;Lcom/gabrieldrn/carbon/foundation/color/Theme;Landroidx/compose/runtime/Composer;II)V } diff --git a/carbon/build.gradle.kts b/carbon/build.gradle.kts index cee62a87..42275d19 100644 --- a/carbon/build.gradle.kts +++ b/carbon/build.gradle.kts @@ -2,7 +2,7 @@ import com.gabrieldrn.carbon.Configuration import org.jetbrains.compose.ExperimentalComposeLibrary import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.DokkaBaseConfiguration -import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl +import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl plugins { id("carbon.kmp.library") @@ -19,7 +19,6 @@ buildscript { apply(from = "${rootDir}/scripts/publishing.gradle.kts") -@OptIn(ExperimentalWasmDsl::class) kotlin { listOf( iosX64(), @@ -32,6 +31,7 @@ kotlin { } } + @OptIn(ExperimentalWasmDsl::class) wasmJs { browser { testTask { diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/button/ButtonColors.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/button/ButtonColors.kt index 17c0e624..3f0f6d8d 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/button/ButtonColors.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/button/ButtonColors.kt @@ -25,7 +25,8 @@ import com.gabrieldrn.carbon.foundation.color.Theme @Immutable internal class ButtonColors private constructor( private val theme: Theme, - private val buttonType: ButtonType + private val buttonType: ButtonType, + private val isIconButton: Boolean, ) { val containerColor: Color = when (buttonType) { @@ -112,32 +113,44 @@ internal class ButtonColors private constructor( else -> theme.textOnColorDisabled } - val iconColor: Color = when (buttonType) { - ButtonType.Tertiary -> theme.buttonTertiary - ButtonType.Ghost -> theme.linkPrimary - ButtonType.PrimaryDanger -> theme.iconOnColor - ButtonType.TertiaryDanger, - ButtonType.GhostDanger -> theme.buttonDangerSecondary - else -> theme.iconOnColor + val iconColor: Color = if (isIconButton) { + theme.iconPrimary + } else { + when (buttonType) { + ButtonType.Tertiary -> theme.buttonTertiary + ButtonType.Ghost -> theme.linkPrimary + ButtonType.PrimaryDanger -> theme.iconOnColor + ButtonType.TertiaryDanger, + ButtonType.GhostDanger -> theme.buttonDangerSecondary + else -> theme.iconOnColor + } } - val iconActiveColor: Color = when (buttonType) { - ButtonType.Tertiary -> theme.iconInverse - ButtonType.Ghost -> theme.linkPrimary // ø - else -> theme.iconOnColor + val iconActiveColor: Color = if (isIconButton) { + theme.iconPrimary + } else { + when (buttonType) { + ButtonType.Tertiary -> theme.iconInverse + ButtonType.Ghost -> theme.linkPrimary // ø + else -> theme.iconOnColor + } } - val iconHoverColor: Color = when (buttonType) { - ButtonType.Tertiary -> theme.iconInverse - ButtonType.Ghost -> theme.linkPrimaryHover - else -> theme.iconOnColor + val iconHoverColor: Color = if (isIconButton) { + theme.iconPrimary + } else { + when (buttonType) { + ButtonType.Tertiary -> theme.iconInverse + ButtonType.Ghost -> theme.linkPrimaryHover + else -> theme.iconOnColor + } } val iconDisabledColor: Color = when (buttonType) { ButtonType.Primary, ButtonType.Secondary, ButtonType.PrimaryDanger -> theme.iconOnColorDisabled - else -> theme.iconDisabled // Issue in documentation for Ghost + else -> theme.iconDisabled // Issue in documentation for Ghost? } override fun equals(other: Any?): Boolean { @@ -146,6 +159,7 @@ internal class ButtonColors private constructor( if (theme != other.theme) return false if (buttonType != other.buttonType) return false + if (isIconButton != other.isIconButton) return false return true } @@ -153,6 +167,7 @@ internal class ButtonColors private constructor( override fun hashCode(): Int { var result = theme.hashCode() result = 31 * result + buttonType.hashCode() + result = 31 * result + isIconButton.hashCode() return result } @@ -161,6 +176,7 @@ internal class ButtonColors private constructor( @Composable fun colors( buttonType: ButtonType, - ): ButtonColors = ButtonColors(Carbon.theme, buttonType) + isIconButton: Boolean, + ): ButtonColors = ButtonColors(Carbon.theme, buttonType, isIconButton) } } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/button/ButtonFocusIndication.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/button/ButtonFocusIndication.kt index abf88d9d..2041640d 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/button/ButtonFocusIndication.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/button/ButtonFocusIndication.kt @@ -18,27 +18,23 @@ package com.gabrieldrn.carbon.button import androidx.compose.animation.core.FiniteAnimationSpec import androidx.compose.animation.core.tween -import androidx.compose.foundation.IndicationInstance -import androidx.compose.foundation.interaction.FocusInteraction import androidx.compose.foundation.interaction.InteractionSource -import androidx.compose.runtime.Composable -import androidx.compose.runtime.LaunchedEffect -import androidx.compose.runtime.remember import androidx.compose.ui.graphics.Color -import com.gabrieldrn.carbon.foundation.color.LocalCarbonTheme +import androidx.compose.ui.node.DelegatableNode import com.gabrieldrn.carbon.foundation.color.Theme import com.gabrieldrn.carbon.foundation.interaction.FocusIndication import com.gabrieldrn.carbon.foundation.motion.Motion -import kotlinx.coroutines.flow.filterIsInstance internal class ButtonFocusIndication( + private val theme: Theme, private val buttonType: ButtonType -) : FocusIndication() { +) : FocusIndication(theme) { private class ButtonIndicationInstance( + interactionSource: InteractionSource, theme: Theme, buttonType: ButtonType - ) : DefaultFocusIndicationInstance(theme) { + ) : DefaultFocusIndicationInstance(interactionSource, theme) { override val insetFocusColor = if (buttonType == ButtonType.Ghost) { Color.Transparent @@ -52,24 +48,24 @@ internal class ButtonFocusIndication( ) } - @Composable - override fun rememberUpdatedInstance( - interactionSource: InteractionSource - ): IndicationInstance { - val theme = LocalCarbonTheme.current + override fun create(interactionSource: InteractionSource): DelegatableNode = + ButtonIndicationInstance(interactionSource, theme, buttonType) - val instance = remember(theme) { - ButtonIndicationInstance(theme = theme, buttonType = buttonType) - } + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (other !is ButtonFocusIndication) return false + if (!super.equals(other)) return false - LaunchedEffect(interactionSource) { - interactionSource.interactions - .filterIsInstance() - .collect { interaction -> - instance.animateFocus(this, interaction) - } - } + if (theme != other.theme) return false + if (buttonType != other.buttonType) return false + + return true + } - return instance + override fun hashCode(): Int { + var result = super.hashCode() + result = 31 * result + theme.hashCode() + result = 31 * result + buttonType.hashCode() + return result } } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/button/ButtonImpl.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/button/ButtonImpl.kt index 93bda958..76ccb8e8 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/button/ButtonImpl.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/button/ButtonImpl.kt @@ -78,9 +78,10 @@ internal fun ButtonRowImpl( interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, content: @Composable RowScope.(ButtonScope) -> Unit, ) { - val colors = ButtonColors.colors(buttonType) + val theme = Carbon.theme + val colors = ButtonColors.colors(buttonType, isIconButton) val containerColor = remember(colors) { Animatable(colors.containerColor) } - val indication = remember(buttonType) { ButtonFocusIndication(buttonType) } + val indication = remember(buttonType) { ButtonFocusIndication(theme, buttonType) } LaunchedEffect(isEnabled, colors) { containerColor.animateTo( diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/checkbox/Checkbox.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/checkbox/Checkbox.kt index d110e841..d6560343 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/checkbox/Checkbox.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/checkbox/Checkbox.kt @@ -154,7 +154,10 @@ public fun Checkbox( state = state, modifier = Modifier.indication( interactionSource = interactionSource, - indication = ToggleableFocusIndication(4.dp) + indication = ToggleableFocusIndication( + theme = Carbon.theme, + indicationCornerRadius = 4.dp + ) ) ) Text( diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/dropdown/Dropdown.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/dropdown/Dropdown.kt index 837e1607..4032c5f7 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/dropdown/Dropdown.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/dropdown/Dropdown.kt @@ -119,7 +119,7 @@ public fun Dropdown( DropdownPlaceholderText( placeholderText = fieldText, colors = colors, - state = state, + state = state ) DropdownStateIcon(state = state) diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/dropdown/DropdownAccessibility.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/dropdown/DropdownAccessibility.kt new file mode 100644 index 00000000..56da65f2 --- /dev/null +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/dropdown/DropdownAccessibility.kt @@ -0,0 +1,17 @@ +/* + * Copyright 2024 Gabriel Derrien + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.gabrieldrn.carbon.dropdown diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/dropdown/base/DropdownField.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/dropdown/base/DropdownField.kt index 11b6bf02..da17965b 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/dropdown/base/DropdownField.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/dropdown/base/DropdownField.kt @@ -156,7 +156,7 @@ internal fun DropdownField( modifier = modifier .indication( interactionSource = interactionSource, - indication = FocusIndication() + indication = FocusIndication(Carbon.theme) ) .focusable( enabled = state.isFocusable, @@ -177,17 +177,6 @@ internal fun DropdownField( ) } } - .padding(horizontal = SpacingScale.spacing05) - .then( - if (state is DropdownInteractiveState.Error) { - Modifier.border( - width = SpacingScale.spacing01, - color = colors.fieldBorderErrorColor - ) - } else { - Modifier - } - ) .then( when (state) { is DropdownInteractiveState.Disabled -> Modifier.semantics { disabled() } @@ -202,6 +191,17 @@ internal fun DropdownField( ) } ) + .then( + if (state is DropdownInteractiveState.Error) { + Modifier.border( + width = SpacingScale.spacing01, + color = colors.fieldBorderErrorColor + ) + } else { + Modifier + } + ) + .padding(horizontal = SpacingScale.spacing05) .semantics(mergeDescendants = true) { role = Role.DropdownList state.helperText?.let { stateDescription = it } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/dropdown/base/DropdownPopupContent.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/dropdown/base/DropdownPopupContent.kt index 81855d56..c72bcb51 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/dropdown/base/DropdownPopupContent.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/dropdown/base/DropdownPopupContent.kt @@ -149,7 +149,7 @@ private fun DropdownMenuOption( .selectable( selected = isSelected, interactionSource = interactionSource, - indication = FocusIndication(), + indication = FocusIndication(Carbon.theme), enabled = option.enabled, onClick = onOptionClicked ) diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/dropdown/multiselect/MultiselectDropdownPopupContent.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/dropdown/multiselect/MultiselectDropdownPopupContent.kt index f004c89a..0d4f2d18 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/dropdown/multiselect/MultiselectDropdownPopupContent.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/dropdown/multiselect/MultiselectDropdownPopupContent.kt @@ -30,7 +30,9 @@ import androidx.compose.foundation.selection.selectable import androidx.compose.runtime.Composable import androidx.compose.runtime.SideEffect import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.focus.FocusRequester @@ -40,12 +42,12 @@ import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.Dp import com.gabrieldrn.carbon.Carbon import com.gabrieldrn.carbon.checkbox.Checkbox +import com.gabrieldrn.carbon.common.selectable.SelectableInteractiveState import com.gabrieldrn.carbon.dropdown.base.DropdownColors import com.gabrieldrn.carbon.dropdown.base.DropdownMenuOptionDivider import com.gabrieldrn.carbon.dropdown.base.DropdownOption import com.gabrieldrn.carbon.dropdown.base.DropdownTestTags import com.gabrieldrn.carbon.foundation.interaction.FocusIndication -import com.gabrieldrn.carbon.common.selectable.SelectableInteractiveState import com.gabrieldrn.carbon.foundation.spacing.SpacingScale import com.gabrieldrn.carbon.foundation.text.Text @@ -85,6 +87,10 @@ internal fun MultiselectDropdownPopupContent( optionEntries.indexOfFirst { it.key == selectedOptions.firstOrNull() } } + var focusFirstOptionFlag by remember { + mutableStateOf(true) + } + LazyColumn( modifier = modifier .background(color = colors.menuOptionBackgroundColor) @@ -92,10 +98,12 @@ internal fun MultiselectDropdownPopupContent( ) { itemsIndexed(optionEntries) { index, optionEntry -> SideEffect { - if (index == 0) { + if (index == 0 && focusFirstOptionFlag) { + focusFirstOptionFlag = false focusRequester.requestFocus() } } + MultiselectDropdownMenuOption( option = optionEntry.value, isSelected = optionEntry.key in selectedOptions, @@ -142,7 +150,7 @@ private fun MultiselectDropdownMenuOption( .selectable( selected = isSelected, interactionSource = interactionSource, - indication = FocusIndication(), + indication = FocusIndication(Carbon.theme), enabled = option.enabled, onClick = onOptionClicked ) @@ -172,7 +180,7 @@ private fun MultiselectDropdownMenuOption( SelectableInteractiveState.Disabled }, label = "", - onClick = onOptionClicked, + onClick = null, modifier = Modifier.testTag(DropdownTestTags.MENU_OPTION_CHECKBOX) ) Text( diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/dropdown/multiselect/MultiselectTag.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/dropdown/multiselect/MultiselectTag.kt index 4818defc..687aedaf 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/dropdown/multiselect/MultiselectTag.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/dropdown/multiselect/MultiselectTag.kt @@ -16,8 +16,7 @@ package com.gabrieldrn.carbon.dropdown.multiselect -import androidx.compose.foundation.Indication -import androidx.compose.foundation.IndicationInstance +import androidx.compose.foundation.IndicationNodeFactory import androidx.compose.foundation.background import androidx.compose.foundation.border import androidx.compose.foundation.clickable @@ -35,7 +34,6 @@ import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.runtime.Composable -import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember @@ -46,8 +44,11 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.drawscope.ContentDrawScope import androidx.compose.ui.graphics.drawscope.inset import androidx.compose.ui.layout.layoutId +import androidx.compose.ui.node.DelegatableNode +import androidx.compose.ui.node.DrawModifierNode import androidx.compose.ui.platform.testTag import androidx.compose.ui.unit.dp +import com.gabrieldrn.carbon.Carbon import com.gabrieldrn.carbon.dropdown.base.DropdownFieldContentId import com.gabrieldrn.carbon.dropdown.base.DropdownInteractiveState import com.gabrieldrn.carbon.dropdown.base.DropdownTestTags @@ -56,6 +57,7 @@ import com.gabrieldrn.carbon.foundation.color.Theme import com.gabrieldrn.carbon.foundation.spacing.SpacingScale import com.gabrieldrn.carbon.foundation.text.Text import com.gabrieldrn.carbon.icons.CloseIcon +import kotlinx.coroutines.launch private val tagShape = RoundedCornerShape(100f) @@ -119,7 +121,7 @@ internal fun DropdownMultiselectTag( modifier = Modifier .size(SpacingScale.spacing06) .indication( - indication = MultiselectTagIndication(), + indication = MultiselectTagIndication(Carbon.theme), interactionSource = interactionSource ) ) { @@ -135,13 +137,18 @@ internal fun DropdownMultiselectTag( } } -private class MultiselectTagIndication : Indication { +private class MultiselectTagIndication( + private val theme: Theme +) : IndicationNodeFactory { - class MultiselectTagIndicationInstance(private val theme: Theme) : IndicationInstance { + class MultiselectTagIndicationInstance( + private val interactionSource: InteractionSource, + private val theme: Theme + ) : Modifier.Node(), DrawModifierNode { var displayIndication: Boolean by mutableStateOf(false) - override fun ContentDrawScope.drawIndication() { + override fun ContentDrawScope.draw() { if (displayIndication) { inset(2f.dp.toPx()) { drawCircle(theme.backgroundHover) @@ -150,31 +157,34 @@ private class MultiselectTagIndication : Indication { drawContent() } - } - - @Composable - override fun rememberUpdatedInstance( - interactionSource: InteractionSource - ): IndicationInstance { - val theme = LocalCarbonTheme.current - val instance = remember(theme) { - MultiselectTagIndicationInstance(theme) - } - - LaunchedEffect(interactionSource) { - interactionSource.interactions.collect { interaction -> - when (interaction) { - is HoverInteraction.Enter, - is PressInteraction.Press -> instance.displayIndication = true - is HoverInteraction.Exit, - is PressInteraction.Release, - is PressInteraction.Cancel -> instance.displayIndication = false - else -> {} + override fun onAttach() { + coroutineScope.launch { + interactionSource.interactions.collect { interaction -> + when (interaction) { + is HoverInteraction.Enter, + is PressInteraction.Press -> displayIndication = true + is HoverInteraction.Exit, + is PressInteraction.Release, + is PressInteraction.Cancel -> displayIndication = false + else -> {} + } } } } + } - return instance + override fun create(interactionSource: InteractionSource): DelegatableNode = + MultiselectTagIndicationInstance(interactionSource, theme) + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (other !is MultiselectTagIndication) return false + + if (theme != other.theme) return false + + return true } + + override fun hashCode(): Int = theme.hashCode() } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/Gray100Theme.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/Gray100Theme.kt index 6538920a..c6a8c40c 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/Gray100Theme.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/Gray100Theme.kt @@ -24,241 +24,241 @@ import com.gabrieldrn.carbon.foundation.color.tag.TagColors */ @Immutable public object Gray100Theme : Theme() { - override val background: Color = Color(0xFF161616) + override val background: Color = Color(0xFF161616) - override val backgroundActive: Color = Color(0x668D8D8D) + override val backgroundActive: Color = Color(0x668D8D8D) - override val backgroundBrand: Color = Color(0xFF0F62FE) + override val backgroundBrand: Color = Color(0xFF0F62FE) - override val backgroundHover: Color = Color(0x288D8D8D) + override val backgroundHover: Color = Color(0x298D8D8D) - override val backgroundInverse: Color = Color(0xFFF4F4F4) + override val backgroundInverse: Color = Color(0xFFF4F4F4) - override val backgroundInverseHover: Color = Color(0xFFE5E5E5) + override val backgroundInverseHover: Color = Color(0xFFE5E5E5) - override val backgroundSelected: Color = Color(0x3D8D8D8D) + override val backgroundSelected: Color = Color(0x3D8D8D8D) - override val backgroundSelectedHover: Color = Color(0x518D8D8D) + override val backgroundSelectedHover: Color = Color(0x528D8D8D) - override val borderDisabled: Color = Color(0x7F8D8D8D) + override val borderDisabled: Color = Color(0x808D8D8D) - override val borderInteractive: Color = Color(0xFF4589FF) + override val borderInteractive: Color = Color(0xFF4589FF) - override val borderInverse: Color = Color(0xFFF4F4F4) + override val borderInverse: Color = Color(0xFFF4F4F4) - override val borderStrong01: Color = Color(0xFF6F6F6F) + override val borderStrong01: Color = Color(0xFF6F6F6F) - override val borderStrong02: Color = Color(0xFF8D8D8D) + override val borderStrong02: Color = Color(0xFF8D8D8D) - override val borderStrong03: Color = Color(0xFFA8A8A8) + override val borderStrong03: Color = Color(0xFFA8A8A8) - override val borderSubtle00: Color = Color(0xFF393939) + override val borderSubtle00: Color = Color(0xFF393939) - override val borderSubtle01: Color = Color(0xFF393939) + override val borderSubtle01: Color = Color(0xFF393939) - override val borderSubtle02: Color = Color(0xFF525252) + override val borderSubtle02: Color = Color(0xFF525252) - override val borderSubtle03: Color = Color(0xFF6F6F6F) + override val borderSubtle03: Color = Color(0xFF6F6F6F) - override val borderSubtleSelected01: Color = Color(0xFF525252) + override val borderSubtleSelected01: Color = Color(0xFF525252) - override val borderSubtleSelected02: Color = Color(0xFF6F6F6F) + override val borderSubtleSelected02: Color = Color(0xFF6F6F6F) - override val borderSubtleSelected03: Color = Color(0xFF8D8D8D) + override val borderSubtleSelected03: Color = Color(0xFF8D8D8D) - override val borderTile01: Color = Color(0xFF525252) + override val borderTile01: Color = Color(0xFF525252) - override val borderTile02: Color = Color(0xFF6F6F6F) + override val borderTile02: Color = Color(0xFF6F6F6F) - override val borderTile03: Color = Color(0xFF8D8D8D) + override val borderTile03: Color = Color(0xFF8D8D8D) - override val buttonDangerActive: Color = Color(0xFF750E13) + override val buttonDangerActive: Color = Color(0xFF750E13) - override val buttonDangerHover: Color = Color(0xFFBA1B23) + override val buttonDangerHover: Color = Color(0xFFBA1B23) - override val buttonDangerPrimary: Color = Color(0xFFDA1E28) + override val buttonDangerPrimary: Color = Color(0xFFDA1E28) - override val buttonDangerSecondary: Color = Color(0xFFFA4D56) + override val buttonDangerSecondary: Color = Color(0xFFFA4D56) - override val buttonDisabled: Color = Color(0xFF525252) + override val buttonDisabled: Color = Color(0xFF525252) - override val buttonPrimary: Color = Color(0xFF0F62FE) + override val buttonPrimary: Color = Color(0xFF0F62FE) - override val buttonPrimaryActive: Color = Color(0xFF002D9C) + override val buttonPrimaryActive: Color = Color(0xFF002D9C) - override val buttonPrimaryHover: Color = Color(0xFF0353E9) + override val buttonPrimaryHover: Color = Color(0xFF0353E9) - override val buttonSecondary: Color = Color(0xFF6F6F6F) + override val buttonSecondary: Color = Color(0xFF6F6F6F) - override val buttonSecondaryActive: Color = Color(0xFF393939) + override val buttonSecondaryActive: Color = Color(0xFF393939) - override val buttonSecondaryHover: Color = Color(0xFF606060) + override val buttonSecondaryHover: Color = Color(0xFF606060) - override val buttonSeparator: Color = Color(0xFF161616) + override val buttonSeparator: Color = Color(0xFF161616) - override val buttonTertiary: Color = Color(0xFFFFFFFF) + override val buttonTertiary: Color = Color(0xFFFFFFFF) - override val buttonTertiaryActive: Color = Color(0xFFC6C6C6) + override val buttonTertiaryActive: Color = Color(0xFFC6C6C6) - override val buttonTertiaryHover: Color = Color(0xFFF4F4F4) + override val buttonTertiaryHover: Color = Color(0xFFF4F4F4) - override val field01: Color = Color(0xFF262626) + override val field01: Color = Color(0xFF262626) - override val field02: Color = Color(0xFF393939) + override val field02: Color = Color(0xFF393939) - override val field03: Color = Color(0xFF525252) + override val field03: Color = Color(0xFF525252) - override val fieldHover01: Color = Color(0xFF333333) + override val fieldHover01: Color = Color(0xFF333333) - override val fieldHover02: Color = Color(0xFF474747) + override val fieldHover02: Color = Color(0xFF474747) - override val fieldHover03: Color = Color(0xFF636363) + override val fieldHover03: Color = Color(0xFF636363) - override val focus: Color = Color(0xFFFFFFFF) + override val focus: Color = Color(0xFFFFFFFF) - override val focusInset: Color = Color(0xFF161616) + override val focusInset: Color = Color(0xFF161616) - override val focusInverse: Color = Color(0xFF0F62FE) + override val focusInverse: Color = Color(0xFF0F62FE) - override val iconDisabled: Color = Color(0xFFF4F4F4) + override val iconDisabled: Color = Color(0x40F4F4F4) - override val iconInteractive: Color = Color(0xFFFFFFFF) + override val iconInteractive: Color = Color(0xFFFFFFFF) - override val iconInverse: Color = Color(0xFF161616) + override val iconInverse: Color = Color(0xFF161616) - override val iconOnColor: Color = Color(0xFFFFFFFF) + override val iconOnColor: Color = Color(0xFFFFFFFF) - override val iconOnColorDisabled: Color = Color(0xFFFFFFFF) + override val iconOnColorDisabled: Color = Color(0x40FFFFFF) - override val iconPrimary: Color = Color(0xFFF4F4F4) + override val iconPrimary: Color = Color(0xFFF4F4F4) - override val iconSecondary: Color = Color(0xFFC6C6C6) + override val iconSecondary: Color = Color(0xFFC6C6C6) - override val layerAccent01: Color = Color(0xFF393939) + override val layerAccent01: Color = Color(0xFF393939) - override val layerAccent02: Color = Color(0xFF525252) + override val layerAccent02: Color = Color(0xFF525252) - override val layerAccent03: Color = Color(0xFF6F6F6F) + override val layerAccent03: Color = Color(0xFF6F6F6F) - override val layerAccentActive01: Color = Color(0xFF525252) + override val layerAccentActive01: Color = Color(0xFF525252) - override val layerAccentActive02: Color = Color(0xFF8D8D8D) + override val layerAccentActive02: Color = Color(0xFF8D8D8D) - override val layerAccentActive03: Color = Color(0xFF393939) + override val layerAccentActive03: Color = Color(0xFF393939) - override val layerAccentHover01: Color = Color(0xFF4C4C4C) + override val layerAccentHover01: Color = Color(0xFF4C4C4C) - override val layerAccentHover02: Color = Color(0xFF656565) + override val layerAccentHover02: Color = Color(0xFF656565) - override val layerAccentHover03: Color = Color(0xFF5E5E5E) + override val layerAccentHover03: Color = Color(0xFF5E5E5E) - override val layer01: Color = Color(0xFF262626) + override val layer01: Color = Color(0xFF262626) - override val layer02: Color = Color(0xFF393939) + override val layer02: Color = Color(0xFF393939) - override val layer03: Color = Color(0xFF525252) + override val layer03: Color = Color(0xFF525252) - override val layerActive01: Color = Color(0xFF525252) + override val layerActive01: Color = Color(0xFF525252) - override val layerActive02: Color = Color(0xFF6F6F6F) + override val layerActive02: Color = Color(0xFF6F6F6F) - override val layerActive03: Color = Color(0xFF8D8D8D) + override val layerActive03: Color = Color(0xFF8D8D8D) - override val layerHover01: Color = Color(0xFF333333) + override val layerHover01: Color = Color(0xFF333333) - override val layerHover02: Color = Color(0xFF474747) + override val layerHover02: Color = Color(0xFF474747) - override val layerHover03: Color = Color(0xFF636363) + override val layerHover03: Color = Color(0xFF636363) - override val layerSelected01: Color = Color(0xFF393939) + override val layerSelected01: Color = Color(0xFF393939) - override val layerSelected02: Color = Color(0xFF525252) + override val layerSelected02: Color = Color(0xFF525252) - override val layerSelected03: Color = Color(0xFF6F6F6F) + override val layerSelected03: Color = Color(0xFF6F6F6F) - override val layerSelectedDisabled: Color = Color(0xFF6F6F6F) + override val layerSelectedDisabled: Color = Color(0xFF6F6F6F) - override val layerSelectedHover01: Color = Color(0xFF4C4C4C) + override val layerSelectedHover01: Color = Color(0xFF4C4C4C) - override val layerSelectedHover02: Color = Color(0xFF656565) + override val layerSelectedHover02: Color = Color(0xFF656565) - override val layerSelectedHover03: Color = Color(0xFF5E5E5E) + override val layerSelectedHover03: Color = Color(0xFF5E5E5E) - override val layerSelectedInverse: Color = Color(0xFFF4F4F4) + override val layerSelectedInverse: Color = Color(0xFFF4F4F4) - override val linkInverse: Color = Color(0xFF0F62FE) + override val linkInverse: Color = Color(0xFF0F62FE) - override val linkInverseActive: Color = Color(0xFF161616) + override val linkInverseActive: Color = Color(0xFF161616) - override val linkInverseHover: Color = Color(0xFF0043CE) + override val linkInverseHover: Color = Color(0xFF0043CE) - override val linkInverseVisited: Color = Color(0xFF8A3FFC) + override val linkInverseVisited: Color = Color(0xFF8A3FFC) - override val linkPrimary: Color = Color(0xFF78A9FF) + override val linkPrimary: Color = Color(0xFF78A9FF) - override val linkPrimaryHover: Color = Color(0xFFA6C8FF) + override val linkPrimaryHover: Color = Color(0xFFA6C8FF) - override val linkSecondary: Color = Color(0xFFA6C8FF) + override val linkSecondary: Color = Color(0xFFA6C8FF) - override val linkVisited: Color = Color(0xFFBE95FF) + override val linkVisited: Color = Color(0xFFBE95FF) - override val highlight: Color = Color(0xFF001D6C) + override val highlight: Color = Color(0xFF001D6C) - override val interactive: Color = Color(0xFF4589FF) + override val interactive: Color = Color(0xFF4589FF) - override val overlay: Color = Color(0xB2161616) + override val overlay: Color = Color(0xB3161616) - override val skeletonBackground: Color = Color(0xFF353535) + override val skeletonBackground: Color = Color(0xFF353535) - override val skeletonElement: Color = Color(0xFF525252) + override val skeletonElement: Color = Color(0xFF525252) - override val toggleOff: Color = Color(0xFF6F6F6F) + override val toggleOff: Color = Color(0xFF6F6F6F) - override val supportCautionMajor: Color = Color(0xFFFF832B) + override val supportCautionMajor: Color = Color(0xFFFF832B) - override val supportCautionMinor: Color = Color(0xFFF1C21B) + override val supportCautionMinor: Color = Color(0xFFF1C21B) - override val supportCautionUndefined: Color = Color(0xFFA56EFF) + override val supportCautionUndefined: Color = Color(0xFFA56EFF) - override val supportError: Color = Color(0xFFFA4D56) + override val supportError: Color = Color(0xFFFA4D56) - override val supportErrorInverse: Color = Color(0xFFDA1E28) + override val supportErrorInverse: Color = Color(0xFFDA1E28) - override val supportInfo: Color = Color(0xFF4589FF) + override val supportInfo: Color = Color(0xFF4589FF) - override val supportInfoInverse: Color = Color(0xFF0043CE) + override val supportInfoInverse: Color = Color(0xFF0043CE) - override val supportSuccess: Color = Color(0xFF42BE65) + override val supportSuccess: Color = Color(0xFF42BE65) - override val supportSuccessInverse: Color = Color(0xFF24A148) + override val supportSuccessInverse: Color = Color(0xFF24A148) - override val supportWarning: Color = Color(0xFFF1C21B) + override val supportWarning: Color = Color(0xFFF1C21B) - override val supportWarningInverse: Color = Color(0xFFF1C21B) + override val supportWarningInverse: Color = Color(0xFFF1C21B) - override val textDisabled: Color = Color(0xFFF4F4F4) + override val textDisabled: Color = Color(0x40F4F4F4) - override val textError: Color = Color(0xFFFF8389) + override val textError: Color = Color(0xFFFF8389) - override val textHelper: Color = Color(0xFF8D8D8D) + override val textHelper: Color = Color(0xFF8D8D8D) - override val textInverse: Color = Color(0xFF161616) + override val textInverse: Color = Color(0xFF161616) - override val textOnColor: Color = Color(0xFFFFFFFF) + override val textOnColor: Color = Color(0xFFFFFFFF) - override val textOnColorDisabled: Color = Color(0xFFFFFFFF) + override val textOnColorDisabled: Color = Color(0x40FFFFFF) - override val textPlaceholder: Color = Color(0xFF6F6F6F) + override val textPlaceholder: Color = Color(0xFF6F6F6F) - override val textPrimary: Color = Color(0xFFF4F4F4) + override val textPrimary: Color = Color(0xFFF4F4F4) - override val textSecondary: Color = Color(0xFFC6C6C6) + override val textSecondary: Color = Color(0xFFC6C6C6) - override val aiColors: AiColors = Gray100AiColors + override val aiColors: AiColors = Gray100AiColors - override val tagColors: TagColors = Gray100TagColors + override val tagColors: TagColors = Gray100TagColors - override val chatColors: ChatColors = Gray100ChatColors + override val chatColors: ChatColors = Gray100ChatColors - override val notificationColors: NotificationColors = Gray100NotificationColors + override val notificationColors: NotificationColors = Gray100NotificationColors } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/Gray10Theme.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/Gray10Theme.kt index b8c4b866..9074169f 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/Gray10Theme.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/Gray10Theme.kt @@ -24,241 +24,241 @@ import com.gabrieldrn.carbon.foundation.color.tag.TagColors */ @Immutable public object Gray10Theme : Theme() { - override val background: Color = Color(0xFFF4F4F4) + override val background: Color = Color(0xFFF4F4F4) - override val backgroundActive: Color = Color(0x7F8D8D8D) + override val backgroundActive: Color = Color(0x808D8D8D) - override val backgroundBrand: Color = Color(0xFF0F62FE) + override val backgroundBrand: Color = Color(0xFF0F62FE) - override val backgroundHover: Color = Color(0x1E8D8D8D) + override val backgroundHover: Color = Color(0x1F8D8D8D) - override val backgroundInverse: Color = Color(0xFF393939) + override val backgroundInverse: Color = Color(0xFF393939) - override val backgroundInverseHover: Color = Color(0xFF4C4C4C) + override val backgroundInverseHover: Color = Color(0xFF4C4C4C) - override val backgroundSelected: Color = Color(0x338D8D8D) + override val backgroundSelected: Color = Color(0x338D8D8D) - override val backgroundSelectedHover: Color = Color(0x518D8D8D) + override val backgroundSelectedHover: Color = Color(0x528D8D8D) - override val borderDisabled: Color = Color(0xFFC6C6C6) + override val borderDisabled: Color = Color(0xFFC6C6C6) - override val borderInteractive: Color = Color(0xFF0F62FE) + override val borderInteractive: Color = Color(0xFF0F62FE) - override val borderInverse: Color = Color(0xFF161616) + override val borderInverse: Color = Color(0xFF161616) - override val borderStrong01: Color = Color(0xFF8D8D8D) + override val borderStrong01: Color = Color(0xFF8D8D8D) - override val borderStrong02: Color = Color(0xFF8D8D8D) + override val borderStrong02: Color = Color(0xFF8D8D8D) - override val borderStrong03: Color = Color(0xFF8D8D8D) + override val borderStrong03: Color = Color(0xFF8D8D8D) - override val borderSubtle00: Color = Color(0xFFC6C6C6) + override val borderSubtle00: Color = Color(0xFFC6C6C6) - override val borderSubtle01: Color = Color(0xFFE0E0E0) + override val borderSubtle01: Color = Color(0xFFE0E0E0) - override val borderSubtle02: Color = Color(0xFFC6C6C6) + override val borderSubtle02: Color = Color(0xFFC6C6C6) - override val borderSubtle03: Color = Color(0xFFE0E0E0) + override val borderSubtle03: Color = Color(0xFFE0E0E0) - override val borderSubtleSelected01: Color = Color(0xFFC6C6C6) + override val borderSubtleSelected01: Color = Color(0xFFC6C6C6) - override val borderSubtleSelected02: Color = Color(0xFFC6C6C6) + override val borderSubtleSelected02: Color = Color(0xFFC6C6C6) - override val borderSubtleSelected03: Color = Color(0xFFC6C6C6) + override val borderSubtleSelected03: Color = Color(0xFFC6C6C6) - override val borderTile01: Color = Color(0xFFA8A8A8) + override val borderTile01: Color = Color(0xFFA8A8A8) - override val borderTile02: Color = Color(0xFFC6C6C6) + override val borderTile02: Color = Color(0xFFC6C6C6) - override val borderTile03: Color = Color(0xFFA8A8A8) + override val borderTile03: Color = Color(0xFFA8A8A8) - override val buttonDangerActive: Color = Color(0xFF750E13) + override val buttonDangerActive: Color = Color(0xFF750E13) - override val buttonDangerHover: Color = Color(0xFFBA1B23) + override val buttonDangerHover: Color = Color(0xFFBA1B23) - override val buttonDangerPrimary: Color = Color(0xFFDA1E28) + override val buttonDangerPrimary: Color = Color(0xFFDA1E28) - override val buttonDangerSecondary: Color = Color(0xFFDA1E28) + override val buttonDangerSecondary: Color = Color(0xFFDA1E28) - override val buttonDisabled: Color = Color(0xFFC6C6C6) + override val buttonDisabled: Color = Color(0xFFC6C6C6) - override val buttonPrimary: Color = Color(0xFF0F62FE) + override val buttonPrimary: Color = Color(0xFF0F62FE) - override val buttonPrimaryActive: Color = Color(0xFF002D9C) + override val buttonPrimaryActive: Color = Color(0xFF002D9C) - override val buttonPrimaryHover: Color = Color(0xFF0353E9) + override val buttonPrimaryHover: Color = Color(0xFF0353E9) - override val buttonSecondary: Color = Color(0xFF393939) + override val buttonSecondary: Color = Color(0xFF393939) - override val buttonSecondaryActive: Color = Color(0xFF6F6F6F) + override val buttonSecondaryActive: Color = Color(0xFF6F6F6F) - override val buttonSecondaryHover: Color = Color(0xFF4C4C4C) + override val buttonSecondaryHover: Color = Color(0xFF4C4C4C) - override val buttonSeparator: Color = Color(0xFFE0E0E0) + override val buttonSeparator: Color = Color(0xFFE0E0E0) - override val buttonTertiary: Color = Color(0xFF0F62FE) + override val buttonTertiary: Color = Color(0xFF0F62FE) - override val buttonTertiaryActive: Color = Color(0xFF002D9C) + override val buttonTertiaryActive: Color = Color(0xFF002D9C) - override val buttonTertiaryHover: Color = Color(0xFF0353E9) + override val buttonTertiaryHover: Color = Color(0xFF0353E9) - override val field01: Color = Color(0xFFFFFFFF) + override val field01: Color = Color(0xFFFFFFFF) - override val field02: Color = Color(0xFFF4F4F4) + override val field02: Color = Color(0xFFF4F4F4) - override val field03: Color = Color(0xFFFFFFFF) + override val field03: Color = Color(0xFFFFFFFF) - override val fieldHover01: Color = Color(0xFFE8E8E8) + override val fieldHover01: Color = Color(0xFFE8E8E8) - override val fieldHover02: Color = Color(0xFFE8E8E8) + override val fieldHover02: Color = Color(0xFFE8E8E8) - override val fieldHover03: Color = Color(0xFFE8E8E8) + override val fieldHover03: Color = Color(0xFFE8E8E8) - override val focus: Color = Color(0xFF0F62FE) + override val focus: Color = Color(0xFF0F62FE) - override val focusInset: Color = Color(0xFFFFFFFF) + override val focusInset: Color = Color(0xFFFFFFFF) - override val focusInverse: Color = Color(0xFFFFFFFF) + override val focusInverse: Color = Color(0xFFFFFFFF) - override val iconDisabled: Color = Color(0xFF161616) + override val iconDisabled: Color = Color(0x40161616) - override val iconInteractive: Color = Color(0xFF0F62FE) + override val iconInteractive: Color = Color(0xFF0F62FE) - override val iconInverse: Color = Color(0xFFFFFFFF) + override val iconInverse: Color = Color(0xFFFFFFFF) - override val iconOnColor: Color = Color(0xFFFFFFFF) + override val iconOnColor: Color = Color(0xFFFFFFFF) - override val iconOnColorDisabled: Color = Color(0xFF8D8D8D) + override val iconOnColorDisabled: Color = Color(0xFF8D8D8D) - override val iconPrimary: Color = Color(0xFF161616) + override val iconPrimary: Color = Color(0xFF161616) - override val iconSecondary: Color = Color(0xFF525252) + override val iconSecondary: Color = Color(0xFF525252) - override val layerAccent01: Color = Color(0xFFE0E0E0) + override val layerAccent01: Color = Color(0xFFE0E0E0) - override val layerAccent02: Color = Color(0xFFE0E0E0) + override val layerAccent02: Color = Color(0xFFE0E0E0) - override val layerAccent03: Color = Color(0xFFE0E0E0) + override val layerAccent03: Color = Color(0xFFE0E0E0) - override val layerAccentActive01: Color = Color(0xFFA8A8A8) + override val layerAccentActive01: Color = Color(0xFFA8A8A8) - override val layerAccentActive02: Color = Color(0xFFA8A8A8) + override val layerAccentActive02: Color = Color(0xFFA8A8A8) - override val layerAccentActive03: Color = Color(0xFFA8A8A8) + override val layerAccentActive03: Color = Color(0xFFA8A8A8) - override val layerAccentHover01: Color = Color(0xFFCACACA) + override val layerAccentHover01: Color = Color(0xFFCACACA) - override val layerAccentHover02: Color = Color(0xFFCACACA) + override val layerAccentHover02: Color = Color(0xFFCACACA) - override val layerAccentHover03: Color = Color(0xFFCACACA) + override val layerAccentHover03: Color = Color(0xFFCACACA) - override val layer01: Color = Color(0xFFFFFFFF) + override val layer01: Color = Color(0xFFFFFFFF) - override val layer02: Color = Color(0xFFF4F4F4) + override val layer02: Color = Color(0xFFF4F4F4) - override val layer03: Color = Color(0xFFFFFFFF) + override val layer03: Color = Color(0xFFFFFFFF) - override val layerActive01: Color = Color(0xFFC6C6C6) + override val layerActive01: Color = Color(0xFFC6C6C6) - override val layerActive02: Color = Color(0xFFC6C6C6) + override val layerActive02: Color = Color(0xFFC6C6C6) - override val layerActive03: Color = Color(0xFFC6C6C6) + override val layerActive03: Color = Color(0xFFC6C6C6) - override val layerHover01: Color = Color(0xFFE8E8E8) + override val layerHover01: Color = Color(0xFFE8E8E8) - override val layerHover02: Color = Color(0xFFE8E8E8) + override val layerHover02: Color = Color(0xFFE8E8E8) - override val layerHover03: Color = Color(0xFFE8E8E8) + override val layerHover03: Color = Color(0xFFE8E8E8) - override val layerSelected01: Color = Color(0xFFE0E0E0) + override val layerSelected01: Color = Color(0xFFE0E0E0) - override val layerSelected02: Color = Color(0xFFE0E0E0) + override val layerSelected02: Color = Color(0xFFE0E0E0) - override val layerSelected03: Color = Color(0xFFE0E0E0) + override val layerSelected03: Color = Color(0xFFE0E0E0) - override val layerSelectedDisabled: Color = Color(0xFF8D8D8D) + override val layerSelectedDisabled: Color = Color(0xFF8D8D8D) - override val layerSelectedHover01: Color = Color(0xFFCACACA) + override val layerSelectedHover01: Color = Color(0xFFCACACA) - override val layerSelectedHover02: Color = Color(0xFFCACACA) + override val layerSelectedHover02: Color = Color(0xFFCACACA) - override val layerSelectedHover03: Color = Color(0xFFCACACA) + override val layerSelectedHover03: Color = Color(0xFFCACACA) - override val layerSelectedInverse: Color = Color(0xFF161616) + override val layerSelectedInverse: Color = Color(0xFF161616) - override val linkInverse: Color = Color(0xFF78A9FF) + override val linkInverse: Color = Color(0xFF78A9FF) - override val linkInverseActive: Color = Color(0xFFF4F4F4) + override val linkInverseActive: Color = Color(0xFFF4F4F4) - override val linkInverseHover: Color = Color(0xFFA6C8FF) + override val linkInverseHover: Color = Color(0xFFA6C8FF) - override val linkInverseVisited: Color = Color(0xFFBE95FF) + override val linkInverseVisited: Color = Color(0xFFBE95FF) - override val linkPrimary: Color = Color(0xFF0F62FE) + override val linkPrimary: Color = Color(0xFF0F62FE) - override val linkPrimaryHover: Color = Color(0xFF0043CE) + override val linkPrimaryHover: Color = Color(0xFF0043CE) - override val linkSecondary: Color = Color(0xFF0043CE) + override val linkSecondary: Color = Color(0xFF0043CE) - override val linkVisited: Color = Color(0xFF8A3FFC) + override val linkVisited: Color = Color(0xFF8A3FFC) - override val highlight: Color = Color(0xFFD0E2FF) + override val highlight: Color = Color(0xFFD0E2FF) - override val interactive: Color = Color(0xFF0F62FE) + override val interactive: Color = Color(0xFF0F62FE) - override val overlay: Color = Color(0x7F161616) + override val overlay: Color = Color(0x80161616) - override val skeletonBackground: Color = Color(0xFFE5E5E5) + override val skeletonBackground: Color = Color(0xFFE5E5E5) - override val skeletonElement: Color = Color(0xFFC6C6C6) + override val skeletonElement: Color = Color(0xFFC6C6C6) - override val toggleOff: Color = Color(0xFF8D8D8D) + override val toggleOff: Color = Color(0xFF8D8D8D) - override val supportCautionMajor: Color = Color(0xFFFF832B) + override val supportCautionMajor: Color = Color(0xFFFF832B) - override val supportCautionMinor: Color = Color(0xFFF1C21B) + override val supportCautionMinor: Color = Color(0xFFF1C21B) - override val supportCautionUndefined: Color = Color(0xFF8A3FFC) + override val supportCautionUndefined: Color = Color(0xFF8A3FFC) - override val supportError: Color = Color(0xFFDA1E28) + override val supportError: Color = Color(0xFFDA1E28) - override val supportErrorInverse: Color = Color(0xFFFA4D56) + override val supportErrorInverse: Color = Color(0xFFFA4D56) - override val supportInfo: Color = Color(0xFF0043CE) + override val supportInfo: Color = Color(0xFF0043CE) - override val supportInfoInverse: Color = Color(0xFF4589FF) + override val supportInfoInverse: Color = Color(0xFF4589FF) - override val supportSuccess: Color = Color(0xFF24A148) + override val supportSuccess: Color = Color(0xFF24A148) - override val supportSuccessInverse: Color = Color(0xFF42BE65) + override val supportSuccessInverse: Color = Color(0xFF42BE65) - override val supportWarning: Color = Color(0xFFF1C21B) + override val supportWarning: Color = Color(0xFFF1C21B) - override val supportWarningInverse: Color = Color(0xFFF1C21B) + override val supportWarningInverse: Color = Color(0xFFF1C21B) - override val textDisabled: Color = Color(0xFF161616) + override val textDisabled: Color = Color(0x40161616) - override val textError: Color = Color(0xFFDA1E28) + override val textError: Color = Color(0xFFDA1E28) - override val textHelper: Color = Color(0xFF6F6F6F) + override val textHelper: Color = Color(0xFF6F6F6F) - override val textInverse: Color = Color(0xFFFFFFFF) + override val textInverse: Color = Color(0xFFFFFFFF) - override val textOnColor: Color = Color(0xFFFFFFFF) + override val textOnColor: Color = Color(0xFFFFFFFF) - override val textOnColorDisabled: Color = Color(0xFF8D8D8D) + override val textOnColorDisabled: Color = Color(0xFF8D8D8D) - override val textPlaceholder: Color = Color(0xFFA8A8A8) + override val textPlaceholder: Color = Color(0xFFA8A8A8) - override val textPrimary: Color = Color(0xFF161616) + override val textPrimary: Color = Color(0xFF161616) - override val textSecondary: Color = Color(0xFF525252) + override val textSecondary: Color = Color(0xFF525252) - override val aiColors: AiColors = Gray10AiColors + override val aiColors: AiColors = Gray10AiColors - override val tagColors: TagColors = Gray10TagColors + override val tagColors: TagColors = Gray10TagColors - override val chatColors: ChatColors = Gray10ChatColors + override val chatColors: ChatColors = Gray10ChatColors - override val notificationColors: NotificationColors = Gray10NotificationColors + override val notificationColors: NotificationColors = Gray10NotificationColors } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/Gray90Theme.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/Gray90Theme.kt index 6e2e1915..77b4fc03 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/Gray90Theme.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/Gray90Theme.kt @@ -24,241 +24,241 @@ import com.gabrieldrn.carbon.foundation.color.tag.TagColors */ @Immutable public object Gray90Theme : Theme() { - override val background: Color = Color(0xFF262626) + override val background: Color = Color(0xFF262626) - override val backgroundActive: Color = Color(0x668D8D8D) + override val backgroundActive: Color = Color(0x668D8D8D) - override val backgroundBrand: Color = Color(0xFF0F62FE) + override val backgroundBrand: Color = Color(0xFF0F62FE) - override val backgroundHover: Color = Color(0x288D8D8D) + override val backgroundHover: Color = Color(0x298D8D8D) - override val backgroundInverse: Color = Color(0xFFF4F4F4) + override val backgroundInverse: Color = Color(0xFFF4F4F4) - override val backgroundInverseHover: Color = Color(0xFFE5E5E5) + override val backgroundInverseHover: Color = Color(0xFFE5E5E5) - override val backgroundSelected: Color = Color(0x3D8D8D8D) + override val backgroundSelected: Color = Color(0x3D8D8D8D) - override val backgroundSelectedHover: Color = Color(0x518D8D8D) + override val backgroundSelectedHover: Color = Color(0x528D8D8D) - override val borderDisabled: Color = Color(0x7F8D8D8D) + override val borderDisabled: Color = Color(0x808D8D8D) - override val borderInteractive: Color = Color(0xFF4589FF) + override val borderInteractive: Color = Color(0xFF4589FF) - override val borderInverse: Color = Color(0xFFF4F4F4) + override val borderInverse: Color = Color(0xFFF4F4F4) - override val borderStrong01: Color = Color(0xFF8D8D8D) + override val borderStrong01: Color = Color(0xFF8D8D8D) - override val borderStrong02: Color = Color(0xFFA8A8A8) + override val borderStrong02: Color = Color(0xFFA8A8A8) - override val borderStrong03: Color = Color(0xFFC6C6C6) + override val borderStrong03: Color = Color(0xFFC6C6C6) - override val borderSubtle00: Color = Color(0xFF525252) + override val borderSubtle00: Color = Color(0xFF525252) - override val borderSubtle01: Color = Color(0xFF525252) + override val borderSubtle01: Color = Color(0xFF525252) - override val borderSubtle02: Color = Color(0xFF6F6F6F) + override val borderSubtle02: Color = Color(0xFF6F6F6F) - override val borderSubtle03: Color = Color(0xFF8D8D8D) + override val borderSubtle03: Color = Color(0xFF8D8D8D) - override val borderSubtleSelected01: Color = Color(0xFF6F6F6F) + override val borderSubtleSelected01: Color = Color(0xFF6F6F6F) - override val borderSubtleSelected02: Color = Color(0xFF8D8D8D) + override val borderSubtleSelected02: Color = Color(0xFF8D8D8D) - override val borderSubtleSelected03: Color = Color(0xFFA8A8A8) + override val borderSubtleSelected03: Color = Color(0xFFA8A8A8) - override val borderTile01: Color = Color(0xFF6F6F6F) + override val borderTile01: Color = Color(0xFF6F6F6F) - override val borderTile02: Color = Color(0xFF8D8D8D) + override val borderTile02: Color = Color(0xFF8D8D8D) - override val borderTile03: Color = Color(0xFFA8A8A8) + override val borderTile03: Color = Color(0xFFA8A8A8) - override val buttonDangerActive: Color = Color(0xFF750E13) + override val buttonDangerActive: Color = Color(0xFF750E13) - override val buttonDangerHover: Color = Color(0xFFBA1B23) + override val buttonDangerHover: Color = Color(0xFFBA1B23) - override val buttonDangerPrimary: Color = Color(0xFFDA1E28) + override val buttonDangerPrimary: Color = Color(0xFFDA1E28) - override val buttonDangerSecondary: Color = Color(0xFFFF8389) + override val buttonDangerSecondary: Color = Color(0xFFFF8389) - override val buttonDisabled: Color = Color(0xFF6F6F6F) + override val buttonDisabled: Color = Color(0xFF6F6F6F) - override val buttonPrimary: Color = Color(0xFF0F62FE) + override val buttonPrimary: Color = Color(0xFF0F62FE) - override val buttonPrimaryActive: Color = Color(0xFF002D9C) + override val buttonPrimaryActive: Color = Color(0xFF002D9C) - override val buttonPrimaryHover: Color = Color(0xFF0353E9) + override val buttonPrimaryHover: Color = Color(0xFF0353E9) - override val buttonSecondary: Color = Color(0xFF6F6F6F) + override val buttonSecondary: Color = Color(0xFF6F6F6F) - override val buttonSecondaryActive: Color = Color(0xFF393939) + override val buttonSecondaryActive: Color = Color(0xFF393939) - override val buttonSecondaryHover: Color = Color(0xFF606060) + override val buttonSecondaryHover: Color = Color(0xFF606060) - override val buttonSeparator: Color = Color(0xFF161616) + override val buttonSeparator: Color = Color(0xFF161616) - override val buttonTertiary: Color = Color(0xFFFFFFFF) + override val buttonTertiary: Color = Color(0xFFFFFFFF) - override val buttonTertiaryActive: Color = Color(0xFFC6C6C6) + override val buttonTertiaryActive: Color = Color(0xFFC6C6C6) - override val buttonTertiaryHover: Color = Color(0xFFF4F4F4) + override val buttonTertiaryHover: Color = Color(0xFFF4F4F4) - override val field01: Color = Color(0xFF393939) + override val field01: Color = Color(0xFF393939) - override val field02: Color = Color(0xFF525252) + override val field02: Color = Color(0xFF525252) - override val field03: Color = Color(0xFF6F6F6F) + override val field03: Color = Color(0xFF6F6F6F) - override val fieldHover01: Color = Color(0xFF474747) + override val fieldHover01: Color = Color(0xFF474747) - override val fieldHover02: Color = Color(0xFF636363) + override val fieldHover02: Color = Color(0xFF636363) - override val fieldHover03: Color = Color(0xFF5E5E5E) + override val fieldHover03: Color = Color(0xFF5E5E5E) - override val focus: Color = Color(0xFFFFFFFF) + override val focus: Color = Color(0xFFFFFFFF) - override val focusInset: Color = Color(0xFF161616) + override val focusInset: Color = Color(0xFF161616) - override val focusInverse: Color = Color(0xFF0F62FE) + override val focusInverse: Color = Color(0xFF0F62FE) - override val iconDisabled: Color = Color(0xFFF4F4F4) + override val iconDisabled: Color = Color(0x40F4F4F4) - override val iconInteractive: Color = Color(0xFFFFFFFF) + override val iconInteractive: Color = Color(0xFFFFFFFF) - override val iconInverse: Color = Color(0xFF161616) + override val iconInverse: Color = Color(0xFF161616) - override val iconOnColor: Color = Color(0xFFFFFFFF) + override val iconOnColor: Color = Color(0xFFFFFFFF) - override val iconOnColorDisabled: Color = Color(0xFFFFFFFF) + override val iconOnColorDisabled: Color = Color(0x40FFFFFF) - override val iconPrimary: Color = Color(0xFFF4F4F4) + override val iconPrimary: Color = Color(0xFFF4F4F4) - override val iconSecondary: Color = Color(0xFFC6C6C6) + override val iconSecondary: Color = Color(0xFFC6C6C6) - override val layerAccent01: Color = Color(0xFF525252) + override val layerAccent01: Color = Color(0xFF525252) - override val layerAccent02: Color = Color(0xFF6F6F6F) + override val layerAccent02: Color = Color(0xFF6F6F6F) - override val layerAccent03: Color = Color(0xFF8D8D8D) + override val layerAccent03: Color = Color(0xFF8D8D8D) - override val layerAccentActive01: Color = Color(0xFF6F6F6F) + override val layerAccentActive01: Color = Color(0xFF6F6F6F) - override val layerAccentActive02: Color = Color(0xFF393939) + override val layerAccentActive02: Color = Color(0xFF393939) - override val layerAccentActive03: Color = Color(0xFF525252) + override val layerAccentActive03: Color = Color(0xFF525252) - override val layerAccentHover01: Color = Color(0xFF656565) + override val layerAccentHover01: Color = Color(0xFF656565) - override val layerAccentHover02: Color = Color(0xFF5E5E5E) + override val layerAccentHover02: Color = Color(0xFF5E5E5E) - override val layerAccentHover03: Color = Color(0xFF7A7A7A) + override val layerAccentHover03: Color = Color(0xFF7A7A7A) - override val layer01: Color = Color(0xFF393939) + override val layer01: Color = Color(0xFF393939) - override val layer02: Color = Color(0xFF525252) + override val layer02: Color = Color(0xFF525252) - override val layer03: Color = Color(0xFF6F6F6F) + override val layer03: Color = Color(0xFF6F6F6F) - override val layerActive01: Color = Color(0xFF6F6F6F) + override val layerActive01: Color = Color(0xFF6F6F6F) - override val layerActive02: Color = Color(0xFF8D8D8D) + override val layerActive02: Color = Color(0xFF8D8D8D) - override val layerActive03: Color = Color(0xFF393939) + override val layerActive03: Color = Color(0xFF393939) - override val layerHover01: Color = Color(0xFF474747) + override val layerHover01: Color = Color(0xFF474747) - override val layerHover02: Color = Color(0xFF636363) + override val layerHover02: Color = Color(0xFF636363) - override val layerHover03: Color = Color(0xFF5E5E5E) + override val layerHover03: Color = Color(0xFF5E5E5E) - override val layerSelected01: Color = Color(0xFF525252) + override val layerSelected01: Color = Color(0xFF525252) - override val layerSelected02: Color = Color(0xFF6F6F6F) + override val layerSelected02: Color = Color(0xFF6F6F6F) - override val layerSelected03: Color = Color(0xFF525252) + override val layerSelected03: Color = Color(0xFF525252) - override val layerSelectedDisabled: Color = Color(0xFF8D8D8D) + override val layerSelectedDisabled: Color = Color(0xFF8D8D8D) - override val layerSelectedHover01: Color = Color(0xFF656565) + override val layerSelectedHover01: Color = Color(0xFF656565) - override val layerSelectedHover02: Color = Color(0xFF5E5E5E) + override val layerSelectedHover02: Color = Color(0xFF5E5E5E) - override val layerSelectedHover03: Color = Color(0xFF656565) + override val layerSelectedHover03: Color = Color(0xFF656565) - override val layerSelectedInverse: Color = Color(0xFFF4F4F4) + override val layerSelectedInverse: Color = Color(0xFFF4F4F4) - override val linkInverse: Color = Color(0xFF0F62FE) + override val linkInverse: Color = Color(0xFF0F62FE) - override val linkInverseActive: Color = Color(0xFF161616) + override val linkInverseActive: Color = Color(0xFF161616) - override val linkInverseHover: Color = Color(0xFF0043CE) + override val linkInverseHover: Color = Color(0xFF0043CE) - override val linkInverseVisited: Color = Color(0xFF8A3FFC) + override val linkInverseVisited: Color = Color(0xFF8A3FFC) - override val linkPrimary: Color = Color(0xFF78A9FF) + override val linkPrimary: Color = Color(0xFF78A9FF) - override val linkPrimaryHover: Color = Color(0xFFA6C8FF) + override val linkPrimaryHover: Color = Color(0xFFA6C8FF) - override val linkSecondary: Color = Color(0xFFA6C8FF) + override val linkSecondary: Color = Color(0xFFA6C8FF) - override val linkVisited: Color = Color(0xFFBE95FF) + override val linkVisited: Color = Color(0xFFBE95FF) - override val highlight: Color = Color(0xFF002D9C) + override val highlight: Color = Color(0xFF002D9C) - override val interactive: Color = Color(0xFF4589FF) + override val interactive: Color = Color(0xFF4589FF) - override val overlay: Color = Color(0xFF161616) + override val overlay: Color = Color(0xFF161616) - override val skeletonBackground: Color = Color(0xFF353535) + override val skeletonBackground: Color = Color(0xFF353535) - override val skeletonElement: Color = Color(0xFF525252) + override val skeletonElement: Color = Color(0xFF525252) - override val toggleOff: Color = Color(0xFF8D8D8D) + override val toggleOff: Color = Color(0xFF8D8D8D) - override val supportCautionMajor: Color = Color(0xFFFF832B) + override val supportCautionMajor: Color = Color(0xFFFF832B) - override val supportCautionMinor: Color = Color(0xFFF1C21B) + override val supportCautionMinor: Color = Color(0xFFF1C21B) - override val supportCautionUndefined: Color = Color(0xFFA56EFF) + override val supportCautionUndefined: Color = Color(0xFFA56EFF) - override val supportError: Color = Color(0xFFFF8389) + override val supportError: Color = Color(0xFFFF8389) - override val supportErrorInverse: Color = Color(0xFFDA1E28) + override val supportErrorInverse: Color = Color(0xFFDA1E28) - override val supportInfo: Color = Color(0xFF4589FF) + override val supportInfo: Color = Color(0xFF4589FF) - override val supportInfoInverse: Color = Color(0xFF0043CE) + override val supportInfoInverse: Color = Color(0xFF0043CE) - override val supportSuccess: Color = Color(0xFF42BE65) + override val supportSuccess: Color = Color(0xFF42BE65) - override val supportSuccessInverse: Color = Color(0xFF24A148) + override val supportSuccessInverse: Color = Color(0xFF24A148) - override val supportWarning: Color = Color(0xFFF1C21B) + override val supportWarning: Color = Color(0xFFF1C21B) - override val supportWarningInverse: Color = Color(0xFFF1C21B) + override val supportWarningInverse: Color = Color(0xFFF1C21B) - override val textDisabled: Color = Color(0xFFF4F4F4) + override val textDisabled: Color = Color(0x40F4F4F4) - override val textError: Color = Color(0xFFFFB3B8) + override val textError: Color = Color(0xFFFFB3B8) - override val textHelper: Color = Color(0xFF8D8D8D) + override val textHelper: Color = Color(0xFF8D8D8D) - override val textInverse: Color = Color(0xFF161616) + override val textInverse: Color = Color(0xFF161616) - override val textOnColor: Color = Color(0xFFFFFFFF) + override val textOnColor: Color = Color(0xFFFFFFFF) - override val textOnColorDisabled: Color = Color(0xFFFFFFFF) + override val textOnColorDisabled: Color = Color(0x40FFFFFF) - override val textPlaceholder: Color = Color(0xFF6F6F6F) + override val textPlaceholder: Color = Color(0xFF6F6F6F) - override val textPrimary: Color = Color(0xFFF4F4F4) + override val textPrimary: Color = Color(0xFFF4F4F4) - override val textSecondary: Color = Color(0xFFC6C6C6) + override val textSecondary: Color = Color(0xFFC6C6C6) - override val aiColors: AiColors = Gray90AiColors + override val aiColors: AiColors = Gray90AiColors - override val tagColors: TagColors = Gray90TagColors + override val tagColors: TagColors = Gray90TagColors - override val chatColors: ChatColors = Gray90ChatColors + override val chatColors: ChatColors = Gray90ChatColors - override val notificationColors: NotificationColors = Gray90NotificationColors + override val notificationColors: NotificationColors = Gray90NotificationColors } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/Theme.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/Theme.kt index 6cfcb494..18988164 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/Theme.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/Theme.kt @@ -27,1145 +27,1263 @@ import kotlin.Suppress */ @Immutable public abstract class Theme { - /** - * Default page background. - * UI Shell base color. - */ - public abstract val background: Color - - /** - * Active color for [background]. - */ - public abstract val backgroundActive: Color - - /** - * Feature background color. - */ - public abstract val backgroundBrand: Color - - /** - * Hover color for [background]. - * Hover color for transparent backgrounds. - */ - public abstract val backgroundHover: Color - - /** - * High contrast backgrounds. - * High contrast elements. - */ - public abstract val backgroundInverse: Color - - /** - * Hover color for [backgroundInverse]. - */ - public abstract val backgroundInverseHover: Color - - /** - * Selected color for [background]. - */ - public abstract val backgroundSelected: Color - - /** - * Hover color for [backgroundSelected]. - */ - public abstract val backgroundSelectedHover: Color - - /** - * Disabled border color (excluding border-subtles). - */ - public abstract val borderDisabled: Color - - /** - * 3:1 AA contrast. - * Selected borders. - * Active borders. - */ - public abstract val borderInteractive: Color - - /** - * High contrast border. - * 4.5:1 AA non-text contrast. - */ - public abstract val borderInverse: Color - - /** - * Medium contrast border. - * Border-bottom paired with [field01]. - * 3:1 AA non-text contrast. - */ - public abstract val borderStrong01: Color - - /** - * Medium contrast border. - * Border-bottom paired with [field02]. - * 3:1 AA non-text contrast. - */ - public abstract val borderStrong02: Color - - /** - * Medium contrast border. - * Border-bottom paired with [field03]. - * 3:1 AA non-text contrast. - */ - public abstract val borderStrong03: Color - - /** - * Subtle borders paired with [background]. - */ - public abstract val borderSubtle00: Color - - /** - * Subtle borders paired with [layer01]. - */ - public abstract val borderSubtle01: Color - - /** - * Subtle borders paired with [layer02]. - */ - public abstract val borderSubtle02: Color - - /** - * Subtle borders paired with [layer03]. - */ - public abstract val borderSubtle03: Color - - /** - * Selected color for [borderSubtle01]. - */ - public abstract val borderSubtleSelected01: Color - - /** - * Selected color for [borderSubtle02]. - */ - public abstract val borderSubtleSelected02: Color - - /** - * Selected color for [borderSubtle03]. - */ - public abstract val borderSubtleSelected03: Color - - /** - * Operable tile indicator paired with [layer01]. - */ - public abstract val borderTile01: Color - - /** - * Operable tile indicator paired with [layer02]. - */ - public abstract val borderTile02: Color - - /** - * Operable tile indicator paired with [layer03]. - */ - public abstract val borderTile03: Color - - /** - * Active color for [dangerPrimary]. - * Active color for [dangerSecondary]. - */ - public abstract val buttonDangerActive: Color - - /** - * Hover color for [dangerPrimary]. - * Hover color for [dangerSecondary]. - */ - public abstract val buttonDangerHover: Color - - /** - * Primary danger button color. - * 3:1 AA non-text contrast. - */ - public abstract val buttonDangerPrimary: Color - - /** - * Tertiary danger button color. - * Ghost danger button color. - * 4.5:1 AA text contrast. - */ - public abstract val buttonDangerSecondary: Color - - /** - * Disabled color for button elements. - */ - public abstract val buttonDisabled: Color - - /** - * Primary button color. - */ - public abstract val buttonPrimary: Color - - /** - * Active color for [buttonPrimary]. - */ - public abstract val buttonPrimaryActive: Color - - /** - * Hover color for [buttonPrimary]. - */ - public abstract val buttonPrimaryHover: Color - - /** - * Secondary button color. - */ - public abstract val buttonSecondary: Color - - /** - * Active color for [buttonSecondary]. - */ - public abstract val buttonSecondaryActive: Color - - /** - * Hover color for [buttonSecondary]. - */ - public abstract val buttonSecondaryHover: Color - - /** - * Fluid button separator. - * 3:1 AA non-text contrast. - */ - public abstract val buttonSeparator: Color - - /** - * Tertiary button color. - * 4.5:1 AA text contrast. - */ - public abstract val buttonTertiary: Color - - /** - * Active color for [buttonTertiary]. - */ - public abstract val buttonTertiaryActive: Color - - /** - * Hover color for [buttonTertiary]. - */ - public abstract val buttonTertiaryHover: Color - - /** - * Default input fields. - * Fields on [background]. - */ - public abstract val field01: Color - - /** - * Secondary input fields. - * Fields on [layer01]. - */ - public abstract val field02: Color - - /** - * Tertiary input fields. - * Fields on [layer02]. - */ - public abstract val field03: Color - - /** - * Hover color for [field01]. - */ - public abstract val fieldHover01: Color - - /** - * Hover color for [field02]. - */ - public abstract val fieldHover02: Color - - /** - * Hover color for [field03]. - */ - public abstract val fieldHover03: Color - - /** - * Focus border. - * Focus underline. - */ - public abstract val focus: Color - - /** - * Contrast border paired with [focus]. - */ - public abstract val focusInset: Color - - /** - * Focus on high contrast moments. - */ - public abstract val focusInverse: Color - - /** - * Disabled icon color. - */ - public abstract val iconDisabled: Color - - /** - * Icons that indicate operability. - */ - public abstract val iconInteractive: Color - - /** - * Inverse icon color. - */ - public abstract val iconInverse: Color - - /** - * Icons on interactive colors. - * Icons on non-layer colors. - */ - public abstract val iconOnColor: Color - - /** - * Disabled color for [iconOnColor]. - */ - public abstract val iconOnColorDisabled: Color - - /** - * Primary icons. - */ - public abstract val iconPrimary: Color - - /** - * Secondary icons. - */ - public abstract val iconSecondary: Color - - /** - * Tertiary background paired with [layer01]. - */ - public abstract val layerAccent01: Color - - /** - * Tertiary background paired with [layer02]. - */ - public abstract val layerAccent02: Color - - /** - * Tertiary background paired with [layer03]. - */ - public abstract val layerAccent03: Color - - /** - * Active color for [layerAccent01]. - */ - public abstract val layerAccentActive01: Color - - /** - * Active color for [layerAccent02]. - */ - public abstract val layerAccentActive02: Color - - /** - * Active color for [layerAccent03]. - */ - public abstract val layerAccentActive03: Color - - /** - * Hover color for [layerAccent01]. - */ - public abstract val layerAccentHover01: Color - - /** - * Hover color for [layerAccent02]. - */ - public abstract val layerAccentHover02: Color - - /** - * Hover color for [layerAccent03]. - */ - public abstract val layerAccentHover03: Color - - /** - * Container color on [background]. - * Secondary page background. - */ - public abstract val layer01: Color - - /** - * Container color on [layer01]. - */ - public abstract val layer02: Color - - /** - * Container color on [layer02]. - */ - public abstract val layer03: Color - - /** - * Active color for [layer01]. - */ - public abstract val layerActive01: Color - - /** - * Active color for [layer02]. - */ - public abstract val layerActive02: Color - - /** - * Active color for [layer03]. - */ - public abstract val layerActive03: Color - - /** - * Hover color for [layer01]. - */ - public abstract val layerHover01: Color - - /** - * Hover color for [layer02]. - */ - public abstract val layerHover02: Color - - /** - * Hover color for [layer03]. - */ - public abstract val layerHover03: Color - - /** - * Selected color for [layer01]. - */ - public abstract val layerSelected01: Color - - /** - * Selected color for [layer02]. - */ - public abstract val layerSelected02: Color - - /** - * Selected color for [layer03]. - */ - public abstract val layerSelected03: Color - - /** - * Disabled color for selected layers. - */ - public abstract val layerSelectedDisabled: Color - - /** - * Hover color for [layerSelected01]. - */ - public abstract val layerSelectedHover01: Color - - /** - * Hover color for [layerSelected02]. - */ - public abstract val layerSelectedHover02: Color - - /** - * Hover color for [layerSelected03]. - */ - public abstract val layerSelectedHover03: Color - - /** - * High contrast elements. - * 4.5:1 AA element contrast. - */ - public abstract val layerSelectedInverse: Color - - /** - * Links on [backgroundInverse] backgrounds. - */ - public abstract val linkInverse: Color - - /** - * Active color for links on [backgroundInverse] backgrounds. - */ - public abstract val linkInverseActive: Color - - /** - * Hover color for links on [backgroundInverse] backgrounds. - */ - public abstract val linkInverseHover: Color - - /** - * Color for visited links on [backgroundInverse] backgrounds. - */ - public abstract val linkInverseVisited: Color - - /** - * Primary links. - */ - public abstract val linkPrimary: Color - - /** - * Hover color for [linkPrimary]. - */ - public abstract val linkPrimaryHover: Color - - /** - * Secondary link color for lower contrast backgrounds. - */ - public abstract val linkSecondary: Color - - /** - * Color for visited links. - */ - public abstract val linkVisited: Color - - /** - * Highlight color. - */ - public abstract val highlight: Color - - /** - * 3:1 AA contrast. - * Selected elements. - * Active elements. - * Accent icons. - */ - public abstract val interactive: Color - - /** - * Background overlay. - */ - public abstract val overlay: Color - - /** - * Skeleton color for containers. - */ - public abstract val skeletonBackground: Color - - /** - * Skeleton color for text and UI elements. - */ - public abstract val skeletonElement: Color - - /** - * Off background. - * 3:1 AA contrast. - */ - public abstract val toggleOff: Color - - /** - * Major caution status. - */ - public abstract val supportCautionMajor: Color - - /** - * Minor caution status. - */ - public abstract val supportCautionMinor: Color - - /** - * Undefined status. - */ - public abstract val supportCautionUndefined: Color - - /** - * Error. - * Invalid state. - */ - public abstract val supportError: Color - - /** - * Error in high contrast moments. - */ - public abstract val supportErrorInverse: Color - - /** - * Information. - */ - public abstract val supportInfo: Color - - /** - * Information in high contrast moments. - */ - public abstract val supportInfoInverse: Color - - /** - * Success. - * On. - */ - public abstract val supportSuccess: Color - - /** - * Success in high contrast moments. - */ - public abstract val supportSuccessInverse: Color - - /** - * Warning. - */ - public abstract val supportWarning: Color - - /** - * Warning in high contrast moments. - */ - public abstract val supportWarningInverse: Color - - /** - * Disabled text color. - */ - public abstract val textDisabled: Color - - /** - * Error message text. - */ - public abstract val textError: Color - - /** - * Tertiary text. - * Help text. - */ - public abstract val textHelper: Color - - /** - * Inverse text color. - */ - public abstract val textInverse: Color - - /** - * Text on interactive colors. - * Text on button colors. - */ - public abstract val textOnColor: Color - - /** - * Disabled color for [textOnColor]. - */ - public abstract val textOnColorDisabled: Color - - /** - * Placeholder text. - */ - public abstract val textPlaceholder: Color - - /** - * Primary text. - * Body copy. - * Headers. - * Hover text color for [textSecondary]. - */ - public abstract val textPrimary: Color - - /** - * Secondary text. - * Input labels. - */ - public abstract val textSecondary: Color - - /** - * Color tokens for the Ai component. - */ - public abstract val aiColors: AiColors - - /** - * Color tokens for the Tag component. - */ - public abstract val tagColors: TagColors - - /** - * Color tokens for the Chat component. - */ - public abstract val chatColors: ChatColors - - /** - * Color tokens for the Notification component. - */ - public abstract val notificationColors: NotificationColors - - /** - * Returns the container color based on a provided [layer]. - * - * @param layer Associated layer. Defaults to layer 00. - */ - public fun containerColor(layer: Layer = Layer.Layer00): Color = when (layer) { - Layer.Layer00 -> background - Layer.Layer01 -> layer01 - Layer.Layer02 -> layer02 - Layer.Layer03 -> layer03 - } - - @Suppress("LongMethod") - internal fun copy( - background: Color = this.background, - backgroundActive: Color = this.backgroundActive, - backgroundBrand: Color = this.backgroundBrand, - backgroundHover: Color = this.backgroundHover, - backgroundInverse: Color = this.backgroundInverse, - backgroundInverseHover: Color = this.backgroundInverseHover, - backgroundSelected: Color = this.backgroundSelected, - backgroundSelectedHover: Color = this.backgroundSelectedHover, - borderDisabled: Color = this.borderDisabled, - borderInteractive: Color = this.borderInteractive, - borderInverse: Color = this.borderInverse, - borderStrong01: Color = this.borderStrong01, - borderStrong02: Color = this.borderStrong02, - borderStrong03: Color = this.borderStrong03, - borderSubtle00: Color = this.borderSubtle00, - borderSubtle01: Color = this.borderSubtle01, - borderSubtle02: Color = this.borderSubtle02, - borderSubtle03: Color = this.borderSubtle03, - borderSubtleSelected01: Color = this.borderSubtleSelected01, - borderSubtleSelected02: Color = this.borderSubtleSelected02, - borderSubtleSelected03: Color = this.borderSubtleSelected03, - borderTile01: Color = this.borderTile01, - borderTile02: Color = this.borderTile02, - borderTile03: Color = this.borderTile03, - buttonDangerActive: Color = this.buttonDangerActive, - buttonDangerHover: Color = this.buttonDangerHover, - buttonDangerPrimary: Color = this.buttonDangerPrimary, - buttonDangerSecondary: Color = this.buttonDangerSecondary, - buttonDisabled: Color = this.buttonDisabled, - buttonPrimary: Color = this.buttonPrimary, - buttonPrimaryActive: Color = this.buttonPrimaryActive, - buttonPrimaryHover: Color = this.buttonPrimaryHover, - buttonSecondary: Color = this.buttonSecondary, - buttonSecondaryActive: Color = this.buttonSecondaryActive, - buttonSecondaryHover: Color = this.buttonSecondaryHover, - buttonSeparator: Color = this.buttonSeparator, - buttonTertiary: Color = this.buttonTertiary, - buttonTertiaryActive: Color = this.buttonTertiaryActive, - buttonTertiaryHover: Color = this.buttonTertiaryHover, - field01: Color = this.field01, - field02: Color = this.field02, - field03: Color = this.field03, - fieldHover01: Color = this.fieldHover01, - fieldHover02: Color = this.fieldHover02, - fieldHover03: Color = this.fieldHover03, - focus: Color = this.focus, - focusInset: Color = this.focusInset, - focusInverse: Color = this.focusInverse, - iconDisabled: Color = this.iconDisabled, - iconInteractive: Color = this.iconInteractive, - iconInverse: Color = this.iconInverse, - iconOnColor: Color = this.iconOnColor, - iconOnColorDisabled: Color = this.iconOnColorDisabled, - iconPrimary: Color = this.iconPrimary, - iconSecondary: Color = this.iconSecondary, - layerAccent01: Color = this.layerAccent01, - layerAccent02: Color = this.layerAccent02, - layerAccent03: Color = this.layerAccent03, - layerAccentActive01: Color = this.layerAccentActive01, - layerAccentActive02: Color = this.layerAccentActive02, - layerAccentActive03: Color = this.layerAccentActive03, - layerAccentHover01: Color = this.layerAccentHover01, - layerAccentHover02: Color = this.layerAccentHover02, - layerAccentHover03: Color = this.layerAccentHover03, - layer01: Color = this.layer01, - layer02: Color = this.layer02, - layer03: Color = this.layer03, - layerActive01: Color = this.layerActive01, - layerActive02: Color = this.layerActive02, - layerActive03: Color = this.layerActive03, - layerHover01: Color = this.layerHover01, - layerHover02: Color = this.layerHover02, - layerHover03: Color = this.layerHover03, - layerSelected01: Color = this.layerSelected01, - layerSelected02: Color = this.layerSelected02, - layerSelected03: Color = this.layerSelected03, - layerSelectedDisabled: Color = this.layerSelectedDisabled, - layerSelectedHover01: Color = this.layerSelectedHover01, - layerSelectedHover02: Color = this.layerSelectedHover02, - layerSelectedHover03: Color = this.layerSelectedHover03, - layerSelectedInverse: Color = this.layerSelectedInverse, - linkInverse: Color = this.linkInverse, - linkInverseActive: Color = this.linkInverseActive, - linkInverseHover: Color = this.linkInverseHover, - linkInverseVisited: Color = this.linkInverseVisited, - linkPrimary: Color = this.linkPrimary, - linkPrimaryHover: Color = this.linkPrimaryHover, - linkSecondary: Color = this.linkSecondary, - linkVisited: Color = this.linkVisited, - highlight: Color = this.highlight, - interactive: Color = this.interactive, - overlay: Color = this.overlay, - skeletonBackground: Color = this.skeletonBackground, - skeletonElement: Color = this.skeletonElement, - toggleOff: Color = this.toggleOff, - supportCautionMajor: Color = this.supportCautionMajor, - supportCautionMinor: Color = this.supportCautionMinor, - supportCautionUndefined: Color = this.supportCautionUndefined, - supportError: Color = this.supportError, - supportErrorInverse: Color = this.supportErrorInverse, - supportInfo: Color = this.supportInfo, - supportInfoInverse: Color = this.supportInfoInverse, - supportSuccess: Color = this.supportSuccess, - supportSuccessInverse: Color = this.supportSuccessInverse, - supportWarning: Color = this.supportWarning, - supportWarningInverse: Color = this.supportWarningInverse, - textDisabled: Color = this.textDisabled, - textError: Color = this.textError, - textHelper: Color = this.textHelper, - textInverse: Color = this.textInverse, - textOnColor: Color = this.textOnColor, - textOnColorDisabled: Color = this.textOnColorDisabled, - textPlaceholder: Color = this.textPlaceholder, - textPrimary: Color = this.textPrimary, - textSecondary: Color = this.textSecondary, - aiColors: AiColors = this.aiColors, - tagColors: TagColors = this.tagColors, - chatColors: ChatColors = this.chatColors, - notificationColors: NotificationColors = this.notificationColors, - ): Theme = object : Theme() { - override val background: Color = background - override val backgroundActive: Color = backgroundActive - override val backgroundBrand: Color = backgroundBrand - override val backgroundHover: Color = backgroundHover - override val backgroundInverse: Color = backgroundInverse - override val backgroundInverseHover: Color = backgroundInverseHover - override val backgroundSelected: Color = backgroundSelected - override val backgroundSelectedHover: Color = backgroundSelectedHover - override val borderDisabled: Color = borderDisabled - override val borderInteractive: Color = borderInteractive - override val borderInverse: Color = borderInverse - override val borderStrong01: Color = borderStrong01 - override val borderStrong02: Color = borderStrong02 - override val borderStrong03: Color = borderStrong03 - override val borderSubtle00: Color = borderSubtle00 - override val borderSubtle01: Color = borderSubtle01 - override val borderSubtle02: Color = borderSubtle02 - override val borderSubtle03: Color = borderSubtle03 - override val borderSubtleSelected01: Color = borderSubtleSelected01 - override val borderSubtleSelected02: Color = borderSubtleSelected02 - override val borderSubtleSelected03: Color = borderSubtleSelected03 - override val borderTile01: Color = borderTile01 - override val borderTile02: Color = borderTile02 - override val borderTile03: Color = borderTile03 - override val buttonDangerActive: Color = buttonDangerActive - override val buttonDangerHover: Color = buttonDangerHover - override val buttonDangerPrimary: Color = buttonDangerPrimary - override val buttonDangerSecondary: Color = buttonDangerSecondary - override val buttonDisabled: Color = buttonDisabled - override val buttonPrimary: Color = buttonPrimary - override val buttonPrimaryActive: Color = buttonPrimaryActive - override val buttonPrimaryHover: Color = buttonPrimaryHover - override val buttonSecondary: Color = buttonSecondary - override val buttonSecondaryActive: Color = buttonSecondaryActive - override val buttonSecondaryHover: Color = buttonSecondaryHover - override val buttonSeparator: Color = buttonSeparator - override val buttonTertiary: Color = buttonTertiary - override val buttonTertiaryActive: Color = buttonTertiaryActive - override val buttonTertiaryHover: Color = buttonTertiaryHover - override val field01: Color = field01 - override val field02: Color = field02 - override val field03: Color = field03 - override val fieldHover01: Color = fieldHover01 - override val fieldHover02: Color = fieldHover02 - override val fieldHover03: Color = fieldHover03 - override val focus: Color = focus - override val focusInset: Color = focusInset - override val focusInverse: Color = focusInverse - override val iconDisabled: Color = iconDisabled - override val iconInteractive: Color = iconInteractive - override val iconInverse: Color = iconInverse - override val iconOnColor: Color = iconOnColor - override val iconOnColorDisabled: Color = iconOnColorDisabled - override val iconPrimary: Color = iconPrimary - override val iconSecondary: Color = iconSecondary - override val layerAccent01: Color = layerAccent01 - override val layerAccent02: Color = layerAccent02 - override val layerAccent03: Color = layerAccent03 - override val layerAccentActive01: Color = layerAccentActive01 - override val layerAccentActive02: Color = layerAccentActive02 - override val layerAccentActive03: Color = layerAccentActive03 - override val layerAccentHover01: Color = layerAccentHover01 - override val layerAccentHover02: Color = layerAccentHover02 - override val layerAccentHover03: Color = layerAccentHover03 - override val layer01: Color = layer01 - override val layer02: Color = layer02 - override val layer03: Color = layer03 - override val layerActive01: Color = layerActive01 - override val layerActive02: Color = layerActive02 - override val layerActive03: Color = layerActive03 - override val layerHover01: Color = layerHover01 - override val layerHover02: Color = layerHover02 - override val layerHover03: Color = layerHover03 - override val layerSelected01: Color = layerSelected01 - override val layerSelected02: Color = layerSelected02 - override val layerSelected03: Color = layerSelected03 - override val layerSelectedDisabled: Color = layerSelectedDisabled - override val layerSelectedHover01: Color = layerSelectedHover01 - override val layerSelectedHover02: Color = layerSelectedHover02 - override val layerSelectedHover03: Color = layerSelectedHover03 - override val layerSelectedInverse: Color = layerSelectedInverse - override val linkInverse: Color = linkInverse - override val linkInverseActive: Color = linkInverseActive - override val linkInverseHover: Color = linkInverseHover - override val linkInverseVisited: Color = linkInverseVisited - override val linkPrimary: Color = linkPrimary - override val linkPrimaryHover: Color = linkPrimaryHover - override val linkSecondary: Color = linkSecondary - override val linkVisited: Color = linkVisited - override val highlight: Color = highlight - override val interactive: Color = interactive - override val overlay: Color = overlay - override val skeletonBackground: Color = skeletonBackground - override val skeletonElement: Color = skeletonElement - override val toggleOff: Color = toggleOff - override val supportCautionMajor: Color = supportCautionMajor - override val supportCautionMinor: Color = supportCautionMinor - override val supportCautionUndefined: Color = supportCautionUndefined - override val supportError: Color = supportError - override val supportErrorInverse: Color = supportErrorInverse - override val supportInfo: Color = supportInfo - override val supportInfoInverse: Color = supportInfoInverse - override val supportSuccess: Color = supportSuccess - override val supportSuccessInverse: Color = supportSuccessInverse - override val supportWarning: Color = supportWarning - override val supportWarningInverse: Color = supportWarningInverse - override val textDisabled: Color = textDisabled - override val textError: Color = textError - override val textHelper: Color = textHelper - override val textInverse: Color = textInverse - override val textOnColor: Color = textOnColor - override val textOnColorDisabled: Color = textOnColorDisabled - override val textPlaceholder: Color = textPlaceholder - override val textPrimary: Color = textPrimary - override val textSecondary: Color = textSecondary - override val aiColors: AiColors = aiColors - override val tagColors: TagColors = tagColors - override val chatColors: ChatColors = chatColors - override val notificationColors: NotificationColors = notificationColors - } - - @Suppress( - "CognitiveComplexMethod", - "CyclomaticComplexMethod", - "LongMethod", - ) - override fun equals(other: Any?): Boolean { - if (this === other) return true - if (other !is Theme) return false - if (background != other.background) return false - if (backgroundActive != other.backgroundActive) return false - if (backgroundBrand != other.backgroundBrand) return false - if (backgroundHover != other.backgroundHover) return false - if (backgroundInverse != other.backgroundInverse) return false - if (backgroundInverseHover != other.backgroundInverseHover) return false - if (backgroundSelected != other.backgroundSelected) return false - if (backgroundSelectedHover != other.backgroundSelectedHover) return false - if (borderDisabled != other.borderDisabled) return false - if (borderInteractive != other.borderInteractive) return false - if (borderInverse != other.borderInverse) return false - if (borderStrong01 != other.borderStrong01) return false - if (borderStrong02 != other.borderStrong02) return false - if (borderStrong03 != other.borderStrong03) return false - if (borderSubtle00 != other.borderSubtle00) return false - if (borderSubtle01 != other.borderSubtle01) return false - if (borderSubtle02 != other.borderSubtle02) return false - if (borderSubtle03 != other.borderSubtle03) return false - if (borderSubtleSelected01 != other.borderSubtleSelected01) return false - if (borderSubtleSelected02 != other.borderSubtleSelected02) return false - if (borderSubtleSelected03 != other.borderSubtleSelected03) return false - if (borderTile01 != other.borderTile01) return false - if (borderTile02 != other.borderTile02) return false - if (borderTile03 != other.borderTile03) return false - if (buttonDangerActive != other.buttonDangerActive) return false - if (buttonDangerHover != other.buttonDangerHover) return false - if (buttonDangerPrimary != other.buttonDangerPrimary) return false - if (buttonDangerSecondary != other.buttonDangerSecondary) return false - if (buttonDisabled != other.buttonDisabled) return false - if (buttonPrimary != other.buttonPrimary) return false - if (buttonPrimaryActive != other.buttonPrimaryActive) return false - if (buttonPrimaryHover != other.buttonPrimaryHover) return false - if (buttonSecondary != other.buttonSecondary) return false - if (buttonSecondaryActive != other.buttonSecondaryActive) return false - if (buttonSecondaryHover != other.buttonSecondaryHover) return false - if (buttonSeparator != other.buttonSeparator) return false - if (buttonTertiary != other.buttonTertiary) return false - if (buttonTertiaryActive != other.buttonTertiaryActive) return false - if (buttonTertiaryHover != other.buttonTertiaryHover) return false - if (field01 != other.field01) return false - if (field02 != other.field02) return false - if (field03 != other.field03) return false - if (fieldHover01 != other.fieldHover01) return false - if (fieldHover02 != other.fieldHover02) return false - if (fieldHover03 != other.fieldHover03) return false - if (focus != other.focus) return false - if (focusInset != other.focusInset) return false - if (focusInverse != other.focusInverse) return false - if (iconDisabled != other.iconDisabled) return false - if (iconInteractive != other.iconInteractive) return false - if (iconInverse != other.iconInverse) return false - if (iconOnColor != other.iconOnColor) return false - if (iconOnColorDisabled != other.iconOnColorDisabled) return false - if (iconPrimary != other.iconPrimary) return false - if (iconSecondary != other.iconSecondary) return false - if (layerAccent01 != other.layerAccent01) return false - if (layerAccent02 != other.layerAccent02) return false - if (layerAccent03 != other.layerAccent03) return false - if (layerAccentActive01 != other.layerAccentActive01) return false - if (layerAccentActive02 != other.layerAccentActive02) return false - if (layerAccentActive03 != other.layerAccentActive03) return false - if (layerAccentHover01 != other.layerAccentHover01) return false - if (layerAccentHover02 != other.layerAccentHover02) return false - if (layerAccentHover03 != other.layerAccentHover03) return false - if (layer01 != other.layer01) return false - if (layer02 != other.layer02) return false - if (layer03 != other.layer03) return false - if (layerActive01 != other.layerActive01) return false - if (layerActive02 != other.layerActive02) return false - if (layerActive03 != other.layerActive03) return false - if (layerHover01 != other.layerHover01) return false - if (layerHover02 != other.layerHover02) return false - if (layerHover03 != other.layerHover03) return false - if (layerSelected01 != other.layerSelected01) return false - if (layerSelected02 != other.layerSelected02) return false - if (layerSelected03 != other.layerSelected03) return false - if (layerSelectedDisabled != other.layerSelectedDisabled) return false - if (layerSelectedHover01 != other.layerSelectedHover01) return false - if (layerSelectedHover02 != other.layerSelectedHover02) return false - if (layerSelectedHover03 != other.layerSelectedHover03) return false - if (layerSelectedInverse != other.layerSelectedInverse) return false - if (linkInverse != other.linkInverse) return false - if (linkInverseActive != other.linkInverseActive) return false - if (linkInverseHover != other.linkInverseHover) return false - if (linkInverseVisited != other.linkInverseVisited) return false - if (linkPrimary != other.linkPrimary) return false - if (linkPrimaryHover != other.linkPrimaryHover) return false - if (linkSecondary != other.linkSecondary) return false - if (linkVisited != other.linkVisited) return false - if (highlight != other.highlight) return false - if (interactive != other.interactive) return false - if (overlay != other.overlay) return false - if (skeletonBackground != other.skeletonBackground) return false - if (skeletonElement != other.skeletonElement) return false - if (toggleOff != other.toggleOff) return false - if (supportCautionMajor != other.supportCautionMajor) return false - if (supportCautionMinor != other.supportCautionMinor) return false - if (supportCautionUndefined != other.supportCautionUndefined) return false - if (supportError != other.supportError) return false - if (supportErrorInverse != other.supportErrorInverse) return false - if (supportInfo != other.supportInfo) return false - if (supportInfoInverse != other.supportInfoInverse) return false - if (supportSuccess != other.supportSuccess) return false - if (supportSuccessInverse != other.supportSuccessInverse) return false - if (supportWarning != other.supportWarning) return false - if (supportWarningInverse != other.supportWarningInverse) return false - if (textDisabled != other.textDisabled) return false - if (textError != other.textError) return false - if (textHelper != other.textHelper) return false - if (textInverse != other.textInverse) return false - if (textOnColor != other.textOnColor) return false - if (textOnColorDisabled != other.textOnColorDisabled) return false - if (textPlaceholder != other.textPlaceholder) return false - if (textPrimary != other.textPrimary) return false - if (textSecondary != other.textSecondary) return false - if (aiColors != other.aiColors) return false - if (tagColors != other.tagColors) return false - if (chatColors != other.chatColors) return false - if (notificationColors != other.notificationColors) return false - return true - } - - @Suppress("LongMethod") - override fun hashCode(): Int { - var result = background.hashCode() - result = 31 * result + backgroundActive.hashCode() - result = 31 * result + backgroundBrand.hashCode() - result = 31 * result + backgroundHover.hashCode() - result = 31 * result + backgroundInverse.hashCode() - result = 31 * result + backgroundInverseHover.hashCode() - result = 31 * result + backgroundSelected.hashCode() - result = 31 * result + backgroundSelectedHover.hashCode() - result = 31 * result + borderDisabled.hashCode() - result = 31 * result + borderInteractive.hashCode() - result = 31 * result + borderInverse.hashCode() - result = 31 * result + borderStrong01.hashCode() - result = 31 * result + borderStrong02.hashCode() - result = 31 * result + borderStrong03.hashCode() - result = 31 * result + borderSubtle00.hashCode() - result = 31 * result + borderSubtle01.hashCode() - result = 31 * result + borderSubtle02.hashCode() - result = 31 * result + borderSubtle03.hashCode() - result = 31 * result + borderSubtleSelected01.hashCode() - result = 31 * result + borderSubtleSelected02.hashCode() - result = 31 * result + borderSubtleSelected03.hashCode() - result = 31 * result + borderTile01.hashCode() - result = 31 * result + borderTile02.hashCode() - result = 31 * result + borderTile03.hashCode() - result = 31 * result + buttonDangerActive.hashCode() - result = 31 * result + buttonDangerHover.hashCode() - result = 31 * result + buttonDangerPrimary.hashCode() - result = 31 * result + buttonDangerSecondary.hashCode() - result = 31 * result + buttonDisabled.hashCode() - result = 31 * result + buttonPrimary.hashCode() - result = 31 * result + buttonPrimaryActive.hashCode() - result = 31 * result + buttonPrimaryHover.hashCode() - result = 31 * result + buttonSecondary.hashCode() - result = 31 * result + buttonSecondaryActive.hashCode() - result = 31 * result + buttonSecondaryHover.hashCode() - result = 31 * result + buttonSeparator.hashCode() - result = 31 * result + buttonTertiary.hashCode() - result = 31 * result + buttonTertiaryActive.hashCode() - result = 31 * result + buttonTertiaryHover.hashCode() - result = 31 * result + field01.hashCode() - result = 31 * result + field02.hashCode() - result = 31 * result + field03.hashCode() - result = 31 * result + fieldHover01.hashCode() - result = 31 * result + fieldHover02.hashCode() - result = 31 * result + fieldHover03.hashCode() - result = 31 * result + focus.hashCode() - result = 31 * result + focusInset.hashCode() - result = 31 * result + focusInverse.hashCode() - result = 31 * result + iconDisabled.hashCode() - result = 31 * result + iconInteractive.hashCode() - result = 31 * result + iconInverse.hashCode() - result = 31 * result + iconOnColor.hashCode() - result = 31 * result + iconOnColorDisabled.hashCode() - result = 31 * result + iconPrimary.hashCode() - result = 31 * result + iconSecondary.hashCode() - result = 31 * result + layerAccent01.hashCode() - result = 31 * result + layerAccent02.hashCode() - result = 31 * result + layerAccent03.hashCode() - result = 31 * result + layerAccentActive01.hashCode() - result = 31 * result + layerAccentActive02.hashCode() - result = 31 * result + layerAccentActive03.hashCode() - result = 31 * result + layerAccentHover01.hashCode() - result = 31 * result + layerAccentHover02.hashCode() - result = 31 * result + layerAccentHover03.hashCode() - result = 31 * result + layer01.hashCode() - result = 31 * result + layer02.hashCode() - result = 31 * result + layer03.hashCode() - result = 31 * result + layerActive01.hashCode() - result = 31 * result + layerActive02.hashCode() - result = 31 * result + layerActive03.hashCode() - result = 31 * result + layerHover01.hashCode() - result = 31 * result + layerHover02.hashCode() - result = 31 * result + layerHover03.hashCode() - result = 31 * result + layerSelected01.hashCode() - result = 31 * result + layerSelected02.hashCode() - result = 31 * result + layerSelected03.hashCode() - result = 31 * result + layerSelectedDisabled.hashCode() - result = 31 * result + layerSelectedHover01.hashCode() - result = 31 * result + layerSelectedHover02.hashCode() - result = 31 * result + layerSelectedHover03.hashCode() - result = 31 * result + layerSelectedInverse.hashCode() - result = 31 * result + linkInverse.hashCode() - result = 31 * result + linkInverseActive.hashCode() - result = 31 * result + linkInverseHover.hashCode() - result = 31 * result + linkInverseVisited.hashCode() - result = 31 * result + linkPrimary.hashCode() - result = 31 * result + linkPrimaryHover.hashCode() - result = 31 * result + linkSecondary.hashCode() - result = 31 * result + linkVisited.hashCode() - result = 31 * result + highlight.hashCode() - result = 31 * result + interactive.hashCode() - result = 31 * result + overlay.hashCode() - result = 31 * result + skeletonBackground.hashCode() - result = 31 * result + skeletonElement.hashCode() - result = 31 * result + toggleOff.hashCode() - result = 31 * result + supportCautionMajor.hashCode() - result = 31 * result + supportCautionMinor.hashCode() - result = 31 * result + supportCautionUndefined.hashCode() - result = 31 * result + supportError.hashCode() - result = 31 * result + supportErrorInverse.hashCode() - result = 31 * result + supportInfo.hashCode() - result = 31 * result + supportInfoInverse.hashCode() - result = 31 * result + supportSuccess.hashCode() - result = 31 * result + supportSuccessInverse.hashCode() - result = 31 * result + supportWarning.hashCode() - result = 31 * result + supportWarningInverse.hashCode() - result = 31 * result + textDisabled.hashCode() - result = 31 * result + textError.hashCode() - result = 31 * result + textHelper.hashCode() - result = 31 * result + textInverse.hashCode() - result = 31 * result + textOnColor.hashCode() - result = 31 * result + textOnColorDisabled.hashCode() - result = 31 * result + textPlaceholder.hashCode() - result = 31 * result + textPrimary.hashCode() - result = 31 * result + textSecondary.hashCode() - result = 31 * result + aiColors.hashCode() - result = 31 * result + tagColors.hashCode() - result = 31 * result + chatColors.hashCode() - result = 31 * result + notificationColors.hashCode() - return result - } + /** + * Default page background. + * UI Shell base color. + */ + public abstract val background: Color + + /** + * Active color for [background]. + */ + public abstract val backgroundActive: Color + + /** + * Feature background color. + */ + public abstract val backgroundBrand: Color + + /** + * Hover color for [background]. + * Hover color for transparent backgrounds. + */ + public abstract val backgroundHover: Color + + /** + * High contrast backgrounds. + * High contrast elements. + */ + public abstract val backgroundInverse: Color + + /** + * Hover color for [backgroundInverse]. + */ + public abstract val backgroundInverseHover: Color + + /** + * Selected color for [background]. + */ + public abstract val backgroundSelected: Color + + /** + * Hover color for [backgroundSelected]. + */ + public abstract val backgroundSelectedHover: Color + + /** + * Disabled border color (excluding border-subtles). + */ + public abstract val borderDisabled: Color + + /** + * 3:1 AA contrast. + * Selected borders. + * Active borders. + */ + public abstract val borderInteractive: Color + + /** + * High contrast border. + * 4.5:1 AA non-text contrast. + */ + public abstract val borderInverse: Color + + /** + * Medium contrast border. + * Border-bottom paired with [field01]. + * 3:1 AA non-text contrast. + */ + public abstract val borderStrong01: Color + + /** + * Medium contrast border. + * Border-bottom paired with [field02]. + * 3:1 AA non-text contrast. + */ + public abstract val borderStrong02: Color + + /** + * Medium contrast border. + * Border-bottom paired with [field03]. + * 3:1 AA non-text contrast. + */ + public abstract val borderStrong03: Color + + /** + * Subtle borders paired with [background]. + */ + public abstract val borderSubtle00: Color + + /** + * Subtle borders paired with [layer01]. + */ + public abstract val borderSubtle01: Color + + /** + * Subtle borders paired with [layer02]. + */ + public abstract val borderSubtle02: Color + + /** + * Subtle borders paired with [layer03]. + */ + public abstract val borderSubtle03: Color + + /** + * Selected color for [borderSubtle01]. + */ + public abstract val borderSubtleSelected01: Color + + /** + * Selected color for [borderSubtle02]. + */ + public abstract val borderSubtleSelected02: Color + + /** + * Selected color for [borderSubtle03]. + */ + public abstract val borderSubtleSelected03: Color + + /** + * Operable tile indicator paired with [layer01]. + */ + public abstract val borderTile01: Color + + /** + * Operable tile indicator paired with [layer02]. + */ + public abstract val borderTile02: Color + + /** + * Operable tile indicator paired with [layer03]. + */ + public abstract val borderTile03: Color + + /** + * Active color for [dangerPrimary]. + * Active color for [dangerSecondary]. + */ + public abstract val buttonDangerActive: Color + + /** + * Hover color for [dangerPrimary]. + * Hover color for [dangerSecondary]. + */ + public abstract val buttonDangerHover: Color + + /** + * Primary danger button color. + * 3:1 AA non-text contrast. + */ + public abstract val buttonDangerPrimary: Color + + /** + * Tertiary danger button color. + * Ghost danger button color. + * 4.5:1 AA text contrast. + */ + public abstract val buttonDangerSecondary: Color + + /** + * Disabled color for button elements. + */ + public abstract val buttonDisabled: Color + + /** + * Primary button color. + */ + public abstract val buttonPrimary: Color + + /** + * Active color for [buttonPrimary]. + */ + public abstract val buttonPrimaryActive: Color + + /** + * Hover color for [buttonPrimary]. + */ + public abstract val buttonPrimaryHover: Color + + /** + * Secondary button color. + */ + public abstract val buttonSecondary: Color + + /** + * Active color for [buttonSecondary]. + */ + public abstract val buttonSecondaryActive: Color + + /** + * Hover color for [buttonSecondary]. + */ + public abstract val buttonSecondaryHover: Color + + /** + * Fluid button separator. + * 3:1 AA non-text contrast. + */ + public abstract val buttonSeparator: Color + + /** + * Tertiary button color. + * 4.5:1 AA text contrast. + */ + public abstract val buttonTertiary: Color + + /** + * Active color for [buttonTertiary]. + */ + public abstract val buttonTertiaryActive: Color + + /** + * Hover color for [buttonTertiary]. + */ + public abstract val buttonTertiaryHover: Color + + /** + * Default input fields. + * Fields on [background]. + */ + public abstract val field01: Color + + /** + * Secondary input fields. + * Fields on [layer01]. + */ + public abstract val field02: Color + + /** + * Tertiary input fields. + * Fields on [layer02]. + */ + public abstract val field03: Color + + /** + * Hover color for [field01]. + */ + public abstract val fieldHover01: Color + + /** + * Hover color for [field02]. + */ + public abstract val fieldHover02: Color + + /** + * Hover color for [field03]. + */ + public abstract val fieldHover03: Color + + /** + * Focus border. + * Focus underline. + */ + public abstract val focus: Color + + /** + * Contrast border paired with [focus]. + */ + public abstract val focusInset: Color + + /** + * Focus on high contrast moments. + */ + public abstract val focusInverse: Color + + /** + * Disabled icon color. + */ + public abstract val iconDisabled: Color + + /** + * Icons that indicate operability. + */ + public abstract val iconInteractive: Color + + /** + * Inverse icon color. + */ + public abstract val iconInverse: Color + + /** + * Icons on interactive colors. + * Icons on non-layer colors. + */ + public abstract val iconOnColor: Color + + /** + * Disabled color for [iconOnColor]. + */ + public abstract val iconOnColorDisabled: Color + + /** + * Primary icons. + */ + public abstract val iconPrimary: Color + + /** + * Secondary icons. + */ + public abstract val iconSecondary: Color + + /** + * Tertiary background paired with [layer01]. + */ + public abstract val layerAccent01: Color + + /** + * Tertiary background paired with [layer02]. + */ + public abstract val layerAccent02: Color + + /** + * Tertiary background paired with [layer03]. + */ + public abstract val layerAccent03: Color + + /** + * Active color for [layerAccent01]. + */ + public abstract val layerAccentActive01: Color + + /** + * Active color for [layerAccent02]. + */ + public abstract val layerAccentActive02: Color + + /** + * Active color for [layerAccent03]. + */ + public abstract val layerAccentActive03: Color + + /** + * Hover color for [layerAccent01]. + */ + public abstract val layerAccentHover01: Color + + /** + * Hover color for [layerAccent02]. + */ + public abstract val layerAccentHover02: Color + + /** + * Hover color for [layerAccent03]. + */ + public abstract val layerAccentHover03: Color + + /** + * Container color on [background]. + * Secondary page background. + */ + public abstract val layer01: Color + + /** + * Container color on [layer01]. + */ + public abstract val layer02: Color + + /** + * Container color on [layer02]. + */ + public abstract val layer03: Color + + /** + * Active color for [layer01]. + */ + public abstract val layerActive01: Color + + /** + * Active color for [layer02]. + */ + public abstract val layerActive02: Color + + /** + * Active color for [layer03]. + */ + public abstract val layerActive03: Color + + /** + * Hover color for [layer01]. + */ + public abstract val layerHover01: Color + + /** + * Hover color for [layer02]. + */ + public abstract val layerHover02: Color + + /** + * Hover color for [layer03]. + */ + public abstract val layerHover03: Color + + /** + * Selected color for [layer01]. + */ + public abstract val layerSelected01: Color + + /** + * Selected color for [layer02]. + */ + public abstract val layerSelected02: Color + + /** + * Selected color for [layer03]. + */ + public abstract val layerSelected03: Color + + /** + * Disabled color for selected layers. + */ + public abstract val layerSelectedDisabled: Color + + /** + * Hover color for [layerSelected01]. + */ + public abstract val layerSelectedHover01: Color + + /** + * Hover color for [layerSelected02]. + */ + public abstract val layerSelectedHover02: Color + + /** + * Hover color for [layerSelected03]. + */ + public abstract val layerSelectedHover03: Color + + /** + * High contrast elements. + * 4.5:1 AA element contrast. + */ + public abstract val layerSelectedInverse: Color + + /** + * Links on [backgroundInverse] backgrounds. + */ + public abstract val linkInverse: Color + + /** + * Active color for links on [backgroundInverse] backgrounds. + */ + public abstract val linkInverseActive: Color + + /** + * Hover color for links on [backgroundInverse] backgrounds. + */ + public abstract val linkInverseHover: Color + + /** + * Color for visited links on [backgroundInverse] backgrounds. + */ + public abstract val linkInverseVisited: Color + + /** + * Primary links. + */ + public abstract val linkPrimary: Color + + /** + * Hover color for [linkPrimary]. + */ + public abstract val linkPrimaryHover: Color + + /** + * Secondary link color for lower contrast backgrounds. + */ + public abstract val linkSecondary: Color + + /** + * Color for visited links. + */ + public abstract val linkVisited: Color + + /** + * Highlight color. + */ + public abstract val highlight: Color + + /** + * 3:1 AA contrast. + * Selected elements. + * Active elements. + * Accent icons. + */ + public abstract val interactive: Color + + /** + * Background overlay. + */ + public abstract val overlay: Color + + /** + * Skeleton color for containers. + */ + public abstract val skeletonBackground: Color + + /** + * Skeleton color for text and UI elements. + */ + public abstract val skeletonElement: Color + + /** + * Off background. + * 3:1 AA contrast. + */ + public abstract val toggleOff: Color + + /** + * Major caution status. + */ + public abstract val supportCautionMajor: Color + + /** + * Minor caution status. + */ + public abstract val supportCautionMinor: Color + + /** + * Undefined status. + */ + public abstract val supportCautionUndefined: Color + + /** + * Error. + * Invalid state. + */ + public abstract val supportError: Color + + /** + * Error in high contrast moments. + */ + public abstract val supportErrorInverse: Color + + /** + * Information. + */ + public abstract val supportInfo: Color + + /** + * Information in high contrast moments. + */ + public abstract val supportInfoInverse: Color + + /** + * Success. + * On. + */ + public abstract val supportSuccess: Color + + /** + * Success in high contrast moments. + */ + public abstract val supportSuccessInverse: Color + + /** + * Warning. + */ + public abstract val supportWarning: Color + + /** + * Warning in high contrast moments. + */ + public abstract val supportWarningInverse: Color + + /** + * Disabled text color. + */ + public abstract val textDisabled: Color + + /** + * Error message text. + */ + public abstract val textError: Color + + /** + * Tertiary text. + * Help text. + */ + public abstract val textHelper: Color + + /** + * Inverse text color. + */ + public abstract val textInverse: Color + + /** + * Text on interactive colors. + * Text on button colors. + */ + public abstract val textOnColor: Color + + /** + * Disabled color for [textOnColor]. + */ + public abstract val textOnColorDisabled: Color + + /** + * Placeholder text. + */ + public abstract val textPlaceholder: Color + + /** + * Primary text. + * Body copy. + * Headers. + * Hover text color for [textSecondary]. + */ + public abstract val textPrimary: Color + + /** + * Secondary text. + * Input labels. + */ + public abstract val textSecondary: Color + + /** + * Color tokens for the Ai component. + */ + public abstract val aiColors: AiColors + + /** + * Color tokens for the Tag component. + */ + public abstract val tagColors: TagColors + + /** + * Color tokens for the Chat component. + */ + public abstract val chatColors: ChatColors + + /** + * Color tokens for the Notification component. + */ + public abstract val notificationColors: NotificationColors + + /** + * Returns the container color based on a provided [layer]. + * + * @param layer Associated layer. Defaults to layer 00. + */ + public fun containerColor(layer: Layer = Layer.Layer00): Color = when (layer) { + Layer.Layer00 -> background + Layer.Layer01 -> layer01 + Layer.Layer02 -> layer02 + Layer.Layer03 -> layer03 + } + + @Suppress("LongMethod") + internal fun copy( + background: Color = this.background, + backgroundActive: Color = this.backgroundActive, + backgroundBrand: Color = this.backgroundBrand, + backgroundHover: Color = this.backgroundHover, + backgroundInverse: Color = this.backgroundInverse, + backgroundInverseHover: Color = this.backgroundInverseHover, + backgroundSelected: Color = this.backgroundSelected, + backgroundSelectedHover: Color = this.backgroundSelectedHover, + borderDisabled: Color = this.borderDisabled, + borderInteractive: Color = this.borderInteractive, + borderInverse: Color = this.borderInverse, + borderStrong01: Color = this.borderStrong01, + borderStrong02: Color = this.borderStrong02, + borderStrong03: Color = this.borderStrong03, + borderSubtle00: Color = this.borderSubtle00, + borderSubtle01: Color = this.borderSubtle01, + borderSubtle02: Color = this.borderSubtle02, + borderSubtle03: Color = this.borderSubtle03, + borderSubtleSelected01: Color = this.borderSubtleSelected01, + borderSubtleSelected02: Color = this.borderSubtleSelected02, + borderSubtleSelected03: Color = this.borderSubtleSelected03, + borderTile01: Color = this.borderTile01, + borderTile02: Color = this.borderTile02, + borderTile03: Color = this.borderTile03, + buttonDangerActive: Color = this.buttonDangerActive, + buttonDangerHover: Color = this.buttonDangerHover, + buttonDangerPrimary: Color = this.buttonDangerPrimary, + buttonDangerSecondary: Color = this.buttonDangerSecondary, + buttonDisabled: Color = this.buttonDisabled, + buttonPrimary: Color = this.buttonPrimary, + buttonPrimaryActive: Color = this.buttonPrimaryActive, + buttonPrimaryHover: Color = this.buttonPrimaryHover, + buttonSecondary: Color = this.buttonSecondary, + buttonSecondaryActive: Color = this.buttonSecondaryActive, + buttonSecondaryHover: Color = this.buttonSecondaryHover, + buttonSeparator: Color = this.buttonSeparator, + buttonTertiary: Color = this.buttonTertiary, + buttonTertiaryActive: Color = this.buttonTertiaryActive, + buttonTertiaryHover: Color = this.buttonTertiaryHover, + field01: Color = this.field01, + field02: Color = this.field02, + field03: Color = this.field03, + fieldHover01: Color = this.fieldHover01, + fieldHover02: Color = this.fieldHover02, + fieldHover03: Color = this.fieldHover03, + focus: Color = this.focus, + focusInset: Color = this.focusInset, + focusInverse: Color = this.focusInverse, + iconDisabled: Color = this.iconDisabled, + iconInteractive: Color = this.iconInteractive, + iconInverse: Color = this.iconInverse, + iconOnColor: Color = this.iconOnColor, + iconOnColorDisabled: Color = this.iconOnColorDisabled, + iconPrimary: Color = this.iconPrimary, + iconSecondary: Color = this.iconSecondary, + layerAccent01: Color = this.layerAccent01, + layerAccent02: Color = this.layerAccent02, + layerAccent03: Color = this.layerAccent03, + layerAccentActive01: Color = this.layerAccentActive01, + layerAccentActive02: Color = this.layerAccentActive02, + layerAccentActive03: Color = this.layerAccentActive03, + layerAccentHover01: Color = this.layerAccentHover01, + layerAccentHover02: Color = this.layerAccentHover02, + layerAccentHover03: Color = this.layerAccentHover03, + layer01: Color = this.layer01, + layer02: Color = this.layer02, + layer03: Color = this.layer03, + layerActive01: Color = this.layerActive01, + layerActive02: Color = this.layerActive02, + layerActive03: Color = this.layerActive03, + layerHover01: Color = this.layerHover01, + layerHover02: Color = this.layerHover02, + layerHover03: Color = this.layerHover03, + layerSelected01: Color = this.layerSelected01, + layerSelected02: Color = this.layerSelected02, + layerSelected03: Color = this.layerSelected03, + layerSelectedDisabled: Color = this.layerSelectedDisabled, + layerSelectedHover01: Color = this.layerSelectedHover01, + layerSelectedHover02: Color = this.layerSelectedHover02, + layerSelectedHover03: Color = this.layerSelectedHover03, + layerSelectedInverse: Color = this.layerSelectedInverse, + linkInverse: Color = this.linkInverse, + linkInverseActive: Color = this.linkInverseActive, + linkInverseHover: Color = this.linkInverseHover, + linkInverseVisited: Color = this.linkInverseVisited, + linkPrimary: Color = this.linkPrimary, + linkPrimaryHover: Color = this.linkPrimaryHover, + linkSecondary: Color = this.linkSecondary, + linkVisited: Color = this.linkVisited, + highlight: Color = this.highlight, + interactive: Color = this.interactive, + overlay: Color = this.overlay, + skeletonBackground: Color = this.skeletonBackground, + skeletonElement: Color = this.skeletonElement, + toggleOff: Color = this.toggleOff, + supportCautionMajor: Color = this.supportCautionMajor, + supportCautionMinor: Color = this.supportCautionMinor, + supportCautionUndefined: Color = this.supportCautionUndefined, + supportError: Color = this.supportError, + supportErrorInverse: Color = this.supportErrorInverse, + supportInfo: Color = this.supportInfo, + supportInfoInverse: Color = this.supportInfoInverse, + supportSuccess: Color = this.supportSuccess, + supportSuccessInverse: Color = this.supportSuccessInverse, + supportWarning: Color = this.supportWarning, + supportWarningInverse: Color = this.supportWarningInverse, + textDisabled: Color = this.textDisabled, + textError: Color = this.textError, + textHelper: Color = this.textHelper, + textInverse: Color = this.textInverse, + textOnColor: Color = this.textOnColor, + textOnColorDisabled: Color = this.textOnColorDisabled, + textPlaceholder: Color = this.textPlaceholder, + textPrimary: Color = this.textPrimary, + textSecondary: Color = this.textSecondary, + aiColors: AiColors = this.aiColors, + tagColors: TagColors = this.tagColors, + chatColors: ChatColors = this.chatColors, + notificationColors: NotificationColors = this.notificationColors, + ): Theme = object : Theme() { + override val background: Color = background + + override val backgroundActive: Color = backgroundActive + + override val backgroundBrand: Color = backgroundBrand + + override val backgroundHover: Color = backgroundHover + + override val backgroundInverse: Color = backgroundInverse + + override val backgroundInverseHover: Color = backgroundInverseHover + + override val backgroundSelected: Color = backgroundSelected + + override val backgroundSelectedHover: Color = backgroundSelectedHover + + override val borderDisabled: Color = borderDisabled + + override val borderInteractive: Color = borderInteractive + + override val borderInverse: Color = borderInverse + + override val borderStrong01: Color = borderStrong01 + + override val borderStrong02: Color = borderStrong02 + + override val borderStrong03: Color = borderStrong03 + + override val borderSubtle00: Color = borderSubtle00 + + override val borderSubtle01: Color = borderSubtle01 + + override val borderSubtle02: Color = borderSubtle02 + + override val borderSubtle03: Color = borderSubtle03 + + override val borderSubtleSelected01: Color = borderSubtleSelected01 + + override val borderSubtleSelected02: Color = borderSubtleSelected02 + + override val borderSubtleSelected03: Color = borderSubtleSelected03 + + override val borderTile01: Color = borderTile01 + + override val borderTile02: Color = borderTile02 + + override val borderTile03: Color = borderTile03 + + override val buttonDangerActive: Color = buttonDangerActive + + override val buttonDangerHover: Color = buttonDangerHover + + override val buttonDangerPrimary: Color = buttonDangerPrimary + + override val buttonDangerSecondary: Color = buttonDangerSecondary + + override val buttonDisabled: Color = buttonDisabled + + override val buttonPrimary: Color = buttonPrimary + + override val buttonPrimaryActive: Color = buttonPrimaryActive + + override val buttonPrimaryHover: Color = buttonPrimaryHover + + override val buttonSecondary: Color = buttonSecondary + + override val buttonSecondaryActive: Color = buttonSecondaryActive + + override val buttonSecondaryHover: Color = buttonSecondaryHover + + override val buttonSeparator: Color = buttonSeparator + + override val buttonTertiary: Color = buttonTertiary + + override val buttonTertiaryActive: Color = buttonTertiaryActive + + override val buttonTertiaryHover: Color = buttonTertiaryHover + + override val field01: Color = field01 + + override val field02: Color = field02 + + override val field03: Color = field03 + + override val fieldHover01: Color = fieldHover01 + + override val fieldHover02: Color = fieldHover02 + + override val fieldHover03: Color = fieldHover03 + + override val focus: Color = focus + + override val focusInset: Color = focusInset + + override val focusInverse: Color = focusInverse + + override val iconDisabled: Color = iconDisabled + + override val iconInteractive: Color = iconInteractive + + override val iconInverse: Color = iconInverse + + override val iconOnColor: Color = iconOnColor + + override val iconOnColorDisabled: Color = iconOnColorDisabled + + override val iconPrimary: Color = iconPrimary + + override val iconSecondary: Color = iconSecondary + + override val layerAccent01: Color = layerAccent01 + + override val layerAccent02: Color = layerAccent02 + + override val layerAccent03: Color = layerAccent03 + + override val layerAccentActive01: Color = layerAccentActive01 + + override val layerAccentActive02: Color = layerAccentActive02 + + override val layerAccentActive03: Color = layerAccentActive03 + + override val layerAccentHover01: Color = layerAccentHover01 + + override val layerAccentHover02: Color = layerAccentHover02 + + override val layerAccentHover03: Color = layerAccentHover03 + + override val layer01: Color = layer01 + + override val layer02: Color = layer02 + + override val layer03: Color = layer03 + + override val layerActive01: Color = layerActive01 + + override val layerActive02: Color = layerActive02 + + override val layerActive03: Color = layerActive03 + + override val layerHover01: Color = layerHover01 + + override val layerHover02: Color = layerHover02 + + override val layerHover03: Color = layerHover03 + + override val layerSelected01: Color = layerSelected01 + + override val layerSelected02: Color = layerSelected02 + + override val layerSelected03: Color = layerSelected03 + + override val layerSelectedDisabled: Color = layerSelectedDisabled + + override val layerSelectedHover01: Color = layerSelectedHover01 + + override val layerSelectedHover02: Color = layerSelectedHover02 + + override val layerSelectedHover03: Color = layerSelectedHover03 + + override val layerSelectedInverse: Color = layerSelectedInverse + + override val linkInverse: Color = linkInverse + + override val linkInverseActive: Color = linkInverseActive + + override val linkInverseHover: Color = linkInverseHover + + override val linkInverseVisited: Color = linkInverseVisited + + override val linkPrimary: Color = linkPrimary + + override val linkPrimaryHover: Color = linkPrimaryHover + + override val linkSecondary: Color = linkSecondary + + override val linkVisited: Color = linkVisited + + override val highlight: Color = highlight + + override val interactive: Color = interactive + + override val overlay: Color = overlay + + override val skeletonBackground: Color = skeletonBackground + + override val skeletonElement: Color = skeletonElement + + override val toggleOff: Color = toggleOff + + override val supportCautionMajor: Color = supportCautionMajor + + override val supportCautionMinor: Color = supportCautionMinor + + override val supportCautionUndefined: Color = supportCautionUndefined + + override val supportError: Color = supportError + + override val supportErrorInverse: Color = supportErrorInverse + + override val supportInfo: Color = supportInfo + + override val supportInfoInverse: Color = supportInfoInverse + + override val supportSuccess: Color = supportSuccess + + override val supportSuccessInverse: Color = supportSuccessInverse + + override val supportWarning: Color = supportWarning + + override val supportWarningInverse: Color = supportWarningInverse + + override val textDisabled: Color = textDisabled + + override val textError: Color = textError + + override val textHelper: Color = textHelper + + override val textInverse: Color = textInverse + + override val textOnColor: Color = textOnColor + + override val textOnColorDisabled: Color = textOnColorDisabled + + override val textPlaceholder: Color = textPlaceholder + + override val textPrimary: Color = textPrimary + + override val textSecondary: Color = textSecondary + + override val aiColors: AiColors = aiColors + + override val tagColors: TagColors = tagColors + + override val chatColors: ChatColors = chatColors + + override val notificationColors: NotificationColors = notificationColors + } + + @Suppress( + "CognitiveComplexMethod", + "CyclomaticComplexMethod", + "LongMethod", + ) + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (other !is Theme) return false + if (background != other.background) return false + if (backgroundActive != other.backgroundActive) return false + if (backgroundBrand != other.backgroundBrand) return false + if (backgroundHover != other.backgroundHover) return false + if (backgroundInverse != other.backgroundInverse) return false + if (backgroundInverseHover != other.backgroundInverseHover) return false + if (backgroundSelected != other.backgroundSelected) return false + if (backgroundSelectedHover != other.backgroundSelectedHover) return false + if (borderDisabled != other.borderDisabled) return false + if (borderInteractive != other.borderInteractive) return false + if (borderInverse != other.borderInverse) return false + if (borderStrong01 != other.borderStrong01) return false + if (borderStrong02 != other.borderStrong02) return false + if (borderStrong03 != other.borderStrong03) return false + if (borderSubtle00 != other.borderSubtle00) return false + if (borderSubtle01 != other.borderSubtle01) return false + if (borderSubtle02 != other.borderSubtle02) return false + if (borderSubtle03 != other.borderSubtle03) return false + if (borderSubtleSelected01 != other.borderSubtleSelected01) return false + if (borderSubtleSelected02 != other.borderSubtleSelected02) return false + if (borderSubtleSelected03 != other.borderSubtleSelected03) return false + if (borderTile01 != other.borderTile01) return false + if (borderTile02 != other.borderTile02) return false + if (borderTile03 != other.borderTile03) return false + if (buttonDangerActive != other.buttonDangerActive) return false + if (buttonDangerHover != other.buttonDangerHover) return false + if (buttonDangerPrimary != other.buttonDangerPrimary) return false + if (buttonDangerSecondary != other.buttonDangerSecondary) return false + if (buttonDisabled != other.buttonDisabled) return false + if (buttonPrimary != other.buttonPrimary) return false + if (buttonPrimaryActive != other.buttonPrimaryActive) return false + if (buttonPrimaryHover != other.buttonPrimaryHover) return false + if (buttonSecondary != other.buttonSecondary) return false + if (buttonSecondaryActive != other.buttonSecondaryActive) return false + if (buttonSecondaryHover != other.buttonSecondaryHover) return false + if (buttonSeparator != other.buttonSeparator) return false + if (buttonTertiary != other.buttonTertiary) return false + if (buttonTertiaryActive != other.buttonTertiaryActive) return false + if (buttonTertiaryHover != other.buttonTertiaryHover) return false + if (field01 != other.field01) return false + if (field02 != other.field02) return false + if (field03 != other.field03) return false + if (fieldHover01 != other.fieldHover01) return false + if (fieldHover02 != other.fieldHover02) return false + if (fieldHover03 != other.fieldHover03) return false + if (focus != other.focus) return false + if (focusInset != other.focusInset) return false + if (focusInverse != other.focusInverse) return false + if (iconDisabled != other.iconDisabled) return false + if (iconInteractive != other.iconInteractive) return false + if (iconInverse != other.iconInverse) return false + if (iconOnColor != other.iconOnColor) return false + if (iconOnColorDisabled != other.iconOnColorDisabled) return false + if (iconPrimary != other.iconPrimary) return false + if (iconSecondary != other.iconSecondary) return false + if (layerAccent01 != other.layerAccent01) return false + if (layerAccent02 != other.layerAccent02) return false + if (layerAccent03 != other.layerAccent03) return false + if (layerAccentActive01 != other.layerAccentActive01) return false + if (layerAccentActive02 != other.layerAccentActive02) return false + if (layerAccentActive03 != other.layerAccentActive03) return false + if (layerAccentHover01 != other.layerAccentHover01) return false + if (layerAccentHover02 != other.layerAccentHover02) return false + if (layerAccentHover03 != other.layerAccentHover03) return false + if (layer01 != other.layer01) return false + if (layer02 != other.layer02) return false + if (layer03 != other.layer03) return false + if (layerActive01 != other.layerActive01) return false + if (layerActive02 != other.layerActive02) return false + if (layerActive03 != other.layerActive03) return false + if (layerHover01 != other.layerHover01) return false + if (layerHover02 != other.layerHover02) return false + if (layerHover03 != other.layerHover03) return false + if (layerSelected01 != other.layerSelected01) return false + if (layerSelected02 != other.layerSelected02) return false + if (layerSelected03 != other.layerSelected03) return false + if (layerSelectedDisabled != other.layerSelectedDisabled) return false + if (layerSelectedHover01 != other.layerSelectedHover01) return false + if (layerSelectedHover02 != other.layerSelectedHover02) return false + if (layerSelectedHover03 != other.layerSelectedHover03) return false + if (layerSelectedInverse != other.layerSelectedInverse) return false + if (linkInverse != other.linkInverse) return false + if (linkInverseActive != other.linkInverseActive) return false + if (linkInverseHover != other.linkInverseHover) return false + if (linkInverseVisited != other.linkInverseVisited) return false + if (linkPrimary != other.linkPrimary) return false + if (linkPrimaryHover != other.linkPrimaryHover) return false + if (linkSecondary != other.linkSecondary) return false + if (linkVisited != other.linkVisited) return false + if (highlight != other.highlight) return false + if (interactive != other.interactive) return false + if (overlay != other.overlay) return false + if (skeletonBackground != other.skeletonBackground) return false + if (skeletonElement != other.skeletonElement) return false + if (toggleOff != other.toggleOff) return false + if (supportCautionMajor != other.supportCautionMajor) return false + if (supportCautionMinor != other.supportCautionMinor) return false + if (supportCautionUndefined != other.supportCautionUndefined) return false + if (supportError != other.supportError) return false + if (supportErrorInverse != other.supportErrorInverse) return false + if (supportInfo != other.supportInfo) return false + if (supportInfoInverse != other.supportInfoInverse) return false + if (supportSuccess != other.supportSuccess) return false + if (supportSuccessInverse != other.supportSuccessInverse) return false + if (supportWarning != other.supportWarning) return false + if (supportWarningInverse != other.supportWarningInverse) return false + if (textDisabled != other.textDisabled) return false + if (textError != other.textError) return false + if (textHelper != other.textHelper) return false + if (textInverse != other.textInverse) return false + if (textOnColor != other.textOnColor) return false + if (textOnColorDisabled != other.textOnColorDisabled) return false + if (textPlaceholder != other.textPlaceholder) return false + if (textPrimary != other.textPrimary) return false + if (textSecondary != other.textSecondary) return false + if (aiColors != other.aiColors) return false + if (tagColors != other.tagColors) return false + if (chatColors != other.chatColors) return false + if (notificationColors != other.notificationColors) return false + return true + } + + @Suppress("LongMethod") + override fun hashCode(): Int { + var result = background.hashCode() + result = 31 * result + backgroundActive.hashCode() + result = 31 * result + backgroundBrand.hashCode() + result = 31 * result + backgroundHover.hashCode() + result = 31 * result + backgroundInverse.hashCode() + result = 31 * result + backgroundInverseHover.hashCode() + result = 31 * result + backgroundSelected.hashCode() + result = 31 * result + backgroundSelectedHover.hashCode() + result = 31 * result + borderDisabled.hashCode() + result = 31 * result + borderInteractive.hashCode() + result = 31 * result + borderInverse.hashCode() + result = 31 * result + borderStrong01.hashCode() + result = 31 * result + borderStrong02.hashCode() + result = 31 * result + borderStrong03.hashCode() + result = 31 * result + borderSubtle00.hashCode() + result = 31 * result + borderSubtle01.hashCode() + result = 31 * result + borderSubtle02.hashCode() + result = 31 * result + borderSubtle03.hashCode() + result = 31 * result + borderSubtleSelected01.hashCode() + result = 31 * result + borderSubtleSelected02.hashCode() + result = 31 * result + borderSubtleSelected03.hashCode() + result = 31 * result + borderTile01.hashCode() + result = 31 * result + borderTile02.hashCode() + result = 31 * result + borderTile03.hashCode() + result = 31 * result + buttonDangerActive.hashCode() + result = 31 * result + buttonDangerHover.hashCode() + result = 31 * result + buttonDangerPrimary.hashCode() + result = 31 * result + buttonDangerSecondary.hashCode() + result = 31 * result + buttonDisabled.hashCode() + result = 31 * result + buttonPrimary.hashCode() + result = 31 * result + buttonPrimaryActive.hashCode() + result = 31 * result + buttonPrimaryHover.hashCode() + result = 31 * result + buttonSecondary.hashCode() + result = 31 * result + buttonSecondaryActive.hashCode() + result = 31 * result + buttonSecondaryHover.hashCode() + result = 31 * result + buttonSeparator.hashCode() + result = 31 * result + buttonTertiary.hashCode() + result = 31 * result + buttonTertiaryActive.hashCode() + result = 31 * result + buttonTertiaryHover.hashCode() + result = 31 * result + field01.hashCode() + result = 31 * result + field02.hashCode() + result = 31 * result + field03.hashCode() + result = 31 * result + fieldHover01.hashCode() + result = 31 * result + fieldHover02.hashCode() + result = 31 * result + fieldHover03.hashCode() + result = 31 * result + focus.hashCode() + result = 31 * result + focusInset.hashCode() + result = 31 * result + focusInverse.hashCode() + result = 31 * result + iconDisabled.hashCode() + result = 31 * result + iconInteractive.hashCode() + result = 31 * result + iconInverse.hashCode() + result = 31 * result + iconOnColor.hashCode() + result = 31 * result + iconOnColorDisabled.hashCode() + result = 31 * result + iconPrimary.hashCode() + result = 31 * result + iconSecondary.hashCode() + result = 31 * result + layerAccent01.hashCode() + result = 31 * result + layerAccent02.hashCode() + result = 31 * result + layerAccent03.hashCode() + result = 31 * result + layerAccentActive01.hashCode() + result = 31 * result + layerAccentActive02.hashCode() + result = 31 * result + layerAccentActive03.hashCode() + result = 31 * result + layerAccentHover01.hashCode() + result = 31 * result + layerAccentHover02.hashCode() + result = 31 * result + layerAccentHover03.hashCode() + result = 31 * result + layer01.hashCode() + result = 31 * result + layer02.hashCode() + result = 31 * result + layer03.hashCode() + result = 31 * result + layerActive01.hashCode() + result = 31 * result + layerActive02.hashCode() + result = 31 * result + layerActive03.hashCode() + result = 31 * result + layerHover01.hashCode() + result = 31 * result + layerHover02.hashCode() + result = 31 * result + layerHover03.hashCode() + result = 31 * result + layerSelected01.hashCode() + result = 31 * result + layerSelected02.hashCode() + result = 31 * result + layerSelected03.hashCode() + result = 31 * result + layerSelectedDisabled.hashCode() + result = 31 * result + layerSelectedHover01.hashCode() + result = 31 * result + layerSelectedHover02.hashCode() + result = 31 * result + layerSelectedHover03.hashCode() + result = 31 * result + layerSelectedInverse.hashCode() + result = 31 * result + linkInverse.hashCode() + result = 31 * result + linkInverseActive.hashCode() + result = 31 * result + linkInverseHover.hashCode() + result = 31 * result + linkInverseVisited.hashCode() + result = 31 * result + linkPrimary.hashCode() + result = 31 * result + linkPrimaryHover.hashCode() + result = 31 * result + linkSecondary.hashCode() + result = 31 * result + linkVisited.hashCode() + result = 31 * result + highlight.hashCode() + result = 31 * result + interactive.hashCode() + result = 31 * result + overlay.hashCode() + result = 31 * result + skeletonBackground.hashCode() + result = 31 * result + skeletonElement.hashCode() + result = 31 * result + toggleOff.hashCode() + result = 31 * result + supportCautionMajor.hashCode() + result = 31 * result + supportCautionMinor.hashCode() + result = 31 * result + supportCautionUndefined.hashCode() + result = 31 * result + supportError.hashCode() + result = 31 * result + supportErrorInverse.hashCode() + result = 31 * result + supportInfo.hashCode() + result = 31 * result + supportInfoInverse.hashCode() + result = 31 * result + supportSuccess.hashCode() + result = 31 * result + supportSuccessInverse.hashCode() + result = 31 * result + supportWarning.hashCode() + result = 31 * result + supportWarningInverse.hashCode() + result = 31 * result + textDisabled.hashCode() + result = 31 * result + textError.hashCode() + result = 31 * result + textHelper.hashCode() + result = 31 * result + textInverse.hashCode() + result = 31 * result + textOnColor.hashCode() + result = 31 * result + textOnColorDisabled.hashCode() + result = 31 * result + textPlaceholder.hashCode() + result = 31 * result + textPrimary.hashCode() + result = 31 * result + textSecondary.hashCode() + result = 31 * result + aiColors.hashCode() + result = 31 * result + tagColors.hashCode() + result = 31 * result + chatColors.hashCode() + result = 31 * result + notificationColors.hashCode() + return result + } } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/WhiteTheme.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/WhiteTheme.kt index 6e6d97f2..283b83b5 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/WhiteTheme.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/WhiteTheme.kt @@ -24,241 +24,241 @@ import com.gabrieldrn.carbon.foundation.color.tag.WhiteTagColors */ @Immutable public object WhiteTheme : Theme() { - override val background: Color = Color(0xFFFFFFFF) + override val background: Color = Color(0xFFFFFFFF) - override val backgroundActive: Color = Color(0x7F8D8D8D) + override val backgroundActive: Color = Color(0x808D8D8D) - override val backgroundBrand: Color = Color(0xFF0F62FE) + override val backgroundBrand: Color = Color(0xFF0F62FE) - override val backgroundHover: Color = Color(0x1E8D8D8D) + override val backgroundHover: Color = Color(0x1F8D8D8D) - override val backgroundInverse: Color = Color(0xFF393939) + override val backgroundInverse: Color = Color(0xFF393939) - override val backgroundInverseHover: Color = Color(0xFF4C4C4C) + override val backgroundInverseHover: Color = Color(0xFF4C4C4C) - override val backgroundSelected: Color = Color(0x338D8D8D) + override val backgroundSelected: Color = Color(0x338D8D8D) - override val backgroundSelectedHover: Color = Color(0x518D8D8D) + override val backgroundSelectedHover: Color = Color(0x528D8D8D) - override val borderDisabled: Color = Color(0xFFC6C6C6) + override val borderDisabled: Color = Color(0xFFC6C6C6) - override val borderInteractive: Color = Color(0xFF0F62FE) + override val borderInteractive: Color = Color(0xFF0F62FE) - override val borderInverse: Color = Color(0xFF161616) + override val borderInverse: Color = Color(0xFF161616) - override val borderStrong01: Color = Color(0xFF8D8D8D) + override val borderStrong01: Color = Color(0xFF8D8D8D) - override val borderStrong02: Color = Color(0xFF8D8D8D) + override val borderStrong02: Color = Color(0xFF8D8D8D) - override val borderStrong03: Color = Color(0xFF8D8D8D) + override val borderStrong03: Color = Color(0xFF8D8D8D) - override val borderSubtle00: Color = Color(0xFFE0E0E0) + override val borderSubtle00: Color = Color(0xFFE0E0E0) - override val borderSubtle01: Color = Color(0xFFC6C6C6) + override val borderSubtle01: Color = Color(0xFFC6C6C6) - override val borderSubtle02: Color = Color(0xFFE0E0E0) + override val borderSubtle02: Color = Color(0xFFE0E0E0) - override val borderSubtle03: Color = Color(0xFFC6C6C6) + override val borderSubtle03: Color = Color(0xFFC6C6C6) - override val borderSubtleSelected01: Color = Color(0xFFC6C6C6) + override val borderSubtleSelected01: Color = Color(0xFFC6C6C6) - override val borderSubtleSelected02: Color = Color(0xFFC6C6C6) + override val borderSubtleSelected02: Color = Color(0xFFC6C6C6) - override val borderSubtleSelected03: Color = Color(0xFFC6C6C6) + override val borderSubtleSelected03: Color = Color(0xFFC6C6C6) - override val borderTile01: Color = Color(0xFFC6C6C6) + override val borderTile01: Color = Color(0xFFC6C6C6) - override val borderTile02: Color = Color(0xFFA8A8A8) + override val borderTile02: Color = Color(0xFFA8A8A8) - override val borderTile03: Color = Color(0xFFC6C6C6) + override val borderTile03: Color = Color(0xFFC6C6C6) - override val buttonDangerActive: Color = Color(0xFF750E13) + override val buttonDangerActive: Color = Color(0xFF750E13) - override val buttonDangerHover: Color = Color(0xFFBA1B23) + override val buttonDangerHover: Color = Color(0xFFBA1B23) - override val buttonDangerPrimary: Color = Color(0xFFDA1E28) + override val buttonDangerPrimary: Color = Color(0xFFDA1E28) - override val buttonDangerSecondary: Color = Color(0xFFDA1E28) + override val buttonDangerSecondary: Color = Color(0xFFDA1E28) - override val buttonDisabled: Color = Color(0xFFC6C6C6) + override val buttonDisabled: Color = Color(0xFFC6C6C6) - override val buttonPrimary: Color = Color(0xFF0F62FE) + override val buttonPrimary: Color = Color(0xFF0F62FE) - override val buttonPrimaryActive: Color = Color(0xFF002D9C) + override val buttonPrimaryActive: Color = Color(0xFF002D9C) - override val buttonPrimaryHover: Color = Color(0xFF0353E9) + override val buttonPrimaryHover: Color = Color(0xFF0353E9) - override val buttonSecondary: Color = Color(0xFF393939) + override val buttonSecondary: Color = Color(0xFF393939) - override val buttonSecondaryActive: Color = Color(0xFF6F6F6F) + override val buttonSecondaryActive: Color = Color(0xFF6F6F6F) - override val buttonSecondaryHover: Color = Color(0xFF4C4C4C) + override val buttonSecondaryHover: Color = Color(0xFF4C4C4C) - override val buttonSeparator: Color = Color(0xFFE0E0E0) + override val buttonSeparator: Color = Color(0xFFE0E0E0) - override val buttonTertiary: Color = Color(0xFF0F62FE) + override val buttonTertiary: Color = Color(0xFF0F62FE) - override val buttonTertiaryActive: Color = Color(0xFF002D9C) + override val buttonTertiaryActive: Color = Color(0xFF002D9C) - override val buttonTertiaryHover: Color = Color(0xFF0353E9) + override val buttonTertiaryHover: Color = Color(0xFF0353E9) - override val field01: Color = Color(0xFFF4F4F4) + override val field01: Color = Color(0xFFF4F4F4) - override val field02: Color = Color(0xFFFFFFFF) + override val field02: Color = Color(0xFFFFFFFF) - override val field03: Color = Color(0xFFF4F4F4) + override val field03: Color = Color(0xFFF4F4F4) - override val fieldHover01: Color = Color(0xFFE8E8E8) + override val fieldHover01: Color = Color(0xFFE8E8E8) - override val fieldHover02: Color = Color(0xFFE8E8E8) + override val fieldHover02: Color = Color(0xFFE8E8E8) - override val fieldHover03: Color = Color(0xFFE8E8E8) + override val fieldHover03: Color = Color(0xFFE8E8E8) - override val focus: Color = Color(0xFF0F62FE) + override val focus: Color = Color(0xFF0F62FE) - override val focusInset: Color = Color(0xFFFFFFFF) + override val focusInset: Color = Color(0xFFFFFFFF) - override val focusInverse: Color = Color(0xFFFFFFFF) + override val focusInverse: Color = Color(0xFFFFFFFF) - override val iconDisabled: Color = Color(0xFF161616) + override val iconDisabled: Color = Color(0x40161616) - override val iconInteractive: Color = Color(0xFF0F62FE) + override val iconInteractive: Color = Color(0xFF0F62FE) - override val iconInverse: Color = Color(0xFFFFFFFF) + override val iconInverse: Color = Color(0xFFFFFFFF) - override val iconOnColor: Color = Color(0xFFFFFFFF) + override val iconOnColor: Color = Color(0xFFFFFFFF) - override val iconOnColorDisabled: Color = Color(0xFF8D8D8D) + override val iconOnColorDisabled: Color = Color(0xFF8D8D8D) - override val iconPrimary: Color = Color(0xFF161616) + override val iconPrimary: Color = Color(0xFF161616) - override val iconSecondary: Color = Color(0xFF525252) + override val iconSecondary: Color = Color(0xFF525252) - override val layerAccent01: Color = Color(0xFFE0E0E0) + override val layerAccent01: Color = Color(0xFFE0E0E0) - override val layerAccent02: Color = Color(0xFFE0E0E0) + override val layerAccent02: Color = Color(0xFFE0E0E0) - override val layerAccent03: Color = Color(0xFFE0E0E0) + override val layerAccent03: Color = Color(0xFFE0E0E0) - override val layerAccentActive01: Color = Color(0xFFA8A8A8) + override val layerAccentActive01: Color = Color(0xFFA8A8A8) - override val layerAccentActive02: Color = Color(0xFFA8A8A8) + override val layerAccentActive02: Color = Color(0xFFA8A8A8) - override val layerAccentActive03: Color = Color(0xFFA8A8A8) + override val layerAccentActive03: Color = Color(0xFFA8A8A8) - override val layerAccentHover01: Color = Color(0xFFCACACA) + override val layerAccentHover01: Color = Color(0xFFCACACA) - override val layerAccentHover02: Color = Color(0xFFCACACA) + override val layerAccentHover02: Color = Color(0xFFCACACA) - override val layerAccentHover03: Color = Color(0xFFCACACA) + override val layerAccentHover03: Color = Color(0xFFCACACA) - override val layer01: Color = Color(0xFFF4F4F4) + override val layer01: Color = Color(0xFFF4F4F4) - override val layer02: Color = Color(0xFFFFFFFF) + override val layer02: Color = Color(0xFFFFFFFF) - override val layer03: Color = Color(0xFFF4F4F4) + override val layer03: Color = Color(0xFFF4F4F4) - override val layerActive01: Color = Color(0xFFC6C6C6) + override val layerActive01: Color = Color(0xFFC6C6C6) - override val layerActive02: Color = Color(0xFFC6C6C6) + override val layerActive02: Color = Color(0xFFC6C6C6) - override val layerActive03: Color = Color(0xFFC6C6C6) + override val layerActive03: Color = Color(0xFFC6C6C6) - override val layerHover01: Color = Color(0xFFE8E8E8) + override val layerHover01: Color = Color(0xFFE8E8E8) - override val layerHover02: Color = Color(0xFFE8E8E8) + override val layerHover02: Color = Color(0xFFE8E8E8) - override val layerHover03: Color = Color(0xFFE8E8E8) + override val layerHover03: Color = Color(0xFFE8E8E8) - override val layerSelected01: Color = Color(0xFFE0E0E0) + override val layerSelected01: Color = Color(0xFFE0E0E0) - override val layerSelected02: Color = Color(0xFFE0E0E0) + override val layerSelected02: Color = Color(0xFFE0E0E0) - override val layerSelected03: Color = Color(0xFFE0E0E0) + override val layerSelected03: Color = Color(0xFFE0E0E0) - override val layerSelectedDisabled: Color = Color(0xFF8D8D8D) + override val layerSelectedDisabled: Color = Color(0xFF8D8D8D) - override val layerSelectedHover01: Color = Color(0xFFCACACA) + override val layerSelectedHover01: Color = Color(0xFFCACACA) - override val layerSelectedHover02: Color = Color(0xFFCACACA) + override val layerSelectedHover02: Color = Color(0xFFCACACA) - override val layerSelectedHover03: Color = Color(0xFFCACACA) + override val layerSelectedHover03: Color = Color(0xFFCACACA) - override val layerSelectedInverse: Color = Color(0xFF161616) + override val layerSelectedInverse: Color = Color(0xFF161616) - override val linkInverse: Color = Color(0xFF78A9FF) + override val linkInverse: Color = Color(0xFF78A9FF) - override val linkInverseActive: Color = Color(0xFFF4F4F4) + override val linkInverseActive: Color = Color(0xFFF4F4F4) - override val linkInverseHover: Color = Color(0xFFA6C8FF) + override val linkInverseHover: Color = Color(0xFFA6C8FF) - override val linkInverseVisited: Color = Color(0xFFBE95FF) + override val linkInverseVisited: Color = Color(0xFFBE95FF) - override val linkPrimary: Color = Color(0xFF0F62FE) + override val linkPrimary: Color = Color(0xFF0F62FE) - override val linkPrimaryHover: Color = Color(0xFF0043CE) + override val linkPrimaryHover: Color = Color(0xFF0043CE) - override val linkSecondary: Color = Color(0xFF0043CE) + override val linkSecondary: Color = Color(0xFF0043CE) - override val linkVisited: Color = Color(0xFF8A3FFC) + override val linkVisited: Color = Color(0xFF8A3FFC) - override val highlight: Color = Color(0xFFD0E2FF) + override val highlight: Color = Color(0xFFD0E2FF) - override val interactive: Color = Color(0xFF0F62FE) + override val interactive: Color = Color(0xFF0F62FE) - override val overlay: Color = Color(0x7F161616) + override val overlay: Color = Color(0x80161616) - override val skeletonBackground: Color = Color(0xFFE5E5E5) + override val skeletonBackground: Color = Color(0xFFE5E5E5) - override val skeletonElement: Color = Color(0xFFC6C6C6) + override val skeletonElement: Color = Color(0xFFC6C6C6) - override val toggleOff: Color = Color(0xFF8D8D8D) + override val toggleOff: Color = Color(0xFF8D8D8D) - override val supportCautionMajor: Color = Color(0xFFFF832B) + override val supportCautionMajor: Color = Color(0xFFFF832B) - override val supportCautionMinor: Color = Color(0xFFF1C21B) + override val supportCautionMinor: Color = Color(0xFFF1C21B) - override val supportCautionUndefined: Color = Color(0xFF8A3FFC) + override val supportCautionUndefined: Color = Color(0xFF8A3FFC) - override val supportError: Color = Color(0xFFDA1E28) + override val supportError: Color = Color(0xFFDA1E28) - override val supportErrorInverse: Color = Color(0xFFFA4D56) + override val supportErrorInverse: Color = Color(0xFFFA4D56) - override val supportInfo: Color = Color(0xFF0043CE) + override val supportInfo: Color = Color(0xFF0043CE) - override val supportInfoInverse: Color = Color(0xFF4589FF) + override val supportInfoInverse: Color = Color(0xFF4589FF) - override val supportSuccess: Color = Color(0xFF24A148) + override val supportSuccess: Color = Color(0xFF24A148) - override val supportSuccessInverse: Color = Color(0xFF42BE65) + override val supportSuccessInverse: Color = Color(0xFF42BE65) - override val supportWarning: Color = Color(0xFFF1C21B) + override val supportWarning: Color = Color(0xFFF1C21B) - override val supportWarningInverse: Color = Color(0xFFF1C21B) + override val supportWarningInverse: Color = Color(0xFFF1C21B) - override val textDisabled: Color = Color(0xFF161616) + override val textDisabled: Color = Color(0x40161616) - override val textError: Color = Color(0xFFDA1E28) + override val textError: Color = Color(0xFFDA1E28) - override val textHelper: Color = Color(0xFF6F6F6F) + override val textHelper: Color = Color(0xFF6F6F6F) - override val textInverse: Color = Color(0xFFFFFFFF) + override val textInverse: Color = Color(0xFFFFFFFF) - override val textOnColor: Color = Color(0xFFFFFFFF) + override val textOnColor: Color = Color(0xFFFFFFFF) - override val textOnColorDisabled: Color = Color(0xFF8D8D8D) + override val textOnColorDisabled: Color = Color(0xFF8D8D8D) - override val textPlaceholder: Color = Color(0xFFA8A8A8) + override val textPlaceholder: Color = Color(0xFFA8A8A8) - override val textPrimary: Color = Color(0xFF161616) + override val textPrimary: Color = Color(0xFF161616) - override val textSecondary: Color = Color(0xFF525252) + override val textSecondary: Color = Color(0xFF525252) - override val aiColors: AiColors = WhiteAiColors + override val aiColors: AiColors = WhiteAiColors - override val tagColors: TagColors = WhiteTagColors + override val tagColors: TagColors = WhiteTagColors - override val chatColors: ChatColors = WhiteChatColors + override val chatColors: ChatColors = WhiteChatColors - override val notificationColors: NotificationColors = WhiteNotificationColors + override val notificationColors: NotificationColors = WhiteNotificationColors } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/ai/AiColors.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/ai/AiColors.kt index ee0fd19e..3929d45d 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/ai/AiColors.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/ai/AiColors.kt @@ -11,90 +11,90 @@ import androidx.compose.ui.graphics.Color */ @Immutable public interface AiColors { - /** - * Linear gradient start value for all AI layers. - */ - public val auraEnd: Color - - /** - * Hover background color for AI layers. - */ - public val auraHoverBackground: Color - - /** - * Linear gradient end value for the AI aura hover. - */ - public val auraHoverEnd: Color - - /** - * Linear gradient start value for the AI aura hover. - */ - public val auraHoverStart: Color - - /** - * Linear gradient start value for large AI layers. - */ - public val auraStart: Color - - /** - * Linear gradient start value for small AI layers. - */ - public val auraStartSm: Color - - /** - * Linear gradient end value for AI borders. - */ - public val borderEnd: Color - - /** - * Linear gradient start value for AI borders. - */ - public val borderStart: Color - - /** - * Medium contrast border for AI elements. - * Border-bottom paired with AI fields. - * 3:1 AA non-text contrast. - */ - public val borderStrong: Color - - /** - * Drop shadow for the AI layer. - */ - public val dropShadow: Color - - /** - * Inner shadow for the AI layer. - */ - public val innerShadow: Color - - /** - * Background overlay for AI components. - */ - public val overlay: Color - - /** - * Background color for the AI explainability popover. - */ - public val popoverBackground: Color - - /** - * 1 of 2 shadow colors for the AI explainability popover. - */ - public val popoverShadowOuter01: Color - - /** - * 2 of 2 shadow colors for the AI explainability popover. - */ - public val popoverShadowOuter02: Color - - /** - * Skeleton color for AI containers. - */ - public val skeletonBackground: Color - - /** - * Skeleton color for AI text and UI elements. - */ - public val skeletonElement: Color + /** + * Linear gradient start value for all AI layers. + */ + public val auraEnd: Color + + /** + * Hover background color for AI layers. + */ + public val auraHoverBackground: Color + + /** + * Linear gradient end value for the AI aura hover. + */ + public val auraHoverEnd: Color + + /** + * Linear gradient start value for the AI aura hover. + */ + public val auraHoverStart: Color + + /** + * Linear gradient start value for large AI layers. + */ + public val auraStart: Color + + /** + * Linear gradient start value for small AI layers. + */ + public val auraStartSm: Color + + /** + * Linear gradient end value for AI borders. + */ + public val borderEnd: Color + + /** + * Linear gradient start value for AI borders. + */ + public val borderStart: Color + + /** + * Medium contrast border for AI elements. + * Border-bottom paired with AI fields. + * 3:1 AA non-text contrast. + */ + public val borderStrong: Color + + /** + * Drop shadow for the AI layer. + */ + public val dropShadow: Color + + /** + * Inner shadow for the AI layer. + */ + public val innerShadow: Color + + /** + * Background overlay for AI components. + */ + public val overlay: Color + + /** + * Background color for the AI explainability popover. + */ + public val popoverBackground: Color + + /** + * 1 of 2 shadow colors for the AI explainability popover. + */ + public val popoverShadowOuter01: Color + + /** + * 2 of 2 shadow colors for the AI explainability popover. + */ + public val popoverShadowOuter02: Color + + /** + * Skeleton color for AI containers. + */ + public val skeletonBackground: Color + + /** + * Skeleton color for AI text and UI elements. + */ + public val skeletonElement: Color } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/ai/Gray100AiColors.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/ai/Gray100AiColors.kt index 3cb47a07..d1341a4d 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/ai/Gray100AiColors.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/ai/Gray100AiColors.kt @@ -11,37 +11,37 @@ import androidx.compose.ui.graphics.Color */ @Immutable public object Gray100AiColors : AiColors { - override val auraEnd: Color = Color(0x00000000) + override val auraEnd: Color = Color(0x00000000) - override val auraHoverBackground: Color = Color(0xFFE8E8E8) + override val auraHoverBackground: Color = Color(0xFFE8E8E8) - override val auraHoverEnd: Color = Color(0x00000000) + override val auraHoverEnd: Color = Color(0x00000000) - override val auraHoverStart: Color = Color(0x664589FF) + override val auraHoverStart: Color = Color(0x664589FF) - override val auraStart: Color = Color(0x194589FF) + override val auraStart: Color = Color(0x1A4589FF) - override val auraStartSm: Color = Color(0x284589FF) + override val auraStartSm: Color = Color(0x294589FF) - override val borderEnd: Color = Color(0xFF4589FF) + override val borderEnd: Color = Color(0xFF4589FF) - override val borderStart: Color = Color(0x5BA6C8FF) + override val borderStart: Color = Color(0x5CA6C8FF) - override val borderStrong: Color = Color(0xFF78A9FF) + override val borderStrong: Color = Color(0xFF78A9FF) - override val dropShadow: Color = Color(0x47000000) + override val dropShadow: Color = Color(0x47000000) - override val innerShadow: Color = Color(0x284589FF) + override val innerShadow: Color = Color(0x294589FF) - override val overlay: Color = Color(0x7F000000) + override val overlay: Color = Color(0x80000000) - override val popoverBackground: Color = Color(0xFF161616) + override val popoverBackground: Color = Color(0xFF161616) - override val popoverShadowOuter01: Color = Color(0x1E000000) + override val popoverShadowOuter01: Color = Color(0x1F000000) - override val popoverShadowOuter02: Color = Color(0x14000000) + override val popoverShadowOuter02: Color = Color(0x14000000) - override val skeletonBackground: Color = Color(0x7F78A9FF) + override val skeletonBackground: Color = Color(0x8078A9FF) - override val skeletonElement: Color = Color(0x4C78A9FF) + override val skeletonElement: Color = Color(0x4D78A9FF) } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/ai/Gray10AiColors.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/ai/Gray10AiColors.kt index 3c3844ef..87322a68 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/ai/Gray10AiColors.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/ai/Gray10AiColors.kt @@ -11,37 +11,37 @@ import androidx.compose.ui.graphics.Color */ @Immutable public object Gray10AiColors : AiColors { - override val auraEnd: Color = Color(0x00FFFFFF) + override val auraEnd: Color = Color(0x00FFFFFF) - override val auraHoverBackground: Color = Color(0xFFEDF5FF) + override val auraHoverBackground: Color = Color(0xFFEDF5FF) - override val auraHoverEnd: Color = Color(0x00FFFFFF) + override val auraHoverEnd: Color = Color(0x00FFFFFF) - override val auraHoverStart: Color = Color(0xFF4589FF) + override val auraHoverStart: Color = Color(0xFF4589FF) - override val auraStart: Color = Color(0x194589FF) + override val auraStart: Color = Color(0x1A4589FF) - override val auraStartSm: Color = Color(0x284589FF) + override val auraStartSm: Color = Color(0x294589FF) - override val borderEnd: Color = Color(0xFF78A9FF) + override val borderEnd: Color = Color(0xFF78A9FF) - override val borderStart: Color = Color(0xA3A6C8FF) + override val borderStart: Color = Color(0xA3A6C8FF) - override val borderStrong: Color = Color(0xFF4589FF) + override val borderStrong: Color = Color(0xFF4589FF) - override val dropShadow: Color = Color(0x190F62FE) + override val dropShadow: Color = Color(0x1A0F62FE) - override val innerShadow: Color = Color(0x194589FF) + override val innerShadow: Color = Color(0x1A4589FF) - override val overlay: Color = Color(0x7F001141) + override val overlay: Color = Color(0x80001141) - override val popoverBackground: Color = Color(0xFFFFFFFF) + override val popoverBackground: Color = Color(0xFFFFFFFF) - override val popoverShadowOuter01: Color = Color(0x0F0043CE) + override val popoverShadowOuter01: Color = Color(0x0F0043CE) - override val popoverShadowOuter02: Color = Color(0x0A000000) + override val popoverShadowOuter02: Color = Color(0x0A000000) - override val skeletonBackground: Color = Color(0xFFD0E2FF) + override val skeletonBackground: Color = Color(0xFFD0E2FF) - override val skeletonElement: Color = Color(0xFF4589FF) + override val skeletonElement: Color = Color(0xFF4589FF) } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/ai/Gray90AiColors.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/ai/Gray90AiColors.kt index c13f52e1..6390726b 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/ai/Gray90AiColors.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/ai/Gray90AiColors.kt @@ -11,37 +11,37 @@ import androidx.compose.ui.graphics.Color */ @Immutable public object Gray90AiColors : AiColors { - override val auraEnd: Color = Color(0x00000000) + override val auraEnd: Color = Color(0x00000000) - override val auraHoverBackground: Color = Color(0xFFE8E8E8) + override val auraHoverBackground: Color = Color(0xFFE8E8E8) - override val auraHoverEnd: Color = Color(0x00000000) + override val auraHoverEnd: Color = Color(0x00000000) - override val auraHoverStart: Color = Color(0x664589FF) + override val auraHoverStart: Color = Color(0x664589FF) - override val auraStart: Color = Color(0x194589FF) + override val auraStart: Color = Color(0x1A4589FF) - override val auraStartSm: Color = Color(0x284589FF) + override val auraStartSm: Color = Color(0x294589FF) - override val borderEnd: Color = Color(0xFF4589FF) + override val borderEnd: Color = Color(0xFF4589FF) - override val borderStart: Color = Color(0x5BA6C8FF) + override val borderStart: Color = Color(0x5CA6C8FF) - override val borderStrong: Color = Color(0xFF78A9FF) + override val borderStrong: Color = Color(0xFF78A9FF) - override val dropShadow: Color = Color(0x47000000) + override val dropShadow: Color = Color(0x47000000) - override val innerShadow: Color = Color(0x284589FF) + override val innerShadow: Color = Color(0x294589FF) - override val overlay: Color = Color(0x7F000000) + override val overlay: Color = Color(0x80000000) - override val popoverBackground: Color = Color(0xFF161616) + override val popoverBackground: Color = Color(0xFF161616) - override val popoverShadowOuter01: Color = Color(0x1E000000) + override val popoverShadowOuter01: Color = Color(0x1F000000) - override val popoverShadowOuter02: Color = Color(0x14000000) + override val popoverShadowOuter02: Color = Color(0x14000000) - override val skeletonBackground: Color = Color(0x7F78A9FF) + override val skeletonBackground: Color = Color(0x8078A9FF) - override val skeletonElement: Color = Color(0x4C78A9FF) + override val skeletonElement: Color = Color(0x4D78A9FF) } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/ai/WhiteAiColors.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/ai/WhiteAiColors.kt index 81e09b00..1cd48cc9 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/ai/WhiteAiColors.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/ai/WhiteAiColors.kt @@ -11,37 +11,37 @@ import androidx.compose.ui.graphics.Color */ @Immutable public object WhiteAiColors : AiColors { - override val auraEnd: Color = Color(0x00FFFFFF) + override val auraEnd: Color = Color(0x00FFFFFF) - override val auraHoverBackground: Color = Color(0xFFEDF5FF) + override val auraHoverBackground: Color = Color(0xFFEDF5FF) - override val auraHoverEnd: Color = Color(0x00FFFFFF) + override val auraHoverEnd: Color = Color(0x00FFFFFF) - override val auraHoverStart: Color = Color(0xFF4589FF) + override val auraHoverStart: Color = Color(0xFF4589FF) - override val auraStart: Color = Color(0x194589FF) + override val auraStart: Color = Color(0x1A4589FF) - override val auraStartSm: Color = Color(0x284589FF) + override val auraStartSm: Color = Color(0x294589FF) - override val borderEnd: Color = Color(0xFF78A9FF) + override val borderEnd: Color = Color(0xFF78A9FF) - override val borderStart: Color = Color(0xA3A6C8FF) + override val borderStart: Color = Color(0xA3A6C8FF) - override val borderStrong: Color = Color(0xFF4589FF) + override val borderStrong: Color = Color(0xFF4589FF) - override val dropShadow: Color = Color(0x190F62FE) + override val dropShadow: Color = Color(0x1A0F62FE) - override val innerShadow: Color = Color(0x194589FF) + override val innerShadow: Color = Color(0x1A4589FF) - override val overlay: Color = Color(0x7F001141) + override val overlay: Color = Color(0x80001141) - override val popoverBackground: Color = Color(0xFFFFFFFF) + override val popoverBackground: Color = Color(0xFFFFFFFF) - override val popoverShadowOuter01: Color = Color(0x0F0043CE) + override val popoverShadowOuter01: Color = Color(0x0F0043CE) - override val popoverShadowOuter02: Color = Color(0x0A000000) + override val popoverShadowOuter02: Color = Color(0x0A000000) - override val skeletonBackground: Color = Color(0xFFD0E2FF) + override val skeletonBackground: Color = Color(0xFFD0E2FF) - override val skeletonElement: Color = Color(0xFF4589FF) + override val skeletonElement: Color = Color(0xFF4589FF) } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/chat/ChatColors.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/chat/ChatColors.kt index 4ca78d6e..6b80757a 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/chat/ChatColors.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/chat/ChatColors.kt @@ -11,88 +11,88 @@ import androidx.compose.ui.graphics.Color */ @Immutable public interface ChatColors { - /** - * Chat avatar background color for agents. - */ - public val avatarAgent: Color - - /** - * Chat avatar background color for bots. - */ - public val avatarBot: Color - - /** - * Chat avatar background color for users. - */ - public val avatarUser: Color - - /** - * Chat bubble background color for agents. - */ - public val bubbleAgent: Color - - /** - * Chat bubble border color for agents. - */ - public val bubbleBorder: Color - - /** - * Chat bubble background color for users. - */ - public val bubbleUser: Color - - /** - * Chat header background color. - */ - public val headerBackground: Color - - /** - * Background color for chat prompt input. - */ - public val promptBackground: Color - - /** - * Linear gradient end value for chat prompts border. - */ - public val promptBorderEnd: Color - - /** - * Linear gradient start value for chat prompts border. - */ - public val promptBorderStart: Color - - /** - * Chat shell background color. - */ - public val shellBackground: Color - - /** - * Chat quick action button color. - */ - public val button: Color - - /** - * Active color for [chatButton]. - */ - public val buttonActive: Color - - /** - * Hover color for [chatButton]. - */ - public val buttonHover: Color - - /** - * Selected color for [chatButton]. - */ - public val buttonSelected: Color - - /** - * Text color for hovered chat button. - */ - public val buttonTextHover: Color - - /** - * Text color for selected chat-button. - */ - public val buttonTextSelected: Color + /** + * Chat avatar background color for agents. + */ + public val avatarAgent: Color + + /** + * Chat avatar background color for bots. + */ + public val avatarBot: Color + + /** + * Chat avatar background color for users. + */ + public val avatarUser: Color + + /** + * Chat bubble background color for agents. + */ + public val bubbleAgent: Color + + /** + * Chat bubble border color for agents. + */ + public val bubbleBorder: Color + + /** + * Chat bubble background color for users. + */ + public val bubbleUser: Color + + /** + * Chat header background color. + */ + public val headerBackground: Color + + /** + * Background color for chat prompt input. + */ + public val promptBackground: Color + + /** + * Linear gradient end value for chat prompts border. + */ + public val promptBorderEnd: Color + + /** + * Linear gradient start value for chat prompts border. + */ + public val promptBorderStart: Color + + /** + * Chat shell background color. + */ + public val shellBackground: Color + + /** + * Chat quick action button color. + */ + public val button: Color + + /** + * Active color for [chatButton]. + */ + public val buttonActive: Color + + /** + * Hover color for [chatButton]. + */ + public val buttonHover: Color + + /** + * Selected color for [chatButton]. + */ + public val buttonSelected: Color + + /** + * Text color for hovered chat button. + */ + public val buttonTextHover: Color + + /** + * Text color for selected chat-button. + */ + public val buttonTextSelected: Color } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/chat/Gray100ChatColors.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/chat/Gray100ChatColors.kt index 29afb542..7db841e3 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/chat/Gray100ChatColors.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/chat/Gray100ChatColors.kt @@ -11,37 +11,37 @@ import androidx.compose.ui.graphics.Color */ @Immutable public object Gray100ChatColors : ChatColors { - override val avatarAgent: Color = Color(0xFFC6C6C6) + override val avatarAgent: Color = Color(0xFFC6C6C6) - override val avatarBot: Color = Color(0xFF8D8D8D) + override val avatarBot: Color = Color(0xFF8D8D8D) - override val avatarUser: Color = Color(0xFF4589FF) + override val avatarUser: Color = Color(0xFF4589FF) - override val bubbleAgent: Color = Color(0xFF262626) + override val bubbleAgent: Color = Color(0xFF262626) - override val bubbleBorder: Color = Color(0xFF525252) + override val bubbleBorder: Color = Color(0xFF525252) - override val bubbleUser: Color = Color(0xFF393939) + override val bubbleUser: Color = Color(0xFF393939) - override val headerBackground: Color = Color(0xFF262626) + override val headerBackground: Color = Color(0xFF262626) - override val promptBackground: Color = Color(0xFF161616) + override val promptBackground: Color = Color(0xFF161616) - override val promptBorderEnd: Color = Color(0x00262626) + override val promptBorderEnd: Color = Color(0x00262626) - override val promptBorderStart: Color = Color(0xFF262626) + override val promptBorderStart: Color = Color(0xFF262626) - override val shellBackground: Color = Color(0xFF262626) + override val shellBackground: Color = Color(0xFF262626) - override val button: Color = Color(0xFF78A9FF) + override val button: Color = Color(0xFF78A9FF) - override val buttonActive: Color = Color(0x668D8D8D) + override val buttonActive: Color = Color(0x668D8D8D) - override val buttonHover: Color = Color(0x288D8D8D) + override val buttonHover: Color = Color(0x298D8D8D) - override val buttonSelected: Color = Color(0x3D8D8D8D) + override val buttonSelected: Color = Color(0x3D8D8D8D) - override val buttonTextHover: Color = Color(0xFFA6C8FF) + override val buttonTextHover: Color = Color(0xFFA6C8FF) - override val buttonTextSelected: Color = Color(0xFFC6C6C6) + override val buttonTextSelected: Color = Color(0xFFC6C6C6) } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/chat/Gray10ChatColors.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/chat/Gray10ChatColors.kt index 628f04d8..db91c3e2 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/chat/Gray10ChatColors.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/chat/Gray10ChatColors.kt @@ -11,37 +11,37 @@ import androidx.compose.ui.graphics.Color */ @Immutable public object Gray10ChatColors : ChatColors { - override val avatarAgent: Color = Color(0xFF393939) + override val avatarAgent: Color = Color(0xFF393939) - override val avatarBot: Color = Color(0xFF6F6F6F) + override val avatarBot: Color = Color(0xFF6F6F6F) - override val avatarUser: Color = Color(0xFF0F62FE) + override val avatarUser: Color = Color(0xFF0F62FE) - override val bubbleAgent: Color = Color(0xFFFFFFFF) + override val bubbleAgent: Color = Color(0xFFFFFFFF) - override val bubbleBorder: Color = Color(0xFFE0E0E0) + override val bubbleBorder: Color = Color(0xFFE0E0E0) - override val bubbleUser: Color = Color(0xFFE0E0E0) + override val bubbleUser: Color = Color(0xFFE0E0E0) - override val headerBackground: Color = Color(0xFFFFFFFF) + override val headerBackground: Color = Color(0xFFFFFFFF) - override val promptBackground: Color = Color(0xFFFFFFFF) + override val promptBackground: Color = Color(0xFFFFFFFF) - override val promptBorderEnd: Color = Color(0x00F4F4F4) + override val promptBorderEnd: Color = Color(0x00F4F4F4) - override val promptBorderStart: Color = Color(0xFFF4F4F4) + override val promptBorderStart: Color = Color(0xFFF4F4F4) - override val shellBackground: Color = Color(0xFFFFFFFF) + override val shellBackground: Color = Color(0xFFFFFFFF) - override val button: Color = Color(0xFF0F62FE) + override val button: Color = Color(0xFF0F62FE) - override val buttonActive: Color = Color(0x7F8D8D8D) + override val buttonActive: Color = Color(0x808D8D8D) - override val buttonHover: Color = Color(0x1E8D8D8D) + override val buttonHover: Color = Color(0x1F8D8D8D) - override val buttonSelected: Color = Color(0x338D8D8D) + override val buttonSelected: Color = Color(0x338D8D8D) - override val buttonTextHover: Color = Color(0xFF0043CE) + override val buttonTextHover: Color = Color(0xFF0043CE) - override val buttonTextSelected: Color = Color(0xFF525252) + override val buttonTextSelected: Color = Color(0xFF525252) } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/chat/Gray90ChatColors.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/chat/Gray90ChatColors.kt index 3a34a632..0ab8e6a5 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/chat/Gray90ChatColors.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/chat/Gray90ChatColors.kt @@ -11,37 +11,37 @@ import androidx.compose.ui.graphics.Color */ @Immutable public object Gray90ChatColors : ChatColors { - override val avatarAgent: Color = Color(0xFFC6C6C6) + override val avatarAgent: Color = Color(0xFFC6C6C6) - override val avatarBot: Color = Color(0xFF8D8D8D) + override val avatarBot: Color = Color(0xFF8D8D8D) - override val avatarUser: Color = Color(0xFF4589FF) + override val avatarUser: Color = Color(0xFF4589FF) - override val bubbleAgent: Color = Color(0xFF262626) + override val bubbleAgent: Color = Color(0xFF262626) - override val bubbleBorder: Color = Color(0xFF525252) + override val bubbleBorder: Color = Color(0xFF525252) - override val bubbleUser: Color = Color(0xFF393939) + override val bubbleUser: Color = Color(0xFF393939) - override val headerBackground: Color = Color(0xFF262626) + override val headerBackground: Color = Color(0xFF262626) - override val promptBackground: Color = Color(0xFF161616) + override val promptBackground: Color = Color(0xFF161616) - override val promptBorderEnd: Color = Color(0x00262626) + override val promptBorderEnd: Color = Color(0x00262626) - override val promptBorderStart: Color = Color(0xFF262626) + override val promptBorderStart: Color = Color(0xFF262626) - override val shellBackground: Color = Color(0xFF262626) + override val shellBackground: Color = Color(0xFF262626) - override val button: Color = Color(0xFF78A9FF) + override val button: Color = Color(0xFF78A9FF) - override val buttonActive: Color = Color(0x668D8D8D) + override val buttonActive: Color = Color(0x668D8D8D) - override val buttonHover: Color = Color(0x288D8D8D) + override val buttonHover: Color = Color(0x298D8D8D) - override val buttonSelected: Color = Color(0x3D8D8D8D) + override val buttonSelected: Color = Color(0x3D8D8D8D) - override val buttonTextHover: Color = Color(0xFFA6C8FF) + override val buttonTextHover: Color = Color(0xFFA6C8FF) - override val buttonTextSelected: Color = Color(0xFFC6C6C6) + override val buttonTextSelected: Color = Color(0xFFC6C6C6) } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/chat/WhiteChatColors.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/chat/WhiteChatColors.kt index 3513db26..c4b628ae 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/chat/WhiteChatColors.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/chat/WhiteChatColors.kt @@ -11,37 +11,37 @@ import androidx.compose.ui.graphics.Color */ @Immutable public object WhiteChatColors : ChatColors { - override val avatarAgent: Color = Color(0xFF393939) + override val avatarAgent: Color = Color(0xFF393939) - override val avatarBot: Color = Color(0xFF6F6F6F) + override val avatarBot: Color = Color(0xFF6F6F6F) - override val avatarUser: Color = Color(0xFF0F62FE) + override val avatarUser: Color = Color(0xFF0F62FE) - override val bubbleAgent: Color = Color(0xFFFFFFFF) + override val bubbleAgent: Color = Color(0xFFFFFFFF) - override val bubbleBorder: Color = Color(0xFFE0E0E0) + override val bubbleBorder: Color = Color(0xFFE0E0E0) - override val bubbleUser: Color = Color(0xFFE0E0E0) + override val bubbleUser: Color = Color(0xFFE0E0E0) - override val headerBackground: Color = Color(0xFFFFFFFF) + override val headerBackground: Color = Color(0xFFFFFFFF) - override val promptBackground: Color = Color(0xFFFFFFFF) + override val promptBackground: Color = Color(0xFFFFFFFF) - override val promptBorderEnd: Color = Color(0x00F4F4F4) + override val promptBorderEnd: Color = Color(0x00F4F4F4) - override val promptBorderStart: Color = Color(0xFFF4F4F4) + override val promptBorderStart: Color = Color(0xFFF4F4F4) - override val shellBackground: Color = Color(0xFFFFFFFF) + override val shellBackground: Color = Color(0xFFFFFFFF) - override val button: Color = Color(0xFF0F62FE) + override val button: Color = Color(0xFF0F62FE) - override val buttonActive: Color = Color(0x7F8D8D8D) + override val buttonActive: Color = Color(0x808D8D8D) - override val buttonHover: Color = Color(0x1E8D8D8D) + override val buttonHover: Color = Color(0x1F8D8D8D) - override val buttonSelected: Color = Color(0x338D8D8D) + override val buttonSelected: Color = Color(0x338D8D8D) - override val buttonTextHover: Color = Color(0xFF0043CE) + override val buttonTextHover: Color = Color(0xFF0043CE) - override val buttonTextSelected: Color = Color(0xFF525252) + override val buttonTextSelected: Color = Color(0xFF525252) } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/notification/Gray100NotificationColors.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/notification/Gray100NotificationColors.kt index a99adf2d..0fe930b4 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/notification/Gray100NotificationColors.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/notification/Gray100NotificationColors.kt @@ -11,23 +11,23 @@ import androidx.compose.ui.graphics.Color */ @Immutable public object Gray100NotificationColors : NotificationColors { - override val actionHover: Color = Color(0xFF333333) + override val actionHover: Color = Color(0xFF333333) - override val actionTertiaryInverse: Color = Color(0xFF0F62FE) + override val actionTertiaryInverse: Color = Color(0xFF0F62FE) - override val actionTertiaryInverseActive: Color = Color(0xFF161616) + override val actionTertiaryInverseActive: Color = Color(0xFF161616) - override val actionTertiaryInverseHover: Color = Color(0xFF002D9C) + override val actionTertiaryInverseHover: Color = Color(0xFF002D9C) - override val actionTertiaryInverseText: Color = Color(0xFFFFFFFF) + override val actionTertiaryInverseText: Color = Color(0xFFFFFFFF) - override val actionTertiaryInverseTextOnColorDisabled: Color = Color(0xFFFFFFFF) + override val actionTertiaryInverseTextOnColorDisabled: Color = Color(0xFFFFFFFF) - override val backgroundError: Color = Color(0xFF262626) + override val backgroundError: Color = Color(0xFF262626) - override val backgroundInfo: Color = Color(0xFF262626) + override val backgroundInfo: Color = Color(0xFF262626) - override val backgroundSuccess: Color = Color(0xFF262626) + override val backgroundSuccess: Color = Color(0xFF262626) - override val backgroundWarning: Color = Color(0xFF262626) + override val backgroundWarning: Color = Color(0xFF262626) } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/notification/Gray10NotificationColors.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/notification/Gray10NotificationColors.kt index eb6be3d5..9cf4164c 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/notification/Gray10NotificationColors.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/notification/Gray10NotificationColors.kt @@ -11,23 +11,23 @@ import androidx.compose.ui.graphics.Color */ @Immutable public object Gray10NotificationColors : NotificationColors { - override val actionHover: Color = Color(0xFFFFFFFF) + override val actionHover: Color = Color(0xFFFFFFFF) - override val actionTertiaryInverse: Color = Color(0xFFFFFFFF) + override val actionTertiaryInverse: Color = Color(0xFFFFFFFF) - override val actionTertiaryInverseActive: Color = Color(0xFFFFFFFF) + override val actionTertiaryInverseActive: Color = Color(0xFFFFFFFF) - override val actionTertiaryInverseHover: Color = Color(0xFFC6C6C6) + override val actionTertiaryInverseHover: Color = Color(0xFFC6C6C6) - override val actionTertiaryInverseText: Color = Color(0xFF161616) + override val actionTertiaryInverseText: Color = Color(0xFF161616) - override val actionTertiaryInverseTextOnColorDisabled: Color = Color(0xFFFFFFFF) + override val actionTertiaryInverseTextOnColorDisabled: Color = Color(0xFFFFFFFF) - override val backgroundError: Color = Color(0xFFFFF1F1) + override val backgroundError: Color = Color(0xFFFFF1F1) - override val backgroundInfo: Color = Color(0xFFEDF5FF) + override val backgroundInfo: Color = Color(0xFFEDF5FF) - override val backgroundSuccess: Color = Color(0xFFDEFBE6) + override val backgroundSuccess: Color = Color(0xFFDEFBE6) - override val backgroundWarning: Color = Color(0xFFFCF4D6) + override val backgroundWarning: Color = Color(0xFFFCF4D6) } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/notification/Gray90NotificationColors.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/notification/Gray90NotificationColors.kt index 5d25e205..b046baee 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/notification/Gray90NotificationColors.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/notification/Gray90NotificationColors.kt @@ -11,23 +11,23 @@ import androidx.compose.ui.graphics.Color */ @Immutable public object Gray90NotificationColors : NotificationColors { - override val actionHover: Color = Color(0xFF474747) + override val actionHover: Color = Color(0xFF474747) - override val actionTertiaryInverse: Color = Color(0xFF0F62FE) + override val actionTertiaryInverse: Color = Color(0xFF0F62FE) - override val actionTertiaryInverseActive: Color = Color(0xFF161616) + override val actionTertiaryInverseActive: Color = Color(0xFF161616) - override val actionTertiaryInverseHover: Color = Color(0xFF002D9C) + override val actionTertiaryInverseHover: Color = Color(0xFF002D9C) - override val actionTertiaryInverseText: Color = Color(0xFFFFFFFF) + override val actionTertiaryInverseText: Color = Color(0xFFFFFFFF) - override val actionTertiaryInverseTextOnColorDisabled: Color = Color(0xFFFFFFFF) + override val actionTertiaryInverseTextOnColorDisabled: Color = Color(0xFFFFFFFF) - override val backgroundError: Color = Color(0xFF393939) + override val backgroundError: Color = Color(0xFF393939) - override val backgroundInfo: Color = Color(0xFF393939) + override val backgroundInfo: Color = Color(0xFF393939) - override val backgroundSuccess: Color = Color(0xFF393939) + override val backgroundSuccess: Color = Color(0xFF393939) - override val backgroundWarning: Color = Color(0xFF393939) + override val backgroundWarning: Color = Color(0xFF393939) } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/notification/NotificationColors.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/notification/NotificationColors.kt index d53b018d..ad5971d6 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/notification/NotificationColors.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/notification/NotificationColors.kt @@ -11,53 +11,53 @@ import androidx.compose.ui.graphics.Color */ @Immutable public interface NotificationColors { - /** - * Hover for notification ghost button. - */ - public val actionHover: Color - - /** - * Tertiary button color for notification. - */ - public val actionTertiaryInverse: Color - - /** - * Active color for tertiary button in notification. - */ - public val actionTertiaryInverseActive: Color - - /** - * Hover color for tertiary button in notification. - */ - public val actionTertiaryInverseHover: Color - - /** - * Text color for tertiary button in notification. - */ - public val actionTertiaryInverseText: Color - - /** - * Disabled color for tertiary button in notification. - */ - public val actionTertiaryInverseTextOnColorDisabled: Color - - /** - * Error low contrast notification background. - */ - public val backgroundError: Color - - /** - * Informational low contrast notification background. - */ - public val backgroundInfo: Color - - /** - * Success low contrast notification background. - */ - public val backgroundSuccess: Color - - /** - * Warning low contrast notification background. - */ - public val backgroundWarning: Color + /** + * Hover for notification ghost button. + */ + public val actionHover: Color + + /** + * Tertiary button color for notification. + */ + public val actionTertiaryInverse: Color + + /** + * Active color for tertiary button in notification. + */ + public val actionTertiaryInverseActive: Color + + /** + * Hover color for tertiary button in notification. + */ + public val actionTertiaryInverseHover: Color + + /** + * Text color for tertiary button in notification. + */ + public val actionTertiaryInverseText: Color + + /** + * Disabled color for tertiary button in notification. + */ + public val actionTertiaryInverseTextOnColorDisabled: Color + + /** + * Error low contrast notification background. + */ + public val backgroundError: Color + + /** + * Informational low contrast notification background. + */ + public val backgroundInfo: Color + + /** + * Success low contrast notification background. + */ + public val backgroundSuccess: Color + + /** + * Warning low contrast notification background. + */ + public val backgroundWarning: Color } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/notification/WhiteNotificationColors.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/notification/WhiteNotificationColors.kt index 0a822a5e..ab055ad3 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/notification/WhiteNotificationColors.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/notification/WhiteNotificationColors.kt @@ -11,23 +11,23 @@ import androidx.compose.ui.graphics.Color */ @Immutable public object WhiteNotificationColors : NotificationColors { - override val actionHover: Color = Color(0xFFFFFFFF) + override val actionHover: Color = Color(0xFFFFFFFF) - override val actionTertiaryInverse: Color = Color(0xFFFFFFFF) + override val actionTertiaryInverse: Color = Color(0xFFFFFFFF) - override val actionTertiaryInverseActive: Color = Color(0xFFFFFFFF) + override val actionTertiaryInverseActive: Color = Color(0xFFFFFFFF) - override val actionTertiaryInverseHover: Color = Color(0xFFC6C6C6) + override val actionTertiaryInverseHover: Color = Color(0xFFC6C6C6) - override val actionTertiaryInverseText: Color = Color(0xFF161616) + override val actionTertiaryInverseText: Color = Color(0xFF161616) - override val actionTertiaryInverseTextOnColorDisabled: Color = Color(0xFFFFFFFF) + override val actionTertiaryInverseTextOnColorDisabled: Color = Color(0xFFFFFFFF) - override val backgroundError: Color = Color(0xFFFFF1F1) + override val backgroundError: Color = Color(0xFFFFF1F1) - override val backgroundInfo: Color = Color(0xFFEDF5FF) + override val backgroundInfo: Color = Color(0xFFEDF5FF) - override val backgroundSuccess: Color = Color(0xFFDEFBE6) + override val backgroundSuccess: Color = Color(0xFFDEFBE6) - override val backgroundWarning: Color = Color(0xFFFCF4D6) + override val backgroundWarning: Color = Color(0xFFFCF4D6) } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/tag/Gray100TagColors.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/tag/Gray100TagColors.kt index 32d81020..8bd2aa7c 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/tag/Gray100TagColors.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/tag/Gray100TagColors.kt @@ -11,83 +11,83 @@ import androidx.compose.ui.graphics.Color */ @Immutable public object Gray100TagColors : TagColors { - override val backgroundBlue: Color = Color(0xFF0043CE) + override val backgroundBlue: Color = Color(0xFF0043CE) - override val backgroundCoolGray: Color = Color(0xFF4D5358) + override val backgroundCoolGray: Color = Color(0xFF4D5358) - override val backgroundCyan: Color = Color(0xFF00539A) + override val backgroundCyan: Color = Color(0xFF00539A) - override val backgroundGray: Color = Color(0xFF525252) + override val backgroundGray: Color = Color(0xFF525252) - override val backgroundGreen: Color = Color(0xFF0E6027) + override val backgroundGreen: Color = Color(0xFF0E6027) - override val backgroundMagenta: Color = Color(0xFF9F1853) + override val backgroundMagenta: Color = Color(0xFF9F1853) - override val backgroundPurple: Color = Color(0xFF6929C4) + override val backgroundPurple: Color = Color(0xFF6929C4) - override val backgroundRed: Color = Color(0xFFA2191F) + override val backgroundRed: Color = Color(0xFFA2191F) - override val backgroundTeal: Color = Color(0xFF005D5D) + override val backgroundTeal: Color = Color(0xFF005D5D) - override val backgroundWarmGray: Color = Color(0xFF565151) + override val backgroundWarmGray: Color = Color(0xFF565151) - override val borderBlue: Color = Color(0xFF4589FF) + override val borderBlue: Color = Color(0xFF4589FF) - override val borderCoolGray: Color = Color(0xFF878D96) + override val borderCoolGray: Color = Color(0xFF878D96) - override val borderCyan: Color = Color(0xFF1192E8) + override val borderCyan: Color = Color(0xFF1192E8) - override val borderGray: Color = Color(0xFF8D8D8D) + override val borderGray: Color = Color(0xFF8D8D8D) - override val borderGreen: Color = Color(0xFF24A148) + override val borderGreen: Color = Color(0xFF24A148) - override val borderMagenta: Color = Color(0xFFEE5396) + override val borderMagenta: Color = Color(0xFFEE5396) - override val borderPurple: Color = Color(0xFFA56EFF) + override val borderPurple: Color = Color(0xFFA56EFF) - override val borderRed: Color = Color(0xFFFA4D56) + override val borderRed: Color = Color(0xFFFA4D56) - override val borderTeal: Color = Color(0xFF009D9A) + override val borderTeal: Color = Color(0xFF009D9A) - override val borderWarmGray: Color = Color(0xFF8F8B8B) + override val borderWarmGray: Color = Color(0xFF8F8B8B) - override val colorBlue: Color = Color(0xFFD0E2FF) + override val colorBlue: Color = Color(0xFFD0E2FF) - override val colorCoolGray: Color = Color(0xFFDDE1E6) + override val colorCoolGray: Color = Color(0xFFDDE1E6) - override val colorCyan: Color = Color(0xFFBAE6FF) + override val colorCyan: Color = Color(0xFFBAE6FF) - override val colorGray: Color = Color(0xFFE0E0E0) + override val colorGray: Color = Color(0xFFE0E0E0) - override val colorGreen: Color = Color(0xFFA7F0BA) + override val colorGreen: Color = Color(0xFFA7F0BA) - override val colorMagenta: Color = Color(0xFFFFD6E8) + override val colorMagenta: Color = Color(0xFFFFD6E8) - override val colorPurple: Color = Color(0xFFE8DAFF) + override val colorPurple: Color = Color(0xFFE8DAFF) - override val colorRed: Color = Color(0xFFFFD7D9) + override val colorRed: Color = Color(0xFFFFD7D9) - override val colorTeal: Color = Color(0xFF9EF0F0) + override val colorTeal: Color = Color(0xFF9EF0F0) - override val colorWarmGray: Color = Color(0xFFE5E0DF) + override val colorWarmGray: Color = Color(0xFFE5E0DF) - override val hoverBlue: Color = Color(0xFF0053FF) + override val hoverBlue: Color = Color(0xFF0053FF) - override val hoverCoolGray: Color = Color(0xFF5D646A) + override val hoverCoolGray: Color = Color(0xFF5D646A) - override val hoverCyan: Color = Color(0xFF0066BD) + override val hoverCyan: Color = Color(0xFF0066BD) - override val hoverGray: Color = Color(0xFF636363) + override val hoverGray: Color = Color(0xFF636363) - override val hoverGreen: Color = Color(0xFF11742F) + override val hoverGreen: Color = Color(0xFF11742F) - override val hoverMagenta: Color = Color(0xFFBF1D63) + override val hoverMagenta: Color = Color(0xFFBF1D63) - override val hoverPurple: Color = Color(0xFF7C3DD6) + override val hoverPurple: Color = Color(0xFF7C3DD6) - override val hoverRed: Color = Color(0xFFC21E25) + override val hoverRed: Color = Color(0xFFC21E25) - override val hoverTeal: Color = Color(0xFF007070) + override val hoverTeal: Color = Color(0xFF007070) - override val hoverWarmGray: Color = Color(0xFF696363) + override val hoverWarmGray: Color = Color(0xFF696363) } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/tag/Gray10TagColors.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/tag/Gray10TagColors.kt index aae374d7..94eb3425 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/tag/Gray10TagColors.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/tag/Gray10TagColors.kt @@ -11,83 +11,83 @@ import androidx.compose.ui.graphics.Color */ @Immutable public object Gray10TagColors : TagColors { - override val backgroundBlue: Color = Color(0xFFD0E2FF) + override val backgroundBlue: Color = Color(0xFFD0E2FF) - override val backgroundCoolGray: Color = Color(0xFFDDE1E6) + override val backgroundCoolGray: Color = Color(0xFFDDE1E6) - override val backgroundCyan: Color = Color(0xFFBAE6FF) + override val backgroundCyan: Color = Color(0xFFBAE6FF) - override val backgroundGray: Color = Color(0xFFE0E0E0) + override val backgroundGray: Color = Color(0xFFE0E0E0) - override val backgroundGreen: Color = Color(0xFFA7F0BA) + override val backgroundGreen: Color = Color(0xFFA7F0BA) - override val backgroundMagenta: Color = Color(0xFFFFD6E8) + override val backgroundMagenta: Color = Color(0xFFFFD6E8) - override val backgroundPurple: Color = Color(0xFFE8DAFF) + override val backgroundPurple: Color = Color(0xFFE8DAFF) - override val backgroundRed: Color = Color(0xFFFFD7D9) + override val backgroundRed: Color = Color(0xFFFFD7D9) - override val backgroundTeal: Color = Color(0xFF9EF0F0) + override val backgroundTeal: Color = Color(0xFF9EF0F0) - override val backgroundWarmGray: Color = Color(0xFFE5E0DF) + override val backgroundWarmGray: Color = Color(0xFFE5E0DF) - override val borderBlue: Color = Color(0xFF78A9FF) + override val borderBlue: Color = Color(0xFF78A9FF) - override val borderCoolGray: Color = Color(0xFFA2A9B0) + override val borderCoolGray: Color = Color(0xFFA2A9B0) - override val borderCyan: Color = Color(0xFF33B1FF) + override val borderCyan: Color = Color(0xFF33B1FF) - override val borderGray: Color = Color(0xFFA8A8A8) + override val borderGray: Color = Color(0xFFA8A8A8) - override val borderGreen: Color = Color(0xFF42BE65) + override val borderGreen: Color = Color(0xFF42BE65) - override val borderMagenta: Color = Color(0xFFFF7EB6) + override val borderMagenta: Color = Color(0xFFFF7EB6) - override val borderPurple: Color = Color(0xFFBE95FF) + override val borderPurple: Color = Color(0xFFBE95FF) - override val borderRed: Color = Color(0xFFFF8389) + override val borderRed: Color = Color(0xFFFF8389) - override val borderTeal: Color = Color(0xFF08BDBA) + override val borderTeal: Color = Color(0xFF08BDBA) - override val borderWarmGray: Color = Color(0xFFADA8A8) + override val borderWarmGray: Color = Color(0xFFADA8A8) - override val colorBlue: Color = Color(0xFF0043CE) + override val colorBlue: Color = Color(0xFF0043CE) - override val colorCoolGray: Color = Color(0xFF121619) + override val colorCoolGray: Color = Color(0xFF121619) - override val colorCyan: Color = Color(0xFF00539A) + override val colorCyan: Color = Color(0xFF00539A) - override val colorGray: Color = Color(0xFF161616) + override val colorGray: Color = Color(0xFF161616) - override val colorGreen: Color = Color(0xFF0E6027) + override val colorGreen: Color = Color(0xFF0E6027) - override val colorMagenta: Color = Color(0xFF9F1853) + override val colorMagenta: Color = Color(0xFF9F1853) - override val colorPurple: Color = Color(0xFF6929C4) + override val colorPurple: Color = Color(0xFF6929C4) - override val colorRed: Color = Color(0xFFA2191F) + override val colorRed: Color = Color(0xFFA2191F) - override val colorTeal: Color = Color(0xFF005D5D) + override val colorTeal: Color = Color(0xFF005D5D) - override val colorWarmGray: Color = Color(0xFF171414) + override val colorWarmGray: Color = Color(0xFF171414) - override val hoverBlue: Color = Color(0xFFB8D3FF) + override val hoverBlue: Color = Color(0xFFB8D3FF) - override val hoverCoolGray: Color = Color(0xFFCDD3DA) + override val hoverCoolGray: Color = Color(0xFFCDD3DA) - override val hoverCyan: Color = Color(0xFF99DAFF) + override val hoverCyan: Color = Color(0xFF99DAFF) - override val hoverGray: Color = Color(0xFFD1D1D1) + override val hoverGray: Color = Color(0xFFD1D1D1) - override val hoverGreen: Color = Color(0xFF74E792) + override val hoverGreen: Color = Color(0xFF74E792) - override val hoverMagenta: Color = Color(0xFFFFBDDA) + override val hoverMagenta: Color = Color(0xFFFFBDDA) - override val hoverPurple: Color = Color(0xFFDCC7FF) + override val hoverPurple: Color = Color(0xFFDCC7FF) - override val hoverRed: Color = Color(0xFFFFC2C5) + override val hoverRed: Color = Color(0xFFFFC2C5) - override val hoverTeal: Color = Color(0xFF57E5E5) + override val hoverTeal: Color = Color(0xFF57E5E5) - override val hoverWarmGray: Color = Color(0xFFD8D0CF) + override val hoverWarmGray: Color = Color(0xFFD8D0CF) } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/tag/Gray90TagColors.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/tag/Gray90TagColors.kt index 1b9b56c9..845fed29 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/tag/Gray90TagColors.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/tag/Gray90TagColors.kt @@ -11,83 +11,83 @@ import androidx.compose.ui.graphics.Color */ @Immutable public object Gray90TagColors : TagColors { - override val backgroundBlue: Color = Color(0xFF0043CE) + override val backgroundBlue: Color = Color(0xFF0043CE) - override val backgroundCoolGray: Color = Color(0xFF4D5358) + override val backgroundCoolGray: Color = Color(0xFF4D5358) - override val backgroundCyan: Color = Color(0xFF00539A) + override val backgroundCyan: Color = Color(0xFF00539A) - override val backgroundGray: Color = Color(0xFF525252) + override val backgroundGray: Color = Color(0xFF525252) - override val backgroundGreen: Color = Color(0xFF0E6027) + override val backgroundGreen: Color = Color(0xFF0E6027) - override val backgroundMagenta: Color = Color(0xFF9F1853) + override val backgroundMagenta: Color = Color(0xFF9F1853) - override val backgroundPurple: Color = Color(0xFF6929C4) + override val backgroundPurple: Color = Color(0xFF6929C4) - override val backgroundRed: Color = Color(0xFFA2191F) + override val backgroundRed: Color = Color(0xFFA2191F) - override val backgroundTeal: Color = Color(0xFF005D5D) + override val backgroundTeal: Color = Color(0xFF005D5D) - override val backgroundWarmGray: Color = Color(0xFF565151) + override val backgroundWarmGray: Color = Color(0xFF565151) - override val borderBlue: Color = Color(0xFF4589FF) + override val borderBlue: Color = Color(0xFF4589FF) - override val borderCoolGray: Color = Color(0xFF878D96) + override val borderCoolGray: Color = Color(0xFF878D96) - override val borderCyan: Color = Color(0xFF1192E8) + override val borderCyan: Color = Color(0xFF1192E8) - override val borderGray: Color = Color(0xFF8D8D8D) + override val borderGray: Color = Color(0xFF8D8D8D) - override val borderGreen: Color = Color(0xFF24A148) + override val borderGreen: Color = Color(0xFF24A148) - override val borderMagenta: Color = Color(0xFFEE5396) + override val borderMagenta: Color = Color(0xFFEE5396) - override val borderPurple: Color = Color(0xFFA56EFF) + override val borderPurple: Color = Color(0xFFA56EFF) - override val borderRed: Color = Color(0xFFFA4D56) + override val borderRed: Color = Color(0xFFFA4D56) - override val borderTeal: Color = Color(0xFF009D9A) + override val borderTeal: Color = Color(0xFF009D9A) - override val borderWarmGray: Color = Color(0xFF8F8B8B) + override val borderWarmGray: Color = Color(0xFF8F8B8B) - override val colorBlue: Color = Color(0xFFD0E2FF) + override val colorBlue: Color = Color(0xFFD0E2FF) - override val colorCoolGray: Color = Color(0xFFDDE1E6) + override val colorCoolGray: Color = Color(0xFFDDE1E6) - override val colorCyan: Color = Color(0xFFBAE6FF) + override val colorCyan: Color = Color(0xFFBAE6FF) - override val colorGray: Color = Color(0xFFE0E0E0) + override val colorGray: Color = Color(0xFFE0E0E0) - override val colorGreen: Color = Color(0xFFA7F0BA) + override val colorGreen: Color = Color(0xFFA7F0BA) - override val colorMagenta: Color = Color(0xFFFFD6E8) + override val colorMagenta: Color = Color(0xFFFFD6E8) - override val colorPurple: Color = Color(0xFFE8DAFF) + override val colorPurple: Color = Color(0xFFE8DAFF) - override val colorRed: Color = Color(0xFFFFD7D9) + override val colorRed: Color = Color(0xFFFFD7D9) - override val colorTeal: Color = Color(0xFF9EF0F0) + override val colorTeal: Color = Color(0xFF9EF0F0) - override val colorWarmGray: Color = Color(0xFFE5E0DF) + override val colorWarmGray: Color = Color(0xFFE5E0DF) - override val hoverBlue: Color = Color(0xFF0053FF) + override val hoverBlue: Color = Color(0xFF0053FF) - override val hoverCoolGray: Color = Color(0xFF5D646A) + override val hoverCoolGray: Color = Color(0xFF5D646A) - override val hoverCyan: Color = Color(0xFF0066BD) + override val hoverCyan: Color = Color(0xFF0066BD) - override val hoverGray: Color = Color(0xFF636363) + override val hoverGray: Color = Color(0xFF636363) - override val hoverGreen: Color = Color(0xFF11742F) + override val hoverGreen: Color = Color(0xFF11742F) - override val hoverMagenta: Color = Color(0xFFBF1D63) + override val hoverMagenta: Color = Color(0xFFBF1D63) - override val hoverPurple: Color = Color(0xFF7C3DD6) + override val hoverPurple: Color = Color(0xFF7C3DD6) - override val hoverRed: Color = Color(0xFFC21E25) + override val hoverRed: Color = Color(0xFFC21E25) - override val hoverTeal: Color = Color(0xFF007070) + override val hoverTeal: Color = Color(0xFF007070) - override val hoverWarmGray: Color = Color(0xFF696363) + override val hoverWarmGray: Color = Color(0xFF696363) } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/tag/TagColors.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/tag/TagColors.kt index f4a141f5..a8d4c5ee 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/tag/TagColors.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/tag/TagColors.kt @@ -11,213 +11,213 @@ import androidx.compose.ui.graphics.Color */ @Immutable public interface TagColors { - /** - * Blue tag background. - */ - public val backgroundBlue: Color - - /** - * Cool gray tag background. - */ - public val backgroundCoolGray: Color - - /** - * Cyan tag background. - */ - public val backgroundCyan: Color - - /** - * Gray tag background. - */ - public val backgroundGray: Color - - /** - * Green tag background. - */ - public val backgroundGreen: Color - - /** - * Magenta tag background. - */ - public val backgroundMagenta: Color - - /** - * Purple tag background. - */ - public val backgroundPurple: Color - - /** - * Red tag background. - */ - public val backgroundRed: Color - - /** - * Teal tag background. - */ - public val backgroundTeal: Color - - /** - * Warm gray tag background. - */ - public val backgroundWarmGray: Color - - /** - * Blue tag border for operational tag. - */ - public val borderBlue: Color - - /** - * Cool gray tag border for operational tag. - */ - public val borderCoolGray: Color - - /** - * Cyan tag border for operational tag. - */ - public val borderCyan: Color - - /** - * Gray tag border for operational tag. - */ - public val borderGray: Color - - /** - * Green tag border for operational tag. - */ - public val borderGreen: Color - - /** - * Magenta tag border for operational tag. - */ - public val borderMagenta: Color - - /** - * Purple tag border for operational tag. - */ - public val borderPurple: Color - - /** - * Red tag border for operational tag. - */ - public val borderRed: Color - - /** - * Teal tag border for operational tag. - */ - public val borderTeal: Color - - /** - * Warm gray tag border for operational tag. - */ - public val borderWarmGray: Color - - /** - * Blue tag text. - * Blue tag icon. - */ - public val colorBlue: Color - - /** - * Cool gray tag text. - * Cool gray tag icon. - */ - public val colorCoolGray: Color - - /** - * Cyan tag text. - * Cyan tag icon. - */ - public val colorCyan: Color - - /** - * Gray tag text. - * Gray tag icon. - */ - public val colorGray: Color - - /** - * Green tag text. - * Green tag icon. - */ - public val colorGreen: Color - - /** - * Magenta tag text. - * Magenta tag icon. - */ - public val colorMagenta: Color - - /** - * Purple tag text. - * Purple tag icon. - */ - public val colorPurple: Color - - /** - * Red tag text. - * Red tag icon. - */ - public val colorRed: Color - - /** - * Teal tag text. - * Teal tag icon. - */ - public val colorTeal: Color - - /** - * Warm gray tag text. - * Warm gray tag icon. - */ - public val colorWarmGray: Color - - /** - * Blue tag hover for [tagBackgroundBlue]. - */ - public val hoverBlue: Color - - /** - * Cool gray tag hover for [tagBackgroundCoolGray]. - */ - public val hoverCoolGray: Color - - /** - * Cyan tag hover for [tagBackgroundCyan]. - */ - public val hoverCyan: Color - - /** - * Gray tag hover for [tagBackgroundGray]. - */ - public val hoverGray: Color - - /** - * Green tag hover for [tagBackgroundGreen]. - */ - public val hoverGreen: Color - - /** - * Magenta tag hover for [tagBackgroundMagenta]. - */ - public val hoverMagenta: Color - - /** - * Purple tag hover for [tagBackgroundPurple]. - */ - public val hoverPurple: Color - - /** - * Red tag hover for [tagBackgroundRed]. - */ - public val hoverRed: Color - - /** - * Teal tag hover for [tagBackgroundTeal]. - */ - public val hoverTeal: Color - - /** - * Warm gray tag hover for [tagBackgroundWarmGray]. - */ - public val hoverWarmGray: Color + /** + * Blue tag background. + */ + public val backgroundBlue: Color + + /** + * Cool gray tag background. + */ + public val backgroundCoolGray: Color + + /** + * Cyan tag background. + */ + public val backgroundCyan: Color + + /** + * Gray tag background. + */ + public val backgroundGray: Color + + /** + * Green tag background. + */ + public val backgroundGreen: Color + + /** + * Magenta tag background. + */ + public val backgroundMagenta: Color + + /** + * Purple tag background. + */ + public val backgroundPurple: Color + + /** + * Red tag background. + */ + public val backgroundRed: Color + + /** + * Teal tag background. + */ + public val backgroundTeal: Color + + /** + * Warm gray tag background. + */ + public val backgroundWarmGray: Color + + /** + * Blue tag border for operational tag. + */ + public val borderBlue: Color + + /** + * Cool gray tag border for operational tag. + */ + public val borderCoolGray: Color + + /** + * Cyan tag border for operational tag. + */ + public val borderCyan: Color + + /** + * Gray tag border for operational tag. + */ + public val borderGray: Color + + /** + * Green tag border for operational tag. + */ + public val borderGreen: Color + + /** + * Magenta tag border for operational tag. + */ + public val borderMagenta: Color + + /** + * Purple tag border for operational tag. + */ + public val borderPurple: Color + + /** + * Red tag border for operational tag. + */ + public val borderRed: Color + + /** + * Teal tag border for operational tag. + */ + public val borderTeal: Color + + /** + * Warm gray tag border for operational tag. + */ + public val borderWarmGray: Color + + /** + * Blue tag text. + * Blue tag icon. + */ + public val colorBlue: Color + + /** + * Cool gray tag text. + * Cool gray tag icon. + */ + public val colorCoolGray: Color + + /** + * Cyan tag text. + * Cyan tag icon. + */ + public val colorCyan: Color + + /** + * Gray tag text. + * Gray tag icon. + */ + public val colorGray: Color + + /** + * Green tag text. + * Green tag icon. + */ + public val colorGreen: Color + + /** + * Magenta tag text. + * Magenta tag icon. + */ + public val colorMagenta: Color + + /** + * Purple tag text. + * Purple tag icon. + */ + public val colorPurple: Color + + /** + * Red tag text. + * Red tag icon. + */ + public val colorRed: Color + + /** + * Teal tag text. + * Teal tag icon. + */ + public val colorTeal: Color + + /** + * Warm gray tag text. + * Warm gray tag icon. + */ + public val colorWarmGray: Color + + /** + * Blue tag hover for [tagBackgroundBlue]. + */ + public val hoverBlue: Color + + /** + * Cool gray tag hover for [tagBackgroundCoolGray]. + */ + public val hoverCoolGray: Color + + /** + * Cyan tag hover for [tagBackgroundCyan]. + */ + public val hoverCyan: Color + + /** + * Gray tag hover for [tagBackgroundGray]. + */ + public val hoverGray: Color + + /** + * Green tag hover for [tagBackgroundGreen]. + */ + public val hoverGreen: Color + + /** + * Magenta tag hover for [tagBackgroundMagenta]. + */ + public val hoverMagenta: Color + + /** + * Purple tag hover for [tagBackgroundPurple]. + */ + public val hoverPurple: Color + + /** + * Red tag hover for [tagBackgroundRed]. + */ + public val hoverRed: Color + + /** + * Teal tag hover for [tagBackgroundTeal]. + */ + public val hoverTeal: Color + + /** + * Warm gray tag hover for [tagBackgroundWarmGray]. + */ + public val hoverWarmGray: Color } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/tag/WhiteTagColors.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/tag/WhiteTagColors.kt index f05dfdc7..9ff81ddc 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/tag/WhiteTagColors.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/color/tag/WhiteTagColors.kt @@ -11,83 +11,83 @@ import androidx.compose.ui.graphics.Color */ @Immutable public object WhiteTagColors : TagColors { - override val backgroundBlue: Color = Color(0xFFD0E2FF) + override val backgroundBlue: Color = Color(0xFFD0E2FF) - override val backgroundCoolGray: Color = Color(0xFFDDE1E6) + override val backgroundCoolGray: Color = Color(0xFFDDE1E6) - override val backgroundCyan: Color = Color(0xFFBAE6FF) + override val backgroundCyan: Color = Color(0xFFBAE6FF) - override val backgroundGray: Color = Color(0xFFE0E0E0) + override val backgroundGray: Color = Color(0xFFE0E0E0) - override val backgroundGreen: Color = Color(0xFFA7F0BA) + override val backgroundGreen: Color = Color(0xFFA7F0BA) - override val backgroundMagenta: Color = Color(0xFFFFD6E8) + override val backgroundMagenta: Color = Color(0xFFFFD6E8) - override val backgroundPurple: Color = Color(0xFFE8DAFF) + override val backgroundPurple: Color = Color(0xFFE8DAFF) - override val backgroundRed: Color = Color(0xFFFFD7D9) + override val backgroundRed: Color = Color(0xFFFFD7D9) - override val backgroundTeal: Color = Color(0xFF9EF0F0) + override val backgroundTeal: Color = Color(0xFF9EF0F0) - override val backgroundWarmGray: Color = Color(0xFFE5E0DF) + override val backgroundWarmGray: Color = Color(0xFFE5E0DF) - override val borderBlue: Color = Color(0xFF78A9FF) + override val borderBlue: Color = Color(0xFF78A9FF) - override val borderCoolGray: Color = Color(0xFFA2A9B0) + override val borderCoolGray: Color = Color(0xFFA2A9B0) - override val borderCyan: Color = Color(0xFF33B1FF) + override val borderCyan: Color = Color(0xFF33B1FF) - override val borderGray: Color = Color(0xFFA8A8A8) + override val borderGray: Color = Color(0xFFA8A8A8) - override val borderGreen: Color = Color(0xFF42BE65) + override val borderGreen: Color = Color(0xFF42BE65) - override val borderMagenta: Color = Color(0xFFFF7EB6) + override val borderMagenta: Color = Color(0xFFFF7EB6) - override val borderPurple: Color = Color(0xFFBE95FF) + override val borderPurple: Color = Color(0xFFBE95FF) - override val borderRed: Color = Color(0xFFFF8389) + override val borderRed: Color = Color(0xFFFF8389) - override val borderTeal: Color = Color(0xFF08BDBA) + override val borderTeal: Color = Color(0xFF08BDBA) - override val borderWarmGray: Color = Color(0xFFADA8A8) + override val borderWarmGray: Color = Color(0xFFADA8A8) - override val colorBlue: Color = Color(0xFF0043CE) + override val colorBlue: Color = Color(0xFF0043CE) - override val colorCoolGray: Color = Color(0xFF121619) + override val colorCoolGray: Color = Color(0xFF121619) - override val colorCyan: Color = Color(0xFF00539A) + override val colorCyan: Color = Color(0xFF00539A) - override val colorGray: Color = Color(0xFF161616) + override val colorGray: Color = Color(0xFF161616) - override val colorGreen: Color = Color(0xFF0E6027) + override val colorGreen: Color = Color(0xFF0E6027) - override val colorMagenta: Color = Color(0xFF9F1853) + override val colorMagenta: Color = Color(0xFF9F1853) - override val colorPurple: Color = Color(0xFF6929C4) + override val colorPurple: Color = Color(0xFF6929C4) - override val colorRed: Color = Color(0xFFA2191F) + override val colorRed: Color = Color(0xFFA2191F) - override val colorTeal: Color = Color(0xFF005D5D) + override val colorTeal: Color = Color(0xFF005D5D) - override val colorWarmGray: Color = Color(0xFF171414) + override val colorWarmGray: Color = Color(0xFF171414) - override val hoverBlue: Color = Color(0xFFB8D3FF) + override val hoverBlue: Color = Color(0xFFB8D3FF) - override val hoverCoolGray: Color = Color(0xFFCDD3DA) + override val hoverCoolGray: Color = Color(0xFFCDD3DA) - override val hoverCyan: Color = Color(0xFF99DAFF) + override val hoverCyan: Color = Color(0xFF99DAFF) - override val hoverGray: Color = Color(0xFFD1D1D1) + override val hoverGray: Color = Color(0xFFD1D1D1) - override val hoverGreen: Color = Color(0xFF74E792) + override val hoverGreen: Color = Color(0xFF74E792) - override val hoverMagenta: Color = Color(0xFFFFBDDA) + override val hoverMagenta: Color = Color(0xFFFFBDDA) - override val hoverPurple: Color = Color(0xFFDCC7FF) + override val hoverPurple: Color = Color(0xFFDCC7FF) - override val hoverRed: Color = Color(0xFFFFC2C5) + override val hoverRed: Color = Color(0xFFFFC2C5) - override val hoverTeal: Color = Color(0xFF57E5E5) + override val hoverTeal: Color = Color(0xFF57E5E5) - override val hoverWarmGray: Color = Color(0xFFD8D0CF) + override val hoverWarmGray: Color = Color(0xFFD8D0CF) } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/interaction/FocusIndication.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/interaction/FocusIndication.kt index 3d1c2c33..c41fe20b 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/interaction/FocusIndication.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/interaction/FocusIndication.kt @@ -18,13 +18,8 @@ package com.gabrieldrn.carbon.foundation.interaction import androidx.compose.animation.core.FiniteAnimationSpec import androidx.compose.animation.core.snap -import androidx.compose.foundation.Indication -import androidx.compose.foundation.IndicationInstance -import androidx.compose.foundation.interaction.FocusInteraction +import androidx.compose.foundation.IndicationNodeFactory import androidx.compose.foundation.interaction.InteractionSource -import androidx.compose.runtime.Composable -import androidx.compose.runtime.LaunchedEffect -import androidx.compose.runtime.remember import androidx.compose.ui.geometry.Offset import androidx.compose.ui.geometry.Size import androidx.compose.ui.graphics.SolidColor @@ -32,19 +27,23 @@ import androidx.compose.ui.graphics.drawscope.ContentDrawScope import androidx.compose.ui.graphics.drawscope.DrawScope import androidx.compose.ui.graphics.drawscope.Stroke import androidx.compose.ui.graphics.drawscope.clipRect -import com.gabrieldrn.carbon.foundation.color.LocalCarbonTheme +import androidx.compose.ui.node.DelegatableNode import com.gabrieldrn.carbon.foundation.color.Theme -import kotlinx.coroutines.flow.filterIsInstance -internal open class FocusIndication : Indication { +/** + * Implements the basic focus indication from Carbon, consisting of a border (of the theme's focus + * color) with sharp corners and an inset that animates in and out when focus is gained or lost. + */ +internal open class FocusIndication(private val theme: Theme) : IndicationNodeFactory { internal open class DefaultFocusIndicationInstance( + interactionSource: InteractionSource, theme: Theme, - ) : FocusIndicationInstance(theme) { + ) : FocusIndicationInstance(interactionSource, theme) { override val focusAnimationSpec: FiniteAnimationSpec = snap() - override fun ContentDrawScope.drawIndication() { + override fun ContentDrawScope.draw() { drawContent() clipRect { drawFocus() } } @@ -84,24 +83,17 @@ internal open class FocusIndication : Indication { } } - @Composable - override fun rememberUpdatedInstance( - interactionSource: InteractionSource - ): IndicationInstance { - val theme = LocalCarbonTheme.current + override fun create(interactionSource: InteractionSource): DelegatableNode = + DefaultFocusIndicationInstance(interactionSource, theme) - val instance = remember(theme) { - DefaultFocusIndicationInstance(theme = theme) - } + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (other !is FocusIndication) return false - LaunchedEffect(interactionSource) { - interactionSource.interactions - .filterIsInstance() - .collect { interaction -> - instance.animateFocus(this, interaction) - } - } + if (theme != other.theme) return false - return instance + return true } + + override fun hashCode(): Int = theme.hashCode() } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/interaction/FocusIndicationInstance.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/interaction/FocusIndicationInstance.kt index 3922e154..b41e5638 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/interaction/FocusIndicationInstance.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/interaction/FocusIndicationInstance.kt @@ -18,19 +18,24 @@ package com.gabrieldrn.carbon.foundation.interaction import androidx.compose.animation.core.Animatable import androidx.compose.animation.core.FiniteAnimationSpec -import androidx.compose.foundation.IndicationInstance import androidx.compose.foundation.interaction.FocusInteraction +import androidx.compose.foundation.interaction.InteractionSource import androidx.compose.runtime.Stable import androidx.compose.runtime.derivedStateOf import androidx.compose.runtime.referentialEqualityPolicy +import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color +import androidx.compose.ui.node.DrawModifierNode import androidx.compose.ui.unit.dp import com.gabrieldrn.carbon.foundation.color.Theme -import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.flow.filterIsInstance import kotlinx.coroutines.launch @Stable -internal abstract class FocusIndicationInstance(theme: Theme) : IndicationInstance { +internal abstract class FocusIndicationInstance( + protected val interactionSource: InteractionSource, + theme: Theme +) : Modifier.Node(), DrawModifierNode { protected val borderFocusWidth = 2f.dp protected val insetFocusWidth = 1f.dp @@ -61,12 +66,19 @@ internal abstract class FocusIndicationInstance(theme: Theme) : IndicationInstan } } - fun animateFocus(scope: CoroutineScope, interaction: FocusInteraction) { - scope.launch { - focusAnimation.animateTo( - targetValue = if (interaction is FocusInteraction.Focus) 1f else 0f, - animationSpec = focusAnimationSpec - ) + private suspend fun animateFocus(interaction: FocusInteraction) { + focusAnimation.animateTo( + targetValue = if (interaction is FocusInteraction.Focus) 1f else 0f, + animationSpec = focusAnimationSpec + ) + } + + override fun onAttach() { + coroutineScope.launch { + interactionSource.interactions.filterIsInstance() + .collect { interaction -> + animateFocus(interaction) + } } } } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/interaction/ToggleableFocusIndication.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/interaction/ToggleableFocusIndication.kt index 76391c8c..7cb6027c 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/interaction/ToggleableFocusIndication.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/foundation/interaction/ToggleableFocusIndication.kt @@ -17,36 +17,34 @@ package com.gabrieldrn.carbon.foundation.interaction import androidx.compose.animation.core.snap -import androidx.compose.foundation.Indication -import androidx.compose.foundation.IndicationInstance -import androidx.compose.foundation.interaction.FocusInteraction +import androidx.compose.foundation.IndicationNodeFactory import androidx.compose.foundation.interaction.InteractionSource -import androidx.compose.runtime.Composable -import androidx.compose.runtime.LaunchedEffect -import androidx.compose.runtime.remember import androidx.compose.ui.geometry.CornerRadius import androidx.compose.ui.geometry.Size import androidx.compose.ui.graphics.SolidColor import androidx.compose.ui.graphics.drawscope.ContentDrawScope import androidx.compose.ui.graphics.drawscope.Stroke import androidx.compose.ui.graphics.drawscope.inset +import androidx.compose.ui.node.DelegatableNode import androidx.compose.ui.unit.Dp -import com.gabrieldrn.carbon.foundation.color.LocalCarbonTheme import com.gabrieldrn.carbon.foundation.color.Theme -import kotlinx.coroutines.flow.filterIsInstance -internal class ToggleableFocusIndication(val indicationCorderRadius: Dp) : Indication { +internal class ToggleableFocusIndication( + private val theme: Theme, + val indicationCornerRadius: Dp +) : IndicationNodeFactory { private inner class ToggleableIndicationInstance( + interactionSource: InteractionSource, theme: Theme - ) : FocusIndicationInstance(theme) { + ) : FocusIndicationInstance(interactionSource, theme) { // From React implementation, focus animation is immediate on toggleable components. // e.g. https://react.carbondesignsystem.com/?path=/docs/components-toggle--overview // This also applies to checkboxes and radio buttons. override val focusAnimationSpec = snap() - override fun ContentDrawScope.drawIndication() { + override fun ContentDrawScope.draw() { val borderStrokeWidthPx = borderFocusWidth.toPx() val insetWidthPx = insetFocusWidth.toPx() @@ -60,7 +58,7 @@ internal class ToggleableFocusIndication(val indicationCorderRadius: Dp) : Indic inset(-borderStrokeWidthPx * .5f - insetWidthPx) { drawRoundRect( brush = SolidColor(borderFocusColorState.value), - cornerRadius = CornerRadius(indicationCorderRadius.toPx()), + cornerRadius = CornerRadius(indicationCornerRadius.toPx()), size = borderSize, style = Stroke(borderStrokeWidthPx) ) @@ -68,24 +66,22 @@ internal class ToggleableFocusIndication(val indicationCorderRadius: Dp) : Indic } } - @Composable - override fun rememberUpdatedInstance( - interactionSource: InteractionSource - ): IndicationInstance { - val theme = LocalCarbonTheme.current + override fun create(interactionSource: InteractionSource): DelegatableNode = + ToggleableIndicationInstance(interactionSource, theme) - val instance = remember(theme) { - ToggleableIndicationInstance(theme = theme) - } + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (other !is ToggleableFocusIndication) return false - LaunchedEffect(interactionSource) { - interactionSource.interactions - .filterIsInstance() - .collect { interaction -> - instance.animateFocus(this, interaction) - } - } + if (theme != other.theme) return false + if (indicationCornerRadius != other.indicationCornerRadius) return false + + return true + } - return instance + override fun hashCode(): Int { + var result = theme.hashCode() + result = 31 * result + indicationCornerRadius.hashCode() + return result } } diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/radiobutton/RadioButton.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/radiobutton/RadioButton.kt index d6e82a40..4b275192 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/radiobutton/RadioButton.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/radiobutton/RadioButton.kt @@ -33,10 +33,10 @@ import androidx.compose.ui.platform.testTag import androidx.compose.ui.semantics.Role import androidx.compose.ui.unit.dp import com.gabrieldrn.carbon.Carbon -import com.gabrieldrn.carbon.foundation.interaction.ToggleableFocusIndication import com.gabrieldrn.carbon.common.selectable.ErrorContent import com.gabrieldrn.carbon.common.selectable.SelectableInteractiveState import com.gabrieldrn.carbon.common.selectable.WarningContent +import com.gabrieldrn.carbon.foundation.interaction.ToggleableFocusIndication import com.gabrieldrn.carbon.foundation.spacing.SpacingScale import com.gabrieldrn.carbon.foundation.text.Text import com.gabrieldrn.carbon.semantics.readOnly @@ -102,7 +102,10 @@ public fun RadioButton( selected = selected, modifier = Modifier.indication( interactionSource = interactionSource, - indication = ToggleableFocusIndication(RadioButtonSize) + indication = ToggleableFocusIndication( + theme = Carbon.theme, + indicationCornerRadius = RadioButtonSize + ) ) ) Text( diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/textinput/PasswordInput.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/textinput/PasswordInput.kt index 492a5f85..8d866d29 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/textinput/PasswordInput.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/textinput/PasswordInput.kt @@ -51,7 +51,7 @@ import com.gabrieldrn.carbon.semantics.imageVectorName * [KeyboardType.Password]. */ public val PasswordKeyboardOptions: KeyboardOptions = KeyboardOptions.Default.copy( - autoCorrect = false, + autoCorrectEnabled = false, keyboardType = KeyboardType.Password ) diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/textinput/TextInput.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/textinput/TextInput.kt index 4f8def00..f41fc4a5 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/textinput/TextInput.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/textinput/TextInput.kt @@ -222,7 +222,7 @@ internal fun TextInputField( modifier = modifier .indication( interactionSource = interactionSource, - indication = FocusIndication() + indication = FocusIndication(Carbon.theme) ) .focusable( enabled = state.isFocusable, diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/toggle/Toggle.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/toggle/Toggle.kt index 368af6f0..ab77b5d9 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/toggle/Toggle.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/toggle/Toggle.kt @@ -46,8 +46,6 @@ import androidx.compose.ui.graphics.drawscope.translate import androidx.compose.ui.graphics.vector.VectorPainter import androidx.compose.ui.graphics.vector.rememberVectorPainter import androidx.compose.ui.platform.LocalDensity -import androidx.compose.ui.platform.debugInspectorInfo -import androidx.compose.ui.platform.inspectable import androidx.compose.ui.semantics.Role import androidx.compose.ui.state.ToggleableState import androidx.compose.ui.unit.dp @@ -186,35 +184,27 @@ private fun ToggleImpl( isReadOnly: Boolean = false, colors: ToggleColors = ToggleColors.colors() ) { - val toggleModifier = when { - isReadOnly -> Modifier.readOnly( - role = Role.Switch, - interactionSource = interactionSource, - state = ToggleableState(isToggled), - mergeDescendants = true - ) - onToggleChange != null -> Modifier.toggleable( - value = isToggled, - onValueChange = { onToggleChange(!isToggled) }, - enabled = isEnabled, - interactionSource = interactionSource, - indication = null, - role = Role.Switch - ) - else -> Modifier - } + val toggleModifier = Modifier.then( + when { + isReadOnly -> Modifier.readOnly( + role = Role.Switch, + interactionSource = interactionSource, + state = ToggleableState(isToggled), + mergeDescendants = true + ) + onToggleChange != null -> Modifier.toggleable( + value = isToggled, + onValueChange = { onToggleChange(!isToggled) }, + enabled = isEnabled, + interactionSource = interactionSource, + indication = null, + role = Role.Switch + ) + else -> Modifier + } + ) - Column( - modifier = Modifier - .inspectable( - debugInspectorInfo { - properties["toggleType"] = when (toggleType) { - ToggleType.Default -> "Default" - ToggleType.Small -> "Small" - } - } - ) { modifier.then(toggleModifier) } - ) { + Column(modifier = modifier.then(toggleModifier)) { if (label.isNotEmpty()) { Text( text = label, @@ -256,9 +246,13 @@ private fun ToggleCanvas( interactionSource: MutableInteractionSource, ) { val density = LocalDensity.current + val theme = Carbon.theme val indication = remember { - ToggleableFocusIndication(toggleType.height) + ToggleableFocusIndication( + theme = theme, + indicationCornerRadius = toggleType.height + ) } val toggleDrawValues = remember(toggleType) { diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/toggle/ToggleColors.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/toggle/ToggleColors.kt index ecbb6188..5d109033 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/toggle/ToggleColors.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/toggle/ToggleColors.kt @@ -29,6 +29,7 @@ import com.gabrieldrn.carbon.foundation.color.Theme * Colors to be used by a [Toggle] based on its state. */ @Immutable +@ConsistentCopyVisibility internal data class ToggleColors private constructor( val theme: Theme, val layer: Layer diff --git a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/uishell/UIShellHeader.kt b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/uishell/UIShellHeader.kt index 02c8de3d..2a3959aa 100644 --- a/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/uishell/UIShellHeader.kt +++ b/carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/uishell/UIShellHeader.kt @@ -21,6 +21,7 @@ import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.RowScope import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.WindowInsets import androidx.compose.foundation.layout.WindowInsetsSides @@ -43,6 +44,8 @@ import androidx.compose.ui.unit.dp import com.gabrieldrn.carbon.Carbon import com.gabrieldrn.carbon.CarbonDesignSystem import com.gabrieldrn.carbon.api.ExperimentalCarbonApi +import com.gabrieldrn.carbon.button.ButtonType +import com.gabrieldrn.carbon.button.IconButton import com.gabrieldrn.carbon.foundation.color.LocalCarbonInlineTheme import com.gabrieldrn.carbon.foundation.color.LocalCarbonTheme import com.gabrieldrn.carbon.foundation.color.Theme @@ -54,6 +57,7 @@ public fun UiShellHeader( headerName: String, modifier: Modifier = Modifier, menuIconPainter: Painter? = null, + actions: @Composable RowScope.() -> Unit = {}, onMenuIconPressed: () -> Unit = {}, windowInsets: WindowInsets = WindowInsets.statusBars.only(WindowInsetsSides.Top), inlineTheme: Theme = LocalCarbonInlineTheme.current, @@ -75,9 +79,10 @@ public fun UiShellHeader( verticalAlignment = Alignment.CenterVertically, ) { if (menuIconPainter != null) { - MenuButton( - onMenuIconPressed = onMenuIconPressed, - menuIconPainter = menuIconPainter + IconButton( + onClick = onMenuIconPressed, + iconPainter = menuIconPainter, + buttonType = ButtonType.Ghost, ) Spacer(modifier = Modifier.width(SpacingScale.spacing03)) } else { @@ -87,9 +92,13 @@ public fun UiShellHeader( BasicText( text = headerName, style = Carbon.typography.headingCompact02.copy( - color = LocalCarbonTheme.current.textPrimary + color = Carbon.theme.textPrimary ), - modifier = Modifier + modifier = Modifier.weight(1f) + ) + + Row( + content = actions, ) } Box( diff --git a/carbon/src/commonTest/kotlin/com/gabrieldrn/carbon/button/ButtonColorsTest.kt b/carbon/src/commonTest/kotlin/com/gabrieldrn/carbon/button/ButtonColorsTest.kt index bd12a23e..dd2ea6b6 100644 --- a/carbon/src/commonTest/kotlin/com/gabrieldrn/carbon/button/ButtonColorsTest.kt +++ b/carbon/src/commonTest/kotlin/com/gabrieldrn/carbon/button/ButtonColorsTest.kt @@ -27,8 +27,11 @@ class ButtonColorsTest : BaseColorsTest() { @Suppress("CognitiveComplexMethod", "CyclomaticComplexMethod", "LongMethod") @Test fun buttonColors_static_colorsAreCorrect() = runComposeUiTest { - forAllLayersAndStates(ButtonType.entries) { buttonType, _ -> - val colors = ButtonColors.colors(buttonType = buttonType) + forAllLayersAndStates( + ButtonType.entries, + listOf(true, false) + ) { buttonType, isIconButton, _ -> + val colors = ButtonColors.colors(buttonType = buttonType, isIconButton = isIconButton) assertEquals( expected = when (buttonType) { @@ -145,31 +148,43 @@ class ButtonColorsTest : BaseColorsTest() { ) assertEquals( - expected = when (buttonType) { - ButtonType.Tertiary -> theme.buttonTertiary - ButtonType.Ghost -> theme.linkPrimary - ButtonType.PrimaryDanger -> theme.iconOnColor - ButtonType.TertiaryDanger, - ButtonType.GhostDanger -> theme.buttonDangerSecondary - else -> theme.iconOnColor + expected = if (isIconButton) { + theme.iconPrimary + } else { + when (buttonType) { + ButtonType.Tertiary -> theme.buttonTertiary + ButtonType.Ghost -> theme.linkPrimary + ButtonType.PrimaryDanger -> theme.iconOnColor + ButtonType.TertiaryDanger, + ButtonType.GhostDanger -> theme.buttonDangerSecondary + else -> theme.iconOnColor + } }, actual = colors.iconColor ) assertEquals( - expected = when (buttonType) { - ButtonType.Tertiary -> theme.iconInverse - ButtonType.Ghost -> theme.linkPrimary - else -> theme.iconOnColor + expected = if (isIconButton) { + theme.iconPrimary + } else { + when (buttonType) { + ButtonType.Tertiary -> theme.iconInverse + ButtonType.Ghost -> theme.linkPrimary + else -> theme.iconOnColor + } }, actual = colors.iconActiveColor ) assertEquals( - expected = when (buttonType) { - ButtonType.Tertiary -> theme.iconInverse - ButtonType.Ghost -> theme.linkPrimaryHover - else -> theme.iconOnColor + expected = if (isIconButton) { + theme.iconPrimary + } else { + when (buttonType) { + ButtonType.Tertiary -> theme.iconInverse + ButtonType.Ghost -> theme.linkPrimaryHover + else -> theme.iconOnColor + } }, actual = colors.iconHoverColor ) diff --git a/carbon/src/commonTest/kotlin/com/gabrieldrn/carbon/dropdown/DropdownFieldTest.kt b/carbon/src/commonTest/kotlin/com/gabrieldrn/carbon/dropdown/DropdownFieldTest.kt index ea953b1c..320c413c 100644 --- a/carbon/src/commonTest/kotlin/com/gabrieldrn/carbon/dropdown/DropdownFieldTest.kt +++ b/carbon/src/commonTest/kotlin/com/gabrieldrn/carbon/dropdown/DropdownFieldTest.kt @@ -17,7 +17,7 @@ package com.gabrieldrn.carbon.dropdown import androidx.compose.animation.core.MutableTransitionState -import androidx.compose.animation.core.updateTransition +import androidx.compose.animation.core.rememberTransition import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember @@ -30,7 +30,6 @@ import androidx.compose.ui.test.assertHeightIsEqualTo import androidx.compose.ui.test.assertIsDisplayed import androidx.compose.ui.test.assertIsFocused import androidx.compose.ui.test.assertIsNotEnabled -import androidx.compose.ui.test.assertLeftPositionInRootIsEqualTo import androidx.compose.ui.test.assertWidthIsEqualTo import androidx.compose.ui.test.getUnclippedBoundsInRoot import androidx.compose.ui.test.isFocusable @@ -71,7 +70,7 @@ open class DropdownFieldTest { open fun ComposeUiTest.setup() { setContent { val expandedStates = remember { MutableTransitionState(false) } - val transition = updateTransition(expandedStates, "Dropdown") + val transition = rememberTransition(expandedStates, "Dropdown") CarbonDesignSystem(WhiteTheme) { val colors = DropdownColors.colors() @@ -147,42 +146,52 @@ open class DropdownFieldTest { open fun onLayoutValidationGetFieldContentWidths( testScope: ComposeUiTest, state: DropdownInteractiveState, - contentWidths: MutableList + contentWidths: MutableMap ): Unit = with(testScope) { - contentWidths.add( + contentWidths[DropdownTestTags.FIELD_PLACEHOLDER] = onNodeWithTag( DropdownTestTags.FIELD_PLACEHOLDER, useUnmergedTree = true ).getUnclippedBoundsInRoot().width - ) - contentWidths.add( + contentWidths[DropdownTestTags.FIELD_CHEVRON] = onNodeWithTag( DropdownTestTags.FIELD_CHEVRON, useUnmergedTree = true ).getUnclippedBoundsInRoot().width - ) + + if (state != DropdownInteractiveState.Disabled) { + // Somehow the padding is not included in the width for the disabled state, but the + // rendered width is correct. + contentWidths["Horizontal padding"] = SpacingScale.spacing05 * 2 + } when (state) { is DropdownInteractiveState.Enabled, is DropdownInteractiveState.ReadOnly, is DropdownInteractiveState.Disabled -> - contentWidths.add(SpacingScale.spacing05) // Chevron padding + contentWidths["Chevron padding"] = SpacingScale.spacing05 // Chevron padding is DropdownInteractiveState.Warning -> onNodeWithTag(DropdownTestTags.FIELD_WARNING_ICON, useUnmergedTree = true) .assertIsDisplayed() .also { - contentWidths.add(it.getUnclippedBoundsInRoot().width) - contentWidths.add(SpacingScale.spacing03 * 2) // Horizontal padding + contentWidths[DropdownTestTags.FIELD_WARNING_ICON] = + it.getUnclippedBoundsInRoot().width + // Horizontal padding + contentWidths[DropdownTestTags.FIELD_WARNING_ICON + "_hz_padding"] = + SpacingScale.spacing03 * 2 } is DropdownInteractiveState.Error -> onNodeWithTag(DropdownTestTags.FIELD_ERROR_ICON, useUnmergedTree = true) .assertIsDisplayed() .also { - contentWidths.add(it.getUnclippedBoundsInRoot().width) - contentWidths.add(SpacingScale.spacing03 * 2) // Horizontal padding + contentWidths[DropdownTestTags.FIELD_ERROR_ICON] = + it.getUnclippedBoundsInRoot().width + // Horizontal padding + contentWidths[DropdownTestTags.FIELD_ERROR_ICON + "_hz_padding"] = + SpacingScale.spacing03 * 2 } } } @@ -190,16 +199,20 @@ open class DropdownFieldTest { @Test fun dropdownField_validateLayout() = runComposeUiTest { setup() - val contentWidths = mutableListOf() + val contentWidths = mutableMapOf() interactiveStates.forEach { + println("state = $it") state = it onLayoutValidationGetFieldContentWidths(this, state, contentWidths) + val totalExpectedWidth = contentWidths.values.reduce(Dp::plus) + + println("Widths = $contentWidths, total = $totalExpectedWidth") + onNodeWithTag(DropdownTestTags.FIELD, useUnmergedTree = true) - .assertLeftPositionInRootIsEqualTo(SpacingScale.spacing05) - .assertWidthIsEqualTo(contentWidths.reduce(Dp::plus)) + .assertWidthIsEqualTo(expectedWidth = totalExpectedWidth) contentWidths.clear() } diff --git a/carbon/src/commonTest/kotlin/com/gabrieldrn/carbon/dropdown/MultiselectDropdownFieldTest.kt b/carbon/src/commonTest/kotlin/com/gabrieldrn/carbon/dropdown/MultiselectDropdownFieldTest.kt index a20e06d2..f825b985 100644 --- a/carbon/src/commonTest/kotlin/com/gabrieldrn/carbon/dropdown/MultiselectDropdownFieldTest.kt +++ b/carbon/src/commonTest/kotlin/com/gabrieldrn/carbon/dropdown/MultiselectDropdownFieldTest.kt @@ -17,7 +17,7 @@ package com.gabrieldrn.carbon.dropdown import androidx.compose.animation.core.MutableTransitionState -import androidx.compose.animation.core.updateTransition +import androidx.compose.animation.core.rememberTransition import androidx.compose.runtime.remember import androidx.compose.ui.test.ComposeUiTest import androidx.compose.ui.test.assertHasClickAction @@ -46,7 +46,7 @@ class MultiselectDropdownFieldTest : DropdownFieldTest() { override fun ComposeUiTest.setup() { setContent { val expandedStates = remember { MutableTransitionState(false) } - val transition = updateTransition(expandedStates, "Dropdown") + val transition = rememberTransition(expandedStates, "Dropdown") CarbonDesignSystem(WhiteTheme) { val colors = DropdownColors.colors() @@ -92,15 +92,14 @@ class MultiselectDropdownFieldTest : DropdownFieldTest() { override fun onLayoutValidationGetFieldContentWidths( testScope: ComposeUiTest, state: DropdownInteractiveState, - contentWidths: MutableList + contentWidths: MutableMap ) { super.onLayoutValidationGetFieldContentWidths(testScope, state, contentWidths) - contentWidths.add( + contentWidths[DropdownTestTags.FIELD_MULTISELECT_TAG] = testScope.onNodeWithTag(DropdownTestTags.FIELD_MULTISELECT_TAG, useUnmergedTree = true) .getUnclippedBoundsInRoot() .width - ) } @Test diff --git a/catalog/build.gradle.kts b/catalog/build.gradle.kts index d269b48f..1cb46d2f 100644 --- a/catalog/build.gradle.kts +++ b/catalog/build.gradle.kts @@ -32,6 +32,12 @@ kotlin { implementation(compose.components.resources) implementation(libs.androidx.navigation.compose) + implementation(libs.koin) + implementation(libs.koin.compose) + implementation(libs.settings) + implementation(libs.settings.noArg) + implementation(libs.settings.coroutines) + implementation(libs.settings.makeObservable) } androidMain.dependencies { @@ -42,6 +48,8 @@ kotlin { desktopMain.dependencies { implementation(compose.desktop.currentOs) + + implementation(libs.kotlinx.coroutines.swing) } } } diff --git a/catalog/src/androidMain/kotlin/com/gabrieldrn/carbon/catalog/CatalogApplication.kt b/catalog/src/androidMain/kotlin/com/gabrieldrn/carbon/catalog/CatalogApplication.kt index 385a1a2d..3cfe8be0 100644 --- a/catalog/src/androidMain/kotlin/com/gabrieldrn/carbon/catalog/CatalogApplication.kt +++ b/catalog/src/androidMain/kotlin/com/gabrieldrn/carbon/catalog/CatalogApplication.kt @@ -17,6 +17,8 @@ package com.gabrieldrn.carbon.catalog import android.app.Application +import com.gabrieldrn.carbon.catalog.di.appModule +import org.koin.core.context.startKoin import timber.log.Timber @Suppress("UndocumentedPublicClass") @@ -25,5 +27,9 @@ class CatalogApplication : Application() { override fun onCreate() { super.onCreate() Timber.plant(Timber.DebugTree()) + + startKoin { + modules(appModule()) + } } } diff --git a/catalog/src/commonMain/composeResources/drawable/ic_settings.xml b/catalog/src/commonMain/composeResources/drawable/ic_settings.xml new file mode 100644 index 00000000..f8e872da --- /dev/null +++ b/catalog/src/commonMain/composeResources/drawable/ic_settings.xml @@ -0,0 +1,28 @@ + + + + + + diff --git a/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/Catalog.kt b/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/Catalog.kt index 622548f2..148cbf9c 100644 --- a/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/Catalog.kt +++ b/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/Catalog.kt @@ -29,8 +29,9 @@ import androidx.compose.ui.platform.LocalUriHandler import androidx.navigation.compose.NavHost import androidx.navigation.compose.rememberNavController import com.gabrieldrn.carbon.api.ExperimentalCarbonApi +import com.gabrieldrn.carbon.button.ButtonType +import com.gabrieldrn.carbon.button.IconButton import com.gabrieldrn.carbon.catalog.BaseDestination.Companion.eq -import com.gabrieldrn.carbon.catalog.dropdown.DropdownNavDestination import com.gabrieldrn.carbon.catalog.theme.CarbonCatalogTheme import com.gabrieldrn.carbon.foundation.color.containerBackground import com.gabrieldrn.carbon.uishell.UiShellHeader @@ -43,9 +44,7 @@ fun Catalog( layoutType: CatalogLayoutType = CatalogLayoutType.Vertical, ) { CarbonCatalogTheme { - val allDestinations = remember { - Destination.entries + DropdownNavDestination.entries - } + val allDestinations = remember { Destination.entries } var currentScreen: BaseDestination by remember { mutableStateOf(Destination.Home) @@ -76,6 +75,15 @@ fun Catalog( } else { null }, + actions = { + if (currentScreen != Destination.Settings) { + IconButton( + onClick = { navController.navigate(Destination.Settings.route) }, + iconPainter = painterResource(Res.drawable.ic_settings), + buttonType = ButtonType.Ghost, + ) + } + }, onMenuIconPressed = { navController.navigateUp() }, ) diff --git a/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/CatalogNavGraph.kt b/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/CatalogNavGraph.kt index 8b382e76..07da3de2 100644 --- a/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/CatalogNavGraph.kt +++ b/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/CatalogNavGraph.kt @@ -16,6 +16,7 @@ package com.gabrieldrn.carbon.catalog +import androidx.compose.animation.AnimatedContentTransitionScope import androidx.compose.animation.fadeIn import androidx.compose.animation.fadeOut import androidx.compose.animation.scaleIn @@ -24,10 +25,11 @@ import androidx.compose.animation.slideInHorizontally import androidx.compose.animation.slideOutHorizontally import androidx.compose.runtime.Composable import androidx.compose.runtime.remember +import androidx.navigation.NavBackStackEntry import androidx.navigation.NavHostController import androidx.navigation.compose.composable import androidx.navigation.createGraph -import com.gabrieldrn.carbon.catalog.dropdown.dropdownNavigation +import com.gabrieldrn.carbon.catalog.BaseDestination.Companion.eq import com.gabrieldrn.carbon.catalog.home.HomeScreen val navigationEnterScaleInTransition = @@ -48,41 +50,63 @@ val navigationExitSlideOutTransition = val navigationExitSlideOutInverseTransition = slideOutHorizontally(targetOffsetX = { -it }) + fadeOut() // right to left +val deadEndEnterTransition = navigationEnterSlideInTransition +val deadEndExitTransition = navigationExitSlideOutTransition + +fun AnimatedContentTransitionScope.getEnterTransition() = + if (initialState.destination eq Destination.Home) { + navigationEnterSlideInTransition + } else { + navigationEnterSlideInInverseTransition + } + +fun AnimatedContentTransitionScope.getExitTransition() = + if (targetState.destination eq Destination.Home) { + navigationExitSlideOutTransition + } else { + navigationExitSlideOutInverseTransition + } + @Composable fun rememberNavGraph( navController: NavHostController, onOpenLink: (String) -> Unit ) = remember(navController) { - navController.createGraph(startDestination = Destination.Home.route) { - Destination - .entries - .filterNot { it.route.isEmpty() } - .forEach { dest -> - when (dest) { - Destination.Home -> composable( - route = Destination.Home.route, - enterTransition = { navigationEnterScaleInTransition }, - exitTransition = { navigationExitScaleOutTransition }, - ) { - HomeScreen( - onTileClicked = { destination -> - destination.route - .takeIf { it.isNotEmpty() } - ?.let(navController::navigate) - }, - onOpenLink = onOpenLink - ) - } - - Destination.Dropdown -> dropdownNavigation(navController) - - else -> composable( - route = dest.route, - enterTransition = { navigationEnterSlideInTransition }, - exitTransition = { navigationExitSlideOutTransition }, - content = { dest.content() } + navController.createGraph(startDestination = Destination.Home.route) { + Destination + .entries + .filterNot { it.route.isEmpty() } + .forEach { dest -> + when (dest) { + Destination.Home -> composable( + route = Destination.Home.route, + enterTransition = { navigationEnterScaleInTransition }, + exitTransition = { navigationExitScaleOutTransition }, + ) { + HomeScreen( + onTileClicked = { destination -> + destination.route + .takeIf { it.isNotEmpty() } + ?.let(navController::navigate) + }, + onOpenLink = onOpenLink ) } + + Destination.Settings -> composable( + route = Destination.Settings.route, + enterTransition = { deadEndEnterTransition }, + exitTransition = { deadEndExitTransition }, + content = { dest.content() } + ) + + else -> composable( + route = dest.route, + enterTransition = { getEnterTransition() }, + exitTransition = { getExitTransition() }, + content = { dest.content() } + ) } - } + } } +} diff --git a/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/Destination.kt b/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/Destination.kt index 1e20bf68..2644ef5b 100644 --- a/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/Destination.kt +++ b/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/Destination.kt @@ -24,6 +24,7 @@ import com.gabrieldrn.carbon.catalog.dropdown.DropdownVariant import com.gabrieldrn.carbon.catalog.progressbar.ProgressBarDemoScreen import com.gabrieldrn.carbon.catalog.radiobutton.LoadingDemoScreen import com.gabrieldrn.carbon.catalog.radiobutton.RadioButtonDemoScreen +import com.gabrieldrn.carbon.catalog.settings.SettingsScreen import com.gabrieldrn.carbon.catalog.tag.TagDemoScreen import com.gabrieldrn.carbon.catalog.textinput.TextInputDemoScreen import com.gabrieldrn.carbon.catalog.toggle.ToggleDemoScreen @@ -41,6 +42,12 @@ enum class Destination( illustration = null, route = "home" ), + Settings( + title = "Settings", + illustration = null, + route = "settings", + content = { SettingsScreen() } + ), Accordion("Accordion"), Breadcrumb("Breadcrumb"), Button( @@ -62,7 +69,8 @@ enum class Destination( Dropdown( title = "Dropdown", illustration = Res.drawable.tile_dropdown, - route = "dropdown" + route = "dropdown", + content = { DropdownDemoScreen(DropdownVariant.Default) } ), FileUploader("File uploader"), Form("Form"), @@ -127,8 +135,10 @@ enum class Destination( UIShell("UI shell"); companion object { + private val nonComponentDestinations = setOf(Home, Settings) + val homeTilesDestinations = entries - .filterNot { it == Home } + .filterNot { it in nonComponentDestinations } // Show first the components that have a demo activity .sortedByDescending { it.route.isNotEmpty() } } diff --git a/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/common/ViewModel.kt b/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/common/ViewModel.kt new file mode 100644 index 00000000..f460c970 --- /dev/null +++ b/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/common/ViewModel.kt @@ -0,0 +1,36 @@ +/* + * Copyright 2024 Gabriel Derrien + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + Temp class to provide a ViewModel as androidx-lifecycle-viewmodel dependency is not available + for wasm target yet. + */ + +package com.gabrieldrn.carbon.catalog.common + +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.cancel +import kotlin.coroutines.CoroutineContext + +abstract class ViewModel : CoroutineScope { + + override val coroutineContext: CoroutineContext = Dispatchers.Main + + open fun clear() { + coroutineContext.cancel() + } +} diff --git a/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/di/KoinAppModule.kt b/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/di/KoinAppModule.kt new file mode 100644 index 00000000..c8be9a39 --- /dev/null +++ b/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/di/KoinAppModule.kt @@ -0,0 +1,21 @@ +/* + * Copyright 2024 Gabriel Derrien + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.gabrieldrn.carbon.catalog.di + +import com.gabrieldrn.carbon.catalog.settings.settingsModule + +fun appModule() = listOf(settingsModule) diff --git a/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/di/KoinExt.kt b/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/di/KoinExt.kt new file mode 100644 index 00000000..1645129d --- /dev/null +++ b/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/di/KoinExt.kt @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Gabriel Derrien + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.gabrieldrn.carbon.catalog.di + +import androidx.compose.runtime.Composable +import androidx.compose.runtime.DisposableEffect +import com.gabrieldrn.carbon.catalog.common.ViewModel +import org.koin.compose.currentKoinScope +import org.koin.compose.koinInject +import org.koin.core.parameter.ParametersDefinition +import org.koin.core.qualifier.Qualifier +import org.koin.core.scope.Scope + +@Composable +inline fun injectViewModel( + qualifier: Qualifier? = null, + scope: Scope = currentKoinScope(), + noinline parameters: ParametersDefinition? = null, +): T { + val viewModel = koinInject( + qualifier = qualifier, + scope = scope, + parameters = parameters, + ) + + DisposableEffect(Unit) { + onDispose { + viewModel.clear() + } + } + + return viewModel +} diff --git a/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/dropdown/DropdownHomeDemoScreen.kt b/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/dropdown/DropdownHomeDemoScreen.kt deleted file mode 100644 index f8cc9002..00000000 --- a/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/dropdown/DropdownHomeDemoScreen.kt +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2024 Gabriel Derrien - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.gabrieldrn.carbon.catalog.dropdown - -import androidx.compose.foundation.background -import androidx.compose.foundation.layout.Arrangement -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.padding -import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier -import com.gabrieldrn.carbon.button.Button -import com.gabrieldrn.carbon.catalog.Res -import com.gabrieldrn.carbon.catalog.ic_arrow_right -import com.gabrieldrn.carbon.foundation.color.LocalCarbonTheme -import com.gabrieldrn.carbon.foundation.spacing.SpacingScale -import org.jetbrains.compose.resources.painterResource - -@Composable -fun DropdownDemoMenu( - onNavigate: (String) -> Unit, - modifier: Modifier = Modifier, -) { - Column( - modifier = modifier - .background(LocalCarbonTheme.current.background) - .padding(SpacingScale.spacing05) - .fillMaxSize(), - verticalArrangement = Arrangement.spacedBy(SpacingScale.spacing03) - ) { - Button( - label = "Default Dropdown", - iconPainter = painterResource(Res.drawable.ic_arrow_right), - onClick = { onNavigate(DropdownNavDestination.Default.route) }, - modifier = Modifier.fillMaxWidth() - ) - Button( - label = "Multiselect Dropdown", - iconPainter = painterResource(Res.drawable.ic_arrow_right), - onClick = { onNavigate(DropdownNavDestination.MultiSelect.route) }, - modifier = Modifier.fillMaxWidth() - ) - } -} diff --git a/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/dropdown/DropdownNavDestination.kt b/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/dropdown/DropdownNavDestination.kt deleted file mode 100644 index 1d306876..00000000 --- a/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/dropdown/DropdownNavDestination.kt +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2024 Gabriel Derrien - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.gabrieldrn.carbon.catalog.dropdown - -import com.gabrieldrn.carbon.catalog.BaseDestination -import com.gabrieldrn.carbon.catalog.Destination -import org.jetbrains.compose.resources.DrawableResource - -@Suppress("UndocumentedPublicClass", "UndocumentedPublicProperty") -enum class DropdownNavDestination( - override val title: String, - val illustration: DrawableResource? = null, - override val route: String = "", -) : BaseDestination { - Home("Dropdown", null, "dropdown_home"), - Default("Dropdown", null, "dropdown/default"), - MultiSelect("Multi-select", null, Destination.MultiSelect.route), -} diff --git a/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/dropdown/DropdownNestedNavGraph.kt b/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/dropdown/DropdownNestedNavGraph.kt deleted file mode 100644 index e4446f76..00000000 --- a/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/dropdown/DropdownNestedNavGraph.kt +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2024 Gabriel Derrien - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.gabrieldrn.carbon.catalog.dropdown - -import androidx.navigation.NavController -import androidx.navigation.NavGraphBuilder -import androidx.navigation.compose.composable -import androidx.navigation.navigation -import com.gabrieldrn.carbon.catalog.BaseDestination.Companion.eq -import com.gabrieldrn.carbon.catalog.Destination -import com.gabrieldrn.carbon.catalog.navigationEnterSlideInInverseTransition -import com.gabrieldrn.carbon.catalog.navigationEnterSlideInTransition -import com.gabrieldrn.carbon.catalog.navigationExitSlideOutInverseTransition -import com.gabrieldrn.carbon.catalog.navigationExitSlideOutTransition - -fun NavGraphBuilder.dropdownNavigation( - navController: NavController -) = navigation( - startDestination = DropdownNavDestination.Home.route, - route = Destination.Dropdown.route -) { - composable( - route = DropdownNavDestination.Home.route, - enterTransition = { - if (targetState.destination eq DropdownNavDestination.Home) { - if (initialState.destination eq Destination.Home) { - navigationEnterSlideInTransition - } else { - navigationEnterSlideInInverseTransition - } - } else { - navigationEnterSlideInInverseTransition - } - }, - exitTransition = { - if (targetState.destination eq Destination.Home) { - navigationExitSlideOutTransition - } else { - navigationExitSlideOutInverseTransition - } - }, - ) { - DropdownDemoMenu(onNavigate = navController::navigate) - } - - composable( - route = DropdownNavDestination.Default.route, - enterTransition = { navigationEnterSlideInTransition }, - exitTransition = { navigationExitSlideOutTransition }, - ) { - DropdownDemoScreen(DropdownVariant.Default) - } - - composable( - route = DropdownNavDestination.MultiSelect.route, - enterTransition = { navigationEnterSlideInTransition }, - exitTransition = { navigationExitSlideOutTransition }, - ) { - DropdownDemoScreen(DropdownVariant.Multiselect) - } -} diff --git a/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/settings/SettingsModule.kt b/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/settings/SettingsModule.kt new file mode 100644 index 00000000..7d8ecbc3 --- /dev/null +++ b/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/settings/SettingsModule.kt @@ -0,0 +1,27 @@ +/* + * Copyright 2024 Gabriel Derrien + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.gabrieldrn.carbon.catalog.settings + +import com.gabrieldrn.carbon.catalog.settings.data.SettingsRepository +import org.koin.core.module.dsl.singleOf +import org.koin.dsl.module + +val settingsModule = module { + singleOf(::SettingsRepository) + + singleOf(::SettingsViewModel) +} diff --git a/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/settings/SettingsScreen.kt b/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/settings/SettingsScreen.kt new file mode 100644 index 00000000..9ca9f8c5 --- /dev/null +++ b/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/settings/SettingsScreen.kt @@ -0,0 +1,105 @@ +/* + * Copyright 2024 Gabriel Derrien + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.gabrieldrn.carbon.catalog.settings + +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.WindowInsets +import androidx.compose.foundation.layout.asPaddingValues +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.navigationBars +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.text.BasicText +import androidx.compose.foundation.verticalScroll +import androidx.compose.runtime.Composable +import androidx.compose.runtime.collectAsState +import androidx.compose.runtime.getValue +import androidx.compose.ui.Modifier +import com.gabrieldrn.carbon.Carbon +import com.gabrieldrn.carbon.catalog.di.injectViewModel +import com.gabrieldrn.carbon.catalog.theme.CarbonTheme +import com.gabrieldrn.carbon.foundation.color.CarbonLayer +import com.gabrieldrn.carbon.foundation.color.containerBackground +import com.gabrieldrn.carbon.foundation.spacing.SpacingScale +import com.gabrieldrn.carbon.radiobutton.RadioButton + +@Composable +fun SettingsScreen( + modifier: Modifier = Modifier, + viewModel: SettingsViewModel = injectViewModel(), +) { + val uiState by viewModel.uiState.collectAsState() + + Column( + modifier = modifier + .fillMaxSize() + .containerBackground() + .verticalScroll(state = rememberScrollState()) + .padding(WindowInsets.navigationBars.asPaddingValues()), + ) { + CarbonLayer { + Column( + modifier = Modifier + .fillMaxWidth() + .containerBackground() + .padding(SpacingScale.spacing05) + ) { + BasicText( + text = "Themes", + style = Carbon.typography.heading02.copy( + color = Carbon.theme.textPrimary + ), + ) + + BasicText( + text = "Light", + style = Carbon.typography.heading01.copy( + color = Carbon.theme.textPrimary + ), + modifier = Modifier.padding(top = SpacingScale.spacing03) + ) + + CarbonTheme.LightTheme.entries.forEach { theme -> + RadioButton( + selected = theme == uiState.lightTheme, + label = theme.displayName, + onClick = { viewModel.setLightTheme(theme) }, + modifier = Modifier.padding(top = SpacingScale.spacing03) + ) + } + + BasicText( + text = "Dark", + style = Carbon.typography.heading01.copy( + color = Carbon.theme.textPrimary + ), + modifier = Modifier.padding(top = SpacingScale.spacing05) + ) + + CarbonTheme.DarkTheme.entries.forEach { theme -> + RadioButton( + selected = theme == uiState.darkTheme, + label = theme.displayName, + onClick = { viewModel.setDarkTheme(theme) }, + modifier = Modifier.padding(top = SpacingScale.spacing03) + ) + } + } + } + } +} diff --git a/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/settings/SettingsViewModel.kt b/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/settings/SettingsViewModel.kt new file mode 100644 index 00000000..eee7fba9 --- /dev/null +++ b/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/settings/SettingsViewModel.kt @@ -0,0 +1,53 @@ +/* + * Copyright 2024 Gabriel Derrien + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.gabrieldrn.carbon.catalog.settings + +import com.gabrieldrn.carbon.catalog.common.ViewModel +import com.gabrieldrn.carbon.catalog.settings.data.SettingsRepository +import com.gabrieldrn.carbon.catalog.theme.CarbonTheme +import kotlinx.coroutines.flow.SharingStarted +import kotlinx.coroutines.flow.StateFlow +import kotlinx.coroutines.flow.combine +import kotlinx.coroutines.flow.stateIn + +class SettingsViewModel( + private val settingsRepository: SettingsRepository +) : ViewModel() { + + val uiState: StateFlow = with(settingsRepository) { + lightThemeFlow + .combine(darkThemeFlow, ::UIState) + .stateIn( + scope = this@SettingsViewModel, + started = SharingStarted.WhileSubscribed(), + initialValue = UIState(lightTheme, darkTheme) + ) + } + + fun setLightTheme(lightTheme: CarbonTheme.LightTheme) { + settingsRepository.setLightTheme(lightTheme) + } + + fun setDarkTheme(darkTheme: CarbonTheme.DarkTheme) { + settingsRepository.setDarkTheme(darkTheme) + } + + data class UIState( + val lightTheme: CarbonTheme.LightTheme, + val darkTheme: CarbonTheme.DarkTheme + ) +} diff --git a/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/settings/data/SettingsRepository.kt b/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/settings/data/SettingsRepository.kt new file mode 100644 index 00000000..fe0e1ef6 --- /dev/null +++ b/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/settings/data/SettingsRepository.kt @@ -0,0 +1,71 @@ +/* + * Copyright 2024 Gabriel Derrien + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.gabrieldrn.carbon.catalog.settings.data + +import com.gabrieldrn.carbon.catalog.theme.CarbonTheme +import com.russhwolf.settings.ExperimentalSettingsApi +import com.russhwolf.settings.Settings +import com.russhwolf.settings.coroutines.getStringFlow +import com.russhwolf.settings.observable.makeObservable +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.map + +@OptIn(ExperimentalSettingsApi::class) +class SettingsRepository { + + private val settings = Settings() + private val observableSettings = settings.makeObservable() + + val lightTheme + get() = settings.getString( + SETTING_KEY_LIGHT_THEME, + CarbonTheme.LightTheme.W.displayName + ).let(CarbonTheme.LightTheme::fromDisplayName) + + val darkTheme + get() = settings.getString( + SETTING_KEY_DARK_THEME, + CarbonTheme.DarkTheme.G100.displayName + ).let(CarbonTheme.DarkTheme::fromDisplayName) + + val lightThemeFlow: Flow = observableSettings + .getStringFlow( + key = SETTING_KEY_LIGHT_THEME, + defaultValue = CarbonTheme.LightTheme.W.displayName + ) + .map(CarbonTheme.LightTheme::fromDisplayName) + + val darkThemeFlow: Flow = observableSettings + .getStringFlow( + key = SETTING_KEY_DARK_THEME, + defaultValue = CarbonTheme.DarkTheme.G100.displayName + ) + .map(CarbonTheme.DarkTheme::fromDisplayName) + + fun setLightTheme(lightTheme: CarbonTheme.LightTheme) { + observableSettings.putString(SETTING_KEY_LIGHT_THEME, lightTheme.displayName) + } + + fun setDarkTheme(darkTheme: CarbonTheme.DarkTheme) { + observableSettings.putString(SETTING_KEY_DARK_THEME, darkTheme.displayName) + } + + companion object { + private const val SETTING_KEY_LIGHT_THEME = "lightTheme" + private const val SETTING_KEY_DARK_THEME = "darkTheme" + } +} diff --git a/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/theme/CarbonThemes.kt b/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/theme/CarbonThemes.kt new file mode 100644 index 00000000..0c46af8b --- /dev/null +++ b/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/theme/CarbonThemes.kt @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Gabriel Derrien + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.gabrieldrn.carbon.catalog.theme + +import com.gabrieldrn.carbon.foundation.color.Gray100Theme +import com.gabrieldrn.carbon.foundation.color.Gray10Theme +import com.gabrieldrn.carbon.foundation.color.Gray90Theme +import com.gabrieldrn.carbon.foundation.color.Theme +import com.gabrieldrn.carbon.foundation.color.WhiteTheme + +sealed class CarbonTheme(val displayName: String, val theme: Theme) { + sealed class LightTheme(displayName: String, theme: Theme) : CarbonTheme(displayName, theme) { + data object W : LightTheme("White", WhiteTheme) + data object G10 : LightTheme("Gray 10", Gray10Theme) + + companion object { + val entries by lazy { + listOf(W, G10) + } + + fun fromDisplayName(displayName: String): LightTheme = + entries.first { it.displayName == displayName } + } + } + + sealed class DarkTheme(displayName: String, theme: Theme) : CarbonTheme(displayName, theme) { + data object G90 : DarkTheme("Gray 90", Gray90Theme) + data object G100 : DarkTheme("Gray 100", Gray100Theme) + + companion object { + val entries by lazy { + listOf(G90, G100) + } + + fun fromDisplayName(displayName: String): DarkTheme = + entries.first { it.displayName == displayName } + } + } + + companion object { + val entries by lazy { + LightTheme.entries + DarkTheme.entries + } + } +} diff --git a/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/theme/CatalogTheme.kt b/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/theme/CatalogTheme.kt index 1d3ce7e0..071499f8 100644 --- a/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/theme/CatalogTheme.kt +++ b/catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/theme/CatalogTheme.kt @@ -16,8 +16,13 @@ package com.gabrieldrn.carbon.catalog.theme +import androidx.compose.foundation.isSystemInDarkTheme import androidx.compose.runtime.Composable +import androidx.compose.runtime.collectAsState +import androidx.compose.runtime.getValue import com.gabrieldrn.carbon.CarbonDesignSystem +import com.gabrieldrn.carbon.catalog.di.injectViewModel +import com.gabrieldrn.carbon.catalog.settings.SettingsViewModel import com.gabrieldrn.carbon.foundation.color.Gray100Theme @Composable @@ -25,7 +30,15 @@ import com.gabrieldrn.carbon.foundation.color.Gray100Theme fun CarbonCatalogTheme( content: @Composable () -> Unit ) { + val settingsViewModel = injectViewModel() + val uiState by settingsViewModel.uiState.collectAsState() + CarbonDesignSystem( + theme = if (isSystemInDarkTheme()) { + uiState.darkTheme.theme + } else { + uiState.lightTheme.theme + }, uiShellInlineTheme = Gray100Theme, content = content ) diff --git a/catalog/src/desktopMain/kotlin/com/gabrieldrn/carbon/catalog/Main.kt b/catalog/src/desktopMain/kotlin/com/gabrieldrn/carbon/catalog/Main.kt index e48354dc..a0875d73 100644 --- a/catalog/src/desktopMain/kotlin/com/gabrieldrn/carbon/catalog/Main.kt +++ b/catalog/src/desktopMain/kotlin/com/gabrieldrn/carbon/catalog/Main.kt @@ -18,8 +18,14 @@ package com.gabrieldrn.carbon.catalog import androidx.compose.ui.window.Window import androidx.compose.ui.window.application +import com.gabrieldrn.carbon.catalog.di.appModule +import org.koin.core.context.startKoin fun main() = application { + startKoin { + modules(appModule()) + } + Window( onCloseRequest = ::exitApplication, title = "Carbon catalog", diff --git a/catalog/src/iosMain/kotlin/com/gabrieldrn/carbon/catalog/KoinHelper.kt b/catalog/src/iosMain/kotlin/com/gabrieldrn/carbon/catalog/KoinHelper.kt new file mode 100644 index 00000000..d69573f4 --- /dev/null +++ b/catalog/src/iosMain/kotlin/com/gabrieldrn/carbon/catalog/KoinHelper.kt @@ -0,0 +1,27 @@ +/* + * Copyright 2024 Gabriel Derrien + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.gabrieldrn.carbon.catalog + +import com.gabrieldrn.carbon.catalog.di.appModule +import org.koin.core.context.startKoin + +@Suppress("unused") +fun initKoin() { + startKoin { + modules(appModule()) + } +} diff --git a/catalog/src/iosMain/kotlin/com/gabrieldrn/carbon/catalog/MainViewController.kt b/catalog/src/iosMain/kotlin/com/gabrieldrn/carbon/catalog/MainViewController.kt index 4c29df33..295e55cd 100644 --- a/catalog/src/iosMain/kotlin/com/gabrieldrn/carbon/catalog/MainViewController.kt +++ b/catalog/src/iosMain/kotlin/com/gabrieldrn/carbon/catalog/MainViewController.kt @@ -25,8 +25,8 @@ import com.gabrieldrn.carbon.CarbonDesignSystem import com.gabrieldrn.carbon.foundation.color.containerBackground import platform.UIKit.UIViewController -@Suppress("FunctionNaming") -public fun MainViewController(): UIViewController = +@Suppress("FunctionNaming", "unused", "FunctionName") +fun MainViewController(): UIViewController = ComposeUIViewController { CarbonDesignSystem { Box(Modifier.fillMaxSize().containerBackground(), contentAlignment = Alignment.Center) { diff --git a/catalog/src/wasmJsMain/kotlin/main.kt b/catalog/src/wasmJsMain/kotlin/main.kt index ca308988..5a35158c 100644 --- a/catalog/src/wasmJsMain/kotlin/main.kt +++ b/catalog/src/wasmJsMain/kotlin/main.kt @@ -1,10 +1,16 @@ import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.window.ComposeViewport import com.gabrieldrn.carbon.catalog.Catalog +import com.gabrieldrn.carbon.catalog.di.appModule import kotlinx.browser.document +import org.koin.core.context.startKoin @OptIn(ExperimentalComposeUiApi::class) fun main() { + startKoin { + modules(appModule()) + } + val body = document.body ?: return ComposeViewport(body) { Catalog() diff --git a/doc-parser/src/main/kotlin/com/gabrieldrn/docparser/color/ThemesCodeGen.kt b/doc-parser/src/main/kotlin/com/gabrieldrn/docparser/color/ThemesCodeGen.kt index 992aef5c..dedaaf07 100644 --- a/doc-parser/src/main/kotlin/com/gabrieldrn/docparser/color/ThemesCodeGen.kt +++ b/doc-parser/src/main/kotlin/com/gabrieldrn/docparser/color/ThemesCodeGen.kt @@ -37,6 +37,7 @@ private val sourcePath = Paths.get("carbon/src/commonMain/kotlin") //private val sourcePath = Paths.get("build/generated/kotlin") private val layerClass = ClassName(PACKAGE_ROOT, "Layer") private val themeAbstractionName = ClassName(PACKAGE_ROOT, "Theme") +private val codeIndent = " " private val generatedCodeMessage = """ ---------------------------------- @@ -44,6 +45,7 @@ private val generatedCodeMessage = ---------------------------------- """.trimIndent() + enum class Component { AI, TAG, @@ -156,6 +158,7 @@ private fun generateComponentAbstraction( .build() FileSpec.builder(interfaceName) + .indent(codeIndent) .addFileComment(generatedCodeMessage) .addType(interfaceSpec) .build() @@ -210,6 +213,7 @@ private fun generateComponentImplementation( .build() FileSpec.builder(implementationName.packageName, implementationName.simpleName) + .indent(codeIndent) .addFileComment(generatedCodeMessage) .addType(classSpec) .build() @@ -268,45 +272,52 @@ private fun generateThemeAbstraction( ) .build() - val copyThemeFuncSpec = FunSpec.builder("copy") - .returns(themeAbstractionName) - .addModifiers(KModifier.INTERNAL) - .addAnnotation( - AnnotationSpec.builder(Suppress::class) - .addMember("%S", "LongMethod") - .build() - ) + val copyAnonymousClass = TypeSpec.anonymousClassBuilder() + .superclass(themeAbstractionName) .apply { tokenProperties.forEach { token -> - addParameter( - ParameterSpec.builder(token.name, Color::class) - .defaultValue("this.${token.name}") + addProperty( + PropertySpec.builder(token.name, Color::class) + .initializer(token.name) + .addModifiers(KModifier.OVERRIDE) .build() ) } componentsPropertySpecs.forEach { component -> - addParameter( - ParameterSpec.builder(component.name, component.type) - .defaultValue("this.${component.name}") + addProperty( + PropertySpec.builder(component.name, component.type) + .initializer(component.name) + .addModifiers(KModifier.OVERRIDE) .build() ) } } - .addCode("return object : ${themeAbstractionName.simpleName}() {\n") - .apply { - tokenProperties.forEach { token -> - addCode(" override val ${token.name}: Color = ${token.name}\n") - } - componentsPropertySpecs.forEach { component -> - addCode( - " override val %N: %T = %N\n", - component.name, - component.type, - component.name - ) + .build() + + val copyThemeFuncSpec = FunSpec.builder("copy") + .returns(themeAbstractionName) + .addModifiers(KModifier.INTERNAL) + .addAnnotation( + AnnotationSpec.builder(Suppress::class) + .addMember("%S", "LongMethod") + .build() + ) + .addParameters( + (tokenProperties + componentsPropertySpecs).mapIndexed { index, spec -> + if (spec is TokenProperty) { + ParameterSpec.builder(spec.name, Color::class) + .defaultValue("this.${spec.name}") + .build() + } else if (spec is PropertySpec) { + ParameterSpec.builder(spec.name, spec.type) + .defaultValue("this.${spec.name}") + .build() + } else { + error("Type ${spec::class.simpleName} at index $index unrecognized.") + } } - } - .addCode("}") + ) + .addStatement("return %L", copyAnonymousClass) .build() val equalsFunSpec = FunSpec.builder("equals") @@ -370,6 +381,7 @@ private fun generateThemeAbstraction( .build() FileSpec.builder(PACKAGE_ROOT, themeAbstractionName.simpleName) + .indent(codeIndent) .addFileComment(generatedCodeMessage) .addType(themeAbstraction) .build() @@ -431,6 +443,7 @@ private fun generateThemeImplementation( .build() FileSpec.builder(PACKAGE_ROOT, themeName) + .indent(codeIndent) .addFileComment(generatedCodeMessage) .addType(classSpec) .build() diff --git a/doc-parser/src/main/kotlin/com/gabrieldrn/docparser/color/serializers/ComposeColorSerializer.kt b/doc-parser/src/main/kotlin/com/gabrieldrn/docparser/color/serializers/ComposeColorSerializer.kt index ec7970f4..7060d5e5 100644 --- a/doc-parser/src/main/kotlin/com/gabrieldrn/docparser/color/serializers/ComposeColorSerializer.kt +++ b/doc-parser/src/main/kotlin/com/gabrieldrn/docparser/color/serializers/ComposeColorSerializer.kt @@ -22,25 +22,32 @@ import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor import kotlinx.serialization.descriptors.SerialDescriptor import kotlinx.serialization.encoding.Decoder import kotlinx.serialization.encoding.Encoder +import kotlin.math.roundToInt object ComposeColorSerializer : KSerializer { + private val alphaDelimiters = listOf("@", "–") + override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("Color", PrimitiveKind.STRING) override fun serialize(encoder: Encoder, value: String) { val alpha = value.substring(1..2).toInt(16) - val hex = "#${value.substring(3)}" + val rgb = "#${value.substring(3)}" val alphaPercent = (alpha / 255f * 100).toInt() - encoder.encodeString("$hex @ $alphaPercent%") + encoder.encodeString("$rgb ${alphaDelimiters.first()} $alphaPercent%") } override fun deserialize(decoder: Decoder): String { val string = decoder.decodeString() - val hex = string.substringBefore(" @") - val alphaPercent = string.substringAfter("@ ", missingDelimiterValue = "100%") + val alphaDelimiter = alphaDelimiters.firstOrNull { it in string } + val hex = string.substringBefore(delimiter = " $alphaDelimiter") + val alphaPercent = string.substringAfter( + delimiter = "$alphaDelimiter ", + missingDelimiterValue = "100%" + ) val alpha = (alphaPercent.removeSuffix("%").toInt() / 100f * 255) - .toInt() + .roundToInt() .let { "%02x".format(it) } val red = hex.substring(1, 3) val green = hex.substring(3, 5) diff --git a/doc-parser/src/test/kotlin/com/gabrieldrn/docparser/color/serializers/ComposeColorSerializerTest.kt b/doc-parser/src/test/kotlin/com/gabrieldrn/docparser/color/serializers/ComposeColorSerializerTest.kt new file mode 100644 index 00000000..d0719ee5 --- /dev/null +++ b/doc-parser/src/test/kotlin/com/gabrieldrn/docparser/color/serializers/ComposeColorSerializerTest.kt @@ -0,0 +1,56 @@ +package com.gabrieldrn.docparser.color.serializers + +import kotlinx.serialization.json.Json +import kotlin.test.Test +import kotlin.test.assertEquals + +class ComposeColorSerializerTest { + + @Test + fun `test serialize color with alpha`() { + // Given a color with an alpha channel + val color = "#80FF5733" // alpha=80 (50%), color=FF5733 + + // When the color is serialized + val serialized = Json.encodeToString(ComposeColorSerializer, color) + + // Then the serialized string should match the expected format + assertEquals(""""#FF5733 @ 50%"""", serialized) + } + + @Test + fun `test deserialize color with alpha`() { + // Given a serialized color string + val serializedColor = """"#FF5733 @ 50%"""" + + // When the string is deserialized + val deserialized = Json.decodeFromString(ComposeColorSerializer, serializedColor) + + // Then the deserialized string should match the original hex color + assertEquals("#80FF5733", deserialized) // alpha=80 (50%), color=FF5733 + } + + @Test + fun `test serialize color with full opacity`() { + // Given a color with full opacity + val color = "#FFFF5733" // alpha=FF (100%), color=FF5733 + + // When the color is serialized + val serialized = Json.encodeToString(ComposeColorSerializer, color) + + // Then the serialized string should represent full opacity + assertEquals(""""#FF5733 @ 100%"""", serialized) + } + + @Test + fun `test deserialize color with full opacity`() { + // Given a serialized color string with full opacity + val serializedColor = """"#FF5733 @ 100%"""" + + // When the string is deserialized + val deserialized = Json.decodeFromString(ComposeColorSerializer, serializedColor) + + // Then the deserialized string should match the original hex color with full alpha + assertEquals("#FFFF5733", deserialized) // alpha=FF (100%), color=FF5733 + } +} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d87e9440..78c834b4 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,27 +1,32 @@ [versions] # region Build + build-logic -androidGradlePlugin = "8.3.1" -kotlin = "2.0.0" +androidGradlePlugin = "8.5.2" +kotlin = "2.0.20" binaryCompatibilityValidator = "0.16.2" # endregion # region Libraries -compose = "1.6.11" -androidxActivity = "1.9.0" +compose = "1.7.0" +androidxActivity = "1.9.3" androidxAppcompat = "1.7.0" #https://developer.android.com/jetpack/androidx/releases/compose-compiler#declaring_dependencies #https://developer.android.com/jetpack/androidx/releases/compose-kotlin -androidxCompose = "1.6.8" +androidxCompose = "1.7.4" androidxEspresso = "3.6.1" androidxNavigation = "2.7.0-alpha07" -androidxTestExtJunit = "1.1.5" +androidxTestExtJunit = "1.2.1" kotlinxSerializationJson = "1.7.3" + +# Community libraries kotlinPoet = "1.18.0" publish-plugin = "0.28.0" detekt = "1.23.7" dokka = "1.9.20" junit = "4.13.2" timber = "5.0.1" +koin = "4.0.0" kermit = "2.0.4" +settings = "1.2.0" + # endregion [libraries] @@ -35,10 +40,17 @@ androidx-test-ext = { module = "androidx.test.ext:junit", version.ref = "android junit = { module = "junit:junit", version.ref = "junit" } kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" } kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" } +kotlinx-coroutines-swing = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-swing", version.ref = "kotlinxSerializationJson" } kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" } kotlinPoet = { module = "com.squareup:kotlinpoet", version.ref = "kotlinPoet" } timber = { module = "com.jakewharton.timber:timber", version.ref = "timber" } touchlab-kermit = { module = "co.touchlab:kermit", version.ref = "kermit" } +koin = { module = "io.insert-koin:koin-core", version.ref = "koin" } +koin-compose = { module = "io.insert-koin:koin-compose", version.ref = "koin" } +settings = { module = "com.russhwolf:multiplatform-settings", version.ref = "settings" } +settings-noArg = { module = "com.russhwolf:multiplatform-settings-no-arg", version.ref = "settings" } +settings-coroutines = { module = "com.russhwolf:multiplatform-settings-coroutines", version.ref = "settings" } +settings-makeObservable = { module = "com.russhwolf:multiplatform-settings-make-observable", version.ref = "settings" } # Build logic android-gradlePlugin = { group = "com.android.tools.build", name = "gradle", version.ref = "androidGradlePlugin" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 715aad24..638c8339 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Thu Aug 03 22:42:31 EDT 2023 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/iosCatalog/CarbonCatalog/CarbonCatalogApp.swift b/iosCatalog/CarbonCatalog/CarbonCatalogApp.swift index 5ca60742..978125ea 100644 --- a/iosCatalog/CarbonCatalog/CarbonCatalogApp.swift +++ b/iosCatalog/CarbonCatalog/CarbonCatalogApp.swift @@ -10,9 +10,13 @@ import Catalog @main struct CarbonCatalogApp: App { + + init() { + KoinHelperKt.doInitKoin() + } + var body: some Scene { WindowGroup { - ContentView() } }