@momo-kits/native-kits 0.168.1-sizescale.1-debug → 0.169.1

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 (164) hide show
  1. package/CLAUDE.md +4 -3
  2. package/PUBLISH_GUIDE.md +29 -658
  3. package/ios/Input/Input.swift +3 -1
  4. package/ios/Input/InputTextArea.swift +3 -1
  5. package/ios/Layout/ModalLayout.swift +152 -0
  6. package/ios/Layout/ScreenLayout.swift +28 -24
  7. package/ios/Navigation/BottomSheet.swift +29 -156
  8. package/ios/Navigation/BottomTab/BottomTab.swift +46 -52
  9. package/ios/Navigation/BottomTab/BottomTabBar.swift +281 -115
  10. package/ios/Navigation/BottomTab/CurvedContainer.swift +51 -47
  11. package/ios/Navigation/BottomTab/DuoTabBar.swift +62 -195
  12. package/ios/Navigation/BottomTab/TabBarMetrics.swift +84 -0
  13. package/ios/Navigation/Component/HeaderRight.swift +1 -1
  14. package/ios/Navigation/ModalScreen.swift +18 -7
  15. package/ios/Navigation/StackScreen.swift +3 -1
  16. package/ios/Popup/PopupDisplay.swift +4 -2
  17. package/ios/Popup/PopupInput.swift +4 -2
  18. package/ios/Popup/PopupLayout.swift +10 -9
  19. package/ios/Popup/PopupNotify.swift +32 -25
  20. package/ios/Typography/Text.swift +2 -2
  21. package/ios/native-kits.podspec +1 -1
  22. package/ios-demo/MoMoUIKitsDemo.podspec +1 -1
  23. package/ios-demo/Resources/tabbar_scan_qr_button.json +1 -0
  24. package/ios-demo/Resources/tabbar_scan_qr_label.json +1 -0
  25. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BottomTabDemo.swift +272 -59
  26. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift +103 -0
  27. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupNotifyDemo.swift +29 -1
  28. package/package.json +1 -1
  29. package/publish.sh +170 -513
  30. package/build.gradle.kts +0 -11
  31. package/compose/build.gradle.kts +0 -198
  32. package/compose/build.gradle.kts.backup +0 -198
  33. package/compose/compose.podspec +0 -47
  34. package/compose/src/androidMain/kotlin/vn/momo/kits/const/HostFont.android.kt +0 -20
  35. package/compose/src/androidMain/kotlin/vn/momo/kits/navigation/ScrollToTop.android.kt +0 -6
  36. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/BackGesture.android.kt +0 -12
  37. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/OsFontScale.android.kt +0 -7
  38. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +0 -155
  39. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/ReservedRegions.android.kt +0 -6
  40. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +0 -110
  41. package/compose/src/commonMain/kotlin/vn/momo/kits/application/DesignSystemKits.kt +0 -62
  42. package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +0 -1071
  43. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Localize.kt +0 -269
  44. package/compose/src/commonMain/kotlin/vn/momo/kits/application/WidgetContainer.kt +0 -56
  45. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +0 -157
  46. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +0 -81
  47. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +0 -32
  48. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +0 -338
  49. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +0 -175
  50. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +0 -357
  51. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +0 -115
  52. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +0 -89
  53. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +0 -128
  54. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +0 -209
  55. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +0 -542
  56. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +0 -49
  57. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +0 -86
  58. package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +0 -125
  59. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +0 -231
  60. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +0 -189
  61. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +0 -478
  62. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +0 -114
  63. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +0 -265
  64. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +0 -235
  65. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +0 -223
  66. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +0 -265
  67. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +0 -185
  68. package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +0 -343
  69. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +0 -108
  70. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +0 -56
  71. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +0 -41
  72. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +0 -84
  73. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +0 -40
  74. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +0 -370
  75. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +0 -108
  76. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +0 -308
  77. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +0 -59
  78. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +0 -87
  79. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +0 -21
  80. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +0 -90
  81. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +0 -330
  82. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +0 -220
  83. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +0 -473
  84. package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +0 -122
  85. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +0 -207
  86. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +0 -92
  87. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +0 -560
  88. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +0 -86
  89. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +0 -125
  90. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +0 -207
  91. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +0 -501
  92. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +0 -176
  93. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +0 -182
  94. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +0 -193
  95. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +0 -29
  96. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +0 -236
  97. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +0 -180
  98. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +0 -325
  99. package/compose/src/commonMain/kotlin/vn/momo/kits/const/HostFont.kt +0 -17
  100. package/compose/src/commonMain/kotlin/vn/momo/kits/const/KitSizeScale.kt +0 -45
  101. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +0 -12
  102. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +0 -19
  103. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +0 -194
  104. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +0 -288
  105. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +0 -54
  106. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +0 -50
  107. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ScreenLayout.kt +0 -321
  108. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +0 -41
  109. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +0 -52
  110. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +0 -66
  111. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +0 -11
  112. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +0 -104
  113. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +0 -48
  114. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Size.kt +0 -51
  115. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +0 -499
  116. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/HostBackGestureBridge.kt +0 -58
  117. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +0 -148
  118. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +0 -116
  119. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +0 -207
  120. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +0 -422
  121. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ScrollToTop.kt +0 -8
  122. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +0 -732
  123. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackTransition.kt +0 -148
  124. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/SwipeBackHaptic.kt +0 -35
  125. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +0 -228
  126. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +0 -217
  127. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +0 -86
  128. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoBarCompression.kt +0 -97
  129. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoTabBar.kt +0 -377
  130. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +0 -169
  131. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +0 -455
  132. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +0 -105
  133. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderJourney.kt +0 -106
  134. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderLocation.kt +0 -74
  135. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +0 -399
  136. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +0 -39
  137. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +0 -363
  138. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SideBar.kt +0 -192
  139. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +0 -133
  140. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +0 -127
  141. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/BackGesture.kt +0 -12
  142. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +0 -91
  143. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/OsFontScale.kt +0 -9
  144. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +0 -74
  145. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReservedRegions.kt +0 -20
  146. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +0 -1329
  147. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +0 -55
  148. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +0 -15
  149. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +0 -118
  150. package/compose/src/iosMain/kotlin/vn/momo/kits/const/HostFont.ios.kt +0 -42
  151. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/HostBackGesture.ios.kt +0 -45
  152. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +0 -32
  153. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/BackGesture.ios.kt +0 -38
  154. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/OsFontScale.ios.kt +0 -67
  155. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +0 -218
  156. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/ReservedRegions.ios.kt +0 -138
  157. package/gradle/libs.versions.toml +0 -69
  158. package/gradle/wrapper/gradle-wrapper.jar +0 -0
  159. package/gradle/wrapper/gradle-wrapper.properties +0 -8
  160. package/gradle.properties +0 -26
  161. package/gradlew +0 -252
  162. package/gradlew.bat +0 -94
  163. package/ios-demo/README.md +0 -120
  164. package/settings.gradle.kts +0 -64
