@momo-kits/native-kits 0.169.6 → 0.169.7-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 (229) hide show
  1. package/build.gradle.kts +11 -0
  2. package/compose/build.gradle.kts +198 -0
  3. package/compose/compose.podspec +47 -0
  4. package/compose/src/androidMain/kotlin/vn/momo/kits/const/HostFont.android.kt +19 -0
  5. package/compose/src/androidMain/kotlin/vn/momo/kits/navigation/ScrollToTop.android.kt +6 -0
  6. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/BackGesture.android.kt +12 -0
  7. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/OsFontScale.android.kt +7 -0
  8. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +154 -0
  9. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/ReduceMotion.android.kt +17 -0
  10. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/ReservedRegions.android.kt +6 -0
  11. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +110 -0
  12. package/compose/src/commonMain/kotlin/vn/momo/kits/application/DesignSystemKits.kt +62 -0
  13. package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +1067 -0
  14. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Localize.kt +267 -0
  15. package/compose/src/commonMain/kotlin/vn/momo/kits/application/WidgetContainer.kt +56 -0
  16. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +157 -0
  17. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +82 -0
  18. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +32 -0
  19. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +338 -0
  20. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +175 -0
  21. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +356 -0
  22. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +115 -0
  23. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +89 -0
  24. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +128 -0
  25. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +209 -0
  26. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +482 -0
  27. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +49 -0
  28. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +86 -0
  29. package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +125 -0
  30. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +224 -0
  31. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +195 -0
  32. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +473 -0
  33. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +113 -0
  34. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +263 -0
  35. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +235 -0
  36. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +228 -0
  37. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +265 -0
  38. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +183 -0
  39. package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +343 -0
  40. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +108 -0
  41. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +56 -0
  42. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +40 -0
  43. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +82 -0
  44. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +39 -0
  45. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +363 -0
  46. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +108 -0
  47. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +307 -0
  48. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +59 -0
  49. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +87 -0
  50. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +21 -0
  51. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +88 -0
  52. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +306 -0
  53. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +220 -0
  54. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +457 -0
  55. package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +122 -0
  56. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +205 -0
  57. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +89 -0
  58. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +542 -0
  59. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +86 -0
  60. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +120 -0
  61. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +201 -0
  62. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +498 -0
  63. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +176 -0
  64. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +182 -0
  65. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +193 -0
  66. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +29 -0
  67. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +210 -0
  68. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +180 -0
  69. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +325 -0
  70. package/compose/src/commonMain/kotlin/vn/momo/kits/const/HostFont.kt +12 -0
  71. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +12 -0
  72. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +16 -0
  73. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +194 -0
  74. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +292 -0
  75. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +54 -0
  76. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +50 -0
  77. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ModalLayout.kt +184 -0
  78. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ScreenLayout.kt +316 -0
  79. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +41 -0
  80. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +52 -0
  81. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +66 -0
  82. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +11 -0
  83. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +104 -0
  84. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +48 -0
  85. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Size.kt +51 -0
  86. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +397 -0
  87. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/HostBackGestureBridge.kt +58 -0
  88. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +153 -0
  89. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +113 -0
  90. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +205 -0
  91. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +422 -0
  92. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ScrollToTop.kt +8 -0
  93. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +727 -0
  94. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackTransition.kt +148 -0
  95. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/SwipeBackHaptic.kt +35 -0
  96. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +239 -0
  97. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +430 -0
  98. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +100 -0
  99. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoBarCompression.kt +97 -0
  100. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoTabBar.kt +208 -0
  101. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/TabBarMetrics.kt +129 -0
  102. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +167 -0
  103. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +456 -0
  104. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +105 -0
  105. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderJourney.kt +106 -0
  106. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderLocation.kt +74 -0
  107. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +399 -0
  108. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +39 -0
  109. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +363 -0
  110. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SideBar.kt +204 -0
  111. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +133 -0
  112. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +127 -0
  113. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/BackGesture.kt +12 -0
  114. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +114 -0
  115. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/OsFontScale.kt +9 -0
  116. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +76 -0
  117. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReduceMotion.kt +7 -0
  118. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReservedRegions.kt +22 -0
  119. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +1329 -0
  120. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +55 -0
  121. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +15 -0
  122. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +118 -0
  123. package/compose/src/iosMain/kotlin/vn/momo/kits/const/HostFont.ios.kt +42 -0
  124. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/HostBackGesture.ios.kt +45 -0
  125. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +32 -0
  126. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/BackGesture.ios.kt +38 -0
  127. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/OsFontScale.ios.kt +66 -0
  128. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +218 -0
  129. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/ReduceMotion.ios.kt +48 -0
  130. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/ReservedRegions.ios.kt +144 -0
  131. package/gradle/libs.versions.toml +67 -0
  132. package/gradle/wrapper/gradle-wrapper.jar +0 -0
  133. package/gradle/wrapper/gradle-wrapper.properties +8 -0
  134. package/gradle.properties +24 -0
  135. package/gradlew +252 -0
  136. package/gradlew.bat +94 -0
  137. package/ios/Application/ApplicationEnvironment.swift +2 -3
  138. package/ios/Application/DesignSystemKits.swift +4 -20
  139. package/ios/Application/DesignSystemKitsPayload.swift +0 -8
  140. package/ios/Application/LanguageSource.swift +0 -8
  141. package/ios/Application/Localize.swift +7 -31
  142. package/ios/Application/LocalizeModifier.swift +0 -8
  143. package/ios/Application/MaxApi.swift +3 -11
  144. package/ios/Avatar/Avatar.swift +0 -1
  145. package/ios/Badge/Badge.swift +0 -1
  146. package/ios/Badge/BadgeRibbon.swift +2 -5
  147. package/ios/Button/Button.swift +2 -5
  148. package/ios/CalculatorKeyboard/CalculatorKeyboard.swift +2 -2
  149. package/ios/Carousel/Carousel.swift +5 -17
  150. package/ios/Checkbox/Checkbox.swift +0 -2
  151. package/ios/Colors+Radius+Spacing/Theme.swift +0 -7
  152. package/ios/DateTimePicker/DateTimePicker.swift +4 -10
  153. package/ios/DateTimePicker/DateTimePickerTypes.swift +1 -3
  154. package/ios/DateTimePicker/DateTimePickerUtils.swift +0 -3
  155. package/ios/DateTimePicker/WheelPicker.swift +2 -4
  156. package/ios/Extensions/SkeletonUICompat.swift +0 -8
  157. package/ios/Icon/Icon.swift +1 -3
  158. package/ios/IconButton/IconButton.swift +0 -2
  159. package/ios/Input/ErrorView.swift +0 -7
  160. package/ios/Input/Input.swift +6 -19
  161. package/ios/Input/InputPhoneNumber.swift +0 -11
  162. package/ios/Input/InputSearch.swift +0 -6
  163. package/ios/Input/InputTextArea.swift +1 -12
  164. package/ios/InputDropDown/InputDropDown.swift +1 -11
  165. package/ios/InputMoney/InputMoney.swift +9 -28
  166. package/ios/InputOTP/InputOTP.swift +2 -9
  167. package/ios/Layout/Item.swift +1 -2
  168. package/ios/Layout/ModalLayout.swift +7 -14
  169. package/ios/Layout/ScreenLayout.swift +2 -7
  170. package/ios/Loader/Loader.swift +3 -12
  171. package/ios/Lottie/LottieView.swift +0 -11
  172. package/ios/Navigation/BottomSheet.swift +14 -35
  173. package/ios/Navigation/BottomTab/BottomTab.swift +10 -19
  174. package/ios/Navigation/BottomTab/BottomTabBar.swift +4 -10
  175. package/ios/Navigation/BottomTab/CurvedContainer.swift +5 -11
  176. package/ios/Navigation/BottomTab/DuoBarCompression.swift +6 -12
  177. package/ios/Navigation/BottomTab/DuoTabBar.swift +2 -7
  178. package/ios/Navigation/BottomTab/TabBarMetrics.swift +3 -9
  179. package/ios/Navigation/Component/FloatingButton.swift +4 -11
  180. package/ios/Navigation/Component/Header.swift +4 -8
  181. package/ios/Navigation/Component/HeaderBackground.swift +2 -8
  182. package/ios/Navigation/Component/HeaderJourney.swift +2 -7
  183. package/ios/Navigation/Component/HeaderLocation.swift +2 -7
  184. package/ios/Navigation/Component/HeaderRight.swift +2 -7
  185. package/ios/Navigation/Component/HeaderTitle.swift +1 -6
  186. package/ios/Navigation/Component/HeaderUser.swift +2 -9
  187. package/ios/Navigation/Component/SideBar.swift +3 -8
  188. package/ios/Navigation/Component/SnackBar.swift +5 -13
  189. package/ios/Navigation/HostBackGestureBridge.swift +3 -9
  190. package/ios/Navigation/ModalScreen.swift +2 -8
  191. package/ios/Navigation/Navigation.swift +2 -15
  192. package/ios/Navigation/NavigationContainer.swift +3 -12
  193. package/ios/Navigation/Navigator.swift +15 -27
  194. package/ios/Navigation/StackScreen.swift +8 -28
  195. package/ios/Navigation/StackTransition.swift +3 -11
  196. package/ios/Navigation/SwipeBackHaptic.swift +2 -7
  197. package/ios/Navigation/Tracking/ScreenTracker.swift +2 -7
  198. package/ios/Pagination/PaginationDot.swift +0 -9
  199. package/ios/Pagination/PaginationNumber.swift +1 -9
  200. package/ios/Pagination/PaginationScroll.swift +2 -14
  201. package/ios/Pagination/PaginationWhiteDot.swift +1 -10
  202. package/ios/Popup/PopupDisplay.swift +3 -3
  203. package/ios/Popup/PopupInput.swift +1 -1
  204. package/ios/Popup/PopupLayout.swift +3 -3
  205. package/ios/PopupView/FullscreenPopup.swift +3 -4
  206. package/ios/PopupView/PopupView.swift +2 -2
  207. package/ios/PopupView/Utils++.swift +1 -2
  208. package/ios/ProgressInfo/ProgressInfo.swift +2 -13
  209. package/ios/Skeleton/Skeleton.swift +2 -10
  210. package/ios/Slider/Slider.swift +5 -12
  211. package/ios/StatusBarTap/StatusBarTap.h +2 -3
  212. package/ios/StatusBarTap/StatusBarTap.m +3 -16
  213. package/ios/Stepper/Stepper.swift +8 -27
  214. package/ios/Steps/Steps.swift +9 -11
  215. package/ios/Swipeable/SwipeCell.swift +2 -2
  216. package/ios/Swipeable/SwipeCellModel.swift +3 -6
  217. package/ios/TabView/TabView.swift +12 -25
  218. package/ios/Template/TrustBanner/TrustBanner.swift +2 -9
  219. package/ios/Tooltip/Tooltip.swift +2 -7
  220. package/ios/Typography/FontScale.swift +3 -15
  221. package/ios/Typography/Text.swift +2 -7
  222. package/ios/Typography/Typography.swift +8 -10
  223. package/ios/Uploader/Uploader.swift +2 -17
  224. package/ios/native-kits.podspec +1 -1
  225. package/ios-demo/MoMoUIKitsDemo.podspec +1 -1
  226. package/ios-demo/README.md +120 -0
  227. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/LocalizeDemo.swift +0 -8
  228. package/package.json +1 -1
  229. package/settings.gradle.kts +64 -0
