From 3c4ecc65926fe29100e3f91a807039d32e2d2a80 Mon Sep 17 00:00:00 2001 From: Kevin Schildhorn Date: Mon, 4 Dec 2023 09:34:42 -0500 Subject: [PATCH 1/5] moreformatting --- .../atomic/atoms/xml/TextViewExtensions.kt | 1 - .../atomik/atomic/atoms/xml/ViewExtensions.kt | 1 - .../typography/AtomikTypographyExtensions.kt | 1 - .../atomik/atomic/atoms/Atom.kt | 3 +- .../atomic/atoms/compose/+AtomikColorType.kt | 1 - .../atomic/atoms/compose/+ConstrainedAtom.kt | 1 - .../atomic/atoms/compose/+EnablableAtom.kt | 1 - .../atomic/atoms/compose/+FixedSizeAtom.kt | 1 - .../atomic/atoms/compose/+RoundedAtom.kt | 1 - .../atomik/atomic/atoms/compose/+TextAtom.kt | 1 - .../molecules/OutlinedTextFieldMolecule.kt | 43 +++++++++---------- .../atomic/molecules/TextFieldMolecule.kt | 28 ++++++------ shared/src/androidMain/kotlin/Main.android.kt | 3 +- .../fotopresenter/data/LoginCredentials.kt | 6 +-- .../fotopresenter/ui/compose/LoginScreen.kt | 10 ++--- .../ui/compose/common/ErrorView.kt | 8 ++-- .../ui/compose/common/PrimaryButton.kt | 8 ++-- 17 files changed, 55 insertions(+), 63 deletions(-) diff --git a/atomik/src/androidMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/xml/TextViewExtensions.kt b/atomik/src/androidMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/xml/TextViewExtensions.kt index 48336f2f..b4c03cfb 100644 --- a/atomik/src/androidMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/xml/TextViewExtensions.kt +++ b/atomik/src/androidMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/xml/TextViewExtensions.kt @@ -1,4 +1,3 @@ - @file:Suppress("ktlint:standard:filename") package com.kevinschildhorn.atomik.atomic.atoms.xml diff --git a/atomik/src/androidMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/xml/ViewExtensions.kt b/atomik/src/androidMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/xml/ViewExtensions.kt index 869e2cf6..2d830197 100644 --- a/atomik/src/androidMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/xml/ViewExtensions.kt +++ b/atomik/src/androidMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/xml/ViewExtensions.kt @@ -1,4 +1,3 @@ - @file:Suppress("ktlint:standard:filename") package com.kevinschildhorn.atomik.atomic.atoms.xml diff --git a/atomik/src/androidMain/kotlin/com/kevinschildhorn/atomik/typography/AtomikTypographyExtensions.kt b/atomik/src/androidMain/kotlin/com/kevinschildhorn/atomik/typography/AtomikTypographyExtensions.kt index f8766559..ebaad42f 100644 --- a/atomik/src/androidMain/kotlin/com/kevinschildhorn/atomik/typography/AtomikTypographyExtensions.kt +++ b/atomik/src/androidMain/kotlin/com/kevinschildhorn/atomik/typography/AtomikTypographyExtensions.kt @@ -1,4 +1,3 @@ - @file:Suppress("ktlint:standard:filename") package com.kevinschildhorn.atomik.typography diff --git a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/Atom.kt b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/Atom.kt index 17b517e8..7fbaea50 100644 --- a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/Atom.kt +++ b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/Atom.kt @@ -35,5 +35,6 @@ public abstract class Atom { * Finds a subComponent matching a specified [AtomInterface] if it exists * @return the subComponent of a specified interface if it's found */ - public inline fun subAtom(): T? = subComponents.find { it is T } as? T + public inline fun subAtom(): T? = + subComponents.find { it is T } as? T } diff --git a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+AtomikColorType.kt b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+AtomikColorType.kt index 474578e1..beee947a 100644 --- a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+AtomikColorType.kt +++ b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+AtomikColorType.kt @@ -1,4 +1,3 @@ - @file:Suppress("ktlint:standard:filename") package com.kevinschildhorn.atomik.atomic.atoms.compose diff --git a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+ConstrainedAtom.kt b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+ConstrainedAtom.kt index 92124a96..60b794cc 100644 --- a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+ConstrainedAtom.kt +++ b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+ConstrainedAtom.kt @@ -1,4 +1,3 @@ - @file:Suppress("ktlint:standard:filename") package com.kevinschildhorn.atomik.atomic.atoms diff --git a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+EnablableAtom.kt b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+EnablableAtom.kt index e0cfe9e0..3a7e1013 100644 --- a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+EnablableAtom.kt +++ b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+EnablableAtom.kt @@ -1,4 +1,3 @@ - @file:Suppress("ktlint:standard:filename") package com.kevinschildhorn.atomik.atomic.atoms.compose diff --git a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+FixedSizeAtom.kt b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+FixedSizeAtom.kt index e736fff1..1fdf5825 100644 --- a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+FixedSizeAtom.kt +++ b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+FixedSizeAtom.kt @@ -1,4 +1,3 @@ - @file:Suppress("ktlint:standard:filename") package com.kevinschildhorn.atomik.atomic.atoms diff --git a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+RoundedAtom.kt b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+RoundedAtom.kt index e2af884e..b7cb7ba7 100644 --- a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+RoundedAtom.kt +++ b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+RoundedAtom.kt @@ -1,4 +1,3 @@ - @file:Suppress("ktlint:standard:filename") package com.kevinschildhorn.atomik.atomic.atoms diff --git a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+TextAtom.kt b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+TextAtom.kt index 1431ebfa..296a704d 100644 --- a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+TextAtom.kt +++ b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/compose/+TextAtom.kt @@ -1,4 +1,3 @@ - @file:Suppress("ktlint:standard:filename") package com.kevinschildhorn.atomik.atomic.atoms diff --git a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/molecules/OutlinedTextFieldMolecule.kt b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/molecules/OutlinedTextFieldMolecule.kt index 5c144c65..9ae70090 100644 --- a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/molecules/OutlinedTextFieldMolecule.kt +++ b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/molecules/OutlinedTextFieldMolecule.kt @@ -35,18 +35,17 @@ public open class OutlinedTextFieldMolecule( override val unFocusedBorderColor: AtomikColor = focusedBorderColor, override val radius: Int, ) : TextFieldMolecule( - textAtom, - backgroundColorAtom, - hintTextAtom, - errorTextAtom, - disabledColorAtom, - cursorColor, - errorColor, - ), - BorderedAtom, - RoundedAtom { + textAtom, + backgroundColorAtom, + hintTextAtom, + errorTextAtom, + disabledColorAtom, + cursorColor, + errorColor, +), BorderedAtom, RoundedAtom { + @Composable - public fun colors(): TextFieldColors { + public override fun colors(): TextFieldColors { val textColor = textAtom.textColor.composeColor val backgroundColor = backgroundColorAtom.color.composeColor val disabledBackgroundColor = backgroundColor.copy(alpha = ContentAlpha.disabled) @@ -56,26 +55,26 @@ public open class OutlinedTextFieldMolecule( textColor = textColor, backgroundColor = backgroundColor, placeholderColor = - hintTextAtom?.textColor?.composeColor ?: backgroundColor.copy( - ContentAlpha.medium, - ), + hintTextAtom?.textColor?.composeColor ?: backgroundColor.copy( + ContentAlpha.medium, + ), cursorColor = cursorColor?.composeColor ?: textColor, focusedBorderColor = focusedBorderColor.composeColor, unfocusedBorderColor = unFocusedBorderColor.composeColor, disabledTextColor = - disabledColorAtom?.color?.composeColor - ?: textColor.copy(ContentAlpha.disabled), + disabledColorAtom?.color?.composeColor + ?: textColor.copy(ContentAlpha.disabled), disabledBorderColor = disabledColorAtom?.color?.composeColor ?: disabledBackgroundColor, disabledLabelColor = disabledColorAtom?.color?.composeColor ?: disabledBackgroundColor, disabledLeadingIconColor = - disabledColorAtom?.color?.composeColor - ?: disabledBackgroundColor, + disabledColorAtom?.color?.composeColor + ?: disabledBackgroundColor, disabledPlaceholderColor = - disabledColorAtom?.color?.composeColor - ?: disabledBackgroundColor, + disabledColorAtom?.color?.composeColor + ?: disabledBackgroundColor, disabledTrailingIconColor = - disabledColorAtom?.color?.composeColor - ?: disabledBackgroundColor, + disabledColorAtom?.color?.composeColor + ?: disabledBackgroundColor, errorCursorColor = errorColor?.composeColor ?: errorTextColor, errorBorderColor = errorColor?.composeColor ?: errorTextColor, errorLabelColor = errorColor?.composeColor ?: errorTextColor, diff --git a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/molecules/TextFieldMolecule.kt b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/molecules/TextFieldMolecule.kt index 45edde9e..dff77771 100644 --- a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/molecules/TextFieldMolecule.kt +++ b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/molecules/TextFieldMolecule.kt @@ -34,7 +34,7 @@ public open class TextFieldMolecule( get() = listOf() @Composable - public fun colors(): TextFieldColors { + public open fun colors(): TextFieldColors { val textColor = textAtom.textColor.composeColor val backgroundColor = backgroundColorAtom.color.composeColor val disabledBackgroundColor = backgroundColor.copy(alpha = ContentAlpha.disabled) @@ -44,26 +44,26 @@ public open class TextFieldMolecule( textColor = textColor, backgroundColor = backgroundColor, placeholderColor = - hintTextAtom?.textColor?.composeColor ?: backgroundColor.copy( - ContentAlpha.medium, - ), + hintTextAtom?.textColor?.composeColor ?: backgroundColor.copy( + ContentAlpha.medium, + ), cursorColor = cursorColor?.composeColor ?: textColor, disabledTextColor = - disabledColorAtom?.color?.composeColor - ?: textColor.copy(ContentAlpha.disabled), + disabledColorAtom?.color?.composeColor + ?: textColor.copy(ContentAlpha.disabled), disabledIndicatorColor = - disabledColorAtom?.color?.composeColor - ?: disabledBackgroundColor, + disabledColorAtom?.color?.composeColor + ?: disabledBackgroundColor, disabledLabelColor = disabledColorAtom?.color?.composeColor ?: disabledBackgroundColor, disabledLeadingIconColor = - disabledColorAtom?.color?.composeColor - ?: disabledBackgroundColor, + disabledColorAtom?.color?.composeColor + ?: disabledBackgroundColor, disabledPlaceholderColor = - disabledColorAtom?.color?.composeColor - ?: disabledBackgroundColor, + disabledColorAtom?.color?.composeColor + ?: disabledBackgroundColor, disabledTrailingIconColor = - disabledColorAtom?.color?.composeColor - ?: disabledBackgroundColor, + disabledColorAtom?.color?.composeColor + ?: disabledBackgroundColor, errorCursorColor = errorColor?.composeColor ?: errorTextColor, errorIndicatorColor = errorColor?.composeColor ?: errorTextColor, errorLabelColor = errorColor?.composeColor ?: errorTextColor, diff --git a/shared/src/androidMain/kotlin/Main.android.kt b/shared/src/androidMain/kotlin/Main.android.kt index 02e27d54..ff5574ca 100644 --- a/shared/src/androidMain/kotlin/Main.android.kt +++ b/shared/src/androidMain/kotlin/Main.android.kt @@ -3,4 +3,5 @@ import com.kevinschildhorn.fotopresenter.ui.viewmodel.LoginViewModel actual fun getPlatformName(): String = "Android" -@Composable fun MainView(viewModel: LoginViewModel) = App(viewModel) +@Composable +fun MainView(viewModel: LoginViewModel) = App(viewModel) diff --git a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/data/LoginCredentials.kt b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/data/LoginCredentials.kt index 1a9d4444..4e21dff6 100644 --- a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/data/LoginCredentials.kt +++ b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/data/LoginCredentials.kt @@ -13,7 +13,7 @@ data class LoginCredentials( val isComplete: Boolean get() = hostname.isNotBlank() && - username.isNotBlank() && - password.isNotBlank() && - sharedFolder.isNotBlank() + username.isNotBlank() && + password.isNotBlank() && + sharedFolder.isNotBlank() } diff --git a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/LoginScreen.kt b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/LoginScreen.kt index 52141fb2..78896a9a 100644 --- a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/LoginScreen.kt +++ b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/LoginScreen.kt @@ -33,11 +33,11 @@ fun LoginScreen( TitleView( "Foto", modifier = - Modifier.padding( - top = Padding.SMALL.dp, - start = Padding.STANDARD.dp, - bottom = Padding.LARGE.dp, - ), + Modifier.padding( + top = Padding.SMALL.dp, + start = Padding.STANDARD.dp, + bottom = Padding.LARGE.dp, + ), ) LoginScreenForm( uiState = uiState, diff --git a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/common/ErrorView.kt b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/common/ErrorView.kt index 65e73ae0..9bbbf39f 100644 --- a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/common/ErrorView.kt +++ b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/common/ErrorView.kt @@ -24,10 +24,10 @@ fun ErrorView( } Box( modifier = - configuredModifier.padding( - horizontal = atom.paddingHorizontal?.dp ?: 0.dp, - vertical = atom.paddingVertical?.dp ?: 0.dp, - ), + configuredModifier.padding( + horizontal = atom.paddingHorizontal?.dp ?: 0.dp, + vertical = atom.paddingVertical?.dp ?: 0.dp, + ), ) { Text( text = message, diff --git a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/common/PrimaryButton.kt b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/common/PrimaryButton.kt index 96ff0768..6adff0cd 100644 --- a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/common/PrimaryButton.kt +++ b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/compose/common/PrimaryButton.kt @@ -26,10 +26,10 @@ fun PrimaryButton( modifier = modifier.height(44.dp), enabled = buttonState.enabled, colors = - ButtonDefaults.buttonColors( - backgroundColor = molecule.color.composeColor, - disabledBackgroundColor = molecule.disabledColor.composeColor, - ), + ButtonDefaults.buttonColors( + backgroundColor = molecule.color.composeColor, + disabledBackgroundColor = molecule.disabledColor.composeColor, + ), ) { if (buttonState.loading) { CircularProgressIndicator( From c5a12aebece59491f95417fe10f7aa7f69a2aa3b Mon Sep 17 00:00:00 2001 From: Kevin Schildhorn Date: Mon, 4 Dec 2023 09:38:19 -0500 Subject: [PATCH 2/5] another try --- .github/workflows/lint-action.yml | 19 +++---------------- .../molecules/OutlinedTextFieldMolecule.kt | 4 +++- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/.github/workflows/lint-action.yml b/.github/workflows/lint-action.yml index 31bd1d84..6984f4a4 100644 --- a/.github/workflows/lint-action.yml +++ b/.github/workflows/lint-action.yml @@ -16,20 +16,7 @@ jobs: distribution: "adopt" java-version: "17" - - uses: reviewdog/action-setup@v1 - - uses: touchlab-lab/ktlint-action-setup@1.0.0 - with: - ktlint_version: 0.50.0 - - - name: Run reviewdog + - name: Run ktlint with reviewdog + uses: ScaCap/action-ktlint@v1.8.0 env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - ktlint --reporter=checkstyle --relative \ - | reviewdog -f=checkstyle -name="ktlint" -reporter=github-pr-review -filter-mode=added -level=warning - - - - - - + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/molecules/OutlinedTextFieldMolecule.kt b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/molecules/OutlinedTextFieldMolecule.kt index 9ae70090..aaf1731b 100644 --- a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/molecules/OutlinedTextFieldMolecule.kt +++ b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/molecules/OutlinedTextFieldMolecule.kt @@ -42,7 +42,9 @@ public open class OutlinedTextFieldMolecule( disabledColorAtom, cursorColor, errorColor, -), BorderedAtom, RoundedAtom { +), + BorderedAtom, + RoundedAtom { @Composable public override fun colors(): TextFieldColors { From 35774266de46abdc80960b74fcb6eb09f4e6fa70 Mon Sep 17 00:00:00 2001 From: Kevin Schildhorn Date: Mon, 4 Dec 2023 09:40:23 -0500 Subject: [PATCH 3/5] Update lint-action.yml --- .github/workflows/lint-action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint-action.yml b/.github/workflows/lint-action.yml index 6984f4a4..5647dfe9 100644 --- a/.github/workflows/lint-action.yml +++ b/.github/workflows/lint-action.yml @@ -18,5 +18,5 @@ jobs: - name: Run ktlint with reviewdog uses: ScaCap/action-ktlint@v1.8.0 - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + with: + github_token: ${{ secrets.github_token }} From 8170df76c4493a62a37ef4e8c5893f4a0a465234 Mon Sep 17 00:00:00 2001 From: Kevin Schildhorn Date: Mon, 4 Dec 2023 09:41:17 -0500 Subject: [PATCH 4/5] Update lint-action.yml --- .github/workflows/lint-action.yml | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/.github/workflows/lint-action.yml b/.github/workflows/lint-action.yml index 5647dfe9..9c9ddbb5 100644 --- a/.github/workflows/lint-action.yml +++ b/.github/workflows/lint-action.yml @@ -1,22 +1,16 @@ -name: Lint Action -on: - pull_request: - paths: - - '**/*.kt' - +name: reviewdog +on: [pull_request] jobs: - build: + ktlint: + name: Check Code Quality runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - - uses: actions/setup-java@v2 + - name: Clone repo + uses: actions/checkout@master with: - distribution: "adopt" - java-version: "17" - - - name: Run ktlint with reviewdog - uses: ScaCap/action-ktlint@v1.8.0 + fetch-depth: 1 + - name: ktlint + uses: ScaCap/action-ktlint@master with: github_token: ${{ secrets.github_token }} From 44a75e50b9597509257ab561c0fbef08ed2c280f Mon Sep 17 00:00:00 2001 From: Kevin Schildhorn Date: Mon, 4 Dec 2023 09:43:22 -0500 Subject: [PATCH 5/5] formatting --- .../atomik/atomic/atoms/Atom.kt | 3 +- .../molecules/OutlinedTextFieldMolecule.kt | 39 +++++++++---------- .../atomic/molecules/TextFieldMolecule.kt | 26 ++++++------- 3 files changed, 33 insertions(+), 35 deletions(-) diff --git a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/Atom.kt b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/Atom.kt index 7fbaea50..17b517e8 100644 --- a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/Atom.kt +++ b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/atoms/Atom.kt @@ -35,6 +35,5 @@ public abstract class Atom { * Finds a subComponent matching a specified [AtomInterface] if it exists * @return the subComponent of a specified interface if it's found */ - public inline fun subAtom(): T? = - subComponents.find { it is T } as? T + public inline fun subAtom(): T? = subComponents.find { it is T } as? T } diff --git a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/molecules/OutlinedTextFieldMolecule.kt b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/molecules/OutlinedTextFieldMolecule.kt index aaf1731b..e31ae0fe 100644 --- a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/molecules/OutlinedTextFieldMolecule.kt +++ b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/molecules/OutlinedTextFieldMolecule.kt @@ -35,17 +35,16 @@ public open class OutlinedTextFieldMolecule( override val unFocusedBorderColor: AtomikColor = focusedBorderColor, override val radius: Int, ) : TextFieldMolecule( - textAtom, - backgroundColorAtom, - hintTextAtom, - errorTextAtom, - disabledColorAtom, - cursorColor, - errorColor, -), + textAtom, + backgroundColorAtom, + hintTextAtom, + errorTextAtom, + disabledColorAtom, + cursorColor, + errorColor, + ), BorderedAtom, RoundedAtom { - @Composable public override fun colors(): TextFieldColors { val textColor = textAtom.textColor.composeColor @@ -57,26 +56,26 @@ public open class OutlinedTextFieldMolecule( textColor = textColor, backgroundColor = backgroundColor, placeholderColor = - hintTextAtom?.textColor?.composeColor ?: backgroundColor.copy( - ContentAlpha.medium, - ), + hintTextAtom?.textColor?.composeColor ?: backgroundColor.copy( + ContentAlpha.medium, + ), cursorColor = cursorColor?.composeColor ?: textColor, focusedBorderColor = focusedBorderColor.composeColor, unfocusedBorderColor = unFocusedBorderColor.composeColor, disabledTextColor = - disabledColorAtom?.color?.composeColor - ?: textColor.copy(ContentAlpha.disabled), + disabledColorAtom?.color?.composeColor + ?: textColor.copy(ContentAlpha.disabled), disabledBorderColor = disabledColorAtom?.color?.composeColor ?: disabledBackgroundColor, disabledLabelColor = disabledColorAtom?.color?.composeColor ?: disabledBackgroundColor, disabledLeadingIconColor = - disabledColorAtom?.color?.composeColor - ?: disabledBackgroundColor, + disabledColorAtom?.color?.composeColor + ?: disabledBackgroundColor, disabledPlaceholderColor = - disabledColorAtom?.color?.composeColor - ?: disabledBackgroundColor, + disabledColorAtom?.color?.composeColor + ?: disabledBackgroundColor, disabledTrailingIconColor = - disabledColorAtom?.color?.composeColor - ?: disabledBackgroundColor, + disabledColorAtom?.color?.composeColor + ?: disabledBackgroundColor, errorCursorColor = errorColor?.composeColor ?: errorTextColor, errorBorderColor = errorColor?.composeColor ?: errorTextColor, errorLabelColor = errorColor?.composeColor ?: errorTextColor, diff --git a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/molecules/TextFieldMolecule.kt b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/molecules/TextFieldMolecule.kt index dff77771..b503224a 100644 --- a/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/molecules/TextFieldMolecule.kt +++ b/atomik/src/commonMain/kotlin/com/kevinschildhorn/atomik/atomic/molecules/TextFieldMolecule.kt @@ -44,26 +44,26 @@ public open class TextFieldMolecule( textColor = textColor, backgroundColor = backgroundColor, placeholderColor = - hintTextAtom?.textColor?.composeColor ?: backgroundColor.copy( - ContentAlpha.medium, - ), + hintTextAtom?.textColor?.composeColor ?: backgroundColor.copy( + ContentAlpha.medium, + ), cursorColor = cursorColor?.composeColor ?: textColor, disabledTextColor = - disabledColorAtom?.color?.composeColor - ?: textColor.copy(ContentAlpha.disabled), + disabledColorAtom?.color?.composeColor + ?: textColor.copy(ContentAlpha.disabled), disabledIndicatorColor = - disabledColorAtom?.color?.composeColor - ?: disabledBackgroundColor, + disabledColorAtom?.color?.composeColor + ?: disabledBackgroundColor, disabledLabelColor = disabledColorAtom?.color?.composeColor ?: disabledBackgroundColor, disabledLeadingIconColor = - disabledColorAtom?.color?.composeColor - ?: disabledBackgroundColor, + disabledColorAtom?.color?.composeColor + ?: disabledBackgroundColor, disabledPlaceholderColor = - disabledColorAtom?.color?.composeColor - ?: disabledBackgroundColor, + disabledColorAtom?.color?.composeColor + ?: disabledBackgroundColor, disabledTrailingIconColor = - disabledColorAtom?.color?.composeColor - ?: disabledBackgroundColor, + disabledColorAtom?.color?.composeColor + ?: disabledBackgroundColor, errorCursorColor = errorColor?.composeColor ?: errorTextColor, errorIndicatorColor = errorColor?.composeColor ?: errorTextColor, errorLabelColor = errorColor?.composeColor ?: errorTextColor,