package/CLAUDE.md CHANGED
@@ -42,7 +42,7 @@ xcodebuild -project sample/iosApp/Pods/Pods.xcodeproj -scheme MoMoUIKits -sdk ip
42
42
  -destination 'generic/platform=iOS Simulator' build
43
43
  ```
44
44
 
45
- Publishing is automated (`publish.sh` + GitLab CI on `[ci build]` / `main`). Do not publish manually unless asked: `sh publish.sh beta` / `sh publish.sh release` (Maven→GitLab + NPM).
45
+ Publishing is automated (`.gitlab-ci.yml` → `publish.sh`; see `PUBLISH_GUIDE.md`): `main` → npm latest + 1 patch (tag `latest`; a manual run with `RELEASE_VERSION` sets the sprint version), other branches on `[ci build]` → `<npm latest + 1 patch>-beta.N`. The version is never stored in the repo — `scripts/ci/resolve-version.mjs` bases it on npm and only takes a number free on **both** npm (incl. `-debug`) and GitLab Maven. Do not publish manually unless asked; `bash publish.sh beta --dry-run` shows the version and packs the tarballs without uploading.
46
46
 
47
47
  ## Architecture essentials
48
48
 
@@ -77,11 +77,12 @@ Publishing is automated (`publish.sh` + GitLab CI on `[ci build]` / `main`). Do
77
77
  - iPhone Duo with a side strip ≥ 60pt: back + toolkit leave the bar for `HeaderSideBar` (`navigation/component/SideBar.kt`, 48pt glass controls); custom header-right stays in the bar. `sideBar.top` is 170pt in portrait, 120pt on the inner display in landscape (height ≥ 600), 24pt on the outer display in landscape, or below the header when the status bar is on top; UIKit's `statusBarFrame` is useless on Duo. Unlike RN the column is clamped above footer (24pt gap) / rail (12pt gap).
78
78
  - Reserved regions (iOS 27.1 `reservedRegionsOfKind:`, reached through the ObjC runtime so older SDKs still build): a probe `UIView` (`platform/ReservedRegions.ios.kt` on the Compose root view; `ReservedRegionsProbe` inside SwiftUI `momoScreenLayout()`) re-reads them in `layoutSubviews`, which UIKit re-runs when they change. They push `sideBar.top` below the status cluster as it grows for calls / Live Activities, and `sideBar.bottom` (≥ 24pt) above a camera at the bottom end of the strip.
79
79
  - Tab bar on Duo is `bottomtab/DuoTabBar.kt`: a rail in the side strip (`sideBar.bottom` above the window bottom, QR below it) or, without a side bar, a floating bar spanning 6/8 grid columns. Both overlay the content; `duoFloatingTabBarInset` pads tab content, footer and FAB.
80
+ - Duo tab selection motion (`bottomtab/DuoLiquidSelection.kt` / `ios/Navigation/BottomTab/DuoLiquidSelection.swift`, port of RN `useLiquidSelection.ts`, momo-kits !682): press lifts the lens, a drag past 10pt takes over (Compose: the bar's `pointerInput` consumes and so cancels the tab's clickable; SwiftUI: one `DragGesture` over the bar, tabs are not `Button`s), long press calls `BottomTab(onTabLongPress)` and release still selects, Reduce Motion (`platform/ReduceMotion`) falls back to a plain slide. SwiftUI integrates the lens spring on a display link because the stretch and the tabs' active tint read it every frame. Constants mirror RN — change both together.
80
81
  - Bar compression (`bottomtab/DuoBarCompression.kt`, HIG "Vertical controls"): when toolbar + rail don't fit in the strip, one is compressed — the toolkit into a `navigation_menu` button, the rail into one button showing the current tab — and tapping it swaps them; `BottomTab(compressionBehavior)` picks which starts compressed. If neither fits beside the other compressed, both rest compressed and a tap opens one for a moment. Side bar columns report their full height (0 when the screen puts nothing there) so the decision follows each screen's toolkit.
81
82
  - Glass header: on Duo with a side bar, Default/Extended headers without search and with a `ScrollState` let content scroll under the bar (`usesDuoGlassHeader`); the bar fades in a translucent surface + hairline over 16pt (Compose has no backdrop blur — RN's fallback look), the gradient leaves with the content.
82
83
  - Quick return header: glass headers and Animated headers (with a `ScrollState`) on the Duo side bar layout slide out with the content and back in on a reverse scroll; a half-shown header settles in or out once the scroll stops. The side bar is drawn apart from the header, so it stays put.
83
- - Overlays on Duo: the modal sits inside the safe area (all four insets, so clear of the side toolbar strip) and caps its content at `duoModalMaxWidth` / `duoModalMaxHeight` (440 × 640pt, at least XL off the safe area); popups fill that width with radius XL and drop their own side padding (body scrolls, actions stay). Snackbars keep clear of the strip.
84
- - Bottom sheet on Duo: radius XL, window height less `duoTopInset` (it never passes the side status bar: unlike RN, nothing restyles the clock over it), centered when the short side ≥ 600 (inner display in either orientation, buttons stay in the header row; RN parity). Below that (outer display, landscape too) it floats `Spacing.M` off the side edges, pads header/content/footer by `inset − M`, and a `Title` header moves back / close into 48pt side bar buttons on the strip part of the sheet (HIG: sheet controls go vertical on the outer display) when the strip fits one; they follow the header row while the sheet is short and stay below `sideBar.top` when it is tall. `BottomHeader.Title(onBack)` / `.title(onBack:)` closes the sheet, then runs (RN `leftOptions.onPressIconLeft`).
84
+ - Overlays on foldables (`layout/ModalLayout.kt` / `ios/Layout/ModalLayout.swift`, Figma "Modal - Foldable Guideline", constants shared with RN): foldable = `isIPhoneDuoDevice` or a window short side ≥ 600, so phones (landscape too) keep their look. The resolver returns the placement (safe area, so left of the Duo control column; right of an active vertical division when a Duo is half folded — Swift also needs `UIHingeInteraction` `.partiallyOpen`; Android half fold stays flat), popup geometry (width clamp(placement − 2·margin, 280, 450), margin 24 or 12 on the Duo outer display / half fold, max height min(600, placement − 48), radius 24; only the PopupNotify description scrolls) and sheet geometry (width min(placement − 24, 653) ≥ 296, bottom anchored, max height window − top inset − 12, min height 230, radius 24 top). Scrim is black 20% over the whole window on foldables (0.6 on phones). Snackbars keep clear of the strip. On every device (RN parity) popup close and sheet header back / close are `ModalIconButton`: 32pt circle on `background.surface` with a 1pt `border.default` stroke, 20pt `text.default` icon; the popup close sits inside the card 12pt from the top right (`PopupPromotion` keeps its close under the image), the default sheet header is 56 tall, 12 padding, 8 gap.
85
+ - Bottom sheet on Duo: stays in the placement, never on or under the side strip; back / close stay in the header row (no side column). `BottomHeader.Title(onBack)` / `.title(onBack:)` closes the sheet, then runs (RN `leftOptions.onPressIconLeft`).
85
86
  - Font scale deliberately uses the short side (`min(w, h)`), unlike RN which reads the window width — landscape must not inflate every font.
86
87
  - Font scale measures the **window**, never `UIScreen.main`: on iPhone Duo the main screen stays on one display while the window follows the one in use. Compose iOS `getScreenDimensions()` reads `LocalWindowInfo.containerSize` (recomposes on fold/unfold); SwiftUI `DesignSystemKits` KVO-observes each `UIWindowScene.effectiveGeometry` and republishes `windowShortSide`.
87
88
  - `StackScreen` pads content/footer/search/FAB by the side insets and provides an inset-consumed layout to its content; a bottom-tab root stays full width (tab bar + each tab's StackScreen handle insets). Grid columns use `contentWidth`.