@momo-kits/native-kits 0.163.1-beta.8 → 0.163.1-beta.9-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/OsFontScale.android.kt +7 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +150 -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 +106 -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 +110 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +378 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/WidgetContainer.kt +56 -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 +125 -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 +21 -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/KitFontScale.kt +22 -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 +276 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +65 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +48 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +51 -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 +172 -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 +91 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/OsFontScale.kt +9 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +69 -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/OsFontScale.ios.kt +66 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +207 -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 +15 -2
- package/ios/Application/Components.swift +50 -44
- package/ios/Application/FloatingButton.swift +10 -9
- package/ios/Application/HeaderRight.swift +79 -45
- package/ios/Application/Localize.swift +277 -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 +200 -0
- package/ios/Application/Navigation/NavigationOptions.swift +109 -0
- package/ios/Application/Navigation/Navigator.swift +385 -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/Screen.swift +2 -1
- package/ios/Application/StackScreen.swift +501 -0
- package/ios/Avatar/Avatar.swift +193 -0
- package/ios/Badge/Badge.swift +11 -14
- package/ios/Badge/BadgeRibbon.swift +92 -21
- package/ios/BaselineView/BaselineView.swift +163 -0
- package/ios/Button/Button.swift +124 -29
- package/ios/Carousel/Carousel.swift +196 -0
- package/ios/Checkbox/Checkbox.swift +23 -28
- package/ios/Chip/Chip.swift +56 -33
- package/ios/Collapse/Collapse.swift +192 -0
- package/ios/Colors+Radius+Spacing/Colors.swift +20 -17
- package/ios/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 +10 -1
- package/ios/IconButton/IconButton.swift +140 -0
- package/ios/Image/Image.swift +16 -3
- package/ios/Information/Information.swift +3 -1
- package/ios/Input/ErrorView.swift +3 -1
- package/ios/Input/Input.swift +72 -33
- package/ios/Input/InputPhoneNumber.swift +33 -21
- package/ios/Input/InputSearch.swift +107 -48
- package/ios/Input/InputTextArea.swift +134 -64
- package/ios/InputDropDown/InputDropDown.swift +201 -0
- package/ios/InputMoney/InputMoney.swift +347 -0
- package/ios/InputOTP/InputOTP.swift +210 -0
- package/ios/Loader/Loader.swift +113 -0
- package/ios/MoMoUIKits.podspec +5 -0
- 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 +11 -20
- package/ios/Popup/PopupInput.swift +2 -8
- package/ios/Popup/PopupNotify.swift +218 -0
- package/ios/Popup/PopupPromotion.swift +16 -8
- package/ios/ProgressInfo/ProgressInfo.swift +296 -0
- package/ios/Radio/Radio.swift +69 -0
- package/ios/Rating/Rating.swift +82 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/AccentColor.colorset/Contents.json +11 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Background.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Border.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Card.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Contents.json +6 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Error.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Primary.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/PrimaryDark.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/PrimaryLight.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Secondary.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Success.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Text.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/TextSecondary.colorset/Contents.json +38 -0
- 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/Resources/MoMoUIKitsColors.xcassets/Warning.colorset/Contents.json +38 -0
- package/ios/Skeleton/Skeleton.swift +99 -0
- package/ios/Slider/Slider.swift +237 -0
- package/ios/Stepper/Stepper.swift +220 -0
- package/ios/Steps/Steps.swift +467 -0
- package/ios/SuggestAction/SuggestAction.swift +99 -0
- package/ios/Swipeable/SwipeCell.swift +187 -0
- package/ios/Swipeable/SwipeCellModel.swift +21 -0
- package/ios/Switch/Switch.swift +53 -28
- package/ios/TabView/TabView.swift +534 -0
- package/ios/Tag/Tag.swift +98 -0
- package/ios/Template/TrustBanner/TrustBanner.swift +6 -7
- package/ios/Title/Title.swift +269 -0
- package/ios/Tooltip/Tooltip.swift +485 -0
- package/ios/Typography/FontScaleStore.swift +19 -0
- package/ios/Typography/Text.swift +79 -5
- package/ios/Typography/Typography.swift +3 -0
- package/ios/Uploader/Uploader.swift +174 -0
- package/ios/native-kits.podspec +61 -8
- package/ios-demo/MoMoUIKitsDemo.podspec +20 -0
- package/ios-demo/README.md +120 -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 +93 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BadgeDemo.swift +269 -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 +100 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CarouselDemo.swift +126 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CheckboxDemo.swift +63 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ChipDemo.swift +20 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CollapseDemo.swift +93 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ContentView.swift +107 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DateTimePickerDemo.swift +124 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DividerDemo.swift +14 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/HeaderUserDemo.swift +49 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/Home.swift +279 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/IconButtonDemo.swift +58 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ImageDemo.swift +78 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InformationDemo.swift +138 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputDemo.swift +111 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputDropDownDemo.swift +136 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputMoneyDemo.swift +107 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputOTPDemo.swift +73 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputPhoneNumberDemo.swift +100 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputSearchDemo.swift +32 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputTextAreaDemo.swift +57 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/LoaderDemo.swift +70 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/LocalizeDemo.swift +188 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift +229 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PaginationDemo.swift +72 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupDisplayDemo.swift +175 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupNotifyDemo.swift +121 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupPromotionDemo.swift +76 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ProgressInfoDemo.swift +89 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/RadioDemo.swift +32 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/RatingDemo.swift +56 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SkeletonDemo.swift +32 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SliderDemo.swift +150 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SnackBarDemo.swift +138 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/StepperDemo.swift +103 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/StepsDemo.swift +94 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SuggestActionDemo.swift +79 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SwipeDemo.swift +152 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SwitchDemo.swift +33 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TabViewDemo.swift +190 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TagDemo.swift +34 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ThemeDemo.swift +182 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TitleDemo.swift +109 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TooltipDemo.swift +187 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TypographyDemo.swift +87 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/UploaderDemo.swift +131 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SwiftUIDemoBrowserView.swift +51 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/UIKitsDemoModels.swift +15 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/UIKitsDemoRegistry.swift +73 -0
- package/local.properties +8 -0
- package/package.json +1 -1
- package/publish.sh +53 -0
- package/scripts/gen-ios-color.mjs +136 -0
- package/settings.gradle.kts +64 -0
- package/.claude/settings.local.json +0 -62
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
//
|
|
2
|
+
// StepperDemo.swift
|
|
3
|
+
// Example
|
|
4
|
+
//
|
|
5
|
+
|
|
6
|
+
import Foundation
|
|
7
|
+
import MoMoUIKits
|
|
8
|
+
import SwiftUI
|
|
9
|
+
|
|
10
|
+
// MARK: - StepperDemo
|
|
11
|
+
|
|
12
|
+
struct StepperDemo: View {
|
|
13
|
+
@State private var sizeLarge = 5
|
|
14
|
+
@State private var sizeSmall = 5
|
|
15
|
+
|
|
16
|
+
@State private var def0 = 0
|
|
17
|
+
@State private var def50 = 50
|
|
18
|
+
@State private var def100 = 100
|
|
19
|
+
|
|
20
|
+
@State private var customStep5 = 0
|
|
21
|
+
@State private var customStep10 = 10
|
|
22
|
+
|
|
23
|
+
@State private var editableLarge = 5
|
|
24
|
+
@State private var editableSmall = 5
|
|
25
|
+
|
|
26
|
+
@State private var disabledAllLarge = 5
|
|
27
|
+
@State private var disabledAllSmall = 5
|
|
28
|
+
|
|
29
|
+
@State private var disabledMinus = 5
|
|
30
|
+
@State private var disabledPlus = 5
|
|
31
|
+
|
|
32
|
+
@State private var boundLow = 0
|
|
33
|
+
@State private var boundHigh = 10
|
|
34
|
+
|
|
35
|
+
var body: some View {
|
|
36
|
+
ScrollView {
|
|
37
|
+
VStack(alignment: .leading, spacing: 24) {
|
|
38
|
+
section("Size") {
|
|
39
|
+
MomoStepper(value: $sizeLarge, size: .large)
|
|
40
|
+
MomoStepper(value: $sizeSmall, size: .small)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
section("Default (min=0, max=100, step=1)") {
|
|
44
|
+
MomoStepper(value: $def0)
|
|
45
|
+
MomoStepper(value: $def50)
|
|
46
|
+
MomoStepper(value: $def100)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
section("Custom step") {
|
|
50
|
+
MomoStepper(value: $customStep5, min: 0, max: 50, step: 5)
|
|
51
|
+
MomoStepper(value: $customStep10, min: 0, max: 100, step: 10)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
section("Editable") {
|
|
55
|
+
MomoStepper(value: $editableLarge, editable: true)
|
|
56
|
+
MomoStepper(value: $editableSmall, size: .small, editable: true)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
section("Disabled — all") {
|
|
60
|
+
MomoStepper(value: $disabledAllLarge, disabled: true)
|
|
61
|
+
MomoStepper(value: $disabledAllSmall, size: .small, disabled: true)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
section("Disabled — minus only") {
|
|
65
|
+
MomoStepper(value: $disabledMinus, disabled: StepperDisabled(minus: true, plus: false))
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
section("Disabled — plus only") {
|
|
69
|
+
MomoStepper(value: $disabledPlus, disabled: StepperDisabled(minus: false, plus: true))
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
section("Auto-disabled at bounds") {
|
|
73
|
+
MomoStepper(value: $boundLow, min: 0, max: 10)
|
|
74
|
+
MomoStepper(value: $boundHigh, min: 0, max: 10)
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
.padding(.vertical, 16)
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// MARK: - Helpers
|
|
82
|
+
|
|
83
|
+
@ViewBuilder
|
|
84
|
+
private func section<Content: View>(
|
|
85
|
+
_ title: String,
|
|
86
|
+
@ViewBuilder content: () -> Content
|
|
87
|
+
) -> some View {
|
|
88
|
+
VStack(alignment: .leading, spacing: 12) {
|
|
89
|
+
Text(title)
|
|
90
|
+
.font(.headline)
|
|
91
|
+
content()
|
|
92
|
+
}
|
|
93
|
+
.padding(.horizontal, 16)
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
#if DEBUG
|
|
98
|
+
struct StepperDemo_Previews: PreviewProvider {
|
|
99
|
+
static var previews: some View {
|
|
100
|
+
StepperDemo()
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
#endif
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
//
|
|
2
|
+
// StepsDemo.swift
|
|
3
|
+
// Example
|
|
4
|
+
//
|
|
5
|
+
// Usage demo for the Steps progress indicator. Mirrors Compose's `StepsUsage`
|
|
6
|
+
// preview cases: vertical/horizontal, sizes, error, use-number, alignments,
|
|
7
|
+
// disabled and time labels.
|
|
8
|
+
//
|
|
9
|
+
|
|
10
|
+
import MoMoUIKits
|
|
11
|
+
import SwiftUI
|
|
12
|
+
|
|
13
|
+
private let sampleSteps: [StepItem] = [
|
|
14
|
+
StepItem(title: "Order placed", description: "Your order has been received", time: "09:00"),
|
|
15
|
+
StepItem(title: "Processing", description: "We are preparing your order", time: "09:15"),
|
|
16
|
+
StepItem(title: "Shipped", description: "Your order is on the way", time: "10:30"),
|
|
17
|
+
StepItem(title: "Delivered", description: "Package delivered successfully", time: "14:00"),
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
private let shortSteps: [StepItem] = [
|
|
21
|
+
StepItem(title: "Step 1"),
|
|
22
|
+
StepItem(title: "Step 2"),
|
|
23
|
+
StepItem(title: "Step 3"),
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
private let stepsWithError: [StepItem] = [
|
|
27
|
+
StepItem(title: "Verified"),
|
|
28
|
+
StepItem(title: "Payment", error: true),
|
|
29
|
+
StepItem(title: "Complete"),
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
struct StepsDemo: View {
|
|
33
|
+
var body: some View {
|
|
34
|
+
ScrollView {
|
|
35
|
+
VStack(alignment: .leading, spacing: 24) {
|
|
36
|
+
section("Vertical — Large (default)") {
|
|
37
|
+
Steps(steps: sampleSteps, activeIndex: 1)
|
|
38
|
+
}
|
|
39
|
+
section("Vertical — Small") {
|
|
40
|
+
Steps(steps: sampleSteps, activeIndex: 2, size: .small)
|
|
41
|
+
}
|
|
42
|
+
section("Vertical — With error") {
|
|
43
|
+
Steps(steps: stepsWithError, activeIndex: 1)
|
|
44
|
+
}
|
|
45
|
+
section("Vertical — Use number") {
|
|
46
|
+
Steps(steps: shortSteps, activeIndex: 1, useNumber: true)
|
|
47
|
+
}
|
|
48
|
+
section("Vertical — Disabled") {
|
|
49
|
+
Steps(steps: sampleSteps, activeIndex: 1, disabled: true)
|
|
50
|
+
}
|
|
51
|
+
section("Horizontal — Center (default)") {
|
|
52
|
+
Steps(steps: shortSteps, activeIndex: 1, horizontal: true)
|
|
53
|
+
}
|
|
54
|
+
section("Horizontal — With time") {
|
|
55
|
+
Steps(steps: sampleSteps, activeIndex: 2, horizontal: true)
|
|
56
|
+
}
|
|
57
|
+
section("Horizontal — Align Left") {
|
|
58
|
+
Steps(steps: shortSteps, activeIndex: 0, horizontal: true, align: .left)
|
|
59
|
+
}
|
|
60
|
+
section("Horizontal — Align Right") {
|
|
61
|
+
Steps(steps: shortSteps, activeIndex: 2, horizontal: true, align: .right)
|
|
62
|
+
}
|
|
63
|
+
section("Horizontal — Align Stretch") {
|
|
64
|
+
Steps(steps: shortSteps, activeIndex: 1, horizontal: true, align: .stretch)
|
|
65
|
+
}
|
|
66
|
+
section("Horizontal — Small + Use number") {
|
|
67
|
+
Steps(
|
|
68
|
+
steps: shortSteps,
|
|
69
|
+
activeIndex: 1,
|
|
70
|
+
horizontal: true,
|
|
71
|
+
size: .small,
|
|
72
|
+
useNumber: true
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
section("Horizontal — With error") {
|
|
76
|
+
Steps(steps: stepsWithError, activeIndex: 1, horizontal: true)
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
.padding(16)
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@ViewBuilder
|
|
84
|
+
private func section<Content: View>(
|
|
85
|
+
_ title: String,
|
|
86
|
+
@ViewBuilder content: () -> Content
|
|
87
|
+
) -> some View {
|
|
88
|
+
VStack(alignment: .leading, spacing: 12) {
|
|
89
|
+
MomoText(title, typography: .headerSSemibold, color: Colors.text)
|
|
90
|
+
content()
|
|
91
|
+
}
|
|
92
|
+
.frame(maxWidth: .infinity, alignment: .leading)
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import SwiftUI
|
|
2
|
+
import MoMoUIKits
|
|
3
|
+
|
|
4
|
+
struct SuggestActionDemo: View {
|
|
5
|
+
@State private var visible1 = true
|
|
6
|
+
@State private var visible2 = true
|
|
7
|
+
@State private var visible3 = true
|
|
8
|
+
@State private var visible4 = true
|
|
9
|
+
|
|
10
|
+
var body: some View {
|
|
11
|
+
ScrollView {
|
|
12
|
+
VStack(alignment: .leading, spacing: 24) {
|
|
13
|
+
section("Default") {
|
|
14
|
+
SuggestAction(
|
|
15
|
+
message: "You have a new suggestion available for you.",
|
|
16
|
+
buttonTitle: "View",
|
|
17
|
+
visible: visible1,
|
|
18
|
+
onClose: { visible1 = false },
|
|
19
|
+
onPressButton: { visible1 = false }
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
section("With bold message") {
|
|
24
|
+
SuggestAction(
|
|
25
|
+
message: "You have a new suggestion available for you.",
|
|
26
|
+
buttonTitle: "View",
|
|
27
|
+
boldMessage: "new suggestion",
|
|
28
|
+
visible: visible2,
|
|
29
|
+
onClose: { visible2 = false },
|
|
30
|
+
onPressButton: { visible2 = false }
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
section("With image") {
|
|
35
|
+
SuggestAction(
|
|
36
|
+
message: "Complete your profile to unlock more features.",
|
|
37
|
+
buttonTitle: "Go",
|
|
38
|
+
boldMessage: "Complete",
|
|
39
|
+
image: "https://static.momocdn.net/app/img/kits/trustBanner/ic_secu.png",
|
|
40
|
+
visible: visible3,
|
|
41
|
+
onClose: { visible3 = false },
|
|
42
|
+
onPressButton: { visible3 = false }
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
section("Short message") {
|
|
47
|
+
SuggestAction(
|
|
48
|
+
message: "Update available.",
|
|
49
|
+
buttonTitle: "Update",
|
|
50
|
+
visible: visible4,
|
|
51
|
+
onClose: { visible4 = false },
|
|
52
|
+
onPressButton: { visible4 = false }
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
Button(
|
|
57
|
+
title: "Reset all",
|
|
58
|
+
action: {
|
|
59
|
+
visible1 = true
|
|
60
|
+
visible2 = true
|
|
61
|
+
visible3 = true
|
|
62
|
+
visible4 = true
|
|
63
|
+
},
|
|
64
|
+
type: .primary,
|
|
65
|
+
isFull: false
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
.padding()
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@ViewBuilder
|
|
73
|
+
private func section<Content: View>(_ title: String, @ViewBuilder content: () -> Content) -> some View {
|
|
74
|
+
VStack(alignment: .leading, spacing: 8) {
|
|
75
|
+
MomoText(title, typography: .headerSSemibold, color: Colors.textSecondary)
|
|
76
|
+
content()
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import MoMoUIKits
|
|
2
|
+
import SwiftUI
|
|
3
|
+
|
|
4
|
+
struct SwipeDemo: View {
|
|
5
|
+
@State private var showLeftActions = true
|
|
6
|
+
@State private var showRightActions = true
|
|
7
|
+
@State private var heightValue: Double = 56
|
|
8
|
+
@State private var radiusValue: Double = 0
|
|
9
|
+
@State private var lastAction = "No action yet"
|
|
10
|
+
|
|
11
|
+
private var editAction: SwipeAction {
|
|
12
|
+
SwipeAction(
|
|
13
|
+
label: "Edit",
|
|
14
|
+
icon: "24_basic_copy",
|
|
15
|
+
backgroundColor: Colors.blue03,
|
|
16
|
+
onPress: { lastAction = "Edit pressed" }
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
private var deleteAction: SwipeAction {
|
|
21
|
+
SwipeAction(
|
|
22
|
+
label: "Delete",
|
|
23
|
+
icon: "24_basic_delete",
|
|
24
|
+
backgroundColor: Colors.red03,
|
|
25
|
+
onPress: { lastAction = "Delete pressed" }
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
private var archiveAction: SwipeAction {
|
|
30
|
+
SwipeAction(
|
|
31
|
+
label: "Archive",
|
|
32
|
+
icon: "24_basic_flag",
|
|
33
|
+
backgroundColor: Colors.orange03,
|
|
34
|
+
onPress: { lastAction = "Archive pressed" }
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
var body: some View {
|
|
39
|
+
ScrollView {
|
|
40
|
+
VStack(alignment: .leading, spacing: Spacing.XL) {
|
|
41
|
+
preview
|
|
42
|
+
Divider()
|
|
43
|
+
playground
|
|
44
|
+
}
|
|
45
|
+
.padding(.vertical, Spacing.L)
|
|
46
|
+
}
|
|
47
|
+
.background(Colors.background)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
private var preview: some View {
|
|
51
|
+
VStack(alignment: .leading, spacing: Spacing.XL) {
|
|
52
|
+
section("Right actions only") {
|
|
53
|
+
Swipe(rightActions: [deleteAction]) {
|
|
54
|
+
swipeContent("Swipe left to delete")
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
section("Left actions only") {
|
|
59
|
+
Swipe(leftActions: [editAction, archiveAction]) {
|
|
60
|
+
swipeContent("Swipe right for actions")
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
section("Both sides") {
|
|
65
|
+
Swipe(leftActions: [editAction], rightActions: [deleteAction]) {
|
|
66
|
+
swipeContent("Swipe both directions")
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
section("Multiple right actions") {
|
|
71
|
+
Swipe(rightActions: [editAction, archiveAction, deleteAction]) {
|
|
72
|
+
swipeContent("3 right actions")
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
section("With itemRadius") {
|
|
77
|
+
Swipe(rightActions: [deleteAction], itemRadius: Radius.S) {
|
|
78
|
+
swipeContent("Rounded corners")
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
section("Custom height") {
|
|
83
|
+
Swipe(rightActions: [deleteAction], height: 80) {
|
|
84
|
+
swipeContent("Taller row (80dp)")
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
private var playground: some View {
|
|
91
|
+
section("Playground") {
|
|
92
|
+
Toggle(isOn: $showLeftActions) {
|
|
93
|
+
MomoText("Show Left Actions", typography: .labelSMedium, color: Colors.text)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
Toggle(isOn: $showRightActions) {
|
|
97
|
+
MomoText("Show Right Actions", typography: .labelSMedium, color: Colors.text)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
VStack(alignment: .leading, spacing: Spacing.XS) {
|
|
101
|
+
MomoText("Height: \(Int(heightValue))", typography: .labelSMedium, color: Colors.textSecondary)
|
|
102
|
+
Slider(value: $heightValue, in: 40...100, step: 1)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
VStack(alignment: .leading, spacing: Spacing.XS) {
|
|
106
|
+
MomoText("Item Radius: \(Int(radiusValue))", typography: .labelSMedium, color: Colors.textSecondary)
|
|
107
|
+
Slider(value: $radiusValue, in: 0...24, step: 1)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
Swipe(
|
|
111
|
+
leftActions: showLeftActions ? [editAction, archiveAction] : [],
|
|
112
|
+
rightActions: showRightActions ? [deleteAction] : [],
|
|
113
|
+
height: CGFloat(heightValue),
|
|
114
|
+
itemRadius: CGFloat(radiusValue)
|
|
115
|
+
) {
|
|
116
|
+
swipeContent("Swipe me!")
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
MomoText(lastAction, typography: .descriptionDefaultRegular, color: Colors.textSecondary)
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
@ViewBuilder
|
|
124
|
+
private func section<Content: View>(
|
|
125
|
+
_ title: String,
|
|
126
|
+
@ViewBuilder content: () -> Content
|
|
127
|
+
) -> some View {
|
|
128
|
+
VStack(alignment: .leading, spacing: Spacing.M) {
|
|
129
|
+
MomoText(title, typography: .headerSSemibold, color: Colors.text)
|
|
130
|
+
content()
|
|
131
|
+
}
|
|
132
|
+
.padding(.horizontal, Spacing.M)
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
private func swipeContent(_ text: String) -> some View {
|
|
136
|
+
HStack {
|
|
137
|
+
MomoText(text, typography: .bodyDefaultRegular, color: Colors.text)
|
|
138
|
+
Spacer(minLength: 0)
|
|
139
|
+
}
|
|
140
|
+
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
|
141
|
+
.padding(.horizontal, Spacing.M)
|
|
142
|
+
.background(Colors.card)
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
#if DEBUG
|
|
147
|
+
struct SwipeDemo_Previews: PreviewProvider {
|
|
148
|
+
static var previews: some View {
|
|
149
|
+
SwipeDemo()
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
#endif
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//
|
|
2
|
+
// SwitchDemo.swift
|
|
3
|
+
// Example
|
|
4
|
+
//
|
|
5
|
+
// Created by dung.pham2 on 3/12/24.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import SwiftUI
|
|
9
|
+
import MoMoUIKits
|
|
10
|
+
|
|
11
|
+
struct SwitchDemo: View {
|
|
12
|
+
@State private var checked = false
|
|
13
|
+
|
|
14
|
+
var body: some View {
|
|
15
|
+
VStack(alignment: .leading, spacing: 8) {
|
|
16
|
+
Text("Value")
|
|
17
|
+
Switch($checked, onChange: { newValue in
|
|
18
|
+
checked = newValue
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
Text("Disabled")
|
|
23
|
+
Switch( .constant(true), disabled: true, onChange: { _ in
|
|
24
|
+
checked = !checked
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
Switch( .constant(false), disabled: true, onChange: { _ in
|
|
28
|
+
checked = !checked
|
|
29
|
+
})
|
|
30
|
+
}
|
|
31
|
+
.padding()
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
//
|
|
2
|
+
// TabViewDemo.swift
|
|
3
|
+
// Example
|
|
4
|
+
//
|
|
5
|
+
|
|
6
|
+
import Foundation
|
|
7
|
+
import MoMoUIKits
|
|
8
|
+
import SwiftUI
|
|
9
|
+
|
|
10
|
+
// MARK: - TabViewDemo
|
|
11
|
+
|
|
12
|
+
struct TabViewDemo: View {
|
|
13
|
+
var body: some View {
|
|
14
|
+
ScrollView {
|
|
15
|
+
VStack(alignment: .leading, spacing: 24) {
|
|
16
|
+
section("Default (2 tabs)") {
|
|
17
|
+
MomoTabView(
|
|
18
|
+
tabs: [
|
|
19
|
+
TabViewItem(title: "Tab 1") { tabContent("Content 1", Colors.pink09) },
|
|
20
|
+
TabViewItem(title: "Tab 2") { tabContent("Content 2", Colors.blue08) },
|
|
21
|
+
]
|
|
22
|
+
)
|
|
23
|
+
.frame(height: 160)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
section("Default (3 tabs)") {
|
|
27
|
+
MomoTabView(
|
|
28
|
+
tabs: [
|
|
29
|
+
TabViewItem(title: "Overview") { tabContent("Overview", Colors.pink09) },
|
|
30
|
+
TabViewItem(title: "Activity") { tabContent("Activity", Colors.blue08) },
|
|
31
|
+
TabViewItem(title: "Settings") { tabContent("Settings", Colors.green08) },
|
|
32
|
+
]
|
|
33
|
+
)
|
|
34
|
+
.frame(height: 160)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
section("With badge & dot") {
|
|
38
|
+
MomoTabView(
|
|
39
|
+
tabs: [
|
|
40
|
+
TabViewItem(title: "Inbox", badgeValue: "5") { tabContent("Inbox", Colors.orange08) },
|
|
41
|
+
TabViewItem(title: "Alerts", showDot: true, dotSize: .small) { tabContent("Alerts", Colors.red08) },
|
|
42
|
+
TabViewItem(title: "Done") { tabContent("Done", Colors.green08) },
|
|
43
|
+
]
|
|
44
|
+
)
|
|
45
|
+
.frame(height: 160)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
section("Scrollable (many tabs)") {
|
|
49
|
+
MomoTabView(
|
|
50
|
+
tabs: [
|
|
51
|
+
TabViewItem(title: "Monday") { tabContent("Monday", Colors.pink09) },
|
|
52
|
+
TabViewItem(title: "Tuesday") { tabContent("Tuesday", Colors.blue08) },
|
|
53
|
+
TabViewItem(title: "Wednesday") { tabContent("Wednesday", Colors.green08) },
|
|
54
|
+
TabViewItem(title: "Thursday") { tabContent("Thursday", Colors.orange08) },
|
|
55
|
+
TabViewItem(title: "Friday") { tabContent("Friday", Colors.mint08) },
|
|
56
|
+
TabViewItem(title: "Saturday") { tabContent("Saturday", Colors.red08) },
|
|
57
|
+
TabViewItem(title: "Sunday") { tabContent("Sunday", Colors.pink09) },
|
|
58
|
+
],
|
|
59
|
+
scrollable: true,
|
|
60
|
+
selectedColor: Colors.pink01,
|
|
61
|
+
unselectedColor: Colors.blue07
|
|
62
|
+
)
|
|
63
|
+
.frame(height: 160)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
section("Card type") {
|
|
67
|
+
MomoTabView(
|
|
68
|
+
tabs: [
|
|
69
|
+
TabViewItem(title: "Personal") { tabContent("Personal", Colors.pink09) },
|
|
70
|
+
TabViewItem(title: "Business") { tabContent("Business", Colors.blue08) },
|
|
71
|
+
TabViewItem(title: "Savings") { tabContent("Savings", Colors.green08) },
|
|
72
|
+
],
|
|
73
|
+
type: .card
|
|
74
|
+
)
|
|
75
|
+
.frame(height: 160)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
section("Card type with icon") {
|
|
79
|
+
MomoTabView(
|
|
80
|
+
tabs: [
|
|
81
|
+
TabViewItem(title: "Home", icon: "basic_home") { tabContent("Home", Colors.pink09) },
|
|
82
|
+
TabViewItem(title: "Search", icon: "basic_search") { tabContent("Search", Colors.blue08) },
|
|
83
|
+
],
|
|
84
|
+
type: .card
|
|
85
|
+
)
|
|
86
|
+
.frame(height: 160)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
section("Column direction") {
|
|
90
|
+
MomoTabView(
|
|
91
|
+
tabs: [
|
|
92
|
+
TabViewItem(title: "Home", icon: "basic_home") { tabContent("Home", Colors.pink09) },
|
|
93
|
+
TabViewItem(title: "Search", icon: "basic_search") { tabContent("Search", Colors.blue08) },
|
|
94
|
+
TabViewItem(title: "Profile", icon: "basic_user") { tabContent("Profile", Colors.green08) },
|
|
95
|
+
],
|
|
96
|
+
direction: .column
|
|
97
|
+
)
|
|
98
|
+
.frame(height: 200)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
section("Custom renderIcon") {
|
|
102
|
+
MomoTabView(
|
|
103
|
+
tabs: [
|
|
104
|
+
TabViewItem(
|
|
105
|
+
title: "Custom",
|
|
106
|
+
renderIcon: { active in
|
|
107
|
+
AnyView(
|
|
108
|
+
RoundedRectangle(cornerRadius: 12)
|
|
109
|
+
.fill(active ? Colors.pink09 : Colors.black17)
|
|
110
|
+
.frame(width: 24, height: 24)
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
) { tabContent("Custom Icon", Colors.pink09) },
|
|
114
|
+
TabViewItem(title: "Normal", icon: "basic_search") { tabContent("Normal", Colors.blue08) },
|
|
115
|
+
]
|
|
116
|
+
)
|
|
117
|
+
.frame(height: 160)
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
section("Swipe enabled") {
|
|
121
|
+
MomoTabView(
|
|
122
|
+
tabs: [
|
|
123
|
+
TabViewItem(title: "Swipe 1") { tabContent("Swipe left/right", Colors.pink09) },
|
|
124
|
+
TabViewItem(title: "Swipe 2") { tabContent("Swipeable!", Colors.blue08) },
|
|
125
|
+
],
|
|
126
|
+
userScrollEnabled: true
|
|
127
|
+
)
|
|
128
|
+
.frame(height: 160)
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
section("Column direction card type") {
|
|
132
|
+
MomoTabView(
|
|
133
|
+
tabs: [
|
|
134
|
+
TabViewItem(title: "Personal", icon: "basic_home") { tabContent("Personal", Colors.pink09) },
|
|
135
|
+
TabViewItem(title: "Business", icon: "basic_search") { tabContent("Business", Colors.blue08) },
|
|
136
|
+
],
|
|
137
|
+
type: .card,
|
|
138
|
+
direction: .column
|
|
139
|
+
)
|
|
140
|
+
.frame(height: 200)
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
section("fitContent (no pager)") {
|
|
144
|
+
MomoTabView(
|
|
145
|
+
tabs: [
|
|
146
|
+
TabViewItem(title: "Tab A") { tabContent("Tab A content", Colors.pink09) },
|
|
147
|
+
TabViewItem(title: "Tab B") { tabContent("Tab B content", Colors.blue08) },
|
|
148
|
+
TabViewItem(title: "Tab C") { tabContent("Tab C content", Colors.green08) },
|
|
149
|
+
],
|
|
150
|
+
fitContent: true
|
|
151
|
+
)
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
.padding(.vertical, 16)
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// MARK: - Helpers
|
|
159
|
+
|
|
160
|
+
@ViewBuilder
|
|
161
|
+
private func section<Content: View>(
|
|
162
|
+
_ title: String,
|
|
163
|
+
@ViewBuilder content: () -> Content
|
|
164
|
+
) -> some View {
|
|
165
|
+
VStack(alignment: .leading, spacing: 12) {
|
|
166
|
+
Text(title)
|
|
167
|
+
.font(.headline)
|
|
168
|
+
content()
|
|
169
|
+
}
|
|
170
|
+
.padding(.horizontal, 16)
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
@ViewBuilder
|
|
174
|
+
private func tabContent(_ label: String, _ background: Color) -> some View {
|
|
175
|
+
ZStack {
|
|
176
|
+
background
|
|
177
|
+
MomoText(label, typography: .headerSSemibold, color: Colors.text)
|
|
178
|
+
}
|
|
179
|
+
.frame(maxWidth: .infinity)
|
|
180
|
+
.frame(height: 120)
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
#if DEBUG
|
|
185
|
+
struct TabViewDemo_Previews: PreviewProvider {
|
|
186
|
+
static var previews: some View {
|
|
187
|
+
TabViewDemo()
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
#endif
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import SwiftUI
|
|
2
|
+
import MoMoUIKits
|
|
3
|
+
|
|
4
|
+
struct TagDemo: View {
|
|
5
|
+
var body: some View {
|
|
6
|
+
ScrollView {
|
|
7
|
+
VStack(alignment: .leading, spacing: 24) {
|
|
8
|
+
VStack(alignment: .leading, spacing: 8) {
|
|
9
|
+
Text("Color").font(.headline)
|
|
10
|
+
Tag()
|
|
11
|
+
Tag(color: .red)
|
|
12
|
+
Tag(color: .blue)
|
|
13
|
+
Tag(color: .green)
|
|
14
|
+
Tag(color: .orange)
|
|
15
|
+
Tag(color: .grey)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
VStack(alignment: .leading, spacing: 8) {
|
|
19
|
+
Text("Size").font(.headline)
|
|
20
|
+
Tag(size: .large)
|
|
21
|
+
Tag(size: .medium)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
VStack(alignment: .leading, spacing: 8) {
|
|
25
|
+
Text("With Icon").font(.headline)
|
|
26
|
+
Tag(icon: "ic_momo", color: .grey)
|
|
27
|
+
Tag(icon: "ic_momo", color: .red, size: .medium)
|
|
28
|
+
Tag(icon: "ic_momo", color: .blue, size: .medium)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
.padding()
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|