@momo-kits/native-kits 0.0.1-beta.4 → 0.0.2-alpha.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 (296) hide show
  1. package/CLAUDE.md +99 -0
  2. package/PUBLISH_GUIDE.md +675 -0
  3. package/README.md +184 -5
  4. package/ios/Application/ApplicationEnvironment.swift +71 -0
  5. package/ios/Application/Components.swift +270 -0
  6. package/ios/Application/ComposeApi.swift +22 -0
  7. package/ios/Application/FloatingButton.swift +174 -0
  8. package/ios/Application/HeaderRight.swift +306 -0
  9. package/ios/Application/LanguageSource.swift +93 -0
  10. package/ios/Application/Localize.swift +378 -0
  11. package/ios/Application/LocalizeModifier.swift +30 -0
  12. package/ios/Application/MaxApi.swift +18 -0
  13. package/ios/Application/Navigation/BottomTab/BottomTab.swift +104 -0
  14. package/ios/Application/Navigation/BottomTab/BottomTabBar.swift +215 -0
  15. package/ios/Application/Navigation/BottomTab/CurvedContainer.swift +65 -0
  16. package/ios/Application/Navigation/HeaderBackProps.swift +66 -0
  17. package/ios/Application/Navigation/HeaderTitle.swift +57 -0
  18. package/ios/Application/Navigation/HeaderUser.swift +209 -0
  19. package/ios/Application/Navigation/NavigationContainer.swift +213 -0
  20. package/ios/Application/Navigation/NavigationOptions.swift +109 -0
  21. package/ios/Application/Navigation/Navigator.swift +453 -0
  22. package/ios/Application/Navigation/NavigatorManager.swift +22 -0
  23. package/ios/Application/Navigation/Overplay/BottomSheet.swift +256 -0
  24. package/ios/Application/Navigation/Overplay/ModalScreen.swift +74 -0
  25. package/ios/Application/Navigation/Overplay/SnackBar.swift +144 -0
  26. package/ios/Application/Navigation/Tracking/ScreenTracker.swift +117 -0
  27. package/ios/Application/Navigation/component/Header.swift +178 -0
  28. package/ios/Application/Navigation/component/HeaderBackground.swift +83 -0
  29. package/ios/Application/Navigation/component/HeaderColor.swift +65 -0
  30. package/ios/Application/Navigation/component/HeaderRightWidthKey.swift +11 -0
  31. package/ios/Application/Navigation/component/NavigationFooter.swift +90 -0
  32. package/ios/Application/Navigation/component/NavigationHeaderRight.swift +196 -0
  33. package/ios/Application/Screen.swift +250 -0
  34. package/ios/Application/StackScreen.swift +492 -0
  35. package/ios/Avatar/Avatar.swift +193 -0
  36. package/ios/Badge/Badge.swift +84 -0
  37. package/ios/Badge/BadgeDot.swift +31 -0
  38. package/ios/Badge/BadgeRibbon.swift +319 -0
  39. package/ios/BaselineView/BaselineView.swift +163 -0
  40. package/ios/Button/Button.swift +232 -84
  41. package/ios/CalculatorKeyboard/CalculatorKeyboard.swift +126 -0
  42. package/ios/Carousel/Carousel.swift +196 -0
  43. package/ios/Checkbox/Checkbox.swift +77 -0
  44. package/ios/Chip/Chip.swift +120 -0
  45. package/ios/Collapse/Collapse.swift +192 -0
  46. package/ios/{Colors+Spacing → Colors+Radius+Spacing}/Colors.swift +42 -37
  47. package/ios/Colors+Radius+Spacing/Radius.swift +22 -0
  48. package/ios/{Colors+Spacing → Colors+Radius+Spacing}/Spacing.swift +3 -1
  49. package/ios/Colors+Radius+Spacing/Theme.swift +295 -0
  50. package/ios/DateTimePicker/DateTimePicker.swift +212 -0
  51. package/ios/DateTimePicker/DateTimePickerTypes.swift +55 -0
  52. package/ios/DateTimePicker/DateTimePickerUtils.swift +167 -0
  53. package/ios/DateTimePicker/WheelPicker.swift +165 -0
  54. package/ios/Divider/Divider.swift +16 -0
  55. package/ios/Extensions/ActiveOpacityButtonStyle.swift +14 -0
  56. package/ios/Extensions/Color++.swift +32 -0
  57. package/ios/Icon/Icon.swift +69 -0
  58. package/ios/IconButton/IconButton.swift +140 -0
  59. package/ios/Image/Image.swift +87 -0
  60. package/ios/Information/Information.swift +156 -0
  61. package/ios/Input/ErrorView.swift +58 -0
  62. package/ios/Input/Input.swift +461 -77
  63. package/ios/Input/InputPhoneNumber.swift +192 -0
  64. package/ios/Input/InputSearch.swift +301 -0
  65. package/ios/Input/InputTextArea.swift +318 -0
  66. package/ios/InputDropDown/InputDropDown.swift +201 -0
  67. package/ios/InputMoney/InputMoney.swift +405 -0
  68. package/ios/InputOTP/InputOTP.swift +211 -0
  69. package/ios/Layout/GridContext.swift +30 -0
  70. package/ios/Layout/Item.swift +42 -0
  71. package/ios/Layout/Section.swift +134 -0
  72. package/ios/Loader/Loader.swift +113 -0
  73. package/ios/Lottie/LottieView.swift +86 -0
  74. package/ios/MoMoUIKits.podspec +5 -0
  75. package/ios/OTPKeyboard/KeyboardButton.swift +13 -5
  76. package/ios/OTPKeyboard/OTPKeyboard.swift +1 -1
  77. package/ios/Pagination/PaginationDot.swift +61 -0
  78. package/ios/Pagination/PaginationNumber.swift +35 -0
  79. package/ios/Pagination/PaginationScroll.swift +101 -0
  80. package/ios/Pagination/PaginationWhiteDot.swift +37 -0
  81. package/ios/Popup/PopupDisplay.swift +279 -0
  82. package/ios/Popup/PopupInput.swift +92 -0
  83. package/ios/Popup/PopupNotify.swift +219 -0
  84. package/ios/Popup/PopupPromotion.swift +74 -0
  85. package/ios/PopupView/FullscreenPopup.swift +251 -0
  86. package/ios/{Popup → PopupView}/Modifiers.swift +6 -20
  87. package/ios/{Popup → PopupView}/PopupView.swift +38 -146
  88. package/ios/PopupView/Utils++.swift +281 -0
  89. package/ios/ProgressInfo/ProgressInfo.swift +297 -0
  90. package/ios/Radio/Radio.swift +69 -0
  91. package/ios/Rating/Rating.swift +83 -0
  92. package/{example/ios/Example/Preview Content/Preview Assets.xcassets/Contents.json → ios/Resources/MoMoUIKitsColors.xcassets/AccentColor.colorset/Contents.json} +5 -0
  93. package/{example/ios/Example/Assets.xcassets → ios/Resources/MoMoUIKitsColors.xcassets}/Text.colorset/Contents.json +3 -3
  94. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/Contents.json +9 -0
  95. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-default.colorset/Contents.json +38 -0
  96. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-disable.colorset/Contents.json +38 -0
  97. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-pressed.colorset/Contents.json +38 -0
  98. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-selected.colorset/Contents.json +38 -0
  99. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-surface.colorset/Contents.json +38 -0
  100. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-tonal.colorset/Contents.json +38 -0
  101. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/border-default.colorset/Contents.json +38 -0
  102. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/border-disable.colorset/Contents.json +38 -0
  103. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/gradient.colorset/Contents.json +38 -0
  104. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/primary.colorset/Contents.json +38 -0
  105. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/secondary.colorset/Contents.json +38 -0
  106. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-container.colorset/Contents.json +38 -0
  107. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-primary.colorset/Contents.json +38 -0
  108. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-secondary.colorset/Contents.json +38 -0
  109. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-default.colorset/Contents.json +38 -0
  110. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-disable.colorset/Contents.json +38 -0
  111. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-hint.colorset/Contents.json +38 -0
  112. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-secondary.colorset/Contents.json +38 -0
  113. package/ios/ScrollIndicator/ScrollIndicator.swift +110 -0
  114. package/ios/Skeleton/Skeleton.swift +99 -0
  115. package/ios/Slider/Slider.swift +237 -0
  116. package/ios/StatusBarTap/StatusBarTap.h +13 -0
  117. package/ios/StatusBarTap/StatusBarTap.m +75 -0
  118. package/ios/Stepper/Stepper.swift +221 -0
  119. package/ios/Steps/Steps.swift +467 -0
  120. package/ios/SuggestAction/SuggestAction.swift +100 -0
  121. package/ios/Swipeable/SwipeCell.swift +226 -31
  122. package/ios/Swipeable/SwipeCellModel.swift +21 -0
  123. package/ios/Switch/Switch.swift +69 -0
  124. package/ios/TabView/TabView.swift +534 -0
  125. package/ios/Tag/Tag.swift +99 -0
  126. package/ios/Template/Logo/Logo.swift +75 -0
  127. package/ios/Template/TrustBanner/TrustBanner.swift +123 -0
  128. package/ios/Title/Title.swift +270 -0
  129. package/ios/Tooltip/Tooltip.swift +486 -0
  130. package/ios/Typography/FontScale.swift +103 -0
  131. package/ios/Typography/FontScaleStore.swift +58 -0
  132. package/ios/Typography/KitDesignSystem.swift +17 -0
  133. package/ios/Typography/Text.swift +262 -0
  134. package/ios/Typography/Typography.swift +80 -23
  135. package/ios/Uploader/Uploader.swift +174 -0
  136. package/ios/native-kits.podspec +73 -13
  137. package/ios-demo/MoMoUIKitsDemo.podspec +20 -0
  138. package/ios-demo/Resources/dot_loading.json +558 -0
  139. package/ios-demo/Resources/icon.json +4052 -0
  140. package/ios-demo/Resources/lottie_circle_loader.json +1 -0
  141. package/ios-demo/Sources/MoMoUIKitsDemo/DemoScaffold.swift +48 -0
  142. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsBadgeDemoView.swift +25 -0
  143. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsButtonDemoView.swift +26 -0
  144. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsCheckboxDemoView.swift +19 -0
  145. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsChipDemoView.swift +33 -0
  146. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsInputDemoView.swift +48 -0
  147. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsPopupDemoView.swift +21 -0
  148. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsRadioDemoView.swift +17 -0
  149. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsTypographyDemoView.swift +28 -0
  150. package/ios-demo/Sources/MoMoUIKitsDemo/MoMoUIKitsDemoContext.swift +31 -0
  151. package/ios-demo/Sources/MoMoUIKitsDemo/MoMoUIKitsDemoFactory.swift +24 -0
  152. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AnimatedHeaderDemo.swift +110 -0
  153. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AvatarDemo.swift +107 -0
  154. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BadgeDemo.swift +75 -0
  155. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BaselineView.swift +117 -0
  156. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BottomTabDemo.swift +89 -0
  157. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ButtonDemo.swift +108 -0
  158. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CarouselDemo.swift +96 -0
  159. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CheckboxDemo.swift +60 -0
  160. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ChipDemo.swift +76 -0
  161. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CollapseDemo.swift +102 -0
  162. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ContentView.swift +107 -0
  163. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DateTimePickerDemo.swift +100 -0
  164. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DemoScreen.swift +420 -0
  165. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DividerDemo.swift +56 -0
  166. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/HeaderUserDemo.swift +49 -0
  167. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/Home.swift +276 -0
  168. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/IconButtonDemo.swift +93 -0
  169. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/IconDemo.swift +81 -0
  170. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ImageDemo.swift +65 -0
  171. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InformationDemo.swift +96 -0
  172. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputDemo.swift +117 -0
  173. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputDropDownDemo.swift +94 -0
  174. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputMoneyDemo.swift +94 -0
  175. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputOTPDemo.swift +88 -0
  176. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputPhoneNumberDemo.swift +120 -0
  177. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputSearchDemo.swift +85 -0
  178. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputTextAreaDemo.swift +87 -0
  179. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/LoaderDemo.swift +73 -0
  180. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/LocalizeDemo.swift +235 -0
  181. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift +241 -0
  182. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PaginationDemo.swift +68 -0
  183. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PlaygroundData.swift +76 -0
  184. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupDisplayDemo.swift +175 -0
  185. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupNotifyDemo.swift +95 -0
  186. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupPromotionDemo.swift +67 -0
  187. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ProgressInfoDemo.swift +101 -0
  188. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/RadioDemo.swift +64 -0
  189. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/RatingDemo.swift +68 -0
  190. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SectionDemo.swift +83 -0
  191. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SkeletonDemo.swift +61 -0
  192. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SliderDemo.swift +90 -0
  193. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SnackBarDemo.swift +82 -0
  194. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/StepperDemo.swift +93 -0
  195. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/StepsDemo.swift +114 -0
  196. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SuggestActionDemo.swift +90 -0
  197. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SwipeDemo.swift +107 -0
  198. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SwitchDemo.swift +58 -0
  199. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TabViewDemo.swift +114 -0
  200. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TagDemo.swift +86 -0
  201. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ThemeDemo.swift +181 -0
  202. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TitleDemo.swift +104 -0
  203. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TooltipDemo.swift +118 -0
  204. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TypographyDemo.swift +87 -0
  205. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/UploaderDemo.swift +85 -0
  206. package/ios-demo/Sources/MoMoUIKitsDemo/SwiftUIDemoBrowserView.swift +53 -0
  207. package/ios-demo/Sources/MoMoUIKitsDemo/UIKitsDemoModels.swift +15 -0
  208. package/ios-demo/Sources/MoMoUIKitsDemo/UIKitsDemoRegistry.swift +73 -0
  209. package/package.json +6 -6
  210. package/publish.sh +554 -20
  211. package/scripts/gen-ios-color.mjs +136 -0
  212. package/CODE_OF_CONDUCT.md +0 -133
  213. package/CONTRIBUTING.md +0 -114
  214. package/LICENSE +0 -20
  215. package/android/build.gradle +0 -82
  216. package/android/gradle.properties +0 -5
  217. package/android/src/main/AndroidManifest.xml +0 -4
  218. package/android/src/main/java/com/momoplatform/nativekits/NativeKitsPackage.kt +0 -17
  219. package/android/src/main/java/com/momoplatform/nativekits/NativeKitsViewManager.kt +0 -20
  220. package/example/ios/Example/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -63
  221. package/example/ios/Example/ComponentDetail.swift +0 -35
  222. package/example/ios/Example/ComponentItem.swift +0 -24
  223. package/example/ios/Example/ComponentModel.swift +0 -33
  224. package/example/ios/Example/ContentView.swift +0 -53
  225. package/example/ios/Example/Example.entitlements +0 -10
  226. package/example/ios/Example/Foundation/ButtonDemo.swift +0 -80
  227. package/example/ios/Example/Foundation/Popup/ActionSheets.swift +0 -136
  228. package/example/ios/Example/Foundation/Popup/Floats.swift +0 -127
  229. package/example/ios/Example/Foundation/Popup/Popups.swift +0 -101
  230. package/example/ios/Example/Foundation/PopupDemo.swift +0 -366
  231. package/example/ios/Example/Foundation/TextInputDemo.swift +0 -31
  232. package/example/ios/Example/Foundation/TypographyDemo.swift +0 -53
  233. package/example/ios/Example/Foundation.swift +0 -26
  234. package/example/ios/Example/Info.plist +0 -18
  235. package/example/ios/Example/Library/SwipeableDemo.swift +0 -105
  236. package/example/ios/Example/Library.swift +0 -26
  237. package/example/ios/Example/Main.swift +0 -11
  238. package/example/ios/Example/Overview.swift +0 -20
  239. package/example/ios/Example/Resource/SFProText-Black.ttf +0 -0
  240. package/example/ios/Example/Resource/SFProText-Bold.ttf +0 -0
  241. package/example/ios/Example/Resource/SFProText-Heavy.ttf +0 -0
  242. package/example/ios/Example/Resource/SFProText-Light.ttf +0 -0
  243. package/example/ios/Example/Resource/SFProText-Medium.ttf +0 -0
  244. package/example/ios/Example/Resource/SFProText-Regular.ttf +0 -0
  245. package/example/ios/Example/Resource/SFProText-Semibold.ttf +0 -0
  246. package/example/ios/Example/Resource/SFProText-Thin.ttf +0 -0
  247. package/example/ios/Example/Resource/SFProText-Ultralight.ttf +0 -0
  248. package/example/ios/Example/Resource/foundation.json +0 -33
  249. package/example/ios/Example/Resource/library.json +0 -8
  250. package/example/ios/Example/Utils.swift +0 -30
  251. package/example/ios/Example/ViewModifier/DarkViewModifier.swift +0 -22
  252. package/example/ios/Example.xcodeproj/project.pbxproj +0 -570
  253. package/example/ios/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  254. package/example/ios/Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  255. package/example/ios/Example.xcodeproj/project.xcworkspace/xcuserdata/wem.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  256. package/example/ios/Example.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
  257. package/example/ios/Example.xcworkspace/contents.xcworkspacedata +0 -10
  258. package/example/ios/Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  259. package/example/ios/Example.xcworkspace/xcuserdata/wem.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  260. package/example/ios/Example.xcworkspace/xcuserdata/wem.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +0 -6
  261. package/example/ios/Podfile +0 -6
  262. package/example/ios/Podfile.lock +0 -16
  263. package/example/ios/Pods/Local Podspecs/MoMoUIKits.podspec.json +0 -29
  264. package/example/ios/Pods/Manifest.lock +0 -16
  265. package/example/ios/Pods/Pods.xcodeproj/project.pbxproj +0 -661
  266. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/MoMoUIKits.xcscheme +0 -58
  267. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/Pods-Example.xcscheme +0 -58
  268. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/xcschememanagement.plist +0 -25
  269. package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits-dummy.m +0 -5
  270. package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits-prefix.pch +0 -12
  271. package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits-umbrella.h +0 -16
  272. package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits.debug.xcconfig +0 -12
  273. package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits.modulemap +0 -6
  274. package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits.release.xcconfig +0 -12
  275. package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.markdown +0 -3
  276. package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.plist +0 -29
  277. package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example-dummy.m +0 -5
  278. package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example-umbrella.h +0 -16
  279. package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig +0 -14
  280. package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example.modulemap +0 -6
  281. package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig +0 -14
  282. package/ios/Colors+Spacing/Radius.swift +0 -11
  283. package/ios/Popup/Utils++.swift +0 -163
  284. package/ios/Theme.md +0 -18
  285. /package/{example/ios/Example/Assets.xcassets → ios/Resources/MoMoUIKitsColors.xcassets}/Background.colorset/Contents.json +0 -0
  286. /package/{example/ios/Example/Assets.xcassets → ios/Resources/MoMoUIKitsColors.xcassets}/Border.colorset/Contents.json +0 -0
  287. /package/{example/ios/Example/Assets.xcassets → ios/Resources/MoMoUIKitsColors.xcassets}/Card.colorset/Contents.json +0 -0
  288. /package/{example/ios/Example/Assets.xcassets → ios/Resources/MoMoUIKitsColors.xcassets}/Contents.json +0 -0
  289. /package/{example/ios/Example/Assets.xcassets → ios/Resources/MoMoUIKitsColors.xcassets}/Error.colorset/Contents.json +0 -0
  290. /package/{example/ios/Example/Assets.xcassets → ios/Resources/MoMoUIKitsColors.xcassets}/Primary.colorset/Contents.json +0 -0
  291. /package/{example/ios/Example/Assets.xcassets → ios/Resources/MoMoUIKitsColors.xcassets}/PrimaryDark.colorset/Contents.json +0 -0
  292. /package/{example/ios/Example/Assets.xcassets → ios/Resources/MoMoUIKitsColors.xcassets}/PrimaryLight.colorset/Contents.json +0 -0
  293. /package/{example/ios/Example/Assets.xcassets → ios/Resources/MoMoUIKitsColors.xcassets}/Secondary.colorset/Contents.json +0 -0
  294. /package/{example/ios/Example/Assets.xcassets → ios/Resources/MoMoUIKitsColors.xcassets}/Success.colorset/Contents.json +0 -0
  295. /package/{example/ios/Example/Assets.xcassets → ios/Resources/MoMoUIKitsColors.xcassets}/TextSecondary.colorset/Contents.json +0 -0
  296. /package/{example/ios/Example/Assets.xcassets → ios/Resources/MoMoUIKitsColors.xcassets}/Warning.colorset/Contents.json +0 -0
