All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.io.github.lyxnx.compose.pine.CardDefaults.kt Maven / Gradle / Ivy

There is a newer version: 2.0.2
Show newest version
package io.github.lyxnx.compose.pine

import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.shape.CornerBasedShape
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import io.github.lyxnx.compose.ui.DropShadow

/**
 * Contains the default values used by a [Card]
 */
public object CardDefaults {

    /**
     * The default shape of a card
     */
    public val Shape: CornerBasedShape
        @Composable
        get() = PineTheme.shapes.medium

    /**
     * The default style for a card's drop shadow
     */
    public val Shadow: DropShadow
        @Composable
        get() = PineTheme.shadows.extraSmall

    /**
     * Default content padding for a card
     */
    public val ContentPadding: PaddingValues = PaddingValues(8.dp)

    /**
     * Creates a [CardColors] instance that represents the colors used by a card
     */
    @Composable
    public fun cardColors(
        backgroundColor: Color = PineTheme.colors.background,
        disabledBackgroundColor: Color = PineTheme.colors.grey300,
        borderColor: Color = PineTheme.colors.grey200,
        disabledBorderColor: Color = PineTheme.colors.grey300,
        contentColor: Color = PineTheme.colors.grey900,
        disabledContentColor: Color = PineTheme.colors.grey400,
    ): CardColors = CardColors(
        backgroundColor = backgroundColor,
        disabledBackgroundColor = disabledBackgroundColor,
        borderColor = borderColor,
        disabledBorderColor = disabledBorderColor,
        contentColor = contentColor,
        disabledContentColor = disabledContentColor
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy