@momo-kits/native-kits 0.163.1-beta.16 → 0.163.1-beta.17-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.
Files changed (152) hide show
  1. package/build.gradle.kts +11 -0
  2. package/compose/build.gradle.kts +190 -0
  3. package/compose/build.gradle.kts.backup +190 -0
  4. package/compose/compose.podspec +47 -0
  5. package/compose/src/androidMain/kotlin/vn/momo/kits/navigation/ScrollToTop.android.kt +6 -0
  6. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/OsFontScale.android.kt +7 -0
  7. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +150 -0
  8. package/compose/src/commonMain/composeResources/font/momosignature.otf +0 -0
  9. package/compose/src/commonMain/composeResources/font/momotrustdisplay.otf +0 -0
  10. package/compose/src/commonMain/composeResources/font/sfprotext_black.otf +0 -0
  11. package/compose/src/commonMain/composeResources/font/sfprotext_black.ttf +0 -0
  12. package/compose/src/commonMain/composeResources/font/sfprotext_bold.ttf +0 -0
  13. package/compose/src/commonMain/composeResources/font/sfprotext_heavy.ttf +0 -0
  14. package/compose/src/commonMain/composeResources/font/sfprotext_light.ttf +0 -0
  15. package/compose/src/commonMain/composeResources/font/sfprotext_medium.ttf +0 -0
  16. package/compose/src/commonMain/composeResources/font/sfprotext_regular.ttf +0 -0
  17. package/compose/src/commonMain/composeResources/font/sfprotext_semibold.ttf +0 -0
  18. package/compose/src/commonMain/composeResources/font/sfprotext_thin.otf +0 -0
  19. package/compose/src/commonMain/composeResources/font/sfprotext_thin.ttf +0 -0
  20. package/compose/src/commonMain/composeResources/font/sfprotext_ultralight.otf +0 -0
  21. package/compose/src/commonMain/composeResources/font/sfprotext_ultralight.ttf +0 -0
  22. package/compose/src/commonMain/kotlin/vn/momo/kits/application/AnimationSearchInput.kt +52 -0
  23. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +106 -0
  24. package/compose/src/commonMain/kotlin/vn/momo/kits/application/FloatingButton.kt +183 -0
  25. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Header.kt +207 -0
  26. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderAnimated.kt +39 -0
  27. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderBackground.kt +86 -0
  28. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderDefault.kt +76 -0
  29. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderExtended.kt +76 -0
  30. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderRight.kt +293 -0
  31. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderTitle.kt +33 -0
  32. package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +826 -0
  33. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Localize.kt +269 -0
  34. package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +110 -0
  35. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +378 -0
  36. package/compose/src/commonMain/kotlin/vn/momo/kits/application/WidgetContainer.kt +56 -0
  37. package/compose/src/commonMain/kotlin/vn/momo/kits/application/useHeaderSearchAnimation.kt +69 -0
  38. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +157 -0
  39. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +82 -0
  40. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +32 -0
  41. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +338 -0
  42. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +175 -0
  43. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +356 -0
  44. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +113 -0
  45. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +89 -0
  46. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +128 -0
  47. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +209 -0
  48. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +542 -0
  49. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +23 -0
  50. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +76 -0
  51. package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +125 -0
  52. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +231 -0
  53. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +112 -0
  54. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +477 -0
  55. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +114 -0
  56. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +214 -0
  57. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +240 -0
  58. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +216 -0
  59. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +259 -0
  60. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +182 -0
  61. package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +343 -0
  62. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +108 -0
  63. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +56 -0
  64. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +41 -0
  65. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +84 -0
  66. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +40 -0
  67. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +328 -0
  68. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +97 -0
  69. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +310 -0
  70. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +59 -0
  71. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +87 -0
  72. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +21 -0
  73. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +90 -0
  74. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +323 -0
  75. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +217 -0
  76. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +473 -0
  77. package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +122 -0
  78. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +199 -0
  79. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +91 -0
  80. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +470 -0
  81. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +88 -0
  82. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +131 -0
  83. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +203 -0
  84. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +498 -0
  85. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +175 -0
  86. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +182 -0
  87. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +193 -0
  88. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +29 -0
  89. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +234 -0
  90. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +188 -0
  91. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +325 -0
  92. package/compose/src/commonMain/kotlin/vn/momo/kits/const/KitFontScale.kt +22 -0
  93. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +12 -0
  94. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +16 -0
  95. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +188 -0
  96. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +276 -0
  97. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +52 -0
  98. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +38 -0
  99. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +39 -0
  100. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +52 -0
  101. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +66 -0
  102. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +11 -0
  103. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +104 -0
  104. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +48 -0
  105. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Size.kt +51 -0
  106. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +299 -0
  107. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +129 -0
  108. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +100 -0
  109. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +172 -0
  110. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +372 -0
  111. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ScrollToTop.kt +8 -0
  112. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +581 -0
  113. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +156 -0
  114. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +225 -0
  115. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +86 -0
  116. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +169 -0
  117. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +320 -0
  118. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +81 -0
  119. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +309 -0
  120. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +34 -0
  121. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +360 -0
  122. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +132 -0
  123. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +127 -0
  124. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +91 -0
  125. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/OsFontScale.kt +9 -0
  126. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +69 -0
  127. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +1329 -0
  128. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +55 -0
  129. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +15 -0
  130. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +105 -0
  131. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +32 -0
  132. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/OsFontScale.ios.kt +66 -0
  133. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +207 -0
  134. package/gradle/libs.versions.toml +69 -0
  135. package/gradle/wrapper/gradle-wrapper.jar +0 -0
  136. package/gradle/wrapper/gradle-wrapper.properties +8 -0
  137. package/gradle.properties +26 -0
  138. package/gradlew +252 -0
  139. package/gradlew.bat +94 -0
  140. package/ios/Application/Components.swift +14 -14
  141. package/ios/Application/HeaderRight.swift +79 -45
  142. package/ios/Application/Navigation/component/Header.swift +1 -1
  143. package/ios/Button/Button.swift +20 -14
  144. package/ios/native-kits.podspec +1 -1
  145. package/ios-demo/MoMoUIKitsDemo.podspec +1 -1
  146. package/ios-demo/README.md +120 -0
  147. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ButtonDemo.swift +66 -211
  148. package/package.json +1 -1
  149. package/settings.gradle.kts +64 -0
  150. package/.claude/settings.local.json +0 -85
  151. package/ios/Application/Navigation/component/HeaderRightWidthKey.swift +0 -11
  152. package/ios/Application/Navigation/component/NavigationHeaderRight.swift +0 -196
