Skip to content

Commit

Permalink
Merge pull request #217 from tarkalabs/mohan/enhancements/tui-icon-bu…
Browse files Browse the repository at this point in the history
…tton-update

TUIIconButton updated with custom style.
  • Loading branch information
rajajawahar authored Apr 1, 2024
2 parents efd176d + f8b5f84 commit 8355bce
Show file tree
Hide file tree
Showing 29 changed files with 127 additions and 80 deletions.
2 changes: 1 addition & 1 deletion tarka-ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ publishing {
run {
groupId = "com.tarkalabs"
artifactId = getLibraryArtifactId()
version = "1.1.10"
version = "1.1.11"
artifact("$buildDir/outputs/aar/tarka-ui-release.aar")
}
}
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
@file:OptIn(ExperimentalMaterial3Api::class)

package com.tarkalabs.uicomponents.screenshots

import androidx.compose.material3.ExperimentalMaterial3Api
import com.tarkalabs.tarkaui.components.base.IconButtonSize.XS
import com.tarkalabs.tarkaui.components.base.IconButtonStyle.GHOST
import com.tarkalabs.tarkaui.components.base.IconButtonStyle.OUTLINE
import com.tarkalabs.tarkaui.components.base.IconButtonStyle.PRIMARY
import com.tarkalabs.tarkaui.components.base.IconButtonStyle.SECONDARY
import com.tarkalabs.tarkaui.components.base.IconButtonStyle.Custom
import com.tarkalabs.tarkaui.components.base.IconButtonStyle.Ghost
import com.tarkalabs.tarkaui.components.base.IconButtonStyle.Outline
import com.tarkalabs.tarkaui.components.base.IconButtonStyle.Primary
import com.tarkalabs.tarkaui.components.base.IconButtonStyle.Secondary
import com.tarkalabs.tarkaui.components.base.TUIIconButton
import com.tarkalabs.tarkaui.icons.ChevronRight20
import com.tarkalabs.tarkaui.icons.Stop24
import com.tarkalabs.tarkaui.icons.TarkaIcons
import com.tarkalabs.tarkaui.theme.TUITheme
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.Parameterized
Expand All @@ -37,31 +37,39 @@ class TUIIconButtonScreenShotTest(
TUIIconButton(
icon = TarkaIcons.Regular.ChevronRight20,
buttonSize = XS,
iconButtonStyle = PRIMARY,
iconButtonStyle = Primary,
)
}

@Test fun secondaryIconButton() = compareScreenshotFor(darkTheme, "_secondaryIconButton_$testName"){
TUIIconButton(
icon = TarkaIcons.Regular.ChevronRight20,
buttonSize = XS,
iconButtonStyle = SECONDARY,
iconButtonStyle = Secondary,
)
}

@Test fun ghostIconButton() = compareScreenshotFor(darkTheme, "_ghostIconButton_$testName"){
TUIIconButton(
icon = TarkaIcons.Regular.ChevronRight20,
buttonSize = XS,
iconButtonStyle = GHOST,
iconButtonStyle = Ghost,
)
}

@Test fun outlineIconButton() = compareScreenshotFor(darkTheme, "_outlineIconButton_$testName"){
TUIIconButton(
icon = TarkaIcons.Regular.ChevronRight20,
buttonSize = XS,
iconButtonStyle = OUTLINE,
iconButtonStyle = Outline,
)
}

