@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.
- package/CLAUDE.md +99 -0
- package/PUBLISH_GUIDE.md +675 -0
- package/README.md +184 -5
- package/ios/Application/ApplicationEnvironment.swift +71 -0
- package/ios/Application/Components.swift +270 -0
- package/ios/Application/ComposeApi.swift +22 -0
- package/ios/Application/FloatingButton.swift +174 -0
- package/ios/Application/HeaderRight.swift +306 -0
- package/ios/Application/LanguageSource.swift +93 -0
- package/ios/Application/Localize.swift +378 -0
- package/ios/Application/LocalizeModifier.swift +30 -0
- package/ios/Application/MaxApi.swift +18 -0
- package/ios/Application/Navigation/BottomTab/BottomTab.swift +104 -0
- package/ios/Application/Navigation/BottomTab/BottomTabBar.swift +215 -0
- package/ios/Application/Navigation/BottomTab/CurvedContainer.swift +65 -0
- package/ios/Application/Navigation/HeaderBackProps.swift +66 -0
- package/ios/Application/Navigation/HeaderTitle.swift +57 -0
- package/ios/Application/Navigation/HeaderUser.swift +209 -0
- package/ios/Application/Navigation/NavigationContainer.swift +213 -0
- package/ios/Application/Navigation/NavigationOptions.swift +109 -0
- package/ios/Application/Navigation/Navigator.swift +453 -0
- package/ios/Application/Navigation/NavigatorManager.swift +22 -0
- package/ios/Application/Navigation/Overplay/BottomSheet.swift +256 -0
- package/ios/Application/Navigation/Overplay/ModalScreen.swift +74 -0
- package/ios/Application/Navigation/Overplay/SnackBar.swift +144 -0
- package/ios/Application/Navigation/Tracking/ScreenTracker.swift +117 -0
- package/ios/Application/Navigation/component/Header.swift +178 -0
- package/ios/Application/Navigation/component/HeaderBackground.swift +83 -0
- package/ios/Application/Navigation/component/HeaderColor.swift +65 -0
- package/ios/Application/Navigation/component/HeaderRightWidthKey.swift +11 -0
- package/ios/Application/Navigation/component/NavigationFooter.swift +90 -0
- package/ios/Application/Navigation/component/NavigationHeaderRight.swift +196 -0
- package/ios/Application/Screen.swift +250 -0
- package/ios/Application/StackScreen.swift +492 -0
- package/ios/Avatar/Avatar.swift +193 -0
- package/ios/Badge/Badge.swift +84 -0
- package/ios/Badge/BadgeDot.swift +31 -0
- package/ios/Badge/BadgeRibbon.swift +319 -0
- package/ios/BaselineView/BaselineView.swift +163 -0
- package/ios/Button/Button.swift +232 -84
- package/ios/CalculatorKeyboard/CalculatorKeyboard.swift +126 -0
- package/ios/Carousel/Carousel.swift +196 -0
- package/ios/Checkbox/Checkbox.swift +77 -0
- package/ios/Chip/Chip.swift +120 -0
- package/ios/Collapse/Collapse.swift +192 -0
- package/ios/{Colors+Spacing → Colors+Radius+Spacing}/Colors.swift +42 -37
- package/ios/Colors+Radius+Spacing/Radius.swift +22 -0
- package/ios/{Colors+Spacing → Colors+Radius+Spacing}/Spacing.swift +3 -1
- package/ios/Colors+Radius+Spacing/Theme.swift +295 -0
- package/ios/DateTimePicker/DateTimePicker.swift +212 -0
- package/ios/DateTimePicker/DateTimePickerTypes.swift +55 -0
- package/ios/DateTimePicker/DateTimePickerUtils.swift +167 -0
- package/ios/DateTimePicker/WheelPicker.swift +165 -0
- package/ios/Divider/Divider.swift +16 -0
- package/ios/Extensions/ActiveOpacityButtonStyle.swift +14 -0
- package/ios/Extensions/Color++.swift +32 -0
- package/ios/Icon/Icon.swift +69 -0
- package/ios/IconButton/IconButton.swift +140 -0
- package/ios/Image/Image.swift +87 -0
- package/ios/Information/Information.swift +156 -0
- package/ios/Input/ErrorView.swift +58 -0
- package/ios/Input/Input.swift +461 -77
- package/ios/Input/InputPhoneNumber.swift +192 -0
- package/ios/Input/InputSearch.swift +301 -0
- package/ios/Input/InputTextArea.swift +318 -0
- package/ios/InputDropDown/InputDropDown.swift +201 -0
- package/ios/InputMoney/InputMoney.swift +405 -0
- package/ios/InputOTP/InputOTP.swift +211 -0
- package/ios/Layout/GridContext.swift +30 -0
- package/ios/Layout/Item.swift +42 -0
- package/ios/Layout/Section.swift +134 -0
- package/ios/Loader/Loader.swift +113 -0
- package/ios/Lottie/LottieView.swift +86 -0
- package/ios/MoMoUIKits.podspec +5 -0
- package/ios/OTPKeyboard/KeyboardButton.swift +13 -5
- package/ios/OTPKeyboard/OTPKeyboard.swift +1 -1
- package/ios/Pagination/PaginationDot.swift +61 -0
- package/ios/Pagination/PaginationNumber.swift +35 -0
- package/ios/Pagination/PaginationScroll.swift +101 -0
- package/ios/Pagination/PaginationWhiteDot.swift +37 -0
- package/ios/Popup/PopupDisplay.swift +279 -0
- package/ios/Popup/PopupInput.swift +92 -0
- package/ios/Popup/PopupNotify.swift +219 -0
- package/ios/Popup/PopupPromotion.swift +74 -0
- package/ios/PopupView/FullscreenPopup.swift +251 -0
- package/ios/{Popup → PopupView}/Modifiers.swift +6 -20
- package/ios/{Popup → PopupView}/PopupView.swift +38 -146
- package/ios/PopupView/Utils++.swift +281 -0
- package/ios/ProgressInfo/ProgressInfo.swift +297 -0
- package/ios/Radio/Radio.swift +69 -0
- package/ios/Rating/Rating.swift +83 -0
- package/{example/ios/Example/Preview Content/Preview Assets.xcassets/Contents.json → ios/Resources/MoMoUIKitsColors.xcassets/AccentColor.colorset/Contents.json} +5 -0
- package/{example/ios/Example/Assets.xcassets → ios/Resources/MoMoUIKitsColors.xcassets}/Text.colorset/Contents.json +3 -3
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/Contents.json +9 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-default.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-disable.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-pressed.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-selected.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-surface.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-tonal.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/border-default.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/border-disable.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/gradient.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/primary.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/secondary.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-container.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-primary.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-secondary.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-default.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-disable.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-hint.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-secondary.colorset/Contents.json +38 -0
- package/ios/ScrollIndicator/ScrollIndicator.swift +110 -0
- package/ios/Skeleton/Skeleton.swift +99 -0
- package/ios/Slider/Slider.swift +237 -0
- package/ios/StatusBarTap/StatusBarTap.h +13 -0
- package/ios/StatusBarTap/StatusBarTap.m +75 -0
- package/ios/Stepper/Stepper.swift +221 -0
- package/ios/Steps/Steps.swift +467 -0
- package/ios/SuggestAction/SuggestAction.swift +100 -0
- package/ios/Swipeable/SwipeCell.swift +226 -31
- package/ios/Swipeable/SwipeCellModel.swift +21 -0
- package/ios/Switch/Switch.swift +69 -0
- package/ios/TabView/TabView.swift +534 -0
- package/ios/Tag/Tag.swift +99 -0
- package/ios/Template/Logo/Logo.swift +75 -0
- package/ios/Template/TrustBanner/TrustBanner.swift +123 -0
- package/ios/Title/Title.swift +270 -0
- package/ios/Tooltip/Tooltip.swift +486 -0
- package/ios/Typography/FontScale.swift +103 -0
- package/ios/Typography/FontScaleStore.swift +58 -0
- package/ios/Typography/KitDesignSystem.swift +17 -0
- package/ios/Typography/Text.swift +262 -0
- package/ios/Typography/Typography.swift +80 -23
- package/ios/Uploader/Uploader.swift +174 -0
- package/ios/native-kits.podspec +73 -13
- package/ios-demo/MoMoUIKitsDemo.podspec +20 -0
- package/ios-demo/Resources/dot_loading.json +558 -0
- package/ios-demo/Resources/icon.json +4052 -0
- package/ios-demo/Resources/lottie_circle_loader.json +1 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/DemoScaffold.swift +48 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsBadgeDemoView.swift +25 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsButtonDemoView.swift +26 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsCheckboxDemoView.swift +19 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsChipDemoView.swift +33 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsInputDemoView.swift +48 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsPopupDemoView.swift +21 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsRadioDemoView.swift +17 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsTypographyDemoView.swift +28 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/MoMoUIKitsDemoContext.swift +31 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/MoMoUIKitsDemoFactory.swift +24 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AnimatedHeaderDemo.swift +110 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AvatarDemo.swift +107 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BadgeDemo.swift +75 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BaselineView.swift +117 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BottomTabDemo.swift +89 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ButtonDemo.swift +108 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CarouselDemo.swift +96 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CheckboxDemo.swift +60 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ChipDemo.swift +76 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CollapseDemo.swift +102 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ContentView.swift +107 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DateTimePickerDemo.swift +100 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DemoScreen.swift +420 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DividerDemo.swift +56 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/HeaderUserDemo.swift +49 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/Home.swift +276 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/IconButtonDemo.swift +93 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/IconDemo.swift +81 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ImageDemo.swift +65 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InformationDemo.swift +96 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputDemo.swift +117 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputDropDownDemo.swift +94 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputMoneyDemo.swift +94 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputOTPDemo.swift +88 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputPhoneNumberDemo.swift +120 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputSearchDemo.swift +85 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputTextAreaDemo.swift +87 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/LoaderDemo.swift +73 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/LocalizeDemo.swift +235 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift +241 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PaginationDemo.swift +68 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PlaygroundData.swift +76 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupDisplayDemo.swift +175 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupNotifyDemo.swift +95 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupPromotionDemo.swift +67 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ProgressInfoDemo.swift +101 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/RadioDemo.swift +64 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/RatingDemo.swift +68 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SectionDemo.swift +83 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SkeletonDemo.swift +61 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SliderDemo.swift +90 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SnackBarDemo.swift +82 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/StepperDemo.swift +93 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/StepsDemo.swift +114 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SuggestActionDemo.swift +90 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SwipeDemo.swift +107 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SwitchDemo.swift +58 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TabViewDemo.swift +114 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TagDemo.swift +86 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ThemeDemo.swift +181 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TitleDemo.swift +104 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TooltipDemo.swift +118 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TypographyDemo.swift +87 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/UploaderDemo.swift +85 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SwiftUIDemoBrowserView.swift +53 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/UIKitsDemoModels.swift +15 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/UIKitsDemoRegistry.swift +73 -0
- package/package.json +6 -6
- package/publish.sh +554 -20
- package/scripts/gen-ios-color.mjs +136 -0
- package/CODE_OF_CONDUCT.md +0 -133
- package/CONTRIBUTING.md +0 -114
- package/LICENSE +0 -20
- package/android/build.gradle +0 -82
- package/android/gradle.properties +0 -5
- package/android/src/main/AndroidManifest.xml +0 -4
- package/android/src/main/java/com/momoplatform/nativekits/NativeKitsPackage.kt +0 -17
- package/android/src/main/java/com/momoplatform/nativekits/NativeKitsViewManager.kt +0 -20
- package/example/ios/Example/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -63
- package/example/ios/Example/ComponentDetail.swift +0 -35
- package/example/ios/Example/ComponentItem.swift +0 -24
- package/example/ios/Example/ComponentModel.swift +0 -33
- package/example/ios/Example/ContentView.swift +0 -53
- package/example/ios/Example/Example.entitlements +0 -10
- package/example/ios/Example/Foundation/ButtonDemo.swift +0 -80
- package/example/ios/Example/Foundation/Popup/ActionSheets.swift +0 -136
- package/example/ios/Example/Foundation/Popup/Floats.swift +0 -127
- package/example/ios/Example/Foundation/Popup/Popups.swift +0 -101
- package/example/ios/Example/Foundation/PopupDemo.swift +0 -366
- package/example/ios/Example/Foundation/TextInputDemo.swift +0 -31
- package/example/ios/Example/Foundation/TypographyDemo.swift +0 -53
- package/example/ios/Example/Foundation.swift +0 -26
- package/example/ios/Example/Info.plist +0 -18
- package/example/ios/Example/Library/SwipeableDemo.swift +0 -105
- package/example/ios/Example/Library.swift +0 -26
- package/example/ios/Example/Main.swift +0 -11
- package/example/ios/Example/Overview.swift +0 -20
- package/example/ios/Example/Resource/SFProText-Black.ttf +0 -0
- package/example/ios/Example/Resource/SFProText-Bold.ttf +0 -0
- package/example/ios/Example/Resource/SFProText-Heavy.ttf +0 -0
- package/example/ios/Example/Resource/SFProText-Light.ttf +0 -0
- package/example/ios/Example/Resource/SFProText-Medium.ttf +0 -0
- package/example/ios/Example/Resource/SFProText-Regular.ttf +0 -0
- package/example/ios/Example/Resource/SFProText-Semibold.ttf +0 -0
- package/example/ios/Example/Resource/SFProText-Thin.ttf +0 -0
- package/example/ios/Example/Resource/SFProText-Ultralight.ttf +0 -0
- package/example/ios/Example/Resource/foundation.json +0 -33
- package/example/ios/Example/Resource/library.json +0 -8
- package/example/ios/Example/Utils.swift +0 -30
- package/example/ios/Example/ViewModifier/DarkViewModifier.swift +0 -22
- package/example/ios/Example.xcodeproj/project.pbxproj +0 -570
- package/example/ios/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/example/ios/Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/example/ios/Example.xcodeproj/project.xcworkspace/xcuserdata/wem.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/example/ios/Example.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- package/example/ios/Example.xcworkspace/contents.xcworkspacedata +0 -10
- package/example/ios/Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/example/ios/Example.xcworkspace/xcuserdata/wem.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/example/ios/Example.xcworkspace/xcuserdata/wem.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +0 -6
- package/example/ios/Podfile +0 -6
- package/example/ios/Podfile.lock +0 -16
- package/example/ios/Pods/Local Podspecs/MoMoUIKits.podspec.json +0 -29
- package/example/ios/Pods/Manifest.lock +0 -16
- package/example/ios/Pods/Pods.xcodeproj/project.pbxproj +0 -661
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/MoMoUIKits.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/Pods-Example.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/xcschememanagement.plist +0 -25
- package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits-dummy.m +0 -5
- package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits-prefix.pch +0 -12
- package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits-umbrella.h +0 -16
- package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits.debug.xcconfig +0 -12
- package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits.modulemap +0 -6
- package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits.release.xcconfig +0 -12
- package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.markdown +0 -3
- package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.plist +0 -29
- package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example-dummy.m +0 -5
- package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example-umbrella.h +0 -16
- package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig +0 -14
- package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example.modulemap +0 -6
- package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig +0 -14
- package/ios/Colors+Spacing/Radius.swift +0 -11
- package/ios/Popup/Utils++.swift +0 -163
- package/ios/Theme.md +0 -18
- /package/{example/ios/Example/Assets.xcassets → ios/Resources/MoMoUIKitsColors.xcassets}/Background.colorset/Contents.json +0 -0
- /package/{example/ios/Example/Assets.xcassets → ios/Resources/MoMoUIKitsColors.xcassets}/Border.colorset/Contents.json +0 -0
- /package/{example/ios/Example/Assets.xcassets → ios/Resources/MoMoUIKitsColors.xcassets}/Card.colorset/Contents.json +0 -0
- /package/{example/ios/Example/Assets.xcassets → ios/Resources/MoMoUIKitsColors.xcassets}/Contents.json +0 -0
- /package/{example/ios/Example/Assets.xcassets → ios/Resources/MoMoUIKitsColors.xcassets}/Error.colorset/Contents.json +0 -0
- /package/{example/ios/Example/Assets.xcassets → ios/Resources/MoMoUIKitsColors.xcassets}/Primary.colorset/Contents.json +0 -0
- /package/{example/ios/Example/Assets.xcassets → ios/Resources/MoMoUIKitsColors.xcassets}/PrimaryDark.colorset/Contents.json +0 -0
- /package/{example/ios/Example/Assets.xcassets → ios/Resources/MoMoUIKitsColors.xcassets}/PrimaryLight.colorset/Contents.json +0 -0
- /package/{example/ios/Example/Assets.xcassets → ios/Resources/MoMoUIKitsColors.xcassets}/Secondary.colorset/Contents.json +0 -0
- /package/{example/ios/Example/Assets.xcassets → ios/Resources/MoMoUIKitsColors.xcassets}/Success.colorset/Contents.json +0 -0
- /package/{example/ios/Example/Assets.xcassets → ios/Resources/MoMoUIKitsColors.xcassets}/TextSecondary.colorset/Contents.json +0 -0
- /package/{example/ios/Example/Assets.xcassets → ios/Resources/MoMoUIKitsColors.xcassets}/Warning.colorset/Contents.json +0 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
//
|
|
2
|
+
// TrustBanner.swift
|
|
3
|
+
// MoMoUIKits
|
|
4
|
+
//
|
|
5
|
+
// Created by Nguyễn Hoàng Sơn on 14/12/2023.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import Foundation
|
|
9
|
+
import SwiftUI
|
|
10
|
+
import SDWebImageSwiftUI
|
|
11
|
+
|
|
12
|
+
let jsonUrl = "https://static.momocdn.net/app/json/component-kits/design_system.json"
|
|
13
|
+
|
|
14
|
+
public struct TrustBannerData: Decodable {
|
|
15
|
+
let content: [String: String]
|
|
16
|
+
let subContent: [String: String]
|
|
17
|
+
let pciImage: String
|
|
18
|
+
let sslImage: String
|
|
19
|
+
let urlConfig: String
|
|
20
|
+
let icons: [String]
|
|
21
|
+
let momoImage: String
|
|
22
|
+
|
|
23
|
+
enum CodingKeys: String, CodingKey {
|
|
24
|
+
case content
|
|
25
|
+
case subContent
|
|
26
|
+
case pciImage
|
|
27
|
+
case sslImage
|
|
28
|
+
case icons
|
|
29
|
+
case momoImage
|
|
30
|
+
case urlConfig = "url_config"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
let defaultBanner = TrustBannerData(
|
|
35
|
+
content: ["vi": "An toàn tài sản & Bảo mật thông tin của bạn là ưu tiên hàng đầu của MoMo.",
|
|
36
|
+
"en": "Ensuring financial security and data privacy is MoMo's highest priority."],
|
|
37
|
+
subContent: [
|
|
38
|
+
"vi": "Tìm hiểu thêm",
|
|
39
|
+
"en": "Learn more"
|
|
40
|
+
],
|
|
41
|
+
pciImage: "https://static.momocdn.net/app/img/kits/trustBanner/pci.png",
|
|
42
|
+
sslImage: "https://static.momocdn.net/app/img/kits/trustBanner/ssl.png",
|
|
43
|
+
urlConfig: "login_and_security",
|
|
44
|
+
icons: [
|
|
45
|
+
"https://static.momocdn.net/app/img/kits/trustBanner/ic_viettinbank.png",
|
|
46
|
+
"https://static.momocdn.net/app/img/kits/trustBanner/ic_agribank.png",
|
|
47
|
+
"https://static.momocdn.net/app/img/kits/trustBanner/ic_vietcombank.png",
|
|
48
|
+
"https://static.momocdn.net/app/img/kits/trustBanner/ic_bidv.png"
|
|
49
|
+
],
|
|
50
|
+
momoImage: "https://static.momocdn.net/app/img/kits/trustBanner/ic_secu.png"
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
public struct TrustBanner: View {
|
|
54
|
+
@Environment(\.applicationEnvironment) var applicationEnvironment
|
|
55
|
+
@Environment(\.localize) private var localize
|
|
56
|
+
|
|
57
|
+
var onPress: ((String)->Void)?
|
|
58
|
+
|
|
59
|
+
public init(onPress: ((String)->Void)?) {
|
|
60
|
+
self.onPress = onPress
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
func onPressSecurity() {
|
|
64
|
+
if (onPress != nil) {
|
|
65
|
+
onPress!(applicationEnvironment.config?.trustBanner?.urlConfig ?? defaultBanner.urlConfig)
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
public var body: some View {
|
|
71
|
+
HStack(alignment: .center, spacing: 8) {
|
|
72
|
+
WebImage(url: URL(string: applicationEnvironment.config?.trustBanner?.momoImage ?? defaultBanner.momoImage))
|
|
73
|
+
.resizable()
|
|
74
|
+
.scaledToFit()
|
|
75
|
+
.frame(width: 64, height: 64)
|
|
76
|
+
VStack(alignment: .leading){
|
|
77
|
+
Text(applicationEnvironment.config?.trustBanner?.content[localize.currentLanguage]
|
|
78
|
+
?? localize.translateData(defaultBanner.content))
|
|
79
|
+
.foregroundColor(Color(hex: "484848"))
|
|
80
|
+
.lineLimit(2)
|
|
81
|
+
.font(.system(size: 13, weight: Font.Weight.regular))
|
|
82
|
+
.ignoreBoldTextSetting()
|
|
83
|
+
.lineSpacing(3)
|
|
84
|
+
.padding(.bottom, 8)
|
|
85
|
+
HStack {
|
|
86
|
+
HStack(spacing: 0) {
|
|
87
|
+
Text(applicationEnvironment.config?.trustBanner?.subContent[localize.currentLanguage]
|
|
88
|
+
?? localize.translateData(defaultBanner.subContent))
|
|
89
|
+
.foregroundColor(Colors.pink03)
|
|
90
|
+
.font(.system(size: 13, weight: .bold))
|
|
91
|
+
.ignoreBoldTextSetting()
|
|
92
|
+
.padding(.trailing, 4)
|
|
93
|
+
|
|
94
|
+
Icon(source: "arrow_chevron_right_small", color: Colors.pink03)
|
|
95
|
+
}.onTapGesture {
|
|
96
|
+
onPressSecurity()
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
Spacer()
|
|
100
|
+
HStack{
|
|
101
|
+
WebImage(url: URL(string: applicationEnvironment.config?.trustBanner?.pciImage ?? defaultBanner.pciImage))
|
|
102
|
+
.resizable()
|
|
103
|
+
.scaledToFit()
|
|
104
|
+
.frame(width: 24, height: 20)
|
|
105
|
+
WebImage(url: URL(string: applicationEnvironment.config?.trustBanner?.sslImage ?? defaultBanner.sslImage))
|
|
106
|
+
.resizable()
|
|
107
|
+
.scaledToFit()
|
|
108
|
+
.frame(width: 52, height: 20)
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
}
|
|
115
|
+
.padding(.all, 12)
|
|
116
|
+
.background(Color(hex: "F2F8FF"))
|
|
117
|
+
.cornerRadius(12)
|
|
118
|
+
.onTapGesture {
|
|
119
|
+
onPressSecurity()
|
|
120
|
+
}
|
|
121
|
+
.frame(maxWidth: UIScreen.main.bounds.size.width)
|
|
122
|
+
}
|
|
123
|
+
}
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import SwiftUI
|
|
2
|
+
|
|
3
|
+
// MARK: - Enums
|
|
4
|
+
|
|
5
|
+
public enum TitleType {
|
|
6
|
+
case card
|
|
7
|
+
case section
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
public enum TitleSize {
|
|
11
|
+
case small
|
|
12
|
+
case medium
|
|
13
|
+
case large
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public enum IconAlign {
|
|
17
|
+
case top
|
|
18
|
+
case center
|
|
19
|
+
case bottom
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public enum TitleButtonSize {
|
|
23
|
+
case small
|
|
24
|
+
case large
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// MARK: - Title
|
|
28
|
+
|
|
29
|
+
public struct Title: View {
|
|
30
|
+
@Environment(\.appTheme) private var theme
|
|
31
|
+
@Environment(\.momoFontScale) private var fontScale
|
|
32
|
+
|
|
33
|
+
private let title: String
|
|
34
|
+
private let type: TitleType
|
|
35
|
+
private let size: TitleSize
|
|
36
|
+
private let icon: String?
|
|
37
|
+
private let iconColor: Color?
|
|
38
|
+
private let iconAlign: IconAlign
|
|
39
|
+
private let showRightAction: Bool
|
|
40
|
+
private let showTrailingAction: Bool
|
|
41
|
+
private let badgeLabel: String?
|
|
42
|
+
private let buttonTitle: String?
|
|
43
|
+
private let buttonSize: TitleButtonSize
|
|
44
|
+
private let onPressRightAction: () -> Void
|
|
45
|
+
private let onPressTrailingAction: () -> Void
|
|
46
|
+
private let textOnly: Bool
|
|
47
|
+
private let description: String?
|
|
48
|
+
|
|
49
|
+
public init(
|
|
50
|
+
title: String,
|
|
51
|
+
type: TitleType = .section,
|
|
52
|
+
size: TitleSize = .medium,
|
|
53
|
+
icon: String? = nil,
|
|
54
|
+
iconColor: Color? = nil,
|
|
55
|
+
iconAlign: IconAlign = .top,
|
|
56
|
+
showRightAction: Bool = false,
|
|
57
|
+
showTrailingAction: Bool = false,
|
|
58
|
+
badgeLabel: String? = nil,
|
|
59
|
+
buttonTitle: String? = nil,
|
|
60
|
+
buttonSize: TitleButtonSize = .small,
|
|
61
|
+
onPressRightAction: @escaping () -> Void = {},
|
|
62
|
+
onPressTrailingAction: @escaping () -> Void = {},
|
|
63
|
+
textOnly: Bool = false,
|
|
64
|
+
description: String? = nil
|
|
65
|
+
) {
|
|
66
|
+
self.title = title
|
|
67
|
+
self.type = type
|
|
68
|
+
self.size = size
|
|
69
|
+
self.icon = icon
|
|
70
|
+
self.iconColor = iconColor
|
|
71
|
+
self.iconAlign = iconAlign
|
|
72
|
+
self.showRightAction = showRightAction
|
|
73
|
+
self.showTrailingAction = showTrailingAction
|
|
74
|
+
self.badgeLabel = badgeLabel
|
|
75
|
+
self.buttonTitle = buttonTitle
|
|
76
|
+
self.buttonSize = buttonSize
|
|
77
|
+
self.onPressRightAction = onPressRightAction
|
|
78
|
+
self.onPressTrailingAction = onPressTrailingAction
|
|
79
|
+
self.textOnly = textOnly
|
|
80
|
+
self.description = description
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// MARK: - Title text style
|
|
84
|
+
|
|
85
|
+
private var titleFontSize: CGFloat {
|
|
86
|
+
switch type {
|
|
87
|
+
case .card:
|
|
88
|
+
switch size {
|
|
89
|
+
case .small: return 14
|
|
90
|
+
case .medium: return 16
|
|
91
|
+
case .large: return 18
|
|
92
|
+
}
|
|
93
|
+
case .section:
|
|
94
|
+
switch size {
|
|
95
|
+
case .small: return 16
|
|
96
|
+
case .medium: return 18
|
|
97
|
+
case .large: return 20
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
private var titleLineHeight: CGFloat {
|
|
103
|
+
switch type {
|
|
104
|
+
case .card:
|
|
105
|
+
switch size {
|
|
106
|
+
case .small: return 20
|
|
107
|
+
case .medium: return 22
|
|
108
|
+
case .large: return 26
|
|
109
|
+
}
|
|
110
|
+
case .section:
|
|
111
|
+
switch size {
|
|
112
|
+
case .small: return 24
|
|
113
|
+
case .medium: return 26
|
|
114
|
+
case .large: return 28
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
private var titleFontWeight: Font.Weight {
|
|
120
|
+
switch type {
|
|
121
|
+
case .card: return .regular
|
|
122
|
+
case .section: return .bold
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
private var titleMaxLines: Int {
|
|
127
|
+
(showTrailingAction || badgeLabel != nil) ? 1 : 2
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
private var iconVerticalAlignment: VerticalAlignment {
|
|
131
|
+
switch iconAlign {
|
|
132
|
+
case .top: return .top
|
|
133
|
+
case .center: return .center
|
|
134
|
+
case .bottom: return .bottom
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
private var trailingBackground: Color {
|
|
139
|
+
type == .section
|
|
140
|
+
? Colors.black06.opacity(0.6)
|
|
141
|
+
: Colors.black06.opacity(0.3)
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// MARK: - Body
|
|
145
|
+
|
|
146
|
+
public var body: some View {
|
|
147
|
+
if textOnly {
|
|
148
|
+
titleText
|
|
149
|
+
} else {
|
|
150
|
+
fullLayout
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
private var titleText: some View {
|
|
155
|
+
SwiftUI.Text(title)
|
|
156
|
+
.font(.system(size: fontScale(titleFontSize), weight: titleFontWeight))
|
|
157
|
+
.ignoreBoldTextSetting()
|
|
158
|
+
.foregroundColor(theme.colors.text.default)
|
|
159
|
+
.lineSpacing(fontScale(titleLineHeight) - fontScale(titleFontSize))
|
|
160
|
+
.lineLimit(titleMaxLines)
|
|
161
|
+
.truncationMode(.tail)
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
private var fullLayout: some View {
|
|
165
|
+
HStack(alignment: .center, spacing: 0) {
|
|
166
|
+
HStack(alignment: iconVerticalAlignment, spacing: 0) {
|
|
167
|
+
if let icon = icon {
|
|
168
|
+
Icon(
|
|
169
|
+
source: icon,
|
|
170
|
+
size: 24,
|
|
171
|
+
color: iconColor ?? theme.colors.text.default
|
|
172
|
+
)
|
|
173
|
+
.padding(.trailing, Spacing.S)
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
VStack(alignment: .leading, spacing: 0) {
|
|
177
|
+
HStack(alignment: .center, spacing: 0) {
|
|
178
|
+
HStack(alignment: .center, spacing: 0) {
|
|
179
|
+
titleText
|
|
180
|
+
|
|
181
|
+
if let badgeLabel = badgeLabel {
|
|
182
|
+
Spacer().frame(width: 4)
|
|
183
|
+
Badge(label: badgeLabel)
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
if showTrailingAction != true {
|
|
187
|
+
Spacer(minLength: 0)
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
if showTrailingAction && !showRightAction {
|
|
191
|
+
Spacer().frame(width: 8)
|
|
192
|
+
SwiftUI.Button(action: onPressTrailingAction) {
|
|
193
|
+
Icon(source: "arrow_chevron_right_small", size: 18)
|
|
194
|
+
.frame(width: 24, height: 24)
|
|
195
|
+
.background(trailingBackground)
|
|
196
|
+
.clipShape(RoundedRectangle(cornerRadius: 12))
|
|
197
|
+
}
|
|
198
|
+
.buttonStyle(.plain)
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
if let description = description {
|
|
203
|
+
Spacer().frame(height: 4)
|
|
204
|
+
MomoText(
|
|
205
|
+
description,
|
|
206
|
+
typography: .descriptionDefaultRegular,
|
|
207
|
+
color: theme.colors.text.secondary
|
|
208
|
+
)
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
if showRightAction && !showTrailingAction {
|
|
214
|
+
Spacer().frame(width: 8)
|
|
215
|
+
if let buttonTitle = buttonTitle {
|
|
216
|
+
SwiftUI.Button(action: onPressRightAction) {
|
|
217
|
+
MomoText(
|
|
218
|
+
buttonTitle,
|
|
219
|
+
typography: buttonSize == .small ? .actionXsBold : .actionSBold,
|
|
220
|
+
color: theme.colors.primary
|
|
221
|
+
)
|
|
222
|
+
}
|
|
223
|
+
.buttonStyle(.plain)
|
|
224
|
+
} else {
|
|
225
|
+
SwiftUI.Button(action: onPressRightAction) {
|
|
226
|
+
Icon(
|
|
227
|
+
source: "arrow_chevron_right_small",
|
|
228
|
+
size: 22,
|
|
229
|
+
color: theme.colors.primary
|
|
230
|
+
)
|
|
231
|
+
.frame(width: 24, height: 24)
|
|
232
|
+
.background(Colors.pink03.opacity(0.1))
|
|
233
|
+
.clipShape(RoundedRectangle(cornerRadius: 12))
|
|
234
|
+
}
|
|
235
|
+
.buttonStyle(.plain)
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
.frame(maxWidth: .infinity, alignment: .leading)
|
|
240
|
+
.padding(8)
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// MARK: - Preview
|
|
245
|
+
|
|
246
|
+
#if DEBUG
|
|
247
|
+
struct Title_Previews: PreviewProvider {
|
|
248
|
+
static var previews: some View {
|
|
249
|
+
VStack(alignment: .leading, spacing: 12) {
|
|
250
|
+
Title(title: "Section Small", type: .section, size: .small)
|
|
251
|
+
Title(
|
|
252
|
+
title: "Section Medium",
|
|
253
|
+
type: .section,
|
|
254
|
+
size: .medium,
|
|
255
|
+
icon: "basic_home",
|
|
256
|
+
description: "This is a medium section with icon."
|
|
257
|
+
)
|
|
258
|
+
Title(
|
|
259
|
+
title: "Section Large",
|
|
260
|
+
type: .section,
|
|
261
|
+
size: .large,
|
|
262
|
+
showTrailingAction: true,
|
|
263
|
+
badgeLabel: "NEW"
|
|
264
|
+
)
|
|
265
|
+
}
|
|
266
|
+
.padding()
|
|
267
|
+
.previewLayout(.sizeThatFits)
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
#endif
|