@@ -1,12 +1,3 @@
1
- //
2
- // PaginationDot.swift
3
- // MoMoUIKits
4
- //
5
- // Native SwiftUI port of Compose's PaginationDot.
6
- // An active dot is a 12x4 pill in `activeColor`; inactive dots are 4x4
7
- // rounded squares in the pressed-background token.
8
- //
9
-
10
1
  import SwiftUI
11
2
 
12
3
  // MARK: - Dot
@@ -1,11 +1,3 @@
1
- //
2
- // PaginationNumber.swift
3
- // MoMoUIKits
4
- //
5
- // Native SwiftUI port of Compose's PaginationNumber.
6
- // Renders "current/total" text on a translucent black rounded chip.
7
- //
8
-
9
1
  import SwiftUI
10
2
 
11
3
  // MARK: - PaginationNumber
@@ -29,7 +21,7 @@ public struct PaginationNumber: View {
29
21
  .padding(.horizontal, Spacing.S)
30
22
  .background(
31
23
  RoundedRectangle(cornerRadius: Radius.L)
32
- .fill(Color.black.opacity(0.2)) // Color(0x33000000)
24
+ .fill(Colors.opacityBlack20)
33
25
  )
34
26
  }
35
27
  }
@@ -1,12 +1,3 @@
1
- //
2
- // PaginationScroll.swift
3
- // MoMoUIKits
4
- //
5
- // Native SwiftUI port of Compose's PaginationScroll.
6
- // Wraps arbitrary horizontally-scrollable content and renders a
7
- // progress-bar style indicator whose position tracks the scroll offset.
8
- //
9
-
10
1
  import SwiftUI