@Test fun customIconButton() = compareScreenshotFor(darkTheme, "_customIconButton_$testName"){
TUIIconButton(
icon = TarkaIcons.Regular.Stop24,
buttonSize = XS,
iconButtonStyle = Custom(TUITheme.colors.success, TUITheme.colors.onSecondaryAlt),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.tarkalabs.tarkaui.components.base.IconButtonSize.XL
import com.tarkalabs.tarkaui.components.base.IconButtonStyle.GHOST
import com.tarkalabs.tarkaui.components.base.IconButtonStyle.Ghost
import com.tarkalabs.tarkaui.components.base.TUIIconButton
import com.tarkalabs.tarkaui.components.base.TUIIconButtonTags
import com.tarkalabs.tarkaui.icons.ChevronLeft24
Expand Down Expand Up @@ -155,7 +155,7 @@ import com.tarkalabs.tarkaui.theme.TUITheme
onIconClick = onNavigationIconClick,
icon = navigationIcon,
tags = tags.navigationIconTags,
iconButtonStyle = GHOST,
iconButtonStyle = Ghost,
buttonSize = XL
)
}
Expand All @@ -167,7 +167,7 @@ import com.tarkalabs.tarkaui.theme.TUITheme
TUIIconButton(
icon = searchIcon,
tags = tags.searchIconTags,
iconButtonStyle = GHOST,
iconButtonStyle = Ghost,
onIconClick = {
if (!disableSearchIcon) {
showSearchBarState = true
Expand All @@ -181,7 +181,7 @@ import com.tarkalabs.tarkaui.theme.TUITheme
TUIIconButton(
icon = menuItemIconThree,
tags = tags.menuIconThreeTags,
iconButtonStyle = GHOST,
iconButtonStyle = Ghost,
onIconClick = onThirdMenuItemClicked,
buttonSize = XL
)
Expand All @@ -192,7 +192,7 @@ import com.tarkalabs.tarkaui.theme.TUITheme
onIconClick = onSecondMenuItemClicked,
icon = menuItemIconTwo,
tags = tags.menuIconTwoTags,
iconButtonStyle = GHOST,
iconButtonStyle = Ghost,
buttonSize = XL
)
}
Expand All @@ -202,7 +202,7 @@ import com.tarkalabs.tarkaui.theme.TUITheme
onIconClick = onFirstMenuItemClicked,
tags = tags.menuIconOneTags,
icon = menuItemIconOne,
iconButtonStyle = GHOST,
iconButtonStyle = Ghost,
buttonSize = XL
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import com.tarkalabs.tarkaui.components.TUIAttachmentUpload.AttachmentState.UpLo
import com.tarkalabs.tarkaui.components.TUIAttachmentUpload.AttachmentState.UpLoading
import com.tarkalabs.tarkaui.components.TUIMediaThumbnailType.Document
import com.tarkalabs.tarkaui.components.base.IconButtonSize
import com.tarkalabs.tarkaui.components.base.IconButtonStyle.GHOST
import com.tarkalabs.tarkaui.components.base.IconButtonStyle.Ghost
import com.tarkalabs.tarkaui.components.base.TUIIconButton
import com.tarkalabs.tarkaui.components.base.TUIIconButtonTags
import com.tarkalabs.tarkaui.icons.Checkmark12
Expand Down Expand Up @@ -158,7 +158,7 @@ object TUIAttachmentUpload {

TUIIconButton(
icon = trailingIcon,
iconButtonStyle = GHOST,
iconButtonStyle = Ghost,
buttonSize = IconButtonSize.XL,
tags = tags.menuItemTag,
onIconClick = onTrailingIconClick
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import com.tarkalabs.tarkaui.components.base.AvatarSize.XS
import com.tarkalabs.tarkaui.components.base.AvatarType
import com.tarkalabs.tarkaui.components.base.BadgeStyle
import com.tarkalabs.tarkaui.components.base.IconButtonSize.M
import com.tarkalabs.tarkaui.components.base.IconButtonStyle.GHOST
import com.tarkalabs.tarkaui.components.base.IconButtonStyle.Ghost
import com.tarkalabs.tarkaui.components.base.TUIAvatar
import com.tarkalabs.tarkaui.components.base.TUIBadge
import com.tarkalabs.tarkaui.components.base.TUIIconButton
Expand Down Expand Up @@ -154,7 +154,7 @@ enum class ChipSize(val size: Dp) {
{
TUIIconButton(
icon = type.trailingIcon,
iconButtonStyle = GHOST,
iconButtonStyle = Ghost,
onIconClick = {
onDismissClick?.invoke()
},
Expand Down Expand Up @@ -233,7 +233,7 @@ enum class ChipSize(val size: Dp) {
{
TUIIconButton(
icon = TarkaIcons.Filled.Dismiss20.copy(tintColor = if (type.selected) TUITheme.colors.onSecondary else TUITheme.colors.onSurface),
iconButtonStyle = GHOST,
iconButtonStyle = Ghost,
)
}
} else if (type.showTrailingCaret) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fun TUIMobileOverlayFooter(
Spacer(modifier = Modifier.weight(1f))
if (showMiddleDismiss) TUIIconButton(
icon = TarkaIcons.Regular.Dismiss24,
iconButtonStyle = IconButtonStyle.GHOST,
iconButtonStyle = IconButtonStyle.Ghost,
onIconClick = { onMiddleDismissClick?.invoke() }
)
Spacer(modifier = Modifier.weight(1f))
Expand All @@ -77,13 +77,13 @@ fun TUIMobileOverlayFooterPreview() {
leftContent = {
TUIIconButton(
icon = TarkaIcons.Regular.ChevronLeft24,
iconButtonStyle = IconButtonStyle.GHOST
iconButtonStyle = IconButtonStyle.Ghost
)
},
rightContent = {
TUIIconButton(
icon = TarkaIcons.Regular.ChevronRight24,
iconButtonStyle = IconButtonStyle.GHOST
iconButtonStyle = IconButtonStyle.Ghost
)
}
)
Expand All @@ -97,13 +97,13 @@ fun TUIMobileOverlayFooterPreview() {
leftContent = {
TUIIconButton(
icon = TarkaIcons.Regular.ChevronLeft24,
iconButtonStyle = IconButtonStyle.GHOST
iconButtonStyle = IconButtonStyle.Ghost
)
},
rightContent = {
TUIIconButton(
icon = TarkaIcons.Regular.ChevronRight24,
iconButtonStyle = IconButtonStyle.GHOST
iconButtonStyle = IconButtonStyle.Ghost
)
}
)
Expand All @@ -113,7 +113,7 @@ fun TUIMobileOverlayFooterPreview() {
rightContent = {
TUIIconButton(
icon = TarkaIcons.Regular.ChevronRight24,
iconButtonStyle = IconButtonStyle.GHOST
iconButtonStyle = IconButtonStyle.Ghost
)
}
)
Expand All @@ -123,7 +123,7 @@ fun TUIMobileOverlayFooterPreview() {
leftContent = {
TUIIconButton(
icon = TarkaIcons.Regular.ChevronLeft24,
iconButtonStyle = IconButtonStyle.GHOST
iconButtonStyle = IconButtonStyle.Ghost
)
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ fun TUIMobileOverlayHeader(
TUIIconButton(
icon = TarkaIcons.Regular.ChevronLeft24,
buttonSize = IconButtonSize.XL,
iconButtonStyle = IconButtonStyle.GHOST,
iconButtonStyle = IconButtonStyle.Ghost,
onIconClick = style.onBackIconClick,
tags = tags.leadingIconButtonTag
)
Expand All @@ -145,7 +145,7 @@ fun TUIMobileOverlayHeader(
TUIIconButton(
icon = style.trailingIcon,
buttonSize = IconButtonSize.L,
iconButtonStyle = IconButtonStyle.GHOST,
iconButtonStyle = IconButtonStyle.Ghost,
onIconClick = style.onTrailingIconClick,
tags = tags.trailingIconButtonTag
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import androidx.compose.ui.text.input.VisualTransformation
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.tarkalabs.tarkaui.components.base.IconButtonSize.L
import com.tarkalabs.tarkaui.components.base.IconButtonStyle.GHOST
import com.tarkalabs.tarkaui.components.base.IconButtonStyle.Ghost
import com.tarkalabs.tarkaui.components.base.TUIIconButton
import com.tarkalabs.tarkaui.components.base.TUIIconButtonTags
import com.tarkalabs.tarkaui.icons.BarcodeScanner24
Expand Down Expand Up @@ -56,7 +56,7 @@ import kotlinx.coroutines.delay
val leadingIconLambda: @Composable (() -> Unit)? = if (leadingIcon != null) {
{
TUIIconButton(
icon = leadingIcon, buttonSize = L, iconButtonStyle = GHOST, onIconClick = {
icon = leadingIcon, buttonSize = L, iconButtonStyle = Ghost, onIconClick = {
onLeadingIconClick?.invoke()
}, tags = searchBarTags.leadingIconTags
)
Expand All @@ -66,7 +66,7 @@ import kotlinx.coroutines.delay
val trailingIconLambda: @Composable (() -> Unit)? = if (query.isNotEmpty()) {
{
TUIIconButton(
icon = trailingIcon, buttonSize = L, iconButtonStyle = GHOST, onIconClick = {
icon = trailingIcon, buttonSize = L, iconButtonStyle = Ghost, onIconClick = {
onQueryTextChange.invoke("")
}, tags = searchBarTags.trailingIconTags
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import com.tarkalabs.tarkaui.components.TextRowStyle.DateStyle
import com.tarkalabs.tarkaui.components.TextRowStyle.Title
import com.tarkalabs.tarkaui.components.TextRowStyle.TitleWithDescription
import com.tarkalabs.tarkaui.components.TextRowStyle.TitleWithNotAvailable
import com.tarkalabs.tarkaui.components.base.IconButtonStyle.GHOST
import com.tarkalabs.tarkaui.components.base.IconButtonStyle.Ghost
import com.tarkalabs.tarkaui.components.base.TUIIconButton
import com.tarkalabs.tarkaui.components.base.TUIIconButtonTags
import com.tarkalabs.tarkaui.icons.Circle24
Expand Down Expand Up @@ -133,13 +133,13 @@ import com.tarkalabs.tarkaui.theme.TUITheme
if (iconOne != null) TUIIconButton(
icon = iconOne,
onIconClick = onIconOneClick,
iconButtonStyle = GHOST,
iconButtonStyle = Ghost,
tags = tags.iconOneTags
)
if (iconTwo != null) TUIIconButton(
icon = iconTwo,
onIconClick = onIconTwoClick,
iconButtonStyle = GHOST,
iconButtonStyle = Ghost,
tags = tags.iconTwoTags

)
Expand Down
Loading

0 comments on commit 8355bce

Please sign in to comment.