@@ -0,0 +1,120 @@
1
+ # MoMoUIKitsDemo
2
+
3
+ SwiftUI demo browser for `MoMoUIKits`.
4
+
5
+ The package can optionally host a Compose UIKits screen by receiving a
6
+ `UIViewController` factory from the host app. It does not import the KMP
7
+ `shared` module directly.
8
+
9
+ SwiftUI mode reuses the full demo screen set from
10
+ `sample/iosApp/iosApp/Demo`, including the sample `HomeView` registry and demo
11
+ screens for all currently available components.
12
+
13
+ ## CocoaPods
14
+
15
+ In the host app `Podfile`, include both local pods:
16
+
17
+ ```ruby
18
+ pod 'MoMoUIKits', :path => '../momo-native-kits/ios/native-kits.podspec'
19
+ pod 'MoMoUIKitsDemo', :path => '../momo-native-kits/ios-demo'
20
+ ```
21
+
22
+ Adjust the relative paths to match the host app checkout.
23
+
24
+ ## Host App Usage
25
+
26
+ ```swift
27
+ import MoMoUIKitsDemo
28
+ import shared
29
+
30
+ class UIKitsViewController: BaseComposeAppViewController {
31
+ override func getViewController() -> UIViewController? {
32
+ let params = self.application.data as? [String: Any]
33
+
34
+ return MoMoUIKitsDemoViewControllerFactory.make(
35
+ context: MoMoUIKitsDemoContext(
36
+ appId: params?["appId"] as? String ?? "",
37
+ appCode: params?["code"] as? String ?? "",
38
+ appName: params?["name"] as? String,
39
+ appIcon: params?["icon"] as? String ?? ""
40
+ ),
41
+ composeViewController: {
42
+ UIKitsScreenComposeViewControllerKt.UIKitsScreenComposeViewController(
43
+ params: params
44
+ )
45
+ }
46
+ )
47
+ }
48
+
49
+ override func viewDidDisappear(_ animated: Bool) {
50
+ super.viewDidDisappear(animated)
51
+ composeViewController = nil
52
+ }
53
+ }
54
+ ```
55
+
56
+ If the host does not pass `composeViewController`, the demo opens directly in
57
+ SwiftUI mode.
58
+
59
+ ## Included SwiftUI Demos
60
+
61
+ The pod includes the sample demo screens for:
62
+
63
+ - Animated Header
64
+ - Avatar
65
+ - Badge
66
+ - Baseline View
67
+ - Bottom Tab
68
+ - Button
69
+ - Carousel
70
+ - Checkbox
71
+ - Chip
72
+ - Collapse
73
+ - DateTimePicker
74
+ - Divider
75
+ - Header User
76
+ - Icon Button
77
+ - Image
78
+ - Information
79
+ - Input
80
+ - Input DropDown
81
+ - Input Money
82
+ - Input OTP
83
+ - Input Phone Number
84
+ - Input Search
85
+ - Input TextArea
86
+ - Loader
87
+ - Navigation
88
+ - Pagination
89
+ - Popup Display
90
+ - Popup Notify
91
+ - Popup Promotion
92
+ - Progress Info
93
+ - Radio
94
+ - Rating
95
+ - Skeleton
96
+ - Slider
97
+ - SnackBar
98
+ - Stepper
99
+ - Steps
100
+ - Suggest Action
101
+ - Swipe
102
+ - Switch
103
+ - TabView
104
+ - Tag
105
+ - Theme
106
+ - Title
107
+ - Tooltip
108
+ - Typography
109
+ - Uploader
110
+
111
+ ## Validation Notes
112
+
113
+ Validated locally with:
114
+
115
+ ```sh
116
+ pod ipc spec ios/MoMoUIKits.podspec
117
+ pod ipc spec ios-demo/MoMoUIKitsDemo.podspec
118
+ pod lib lint ios/MoMoUIKits.podspec --allow-warnings --skip-import-validation
119
+ pod lib lint ios-demo/MoMoUIKitsDemo.podspec --allow-warnings --skip-import-validation --include-podspecs=ios/MoMoUIKits.podspec
120
+ ```
@@ -1,245 +1,100 @@
1
1
  //
