@momo-kits/native-kits 0.162.2-beta.26-debug → 0.162.2-beta.27-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.
Files changed (197) hide show
  1. package/CLAUDE.md +1 -1
  2. package/compose/build.gradle.kts +1 -1
  3. package/compose/compose.podspec +1 -1
  4. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +0 -5
  5. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderRight.kt +1 -1
  6. package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +0 -3
  7. package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +55 -40
  8. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +0 -4
  9. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +2 -8
  10. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +75 -93
  11. package/gradle.properties +1 -1
  12. package/ios/Application/ApplicationEnvironment.swift +0 -11
  13. package/ios/Application/Components.swift +44 -34
  14. package/ios/Application/FloatingButton.swift +9 -10
  15. package/ios/Application/HeaderRight.swift +45 -79
  16. package/ios/Application/Screen.swift +1 -2
  17. package/ios/Badge/Badge.swift +14 -11
  18. package/ios/Badge/BadgeRibbon.swift +21 -12
  19. package/ios/Button/Button.swift +22 -61
  20. package/ios/Checkbox/Checkbox.swift +13 -14
  21. package/ios/Chip/Chip.swift +9 -23
  22. package/ios/Colors+Radius+Spacing/Colors.swift +12 -12
  23. package/ios/Extensions/Color++.swift +0 -32
  24. package/ios/Icon/Icon.swift +1 -6
  25. package/ios/Input/Input.swift +25 -41
  26. package/ios/Input/InputPhoneNumber.swift +19 -20
  27. package/ios/Input/InputSearch.swift +47 -100
  28. package/ios/Input/InputTextArea.swift +40 -66
  29. package/ios/Popup/PopupDisplay.swift +16 -8
  30. package/ios/Popup/PopupInput.swift +8 -2
  31. package/ios/Swipeable/SwipeCell.swift +0 -185
  32. package/ios/Swipeable/SwipeCellModel.swift +0 -21
  33. package/ios/Typography/Text.swift +5 -79
  34. package/ios/Typography/Typography.swift +0 -3
  35. package/ios/native-kits.podspec +8 -61
  36. package/package.json +1 -1
  37. package/publish.sh +0 -50
  38. package/.claude/settings.local.json +0 -39
  39. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/OsFontScale.android.kt +0 -7
  40. package/compose/src/commonMain/kotlin/vn/momo/kits/application/WidgetContainer.kt +0 -56
  41. package/compose/src/commonMain/kotlin/vn/momo/kits/const/KitFontScale.kt +0 -22
  42. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/OsFontScale.kt +0 -9
  43. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/OsFontScale.ios.kt +0 -66
  44. package/ios/Application/Navigation/BottomTab/BottomTab.swift +0 -103
  45. package/ios/Application/Navigation/BottomTab/BottomTabBar.swift +0 -215
  46. package/ios/Application/Navigation/BottomTab/CurvedContainer.swift +0 -65
  47. package/ios/Application/Navigation/HeaderBackProps.swift +0 -66
  48. package/ios/Application/Navigation/HeaderTitle.swift +0 -57
  49. package/ios/Application/Navigation/HeaderUser.swift +0 -209
  50. package/ios/Application/Navigation/NavigationContainer.swift +0 -176
  51. package/ios/Application/Navigation/NavigationOptions.swift +0 -109
  52. package/ios/Application/Navigation/Navigator.swift +0 -364
  53. package/ios/Application/Navigation/Overplay/BottomSheet.swift +0 -188
  54. package/ios/Application/Navigation/Overplay/ModalScreen.swift +0 -68
  55. package/ios/Application/Navigation/Overplay/SnackBar.swift +0 -144
  56. package/ios/Application/Navigation/component/Header.swift +0 -178
  57. package/ios/Application/Navigation/component/HeaderBackground.swift +0 -83
  58. package/ios/Application/Navigation/component/HeaderColor.swift +0 -65
  59. package/ios/Application/StackScreen.swift +0 -453
  60. package/ios/Avatar/Avatar.swift +0 -193
  61. package/ios/BaselineView/BaselineView.swift +0 -163
  62. package/ios/Carousel/Carousel.swift +0 -181
  63. package/ios/Collapse/Collapse.swift +0 -182
  64. package/ios/Colors+Radius+Spacing/Theme.swift +0 -295
  65. package/ios/DateTimePicker/DateTimePicker.swift +0 -210
  66. package/ios/DateTimePicker/DateTimePickerTypes.swift +0 -55
  67. package/ios/DateTimePicker/DateTimePickerUtils.swift +0 -167
  68. package/ios/DateTimePicker/WheelPicker.swift +0 -161
  69. package/ios/Divider/Divider.swift +0 -16
  70. package/ios/IconButton/IconButton.swift +0 -112
  71. package/ios/InputDropDown/InputDropDown.swift +0 -198
  72. package/ios/InputMoney/InputMoney.swift +0 -335
  73. package/ios/InputOTP/InputOTP.swift +0 -210
  74. package/ios/Loader/Loader.swift +0 -113
  75. package/ios/MoMoUIKits.podspec +0 -5
  76. package/ios/Pagination/PaginationDot.swift +0 -61
  77. package/ios/Pagination/PaginationNumber.swift +0 -35
  78. package/ios/Pagination/PaginationScroll.swift +0 -101
  79. package/ios/Pagination/PaginationWhiteDot.swift +0 -37
  80. package/ios/Popup/PopupNotify.swift +0 -219
  81. package/ios/ProgressInfo/ProgressInfo.swift +0 -294
  82. package/ios/Radio/Radio.swift +0 -70
  83. package/ios/Rating/Rating.swift +0 -82
  84. package/ios/Resources/MoMoUIKitsColors.xcassets/AccentColor.colorset/Contents.json +0 -11
  85. package/ios/Resources/MoMoUIKitsColors.xcassets/Background.colorset/Contents.json +0 -38
  86. package/ios/Resources/MoMoUIKitsColors.xcassets/Border.colorset/Contents.json +0 -38
  87. package/ios/Resources/MoMoUIKitsColors.xcassets/Card.colorset/Contents.json +0 -38
  88. package/ios/Resources/MoMoUIKitsColors.xcassets/Contents.json +0 -6
  89. package/ios/Resources/MoMoUIKitsColors.xcassets/Error.colorset/Contents.json +0 -38
  90. package/ios/Resources/MoMoUIKitsColors.xcassets/Primary.colorset/Contents.json +0 -38
  91. package/ios/Resources/MoMoUIKitsColors.xcassets/PrimaryDark.colorset/Contents.json +0 -38
  92. package/ios/Resources/MoMoUIKitsColors.xcassets/PrimaryLight.colorset/Contents.json +0 -38
  93. package/ios/Resources/MoMoUIKitsColors.xcassets/Secondary.colorset/Contents.json +0 -38
  94. package/ios/Resources/MoMoUIKitsColors.xcassets/Success.colorset/Contents.json +0 -38
  95. package/ios/Resources/MoMoUIKitsColors.xcassets/Text.colorset/Contents.json +0 -38
  96. package/ios/Resources/MoMoUIKitsColors.xcassets/TextSecondary.colorset/Contents.json +0 -38
  97. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/Contents.json +0 -9
  98. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-default.colorset/Contents.json +0 -38
  99. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-disable.colorset/Contents.json +0 -38
  100. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-pressed.colorset/Contents.json +0 -38
  101. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-selected.colorset/Contents.json +0 -38
  102. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-surface.colorset/Contents.json +0 -38
  103. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-tonal.colorset/Contents.json +0 -38
  104. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/border-default.colorset/Contents.json +0 -38
  105. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/border-disable.colorset/Contents.json +0 -38
  106. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/gradient.colorset/Contents.json +0 -38
  107. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/primary.colorset/Contents.json +0 -38
  108. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/secondary.colorset/Contents.json +0 -38
  109. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-container.colorset/Contents.json +0 -38
  110. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-primary.colorset/Contents.json +0 -38
  111. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-secondary.colorset/Contents.json +0 -38
  112. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-default.colorset/Contents.json +0 -38
  113. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-disable.colorset/Contents.json +0 -38
  114. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-hint.colorset/Contents.json +0 -38
  115. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-secondary.colorset/Contents.json +0 -38
  116. package/ios/Resources/MoMoUIKitsColors.xcassets/Warning.colorset/Contents.json +0 -38
  117. package/ios/Skeleton/Skeleton.swift +0 -99
  118. package/ios/Slider/Slider.swift +0 -237
  119. package/ios/Stepper/Stepper.swift +0 -220
  120. package/ios/Steps/Steps.swift +0 -451
  121. package/ios/SuggestAction/SuggestAction.swift +0 -97
  122. package/ios/TabView/TabView.swift +0 -530
  123. package/ios/Tag/Tag.swift +0 -98
  124. package/ios/Title/Title.swift +0 -269
  125. package/ios/Tooltip/Tooltip.swift +0 -482
  126. package/ios/Typography/FontScaleStore.swift +0 -19
  127. package/ios/Uploader/Uploader.swift +0 -183
  128. package/ios-demo/MoMoUIKitsDemo.podspec +0 -20
  129. package/ios-demo/README.md +0 -120
  130. package/ios-demo/Resources/dot_loading.json +0 -558
  131. package/ios-demo/Resources/icon.json +0 -4052
  132. package/ios-demo/Resources/lottie_circle_loader.json +0 -1
  133. package/ios-demo/Sources/MoMoUIKitsDemo/DemoScaffold.swift +0 -48
  134. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsBadgeDemoView.swift +0 -25
  135. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsButtonDemoView.swift +0 -26
  136. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsCheckboxDemoView.swift +0 -19
  137. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsChipDemoView.swift +0 -33
  138. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsInputDemoView.swift +0 -48
  139. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsPopupDemoView.swift +0 -21
  140. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsRadioDemoView.swift +0 -17
  141. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsTypographyDemoView.swift +0 -28
  142. package/ios-demo/Sources/MoMoUIKitsDemo/MoMoUIKitsDemoContext.swift +0 -31
  143. package/ios-demo/Sources/MoMoUIKitsDemo/MoMoUIKitsDemoFactory.swift +0 -24
  144. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AnimatedHeaderDemo.swift +0 -110
  145. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AvatarDemo.swift +0 -93
  146. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BadgeDemo.swift +0 -269
  147. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BaselineView.swift +0 -117
  148. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BottomTabDemo.swift +0 -89
  149. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ButtonDemo.swift +0 -100
  150. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CarouselDemo.swift +0 -126
  151. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CheckboxDemo.swift +0 -63
  152. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ChipDemo.swift +0 -20
  153. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CollapseDemo.swift +0 -93
  154. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ContentView.swift +0 -107
  155. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DateTimePickerDemo.swift +0 -124
  156. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DividerDemo.swift +0 -14
  157. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/HeaderUserDemo.swift +0 -49
  158. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/Home.swift +0 -278
  159. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/IconButtonDemo.swift +0 -58
  160. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ImageDemo.swift +0 -78
  161. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InformationDemo.swift +0 -138
  162. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputDemo.swift +0 -111
  163. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputDropDownDemo.swift +0 -136
  164. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputMoneyDemo.swift +0 -107
  165. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputOTPDemo.swift +0 -73
  166. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputPhoneNumberDemo.swift +0 -100
  167. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputSearchDemo.swift +0 -32
  168. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputTextAreaDemo.swift +0 -57
  169. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/LoaderDemo.swift +0 -70
  170. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift +0 -227
  171. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PaginationDemo.swift +0 -72
  172. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupDisplayDemo.swift +0 -175
  173. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupNotifyDemo.swift +0 -121
  174. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupPromotionDemo.swift +0 -76
  175. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ProgressInfoDemo.swift +0 -89
  176. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/RadioDemo.swift +0 -32
  177. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/RatingDemo.swift +0 -56
  178. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SkeletonDemo.swift +0 -32
  179. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SliderDemo.swift +0 -150
  180. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SnackBarDemo.swift +0 -138
  181. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/StepperDemo.swift +0 -103
  182. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/StepsDemo.swift +0 -94
  183. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SuggestActionDemo.swift +0 -79
  184. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SwipeDemo.swift +0 -152
  185. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SwitchDemo.swift +0 -33
  186. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TabViewDemo.swift +0 -190
  187. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TagDemo.swift +0 -34
  188. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ThemeDemo.swift +0 -182
  189. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TitleDemo.swift +0 -109
  190. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TooltipDemo.swift +0 -187
  191. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TypographyDemo.swift +0 -87
  192. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/UploaderDemo.swift +0 -131
  193. package/ios-demo/Sources/MoMoUIKitsDemo/SwiftUIDemoBrowserView.swift +0 -51
  194. package/ios-demo/Sources/MoMoUIKitsDemo/UIKitsDemoModels.swift +0 -15
  195. package/ios-demo/Sources/MoMoUIKitsDemo/UIKitsDemoRegistry.swift +0 -73
  196. package/local.properties +0 -8
  197. package/scripts/gen-ios-color.mjs +0 -136
