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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/CLAUDE.md +1 -1
  2. package/compose/build.gradle.kts +1 -1
  3. package/compose/compose.podspec +1 -1
  4. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +0 -5
  5. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderRight.kt +1 -1
  6. package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +0 -3
  7. package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +55 -40
  8. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +0 -4
  9. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +2 -8
  10. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +75 -93
  11. package/gradle.properties +1 -1
  12. package/ios/Application/ApplicationEnvironment.swift +0 -11
  13. package/ios/Application/Components.swift +44 -34
  14. package/ios/Application/FloatingButton.swift +9 -10
  15. package/ios/Application/HeaderRight.swift +45 -79
  16. package/ios/Application/Screen.swift +1 -2
  17. package/ios/Badge/Badge.swift +14 -11
  18. package/ios/Badge/BadgeRibbon.swift +21 -12
  19. package/ios/Button/Button.swift +22 -61
  20. package/ios/Checkbox/Checkbox.swift +13 -14
  21. package/ios/Chip/Chip.swift +9 -23
  22. package/ios/Colors+Radius+Spacing/Colors.swift +12 -12
  23. package/ios/Extensions/Color++.swift +0 -32
  24. package/ios/Icon/Icon.swift +1 -6
  25. package/ios/Input/Input.swift +25 -41
  26. package/ios/Input/InputPhoneNumber.swift +19 -20
  27. package/ios/Input/InputSearch.swift +47 -100
  28. package/ios/Input/InputTextArea.swift +40 -66
  29. package/ios/Popup/PopupDisplay.swift +16 -8
  30. package/ios/Popup/PopupInput.swift +8 -2
  31. package/ios/Swipeable/SwipeCell.swift +0 -185
  32. package/ios/Swipeable/SwipeCellModel.swift +0 -21
  33. package/ios/Typography/Text.swift +5 -79
  34. package/ios/Typography/Typography.swift +0 -3
  35. package/ios/native-kits.podspec +8 -61
  36. package/package.json +1 -1
  37. package/publish.sh +0 -50
  38. package/.claude/settings.local.json +0 -39
  39. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/OsFontScale.android.kt +0 -7
  40. package/compose/src/commonMain/kotlin/vn/momo/kits/application/WidgetContainer.kt +0 -56
  41. package/compose/src/commonMain/kotlin/vn/momo/kits/const/KitFontScale.kt +0 -22
  42. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/OsFontScale.kt +0 -9
  43. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/OsFontScale.ios.kt +0 -66
  44. package/ios/Application/Navigation/BottomTab/BottomTab.swift +0 -103
  45. package/ios/Application/Navigation/BottomTab/BottomTabBar.swift +0 -215
  46. package/ios/Application/Navigation/BottomTab/CurvedContainer.swift +0 -65
  47. package/ios/Application/Navigation/HeaderBackProps.swift +0 -66
  48. package/ios/Application/Navigation/HeaderTitle.swift +0 -57
  49. package/ios/Application/Navigation/HeaderUser.swift +0 -209
  50. package/ios/Application/Navigation/NavigationContainer.swift +0 -176
  51. package/ios/Application/Navigation/NavigationOptions.swift +0 -109
  52. package/ios/Application/Navigation/Navigator.swift +0 -364
  53. package/ios/Application/Navigation/Overplay/BottomSheet.swift +0 -188
  54. package/ios/Application/Navigation/Overplay/ModalScreen.swift +0 -68
  55. package/ios/Application/Navigation/Overplay/SnackBar.swift +0 -144
  56. package/ios/Application/Navigation/component/Header.swift +0 -178
  57. package/ios/Application/Navigation/component/HeaderBackground.swift +0 -83
  58. package/ios/Application/Navigation/component/HeaderColor.swift +0 -65
  59. package/ios/Application/StackScreen.swift +0 -453
  60. package/ios/Avatar/Avatar.swift +0 -193
  61. package/ios/BaselineView/BaselineView.swift +0 -163
  62. package/ios/Carousel/Carousel.swift +0 -181
  63. package/ios/Collapse/Collapse.swift +0 -182
  64. package/ios/Colors+Radius+Spacing/Theme.swift +0 -295
  65. package/ios/DateTimePicker/DateTimePicker.swift +0 -210
  66. package/ios/DateTimePicker/DateTimePickerTypes.swift +0 -55
  67. package/ios/DateTimePicker/DateTimePickerUtils.swift +0 -167
  68. package/ios/DateTimePicker/WheelPicker.swift +0 -161
  69. package/ios/Divider/Divider.swift +0 -16
  70. package/ios/IconButton/IconButton.swift +0 -112
  71. package/ios/InputDropDown/InputDropDown.swift +0 -198
  72. package/ios/InputMoney/InputMoney.swift +0 -335
  73. package/ios/InputOTP/InputOTP.swift +0 -210
  74. package/ios/Loader/Loader.swift +0 -113
  75. package/ios/MoMoUIKits.podspec +0 -5
  76. package/ios/Pagination/PaginationDot.swift +0 -61
  77. package/ios/Pagination/PaginationNumber.swift +0 -35
  78. package/ios/Pagination/PaginationScroll.swift +0 -101
  79. package/ios/Pagination/PaginationWhiteDot.swift +0 -37
  80. package/ios/Popup/PopupNotify.swift +0 -219
  81. package/ios/ProgressInfo/ProgressInfo.swift +0 -294
  82. package/ios/Radio/Radio.swift +0 -70
  83. package/ios/Rating/Rating.swift +0 -82
  84. package/ios/Resources/MoMoUIKitsColors.xcassets/AccentColor.colorset/Contents.json +0 -11
  85. package/ios/Resources/MoMoUIKitsColors.xcassets/Background.colorset/Contents.json +0 -38
  86. package/ios/Resources/MoMoUIKitsColors.xcassets/Border.colorset/Contents.json +0 -38
  87. package/ios/Resources/MoMoUIKitsColors.xcassets/Card.colorset/Contents.json +0 -38
  88. package/ios/Resources/MoMoUIKitsColors.xcassets/Contents.json +0 -6
  89. package/ios/Resources/MoMoUIKitsColors.xcassets/Error.colorset/Contents.json +0 -38
  90. package/ios/Resources/MoMoUIKitsColors.xcassets/Primary.colorset/Contents.json +0 -38
  91. package/ios/Resources/MoMoUIKitsColors.xcassets/PrimaryDark.colorset/Contents.json +0 -38
  92. package/ios/Resources/MoMoUIKitsColors.xcassets/PrimaryLight.colorset/Contents.json +0 -38
  93. package/ios/Resources/MoMoUIKitsColors.xcassets/Secondary.colorset/Contents.json +0 -38
  94. package/ios/Resources/MoMoUIKitsColors.xcassets/Success.colorset/Contents.json +0 -38
  95. package/ios/Resources/MoMoUIKitsColors.xcassets/Text.colorset/Contents.json +0 -38
  96. package/ios/Resources/MoMoUIKitsColors.xcassets/TextSecondary.colorset/Contents.json +0 -38
  97. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/Contents.json +0 -9
  98. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-default.colorset/Contents.json +0 -38
  99. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-disable.colorset/Contents.json +0 -38
  100. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-pressed.colorset/Contents.json +0 -38
  101. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-selected.colorset/Contents.json +0 -38
  102. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-surface.colorset/Contents.json +0 -38
  103. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-tonal.colorset/Contents.json +0 -38
  104. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/border-default.colorset/Contents.json +0 -38
  105. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/border-disable.colorset/Contents.json +0 -38
  106. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/gradient.colorset/Contents.json +0 -38
  107. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/primary.colorset/Contents.json +0 -38
  108. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/secondary.colorset/Contents.json +0 -38
  109. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-container.colorset/Contents.json +0 -38
  110. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-primary.colorset/Contents.json +0 -38
  111. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-secondary.colorset/Contents.json +0 -38
  112. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-default.colorset/Contents.json +0 -38
  113. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-disable.colorset/Contents.json +0 -38
  114. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-hint.colorset/Contents.json +0 -38
  115. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-secondary.colorset/Contents.json +0 -38
  116. package/ios/Resources/MoMoUIKitsColors.xcassets/Warning.colorset/Contents.json +0 -38
  117. package/ios/Skeleton/Skeleton.swift +0 -99
  118. package/ios/Slider/Slider.swift +0 -237
  119. package/ios/Stepper/Stepper.swift +0 -220
  120. package/ios/Steps/Steps.swift +0 -451
  121. package/ios/SuggestAction/SuggestAction.swift +0 -97
  122. package/ios/TabView/TabView.swift +0 -530
  123. package/ios/Tag/Tag.swift +0 -98
  124. package/ios/Title/Title.swift +0 -269
  125. package/ios/Tooltip/Tooltip.swift +0 -482
  126. package/ios/Typography/FontScaleStore.swift +0 -19
  127. package/ios/Uploader/Uploader.swift +0 -183
  128. package/ios-demo/MoMoUIKitsDemo.podspec +0 -20
  129. package/ios-demo/README.md +0 -120
  130. package/ios-demo/Resources/dot_loading.json +0 -558
  131. package/ios-demo/Resources/icon.json +0 -4052
  132. package/ios-demo/Resources/lottie_circle_loader.json +0 -1
  133. package/ios-demo/Sources/MoMoUIKitsDemo/DemoScaffold.swift +0 -48
  134. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsBadgeDemoView.swift +0 -25
  135. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsButtonDemoView.swift +0 -26
  136. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsCheckboxDemoView.swift +0 -19
  137. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsChipDemoView.swift +0 -33
  138. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsInputDemoView.swift +0 -48
  139. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsPopupDemoView.swift +0 -21
  140. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsRadioDemoView.swift +0 -17
  141. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsTypographyDemoView.swift +0 -28
  142. package/ios-demo/Sources/MoMoUIKitsDemo/MoMoUIKitsDemoContext.swift +0 -31
  143. package/ios-demo/Sources/MoMoUIKitsDemo/MoMoUIKitsDemoFactory.swift +0 -24
  144. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AnimatedHeaderDemo.swift +0 -110
  145. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AvatarDemo.swift +0 -93
  146. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BadgeDemo.swift +0 -269
  147. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BaselineView.swift +0 -117
  148. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BottomTabDemo.swift +0 -89
  149. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ButtonDemo.swift +0 -100
  150. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CarouselDemo.swift +0 -126
  151. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CheckboxDemo.swift +0 -63
  152. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ChipDemo.swift +0 -20
  153. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CollapseDemo.swift +0 -93
  154. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ContentView.swift +0 -107
  155. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DateTimePickerDemo.swift +0 -124
  156. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DividerDemo.swift +0 -14
  157. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/HeaderUserDemo.swift +0 -49
  158. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/Home.swift +0 -278
  159. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/IconButtonDemo.swift +0 -58
  160. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ImageDemo.swift +0 -78
  161. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InformationDemo.swift +0 -138
  162. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputDemo.swift +0 -111
  163. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputDropDownDemo.swift +0 -136
  164. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputMoneyDemo.swift +0 -107
  165. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputOTPDemo.swift +0 -73
  166. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputPhoneNumberDemo.swift +0 -100
  167. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputSearchDemo.swift +0 -32
  168. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputTextAreaDemo.swift +0 -57
  169. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/LoaderDemo.swift +0 -70
  170. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift +0 -227
  171. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PaginationDemo.swift +0 -72
  172. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupDisplayDemo.swift +0 -175
  173. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupNotifyDemo.swift +0 -121
  174. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupPromotionDemo.swift +0 -76
  175. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ProgressInfoDemo.swift +0 -89
  176. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/RadioDemo.swift +0 -32
  177. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/RatingDemo.swift +0 -56
  178. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SkeletonDemo.swift +0 -32
  179. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SliderDemo.swift +0 -150
  180. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SnackBarDemo.swift +0 -138
  181. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/StepperDemo.swift +0 -103
  182. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/StepsDemo.swift +0 -94
  183. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SuggestActionDemo.swift +0 -79
  184. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SwipeDemo.swift +0 -152
  185. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SwitchDemo.swift +0 -33
  186. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TabViewDemo.swift +0 -190
  187. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TagDemo.swift +0 -34
  188. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ThemeDemo.swift +0 -182
  189. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TitleDemo.swift +0 -109
  190. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TooltipDemo.swift +0 -187
  191. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TypographyDemo.swift +0 -87
  192. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/UploaderDemo.swift +0 -131
  193. package/ios-demo/Sources/MoMoUIKitsDemo/SwiftUIDemoBrowserView.swift +0 -51
  194. package/ios-demo/Sources/MoMoUIKitsDemo/UIKitsDemoModels.swift +0 -15
  195. package/ios-demo/Sources/MoMoUIKitsDemo/UIKitsDemoRegistry.swift +0 -73
  196. package/local.properties +0 -8
  197. package/scripts/gen-ios-color.mjs +0 -136