2
- // ButtonDemo.swift
3
- // MoMoUIKitsDemo
2
+ // Foundation.swift
3
+ // Example
4
4
  //
5
- // SwiftUI port of the Compose demo `sample/shared/.../screens/ButtonUsage.kt`:
6
- // Preview tab mirrors `PreviewButton`, Playground tab mirrors `PlaygroundButton`.
5
+ // Created by Wem on 13/12/2022.
7
6
  //
8
7
 
9
8
  import Foundation
9
+ import Lottie
10
10
  import MoMoUIKits
11
11
  import SwiftUI
12
12
 
13
- // Mirror the option lists in Compose `DemoScreen.kt`.
14
- private let buttonTypeList: [(key: String, value: ButtonType)] = [
15
- ("primary", .primary),
16
- ("secondary", .secondary),
17
- ("tonal", .tonal),
18
- ("outline", .outline),
19
- ("danger", .danger),
20
- ("text", .text),
21
- ("disabled", .disabled),
22
- ]
23
-
24
- private let sizeList: [(key: String, value: ButtonSize)] = [
25
- ("large", .large),
26
- ("medium", .medium),
27
- ("small", .small),
28
- ]
29
-
30
- // Subset of the Compose `Icons` map — names resolved via `Icon(source:)` / icon.json.
31
- private let iconOptionList: [String] = [
32
- "none",
33
- "arrow_arrow-back",
34
- "arrow_arrow-next",
35
- "Phonebook",
36
- ]
37
-
38
13
  // MARK: - ButtonDemo
39
14
 
