-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
109 changed files
with
2,728 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,23 @@ | ||
// swift-tools-version: 5.10 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "QDS", | ||
platforms: [.iOS(.v15), .macOS(.v12)], | ||
products: [ | ||
.library( | ||
name: "QDS", | ||
targets: ["QDS"]), | ||
], | ||
targets: [ | ||
.target( | ||
name: "QDS", | ||
dependencies: [], | ||
resources: [ | ||
.process("Resources") | ||
] | ||
) | ||
] | ||
) |
Binary file not shown.
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,41 @@ | ||
// | ||
// SwiftUIView.swift | ||
// | ||
// | ||
// Created by hyk on 7/27/24. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct QvickButton: View { | ||
let action: (() -> ())? | ||
let text: String | ||
let background: Color | ||
|
||
public init(action: (() -> ())? = nil, text: String, background: Color = .blue) { | ||
self.text = text | ||
self.background = background | ||
self.action = action | ||
} | ||
|
||
var body: some View { | ||
Button { | ||
if let action = action { | ||
action() | ||
} | ||
} label: { | ||
RoundedRectangle(cornerRadius: 14) | ||
.frame(width: 345, height: 50) | ||
.foregroundStyle(background) | ||
.overlay { | ||
Text(text) | ||
.font(.pretendard(.semibold, size: 17)) | ||
.foregroundStyle(.white) | ||
} | ||
} | ||
} | ||
} | ||
|
||
#Preview { | ||
QvickButton(text: "다음") | ||
} |
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,16 @@ | ||
import SwiftUI | ||
|
||
public enum QvickTabItem: Int, CaseIterable { | ||
case notice, home, profile | ||
|
||
var icon: Image { | ||
switch self { | ||
case .notice: | ||
Image(systemName: "bell.fill") | ||
case .home: | ||
Image(systemName: "house.fill") | ||
case .profile: | ||
Image(systemName: "person.crop.circle.fill") | ||
} | ||
} | ||
} |
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,55 @@ | ||
// | ||
// SwiftUIView.swift | ||
// | ||
// | ||
// Created by hyk on 7/28/24. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct QvickTabView<Content: View>: View { | ||
@Binding var selection: QvickTabItem | ||
let content: Content | ||
|
||
public init(selection: Binding<QvickTabItem>, @ViewBuilder content: () -> Content) { | ||
self._selection = selection | ||
self.content = content() | ||
} | ||
|
||
var body: some View { | ||
ZStack { | ||
content | ||
|
||
VStack { | ||
Spacer() | ||
|
||
Rectangle() | ||
.foregroundStyle(.white) | ||
.frame(height: 70) | ||
.shadow(color: .black.opacity(0.05), radius: 4, y: -8) | ||
.overlay { | ||
HStack(spacing: 80) { | ||
ForEach(QvickTabItem.allCases, id: \.self) { item in | ||
Button { | ||
self.selection = item | ||
} label: { | ||
item.icon | ||
.resizable() | ||
.scaledToFit() | ||
.frame(height: 38) | ||
.foregroundStyle(item == selection ? .blue : Color(red: 217/255, green: 217/255, blue: 217/255)) | ||
} | ||
.disabled(item == selection) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
#Preview { | ||
QvickTabView<EmptyView>(selection: .constant(QvickTabItem.home)) { | ||
EmptyView() | ||
} | ||
} |
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,60 @@ | ||
// | ||
// SwiftUIView.swift | ||
// | ||
// | ||
// Created by hyk on 7/28/24. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct QvickTextField: View { | ||
@Binding var text: String | ||
let prompt: String | ||
@State var isTab: Bool = false | ||
|
||
var body: some View { | ||
RoundedRectangle(cornerRadius: 15) | ||
.frame(width: 340, height: 60) | ||
.foregroundStyle(.clear) | ||
.overlay { | ||
RoundedRectangle(cornerRadius: 15).stroke(isTab ? .blue : .gray) | ||
|
||
HStack(spacing: 20) { | ||
Image(systemName: "person.fill") | ||
.foregroundStyle(.gray) | ||
|
||
TextField( | ||
text: $text, | ||
prompt: Text(prompt).font(.pretendard(size: 14)) | ||
) { | ||
|
||
} | ||
.overlay { | ||
if self.isTab { | ||
Text(prompt) | ||
.foregroundStyle(.blue) | ||
.font(.pretendard(size: 11)) | ||
.padding(.horizontal, 5) | ||
.background(Color.white) | ||
.offset(x: -120, y: -30) | ||
} | ||
} | ||
.onTapGesture { | ||
withAnimation(.bouncy) { | ||
self.isTab = true | ||
} | ||
} | ||
.onSubmit { | ||
withAnimation(.bouncy) { | ||
self.isTab = false | ||
} | ||
} | ||
} | ||
.padding(.horizontal, 20) | ||
} | ||
} | ||
} | ||
|
||
#Preview { | ||
QvickTextField(text: .constant(""), prompt: "이메일을 입력해주세요") | ||
} |
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,11 @@ | ||
import SwiftUI | ||
|
||
extension QvickColor.Pallete { | ||
public enum Common: QvickColor.CanPallete { case w0, w100 } | ||
public enum Blue: QvickColor.CanPallete { case w100, w200, w300, w400, w500, w600, w700, w800, w900 } | ||
public enum Indigo: QvickColor.CanPallete { case w100, w200, w300, w400, w500, w600, w700, w800, w900 } | ||
public enum SkyBlue: QvickColor.CanPallete { case w100, w200, w300, w400, w500, w600, w700, w800, w900 } | ||
public enum Green: QvickColor.CanPallete { case w100, w200, w300, w400, w500, w600, w700, w800, w900 } | ||
public enum Yellow: QvickColor.CanPallete { case w100, w200, w300, w400, w500, w600, w700, w800, w900 } | ||
public enum Red: QvickColor.CanPallete { case w100, w200, w300, w400, w500, w600, w700, w800, w900 } | ||
} |
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,43 @@ | ||
import SwiftUI | ||
|
||
@available(iOS 13.0, *) | ||
extension QvickColor { | ||
public protocol ColorContain { | ||
var color: Color { get } | ||
} | ||
|
||
public protocol CanPallete: ColorContain { | ||
|
||
} | ||
|
||
public protocol CanSementic: ColorContain { | ||
var pallete: CanPallete { get } | ||
} | ||
} | ||
|
||
extension QvickColor.CanPallete { | ||
public var color: Color { | ||
get { | ||
self.toColor() | ||
} | ||
} | ||
|
||
private func toColor() -> Color { | ||
let enumName = String(reflecting: self).split(separator: ".").dropLast().last | ||
let caseName = String(describing: self) | ||
|
||
if enumName == nil { | ||
return .gray | ||
} | ||
|
||
return Color("\(enumName!)/\(caseName)", bundle: .module) | ||
} | ||
} | ||
|
||
extension QvickColor.CanSementic { | ||
public var color: Color { | ||
get { | ||
self.pallete.color | ||
} | ||
} | ||
} |
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,6 @@ | ||
import SwiftUI | ||
|
||
public struct QvickColor { | ||
public enum Pallete {} | ||
public enum Semantic {} | ||
} |
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,8 @@ | ||
import SwiftUI | ||
|
||
@available(iOS 13.0, *) | ||
public extension Image { | ||
init(qvick: QvickImage) { | ||
self = qvick.image | ||
} | ||
} |
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,16 @@ | ||
import SwiftUI | ||
|
||
public enum QvickImage: String { | ||
case Logo | ||
case LogoWithText | ||
case LogoSmall | ||
} | ||
|
||
@available(iOS 13.0, *) | ||
extension QvickImage { | ||
public var image: Image { | ||
get { | ||
return Image(self.rawValue, bundle: .module) | ||
} | ||
} | ||
} |
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,8 @@ | ||
import SwiftUI | ||
|
||
@available(iOS 13.0, *) | ||
extension Font { | ||
public static func pretendard( _ weight: QvickFont.Pretendard = .regular, size: CGFloat ) -> Font { | ||
return weight.font(size: size) | ||
} | ||
} |
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,40 @@ | ||
import SwiftUI | ||
|
||
extension QvickFont.Pretendard: QvickFont.CanDefine { | ||
|
||
public static func register() { | ||
QvickFont.Pretendard.allCases.forEach { | ||
guard let fontURL = Bundle.module.url( | ||
forResource: "Pretendard-\($0.name)", | ||
withExtension: "ttf" | ||
), | ||
let fontDataProvider = CGDataProvider(url: fontURL as CFURL), | ||
let font = CGFont(fontDataProvider) else { return } | ||
var error: Unmanaged<CFError>? | ||
CTFontManagerRegisterGraphicsFont(font, &error) | ||
} | ||
} | ||
|
||
public var name: String { | ||
switch self { | ||
case .thin: | ||
"Pretendard-Thin" | ||
case .extralight: | ||
"Pretendard-ExtraLight" | ||
case .light: | ||
"Pretendard-Light" | ||
case .regular: | ||
"Pretendard-Regular" | ||
case .medium: | ||
"Pretendard-Medium" | ||
case .semibold: | ||
"Pretendard-SemiBold" | ||
case .bold: | ||
"Pretendard-Bold" | ||
case .extrabold: | ||
"Pretendard-ExtraBold" | ||
case .black: | ||
"Pretendard-Black" | ||
} | ||
} | ||
} |
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,19 @@ | ||
import SwiftUI | ||
|
||
extension QvickFont { | ||
public protocol CanDefine { | ||
var name: String { get } | ||
|
||
static func register() | ||
} | ||
} | ||
|
||
|
||
|
||
|
||
@available(iOS 13.0, *) | ||
extension QvickFont.CanDefine { | ||
public func font( size: CGFloat ) -> Font { | ||
return Font.custom(self.name, size: size) | ||
} | ||
} |
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,7 @@ | ||
import SwiftUI | ||
|
||
public struct QvickFont { | ||
public enum Pretendard: CaseIterable { | ||
case black, extrabold, bold, semibold, medium, regular, light, extralight, thin | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
6 changes: 6 additions & 0 deletions
6
Sources/QDS/Resources/Color/Pallete.xcassets/Blue/Contents.json
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,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Oops, something went wrong.