Skip to content

Commit

Permalink
buttons: introduce BundleButtons
Browse files Browse the repository at this point in the history
  • Loading branch information
hrach committed Mar 16, 2022
1 parent 8f0adb1 commit c319841
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import kiwi.orbit.compose.catalog.Screen
import kiwi.orbit.compose.ui.OrbitTheme
import kiwi.orbit.compose.ui.controls.ButtonBundleBasic
import kiwi.orbit.compose.ui.controls.ButtonBundleMedium
import kiwi.orbit.compose.ui.controls.ButtonBundleTop
import kiwi.orbit.compose.ui.controls.ButtonCritical
import kiwi.orbit.compose.ui.controls.ButtonCriticalSubtle
import kiwi.orbit.compose.ui.controls.ButtonLink
Expand Down Expand Up @@ -61,6 +64,9 @@ private fun ButtonScreenInner() {
ButtonSecondary(onClick = {}, maxWidth) { Text("Secondary Button") }
ButtonCritical(onClick = {}, maxWidth) { Text("Critical Button") }
ButtonCriticalSubtle(onClick = {}, maxWidth) { Text("Critical Subtle Button") }
ButtonBundleBasic(onClick = {}, maxWidth) { Text("Bundle Basic Button") }
ButtonBundleMedium(onClick = {}, maxWidth) { Text("Bundle Medium Button") }
ButtonBundleTop(onClick = {}, maxWidth) { Text("Bundle Top Button") }
ButtonLink(onClick = {}, maxWidth) { Text("Link Button") }

Text("Manually themed", Modifier.padding(top = 16.dp))
Expand Down
48 changes: 48 additions & 0 deletions ui/src/main/java/kiwi/orbit/compose/ui/controls/Button.kt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,54 @@ public fun ButtonCriticalSubtle(
)
}

@Composable
public fun ButtonBundleBasic(
onClick: () -> Unit,
modifier: Modifier = Modifier,
content: @Composable RowScope.() -> Unit
) {
ButtonLargePrimitive(
onClick = onClick,
backgroundColor = Color.Unspecified,
backgroundBrush = OrbitTheme.colors.bundle.basicGradient,
contentColor = OrbitTheme.colors.bundle.onBasic,
modifier = modifier,
content = content,
)
}

@Composable
public fun ButtonBundleMedium(
onClick: () -> Unit,
modifier: Modifier = Modifier,
content: @Composable RowScope.() -> Unit
) {
ButtonLargePrimitive(
onClick = onClick,
backgroundColor = Color.Unspecified,
backgroundBrush = OrbitTheme.colors.bundle.mediumGradient,
contentColor = OrbitTheme.colors.bundle.onMedium,
modifier = modifier,
content = content,
)
}

@Composable
public fun ButtonBundleTop(
onClick: () -> Unit,
modifier: Modifier = Modifier,
content: @Composable RowScope.() -> Unit
) {
ButtonLargePrimitive(
onClick = onClick,
backgroundColor = Color.Unspecified,
backgroundBrush = OrbitTheme.colors.bundle.topGradient,
contentColor = OrbitTheme.colors.bundle.onTop,
modifier = modifier,
content = content,
)
}

@Composable
public fun ButtonLink(
onClick: () -> Unit,
Expand Down

0 comments on commit c319841

Please sign in to comment.