Skip to content

Commit

Permalink
Merge pull request #128 from tarkalabs/nilesh/tuiSearchBar/changes
Browse files Browse the repository at this point in the history
- Small UI change in TUISelectionCard
  • Loading branch information
rajajawahar authored Oct 5, 2023
2 parents 01d9a24 + dd350d9 commit 1e97017
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tarkaui/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 = "0.47-alpha"
version = "0.48-alpha"
artifact("$buildDir/outputs/aar/${getLibraryArtifactId()}-release.aar")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,15 @@ import com.tarkalabs.tarkaicons.ChevronRight24
import com.tarkalabs.tarkaicons.Person24
import com.tarkalabs.tarkaicons.TarkaIcon
import com.tarkalabs.tarkaicons.TarkaIcons
import com.tarkalabs.uicomponents.components.SecondaryDetailsStyle.ERROR
import com.tarkalabs.uicomponents.components.SecondaryDetailsStyle.NORMAL
import com.tarkalabs.uicomponents.components.base.TUIBadge
import com.tarkalabs.uicomponents.theme.TUITheme

enum class SecondaryDetailsStyle {
NORMAL,
ERROR
}
/**
* This Composable function is used to Show the Cards in a list to pick the particular from User.
*
Expand All @@ -39,6 +45,7 @@ import com.tarkalabs.uicomponents.theme.TUITheme
* @param secondaryDescription - Optional additional description of the card.
* @param primaryDetails - Optional details of the card.
* @param secondaryDetails - Optional second details of the card.
* @param secondaryDetailStyle - Optional text color style for secondaryDetails.
* @param badgeCount - Optional Count Details which is shown in Badge style.
* @param showTrailingIcon - boolean indicated to shown the frontArrow at the end of the card.
* @param isSelected - a boolean which indicates current clicked state of the card.
Expand All @@ -56,6 +63,7 @@ fun TUISelectionCard(
secondaryDescription: String? = null,
primaryDetails: String? = null,
secondaryDetails: String? = null,
secondaryDetailStyle: SecondaryDetailsStyle = SecondaryDetailsStyle.NORMAL,
badgeCount: Int? = null,
showTrailingIcon: Boolean = false,
isSelected: Boolean = false,
Expand Down Expand Up @@ -132,7 +140,7 @@ fun TUISelectionCard(
Text(
modifier = Modifier.testTag(tags.details2Tag),
text = it,
color = TUITheme.colors.inputTextDim.copy(alpha = 0.7f),
color = if(secondaryDetailStyle == NORMAL) TUITheme.colors.inputTextDim.copy(alpha = 0.7f) else TUITheme.colors.error,
style = TUITheme.typography.body7
)
}
Expand Down Expand Up @@ -186,6 +194,17 @@ fun TUISelectionCardPreview() {
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center
) {
TUISelectionCard(
label = "itemNum",
primaryDescription = "item Description",
primaryDetails = "location",
secondaryDetails = "- 11 Unit",
secondaryDetailStyle = ERROR,
showTrailingIcon = false
) {
}
VerticalSpacer(space = 14)

TUISelectionCard(
label = null,
primaryDescription = "Description",
Expand Down Expand Up @@ -213,6 +232,7 @@ fun TUISelectionCardPreview() {
secondaryDescription = "Description2",
primaryDetails = "Details",
secondaryDetails = "Details2",
secondaryDetailStyle = ERROR,
badgeCount = 4,
showTrailingIcon = true
) {}
Expand Down Expand Up @@ -247,6 +267,7 @@ fun TUISelectionCardPreview() {
label = "Label",
primaryDescription = "Description",
secondaryDescription = "Description2",
secondaryDetailStyle = ERROR,
primaryDetails = "Details",
secondaryDetails = "Details2",
badgeCount = 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ scrollBehavior = TopAppBarScrollBehavior.ScrollOnAppBarScroll, // Optional: Spec
) {
if (showSearchBar) {
TUISearchBar(
modifier = Modifier,
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp)
,
query = query,
placeholder = "",
leadingIcon = TarkaIcons.Regular.ChevronLeft24,
Expand Down

0 comments on commit 1e97017

Please sign in to comment.