@uniai-fe/uds-templates 0.0.11 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/dist/styles.css +916 -1074
- package/package.json +3 -3
- package/src/auth/common/complete/Template.tsx +47 -0
- package/src/auth/common/complete/img/circle-check-complete.svg +4 -0
- package/src/auth/common/complete/index.scss +38 -0
- package/src/auth/common/complete/types.ts +15 -0
- package/src/auth/common/container/header/StageHeader.tsx +61 -0
- package/src/auth/common/container/header/index.tsx +5 -0
- package/src/auth/common/container/header/stage-header.scss +50 -0
- package/src/{components/auth → auth/common}/container/index.tsx +2 -0
- package/src/auth/common/find/hooks/useFindAccountForm.ts +79 -0
- package/src/auth/common/find/markup/CodeStep.tsx +166 -0
- package/src/auth/common/find/markup/Header.tsx +46 -0
- package/src/auth/common/find/markup/InfoStep.tsx +109 -0
- package/src/auth/common/find/styles/email.scss +55 -0
- package/src/auth/common/find/styles/find-account.scss +4 -0
- package/src/auth/common/find/styles/layout.scss +19 -0
- package/src/auth/common/find/styles/password.scss +39 -0
- package/src/auth/common/find/styles/result.scss +78 -0
- package/src/auth/common/find/types/forms.ts +30 -0
- package/src/auth/common/find/types/index.ts +121 -0
- package/src/auth/common/find/utils/composeFieldProps.ts +45 -0
- package/src/auth/common/password/constants.ts +19 -0
- package/src/auth/common/password/hooks/useCheckPassword.ts +133 -0
- package/src/auth/common/password/img/check-password.svg +3 -0
- package/src/auth/common/password/markup/PasswordSetField.tsx +250 -0
- package/src/auth/common/password/styles/password-set-field.scss +49 -0
- package/src/auth/common/password/types.ts +142 -0
- package/src/auth/common/password/utils/composePasswordFieldProps.ts +44 -0
- package/src/auth/find-account.ts +28 -0
- package/src/auth/find-id/hooks/index.ts +1 -0
- package/src/auth/find-id/index.scss +1 -0
- package/src/auth/find-id/index.ts +23 -0
- package/src/auth/find-id/markup/StepComplete.tsx +58 -0
- package/src/auth/find-id/markup/StepIdentify.tsx +46 -0
- package/src/auth/find-id/markup/StepVerifyCode.tsx +48 -0
- package/src/auth/find-id/types/index.ts +66 -0
- package/src/auth/find-password/index.scss +1 -0
- package/src/auth/find-password/index.ts +30 -0
- package/src/auth/find-password/markup/StepComplete.tsx +30 -0
- package/src/auth/find-password/markup/StepIdentify.tsx +45 -0
- package/src/auth/find-password/markup/StepResetPassword.tsx +150 -0
- package/src/auth/find-password/markup/StepVerifyCode.tsx +48 -0
- package/src/auth/index.tsx +41 -0
- package/src/{components/auth → auth}/login/markup/Container.tsx +1 -1
- package/src/{components/auth → auth}/login/types/props.ts +1 -1
- package/src/{components/auth → auth}/signup/hooks/useSignupAccountForm.ts +26 -2
- package/src/{components/auth → auth}/signup/hooks/useSignupUserInfoForm.ts +10 -3
- package/src/auth/signup/img/check-agree.svg +3 -0
- package/src/auth/signup/img/chevron-open-detail.svg +3 -0
- package/src/{components/auth → auth}/signup/index.ts +3 -0
- package/src/auth/signup/markup/AccountForm.tsx +113 -0
- package/src/auth/signup/markup/Complete.tsx +59 -0
- package/src/auth/signup/markup/Template.tsx +110 -0
- package/src/{components/auth → auth}/signup/markup/UserInfoForm.tsx +23 -13
- package/src/auth/signup/markup/VerificationForm.tsx +285 -0
- package/src/{components/auth → auth}/signup/markup/index.ts +1 -0
- package/src/auth/signup/styles/signup.scss +187 -0
- package/src/{components/auth → auth}/signup/types/hooks.ts +1 -0
- package/src/{components/auth → auth}/signup/types/props.ts +49 -9
- package/src/auth/signup/utils/getSignupFieldDefaultValue.ts +40 -0
- package/src/index.scss +5 -4
- package/src/index.tsx +3 -3
- package/src/page-frame/mobile/header/PageFrameMobileHeader.tsx +52 -0
- package/src/page-frame/mobile/header/index.ts +4 -0
- package/src/page-frame/mobile/header/page-frame-mobile-header.scss +48 -0
- package/src/page-frame/mobile/img/chevron-backward.svg +3 -0
- package/src/components/auth/index.tsx +0 -20
- package/src/components/auth/signup/markup/AccountForm.tsx +0 -124
- package/src/components/auth/signup/markup/Complete.tsx +0 -61
- package/src/components/auth/signup/markup/VerificationForm.tsx +0 -155
- package/src/components/auth/signup/styles/signup.scss +0 -135
- /package/src/{components/auth → auth/common}/container/AuthContainer.tsx +0 -0
- /package/src/{components/auth → auth/common}/container/index.scss +0 -0
- /package/src/{components/auth → auth/common}/container/types.ts +0 -0
- /package/src/{components/auth → auth}/login/data/valid-options.ts +0 -0
- /package/src/{components/auth → auth}/login/hooks/index.ts +0 -0
- /package/src/{components/auth → auth}/login/hooks/useAuthLoginForm.ts +0 -0
- /package/src/{components/auth → auth}/login/index.scss +0 -0
- /package/src/{components/auth → auth}/login/index.tsx +0 -0
- /package/src/{components/auth → auth}/login/markup/FormField.tsx +0 -0
- /package/src/{components/auth → auth}/login/markup/LinkButtons.tsx +0 -0
- /package/src/{components/auth → auth}/login/styles/login.scss +0 -0
- /package/src/{components/auth → auth}/login/types/form.ts +0 -0
- /package/src/{components/auth → auth}/login/types/hooks.ts +0 -0
- /package/src/{components/auth → auth}/login/types.ts +0 -0
- /package/src/{components/auth → auth}/signup/hooks/index.ts +0 -0
- /package/src/{components/auth → auth}/signup/hooks/useSignupVerificationForm.ts +0 -0
- /package/src/{components/auth → auth}/signup/types/index.ts +0 -0
- /package/src/{components/auth → auth}/signup/utils/composeFieldProps.ts +0 -0
- /package/src/{components/modal → modal}/core/components/Container.tsx +0 -0
- /package/src/{components/modal → modal}/core/components/FooterButtons.tsx +0 -0
- /package/src/{components/modal → modal}/core/components/Provider.tsx +0 -0
- /package/src/{components/modal → modal}/core/components/Root.tsx +0 -0
- /package/src/{components/modal → modal}/core/hooks/useModal.ts +0 -0
- /package/src/{components/modal → modal}/core/jotai/atoms.ts +0 -0
- /package/src/{components/modal → modal}/index.scss +0 -0
- /package/src/{components/modal → modal}/index.tsx +0 -0
- /package/src/{components/modal → modal}/styles/animations.scss +0 -0
- /package/src/{components/modal → modal}/styles/base.scss +0 -0
- /package/src/{components/modal → modal}/styles/container.scss +0 -0
- /package/src/{components/modal → modal}/styles/dimmer.scss +0 -0
- /package/src/{components/modal → modal}/templates/Alert.tsx +0 -0
- /package/src/{components/modal → modal}/templates/Dialog.tsx +0 -0
- /package/src/{components/modal → modal}/types/footer.ts +0 -0
- /package/src/{components/modal → modal}/types/index.ts +0 -0
- /package/src/{components/modal → modal}/types/options.ts +0 -0
- /package/src/{components/modal → modal}/types/state.ts +0 -0
- /package/src/{components/modal → modal}/types/templates.ts +0 -0
- /package/src/{components/page-frame → page-frame}/container/PageFrameContainer.tsx +0 -0
- /package/src/{components/page-frame → page-frame}/container/index.scss +0 -0
- /package/src/{components/page-frame → page-frame}/container/index.tsx +0 -0
- /package/src/{components/page-frame → page-frame}/container/types.ts +0 -0
- /package/src/{components/page-frame → page-frame}/index.tsx +0 -0
- /package/src/{components/page-frame → page-frame}/mobile/PageFrameMobile.tsx +0 -0
- /package/src/{components/page-frame → page-frame}/mobile/index.scss +0 -0
- /package/src/{components/page-frame → page-frame}/mobile/index.tsx +0 -0
- /package/src/{components/page-frame → page-frame}/mobile/types.ts +0 -0
- /package/src/{components/page-frame → page-frame}/navigation/PageFrameNavigation.tsx +0 -0
- /package/src/{components/page-frame → page-frame}/navigation/index.scss +0 -0
- /package/src/{components/page-frame → page-frame}/navigation/index.tsx +0 -0
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import { useMemo } from "react";
|
|
2
|
-
import { useForm } from "react-hook-form";
|
|
3
|
-
import {
|
|
4
|
-
Button,
|
|
5
|
-
CheckboxField,
|
|
6
|
-
EmailVerificationInput,
|
|
7
|
-
type EmailVerificationInputProps,
|
|
8
|
-
} from "@uniai-fe/uds-primitives";
|
|
9
|
-
import type {
|
|
10
|
-
AuthSignupAgreementOption,
|
|
11
|
-
AuthSignupVerificationProps,
|
|
12
|
-
AuthSignupVerificationValues,
|
|
13
|
-
} from "../types";
|
|
14
|
-
import { useSignupVerificationForm } from "../hooks";
|
|
15
|
-
import { composeSignupFieldProps } from "../utils/composeFieldProps";
|
|
16
|
-
|
|
17
|
-
const DEFAULT_SUBMIT_LABEL = "다음";
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* 회원가입 Step2; 약관 동의 + 이메일 인증
|
|
21
|
-
* @component
|
|
22
|
-
* @param {AuthSignupVerificationProps} props verification props
|
|
23
|
-
* @param {AuthSignupAgreementOption[]} props.agreements 약관 목록
|
|
24
|
-
* @param {Record<string, boolean>} props.agreementState 약관 체크 상태
|
|
25
|
-
* @param {(agreementId: string) => void} props.onToggleAgreement 단일 약관 토글
|
|
26
|
-
* @param {() => void} props.onToggleAll 전체 동의 토글
|
|
27
|
-
* @param {(agreementId: string) => void} [props.onOpenAgreementDetail] 약관 상세 보기
|
|
28
|
-
* @param {React.FormHTMLAttributes<HTMLFormElement>} [props.formAttr] form attr
|
|
29
|
-
* @param {import("react").ReactNode} [props.submitLabel] CTA 라벨
|
|
30
|
-
*/
|
|
31
|
-
export function AuthSignupVerificationForm({
|
|
32
|
-
fields,
|
|
33
|
-
agreements,
|
|
34
|
-
agreementState,
|
|
35
|
-
onToggleAgreement,
|
|
36
|
-
onToggleAll,
|
|
37
|
-
onOpenAgreementDetail,
|
|
38
|
-
formAttr,
|
|
39
|
-
submitLabel,
|
|
40
|
-
onSubmit,
|
|
41
|
-
}: AuthSignupVerificationProps) {
|
|
42
|
-
// 이메일 필드 name attr 기반으로 RHF defaultValues를 설정한다.
|
|
43
|
-
const defaultValues = useMemo(
|
|
44
|
-
() =>
|
|
45
|
-
(Object.keys(fields) as Array<keyof typeof fields>).reduce(
|
|
46
|
-
(acc, fieldKey) => {
|
|
47
|
-
const config = fields[fieldKey];
|
|
48
|
-
const fieldName = config.attr?.name ?? String(fieldKey);
|
|
49
|
-
acc[fieldName] = "";
|
|
50
|
-
return acc;
|
|
51
|
-
},
|
|
52
|
-
{} as AuthSignupVerificationValues,
|
|
53
|
-
),
|
|
54
|
-
[fields],
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
const form = useForm<AuthSignupVerificationValues>({
|
|
58
|
-
mode: "onChange",
|
|
59
|
-
defaultValues,
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
const {
|
|
63
|
-
register,
|
|
64
|
-
helpers,
|
|
65
|
-
disabled,
|
|
66
|
-
onSubmit: handleSubmit,
|
|
67
|
-
} = useSignupVerificationForm({
|
|
68
|
-
fields,
|
|
69
|
-
form,
|
|
70
|
-
onSubmit,
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
// 전체 동의 상태를 agreementState 집계로 계산한다.
|
|
74
|
-
const allChecked = agreements.every(
|
|
75
|
-
agreement => agreementState[agreement.id],
|
|
76
|
-
);
|
|
77
|
-
|
|
78
|
-
const renderAgreementLabel = (option: AuthSignupAgreementOption) => (
|
|
79
|
-
<span className="auth-signup-agreement-label">
|
|
80
|
-
<span className="auth-signup-agreement-title">{option.label}</span>
|
|
81
|
-
<span className="auth-signup-agreement-required">
|
|
82
|
-
{option.required ? "필수" : "선택"}
|
|
83
|
-
</span>
|
|
84
|
-
</span>
|
|
85
|
-
);
|
|
86
|
-
|
|
87
|
-
return (
|
|
88
|
-
<div className="auth-signup-verification">
|
|
89
|
-
<section className="auth-signup-agreements" aria-label="약관 동의">
|
|
90
|
-
<div className="auth-signup-agreement">
|
|
91
|
-
<CheckboxField
|
|
92
|
-
size="large"
|
|
93
|
-
label={
|
|
94
|
-
<span className="auth-signup-agreement-title">전체 동의</span>
|
|
95
|
-
}
|
|
96
|
-
helperText="필수 및 선택 약관 전체 동의"
|
|
97
|
-
checked={allChecked}
|
|
98
|
-
onCheckedChange={() => onToggleAll()}
|
|
99
|
-
/>
|
|
100
|
-
</div>
|
|
101
|
-
<div className="auth-signup-agreement-divider" aria-hidden />
|
|
102
|
-
{agreements.map(option => (
|
|
103
|
-
<div
|
|
104
|
-
className="auth-signup-agreement"
|
|
105
|
-
key={option.id}
|
|
106
|
-
data-required={option.required ? "true" : undefined}
|
|
107
|
-
>
|
|
108
|
-
<CheckboxField
|
|
109
|
-
size="large"
|
|
110
|
-
label={renderAgreementLabel(option)}
|
|
111
|
-
helperText={option.description}
|
|
112
|
-
checked={Boolean(agreementState[option.id])}
|
|
113
|
-
onCheckedChange={() => onToggleAgreement(option.id)}
|
|
114
|
-
/>
|
|
115
|
-
{onOpenAgreementDetail ? (
|
|
116
|
-
<button
|
|
117
|
-
type="button"
|
|
118
|
-
className="auth-signup-agreement-detail-button"
|
|
119
|
-
onClick={() => onOpenAgreementDetail(option.id)}
|
|
120
|
-
>
|
|
121
|
-
자세히 보기
|
|
122
|
-
</button>
|
|
123
|
-
) : null}
|
|
124
|
-
</div>
|
|
125
|
-
))}
|
|
126
|
-
</section>
|
|
127
|
-
<form
|
|
128
|
-
className="auth-signup-form auth-signup-form--verification"
|
|
129
|
-
{...formAttr}
|
|
130
|
-
onSubmit={handleSubmit}
|
|
131
|
-
>
|
|
132
|
-
<div className="auth-signup-fields">
|
|
133
|
-
<EmailVerificationInput
|
|
134
|
-
{...composeSignupFieldProps<EmailVerificationInputProps>(
|
|
135
|
-
fields.email,
|
|
136
|
-
helpers.email,
|
|
137
|
-
)}
|
|
138
|
-
register={register.email}
|
|
139
|
-
/>
|
|
140
|
-
</div>
|
|
141
|
-
<Button.Default
|
|
142
|
-
type="submit"
|
|
143
|
-
scale="solid-xlarge"
|
|
144
|
-
priority="primary"
|
|
145
|
-
block
|
|
146
|
-
disabled={disabled}
|
|
147
|
-
>
|
|
148
|
-
{submitLabel ?? DEFAULT_SUBMIT_LABEL}
|
|
149
|
-
</Button.Default>
|
|
150
|
-
</form>
|
|
151
|
-
</div>
|
|
152
|
-
);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
export default AuthSignupVerificationForm;
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
.auth-signup-form {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
gap: var(--spacing-padding-8, 32px);
|
|
5
|
-
margin-top: var(--spacing-padding-9, 36px);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.auth-signup-fields {
|
|
9
|
-
display: flex;
|
|
10
|
-
flex-direction: column;
|
|
11
|
-
gap: var(--spacing-padding-5, 20px);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.auth-signup-verification {
|
|
15
|
-
display: flex;
|
|
16
|
-
flex-direction: column;
|
|
17
|
-
gap: var(--spacing-padding-9, 36px);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.auth-signup-agreements {
|
|
21
|
-
padding: var(--spacing-padding-7, 28px);
|
|
22
|
-
border-radius: var(--shape-rounded-3, 16px);
|
|
23
|
-
background: var(--color-background-subtle);
|
|
24
|
-
display: flex;
|
|
25
|
-
flex-direction: column;
|
|
26
|
-
gap: var(--spacing-padding-4, 16px);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.auth-signup-agreement {
|
|
30
|
-
display: flex;
|
|
31
|
-
align-items: flex-start;
|
|
32
|
-
justify-content: space-between;
|
|
33
|
-
gap: var(--spacing-padding-3, 12px);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.auth-signup-agreement-divider {
|
|
37
|
-
height: 1px;
|
|
38
|
-
width: 100%;
|
|
39
|
-
background: var(--color-border-default);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.auth-signup-agreement-label {
|
|
43
|
-
display: flex;
|
|
44
|
-
gap: var(--spacing-padding-2, 8px);
|
|
45
|
-
align-items: center;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.auth-signup-agreement-title {
|
|
49
|
-
font-weight: 600;
|
|
50
|
-
color: var(--color-label-standard);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.auth-signup-agreement-required {
|
|
54
|
-
font-size: 12px;
|
|
55
|
-
color: var(--color-label-assistive);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.auth-signup-agreement-detail-button {
|
|
59
|
-
border: none;
|
|
60
|
-
background: none;
|
|
61
|
-
font-size: 13px;
|
|
62
|
-
color: var(--color-primary-60, #1d4ed8);
|
|
63
|
-
cursor: pointer;
|
|
64
|
-
|
|
65
|
-
&:hover {
|
|
66
|
-
color: var(--color-primary-70, #1e40af);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.auth-signup-password-rules {
|
|
71
|
-
list-style: none;
|
|
72
|
-
padding: 0;
|
|
73
|
-
margin: 0;
|
|
74
|
-
display: flex;
|
|
75
|
-
flex-direction: column;
|
|
76
|
-
gap: var(--spacing-padding-2, 8px);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.auth-signup-password-rule {
|
|
80
|
-
display: flex;
|
|
81
|
-
align-items: center;
|
|
82
|
-
gap: var(--spacing-padding-3, 12px);
|
|
83
|
-
color: var(--color-label-assistive);
|
|
84
|
-
|
|
85
|
-
&[data-fulfilled="true"] {
|
|
86
|
-
color: var(--color-label-positive);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.auth-signup-password-rule-indicator {
|
|
91
|
-
width: 8px;
|
|
92
|
-
height: 8px;
|
|
93
|
-
border-radius: 50%;
|
|
94
|
-
background: var(--color-border-default);
|
|
95
|
-
flex-shrink: 0;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.auth-signup-password-rule[data-fulfilled="true"]
|
|
99
|
-
.auth-signup-password-rule-indicator {
|
|
100
|
-
background: var(--color-label-positive);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.auth-signup-password-rule-text {
|
|
104
|
-
font-size: 14px;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.auth-signup-complete {
|
|
108
|
-
display: flex;
|
|
109
|
-
flex-direction: column;
|
|
110
|
-
gap: var(--spacing-padding-7, 28px);
|
|
111
|
-
text-align: center;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.auth-signup-complete-illustration {
|
|
115
|
-
display: flex;
|
|
116
|
-
justify-content: center;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.auth-signup-complete-title {
|
|
120
|
-
font-size: 24px;
|
|
121
|
-
font-weight: 700;
|
|
122
|
-
color: var(--color-label-standard);
|
|
123
|
-
margin: 0;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.auth-signup-complete-description {
|
|
127
|
-
margin: var(--spacing-padding-2, 8px) 0 0;
|
|
128
|
-
color: var(--color-label-assistive);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.auth-signup-complete-actions {
|
|
132
|
-
display: flex;
|
|
133
|
-
flex-direction: column;
|
|
134
|
-
gap: var(--spacing-padding-4, 16px);
|
|
135
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|