@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.
- package/CLAUDE.md +1 -1
- package/compose/build.gradle.kts +1 -1
- package/compose/compose.podspec +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +0 -5
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderRight.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +0 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +55 -40
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +0 -4
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +2 -8
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +75 -93
- package/gradle.properties +1 -1
- package/ios/Application/ApplicationEnvironment.swift +0 -11
- package/ios/Application/Components.swift +44 -34
- package/ios/Application/FloatingButton.swift +9 -10
- package/ios/Application/HeaderRight.swift +45 -79
- package/ios/Application/Screen.swift +1 -2
- package/ios/Badge/Badge.swift +14 -11
- package/ios/Badge/BadgeRibbon.swift +21 -12
- package/ios/Button/Button.swift +22 -61
- package/ios/Checkbox/Checkbox.swift +13 -14
- package/ios/Chip/Chip.swift +9 -23
- package/ios/Colors+Radius+Spacing/Colors.swift +12 -12
- package/ios/Extensions/Color++.swift +0 -32
- package/ios/Icon/Icon.swift +1 -6
- package/ios/Input/Input.swift +25 -41
- package/ios/Input/InputPhoneNumber.swift +19 -20
- package/ios/Input/InputSearch.swift +47 -100
- package/ios/Input/InputTextArea.swift +40 -66
- package/ios/Popup/PopupDisplay.swift +16 -8
- package/ios/Popup/PopupInput.swift +8 -2
- package/ios/Swipeable/SwipeCell.swift +0 -185
- package/ios/Swipeable/SwipeCellModel.swift +0 -21
- package/ios/Typography/Text.swift +5 -79
- package/ios/Typography/Typography.swift +0 -3
- package/ios/native-kits.podspec +8 -61
- package/package.json +1 -1
- package/publish.sh +0 -50
- package/.claude/settings.local.json +0 -39
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/OsFontScale.android.kt +0 -7
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/WidgetContainer.kt +0 -56
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/KitFontScale.kt +0 -22
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/OsFontScale.kt +0 -9
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/OsFontScale.ios.kt +0 -66
- package/ios/Application/Navigation/BottomTab/BottomTab.swift +0 -103
- package/ios/Application/Navigation/BottomTab/BottomTabBar.swift +0 -215
- package/ios/Application/Navigation/BottomTab/CurvedContainer.swift +0 -65
- package/ios/Application/Navigation/HeaderBackProps.swift +0 -66
- package/ios/Application/Navigation/HeaderTitle.swift +0 -57
- package/ios/Application/Navigation/HeaderUser.swift +0 -209
- package/ios/Application/Navigation/NavigationContainer.swift +0 -176
- package/ios/Application/Navigation/NavigationOptions.swift +0 -109
- package/ios/Application/Navigation/Navigator.swift +0 -364
- package/ios/Application/Navigation/Overplay/BottomSheet.swift +0 -188
- package/ios/Application/Navigation/Overplay/ModalScreen.swift +0 -68
- package/ios/Application/Navigation/Overplay/SnackBar.swift +0 -144
- package/ios/Application/Navigation/component/Header.swift +0 -178
- package/ios/Application/Navigation/component/HeaderBackground.swift +0 -83
- package/ios/Application/Navigation/component/HeaderColor.swift +0 -65
- package/ios/Application/StackScreen.swift +0 -453
- package/ios/Avatar/Avatar.swift +0 -193
- package/ios/BaselineView/BaselineView.swift +0 -163
- package/ios/Carousel/Carousel.swift +0 -181
- package/ios/Collapse/Collapse.swift +0 -182
- package/ios/Colors+Radius+Spacing/Theme.swift +0 -295
- package/ios/DateTimePicker/DateTimePicker.swift +0 -210
- package/ios/DateTimePicker/DateTimePickerTypes.swift +0 -55
- package/ios/DateTimePicker/DateTimePickerUtils.swift +0 -167
- package/ios/DateTimePicker/WheelPicker.swift +0 -161
- package/ios/Divider/Divider.swift +0 -16
- package/ios/IconButton/IconButton.swift +0 -112
- package/ios/InputDropDown/InputDropDown.swift +0 -198
- package/ios/InputMoney/InputMoney.swift +0 -335
- package/ios/InputOTP/InputOTP.swift +0 -210
- package/ios/Loader/Loader.swift +0 -113
- package/ios/MoMoUIKits.podspec +0 -5
- package/ios/Pagination/PaginationDot.swift +0 -61
- package/ios/Pagination/PaginationNumber.swift +0 -35
- package/ios/Pagination/PaginationScroll.swift +0 -101
- package/ios/Pagination/PaginationWhiteDot.swift +0 -37
- package/ios/Popup/PopupNotify.swift +0 -219
- package/ios/ProgressInfo/ProgressInfo.swift +0 -294
- package/ios/Radio/Radio.swift +0 -70
- package/ios/Rating/Rating.swift +0 -82
- package/ios/Resources/MoMoUIKitsColors.xcassets/AccentColor.colorset/Contents.json +0 -11
- package/ios/Resources/MoMoUIKitsColors.xcassets/Background.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/Border.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/Card.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/Contents.json +0 -6
- package/ios/Resources/MoMoUIKitsColors.xcassets/Error.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/Primary.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/PrimaryDark.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/PrimaryLight.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/Secondary.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/Success.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/Text.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/TextSecondary.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/Contents.json +0 -9
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-default.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-disable.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-pressed.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-selected.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-surface.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-tonal.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/border-default.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/border-disable.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/gradient.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/primary.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/secondary.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-container.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-primary.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-secondary.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-default.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-disable.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-hint.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-secondary.colorset/Contents.json +0 -38
- package/ios/Resources/MoMoUIKitsColors.xcassets/Warning.colorset/Contents.json +0 -38
- package/ios/Skeleton/Skeleton.swift +0 -99
- package/ios/Slider/Slider.swift +0 -237
- package/ios/Stepper/Stepper.swift +0 -220
- package/ios/Steps/Steps.swift +0 -451
- package/ios/SuggestAction/SuggestAction.swift +0 -97
- package/ios/TabView/TabView.swift +0 -530
- package/ios/Tag/Tag.swift +0 -98
- package/ios/Title/Title.swift +0 -269
- package/ios/Tooltip/Tooltip.swift +0 -482
- package/ios/Typography/FontScaleStore.swift +0 -19
- package/ios/Uploader/Uploader.swift +0 -183
- package/ios-demo/MoMoUIKitsDemo.podspec +0 -20
- package/ios-demo/README.md +0 -120
- package/ios-demo/Resources/dot_loading.json +0 -558
- package/ios-demo/Resources/icon.json +0 -4052
- package/ios-demo/Resources/lottie_circle_loader.json +0 -1
- package/ios-demo/Sources/MoMoUIKitsDemo/DemoScaffold.swift +0 -48
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsBadgeDemoView.swift +0 -25
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsButtonDemoView.swift +0 -26
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsCheckboxDemoView.swift +0 -19
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsChipDemoView.swift +0 -33
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsInputDemoView.swift +0 -48
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsPopupDemoView.swift +0 -21
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsRadioDemoView.swift +0 -17
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsTypographyDemoView.swift +0 -28
- package/ios-demo/Sources/MoMoUIKitsDemo/MoMoUIKitsDemoContext.swift +0 -31
- package/ios-demo/Sources/MoMoUIKitsDemo/MoMoUIKitsDemoFactory.swift +0 -24
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AnimatedHeaderDemo.swift +0 -110
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AvatarDemo.swift +0 -93
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BadgeDemo.swift +0 -269
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BaselineView.swift +0 -117
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BottomTabDemo.swift +0 -89
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ButtonDemo.swift +0 -100
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CarouselDemo.swift +0 -126
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CheckboxDemo.swift +0 -63
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ChipDemo.swift +0 -20
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CollapseDemo.swift +0 -93
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ContentView.swift +0 -107
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DateTimePickerDemo.swift +0 -124
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DividerDemo.swift +0 -14
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/HeaderUserDemo.swift +0 -49
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/Home.swift +0 -278
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/IconButtonDemo.swift +0 -58
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ImageDemo.swift +0 -78
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InformationDemo.swift +0 -138
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputDemo.swift +0 -111
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputDropDownDemo.swift +0 -136
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputMoneyDemo.swift +0 -107
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputOTPDemo.swift +0 -73
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputPhoneNumberDemo.swift +0 -100
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputSearchDemo.swift +0 -32
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputTextAreaDemo.swift +0 -57
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/LoaderDemo.swift +0 -70
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift +0 -227
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PaginationDemo.swift +0 -72
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupDisplayDemo.swift +0 -175
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupNotifyDemo.swift +0 -121
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupPromotionDemo.swift +0 -76
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ProgressInfoDemo.swift +0 -89
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/RadioDemo.swift +0 -32
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/RatingDemo.swift +0 -56
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SkeletonDemo.swift +0 -32
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SliderDemo.swift +0 -150
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SnackBarDemo.swift +0 -138
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/StepperDemo.swift +0 -103
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/StepsDemo.swift +0 -94
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SuggestActionDemo.swift +0 -79
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SwipeDemo.swift +0 -152
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SwitchDemo.swift +0 -33
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TabViewDemo.swift +0 -190
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TagDemo.swift +0 -34
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ThemeDemo.swift +0 -182
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TitleDemo.swift +0 -109
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TooltipDemo.swift +0 -187
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TypographyDemo.swift +0 -87
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/UploaderDemo.swift +0 -131
- package/ios-demo/Sources/MoMoUIKitsDemo/SwiftUIDemoBrowserView.swift +0 -51
- package/ios-demo/Sources/MoMoUIKitsDemo/UIKitsDemoModels.swift +0 -15
- package/ios-demo/Sources/MoMoUIKitsDemo/UIKitsDemoRegistry.swift +0 -73
- package/local.properties +0 -8
- package/scripts/gen-ios-color.mjs +0 -136
package/ios/Button/Button.swift
CHANGED
|
@@ -31,45 +31,33 @@ public struct ButtonStyleData {
|
|
|
31
31
|
|
|
32
32
|
public extension ButtonType {
|
|
33
33
|
func backgroundColor(loading: Bool) -> Color {
|
|
34
|
-
backgroundColor(loading: loading, theme: defaultTheme)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
func backgroundColor(loading: Bool, theme: Theme) -> Color {
|
|
38
34
|
switch self {
|
|
39
|
-
case .disabled: return
|
|
40
|
-
case .primary: return
|
|
41
|
-
case .secondary: return
|
|
42
|
-
case .outline: return
|
|
43
|
-
case .tonal: return
|
|
44
|
-
case .danger: return
|
|
35
|
+
case .disabled: return Colors.black05.opacity(loading ? 0.75 : 1)
|
|
36
|
+
case .primary: return Colors.primary.opacity(loading ? 0.75 : 1)
|
|
37
|
+
case .secondary: return Colors.card.opacity(loading ? 0.75 : 1)
|
|
38
|
+
case .outline: return Colors.card.opacity(loading ? 0.75 : 1)
|
|
39
|
+
case .tonal: return Colors.primaryLight.opacity(loading ? 0.75 : 1)
|
|
40
|
+
case .danger: return Colors.error.opacity(loading ? 0.75 : 1)
|
|
45
41
|
case .text: return .clear
|
|
46
42
|
}
|
|
47
43
|
}
|
|
48
44
|
|
|
49
45
|
func contentColor(loading: Bool) -> Color {
|
|
50
|
-
contentColor(loading: loading, theme: defaultTheme)
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
func contentColor(loading: Bool, theme: Theme) -> Color {
|
|
54
46
|
switch self {
|
|
55
|
-
case .disabled: return
|
|
47
|
+
case .disabled: return Colors.black06.opacity(loading ? 0.75 : 1)
|
|
56
48
|
case .primary: return Colors.black01
|
|
57
|
-
case .secondary: return
|
|
58
|
-
case .outline: return
|
|
59
|
-
case .tonal: return
|
|
49
|
+
case .secondary: return Colors.black17
|
|
50
|
+
case .outline: return Colors.primary
|
|
51
|
+
case .tonal: return Colors.primary
|
|
60
52
|
case .danger: return Colors.black01
|
|
61
|
-
case .text: return
|
|
53
|
+
case .text: return Colors.primary
|
|
62
54
|
}
|
|
63
55
|
}
|
|
64
56
|
|
|
65
57
|
var borderColor: Color? {
|
|
66
|
-
borderColor(theme: defaultTheme)
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
func borderColor(theme: Theme) -> Color? {
|
|
70
58
|
switch self {
|
|
71
|
-
case .outline: return
|
|
72
|
-
case .secondary: return
|
|
59
|
+
case .outline: return Colors.primary
|
|
60
|
+
case .secondary: return Colors.black04
|
|
73
61
|
default: return nil
|
|
74
62
|
}
|
|
75
63
|
}
|
|
@@ -129,7 +117,6 @@ extension ButtonSize {
|
|
|
129
117
|
}
|
|
130
118
|
|
|
131
119
|
public struct Button: View {
|
|
132
|
-
@Environment(\.appTheme) private var theme
|
|
133
120
|
var title: String
|
|
134
121
|
var action: () -> Void
|
|
135
122
|
var type: ButtonType
|
|
@@ -138,7 +125,6 @@ public struct Button: View {
|
|
|
138
125
|
var iconRight: AnyView?
|
|
139
126
|
var isFull: Bool
|
|
140
127
|
var loading: Bool
|
|
141
|
-
var useTintColor: Bool
|
|
142
128
|
|
|
143
129
|
public init(
|
|
144
130
|
title: String = "",
|
|
@@ -148,8 +134,7 @@ public struct Button: View {
|
|
|
148
134
|
iconLeft: AnyView? = nil,
|
|
149
135
|
iconRight: AnyView? = nil,
|
|
150
136
|
isFull: Bool = true,
|
|
151
|
-
loading: Bool = false
|
|
152
|
-
useTintColor: Bool = true
|
|
137
|
+
loading: Bool = false
|
|
153
138
|
) {
|
|
154
139
|
self.title = title
|
|
155
140
|
self.action = action
|
|
@@ -159,7 +144,6 @@ public struct Button: View {
|
|
|
159
144
|
self.iconRight = iconRight
|
|
160
145
|
self.isFull = isFull
|
|
161
146
|
self.loading = loading
|
|
162
|
-
self.useTintColor = useTintColor
|
|
163
147
|
}
|
|
164
148
|
|
|
165
149
|
private func shouldLoadingOnLeft(_ left: AnyView?, _ right: AnyView?) -> Bool {
|
|
@@ -176,15 +160,14 @@ public struct Button: View {
|
|
|
176
160
|
|
|
177
161
|
public var body: some View {
|
|
178
162
|
let loadingOnLeft = shouldLoadingOnLeft(iconLeft, iconRight)
|
|
179
|
-
let isEnabled = type != .disabled && !loading
|
|
180
163
|
|
|
181
|
-
let bg = type.backgroundColor(loading: loading
|
|
182
|
-
let fg = type.contentColor(loading: loading
|
|
183
|
-
let border = type.borderColor
|
|
164
|
+
let bg = type.backgroundColor(loading: loading)
|
|
165
|
+
let fg = type.contentColor(loading: loading)
|
|
166
|
+
let border = type.borderColor
|
|
184
167
|
let borderWidth = type.borderWidth
|
|
185
168
|
|
|
186
169
|
SwiftUI.Button(action: {
|
|
187
|
-
if
|
|
170
|
+
if !loading, type != .disabled {
|
|
188
171
|
action()
|
|
189
172
|
}
|
|
190
173
|
}) {
|
|
@@ -195,7 +178,7 @@ public struct Button: View {
|
|
|
195
178
|
.colorMultiply(fg)
|
|
196
179
|
|
|
197
180
|
} else if let iconLeft = iconLeft {
|
|
198
|
-
|
|
181
|
+
iconLeft.frame(width: size.iconSize, height: size.iconSize)
|
|
199
182
|
}
|
|
200
183
|
|
|
201
184
|
MomoText(title, typography: size.typographyStyle, color: fg)
|
|
@@ -208,7 +191,7 @@ public struct Button: View {
|
|
|
208
191
|
.colorMultiply(fg)
|
|
209
192
|
|
|
210
193
|
} else if let iconRight = iconRight {
|
|
211
|
-
|
|
194
|
+
iconRight.frame(width: size.iconSize, height: size.iconSize)
|
|
212
195
|
}
|
|
213
196
|
}
|
|
214
197
|
.frame(maxWidth: isFull ? .infinity : nil)
|
|
@@ -220,30 +203,8 @@ public struct Button: View {
|
|
|
220
203
|
.strokeBorder(border ?? .clear, lineWidth: border != nil ? borderWidth : 0)
|
|
221
204
|
)
|
|
222
205
|
.clipShape(RoundedRectangle(cornerRadius: size.radius))
|
|
206
|
+
.opacity(loading ? 0.75 : 1)
|
|
223
207
|
}
|
|
224
|
-
.
|
|
225
|
-
.disabled(!isEnabled)
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
@ViewBuilder
|
|
229
|
-
private func tintedIcon(_ icon: AnyView, color: Color) -> some View {
|
|
230
|
-
if useTintColor {
|
|
231
|
-
icon
|
|
232
|
-
.frame(width: size.iconSize, height: size.iconSize)
|
|
233
|
-
.colorMultiply(color)
|
|
234
|
-
} else {
|
|
235
|
-
icon
|
|
236
|
-
.frame(width: size.iconSize, height: size.iconSize)
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
private struct ButtonPressFeedbackStyle: ButtonStyle {
|
|
242
|
-
let isEnabled: Bool
|
|
243
|
-
|
|
244
|
-
func makeBody(configuration: Configuration) -> some View {
|
|
245
|
-
configuration.label
|
|
246
|
-
.opacity(configuration.isPressed && isEnabled ? 0.5 : 1)
|
|
247
|
-
.animation(.easeInOut(duration: 0.1), value: configuration.isPressed)
|
|
208
|
+
.disabled(type == .disabled || loading)
|
|
248
209
|
}
|
|
249
210
|
}
|
|
@@ -2,7 +2,6 @@ import Foundation
|
|
|
2
2
|
import SwiftUI
|
|
3
3
|
|
|
4
4
|
public struct Checkbox: View{
|
|
5
|
-
@Environment(\.appTheme) private var theme
|
|
6
5
|
@Binding var checked: Bool
|
|
7
6
|
var disabled: Bool
|
|
8
7
|
var onChange: ((Bool)->Void)?
|
|
@@ -38,11 +37,11 @@ public struct Checkbox: View{
|
|
|
38
37
|
)
|
|
39
38
|
|
|
40
39
|
if checked {
|
|
41
|
-
Image(systemName: indeterminate ? "minus" : "checkmark")
|
|
40
|
+
Image(systemName: indeterminate ? "minus.square.fill" : "checkmark.square.fill")
|
|
42
41
|
.resizable()
|
|
43
|
-
.
|
|
44
|
-
.
|
|
45
|
-
.frame(width:
|
|
42
|
+
.foregroundColor(backgroundColor)
|
|
43
|
+
.background(Colors.black01)
|
|
44
|
+
.frame(width: 20, height: 20)
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
47
|
|
|
@@ -54,28 +53,28 @@ public struct Checkbox: View{
|
|
|
54
53
|
|
|
55
54
|
// Title
|
|
56
55
|
if !title.isEmpty {
|
|
57
|
-
|
|
56
|
+
Text(title)
|
|
57
|
+
.font(.description1)
|
|
58
|
+
.ignoreBoldTextSetting()
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
private var borderColor: Color {
|
|
63
|
-
if disabled
|
|
64
|
-
return
|
|
65
|
-
} else if disabled {
|
|
66
|
-
return theme.colors.border.disable
|
|
64
|
+
if disabled {
|
|
65
|
+
return Colors.black03
|
|
67
66
|
} else if checked {
|
|
68
|
-
return
|
|
67
|
+
return Colors.primary
|
|
69
68
|
} else {
|
|
70
|
-
return
|
|
69
|
+
return Colors.text
|
|
71
70
|
}
|
|
72
71
|
}
|
|
73
72
|
|
|
74
73
|
private var backgroundColor: Color {
|
|
75
74
|
if disabled && checked {
|
|
76
|
-
return
|
|
75
|
+
return Colors.pink08
|
|
77
76
|
} else if checked {
|
|
78
|
-
return
|
|
77
|
+
return Colors.primary
|
|
79
78
|
} else {
|
|
80
79
|
return Color.clear
|
|
81
80
|
}
|
package/ios/Chip/Chip.swift
CHANGED
|
@@ -2,18 +2,17 @@ import SwiftUI
|
|
|
2
2
|
import Foundation
|
|
3
3
|
|
|
4
4
|
public struct Chip: View {
|
|
5
|
-
@Environment(\.appTheme) private var theme
|
|
6
5
|
public enum ChipSize { case small, large }
|
|
7
6
|
|
|
8
7
|
public struct Dimensions {
|
|
9
|
-
let height: CGFloat
|
|
10
8
|
let horizontal: CGFloat
|
|
9
|
+
let vertical: CGFloat
|
|
11
10
|
let iconSize: CGFloat
|
|
12
11
|
let iconSpacing: CGFloat
|
|
13
12
|
}
|
|
14
13
|
|
|
15
|
-
public static let Large = Dimensions(
|
|
16
|
-
public static let Small = Dimensions(
|
|
14
|
+
public static let Large = Dimensions(horizontal: 12, vertical: 8, iconSize: 20, iconSpacing: 8)
|
|
15
|
+
public static let Small = Dimensions(horizontal: 10, vertical: 6, iconSize: 16, iconSpacing: 6)
|
|
17
16
|
|
|
18
17
|
private let label: String?
|
|
19
18
|
private let iconLeft: String?
|
|
@@ -54,14 +53,14 @@ public struct Chip: View {
|
|
|
54
53
|
let dims = (size == .small) ? Self.Small : Self.Large
|
|
55
54
|
|
|
56
55
|
let bg: Color = {
|
|
57
|
-
if selected { return
|
|
56
|
+
if selected { return Colors.pink10 }
|
|
58
57
|
if let explicit = backgroundColor { return explicit }
|
|
59
58
|
return Colors.black03
|
|
60
59
|
}()
|
|
61
60
|
|
|
62
|
-
let textColor: Color = selected ?
|
|
63
|
-
let leftTint: Color = selected ?
|
|
64
|
-
let rightTint: Color = selected ?
|
|
61
|
+
let textColor: Color = selected ? Colors.primary : Colors.text
|
|
62
|
+
let leftTint: Color = selected ? Colors.primary : iconLeftTint ?? Colors.text
|
|
63
|
+
let rightTint: Color = selected ? Colors.primary : iconRightTint ?? Colors.text
|
|
65
64
|
|
|
66
65
|
HStack(spacing: dims.iconSpacing) {
|
|
67
66
|
if let iconLeft {
|
|
@@ -78,7 +77,7 @@ public struct Chip: View {
|
|
|
78
77
|
}
|
|
79
78
|
}
|
|
80
79
|
.padding(.horizontal, dims.horizontal)
|
|
81
|
-
.
|
|
80
|
+
.padding(.vertical, dims.vertical)
|
|
82
81
|
.background(
|
|
83
82
|
RoundedRectangle(cornerRadius: Radius.L, style: .continuous)
|
|
84
83
|
.fill(bg)
|
|
@@ -87,24 +86,11 @@ public struct Chip: View {
|
|
|
87
86
|
Group {
|
|
88
87
|
if selected {
|
|
89
88
|
RoundedRectangle(cornerRadius: Radius.L, style: .continuous)
|
|
90
|
-
.stroke(
|
|
89
|
+
.stroke(Colors.primary, lineWidth: 2)
|
|
91
90
|
}
|
|
92
91
|
}
|
|
93
92
|
)
|
|
94
93
|
.contentShape(RoundedRectangle(cornerRadius: Radius.L, style: .continuous))
|
|
95
94
|
.onTapGesture(perform: onClick)
|
|
96
|
-
.modifier(ChipAccessibilityModifier(accessibilityLabel: accessibilityLabel))
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
private struct ChipAccessibilityModifier: ViewModifier {
|
|
101
|
-
let accessibilityLabel: String?
|
|
102
|
-
|
|
103
|
-
func body(content: Content) -> some View {
|
|
104
|
-
if let id = accessibilityLabel {
|
|
105
|
-
content.accessibilityIdentifier(id)
|
|
106
|
-
} else {
|
|
107
|
-
content
|
|
108
|
-
}
|
|
109
95
|
}
|
|
110
96
|
}
|
|
@@ -3,18 +3,18 @@ import Foundation
|
|
|
3
3
|
import SwiftUI
|
|
4
4
|
|
|
5
5
|
public enum Colors {
|
|
6
|
-
public static let primary = Color
|
|
7
|
-
public static let primaryDark = Color
|
|
8
|
-
public static let primaryLight = Color
|
|
9
|
-
public static let secondary = Color
|
|
10
|
-
public static let background = Color
|
|
11
|
-
public static let border = Color
|
|
12
|
-
public static let text = Color
|
|
13
|
-
public static let textSecondary = Color
|
|
14
|
-
public static let card = Color
|
|
15
|
-
public static let error = Color
|
|
16
|
-
public static let info = Color(
|
|
17
|
-
public static let success = Color
|
|
6
|
+
public static let primary = Color("Primary")
|
|
7
|
+
public static let primaryDark = Color("PrimaryDark")
|
|
8
|
+
public static let primaryLight = Color("PrimaryLight")
|
|
9
|
+
public static let secondary = Color("Secondary")
|
|
10
|
+
public static let background = Color("Background")
|
|
11
|
+
public static let border = Color("Border")
|
|
12
|
+
public static let text = Color("Text")
|
|
13
|
+
public static let textSecondary = Color("TextSecondary")
|
|
14
|
+
public static let card = Color("Card")
|
|
15
|
+
public static let error = Color("Error")
|
|
16
|
+
public static let info = Color("Info")
|
|
17
|
+
public static let success = Color("Success")
|
|
18
18
|
|
|
19
19
|
public static let black20 = Color(hex: "000000")
|
|
20
20
|
public static let black19 = Color(hex: "18191a")
|
|
@@ -1,38 +1,6 @@
|
|
|
1
1
|
import SwiftUI
|
|
2
|
-
import Foundation
|
|
3
|
-
|
|
4
|
-
private final class MoMoUIKitsBundleToken {}
|
|
5
|
-
|
|
6
|
-
enum MoMoUIKitsResources {
|
|
7
|
-
static let bundle: Bundle = {
|
|
8
|
-
let bundleName = "MoMoUIKitsResources"
|
|
9
|
-
let tokenBundle = Bundle(for: MoMoUIKitsBundleToken.self)
|
|
10
|
-
let frameworkBundle = Bundle(identifier: "org.cocoapods.MoMoUIKits")
|
|
11
|
-
let candidates = [
|
|
12
|
-
Bundle.main.resourceURL,
|
|
13
|
-
tokenBundle.resourceURL,
|
|
14
|
-
tokenBundle.bundleURL,
|
|
15
|
-
frameworkBundle?.resourceURL,
|
|
16
|
-
frameworkBundle?.bundleURL
|
|
17
|
-
]
|
|
18
|
-
|
|
19
|
-
for candidate in candidates {
|
|
20
|
-
guard let bundleURL = candidate?.appendingPathComponent("\(bundleName).bundle"),
|
|
21
|
-
let bundle = Bundle(url: bundleURL) else {
|
|
22
|
-
continue
|
|
23
|
-
}
|
|
24
|
-
return bundle
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return Bundle.main
|
|
28
|
-
}()
|
|
29
|
-
}
|
|
30
2
|
|
|
31
3
|
public extension Color {
|
|
32
|
-
static func momoAsset(_ name: String) -> Color {
|
|
33
|
-
Color(name, bundle: MoMoUIKitsResources.bundle)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
4
|
init(hex: UInt, alpha: Double = 1) {
|
|
37
5
|
self.init(
|
|
38
6
|
.sRGB,
|
package/ios/Icon/Icon.swift
CHANGED
|
@@ -23,9 +23,6 @@ func loadIconSources() -> [String: IconSource] {
|
|
|
23
23
|
// Load the JSON data into a global variable
|
|
24
24
|
let iconSources: [String: IconSource] = loadIconSources()
|
|
25
25
|
|
|
26
|
-
// Icons that must never be tinted (mirror Compose `noThemeIcons`)
|
|
27
|
-
let noThemeIcons: [String] = ["ic_round_momo_tiny"]
|
|
28
|
-
|
|
29
26
|
// Icon ViewModel
|
|
30
27
|
public struct Icon: View {
|
|
31
28
|
var source: String
|
|
@@ -47,9 +44,7 @@ public struct Icon: View {
|
|
|
47
44
|
|
|
48
45
|
public var body: some View {
|
|
49
46
|
if let uri = iconSources[source]?.uri {
|
|
50
|
-
|
|
51
|
-
let resolvedColor = noThemeIcons.contains(source) ? nil : color
|
|
52
|
-
ImageView(uri, color: resolvedColor).frame(width: size, height: size)
|
|
47
|
+
ImageView(uri, color: color).frame(width: size, height: size)
|
|
53
48
|
}
|
|
54
49
|
}
|
|
55
50
|
}
|
package/ios/Input/Input.swift
CHANGED
|
@@ -3,14 +3,12 @@ import SwiftUI
|
|
|
3
3
|
import Combine
|
|
4
4
|
|
|
5
5
|
public struct Input: View {
|
|
6
|
-
@Environment(\.appTheme) private var theme
|
|
7
6
|
@Binding public var text: String
|
|
8
7
|
|
|
9
8
|
public var placeholder: String
|
|
10
9
|
public var floatingValue: String
|
|
11
|
-
public var floatingValueColor: Color?
|
|
12
10
|
public var floatingIcon: String
|
|
13
|
-
public var floatingIconColor: Color
|
|
11
|
+
public var floatingIconColor: Color
|
|
14
12
|
public var size: InputSize
|
|
15
13
|
public var hintText: String
|
|
16
14
|
public var error: String
|
|
@@ -19,9 +17,9 @@ public struct Input: View {
|
|
|
19
17
|
public var readOnly: Bool
|
|
20
18
|
public var secureTextEntry: Bool
|
|
21
19
|
public var rightIcon: String
|
|
22
|
-
public var rightIconColor: Color
|
|
20
|
+
public var rightIconColor: Color
|
|
23
21
|
public var leadingIcon: String
|
|
24
|
-
public var leadingIconColor: Color
|
|
22
|
+
public var leadingIconColor: Color
|
|
25
23
|
public var loading: Bool
|
|
26
24
|
public var required: Bool
|
|
27
25
|
public var maxLength: Int?
|
|
@@ -40,9 +38,8 @@ public struct Input: View {
|
|
|
40
38
|
text: Binding<String>,
|
|
41
39
|
placeholder: String = "",
|
|
42
40
|
floatingValue: String = "",
|
|
43
|
-
floatingValueColor: Color? = nil,
|
|
44
41
|
floatingIcon: String = "",
|
|
45
|
-
floatingIconColor: Color
|
|
42
|
+
floatingIconColor: Color = Colors.primary,
|
|
46
43
|
size: InputSize = .small,
|
|
47
44
|
hintText: String = "",
|
|
48
45
|
error: String = "",
|
|
@@ -51,9 +48,9 @@ public struct Input: View {
|
|
|
51
48
|
readOnly: Bool = false,
|
|
52
49
|
secureTextEntry: Bool = false,
|
|
53
50
|
rightIcon: String = "",
|
|
54
|
-
rightIconColor: Color
|
|
51
|
+
rightIconColor: Color = Colors.black17,
|
|
55
52
|
leadingIcon: String = "",
|
|
56
|
-
leadingIconColor: Color
|
|
53
|
+
leadingIconColor: Color = Colors.black12,
|
|
57
54
|
loading: Bool = false,
|
|
58
55
|
required: Bool = false,
|
|
59
56
|
maxLength: Int? = nil,
|
|
@@ -68,7 +65,6 @@ public struct Input: View {
|
|
|
68
65
|
self._text = text
|
|
69
66
|
self.placeholder = placeholder
|
|
70
67
|
self.floatingValue = floatingValue
|
|
71
|
-
self.floatingValueColor = floatingValueColor
|
|
72
68
|
self.floatingIcon = floatingIcon
|
|
73
69
|
self.floatingIconColor = floatingIconColor
|
|
74
70
|
self.size = size
|
|
@@ -111,14 +107,14 @@ public struct Input: View {
|
|
|
111
107
|
HStack(spacing: Spacing.XS) {
|
|
112
108
|
MomoText(floatingValue, typography: .labelSMedium, color: getFloatingColor())
|
|
113
109
|
if required {
|
|
114
|
-
MomoText("*", typography: .labelSMedium, color:
|
|
110
|
+
MomoText("*", typography: .labelSMedium, color: Colors.red03)
|
|
115
111
|
}
|
|
116
112
|
if !floatingIcon.isEmpty {
|
|
117
113
|
Icon(source: floatingIcon, size: 16, color: getFloatingIconColor())
|
|
118
114
|
}
|
|
119
115
|
}
|
|
120
116
|
.padding(.horizontal, Spacing.S)
|
|
121
|
-
.background(
|
|
117
|
+
.background(Colors.black01)
|
|
122
118
|
.offset(x: Spacing.S, y: -8)
|
|
123
119
|
.zIndex(10)
|
|
124
120
|
}
|
|
@@ -127,7 +123,7 @@ public struct Input: View {
|
|
|
127
123
|
HStack(alignment: .center, spacing: 0) {
|
|
128
124
|
// Leading icon
|
|
129
125
|
if !leadingIcon.isEmpty {
|
|
130
|
-
Icon(source: leadingIcon, size: size == .small ? 24 : 32, color:
|
|
126
|
+
Icon(source: leadingIcon, size: size == .small ? 24 : 32, color: leadingIconColor)
|
|
131
127
|
.padding(.trailing, Spacing.M)
|
|
132
128
|
}
|
|
133
129
|
|
|
@@ -148,7 +144,6 @@ public struct Input: View {
|
|
|
148
144
|
fontSize: scaleSize(14),
|
|
149
145
|
fontWeight: fontWeight == .bold ? .bold : .regular,
|
|
150
146
|
textColor: UIColor(getTextColor()),
|
|
151
|
-
cursorColor: UIColor(theme.colors.primary),
|
|
152
147
|
isDisabled: disabled || readOnly,
|
|
153
148
|
maxLength: maxLength,
|
|
154
149
|
onFocusChange: { focused in
|
|
@@ -165,7 +160,7 @@ public struct Input: View {
|
|
|
165
160
|
.ignoreBoldTextSetting()
|
|
166
161
|
.foregroundColor(getTextColor())
|
|
167
162
|
.disabled(disabled || readOnly)
|
|
168
|
-
.
|
|
163
|
+
.applyPrimaryCursorColor()
|
|
169
164
|
.onChange(of: text) { newValue in
|
|
170
165
|
let limited = limitText(newValue)
|
|
171
166
|
if limited != newValue {
|
|
@@ -181,7 +176,7 @@ public struct Input: View {
|
|
|
181
176
|
text = ""
|
|
182
177
|
onChangeText?("")
|
|
183
178
|
}) {
|
|
184
|
-
Icon(source: "24_navigation_close_circle_full", size: 16, color:
|
|
179
|
+
Icon(source: "24_navigation_close_circle_full", size: 16, color: Colors.black12)
|
|
185
180
|
.padding(.leading, Spacing.S).accessibility(identifier: "ic_clear")
|
|
186
181
|
}
|
|
187
182
|
}
|
|
@@ -200,14 +195,14 @@ public struct Input: View {
|
|
|
200
195
|
Icon(
|
|
201
196
|
source: isPasswordHidden ? "24_security_eye_off" : "24_security_eye_open",
|
|
202
197
|
size: 24,
|
|
203
|
-
color:
|
|
198
|
+
color: rightIconColor
|
|
204
199
|
)
|
|
205
200
|
.padding(.leading, Spacing.S).accessibility(identifier: "ic_show_hide")
|
|
206
201
|
}
|
|
207
202
|
}
|
|
208
203
|
} else if !rightIcon.isEmpty {
|
|
209
204
|
SwiftUI.Button(action: { onRightIconPressed?() }) {
|
|
210
|
-
Icon(source: rightIcon, size: 24, color:
|
|
205
|
+
Icon(source: rightIcon, size: 24, color: rightIconColor)
|
|
211
206
|
.padding(.leading, Spacing.S)
|
|
212
207
|
}
|
|
213
208
|
}
|
|
@@ -216,7 +211,7 @@ public struct Input: View {
|
|
|
216
211
|
.frame(height: scaleSize(size == .small ? 48 : 56, 1.1))
|
|
217
212
|
.background(
|
|
218
213
|
RoundedRectangle(cornerRadius: Radius.S)
|
|
219
|
-
.fill(
|
|
214
|
+
.fill(Colors.black01)
|
|
220
215
|
)
|
|
221
216
|
.overlay(
|
|
222
217
|
RoundedRectangle(cornerRadius: Radius.S)
|
|
@@ -265,39 +260,31 @@ public struct Input: View {
|
|
|
265
260
|
|
|
266
261
|
private func borderColor() -> Color {
|
|
267
262
|
if disabled {
|
|
268
|
-
return
|
|
263
|
+
return Colors.black04 // border.disable
|
|
269
264
|
}
|
|
270
265
|
if !error.isEmpty {
|
|
271
|
-
return
|
|
266
|
+
return Colors.red03 // error.primary
|
|
272
267
|
}
|
|
273
268
|
if isFocused {
|
|
274
|
-
return
|
|
269
|
+
return Colors.primary
|
|
275
270
|
}
|
|
276
|
-
return
|
|
271
|
+
return Colors.black04 // border.default
|
|
277
272
|
}
|
|
278
273
|
|
|
279
274
|
private func getTextColor() -> Color {
|
|
280
|
-
return disabled ?
|
|
275
|
+
return disabled ? Colors.black09 : Colors.black17
|
|
281
276
|
}
|
|
282
277
|
|
|
283
278
|
private func getPlaceholderColor() -> Color {
|
|
284
|
-
return disabled ?
|
|
279
|
+
return disabled ? Colors.black09 : Colors.black12
|
|
285
280
|
}
|
|
286
281
|
|
|
287
282
|
private func getFloatingColor() -> Color {
|
|
288
|
-
return disabled ?
|
|
283
|
+
return disabled ? Colors.black09 : Colors.black12
|
|
289
284
|
}
|
|
290
285
|
|
|
291
286
|
private func getFloatingIconColor() -> Color {
|
|
292
|
-
return disabled ?
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
private func getLeadingIconColor() -> Color {
|
|
296
|
-
return disabled ? theme.colors.text.disable : (leadingIconColor ?? theme.colors.text.hint)
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
private func getRightIconColor() -> Color {
|
|
300
|
-
return disabled ? theme.colors.text.disable : (rightIconColor ?? theme.colors.text.default)
|
|
287
|
+
return disabled ? Colors.black09 : floatingIconColor
|
|
301
288
|
}
|
|
302
289
|
}
|
|
303
290
|
|
|
@@ -309,7 +296,6 @@ private struct SecureInputField: UIViewRepresentable {
|
|
|
309
296
|
var fontSize: CGFloat
|
|
310
297
|
var fontWeight: UIFont.Weight
|
|
311
298
|
var textColor: UIColor
|
|
312
|
-
var cursorColor: UIColor
|
|
313
299
|
var isDisabled: Bool
|
|
314
300
|
var maxLength: Int?
|
|
315
301
|
var onFocusChange: (Bool) -> Void
|
|
@@ -330,7 +316,7 @@ private struct SecureInputField: UIViewRepresentable {
|
|
|
330
316
|
textField.setContentHuggingPriority(.defaultLow, for: .horizontal)
|
|
331
317
|
textField.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
|
|
332
318
|
textField.text = text
|
|
333
|
-
textField.tintColor =
|
|
319
|
+
textField.tintColor = UIColor(Colors.primary)
|
|
334
320
|
textField.addTarget(
|
|
335
321
|
context.coordinator,
|
|
336
322
|
action: #selector(Coordinator.textFieldDidChange(_:)),
|
|
@@ -345,8 +331,6 @@ private struct SecureInputField: UIViewRepresentable {
|
|
|
345
331
|
textField.text = text
|
|
346
332
|
}
|
|
347
333
|
textField.isEnabled = !isDisabled
|
|
348
|
-
textField.textColor = textColor
|
|
349
|
-
textField.tintColor = cursorColor
|
|
350
334
|
if textField.keyboardType != keyboardType {
|
|
351
335
|
textField.keyboardType = keyboardType
|
|
352
336
|
textField.reloadInputViews()
|
|
@@ -417,9 +401,9 @@ private struct SecureInputField: UIViewRepresentable {
|
|
|
417
401
|
|
|
418
402
|
// MARK: - Helper Extension
|
|
419
403
|
private extension View {
|
|
420
|
-
func
|
|
404
|
+
func applyPrimaryCursorColor() -> some View {
|
|
421
405
|
if #available(iOS 15.0, *) {
|
|
422
|
-
return self.tint(
|
|
406
|
+
return self.tint(Colors.primary)
|
|
423
407
|
} else {
|
|
424
408
|
return self
|
|
425
409
|
}
|