Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WEAV-53] Design System - Core Change #18

Merged
merged 1 commit into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"color-space" : "display-p3",
"components" : {
"alpha" : "1.000",
"blue" : "255",
"green" : "140",
"red" : "64"
"blue" : "247",
"green" : "155",
"red" : "94"
}
},
"idiom" : "universal"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "display-p3",
"components" : {
"alpha" : "1.000",
"blue" : "165",
"green" : "219",
"red" : "223"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "display-p3",
"components" : {
"alpha" : "1.000",
"blue" : "241",
"green" : "242",
"red" : "242"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "display-p3",
"components" : {
"alpha" : "1.000",
"blue" : "196",
"green" : "177",
"red" : "230"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "display-p3",
"components" : {
"alpha" : "1.000",
"blue" : "165",
"green" : "219",
"red" : "223"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public struct BackgroundTextureView: View {
public init() {}

public var body: some View {
DesignCore.Images.backgroundDefault.image!
DesignCore.Images.backgroundDefault.image
.resizable()
.frame(
width: Device.width,
Expand All @@ -27,7 +27,7 @@ fileprivate struct BackgroundTextureViewModifier: ViewModifier {
fileprivate func body(content: Content) -> some View {
content
.background {
DesignCore.Images.backgroundDefault.image!
DesignCore.Images.backgroundDefault.image
.resizable()
.frame(
width: Device.width,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public struct CTABottomButton<BackgroundStyle: ShapeStyle>: View {
)
Text(title)
.foregroundStyle(titleColor)
.typography(.medium_18)
.typography(.semibold_18)
}
Rectangle()
.foregroundStyle(buttonBackgroundColor)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public struct CTAButton<BackgroundStyle: ShapeStyle>: View {
.clipShape(RoundedRectangle(cornerRadius: 20))
Text(title)
.foregroundStyle(titleColor)
.typography(.medium_18)
.typography(.semibold_18)
}
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ struct Toast: View {
.shadow(.alert)

HStack(spacing: 6) {
DesignCore.Images.alert.image!
DesignCore.Images.alert.image
jisu15-kim marked this conversation as resolved.
Show resolved Hide resolved
.resizable()
.frame(width: 20, height: 20)
Text(message)
Expand Down
8 changes: 4 additions & 4 deletions Projects/DesignSystem/DesignCore/Sources/Typography.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ public enum Typography: CaseIterable {
case semibold_28
case semibold_24
case semibold_20
case semibold_18
case semibold_14

// Pretendard - medium
case medium_18
case medium_16
case medium_14

Expand All @@ -38,8 +38,8 @@ extension Typography {
case .semibold_28: return 28
case .semibold_24: return 24
case .semibold_20: return 20
case .semibold_18: return 18
case .semibold_14: return 14
case .medium_18: return 18
case .medium_16: return 16
case .medium_14: return 14
case .regular_15: return 15
Expand All @@ -63,10 +63,10 @@ extension Typography {
case .en_medium_20, .en_medium_16:
return nil

case .semibold_28, .semibold_24, .semibold_20, .semibold_14:
case .semibold_28, .semibold_24, .semibold_20, .semibold_18, .semibold_14:
return ._600

case .medium_18, .medium_16, .medium_14:
case .medium_16, .medium_14:
return ._500

case .regular_15, .regular_14, .regular_12:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct DesignButtonView: View {

CTAButton(
title: "타이틀",
backgroundStyle: DesignCore.Colors.darkGreen
backgroundStyle: DesignCore.Colors.green500
) {}
.padding(.horizontal, 36)

Expand Down
20 changes: 13 additions & 7 deletions Projects/Features/DesignPreview/Sources/DesignColorPreview.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,26 @@ struct DesignColorPreview: View {
DesignCore.Colors.blue300
]

let lightColors = [
DesignCore.Colors.green500,
DesignCore.Colors.pink500,
DesignCore.Colors.blue500,
DesignCore.Colors.green100,
DesignCore.Colors.pink100
]

let pastelColors = [
DesignCore.Colors.darkGreen,
DesignCore.Colors.darkPink,
DesignCore.Colors.darkBlue,
DesignCore.Colors.lightYellow,
DesignCore.Colors.lightGreen,
DesignCore.Colors.lightPink,
DesignCore.Colors.lightBlue,
DesignCore.Colors.yellow50,
DesignCore.Colors.green50,
DesignCore.Colors.pink50,
DesignCore.Colors.blue50,
]

var colorGroups: [[Color]] {
return [
blackColors,
tintColors,
lightColors,
pastelColors
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct DesignTextInputPreview: View {
var phoneRightIcon: TextInputRightIconModel? {
if isPhoneValidated {
return .init(
icon: DesignCore.Images.checkBold.image!,
icon: DesignCore.Images.checkBold.image,
backgroundColor: Color(hex: 0x2DE76B)
)
}
Expand All @@ -36,7 +36,7 @@ struct DesignTextInputPreview: View {
backgroundColor: .white,
text: $companyTextInput,
rightIcon: .init(
icon: DesignCore.Images.checkBold.image!,
icon: DesignCore.Images.checkBold.image,
backgroundColor: Color(hex: 0x2DE76B)
)
)
Expand All @@ -46,7 +46,7 @@ struct DesignTextInputPreview: View {
backgroundColor: .white,
text: $naverTextInput,
rightIcon: .init(
icon: DesignCore.Images.search.image!,
icon: DesignCore.Images.search.image,
backgroundColor: DesignCore.Colors.grey100
)
)
Expand All @@ -58,7 +58,7 @@ struct DesignTextInputPreview: View {
keyboardType: .phonePad,
leftView: {
HStack(spacing: 6) {
DesignCore.Images.flagKorea.image!
DesignCore.Images.flagKorea.image
Text("+82")
.foregroundStyle(DesignCore.Colors.grey200)
.typography(.medium_16)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ struct DesignTypographyPreview: View {
.foregroundStyle(DesignCore.Colors.grey200)
Text("직업 / medium-14")
.typography(.medium_14)
.foregroundStyle(DesignCore.Colors.darkGreen)
.foregroundStyle(DesignCore.Colors.green500)
Text("초등학교 교사 / medium-16")
.typography(.medium_16)
.foregroundStyle(DesignCore.Colors.darkGreen)
.foregroundStyle(DesignCore.Colors.green500)
Text("취미 / semibold-24")
.typography(.semibold_24)
.foregroundStyle(Color(hex: 0x15394B))
Text("연락한 지 2일차 / medium-18")
.typography(.medium_18)
.typography(.semibold_18)
.foregroundStyle(Color(hex: 0x534C44))
Text("3일차까지 10시간 24분 43초 남았어요 / regular-14")
.typography(.regular_14)
Expand Down
5 changes: 2 additions & 3 deletions Tuist/ResourceSynthesizers/Assets.stencil
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,8 @@ import SwiftUI
return image
}

{{accessModifier}} var image: SwiftUI.Image? {
guard let uiImage else { return nil }
return SwiftUI.Image(uiImage: uiImage)
{{accessModifier}} var image: SwiftUI.Image {
return SwiftUI.Image(uiImage: uiImage!)
jisu15-kim marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down
Loading