Skip to content

Commit a9833df

Browse files
committed
Move code not related to Material Design into ":compose-web-common"
1 parent 81ba43f commit a9833df

File tree

7 files changed

+24
-29
lines changed

7 files changed

+24
-29
lines changed

compose-web-material/src/jsMain/kotlin/com/huanshankeji/compose/web/Layouts.kt renamed to compose-web-common/src/jsMain/kotlin/com/huanshankeji/compose/web/Layouts.kt

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.huanshankeji.compose.web
22

33
import androidx.compose.runtime.Composable
4-
import com.huanshankeji.compose.web.material.defaultSpacing
54
import org.jetbrains.compose.web.css.*
65
import org.jetbrains.compose.web.dom.ContentBuilder
76
import org.jetbrains.compose.web.dom.Div
@@ -64,6 +63,29 @@ fun RowWithSpaceBetween(
6463
styles?.invoke(this)
6564
}, content)
6665

66+
@Composable
67+
fun ColumnWithGaps(
68+
styles: Styles? = null,
69+
gap: CSSNumeric,
70+
fitContent: Boolean = true,
71+
content: ContentBuilder<HTMLDivElement>
72+
) =
73+
Column({
74+
gap(gap)
75+
styles?.invoke(this)
76+
}, fitContent, content)
77+
78+
@Composable
79+
fun RowWithGaps(
80+
styles: Styles? = null,
81+
gap: CSSNumeric,
82+
content: ContentBuilder<HTMLDivElement>
83+
) =
84+
Row({
85+
gap(gap)
86+
styles?.invoke(this)
87+
}, content)
88+
6789
@Composable
6890
fun Centered(
6991
styles: Styles? = null,
@@ -88,7 +110,7 @@ fun CenteredInViewport(
88110
@Composable
89111
fun FrGrid(
90112
numColumns: Int,
91-
gap: CSSNumeric = defaultSpacing,
113+
gap: CSSNumeric,
92114
content: HTMLElementContent
93115
) =
94116
Div({

compose-web-material/src/jsMain/kotlin/com/huanshankeji/compose/web/material/Layouts.kt

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,11 @@ package com.huanshankeji.compose.web.material
22

33
import androidx.compose.runtime.Composable
44
import com.huanshankeji.compose.web.CenteredInViewport
5-
import com.huanshankeji.compose.web.Column
6-
import com.huanshankeji.compose.web.Row
75
import com.huanshankeji.compose.web.Styles
86
import org.jetbrains.compose.web.attributes.AttrsScope
9-
import org.jetbrains.compose.web.css.CSSNumeric
10-
import org.jetbrains.compose.web.css.gap
117
import org.jetbrains.compose.web.dom.ContentBuilder
128
import org.w3c.dom.HTMLDivElement
139

14-
@Composable
15-
fun ColumnWithGaps(
16-
styles: Styles? = null,
17-
gap: CSSNumeric = defaultSpacing,
18-
fitContent: Boolean = true,
19-
content: ContentBuilder<HTMLDivElement>
20-
) =
21-
Column({
22-
gap(gap)
23-
styles?.invoke(this)
24-
}, fitContent, content)
25-
26-
@Composable
27-
fun RowWithGaps(
28-
styles: Styles? = null,
29-
gap: CSSNumeric = defaultSpacing,
30-
content: ContentBuilder<HTMLDivElement>
31-
) =
32-
Row({
33-
gap(gap)
34-
styles?.invoke(this)
35-
}, content)
36-
3710
@Composable
3811
fun CenteredCardInViewport(
3912
viewportDivStyles: Styles? = null,

0 commit comments

Comments
 (0)