-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
853 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
...ystem/src/commonMain/kotlin/team/aliens/dms/kmp/core/designsystem/checkbox/DmsCheckbox.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package team.aliens.dms.kmp.core.designsystem.checkbox | ||
|
||
import androidx.compose.foundation.interaction.MutableInteractionSource | ||
import androidx.compose.material.Checkbox | ||
import androidx.compose.material.CheckboxColors | ||
import androidx.compose.material.CheckboxDefaults | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import team.aliens.dms.kmp.core.designsystem.foundation.DmsTheme | ||
|
||
@Composable | ||
fun DmsCheckbox( | ||
checked: Boolean, | ||
onCheckedChange: ((Boolean) -> Unit)?, | ||
modifier: Modifier = Modifier, | ||
enabled: Boolean = true, | ||
colors: CheckboxColors = DmsCheckboxDefaults.Colors(), | ||
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, | ||
) { | ||
Checkbox( | ||
checked = checked, | ||
onCheckedChange = onCheckedChange, | ||
modifier = modifier, | ||
enabled = enabled, | ||
colors = colors, | ||
interactionSource = interactionSource, | ||
) | ||
} | ||
|
||
object DmsCheckboxDefaults { | ||
|
||
private const val DISABLED_CONTAINER_OPACITY = 0.38f | ||
|
||
@Composable | ||
fun Colors( | ||
checkedColor: Color = DmsTheme.colors.secondary, | ||
uncheckedColor: Color = DmsTheme.colors.inverseSurface, | ||
checkmarkColor: Color = DmsTheme.colors.surfaceTint, | ||
disabledColor: Color = DmsTheme.colors.primaryContainer, | ||
disabledIndeterminateColor: Color = checkedColor.copy(alpha = DISABLED_CONTAINER_OPACITY), | ||
): CheckboxColors = CheckboxDefaults.colors( | ||
checkedColor = checkedColor, | ||
uncheckedColor = uncheckedColor, | ||
checkmarkColor = checkmarkColor, | ||
disabledColor = disabledColor, | ||
disabledIndeterminateColor = disabledIndeterminateColor, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...up/src/commonMain/kotlin/team/aliens/dms/kmp/feature/signup/component/SignUpInfoBanner.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package team.aliens.dms.kmp.feature.signup.component | ||
|
||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.unit.dp | ||
import team.aliens.dms.kmp.core.designsystem.foundation.DmsTheme | ||
import team.aliens.dms.kmp.core.designsystem.foundation.DmsTypography | ||
import team.aliens.dms.kmp.core.designsystem.text.DmsText | ||
|
||
@Composable | ||
internal fun SignUpInfoBanner( | ||
modifier: Modifier = Modifier, | ||
title: String, | ||
description: String, | ||
) { | ||
Column( | ||
modifier = modifier.fillMaxWidth(), | ||
verticalArrangement = Arrangement.spacedBy(8.dp), | ||
) { | ||
DmsText( | ||
text = title, | ||
style = DmsTypography.Header3, | ||
) | ||
DmsText( | ||
text = description, | ||
style = DmsTypography.Body1, | ||
color = DmsTheme.colors.inverseOnSurface, | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...Main/kotlin/team/aliens/dms/kmp/feature/signup/navigation/EnterStudentNumberNavigation.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package team.aliens.dms.kmp.feature.signup.navigation | ||
|
||
import androidx.navigation.NavController | ||
import androidx.navigation.NavGraphBuilder | ||
import androidx.navigation.NavType | ||
import androidx.navigation.compose.composable | ||
import androidx.navigation.navArgument | ||
import team.aliens.dms.kmp.core.common.utils.ResourceKeys | ||
import team.aliens.dms.kmp.feature.signup.model.SignUpData | ||
import team.aliens.dms.kmp.feature.signup.model.toJsonString | ||
import team.aliens.dms.kmp.feature.signup.ui.EnterStudentNumber | ||
|
||
const val NAVIGATION_ENTER_STUDENT_NUMBER = "enterStudentNumber" | ||
|
||
fun NavGraphBuilder.enterStudentNumber( | ||
onBackPressed: () -> Unit, | ||
navigateToSetId: (SignUpData) -> Unit, | ||
) { | ||
composable( | ||
route = "$NAVIGATION_ENTER_STUDENT_NUMBER/{${ResourceKeys.SIGN_UP}}", | ||
arguments = listOf(navArgument(ResourceKeys.SIGN_UP) { type = NavType.StringType }), | ||
) { | ||
EnterStudentNumber( | ||
onBackPressed = onBackPressed, | ||
navigateToSetId = navigateToSetId, | ||
signUpData = it.getSignUpData(), | ||
) | ||
} | ||
} | ||
|
||
fun NavController.navigateToEnterStudentNumber(signUpData: SignUpData) { | ||
navigate("$NAVIGATION_ENTER_STUDENT_NUMBER/${signUpData.toJsonString()}") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.