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-30] DesignSystem Core #10

Merged
merged 4 commits into from
Sep 15, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
17 changes: 5 additions & 12 deletions Projects/App/Sources/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,23 @@ import SwiftUI
import CoreKit
import NetworkKit
import ComponentsKit
import DesignSystemKit
import DesignCore
import Main

public struct ContentView: View {
public init() {}

public var body: some View {
VStack {
VStack(spacing: 20) {
Text("Hello, World!")
.padding()
.pretendard(weight: ._300, size: 20)
.robotoSlab(size: 12)

MainView()

SampleComponent()
.foregroundStyle(Color.tempColor)
}
.onAppear {
Task {
do {
try await AuthEndpoint.requestSMSVerification(phone: "010-4602-2274")
} catch {
print(error)
}
}
.foregroundStyle(Color.red)
jisu15-kim marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
Expand Down
115 changes: 115 additions & 0 deletions Projects/App/Sources/DesignPreviewView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
//
// DesignPreviewView.swift
// App
//
// Created by 김지수 on 9/14/24.
// Copyright © 2024 com.studentcenter. All rights reserved.
//

import SwiftUI
import DesignCore

struct DesignPreviewView: View {

let blackColors = [
DesignCore.black,
DesignCore.grey500,
DesignCore.grey400,
DesignCore.grey300,
DesignCore.grey200,
DesignCore.grey100
]

let tintColors = [
DesignCore.red300,
DesignCore.blue300
]

let pastelColors = [
DesignCore.darkGreen,
DesignCore.darkPink,
DesignCore.darkBlue,
DesignCore.lightYellow,
DesignCore.lightGreen,
DesignCore.lightPink,
DesignCore.lightBlue,
]

var colorGroups: [[Color]] {
return [
blackColors,
tintColors,
pastelColors
]
}

var body: some View {
NavigationStack {
ScrollView {
VStack(spacing: 24) {
VStack(spacing: 12) {
ForEach(colorGroups, id: \.self) { group in
HStack {
ForEach(group, id: \.self) {
RoundedRectangle(cornerRadius: 4)
.frame(width: 24, height: 24)
.foregroundStyle($0)
}
}
}

RoundedRectangle(cornerRadius: 5)
.frame(height: 36)
.padding(.horizontal, 36)
.foregroundStyle(LinearGradient.gradientA)
}
Divider()

Text("HOME / en-medium-20")
.typography(.en_medium_20)
.foregroundStyle(DesignCore.black)
Text("Introduction / en-medium-16")
.typography(.en_medium_16)
.foregroundStyle(DesignCore.grey400)
Text("새 메시지 3개 / semibold-14")
.typography(.semibold_14)
.foregroundStyle(DesignCore.grey500)
Text("안녕하세요? 이것은 샘플 화면입니다...\nUI를 잡아보는 중인데 글자 수가 얼마... / regular-15")
.typography(.regular_15)
.foregroundStyle(Color(hex: 0x474638))
Text("28분 전 / regular-12")
.typography(.regular_12)
.foregroundStyle(Color(hex: 0x534C44, opacity: 0.5))
Text("이지혜 / semibold-28")
.typography(.semibold_28)
.foregroundStyle(DesignCore.black)
Text("1998년생 / medium-14")
.typography(.medium_14)
.foregroundStyle(DesignCore.grey200)
Text("직업 / medium-14")
.typography(.medium_14)
.foregroundStyle(DesignCore.darkGreen)
Text("초등학교 교사 / medium-16")
.typography(.medium_16)
.foregroundStyle(DesignCore.darkGreen)
Text("취미 / semibold-24")
.typography(.semibold_24)
.foregroundStyle(Color(hex: 0x15394B))
Text("연락한 지 2일차 / medium-18")
.typography(.medium_18)
.foregroundStyle(Color(hex: 0x534C44))
Text("3일차까지 10시간 24분 43초 남았어요 / regular-14")
.typography(.regular_14)
.foregroundStyle(Color(hex: 0x534C44))
}
.padding(.vertical, 20)
}
.navigationTitle("three-days DesignSystem")
.toolbarTitleDisplayMode(.inline)
}
}
}

#Preview {
DesignPreviewView()
}
2 changes: 1 addition & 1 deletion Projects/App/Sources/Weave2IOSApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import SwiftUI
struct Weave2IOSApp: App {
var body: some Scene {
WindowGroup {
ContentView()
DesignPreviewView()
}
}
}
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" : "238",
"green" : "241",
"red" : "245"
}
},
"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" : "31",
"green" : "31",
"red" : "31"
}
},
"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" : "255",
"green" : "140",
"red" : "64"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"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" : "143",
"green" : "109",
"red" : "96"
}
},
"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" : "84",
"green" : "102",
"red" : "91"
}
},
"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" : "112",
"green" : "100",
"red" : "132"
}
},
"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" : "172",
"green" : "139",
"red" : "255"
}
},
"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" : "255",
"green" : "193",
"red" : "152"
}
},
"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" : "197",
"green" : "199",
"red" : "202"
}
},
"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" : "160",
"green" : "160",
"red" : "160"
}
},
"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" : "132",
"green" : "132",
"red" : "132"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Loading