@momo-kits/native-kits 0.162.2-beta.26 → 0.162.2-beta.27-debug
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +1 -1
- package/build.gradle.kts +11 -0
- package/compose/build.gradle.kts +190 -0
- package/compose/build.gradle.kts.backup +190 -0
- package/compose/compose.podspec +47 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/navigation/ScrollToTop.android.kt +6 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +123 -0
- package/compose/src/commonMain/composeResources/font/momosignature.otf +0 -0
- package/compose/src/commonMain/composeResources/font/momotrustdisplay.otf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_black.otf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_black.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_bold.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_heavy.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_light.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_medium.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_regular.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_semibold.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_thin.otf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_thin.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_ultralight.otf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_ultralight.ttf +0 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/AnimationSearchInput.kt +52 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +101 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/FloatingButton.kt +183 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Header.kt +207 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderAnimated.kt +39 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderBackground.kt +86 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderDefault.kt +76 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderExtended.kt +76 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderRight.kt +294 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderTitle.kt +33 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +826 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Localize.kt +269 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +107 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +378 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/useHeaderSearchAnimation.kt +69 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +157 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +82 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +32 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +338 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +175 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +356 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +113 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +89 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +128 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +209 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +543 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +23 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +76 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +140 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +231 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +112 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +477 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +114 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +214 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +240 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +216 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +259 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +182 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +343 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +108 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +56 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +41 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +84 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +40 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +328 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +97 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +310 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +59 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +87 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +17 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +90 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +323 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +217 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +473 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +122 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +199 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +91 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +470 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +88 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +131 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +203 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +498 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +175 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +182 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +193 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +29 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +234 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +188 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +306 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +12 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +16 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +188 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +270 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +2 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +35 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +2 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +52 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +66 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +11 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +104 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +48 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Size.kt +51 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +253 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +129 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +100 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +154 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +360 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ScrollToTop.kt +8 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +581 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +156 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +225 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +86 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +169 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +320 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +81 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +309 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +34 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +360 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +132 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +128 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +70 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +58 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +1329 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +55 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +15 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +105 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +32 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +184 -0
- package/gradle/libs.versions.toml +69 -0
- package/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/gradle/wrapper/gradle-wrapper.properties +8 -0
- package/gradle.properties +26 -0
- package/gradlew +252 -0
- package/gradlew.bat +94 -0
- package/ios/Application/ApplicationEnvironment.swift +0 -11
- package/ios/Application/Components.swift +44 -34
- package/ios/Application/FloatingButton.swift +9 -10
- package/ios/Application/HeaderRight.swift +45 -79
- package/ios/Application/Screen.swift +1 -2
- package/ios/Badge/Badge.swift +14 -11
- package/ios/Badge/BadgeRibbon.swift +21 -12
- package/ios/Button/Button.swift +22 -61
- package/ios/Checkbox/Checkbox.swift +13 -14
- package/ios/Chip/Chip.swift +9 -23
- package/ios/Colors+Radius+Spacing/Colors.swift +12 -12
- package/ios/Extensions/Color++.swift +0 -32
- package/ios/Icon/Icon.swift +1 -6
- package/ios/Input/Input.swift +25 -41
- package/ios/Input/InputPhoneNumber.swift +19 -20
- package/ios/Input/InputSearch.swift +47 -100
- package/ios/Input/InputTextArea.swift +40 -66
- package/ios/Popup/PopupDisplay.swift +16 -8
- package/ios/Popup/PopupInput.swift +8 -2
- package/ios/Swipeable/SwipeCell.swift +0 -185
- package/ios/Swipeable/SwipeCellModel.swift +0 -21
- package/ios/Typography/Text.swift +5 -79
- package/ios/Typography/Typography.swift +0 -3
- package/ios/native-kits.podspec +8 -61
- package/package.json +1 -1
- package/publish.sh +0 -50
- package/settings.gradle.kts +64 -0
- package/.claude/settings.local.json +0 -39
- package/ios/Application/Navigation/BottomTab/BottomTab.swift +0 -103
- package/ios/Application/Navigation/BottomTab/BottomTabBar.swift +0 -215
- package/ios/Application/Navigation/BottomTab/CurvedContainer.swift +0 -65
- package/ios/Application/Navigation/HeaderBackProps.swift +0 -66
- package/ios/Application/Navigation/HeaderTitle.swift +0 -57
- package/ios/Application/Navigation/HeaderUser.swift +0 -209
- package/ios/Application/Navigation/NavigationContainer.swift +0 -176
- package/ios/Application/Navigation/NavigationOptions.swift +0 -109
- package/ios/Application/Navigation/Navigator.swift +0 -364
- package/ios/Application/Navigation/Overplay/BottomSheet.swift +0 -188
- package/ios/Application/Navigation/Overplay/ModalScreen.swift +0 -68
- package/ios/Application/Navigation/Overplay/SnackBar.swift +0 -144
- package/ios/Application/Navigation/component/Header.swift +0 -178
- package/ios/Application/Navigation/component/HeaderBackground.swift +0 -83
- package/ios/Application/Navigation/component/HeaderColor.swift +0 -65
- package/ios/Application/StackScreen.swift +0 -453
- package/ios/Avatar/Avatar.swift +0 -193
- package/ios/BaselineView/BaselineView.swift +0 -163
- package/ios/Carousel/Carousel.swift +0 -181
- package/ios/Collapse/Collapse.swift +0 -182
- package/ios/Colors+Radius+Spacing/Theme.swift +0 -295
- package/ios/DateTimePicker/DateTimePicker.swift +0 -210
- package/ios/DateTimePicker/DateTimePickerTypes.swift +0 -55
- package/ios/DateTimePicker/DateTimePickerUtils.swift +0 -167
- package/ios/DateTimePicker/WheelPicker.swift +0 -161
- package/ios/Divider/Divider.swift +0 -16
- package/ios/IconButton/IconButton.swift +0 -112
- package/ios/InputDropDown/InputDropDown.swift +0 -198
- package/ios/InputMoney/InputMoney.swift +0 -335
- package/ios/InputOTP/InputOTP.swift +0 -210
- package/ios/Loader/Loader.swift +0 -113
- package/ios/MoMoUIKits.podspec +0 -5
- package/ios/Pagination/PaginationDot.swift +0 -61
- package/ios/Pagination/PaginationNumber.swift +0 -35
- package/ios/Pagination/PaginationScroll.swift +0 -101
- package/ios/Pagination/PaginationWhiteDot.swift +0 -37
- package/ios/Popup/PopupNotify.swift +0 -219
- package/ios/ProgressInfo/ProgressInfo.swift +0 -294
- package/ios/Radio/Radio.swift +0 -70
- package/ios/Rating/Rating.swift +0 -82
- package/ios/Resources/MoMoUIKitsColors.xcassets/AccentColor.colorset/Contents.json +0 -11
- package/ios/Resources/MoMoUIKitsColors.xcassets/Background.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/Border.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/Card.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/Contents.json +0 -6
- package/ios/Resources/MoMoUIKitsColors.xcassets/Error.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/Primary.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/PrimaryDark.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/PrimaryLight.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/Secondary.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/Success.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/Text.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/TextSecondary.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/Contents.json +0 -9
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-default.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-disable.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-pressed.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-selected.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-surface.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-tonal.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/border-default.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/border-disable.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/gradient.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/primary.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/secondary.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-container.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-primary.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-secondary.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-default.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-disable.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-hint.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-secondary.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/Warning.colorset/Contents.json +0 -38
- package/ios/Skeleton/Skeleton.swift +0 -99
- package/ios/Slider/Slider.swift +0 -237
- package/ios/Stepper/Stepper.swift +0 -220
- package/ios/Steps/Steps.swift +0 -451
- package/ios/SuggestAction/SuggestAction.swift +0 -97
- package/ios/TabView/TabView.swift +0 -530
- package/ios/Tag/Tag.swift +0 -98
- package/ios/Title/Title.swift +0 -269
- package/ios/Tooltip/Tooltip.swift +0 -482
- package/ios/Typography/FontScaleStore.swift +0 -19
- package/ios/Uploader/Uploader.swift +0 -183
- package/ios-demo/MoMoUIKitsDemo.podspec +0 -20
- package/ios-demo/Resources/dot_loading.json +0 -558
- package/ios-demo/Resources/icon.json +0 -4052
- package/ios-demo/Resources/lottie_circle_loader.json +0 -1
- package/ios-demo/Sources/MoMoUIKitsDemo/DemoScaffold.swift +0 -48
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsBadgeDemoView.swift +0 -25
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsButtonDemoView.swift +0 -26
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsCheckboxDemoView.swift +0 -19
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsChipDemoView.swift +0 -33
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsInputDemoView.swift +0 -48
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsPopupDemoView.swift +0 -21
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsRadioDemoView.swift +0 -17
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsTypographyDemoView.swift +0 -28
- package/ios-demo/Sources/MoMoUIKitsDemo/MoMoUIKitsDemoContext.swift +0 -31
- package/ios-demo/Sources/MoMoUIKitsDemo/MoMoUIKitsDemoFactory.swift +0 -24
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AnimatedHeaderDemo.swift +0 -110
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AvatarDemo.swift +0 -93
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BadgeDemo.swift +0 -269
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BaselineView.swift +0 -117
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BottomTabDemo.swift +0 -89
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ButtonDemo.swift +0 -100
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CarouselDemo.swift +0 -126
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CheckboxDemo.swift +0 -63
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ChipDemo.swift +0 -20
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CollapseDemo.swift +0 -93
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ContentView.swift +0 -107
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DateTimePickerDemo.swift +0 -124
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DividerDemo.swift +0 -14
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/HeaderUserDemo.swift +0 -49
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/Home.swift +0 -278
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/IconButtonDemo.swift +0 -58
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ImageDemo.swift +0 -78
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InformationDemo.swift +0 -138
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputDemo.swift +0 -111
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputDropDownDemo.swift +0 -136
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputMoneyDemo.swift +0 -107
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputOTPDemo.swift +0 -73
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputPhoneNumberDemo.swift +0 -100
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputSearchDemo.swift +0 -32
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputTextAreaDemo.swift +0 -57
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/LoaderDemo.swift +0 -70
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift +0 -227
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PaginationDemo.swift +0 -72
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupDisplayDemo.swift +0 -175
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupNotifyDemo.swift +0 -121
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupPromotionDemo.swift +0 -76
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ProgressInfoDemo.swift +0 -89
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/RadioDemo.swift +0 -32
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/RatingDemo.swift +0 -56
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SkeletonDemo.swift +0 -32
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SliderDemo.swift +0 -150
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SnackBarDemo.swift +0 -138
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/StepperDemo.swift +0 -103
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/StepsDemo.swift +0 -94
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SuggestActionDemo.swift +0 -79
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SwipeDemo.swift +0 -152
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SwitchDemo.swift +0 -33
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TabViewDemo.swift +0 -190
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TagDemo.swift +0 -34
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ThemeDemo.swift +0 -182
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TitleDemo.swift +0 -109
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TooltipDemo.swift +0 -187
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TypographyDemo.swift +0 -87
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/UploaderDemo.swift +0 -131
- package/ios-demo/Sources/MoMoUIKitsDemo/SwiftUIDemoBrowserView.swift +0 -51
- package/ios-demo/Sources/MoMoUIKitsDemo/UIKitsDemoModels.swift +0 -15
- package/ios-demo/Sources/MoMoUIKitsDemo/UIKitsDemoRegistry.swift +0 -73
- package/scripts/gen-ios-color.mjs +0 -136
|
@@ -3,18 +3,18 @@ import Foundation
|
|
|
3
3
|
import SwiftUI
|
|
4
4
|
|
|
5
5
|
public enum Colors {
|
|
6
|
-
public static let primary = Color
|
|
7
|
-
public static let primaryDark = Color
|
|
8
|
-
public static let primaryLight = Color
|
|
9
|
-
public static let secondary = Color
|
|
10
|
-
public static let background = Color
|
|
11
|
-
public static let border = Color
|
|
12
|
-
public static let text = Color
|
|
13
|
-
public static let textSecondary = Color
|
|
14
|
-
public static let card = Color
|
|
15
|
-
public static let error = Color
|
|
16
|
-
public static let info = Color(
|
|
17
|
-
public static let success = Color
|
|
6
|
+
public static let primary = Color("Primary")
|
|
7
|
+
public static let primaryDark = Color("PrimaryDark")
|
|
8
|
+
public static let primaryLight = Color("PrimaryLight")
|
|
9
|
+
public static let secondary = Color("Secondary")
|
|
10
|
+
public static let background = Color("Background")
|
|
11
|
+
public static let border = Color("Border")
|
|
12
|
+
public static let text = Color("Text")
|
|
13
|
+
public static let textSecondary = Color("TextSecondary")
|
|
14
|
+
public static let card = Color("Card")
|
|
15
|
+
public static let error = Color("Error")
|
|
16
|
+
public static let info = Color("Info")
|
|
17
|
+
public static let success = Color("Success")
|
|
18
18
|
|
|
19
19
|
public static let black20 = Color(hex: "000000")
|
|
20
20
|
public static let black19 = Color(hex: "18191a")
|
|
@@ -1,38 +1,6 @@
|
|
|
1
1
|
import SwiftUI
|
|
2
|
-
import Foundation
|
|
3
|
-
|
|
4
|
-
private final class MoMoUIKitsBundleToken {}
|
|
5
|
-
|
|
6
|
-
enum MoMoUIKitsResources {
|
|
7
|
-
static let bundle: Bundle = {
|
|
8
|
-
let bundleName = "MoMoUIKitsResources"
|
|
9
|
-
let tokenBundle = Bundle(for: MoMoUIKitsBundleToken.self)
|
|
10
|
-
let frameworkBundle = Bundle(identifier: "org.cocoapods.MoMoUIKits")
|
|
11
|
-
let candidates = [
|
|
12
|
-
Bundle.main.resourceURL,
|
|
13
|
-
tokenBundle.resourceURL,
|
|
14
|
-
tokenBundle.bundleURL,
|
|
15
|
-
frameworkBundle?.resourceURL,
|
|
16
|
-
frameworkBundle?.bundleURL
|
|
17
|
-
]
|
|
18
|
-
|
|
19
|
-
for candidate in candidates {
|
|
20
|
-
guard let bundleURL = candidate?.appendingPathComponent("\(bundleName).bundle"),
|
|
21
|
-
let bundle = Bundle(url: bundleURL) else {
|
|
22
|
-
continue
|
|
23
|
-
}
|
|
24
|
-
return bundle
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return Bundle.main
|
|
28
|
-
}()
|
|
29
|
-
}
|
|
30
2
|
|
|
31
3
|
public extension Color {
|
|
32
|
-
static func momoAsset(_ name: String) -> Color {
|
|
33
|
-
Color(name, bundle: MoMoUIKitsResources.bundle)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
4
|
init(hex: UInt, alpha: Double = 1) {
|
|
37
5
|
self.init(
|
|
38
6
|
.sRGB,
|
package/ios/Icon/Icon.swift
CHANGED
|
@@ -23,9 +23,6 @@ func loadIconSources() -> [String: IconSource] {
|
|
|
23
23
|
// Load the JSON data into a global variable
|
|
24
24
|
let iconSources: [String: IconSource] = loadIconSources()
|
|
25
25
|
|
|
26
|
-
// Icons that must never be tinted (mirror Compose `noThemeIcons`)
|
|
27
|
-
let noThemeIcons: [String] = ["ic_round_momo_tiny"]
|
|
28
|
-
|
|
29
26
|
// Icon ViewModel
|
|
30
27
|
public struct Icon: View {
|
|
31
28
|
var source: String
|
|
@@ -47,9 +44,7 @@ public struct Icon: View {
|
|
|
47
44
|
|
|
48
45
|
public var body: some View {
|
|
49
46
|
if let uri = iconSources[source]?.uri {
|
|
50
|
-
|
|
51
|
-
let resolvedColor = noThemeIcons.contains(source) ? nil : color
|
|
52
|
-
ImageView(uri, color: resolvedColor).frame(width: size, height: size)
|
|
47
|
+
ImageView(uri, color: color).frame(width: size, height: size)
|
|
53
48
|
}
|
|
54
49
|
}
|
|
55
50
|
}
|
package/ios/Input/Input.swift
CHANGED
|
@@ -3,14 +3,12 @@ import SwiftUI
|
|
|
3
3
|
import Combine
|
|
4
4
|
|
|
5
5
|
public struct Input: View {
|
|
6
|
-
@Environment(\.appTheme) private var theme
|
|
7
6
|
@Binding public var text: String
|
|
8
7
|
|
|
9
8
|
public var placeholder: String
|
|
10
9
|
public var floatingValue: String
|
|
11
|
-
public var floatingValueColor: Color?
|
|
12
10
|
public var floatingIcon: String
|
|
13
|
-
public var floatingIconColor: Color
|
|
11
|
+
public var floatingIconColor: Color
|
|
14
12
|
public var size: InputSize
|
|
15
13
|
public var hintText: String
|
|
16
14
|
public var error: String
|
|
@@ -19,9 +17,9 @@ public struct Input: View {
|
|
|
19
17
|
public var readOnly: Bool
|
|
20
18
|
public var secureTextEntry: Bool
|
|
21
19
|
public var rightIcon: String
|
|
22
|
-
public var rightIconColor: Color
|
|
20
|
+
public var rightIconColor: Color
|
|
23
21
|
public var leadingIcon: String
|
|
24
|
-
public var leadingIconColor: Color
|
|
22
|
+
public var leadingIconColor: Color
|
|
25
23
|
public var loading: Bool
|
|
26
24
|
public var required: Bool
|
|
27
25
|
public var maxLength: Int?
|
|
@@ -40,9 +38,8 @@ public struct Input: View {
|
|
|
40
38
|
text: Binding<String>,
|
|
41
39
|
placeholder: String = "",
|
|
42
40
|
floatingValue: String = "",
|
|
43
|
-
floatingValueColor: Color? = nil,
|
|
44
41
|
floatingIcon: String = "",
|
|
45
|
-
floatingIconColor: Color
|
|
42
|
+
floatingIconColor: Color = Colors.primary,
|
|
46
43
|
size: InputSize = .small,
|
|
47
44
|
hintText: String = "",
|
|
48
45
|
error: String = "",
|
|
@@ -51,9 +48,9 @@ public struct Input: View {
|
|
|
51
48
|
readOnly: Bool = false,
|
|
52
49
|
secureTextEntry: Bool = false,
|
|
53
50
|
rightIcon: String = "",
|
|
54
|
-
rightIconColor: Color
|
|
51
|
+
rightIconColor: Color = Colors.black17,
|
|
55
52
|
leadingIcon: String = "",
|
|
56
|
-
leadingIconColor: Color
|
|
53
|
+
leadingIconColor: Color = Colors.black12,
|
|
57
54
|
loading: Bool = false,
|
|
58
55
|
required: Bool = false,
|
|
59
56
|
maxLength: Int? = nil,
|
|
@@ -68,7 +65,6 @@ public struct Input: View {
|
|
|
68
65
|
self._text = text
|
|
69
66
|
self.placeholder = placeholder
|
|
70
67
|
self.floatingValue = floatingValue
|
|
71
|
-
self.floatingValueColor = floatingValueColor
|
|
72
68
|
self.floatingIcon = floatingIcon
|
|
73
69
|
self.floatingIconColor = floatingIconColor
|
|
74
70
|
self.size = size
|
|
@@ -111,14 +107,14 @@ public struct Input: View {
|
|
|
111
107
|
HStack(spacing: Spacing.XS) {
|
|
112
108
|
MomoText(floatingValue, typography: .labelSMedium, color: getFloatingColor())
|
|
113
109
|
if required {
|
|
114
|
-
MomoText("*", typography: .labelSMedium, color:
|
|
110
|
+
MomoText("*", typography: .labelSMedium, color: Colors.red03)
|
|
115
111
|
}
|
|
116
112
|
if !floatingIcon.isEmpty {
|
|
117
113
|
Icon(source: floatingIcon, size: 16, color: getFloatingIconColor())
|
|
118
114
|
}
|
|
119
115
|
}
|
|
120
116
|
.padding(.horizontal, Spacing.S)
|
|
121
|
-
.background(
|
|
117
|
+
.background(Colors.black01)
|
|
122
118
|
.offset(x: Spacing.S, y: -8)
|
|
123
119
|
.zIndex(10)
|
|
124
120
|
}
|
|
@@ -127,7 +123,7 @@ public struct Input: View {
|
|
|
127
123
|
HStack(alignment: .center, spacing: 0) {
|
|
128
124
|
// Leading icon
|
|
129
125
|
if !leadingIcon.isEmpty {
|
|
130
|
-
Icon(source: leadingIcon, size: size == .small ? 24 : 32, color:
|
|
126
|
+
Icon(source: leadingIcon, size: size == .small ? 24 : 32, color: leadingIconColor)
|
|
131
127
|
.padding(.trailing, Spacing.M)
|
|
132
128
|
}
|
|
133
129
|
|
|
@@ -148,7 +144,6 @@ public struct Input: View {
|
|
|
148
144
|
fontSize: scaleSize(14),
|
|
149
145
|
fontWeight: fontWeight == .bold ? .bold : .regular,
|
|
150
146
|
textColor: UIColor(getTextColor()),
|
|
151
|
-
cursorColor: UIColor(theme.colors.primary),
|
|
152
147
|
isDisabled: disabled || readOnly,
|
|
153
148
|
maxLength: maxLength,
|
|
154
149
|
onFocusChange: { focused in
|
|
@@ -165,7 +160,7 @@ public struct Input: View {
|
|
|
165
160
|
.ignoreBoldTextSetting()
|
|
166
161
|
.foregroundColor(getTextColor())
|
|
167
162
|
.disabled(disabled || readOnly)
|
|
168
|
-
.
|
|
163
|
+
.applyPrimaryCursorColor()
|
|
169
164
|
.onChange(of: text) { newValue in
|
|
170
165
|
let limited = limitText(newValue)
|
|
171
166
|
if limited != newValue {
|
|
@@ -181,7 +176,7 @@ public struct Input: View {
|
|
|
181
176
|
text = ""
|
|
182
177
|
onChangeText?("")
|
|
183
178
|
}) {
|
|
184
|
-
Icon(source: "24_navigation_close_circle_full", size: 16, color:
|
|
179
|
+
Icon(source: "24_navigation_close_circle_full", size: 16, color: Colors.black12)
|
|
185
180
|
.padding(.leading, Spacing.S).accessibility(identifier: "ic_clear")
|
|
186
181
|
}
|
|
187
182
|
}
|
|
@@ -200,14 +195,14 @@ public struct Input: View {
|
|
|
200
195
|
Icon(
|
|
201
196
|
source: isPasswordHidden ? "24_security_eye_off" : "24_security_eye_open",
|
|
202
197
|
size: 24,
|
|
203
|
-
color:
|
|
198
|
+
color: rightIconColor
|
|
204
199
|
)
|
|
205
200
|
.padding(.leading, Spacing.S).accessibility(identifier: "ic_show_hide")
|
|
206
201
|
}
|
|
207
202
|
}
|
|
208
203
|
} else if !rightIcon.isEmpty {
|
|
209
204
|
SwiftUI.Button(action: { onRightIconPressed?() }) {
|
|
210
|
-
Icon(source: rightIcon, size: 24, color:
|
|
205
|
+
Icon(source: rightIcon, size: 24, color: rightIconColor)
|
|
211
206
|
.padding(.leading, Spacing.S)
|
|
212
207
|
}
|
|
213
208
|
}
|
|
@@ -216,7 +211,7 @@ public struct Input: View {
|
|
|
216
211
|
.frame(height: scaleSize(size == .small ? 48 : 56, 1.1))
|
|
217
212
|
.background(
|
|
218
213
|
RoundedRectangle(cornerRadius: Radius.S)
|
|
219
|
-
.fill(
|
|
214
|
+
.fill(Colors.black01)
|
|
220
215
|
)
|
|
221
216
|
.overlay(
|
|
222
217
|
RoundedRectangle(cornerRadius: Radius.S)
|
|
@@ -265,39 +260,31 @@ public struct Input: View {
|
|
|
265
260
|
|
|
266
261
|
private func borderColor() -> Color {
|
|
267
262
|
if disabled {
|
|
268
|
-
return
|
|
263
|
+
return Colors.black04 // border.disable
|
|
269
264
|
}
|
|
270
265
|
if !error.isEmpty {
|
|
271
|
-
return
|
|
266
|
+
return Colors.red03 // error.primary
|
|
272
267
|
}
|
|
273
268
|
if isFocused {
|
|
274
|
-
return
|
|
269
|
+
return Colors.primary
|
|
275
270
|
}
|
|
276
|
-
return
|
|
271
|
+
return Colors.black04 // border.default
|
|
277
272
|
}
|
|
278
273
|
|
|
279
274
|
private func getTextColor() -> Color {
|
|
280
|
-
return disabled ?
|
|
275
|
+
return disabled ? Colors.black09 : Colors.black17
|
|
281
276
|
}
|
|
282
277
|
|
|
283
278
|
private func getPlaceholderColor() -> Color {
|
|
284
|
-
return disabled ?
|
|
279
|
+
return disabled ? Colors.black09 : Colors.black12
|
|
285
280
|
}
|
|
286
281
|
|
|
287
282
|
private func getFloatingColor() -> Color {
|
|
288
|
-
return disabled ?
|
|
283
|
+
return disabled ? Colors.black09 : Colors.black12
|
|
289
284
|
}
|
|
290
285
|
|
|
291
286
|
private func getFloatingIconColor() -> Color {
|
|
292
|
-
return disabled ?
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
private func getLeadingIconColor() -> Color {
|
|
296
|
-
return disabled ? theme.colors.text.disable : (leadingIconColor ?? theme.colors.text.hint)
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
private func getRightIconColor() -> Color {
|
|
300
|
-
return disabled ? theme.colors.text.disable : (rightIconColor ?? theme.colors.text.default)
|
|
287
|
+
return disabled ? Colors.black09 : floatingIconColor
|
|
301
288
|
}
|
|
302
289
|
}
|
|
303
290
|
|
|
@@ -309,7 +296,6 @@ private struct SecureInputField: UIViewRepresentable {
|
|
|
309
296
|
var fontSize: CGFloat
|
|
310
297
|
var fontWeight: UIFont.Weight
|
|
311
298
|
var textColor: UIColor
|
|
312
|
-
var cursorColor: UIColor
|
|
313
299
|
var isDisabled: Bool
|
|
314
300
|
var maxLength: Int?
|
|
315
301
|
var onFocusChange: (Bool) -> Void
|
|
@@ -330,7 +316,7 @@ private struct SecureInputField: UIViewRepresentable {
|
|
|
330
316
|
textField.setContentHuggingPriority(.defaultLow, for: .horizontal)
|
|
331
317
|
textField.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
|
|
332
318
|
textField.text = text
|
|
333
|
-
textField.tintColor =
|
|
319
|
+
textField.tintColor = UIColor(Colors.primary)
|
|
334
320
|
textField.addTarget(
|
|
335
321
|
context.coordinator,
|
|
336
322
|
action: #selector(Coordinator.textFieldDidChange(_:)),
|
|
@@ -345,8 +331,6 @@ private struct SecureInputField: UIViewRepresentable {
|
|
|
345
331
|
textField.text = text
|
|
346
332
|
}
|
|
347
333
|
textField.isEnabled = !isDisabled
|
|
348
|
-
textField.textColor = textColor
|
|
349
|
-
textField.tintColor = cursorColor
|
|
350
334
|
if textField.keyboardType != keyboardType {
|
|
351
335
|
textField.keyboardType = keyboardType
|
|
352
336
|
textField.reloadInputViews()
|
|
@@ -417,9 +401,9 @@ private struct SecureInputField: UIViewRepresentable {
|
|
|
417
401
|
|
|
418
402
|
// MARK: - Helper Extension
|
|
419
403
|
private extension View {
|
|
420
|
-
func
|
|
404
|
+
func applyPrimaryCursorColor() -> some View {
|
|
421
405
|
if #available(iOS 15.0, *) {
|
|
422
|
-
return self.tint(
|
|
406
|
+
return self.tint(Colors.primary)
|
|
423
407
|
} else {
|
|
424
408
|
return self
|
|
425
409
|
}
|
|
@@ -7,17 +7,15 @@
|
|
|
7
7
|
|
|
8
8
|
import SwiftUI
|
|
9
9
|
public struct InputPhoneNumber: View {
|
|
10
|
-
@Environment(\.appTheme) private var theme
|
|
11
10
|
@Binding public var text: String
|
|
12
11
|
|
|
13
12
|
public var placeholder: String
|
|
14
13
|
public var size: InputSize
|
|
15
14
|
public var hintText: String
|
|
16
15
|
public var error: String
|
|
17
|
-
public var errorSpacing: Bool
|
|
18
16
|
public var loading: Bool
|
|
19
17
|
public var rightIcon: String
|
|
20
|
-
public var rightIconColor: Color
|
|
18
|
+
public var rightIconColor: Color
|
|
21
19
|
public var autofocus: Bool
|
|
22
20
|
public var onChangeText: ((String) -> Void)?
|
|
23
21
|
public var onFocus: (() -> Void)?
|
|
@@ -33,11 +31,10 @@ public struct InputPhoneNumber: View {
|
|
|
33
31
|
size: InputSize = .small,
|
|
34
32
|
hintText: String = "",
|
|
35
33
|
error: String = "",
|
|
36
|
-
errorSpacing: Bool = false,
|
|
37
34
|
loading: Bool = false,
|
|
38
35
|
required: Bool = false,
|
|
39
36
|
rightIcon: String = "",
|
|
40
|
-
rightIconColor: Color
|
|
37
|
+
rightIconColor: Color = Colors.black12,
|
|
41
38
|
autofocus: Bool = false,
|
|
42
39
|
onChangeText: ((String) -> Void)? = nil,
|
|
43
40
|
onFocus: (() -> Void)? = nil,
|
|
@@ -50,7 +47,6 @@ public struct InputPhoneNumber: View {
|
|
|
50
47
|
self.size = size
|
|
51
48
|
self.hintText = hintText
|
|
52
49
|
self.error = error
|
|
53
|
-
self.errorSpacing = errorSpacing
|
|
54
50
|
self.loading = loading
|
|
55
51
|
self.rightIcon = rightIcon
|
|
56
52
|
self.rightIconColor = rightIconColor
|
|
@@ -80,17 +76,17 @@ public struct InputPhoneNumber: View {
|
|
|
80
76
|
.padding(.trailing, Spacing.XS)
|
|
81
77
|
|
|
82
78
|
MomoText("+84", typography: size == .small ? .headerSSemibold : .headerMBold)
|
|
83
|
-
.foregroundColor(
|
|
79
|
+
.foregroundColor(Colors.black17)
|
|
84
80
|
|
|
85
81
|
Rectangle()
|
|
86
|
-
.fill(
|
|
82
|
+
.fill(Colors.black04)
|
|
87
83
|
.frame(width: 1, height: size == .small ? 24 : 32)
|
|
88
84
|
.padding(.horizontal, Spacing.M)
|
|
89
85
|
|
|
90
86
|
// Text input
|
|
91
87
|
ZStack(alignment: .leading) {
|
|
92
88
|
if text.isEmpty {
|
|
93
|
-
MomoText(placeholder, typography: size == .small ? .headerSSemibold : .headerMBold, color:
|
|
89
|
+
MomoText(placeholder, typography: size == .small ? .headerSSemibold : .headerMBold, color: Colors.black12)
|
|
94
90
|
}
|
|
95
91
|
|
|
96
92
|
TextField("", text: textBinding, onEditingChanged: { focused in
|
|
@@ -99,8 +95,8 @@ public struct InputPhoneNumber: View {
|
|
|
99
95
|
.keyboardType(.numberPad)
|
|
100
96
|
.font(size == .small ? .header_s_semibold : .header_m_bold)
|
|
101
97
|
.ignoreBoldTextSetting()
|
|
102
|
-
.foregroundColor(
|
|
103
|
-
.
|
|
98
|
+
.foregroundColor(Colors.black17)
|
|
99
|
+
.applyPrimaryCursorColor()
|
|
104
100
|
.lineLimit(1)
|
|
105
101
|
.accessibility(identifier: accessibilityLabel ?? "")
|
|
106
102
|
.accessibilityValue(textBinding.wrappedValue.isEmpty ? placeholder : textBinding.wrappedValue)
|
|
@@ -112,7 +108,7 @@ public struct InputPhoneNumber: View {
|
|
|
112
108
|
text = ""
|
|
113
109
|
onChangeText?("")
|
|
114
110
|
}) {
|
|
115
|
-
Icon(source: "24_navigation_close_circle_full", size: 16, color:
|
|
111
|
+
Icon(source: "24_navigation_close_circle_full", size: 16, color: Colors.black12)
|
|
116
112
|
.padding(.leading, Spacing.S).accessibility(identifier: "ic_clear")
|
|
117
113
|
}
|
|
118
114
|
}
|
|
@@ -126,7 +122,7 @@ public struct InputPhoneNumber: View {
|
|
|
126
122
|
// ✅ Right icon
|
|
127
123
|
if !rightIcon.isEmpty {
|
|
128
124
|
SwiftUI.Button(action: { onRightIconPressed?() }) {
|
|
129
|
-
Icon(source: rightIcon, size: 24, color: rightIconColor
|
|
125
|
+
Icon(source: rightIcon, size: 24, color: rightIconColor)
|
|
130
126
|
.padding(.leading, Spacing.S)
|
|
131
127
|
}
|
|
132
128
|
}
|
|
@@ -135,7 +131,7 @@ public struct InputPhoneNumber: View {
|
|
|
135
131
|
.frame(height: scaleSize(size == .small ? 48 : 56, 1.1))
|
|
136
132
|
.background(
|
|
137
133
|
RoundedRectangle(cornerRadius: Radius.S)
|
|
138
|
-
.fill(
|
|
134
|
+
.fill(Colors.black01)
|
|
139
135
|
)
|
|
140
136
|
.overlay(
|
|
141
137
|
RoundedRectangle(cornerRadius: Radius.S)
|
|
@@ -145,7 +141,7 @@ public struct InputPhoneNumber: View {
|
|
|
145
141
|
// Error or hint
|
|
146
142
|
ErrorView(
|
|
147
143
|
errorMessage: error,
|
|
148
|
-
errorSpacing:
|
|
144
|
+
errorSpacing: false,
|
|
149
145
|
hintText: hintText
|
|
150
146
|
)
|
|
151
147
|
}
|
|
@@ -163,18 +159,21 @@ public struct InputPhoneNumber: View {
|
|
|
163
159
|
}
|
|
164
160
|
|
|
165
161
|
private func borderColor() -> Color {
|
|
166
|
-
if !error.isEmpty { return
|
|
167
|
-
if isFocused { return
|
|
168
|
-
return
|
|
162
|
+
if !error.isEmpty { return Colors.red03 }
|
|
163
|
+
if isFocused { return Colors.primary }
|
|
164
|
+
return Colors.black04
|
|
169
165
|
}
|
|
170
166
|
}
|
|
171
167
|
|
|
172
168
|
private extension View {
|
|
173
|
-
func
|
|
169
|
+
func applyPrimaryCursorColor() -> some View {
|
|
174
170
|
if #available(iOS 15.0, *) {
|
|
175
|
-
|
|
171
|
+
// Modern SwiftUI: use .tint() for cursor
|
|
172
|
+
return self.tint(Colors.primary)
|
|
176
173
|
} else {
|
|
174
|
+
// iOS 13–14: return unchanged (no tint support)
|
|
177
175
|
return self
|
|
178
176
|
}
|
|
179
177
|
}
|
|
180
178
|
}
|
|
179
|
+
|