Skip to content

Commit 621676a

Browse files
Merge pull request #99 from componentskit/dev
v1.5.3
2 parents b582cb9 + d54585b commit 621676a

File tree

8 files changed

+20
-17
lines changed

8 files changed

+20
-17
lines changed

Sources/ComponentsKit/Components/Button/SUButton.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ private struct CustomButtonStyle: SwiftUI.ButtonStyle {
139139
RoundedRectangle(
140140
cornerRadius: self.model.cornerRadius.value()
141141
)
142-
.stroke(
142+
.strokeBorder(
143143
self.model.borderColor?.color ?? .clear,
144144
lineWidth: self.model.borderWidth
145145
)

Sources/ComponentsKit/Components/Card/SUCard.swift

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,19 @@ public struct SUCard<Content: View>: View {
5959
.shadow(self.model.shadow)
6060
.observeSize { self.contentSize = $0 }
6161
.contentShape(.rect)
62-
.gesture(
62+
.onTapGesture {
63+
guard self.model.isTappable else { return }
64+
self.onTap()
65+
}
66+
.simultaneousGesture(
6367
DragGesture(minimumDistance: 0.0)
6468
.onChanged { _ in
65-
guard self.model.isTappable else { return }
6669
self.isPressed = true
6770
}
68-
.onEnded { value in
69-
guard self.model.isTappable else { return }
70-
71-
defer { self.isPressed = false }
72-
73-
if CGRect(origin: .zero, size: self.contentSize)
74-
.contains(value.location) {
75-
self.onTap()
76-
}
77-
}
71+
.onEnded { _ in
72+
self.isPressed = false
73+
},
74+
isEnabled: self.model.isTappable
7875
)
7976
.scaleEffect(
8077
self.isPressed ? self.model.animationScale.value : 1,

Sources/ComponentsKit/Components/Checkbox/SUCheckbox.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public struct SUCheckbox: View {
5656
}
5757
.overlay {
5858
RoundedRectangle(cornerRadius: self.model.checkboxCornerRadius)
59-
.stroke(
59+
.strokeBorder(
6060
self.model.borderColor.color,
6161
lineWidth: self.model.borderWidth
6262
)

Sources/ComponentsKit/Components/InputField/SUInputField.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public struct SUInputField<FocusValue: Hashable>: View {
9999
RoundedRectangle(
100100
cornerRadius: self.model.cornerRadius.value()
101101
)
102-
.stroke(
102+
.strokeBorder(
103103
self.model.borderColor.color,
104104
lineWidth: self.model.borderWidth
105105
)

Sources/ComponentsKit/Components/Modal/SwiftUI/Helpers/ModalPresentationModifier.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ struct ModalPresentationModifier<Modal: View>: ViewModifier {
2323

2424
func body(content: Content) -> some View {
2525
content
26+
.transaction {
27+
$0.disablesAnimations = false
28+
}
2629
.onAppear {
2730
if self.isContentVisible {
2831
self.isPresented = true

Sources/ComponentsKit/Components/Modal/SwiftUI/Helpers/ModalPresentationWithItemModifier.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ struct ModalPresentationWithItemModifier<Modal: View, Item: Identifiable>: ViewM
2323

2424
func body(content: Content) -> some View {
2525
content
26+
.transaction {
27+
$0.disablesAnimations = false
28+
}
2629
.onAppear {
2730
self.presentedItem = self.visibleItem
2831
}

Sources/ComponentsKit/Components/Modal/SwiftUI/ModalContent.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ struct ModalContent<VM: ModalVM, Header: View, Body: View, Footer: View>: View {
5959
.clipShape(RoundedRectangle(cornerRadius: self.model.cornerRadius.value))
6060
.overlay(
6161
RoundedRectangle(cornerRadius: self.model.cornerRadius.value)
62-
.stroke(UniversalColor.divider.color, lineWidth: self.model.borderWidth.value)
62+
.strokeBorder(UniversalColor.divider.color, lineWidth: self.model.borderWidth.value)
6363
)
6464
.padding(self.model.outerPaddings.edgeInsets)
6565
}

Sources/ComponentsKit/Components/TextInput/SUTextInput.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public struct SUTextInput<FocusValue: Hashable>: View {
137137
RoundedRectangle(
138138
cornerRadius: self.model.cornerRadius.value()
139139
)
140-
.stroke(
140+
.strokeBorder(
141141
self.model.borderColor.color,
142142
lineWidth: self.model.borderWidth
143143
)

0 commit comments

Comments
 (0)