Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Team-B1ND/dds-ios
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.2.15
Choose a base ref
...
head repository: Team-B1ND/dds-ios
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 19 commits
  • 38 files changed
  • 2 contributors

Commits on Jul 28, 2024

  1. Copy the full SHA
    c2434a9 View commit details

Commits on Aug 16, 2024

  1. Copy the full SHA
    0611b0f View commit details

Commits on Sep 20, 2024

  1. Copy the full SHA
    a9e9fc7 View commit details
  2. Copy the full SHA
    7f869c3 View commit details
  3. fix: Avatar initializer

    hhhello0507 committed Sep 20, 2024
    Copy the full SHA
    2a44107 View commit details
  4. Copy the full SHA
    d605e28 View commit details

Commits on Sep 29, 2024

  1. feat: Add FilledTextField

    hhhello0507 committed Sep 29, 2024
    Copy the full SHA
    44b3ff4 View commit details
  2. chore: Improve Color api

    hhhello0507 committed Sep 29, 2024
    Copy the full SHA
    8c340c8 View commit details

Commits on Nov 18, 2024

  1. Copy the full SHA
    e777af4 View commit details

Commits on Nov 20, 2024

  1. Copy the full SHA
    e643685 View commit details

Commits on Dec 6, 2024

  1. Copy the full SHA
    a921c8f View commit details
  2. fix: Modal ux

    hhhello0507 committed Dec 6, 2024
    Copy the full SHA
    3e23393 View commit details
  3. Copy the full SHA
    d9962ba View commit details

Commits on Dec 12, 2024

  1. Copy the full SHA
    fd07c77 View commit details

Commits on Feb 4, 2025

  1. assets: Add SmilingFace

    leeyoonchae committed Feb 4, 2025
    Copy the full SHA
    06c16ad View commit details
  2. assets: Add Handshake

    hhhello0507 committed Feb 4, 2025
    Copy the full SHA
    630540c View commit details

Commits on Feb 5, 2025

  1. Copy the full SHA
    29371c4 View commit details

Commits on Feb 6, 2025

  1. assets: Add CheckCircle

    leeyoonchae committed Feb 6, 2025
    Copy the full SHA
    accac64 View commit details
  2. Copy the full SHA
    a176946 View commit details
Showing with 1,147 additions and 262 deletions.
  1. +67 −0 .swiftpm/xcode/xcshareddata/xcschemes/DDS.xcscheme
  2. +16 −0 Package.resolved
  3. +4 −1 Package.swift
  4. +92 −0 Source/DDS/Component/Avatar/Avatar.swift
  5. +3 −4 Source/DDS/Component/Modal/BaseModal.swift
  6. +11 −55 Source/DDS/Component/Modal/TimePicker/TimePickerPresenter.swift
  7. +3 −6 Source/DDS/Component/Modal/TimePicker/TimePickerProvider.swift
  8. +31 −24 Source/DDS/Component/PageView/PageView.swift
  9. +4 −2 Source/DDS/Component/ScrollView/ScrollView.swift
  10. +0 −88 Source/DDS/Component/ScrollView/SnapScrollView.swift
  11. +27 −0 Source/DDS/Component/TextField/Extension/View+advancedFocus.swift
  12. +261 −0 Source/DDS/Component/TextField/FilledTextField.swift
  13. +104 −0 Source/DDS/Component/TextField/Internal/BaseTextField.swift
  14. +56 −0 Source/DDS/Component/TextField/Internal/TextFieldIcon.swift
  15. +195 −68 Source/DDS/Component/TextField/TextField.swift
  16. +35 −0 Source/DDS/Component/TextField/TextFieldColors.swift
  17. +13 −0 Source/DDS/Component/TextField/TextFieldRole.swift
  18. +9 −3 Source/DDS/Foundation/Color/Color.swift
  19. +6 −6 Source/DDS/Foundation/Color/Extension/Color+ViewExt.swift
  20. +3 −3 Source/DDS/Foundation/Color/{Pallete.swift → Palette.swift}
  21. +8 −1 Source/DDS/Foundation/Iconography/Iconography.swift
  22. +3 −0 Source/DDS/Foundation/Iconography/Iconography.xcassets/CheckCircle.imageset/CheckCircle.svg
  23. +21 −0 Source/DDS/Foundation/Iconography/Iconography.xcassets/CheckCircle.imageset/Contents.json
  24. +3 −0 Source/DDS/Foundation/Iconography/Iconography.xcassets/Close.imageset/Close.svg
  25. +21 −0 Source/DDS/Foundation/Iconography/Iconography.xcassets/Close.imageset/Contents.json
  26. +15 −0 Source/DDS/Foundation/Iconography/Iconography.xcassets/Handshake.imageset/Contents.json
  27. +15 −0 Source/DDS/Foundation/Iconography/Iconography.xcassets/Handshake.imageset/Handshake.svg
  28. +21 −0 Source/DDS/Foundation/Iconography/Iconography.xcassets/MagnifyingGlass.imageset/Contents.json
  29. +3 −0 Source/DDS/Foundation/Iconography/Iconography.xcassets/MagnifyingGlass.imageset/magnifyingglass.svg
  30. +21 −0 Source/DDS/Foundation/Iconography/Iconography.xcassets/NoneCheckCircle.imageset/Contents.json
  31. +4 −0 Source/DDS/Foundation/Iconography/Iconography.xcassets/NoneCheckCircle.imageset/NoneCheckCircle.svg
  32. +21 −0 Source/DDS/Foundation/Iconography/Iconography.xcassets/Pen.imageset/Contents.json
  33. +3 −0 Source/DDS/Foundation/Iconography/Iconography.xcassets/Pen.imageset/Pen.svg
  34. +21 −0 Source/DDS/Foundation/Iconography/Iconography.xcassets/Person.imageset/Contents.json
  35. +3 −0 Source/DDS/Foundation/Iconography/Iconography.xcassets/Person.imageset/Person.svg
  36. +15 −0 Source/DDS/Foundation/Iconography/Iconography.xcassets/SmilingFace.imageset/Contents.json
  37. +8 −0 Source/DDS/Foundation/Iconography/Iconography.xcassets/SmilingFace.imageset/SmilingFace.svg
  38. +1 −1 Source/DDS/Foundation/Typography/Extension/ViewExt.swift
