-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a3bae7
commit cbea770
Showing
3 changed files
with
142 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// Button+ButtonRole.swift | ||
// | ||
// | ||
// Created by hhhello0507 on 7/26/24. | ||
// | ||
|
||
import SwiftUI | ||
|
||
extension DodamButton.ButtonRole { | ||
var background: DodamColorable { | ||
switch self { | ||
case .primary: DodamColor.Primary.normal | ||
case .secondary: DodamColor.Primary.assistive | ||
case .assistive: DodamColor.Fill.normal | ||
} | ||
} | ||
|
||
var foreground: DodamColorable { | ||
switch self { | ||
case .primary: DodamColor.Static.white | ||
case .secondary: DodamColor.Primary.normal | ||
case .assistive: DodamColor.Label.neutral | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// | ||
// Button+ButtonType.swift | ||
// | ||
// | ||
// Created by hhhello0507 on 7/26/24. | ||
// | ||
|
||
import SwiftUI | ||
|
||
extension DodamButton.ButtonType { | ||
var shape: DodamShape { | ||
switch self { | ||
case .large: .medium | ||
case .medium: .small | ||
case .small: .extraSmall | ||
} | ||
} | ||
|
||
var height: CGFloat { | ||
switch self { | ||
case .large: 48 | ||
case .medium: 38 | ||
case .small: 32 | ||
} | ||
} | ||
|
||
var horizontalPadding: CGFloat { | ||
switch self { | ||
case .large: 28 | ||
case .medium: 20 | ||
case .small: 12 | ||
} | ||
} | ||
|
||
var iconSize: CGFloat { | ||
switch self { | ||
case .large: 20 | ||
case .medium: 18 | ||
case .small: 16 | ||
} | ||
} | ||
|
||
var font: Font { | ||
switch self { | ||
case .large: .body1(.bold) | ||
case .medium: .body2(.bold) | ||
case .small: .caption1(.bold) | ||
} | ||
} | ||
|
||
var horizontalSpacing: CGFloat { | ||
switch self { | ||
case .large: 6 | ||
case .medium: 5 | ||
case .small: 4 | ||
} | ||
} | ||
} |