@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
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// TitleDemo.swift
|
|
3
|
-
// Example
|
|
4
|
-
//
|
|
5
|
-
import SwiftUI
|
|
6
|
-
import MoMoUIKits
|
|
7
|
-
|
|
8
|
-
struct TitleDemo: View {
|
|
9
|
-
var body: some View {
|
|
10
|
-
ScrollView {
|
|
11
|
-
VStack(alignment: .leading, spacing: 24) {
|
|
12
|
-
section("Section Type") {
|
|
13
|
-
Title(
|
|
14
|
-
title: "Section Small",
|
|
15
|
-
type: .section,
|
|
16
|
-
size: .small
|
|
17
|
-
)
|
|
18
|
-
Title(
|
|
19
|
-
title: "Section Medium",
|
|
20
|
-
type: .section,
|
|
21
|
-
size: .medium,
|
|
22
|
-
icon: "basic_home",
|
|
23
|
-
description: "This is a medium section with icon."
|
|
24
|
-
)
|
|
25
|
-
Title(
|
|
26
|
-
title: "Section Large",
|
|
27
|
-
type: .section,
|
|
28
|
-
size: .large,
|
|
29
|
-
showTrailingAction: true,
|
|
30
|
-
badgeLabel: "NEW",
|
|
31
|
-
onPressTrailingAction: { }
|
|
32
|
-
)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
section("Card Type") {
|
|
36
|
-
Title(
|
|
37
|
-
title: "Card Small Text Only",
|
|
38
|
-
type: .card,
|
|
39
|
-
size: .small,
|
|
40
|
-
textOnly: true
|
|
41
|
-
)
|
|
42
|
-
Title(
|
|
43
|
-
title: "Card Medium with Right Action",
|
|
44
|
-
type: .card,
|
|
45
|
-
size: .medium,
|
|
46
|
-
icon: "basic_home",
|
|
47
|
-
showRightAction: true,
|
|
48
|
-
buttonTitle: "Action",
|
|
49
|
-
onPressRightAction: { }
|
|
50
|
-
)
|
|
51
|
-
Title(
|
|
52
|
-
title: "Card Large Full",
|
|
53
|
-
type: .card,
|
|
54
|
-
size: .large,
|
|
55
|
-
icon: "basic_home",
|
|
56
|
-
showRightAction: true,
|
|
57
|
-
badgeLabel: "99+",
|
|
58
|
-
onPressRightAction: { },
|
|
59
|
-
description: "A large card title with description, badge and right arrow."
|
|
60
|
-
)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
section("Icon Alignment") {
|
|
64
|
-
Title(
|
|
65
|
-
title: "Icon Top",
|
|
66
|
-
type: .section,
|
|
67
|
-
icon: "basic_home",
|
|
68
|
-
iconAlign: .top,
|
|
69
|
-
description: "Icon aligned to top"
|
|
70
|
-
)
|
|
71
|
-
Title(
|
|
72
|
-
title: "Icon Center",
|
|
73
|
-
type: .section,
|
|
74
|
-
icon: "basic_home",
|
|
75
|
-
iconAlign: .center,
|
|
76
|
-
description: "Icon aligned to center"
|
|
77
|
-
)
|
|
78
|
-
Title(
|
|
79
|
-
title: "Icon Bottom",
|
|
80
|
-
type: .section,
|
|
81
|
-
icon: "basic_home",
|
|
82
|
-
iconAlign: .bottom,
|
|
83
|
-
description: "Icon aligned to bottom"
|
|
84
|
-
)
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
.padding(16)
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
@ViewBuilder
|
|
92
|
-
private func section<Content: View>(
|
|
93
|
-
_ title: String,
|
|
94
|
-
@ViewBuilder content: () -> Content
|
|
95
|
-
) -> some View {
|
|
96
|
-
VStack(alignment: .leading, spacing: 8) {
|
|
97
|
-
MomoText(title, typography: .headerSSemibold, color: Colors.textSecondary)
|
|
98
|
-
content()
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
struct TitleDemo_Previews: PreviewProvider {
|
|
104
|
-
static var previews: some View {
|
|
105
|
-
NavigationView {
|
|
106
|
-
TitleDemo()
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// TooltipDemo.swift
|
|
3
|
-
// Example
|
|
4
|
-
//
|
|
5
|
-
|
|
6
|
-
import Foundation
|
|
7
|
-
import MoMoUIKits
|
|
8
|
-
import SwiftUI
|
|
9
|
-
|
|
10
|
-
// MARK: - TooltipDemo
|
|
11
|
-
|
|
12
|
-
struct TooltipDemo: View {
|
|
13
|
-
// Placement
|
|
14
|
-
@StateObject private var topState = TooltipState()
|
|
15
|
-
@StateObject private var bottomState = TooltipState()
|
|
16
|
-
@StateObject private var leftState = TooltipState()
|
|
17
|
-
@StateObject private var rightState = TooltipState()
|
|
18
|
-
|
|
19
|
-
// Alignment
|
|
20
|
-
@StateObject private var startState = TooltipState()
|
|
21
|
-
@StateObject private var centerState = TooltipState()
|
|
22
|
-
@StateObject private var endState = TooltipState()
|
|
23
|
-
|
|
24
|
-
// With Buttons
|
|
25
|
-
@StateObject private var singleBtnState = TooltipState()
|
|
26
|
-
@StateObject private var twoBtnState = TooltipState()
|
|
27
|
-
|
|
28
|
-
// Description Only
|
|
29
|
-
@StateObject private var descState = TooltipState()
|
|
30
|
-
|
|
31
|
-
var body: some View {
|
|
32
|
-
ScrollView {
|
|
33
|
-
VStack(alignment: .leading, spacing: 48) {
|
|
34
|
-
// MARK: - Placement
|
|
35
|
-
|
|
36
|
-
section("Placement") {
|
|
37
|
-
Tooltip(
|
|
38
|
-
state: topState,
|
|
39
|
-
title: "Top",
|
|
40
|
-
description: "Tooltip on top of the anchor.",
|
|
41
|
-
placement: .top,
|
|
42
|
-
onPressClose: { topState.hide() }
|
|
43
|
-
) {
|
|
44
|
-
Button(title: "Top", action: { topState.toggle() }, size: .small, isFull: false)
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
Tooltip(
|
|
48
|
-
state: bottomState,
|
|
49
|
-
title: "Bottom",
|
|
50
|
-
description: "Tooltip below the anchor.",
|
|
51
|
-
placement: .bottom,
|
|
52
|
-
onPressClose: { bottomState.hide() }
|
|
53
|
-
) {
|
|
54
|
-
Button(title: "Bottom", action: { bottomState.toggle() }, size: .small, isFull: false)
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
HStack {
|
|
58
|
-
Tooltip(
|
|
59
|
-
state: rightState,
|
|
60
|
-
title: "Right",
|
|
61
|
-
description: "Tooltip on the right.",
|
|
62
|
-
placement: .right,
|
|
63
|
-
onPressClose: { rightState.hide() }
|
|
64
|
-
) {
|
|
65
|
-
Button(title: "Right", action: { rightState.toggle() }, size: .small, isFull: false)
|
|
66
|
-
}
|
|
67
|
-
Spacer().frame(width: 12)
|
|
68
|
-
Tooltip(
|
|
69
|
-
state: leftState,
|
|
70
|
-
title: "Left",
|
|
71
|
-
description: "Tooltip on the left.",
|
|
72
|
-
placement: .left,
|
|
73
|
-
onPressClose: { leftState.hide() }
|
|
74
|
-
) {
|
|
75
|
-
Button(title: "Left", action: { leftState.toggle() }, size: .small, isFull: false)
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// MARK: - Alignment
|
|
81
|
-
|
|
82
|
-
section("Alignment") {
|
|
83
|
-
Tooltip(
|
|
84
|
-
state: startState,
|
|
85
|
-
title: "Start",
|
|
86
|
-
description: "Aligned to start.",
|
|
87
|
-
placement: .bottom,
|
|
88
|
-
align: .start,
|
|
89
|
-
onPressClose: { startState.hide() }
|
|
90
|
-
) {
|
|
91
|
-
Button(title: "Start", action: { startState.toggle() }, size: .small, isFull: false)
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
Tooltip(
|
|
95
|
-
state: centerState,
|
|
96
|
-
title: "Center",
|
|
97
|
-
description: "Aligned to center.",
|
|
98
|
-
placement: .bottom,
|
|
99
|
-
align: .center,
|
|
100
|
-
onPressClose: { centerState.hide() }
|
|
101
|
-
) {
|
|
102
|
-
Button(title: "Center", action: { centerState.toggle() }, size: .small, isFull: false)
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
Tooltip(
|
|
106
|
-
state: endState,
|
|
107
|
-
title: "End",
|
|
108
|
-
description: "Aligned to end.",
|
|
109
|
-
placement: .bottom,
|
|
110
|
-
align: .end,
|
|
111
|
-
onPressClose: { endState.hide() }
|
|
112
|
-
) {
|
|
113
|
-
Button(title: "End", action: { endState.toggle() }, size: .small, isFull: false)
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// MARK: - With Buttons
|
|
118
|
-
|
|
119
|
-
section("With Buttons") {
|
|
120
|
-
Tooltip(
|
|
121
|
-
state: singleBtnState,
|
|
122
|
-
title: "Single Button",
|
|
123
|
-
description: "Tooltip with one action button.",
|
|
124
|
-
buttons: [
|
|
125
|
-
TooltipButton(title: "Got it", onPress: { singleBtnState.hide() })
|
|
126
|
-
],
|
|
127
|
-
placement: .bottom,
|
|
128
|
-
onPressClose: { singleBtnState.hide() }
|
|
129
|
-
) {
|
|
130
|
-
Button(title: "1 Button", action: { singleBtnState.toggle() }, size: .small, isFull: false)
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
Tooltip(
|
|
134
|
-
state: twoBtnState,
|
|
135
|
-
title: "Two Buttons",
|
|
136
|
-
description: "Tooltip with primary and secondary actions.",
|
|
137
|
-
buttons: [
|
|
138
|
-
TooltipButton(title: "Confirm", onPress: { twoBtnState.hide() }),
|
|
139
|
-
TooltipButton(title: "Cancel", onPress: { twoBtnState.hide() })
|
|
140
|
-
],
|
|
141
|
-
placement: .bottom,
|
|
142
|
-
onPressClose: { twoBtnState.hide() }
|
|
143
|
-
) {
|
|
144
|
-
Button(title: "2 Buttons", action: { twoBtnState.toggle() }, size: .small, isFull: false)
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
// MARK: - Description Only
|
|
149
|
-
|
|
150
|
-
section("Description Only") {
|
|
151
|
-
Tooltip(
|
|
152
|
-
state: descState,
|
|
153
|
-
description: "This tooltip has no title, just a description.",
|
|
154
|
-
placement: .top,
|
|
155
|
-
onPressClose: { descState.hide() }
|
|
156
|
-
) {
|
|
157
|
-
Button(title: "No Title", action: { descState.toggle() }, size: .small, isFull: false)
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
.padding(.vertical, 48)
|
|
162
|
-
.padding(.horizontal, 16)
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
// MARK: - Helpers
|
|
167
|
-
|
|
168
|
-
@ViewBuilder
|
|
169
|
-
private func section<Content: View>(
|
|
170
|
-
_ title: String,
|
|
171
|
-
@ViewBuilder content: () -> Content
|
|
172
|
-
) -> some View {
|
|
173
|
-
VStack(alignment: .leading, spacing: 24) {
|
|
174
|
-
Text(title)
|
|
175
|
-
.font(.headline)
|
|
176
|
-
content()
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
#if DEBUG
|
|
182
|
-
struct TooltipDemo_Previews: PreviewProvider {
|
|
183
|
-
static var previews: some View {
|
|
184
|
-
TooltipDemo()
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
#endif
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// TypographyDemo.swift
|
|
3
|
-
// Example
|
|
4
|
-
//
|
|
5
|
-
// Created by dung.pham2 on 29/11/24.
|
|
6
|
-
//
|
|
7
|
-
import SwiftUI
|
|
8
|
-
import MoMoUIKits
|
|
9
|
-
|
|
10
|
-
struct TypographyDemo: View {
|
|
11
|
-
var body: some View {
|
|
12
|
-
ScrollView {
|
|
13
|
-
VStack(alignment: .leading, spacing: 12) {
|
|
14
|
-
// New supported typography styles
|
|
15
|
-
MomoText("Headline Default Bold", typography: .headlineDefaultBold)
|
|
16
|
-
.background(Color.red.opacity(0.3))
|
|
17
|
-
.cornerRadius(4)
|
|
18
|
-
MomoText("Header M Bold", typography: .headerMBold)
|
|
19
|
-
.background(Color.orange.opacity(0.3))
|
|
20
|
-
.cornerRadius(4)
|
|
21
|
-
MomoText("Header Default Bold", typography: .headerDefaultBold)
|
|
22
|
-
.background(Color.yellow.opacity(0.3))
|
|
23
|
-
.cornerRadius(4)
|
|
24
|
-
MomoText("Header S Semibold", typography: .headerSSemibold)
|
|
25
|
-
.background(Color.green.opacity(0.3))
|
|
26
|
-
.cornerRadius(4)
|
|
27
|
-
MomoText("Header XS Semibold", typography: .headerXsSemibold)
|
|
28
|
-
.background(Color.blue.opacity(0.3))
|
|
29
|
-
.cornerRadius(4)
|
|
30
|
-
|
|
31
|
-
Divider().padding(.vertical, 8)
|
|
32
|
-
|
|
33
|
-
// Body Default Regular
|
|
34
|
-
MomoText("Body Default Regular", typography: .bodyDefaultRegular)
|
|
35
|
-
.background(Color.purple.opacity(0.3))
|
|
36
|
-
.cornerRadius(4)
|
|
37
|
-
MomoText("Description Default Regular", typography: .descriptionDefaultRegular)
|
|
38
|
-
.background(Color.pink.opacity(0.3))
|
|
39
|
-
.cornerRadius(4)
|
|
40
|
-
MomoText("Description XS Regular", typography: .descriptionXsRegular)
|
|
41
|
-
.background(Color.gray.opacity(0.3))
|
|
42
|
-
.cornerRadius(4)
|
|
43
|
-
|
|
44
|
-
Divider().padding(.vertical, 8)
|
|
45
|
-
|
|
46
|
-
// Label Default Medium
|
|
47
|
-
MomoText("Label Default Medium", typography: .labelDefaultMedium)
|
|
48
|
-
.background(Color.red.opacity(0.3))
|
|
49
|
-
.cornerRadius(4)
|
|
50
|
-
MomoText("Label S Medium", typography: .labelSMedium)
|
|
51
|
-
.background(Color.orange.opacity(0.3))
|
|
52
|
-
.cornerRadius(4)
|
|
53
|
-
MomoText("Label XS Medium", typography: .labelXsMedium)
|
|
54
|
-
.background(Color.yellow.opacity(0.3))
|
|
55
|
-
.cornerRadius(4)
|
|
56
|
-
|
|
57
|
-
Divider().padding(.vertical, 8)
|
|
58
|
-
|
|
59
|
-
// Action Default Bold
|
|
60
|
-
MomoText("Action Default Bold", typography: .actionDefaultBold)
|
|
61
|
-
.background(Color.green.opacity(0.3))
|
|
62
|
-
.cornerRadius(4)
|
|
63
|
-
MomoText("Action S Bold", typography: .actionSBold)
|
|
64
|
-
.background(Color.blue.opacity(0.3))
|
|
65
|
-
.cornerRadius(4)
|
|
66
|
-
MomoText("Action XS Bold", typography: .actionXsBold)
|
|
67
|
-
.background(Color.purple.opacity(0.3))
|
|
68
|
-
.cornerRadius(4)
|
|
69
|
-
MomoText("Action XXS Bold", typography: .actionXxsBold)
|
|
70
|
-
.background(Color.pink.opacity(0.3))
|
|
71
|
-
.cornerRadius(4)
|
|
72
|
-
|
|
73
|
-
Divider().padding(.vertical, 16)
|
|
74
|
-
}
|
|
75
|
-
.padding(16)
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
struct TypographyDemo_Previews: PreviewProvider {
|
|
81
|
-
static var previews: some View {
|
|
82
|
-
NavigationView {
|
|
83
|
-
TypographyDemo()
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// UploaderDemo.swift
|
|
3
|
-
// Example
|
|
4
|
-
//
|
|
5
|
-
|
|
6
|
-
import SwiftUI
|
|
7
|
-
import MoMoUIKits
|
|
8
|
-
|
|
9
|
-
struct UploaderDemo: View {
|
|
10
|
-
private let mockURL = "https://static.momocdn.net/app/img/kits/navigation-bar.png"
|
|
11
|
-
|
|
12
|
-
// Playground state
|
|
13
|
-
@State private var playgroundImages: [UploadImage] = []
|
|
14
|
-
@State private var numberOfImages: Double = 3
|
|
15
|
-
@State private var disabled = false
|
|
16
|
-
@State private var width: Double = 64
|
|
17
|
-
@State private var height: Double = 64
|
|
18
|
-
|
|
19
|
-
var body: some View {
|
|
20
|
-
ScrollView {
|
|
21
|
-
VStack(alignment: .leading, spacing: 24) {
|
|
22
|
-
section("Default — single slot, no images") {
|
|
23
|
-
Uploader(
|
|
24
|
-
images: [],
|
|
25
|
-
numberOfImages: 1,
|
|
26
|
-
onAdd: {}
|
|
27
|
-
)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
section("With image + cancel button") {
|
|
31
|
-
Uploader(
|
|
32
|
-
images: [UploadImage(uri: mockURL)],
|
|
33
|
-
numberOfImages: 3,
|
|
34
|
-
onAdd: {},
|
|
35
|
-
onCancel: { _, _ in }
|
|
36
|
-
)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
section("Multiple images (slot full — picker hidden)") {
|
|
40
|
-
Uploader(
|
|
41
|
-
images: [
|
|
42
|
-
UploadImage(uri: mockURL),
|
|
43
|
-
UploadImage(uri: mockURL),
|
|
44
|
-
UploadImage(uri: mockURL),
|
|
45
|
-
],
|
|
46
|
-
numberOfImages: 3,
|
|
47
|
-
onAdd: {},
|
|
48
|
-
onCancel: { _, _ in }
|
|
49
|
-
)
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
section("Loading state") {
|
|
53
|
-
Uploader(
|
|
54
|
-
images: [UploadImage(uri: mockURL, loading: true)],
|
|
55
|
-
numberOfImages: 3,
|
|
56
|
-
onAdd: {},
|
|
57
|
-
onCancel: { _, _ in }
|
|
58
|
-
)
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
section("Disabled") {
|
|
62
|
-
Uploader(
|
|
63
|
-
images: [],
|
|
64
|
-
numberOfImages: 1,
|
|
65
|
-
disabled: true,
|
|
66
|
-
onAdd: {}
|
|
67
|
-
)
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
section("Custom size (80 x 80)") {
|
|
71
|
-
Uploader(
|
|
72
|
-
images: [UploadImage(uri: mockURL)],
|
|
73
|
-
numberOfImages: 3,
|
|
74
|
-
width: 80,
|
|
75
|
-
height: 80,
|
|
76
|
-
onAdd: {},
|
|
77
|
-
onCancel: { _, _ in }
|
|
78
|
-
)
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
Divider()
|
|
82
|
-
|
|
83
|
-
section("Playground") {
|
|
84
|
-
VStack(alignment: .leading, spacing: 12) {
|
|
85
|
-
Uploader(
|
|
86
|
-
images: playgroundImages,
|
|
87
|
-
numberOfImages: Int(numberOfImages),
|
|
88
|
-
disabled: disabled,
|
|
89
|
-
width: CGFloat(width),
|
|
90
|
-
height: CGFloat(height),
|
|
91
|
-
onAdd: {
|
|
92
|
-
playgroundImages.append(UploadImage(uri: mockURL))
|
|
93
|
-
},
|
|
94
|
-
onCancel: { _, index in
|
|
95
|
-
if playgroundImages.indices.contains(index) {
|
|
96
|
-
playgroundImages.remove(at: index)
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
onPressImage: { _, _ in }
|
|
100
|
-
)
|
|
101
|
-
|
|
102
|
-
VStack(alignment: .leading, spacing: 4) {
|
|
103
|
-
Text("numberOfImages: \(Int(numberOfImages))")
|
|
104
|
-
Slider(value: $numberOfImages, in: 1...6, step: 1)
|
|
105
|
-
|
|
106
|
-
Toggle("disabled", isOn: $disabled)
|
|
107
|
-
|
|
108
|
-
Text("width: \(Int(width))")
|
|
109
|
-
Slider(value: $width, in: 48...120, step: 1)
|
|
110
|
-
|
|
111
|
-
Text("height: \(Int(height))")
|
|
112
|
-
Slider(value: $height, in: 48...120, step: 1)
|
|
113
|
-
}
|
|
114
|
-
.font(.footnote)
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
.padding()
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
@ViewBuilder
|
|
123
|
-
private func section<Content: View>(_ title: String, @ViewBuilder content: () -> Content) -> some View {
|
|
124
|
-
VStack(alignment: .leading, spacing: 8) {
|
|
125
|
-
Text(title)
|
|
126
|
-
.font(.subheadline)
|
|
127
|
-
.foregroundColor(.secondary)
|
|
128
|
-
content()
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import SwiftUI
|
|
2
|
-
import MoMoUIKits
|
|
3
|
-
|
|
4
|
-
struct SwiftUIDemoBrowserView: View {
|
|
5
|
-
let context: MoMoUIKitsDemoContext
|
|
6
|
-
let onOpenCompose: () -> Void
|
|
7
|
-
@State private var searchText = ""
|
|
8
|
-
|
|
9
|
-
var body: some View {
|
|
10
|
-
Group {
|
|
11
|
-
if #available(iOS 16.0, *) {
|
|
12
|
-
HomeView(
|
|
13
|
-
onOpenCompose: onOpenCompose,
|
|
14
|
-
applicationContext: context.miniAppContext
|
|
15
|
-
)
|
|
16
|
-
} else {
|
|
17
|
-
fallbackBrowser
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
.environment(\.appTheme, defaultTheme)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
private var fallbackBrowser: some View {
|
|
24
|
-
NavigationView {
|
|
25
|
-
List {
|
|
26
|
-
ForEach(ScreenUsages) { item in
|
|
27
|
-
NavigationLink(destination: item.destination) {
|
|
28
|
-
MomoText(item.title, typography: .headerDefaultBold)
|
|
29
|
-
.padding(.vertical, 8)
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
.listStyle(.insetGrouped)
|
|
34
|
-
.navigationTitle("UI Kits SwiftUI")
|
|
35
|
-
}
|
|
36
|
-
.navigationViewStyle(.stack)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
private var filteredSections: [UIKitsDemoSection] {
|
|
40
|
-
guard !searchText.isEmpty else { return UIKitsDemoRegistry.sections }
|
|
41
|
-
|
|
42
|
-
return UIKitsDemoRegistry.sections.compactMap { section in
|
|
43
|
-
let items = section.items.filter { item in
|
|
44
|
-
item.title.localizedCaseInsensitiveContains(searchText)
|
|
45
|
-
|| item.subtitle.localizedCaseInsensitiveContains(searchText)
|
|
46
|
-
}
|
|
47
|
-
guard !items.isEmpty else { return nil }
|
|
48
|
-
return UIKitsDemoSection(id: section.id, title: section.title, items: items)
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import SwiftUI
|
|
2
|
-
|
|
3
|
-
struct UIKitsDemoItem: Identifiable {
|
|
4
|
-
let id: String
|
|
5
|
-
let title: String
|
|
6
|
-
let subtitle: String
|
|
7
|
-
let destination: AnyView
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
struct UIKitsDemoSection: Identifiable {
|
|
11
|
-
let id: String
|
|
12
|
-
let title: String
|
|
13
|
-
let items: [UIKitsDemoItem]
|
|
14
|
-
}
|
|
15
|
-
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import SwiftUI
|
|
2
|
-
|
|
3
|
-
enum UIKitsDemoRegistry {
|
|
4
|
-
static let sections: [UIKitsDemoSection] = [
|
|
5
|
-
UIKitsDemoSection(
|
|
6
|
-
id: "components",
|
|
7
|
-
title: "Components",
|
|
8
|
-
items: [
|
|
9
|
-
UIKitsDemoItem(
|
|
10
|
-
id: "typography",
|
|
11
|
-
title: "Typography",
|
|
12
|
-
subtitle: "Text styles and semantic colors",
|
|
13
|
-
destination: AnyView(UIKitsTypographyDemoView())
|
|
14
|
-
),
|
|
15
|
-
UIKitsDemoItem(
|
|
16
|
-
id: "button",
|
|
17
|
-
title: "Button",
|
|
18
|
-
subtitle: "Primary, secondary, outline, loading",
|
|
19
|
-
destination: AnyView(UIKitsButtonDemoView())
|
|
20
|
-
),
|
|
21
|
-
UIKitsDemoItem(
|
|
22
|
-
id: "badge",
|
|
23
|
-
title: "Badge",
|
|
24
|
-
subtitle: "Numeric and label badges",
|
|
25
|
-
destination: AnyView(UIKitsBadgeDemoView())
|
|
26
|
-
),
|
|
27
|
-
UIKitsDemoItem(
|
|
28
|
-
id: "chip",
|
|
29
|
-
title: "Chip",
|
|
30
|
-
subtitle: "Selectable labels and compact filters",
|
|
31
|
-
destination: AnyView(UIKitsChipDemoView())
|
|
32
|
-
)
|
|
33
|
-
]
|
|
34
|
-
),
|
|
35
|
-
UIKitsDemoSection(
|
|
36
|
-
id: "inputs",
|
|
37
|
-
title: "Inputs",
|
|
38
|
-
items: [
|
|
39
|
-
UIKitsDemoItem(
|
|
40
|
-
id: "input",
|
|
41
|
-
title: "Input",
|
|
42
|
-
subtitle: "Text, error, password, disabled states",
|
|
43
|
-
destination: AnyView(UIKitsInputDemoView())
|
|
44
|
-
),
|
|
45
|
-
UIKitsDemoItem(
|
|
46
|
-
id: "checkbox",
|
|
47
|
-
title: "Checkbox",
|
|
48
|
-
subtitle: "Checked, indeterminate, disabled",
|
|
49
|
-
destination: AnyView(UIKitsCheckboxDemoView())
|
|
50
|
-
),
|
|
51
|
-
UIKitsDemoItem(
|
|
52
|
-
id: "radio",
|
|
53
|
-
title: "Radio",
|
|
54
|
-
subtitle: "Single choice controls",
|
|
55
|
-
destination: AnyView(UIKitsRadioDemoView())
|
|
56
|
-
)
|
|
57
|
-
]
|
|
58
|
-
),
|
|
59
|
-
UIKitsDemoSection(
|
|
60
|
-
id: "feedback",
|
|
61
|
-
title: "Feedback",
|
|
62
|
-
items: [
|
|
63
|
-
UIKitsDemoItem(
|
|
64
|
-
id: "popup",
|
|
65
|
-
title: "Popup Notify",
|
|
66
|
-
subtitle: "Notification popup content and actions",
|
|
67
|
-
destination: AnyView(UIKitsPopupDemoView())
|
|
68
|
-
)
|
|
69
|
-
]
|
|
70
|
-
)
|
|
71
|
-
]
|
|
72
|
-
}
|
|
73
|
-
|