diff --git a/Projects/App/Sources/Application/NeedleGenerated.swift b/Projects/App/Sources/Application/NeedleGenerated.swift index fbd7137a..89f1037a 100644 --- a/Projects/App/Sources/Application/NeedleGenerated.swift +++ b/Projects/App/Sources/Application/NeedleGenerated.swift @@ -604,7 +604,7 @@ private func registerProviderFactory(_ componentPath: String, _ factory: @escapi #if !NEEDLE_DYNAMIC -private func register1() { +@inline(never) private func register1() { registerProviderFactory("^->AppComponent", factoryEmptyDependencyProvider) registerProviderFactory("^->AppComponent->SchoolConfirmationQuestionsComponent", factoryd462667f0418a53210fcf47b58f8f304c97af4d5) registerProviderFactory("^->AppComponent->SchoolCodeComponent", factoryb65c1efbf06b87162473f47b58f8f304c97af4d5) diff --git a/Projects/Features/FindIDFeature/Sources/Component/SchoolSelectButtonView.swift b/Projects/Features/FindIDFeature/Sources/Component/SchoolSelectButtonView.swift index 4427942b..2f1d5b37 100644 --- a/Projects/Features/FindIDFeature/Sources/Component/SchoolSelectButtonView.swift +++ b/Projects/Features/FindIDFeature/Sources/Component/SchoolSelectButtonView.swift @@ -24,7 +24,7 @@ struct SchoolSelectButtonView: View { VStack(alignment: .leading, spacing: 10) { HStack(alignment: .bottom) { Text(placeholderText) - .dmsFont(.text(.medium), color: textColor) + .dmsFont(.body(.body1), color: textColor) Spacer() diff --git a/Projects/Features/FindIDFeature/Sources/FindIDView.swift b/Projects/Features/FindIDFeature/Sources/FindIDView.swift index 45a59067..6ec54d1f 100644 --- a/Projects/Features/FindIDFeature/Sources/FindIDView.swift +++ b/Projects/Features/FindIDFeature/Sources/FindIDView.swift @@ -19,7 +19,7 @@ struct FindIDView: View { var body: some View { VStack { - AuthHeaderView(subTitle: "아이디 찾기") + DMSHeaderTitleView(subTitle: "아이디 찾기") .padding(.top, 24) VStack(spacing: 60) { diff --git a/Projects/Features/HomeFeature/Sources/Component/CalendarSheetView.swift b/Projects/Features/HomeFeature/Sources/Component/CalendarSheetView.swift index c5788182..4b004b38 100644 --- a/Projects/Features/HomeFeature/Sources/Component/CalendarSheetView.swift +++ b/Projects/Features/HomeFeature/Sources/Component/CalendarSheetView.swift @@ -15,7 +15,7 @@ struct CalendarSheetView: View { VStack { HStack { Text(selectedDateString) - .dmsFont(.text(.extraLarge), color: .GrayScale.gray6) + .dmsFont(.title(.title2), color: .GrayScale.gray6) Spacer() } @@ -27,7 +27,7 @@ struct CalendarSheetView: View { if model.day != -1 { Text("\(model.day)") .dmsFont( - .text(.large), + .body(.body1), color: model.date.isSameDay(selectedDate) ? .GrayScale.gray1 : .GrayScale.gray6 ) .padding(8) diff --git a/Projects/Features/HomeFeature/Sources/Component/MealCarouselView.swift b/Projects/Features/HomeFeature/Sources/Component/MealCarouselView.swift index 2e722f04..f693e0a8 100644 --- a/Projects/Features/HomeFeature/Sources/Component/MealCarouselView.swift +++ b/Projects/Features/HomeFeature/Sources/Component/MealCarouselView.swift @@ -53,13 +53,13 @@ struct MealCarouselView: View { VStack { if meal.isEmpty { Text("급식이 없습니다.") - .dmsFont(.text(.large), color: .GrayScale.gray6) + .dmsFont(.body(.body1), color: .GrayScale.gray6) .frame(maxHeight: .infinity) } else { ForEach(meal.indices, id: \.self) { index in if index != meal.count - 1 { Text(meal[index]) - .dmsFont(.text(.medium), color: .GrayScale.gray6) + .dmsFont(.body(.body1), color: .GrayScale.gray6) .frame(maxHeight: .infinity) } } @@ -69,7 +69,7 @@ struct MealCarouselView: View { .frame(maxHeight: .infinity) Text(meal.last?.hasSuffix("Kcal") ?? false ? meal.last ?? "0Kcal" : "0Kcal") - .dmsFont(.text(.medium), color: .GrayScale.gray5) + .dmsFont(.body(.body2), color: .GrayScale.gray5) .padding(.bottom, 16) } .redacted(reason: isLoading ? .placeholder : []) diff --git a/Projects/Features/HomeFeature/Sources/Component/NoticeView.swift b/Projects/Features/HomeFeature/Sources/Component/NoticeView.swift index 97b85936..32f5a360 100644 --- a/Projects/Features/HomeFeature/Sources/Component/NoticeView.swift +++ b/Projects/Features/HomeFeature/Sources/Component/NoticeView.swift @@ -10,7 +10,7 @@ struct NoticeView: View { .padding(.vertical, 12) Text("새로운 공지가 있습니다.") - .dmsFont(.text(.small), color: .GrayScale.gray6) + .dmsFont(.body(.body3), color: .GrayScale.gray6) Spacer() diff --git a/Projects/Features/HomeFeature/Sources/HomeView.swift b/Projects/Features/HomeFeature/Sources/HomeView.swift index 130ae4fc..4e333c89 100644 --- a/Projects/Features/HomeFeature/Sources/HomeView.swift +++ b/Projects/Features/HomeFeature/Sources/HomeView.swift @@ -40,7 +40,7 @@ struct HomeView: View { } Text("오늘의 급식") - .dmsFont(.title(.small), color: .GrayScale.gray7) + .dmsFont(.title(.title1), color: .GrayScale.gray7) .padding(.top, 16) selectDateView() @@ -65,7 +65,7 @@ struct HomeView: View { .toolbar { ToolbarItem(placement: .navigationBarLeading) { Text("로고") - .dmsFont(.title(.small), color: .GrayScale.gray7) + .dmsFont(.title(.title1), color: .GrayScale.gray7) } } .dmsBackground() @@ -97,7 +97,7 @@ struct HomeView: View { } icon: { Image(systemName: "calendar") } - .dmsFont(.button(.default), color: .GrayScale.gray6) + .dmsFont(.etc(.button), color: .GrayScale.gray6) .padding(.vertical, 8.5) .padding(.horizontal, 12) .overlay { diff --git a/Projects/Features/MyPageFeature/Sources/ChangeProfile/ChangeProfileView.swift b/Projects/Features/MyPageFeature/Sources/ChangeProfile/ChangeProfileView.swift index 330760f0..817ad2c7 100644 --- a/Projects/Features/MyPageFeature/Sources/ChangeProfile/ChangeProfileView.swift +++ b/Projects/Features/MyPageFeature/Sources/ChangeProfile/ChangeProfileView.swift @@ -17,7 +17,7 @@ struct ChangeProfileView: View { var body: some View { VStack { - DMSHeaderView(subTitle: "프로필 사진") + DMSHeaderTitleView(subTitle: "프로필 사진") .padding(.top, 24) Button { diff --git a/Projects/Features/MyPageFeature/Sources/MyPageView.swift b/Projects/Features/MyPageFeature/Sources/MyPageView.swift index 04dc1c9e..12a481b8 100644 --- a/Projects/Features/MyPageFeature/Sources/MyPageView.swift +++ b/Projects/Features/MyPageFeature/Sources/MyPageView.swift @@ -20,10 +20,10 @@ struct MyPageView: View { HStack { VStack(alignment: .leading, spacing: 8) { Text("\(viewModel.profile?.gcn ?? "") \(viewModel.profile?.name ?? "Loading...")") - .dmsFont(.title(.small), color: .GrayScale.gray7) + .dmsFont(.title(.title1), color: .GrayScale.gray7) Text(viewModel.profile?.schoolName ?? "") - .dmsFont(.text(.small), color: .GrayScale.gray6) + .dmsFont(.body(.body3), color: .GrayScale.gray6) } Spacer() @@ -55,7 +55,7 @@ struct MyPageView: View { .padding(.top, 48) Text(viewModel.profile?.phrase ?? "") - .dmsFont(.text(.small), color: .GrayScale.gray7) + .dmsFont(.body(.body3), color: .GrayScale.gray7) .multilineTextAlignment(.leading) .frame(maxWidth: .infinity) .padding(.vertical, 14) @@ -74,14 +74,14 @@ struct MyPageView: View { VStack(alignment: .leading, spacing: 0) { myPageOptionRowCardView(title: "상벌점 내역 확인") - .dmsFont(.text(.medium), color: .GrayScale.gray6) + .dmsFont(.body(.body2), color: .GrayScale.gray6) .cornerRadius(10, corners: [.topLeft, .topRight]) Divider() .padding(.horizontal, 10) myPageOptionRowCardView(title: "비밀번호 변경") - .dmsFont(.text(.medium), color: .GrayScale.gray6) + .dmsFont(.body(.body2), color: .GrayScale.gray6) .cornerRadius(10, corners: [.bottomLeft, .bottomRight]) } .background { @@ -92,7 +92,7 @@ struct MyPageView: View { VStack(alignment: .leading, spacing: 0) { myPageOptionRowCardView(title: "로그아웃", action: viewModel.logoutButtonDidTap) - .dmsFont(.text(.medium), color: .System.error) + .dmsFont(.body(.body2), color: .System.error) .onTapGesture(perform: viewModel.logoutButtonDidTap) .cornerRadius(10) } @@ -113,10 +113,10 @@ struct MyPageView: View { .onAppear(perform: viewModel.onAppear) .alert("", isPresented: $viewModel.isPresentedLogoutAlert) { Button("취소", role: .cancel) {} - Button("로그아웃", role: .destructive, action: viewModel.confirmLogoutButtonDidTap) + Button("확인", role: .destructive, action: viewModel.confirmLogoutButtonDidTap) } message: { Text("정말 로그아웃 하시겠습니까?") - .dmsFont(.text(.medium), color: .GrayScale.gray6) + .dmsFont(.body(.body2), color: .GrayScale.gray6) } .navigate( to: changeProfileComponent.makeView(), @@ -146,7 +146,7 @@ struct MyPageView: View { VStack { HStack { Text(title) - .dmsFont(.text(.small), color: .GrayScale.gray6) + .dmsFont(.body(.body3), color: .GrayScale.gray6) Spacer() } @@ -156,7 +156,7 @@ struct MyPageView: View { Spacer() Text("\(point)") - .dmsFont(.title(.large), color: .GrayScale.gray6) + .dmsFont(.headline(.headline2), color: .GrayScale.gray6) } .padding(.bottom, 16) } diff --git a/Projects/Features/MyPageFeature/Sources/RewardPointDetail/RewardPointDetailView.swift b/Projects/Features/MyPageFeature/Sources/RewardPointDetail/RewardPointDetailView.swift index 135ea717..9d16d6a1 100644 --- a/Projects/Features/MyPageFeature/Sources/RewardPointDetail/RewardPointDetailView.swift +++ b/Projects/Features/MyPageFeature/Sources/RewardPointDetail/RewardPointDetailView.swift @@ -31,7 +31,7 @@ struct RewardPointDetailView: View { .padding(.top, 16) Text("\(viewModel.point?.totalPoint ?? 0)" + " 점") - .dmsFont(.title(.large), color: .GrayScale.gray6) + .dmsFont(.headline(.headline2), color: .GrayScale.gray6) .padding(.top, 44) .padding(.horizontal, 24) .padding(.bottom, 44) @@ -65,16 +65,16 @@ struct RewardPointDetailView: View { HStack { VStack(alignment: .leading, spacing: 8) { Text(date) - .dmsFont(.text(.extraSmall), color: .System.title) + .dmsFont(.etc(.caption), color: .System.title) Text(name) - .dmsFont(.text(.medium), color: .System.text) + .dmsFont(.body(.body2), color: .System.text) } HStack { Spacer() Text(score) - .dmsFont(.text(.medium), color: score.contains("-") ? .System.error : .PrimaryVariant.darken2) + .dmsFont(.body(.body2), color: score.contains("-") ? .System.error : .PrimaryVariant.darken2) } Spacer() diff --git a/Projects/Features/NoticeFeature/Sources/Detail/NoticeDetailView.swift b/Projects/Features/NoticeFeature/Sources/Detail/NoticeDetailView.swift index 0aeda9b7..d9eed89d 100644 --- a/Projects/Features/NoticeFeature/Sources/Detail/NoticeDetailView.swift +++ b/Projects/Features/NoticeFeature/Sources/Detail/NoticeDetailView.swift @@ -8,31 +8,31 @@ struct NoticeDetailView: View { var body: some View { VStack { - VStack(alignment: .leading, spacing: 24) { + VStack(alignment: .leading, spacing: 0) { Text(viewModel.title) - .dmsFont(.title(.small), color: .GrayScale.gray7) + .dmsFont(.title(.title1), color: .GrayScale.gray7) .padding(.top, 40) + Text(viewModel.date.toDMSDateString()) + .dmsFont(.etc(.caption), color: .GrayScale.gray5) + .padding(.top, 10) + Divider() + .padding(.top, 20) } - VStack(alignment: .leading, spacing: 24) { - Text(viewModel.content) - .padding(.top, 24) - .padding(.bottom, 40) - - HStack { - Spacer() + .frame(maxWidth: .infinity) + .padding(.top, 40) - Text(viewModel.date.toDMSDateString()) - .dmsFont(.text(.extraSmall), color: .GrayScale.gray5) - .frame(alignment: .trailing) - } - } + Text(viewModel.content) + .dmsFont(.body(.body2), color: .GrayScale.gray6) + .padding(.top, 24) + .padding(.bottom, 40) Spacer() } .navigationTitle("공지") .navigationBarTitleDisplayMode(.inline) .padding(.horizontal, 24) + .dmsBackground() } } diff --git a/Projects/Features/NoticeFeature/Sources/NoticeList/NoticeListView.swift b/Projects/Features/NoticeFeature/Sources/NoticeList/NoticeListView.swift index 71d677b7..0fec11a9 100644 --- a/Projects/Features/NoticeFeature/Sources/NoticeList/NoticeListView.swift +++ b/Projects/Features/NoticeFeature/Sources/NoticeList/NoticeListView.swift @@ -36,7 +36,7 @@ struct NoticeListView: View { NavigationLink(destination: noticeDetailComponent.makeView(id: noticeList.id)) { noticeListCellView( title: noticeList.title, - content: noticeList.createdAt.toSmallDMSDateString() + date: noticeList.createdAt ) .padding(.top, 5) .listRowInsets(EdgeInsets()) @@ -44,7 +44,6 @@ struct NoticeListView: View { } } .padding(.horizontal, 24) - } } .navigationTitle("공지") @@ -54,7 +53,7 @@ struct NoticeListView: View { } @ViewBuilder - func noticeListCellView(title: String, content: String) -> some View { + func noticeListCellView(title: String, date: Date) -> some View { ZStack { Color.System.surface .cornerRadius(6) @@ -62,10 +61,10 @@ struct NoticeListView: View { HStack { VStack(alignment: .leading) { Text(title) - .dmsFont(.text(.medium), color: .System.title) + .dmsFont(.body(.body2), color: .System.title) - Text(content) - .dmsFont(.text(.extraSmall), color: .System.text) + Text(date.toSmallDMSDateString()) + .dmsFont(.etc(.caption), color: .System.text) } Spacer() } diff --git a/Projects/Features/NoticeFeature/Sources/NoticeList/NoticeOrderButton.swift b/Projects/Features/NoticeFeature/Sources/NoticeList/NoticeOrderButton.swift index 20b8e28c..007db75f 100644 --- a/Projects/Features/NoticeFeature/Sources/NoticeList/NoticeOrderButton.swift +++ b/Projects/Features/NoticeFeature/Sources/NoticeList/NoticeOrderButton.swift @@ -41,7 +41,7 @@ extension NoticeOrderButtonStyle { configuration.label .padding(.vertical, 8.5) .padding(.horizontal, 16) - .dmsFont(.button(.default)) + .dmsFont(.etc(.button)) .background(.clear) .foregroundColor(color) .overlay { diff --git a/Projects/Features/RenewalPasswordFeature/Sources/AuthenticationEmail/AuthenticationEmailView.swift b/Projects/Features/RenewalPasswordFeature/Sources/AuthenticationEmail/AuthenticationEmailView.swift index 8da73f3e..45e74337 100644 --- a/Projects/Features/RenewalPasswordFeature/Sources/AuthenticationEmail/AuthenticationEmailView.swift +++ b/Projects/Features/RenewalPasswordFeature/Sources/AuthenticationEmail/AuthenticationEmailView.swift @@ -16,19 +16,19 @@ struct AuthenticationEmailView: View { var body: some View { VStack { - AuthHeaderView(subTitle: "이메일 주소 입력") + DMSHeaderTitleView(subTitle: "이메일 주소 입력") .padding(.top, 24) VStack(spacing: 40) { DMSPassCodeView(codeCount: 6, text: $viewModel.authCode) Text(viewModel.isErrorOcuured ? viewModel.errorMessage : "이메일로 전송된 인증코드 6자리를 입력해주세요.") - .dmsFont(.text(.small), color: viewModel.isErrorOcuured ? .System.error : .GrayScale.gray5) + .dmsFont(.body(.body3), color: viewModel.isErrorOcuured ? .System.error : .GrayScale.gray5) } .padding(.top, 56) Text(viewModel.timeText) - .dmsFont(.text(.small), color: .PrimaryVariant.primary) + .dmsFont(.body(.body3), color: .PrimaryVariant.primary) .padding(.top, 10) Spacer() diff --git a/Projects/Features/RenewalPasswordFeature/Sources/ChangePassword/ChangePasswordView.swift b/Projects/Features/RenewalPasswordFeature/Sources/ChangePassword/ChangePasswordView.swift index 6e5c0b45..000db08f 100644 --- a/Projects/Features/RenewalPasswordFeature/Sources/ChangePassword/ChangePasswordView.swift +++ b/Projects/Features/RenewalPasswordFeature/Sources/ChangePassword/ChangePasswordView.swift @@ -18,12 +18,12 @@ struct ChangePasswordView: View { var body: some View { VStack(spacing: 4) { - AuthHeaderView(subTitle: "비밀번호 설정") + DMSHeaderTitleView(subTitle: "비밀번호 설정") .padding(.top, 24) HStack { Text("비밀번호는 영문, 숫자, 기호를 포함한 8~20자이어야 합니다.") - .dmsFont(.text(.extraSmall), color: .GrayScale.gray5) + .dmsFont(.etc(.caption), color: .GrayScale.gray5) Spacer() } diff --git a/Projects/Features/RenewalPasswordFeature/Sources/EnterInformation/Component/BlockEmailView.swift b/Projects/Features/RenewalPasswordFeature/Sources/EnterInformation/Component/BlockEmailView.swift index f6efa804..6952b6ae 100644 --- a/Projects/Features/RenewalPasswordFeature/Sources/EnterInformation/Component/BlockEmailView.swift +++ b/Projects/Features/RenewalPasswordFeature/Sources/EnterInformation/Component/BlockEmailView.swift @@ -18,11 +18,11 @@ struct BlockEmailView: View { HStack { VStack(alignment: .leading) { Text("아이디와 일치하는 이메일 입니다") - .dmsFont(.text(.small), color: .GrayScale.gray7) + .dmsFont(.body(.body3), color: .GrayScale.gray7) .multilineTextAlignment(.leading) Text(email) - .dmsFont(.text(.small), color: .PrimaryVariant.primary) + .dmsFont(.body(.body3), color: .PrimaryVariant.primary) .multilineTextAlignment(.leading) } Spacer() diff --git a/Projects/Features/RenewalPasswordFeature/Sources/EnterInformation/EnterInformationView.swift b/Projects/Features/RenewalPasswordFeature/Sources/EnterInformation/EnterInformationView.swift index cdc37ba5..bb812373 100644 --- a/Projects/Features/RenewalPasswordFeature/Sources/EnterInformation/EnterInformationView.swift +++ b/Projects/Features/RenewalPasswordFeature/Sources/EnterInformation/EnterInformationView.swift @@ -23,7 +23,7 @@ struct EnterInformationView: View { var body: some View { VStack { - AuthHeaderView(subTitle: "계정 본인인증") + DMSHeaderTitleView(subTitle: "계정 본인인증") .padding(.top, 24) VStack(spacing: 20) { diff --git a/Projects/Features/SigninFeature/Sources/SigninView.swift b/Projects/Features/SigninFeature/Sources/SigninView.swift index 80af08fe..dc5c3c4b 100644 --- a/Projects/Features/SigninFeature/Sources/SigninView.swift +++ b/Projects/Features/SigninFeature/Sources/SigninView.swift @@ -35,7 +35,7 @@ struct SigninView: View { var body: some View { NavigationView { VStack { - AuthHeaderView(subTitle: "더 편한 기숙사 생활을 위해") + DMSHeaderTitleView(subTitle: "더 편한 기숙사 생활을 위해") .padding(.top, 24) VStack(spacing: 72) { @@ -62,7 +62,7 @@ struct SigninView: View { DMSCheckBox(isOn: $viewModel.isOnAutoSignin) Text("자동로그인") - .dmsFont(.text(.small), color: .GrayScale.gray6) + .dmsFont(.body(.body3), color: .GrayScale.gray6) } .onTapGesture { withAnimation { @@ -78,7 +78,7 @@ struct SigninView: View { } } label: { Text("아이디 찾기") - .dmsFont(.text(.extraSmall), color: .GrayScale.gray5) + .dmsFont(.etc(.caption), color: .GrayScale.gray5) } Divider() @@ -91,7 +91,7 @@ struct SigninView: View { } } label: { Text("비밀번호 재설정") - .dmsFont(.text(.extraSmall), color: .GrayScale.gray5) + .dmsFont(.etc(.caption), color: .GrayScale.gray5) } } .padding(.top, 16) @@ -100,7 +100,7 @@ struct SigninView: View { HStack(spacing: 16) { Text("아직 회원이 아니신가요?") - .dmsFont(.text(.extraSmall), color: .GrayScale.gray5) + .dmsFont(.etc(.caption), color: .GrayScale.gray5) DMSButton(text: "회원가입", style: .text, color: .GrayScale.gray6) { isNavigateSignup.toggle() diff --git a/Projects/Features/SignupFeature/Sources/IDSetting/IDSettingView.swift b/Projects/Features/SignupFeature/Sources/IDSetting/IDSettingView.swift index 97f8de74..b9121d81 100644 --- a/Projects/Features/SignupFeature/Sources/IDSetting/IDSettingView.swift +++ b/Projects/Features/SignupFeature/Sources/IDSetting/IDSettingView.swift @@ -24,12 +24,12 @@ struct IDSettingView: View { var body: some View { VStack(spacing: 4) { - AuthHeaderView(subTitle: "아이디 설정") + DMSHeaderTitleView(subTitle: "아이디 설정") .padding(.top, 24) HStack { Text("학년, 반, 번호는 숫자만 입력하여 주세요.") - .dmsFont(.text(.extraSmall), color: .GrayScale.gray5) + .dmsFont(.etc(.caption), color: .GrayScale.gray5) Spacer() } @@ -63,7 +63,7 @@ struct IDSettingView: View { if viewModel.isShowingCheckStudent && !viewModel.isCheckedStudent { HStack { Text("\(viewModel.checkedName)님이 맞으신가요?") - .dmsFont(.text(.small), color: .GrayScale.gray7) + .dmsFont(.body(.body3), color: .GrayScale.gray7) .padding(.leading, 20) Spacer() diff --git a/Projects/Features/SignupFeature/Sources/SchoolCode/SchoolCodeView.swift b/Projects/Features/SignupFeature/Sources/SchoolCode/SchoolCodeView.swift index 7ae9a3e8..05a06ca8 100644 --- a/Projects/Features/SignupFeature/Sources/SchoolCode/SchoolCodeView.swift +++ b/Projects/Features/SignupFeature/Sources/SchoolCode/SchoolCodeView.swift @@ -16,14 +16,14 @@ struct SchoolCodeView: View { var body: some View { VStack { - AuthHeaderView(subTitle: "학교 인증코드 입력") + DMSHeaderTitleView(subTitle: "학교 인증코드 입력") .padding(.top, 24) VStack(spacing: 24) { DMSPassCodeView(codeCount: 8, text: $viewModel.schoolCode) Text(viewModel.isErrorOcuured ? viewModel.errorMessage : "이메일로 전송된 인증코드 8자리를 입력해주세요.") - .dmsFont(.text(.small), color: viewModel.isErrorOcuured ? .System.error : .GrayScale.gray5) + .dmsFont(.body(.body3), color: viewModel.isErrorOcuured ? .System.error : .GrayScale.gray5) } .padding(.top, 56) diff --git a/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsParam.swift b/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsParam.swift index 8f143bc1..56213795 100644 --- a/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsParam.swift +++ b/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsParam.swift @@ -3,4 +3,9 @@ import Foundation public struct SchoolConfirmationQuestionsParam: Equatable { public let schoolCode: String public let schoolID: String + + public init(schoolCode: String, schoolID: String) { + self.schoolCode = schoolCode + self.schoolID = schoolID + } } diff --git a/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsView.swift b/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsView.swift index 0c29f1c6..35fccd95 100644 --- a/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsView.swift +++ b/Projects/Features/SignupFeature/Sources/SchoolConfirmationQuestions/SchoolConfirmationQuestionsView.swift @@ -21,12 +21,12 @@ struct SchoolConfirmationQuestionsView: View { var body: some View { VStack { - AuthHeaderView(subTitle: "학교 확인 질문") + DMSHeaderTitleView(subTitle: "학교 확인 질문") .padding(.top, 24) HStack { Text(viewModel.question) - .dmsFont(.text(.large), color: .GrayScale.gray7) + .dmsFont(.body(.body2), color: .GrayScale.gray7) Spacer() } @@ -49,7 +49,7 @@ struct SchoolConfirmationQuestionsView: View { HStack(spacing: 16) { Text("이미 계정이 있으신가요?") - .dmsFont(.text(.small), color: .GrayScale.gray5) + .dmsFont(.body(.body3), color: .GrayScale.gray5) DMSButton(text: "로그인", style: .text, color: .GrayScale.gray6) { rootPresentationMode.wrappedValue.toggle() diff --git a/Projects/Features/SignupFeature/Sources/SignupEmailAuthCodeVerify/EmailAuthCodeVerifyView.swift b/Projects/Features/SignupFeature/Sources/SignupEmailAuthCodeVerify/EmailAuthCodeVerifyView.swift index a42b0b0e..d764e84e 100644 --- a/Projects/Features/SignupFeature/Sources/SignupEmailAuthCodeVerify/EmailAuthCodeVerifyView.swift +++ b/Projects/Features/SignupFeature/Sources/SignupEmailAuthCodeVerify/EmailAuthCodeVerifyView.swift @@ -17,19 +17,19 @@ struct SignupEmailAuthCodeVerifyView: View { var body: some View { VStack { - AuthHeaderView(subTitle: "이메일 주소 입력") + DMSHeaderTitleView(subTitle: "이메일 주소 입력") .padding(.top, 24) VStack(spacing: 40) { DMSPassCodeView(codeCount: 6, text: $viewModel.authCode) Text(viewModel.isErrorOcuured ? viewModel.errorMessage : "이메일로 전송된 인증코드 6자리를 입력해주세요.") - .dmsFont(.text(.small), color: viewModel.isErrorOcuured ? .System.error : .GrayScale.gray5) + .dmsFont(.body(.body3), color: viewModel.isErrorOcuured ? .System.error : .GrayScale.gray5) } .padding(.top, 60) Text(viewModel.timeText) - .dmsFont(.text(.small), color: .PrimaryVariant.primary) + .dmsFont(.body(.body3), color: .PrimaryVariant.primary) .padding(.top, 10) Spacer() diff --git a/Projects/Features/SignupFeature/Sources/SignupEmailVerify/SignupEmailVerifyView.swift b/Projects/Features/SignupFeature/Sources/SignupEmailVerify/SignupEmailVerifyView.swift index 315d0a67..588a23a0 100644 --- a/Projects/Features/SignupFeature/Sources/SignupEmailVerify/SignupEmailVerifyView.swift +++ b/Projects/Features/SignupFeature/Sources/SignupEmailVerify/SignupEmailVerifyView.swift @@ -21,7 +21,7 @@ struct SignupEmailVerifyView: View { var body: some View { VStack { - AuthHeaderView(subTitle: "이메일 주소 입력") + DMSHeaderTitleView(subTitle: "이메일 주소 입력") .padding(.top, 24) DMSFloatingTextField( @@ -39,7 +39,7 @@ struct SignupEmailVerifyView: View { HStack(spacing: 6) { Text("이미 계정이 있으신가요?") - .dmsFont(.text(.small), color: .GrayScale.gray5) + .dmsFont(.body(.body3), color: .GrayScale.gray5) DMSButton(text: "로그인", style: .text, color: .GrayScale.gray6) { rootPresentationMode.wrappedValue.toggle() diff --git a/Projects/Features/SignupFeature/Sources/SignupPassword/SignupPasswordView.swift b/Projects/Features/SignupFeature/Sources/SignupPassword/SignupPasswordView.swift index 32ab309c..cfb1f066 100644 --- a/Projects/Features/SignupFeature/Sources/SignupPassword/SignupPasswordView.swift +++ b/Projects/Features/SignupFeature/Sources/SignupPassword/SignupPasswordView.swift @@ -21,12 +21,12 @@ struct SignupPasswordView: View { var body: some View { VStack(spacing: 4) { - AuthHeaderView(subTitle: "비밀번호 설정") + DMSHeaderTitleView(subTitle: "비밀번호 설정") .padding(.top, 24) HStack { Text("비밀번호는 영문, 숫자, 기호를 포함한 8~20자이어야 합니다.") - .dmsFont(.text(.extraSmall), color: .GrayScale.gray5) + .dmsFont(.etc(.caption), color: .GrayScale.gray5) Spacer() } diff --git a/Projects/Features/SignupFeature/Sources/SignupProfileImage/SignupProfileImageView.swift b/Projects/Features/SignupFeature/Sources/SignupProfileImage/SignupProfileImageView.swift index 8ce0990d..f1cbe725 100644 --- a/Projects/Features/SignupFeature/Sources/SignupProfileImage/SignupProfileImageView.swift +++ b/Projects/Features/SignupFeature/Sources/SignupProfileImage/SignupProfileImageView.swift @@ -20,7 +20,7 @@ struct SignupProfileImageView: View { var body: some View { VStack { - AuthHeaderView(subTitle: "프로필 사진") + DMSHeaderTitleView(subTitle: "프로필 사진") .padding(.top, 24) Button { diff --git a/Projects/Features/SignupFeature/Sources/SignupTerms/SignupTermsView.swift b/Projects/Features/SignupFeature/Sources/SignupTerms/SignupTermsView.swift index ee680c99..255b70e5 100644 --- a/Projects/Features/SignupFeature/Sources/SignupTerms/SignupTermsView.swift +++ b/Projects/Features/SignupFeature/Sources/SignupTerms/SignupTermsView.swift @@ -14,18 +14,8 @@ struct SignupTermsView: View { var body: some View { VStack(spacing: 0) { - HStack { - VStack(alignment: .leading, spacing: 8) { - Text("DMS") - .dmsFont(.title(.extraLarge), color: .PrimaryVariant.primary) - - Text("이메일 주소 입력") - .dmsFont(.text(.medium), color: .GrayScale.gray6) - } - - Spacer() - } - .padding(.top, 24) + DMSHeaderTitleView(subTitle: "이메일 주소 입력") + .padding(.top, 24) DMSWebView(urlToLoad: "https://team-aliens-webview.dsm-dms.com/sign-up-policy") .frame(maxWidth: .infinity, maxHeight: .infinity) @@ -36,7 +26,7 @@ struct SignupTermsView: View { DMSCheckBox(isOn: $viewModel.isAgreeTerms) Text("전체 약관 동의") - .dmsFont(.text(.small), color: .GrayScale.gray6) + .dmsFont(.body(.body3), color: .GrayScale.gray6) Spacer() } diff --git a/Projects/Services/DataMappingModule/Sources/Points/FetchPointListResponseDTO.swift b/Projects/Services/DataMappingModule/Sources/Points/FetchPointListResponseDTO.swift index 1e793409..fa185b88 100644 --- a/Projects/Services/DataMappingModule/Sources/Points/FetchPointListResponseDTO.swift +++ b/Projects/Services/DataMappingModule/Sources/Points/FetchPointListResponseDTO.swift @@ -1,5 +1,6 @@ import Foundation +// swiftlint: disable nesting public struct FetchPointListResponseDTO: Decodable { public init( totalPoint: Int, diff --git a/Projects/UsertInterfaces/DesignSystem/Derived/Sources/TuistFonts+DesignSystem.swift b/Projects/UsertInterfaces/DesignSystem/Derived/Sources/TuistFonts+DesignSystem.swift new file mode 100644 index 00000000..e54158e7 --- /dev/null +++ b/Projects/UsertInterfaces/DesignSystem/Derived/Sources/TuistFonts+DesignSystem.swift @@ -0,0 +1,83 @@ +// swiftlint:disable all +// swift-format-ignore-file +// swiftformat:disable all +// Generated using tuist — https://github.com/tuist/tuist + +#if os(OSX) + import AppKit.NSFont +#elseif os(iOS) || os(tvOS) || os(watchOS) + import UIKit.UIFont +#endif + +// swiftlint:disable superfluous_disable_command +// swiftlint:disable file_length + +// MARK: - Fonts + +// swiftlint:disable identifier_name line_length type_body_length +public enum DesignSystemFontFamily { + public enum NotoSansKR { + public static let black = DesignSystemFontConvertible(name: "NotoSansKR-Black", family: "Noto Sans KR", path: "NotoSansKR-Black.otf") + public static let bold = DesignSystemFontConvertible(name: "NotoSansKR-Bold", family: "Noto Sans KR", path: "NotoSansKR-Bold.otf") + public static let light = DesignSystemFontConvertible(name: "NotoSansKR-Light", family: "Noto Sans KR", path: "NotoSansKR-Light.otf") + public static let medium = DesignSystemFontConvertible(name: "NotoSansKR-Medium", family: "Noto Sans KR", path: "NotoSansKR-Medium.otf") + public static let regular = DesignSystemFontConvertible(name: "NotoSansKR-Regular", family: "Noto Sans KR", path: "NotoSansKR-Regular.otf") + public static let thin = DesignSystemFontConvertible(name: "NotoSansKR-Thin", family: "Noto Sans KR", path: "NotoSansKR-Thin.otf") + public static let all: [DesignSystemFontConvertible] = [black, bold, light, medium, regular, thin] + } + public static let allCustomFonts: [DesignSystemFontConvertible] = [NotoSansKR.all].flatMap { $0 } + public static func registerAllCustomFonts() { + allCustomFonts.forEach { $0.register() } + } +} +// swiftlint:enable identifier_name line_length type_body_length + +// MARK: - Implementation Details + +public struct DesignSystemFontConvertible { + public let name: String + public let family: String + public let path: String + + #if os(OSX) + public typealias Font = NSFont + #elseif os(iOS) || os(tvOS) || os(watchOS) + public typealias Font = UIFont + #endif + + public func font(size: CGFloat) -> Font { + guard let font = Font(font: self, size: size) else { + fatalError("Unable to initialize font '\(name)' (\(family))") + } + return font + } + + public func register() { + // swiftlint:disable:next conditional_returns_on_newline + guard let url = url else { return } + CTFontManagerRegisterFontsForURL(url as CFURL, .process, nil) + } + + fileprivate var url: URL? { + // swiftlint:disable:next implicit_return + return Bundle.module.url(forResource: path, withExtension: nil) + } +} + +public extension DesignSystemFontConvertible.Font { + convenience init?(font: DesignSystemFontConvertible, size: CGFloat) { + #if os(iOS) || os(tvOS) || os(watchOS) + if !UIFont.fontNames(forFamilyName: font.family).contains(font.name) { + font.register() + } + #elseif os(OSX) + if let url = font.url, CTFontManagerGetScopeForURL(url as CFURL) == .none { + font.register() + } + #endif + + self.init(name: font.name, size: size) + } +} +// swiftlint:enable all +// swiftformat:enable all diff --git a/Projects/UsertInterfaces/DesignSystem/Resources/Fonts/NotoSansKR/NotoSansKR-Black.otf b/Projects/UsertInterfaces/DesignSystem/Resources/Fonts/NotoSansKR/NotoSansKR-Black.otf new file mode 100644 index 00000000..5599581d Binary files /dev/null and b/Projects/UsertInterfaces/DesignSystem/Resources/Fonts/NotoSansKR/NotoSansKR-Black.otf differ diff --git a/Projects/UsertInterfaces/DesignSystem/Resources/Fonts/NotoSansKR/NotoSansKR-Bold.otf b/Projects/UsertInterfaces/DesignSystem/Resources/Fonts/NotoSansKR/NotoSansKR-Bold.otf new file mode 100644 index 00000000..be388bf5 Binary files /dev/null and b/Projects/UsertInterfaces/DesignSystem/Resources/Fonts/NotoSansKR/NotoSansKR-Bold.otf differ diff --git a/Projects/UsertInterfaces/DesignSystem/Resources/Fonts/NotoSansKR/NotoSansKR-Light.otf b/Projects/UsertInterfaces/DesignSystem/Resources/Fonts/NotoSansKR/NotoSansKR-Light.otf new file mode 100644 index 00000000..548e667e Binary files /dev/null and b/Projects/UsertInterfaces/DesignSystem/Resources/Fonts/NotoSansKR/NotoSansKR-Light.otf differ diff --git a/Projects/UsertInterfaces/DesignSystem/Resources/Fonts/NotoSansKR/NotoSansKR-Medium.otf b/Projects/UsertInterfaces/DesignSystem/Resources/Fonts/NotoSansKR/NotoSansKR-Medium.otf new file mode 100644 index 00000000..5ddbbc03 Binary files /dev/null and b/Projects/UsertInterfaces/DesignSystem/Resources/Fonts/NotoSansKR/NotoSansKR-Medium.otf differ diff --git a/Projects/UsertInterfaces/DesignSystem/Resources/Fonts/NotoSansKR/NotoSansKR-Regular.otf b/Projects/UsertInterfaces/DesignSystem/Resources/Fonts/NotoSansKR/NotoSansKR-Regular.otf new file mode 100644 index 00000000..7c5c2fae Binary files /dev/null and b/Projects/UsertInterfaces/DesignSystem/Resources/Fonts/NotoSansKR/NotoSansKR-Regular.otf differ diff --git a/Projects/UsertInterfaces/DesignSystem/Resources/Fonts/NotoSansKR/NotoSansKR-Thin.otf b/Projects/UsertInterfaces/DesignSystem/Resources/Fonts/NotoSansKR/NotoSansKR-Thin.otf new file mode 100644 index 00000000..1299fef0 Binary files /dev/null and b/Projects/UsertInterfaces/DesignSystem/Resources/Fonts/NotoSansKR/NotoSansKR-Thin.otf differ diff --git a/Projects/UsertInterfaces/DesignSystem/Sources/Button/Default/DMSButtonStyle.swift b/Projects/UsertInterfaces/DesignSystem/Sources/Button/Default/DMSButtonStyle.swift index 4454129f..16e11a27 100644 --- a/Projects/UsertInterfaces/DesignSystem/Sources/Button/Default/DMSButtonStyle.swift +++ b/Projects/UsertInterfaces/DesignSystem/Sources/Button/Default/DMSButtonStyle.swift @@ -44,9 +44,9 @@ extension DMSButtonStyle { var body: some View { configuration.label - .padding(.vertical, 8.5) - .padding(.horizontal, 19.5) - .dmsFont(.button(.default)) + .padding(.vertical, 14) + .padding(.horizontal, 16) + .dmsFont(.etc(.button)) .background(color) .foregroundColor(.GrayScale.gray1) .cornerRadius(5) @@ -68,9 +68,9 @@ extension DMSButtonStyle { var body: some View { configuration.label - .padding(.vertical, 8.5) - .padding(.horizontal, 19.5) - .dmsFont(.button(.default)) + .padding(.vertical, 14) + .padding(.horizontal, 16) + .dmsFont(.etc(.button)) .background(.clear) .foregroundColor(color) .overlay { @@ -95,7 +95,8 @@ extension DMSButtonStyle { var body: some View { configuration.label - .dmsFont(.button(.default)) + .dmsFont( + .etc(.button)) .foregroundColor(color) .opacity( isEnabled ? @@ -115,7 +116,7 @@ extension DMSButtonStyle { var body: some View { configuration.label - .dmsFont(.button(.default)) + .dmsFont(.etc(.button)) .foregroundColor(color) .overlay(alignment: .bottom) { Rectangle() diff --git a/Projects/UsertInterfaces/DesignSystem/Sources/Button/Wide/DMSWideButtonStyle.swift b/Projects/UsertInterfaces/DesignSystem/Sources/Button/Wide/DMSWideButtonStyle.swift index 83af84c6..3e42e149 100644 --- a/Projects/UsertInterfaces/DesignSystem/Sources/Button/Wide/DMSWideButtonStyle.swift +++ b/Projects/UsertInterfaces/DesignSystem/Sources/Button/Wide/DMSWideButtonStyle.swift @@ -50,7 +50,7 @@ extension DMSWideButtonStyle { var body: some View { configuration.label - .dmsFont(.button(.default)) + .dmsFont(.etc(.button)) .background(color) .foregroundColor(.GrayScale.gray1) .cornerRadius(5) @@ -74,7 +74,7 @@ extension DMSWideButtonStyle { var body: some View { configuration.label - .dmsFont(.button(.default)) + .dmsFont(.etc(.button)) .background(.clear) .foregroundColor(color) .overlay { @@ -101,7 +101,7 @@ extension DMSWideButtonStyle { var body: some View { configuration.label - .dmsFont(.button(.default)) + .dmsFont(.etc(.button)) .foregroundColor(color) .opacity(opacity) } @@ -123,7 +123,7 @@ extension DMSWideButtonStyle { var body: some View { configuration.label - .dmsFont(.button(.default)) + .dmsFont(.etc(.button)) .foregroundColor(color) .overlay(alignment: .bottom) { Rectangle() diff --git a/Projects/UsertInterfaces/DesignSystem/Sources/Component/Auth/AuthHeaderView.swift b/Projects/UsertInterfaces/DesignSystem/Sources/Component/Auth/AuthHeaderView.swift deleted file mode 100644 index 3617a6ac..00000000 --- a/Projects/UsertInterfaces/DesignSystem/Sources/Component/Auth/AuthHeaderView.swift +++ /dev/null @@ -1,23 +0,0 @@ -import SwiftUI - -public struct AuthHeaderView: View { - let subTitle: String - - public init(subTitle: String) { - self.subTitle = subTitle - } - - public var body: some View { - HStack { - VStack(alignment: .leading, spacing: 8) { - Text("DMS") - .dmsFont(.title(.extraLarge), color: .PrimaryVariant.primary) - - Text(subTitle) - .dmsFont(.text(.medium), color: .GrayScale.gray6) - } - - Spacer() - } - } -} diff --git a/Projects/UsertInterfaces/DesignSystem/Sources/Component/Common/DMSHeaderView.swift b/Projects/UsertInterfaces/DesignSystem/Sources/Component/Common/DMSHeaderView.swift index 3b3dacff..a699a391 100644 --- a/Projects/UsertInterfaces/DesignSystem/Sources/Component/Common/DMSHeaderView.swift +++ b/Projects/UsertInterfaces/DesignSystem/Sources/Component/Common/DMSHeaderView.swift @@ -1,6 +1,6 @@ import SwiftUI -public struct DMSHeaderView: View { +public struct DMSHeaderTitleView: View { private let subTitle: String public init(subTitle: String) { @@ -11,10 +11,10 @@ public struct DMSHeaderView: View { HStack { VStack(alignment: .leading, spacing: 8) { Text("DMS") - .dmsFont(.title(.extraLarge), color: .PrimaryVariant.primary) + .dmsFont(.headline(.headline1), color: .PrimaryVariant.primary) Text(subTitle) - .dmsFont(.text(.medium), color: .GrayScale.gray6) + .dmsFont(.body(.body2), color: .GrayScale.gray6) } Spacer() diff --git a/Projects/UsertInterfaces/DesignSystem/Sources/Playground/Views/FontPlaygroundView.swift b/Projects/UsertInterfaces/DesignSystem/Sources/Playground/Views/FontPlaygroundView.swift index 9a197069..3712bb36 100644 --- a/Projects/UsertInterfaces/DesignSystem/Sources/Playground/Views/FontPlaygroundView.swift +++ b/Projects/UsertInterfaces/DesignSystem/Sources/Playground/Views/FontPlaygroundView.swift @@ -2,24 +2,25 @@ import SwiftUI struct FontPlaygroundView: View { let fonts: [(String, [DMSFontStyle])] = [ + ("Headline", [ + .headline(.headline1), + .headline(.headline2), + .headline(.headline3) + ]), ("Title", [ - .title(.extraLarge), - .title(.large), - .title(.medium), - .title(.small), - .title(.extraSmall) + .title(.title1), + .title(.title2), + .title(.subTitle1) ]), - ("Text", [ - .text(.twoExtraLarge), - .text(.extraLarge), - .text(.large), - .text(.medium), - .text(.small), - .text(.extraSmall), - .text(.twoExtraSmall) + ("Body", [ + .body(.body1), + .body(.body2), + .body(.body3) ]), - ("Button", [ - .button(.default) + ("Etc", [ + .etc(.caption), + .etc(.overline), + .etc(.button) ]) ] var body: some View { @@ -28,7 +29,7 @@ struct FontPlaygroundView: View { ForEach(fonts, id: \.0) { proto in Section { Text(proto.0) - .dmsFont(.title(.extraLarge)) + .dmsFont(.title(.title1)) } VStack(alignment: .leading) { diff --git a/Projects/UsertInterfaces/DesignSystem/Sources/Playground/Views/TextFieldPlaygroundView.swift b/Projects/UsertInterfaces/DesignSystem/Sources/Playground/Views/TextFieldPlaygroundView.swift index 5dc84299..0881d4d3 100644 --- a/Projects/UsertInterfaces/DesignSystem/Sources/Playground/Views/TextFieldPlaygroundView.swift +++ b/Projects/UsertInterfaces/DesignSystem/Sources/Playground/Views/TextFieldPlaygroundView.swift @@ -16,13 +16,12 @@ struct TextFieldPlaygroundView: View { SecureDMSFloatingTextField("비밀번호", text: $text2) - DMSFloatingTextField("HelpText", text: $text3, helpMessage: "HelpText") - - DMSFloatingTextField("Error", - text: $text4, - helpMessage: "HelpText", - isError: isError1, - errorMessage: "Error Message") { + DMSFloatingTextField( + "Error", + text: $text3, + isError: isError1, + errorMessage: "Error Message" + ) { isError1.toggle() } diff --git a/Projects/UsertInterfaces/DesignSystem/Sources/TextField/Floating/DMSFloatingTextField.swift b/Projects/UsertInterfaces/DesignSystem/Sources/TextField/Floating/DMSFloatingTextField.swift index 2364801b..13517837 100644 --- a/Projects/UsertInterfaces/DesignSystem/Sources/TextField/Floating/DMSFloatingTextField.swift +++ b/Projects/UsertInterfaces/DesignSystem/Sources/TextField/Floating/DMSFloatingTextField.swift @@ -3,7 +3,6 @@ import SwiftUI public struct DMSFloatingTextField: View { var label: String @Binding var text: String - var helpMessage: String var isError: Bool var errorMessage: String var onCommit: () -> Void @@ -11,8 +10,8 @@ public struct DMSFloatingTextField: View { private var isFloaintg: Bool { isFocused || !text.isEmpty } - private var isErrorOrHelpNotEmpty: Bool { - isError || !helpMessage.isEmpty + private var isErrorAndNotEmpty: Bool { + isError && !errorMessage.isEmpty } private var dmsForegroundColor: Color { isFocused ? @@ -25,14 +24,12 @@ public struct DMSFloatingTextField: View { public init( _ label: String = "", text: Binding, - helpMessage: String = "", isError: Bool = false, errorMessage: String = "", onCommit: @escaping () -> Void = {} ) { self.label = label _text = text - self.helpMessage = helpMessage self.isError = isError self.errorMessage = errorMessage self.onCommit = onCommit @@ -41,13 +38,13 @@ public struct DMSFloatingTextField: View { public var body: some View { ZStack(alignment: .leading) { Text(label) - .dmsFont(.text(.extraLarge), color: dmsForegroundColor) - .offset(y: isFloaintg ? -40 : isErrorOrHelpNotEmpty ? -10 : 0) + .dmsFont(.body(.body1), color: dmsForegroundColor) + .offset(y: isFloaintg ? -40 : isErrorAndNotEmpty ? -10 : 0) .scaleEffect(isFloaintg ? 0.8 : 1, anchor: .topLeading) VStack(alignment: .leading, spacing: 10) { TextField("", text: $text) - .dmsFont(.text(.medium), color: .GrayScale.gray9) + .dmsFont(.body(.body2), color: .GrayScale.gray9) .foregroundColor(dmsForegroundColor) .overlay(alignment: .bottom) { Rectangle() @@ -58,18 +55,15 @@ public struct DMSFloatingTextField: View { .focused($isFocused) .onSubmit(onCommit) - if !isError && !helpMessage.isEmpty { - Text(helpMessage) - .dmsFont(.text(.extraSmall), color: .GrayScale.gray5) - .offset(x: 5) - } else if isError && !errorMessage.isEmpty { + if isErrorAndNotEmpty { Text(errorMessage) - .dmsFont(.text(.extraSmall), color: .System.error) + .dmsFont(.etc(.caption), color: .System.error) .offset(x: 5) } } } - .animation(.easeIn(duration: 0.3), value: isErrorOrHelpNotEmpty) + .animation(.easeIn(duration: 0.3), value: isErrorAndNotEmpty) + .animation(.easeIn(duration: 0.3), value: isError) .animation(.easeIn(duration: 0.3), value: isFloaintg) .animation(.easeIn(duration: 0.3), value: isFocused) } diff --git a/Projects/UsertInterfaces/DesignSystem/Sources/TextField/Floating/SecureDMSFloatingTextField.swift b/Projects/UsertInterfaces/DesignSystem/Sources/TextField/Floating/SecureDMSFloatingTextField.swift index d1c1d05a..28390f80 100644 --- a/Projects/UsertInterfaces/DesignSystem/Sources/TextField/Floating/SecureDMSFloatingTextField.swift +++ b/Projects/UsertInterfaces/DesignSystem/Sources/TextField/Floating/SecureDMSFloatingTextField.swift @@ -3,7 +3,6 @@ import SwiftUI public struct SecureDMSFloatingTextField: View { var label: String @Binding var text: String - var helpMessage: String var isError: Bool var errorMessage: String var onCommit: () -> Void @@ -12,8 +11,8 @@ public struct SecureDMSFloatingTextField: View { private var isFloaintg: Bool { isFocused || !text.isEmpty } - private var isErrorOrHelpNotEmpty: Bool { - isError || !helpMessage.isEmpty + private var isErrorAndNotEmpty: Bool { + isError && !errorMessage.isEmpty } private var dmsForegroundColor: Color { isFocused ? @@ -26,14 +25,12 @@ public struct SecureDMSFloatingTextField: View { public init( _ label: String = "", text: Binding, - helpMessage: String = "", isError: Bool = false, errorMessage: String = "", onCommit: @escaping () -> Void = {} ) { self.label = label _text = text - self.helpMessage = helpMessage self.isError = isError self.errorMessage = errorMessage self.onCommit = onCommit @@ -43,8 +40,8 @@ public struct SecureDMSFloatingTextField: View { ZStack(alignment: .leading) { HStack { Text(label) - .dmsFont(.text(.extraLarge), color: dmsForegroundColor) - .offset(y: isFloaintg ? -40 : isErrorOrHelpNotEmpty ? -10 : 0) + .dmsFont(.body(.body1), color: dmsForegroundColor) + .offset(y: isFloaintg ? -40 : isErrorAndNotEmpty ? -10 : 0) .scaleEffect(isFloaintg ? 0.8 : 1, anchor: .topLeading) .onTapGesture { isFocused = true @@ -59,7 +56,7 @@ public struct SecureDMSFloatingTextField: View { .foregroundColor(.GrayScale.gray5) } .padding() - .offset(y: isErrorOrHelpNotEmpty ? -10 : 0) + .offset(y: isErrorAndNotEmpty ? -10 : 0) } .zIndex(1) @@ -71,7 +68,7 @@ public struct SecureDMSFloatingTextField: View { TextField("", text: $text) } } - .dmsFont(.text(.medium), color: .GrayScale.gray9) + .dmsFont(.body(.body2), color: .GrayScale.gray9) .foregroundColor(dmsForegroundColor) .overlay(alignment: .bottom) { Rectangle() @@ -82,14 +79,15 @@ public struct SecureDMSFloatingTextField: View { .focused($isFocused) .onSubmit(onCommit) - if isErrorOrHelpNotEmpty { - Text(isError ? errorMessage : helpMessage) - .dmsFont(.text(.extraSmall), color: isError ? .System.error : .GrayScale.gray5) + if isErrorAndNotEmpty { + Text(errorMessage) + .dmsFont(.etc(.caption), color: .System.error) .offset(x: 5) } } } - .animation(.easeIn(duration: 0.3), value: isErrorOrHelpNotEmpty) + .animation(.easeIn(duration: 0.3), value: isErrorAndNotEmpty) + .animation(.easeIn(duration: 0.3), value: isError) .animation(.easeIn(duration: 0.3), value: isFloaintg) .animation(.easeIn(duration: 0.3), value: isFocused) } diff --git a/Projects/UsertInterfaces/DesignSystem/Sources/TextField/Form/DMSFormTextEditor.swift b/Projects/UsertInterfaces/DesignSystem/Sources/TextField/Form/DMSFormTextEditor.swift index 47f3993e..c99c6422 100644 --- a/Projects/UsertInterfaces/DesignSystem/Sources/TextField/Form/DMSFormTextEditor.swift +++ b/Projects/UsertInterfaces/DesignSystem/Sources/TextField/Form/DMSFormTextEditor.swift @@ -4,6 +4,7 @@ public struct DMSFormTextEditor: View { var placeholder: String @Binding var text: String var minHeight: CGFloat + @FocusState var isFocused: Bool public init( _ placeholder: String = "", @@ -24,17 +25,20 @@ public struct DMSFormTextEditor: View { .strokeBorder(Color.GrayScale.gray4) TextEditor(text: $text) - .dmsFont(.text(.medium), color: .GrayScale.gray6) + .dmsFont(.body(.body2), color: .GrayScale.gray6) .padding(.horizontal, 16) .padding(.vertical, 15) .frame(minHeight: minHeight, alignment: .leading) .cornerRadius(4) Text(placeholder) - .dmsFont(.text(.medium), color: .GrayScale.gray5) + .dmsFont(.body(.body2), color: .GrayScale.gray5) .padding(.horizontal, 21) .padding(.vertical, 21) .opacity(text.isEmpty ? 1 : 0) + .onTapGesture { + isFocused = true + } } } } diff --git a/Projects/UsertInterfaces/DesignSystem/Sources/TextField/Form/DMSFormTextField.swift b/Projects/UsertInterfaces/DesignSystem/Sources/TextField/Form/DMSFormTextField.swift index cf50da56..550a5310 100644 --- a/Projects/UsertInterfaces/DesignSystem/Sources/TextField/Form/DMSFormTextField.swift +++ b/Projects/UsertInterfaces/DesignSystem/Sources/TextField/Form/DMSFormTextField.swift @@ -3,6 +3,7 @@ import SwiftUI public struct DMSFormTextField: View { var placeholder: String @Binding var text: String + @FocusState var isFocused: Bool public init( _ placeholder: String = "", @@ -16,12 +17,16 @@ public struct DMSFormTextField: View { ZStack(alignment: .leading) { if text.isEmpty { Text(placeholder) - .dmsFont(.text(.medium), color: .GrayScale.gray5) + .dmsFont(.body(.body2), color: .GrayScale.gray5) .padding(.horizontal, 16) .padding(.vertical, 15) + .onTapGesture { + isFocused = true + } } TextField("", text: $text) + .dmsFont(.body(.body2), color: .GrayScale.gray5) .foregroundColor(.GrayScale.gray6) .padding(.horizontal, 16) .padding(.vertical, 15) diff --git a/Projects/UsertInterfaces/DesignSystem/Sources/Toast/DmsToast.swift b/Projects/UsertInterfaces/DesignSystem/Sources/Toast/DmsToast.swift index 34d3909f..4eb65420 100644 --- a/Projects/UsertInterfaces/DesignSystem/Sources/Toast/DmsToast.swift +++ b/Projects/UsertInterfaces/DesignSystem/Sources/Toast/DmsToast.swift @@ -44,8 +44,7 @@ struct DmsToast: ViewModifier { .foregroundColor(style.iconForeground) Text(message) - .dmsFont(.text(.small)) - .foregroundColor(style.textForeground) + .dmsFont(.body(.body3), color: style.textForeground) Spacer() } diff --git a/Projects/UsertInterfaces/DesignSystem/Sources/Typography/DMSFont.swift b/Projects/UsertInterfaces/DesignSystem/Sources/Typography/DMSFont.swift index 5c48b0cc..1806d71b 100644 --- a/Projects/UsertInterfaces/DesignSystem/Sources/Typography/DMSFont.swift +++ b/Projects/UsertInterfaces/DesignSystem/Sources/Typography/DMSFont.swift @@ -5,17 +5,21 @@ public struct DMSFont: ViewModifier { public func body(content: Content) -> some View { switch style { + case let .headline(font): + return content + .font(.custom("NotoSansKR-\(font.weight.rawValue)", size: font.size)) + case let .title(font): return content - .font(.system(size: font.size, weight: font.weight)) + .font(.custom("NotoSansKR-\(font.weight.rawValue)", size: font.size)) - case let .text(font): + case let .body(font): return content - .font(.system(size: font.size, weight: font.weight)) + .font(.custom("NotoSansKR-\(font.weight.rawValue)", size: font.size)) - case let .button(font): + case let .etc(font): return content - .font(.system(size: font.size, weight: font.weight)) + .font(.custom("NotoSansKR-\(font.weight.rawValue)", size: font.size)) } } } diff --git a/Projects/UsertInterfaces/DesignSystem/Sources/Typography/DMSFontStyle.swift b/Projects/UsertInterfaces/DesignSystem/Sources/Typography/DMSFontStyle.swift index 2f50d1b4..d6ddefe5 100644 --- a/Projects/UsertInterfaces/DesignSystem/Sources/Typography/DMSFontStyle.swift +++ b/Projects/UsertInterfaces/DesignSystem/Sources/Typography/DMSFontStyle.swift @@ -2,34 +2,43 @@ import SwiftUI protocol DMSFontable { var size: CGFloat { get } - var weight: Font.Weight { get } + var weight: DMSFontWeight { get } +} + +public enum DMSFontWeight: String { + case bold = "Bold" + case medium = "Medium" + case regular = "Regular" } public enum DMSFontStyle: Hashable { + case headline(DMSFontStyle.Headline) case title(DMSFontStyle.Title) - case text(DMSFontStyle.Text) - case button(DMSFontStyle.Button) + case body(DMSFontStyle.Body) + case etc(DMSFontStyle.Etc) + + public enum Headline: CGFloat, DMSFontable { + case headline1 = 36 + case headline2 = 30 + case headline3 = 24 + } public enum Title: CGFloat, DMSFontable { - case extraLarge = 36 - case large = 30 - case medium = 24 - case small = 22 - case extraSmall = 18 + case title1 = 22 + case title2 = 20 + case subTitle1 = 18 } - public enum Text: CGFloat, DMSFontable { - case twoExtraLarge = 22 - case extraLarge = 20 - case large = 18 - case medium = 16 - case small = 14 - case extraSmall = 12 - case twoExtraSmall = 10 + public enum Body: CGFloat, DMSFontable { + case body1 = 18 + case body2 = 16 + case body3 = 14 } - public enum Button: CGFloat, DMSFontable { - case `default` = 14 + public enum Etc: CGFloat, DMSFontable { + case caption = 12 + case overline = 10 + case button = 14 } } @@ -40,35 +49,45 @@ extension DMSFontable where Self: RawRepresentable, Self.RawValue == CGFloat { } } -// MARK: - Title -public extension DMSFontStyle.Title { - var weight: Font.Weight { +// MARK: - Headline +public extension DMSFontStyle.Headline { + var weight: DMSFontWeight { switch self { - case .extraLarge, .large, .medium, .extraSmall: + case .headline1, .headline2, .headline3: return .medium + } + } +} - case .small: +// MARK: - Title +public extension DMSFontStyle.Title { + var weight: DMSFontWeight { + switch self { + case .title1, .title2, .subTitle1: return .bold } } } // MARK: - Text -public extension DMSFontStyle.Text { - var weight: Font.Weight { +public extension DMSFontStyle.Body { + var weight: DMSFontWeight { switch self { - case .twoExtraLarge, .extraLarge, .large, .medium, .small, .extraSmall, .twoExtraSmall: + case .body1, .body2, .body3: return .regular } } } // MARK: - Button -public extension DMSFontStyle.Button { - var weight: Font.Weight { +public extension DMSFontStyle.Etc { + var weight: DMSFontWeight { switch self { - case .`default`: - return .semibold + case .caption: + return .regular + + case .overline, .button: + return .bold } } }