Updated on 2026-08-14

This commit is contained in:
Tangem 2023-08-25 15:07:47 +03:00
parent c353710ba2
commit f6a0cb6428
22 changed files with 403 additions and 224 deletions

View file

@ -11,7 +11,7 @@ import com.tangem.core.ui.res.TangemTheme
@Suppress("LongParameterList")
@Composable
internal fun TangemButton(
fun TangemButton(
text: String,
icon: TangemButtonIconPosition,
onClick: () -> Unit,

View file

@ -6,7 +6,7 @@ import androidx.compose.runtime.State
import androidx.compose.runtime.rememberUpdatedState
import androidx.compose.ui.graphics.Color
internal class TangemButtonColors(
class TangemButtonColors(
private val backgroundColor: Color,
private val contentColor: Color,
private val disabledBackgroundColor: Color,

View file

@ -1,8 +1,10 @@
package com.tangem.core.ui.components.buttons.common
import androidx.annotation.DrawableRes
import androidx.compose.runtime.Immutable
internal sealed interface TangemButtonIconPosition {
@Immutable
sealed interface TangemButtonIconPosition {
val iconResId: Int?
data class Start(@DrawableRes override val iconResId: Int) : TangemButtonIconPosition

View file

@ -8,7 +8,7 @@ import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.tangem.core.ui.res.TangemTheme
internal enum class TangemButtonSize {
enum class TangemButtonSize {
Default,
Text,
Selector,

View file

@ -11,7 +11,8 @@ import com.tangem.core.ui.res.TangemTheme
internal object TangemButtonsDefaults {
val elevation: ButtonElevation
@Composable get() = ButtonDefaults.elevation(
@Composable
get() = ButtonDefaults.elevation(
defaultElevation = TangemTheme.dimens.elevation0,
pressedElevation = TangemTheme.dimens.elevation0,
)
@ -65,14 +66,4 @@ internal object TangemButtonsDefaults {
disabledBackgroundColor = Color.Transparent,
disabledContentColor = TangemTheme.colors.text.disabled,
)
val backgroundButtonColors: ButtonColors
@Composable
@ReadOnlyComposable
get() = TangemButtonColors(
backgroundColor = TangemTheme.colors.background.primary,
contentColor = TangemTheme.colors.text.primary1,
disabledBackgroundColor = TangemTheme.colors.button.disabled,
disabledContentColor = TangemTheme.colors.text.disabled,
)
}