File tree Expand file tree Collapse file tree 4 files changed +8
-2
lines changed
Examples/DemosApp/DemosApp/ComponentsPreview/PreviewPages
Sources/ComponentsKit/Components/Card Expand file tree Collapse file tree 4 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ struct CardPreview: View {
2323 Text ( " Warning Background " ) . tag ( ComponentColor . warning. background)
2424 Text ( " Danger Background " ) . tag ( ComponentColor . danger. background)
2525 }
26+ BorderWidthPicker ( selection: self . $model. borderWidth)
2627 Picker ( " Content Paddings " , selection: self . $model. contentPaddings) {
2728 Text ( " 12px " ) . tag ( Paddings ( padding: 12 ) )
2829 Text ( " 16px " ) . tag ( Paddings ( padding: 16 ) )
Original file line number Diff line number Diff line change @@ -5,6 +5,11 @@ public struct CardVM: ComponentVM {
55 /// The background color of the card.
66 public var backgroundColor : UniversalColor ?
77
8+ /// The border thickness of the card.
9+ ///
10+ /// Defaults to `.medium`.
11+ public var borderWidth : BorderWidth = . medium
12+
813 /// The padding applied to the card's content area.
914 ///
1015 /// Defaults to a padding value of `16` for all sides.
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ public struct SUCard<Content: View>: View {
4444 . cornerRadius ( self . model. cornerRadius. value)
4545 . overlay (
4646 RoundedRectangle ( cornerRadius: self . model. cornerRadius. value)
47- . stroke ( UniversalColor . divider. color, lineWidth: 1.0 )
47+ . stroke ( UniversalColor . divider. color, lineWidth: self . model . borderWidth . value )
4848 )
4949 . shadow ( self . model. shadow)
5050 }
Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ extension UKCard {
140140 static func mainView( _ view: UIView , model: Model ) {
141141 view. backgroundColor = UniversalColor . background. uiColor
142142 view. layer. cornerRadius = model. cornerRadius. value
143- view. layer. borderWidth = 1
143+ view. layer. borderWidth = model . borderWidth . value
144144 view. layer. borderColor = UniversalColor . divider. cgColor
145145 view. layer. shadowRadius = model. shadow. radius
146146 view. layer. shadowOffset = model. shadow. offset
You can’t perform that action at this time.
0 commit comments