11
2
 
12
3
  // MARK: - Constants
@@ -22,10 +13,8 @@ private func calculateOffset(currentPosition: CGFloat, maxBound: CGFloat) -> CGF
22
13
 
23
14
  // MARK: - PaginationScroll
24
15
 
25
- /// Mirrors Compose's `PaginationScroll(modifier, content)`.
26
- ///
27
- /// The trailing-closure `content` is laid out in a horizontal scroll view and
28
- /// the indicator below reflects the current scroll progress.
16
+ /// Mirrors Compose's `PaginationScroll(modifier, content)`: horizontal scroll content with a
17
+ /// progress indicator below that tracks the scroll offset.
29
18
  public struct PaginationScroll<Content: View>: View {
30
19
  @Environment(\.appTheme) private var theme
31
20
 
@@ -76,7 +65,6 @@ public struct PaginationScroll<Content: View>: View {
76
65
  .onPreferenceChange(ScrollOffsetKey.self) { scrollOffset = max($0, 0) }
77
66
  .padding(.bottom, Spacing.L)
78
67
 
79
- // Progress indicator
80
68
  ZStack(alignment: .leading) {
81
69
  RoundedRectangle(cornerRadius: Spacing.XS)
82
70
  .fill(theme.colors.background.pressed)
@@ -1,12 +1,3 @@
1
- //
2
- // PaginationWhiteDot.swift
3
- // MoMoUIKits
4
- //
5
- // Native SwiftUI port of Compose's PaginationWhiteDot.
6
- // Same dot layout as PaginationDot, but the active color is white
7
- // (black_01) and the row sits on a translucent black rounded surface.
8
- //
9
-
10
1
  import SwiftUI
11
2
 
12
3
  // MARK: - PaginationWhiteDot
@@ -31,7 +22,7 @@ public struct PaginationWhiteDot: View {
31
22
  .padding(Spacing.XS)
32
23
  .background(
33
24
  RoundedRectangle(cornerRadius: Radius.S)
34
- .fill(Color.black.opacity(0.2)) // Color(0x33000000)
25
+ .fill(Colors.opacityBlack20)
35
26
  )
36
27
  }
37
28
  }
@@ -108,7 +108,7 @@ public struct PopupDisplay: View {
108
108
  }
109
109
  .fixedSize(horizontal: false, vertical: true)
110
110
  .background(theme.colors.background.surface)
111
- .clipShape(RoundedRectangle(cornerRadius: layout.popupRadius()))
111
+ .clipShape(RoundedRectangle(cornerRadius: layout.popupRadius))
112
112
 
113
113
  if isShowCloseIcon {
114
114
  ModalIconButton(icon: "navigation_close", accessibilityId: "ic_popup_close", action: onClose)
@@ -116,8 +116,8 @@ public struct PopupDisplay: View {
116
116
  .padding(.trailing, Spacing.M)
117
117
  }
118
118
  }
119
- .frame(maxWidth: layout.popupMaxWidth)
120
- .padding(.horizontal, layout.popupHorizontalPadding(12))
119
+ // window minus 24 a side on phones too, host padding included (PopupNotify parity)
120
+ .frame(maxWidth: layout.modalLayout.popup.maxWidth)
121
121
  .accessibilityElement(children: .contain)
122
122
  .accessibilityIdentifier("popup_notify")
123
123
  }
@@ -61,7 +61,7 @@ public struct PopupInput: View {
61
61
  .padding(.trailing, Spacing.M)
62
62
  }
63
63
  }