40
15
  struct ButtonDemo: View {
41
- @State private var tab = 0
42
-
43
- var body: some View {
44
- VStack(spacing: 0) {
45
- // Stand-in for Compose `DemoScreen`'s Preview/Playground bottom tabs.
46
- Picker("", selection: $tab) {
47
- Text("Preview").tag(0)
48
- Text("Playground").tag(1)
49
- }
50
- .pickerStyle(.segmented)
51
- .padding(.horizontal, 12)
52
- .padding(.top, 8)
53
-
54
- if tab == 0 {
55
- PreviewButton()
56
- } else {
57
- PlaygroundButton()
58
- }
59
- }
60
- }
61
- }
62
-
63
- // MARK: - PreviewButton
64
-
65
- private struct PreviewButton: View {
66
- private let url = "https://static-00.iconduck.com/assets.00/external-link-icon-512x512-h2zzryfc.png"
16
+ // MARK: Internal
67
17
 
68
18
  var body: some View {
69
19
  ScrollView {
70
- VStack(spacing: 0) {
71
- ButtonSectionBox(title: "Title") {
72
- Button(title: "Open", action: {})
73
- }
20
+ VStack {
21
+ Toggle("Disabled", isOn: $disabled)
74
22
 
75
- ButtonSectionBox(title: "Type") {
76
- Button(title: "PRIMARY", action: {}, type: .primary)
77
- Button(title: "DANGER", action: {}, type: .danger)
78
- Button(title: "SECONDARY", action: {}, type: .secondary)
79
- Button(title: "TONAL", action: {}, type: .tonal)
80
- Button(title: "OUTLINE", action: {}, type: .outline)
81
- Button(title: "TEXT", action: {}, type: .text)
82
- Button(title: "DISABLED", action: {}, type: .disabled)
23
+ Group {
24
+ Button(title: "Button", action: onPress, type: disabled ? .disabled : .primary, size: .large,
25
+ iconRight: AnyView(Image(systemName: "checkmark.circle")))
26
+ Button(title: "Button", action: onPress, size: .small)
83
27
  }
84
28
 
85
- ButtonSectionBox(title: "Size") {
86
- Button(title: "LARGE", action: {}, size: .large)
87
- Button(title: "MEDIUM", action: {}, size: .medium)
88
- Button(title: "SMALL", action: {}, size: .small)
29
+ Group {
30
+ Button(title: "Button", action: onPress, type: .danger,
31
+ iconLeft: AnyView(Image(systemName: "checkmark.circle")))
32
+ Button(title: "Button", action: onPress, type: .danger, size: .medium)
33
+ Button(title: "Button", action: onPress, type: .danger, size: .small)
89
34
  }
90
-
91
- ButtonSectionBox(title: "Loading") {
92
- Button(title: "PRIMARY", action: {}, type: .primary, loading: true)
93
- Button(title: "DANGER", action: {}, type: .danger, loading: true)
94
- Button(title: "SECONDARY", action: {}, type: .secondary, loading: true)
95
- Button(title: "TONAL", action: {}, type: .tonal, loading: true)
96
- Button(title: "OUTLINE", action: {}, type: .outline, loading: true)
97
- Button(title: "TEXT", action: {}, type: .text, loading: true)
98
- Button(title: "DISABLED", action: {}, type: .disabled, loading: true)
35
+
36
+ Group {
37
+ Button(title: "Button", action: onPress, type: .danger, iconLeft: AnyView(Image(systemName: "checkmark.circle")), isFull: false)
38
+ Button(title: "Button", action: onPress, type: .danger, size: .medium, isFull: false)
39
+ Button(title: "Button", action: onPress, type: .danger, size: .small, isFull: false)
99
40
  }
100
41
 
101
- ButtonSectionBox(title: "Icon Right") {
102
- Button(title: "Icon", action: {}, iconRight: AnyView(ImageView(url, loading: false)))
103
- }
104
42
 
105
- ButtonSectionBox(title: "Icon Left") {
106
- Button(title: "Icon", action: {}, iconLeft: AnyView(ImageView(url, loading: false)))
43
+ Group {
44
+ Button(title: "Button", action: onPress, type: .tonal, size: .large)
45
+ Button(title: "Button", action: onPress, type: .tonal, size: .medium)
46
+ Button(title: "Button", action: onPress, type: .tonal, size: .small)
107
47
  }
108
- }
109
- }
110
- }
111
- }
112
-
113
- // MARK: - PlaygroundButton
114
48
 
115
- private struct PlaygroundButton: View {
116
- @State private var title: String = "Button"
117
- @State private var type: AnyHashable = "primary"
118
- @State private var size: AnyHashable = "large"
119
- @State private var iconRight: AnyHashable = "none"
120
- @State private var iconLeft: AnyHashable = "none"
121
- @State private var full = true
122
- @State private var loading = false
123
- @State private var useTintColor = true
124
-
125
- var body: some View {
126
- VStack(spacing: 0) {
127
- ButtonSectionBox(title: "Component", alignment: .leading) {
128
- Button(
129
- title: title,
130
- action: {},
131
- type: buttonTypeList.first { $0.key == type }?.value ?? .primary,
132
- size: sizeList.first { $0.key == size }?.value ?? .large,
133
- iconLeft: iconView(iconLeft),
134
- iconRight: iconView(iconRight),
135
- isFull: full,
136
- loading: loading,
137
- useTintColor: useTintColor
138
- )
139
- }
140
-
141
- ScrollView {
142
- ButtonSectionBox(title: "Props", alignment: .leading) {
143
- PropTitle("Children")
144
- Input(text: $title)
145
- PropGap()
146
-
147
- PropTitle("Type")
148
- RadioGroup(options: buttonTypeList.map(\.key), selection: $type)
149
- PropGap()
150
-
151
- PropTitle("Size")
152
- RadioGroup(options: sizeList.map(\.key), selection: $size)
153
- PropGap()
154
-
155
- PropTitle("Full")
156
- Checkbox($full, title: "\(full)")
157
- PropGap()
158
-
159
- PropTitle("Iconright")
160
- RadioGroup(options: iconOptionList, selection: $iconRight)
161
- PropGap()
162
-
163
- PropTitle("Iconleft")
164
- RadioGroup(options: iconOptionList, selection: $iconLeft)
165
- PropGap()
166
-
167
- PropTitle("Loading")
168
- Checkbox($loading, title: "\(loading)")
169
- PropGap()
170
-
171
- PropTitle("Usetinecolor")
172
- Checkbox($useTintColor, title: "\(useTintColor)")
49
+ Group {
50
+ Button(title: "Tinted icon", action: onPress, type: .primary,
51
+ iconLeft: AnyView(Image(systemName: "checkmark.circle")), useTintColor: true)
52
+ Button(title: "Original icon", action: onPress, type: .primary,
53
+ iconLeft: AnyView(Image(systemName: "checkmark.circle")), useTintColor: false)
173
54
  }
174
- }
175
- }
176
- }
177
-
178
- private func iconView(_ selection: AnyHashable) -> AnyView? {
179
- guard let name = selection as? String, name != "none" else { return nil }
180
- return AnyView(Icon(source: name))
181
- }
182
- }
183
-
184
- // MARK: - Playground helpers
185
55
 
186
- private struct PropTitle: View {
187
- let title: String
188
-
189
- init(_ title: String) { self.title = title }
190
-
191
- var body: some View {
192
- MomoText(title, typography: .headerDefaultBold)
193
- }
194
- }
56
+ Group {
57
+ Button(title: "Button", action: onPress, type: .secondary, size: .large)
58
+ Button(title: "Button", action: onPress, type: .secondary, size: .medium)
59
+ Button(title: "Button", action: onPress, type: .secondary, size: .small)
60
+ }
195
61
 
196
- private struct PropGap: View {
197
- var body: some View {
198
- Spacer().frame(height: Spacing.L)
199
- }
200
- }
62
+ Group {
63
+ Button(title: "Button", action: onPress, type: .text, size: .large)
64
+ Button(title: "Button", action: onPress, type: .text, size: .medium)
65
+ Button(title: "Button", action: onPress, type: .text, size: .small)
66
+ }
201
67
 
202
- private struct RadioGroup: View {
203
- let options: [String]
204
- @Binding var selection: AnyHashable
68
+ Group {
69
+ Button(title: "Button", action: onPress, type: .outline, size: .large)
70
+ Button(title: "Button", action: onPress, type: .outline, size: .medium)
71
+ Button(title: "Button", action: onPress, type: .outline, size: .small)
72
+ }
205
73
 
206
- var body: some View {
207
- ForEach(options, id: \.self) { key in
208
- Radio(value: key, groupValue: $selection, label: key)
209
- }
74
+ Group {
75
+ Button(title: "Button", action: onPress, type: .disabled, size: .large)
76
+ Button(title: "Button", action: onPress, type: .disabled, size: .medium)
77
+ Button(title: "Button", action: onPress, type: .disabled, size: .small)
78
+ }
79
+ Group {
80
+ Button(title: "Button", action: onPress, type: .primary, size: .medium, loading: true)
81
+ Button(title: "Button", action: onPress, type: .danger, size: .medium, iconLeft: AnyView(Image(systemName: "checkmark.circle")), loading: true)
82
+ Button(title: "Button", action: onPress, type: .disabled, size: .medium, iconRight: AnyView(Image(systemName: "checkmark.circle")), loading: true)
83
+ Button(title: "Button", action: onPress, type: .outline, size: .medium, iconLeft: AnyView(Image(systemName: "checkmark.circle")), iconRight: AnyView(Image(systemName: "checkmark.circle")), loading: true)
84
+ Button(title: "Button", action: onPress, type: .secondary, size: .medium, loading: true)
85
+ Button(title: "Button", action: onPress, type: .text, size: .medium, loading: true)
86
+ Button(title: "Button", action: onPress, type: .tonal, size: .medium, loading: true)
87
+ }
88
+ }.padding(16)
89
+ }.padding(.top)
210
90
  }
211
- }
212
91
 
213
- // MARK: - ButtonSectionBox
214
-
215
- /// Titled rounded-card section container, mirroring Compose's `BasicColumnBox`.
216
- private struct ButtonSectionBox<Content: View>: View {
217
- @Environment(\.appTheme) private var theme
218
- let title: String
219
- var alignment: HorizontalAlignment = .center
220
- @ViewBuilder let content: () -> Content
221
-
222
- var body: some View {
223
- VStack(alignment: .leading, spacing: 8) {
224
- if !title.isEmpty {
225
- MomoText(title, typography: .headerMBold)
226
- .padding(.top, 8)
227
- }
228
-
229
- VStack(alignment: alignment, spacing: 8) {
230
- content()
231
- }
232
- .frame(maxWidth: .infinity, alignment: alignment == .leading ? .leading : .center)
233
- .padding(12)
234
- .background(theme.colors.background.surface)
235
- .clipShape(RoundedRectangle(cornerRadius: Radius.M))
236
- }
237
- .padding(12)
92
+ func onPress() {
93
+ print("Button")
238
94
  }
239
- }
240
95
 
241
- // MARK: - Preview
96
+ // MARK: Private
242
97
 
243
- #Preview {
244
- ButtonDemo()
98
+ @State private var value: String = ""
99
+ @State private var disabled: Bool = false
245
100
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.163.1-beta.16",
3
+ "version": "0.163.1-beta.17-debug",
4
4
  "private": false,
5
5
  "dependencies": {},
6
6
  "devDependencies": {},
@@ -0,0 +1,64 @@
1
+ import org.gradle.kotlin.dsl.maven
2
+
3
+ rootProject.name = "momo-native-kits"
4
+ enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
5
+
6
+ pluginManagement {
7
+ repositories {
8
+ google {
9
+ mavenContent {
10
+ includeGroupAndSubgroups("androidx")
11
+ includeGroupAndSubgroups("com.android")
12
+ includeGroupAndSubgroups("com.google")
13
+ }
14
+ }
15
+ mavenCentral()
16
+ gradlePluginPortal()
17
+ maven {
18
+ url = uri("https://gitlab.mservice.com.vn/api/v4/projects/5400/packages/maven")
19
+ credentials {username = "download_packages"; password = "gldt-bjDqLpU_sPcHDuXau2ws" }
20
+ }
21
+ maven {
22
+ url = uri("https://artifacts.mservice.com.vn/repository/maven-momo-app/")
23
+ credentials {
24
+ username = "viewer"
25
+ password = "viewer"
26
+ }
27
+ isAllowInsecureProtocol = true
28
+ }
29
+ }
30
+ }
31
+
32
+ dependencyResolutionManagement {
33
+ repositories {
34
+ google {
35
+ mavenContent {
36
+ includeGroupAndSubgroups("androidx")
37
+ includeGroupAndSubgroups("com.android")
38
+ includeGroupAndSubgroups("com.google")
39
+ }
40
+ }
41
+ mavenCentral()
42
+ maven { url = uri("https://maven.pkg.jetbrains.space/public/p/compose/dev") }
43
+ maven {
44
+ url = uri("https://gitlab.mservice.com.vn/api/v4/projects/5400/packages/maven")
45
+ credentials {
46
+ username = "download_packages";
47
+ password = "gldt-bjDqLpU_sPcHDuXau2ws"
48
+ }
49
+ }
50
+ maven {
51
+ url = uri("https://artifacts.mservice.com.vn/repository/maven-momo-app/")
52
+ credentials {
53
+ username = "viewer"
54
+ password = "viewer"
55
+ }
56
+ isAllowInsecureProtocol = true
57
+ }
58
+ }
59
+ }
60
+
61
+ include(":compose")
62
+
63
+ include(":sample:androidApp")
64
+ include(":sample:shared")
@@ -1,85 +0,0 @@
1
- {
2
- "permissions": {
3
- "allow": [
4
- "Bash(curl -s -o /dev/null -w \"%{http_code}\" \"https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko-android/0.144.6/skiko-android-0.144.6.pom\")",
5
- "Bash(curl -s \"https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko-android/maven-metadata.xml\")",
6
- "Bash(curl -s \"https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko/maven-metadata.xml\")",
7
- "Bash(curl -s \"https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko/0.144.6/skiko-0.144.6.module\")",
8
- "Bash(curl -s -o /dev/null -w '%{http_code}' https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko-android/0.144.6/skiko-android-0.144.6.__TRACKED_VAR__)",
9
- "Bash(curl -s \"https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko-android/0.144.6/\")",
10
- "Bash(curl -s \"https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko-android/\")",
11
- "Bash(curl -s -o /dev/null -w \"%{http_code}\\\\n\" \"https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko-android/0.148.1/skiko-android-0.148.1.pom\")",
12
- "Bash(curl -s -o /dev/null -w \"%{http_code}\\\\n\" \"https://repo.maven.apache.org/maven2/org/jetbrains/skiko/skiko-android/0.144.5/skiko-android-0.144.5.pom\")",
13
- "Bash(curl -s -o /dev/null -w \"%{http_code}\\\\n\" \"https://dl.google.com/dl/android/maven2/org/jetbrains/skiko/skiko-android/0.144.6/skiko-android-0.144.6.pom\")",
14
- "Bash(curl -s \"https://search.maven.org/solrsearch/select?q=a:skiko-android&rows=5&wt=json\")",
15
- "Bash(curl -sL -o /dev/null -w \"%{http_code} %{url_effective}\\\\n\" \"https://repo1.maven.org/maven2/org/jetbrains/skiko/skiko-android/0.144.6/skiko-android-0.144.6.pom\")",
16
- "Bash(curl *)",
17
- "Bash(./gradlew :sample:androidApp:dependencies --configuration debugRuntimeClasspath)",
18
- "Bash(./gradlew :sample:shared:compileDebugKotlinAndroid)",
19
- "Bash(./gradlew :sample:androidApp:compileDebugKotlin)",
20
- "Bash(ls -d *.xcodeproj)",
21
- "Bash(grep -c ChipDemo.swift __TRACKED_VAR__/project.pbxproj)",
22
- "Bash(grep -c PBXFileSystemSynchronizedRootGroup __TRACKED_VAR__/project.pbxproj)",
23
- "Bash(grep -c InformationDemo.swift __TRACKED_VAR__/project.pbxproj)",
24
- "Bash(plutil -lint project.pbxproj)",
25
- "Bash(xcode-select -p)",
26
- "Bash(/usr/bin/xcrun xcodebuild *)",
27
- "Bash(echo \"exit: $?\")",
28
- "Bash(/Applications/Xcode26.app/Contents/Developer/usr/bin/xcodebuild -version)",
29
- "Bash(./gradlew :compose:tasks --all)",
30
- "Bash(grep -n \"vanniktech\\\\|mavenPublishing\\\\|^publishing\\\\|version = gitlabVersion\\\\|namespace =\\\\|compileSdk =\\\\|minSdk =\\\\|GitLabPackages\\\\|name = \\\\\"\\\\${gitlabRepo}Packages\\\\\"\")",
31
- "Bash(git checkout *)",
32
- "Bash(./gradlew :compose:publishAllPublicationsToGitLabPackagesRepository --dry-run)",
33
- "Bash(git fetch *)",
34
- "Bash(git pull *)",
35
- "Bash(git push *)",
36
- "Bash(git branch *)",
37
- "Bash(xcodebuild -workspace iosApp.xcworkspace -list)",
38
- "Bash(xcrun simctl *)",
39
- "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme iosApp -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14 Pro' -configuration Debug build CODE_SIGNING_ALLOWED=NO)",
40
- "Bash(pod install *)",
41
- "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme iosApp -sdk iphonesimulator -destination 'id=1E6F9A79-5E64-4590-BEA2-828D75D99393' -configuration Debug build CODE_SIGNING_ALLOWED=NO)",
42
- "Bash(xcrun swiftc *)",
43
- "Bash(echo \"=== exit: $? \\(1=none found\\) ===\")",
44
- "Bash(cat Radius.swift)",
45
- "Bash(cat Spacing.swift)",
46
- "Bash(echo \"exit=$?\")",
47
- "Bash(ruby *)",
48
- "Bash(xcodebuild -list -workspace iosApp.xcworkspace)",
49
- "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme MoMoUIKits -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14 Pro' build)",
50
- "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme MoMoUIKits -sdk iphonesimulator -destination 'platform=iOS Simulator,id=E6A899C0-098E-473A-95B8-A2BBD2D42A92' build)",
51
- "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme iosApp -sdk iphonesimulator -destination 'platform=iOS Simulator,id=E6A899C0-098E-473A-95B8-A2BBD2D42A92' build)",
52
- "Bash(xcodebuild build *)",
53
- "Bash(git stash *)",
54
- "Bash(plutil -lint sample/iosApp/iosApp.xcodeproj/project.pbxproj)",
55
- "Bash(git add *)",
56
- "Bash(git commit -m 'feat: DS-646 [ci build] *)",
57
- "Bash(git commit -q -m 'fix: DS-656 [ci build] *)",
58
- "Bash(xargs git log --oneline -1)",
59
- "Bash(git rev-list *)",
60
- "Bash(git status *)",
61
- "Bash(git rebase *)",
62
- "Bash(git merge *)",
63
- "Bash(git reset *)",
64
- "Bash(awk '/^ *)",
65
- "Bash(git ls-tree *)",
66
- "Bash(awk *)",
67
- "Read(//Users/sophia/Workspace/momo/momo-app/**)",
68
- "Bash(git log *)",
69
- "Bash(xcodebuild -version)",
70
- "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme iosApp -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -configuration Debug build CODE_SIGNING_ALLOWED=NO)",
71
- "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme MoMoUIKits -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -configuration Debug build CODE_SIGNING_ALLOWED=NO)",
72
- "Bash(xcodebuild -workspace iosApp.xcworkspace -scheme MoMoUIKits -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -configuration Debug clean build CODE_SIGNING_ALLOWED=NO)",
73
- "Bash(git commit *)",
74
- "Bash(npm view *)",
75
- "Bash(echo \"EXIT=$? -> not resolvable\")",
76
- "Bash(yarn install *)",
77
- "Bash(RCT_NEW_ARCH_ENABLED=1 pod install)",
78
- "Bash(xcodebuild -workspace MoMoPlatform.xcworkspace -list)",
79
- "Bash(git --no-pager diff --stat ios/Application/Localize.swift ios/Application/Navigation/NavigationContainer.swift ios/Popup/PopupDisplay.swift ios/Popup/PopupNotify.swift ios/Template/TrustBanner/TrustBanner.swift)",
80
- "Bash(git rm *)",
81
- "Bash(echo \"EXIT=$?\")",
82
- "Bash(git -C /Users/sophia/Workspace/momo/momo-native-kits diff sample/iosApp/iosApp/Demo/ButtonDemo.swift)"
83
- ]
84
- }
85
- }
@@ -1,11 +0,0 @@
1
- import SwiftUI
2
-
3
- /// Reports the measured width of the header-right area so the animated search
4
- /// header can compute its trailing inset (mirrors Compose's headerRightWidthPx).
5
- /// Written by the header views (`NavigationHeader`) and read by `StackScreen`.
6
- public struct HeaderRightWidthKey: PreferenceKey {
7
- public static var defaultValue: CGFloat = 0
8
- public static func reduce(value: inout CGFloat, nextValue: () -> CGFloat) {
9
- value = max(value, nextValue())
10
- }
11
- }