diff --git a/Source/DDS/Component/Button/SegmentedButton.swift b/Source/DDS/Component/Button/SegmentedButton.swift index 10c2cde..e1fccef 100644 --- a/Source/DDS/Component/Button/SegmentedButton.swift +++ b/Source/DDS/Component/Button/SegmentedButton.swift @@ -1,7 +1,7 @@ import SwiftUI import Combine -public struct SegmentedButton: View { +public struct DodamSegmentedButton: View { private let labels: [String] @@ -22,7 +22,7 @@ public struct SegmentedButton: View { @State private var animatedSelection: Int public var body: some View { - HStack(spacing: 8) { + HStack(spacing: 0) { ForEach(Array(labels.enumerated()), id: \.offset) { idx, label in let isSelected = animatedSelection == idx Button { @@ -39,7 +39,7 @@ public struct SegmentedButton: View { .background { if isSelected { RoundedRectangle(cornerRadius: 10) - .dodamFill(DodamColor.Background.normal) + .dodamFill(DodamColor.Fill.assistive) .matchedGeometryEffect( id: 0, in: animation @@ -52,9 +52,9 @@ public struct SegmentedButton: View { ) } } - .padding(4) } } + .padding(4) .frame(maxWidth: .infinity) .background(DodamColor.Fill.neutral) .clipShape(.medium) @@ -74,8 +74,23 @@ public struct SegmentedButton: View { } } -#Preview { - SegmentedButton(labels: ["외출", "외박"], selection: .constant(0)) - .padding(.horizontal, 16) +private struct SegmentedButtonPreview: View { + var body: some View { + VStack { + DodamSegmentedButton(labels: ["외출", "외박"], selection: .constant(1)) + .padding(.horizontal, 16) + DodamSegmentedButton(labels: ["외출", "외박"], selection: .constant(0)) + .padding(.horizontal, 16) + } .registerSUIT() + } +} + +#Preview { + SegmentedButtonPreview() +} + +#Preview { + SegmentedButtonPreview() + .preferredColorScheme(.dark) } diff --git a/Source/DDS/Component/CheckBox/Checkbox.swift b/Source/DDS/Component/CheckBox/Checkbox.swift index 6b78e22..f7b755d 100644 --- a/Source/DDS/Component/CheckBox/Checkbox.swift +++ b/Source/DDS/Component/CheckBox/Checkbox.swift @@ -1,7 +1,7 @@ import SwiftUI @available(macOS 12, iOS 15, *) -public struct Checkbox: View { +public struct DodamCheckbox: View { public enum CheckType { case primary, error @@ -62,9 +62,9 @@ public struct Checkbox: View { var body: some View { VStack(spacing: 20) { - Checkbox(isChecked: $isChecked) - Checkbox(isChecked: $isChecked, type: .error) - Checkbox(isChecked: $isChecked, isDisabled: true) + DodamCheckbox(isChecked: $isChecked) + DodamCheckbox(isChecked: $isChecked, type: .error) + DodamCheckbox(isChecked: $isChecked, isDisabled: true) } .padding(16) .background(DodamColor.Background.normal) diff --git a/Source/DDS/Foundation/Color/Color.swift b/Source/DDS/Foundation/Color/Color.swift index 06450d6..d8808af 100644 --- a/Source/DDS/Foundation/Color/Color.swift +++ b/Source/DDS/Foundation/Color/Color.swift @@ -47,6 +47,7 @@ public struct DodamColor: RawRepresentable { case normal case neutral case alternative + case assistive } public enum Background { case normal @@ -102,6 +103,7 @@ extension DodamColor.Fill: DodamColorable, CaseIterable { case .normal: .init(P.neutral99, P.neutral25) case .neutral: .init(P.neutral97, P.neutral25) case .alternative: .init(P.neutral95, P.neutral30) + case .assistive: .init(P.common100, P.neutral60) } } }