@@ -7,17 +7,15 @@
7
7
 
8
8
  import SwiftUI
9
9
  public struct InputPhoneNumber: View {
10
- @Environment(\.appTheme) private var theme
11
10
  @Binding public var text: String
12
11
 
13
12
  public var placeholder: String
14
13
  public var size: InputSize
15
14
  public var hintText: String
16
15
  public var error: String
17
- public var errorSpacing: Bool
18
16
  public var loading: Bool
19
17
  public var rightIcon: String
20
- public var rightIconColor: Color?
18
+ public var rightIconColor: Color
21
19
  public var autofocus: Bool
22
20
  public var onChangeText: ((String) -> Void)?
23
21
  public var onFocus: (() -> Void)?
@@ -33,11 +31,10 @@ public struct InputPhoneNumber: View {
33
31
  size: InputSize = .small,
34
32
  hintText: String = "",
35
33
  error: String = "",
36
- errorSpacing: Bool = false,
37
34
  loading: Bool = false,
38
35
  required: Bool = false,
39
36
  rightIcon: String = "",
40
- rightIconColor: Color? = nil,
37
+ rightIconColor: Color = Colors.black12,
41
38
  autofocus: Bool = false,
42
39
  onChangeText: ((String) -> Void)? = nil,
43
40
  onFocus: (() -> Void)? = nil,
@@ -50,7 +47,6 @@ public struct InputPhoneNumber: View {
50
47
  self.size = size
51
48
  self.hintText = hintText
52
49
  self.error = error
53
- self.errorSpacing = errorSpacing
54
50
  self.loading = loading
55
51
  self.rightIcon = rightIcon
56
52
  self.rightIconColor = rightIconColor
@@ -80,17 +76,17 @@ public struct InputPhoneNumber: View {
80
76
  .padding(.trailing, Spacing.XS)
81
77
 
82
78
  MomoText("+84", typography: size == .small ? .headerSSemibold : .headerMBold)
83
- .foregroundColor(theme.colors.text.default)
79
+ .foregroundColor(Colors.black17)
84
80
 
85
81
  Rectangle()
86
- .fill(theme.colors.border.default)
82
+ .fill(Colors.black04)
87
83
  .frame(width: 1, height: size == .small ? 24 : 32)
88
84
  .padding(.horizontal, Spacing.M)
89
85
 
90
86
  // Text input
91
87
  ZStack(alignment: .leading) {
92
88
  if text.isEmpty {
93
- MomoText(placeholder, typography: size == .small ? .headerSSemibold : .headerMBold, color: theme.colors.text.hint)
89
+ MomoText(placeholder, typography: size == .small ? .headerSSemibold : .headerMBold, color: Colors.black12)
94
90
  }
95
91
 
96
92
  TextField("", text: textBinding, onEditingChanged: { focused in
@@ -99,8 +95,8 @@ public struct InputPhoneNumber: View {
99
95
  .keyboardType(.numberPad)
100
96
  .font(size == .small ? .header_s_semibold : .header_m_bold)
101
97
  .ignoreBoldTextSetting()
102
- .foregroundColor(theme.colors.text.default)
103
- .applyCursorColor(theme.colors.primary)
98
+ .foregroundColor(Colors.black17)
99
+ .applyPrimaryCursorColor()
104
100
  .lineLimit(1)
105
101
  .accessibility(identifier: accessibilityLabel ?? "")
106
102
  .accessibilityValue(textBinding.wrappedValue.isEmpty ? placeholder : textBinding.wrappedValue)
@@ -112,7 +108,7 @@ public struct InputPhoneNumber: View {
112
108
  text = ""
113
109
  onChangeText?("")
114
110
  }) {
115
- Icon(source: "24_navigation_close_circle_full", size: 16, color: theme.colors.text.hint)
111
+ Icon(source: "24_navigation_close_circle_full", size: 16, color: Colors.black12)
116
112
  .padding(.leading, Spacing.S).accessibility(identifier: "ic_clear")
117
113
  }
118
114
  }
@@ -126,7 +122,7 @@ public struct InputPhoneNumber: View {
126
122
  // ✅ Right icon
127
123
  if !rightIcon.isEmpty {
128
124
  SwiftUI.Button(action: { onRightIconPressed?() }) {
129
- Icon(source: rightIcon, size: 24, color: rightIconColor ?? theme.colors.text.default)
125
+ Icon(source: rightIcon, size: 24, color: rightIconColor)
130
126
  .padding(.leading, Spacing.S)
131
127
  }
132
128
  }
@@ -135,7 +131,7 @@ public struct InputPhoneNumber: View {
135
131
  .frame(height: scaleSize(size == .small ? 48 : 56, 1.1))
136
132
  .background(
137
133
  RoundedRectangle(cornerRadius: Radius.S)
138
- .fill(theme.colors.background.surface)
134
+ .fill(Colors.black01)
139
135
  )
140
136
  .overlay(
141
137
  RoundedRectangle(cornerRadius: Radius.S)
@@ -145,7 +141,7 @@ public struct InputPhoneNumber: View {
145
141
  // Error or hint
146
142
  ErrorView(
147
143
  errorMessage: error,
148
- errorSpacing: errorSpacing,
144
+ errorSpacing: false,
149
145
  hintText: hintText
150
146
  )
151
147
  }
@@ -163,18 +159,21 @@ public struct InputPhoneNumber: View {
163
159
  }
164
160
 
165
161
  private func borderColor() -> Color {
166
- if !error.isEmpty { return theme.colors.error.primary }
167
- if isFocused { return theme.colors.primary }
168
- return theme.colors.border.default
162
+ if !error.isEmpty { return Colors.red03 }
163
+ if isFocused { return Colors.primary }
164
+ return Colors.black04
169
165
  }
170
166
  }
171
167
 
172
168
  private extension View {
173
- func applyCursorColor(_ color: Color) -> some View {
169
+ func applyPrimaryCursorColor() -> some View {
174
170
  if #available(iOS 15.0, *) {
175
- return self.tint(color)
171
+ // Modern SwiftUI: use .tint() for cursor
172
+ return self.tint(Colors.primary)
176
173
  } else {
174
+ // iOS 13–14: return unchanged (no tint support)
177
175
  return self
178
176
  }
179
177
  }
180
178
  }
179
+
@@ -9,12 +9,11 @@ import SwiftUI
9
9
  // MARK: - RenderRightIconSearch
10
10
 
11
11
  struct RenderRightIconSearch: View {
12
- @Environment(\.appTheme) private var theme
13
12
  let loading: Bool
14
13
  let icon: String
15
14
  let color: Color
16
15
  let onClick: () -> Void
17
-
16
+
18
17
  var body: some View {
19
18
  HStack(spacing: 0) {
20
19
  if loading {
@@ -25,10 +24,12 @@ struct RenderRightIconSearch: View {
25
24
  if !icon.isEmpty {
26
25
  Divider()
27
26
  .frame(width: 1)
28
- .background(theme.colors.primary)
27
+ .background(Colors.primary)
29
28
  .padding(.leading, Spacing.S)
30
29
 
31
- Icon(source: icon, size: 24, color: color)
30
+ Image(systemName: icon)
31
+ .foregroundColor(color)
32
+ .frame(width: 24, height: 24)
32
33
  .padding(.leading, Spacing.S)
33
34
  .onTapGesture(perform: onClick)
34
35
  }
@@ -47,18 +48,14 @@ public struct InputSearchProps {
47
48
  var error: String = ""
48
49
  var disabled: Bool = false
49
50
  var icon: String = ""
50
- var iconColor: Color? = nil
51
+ var iconColor: Color = Colors.text
51
52
  var onRightIconPressed: () -> Void = {}
52
53
  var onFocus: () -> Void = {}
53
54
  var onBlur: () -> Void = {}
54
55
  var loading: Bool = false
55
56
  var fontWeight: Font.Weight = .regular
56
57
  var keyboardType: UIKeyboardType = .default
57
- // Mirrors Compose's InputSearchProps.searchIcon — a custom leading icon view.
58
- var searchIcon: (() -> AnyView)? = nil
59
- // Mirrors Compose's InputSearchProps.placeholderCustomRender — a custom placeholder view.
60
- var placeholderCustomRender: (() -> AnyView)? = nil
61
-
58
+
62
59
  public init(text: Binding<String>,
63
60
  buttonText: String = "",
64
61
  showButtonText: Bool = false,
@@ -69,15 +66,13 @@ public struct InputSearchProps {
69
66
  error: String = "",
70
67
  disabled: Bool = false,
71
68
  icon: String = "",
72
- iconColor: Color? = nil,
69
+ iconColor: Color = Colors.text,
73
70
  onRightIconPressed: @escaping () -> Void = {},
74
71
  onFocus: @escaping () -> Void = {},
75
72
  onBlur: @escaping () -> Void = {},
76
73
  loading: Bool = false,
77
74
  fontWeight: Font.Weight = .regular,
78
- keyboardType: UIKeyboardType = .default,
79
- searchIcon: (() -> AnyView)? = nil,
80
- placeholderCustomRender: (() -> AnyView)? = nil) {
75
+ keyboardType: UIKeyboardType = .default) {
81
76
  self._text = text
82
77
  self.buttonText = buttonText
83
78
  self.showButtonText = showButtonText
@@ -95,15 +90,12 @@ public struct InputSearchProps {
95
90
  self.loading = loading
96
91
  self.fontWeight = fontWeight
97
92
  self.keyboardType = keyboardType
98
- self.searchIcon = searchIcon
99
- self.placeholderCustomRender = placeholderCustomRender
100
93
  }
101
94
  }
102
95
 
103
96
  // MARK: - InputSearch
104
97
 
105
98
  public struct InputSearch: View {
106
- @Environment(\.appTheme) private var theme
107
99
  @Binding var text: String
108
100
  var buttonText: String = ""
109
101
  var showButtonText: Bool = false
@@ -114,19 +106,17 @@ public struct InputSearch: View {
114
106
  var error: String = ""
115
107
  var disabled: Bool = false
116
108
  var icon: String = ""
117
- var iconColor: Color? = nil
109
+ var iconColor: Color = Colors.text
118
110
  var onRightIconPressed: () -> Void = {}
119
111
  var onFocus: () -> Void = {}
120
112
  var onBlur: () -> Void = {}
121
113
  var loading: Bool = false
122
114
  var fontWeight: Font.Weight = .regular
123
115
  var keyboardType: UIKeyboardType = .default
124
- var searchIcon: (() -> AnyView)? = nil
125
- var placeholderCustomRender: (() -> AnyView)? = nil
126
-
116
+
127
117
  @State private var isFocused = false
128
118
  @State private var isBlurred = false
129
-
119
+
130
120
  public init(text: Binding<String>,
131
121
  buttonText: String = "",
132
122
  showButtonText: Bool = false,
@@ -137,15 +127,13 @@ public struct InputSearch: View {
137
127
  error: String = "",
138
128
  disabled: Bool = false,
139
129
  icon: String = "",
140
- iconColor: Color? = nil,
130
+ iconColor: Color = Colors.text,
141
131
  onRightIconPressed: @escaping () -> Void = {},
142
132
  onFocus: @escaping () -> Void = {},
143
133
  onBlur: @escaping () -> Void = {},
144
134
  loading: Bool = false,
145
135
  fontWeight: Font.Weight = .regular,
146
- keyboardType: UIKeyboardType = .default,
147
- searchIcon: (() -> AnyView)? = nil,
148
- placeholderCustomRender: (() -> AnyView)? = nil) {
136
+ keyboardType: UIKeyboardType = .default) {
149
137
  self._text = text
150
138
  self.buttonText = buttonText
151
139
  self.showButtonText = showButtonText
@@ -163,60 +151,24 @@ public struct InputSearch: View {
163
151
  self.loading = loading
164
152
  self.fontWeight = fontWeight
165
153
  self.keyboardType = keyboardType
166
- self.searchIcon = searchIcon
167
- self.placeholderCustomRender = placeholderCustomRender
168
154
  }
169
155
 
170
- /// Convenience initializer mirroring Compose's `InputSearch(inputSearchProps)`.
171
- public init(props: InputSearchProps) {
172
- self.init(
173
- text: props.$text,
174
- buttonText: props.buttonText,
175
- showButtonText: props.showButtonText,
176
- showBorder: props.showBorder,
177
- placeholder: props.placeholder,
178
- onChangeText: props.onChangeText,
179
- onPressButtonText: props.onPressButtonText,
180
- error: props.error,
181
- disabled: props.disabled,
182
- icon: props.icon,
183
- iconColor: props.iconColor,
184
- onRightIconPressed: props.onRightIconPressed,
185
- onFocus: props.onFocus,
186
- onBlur: props.onBlur,
187
- loading: props.loading,
188
- fontWeight: props.fontWeight,
189
- keyboardType: props.keyboardType,
190
- searchIcon: props.searchIcon,
191
- placeholderCustomRender: props.placeholderCustomRender
192
- )
193
- }
194
-
195
-
156
+
196
157
  public var body: some View {
197
- let iconColor: Color = disabled ? theme.colors.text.disable : (self.iconColor ?? theme.colors.text.default)
198
158
  VStack(alignment: .leading, spacing: 0) {
199
159
  HStack(spacing: 0) {
200
160
  HStack {
201
- if let searchIcon = searchIcon {
202
- searchIcon()
203
- } else {
204
- Image(systemName: "magnifyingglass")
205
- .foregroundColor(theme.colors.text.hint)
206
- .frame(width: 24, height: 24)
207
- .padding(.trailing, Spacing.XS)
208
- }
209
-
161
+ Image(systemName: "magnifyingglass")
162
+ .foregroundColor(Colors.black12)
163
+ .frame(width: 24, height: 24)
164
+ .padding(.trailing, Spacing.XS)
165
+
210
166
  ZStack(alignment: .leading) {
211
167
  if text.isEmpty {
212
- if let placeholderCustomRender = placeholderCustomRender {
213
- placeholderCustomRender()
214
- } else {
215
- Text(placeholder)
216
- .foregroundColor(disabled ? theme.colors.text.disable : theme.colors.text.hint)
217
- .font(.system(size: scaleSize(14), weight: fontWeight))
218
- .ignoreBoldTextSetting()
219
- }
168
+ Text(placeholder)
169
+ .foregroundColor(disabled ? Colors.black08 : Colors.black12)
170
+ .font(.system(size: 16, weight: fontWeight))
171
+ .ignoreBoldTextSetting()
220
172
  }
221
173
  TextField("", text: $text, onEditingChanged: { editing in
222
174
  isFocused = editing
@@ -230,27 +182,26 @@ public struct InputSearch: View {
230
182
  }
231
183
  }, onCommit: {})
232
184
  .disabled(disabled)
233
- .foregroundColor(disabled ? theme.colors.text.disable : theme.colors.text.default)
234
- .font(.system(size: scaleSize(14), weight: fontWeight))
185
+ .foregroundColor(disabled ? Colors.black08 : Colors.black17)
186
+ .font(.system(size: 15, weight: fontWeight))
235
187
  .ignoreBoldTextSetting()
236
188
  .keyboardType(keyboardType)
237
- .applyCursorColor(theme.colors.primary)
238
189
  }
239
190
 
240
191
  if isFocused && !text.isEmpty {
241
192
  SwiftButton(action: { text = "" }) {
242
193
  Image(systemName: "xmark.circle.fill")
243
- .foregroundColor(theme.colors.text.hint)
194
+ .foregroundColor(Colors.black12)
244
195
  .frame(width: 16, height: 16)
245
196
  }
246
197
  .padding(.leading, Spacing.S)
247
198
  }
248
199
 
249
- RenderRightIconSearch(loading: loading, icon: icon, color: iconColor, onClick: onRightIconPressed)
200
+ RenderRightIconSearch(loading: loading, icon: icon, color: disabled ? Colors.black08 : iconColor, onClick: onRightIconPressed)
250
201
  }
251
202
  .padding(.horizontal, Spacing.M)
252
203
  .padding(.vertical, Spacing.S)
253
- .background(theme.colors.background.surface)
204
+ .background(Colors.black01)
254
205
  .cornerRadius(Radius.XL)
255
206
  .overlay(
256
207
  RoundedRectangle(cornerRadius: Radius.XL)
@@ -260,35 +211,31 @@ public struct InputSearch: View {
260
211
 
261
212
  if showButtonText {
262
213
  SwiftButton(action: onPressButtonText) {
263
- MomoText(buttonText, typography: .actionDefaultBold, color: theme.colors.text.default)
214
+ Text(buttonText)
215
+ .foregroundColor(Colors.black17)
216
+ .font(.system(size: 14, weight: .medium))
217
+ .ignoreBoldTextSetting()
264
218
  }
265
219
  .padding(.leading, Spacing.L)
266
220
  }
267
221
  }
268
222
  }
269
223
  }
270
-
271
- // MARK: - Helper Functions
272
-
273
- func getBorderColor(isFocused: Bool, error: String, disabled: Bool) -> Color {
274
- if disabled {
275
- return theme.colors.border.disable
276
- } else if !error.isEmpty {
277
- return theme.colors.error.primary
278
- } else if isFocused {
279
- return theme.colors.primary
280
- } else {
281
- return theme.colors.border.default
282
- }
283
- }
284
224
  }
285
225
 
286
- private extension View {
287
- func applyCursorColor(_ color: Color) -> some View {
288
- if #available(iOS 15.0, *) {
289
- return self.tint(color)
290
- } else {
291
- return self
292
- }
226
+ // MARK: - Helper Functions
227
+
228
+ func getBorderColor(isFocused: Bool, error: String, disabled: Bool) -> Color {
229
+ if disabled {
230
+ return Colors.black08
231
+ } else if !error.isEmpty {
232
+ return Colors.red03
233
+ } else if isFocused {
234
+ return Colors.primary
235
+ } else {
236
+ return Colors.black04
293
237
  }
294
238
  }
239
+
240
+
241
+
@@ -12,12 +12,6 @@ public let DEFAULT_HEIGHT: CGFloat = 104
12
12
 
13
13
  struct UITextViewWrapper: UIViewRepresentable {
14
14
  @Binding var text: String
15
- var maxLength: Int
16
- var textColor: Color
17
- var cursorColor: Color
18
- var fontWeight: Font.Weight
19
- var disabled: Bool
20
- var onChangeText: (String) -> Void
21
15
  var onDone: (() -> Void)?
22
16
  var onFocus: (() -> Void)?
23
17
  var onBlur: (() -> Void)?
@@ -25,20 +19,11 @@ struct UITextViewWrapper: UIViewRepresentable {
25
19
  func makeUIView(context: Context) -> UITextView {
26
20
  let textView = UITextView()
27
21
  textView.delegate = context.coordinator
28
- textView.backgroundColor = .clear
29
- textView.textContainerInset = .zero
30
- textView.textContainer.lineFragmentPadding = 0
31
22
  return textView
32
23
  }
33
24
 
34
25
  func updateUIView(_ uiView: UITextView, context: Context) {
35
- if uiView.text != text {
36
- uiView.text = text
37
- }
38
- uiView.textColor = UIColor(textColor)
39
- uiView.tintColor = UIColor(cursorColor)
40
- uiView.font = UIFont.systemFont(ofSize: scaleSize(16), weight: fontWeight == .bold ? .bold : .regular)
41
- uiView.isEditable = !disabled
26
+ uiView.text = text
42
27
  }
43
28
 
44
29
  func makeCoordinator() -> Coordinator {
@@ -53,12 +38,7 @@ struct UITextViewWrapper: UIViewRepresentable {
53
38
  }
54
39
 
55
40
  func textViewDidChange(_ textView: UITextView) {
56
- let limited = String(textView.text.prefix(parent.maxLength))
57
- if textView.text != limited {
58
- textView.text = limited
59
- }
60
- parent.text = limited
61
- parent.onChangeText(limited)
41
+ parent.text = textView.text
62
42
  }
63
43
 
64
44
  func textViewDidBeginEditing(_ textView: UITextView) {
@@ -74,31 +54,27 @@ struct UITextViewWrapper: UIViewRepresentable {
74
54
  parent.onDone?()
75
55
  return false
76
56
  }
77
- let current = textView.text ?? ""
78
- guard let range = Range(range, in: current) else { return false }
79
- let proposed = current.replacingCharacters(in: range, with: text)
80
- return proposed.count <= parent.maxLength
57
+ return true
81
58
  }
82
59
  }
83
60
  }
84
61
 
85
62
  // Make the struct public
86
63
  public struct InputTextArea: View {
87
- @Environment(\.appTheme) private var theme
88
64
  @Binding var text: String
89
65
  var maxLength: Int = MAX_LENGTH
90
66
  var height: CGFloat = DEFAULT_HEIGHT
91
67
  var floatingValue: String = ""
92
- var floatingValueColor: Color?
68
+ var floatingValueColor: Color = .gray
93
69
  var floatingIcon: String = ""
94
- var floatingIconColor: Color?
70
+ var floatingIconColor: Color = .black
95
71
  var placeholder: String = ""
96
72
  var onChangeText: (String) -> Void = { _ in }
97
73
  var error: String = ""
98
74
  var errorSpacing: Bool = false
99
75
  var disabled: Bool = false
100
76
  var icon: String = ""
101
- var iconColor: Color?
77
+ var iconColor: Color = .black
102
78
  var onRightIconPressed: () -> Void = {}
103
79
  var onFocus: () -> Void = {}
104
80
  var onBlur: () -> Void = {}
@@ -116,16 +92,16 @@ public struct InputTextArea: View {
116
92
  maxLength: Int = MAX_LENGTH,
117
93
  height: CGFloat = DEFAULT_HEIGHT,
118
94
  floatingValue: String = "",
119
- floatingValueColor: Color? = nil,
95
+ floatingValueColor: Color = .gray,
120
96
  floatingIcon: String = "",
121
- floatingIconColor: Color? = nil,
97
+ floatingIconColor: Color = .black,
122
98
  placeholder: String = "",
123
99
  onChangeText: @escaping (String) -> Void = { _ in },
124
100
  error: String = "",
125
101
  errorSpacing: Bool = false,
126
102
  disabled: Bool = false,
127
103
  icon: String = "",
128
- iconColor: Color? = nil,
104
+ iconColor: Color = Colors.pink03,
129
105
  onRightIconPressed: @escaping () -> Void = {},
130
106
  onFocus: @escaping () -> Void = {},
131
107
  onBlur: @escaping () -> Void = {},
@@ -162,27 +138,24 @@ public struct InputTextArea: View {
162
138
  ZStack(alignment: .topLeading) {
163
139
  if !floatingValue.isEmpty || !floatingIcon.isEmpty {
164
140
  HStack(spacing: 4) {
165
- MomoText(
166
- floatingValue,
167
- typography: .labelSMedium,
168
- color: disabled ? theme.colors.text.disable : (floatingValueColor ?? theme.colors.text.hint)
169
- )
141
+ Text(floatingValue)
142
+ .font(.caption)
143
+ .foregroundColor(disabled ? .gray : floatingValueColor)
170
144
 
171
145
  if required {
172
- MomoText("*", typography: .labelSMedium, color: theme.colors.error.primary)
146
+ Text("*")
147
+ .font(.caption)
148
+ .foregroundColor(.red)
173
149
  }
174
150
 
175
151
  if !floatingIcon.isEmpty {
176
- Icon(
177
- source: floatingIcon,
178
- size: 16,
179
- color: disabled ? theme.colors.text.disable : (floatingIconColor ?? theme.colors.text.default)
180
- )
181
- .padding(.leading, Spacing.XS)
152
+ Image(systemName: floatingIcon)
153
+ .font(.caption)
154
+ .foregroundColor(disabled ? .gray : floatingIconColor)
182
155
  }
183
156
  }
184
- .padding(.horizontal, Spacing.S)
185
- .background(theme.colors.background.surface)
157
+ .padding(.horizontal, 8)
158
+ .background(Colors.black01)
186
159
  .offset(x: Spacing.S, y: -height / 10)
187
160
  .zIndex(10)
188
161
  }
@@ -191,21 +164,13 @@ public struct InputTextArea: View {
191
164
  ZStack(alignment: .topLeading) {
192
165
  if text.isEmpty {
193
166
  Text(placeholder)
194
- .foregroundColor(disabled ? theme.colors.text.disable : theme.colors.text.hint)
167
+ .foregroundColor(disabled ? .gray : .gray)
195
168
  .font(.system(size: 16, weight: fontWeight))
196
169
  .padding(.horizontal, 16)
197
170
  .padding(.vertical, 12)
198
171
  }
199
172
 
200
- UITextViewWrapper(
201
- text: $text,
202
- maxLength: maxLength,
203
- textColor: disabled ? theme.colors.text.disable : theme.colors.text.default,
204
- cursorColor: theme.colors.primary,
205
- fontWeight: fontWeight,
206
- disabled: disabled,
207
- onChangeText: onChangeText,
208
- onDone: {
173
+ UITextViewWrapper(text: $text, onDone: {
209
174
  // Handle done action if needed
210
175
  },
211
176
  onFocus: {
@@ -223,20 +188,27 @@ public struct InputTextArea: View {
223
188
 
224
189
  HStack {
225
190
  Spacer()
226
- MomoText("\(text.count)/\(maxLength)", typography: .descriptionXsRegular, color: theme.colors.text.hint)
191
+ Text("\(text.count)/\(maxLength)")
192
+ .font(.caption)
193
+ .foregroundColor(.gray)
227
194
  }
228
195
  .padding(.horizontal, 16)
229
196
  .padding(.bottom, 12)
230
197
  }
231
- .background(theme.colors.background.surface)
232
- .cornerRadius(Radius.S)
198
+ .background(Color.white)
199
+ .cornerRadius(8)
233
200
  .overlay(
234
- RoundedRectangle(cornerRadius: Radius.S)
201
+ RoundedRectangle(cornerRadius: 8)
235
202
  .stroke(borderColor, lineWidth: 1)
236
203
  )
237
204
  }
238
205
 
239
- ErrorView(errorMessage: error, errorSpacing: errorSpacing, hintText: "")
206
+ if !error.isEmpty {
207
+ Text(error)
208
+ .font(.caption)
209
+ .foregroundColor(.red)
210
+ .padding(.top, errorSpacing ? 8 : 4)
211
+ }
240
212
  }
241
213
  .onReceive(NotificationCenter.default.publisher(for: UIResponder.keyboardWillShowNotification)) { _ in
242
214
  if !isBlurred {
@@ -256,14 +228,16 @@ public struct InputTextArea: View {
256
228
 
257
229
  private var borderColor: Color {
258
230
  if disabled {
259
- return theme.colors.border.disable
231
+ return Colors.black03
260
232
  } else if !error.isEmpty {
261
- return theme.colors.error.primary
233
+ return .red
262
234
  } else if isFocused {
263
- return theme.colors.primary
235
+ return Colors.pink03
264
236
  } else {
265
- return theme.colors.border.default
237
+ return Colors.border
266
238
  }
267
239
 
268
240
  }
269
241
  }
242
+
243
+
@@ -221,13 +221,17 @@ public struct PopupDisplay: View {
221
221
  var RowTextButtons: some View {
222
222
  HStack {
223
223
  SwiftUI.Button(action: onPressCloseButton) {
224
- MomoText(closeButtonTitle, typography: .actionSBold, color: Colors.black09)
225
- }
224
+ Text(closeButtonTitle)
225
+ .font(.action2)
226
+ .ignoreBoldTextSetting()
227
+ }.foregroundColor(Colors.black09)
226
228
  .padding(.trailing, 12)
227
229
 
228
230
  SwiftUI.Button(action: onPressAction) {
229
- MomoText(actionButtonTitle, typography: .actionSBold, color: Colors.primary)
230
- }
231
+ Text(actionButtonTitle)
232
+ .font(.action2)
233
+ .ignoreBoldTextSetting()
234
+ }.foregroundColor(Colors.primary)
231
235
  }
232
236
  .frame(maxWidth: .infinity, alignment: .trailing)
233
237
  .padding(EdgeInsets(top: 0, leading: 0, bottom: 24, trailing: 24))
@@ -236,13 +240,17 @@ public struct PopupDisplay: View {
236
240
  var ColumnTextButtons: some View {
237
241
  VStack(alignment: .trailing) {
238
242
  SwiftUI.Button(action: onPressAction) {
239
- MomoText(actionButtonTitle, typography: .actionSBold, color: Colors.primary)
240
- }
243
+ Text(actionButtonTitle)
244
+ .font(.action2)
245
+ .ignoreBoldTextSetting()
246
+ }.foregroundColor(Colors.primary)
241
247
  .padding(.bottom, 6)
242
248
 
243
249
  SwiftUI.Button(action: onPressCloseButton) {
244
- MomoText(closeButtonTitle, typography: .actionSBold, color: Colors.black09)
245
- }
250
+ Text(closeButtonTitle)
251
+ .font(.action2)
252
+ .ignoreBoldTextSetting()
253
+ }.foregroundColor(Colors.black09)
246
254
  }
247
255
  .frame(maxWidth: .infinity, alignment: .trailing)
248
256
  .padding(EdgeInsets(top: 0, leading: 0, bottom: 24, trailing: 24))