@@ -1,294 +0,0 @@
1
- import SwiftUI
2
-
3
- // MARK: - Data model
4
-
5
- public struct ProgressInfoItem: Identifiable {
6
- public let id = UUID()
7
- public let title: String
8
- public let description: String?
9
-
10
- public init(title: String, description: String? = nil) {
11
- self.title = title
12
- self.description = description
13
- }
14
- }
15
-
16
- public enum ProgressInfoSize {
17
- case small
18
- case large
19
- }
20
-
21
- public enum ProgressInfoAlign {
22
- case left
23
- case right
24
- case center
25
- case stretch
26
- }
27
-
28
- // MARK: - Public entry-point
29
-
30
- /// Display-only step progress indicator.
31
- ///
32
- /// - Parameters:
33
- /// - steps: Ordered list of steps; each has a title and an optional description.
34
- /// - horizontal: When `true` renders steps in a horizontal row with connector lines;
35
- /// when `false` (default) renders a vertical column.
36
- /// - size: Icon diameter: `.small` = 16, `.large` = 24 (default).
37
- /// - useNumber: Show the 1-based step index inside the icon instead of the default dot.
38
- /// - align: Alignment of icon + text for the horizontal variant.
39
- /// - showTitle: Whether step titles are rendered (default `true`).
40
- /// - showDescription: Whether step descriptions are rendered (default `true`).
41
- /// - customIcon: Icon source key rendered inside each step circle (overrides the dot;
42
- /// itself overridden by `useNumber`).
43
- public struct ProgressInfo: View {
44
- private let steps: [ProgressInfoItem]
45
- private let horizontal: Bool
46
- private let size: ProgressInfoSize
47
- private let useNumber: Bool
48
- private let align: ProgressInfoAlign
49
- private let showTitle: Bool
50
- private let showDescription: Bool
51
- private let customIcon: String?
52
-
53
- public init(
54
- steps: [ProgressInfoItem],
55
- horizontal: Bool = false,
56
- size: ProgressInfoSize = .large,
57
- useNumber: Bool = false,
58
- align: ProgressInfoAlign = .center,
59
- showTitle: Bool = true,
60
- showDescription: Bool = true,
61
- customIcon: String? = nil
62
- ) {
63
- self.steps = steps
64
- self.horizontal = horizontal
65
- self.size = size
66
- self.useNumber = useNumber
67
- self.align = align
68
- self.showTitle = showTitle
69
- self.showDescription = showDescription
70
- self.customIcon = customIcon
71
- }
72
-
73
- public var body: some View {
74
- if horizontal {
75
- ProgressInfoHorizontal(
76
- steps: steps,
77
- size: size,
78
- useNumber: useNumber,
79
- align: align,
80
- showTitle: showTitle,
81
- showDescription: showDescription,
82
- customIcon: customIcon
83
- )
84
- } else {
85
- ProgressInfoVertical(
86
- steps: steps,
87
- size: size,
88
- useNumber: useNumber,
89
- showTitle: showTitle,
90
- showDescription: showDescription,
91
- customIcon: customIcon
92
- )
93
- }
94
- }
95
- }
96
-
97
- // MARK: - Tokens
98
-
99
- private let progressInfoLineColor = Colors.pink08
100
- private let progressInfoAccentColor = Color(hex: "a50064") // pink_MoMo_Branding
101
-
102
- // MARK: - Horizontal variant
103
-
104
- private struct ProgressInfoHorizontal: View {
105
- let steps: [ProgressInfoItem]
106
- let size: ProgressInfoSize
107
- let useNumber: Bool
108
- let align: ProgressInfoAlign
109
- let showTitle: Bool
110
- let showDescription: Bool
111
- let customIcon: String?
112
-
113
- var body: some View {
114
- HStack(alignment: .top, spacing: 0) {
115
- ForEach(Array(steps.enumerated()), id: \.element.id) { index, item in
116
- let isFirst = index == 0
117
- let isLast = index == steps.count - 1
118
-
119
- let alignment = columnAlignment(isFirst: isFirst, isLast: isLast)
120
- let textAlign = textAlignment(isFirst: isFirst, isLast: isLast)
121
- let endPadding: CGFloat = (!isLast && align != .center && align != .stretch) ? Spacing.XS : 0
122
- let hideLineLeft = align == .left || (align == .stretch && isFirst)
123
- let hideLineRight = align == .right || (align == .stretch && isLast)
124
-
125
- VStack(alignment: alignment, spacing: 0) {
126
- HStack(spacing: 0) {
127
- if !hideLineLeft {
128
- ProgressInfoHorizontalLine()
129
- }
130
- ProgressInfoStepIcon(
131
- index: index,
132
- size: size,
133
- useNumber: useNumber,
134
- customIcon: customIcon
135
- )
136
- .padding(.vertical, Spacing.XS)
137
- if !hideLineRight {
138
- ProgressInfoHorizontalLine()
139
- }
140
- }
141
- .frame(maxWidth: .infinity)
142
-
143
- if showTitle && !item.title.isEmpty {
144
- MomoText(item.title, typography: .headerXsSemibold)
145
- .multilineTextAlignment(textAlign)
146
- .frame(maxWidth: .infinity, alignment: frameAlignment(alignment))
147
- .padding(.bottom, Spacing.XS)
148
- }
149
-
150
- if showDescription, let desc = item.description, !desc.isEmpty {
151
- MomoText(desc, typography: .descriptionDefaultRegular, color: Colors.black12)
152
- .multilineTextAlignment(textAlign)
153
- .frame(maxWidth: .infinity, alignment: frameAlignment(alignment))
154
- }
155
- }
156
- .frame(maxWidth: .infinity)
157
- .padding(.trailing, endPadding)
158
- }
159
- }
160
- .frame(maxWidth: .infinity)
161
- }
162
-
163
- private func columnAlignment(isFirst: Bool, isLast: Bool) -> HorizontalAlignment {
164
- switch align {
165
- case .left: return .leading
166
- case .right: return .trailing
167
- case .center: return .center
168
- case .stretch:
169
- if isFirst { return .leading }
170
- if isLast { return .trailing }
171
- return .center
172
- }
173
- }
174
-
175
- private func frameAlignment(_ h: HorizontalAlignment) -> Alignment {
176
- switch h {
177
- case .leading: return .leading
178
- case .trailing: return .trailing
179
- default: return .center
180
- }
181
- }
182
-
183
- private func textAlignment(isFirst: Bool, isLast: Bool) -> TextAlignment {
184
- switch align {
185
- case .left: return .leading
186
- case .right: return .trailing
187
- case .center: return .center
188
- case .stretch:
189
- if isFirst { return .leading }
190
- if isLast { return .trailing }
191
- return .center
192
- }
193
- }
194
- }
195
-
196
- // MARK: - Vertical variant
197
-
198
- private struct ProgressInfoVertical: View {
199
- let steps: [ProgressInfoItem]
200
- let size: ProgressInfoSize
201
- let useNumber: Bool
202
- let showTitle: Bool
203
- let showDescription: Bool
204
- let customIcon: String?
205
-
206
- var body: some View {
207
- VStack(alignment: .leading, spacing: 0) {
208
- ForEach(Array(steps.enumerated()), id: \.element.id) { index, item in
209
- let isLast = index == steps.count - 1
210
-
211
- HStack(alignment: .top, spacing: 0) {
212
- VStack(spacing: 0) {
213
- ProgressInfoStepIcon(
214
- index: index,
215
- size: size,
216
- useNumber: useNumber,
217
- customIcon: customIcon
218
- )
219
- if !isLast {
220
- Rectangle()
221
- .fill(Colors.primary.opacity(0.2))
222
- .frame(width: 2)
223
- .frame(maxHeight: .infinity)
224
- }
225
- }
226
- .frame(minHeight: isLast ? 40 : 48)
227
-
228
- VStack(alignment: .leading, spacing: 0) {
229
- if showTitle && !item.title.isEmpty {
230
- MomoText(item.title, typography: .headerXsSemibold)
231
- .lineLimit(2)
232
- .frame(maxWidth: .infinity, alignment: .leading)
233
- .padding(.trailing, Spacing.S)
234
- }
235
- if showDescription, let desc = item.description, !desc.isEmpty {
236
- MomoText(desc, typography: .descriptionDefaultRegular, color: Colors.black12)
237
- .frame(maxWidth: .infinity, alignment: .leading)
238
- }
239
- }
240
- .frame(maxWidth: .infinity, alignment: .leading)
241
- .padding(.trailing, Spacing.S)
242
- .padding(.bottom, isLast ? 0 : Spacing.S)
243
- }
244
- .frame(maxWidth: .infinity, alignment: .leading)
245
- .fixedSize(horizontal: false, vertical: true)
246
- }
247
- }
248
- .frame(maxWidth: .infinity, alignment: .leading)
249
- }
250
- }
251
-
252
- // MARK: - Step icon
253
-
254
- private struct ProgressInfoStepIcon: View {
255
- let index: Int
256
- let size: ProgressInfoSize
257
- let useNumber: Bool
258
- let customIcon: String?
259
-
260
- var body: some View {
261
- let containerSize = scaleSize(size == .small ? 16 : 24)
262
- let dotSize = scaleSize(size == .small ? 6 : 8)
263
- let iconSize = scaleSize(size == .small ? 12 : 16)
264
-
265
- ZStack {
266
- Circle()
267
- .fill(progressInfoLineColor)
268
- .overlay(Circle().strokeBorder(progressInfoLineColor, lineWidth: 2))
269
-
270
- if useNumber {
271
- MomoText("\(index + 1)", typography: .headerXsSemibold, color: progressInfoAccentColor)
272
- .multilineTextAlignment(.center)
273
- } else if let icon = customIcon, !icon.isEmpty {
274
- Icon(source: icon, size: iconSize, color: progressInfoAccentColor)
275
- } else {
276
- Circle()
277
- .fill(progressInfoAccentColor)
278
- .frame(width: dotSize, height: dotSize)
279
- }
280
- }
281
- .frame(width: containerSize, height: containerSize)
282
- }
283
- }
284
-
285
- // MARK: - Horizontal connector line
286
-
287
- private struct ProgressInfoHorizontalLine: View {
288
- var body: some View {
289
- Rectangle()
290
- .fill(progressInfoLineColor)
291
- .frame(height: 2)
292
- .frame(maxWidth: .infinity)
293
- }
294
- }
@@ -1,70 +0,0 @@
1
- import Foundation
2
- import SwiftUI
3
-
4
- public struct Radio: View {
5
- @Environment(\.appTheme) private var theme
6
-
7
- var value: AnyHashable
8
- @Binding var groupValue: AnyHashable
9
- var disabled: Bool
10
- var onChange: (() -> Void)?
11
- var label: String
12
-
13
- public init(
14
- value: AnyHashable,
15
- groupValue: Binding<AnyHashable>,
16
- disabled: Bool = false,
17
- onChange: (() -> Void)? = nil,
18
- label: String = ""
19
- ) {
20
- self.value = value
21
- self._groupValue = groupValue
22
- self.disabled = disabled
23
- self.onChange = onChange
24
- self.label = label
25
- }
26
-
27
- private var selected: Bool {
28
- value == groupValue
29
- }
30
-
31
- private func onTap() {
32
- groupValue = value
33
- onChange?()
34
- }
35
-
36
- public var body: some View {
37
- HStack(spacing: 0) {
38
- RoundedRectangle(cornerRadius: Radius.M)
39
- .stroke(borderColor, lineWidth: borderWidth)
40
- .frame(width: 20, height: 20)
41
- .padding(.trailing, label.isEmpty ? 0 : Spacing.XS)
42
-
43
- if !label.isEmpty {
44
- MomoText(label, typography: .descriptionDefaultRegular)
45
- }
46
- }
47
- .contentShape(Rectangle())
48
- .onTapGesture {
49
- if !disabled {
50
- onTap()
51
- }
52
- }
53
- }
54
-
55
- private var borderWidth: CGFloat {
56
- selected ? 6 : 2
57
- }
58
-
59
- private var borderColor: Color {
60
- if disabled && selected {
61
- return theme.colors.background.tonal
62
- } else if disabled {
63
- return theme.colors.text.disable
64
- } else if selected {
65
- return theme.colors.primary
66
- } else {
67
- return theme.colors.text.default
68
- }
69
- }
70
- }
@@ -1,82 +0,0 @@
1
- import SwiftUI
2
-
3
- public enum RatingSize {
4
- case small
5
- case medium
6
- case large
7
-
8
- var iconSize: CGFloat {
9
- switch self {
10
- case .small: return 16
11
- case .medium: return 20
12
- case .large: return 24
13
- }
14
- }
15
- }
16
-
17
- public struct Rating: View {
18
- private let numOfStars: Int
19
- private let rating: Float
20
- private let onRatingChange: ((Int) -> Void)?
21
- private let size: RatingSize
22
-
23
- public init(
24
- numOfStars: Int,
25
- rating: Float,
26
- onRatingChange: ((Int) -> Void)? = nil,
27
- size: RatingSize = .large
28
- ) {
29
- self.numOfStars = numOfStars
30
- self.rating = rating
31
- self.onRatingChange = onRatingChange
32
- self.size = size
33
- }
34
-
35
- public var body: some View {
36
- HStack(spacing: 2) {
37
- ForEach(0..<numOfStars, id: \.self) { index in
38
- star(at: index)
39
- }
40
- }
41
- }
42
-
43
- @ViewBuilder
44
- private func star(at index: Int) -> some View {
45
- let icon = Icon(
46
- source: starIcon(at: index),
47
- size: scaleSize(size.iconSize),
48
- color: starColor(at: index)
49
- )
50
-
51
- if let onRatingChange = onRatingChange {
52
- SwiftUI.Button(action: { onRatingChange(index + 1) }) {
53
- icon
54
- }
55
- .buttonStyle(.plain)
56
- } else {
57
- icon
58
- }
59
- }
60
-
61
- private func starIcon(at index: Int) -> String {
62
- let intRating = Int(rating)
63
- if index < intRating {
64
- return "reaction_star_full"
65
- } else if index == intRating && rating.truncatingRemainder(dividingBy: 1) != 0 {
66
- return "reaction_star_half"
67
- } else {
68
- return "reaction_star_non"
69
- }
70
- }
71
-
72
- private func starColor(at index: Int) -> Color {
73
- let intRating = Int(rating)
74
- if index < intRating {
75
- return Colors.yellow03
76
- } else if index == intRating && rating.truncatingRemainder(dividingBy: 1) != 0 {
77
- return Colors.yellow03
78
- } else {
79
- return Colors.black07
80
- }
81
- }
82
- }
@@ -1,11 +0,0 @@
1
- {
2
- "colors" : [
3
- {
4
- "idiom" : "universal"
5
- }
6
- ],
7
- "info" : {
8
- "author" : "xcode",
9
- "version" : 1
10
- }
11
- }
@@ -1,38 +0,0 @@
1
- {
2
- "colors" : [
3
- {
4
- "color" : {
5
- "color-space" : "srgb",
6
- "components" : {
7
- "alpha" : "1.000",
8
- "blue" : "0.965",
9
- "green" : "0.961",
10
- "red" : "0.957"
11
- }
12
- },
13
- "idiom" : "universal"
14
- },
15
- {
16
- "appearances" : [
17
- {
18
- "appearance" : "luminosity",
19
- "value" : "dark"
20
- }
21
- ],
22
- "color" : {
23
- "color-space" : "srgb",
24
- "components" : {
25
- "alpha" : "1.000",
26
- "blue" : "0.000",
27
- "green" : "0.000",
28
- "red" : "0.000"
29
- }
30
- },
31
- "idiom" : "universal"
32
- }
33
- ],
34
- "info" : {
35
- "author" : "xcode",
36
- "version" : 1
37
- }
38
- }
@@ -1,38 +0,0 @@
1
- {
2
- "colors" : [
3
- {
4
- "color" : {
5
- "color-space" : "srgb",
6
- "components" : {
7
- "alpha" : "1.000",
8
- "blue" : "0.933",
9
- "green" : "0.925",
10
- "red" : "0.925"
11
- }
12
- },
13
- "idiom" : "universal"
14
- },
15
- {
16
- "appearances" : [
17
- {
18
- "appearance" : "luminosity",
19
- "value" : "dark"
20
- }
21
- ],
22
- "color" : {
23
- "color-space" : "srgb",
24
- "components" : {
25
- "alpha" : "1.000",
26
- "blue" : "0.933",
27
- "green" : "0.925",
28
- "red" : "0.925"
29
- }
30
- },
31
- "idiom" : "universal"
32
- }
33
- ],
34
- "info" : {
35
- "author" : "xcode",
36
- "version" : 1
37
- }
38
- }
@@ -1,38 +0,0 @@
1
- {
2
- "colors" : [
3
- {
4
- "color" : {
5
- "color-space" : "srgb",
6
- "components" : {
7
- "alpha" : "1.000",
8
- "blue" : "1.000",
9
- "green" : "1.000",
10
- "red" : "1.000"
11
- }
12
- },
13
- "idiom" : "universal"
14
- },
15
- {
16
- "appearances" : [
17
- {
18
- "appearance" : "luminosity",
19
- "value" : "dark"
20
- }
21
- ],
22
- "color" : {
23
- "color-space" : "srgb",
24
- "components" : {
25
- "alpha" : "1.000",
26
- "blue" : "0.282",
27
- "green" : "0.216",
28
- "red" : "0.169"
29
- }
30
- },
31
- "idiom" : "universal"
32
- }
33
- ],
34
- "info" : {
35
- "author" : "xcode",
36
- "version" : 1
37
- }
38
- }
@@ -1,6 +0,0 @@
1
- {
2
- "info" : {
3
- "author" : "xcode",
4
- "version" : 1
5
- }
6
- }
@@ -1,38 +0,0 @@
1
- {
2
- "colors" : [
3
- {
4
- "color" : {
5
- "color-space" : "srgb",
6
- "components" : {
7
- "alpha" : "1.000",
8
- "blue" : "0.176",
9
- "green" : "0.133",
10
- "red" : "0.961"
11
- }
12
- },
13
- "idiom" : "universal"
14
- },
15
- {
16
- "appearances" : [
17
- {
18
- "appearance" : "luminosity",
19
- "value" : "dark"
20
- }
21
- ],
22
- "color" : {
23
- "color-space" : "srgb",
24
- "components" : {
25
- "alpha" : "1.000",
26
- "blue" : "0.176",
27
- "green" : "0.133",
28
- "red" : "0.961"
29
- }
30
- },
31
- "idiom" : "universal"
32
- }
33
- ],
34
- "info" : {
35
- "author" : "xcode",
36
- "version" : 1
37
- }
38
- }
@@ -1,38 +0,0 @@
1
- {
2
- "colors" : [
3
- {
4
- "color" : {
5
- "color-space" : "srgb",
6
- "components" : {
7
- "alpha" : "1.000",
8
- "blue" : "0.627",
9
- "green" : "0.263",
10
- "red" : "0.929"
11
- }
12
- },
13
- "idiom" : "universal"
14
- },
15
- {
16
- "appearances" : [
17
- {
18
- "appearance" : "luminosity",
19
- "value" : "dark"
20
- }
21
- ],
22
- "color" : {
23
- "color-space" : "srgb",
24
- "components" : {
25
- "alpha" : "1.000",
26
- "blue" : "0.627",
27
- "green" : "0.263",
28
- "red" : "0.929"
29
- }
30
- },
31
- "idiom" : "universal"
32
- }
33
- ],
34
- "info" : {
35
- "author" : "xcode",
36
- "version" : 1
37
- }
38
- }
@@ -1,38 +0,0 @@
1
- {
2
- "colors" : [
3
- {
4
- "color" : {
5
- "color-space" : "srgb",
6
- "components" : {
7
- "alpha" : "1.000",
8
- "blue" : "0.471",
9
- "green" : "0.149",
10
- "red" : "0.737"
11
- }
12
- },
13
- "idiom" : "universal"
14
- },
15
- {
16
- "appearances" : [
17
- {
18
- "appearance" : "luminosity",
19
- "value" : "dark"
20
- }
21
- ],
22
- "color" : {
23
- "color-space" : "srgb",
24
- "components" : {
25
- "alpha" : "1.000",
26
- "blue" : "0.471",
27
- "green" : "0.149",
28
- "red" : "0.737"
29
- }
30
- },
31
- "idiom" : "universal"
32
- }
33
- ],
34
- "info" : {
35
- "author" : "xcode",
36
- "version" : 1
37
- }
38
- }