@momo-kits/native-kits 0.162.33-debug → 0.162.34-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.
package/compose/build.gradle.kts
CHANGED
|
@@ -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(
|
|
96
|
+
Text(
|
|
97
|
+
title,
|
|
98
|
+
style = Typography.labelDefaultMedium,
|
|
99
|
+
accessibilityId = "$automationId|title-text"
|
|
100
|
+
)
|
|
88
101
|
}
|
|
89
|
-
Text(
|
|
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(
|
|
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
|
}
|
package/gradle.properties
CHANGED