@momo-kits/native-kits 0.162.2-beta.26 → 0.162.2-beta.27

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 (180) hide show
  1. package/CLAUDE.md +1 -1
  2. package/ios/Application/ApplicationEnvironment.swift +0 -11
  3. package/ios/Application/Components.swift +44 -34
  4. package/ios/Application/FloatingButton.swift +9 -10
  5. package/ios/Application/HeaderRight.swift +45 -79
  6. package/ios/Application/Screen.swift +1 -2
  7. package/ios/Badge/Badge.swift +14 -11
  8. package/ios/Badge/BadgeRibbon.swift +21 -12
  9. package/ios/Button/Button.swift +22 -61
  10. package/ios/Checkbox/Checkbox.swift +13 -14
  11. package/ios/Chip/Chip.swift +9 -23
  12. package/ios/Colors+Radius+Spacing/Colors.swift +12 -12
  13. package/ios/Extensions/Color++.swift +0 -32
  14. package/ios/Icon/Icon.swift +1 -6
  15. package/ios/Input/Input.swift +25 -41
  16. package/ios/Input/InputPhoneNumber.swift +19 -20
  17. package/ios/Input/InputSearch.swift +47 -100
  18. package/ios/Input/InputTextArea.swift +40 -66
  19. package/ios/Popup/PopupDisplay.swift +16 -8
  20. package/ios/Popup/PopupInput.swift +8 -2
  21. package/ios/Swipeable/SwipeCell.swift +0 -185
  22. package/ios/Swipeable/SwipeCellModel.swift +0 -21
  23. package/ios/Typography/Text.swift +5 -79
  24. package/ios/Typography/Typography.swift +0 -3
  25. package/ios/native-kits.podspec +8 -61
  26. package/package.json +1 -1
  27. package/publish.sh +0 -50
  28. package/.claude/settings.local.json +0 -39
  29. package/ios/Application/Navigation/BottomTab/BottomTab.swift +0 -103
  30. package/ios/Application/Navigation/BottomTab/BottomTabBar.swift +0 -215
  31. package/ios/Application/Navigation/BottomTab/CurvedContainer.swift +0 -65
  32. package/ios/Application/Navigation/HeaderBackProps.swift +0 -66
  33. package/ios/Application/Navigation/HeaderTitle.swift +0 -57
  34. package/ios/Application/Navigation/HeaderUser.swift +0 -209
  35. package/ios/Application/Navigation/NavigationContainer.swift +0 -176
  36. package/ios/Application/Navigation/NavigationOptions.swift +0 -109
  37. package/ios/Application/Navigation/Navigator.swift +0 -364
  38. package/ios/Application/Navigation/Overplay/BottomSheet.swift +0 -188
  39. package/ios/Application/Navigation/Overplay/ModalScreen.swift +0 -68
  40. package/ios/Application/Navigation/Overplay/SnackBar.swift +0 -144
  41. package/ios/Application/Navigation/component/Header.swift +0 -178
  42. package/ios/Application/Navigation/component/HeaderBackground.swift +0 -83
  43. package/ios/Application/Navigation/component/HeaderColor.swift +0 -65
  44. package/ios/Application/StackScreen.swift +0 -453
  45. package/ios/Avatar/Avatar.swift +0 -193
  46. package/ios/BaselineView/BaselineView.swift +0 -163
  47. package/ios/Carousel/Carousel.swift +0 -181
  48. package/ios/Collapse/Collapse.swift +0 -182
  49. package/ios/Colors+Radius+Spacing/Theme.swift +0 -295
  50. package/ios/DateTimePicker/DateTimePicker.swift +0 -210
  51. package/ios/DateTimePicker/DateTimePickerTypes.swift +0 -55
  52. package/ios/DateTimePicker/DateTimePickerUtils.swift +0 -167
  53. package/ios/DateTimePicker/WheelPicker.swift +0 -161
  54. package/ios/Divider/Divider.swift +0 -16
  55. package/ios/IconButton/IconButton.swift +0 -112
  56. package/ios/InputDropDown/InputDropDown.swift +0 -198
  57. package/ios/InputMoney/InputMoney.swift +0 -335
  58. package/ios/InputOTP/InputOTP.swift +0 -210
  59. package/ios/Loader/Loader.swift +0 -113
  60. package/ios/MoMoUIKits.podspec +0 -5
  61. package/ios/Pagination/PaginationDot.swift +0 -61
  62. package/ios/Pagination/PaginationNumber.swift +0 -35
  63. package/ios/Pagination/PaginationScroll.swift +0 -101
  64. package/ios/Pagination/PaginationWhiteDot.swift +0 -37
  65. package/ios/Popup/PopupNotify.swift +0 -219
  66. package/ios/ProgressInfo/ProgressInfo.swift +0 -294
  67. package/ios/Radio/Radio.swift +0 -70
  68. package/ios/Rating/Rating.swift +0 -82
  69. package/ios/Resources/MoMoUIKitsColors.xcassets/AccentColor.colorset/Contents.json +0 -11
  70. package/ios/Resources/MoMoUIKitsColors.xcassets/Background.colorset/Contents.json +0 -38
  71. package/ios/Resources/MoMoUIKitsColors.xcassets/Border.colorset/Contents.json +0 -38
  72. package/ios/Resources/MoMoUIKitsColors.xcassets/Card.colorset/Contents.json +0 -38
  73. package/ios/Resources/MoMoUIKitsColors.xcassets/Contents.json +0 -6
  74. package/ios/Resources/MoMoUIKitsColors.xcassets/Error.colorset/Contents.json +0 -38
  75. package/ios/Resources/MoMoUIKitsColors.xcassets/Primary.colorset/Contents.json +0 -38
  76. package/ios/Resources/MoMoUIKitsColors.xcassets/PrimaryDark.colorset/Contents.json +0 -38
  77. package/ios/Resources/MoMoUIKitsColors.xcassets/PrimaryLight.colorset/Contents.json +0 -38
  78. package/ios/Resources/MoMoUIKitsColors.xcassets/Secondary.colorset/Contents.json +0 -38
  79. package/ios/Resources/MoMoUIKitsColors.xcassets/Success.colorset/Contents.json +0 -38
  80. package/ios/Resources/MoMoUIKitsColors.xcassets/Text.colorset/Contents.json +0 -38
  81. package/ios/Resources/MoMoUIKitsColors.xcassets/TextSecondary.colorset/Contents.json +0 -38
  82. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/Contents.json +0 -9
  83. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-default.colorset/Contents.json +0 -38
  84. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-disable.colorset/Contents.json +0 -38
  85. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-pressed.colorset/Contents.json +0 -38
  86. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-selected.colorset/Contents.json +0 -38
  87. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-surface.colorset/Contents.json +0 -38
  88. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-tonal.colorset/Contents.json +0 -38
  89. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/border-default.colorset/Contents.json +0 -38
  90. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/border-disable.colorset/Contents.json +0 -38
  91. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/gradient.colorset/Contents.json +0 -38
  92. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/primary.colorset/Contents.json +0 -38
  93. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/secondary.colorset/Contents.json +0 -38
  94. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-container.colorset/Contents.json +0 -38
  95. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-primary.colorset/Contents.json +0 -38
  96. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-secondary.colorset/Contents.json +0 -38
  97. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-default.colorset/Contents.json +0 -38
  98. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-disable.colorset/Contents.json +0 -38
  99. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-hint.colorset/Contents.json +0 -38
  100. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-secondary.colorset/Contents.json +0 -38
  101. package/ios/Resources/MoMoUIKitsColors.xcassets/Warning.colorset/Contents.json +0 -38
  102. package/ios/Skeleton/Skeleton.swift +0 -99
  103. package/ios/Slider/Slider.swift +0 -237
  104. package/ios/Stepper/Stepper.swift +0 -220
  105. package/ios/Steps/Steps.swift +0 -451
  106. package/ios/SuggestAction/SuggestAction.swift +0 -97
  107. package/ios/TabView/TabView.swift +0 -530
  108. package/ios/Tag/Tag.swift +0 -98
  109. package/ios/Title/Title.swift +0 -269
  110. package/ios/Tooltip/Tooltip.swift +0 -482
  111. package/ios/Typography/FontScaleStore.swift +0 -19
  112. package/ios/Uploader/Uploader.swift +0 -183
  113. package/ios-demo/MoMoUIKitsDemo.podspec +0 -20
  114. package/ios-demo/Resources/dot_loading.json +0 -558
  115. package/ios-demo/Resources/icon.json +0 -4052
  116. package/ios-demo/Resources/lottie_circle_loader.json +0 -1
  117. package/ios-demo/Sources/MoMoUIKitsDemo/DemoScaffold.swift +0 -48
  118. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsBadgeDemoView.swift +0 -25
  119. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsButtonDemoView.swift +0 -26
  120. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsCheckboxDemoView.swift +0 -19
  121. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsChipDemoView.swift +0 -33
  122. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsInputDemoView.swift +0 -48
  123. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsPopupDemoView.swift +0 -21
  124. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsRadioDemoView.swift +0 -17
  125. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsTypographyDemoView.swift +0 -28
  126. package/ios-demo/Sources/MoMoUIKitsDemo/MoMoUIKitsDemoContext.swift +0 -31
  127. package/ios-demo/Sources/MoMoUIKitsDemo/MoMoUIKitsDemoFactory.swift +0 -24
  128. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AnimatedHeaderDemo.swift +0 -110
  129. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AvatarDemo.swift +0 -93
  130. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BadgeDemo.swift +0 -269
  131. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BaselineView.swift +0 -117
  132. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BottomTabDemo.swift +0 -89
  133. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ButtonDemo.swift +0 -100
  134. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CarouselDemo.swift +0 -126
  135. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CheckboxDemo.swift +0 -63
  136. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ChipDemo.swift +0 -20
  137. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CollapseDemo.swift +0 -93
  138. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ContentView.swift +0 -107
  139. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DateTimePickerDemo.swift +0 -124
  140. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DividerDemo.swift +0 -14
  141. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/HeaderUserDemo.swift +0 -49
  142. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/Home.swift +0 -278
  143. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/IconButtonDemo.swift +0 -58
  144. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ImageDemo.swift +0 -78
  145. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InformationDemo.swift +0 -138
  146. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputDemo.swift +0 -111
  147. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputDropDownDemo.swift +0 -136
  148. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputMoneyDemo.swift +0 -107
  149. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputOTPDemo.swift +0 -73
  150. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputPhoneNumberDemo.swift +0 -100
  151. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputSearchDemo.swift +0 -32
  152. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputTextAreaDemo.swift +0 -57
  153. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/LoaderDemo.swift +0 -70
  154. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift +0 -227
  155. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PaginationDemo.swift +0 -72
  156. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupDisplayDemo.swift +0 -175
  157. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupNotifyDemo.swift +0 -121
  158. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupPromotionDemo.swift +0 -76
  159. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ProgressInfoDemo.swift +0 -89
  160. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/RadioDemo.swift +0 -32
  161. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/RatingDemo.swift +0 -56
  162. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SkeletonDemo.swift +0 -32
  163. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SliderDemo.swift +0 -150
  164. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SnackBarDemo.swift +0 -138
  165. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/StepperDemo.swift +0 -103
  166. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/StepsDemo.swift +0 -94
  167. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SuggestActionDemo.swift +0 -79
  168. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SwipeDemo.swift +0 -152
  169. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SwitchDemo.swift +0 -33
  170. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TabViewDemo.swift +0 -190
  171. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TagDemo.swift +0 -34
  172. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ThemeDemo.swift +0 -182
  173. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TitleDemo.swift +0 -109
  174. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TooltipDemo.swift +0 -187
  175. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TypographyDemo.swift +0 -87
  176. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/UploaderDemo.swift +0 -131
  177. package/ios-demo/Sources/MoMoUIKitsDemo/SwiftUIDemoBrowserView.swift +0 -51
  178. package/ios-demo/Sources/MoMoUIKitsDemo/UIKitsDemoModels.swift +0 -15
  179. package/ios-demo/Sources/MoMoUIKitsDemo/UIKitsDemoRegistry.swift +0 -73
  180. 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
-