67 changes: 67 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/DDS.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1600"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DDS"
BuildableName = "DDS"
BlueprintName = "DDS"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DDS"
BuildableName = "DDS"
BlueprintName = "DDS"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
16 changes: 16 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"object": {
"pins": [
{
"package": "swiftui-cached-async-image",
"repositoryURL": "https://github.com/lorenzofiamingo/swiftui-cached-async-image",
"state": {
"branch": null,
"revision": "467a3d17479887943ab917a379e62bbaff60ac8a",
"version": "2.1.1"
}
}
]
},
"version": 1
}
5 changes: 4 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -13,11 +13,14 @@ let package = Package(
),
],
dependencies: [
.package(url: "https://github.com/lorenzofiamingo/swiftui-cached-async-image", from: "2.1.1")
],
targets: [
.target(
name: "DDS",
dependencies: [],
dependencies: [
.product(name: "CachedAsyncImage", package: "swiftui-cached-async-image")
],
resources: [
.process("Foundation/Typography/Font"),
.process("Foundation/Iconography/Iconography.xcassets")
92 changes: 92 additions & 0 deletions Source/DDS/Component/Avatar/Avatar.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
//
// File.swift
//
//
// Created by hhhello0507 on 9/20/24.
//

import Foundation
import SwiftUI
import CachedAsyncImage

public struct DodamAvatar: View {

public enum Size: CGFloat, CaseIterable {
case extraSmall = 16
case small = 24
case medium = 32
case large = 36
case extraLarge = 64
case xxl = 128

var innerSize: CGFloat {
rawValue * 5 / 8
}
}

private let url: String?
private let size: Size

init(url: String?, size: Size) {
self.url = url
self.size = size
}

public static func extraSmall(url: String?) -> DodamAvatar {
.init(url: url, size: .extraSmall)
}

public static func small(url: String?) -> DodamAvatar {
.init(url: url, size: .small)
}

public static func medium(url: String?) -> DodamAvatar {
.init(url: url, size: .medium)
}

public static func large(url: String?) -> DodamAvatar {
.init(url: url, size: .large)
}

public static func extraLarge(url: String?) -> DodamAvatar {
.init(url: url, size: .extraLarge)
}

public static func xxl(url: String?) -> DodamAvatar {
.init(url: url, size: .xxl)
}

public var body: some View {
Group {
if let url {
CachedAsyncImage(url: URL(string: url)) { image in
image
.resizable()
.aspectRatio(contentMode: .fill)
} placeholder: {
Rectangle()
.shimmer()
}
} else {
Image(icon: .person)
.resizable()
.renderingMode(.template)
.foreground(DodamColor.Fill.alternative)
.frame(width: size.innerSize, height: size.innerSize)
}
}
.frame(width: size.rawValue, height: size.rawValue)
.background(DodamColor.Fill.normal)
.clipShape(Circle())
}
}

#Preview {
VStack {
ForEach(DodamAvatar.Size.allCases, id: \.self) {
DodamAvatar(url: "https://gratisography.com/wp-content/uploads/2024/01/gratisography-cyber-kitty-800x525.jpg", size: $0)
DodamAvatar(url: nil, size: $0)
}
}
.registerPretendard()
}
7 changes: 3 additions & 4 deletions Source/DDS/Component/Modal/BaseModal.swift
Original file line number Diff line number Diff line change
@@ -2,14 +2,12 @@ import Foundation
import SwiftUI

struct BaseModal<MC: View, C: View>: View {

@Namespace var animation
@State private var scaleEffect: CGFloat = 1.2
@Binding var isPresent: Bool
@State var opacity: Double = 0.0
let backgroundColor: DodamColorable = DodamColor.Background.normal
let cornerRadius: CGFloat = 16
// let shadow: SeugiShadowSystem = .evBlack(.ev1)
@ViewBuilder let content: () -> C
@ViewBuilder let modalContent: () -> MC

@@ -19,21 +17,22 @@ struct BaseModal<MC: View, C: View>: View {
Color.black
.opacity(0.2 * opacity)
.ignoresSafeArea()
.onTapGesture {
self.isPresent = false
}
// MARK: - Modal Content
VStack {
Spacer()
if isPresent {
modalContent()
.background(backgroundColor)
.cornerRadius(cornerRadius)
// .shadow(shadow)
.scaleEffect(scaleEffect)
.opacity(opacity)
} else {
modalContent()
.background(backgroundColor)
.cornerRadius(cornerRadius)
// .shadow(shadow)
.opacity(opacity)
}
Spacer()
66 changes: 11 additions & 55 deletions Source/DDS/Component/Modal/TimePicker/TimePickerPresenter.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import SwiftUI
import UIKit

public struct DodamTimePickerPresenter<C: View>: ModalViewProtocol {

private let hours = Array(0..<24)
private let minutes = Array(0..<60)

@StateObject private var provider: TimePickerProvider
@State private var size: CGSize = .zero
let content: () -> C

init(
@@ -32,53 +28,12 @@ public struct DodamTimePickerPresenter<C: View>: ModalViewProtocol {
.heading2(.bold)
.foreground(DodamColor.Label.strong)
.frame(maxWidth: .infinity, alignment: .leading)
HStack(spacing: 0) {
SnapScrollView(
Array(hours.enumerated()),
selection: $provider.hour,
spacing: 12,
showItemCount: 5
) { idx, item in
let selected = idx == provider.hour
Text("\(item)")
.title3(.medium)
.foreground(
selected
? DodamColor.Label.normal
: DodamColor.Label.alternative
)
.opacity(selected ? 1 : 0.5)
.padding(.horizontal, 20)
}
Text(":")
.heading1(.bold)
.foreground(DodamColor.Label.normal)
SnapScrollView(
Array(minutes.enumerated()),
selection: $provider.minute,
spacing: 12,
showItemCount: 5
) { idx, item in
let selected = idx == provider.minute
Text("\(item)")
.title3(.medium)
.foreground(
selected
? DodamColor.Label.normal
: DodamColor.Label.alternative
)
.opacity(selected ? 1 : 0.5)
.padding(.horizontal, 20)
}
}
SwiftUI.DatePicker("", selection: $provider.date, displayedComponents: .hourAndMinute)
.datePickerStyle(.wheel)
.labelsHidden()
.padding()
.frame(maxWidth: .infinity)
.background {
Rectangle()
.dodamFill(DodamColor.Fill.alternative)
.opacity(0.5)
.frame(height: 44)
.clipShape(.small)
}
.frame(height: 200)
HStack {
Spacer()
DodamTextButton.large(title: "선택", color: DodamColor.Primary.normal) {
@@ -97,17 +52,18 @@ public struct DodamTimePickerPresenter<C: View>: ModalViewProtocol {

private struct TimePickerPreview: View {
@StateObject private var provider = TimePickerProvider()
@State var hour = 0
@State var minute = 0
@State var date = Date.now
var body: some View {
DodamTimePickerPresenter(provider: provider) {
VStack {
Button("Show") {
provider.present(.init(title: "외출 일시") {
print("Hello")
date = provider.date
})
}
Text("\(hour)")
Text("\(Calendar.current.dateComponents([.hour], from: date).hour!)")
.foreground(DodamColor.Label.normal)
Text("\(Calendar.current.dateComponents([.minute], from: date).minute!)")
.foreground(DodamColor.Label.normal)
}
}
Original file line number Diff line number Diff line change
@@ -11,22 +11,19 @@ import SwiftUI
public final class TimePickerProvider: ModalProvider {
@Published var isPresent: Bool = false

@Published public var hour: Int = 0
@Published public var minute: Int = 0
@Published public var date: Date = .now

@Published var timePicker: TimePicker?

public init() {}

public func present(
_ timePicker: TimePicker,
hour: Int = 0,
minute: Int = 0
date: Date = .now
) {
self.isPresent = true

self.hour = hour
self.minute = minute
self.date = date

self.timePicker = timePicker
}
Loading