@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
|
@@ -1,269 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// BadgeDemo.swift
|
|
3
|
-
// Example
|
|
4
|
-
//
|
|
5
|
-
// Created by sophia on 12/5/25.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
import Foundation
|
|
9
|
-
import MoMoUIKits
|
|
10
|
-
import SwiftUI
|
|
11
|
-
|
|
12
|
-
// MARK: - BadgeDemo
|
|
13
|
-
|
|
14
|
-
struct BadgeDemo: View {
|
|
15
|
-
// MARK: Internal
|
|
16
|
-
|
|
17
|
-
var body: some View {
|
|
18
|
-
ScrollView {
|
|
19
|
-
VStack(alignment: .leading, spacing: 24) {
|
|
20
|
-
// MARK: - Basic Badges
|
|
21
|
-
|
|
22
|
-
VStack(alignment: .leading, spacing: 12) {
|
|
23
|
-
Text("Basic Badges")
|
|
24
|
-
.font(.headline)
|
|
25
|
-
.padding(.horizontal, 16)
|
|
26
|
-
|
|
27
|
-
VStack(spacing: 16) {
|
|
28
|
-
HStack(spacing: 16) {
|
|
29
|
-
VStack(spacing: 8) {
|
|
30
|
-
Badge()
|
|
31
|
-
Text("Default")
|
|
32
|
-
.font(.caption)
|
|
33
|
-
.foregroundColor(.gray)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
VStack(spacing: 8) {
|
|
37
|
-
Badge(label: "9")
|
|
38
|
-
Text("Single Digit")
|
|
39
|
-
.font(.caption)
|
|
40
|
-
.foregroundColor(.gray)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
VStack(spacing: 8) {
|
|
44
|
-
Badge(label: "99")
|
|
45
|
-
Text("Two Digits")
|
|
46
|
-
.font(.caption)
|
|
47
|
-
.foregroundColor(.gray)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
VStack(spacing: 8) {
|
|
51
|
-
Badge(label: "999")
|
|
52
|
-
Text("99+ Format")
|
|
53
|
-
.font(.caption)
|
|
54
|
-
.foregroundColor(.gray)
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
HStack(spacing: 16) {
|
|
59
|
-
VStack(spacing: 8) {
|
|
60
|
-
Badge(label: "New")
|
|
61
|
-
Text("Text Label")
|
|
62
|
-
.font(.caption)
|
|
63
|
-
.foregroundColor(.gray)
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
VStack(spacing: 8) {
|
|
67
|
-
Badge(label: "Hot", backgroundColor: Colors.pink03)
|
|
68
|
-
Text("Custom Color")
|
|
69
|
-
.font(.caption)
|
|
70
|
-
.foregroundColor(.gray)
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
VStack(spacing: 8) {
|
|
74
|
-
Badge(label: "5", backgroundColor: Colors.green03)
|
|
75
|
-
Text("Green Badge")
|
|
76
|
-
.font(.caption)
|
|
77
|
-
.foregroundColor(.gray)
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
.padding(.horizontal, 16)
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
Divider()
|
|
85
|
-
|
|
86
|
-
// MARK: - Badge Dots
|
|
87
|
-
|
|
88
|
-
VStack(alignment: .leading, spacing: 12) {
|
|
89
|
-
Text("Badge Dots")
|
|
90
|
-
.font(.headline)
|
|
91
|
-
.padding(.horizontal, 16)
|
|
92
|
-
|
|
93
|
-
HStack(spacing: 32) {
|
|
94
|
-
VStack(spacing: 8) {
|
|
95
|
-
BadgeDot(size: .small)
|
|
96
|
-
Text("Small")
|
|
97
|
-
.font(.caption)
|
|
98
|
-
.foregroundColor(.gray)
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
VStack(spacing: 8) {
|
|
102
|
-
BadgeDot(size: .large)
|
|
103
|
-
Text("Large")
|
|
104
|
-
.font(.caption)
|
|
105
|
-
.foregroundColor(.gray)
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
.padding(.horizontal, 16)
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
Divider()
|
|
112
|
-
|
|
113
|
-
// MARK: - Badge Ribbons
|
|
114
|
-
|
|
115
|
-
VStack(alignment: .leading, spacing: 12) {
|
|
116
|
-
Text("Badge Ribbons")
|
|
117
|
-
.font(.headline)
|
|
118
|
-
.padding(.horizontal, 16)
|
|
119
|
-
|
|
120
|
-
VStack(spacing: 20) {
|
|
121
|
-
HStack(spacing: 20) {
|
|
122
|
-
VStack(spacing: 8) {
|
|
123
|
-
BadgeRibbon(position: .topLeft, label: "Top Left", isRound: true)
|
|
124
|
-
.frame(width: 150, height: 30)
|
|
125
|
-
Text("Top Left")
|
|
126
|
-
.font(.caption)
|
|
127
|
-
.foregroundColor(.gray)
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
VStack(spacing: 8) {
|
|
131
|
-
BadgeRibbon(position: .topRight, label: "Top Right", isRound: true)
|
|
132
|
-
.frame(width: 150, height: 30)
|
|
133
|
-
Text("Top Right")
|
|
134
|
-
.font(.caption)
|
|
135
|
-
.foregroundColor(.gray)
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
HStack(spacing: 20) {
|
|
140
|
-
VStack(spacing: 8) {
|
|
141
|
-
BadgeRibbon(position: .bottomLeft, label: "Bottom Left", isRound: true)
|
|
142
|
-
.frame(width: 150, height: 30)
|
|
143
|
-
Text("Bottom Left")
|
|
144
|
-
.font(.caption)
|
|
145
|
-
.foregroundColor(.gray)
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
VStack(spacing: 8) {
|
|
149
|
-
BadgeRibbon(position: .bottomRight, label: "Bottom Right", isRound: true)
|
|
150
|
-
.frame(width: 150, height: 30)
|
|
151
|
-
Text("Bottom Right")
|
|
152
|
-
.font(.caption)
|
|
153
|
-
.foregroundColor(.gray)
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
.padding(.horizontal, 16)
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
Divider()
|
|
161
|
-
|
|
162
|
-
// MARK: - Badge in Context (Real Usage Examples)
|
|
163
|
-
|
|
164
|
-
VStack(alignment: .leading, spacing: 12) {
|
|
165
|
-
Text("Real Usage Examples")
|
|
166
|
-
.font(.headline)
|
|
167
|
-
.padding(.horizontal, 16)
|
|
168
|
-
|
|
169
|
-
VStack(spacing: 16) {
|
|
170
|
-
// Notification with badge
|
|
171
|
-
HStack {
|
|
172
|
-
Image(systemName: "bell.fill")
|
|
173
|
-
.font(.system(size: 24))
|
|
174
|
-
.foregroundColor(Colors.primary)
|
|
175
|
-
|
|
176
|
-
Text("Notifications")
|
|
177
|
-
.font(.body)
|
|
178
|
-
|
|
179
|
-
Spacer()
|
|
180
|
-
|
|
181
|
-
Badge(label: "23")
|
|
182
|
-
}
|
|
183
|
-
.padding()
|
|
184
|
-
.background(Color(.systemGray6))
|
|
185
|
-
.cornerRadius(12)
|
|
186
|
-
|
|
187
|
-
// Message with badge
|
|
188
|
-
HStack {
|
|
189
|
-
Image(systemName: "message.fill")
|
|
190
|
-
.font(.system(size: 24))
|
|
191
|
-
.foregroundColor(Colors.primary)
|
|
192
|
-
|
|
193
|
-
Text("Messages")
|
|
194
|
-
.font(.body)
|
|
195
|
-
|
|
196
|
-
Spacer()
|
|
197
|
-
|
|
198
|
-
Badge(label: "5")
|
|
199
|
-
}
|
|
200
|
-
.padding()
|
|
201
|
-
.background(Color(.systemGray6))
|
|
202
|
-
.cornerRadius(12)
|
|
203
|
-
|
|
204
|
-
// Product card with ribbon
|
|
205
|
-
ZStack(alignment: .topTrailing) {
|
|
206
|
-
VStack(alignment: .leading, spacing: 8) {
|
|
207
|
-
Rectangle()
|
|
208
|
-
.fill(Color(.systemGray5))
|
|
209
|
-
.frame(height: 120)
|
|
210
|
-
.cornerRadius(8)
|
|
211
|
-
|
|
212
|
-
Text("Product Name")
|
|
213
|
-
.font(.headline)
|
|
214
|
-
|
|
215
|
-
Text("$99.99")
|
|
216
|
-
.font(.subheadline)
|
|
217
|
-
.foregroundColor(.gray)
|
|
218
|
-
}
|
|
219
|
-
.padding()
|
|
220
|
-
.background(Color(.systemGray6))
|
|
221
|
-
.cornerRadius(12)
|
|
222
|
-
|
|
223
|
-
BadgeRibbon(position: .topRight, label: "NEW")
|
|
224
|
-
.frame(width: 60, height: 40)
|
|
225
|
-
.offset(x: 5, y: 0)
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
// Profile with dot indicator
|
|
229
|
-
HStack {
|
|
230
|
-
ZStack(alignment: .topTrailing) {
|
|
231
|
-
Circle()
|
|
232
|
-
.fill(Color(.systemGray5))
|
|
233
|
-
.frame(width: 50, height: 50)
|
|
234
|
-
|
|
235
|
-
BadgeDot(size: .small)
|
|
236
|
-
.offset(x: 2, y: 2)
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
VStack(alignment: .leading) {
|
|
240
|
-
Text("User Name")
|
|
241
|
-
.font(.headline)
|
|
242
|
-
Text("Online")
|
|
243
|
-
.font(.caption)
|
|
244
|
-
.foregroundColor(Colors.green03)
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
Spacer()
|
|
248
|
-
}
|
|
249
|
-
.padding()
|
|
250
|
-
.background(Color(.systemGray6))
|
|
251
|
-
.cornerRadius(12)
|
|
252
|
-
}
|
|
253
|
-
.padding(.horizontal, 16)
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
.padding(.vertical, 16)
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
// MARK: - Preview
|
|
262
|
-
|
|
263
|
-
#if DEBUG
|
|
264
|
-
struct BadgeDemo_Previews: PreviewProvider {
|
|
265
|
-
static var previews: some View {
|
|
266
|
-
BadgeDemo()
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
#endif
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import MoMoUIKits
|
|
2
|
-
import SwiftUI
|
|
3
|
-
|
|
4
|
-
struct BaselineViewDemo: View {
|
|
5
|
-
@State private var enabled = true
|
|
6
|
-
|
|
7
|
-
var body: some View {
|
|
8
|
-
GeometryReader { geometry in
|
|
9
|
-
ZStack(alignment: .top) {
|
|
10
|
-
demoContent(
|
|
11
|
-
topInset: geometry.safeAreaInsets.top,
|
|
12
|
-
bottomInset: geometry.safeAreaInsets.bottom
|
|
13
|
-
)
|
|
14
|
-
|
|
15
|
-
MoMoUIKits.BaselineView(enabled: enabled)
|
|
16
|
-
}
|
|
17
|
-
.background(Colors.black02)
|
|
18
|
-
.ignoresSafeArea(.container, edges: [.top, .bottom])
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
private func demoContent(topInset: CGFloat, bottomInset: CGFloat) -> some View {
|
|
23
|
-
VStack(spacing: 0) {
|
|
24
|
-
header(topInset: topInset)
|
|
25
|
-
|
|
26
|
-
ScrollView {
|
|
27
|
-
VStack(alignment: .leading, spacing: 16) {
|
|
28
|
-
Toggle(isOn: $enabled) {
|
|
29
|
-
MomoText("Show baseline overlay", typography: .headerDefaultBold)
|
|
30
|
-
}
|
|
31
|
-
.padding(16)
|
|
32
|
-
.background(Colors.black01)
|
|
33
|
-
.cornerRadius(Radius.M)
|
|
34
|
-
|
|
35
|
-
MomoText(
|
|
36
|
-
"Use this screen to inspect the safe area, header, horizontal spacing, bottom tab, and button baseline guides.",
|
|
37
|
-
typography: .bodyDefaultRegular,
|
|
38
|
-
color: Colors.textSecondary
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
ForEach(1...8, id: \.self) { index in
|
|
42
|
-
sampleRow(index)
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
.padding(.horizontal, 16)
|
|
46
|
-
.padding(.top, 16)
|
|
47
|
-
.padding(.bottom, 88)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
bottomAction(bottomInset: bottomInset)
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
private func header(topInset: CGFloat) -> some View {
|
|
55
|
-
VStack(spacing: 0) {
|
|
56
|
-
Color.clear
|
|
57
|
-
.frame(height: topInset)
|
|
58
|
-
|
|
59
|
-
HStack(spacing: 12) {
|
|
60
|
-
Image(systemName: "chevron.left")
|
|
61
|
-
.font(.system(size: 18, weight: .semibold))
|
|
62
|
-
.frame(width: 40, height: 52)
|
|
63
|
-
|
|
64
|
-
MomoText("Baseline View", typography: .headerDefaultBold)
|
|
65
|
-
|
|
66
|
-
Spacer(minLength: 0)
|
|
67
|
-
}
|
|
68
|
-
.frame(height: 52)
|
|
69
|
-
.padding(.horizontal, 12)
|
|
70
|
-
.background(Colors.black01)
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
private func sampleRow(_ index: Int) -> some View {
|
|
75
|
-
HStack(spacing: 12) {
|
|
76
|
-
Circle()
|
|
77
|
-
.fill(Colors.primaryLight)
|
|
78
|
-
.frame(width: 36, height: 36)
|
|
79
|
-
.overlay(
|
|
80
|
-
MomoText("\(index)", typography: .labelSMedium, color: Colors.primary)
|
|
81
|
-
)
|
|
82
|
-
|
|
83
|
-
VStack(alignment: .leading, spacing: 4) {
|
|
84
|
-
MomoText("Content row \(index)", typography: .headerSSemibold)
|
|
85
|
-
MomoText("Scrollable content under the debug overlay.", color: Colors.textSecondary)
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
Spacer(minLength: 0)
|
|
89
|
-
}
|
|
90
|
-
.padding(16)
|
|
91
|
-
.background(Colors.black01)
|
|
92
|
-
.cornerRadius(Radius.M)
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
private func bottomAction(bottomInset: CGFloat) -> some View {
|
|
96
|
-
VStack(spacing: 8) {
|
|
97
|
-
MoMoUIKits.Button(
|
|
98
|
-
title: "Primary action",
|
|
99
|
-
action: {},
|
|
100
|
-
type: .primary,
|
|
101
|
-
size: .large
|
|
102
|
-
)
|
|
103
|
-
}
|
|
104
|
-
.padding(.horizontal, 16)
|
|
105
|
-
.padding(.top, 8)
|
|
106
|
-
.padding(.bottom, bottomInset)
|
|
107
|
-
.background(Colors.black01)
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
#if DEBUG
|
|
112
|
-
struct BaselineViewDemo_Previews: PreviewProvider {
|
|
113
|
-
static var previews: some View {
|
|
114
|
-
BaselineViewDemo()
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
#endif
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// BottomTabDemo.swift
|
|
3
|
-
// Example
|
|
4
|
-
//
|
|
5
|
-
// Usage demo for the bottom-tab navigation. Mirrors Compose's `BottomTabUsage`:
|
|
6
|
-
// four tabs (each with its own header title + badge) and a center floating
|
|
7
|
-
// button. Must be hosted inside a `NavigationContainer` (uses the Navigator).
|
|
8
|
-
//
|
|
9
|
-
|
|
10
|
-
import MoMoUIKits
|
|
11
|
-
import SwiftUI
|
|
12
|
-
|
|
13
|
-
@available(iOS 16.0, *)
|
|
14
|
-
struct BottomTabDemoContent: View {
|
|
15
|
-
@EnvironmentObject private var navigator: Navigator
|
|
16
|
-
|
|
17
|
-
var body: some View {
|
|
18
|
-
BottomTab(
|
|
19
|
-
items: [
|
|
20
|
-
BottomTabItem(
|
|
21
|
-
name: "Tab1",
|
|
22
|
-
label: "Option 1",
|
|
23
|
-
icon: "16_basic_home",
|
|
24
|
-
badgeLabel: "",
|
|
25
|
-
options: NavigationOptions(headerTitle: .default("Option 1"), hiddenBack: false),
|
|
26
|
-
screen: { tabBody("Option 1", Colors.blue09) }
|
|
27
|
-
),
|
|
28
|
-
BottomTabItem(
|
|
29
|
-
name: "Tab2",
|
|
30
|
-
label: "Option 2",
|
|
31
|
-
icon: "help_center",
|
|
32
|
-
badgeLabel: "0", // hidden (mirrors Compose's "0" → no badge)
|
|
33
|
-
options: NavigationOptions(headerTitle: .default("Option 2")),
|
|
34
|
-
screen: { tabBody("Option 2", Colors.pink09) }
|
|
35
|
-
),
|
|
36
|
-
BottomTabItem(
|
|
37
|
-
name: "Tab3",
|
|
38
|
-
label: "Option 3 with a very long label",
|
|
39
|
-
icon: "pin_star",
|
|
40
|
-
badgeLabel: "New",
|
|
41
|
-
options: NavigationOptions(headerTitle: .default("Option 3")),
|
|
42
|
-
screen: { tabBody("Option 3", Colors.yellow09) }
|
|
43
|
-
),
|
|
44
|
-
BottomTabItem(
|
|
45
|
-
name: "Tab4",
|
|
46
|
-
label: "Option 4 also quite long here",
|
|
47
|
-
icon: "navigation_more_icon",
|
|
48
|
-
badgeLabel: "9999",
|
|
49
|
-
options: NavigationOptions(headerTitle: .default("Option 4")),
|
|
50
|
-
screen: { tabBody("Option 4", Colors.blue10) }
|
|
51
|
-
)
|
|
52
|
-
],
|
|
53
|
-
floatingButton: BottomTabFloatingButton(
|
|
54
|
-
icon: "16_basic_home",
|
|
55
|
-
label: "Quét QR",
|
|
56
|
-
onPress: { navigator.push({ qrScreen }, options: NavigationOptions(title: "QR")) }
|
|
57
|
-
)
|
|
58
|
-
)
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
@ViewBuilder
|
|
62
|
-
private func tabBody(_ title: String, _ color: Color) -> some View {
|
|
63
|
-
VStack {
|
|
64
|
-
MomoText(title, typography: .headerDefaultBold)
|
|
65
|
-
.padding(.top, 24)
|
|
66
|
-
Spacer()
|
|
67
|
-
}
|
|
68
|
-
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
|
69
|
-
.background(color)
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
private var qrScreen: some View {
|
|
73
|
-
VStack { MomoText("QR scanner placeholder") }
|
|
74
|
-
.frame(maxWidth: .infinity)
|
|
75
|
-
.padding(24)
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// MARK: - Standalone wrapper (so it can be opened directly from Home too)
|
|
80
|
-
|
|
81
|
-
struct BottomTabDemo: View {
|
|
82
|
-
var body: some View {
|
|
83
|
-
if #available(iOS 16.0, *) {
|
|
84
|
-
BottomTabDemoContent()
|
|
85
|
-
} else {
|
|
86
|
-
Text("Bottom tab demo requires iOS 16+").padding()
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Foundation.swift
|
|
3
|
-
// Example
|
|
4
|
-
//
|
|
5
|
-
// Created by Wem on 13/12/2022.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
import Foundation
|
|
9
|
-
import Lottie
|
|
10
|
-
import MoMoUIKits
|
|
11
|
-
import SwiftUI
|
|
12
|
-
|
|
13
|
-
// MARK: - ButtonDemo
|
|
14
|
-
|
|
15
|
-
struct ButtonDemo: View {
|
|
16
|
-
// MARK: Internal
|
|
17
|
-
|
|
18
|
-
var body: some View {
|
|
19
|
-
ScrollView {
|
|
20
|
-
VStack {
|
|
21
|
-
Toggle("Disabled", isOn: $disabled)
|
|
22
|
-
|
|
23
|
-
Group {
|
|
24
|
-
Button(title: "Button", action: onPress, type: disabled ? .disabled : .primary, size: .large,
|
|
25
|
-
iconRight: AnyView(Image(systemName: "checkmark.circle")))
|
|
26
|
-
Button(title: "Button", action: onPress, size: .small)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
Group {
|
|
30
|
-
Button(title: "Button", action: onPress, type: .danger,
|
|
31
|
-
iconLeft: AnyView(Image(systemName: "checkmark.circle")))
|
|
32
|
-
Button(title: "Button", action: onPress, type: .danger, size: .medium)
|
|
33
|
-
Button(title: "Button", action: onPress, type: .danger, size: .small)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
Group {
|
|
37
|
-
Button(title: "Button", action: onPress, type: .danger, iconLeft: AnyView(Image(systemName: "checkmark.circle")), isFull: false)
|
|
38
|
-
Button(title: "Button", action: onPress, type: .danger, size: .medium, isFull: false)
|
|
39
|
-
Button(title: "Button", action: onPress, type: .danger, size: .small, isFull: false)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
Group {
|
|
44
|
-
Button(title: "Button", action: onPress, type: .tonal, size: .large)
|
|
45
|
-
Button(title: "Button", action: onPress, type: .tonal, size: .medium)
|
|
46
|
-
Button(title: "Button", action: onPress, type: .tonal, size: .small)
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
Group {
|
|
50
|
-
Button(title: "Tinted icon", action: onPress, type: .primary,
|
|
51
|
-
iconLeft: AnyView(Image(systemName: "checkmark.circle")), useTintColor: true)
|
|
52
|
-
Button(title: "Original icon", action: onPress, type: .primary,
|
|
53
|
-
iconLeft: AnyView(Image(systemName: "checkmark.circle")), useTintColor: false)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
Group {
|
|
57
|
-
Button(title: "Button", action: onPress, type: .secondary, size: .large)
|
|
58
|
-
Button(title: "Button", action: onPress, type: .secondary, size: .medium)
|
|
59
|
-
Button(title: "Button", action: onPress, type: .secondary, size: .small)
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
Group {
|
|
63
|
-
Button(title: "Button", action: onPress, type: .text, size: .large)
|
|
64
|
-
Button(title: "Button", action: onPress, type: .text, size: .medium)
|
|
65
|
-
Button(title: "Button", action: onPress, type: .text, size: .small)
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
Group {
|
|
69
|
-
Button(title: "Button", action: onPress, type: .outline, size: .large)
|
|
70
|
-
Button(title: "Button", action: onPress, type: .outline, size: .medium)
|
|
71
|
-
Button(title: "Button", action: onPress, type: .outline, size: .small)
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
Group {
|
|
75
|
-
Button(title: "Button", action: onPress, type: .disabled, size: .large)
|
|
76
|
-
Button(title: "Button", action: onPress, type: .disabled, size: .medium)
|
|
77
|
-
Button(title: "Button", action: onPress, type: .disabled, size: .small)
|
|
78
|
-
}
|
|
79
|
-
Group {
|
|
80
|
-
Button(title: "Button", action: onPress, type: .primary, size: .medium, loading: true)
|
|
81
|
-
Button(title: "Button", action: onPress, type: .danger, size: .medium, iconLeft: AnyView(Image(systemName: "checkmark.circle")), loading: true)
|
|
82
|
-
Button(title: "Button", action: onPress, type: .disabled, size: .medium, iconRight: AnyView(Image(systemName: "checkmark.circle")), loading: true)
|
|
83
|
-
Button(title: "Button", action: onPress, type: .outline, size: .medium, iconLeft: AnyView(Image(systemName: "checkmark.circle")), iconRight: AnyView(Image(systemName: "checkmark.circle")), loading: true)
|
|
84
|
-
Button(title: "Button", action: onPress, type: .secondary, size: .medium, loading: true)
|
|
85
|
-
Button(title: "Button", action: onPress, type: .text, size: .medium, loading: true)
|
|
86
|
-
Button(title: "Button", action: onPress, type: .tonal, size: .medium, loading: true)
|
|
87
|
-
}
|
|
88
|
-
}.padding(16)
|
|
89
|
-
}.padding(.top)
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
func onPress() {
|
|
93
|
-
print("Button")
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// MARK: Private
|
|
97
|
-
|
|
98
|
-
@State private var value: String = ""
|
|
99
|
-
@State private var disabled: Bool = false
|
|
100
|
-
}
|