diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/Contents.json b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/check_circular.imageset/Contents.json b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/check_circular.imageset/Contents.json new file mode 100644 index 00000000..741677da --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/check_circular.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "check_circular.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/check_circular.imageset/check_circular.svg b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/check_circular.imageset/check_circular.svg new file mode 100644 index 00000000..08ef67cf --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/check_circular.imageset/check_circular.svg @@ -0,0 +1,4 @@ + + + + diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/checkbox_active.imageset/Contents.json b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/checkbox_active.imageset/Contents.json new file mode 100644 index 00000000..24abe026 --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/checkbox_active.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "checkbox_active.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/checkbox_active.imageset/checkbox_active.svg b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/checkbox_active.imageset/checkbox_active.svg new file mode 100644 index 00000000..fbe45d5c --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/checkbox_active.imageset/checkbox_active.svg @@ -0,0 +1,4 @@ + + + + diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/checkbox_default.imageset/Contents.json b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/checkbox_default.imageset/Contents.json new file mode 100644 index 00000000..b37ef50c --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/checkbox_default.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "checkbox_default.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/checkbox_default.imageset/checkbox_default.svg b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/checkbox_default.imageset/checkbox_default.svg new file mode 100644 index 00000000..ae101c1a --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/checkbox_default.imageset/checkbox_default.svg @@ -0,0 +1,3 @@ + + + diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/chevron_left.imageset/Contents.json b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/chevron_left.imageset/Contents.json new file mode 100644 index 00000000..c6baf6dd --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/chevron_left.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "chevron_left.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/chevron_left.imageset/chevron_left.svg b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/chevron_left.imageset/chevron_left.svg new file mode 100644 index 00000000..d92eb51e --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/chevron_left.imageset/chevron_left.svg @@ -0,0 +1,3 @@ + + + diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/chevron_right.imageset/Contents.json b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/chevron_right.imageset/Contents.json new file mode 100644 index 00000000..da204d2e --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/chevron_right.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "chevron_right.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/chevron_right.imageset/chevron_right.svg b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/chevron_right.imageset/chevron_right.svg new file mode 100644 index 00000000..2094a219 --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/chevron_right.imageset/chevron_right.svg @@ -0,0 +1,3 @@ + + + diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/clock.imageset/Contents.json b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/clock.imageset/Contents.json new file mode 100644 index 00000000..bfc82bed --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/clock.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "clock.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/clock.imageset/clock.svg b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/clock.imageset/clock.svg new file mode 100644 index 00000000..c4e048f9 --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/clock.imageset/clock.svg @@ -0,0 +1,4 @@ + + + + diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/close.imageset/Contents.json b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/close.imageset/Contents.json new file mode 100644 index 00000000..308f9c8f --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/close.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "close.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/close.imageset/close.svg b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/close.imageset/close.svg new file mode 100644 index 00000000..1d1af42d --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/close.imageset/close.svg @@ -0,0 +1,3 @@ + + + diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/deletebox.imageset/Contents.json b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/deletebox.imageset/Contents.json new file mode 100644 index 00000000..d3685f1e --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/deletebox.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "deletebox.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/deletebox.imageset/deletebox.svg b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/deletebox.imageset/deletebox.svg new file mode 100644 index 00000000..d495c766 --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/deletebox.imageset/deletebox.svg @@ -0,0 +1,4 @@ + + + + diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/info.imageset/Contents.json b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/info.imageset/Contents.json new file mode 100644 index 00000000..adcd08a2 --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/info.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "info.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/info.imageset/info.svg b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/info.imageset/info.svg new file mode 100644 index 00000000..fa61a699 --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/info.imageset/info.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/plus.imageset/Contents.json b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/plus.imageset/Contents.json new file mode 100644 index 00000000..a23b7466 --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/plus.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "plus.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/plus.imageset/plus.svg b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/plus.imageset/plus.svg new file mode 100644 index 00000000..3a7c545d --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/plus.imageset/plus.svg @@ -0,0 +1,3 @@ + + + diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/radiobtn_default.imageset/Contents.json b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/radiobtn_default.imageset/Contents.json new file mode 100644 index 00000000..b2d49f2e --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/radiobtn_default.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "radiobtn_default.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/radiobtn_default.imageset/radiobtn_default.svg b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/radiobtn_default.imageset/radiobtn_default.svg new file mode 100644 index 00000000..e2dcd6bb --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/radiobtn_default.imageset/radiobtn_default.svg @@ -0,0 +1,3 @@ + + + diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/radiobtn_selected.imageset/Contents.json b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/radiobtn_selected.imageset/Contents.json new file mode 100644 index 00000000..9bc9da4d --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/radiobtn_selected.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "radiobtn_selected.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/radiobtn_selected.imageset/radiobtn_selected.svg b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/radiobtn_selected.imageset/radiobtn_selected.svg new file mode 100644 index 00000000..5b319c40 --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/radiobtn_selected.imageset/radiobtn_selected.svg @@ -0,0 +1,4 @@ + + + + diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/return.imageset/Contents.json b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/return.imageset/Contents.json new file mode 100644 index 00000000..c2dda6d6 --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/return.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "return.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/return.imageset/return.svg b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/return.imageset/return.svg new file mode 100644 index 00000000..8842ea87 --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/return.imageset/return.svg @@ -0,0 +1,3 @@ + + + diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/search.imageset/Contents.json b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/search.imageset/Contents.json new file mode 100644 index 00000000..4a3f4dab --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/search.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "search.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/search.imageset/search.svg b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/search.imageset/search.svg new file mode 100644 index 00000000..4b2bb641 --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/search.imageset/search.svg @@ -0,0 +1,3 @@ + + + diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/sun.imageset/Contents.json b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/sun.imageset/Contents.json new file mode 100644 index 00000000..fd8711a4 --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/sun.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "sun.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/sun.imageset/sun.svg b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/sun.imageset/sun.svg new file mode 100644 index 00000000..2b9d6e6c --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Assets.xcassets/cherrishIcon/sun.imageset/sun.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishButton.swift b/Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishButton.swift new file mode 100644 index 00000000..8907278f --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishButton.swift @@ -0,0 +1,115 @@ +// +// CherrishButton.swift +// Cherrish-iOS +// +// Created by sumin Kong on 1/10/26. +// + +import SwiftUI + +enum ButtonState { + case normal + case active +} + +enum CherrishButtonType { + case next + case confirm + case save + case addEvent +} + +struct CherrishButton: View { + + let title: String + let type: CherrishButtonType + @Binding var state: ButtonState + let action: () -> Void + + var body: some View { + Button(action: action) { + Text(title) + .typography(.title2_sb_16) + .foregroundStyle(type.textColor(for: state)) + } + .buttonStyle(CherrishButtonStyle(state: state, type: type)) + .disabled(type.isDisabled(for: state)) + } +} + + +struct CherrishButtonStyle: ButtonStyle { + let state: ButtonState + let type: CherrishButtonType + + func makeBody(configuration: Configuration) -> some View { + configuration.label + .frame( + width: configuration.isPressed ? type.width * 0.95 : type.width, + height: configuration.isPressed ? type.height * 0.95 : type.height + ) + .background(type.backgroundColor(for: state)) + .clipShape(RoundedRectangle(cornerRadius: configuration.isPressed + ? type.cornerRadius * 0.95 + : type.cornerRadius)) + } +} + + +extension CherrishButtonType { + + var width: CGFloat { + switch self { + case .next: return 326 + case .confirm: return 126 + case .save: return 278 + case .addEvent: return 196 + } + } + + var height: CGFloat { + switch self { + case .save: return 44 + default: + return 50 + } + } + + var cornerRadius: CGFloat { + switch self { + case .save: return 10 + default: return 12 + } + } + + func backgroundColor(for state: ButtonState) -> Color { + switch self { + case .next: + return state == .active ? .red700 : .gray200 + case .confirm, .save: + return .red700 + case .addEvent: + return .gray400 + } + } + + func textColor(for state: ButtonState) -> Color { + switch self { + case .next: + return state == .active ? .gray0 : .gray600 + case .confirm, .save: + return .gray0 + case .addEvent: + return .gray700 + } + } + + func isDisabled(for state: ButtonState) -> Bool { + switch self { + case .next: + return state == .normal + default: + return false + } + } +}