@momo-kits/native-kits 0.162.44 → 0.162.45

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 (128) hide show
  1. package/CLAUDE.md +45 -3
  2. package/README.md +2 -2
  3. package/ios/Application/ApplicationEnvironment.swift +17 -0
  4. package/ios/Application/MaxApi.swift +30 -3
  5. package/ios/Avatar/Avatar.swift +4 -3
  6. package/ios/Badge/Badge.swift +6 -4
  7. package/ios/Badge/BadgeDot.swift +1 -1
  8. package/ios/Badge/BadgeRibbon.swift +0 -1
  9. package/ios/Button/Button.swift +15 -12
  10. package/ios/CalculatorKeyboard/CalculatorKeyboard.swift +64 -18
  11. package/ios/Carousel/Carousel.swift +29 -12
  12. package/ios/Checkbox/Checkbox.swift +7 -3
  13. package/ios/Chip/Chip.swift +5 -4
  14. package/ios/Collapse/Collapse.swift +70 -19
  15. package/ios/Colors+Radius+Spacing/Colors.swift +10 -1
  16. package/ios/Colors+Radius+Spacing/Radius.swift +6 -0
  17. package/ios/DateTimePicker/DateTimePicker.swift +54 -20
  18. package/ios/DateTimePicker/WheelPicker.swift +103 -105
  19. package/ios/Divider/Divider.swift +37 -4
  20. package/ios/Extensions/Color++.swift +38 -9
  21. package/ios/Extensions/OptionalEnvironmentObject.swift +12 -0
  22. package/ios/Extensions/SkeletonUICompat.swift +11 -0
  23. package/ios/Icon/Icon.swift +21 -23
  24. package/ios/Icon/Icons.swift +1329 -0
  25. package/ios/IconButton/IconButton.swift +15 -7
  26. package/ios/Image/Image.swift +7 -23
  27. package/ios/Information/Information.swift +27 -9
  28. package/ios/Input/ErrorView.swift +2 -2
  29. package/ios/Input/Input.swift +160 -147
  30. package/ios/Input/InputPhoneNumber.swift +12 -9
  31. package/ios/Input/InputSearch.swift +107 -77
  32. package/ios/Input/InputTextArea.swift +128 -145
  33. package/ios/InputDropDown/InputDropDown.swift +10 -7
  34. package/ios/InputMoney/InputMoney.swift +33 -11
  35. package/ios/InputOTP/InputOTP.swift +22 -12
  36. package/ios/Layout/Card.swift +50 -0
  37. package/ios/Layout/GridContext.swift +187 -3
  38. package/ios/Layout/Item.swift +5 -4
  39. package/ios/Layout/ScreenLayout.swift +385 -0
  40. package/ios/Layout/Section.swift +4 -100
  41. package/ios/Loader/Loader.swift +5 -9
  42. package/ios/Lottie/LottieView.swift +14 -2
  43. package/ios/{Application/Navigation/Overplay → Navigation}/BottomSheet.swift +169 -29
  44. package/ios/Navigation/BottomTab/BottomTab.swift +332 -0
  45. package/ios/{Application/Navigation → Navigation}/BottomTab/BottomTabBar.swift +18 -7
  46. package/ios/Navigation/BottomTab/DuoBarCompression.swift +104 -0
  47. package/ios/Navigation/BottomTab/DuoTabBar.swift +329 -0
  48. package/ios/{Application → Navigation/Component}/FloatingButton.swift +43 -54
  49. package/ios/Navigation/Component/Header.swift +545 -0
  50. package/ios/Navigation/Component/HeaderBackground.swift +154 -0
  51. package/ios/Navigation/Component/HeaderJourney.swift +73 -0
  52. package/ios/Navigation/Component/HeaderLocation.swift +48 -0
  53. package/ios/Navigation/Component/HeaderRight.swift +425 -0
  54. package/ios/Navigation/Component/HeaderTitle.swift +36 -0
  55. package/ios/{Application/Navigation → Navigation/Component}/HeaderUser.swift +21 -24
  56. package/ios/Navigation/Component/SideBar.swift +183 -0
  57. package/ios/{Application/Navigation/Overplay → Navigation/Component}/SnackBar.swift +8 -8
  58. package/ios/Navigation/HostBackGestureBridge.swift +78 -0
  59. package/ios/{Application/Navigation/Overplay → Navigation}/ModalScreen.swift +9 -2
  60. package/ios/Navigation/Navigation.swift +204 -0
  61. package/ios/Navigation/NavigationContainer.swift +195 -0
  62. package/ios/{Application/Navigation → Navigation}/Navigator.swift +207 -107
  63. package/ios/Navigation/StackScreen.swift +930 -0
  64. package/ios/Navigation/StackTransition.swift +400 -0
  65. package/ios/Navigation/SwipeBackHaptic.swift +33 -0
  66. package/ios/{Application/Navigation → Navigation}/Tracking/ScreenTracker.swift +12 -5
  67. package/ios/OTPKeyboard/OTPKeyboard.swift +8 -11
  68. package/ios/Pagination/PaginationScroll.swift +2 -2
  69. package/ios/Popup/PopupDisplay.swift +72 -135
  70. package/ios/Popup/PopupInput.swift +10 -13
  71. package/ios/Popup/PopupLayout.swift +140 -0
  72. package/ios/Popup/PopupNotify.swift +59 -69
  73. package/ios/Popup/PopupPromotion.swift +31 -47
  74. package/ios/PopupView/FullscreenPopup.swift +13 -19
  75. package/ios/PopupView/PopupView.swift +1 -1
  76. package/ios/PopupView/Utils++.swift +0 -8
  77. package/ios/ProgressInfo/ProgressInfo.swift +4 -2
  78. package/ios/Radio/Radio.swift +2 -1
  79. package/ios/Rating/Rating.swift +9 -1
  80. package/ios/Resources/dot_loading.json +558 -0
  81. package/ios/Resources/lottie_circle_loader.json +1 -0
  82. package/ios/ScrollIndicator/ScrollIndicator.swift +11 -10
  83. package/ios/Skeleton/Skeleton.swift +22 -27
  84. package/ios/Slider/Slider.swift +16 -18
  85. package/ios/Stepper/Stepper.swift +6 -1
  86. package/ios/Steps/Steps.swift +8 -6
  87. package/ios/SuggestAction/SuggestAction.swift +5 -0
  88. package/ios/Swipeable/SwipeCell.swift +10 -6
  89. package/ios/Switch/Switch.swift +22 -20
  90. package/ios/TabView/TabView.swift +102 -21
  91. package/ios/Tag/Tag.swift +15 -4
  92. package/ios/Template/Logo/Logo.swift +2 -1
  93. package/ios/Template/TrustBanner/TrustBanner.swift +106 -54
  94. package/ios/Title/Title.swift +6 -17
  95. package/ios/Tooltip/Tooltip.swift +29 -14
  96. package/ios/Typography/FontScale.swift +3 -3
  97. package/ios/Typography/Text.swift +81 -19
  98. package/ios/Uploader/Uploader.swift +3 -1
  99. package/ios/native-kits.podspec +2 -1
  100. package/ios-demo/MoMoUIKitsDemo.podspec +1 -1
  101. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ContentView.swift +1 -1
  102. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DuoTabDemo.swift +80 -0
  103. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/Home.swift +2 -0
  104. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/IPhoneDuoDemo.swift +173 -0
  105. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift +77 -1
  106. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupDisplayDemo.swift +1 -0
  107. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupNotifyDemo.swift +2 -2
  108. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupPromotionDemo.swift +2 -0
  109. package/package.json +1 -1
  110. package/scripts/gen-ios-icons.mjs +36 -0
  111. package/ios/Application/Components.swift +0 -270
  112. package/ios/Application/ComposeApi.swift +0 -22
  113. package/ios/Application/HeaderRight.swift +0 -306
  114. package/ios/Application/Navigation/BottomTab/BottomTab.swift +0 -104
  115. package/ios/Application/Navigation/HeaderBackProps.swift +0 -66
  116. package/ios/Application/Navigation/HeaderTitle.swift +0 -57
  117. package/ios/Application/Navigation/NavigationContainer.swift +0 -213
  118. package/ios/Application/Navigation/NavigationOptions.swift +0 -109
  119. package/ios/Application/Navigation/NavigatorManager.swift +0 -22
  120. package/ios/Application/Navigation/component/Header.swift +0 -178
  121. package/ios/Application/Navigation/component/HeaderBackground.swift +0 -83
  122. package/ios/Application/Navigation/component/HeaderColor.swift +0 -65
  123. package/ios/Application/Navigation/component/HeaderRightWidthKey.swift +0 -11
  124. package/ios/Application/Navigation/component/NavigationFooter.swift +0 -90
  125. package/ios/Application/Navigation/component/NavigationHeaderRight.swift +0 -196
  126. package/ios/Application/Screen.swift +0 -250
  127. package/ios/Application/StackScreen.swift +0 -492
  128. /package/ios/{Application/Navigation → Navigation}/BottomTab/CurvedContainer.swift +0 -0
