@momo-kits/native-kits 0.117.1-beta.15 → 0.117.1-beta.17

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.
@@ -200,9 +200,8 @@ fun Footer(footer: @Composable (() -> Unit)? = null, keyboardSize: Dp = 0.dp, bo
200
200
  Box(
201
201
  Modifier
202
202
  .offset(y = -keyboardSize)
203
- .padding(bottom = bottom)
204
203
  .shadow(
205
- Colors.black_20.copy(alpha = 0.1f),
204
+ Colors.black_20.copy(alpha = 0.2f),
206
205
  borderRadius = 0.dp,
207
206
  10f,
208
207
  offsetX = 0.dp,
@@ -212,7 +211,9 @@ fun Footer(footer: @Composable (() -> Unit)? = null, keyboardSize: Dp = 0.dp, bo
212
211
  .background(AppTheme.current.colors.background.surface)
213
212
  ) {
214
213
  Box(
215
- Modifier.fillMaxWidth().padding(vertical = Spacing.S, horizontal = Spacing.M)
214
+ Modifier.fillMaxWidth()
215
+ .padding(bottom = bottom)
216
+ .padding(vertical = Spacing.S, horizontal = Spacing.M)
216
217
  ) {
217
218
  footer?.invoke()
218
219
  }
@@ -57,6 +57,7 @@ fun PopupNotify(
57
57
  secondary: PopupAction? = null,
58
58
  buttonDirection: PopupActionDirection = PopupActionDirection.ROW,
59
59
  onIconClose: () -> Unit,
60
+ isShowCloseIcon: Boolean = true,
60
61
  ) {
61
62
  var isScroll by remember { mutableStateOf(false) }
62
63
  val layoutResult = remember { mutableStateOf<TextLayoutResult?>(null) }
@@ -144,34 +145,36 @@ fun PopupNotify(
144
145
  }
145
146
  }
146
147
 
147
- Box(
148
- Modifier
149
- .width(22.dp)
150
- .height(22.dp)
151
- .offset(x = -(1).dp, y = (-11).dp)
152
- .background(
153
- color = AppTheme.current.colors.text.default,
154
- shape = RoundedCornerShape(Radius.M)
155
- )
156
- .border(
157
- width = 2.dp,
148
+ if(isShowCloseIcon) {
149
+ Box(
150
+ Modifier
151
+ .width(22.dp)
152
+ .height(22.dp)
153
+ .offset(x = -(1).dp, y = (-11).dp)
154
+ .background(
155
+ color = AppTheme.current.colors.text.default,
156
+ shape = RoundedCornerShape(Radius.M)
157
+ )
158
+ .border(
159
+ width = 2.dp,
160
+ color = AppTheme.current.colors.background.surface,
161
+ shape = RoundedCornerShape(Radius.M)
162
+ )
163
+ .clip(RoundedCornerShape(100))
164
+ .clickable(
165
+ interactionSource = remember { MutableInteractionSource() },
166
+ indication = null,
167
+ onClick = { onClose { onIconClose() } }
168
+ ),
169
+ contentAlignment = Alignment.Center
170
+ ) {
171
+ Icon(
172
+ source = "navigation_close",
158
173
  color = AppTheme.current.colors.background.surface,
159
- shape = RoundedCornerShape(Radius.M)
174
+ size = 16.dp,
175
+ modifier = Modifier.setAutomationId("ic_popup_close")
160
176
  )
161
- .clip(RoundedCornerShape(100))
162
- .clickable(
163
- interactionSource = remember { MutableInteractionSource() },
164
- indication = null,
165
- onClick = { onClose { onIconClose() } }
166
- ),
167
- contentAlignment = Alignment.Center
168
- ) {
169
- Icon(
170
- source = "navigation_close",
171
- color = AppTheme.current.colors.background.surface,
172
- size = 16.dp,
173
- modifier = Modifier.setAutomationId("ic_popup_close")
174
- )
177
+ }
175
178
  }
176
179
  }
177
180
  }
@@ -46,15 +46,15 @@ fun getFont(font: String): FontFamily {
46
46
  fun getFontFamily(fontFamily: String, fontWeight: FontWeight? = FontWeight.Normal): FontFamily {
47
47
  val key = "$fontFamily-${fontWeight?.weight}"
48
48
  val fontMap = mapOf(
49
- "SFProText-100" to "sfprotext_thin.otf",
50
- "SFProText-200" to "sfprotext_ultralight.otf",
49
+ "SFProText-100" to "sfprotext_thin.ttf",
50
+ "SFProText-200" to "sfprotext_ultralight.ttf",
51
51
  "SFProText-300" to "sfprotext_light.ttf",
52
52
  "SFProText-400" to "sfprotext_regular.ttf",
53
53
  "SFProText-500" to "sfprotext_medium.ttf",
54
54
  "SFProText-600" to "sfprotext_semibold.ttf",
55
55
  "SFProText-700" to "sfprotext_bold.ttf",
56
56
  "SFProText-800" to "sfprotext_heavy.ttf",
57
- "SFProText-900" to "sfprotext_black.otf",
57
+ "SFProText-900" to "sfprotext_black.ttf",
58
58
 
59
59
  "MoMoSignature-100" to "momosignature.otf",
60
60
  "MoMoSignature-200" to "momosignature.otf",
@@ -88,7 +88,8 @@ public struct Screen<Content: View>: View {
88
88
  let screenHeight = height + topInset + bottomInset
89
89
 
90
90
  ZStack {
91
- (backgroundColor ?? Color.white).edgesIgnoringSafeArea(.all)
91
+ (backgroundColor ?? Color.white)
92
+ .edgesIgnoringSafeArea(.top)
92
93
 
93
94
  VStack(spacing: 0) {
94
95
  ZStack(alignment: .top) {
@@ -184,6 +185,8 @@ struct Footer: View {
184
185
  VStack {
185
186
  footerView
186
187
  }
188
+ .padding(.vertical, Spacing.S)
189
+ .padding(.horizontal, Spacing.M)
187
190
  .padding(.bottom, keyboardSize)
188
191
  .background(Colors.black01)
189
192
  }
@@ -21,7 +21,7 @@ public enum PopupButtonType {
21
21
  public struct PopupDisplay: View {
22
22
  // MARK: Lifecycle
23
23
 
24
- public init(isPresented: Binding<Bool>, title: String = "", description: String = "", url: String = "", buttonDirection: PopupButtonDirection = .column, buttonType: PopupButtonType = .button, actionButtonTitle: String = "", closeButtonTitle: String = "", onPressAction: @escaping () -> Void = {}, onPressCloseButton: @escaping () -> Void = {}, onClose: @escaping () -> Void = {}, errorCode: String = "") {
24
+ public init(isPresented: Binding<Bool>, title: String = "", description: String = "", url: String = "", buttonDirection: PopupButtonDirection = .column, buttonType: PopupButtonType = .button, actionButtonTitle: String = "", closeButtonTitle: String = "", onPressAction: @escaping () -> Void = {}, onPressCloseButton: @escaping () -> Void = {}, onClose: @escaping () -> Void = {}, errorCode: String = "", isShowCloseIcon: Bool = true) {
25
25
  self._isPresented = isPresented
26
26
  self.title = title
27
27
  self.description = description
@@ -34,6 +34,7 @@ public struct PopupDisplay: View {
34
34
  self.closeButtonTitle = closeButtonTitle
35
35
  self.actionButtonTitle = actionButtonTitle
36
36
  self.errorCode = errorCode
37
+ self.isShowCloseIcon = isShowCloseIcon
37
38
  }
38
39
 
39
40
  // MARK: Public
@@ -48,17 +49,19 @@ public struct PopupDisplay: View {
48
49
 
49
50
  VStack(spacing: 12) {
50
51
  ZStack(alignment: .topTrailing) {
51
- SwiftUI.Button(action: onClose) {
52
- Image(systemName: "xmark.circle.fill")
53
- .resizable()
54
- .frame(width: 22, height: 22)
55
- .overlay(RoundedRectangle(cornerRadius: Radius.L).stroke(Colors.black01, lineWidth: 2))
56
- }.foregroundColor(Colors.black20)
57
- .background(Colors.black01.cornerRadius(15))
58
- .padding(.trailing, -11)
59
- .padding(.top, -11)
60
- .zIndex(1)
61
- .accessibility(identifier: "ic_popup_close")
52
+ if(isShowCloseIcon) {
53
+ SwiftUI.Button(action: onClose) {
54
+ Image(systemName: "xmark.circle.fill")
55
+ .resizable()
56
+ .frame(width: 22, height: 22)
57
+ .overlay(RoundedRectangle(cornerRadius: Radius.L).stroke(Colors.black01, lineWidth: 2))
58
+ }.foregroundColor(Colors.black20)
59
+ .background(Colors.black01.cornerRadius(15))
60
+ .padding(.trailing, -11)
61
+ .padding(.top, -11)
62
+ .zIndex(1)
63
+ .accessibility(identifier: "ic_popup_close")
64
+ }
62
65
 
63
66
  VStack {
64
67
  if(!url.isEmpty) {
@@ -162,6 +165,7 @@ public struct PopupDisplay: View {
162
165
  var actionButtonTitle: String
163
166
  var closeButtonTitle: String
164
167
  var errorCode: String
168
+ var isShowCloseIcon: Bool
165
169
 
166
170
  var RowTextButtons: some View {
167
171
  HStack {
@@ -199,7 +203,9 @@ public struct PopupDisplay: View {
199
203
 
200
204
  var RowButtons: some View {
201
205
  HStack {
202
- Button(title: closeButtonTitle, action: onPressCloseButton, type: .secondary, size: .medium).accessibility(identifier: "btn_popup_cancel")
206
+ if(!closeButtonTitle.isEmpty) {
207
+ Button(title: closeButtonTitle, action: onPressCloseButton, type: .secondary, size: .medium).accessibility(identifier: "btn_popup_cancel")
208
+ }
203
209
  Button(title: actionButtonTitle, action: onPressAction, size: .medium)
204
210
  .accessibility(identifier: "btn_popup_allow")
205
211
  }
@@ -215,8 +221,9 @@ public struct PopupDisplay: View {
215
221
  action: onPressAction,
216
222
  size: .medium
217
223
  ).accessibility(identifier: "btn_popup_allow")
218
- Button(title: closeButtonTitle, action: onPressCloseButton, type: .secondary, size: .medium).accessibility(identifier: "btn_popup_cancel")
219
-
224
+ if(!closeButtonTitle.isEmpty) {
225
+ Button(title: closeButtonTitle, action: onPressCloseButton, type: .secondary, size: .medium).accessibility(identifier: "btn_popup_cancel")
226
+ }
220
227
  }
221
228
  .frame(maxWidth: .infinity, alignment: .trailing)
222
229
  .padding(.horizontal, 24)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.117.1-beta.15",
3
+ "version": "0.117.1-beta.17",
4
4
  "private": false,
5
5
  "dependencies": {},
6
6
  "devDependencies": {},