@momo-kits/native-kits 0.157.1-beta.9 → 0.157.1-com.1-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/build.gradle.kts +11 -0
- package/compose/build.gradle.kts +180 -0
- package/compose/build.gradle.kts.backup +180 -0
- package/compose/compose.podspec +54 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +110 -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 +57 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +107 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/FloatingButton.kt +201 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Header.kt +222 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderAnimated.kt +48 -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 +305 -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 +720 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +121 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +405 -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 +85 -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 +340 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +198 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +357 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +123 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +94 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +136 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +224 -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 +148 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +188 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +116 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +448 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +172 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +255 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +231 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +233 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +254 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +241 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +364 -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 +92 -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 +352 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +103 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +350 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +70 -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 +96 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +360 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +256 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +494 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +131 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +215 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +96 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +449 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +92 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +130 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +214 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +590 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +177 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +192 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +205 -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 +239 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +191 -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 +13 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +185 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +285 -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 +59 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +68 -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 +14 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +50 -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 +239 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +119 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +98 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +161 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +331 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +497 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +162 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +243 -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 +187 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +279 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +80 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +306 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +32 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +370 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +132 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +42 -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 +62 -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 +88 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +149 -0
- package/gradle/libs.versions.toml +57 -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/Input/Input.swift +4 -0
- package/local.properties +8 -0
- package/package.json +1 -1
- package/settings.gradle.kts +52 -0
- package/src/doctor/README.md +73 -0
- package/src/doctor/package-lock.json +885 -0
- package/src/doctor/package.json +44 -0
- package/src/doctor/publish.sh +27 -0
- package/src/doctor/src/Users.json +112 -0
- package/src/doctor/src/Whitelist.json +6 -0
- package/src/doctor/src/commands/check.ts +81 -0
- package/src/doctor/src/commands/doctor.ts +193 -0
- package/src/doctor/src/index.ts +35 -0
- package/src/doctor/src/logger.ts +84 -0
- package/src/doctor/src/task/native.ts +21 -0
- package/src/doctor/src/task/utils.ts +20 -0
- package/src/doctor/src/utils/checkCoreDependencies.ts +138 -0
- package/src/doctor/src/utils/checkDeletedPackage.ts +53 -0
- package/src/doctor/src/utils/checkDeprecatedPackages.ts +168 -0
- package/src/doctor/src/utils/checkDeprecatedVersion.ts +60 -0
- package/src/doctor/src/utils/checkShareDependencies.ts +251 -0
- package/src/doctor/src/utils/checkWrongVersionCommunityPackage.ts +64 -0
- package/src/doctor/src/utils/getErrorMessage.ts +84 -0
- package/src/doctor/src/utils/scanComponentUsage.ts +206 -0
- package/src/doctor/src/utils/scanFoundationImports.ts +169 -0
- package/src/doctor/src/utils/scanMaxApiUsage.ts +86 -0
- package/src/doctor/src/utils/scanNativeModulesUsage.ts +78 -0
- package/src/doctor/src/utils/sendMessage.ts +28 -0
- package/src/doctor/tsconfig.json +14 -0
- package/src/doctor/yarn.lock +492 -0
- package/src/foundations/Application/BottomSheet.tsx +358 -0
- package/src/foundations/Application/BottomTab/BottomTabBar.tsx +320 -0
- package/src/foundations/Application/BottomTab/CustomBottomTabItem.tsx +155 -0
- package/src/foundations/Application/BottomTab/TabBarIcon.tsx +113 -0
- package/src/foundations/Application/BottomTab/index.tsx +449 -0
- package/src/foundations/Application/Components/BackgroundImageView.tsx +126 -0
- package/src/foundations/Application/Components/HeaderAnimated.tsx +69 -0
- package/src/foundations/Application/Components/HeaderBackground.tsx +83 -0
- package/src/foundations/Application/Components/HeaderExtendHeader.tsx +225 -0
- package/src/foundations/Application/Components/HeaderLeft.tsx +93 -0
- package/src/foundations/Application/Components/HeaderRight.tsx +444 -0
- package/src/foundations/Application/Components/HeaderTitle.tsx +596 -0
- package/src/foundations/Application/Components/NavigationButton.tsx +76 -0
- package/src/foundations/Application/Components/SearchHeader.tsx +127 -0
- package/src/foundations/Application/Localize.ts +44 -0
- package/src/foundations/Application/ModalScreen.tsx +148 -0
- package/src/foundations/Application/Navigation.ts +63 -0
- package/src/foundations/Application/NavigationContainer.tsx +245 -0
- package/src/foundations/Application/Navigator.ts +171 -0
- package/src/foundations/Application/ScaleSizeProvider.tsx +16 -0
- package/src/foundations/Application/StackScreen.tsx +420 -0
- package/src/foundations/Application/TooltipPortal.tsx +127 -0
- package/src/foundations/Application/WidgetContainer.tsx +162 -0
- package/src/foundations/Application/index.ts +34 -0
- package/src/foundations/Application/types.ts +350 -0
- package/src/foundations/Application/utils.tsx +239 -0
- package/src/foundations/Assets/DotAnimation.json +256 -0
- package/src/foundations/Assets/SpinnerAnimation.json +1027 -0
- package/src/foundations/Assets/icon.json +4052 -0
- package/src/foundations/Assets/icon_bank.json +506 -0
- package/src/foundations/Assets/language.json +208 -0
- package/src/foundations/Assets/lottie_circle_loader.json +1 -0
- package/src/foundations/Assets/pinAnimation.json +1 -0
- package/src/foundations/Assets/unpinAnimation.json +1 -0
- package/src/foundations/Badge/Badge.tsx +104 -0
- package/src/foundations/Badge/BadgeDot.tsx +35 -0
- package/src/foundations/Badge/BadgeDotAnimation.tsx +95 -0
- package/src/foundations/Badge/BadgeRibbon.tsx +112 -0
- package/src/foundations/Badge/Shape.tsx +29 -0
- package/src/foundations/Badge/index.tsx +8 -0
- package/src/foundations/Badge/styles.ts +125 -0
- package/src/foundations/Badge/types.ts +68 -0
- package/src/foundations/Button/index.tsx +371 -0
- package/src/foundations/Button/styles.ts +65 -0
- package/src/foundations/CheckBox/index.tsx +104 -0
- package/src/foundations/CheckBox/styles.ts +17 -0
- package/src/foundations/CheckBox/types.ts +37 -0
- package/src/foundations/Consts/colors+spacing+radius.ts +232 -0
- package/src/foundations/Consts/index.ts +4 -0
- package/src/foundations/Consts/styles.ts +52 -0
- package/src/foundations/Consts/theme.ts +121 -0
- package/src/foundations/Context/index.ts +27 -0
- package/src/foundations/Divider/DashDivider.tsx +46 -0
- package/src/foundations/Divider/index.tsx +45 -0
- package/src/foundations/FoundationList/index.tsx +12 -0
- package/src/foundations/FoundationList/types.ts +7 -0
- package/src/foundations/Icon/index.tsx +57 -0
- package/src/foundations/Icon/types.ts +32 -0
- package/src/foundations/IconButton/index.tsx +144 -0
- package/src/foundations/IconButton/styles.ts +20 -0
- package/src/foundations/Image/index.tsx +115 -0
- package/src/foundations/Image/styles.ts +7 -0
- package/src/foundations/Image/types.ts +7 -0
- package/src/foundations/Input/Input.tsx +280 -0
- package/src/foundations/Input/InputDropDown.tsx +161 -0
- package/src/foundations/Input/InputMoney.tsx +325 -0
- package/src/foundations/Input/InputOTP.tsx +299 -0
- package/src/foundations/Input/InputPhoneNumber.tsx +287 -0
- package/src/foundations/Input/InputSearch.tsx +351 -0
- package/src/foundations/Input/InputTextArea.tsx +218 -0
- package/src/foundations/Input/SystemTextInput.tsx +44 -0
- package/src/foundations/Input/TextTyping.tsx +115 -0
- package/src/foundations/Input/common.tsx +243 -0
- package/src/foundations/Input/index.tsx +373 -0
- package/src/foundations/Input/styles.ts +226 -0
- package/src/foundations/Input/utils.ts +97 -0
- package/src/foundations/Layout/Card.tsx +108 -0
- package/src/foundations/Layout/FloatingButton.tsx +179 -0
- package/src/foundations/Layout/GridSystem.tsx +137 -0
- package/src/foundations/Layout/Item.tsx +59 -0
- package/src/foundations/Layout/ItemList.tsx +66 -0
- package/src/foundations/Layout/ItemSectionList.tsx +40 -0
- package/src/foundations/Layout/Screen.tsx +644 -0
- package/src/foundations/Layout/Section.tsx +103 -0
- package/src/foundations/Layout/TrackingScope.tsx +18 -0
- package/src/foundations/Layout/index.ts +34 -0
- package/src/foundations/Layout/styles.ts +95 -0
- package/src/foundations/Layout/types.ts +40 -0
- package/src/foundations/Layout/utils.ts +47 -0
- package/src/foundations/Loader/DotLoader.tsx +37 -0
- package/src/foundations/Loader/Loader.tsx +13 -0
- package/src/foundations/Loader/ProgressBar.tsx +45 -0
- package/src/foundations/Loader/Spinner.tsx +29 -0
- package/src/foundations/Loader/index.tsx +6 -0
- package/src/foundations/Loader/styles.ts +10 -0
- package/src/foundations/Loader/types.ts +35 -0
- package/src/foundations/Loader/utils.ts +25 -0
- package/src/foundations/Pagination/Dot.tsx +19 -0
- package/src/foundations/Pagination/PaginationDot.tsx +44 -0
- package/src/foundations/Pagination/PaginationNumber.tsx +31 -0
- package/src/foundations/Pagination/PaginationScroll.tsx +99 -0
- package/src/foundations/Pagination/PaginationWhiteDot.tsx +43 -0
- package/src/foundations/Pagination/index.tsx +25 -0
- package/src/foundations/Pagination/styles.ts +51 -0
- package/src/foundations/Pagination/types.ts +40 -0
- package/src/foundations/Popup/PopupNotify.tsx +276 -0
- package/src/foundations/Popup/PopupPromotion.tsx +118 -0
- package/src/foundations/Popup/index.tsx +4 -0
- package/src/foundations/Popup/types.ts +96 -0
- package/src/foundations/Radio/index.tsx +108 -0
- package/src/foundations/Radio/styles.ts +15 -0
- package/src/foundations/Radio/types.ts +31 -0
- package/src/foundations/Skeleton/index.tsx +118 -0
- package/src/foundations/Skeleton/styles.ts +5 -0
- package/src/foundations/Skeleton/types.ts +6 -0
- package/src/foundations/Switch/index.tsx +68 -0
- package/src/foundations/Switch/styles.ts +25 -0
- package/src/foundations/Switch/types.ts +19 -0
- package/src/foundations/Tag/index.tsx +128 -0
- package/src/foundations/Tag/types.ts +41 -0
- package/src/foundations/Text/index.tsx +241 -0
- package/src/foundations/Text/styles.ts +78 -0
- package/src/foundations/Text/types.ts +53 -0
- package/src/foundations/Text/utils.ts +63 -0
- package/src/foundations/Title/index.tsx +285 -0
- package/src/foundations/Title/styles.ts +55 -0
- package/src/foundations/Title/types.ts +21 -0
- package/src/foundations/index.ts +50 -0
- package/src/foundations/package.json +35 -0
- package/src/foundations/publish.sh +17 -0
- package/src/libs/AutoComplete/index.tsx +88 -0
- package/src/libs/AutoComplete/package.json +16 -0
- package/src/libs/AutoComplete/publish.sh +16 -0
- package/src/libs/AutoComplete/styles.ts +15 -0
- package/src/libs/AutoComplete/types.ts +60 -0
- package/src/libs/Avatar/index.tsx +146 -0
- package/src/libs/Avatar/package.json +16 -0
- package/src/libs/Avatar/publish.sh +20 -0
- package/src/libs/Avatar/styles.ts +18 -0
- package/src/libs/Avatar/types.ts +57 -0
- package/src/libs/Badge/Badge.tsx +70 -0
- package/src/libs/Badge/BadgeDot.tsx +11 -0
- package/src/libs/Badge/BadgeRibbon.tsx +122 -0
- package/src/libs/Badge/Shape.tsx +29 -0
- package/src/libs/Badge/index.tsx +7 -0
- package/src/libs/Badge/package.json +16 -0
- package/src/libs/Badge/publish.sh +18 -0
- package/src/libs/Badge/styles.ts +55 -0
- package/src/libs/Badge/types.ts +63 -0
- package/src/libs/Calendar/CalendarPro.tsx +307 -0
- package/src/libs/Calendar/Day.tsx +150 -0
- package/src/libs/Calendar/HeaderControl.tsx +55 -0
- package/src/libs/Calendar/LunarDateConverter.ts +228 -0
- package/src/libs/Calendar/LunarService.ts +206 -0
- package/src/libs/Calendar/Month.tsx +118 -0
- package/src/libs/Calendar/MonthList.tsx +226 -0
- package/src/libs/Calendar/TabHeader.tsx +91 -0
- package/src/libs/Calendar/Util.ts +288 -0
- package/src/libs/Calendar/holidayData.ts +118 -0
- package/src/libs/Calendar/index.tsx +383 -0
- package/src/libs/Calendar/package.json +18 -0
- package/src/libs/Calendar/publish.sh +18 -0
- package/src/libs/Calendar/styles.ts +122 -0
- package/src/libs/Calendar/types.ts +212 -0
- package/src/libs/Carousel/animation.ts +62 -0
- package/src/libs/Carousel/index.tsx +517 -0
- package/src/libs/Carousel/package.json +18 -0
- package/src/libs/Carousel/publish.sh +16 -0
- package/src/libs/Carousel/types.ts +71 -0
- package/src/libs/Chip/index.tsx +164 -0
- package/src/libs/Chip/package.json +16 -0
- package/src/libs/Chip/publish.sh +16 -0
- package/src/libs/Chip/styles.ts +20 -0
- package/src/libs/Chip/types.ts +72 -0
- package/src/libs/Collapse/index.tsx +305 -0
- package/src/libs/Collapse/package.json +16 -0
- package/src/libs/Collapse/publish.sh +18 -0
- package/src/libs/Collapse/styles.ts +37 -0
- package/src/libs/Collapse/types.ts +84 -0
- package/src/libs/DateTimePicker/WheelPicker.tsx +163 -0
- package/src/libs/DateTimePicker/WheelPickerItem.tsx +58 -0
- package/src/libs/DateTimePicker/index.tsx +188 -0
- package/src/libs/DateTimePicker/package.json +16 -0
- package/src/libs/DateTimePicker/publish.sh +17 -0
- package/src/libs/DateTimePicker/styles.ts +31 -0
- package/src/libs/DateTimePicker/types.ts +102 -0
- package/src/libs/DateTimePicker/utils.ts +114 -0
- package/src/libs/Information/index.tsx +129 -0
- package/src/libs/Information/package.json +16 -0
- package/src/libs/Information/publish.sh +18 -0
- package/src/libs/Information/styles.ts +34 -0
- package/src/libs/Information/types.ts +79 -0
- package/src/libs/Logo/index.tsx +39 -0
- package/src/libs/Logo/package.json +17 -0
- package/src/libs/Logo/publish.sh +16 -0
- package/src/libs/Logo/styles.ts +25 -0
- package/src/libs/Logo/types.ts +13 -0
- package/src/libs/ProgressInfo/ProgressInfoHorizontal.tsx +128 -0
- package/src/libs/ProgressInfo/ProgressInfoIcon.tsx +88 -0
- package/src/libs/ProgressInfo/ProgressInfoVertical.tsx +85 -0
- package/src/libs/ProgressInfo/index.tsx +22 -0
- package/src/libs/ProgressInfo/package.json +16 -0
- package/src/libs/ProgressInfo/publish.sh +16 -0
- package/src/libs/ProgressInfo/styles.ts +46 -0
- package/src/libs/ProgressInfo/types.ts +60 -0
- package/src/libs/ProgressInfo/yarn.lock +8 -0
- package/src/libs/Rating/index.tsx +74 -0
- package/src/libs/Rating/package.json +16 -0
- package/src/libs/Rating/publish.sh +18 -0
- package/src/libs/Rating/type.ts +25 -0
- package/src/libs/Slider/Label.tsx +33 -0
- package/src/libs/Slider/helpers.ts +35 -0
- package/src/libs/Slider/hooks.tsx +218 -0
- package/src/libs/Slider/index.tsx +453 -0
- package/src/libs/Slider/package.json +16 -0
- package/src/libs/Slider/publish.sh +18 -0
- package/src/libs/Slider/styles.ts +36 -0
- package/src/libs/Stepper/NumberView.tsx +64 -0
- package/src/libs/Stepper/StepperButton.tsx +37 -0
- package/src/libs/Stepper/index.tsx +139 -0
- package/src/libs/Stepper/package.json +16 -0
- package/src/libs/Stepper/publish.sh +17 -0
- package/src/libs/Stepper/styles.ts +44 -0
- package/src/libs/Stepper/types.ts +154 -0
- package/src/libs/Steps/StepIcon.tsx +86 -0
- package/src/libs/Steps/StepsHorizontal.tsx +189 -0
- package/src/libs/Steps/StepsVertical.tsx +133 -0
- package/src/libs/Steps/index.tsx +20 -0
- package/src/libs/Steps/package.json +16 -0
- package/src/libs/Steps/publish.sh +16 -0
- package/src/libs/Steps/styles.ts +46 -0
- package/src/libs/Steps/types.ts +159 -0
- package/src/libs/Steps/utils.ts +175 -0
- package/src/libs/SuggestAction/SuggestActionView.tsx +124 -0
- package/src/libs/SuggestAction/index.tsx +3 -0
- package/src/libs/SuggestAction/package.json +16 -0
- package/src/libs/SuggestAction/publish.sh +16 -0
- package/src/libs/SuggestAction/styles.ts +30 -0
- package/src/libs/SuggestAction/types.ts +36 -0
- package/src/libs/Swipe/SwipeView.tsx +151 -0
- package/src/libs/Swipe/index.tsx +5 -0
- package/src/libs/Swipe/package.json +16 -0
- package/src/libs/Swipe/publish.sh +16 -0
- package/src/libs/Swipe/styles.ts +16 -0
- package/src/libs/Swipe/types.ts +109 -0
- package/src/libs/TabView/assets/Path.tsx +29 -0
- package/src/libs/TabView/index.tsx +184 -0
- package/src/libs/TabView/package.json +16 -0
- package/src/libs/TabView/publish.sh +16 -0
- package/src/libs/TabView/styles.ts +96 -0
- package/src/libs/TabView/tabBar/CardTabBar.tsx +137 -0
- package/src/libs/TabView/tabBar/SrollableTabBar.tsx +218 -0
- package/src/libs/TabView/tabBar/TabBar.tsx +67 -0
- package/src/libs/TabView/tabItem/CardTabItem.tsx +118 -0
- package/src/libs/TabView/tabItem/TabItem.tsx +180 -0
- package/src/libs/TabView/types.ts +166 -0
- package/src/libs/Template/HeaderSliderBanner/index.tsx +86 -0
- package/src/libs/Template/HeaderSliderBanner/types.ts +16 -0
- package/src/libs/Template/TrustBanner/CustomAvatar.tsx +39 -0
- package/src/libs/Template/TrustBanner/index.tsx +161 -0
- package/src/libs/Template/TrustBanner/styles.ts +48 -0
- package/src/libs/Template/TrustBanner/types.ts +50 -0
- package/src/libs/Template/index.tsx +4 -0
- package/src/libs/Template/package.json +18 -0
- package/src/libs/Template/publish.sh +17 -0
- package/src/libs/Title/index.tsx +284 -0
- package/src/libs/Title/package.json +17 -0
- package/src/libs/Title/publish.sh +16 -0
- package/src/libs/Title/styles.ts +54 -0
- package/src/libs/Title/types.ts +21 -0
- package/src/libs/Tooltip/TooltipButtons.tsx +54 -0
- package/src/libs/Tooltip/index.tsx +608 -0
- package/src/libs/Tooltip/package.json +16 -0
- package/src/libs/Tooltip/publish.sh +18 -0
- package/src/libs/Tooltip/styles.ts +70 -0
- package/src/libs/Tooltip/types.ts +61 -0
- package/src/libs/Uploader/index.tsx +87 -0
- package/src/libs/Uploader/package.json +17 -0
- package/src/libs/Uploader/publish.sh +18 -0
- package/src/libs/Uploader/styles.ts +30 -0
- package/src/libs/Uploader/types.ts +69 -0
- package/src/native/MoMoNative.podspec +18 -0
- package/src/native/calculator/android/build.gradle +61 -0
- package/src/native/calculator/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/src/native/calculator/android/gradle/wrapper/gradle-wrapper.properties +6 -0
- package/src/native/calculator/android/gradlew +172 -0
- package/src/native/calculator/android/gradlew.bat +84 -0
- package/src/native/calculator/android/src/main/AndroidManifest.xml +5 -0
- package/src/native/calculator/android/src/main/java/com/calculator/KeyboardViewModule.java +22 -0
- package/src/native/calculator/android/src/main/java/com/calculator/KeyboardViewPackage.java +35 -0
- package/src/native/calculator/android/src/main/java/com/calculator/modules/CalculatorKeyboardModule.java +157 -0
- package/src/native/calculator/android/src/main/java/com/calculator/views/calculatorkeyboard/CalculatorEditText.java +36 -0
- package/src/native/calculator/android/src/main/java/com/calculator/views/calculatorkeyboard/FixedRelativeLayout.java +45 -0
- package/src/native/calculator/android/src/main/java/com/calculator/views/calculatorkeyboard/MomoTextInputCalculatorManager.java +173 -0
- package/src/native/calculator/android/src/main/java/com/calculator/views/customkeyboard/RNCustomKeyboardModule.java +417 -0
- package/src/native/calculator/ios/Helper/MomoHelper.swift +16 -0
- package/src/native/calculator/ios/KeyboardView-Bridging-Header.h +60 -0
- package/src/native/calculator/ios/KeyboardView.h +19 -0
- package/src/native/calculator/ios/KeyboardView.m +56 -0
- package/src/native/calculator/ios/MomoTextInputCalculator.swift +144 -0
- package/src/native/calculator/ios/RNCustomKeyboard/RNCustomKeyboard.h +6 -0
- package/src/native/calculator/ios/RNCustomKeyboard/RNCustomKeyboard.m +143 -0
- package/src/native/package.json +14 -0
- package/src/native/publish.sh +29 -0
- package/src/native/resource/android/build.gradle +57 -0
- package/src/native/resource/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/src/native/resource/android/gradle/wrapper/gradle-wrapper.properties +6 -0
- package/src/native/resource/android/src/main/AndroidManifest.xml +6 -0
- package/src/native/resource/android/src/main/java/com/resource/RNResourceModule.java +90 -0
- package/src/native/resource/android/src/main/java/com/resource/RNResourcePackage.java +22 -0
- package/src/native/resource/ios/RNResouce.m +71 -0
- package/src/native/resource/ios/RNResource.h +5 -0
- package/example/ios/Example.xcodeproj/xcuserdata/sophia.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- package/example/ios/Example.xcworkspace/xcuserdata/sophia.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/example/ios/Example.xcworkspace/xcuserdata/sophia.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +0 -6
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sophia.xcuserdatad/xcschemes/MoMoUIKits.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sophia.xcuserdatad/xcschemes/Pods-Example.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sophia.xcuserdatad/xcschemes/SDWebImage.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sophia.xcuserdatad/xcschemes/SDWebImageSwiftUI.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sophia.xcuserdatad/xcschemes/SkeletonUI.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sophia.xcuserdatad/xcschemes/lottie-ios-LottiePrivacyInfo.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sophia.xcuserdatad/xcschemes/lottie-ios.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sophia.xcuserdatad/xcschemes/xcschememanagement.plist +0 -46
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import {ApplicationContext, Colors, Typography} from '@momo-kits/foundation';
|
|
2
|
+
import {Step} from '@momo-kits/step';
|
|
3
|
+
import {useContext} from 'react';
|
|
4
|
+
|
|
5
|
+
type StepStatus = 'incomplete' | 'current' | 'completed' | 'error' | 'disable';
|
|
6
|
+
type StepTypo = {
|
|
7
|
+
typography: Typography;
|
|
8
|
+
color: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const getStatus = (
|
|
12
|
+
activeIndex: number,
|
|
13
|
+
currentIndex: number,
|
|
14
|
+
error?: boolean,
|
|
15
|
+
disabled?: boolean
|
|
16
|
+
): StepStatus => {
|
|
17
|
+
if (disabled) return 'disable';
|
|
18
|
+
if (error) return 'error';
|
|
19
|
+
if (activeIndex === currentIndex) return 'current';
|
|
20
|
+
if (activeIndex > currentIndex) return 'completed';
|
|
21
|
+
return 'incomplete';
|
|
22
|
+
};
|
|
23
|
+
const checkSizeAndStepType = (
|
|
24
|
+
stepType?: 'vertical' | 'horizontal',
|
|
25
|
+
size?: 'small' | 'large'
|
|
26
|
+
) => {
|
|
27
|
+
return (
|
|
28
|
+
stepType === 'horizontal' || (stepType === 'vertical' && size === 'small')
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const getTypoTitle = (
|
|
33
|
+
status: StepStatus,
|
|
34
|
+
size?: 'small' | 'large',
|
|
35
|
+
stepType?: 'vertical' | 'horizontal'
|
|
36
|
+
): Typography => {
|
|
37
|
+
const defaultTypo =
|
|
38
|
+
!!size && stepType === 'vertical'
|
|
39
|
+
? 'body_default_regular'
|
|
40
|
+
: 'description_default_regular';
|
|
41
|
+
|
|
42
|
+
switch (status) {
|
|
43
|
+
case 'current':
|
|
44
|
+
case 'error': {
|
|
45
|
+
return checkSizeAndStepType(stepType, size)
|
|
46
|
+
? 'header_xs_semibold'
|
|
47
|
+
: 'header_s_semibold';
|
|
48
|
+
}
|
|
49
|
+
case 'incomplete':
|
|
50
|
+
case 'completed': {
|
|
51
|
+
return checkSizeAndStepType(stepType, size)
|
|
52
|
+
? 'description_default_regular'
|
|
53
|
+
: 'body_default_regular';
|
|
54
|
+
}
|
|
55
|
+
default: {
|
|
56
|
+
return defaultTypo;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const GetStepTypo = (
|
|
62
|
+
activeIndex: number,
|
|
63
|
+
currentIndex: number,
|
|
64
|
+
error?: boolean,
|
|
65
|
+
size?: 'small' | 'large',
|
|
66
|
+
stepType?: 'vertical' | 'horizontal'
|
|
67
|
+
) => {
|
|
68
|
+
const {theme} = useContext(ApplicationContext);
|
|
69
|
+
const status = getStatus(activeIndex, currentIndex, error);
|
|
70
|
+
|
|
71
|
+
let title: StepTypo = {
|
|
72
|
+
color: theme.colors.text.default,
|
|
73
|
+
typography: getTypoTitle(status, size, stepType),
|
|
74
|
+
};
|
|
75
|
+
let description: StepTypo = {
|
|
76
|
+
color: theme.colors.text.hint,
|
|
77
|
+
typography: !!size
|
|
78
|
+
? 'description_xs_regular'
|
|
79
|
+
: 'description_default_regular',
|
|
80
|
+
};
|
|
81
|
+
let time: StepTypo = {
|
|
82
|
+
color: theme.colors.text.hint,
|
|
83
|
+
typography: 'description_xs_regular',
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
switch (status) {
|
|
87
|
+
case 'current': {
|
|
88
|
+
title.color = theme.colors.primary;
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
case 'error': {
|
|
92
|
+
title.color = theme.colors.error.primary;
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return {title, description, time};
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export const GetStepColor = (
|
|
101
|
+
activeIndex: number,
|
|
102
|
+
currentIndex: number,
|
|
103
|
+
error?: boolean,
|
|
104
|
+
length: number = 1,
|
|
105
|
+
disabled?: boolean
|
|
106
|
+
) => {
|
|
107
|
+
const {theme} = useContext(ApplicationContext);
|
|
108
|
+
const DEFAULT_LINE_COLOR = theme.colors.background.default;
|
|
109
|
+
const COMPLETED_LINE_COLOR = theme.colors.primary + '33';
|
|
110
|
+
|
|
111
|
+
let backgroundColor = Colors.black_06;
|
|
112
|
+
let borderColor = theme.colors.border.default;
|
|
113
|
+
let lineColorLeft = DEFAULT_LINE_COLOR;
|
|
114
|
+
let lineColorRight = DEFAULT_LINE_COLOR;
|
|
115
|
+
const status = getStatus(activeIndex, currentIndex, error, disabled);
|
|
116
|
+
|
|
117
|
+
if (activeIndex > currentIndex) {
|
|
118
|
+
lineColorLeft = COMPLETED_LINE_COLOR;
|
|
119
|
+
lineColorRight = COMPLETED_LINE_COLOR;
|
|
120
|
+
}
|
|
121
|
+
if (activeIndex === currentIndex) {
|
|
122
|
+
lineColorLeft = COMPLETED_LINE_COLOR;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (currentIndex === 0) {
|
|
126
|
+
lineColorLeft = 'transparent';
|
|
127
|
+
}
|
|
128
|
+
if (currentIndex === length - 1) {
|
|
129
|
+
lineColorRight = 'transparent';
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
switch (status) {
|
|
133
|
+
case 'current': {
|
|
134
|
+
backgroundColor = theme.colors.primary;
|
|
135
|
+
borderColor = theme.colors.background.tonal;
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
case 'completed': {
|
|
140
|
+
backgroundColor = theme.colors.primary;
|
|
141
|
+
borderColor = theme.colors.background.tonal;
|
|
142
|
+
break;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
case 'error': {
|
|
146
|
+
backgroundColor = theme.colors.error.primary;
|
|
147
|
+
borderColor = theme.colors.error.container;
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
case 'disable': {
|
|
152
|
+
backgroundColor = Colors.pink_08;
|
|
153
|
+
borderColor = Colors.pink_10;
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return {backgroundColor, borderColor, lineColorLeft, lineColorRight, status};
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export const getOnPressCompleted = (
|
|
162
|
+
item: Step,
|
|
163
|
+
activeIndex: number,
|
|
164
|
+
currentIndex: number,
|
|
165
|
+
error?: boolean,
|
|
166
|
+
disabled?: boolean,
|
|
167
|
+
onPress?: (item: Step, index: number) => void
|
|
168
|
+
) => {
|
|
169
|
+
const status = getStatus(activeIndex, currentIndex, error, disabled);
|
|
170
|
+
|
|
171
|
+
if (status === 'completed' && onPress) {
|
|
172
|
+
return () => onPress(item, currentIndex);
|
|
173
|
+
}
|
|
174
|
+
return undefined;
|
|
175
|
+
};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import React, {
|
|
2
|
+
forwardRef,
|
|
3
|
+
ForwardRefRenderFunction,
|
|
4
|
+
useContext,
|
|
5
|
+
useImperativeHandle,
|
|
6
|
+
useRef,
|
|
7
|
+
} from 'react';
|
|
8
|
+
import {Animated, Easing, TouchableOpacity} from 'react-native';
|
|
9
|
+
import {SuggestActionProps, SuggestActionRef} from './types';
|
|
10
|
+
import {
|
|
11
|
+
ApplicationContext,
|
|
12
|
+
Button,
|
|
13
|
+
Icon,
|
|
14
|
+
Image,
|
|
15
|
+
Shadow,
|
|
16
|
+
Text,
|
|
17
|
+
} from '@momo-kits/foundation';
|
|
18
|
+
import styles from './styles';
|
|
19
|
+
|
|
20
|
+
const DURATION = 200;
|
|
21
|
+
|
|
22
|
+
const SuggestAction: ForwardRefRenderFunction<
|
|
23
|
+
SuggestActionRef,
|
|
24
|
+
SuggestActionProps
|
|
25
|
+
> = (
|
|
26
|
+
{
|
|
27
|
+
image,
|
|
28
|
+
onPressButton = () => {},
|
|
29
|
+
onClose,
|
|
30
|
+
bottom = 72,
|
|
31
|
+
message = 'Message',
|
|
32
|
+
buttonTitle = 'Button',
|
|
33
|
+
boldMessage,
|
|
34
|
+
},
|
|
35
|
+
ref
|
|
36
|
+
) => {
|
|
37
|
+
const {theme} = useContext(ApplicationContext);
|
|
38
|
+
const opacity = useRef(new Animated.Value(0)).current;
|
|
39
|
+
|
|
40
|
+
useImperativeHandle(ref, () => ({show}));
|
|
41
|
+
const show = () => {
|
|
42
|
+
Animated.timing(opacity, {
|
|
43
|
+
toValue: 1,
|
|
44
|
+
duration: DURATION,
|
|
45
|
+
useNativeDriver: false,
|
|
46
|
+
easing: Easing.linear,
|
|
47
|
+
}).start();
|
|
48
|
+
};
|
|
49
|
+
const hide = () => {
|
|
50
|
+
Animated.timing(opacity, {
|
|
51
|
+
toValue: 0,
|
|
52
|
+
duration: DURATION,
|
|
53
|
+
easing: Easing.linear,
|
|
54
|
+
useNativeDriver: false,
|
|
55
|
+
}).start();
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const handleClose = () => {
|
|
59
|
+
onClose?.();
|
|
60
|
+
hide();
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const handleButtonPress = () => {
|
|
64
|
+
onPressButton?.();
|
|
65
|
+
hide();
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const renderMessage = () => {
|
|
69
|
+
if (!!boldMessage) {
|
|
70
|
+
let splitMessage = [];
|
|
71
|
+
let index = message.toLowerCase().indexOf(boldMessage.toLowerCase());
|
|
72
|
+
if (index !== -1) {
|
|
73
|
+
splitMessage = [
|
|
74
|
+
message.substring(0, index),
|
|
75
|
+
boldMessage,
|
|
76
|
+
message.substring(index + boldMessage.length),
|
|
77
|
+
];
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<Text style={styles.content} typography={'body_default_regular'}>
|
|
81
|
+
{splitMessage[0]}
|
|
82
|
+
<Text typography={'action_s_bold'}>{splitMessage[1]}</Text>
|
|
83
|
+
{splitMessage[2]}
|
|
84
|
+
</Text>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return (
|
|
90
|
+
<Text style={styles.content} typography={'description_default_regular'}>
|
|
91
|
+
{message}
|
|
92
|
+
</Text>
|
|
93
|
+
);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<Animated.View
|
|
98
|
+
style={[
|
|
99
|
+
styles.container,
|
|
100
|
+
{
|
|
101
|
+
backgroundColor: theme.colors.background.surface,
|
|
102
|
+
opacity,
|
|
103
|
+
bottom,
|
|
104
|
+
},
|
|
105
|
+
Shadow.Light,
|
|
106
|
+
]}>
|
|
107
|
+
{!!image && <Image source={{uri: image}} style={styles.image} />}
|
|
108
|
+
{renderMessage()}
|
|
109
|
+
<Button
|
|
110
|
+
type="tonal"
|
|
111
|
+
title={buttonTitle}
|
|
112
|
+
onPress={handleButtonPress}
|
|
113
|
+
size={'small'}
|
|
114
|
+
full={false}
|
|
115
|
+
/>
|
|
116
|
+
<TouchableOpacity style={styles.closeIcon} onPress={handleClose}>
|
|
117
|
+
<Icon source={'navigation_close'} />
|
|
118
|
+
</TouchableOpacity>
|
|
119
|
+
</Animated.View>
|
|
120
|
+
);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export default forwardRef(SuggestAction);
|
|
124
|
+
export type {SuggestActionRef, SuggestActionProps};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@momo-kits/suggest-action",
|
|
3
|
+
"version": "0.157.1-beta.4",
|
|
4
|
+
"private": false,
|
|
5
|
+
"main": "index.tsx",
|
|
6
|
+
"peerDependencies": {
|
|
7
|
+
"@momo-kits/foundation": "latest",
|
|
8
|
+
"react": "*",
|
|
9
|
+
"react-native": "*"
|
|
10
|
+
},
|
|
11
|
+
"license": "MoMo",
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"registry": "https://registry.npmjs.org/"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {}
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
if [ "$1" == "stable" ]; then
|
|
4
|
+
npm version $(npm view @momo-kits/foundation@stable version)
|
|
5
|
+
npm version patch
|
|
6
|
+
npm publish --tag stable --access=public
|
|
7
|
+
elif [ "$1" == "latest" ]; then
|
|
8
|
+
npm publish --tag latest --access=public
|
|
9
|
+
elif [ "$1" == "beta" ]; then
|
|
10
|
+
npm publish --tag beta --access=public
|
|
11
|
+
else
|
|
12
|
+
npm publish --tag alpha --access=public
|
|
13
|
+
fi
|
|
14
|
+
|
|
15
|
+
PACKAGE_NAME=$(npm pkg get name)
|
|
16
|
+
NEW_PACKAGE_VERSION=$(npm pkg get version)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {Dimensions, StyleSheet} from 'react-native';
|
|
2
|
+
import {Radius, Spacing} from '@momo-kits/foundation';
|
|
3
|
+
|
|
4
|
+
const screenWidth = Dimensions.get('window').width;
|
|
5
|
+
|
|
6
|
+
export default StyleSheet.create({
|
|
7
|
+
image: {
|
|
8
|
+
width: 32,
|
|
9
|
+
height: 32,
|
|
10
|
+
borderRadius: Radius.XS,
|
|
11
|
+
marginRight: Spacing.S,
|
|
12
|
+
},
|
|
13
|
+
container: {
|
|
14
|
+
flexDirection: 'row',
|
|
15
|
+
width: screenWidth - Spacing.M * 2,
|
|
16
|
+
marginHorizontal: Spacing.M,
|
|
17
|
+
padding: Spacing.M,
|
|
18
|
+
borderRadius: Radius.S,
|
|
19
|
+
alignItems: 'center',
|
|
20
|
+
position: 'absolute',
|
|
21
|
+
zIndex: 10,
|
|
22
|
+
},
|
|
23
|
+
content: {
|
|
24
|
+
flex: 1,
|
|
25
|
+
marginRight: Spacing.M,
|
|
26
|
+
},
|
|
27
|
+
closeIcon: {
|
|
28
|
+
marginLeft: Spacing.S,
|
|
29
|
+
},
|
|
30
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export type SuggestActionProps = {
|
|
2
|
+
/**
|
|
3
|
+
* Optional. A callback function that is triggered when the action suggestion is closed.
|
|
4
|
+
*/
|
|
5
|
+
onClose?: () => void;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Optional. A callback function that is triggered when the action button is pressed.
|
|
9
|
+
*/
|
|
10
|
+
onPressButton?: () => void;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The image associated with the action, typically displayed as part of the suggestion.
|
|
14
|
+
*/
|
|
15
|
+
image?: string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Optional. Specifies the bottom margin for the component. Useful for positioning or spacing within a layout.
|
|
19
|
+
*/
|
|
20
|
+
bottom?: number;
|
|
21
|
+
|
|
22
|
+
message: string;
|
|
23
|
+
buttonTitle: string;
|
|
24
|
+
boldMessage?: string;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A reference type for the SuggestAction component.
|
|
29
|
+
* Allows external control over the visibility of the SuggestAction component.
|
|
30
|
+
*/
|
|
31
|
+
export type SuggestActionRef = {
|
|
32
|
+
/**
|
|
33
|
+
* A method to show the SuggestAction component. Can be called to display the component when needed.
|
|
34
|
+
*/
|
|
35
|
+
show: () => void;
|
|
36
|
+
};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import React, {
|
|
2
|
+
forwardRef,
|
|
3
|
+
ForwardRefRenderFunction,
|
|
4
|
+
useContext,
|
|
5
|
+
useImperativeHandle,
|
|
6
|
+
useRef,
|
|
7
|
+
} from 'react';
|
|
8
|
+
import {Animated, Dimensions, TouchableHighlight, View} from 'react-native';
|
|
9
|
+
import {Swipeable} from 'react-native-gesture-handler';
|
|
10
|
+
import {ApplicationContext, Colors, Icon, Text} from '@momo-kits/foundation';
|
|
11
|
+
import {SwipeableRef, SwipeAction, SwipeProps} from './types';
|
|
12
|
+
import styles from './styles';
|
|
13
|
+
|
|
14
|
+
const ACTION_WIDTH = 56;
|
|
15
|
+
|
|
16
|
+
export const Swipe: ForwardRefRenderFunction<SwipeableRef, SwipeProps> = (
|
|
17
|
+
{children, leftActions, rightActions, height = 56, itemRadius, ...props},
|
|
18
|
+
ref
|
|
19
|
+
) => {
|
|
20
|
+
const {theme} = useContext(ApplicationContext);
|
|
21
|
+
const screenWidth = Dimensions.get('window').width;
|
|
22
|
+
const swipeableRef = useRef<Swipeable>(null);
|
|
23
|
+
|
|
24
|
+
const renderActionItem = (
|
|
25
|
+
action: SwipeAction,
|
|
26
|
+
index: number,
|
|
27
|
+
length: number,
|
|
28
|
+
direction: 'left' | 'right',
|
|
29
|
+
dragX: Animated.AnimatedInterpolation<number | string>
|
|
30
|
+
) => {
|
|
31
|
+
const {
|
|
32
|
+
label,
|
|
33
|
+
icon,
|
|
34
|
+
onPress,
|
|
35
|
+
backgroundColor = theme.colors.highlight.primary,
|
|
36
|
+
} = action;
|
|
37
|
+
|
|
38
|
+
let inputRange = [0, ACTION_WIDTH * length];
|
|
39
|
+
let outputRange = [-ACTION_WIDTH * (index + 1), 0];
|
|
40
|
+
|
|
41
|
+
let zIndex = -index;
|
|
42
|
+
|
|
43
|
+
if (direction === 'right') {
|
|
44
|
+
inputRange = [-ACTION_WIDTH * length, 0];
|
|
45
|
+
outputRange = [0, ACTION_WIDTH * (length - index)];
|
|
46
|
+
zIndex = index;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const translateX = dragX.interpolate({
|
|
50
|
+
inputRange,
|
|
51
|
+
outputRange,
|
|
52
|
+
extrapolate: 'clamp',
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<TouchableHighlight
|
|
57
|
+
key={`swipe-action-${direction}-${index}`}
|
|
58
|
+
underlayColor={Colors.black_01}
|
|
59
|
+
activeOpacity={0.8}
|
|
60
|
+
style={{zIndex: zIndex}}
|
|
61
|
+
onPress={onPress}>
|
|
62
|
+
<Animated.View
|
|
63
|
+
style={[
|
|
64
|
+
styles.action,
|
|
65
|
+
{
|
|
66
|
+
backgroundColor,
|
|
67
|
+
transform: [{translateX}],
|
|
68
|
+
width: ACTION_WIDTH,
|
|
69
|
+
borderRadius: itemRadius,
|
|
70
|
+
},
|
|
71
|
+
]}>
|
|
72
|
+
{!!icon && <Icon source={icon} color={Colors.black_01} />}
|
|
73
|
+
<Text
|
|
74
|
+
style={styles.textCenter}
|
|
75
|
+
numberOfLines={1}
|
|
76
|
+
color={Colors.black_01}
|
|
77
|
+
typography={'label_s_medium'}>
|
|
78
|
+
{label}
|
|
79
|
+
</Text>
|
|
80
|
+
</Animated.View>
|
|
81
|
+
</TouchableHighlight>
|
|
82
|
+
);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const renderActions = (
|
|
86
|
+
actions: SwipeAction[] = [],
|
|
87
|
+
direction: 'left' | 'right',
|
|
88
|
+
dragX: Animated.AnimatedInterpolation<number | string>
|
|
89
|
+
) => {
|
|
90
|
+
let overlayPosition: {[key: string]: number} = {left: 0};
|
|
91
|
+
if (direction === 'right') {
|
|
92
|
+
overlayPosition = {right: 0};
|
|
93
|
+
}
|
|
94
|
+
return (
|
|
95
|
+
<View style={styles.row}>
|
|
96
|
+
<View
|
|
97
|
+
style={[
|
|
98
|
+
{
|
|
99
|
+
width: screenWidth,
|
|
100
|
+
backgroundColor: theme.colors.background.surface,
|
|
101
|
+
height: '100%',
|
|
102
|
+
zIndex: -10,
|
|
103
|
+
position: 'absolute',
|
|
104
|
+
},
|
|
105
|
+
overlayPosition,
|
|
106
|
+
]}
|
|
107
|
+
/>
|
|
108
|
+
{actions?.map((item, index) => {
|
|
109
|
+
//maximum 3 actions
|
|
110
|
+
if (index < 3) {
|
|
111
|
+
return renderActionItem(
|
|
112
|
+
item,
|
|
113
|
+
index,
|
|
114
|
+
actions?.length,
|
|
115
|
+
direction,
|
|
116
|
+
dragX
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
})}
|
|
120
|
+
</View>
|
|
121
|
+
);
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
useImperativeHandle(ref, () => ({
|
|
125
|
+
openLeft: () => swipeableRef?.current?.openLeft(),
|
|
126
|
+
openRight: () => swipeableRef?.current?.openRight(),
|
|
127
|
+
close: () => swipeableRef?.current?.close(),
|
|
128
|
+
}));
|
|
129
|
+
|
|
130
|
+
return (
|
|
131
|
+
<Swipeable
|
|
132
|
+
{...props}
|
|
133
|
+
containerStyle={[
|
|
134
|
+
styles.container,
|
|
135
|
+
{
|
|
136
|
+
height,
|
|
137
|
+
},
|
|
138
|
+
]}
|
|
139
|
+
ref={swipeableRef}
|
|
140
|
+
renderRightActions={(progressAnimatedValue, dragAnimatedValue) =>
|
|
141
|
+
renderActions(rightActions, 'right', dragAnimatedValue)
|
|
142
|
+
}
|
|
143
|
+
renderLeftActions={(progressAnimatedValue, dragAnimatedValue) =>
|
|
144
|
+
renderActions(leftActions, 'left', dragAnimatedValue)
|
|
145
|
+
}>
|
|
146
|
+
{children}
|
|
147
|
+
</Swipeable>
|
|
148
|
+
);
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
export default forwardRef(Swipe);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@momo-kits/swipe",
|
|
3
|
+
"version": "0.157.1-beta.4",
|
|
4
|
+
"private": false,
|
|
5
|
+
"main": "index.tsx",
|
|
6
|
+
"peerDependencies": {
|
|
7
|
+
"@momo-kits/foundation": "latest",
|
|
8
|
+
"react": "*",
|
|
9
|
+
"react-native": "*"
|
|
10
|
+
},
|
|
11
|
+
"license": "MoMo",
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"registry": "https://registry.npmjs.org/"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {}
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
if [ "$1" == "stable" ]; then
|
|
4
|
+
npm version $(npm view @momo-kits/foundation@stable version)
|
|
5
|
+
npm version patch
|
|
6
|
+
npm publish --tag stable --access=public
|
|
7
|
+
elif [ "$1" == "latest" ]; then
|
|
8
|
+
npm publish --tag latest --access=public
|
|
9
|
+
elif [ "$1" == "beta" ]; then
|
|
10
|
+
npm publish --tag beta --access=public
|
|
11
|
+
else
|
|
12
|
+
npm publish --tag alpha --access=public
|
|
13
|
+
fi
|
|
14
|
+
|
|
15
|
+
PACKAGE_NAME=$(npm pkg get name)
|
|
16
|
+
NEW_PACKAGE_VERSION=$(npm pkg get version)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {StyleSheet} from 'react-native';
|
|
2
|
+
|
|
3
|
+
export default StyleSheet.create({
|
|
4
|
+
action: {
|
|
5
|
+
height: '100%',
|
|
6
|
+
alignItems: 'center',
|
|
7
|
+
justifyContent: 'center',
|
|
8
|
+
},
|
|
9
|
+
row: {
|
|
10
|
+
flexDirection: 'row',
|
|
11
|
+
},
|
|
12
|
+
textCenter: {
|
|
13
|
+
textAlign: 'center',
|
|
14
|
+
},
|
|
15
|
+
container: {width: '100%'},
|
|
16
|
+
});
|