@momo-kits/native-kits 0.111.1-beta.2 → 0.111.1-beta.5
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.
|
@@ -39,15 +39,15 @@ fun getFont(font: String): FontFamily {
|
|
|
39
39
|
fun getFontFamily(fontFamily: String, fontWeight: FontWeight? = FontWeight.Normal): FontFamily {
|
|
40
40
|
val key = "$fontFamily-${fontWeight?.weight}"
|
|
41
41
|
val fontMap = mapOf(
|
|
42
|
-
"SFProText-100" to "sfprotext_thin.
|
|
43
|
-
"SFProText-200" to "sfprotext_ultralight.
|
|
42
|
+
"SFProText-100" to "sfprotext_thin.otf",
|
|
43
|
+
"SFProText-200" to "sfprotext_ultralight.otf",
|
|
44
44
|
"SFProText-300" to "sfprotext_light.ttf",
|
|
45
45
|
"SFProText-400" to "sfprotext_regular.ttf",
|
|
46
46
|
"SFProText-500" to "sfprotext_medium.ttf",
|
|
47
|
-
"SFProText-600" to "
|
|
48
|
-
"SFProText-700" to "
|
|
49
|
-
"SFProText-800" to "
|
|
50
|
-
"SFProText-900" to "
|
|
47
|
+
"SFProText-600" to "sfprotext_semibold.ttf",
|
|
48
|
+
"SFProText-700" to "sfprotext_bold.ttf",
|
|
49
|
+
"SFProText-800" to "sfprotext_heavy.ttf",
|
|
50
|
+
"SFProText-900" to "sfprotext_black.otf",
|
|
51
51
|
|
|
52
52
|
"MoMoSignature-100" to "momosignature.otf",
|
|
53
53
|
"MoMoSignature-200" to "momosignature.otf",
|
|
@@ -7,8 +7,8 @@ public struct Checkbox: View{
|
|
|
7
7
|
var onChange: ((Bool)->Void)?
|
|
8
8
|
var indeterminate: Bool
|
|
9
9
|
var title: String
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
|
|
11
|
+
|
|
12
12
|
public init(_ checked: Binding<Bool>,disabled: Bool = false, onChange: ( (Bool) -> Void)? = nil,
|
|
13
13
|
indeterminate: Bool = false,
|
|
14
14
|
title: String = ""){
|
|
@@ -18,12 +18,12 @@ public struct Checkbox: View{
|
|
|
18
18
|
self.indeterminate = indeterminate
|
|
19
19
|
self.title = title
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
func onCheck(){
|
|
23
23
|
checked.toggle()
|
|
24
24
|
onChange?(checked)
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
public var body: some View {
|
|
28
28
|
HStack(spacing: Spacing.S) {
|
|
29
29
|
// Checkbox
|
|
@@ -35,22 +35,22 @@ public struct Checkbox: View{
|
|
|
35
35
|
RoundedRectangle(cornerRadius: Radius.XS)
|
|
36
36
|
.stroke(borderColor, lineWidth: Spacing.XXS)
|
|
37
37
|
)
|
|
38
|
-
|
|
38
|
+
|
|
39
39
|
if checked {
|
|
40
40
|
Image(systemName: indeterminate ? "minus.square.fill" : "checkmark.square.fill")
|
|
41
41
|
.resizable()
|
|
42
42
|
.foregroundColor(backgroundColor)
|
|
43
43
|
.background(Colors.black01)
|
|
44
|
-
.frame(width:
|
|
44
|
+
.frame(width: 20, height: 20)
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
|
|
48
48
|
.onTapGesture {
|
|
49
49
|
if !disabled {
|
|
50
|
-
|
|
50
|
+
onCheck()
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
|
|
54
54
|
// Title
|
|
55
55
|
if !title.isEmpty {
|
|
56
56
|
Text(title)
|
|
@@ -58,7 +58,7 @@ public struct Checkbox: View{
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
|
|
61
|
+
|
|
62
62
|
private var borderColor: Color {
|
|
63
63
|
if disabled {
|
|
64
64
|
return Colors.black03
|
|
@@ -68,7 +68,7 @@ public struct Checkbox: View{
|
|
|
68
68
|
return Colors.text
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
|
|
71
|
+
|
|
72
72
|
private var backgroundColor: Color {
|
|
73
73
|
if disabled && checked {
|
|
74
74
|
return Colors.pink08
|