64
- .background(theme.colors.background.surface.cornerRadius(layout.popupRadius(8)))
64
+ .background(theme.colors.background.surface.cornerRadius(layout.popupRadius))
65
65
  .shadow(color: .black.opacity(0.08), radius: 2, x: 0, y: 0)
66
66
  .shadow(color: .black.opacity(0.16), radius: 24, x: 0, y: 0)
67
67
  .frame(maxWidth: layout.popupMaxWidth)
@@ -19,9 +19,9 @@ extension ScreenLayout {
19
19
  modalLayout.popup.maxHeight
20
20
  }
21
21
 
22
- func popupRadius(_ regular: CGFloat = Radius.L) -> CGFloat {
23
- let modal = modalLayout
24
- return modal.isFoldable ? modal.popup.radius : regular
22
+ /// Popup corner radius on every device (`modalLayout`, Compose `popupRadius`).
23
+ var popupRadius: CGFloat {
24
+ modalLayout.popup.radius
25
25
  }
26
26
  }
27
27
 
@@ -1,10 +1,9 @@
1
-
2
1
  import Foundation
3
2
  import SwiftUI
4
3
 
5
4
  public struct FullscreenPopup<Item: Equatable, PopupContent: View>: ViewModifier {
6
5
 
7
- // MARK: - Presentaion
6
+ // MARK: - Presentation
8
7
  @Binding var isPresented: Bool
9
8
  @Binding var item: Item?
10
9
 
@@ -56,7 +55,7 @@ public struct FullscreenPopup<Item: Equatable, PopupContent: View>: ViewModifier
56
55
  @State private var dispatchWorkHolder = DispatchWorkHolder()
57
56
 
58
57
  // MARK: - Internal
59
- /// Set dismiss souce to pass to dismiss callback
58
+ /// Set dismiss source to pass to dismiss callback
60
59
  @State private var dismissSource: DismissSource?
61
60
 
62
61
  init(isPresented: Binding<Bool>,
@@ -190,7 +189,7 @@ public struct FullscreenPopup<Item: Equatable, PopupContent: View>: ViewModifier
190
189
  showContent = true // immediately load popup body
191
190
  performWithDelay(0.01) {
192
191
  shouldShowContent = true // this will cause currentOffset change thus triggering the sliding showing animation
193
- opacity = 1 // this will cause cross disolving animation for background color
192
+ opacity = 1 // this will cause cross dissolving animation for background color
194
193
  setupAutohide()
195
194
  }
196
195
  } else {
@@ -1,7 +1,7 @@
1
1
  import SwiftUI
2
2
 
3
3
  public enum DismissSource {
4
- case binding // set isPresented to false ot item to nil
4
+ case binding // set isPresented to false or item to nil
5
5
  case tapInside
6
6
  case tapOutside
7
7
  case drag
@@ -140,7 +140,7 @@ public struct Popup<Item: Equatable, PopupContent: View>: ViewModifier {
140
140
  /// is called on any close action
141
141
  var dismissCallback: (DismissSource) -> ()
142
142
 
143
- /// Set dismiss souce to pass to dismiss callback
143
+ /// Set dismiss source to pass to dismiss callback
144
144
  @Binding private var dismissSource: DismissSource?
145
145
 
146
146
  /// called on showing/hiding sliding animation completed
@@ -128,7 +128,7 @@ struct AnimatableModifierDouble: AnimatableModifier {
128
128
  // Set animatableData to the new value. But SwiftUI again directly
129
129
  // and gradually varies the value while the body
130
130
  // is being called to animate. Following line serves the purpose of
131
- // associating the extenal argument with the animatableData.
131
+ // associating the external argument with the animatableData.
132
132
  self.animatableData = bindedValue
133
133
  targetValue = bindedValue
134
134
  AnimatableModifierDouble.done = false
@@ -139,7 +139,6 @@ struct AnimatableModifierDouble: AnimatableModifier {
139
139
  let delta = 0.1
140
140
  if animatableData > targetValue - delta &&
141
141
  animatableData < targetValue + delta {
142
- //print("check", animatableData, targetValue)
143
142
  AnimatableModifierDouble.done = true
144
143
  DispatchQueue.main.async {
145
144
  self.completion()
@@ -27,19 +27,8 @@ public enum ProgressInfoAlign {
27
27
 
28
28
  // MARK: - Public entry-point
29
29
 
30
- /// Display-only step progress indicator.
31
- ///
32
- /// - Parameters:
33
- /// - steps: Ordered list of steps; each has a title and an optional description.
34
- /// - horizontal: When `true` renders steps in a horizontal row with connector lines;
35
- /// when `false` (default) renders a vertical column.
36
- /// - size: Icon diameter: `.small` = 16, `.large` = 24 (default).
37
- /// - useNumber: Show the 1-based step index inside the icon instead of the default dot.
38
- /// - align: Alignment of icon + text for the horizontal variant.
39
- /// - showTitle: Whether step titles are rendered (default `true`).
40
- /// - showDescription: Whether step descriptions are rendered (default `true`).
41
- /// - customIcon: Icon source key rendered inside each step circle (overrides the dot;
42
- /// itself overridden by `useNumber`).
30
+ /// Display-only step progress. Each step icon shows the 1-based index with `useNumber`, else
31
+ /// `customIcon`, else a dot; `align` applies to the horizontal variant only.
43
32
  public struct ProgressInfo: View {
44
33
  private let steps: [ProgressInfoItem]
45
34
  private let horizontal: Bool
@@ -1,14 +1,8 @@
1
1
  import Foundation
2
2
  import SwiftUI
3
3
 
4
- /// Native SwiftUI port of the Compose `Skeleton` component.
5
- ///
6
- /// Fills the available space with a base placeholder color and overlays a
7
- /// horizontal shimmer gradient that animates left-to-right on an infinite loop.
8
- ///
9
- /// Mirrors the Compose surface: `Skeleton()` takes no required arguments and
10
- /// fills its container. The shimmer animation parameters match the Compose
11
- /// defaults (`durationMillis = 1000`, shimmer band = 60% of container width).
4
+ /// Compose `Skeleton`: fills its container with a placeholder color under a shimmer band
5
+ /// that loops left to right, with Compose's defaults (1000ms, band 60% of the width).
12
6
  public struct Skeleton: View {
13
7
  // Matches Compose `DEFAULT_DURATION_MILLIS = 1000`.
14
8
  private let durationMillis: Int
@@ -31,7 +25,6 @@ public struct Skeleton: View {
31
25
  angleOfAxisY: angleOfAxisY
32
26
  )
33
27
  }
34
- // Compose base background (`Colors.black_05`).
35
28
  .background(Colors.black05)
36
29
  }
37
30
  }
@@ -47,7 +40,6 @@ private struct ShimmerLoading: View {
47
40
  // Matches Compose `SHADOW_BRUSH_PERCENTAGE = 0.6f`.
48
41
  private static let shadowBrushPercentage: CGFloat = 0.6
49
42
 
50
- // Pre-computed shimmer colors (Colors.black_05, black_03, black_05).
51
43
  private static let shimmerColors: [Color] = [
52
44
  Colors.black05,
53
45
  Colors.black03,
@@ -1,13 +1,13 @@
1
1
  import SwiftUI
2
2
 
3
- // ── Design constants ─────────────────────────────────────────────────────────
3
+ // MARK: - Constants
4
4
 
5
5
  private let THUMB_SIZE: CGFloat = 20
6
6
  private let THUMB_BORDER: CGFloat = 3
7
7
  private let TRACK_HEIGHT: CGFloat = 4
8
8
  private let LABEL_GAP: CGFloat = 4 // space between label and thumb top (Spacing.XS)
9
9
 
10
- // ── Pure helpers (mirrors Compose / RN helpers) ──────────────────────────────
10
+ // MARK: - Helpers (Compose / RN parity)
11
11
 
12
12
  private func clampF(_ value: CGFloat, _ minV: CGFloat, _ maxV: CGFloat) -> CGFloat {
13
13
  Swift.min(Swift.max(value, minV), maxV)
@@ -55,12 +55,10 @@ private func formatLabel(_ value: CGFloat) -> String {
55
55
  return String(Double((value * 10).rounded(.towardZero)) / 10)
56
56
  }
57
57
 
58
- // ── Component ─────────────────────────────────────────────────────────────────
58
+ // MARK: - MomoSlider
59
59
 
60
- /// Range slider (or single-thumb when `disableRange` = true), ported from Compose.
61
- ///
62
- /// SwiftUI ships a built-in `Slider`; this custom type is named `MomoSlider`
63
- /// (convention, like `MomoText`) to avoid module-wide shadowing.
60
+ /// Compose range slider (one thumb with `disableRange`), named `MomoSlider` like `MomoText`
61
+ /// to avoid shadowing SwiftUI's `Slider`.
64
62
  public struct MomoSlider: View {
65
63
  @Environment(\.appTheme) private var theme
66
64
 
@@ -130,7 +128,6 @@ public struct MomoSlider: View {
130
128
  let activeWidth = availableWidth * (activeEndFraction - activeStartFraction)
131
129
 
132
130
  ZStack(alignment: .topLeading) {
133
- // ── Floating label ────────────────────────────────────────────
134
131
  if floatingLabel && isDragging {
135
132
  let activeFraction = draggingLow ? lowFraction : highFraction
136
133
  let activeValue = draggingLow ? lowValue : highValue
@@ -142,13 +139,11 @@ public struct MomoSlider: View {
142
139
  .offset(x: availableWidth * activeFraction, y: 0)
143
140
  }
144
141
 
145
- // ── Inactive track (full width) ───────────────────────────────
146
142
  Capsule()
147
143
  .fill(trackInactiveColor)
148
144
  .frame(width: max(trackWidth - THUMB_SIZE, 0), height: TRACK_HEIGHT)
149
145
  .offset(x: THUMB_SIZE / 2, y: topPad + (THUMB_SIZE - TRACK_HEIGHT) / 2)
150
146
 
151
- // ── Active track (selected range / single value) ──────────────
152
147
  if activeWidth > 0 {
153
148
  Capsule()
154
149
  .fill(trackActiveColor)
@@ -156,11 +151,9 @@ public struct MomoSlider: View {
156
151
  .offset(x: activeStartX, y: topPad + (THUMB_SIZE - TRACK_HEIGHT) / 2)
157
152
  }
158
153
 
159
- // ── Low thumb ─────────────────────────────────────────────────
160
154
  thumb
161
155
  .offset(x: availableWidth * lowFraction, y: topPad)
162
156
 
163
- // ── High thumb (range mode only) ──────────────────────────────
164
157
  if !disableRange {
165
158
  thumb
166
159
  .offset(x: availableWidth * highFraction, y: topPad)
@@ -2,9 +2,8 @@
2
2
 
3
3
  NS_ASSUME_NONNULL_BEGIN
4
4
 
5
- /// Posts `MoMoStatusBarTap.notificationName` on every status-bar tap.
6
- /// The swizzle installs automatically at framework load (`+load`) — calling
7
- /// `install` is a no-op kept for explicit/manual triggering.
5
+ /// Posts `MoMoStatusBarTap.notificationName` on every status-bar tap once `install` has run.
6
+ /// Opt-in: there is no `+load` auto-install; `install` is idempotent.
8
7
  @interface MoMoStatusBarTap : NSObject
9
8
  @property (class, nonatomic, readonly) NSNotificationName notificationName;
10
9
  + (void)install;
@@ -3,7 +3,6 @@
3
3
  #import <objc/runtime.h>
4
4
  #import "StatusBarTap.h"
5
5
 
6
- // Performs the actual swizzle once per process. Safe to call multiple times.
7
6
  static void mm_installStatusBarTapSwizzleOnce(void) {
8
7
  static dispatch_once_t onceToken;
9
8
  dispatch_once(&onceToken, ^{
@@ -15,9 +14,7 @@ static void mm_installStatusBarTapSwizzleOnce(void) {
15
14
  Method swizzledMethod = class_getInstanceMethod(cls, swizzledSelector);
16
15
  if (!originalMethod || !swizzledMethod) return;
17
16
 
18
- // Verify the original method matches the (id) -> void shape we expect.
19
- // Encoding may include byte offsets (e.g. "v32@0:8@16") so we filter
20
- // digits out before comparing.
17
+ // Bail unless the original is (id) -> void; the encoding carries byte offsets ("v32@0:8@16").
21
18
  const char *encPtr = method_getTypeEncoding(originalMethod);
22
19
  if (encPtr) {
23
20
  NSMutableString *enc = [NSMutableString string];
@@ -48,24 +45,14 @@ static void mm_installStatusBarTapSwizzleOnce(void) {
48
45
  @end
49
46
 
50
47
  // MARK: - Swizzle target on UIStatusBarManager
51
- // `mm_handleTapAction:` is the replacement IMP. After the add/exchange,
52
- // this selector points at the original UIKit IMP — calling it inside
53
- // the body invokes UIKit's real handler so UIScrollView.scrollsToTop
54
- // and any other side effects continue to work.
48
+ // After the swizzle `mm_handleTapAction:` points at UIKit's original IMP, so calling it runs the
49
+ // real handler (UIScrollView.scrollsToTop and other side effects) before posting.
55
50
 
56
51
  @interface UIStatusBarManager (MoMoStatusBarTap)
57
52
  @end
58
53
 
59
54
  @implementation UIStatusBarManager (MoMoStatusBarTap)
60
55
 
61
- // Auto-install at framework load. Commented out so the swizzle stays
62
- // opt-in via `[MoMoStatusBarTap install]`. Uncomment to revert to
63
- // auto-installation before main().
64
- //
65
- // + (void)load {
66
- // mm_installStatusBarTapSwizzleOnce();
67
- // }
68
-
69
56
  - (void)mm_handleTapAction:(id)action {
70
57
  [self mm_handleTapAction:action];
71
58
  [[NSNotificationCenter defaultCenter] postNotificationName:MoMoStatusBarTap.notificationName
@@ -1,8 +1,6 @@
1
1
  import SwiftUI
2
2
 
3
- // ---------------------------------------------------------------------------
4
- // Size variant
5
- // ---------------------------------------------------------------------------
3
+ // MARK: - Size
6
4
 
7
5
  public enum StepperSize {
8
6
  case large
@@ -25,10 +23,9 @@ private func stepperSizeSpec(_ size: StepperSize) -> StepperSizeSpec {
25
23
  }
26
24
  }
27
25
 
28
- // ---------------------------------------------------------------------------
29
- // Disabled spec — mirrors Compose `disabled: Any` (Bool or per-part array)
30
- // ---------------------------------------------------------------------------
26
+ // MARK: - Disabled
31
27
 
28
+ /// Compose's `disabled: Any`: one Bool for every part, or per part.
32
29
  public struct StepperDisabled {
33
30
  let minus: Bool
34
31
  let plus: Bool
@@ -40,7 +37,6 @@ public struct StepperDisabled {
40
37
  self.plus = plus
41
38
  }
42
39
 
43
- /// All parts share the same disabled state.
44
40
  public init(_ all: Bool) {
45
41
  self.minus = all
46
42
  self.plus = all
@@ -53,9 +49,7 @@ extension StepperDisabled: ExpressibleByBooleanLiteral {
53
49
  }
54
50
  }
55
51
 
56
- // ---------------------------------------------------------------------------
57
- // Private sub-views
58
- // ---------------------------------------------------------------------------
52
+ // MARK: - Sub-views
59
53
 
60
54
  private struct StepperButton: View {
61
55
  @Environment(\.appTheme) private var theme
@@ -119,23 +113,10 @@ private struct StepperNumberView: View {
119
113
  }
120
114
  }
121
115
 
122
- // ---------------------------------------------------------------------------
123
- // Public API — MomoStepper
124
- // ---------------------------------------------------------------------------
125
-
126
- /// MomoStepper — quantity +/- control. Layout: [- button] [value] [+ button].
127
- ///
128
- /// Named `MomoStepper` to avoid shadowing SwiftUI's built-in `Stepper`.
129
- ///
130
- /// - Parameters:
131
- /// - value: Binding to the current value. Clamped to `min...max`.
132
- /// - min: Minimum allowed value (default 0). Minus auto-disables at this bound.
133
- /// - max: Maximum allowed value (default 100). Plus auto-disables at this bound.
134
- /// - step: Amount added/subtracted per press (default 1).
135
- /// - size: Visual size variant (default `.large`).
136
- /// - disabled: Disable state — `true` for everything, or `StepperDisabled(minus:plus:)`.
137
- /// - editable: When `true` the number display becomes a keyboard input (default false).
138
- /// - onValueChange: Callback invoked with the new value on every change.
116
+ // MARK: - MomoStepper
117
+
118
+ /// Quantity +/- control, named `MomoStepper` to avoid shadowing SwiftUI's `Stepper`.
119
+ /// `value` is clamped to `min...max`; each button disables itself at its bound.
139
120
  public struct MomoStepper: View {
140
121
  @Binding private var value: Int
141
122
  private let min: Int
@@ -1,6 +1,6 @@
1
1
  import SwiftUI
2
2
 
3
- // ─── Data model ────────────────────────────────────────────────────────────────
3
+ // MARK: - Data model
4
4
 
5
5
  /// A single step rendered inside a ``Steps`` indicator.
6
6
  public struct StepItem: Identifiable {
@@ -23,7 +23,7 @@ public struct StepItem: Identifiable {
23
23
  }
24
24
  }
25
25
 
26
- // ─── Enumerations ──────────────────────────────────────────────────────────────
26
+ // MARK: - Enumerations
27
27
 
28
28
  public enum StepsSize {
29
29
  case small
@@ -37,7 +37,7 @@ public enum StepsAlign {
37
37
  case stretch
38
38
  }
39
39
 
40
- // ─── Internal status ───────────────────────────────────────────────────────────
40
+ // MARK: - Internal status
41
41
 
42
42
  private enum StepStatus {
43
43
  case incomplete
@@ -60,7 +60,7 @@ private func resolveStatus(
60
60
  return .incomplete
61
61
  }
62
62
 
63
- // ─── Color helpers ─────────────────────────────────────────────────────────────
63
+ // MARK: - Color helpers
64
64
 
65
65
  private func resolveIconBgAndBorder(_ status: StepStatus, theme: Theme) -> (bg: Color, border: Color) {
66
66
  switch status {
@@ -88,7 +88,7 @@ private func resolveTitleColor(_ status: StepStatus, theme: Theme) -> Color {
88
88
  }
89
89
  }
90
90
 
91
- // ─── Step bubble ───────────────────────────────────────────────────────────────
91
+ // MARK: - Step bubble
92
92
 
93
93
  private struct StepBubble: View {
94
94
  @Environment(\.appTheme) private var theme
@@ -143,7 +143,7 @@ private struct StepBubble: View {
143
143
  }
144
144
  }
145
145
 
146
- // ─── Horizontal layout ─────────────────────────────────────────────────────────
146
+ // MARK: - Horizontal layout
147
147
 
148
148
  private struct StepsHorizontal: View {
149
149
  @Environment(\.appTheme) private var theme
@@ -297,7 +297,7 @@ private struct StepsHorizontal: View {
297
297
  }
298
298
  }
299
299
 
300
- // ─── Vertical layout ───────────────────────────────────────────────────────────
300
+ // MARK: - Vertical layout
301
301
 
302
302
  private struct StepsVertical: View {
303
303
  @Environment(\.appTheme) private var theme
@@ -404,11 +404,9 @@ private struct StepsVertical: View {
404
404
  }
405
405
  }
406
406
 
407
- // ─── Public API ────────────────────────────────────────────────────────────────
407
+ // MARK: - Public API
408
408
 
409
- /// Steps — guided progress indicator through a sequence of procedural steps.
410
- ///
411
- /// Mirrors the Compose `Steps` component.
409
+ /// Guided progress through a sequence of steps; mirrors Compose `Steps`.
412
410
  public struct Steps: View {
413
411
  private let steps: [StepItem]
414
412
  private let activeIndex: Int
@@ -340,7 +340,7 @@ public struct SwipeCellModifier: ViewModifier {
340
340
  }
341
341
 
342
342
  } else {
343
- // leading group emtpy
343
+ // leading group empty
344
344
  self.setOffsetX(value: 0)
345
345
  }
346
346
  } else if self.offsetX < 0 {
@@ -354,7 +354,7 @@ public struct SwipeCellModifier: ViewModifier {
354
354
  }
355
355
 
356
356
  } else {
357
- // trailing group emtpy
357
+ // trailing group empty
358
358
  self.setOffsetX(value: 0)
359
359
  }
360
360
  }
@@ -1,5 +1,3 @@
1
-
2
-
3
1
  import Foundation
4
2
  import SwiftUI
5
3
 
@@ -49,11 +47,11 @@ public struct SwipeCellActionItem: Identifiable {
49
47
  // MARK: Lifecycle
50
48
 
51
49
  /// Initializer
52
- /// - Parameter id: Required to identify each buttin in the side menu. Default is a random uuid string.
50
+ /// - Parameter id: Required to identify each button in the side menu. Default is a random uuid string.
53
51
  /// - Parameter buttonView: The view in the foreground of the menu button. Make sure to set a maximum frame height less than the cell height!
54
52
  /// - Parameter swipeOutButtonView: Alternative button view that is displayed only when the offset during swipe is beyond the swipe out trigger value.
55
- /// - Parameter buttonWidth: Width of the button. The the open side menu width is calculated from the sum of all button widths. Default is 75.
56
- /// - Parameter backgroundColor: The background colour of the the menu button.
53
+ /// - Parameter buttonWidth: Width of the button. The open side menu width is calculated from the sum of all button widths. Default is 75.
54
+ /// - Parameter backgroundColor: The background colour of the menu button.
57
55
  /// - Parameter swipeOutAction: A Boolean that determines if a swipe out action is activated or not. Default is false.
58
56
  /// - Parameter swipeOutHapticFeedbackType: If a swipeOutAction is activated, a haptic feedback will occur after the swipe out threshold is passed. Default is nil.
59
57
  /// - Parameter swipeOutIsDestructive: A Boolean that determines if the swipe out is destructive. If true, the content cell view will be "move out of sight" once the swipe out is triggered.
@@ -79,7 +77,6 @@ public struct SwipeCellActionItem: Identifiable {
79
77
  public var swipeOutAction: Bool
80
78
  public var swipeOutHapticFeedbackType: UINotificationFeedbackGenerator.FeedbackType?
81
79
  public var swipeOutIsDestructive: Bool
82
- /// public var swipeOutButtonViewScaleFactor: CGFloat
83
80
  public var actionCallback: ()->()
84
81
  }
85
82