@@ -0,0 +1,221 @@
1
+ import SwiftUI
2
+
3
+ // ---------------------------------------------------------------------------
4
+ // Size variant
5
+ // ---------------------------------------------------------------------------
6
+
7
+ public enum StepperSize {
8
+ case large
9
+ case small
10
+ }
11
+
12
+ private struct StepperSizeSpec {
13
+ let buttonSize: CGFloat
14
+ let iconSize: CGFloat
15
+ let numberMinWidth: CGFloat
16
+ let numberHeight: CGFloat
17
+ }
18
+
19
+ private func stepperSizeSpec(_ size: StepperSize) -> StepperSizeSpec {
20
+ switch size {
21
+ case .large:
22
+ return StepperSizeSpec(buttonSize: 36, iconSize: 22, numberMinWidth: 32, numberHeight: 28)
23
+ case .small:
24
+ return StepperSizeSpec(buttonSize: 28, iconSize: 18, numberMinWidth: 28, numberHeight: 24)
25
+ }
26
+ }
27
+
28
+ // ---------------------------------------------------------------------------
29
+ // Disabled spec — mirrors Compose `disabled: Any` (Bool or per-part array)
30
+ // ---------------------------------------------------------------------------
31
+
32
+ public struct StepperDisabled {
33
+ let minus: Bool
34
+ let plus: Bool
35
+
36
+ fileprivate var number: Bool { minus && plus }
37
+
38
+ public init(minus: Bool, plus: Bool) {
39
+ self.minus = minus
40
+ self.plus = plus
41
+ }
42
+
43
+ /// All parts share the same disabled state.
44
+ public init(_ all: Bool) {
45
+ self.minus = all
46
+ self.plus = all
47
+ }
48
+ }
49
+
50
+ extension StepperDisabled: ExpressibleByBooleanLiteral {
51
+ public init(booleanLiteral value: Bool) {
52
+ self.init(value)
53
+ }
54
+ }
55
+
56
+ // ---------------------------------------------------------------------------
57
+ // Private sub-views
58
+ // ---------------------------------------------------------------------------
59
+
60
+ private struct StepperButton: View {
61
+ @Environment(\.appTheme) private var theme
62
+
63
+ var sign: String
64
+ var size: StepperSize
65
+ var disabled: Bool
66
+ var onPress: () -> Void
67
+
68
+ var body: some View {
69
+ let specs = stepperSizeSpec(size)
70
+ let iconColor: Color = disabled ? theme.colors.text.disable : theme.colors.primary
71
+ let iconName = sign == "-" ? "24_navigation_minus_circle" : "24_navigation_plus_circle"
72
+
73
+ SwiftUI.Button(action: onPress) {
74
+ ZStack {
75
+ Circle().fill(theme.colors.background.disable)
76
+ Icon(source: iconName, size: specs.iconSize, color: iconColor)
77
+ }
78
+ .frame(width: specs.buttonSize, height: specs.buttonSize)
79
+ }
80
+ .buttonStyle(ActiveOpacityButtonStyle())
81
+ .disabled(disabled)
82
+ }
83
+ }
84
+
85
+ private struct StepperNumberView: View {
86
+ @Environment(\.appTheme) private var theme
87
+ @Environment(\.momoFontScale) private var fontScale
88
+
89
+ @Binding var text: String
90
+ var size: StepperSize
91
+ var disabled: Bool
92
+ var editable: Bool
93
+
94
+ var body: some View {
95
+ let specs = stepperSizeSpec(size)
96
+ let textColor: Color = disabled ? theme.colors.text.disable : theme.colors.text.default
97
+ let borderColor: Color = disabled ? theme.colors.border.disable : theme.colors.border.default
98
+
99
+ Group {
100
+ if editable {
101
+ TextField("", text: $text)
102
+ .keyboardType(.numberPad)
103
+ .multilineTextAlignment(.center)
104
+ .disabled(disabled)
105
+ } else {
106
+ MomoText(text, typography: .descriptionDefaultRegular, color: textColor)
107
+ }
108
+ }
109
+ .font(.system(size: fontScale(12)))
110
+ .ignoreBoldTextSetting()
111
+ .foregroundColor(textColor)
112
+ .frame(minWidth: specs.numberMinWidth)
113
+ .frame(height: specs.numberHeight)
114
+ .padding(.horizontal, Spacing.XS)
115
+ .overlay(
116
+ RoundedRectangle(cornerRadius: Radius.S)
117
+ .stroke(borderColor, lineWidth: 1)
118
+ )
119
+ }
120
+ }
121
+
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.
139
+ public struct MomoStepper: View {
140
+ @Binding private var value: Int
141
+ private let min: Int
142
+ private let max: Int
143
+ private let step: Int
144
+ private let size: StepperSize
145
+ private let disabled: StepperDisabled
146
+ private let editable: Bool
147
+ private let onValueChange: (Int) -> Void
148
+
149
+ @State private var editingText: String = ""
150
+
151
+ public init(
152
+ value: Binding<Int>,
153
+ min: Int = 0,
154
+ max: Int = 100,
155
+ step: Int = 1,
156
+ size: StepperSize = .large,
157
+ disabled: StepperDisabled = false,
158
+ editable: Bool = false,
159
+ onValueChange: @escaping (Int) -> Void = { _ in }
160
+ ) {
161
+ self._value = value
162
+ self.min = min
163
+ self.max = max
164
+ self.step = step
165
+ self.size = size
166
+ self.disabled = disabled
167
+ self.editable = editable
168
+ self.onValueChange = onValueChange
169
+ }
170
+
171
+ private func clamp(_ raw: Int) -> Int {
172
+ Swift.max(min, Swift.min(max, raw))
173
+ }
174
+
175
+ private func applyValue(_ raw: Int) {
176
+ let parsed = clamp(raw)
177
+ value = parsed
178
+ editingText = String(parsed)
179
+ onValueChange(parsed)
180
+ }
181
+
182
+ public var body: some View {
183
+ let effectiveMinusDisabled = disabled.minus || value <= min
184
+ let effectivePlusDisabled = disabled.plus || value >= max
185
+
186
+ HStack(spacing: Spacing.S) {
187
+ StepperButton(
188
+ sign: "-",
189
+ size: size,
190
+ disabled: effectiveMinusDisabled,
191
+ onPress: { applyValue(value - step) }
192
+ )
193
+
194
+ StepperNumberView(
195
+ text: Binding(
196
+ get: { editable ? editingText : String(value) },
197
+ set: { newText in
198
+ editingText = newText
199
+ let parsed = Int(newText.filter { $0.isNumber }) ?? 0
200
+ applyValue(parsed)
201
+ }
202
+ ),
203
+ size: size,
204
+ disabled: disabled.number,
205
+ editable: editable
206
+ )
207
+
208
+ StepperButton(
209
+ sign: "+",
210
+ size: size,
211
+ disabled: effectivePlusDisabled,
212
+ onPress: { applyValue(value + step) }
213
+ )
214
+ }
215
+ .onAppear {
216
+ let clamped = clamp(value)
217
+ if clamped != value { value = clamped }
218
+ editingText = String(clamped)
219
+ }
220
+ }
221
+ }
@@ -0,0 +1,467 @@
1
+ import SwiftUI
2
+
3
+ // ─── Data model ────────────────────────────────────────────────────────────────
4
+
5
+ /// A single step rendered inside a ``Steps`` indicator.
6
+ public struct StepItem: Identifiable {
7
+ public let id = UUID()
8
+ public let title: String
9
+ public let description: String?
10
+ public let error: Bool
11
+ public let time: String?
12
+
13
+ public init(
14
+ title: String,
15
+ description: String? = nil,
16
+ error: Bool = false,
17
+ time: String? = nil
18
+ ) {
19
+ self.title = title
20
+ self.description = description
21
+ self.error = error
22
+ self.time = time
23
+ }
24
+ }
25
+
26
+ // ─── Enumerations ──────────────────────────────────────────────────────────────
27
+
28
+ public enum StepsSize {
29
+ case small
30
+ case large
31
+ }
32
+
33
+ public enum StepsAlign {
34
+ case left
35
+ case right
36
+ case center
37
+ case stretch
38
+ }
39
+
40
+ // ─── Internal status ───────────────────────────────────────────────────────────
41
+
42
+ private enum StepStatus {
43
+ case incomplete
44
+ case current
45
+ case completed
46
+ case error
47
+ case disabled
48
+ }
49
+
50
+ private func resolveStatus(
51
+ activeIndex: Int,
52
+ currentIndex: Int,
53
+ error: Bool,
54
+ disabled: Bool
55
+ ) -> StepStatus {
56
+ if disabled { return .disabled }
57
+ if error { return .error }
58
+ if activeIndex == currentIndex { return .current }
59
+ if activeIndex > currentIndex { return .completed }
60
+ return .incomplete
61
+ }
62
+
63
+ // ─── Color helpers ─────────────────────────────────────────────────────────────
64
+
65
+ private func resolveIconBgAndBorder(_ status: StepStatus, theme: Theme) -> (bg: Color, border: Color) {
66
+ switch status {
67
+ case .current, .completed:
68
+ return (theme.colors.primary, theme.colors.background.tonal)
69
+ case .error:
70
+ return (theme.colors.error.primary, theme.colors.error.container)
71
+ case .disabled:
72
+ return (Colors.pink08, Colors.pink10)
73
+ case .incomplete:
74
+ return (Colors.black06, theme.colors.border.default)
75
+ }
76
+ }
77
+
78
+ private func resolveTitleColor(_ status: StepStatus, theme: Theme) -> Color {
79
+ switch status {
80
+ case .current:
81
+ return theme.colors.primary
82
+ case .error:
83
+ return theme.colors.error.primary
84
+ case .disabled:
85
+ return theme.colors.text.disable
86
+ default:
87
+ return theme.colors.text.default
88
+ }
89
+ }
90
+
91
+ // ─── Step bubble ───────────────────────────────────────────────────────────────
92
+
93
+ private struct StepBubble: View {
94
+ @Environment(\.appTheme) private var theme
95
+
96
+ let index: Int
97
+ let isActive: Bool
98
+ let error: Bool
99
+ let size: StepsSize
100
+ let status: StepStatus
101
+ let useNumber: Bool
102
+ let customIcon: String?
103
+
104
+ private var bubbleSize: CGFloat { size == .small ? 16 : 24 }
105
+ private var innerSize: CGFloat { size == .small ? 12 : 16 }
106
+ private var dotSize: CGFloat { size == .small ? 6 : 8 }
107
+
108
+ var body: some View {
109
+ let colors = resolveIconBgAndBorder(status, theme: theme)
110
+ ZStack {
111
+ Circle()
112
+ .fill(colors.bg)
113
+ .overlay(Circle().strokeBorder(colors.border, lineWidth: 2))
114
+
115
+ bubbleContent
116
+ }
117
+ .frame(width: bubbleSize, height: bubbleSize)
118
+ }
119
+
120
+ @ViewBuilder
121
+ private var bubbleContent: some View {
122
+ if useNumber {
123
+ MomoText(
124
+ "\(index + 1)",
125
+ typography: .headerXsSemibold,
126
+ color: Colors.black01
127
+ )
128
+ } else if isActive {
129
+ if let customIcon = customIcon, !customIcon.isEmpty {
130
+ Icon(source: customIcon, size: innerSize, color: Colors.black01)
131
+ } else {
132
+ Circle()
133
+ .fill(Colors.black01)
134
+ .frame(width: dotSize, height: dotSize)
135
+ }
136
+ } else {
137
+ Icon(
138
+ source: error ? "navigation_close" : "notifications_check",
139
+ size: innerSize,
140
+ color: Colors.black01
141
+ )
142
+ }
143
+ }
144
+ }
145
+
146
+ // ─── Horizontal layout ─────────────────────────────────────────────────────────
147
+
148
+ private struct StepsHorizontal: View {
149
+ @Environment(\.appTheme) private var theme
150
+
151
+ let steps: [StepItem]
152
+ let activeIndex: Int
153
+ let size: StepsSize
154
+ let useNumber: Bool
155
+ let align: StepsAlign
156
+ let customIcon: String?
157
+ let disabled: Bool
158
+ let onPress: ((StepItem, Int) -> Void)?
159
+
160
+ private var completedLine: Color { theme.colors.primary.opacity(0.2) }
161
+ private var defaultLine: Color { theme.colors.background.default }
162
+
163
+ var body: some View {
164
+ HStack(alignment: .top, spacing: 0) {
165
+ ForEach(Array(steps.enumerated()), id: \.element.id) { index, item in
166
+ column(index: index, item: item)
167
+ .frame(maxWidth: .infinity)
168
+ }
169
+ }
170
+ .frame(maxWidth: .infinity)
171
+ }
172
+
173
+ @ViewBuilder
174
+ private func column(index: Int, item: StepItem) -> some View {
175
+ let status = resolveStatus(
176
+ activeIndex: activeIndex,
177
+ currentIndex: index,
178
+ error: item.error,
179
+ disabled: disabled
180
+ )
181
+ let isActiveOrError = status == .current || status == .error
182
+ let titleStyle: TypographyStyle = isActiveOrError
183
+ ? .headerXsSemibold : .descriptionDefaultRegular
184
+ let descStyle: TypographyStyle = size == .small
185
+ ? .descriptionXsRegular : .descriptionDefaultRegular
186
+ let titleColor = resolveTitleColor(status, theme: theme)
187
+ let subColor = disabled ? theme.colors.text.disable : theme.colors.text.hint
188
+
189
+ let colAlignment = horizontalAlignment(for: index)
190
+ let textAlignment = textAlign(for: index)
191
+
192
+ let hideLineLeft = align == .left || (align == .stretch && index == 0)
193
+ let hideLineRight = align == .right || (align == .stretch && index == steps.count - 1)
194
+
195
+ let lineLeft: Color = index == 0
196
+ ? Color.clear
197
+ : (activeIndex >= index ? completedLine : defaultLine)
198
+ let lineRight: Color = index == steps.count - 1
199
+ ? Color.clear
200
+ : (activeIndex > index ? completedLine : defaultLine)
201
+
202
+ let clickable = status == .completed && onPress != nil && !disabled
203
+
204
+ let columnBody = VStack(alignment: colAlignment, spacing: 0) {
205
+ if let time = item.time, !time.isEmpty {
206
+ MomoText(time, typography: .descriptionXsRegular, color: subColor)
207
+ .multilineTextAlignment(textAlignment)
208
+ .frame(maxWidth: .infinity, alignment: frameAlignment(colAlignment))
209
+ }
210
+
211
+ HStack(spacing: 0) {
212
+ if !hideLineLeft {
213
+ lineLeft
214
+ .frame(height: 2)
215
+ .frame(maxWidth: .infinity)
216
+ .clipShape(RoundedCorner(radius: Radius.XS, corners: [.topRight, .bottomRight]))
217
+ }
218
+ StepBubble(
219
+ index: index,
220
+ isActive: activeIndex == index,
221
+ error: item.error,
222
+ size: size,
223
+ status: status,
224
+ useNumber: useNumber,
225
+ customIcon: customIcon
226
+ )
227
+ .padding(.leading, hideLineLeft ? 0 : Spacing.XS)
228
+ .padding(.trailing, hideLineRight ? 0 : Spacing.XS)
229
+ .padding(.vertical, Spacing.XS)
230
+ if !hideLineRight {
231
+ lineRight
232
+ .frame(height: 2)
233
+ .frame(maxWidth: .infinity)
234
+ .clipShape(RoundedCorner(radius: Radius.XS, corners: [.topLeft, .bottomLeft]))
235
+ }
236
+ }
237
+ .frame(maxWidth: .infinity)
238
+
239
+ if !item.title.isEmpty {
240
+ MomoText(item.title, typography: titleStyle, color: titleColor)
241
+ .multilineTextAlignment(textAlignment)
242
+ .frame(maxWidth: .infinity, alignment: frameAlignment(colAlignment))
243
+ .padding(.bottom, Spacing.XXS)
244
+ }
245
+
246
+ if let desc = item.description, !desc.isEmpty {
247
+ MomoText(desc, typography: descStyle, color: subColor)
248
+ .multilineTextAlignment(textAlignment)
249
+ .frame(maxWidth: .infinity, alignment: frameAlignment(colAlignment))
250
+ }
251
+ }
252
+ .contentShape(Rectangle())
253
+
254
+ if clickable {
255
+ // Mirrors Compose's `activeOpacityClickable` press feedback; non-clickable
256
+ // steps render with no press interaction at all.
257
+ SwiftUI.Button(action: { onPress?(item, index) }) {
258
+ columnBody
259
+ }
260
+ .buttonStyle(ActiveOpacityButtonStyle())
261
+ } else {
262
+ columnBody
263
+ }
264
+ }
265
+
266
+ private func horizontalAlignment(for index: Int) -> HorizontalAlignment {
267
+ switch align {
268
+ case .left: return .leading
269
+ case .right: return .trailing
270
+ case .center: return .center
271
+ case .stretch:
272
+ if index == 0 { return .leading }
273
+ if index == steps.count - 1 { return .trailing }
274
+ return .center
275
+ }
276
+ }
277
+
278
+ private func textAlign(for index: Int) -> TextAlignment {
279
+ switch align {
280
+ case .left: return .leading
281
+ case .right: return .trailing
282
+ case .center: return .center
283
+ case .stretch:
284
+ if index == 0 { return .leading }
285
+ if index == steps.count - 1 { return .trailing }
286
+ return .center
287
+ }
288
+ }
289
+
290
+ private func frameAlignment(_ h: HorizontalAlignment) -> Alignment {
291
+ switch h {
292
+ case .leading: return .leading
293
+ case .trailing: return .trailing
294
+ default: return .center
295
+ }
296
+ }
297
+ }
298
+
299
+ // ─── Vertical layout ───────────────────────────────────────────────────────────
300
+
301
+ private struct StepsVertical: View {
302
+ @Environment(\.appTheme) private var theme
303
+
304
+ let steps: [StepItem]
305
+ let activeIndex: Int
306
+ let size: StepsSize
307
+ let useNumber: Bool
308
+ let customIcon: String?
309
+ let disabled: Bool
310
+ let onPress: ((StepItem, Int) -> Void)?
311
+
312
+ private var completedLine: Color { theme.colors.primary.opacity(0.2) }
313
+ private var defaultLine: Color { theme.colors.background.default }
314
+ private var useSmall: Bool { size == .small }
315
+ private var connectorHeight: CGFloat { useSmall ? 24 : 32 }
316
+
317
+ var body: some View {
318
+ VStack(spacing: 0) {
319
+ ForEach(Array(steps.enumerated()), id: \.element.id) { index, item in
320
+ row(index: index, item: item)
321
+ }
322
+ }
323
+ .frame(maxWidth: .infinity)
324
+ }
325
+
326
+ @ViewBuilder
327
+ private func row(index: Int, item: StepItem) -> some View {
328
+ let status = resolveStatus(
329
+ activeIndex: activeIndex,
330
+ currentIndex: index,
331
+ error: item.error,
332
+ disabled: disabled
333
+ )
334
+ let isActiveOrError = status == .current || status == .error
335
+ let isLast = index == steps.count - 1
336
+
337
+ let titleStyle: TypographyStyle = isActiveOrError
338
+ ? (useSmall ? .headerXsSemibold : .headerSSemibold)
339
+ : (useSmall ? .descriptionDefaultRegular : .bodyDefaultRegular)
340
+ let descStyle: TypographyStyle = useSmall
341
+ ? .descriptionXsRegular : .descriptionDefaultRegular
342
+
343
+ let titleColor = resolveTitleColor(status, theme: theme)
344
+ let subColor = disabled ? theme.colors.text.disable : theme.colors.text.hint
345
+ let lineColor = activeIndex > index ? completedLine : defaultLine
346
+
347
+ let clickable = status == .completed && onPress != nil && !disabled
348
+
349
+ let rowBody = HStack(alignment: .top, spacing: 0) {
350
+ VStack(spacing: 0) {
351
+ StepBubble(
352
+ index: index,
353
+ isActive: activeIndex == index,
354
+ error: item.error,
355
+ size: size,
356
+ status: status,
357
+ useNumber: useNumber,
358
+ customIcon: customIcon
359
+ )
360
+ if !isLast {
361
+ lineColor
362
+ .frame(width: 2, height: connectorHeight)
363
+ .padding(.vertical, Spacing.XS)
364
+ }
365
+ }
366
+ .padding(.trailing, Spacing.M)
367
+
368
+ VStack(alignment: .leading, spacing: 0) {
369
+ HStack(alignment: .top, spacing: 0) {
370
+ MomoText(item.title, typography: titleStyle, color: titleColor)
371
+ .lineLimit(2)
372
+ .frame(maxWidth: .infinity, alignment: .leading)
373
+ .padding(.trailing, Spacing.S)
374
+ if let time = item.time, !time.isEmpty {
375
+ MomoText(time, typography: .descriptionXsRegular, color: subColor)
376
+ }
377
+ }
378
+ .frame(maxWidth: .infinity)
379
+
380
+ if let desc = item.description, !desc.isEmpty {
381
+ MomoText(desc, typography: descStyle, color: subColor)
382
+ .frame(maxWidth: .infinity, alignment: .leading)
383
+ .padding(.top, Spacing.XXS)
384
+ }
385
+ }
386
+ .frame(maxWidth: .infinity)
387
+ .padding(.bottom, isLast ? 0 : Spacing.S)
388
+ }
389
+ .frame(maxWidth: .infinity)
390
+ .contentShape(Rectangle())
391
+
392
+ if clickable {
393
+ // Mirrors Compose's `activeOpacityClickable` press feedback; non-clickable
394
+ // steps render with no press interaction at all.
395
+ SwiftUI.Button(action: { onPress?(item, index) }) {
396
+ rowBody
397
+ }
398
+ .buttonStyle(ActiveOpacityButtonStyle())
399
+ } else {
400
+ rowBody
401
+ }
402
+ }
403
+ }
404
+
405
+ // ─── Public API ────────────────────────────────────────────────────────────────
406
+
407
+ /// Steps — guided progress indicator through a sequence of procedural steps.
408
+ ///
409
+ /// Mirrors the Compose `Steps` component.
410
+ public struct Steps: View {
411
+ private let steps: [StepItem]
412
+ private let activeIndex: Int
413
+ private let horizontal: Bool
414
+ private let size: StepsSize
415
+ private let useNumber: Bool
416
+ private let align: StepsAlign
417
+ private let customIcon: String?
418
+ private let disabled: Bool
419
+ private let onPress: ((StepItem, Int) -> Void)?
420
+
421
+ public init(
422
+ steps: [StepItem],
423
+ activeIndex: Int,
424
+ horizontal: Bool = false,
425
+ size: StepsSize = .large,
426
+ useNumber: Bool = false,
427
+ align: StepsAlign = .center,
428
+ customIcon: String? = nil,
429
+ disabled: Bool = false,
430
+ onPress: ((StepItem, Int) -> Void)? = nil
431
+ ) {
432
+ self.steps = steps
433
+ self.activeIndex = activeIndex
434
+ self.horizontal = horizontal
435
+ self.size = size
436
+ self.useNumber = useNumber
437
+ self.align = align
438
+ self.customIcon = customIcon
439
+ self.disabled = disabled
440
+ self.onPress = onPress
441
+ }
442
+
443
+ public var body: some View {
444
+ if horizontal {
445
+ StepsHorizontal(
446
+ steps: steps,
447
+ activeIndex: activeIndex,
448
+ size: size,
449
+ useNumber: useNumber,
450
+ align: align,
451
+ customIcon: customIcon,
452
+ disabled: disabled,
453
+ onPress: onPress
454
+ )
455
+ } else {
456
+ StepsVertical(
457
+ steps: steps,
458
+ activeIndex: activeIndex,
459
+ size: size,
460
+ useNumber: useNumber,
461
+ customIcon: customIcon,
462
+ disabled: disabled,
463
+ onPress: onPress
464
+ )
465
+ }
466
+ }
467
+ }