Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cmp-android/dependencies/demoDebugRuntimeClasspath.txt
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ io.coil-kt.coil3:coil-svg:3.2.0
io.coil-kt.coil3:coil:3.2.0
io.github.niyajali:compose-signature-android:1.0.1
io.github.niyajali:compose-signature:1.0.1
io.github.niyajali:fluentui-system-icons-android:1.0.0
io.github.niyajali:fluentui-system-icons:1.0.0
io.github.vinceglb:filekit-coil-android:0.10.0-beta04
io.github.vinceglb:filekit-coil:0.10.0-beta04
io.github.vinceglb:filekit-compose-android:0.8.8
Expand Down
2 changes: 2 additions & 0 deletions cmp-android/dependencies/demoReleaseRuntimeClasspath.txt
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ io.coil-kt.coil3:coil-svg:3.2.0
io.coil-kt.coil3:coil:3.2.0
io.github.niyajali:compose-signature-android:1.0.1
io.github.niyajali:compose-signature:1.0.1
io.github.niyajali:fluentui-system-icons-android:1.0.0
io.github.niyajali:fluentui-system-icons:1.0.0
io.github.vinceglb:filekit-coil-android:0.10.0-beta04
io.github.vinceglb:filekit-coil:0.10.0-beta04
io.github.vinceglb:filekit-compose-android:0.8.8
Expand Down
2 changes: 2 additions & 0 deletions cmp-android/dependencies/prodDebugRuntimeClasspath.txt
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ io.coil-kt.coil3:coil-svg:3.2.0
io.coil-kt.coil3:coil:3.2.0
io.github.niyajali:compose-signature-android:1.0.1
io.github.niyajali:compose-signature:1.0.1
io.github.niyajali:fluentui-system-icons-android:1.0.0
io.github.niyajali:fluentui-system-icons:1.0.0
io.github.vinceglb:filekit-coil-android:0.10.0-beta04
io.github.vinceglb:filekit-coil:0.10.0-beta04
io.github.vinceglb:filekit-compose-android:0.8.8
Expand Down
2 changes: 2 additions & 0 deletions cmp-android/dependencies/prodReleaseRuntimeClasspath.txt
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ io.coil-kt.coil3:coil-svg:3.2.0
io.coil-kt.coil3:coil:3.2.0
io.github.niyajali:compose-signature-android:1.0.1
io.github.niyajali:compose-signature:1.0.1
io.github.niyajali:fluentui-system-icons-android:1.0.0
io.github.niyajali:fluentui-system-icons:1.0.0
io.github.vinceglb:filekit-coil-android:0.10.0-beta04
io.github.vinceglb:filekit-coil:0.10.0-beta04
io.github.vinceglb:filekit-compose-android:0.8.8
Expand Down
1 change: 1 addition & 0 deletions core/designsystem/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ kotlin {
implementation(compose.components.uiToolingPreview)
api(libs.back.handler)
api(libs.window.size)
implementation(libs.fluentui.system.icons)
}

nativeMain.dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.unit.dp
import com.mifos.core.designsystem.theme.DesignToken
import com.mifos.core.designsystem.theme.MifosTheme
import org.jetbrains.compose.ui.tooling.preview.Preview

