@momo-kits/native-kits 0.162.2-test.25-debug → 0.162.2-test.26-debug

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -40,7 +40,7 @@ kotlin {
40
40
  }
41
41
 
42
42
  cocoapods {
43
- version = "0.162.2-test.25-debug"
43
+ version = "0.162.2-test.26-debug"
44
44
  summary = "IOS Shared module"
45
45
  homepage = "https://momo.vn"
46
46
  ios.deploymentTarget = "15.0"
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |spec|
2
2
  spec.name = 'compose'
3
- spec.version = '0.162.2-test.22'
3
+ spec.version = '0.162.2-test.25'
4
4
  spec.homepage = 'https://momo.vn'
5
5
  spec.source = { :http=> ''}
6
6
  spec.authors = ''
@@ -6,6 +6,7 @@ import androidx.compose.foundation.layout.Box
6
6
  import androidx.compose.foundation.layout.BoxWithConstraints
7
7
  import androidx.compose.foundation.layout.ExperimentalLayoutApi
8
8
  import androidx.compose.foundation.layout.FlowRow
9
+ import androidx.compose.foundation.layout.PaddingValues
9
10
  import androidx.compose.foundation.layout.fillMaxWidth
10
11
  import androidx.compose.foundation.layout.padding
11
12
  import androidx.compose.foundation.shape.RoundedCornerShape
@@ -18,6 +19,7 @@ import androidx.compose.ui.unit.dp
18
19
  import vn.momo.kits.components.Image
19
20
  import vn.momo.kits.const.AppTheme
20
21
  import vn.momo.kits.const.Radius
22
+ import vn.momo.kits.const.Spacing
21
23
 
22
24
  /**
23
25
  * A white rounded surface card that lays its [Item]s on a 12-column grid
@@ -30,6 +32,12 @@ import vn.momo.kits.const.Radius
30
32
  fun Card(
31
33
  useShadow: Boolean = false,
32
34
  backgroundImage: String? = null,
35
+ // The React kit lets a caller's `style` override the card's own 12dp padding
36
+ // per edge (`<Card style={{ paddingVertical: 20 }}>` → 20 top/bottom, 12
37
+ // left/right, all INSIDE the surface). A Compose modifier cannot express
38
+ // that: it is applied outside the background, so it would read as a margin.
39
+ // Take the content padding as a parameter instead.
40
+ contentPadding: PaddingValues = PaddingValues(Spacing.M),
33
41
  modifier: Modifier = Modifier,
34
42
  content: @Composable () -> Unit,
35
43
  ) {
@@ -49,7 +57,7 @@ fun Card(
49
57
  if (backgroundImage != null) {
50
58
  Image(source = backgroundImage, modifier = Modifier.matchParentSize())
51
59
  }
52
- BoxWithConstraints(modifier = Modifier.fillMaxWidth().padding(12.dp)) {
60
+ BoxWithConstraints(modifier = Modifier.fillMaxWidth().padding(contentPadding)) {
53
61
  // `- 1.dp / columns` mirrors the React kit's `- 1 / numberOfColumns`
54
62
  // nudge: it keeps a full 12-span Item ~1dp narrower than the content
55
63
  // box so sub-pixel rounding can never overflow and wrap the FlowRow.
@@ -43,6 +43,7 @@ import vn.momo.kits.const.Radius
43
43
  import vn.momo.kits.const.Spacing
44
44
  import vn.momo.kits.application.LocalContext
45
45
  import vn.momo.kits.application.IsShowBaseLineDebug
46
+ import vn.momo.kits.const.AppNavigationBar
46
47
  import vn.momo.kits.const.Typography
47
48
  import vn.momo.kits.navigation.tracking.ScreenTracker
48
49
  import vn.momo.kits.modifier.conditional
@@ -58,8 +59,6 @@ internal fun BottomSheet(
58
59
  barrierDismissible: Boolean = true,
59
60
  onDismiss: (() -> Unit)?
60
61
  ) {
61
- val navigator = LocalNavigator.current
62
-
63
62
  val screenHeightDp = getScreenHeight()
64
63
  val screenHeightPx = with(LocalDensity.current) { screenHeightDp.toPx() }
65
64
  val sheetOffset = remember { Animatable(screenHeightPx) }
@@ -191,7 +190,7 @@ internal fun BottomSheet(
191
190
  Column(
192
191
  modifier = Modifier
193
192
  .fillMaxSize()
194
- .padding(horizontal = Spacing.M),
193
+ .padding(horizontal = AppNavigationBar.current + Spacing.M),
195
194
  horizontalAlignment = Alignment.CenterHorizontally
196
195
  ) {
197
196
  Spacer(Modifier.height(8.dp))
@@ -6,6 +6,7 @@ import androidx.compose.foundation.ScrollState
6
6
  import androidx.compose.foundation.background
7
7
  import androidx.compose.foundation.border
8
8
  import androidx.compose.foundation.gestures.ScrollableState
9
+ import androidx.compose.foundation.layout.Arrangement
9
10
  import androidx.compose.foundation.layout.Box
10
11
  import androidx.compose.foundation.layout.Column
11
12
  import androidx.compose.foundation.layout.ColumnScope
@@ -283,7 +284,22 @@ internal fun ColumnScope.MainContent(content: @Composable () -> Unit, isBottomTa
283
284
  !options.scrollData.scrollable -> 0.dp
284
285
  else -> navigationBar
285
286
  }
286
- )
287
+ ),
288
+ // The React kit's Screen puts the gap BETWEEN a screen's blocks, not the
289
+ // blocks themselves: with `useGridLayout` (default on) it wraps every
290
+ // direct child in `<View style={{marginTop: Spacing.M}}>`
291
+ // (foundation/Layout/Screen.tsx renderContent). Compose cannot walk the
292
+ // content lambda's children to do that per-child, so space them here —
293
+ // this is the closest faithful equivalent and covers the normal screen.
294
+ //
295
+ // Two React behaviours it deliberately does NOT reproduce, because
296
+ // Compose gives no way to: the 12dp React also puts ABOVE the first
297
+ // child, and the per-child `useMargin = false` opt-out (React reads the
298
+ // child's props; a @Composable lambda exposes nothing). Generated code
299
+ // therefore still emits its own per-block wrapper, which does honour
300
+ // `useMargin: false` — and does not double up here, since a generated
301
+ // screen enters as a single child.
302
+ verticalArrangement = Arrangement.spacedBy(Spacing.M),
287
303
  ) {
288
304
  ScreenContent(content = content)
289
305
  }
package/gradle.properties CHANGED
@@ -18,7 +18,7 @@ kotlin.apple.xcodeCompatibility.nowarn=true
18
18
  name="ComposeKits"
19
19
  group=vn.momo.kits
20
20
  artifact.id=kits
21
- version=0.162.2-test.25
21
+ version=0.162.2-test.26
22
22
 
23
23
  repo=GitLab
24
24
  url=https://gitlab.mservice.com.vn/api/v4/projects/5400/packages/maven
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.162.2-test.25-debug",
3
+ "version": "0.162.2-test.26-debug",
4
4
  "private": false,
5
5
  "dependencies": {},
6
6
  "devDependencies": {},