@momo-kits/native-kits 0.163.1-footer.2-debug → 0.163.1-information.1-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.163.1-footer.2-debug"
43
+ version = "0.163.1-information.1-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.163.1-footer.2-debug'
3
+ spec.version = '0.163.1-information.1-debug'
4
4
  spec.homepage = 'https://momo.vn'
5
5
  spec.source = { :http=> ''}
6
6
  spec.authors = ''
@@ -6,6 +6,7 @@ import androidx.compose.foundation.clickable
6
6
  import androidx.compose.foundation.layout.*
7
7
  import androidx.compose.foundation.shape.RoundedCornerShape
8
8
  import androidx.compose.runtime.Composable
9
+ import androidx.compose.runtime.remember
9
10
  import androidx.compose.ui.Modifier
10
11
  import androidx.compose.ui.draw.clip
11
12
  import androidx.compose.ui.text.style.TextAlign
@@ -16,6 +17,7 @@ import vn.momo.kits.const.Radius
16
17
  import vn.momo.kits.const.Spacing
17
18
  import vn.momo.kits.const.Typography
18
19
  import vn.momo.kits.modifier.conditional
20
+ import vn.momo.kits.modifier.setAutomationId
19
21
 
20
22
  enum class InformationState {
21
23
  DEFAULT,
@@ -34,7 +36,12 @@ fun Information(
34
36
  action: String? = null,
35
37
  showIconClose: Boolean = true,
36
38
  onPressClose: (() -> Unit)? = null,
39
+ accessibilityLabel: String? = null,
37
40
  ) {
41
+ val automationId = remember(accessibilityLabel, title) {
42
+ accessibilityLabel ?: "Information${if (title != null) "/$title" else ""}"
43
+ }
44
+
38
45
  var borderColor = Colors.blue_07
39
46
  var backgroundColor = Colors.blue_10
40
47
  var color = Colors.blue_03
@@ -64,6 +71,7 @@ fun Information(
64
71
  border(1.dp, Colors.blue_03)
65
72
  }
66
73
  .padding(Spacing.M)
74
+ .setAutomationId(automationId)
67
75
  ) {
68
76
  Row {
69
77
  if (image != null) {
@@ -71,7 +79,7 @@ fun Information(
71
79
  source = image,
72
80
  modifier = Modifier.padding(end = Spacing.S).width(40.dp).height(40.dp).clip(
73
81
  RoundedCornerShape(Radius.S)
74
- )
82
+ ).setAutomationId("$automationId|img")
75
83
  )
76
84
  }
77
85
  if (image == null && showIcon) {
@@ -80,30 +88,44 @@ fun Information(
80
88
  size = 16.dp,
81
89
  color = color,
82
90
  modifier = Modifier.padding(end = Spacing.S)
91
+ .setAutomationId("$automationId|icon")
83
92
  )
84
93
  }
85
94
  Column(modifier = Modifier.weight(1f)) {
86
95
  if (title != null) {
87
- Text(title, style = Typography.labelDefaultMedium)
96
+ Text(
97
+ title,
98
+ style = Typography.labelDefaultMedium,
99
+ accessibilityId = "$automationId|title-text"
100
+ )
88
101
  }
89
- Text(description, style = Typography.descriptionDefaultRegular)
102
+ Text(
103
+ description,
104
+ style = Typography.descriptionDefaultRegular,
105
+ accessibilityId = "$automationId|description-text"
106
+ )
90
107
  }
91
108
  if (onPressClose != null && showIconClose) {
92
109
  Icon(
93
110
  source = "navigation_close",
94
111
  size = 16.dp,
95
112
  modifier = Modifier.clickable(onClick = onPressClose)
113
+ .setAutomationId("$automationId|close-icon-touch")
96
114
  )
97
115
  }
98
116
  }
99
117
  if (action != null && onPressAction != null) {
100
- Row(modifier = Modifier.padding(top = Spacing.S)) {
118
+ Row(
119
+ modifier = Modifier.padding(top = Spacing.S)
120
+ .setAutomationId("$automationId|cta-touch")
121
+ ) {
101
122
  Text(
102
123
  action,
103
124
  modifier = Modifier.weight(1f).clickable(onClick = onPressAction),
104
125
  textAlign = TextAlign.End,
105
126
  style = Typography.actionXsBold,
106
- color = color
127
+ color = color,
128
+ accessibilityId = "$automationId|cta-text"
107
129
  )
108
130
  }
109
131
  }
@@ -32,7 +32,6 @@ class Navigation(
32
32
  backgroundColor: Color? = null,
33
33
  tintColor: Color? = null,
34
34
  footerComponent: (@Composable () -> Unit)? = null,
35
- footerTransparent: Boolean? = null,
36
35
  floatingButtonProps: FloatingButtonProps? = null,
37
36
  keyboardOptions: KeyboardOptions? = null
38
37
  ) {
@@ -49,7 +48,6 @@ class Navigation(
49
48
  backgroundColor = backgroundColor ?: options.backgroundColor,
50
49
  tintColor = tintColor ?: options.tintColor,
51
50
  footerComponent = footerComponent ?: options.footerComponent,
52
- footerTransparent = footerTransparent ?: options.footerTransparent,
53
51
  floatingButtonProps = floatingButtonProps ?: options.floatingButtonProps,
54
52
  keyboardOptions = keyboardOptions ?: options.keyboardOptions,
55
53
  )
@@ -85,9 +83,6 @@ data class NavigationOptions(
85
83
  val backgroundColor: Color? = null,
86
84
  val tintColor: Color? = null,
87
85
  val footerComponent: @Composable (() -> Unit)? = null,
88
- // Transparent footer keeps its layout slot but drops the surface background + shadow,
89
- // so the screen background shows through.
90
- val footerTransparent: Boolean = false,
91
86
  val floatingButtonProps: FloatingButtonProps? = null,
92
87
  val keyboardOptions: KeyboardOptions = KeyboardOptions()
93
88
  ) {
@@ -316,11 +316,7 @@ internal fun FooterContent() {
316
316
  if (options.hasFooter()) {
317
317
  val keyboardSize = keyboardSizeState()
318
318
  val bottomPadding = (AppNavigationBar.current - keyboardSize.value).coerceAtLeast(0.dp)
319
- Footer(
320
- footerComponent = options.footerComponent,
321
- bottomPadding = bottomPadding,
322
- transparent = options.footerTransparent
323
- )
319
+ Footer(footerComponent = options.footerComponent, bottomPadding = bottomPadding)
324
320
  }
325
321
  }
326
322
 
@@ -344,7 +340,7 @@ internal fun OverplayView(isBottomTabChild: Boolean, id: Int) {
344
340
  }
345
341
 
346
342
  @Composable
347
- fun Footer(footerComponent: @Composable (() -> Unit)?, bottomPadding: Dp, transparent: Boolean = false) {
343
+ fun Footer(footerComponent: @Composable (() -> Unit)?, bottomPadding: Dp) {
348
344
  if (footerComponent == null) return
349
345
 
350
346
  val footerHeightPx = LocalFooterHeightPx.current
@@ -355,15 +351,13 @@ fun Footer(footerComponent: @Composable (() -> Unit)?, bottomPadding: Dp, transp
355
351
  )
356
352
  }
357
353
 
358
- val backgroundColor = if (transparent) Color.Transparent else AppTheme.current.colors.background.surface
359
-
360
354
  Box(Modifier.onGloballyPositioned {
361
355
  if (footerHeightPx.intValue != it.size.height) footerHeightPx.intValue = it.size.height
362
356
  }) {
363
357
  Box(
364
358
  Modifier
365
359
  .fillMaxWidth()
366
- .background(backgroundColor)
360
+ .background(AppTheme.current.colors.background.surface)
367
361
  .conditional(IsShowBaseLineDebug) {
368
362
  border(1.dp, Colors.blue_03)
369
363
  }
@@ -372,15 +366,13 @@ fun Footer(footerComponent: @Composable (() -> Unit)?, bottomPadding: Dp, transp
372
366
  footerComponent.invoke()
373
367
  }
374
368
 
375
- if (!transparent) {
376
- Box(
377
- modifier = Modifier
378
- .fillMaxWidth()
379
- .height(6.dp)
380
- .offset(x = 0.dp, y = (-6).dp)
381
- .background(shadowBrush)
382
- )
383
- }
369
+ Box(
370
+ modifier = Modifier
371
+ .fillMaxWidth()
372
+ .height(6.dp)
373
+ .offset(x = 0.dp, y = (-6).dp)
374
+ .background(shadowBrush)
375
+ )
384
376
  }
385
377
  }
386
378
 
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.163.1-footer.2
21
+ version=0.163.1-information.1
22
22
 
23
23
  repo=GitLab
24
24
  url=https://gitlab.mservice.com.vn/api/v4/projects/5400/packages/maven
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'MoMoUIKits'
3
- s.version = '0.163.1-footer.2'
3
+ s.version = '0.163.1-information.1'
4
4
  s.summary = 'MoMoUIKits for iOS'
5
5
  s.homepage = 'https://momo.vn'
6
6
  s.license = { :type => 'MIT' }
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'MoMoUIKitsDemo'
3
- s.version = '0.163.1-footer.2'
3
+ s.version = '0.163.1-information.1'
4
4
  s.summary = 'Demo browser for MoMoUIKits SwiftUI components'
5
5
  s.homepage = 'https://momo.vn'
6
6
  s.license = { :type => 'MIT' }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.163.1-footer.2-debug",
3
+ "version": "0.163.1-information.1-debug",
4
4
  "private": false,
5
5
  "dependencies": {},
6
6
  "devDependencies": {},