Expand All @@ -51,10 +52,12 @@ fun MifosButton(
onClick: () -> Unit,
modifier: Modifier = Modifier,
enabled: Boolean = true,
shape: Shape = ButtonDefaults.shape,
shape: Shape = DesignToken.shapes.medium,
contentPadding: PaddingValues = ButtonDefaults.ContentPadding,
elevation: ButtonElevation? = ButtonDefaults.buttonElevation(),
colors: ButtonColors = ButtonDefaults.buttonColors(),
colors: ButtonColors = ButtonDefaults.buttonColors(
containerColor = MaterialTheme.colorScheme.background,
),
content: @Composable RowScope.() -> Unit = {},
) {
Button(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ import androidx.compose.material.icons.rounded.Sync
import androidx.compose.material.icons.rounded.Task
import androidx.compose.material.icons.rounded.Translate
import androidx.compose.ui.graphics.vector.ImageVector
import fluent.ui.system.icons.FluentIcons
import fluent.ui.system.icons.filled.ChevronRight
import fluent.ui.system.icons.filled.Person
import fluent.ui.system.icons.regular.ChevronLeft

object MifosIcons {
val Add = Icons.Rounded.Add
Expand Down Expand Up @@ -202,4 +206,8 @@ object MifosIcons {
val AddFilled = Icons.Filled.Add

val Payments = Icons.Filled.Payments

val ChevronLeft = FluentIcons.Regular.ChevronLeft
val ChevronRight = FluentIcons.Filled.ChevronRight
val ProfileSet = FluentIcons.Filled.Person
}
28 changes: 28 additions & 0 deletions core/ui/src/commonMain/composeResources/drawable/ic_icon_error.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2025 Mifos Initiative

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
If a copy of the MPL was not distributed with this file,
You can obtain one at https://mozilla.org/MPL/2.0/.

See https://github.com/openMF/android-client/blob/master/LICENSE.md
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="96dp"
android:height="96dp"
android:viewportWidth="96"
android:viewportHeight="96">

<path
android:fillColor="#E0E2E8"
android:pathData="M48,0a48,48 0 1,0 0,96a48,48 0 1,0 0,-96z" />

<path
android:fillColor="#93000A"
android:pathData="M47.9932,10.6602a37.3333,37.3333 0 1,0 0.0001,74.6666a37.3333,37.3333 0 1,0 -0.0001,-74.6666z" />

<path
android:fillColor="#FFFFFF"
android:pathData="M37.5467,61.0669L34.9333,58.4536L45.3867,48.0003L34.9333,37.5469L37.5467,34.9336L48,45.3869L58.4534,34.9336L61.0667,37.5469L50.6134,48.0003L61.0667,58.4536L58.4534,61.0669L48,50.6136L37.5467,61.0669Z" />
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2025 Mifos Initiative

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
If a copy of the MPL was not distributed with this file,
You can obtain one at https://mozilla.org/MPL/2.0/.

See https://github.com/openMF/android-client/blob/master/LICENSE.md
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="96dp"
android:height="96dp"
android:viewportWidth="96"
android:viewportHeight="96">

<path
android:fillColor="#E0E2E8"
android:pathData="M48,0a48,48 0 1,0 0,96a48,48 0 1,0 0,-96z" />

<path
android:fillColor="#009325"
android:pathData="M47.9932,10.6602a37.3333,37.3333 0 1,0 0.0001,74.6666a37.3333,37.3333 0 1,0 -0.0001,-74.6666z" />

<path
android:fillColor="#FFFFFF"
android:pathData="M43.4266,59.2001L32.7866,48.5601L35.4466,45.9001L43.4266,53.8801L60.5533,36.7534L63.2133,39.4134L43.4266,59.2001Z" />
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/*
* Copyright 2025 Mifos Initiative
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
* See https://github.com/openMF/android-client/blob/master/LICENSE.md
*/
package com.mifos.core.ui.components

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import com.mifos.core.designsystem.theme.DesignToken
import com.mifos.core.designsystem.theme.MifosTypography
import org.jetbrains.compose.ui.tooling.preview.Preview

@Composable
fun MifosAddressCard(
title: String,
addressList: Map<String, String>,
modifier: Modifier = Modifier,
) {
MifosListingComponentOutline {
Column(
modifier.fillMaxWidth(),
verticalArrangement = Arrangement.spacedBy(DesignToken.padding.extraSmall),
) {
Text(
text = title,
style = MifosTypography.titleMediumEmphasized,
)
Spacer(Modifier.height(DesignToken.padding.medium))
addressList.forEach { (key, value) ->
MifosAddressItem(key, value)
Spacer(Modifier.height(DesignToken.padding.small))
}
}
}
}

@Composable
fun MifosAddressItem(
addressLabel: String,
addressValue: String,
modifier: Modifier = Modifier,
) {
Column(
modifier.fillMaxWidth(),
verticalArrangement = Arrangement.spacedBy(DesignToken.padding.extraExtraSmall),
) {
Text(
text = addressLabel,
style = MifosTypography.labelSmall,
color = MaterialTheme.colorScheme.secondary,
)
Text(
text = addressValue,
style = MifosTypography.bodySmall,
)
}
}

@Preview
@Composable
fun MifosAddressCardPreview() {
val sampleAddresses = mapOf(
"Address 1" to "123, MG Road",
"Address 2" to "2nd Floor, Lotus Building",
"City" to "Bengaluru",
"State" to "Karnataka",
"Pincode" to "560001",
"Country" to "India",
)

MifosAddressCard(
title = "Client Address",
addressList = sampleAddresses,
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Copyright 2025 Mifos Initiative
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
* See https://github.com/openMF/android-client/blob/master/LICENSE.md
*/
package com.mifos.core.ui.components

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import com.mifos.core.designsystem.theme.DesignToken
import com.mifos.core.designsystem.theme.MifosTheme
import com.mifos.core.designsystem.theme.MifosTypography
import org.jetbrains.compose.ui.tooling.preview.Preview

@Composable
fun MifosEmptyCard(
msg: String,
modifier: Modifier = Modifier,
) {
MifosListingComponentOutline {
Column(modifier.fillMaxWidth()) {
Text(
text = "No Item Found",
style = MifosTypography.titleSmallEmphasized,
)
Spacer(Modifier.height((DesignToken.padding.medium)))
Text(
text = msg,
style = MifosTypography.bodySmall,
)
}
}
}

@Preview
@Composable
fun MifosEmptyCardPreview() {
MifosTheme {
MifosEmptyCard("Add any to show")
}
}
Loading