@@ -0,0 +1,11 @@
1
+ // File: ios/Extensions/SkeletonUICompat.swift
2
+ // Created At: 2026-10-07 12:03:28 +07:00
3
+ // Created By: AI
4
+ // AI Agent: Claude Code
5
+ // Model: claude-opus-5-5
6
+
7
+ // AI-GENERATED START: keep SkeletonUI extensions visible to MoMoUIKits clients
8
+ // Unused here on purpose: Swift 5 exposes extension members of every module a dependency imports, so clients
9
+ // that only `import MoMoUIKits` rely on SkeletonUI's (e.g. `Text(String?)` in NativeWidget). Removing it breaks them.
10
+ import SkeletonUI
11
+ // AI-GENERATED END: keep SkeletonUI extensions visible to MoMoUIKits clients
@@ -1,30 +1,20 @@
1
+ import SDWebImageSwiftUI
1
2
  import SwiftUI
2
3
 
3
4
  struct IconSource: Codable {
4
5
  let uri: String
5
6
  }
6
7
 
7
- func loadIconSources() -> [String: IconSource] {
8
- guard let url = Bundle.main.url(forResource: "icon", withExtension: "json") else {
9
- print("Error: icon.json not found")
10
- return [:]
8
+ // The compiled-in map (Icons.swift) wins; a host `icon.json` in the main bundle only adds keys
9
+ // the kit doesn't know, so hosts that shipped one keep their extra icons.
10
+ let iconSources: [String: String] = {
11
+ guard let url = Bundle.main.url(forResource: "icon", withExtension: "json"),
12
+ let data = try? Data(contentsOf: url),
13
+ let hostIcons = try? JSONDecoder().decode([String: IconSource].self, from: data) else {
14
+ return kitIcons
11
15
  }
12
-
13
- do {
14
- let data = try Data(contentsOf: url)
15
- let decoded = try JSONDecoder().decode([String: IconSource].self, from: data)
16
- return decoded
17
- } catch {
18
- print("Error decoding icon.json: \(error)")
19
- return [:]
20
- }
21
- }
22
-
23
- // Load the JSON data into a global variable
24
- let iconSources: [String: IconSource] = loadIconSources()
25
-
26
- // Icons that must never be tinted (mirror Compose `noThemeIcons`)
27
- let noThemeIcons: [String] = ["ic_round_momo_tiny"]
16
+ return kitIcons.merging(hostIcons.mapValues(\.uri)) { kit, _ in kit }
17
+ }()
28
18
 
29
19
  // Compose defaults `color` to the theme text color while `color = null` means "no tint".
30
20
  // Swift can't tell an omitted argument from an explicit `nil`, so the default is this
@@ -53,16 +43,24 @@ public struct Icon: View {
53
43
  }
54
44
 
55
45
  public var body: some View {
56
- // Mirror Compose: an https source is used as-is, anything else is a key into icon.json
57
- if let uri = source.contains("https") ? source : iconSources[source]?.uri {
46
+ // Mirror Compose: an https source is used as-is, anything else is a key into the icon map
47
+ if let uri = source.contains("https") ? source : iconSources[source] {
58
48
  let requestedColor = color == iconThemeColor ? theme.colors.text.default : color
59
49
  // Mirror Compose: certain icons (e.g. branded glyphs) are never tinted
60
50
  let resolvedColor = noThemeIcons.contains(source) ? nil : requestedColor
61
- ImageView(uri, color: resolvedColor)
51
+ // Bare WebImage like Compose's AsyncImage: no skeleton while loading, nothing on failure.
52
+ WebImage(url: URL(string: uri), isAnimating: .constant(true))
53
+ .resizable()
54
+ .renderingMode(resolvedColor != nil ? .template : .original)
55
+ .scaledToFit()
56
+ .foregroundColor(resolvedColor)
62
57
  .frame(width: size, height: size)
63
58
  // Mirrors Compose's auto-generated `contentDescription = "img|$iconUrl"`
64
59
  // when no explicit label is provided.
65
60
  .accessibilityLabel(accessibilityLabel ?? "img|\(uri)")
61
+ } else {
62
+ // Compose keeps the sized box for an unknown key, so layouts don't collapse.
63
+ Color.clear.frame(width: size, height: size)
66
64
  }
67
65
  }
68
66
  }