@uniai-fe/uds-templates 0.0.10 → 0.0.12
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 +88 -1
- package/dist/styles.css +2051 -2266
- package/package.json +5 -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/index.tsx +1 -7
- package/src/{components/auth → auth}/login/markup/Container.tsx +1 -1
- package/src/{components/auth → auth}/login/markup/FormField.tsx +2 -2
- package/src/{components/auth → auth}/login/types/props.ts +13 -13
- package/src/auth/login/types.ts +2 -0
- package/src/auth/signup/hooks/index.ts +3 -0
- package/src/auth/signup/hooks/useSignupAccountForm.ts +101 -0
- package/src/auth/signup/hooks/useSignupUserInfoForm.ts +88 -0
- package/src/auth/signup/hooks/useSignupVerificationForm.ts +77 -0
- package/src/auth/signup/img/check-agree.svg +3 -0
- package/src/auth/signup/img/chevron-open-detail.svg +3 -0
- package/src/auth/signup/index.ts +27 -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/auth/signup/markup/UserInfoForm.tsx +107 -0
- package/src/auth/signup/markup/VerificationForm.tsx +285 -0
- package/src/auth/signup/markup/index.ts +5 -0
- package/src/auth/signup/styles/signup.scss +187 -0
- package/src/auth/signup/types/hooks.ts +86 -0
- package/src/auth/signup/types/index.ts +2 -0
- package/src/auth/signup/types/props.ts +145 -0
- package/src/auth/signup/utils/composeFieldProps.ts +50 -0
- package/src/auth/signup/utils/getSignupFieldDefaultValue.ts +40 -0
- package/src/index.scss +5 -3
- package/src/index.tsx +3 -2
- package/src/modal/core/components/Container.tsx +41 -0
- package/src/modal/core/components/FooterButtons.tsx +132 -0
- package/src/modal/core/components/Provider.tsx +28 -0
- package/src/modal/core/components/Root.tsx +93 -0
- package/src/modal/core/hooks/useModal.ts +136 -0
- package/src/modal/core/jotai/atoms.ts +10 -0
- package/src/modal/index.scss +4 -0
- package/src/modal/index.tsx +16 -0
- package/src/modal/styles/animations.scss +24 -0
- package/src/modal/styles/base.scss +45 -0
- package/src/modal/styles/container.scss +138 -0
- package/src/modal/styles/dimmer.scss +23 -0
- package/src/modal/templates/Alert.tsx +104 -0
- package/src/modal/templates/Dialog.tsx +112 -0
- package/src/modal/types/footer.ts +36 -0
- package/src/modal/types/index.ts +21 -0
- package/src/modal/types/options.ts +6 -0
- package/src/modal/types/state.ts +31 -0
- package/src/modal/types/templates.ts +32 -0
- 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/login/types.ts +0 -2
- /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/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/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
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
.uds-modal-container {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
width: 100%;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.uds-modal-header,
|
|
8
|
+
.uds-modal-body {
|
|
9
|
+
padding: 0;
|
|
10
|
+
margin: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.uds-modal-footer {
|
|
14
|
+
padding: 0;
|
|
15
|
+
border-top: none;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.uds-modal-footer-buttons {
|
|
19
|
+
display: flex;
|
|
20
|
+
width: 100%;
|
|
21
|
+
gap: var(--spacing-gap-4, 16px);
|
|
22
|
+
padding: var(--spacing-padding-6, 16px);
|
|
23
|
+
align-items: stretch;
|
|
24
|
+
|
|
25
|
+
&[data-count="1"] {
|
|
26
|
+
.uds-modal-footer-button {
|
|
27
|
+
width: 100%;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&[data-count="2"] {
|
|
32
|
+
.uds-modal-footer-button {
|
|
33
|
+
flex: 1 1 0;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&[data-appearance="text"] {
|
|
38
|
+
padding: 0;
|
|
39
|
+
gap: 0;
|
|
40
|
+
min-height: var(--notice-dialog-action-height, 56px);
|
|
41
|
+
border-top: 1px solid
|
|
42
|
+
var(
|
|
43
|
+
--uds-modal-footer-border-color,
|
|
44
|
+
var(
|
|
45
|
+
--dialog-border-color,
|
|
46
|
+
var(--color-border-standard-cool-gray, #e4e5e7)
|
|
47
|
+
)
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
.uds-modal-footer-button {
|
|
51
|
+
border-radius: 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.uds-modal-footer-button + .uds-modal-footer-button {
|
|
55
|
+
border-left: 1px solid
|
|
56
|
+
var(
|
|
57
|
+
--uds-modal-footer-border-color,
|
|
58
|
+
var(
|
|
59
|
+
--dialog-border-color,
|
|
60
|
+
var(--color-border-standard-cool-gray, #e4e5e7)
|
|
61
|
+
)
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.uds-modal-footer-button-solid {
|
|
68
|
+
min-height: 48px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.uds-modal-footer-button-text {
|
|
72
|
+
min-height: 56px;
|
|
73
|
+
justify-content: center;
|
|
74
|
+
border-radius: 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.uds-modal-alert-message {
|
|
78
|
+
padding: var(--spacing-padding-10, 32px) var(--spacing-padding-8, 24px);
|
|
79
|
+
text-align: center;
|
|
80
|
+
color: var(--dialog-body-color);
|
|
81
|
+
word-break: keep-all;
|
|
82
|
+
|
|
83
|
+
> p,
|
|
84
|
+
> span,
|
|
85
|
+
> strong,
|
|
86
|
+
> em {
|
|
87
|
+
margin: 0;
|
|
88
|
+
font-size: var(--dialog-body-font-size);
|
|
89
|
+
line-height: 1.5em;
|
|
90
|
+
font-weight: var(--font-body-small-weight, 400);
|
|
91
|
+
word-break: inherit;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
> * + * {
|
|
95
|
+
margin-top: var(--spacing-gap-2, 8px);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.uds-modal-dialog-header,
|
|
100
|
+
.uds-modal-dialog-body {
|
|
101
|
+
padding: 0;
|
|
102
|
+
margin: 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.uds-modal-dialog-header-content {
|
|
106
|
+
padding: var(--spacing-padding-7, 20px) var(--spacing-padding-6, 16px);
|
|
107
|
+
text-align: center;
|
|
108
|
+
|
|
109
|
+
> h3 {
|
|
110
|
+
margin: 0;
|
|
111
|
+
color: var(--dialog-title-color);
|
|
112
|
+
font-size: var(--dialog-title-font-size);
|
|
113
|
+
line-height: var(--dialog-title-line-height);
|
|
114
|
+
font-weight: var(--dialog-title-weight);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.uds-modal-dialog-body-content {
|
|
119
|
+
padding: var(--spacing-padding-7, 20px) var(--spacing-padding-6, 16px);
|
|
120
|
+
text-align: center;
|
|
121
|
+
color: var(--dialog-body-color);
|
|
122
|
+
word-break: keep-all;
|
|
123
|
+
|
|
124
|
+
> p,
|
|
125
|
+
> span,
|
|
126
|
+
> strong,
|
|
127
|
+
> em {
|
|
128
|
+
margin: 0;
|
|
129
|
+
font-size: var(--dialog-body-font-size);
|
|
130
|
+
line-height: 1.5em;
|
|
131
|
+
font-weight: var(--font-body-small-weight, 400);
|
|
132
|
+
word-break: inherit;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
> * + * {
|
|
136
|
+
margin-top: var(--spacing-gap-2, 8px);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.uds-modal-root {
|
|
2
|
+
&[data-state="init"],
|
|
3
|
+
&[data-state="open"] {
|
|
4
|
+
pointer-events: auto;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
&[data-state="closed"] {
|
|
8
|
+
pointer-events: none;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.uds-modal-dimmer {
|
|
13
|
+
opacity: 0;
|
|
14
|
+
transition: opacity 0.2s ease;
|
|
15
|
+
|
|
16
|
+
.uds-modal-root[data-state="open"] & {
|
|
17
|
+
opacity: 1;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.uds-modal-root[data-state="closed"] & {
|
|
21
|
+
opacity: 0;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
AlertTemplateOptions,
|
|
5
|
+
ModalFooterButton,
|
|
6
|
+
ModalState,
|
|
7
|
+
ModalTemplateButtonSpec,
|
|
8
|
+
} from "../types";
|
|
9
|
+
|
|
10
|
+
const DEFAULT_CONFIRM_LABEL = "확인";
|
|
11
|
+
const DEFAULT_CANCEL_LABEL = "취소";
|
|
12
|
+
|
|
13
|
+
function AlertBody({ message }: { message: AlertTemplateOptions["message"] }) {
|
|
14
|
+
return (
|
|
15
|
+
<div className="uds-modal-alert-message">
|
|
16
|
+
{typeof message === "string" ? <p>{message}</p> : message}
|
|
17
|
+
</div>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const createAlertFooterButtons = ({
|
|
22
|
+
stackKey,
|
|
23
|
+
primary,
|
|
24
|
+
cancel,
|
|
25
|
+
}: {
|
|
26
|
+
stackKey: string;
|
|
27
|
+
primary: ModalTemplateButtonSpec;
|
|
28
|
+
cancel?: ModalTemplateButtonSpec;
|
|
29
|
+
}): ModalFooterButton[] => {
|
|
30
|
+
const buttons: ModalFooterButton[] = [];
|
|
31
|
+
|
|
32
|
+
if (cancel) {
|
|
33
|
+
// cancel 버튼은 저강조 텍스트 버튼 규격을 고정해 디자인 일관성을 맞춘다.
|
|
34
|
+
buttons.push({
|
|
35
|
+
stackKey,
|
|
36
|
+
role: "close",
|
|
37
|
+
defaultOptions: {
|
|
38
|
+
label: cancel.label ?? DEFAULT_CANCEL_LABEL,
|
|
39
|
+
appearance: "text",
|
|
40
|
+
priority: "tertiary",
|
|
41
|
+
textSize: "large",
|
|
42
|
+
disabled: cancel.disabled,
|
|
43
|
+
onClick: cancel.onClick,
|
|
44
|
+
},
|
|
45
|
+
closeOnClick: cancel.closeOnClick,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// confirm 버튼은 고강조 텍스트 버튼으로 구성한다.
|
|
50
|
+
buttons.push({
|
|
51
|
+
stackKey,
|
|
52
|
+
role: "close",
|
|
53
|
+
defaultOptions: {
|
|
54
|
+
label: primary.label ?? DEFAULT_CONFIRM_LABEL,
|
|
55
|
+
appearance: "text",
|
|
56
|
+
priority: "secondary",
|
|
57
|
+
textSize: "large",
|
|
58
|
+
disabled: primary.disabled,
|
|
59
|
+
onClick: primary.onClick,
|
|
60
|
+
},
|
|
61
|
+
closeOnClick: primary.closeOnClick,
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
return buttons;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Alert 템플릿 모달 상태 생성.
|
|
69
|
+
* @component
|
|
70
|
+
* @param {AlertTemplateOptions} options Alert 모달 옵션
|
|
71
|
+
* @param {string} options.stackKey 모달 스택 키
|
|
72
|
+
* @param {React.ReactNode} options.message 본문 메시지
|
|
73
|
+
* @param {ModalTemplateButtonSpec} [options.confirm] 확인 버튼 스펙
|
|
74
|
+
* @param {ModalTemplateButtonSpec} [options.cancel] 취소 버튼 스펙
|
|
75
|
+
* @param {React.ReactNode} [options.footer] 완전 커스텀 footer
|
|
76
|
+
* @param {number} [options.showDelay] close 후 제거 지연(ms)
|
|
77
|
+
* @returns {ModalState}
|
|
78
|
+
*/
|
|
79
|
+
export function createAlertModal({
|
|
80
|
+
stackKey,
|
|
81
|
+
message,
|
|
82
|
+
confirm,
|
|
83
|
+
cancel,
|
|
84
|
+
footer,
|
|
85
|
+
showDelay,
|
|
86
|
+
}: AlertTemplateOptions): ModalState {
|
|
87
|
+
const primary: ModalTemplateButtonSpec = confirm ?? {
|
|
88
|
+
label: DEFAULT_CONFIRM_LABEL,
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
return {
|
|
92
|
+
stackKey,
|
|
93
|
+
modalProps: {
|
|
94
|
+
show: "init",
|
|
95
|
+
showDelay,
|
|
96
|
+
body: <AlertBody message={message} />,
|
|
97
|
+
footer,
|
|
98
|
+
footerButtons:
|
|
99
|
+
footer || !primary
|
|
100
|
+
? undefined
|
|
101
|
+
: createAlertFooterButtons({ stackKey, primary, cancel }),
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
DialogTemplateOptions,
|
|
5
|
+
ModalFooterButton,
|
|
6
|
+
ModalState,
|
|
7
|
+
ModalTemplateButtonSpec,
|
|
8
|
+
} from "../types";
|
|
9
|
+
|
|
10
|
+
const DEFAULT_DIALOG_CONFIRM = "확인";
|
|
11
|
+
const DEFAULT_DIALOG_CANCEL = "취소";
|
|
12
|
+
|
|
13
|
+
function DialogHeader({ title }: { title?: DialogTemplateOptions["title"] }) {
|
|
14
|
+
if (!title) return null;
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<div className="uds-modal-dialog-header">
|
|
18
|
+
<div className="uds-modal-dialog-header-content">
|
|
19
|
+
{typeof title === "string" ? <h3>{title}</h3> : title}
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function DialogBody({
|
|
26
|
+
content,
|
|
27
|
+
}: {
|
|
28
|
+
content: DialogTemplateOptions["content"];
|
|
29
|
+
}) {
|
|
30
|
+
return (
|
|
31
|
+
<div className="uds-modal-dialog-body">
|
|
32
|
+
<div className="uds-modal-dialog-body-content">
|
|
33
|
+
{typeof content === "string" ? <p>{content}</p> : content}
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Dialog 템플릿 모달 상태 생성.
|
|
41
|
+
* @component
|
|
42
|
+
* @param {DialogTemplateOptions} options Dialog 모달 옵션
|
|
43
|
+
* @param {string} options.stackKey 모달 스택 키
|
|
44
|
+
* @param {React.ReactNode} [options.title] 헤더 타이틀
|
|
45
|
+
* @param {React.ReactNode} options.content 본문 컨텐츠
|
|
46
|
+
* @param {ModalTemplateButtonSpec} [options.confirm] 확인 버튼 스펙
|
|
47
|
+
* @param {ModalTemplateButtonSpec} [options.cancel] 취소 버튼 스펙
|
|
48
|
+
* @param {React.ReactNode} [options.footer] 커스텀 footer
|
|
49
|
+
* @param {number} [options.showDelay] close 후 제거 지연(ms)
|
|
50
|
+
* @returns {ModalState}
|
|
51
|
+
*/
|
|
52
|
+
export function createDialogModal({
|
|
53
|
+
stackKey,
|
|
54
|
+
title,
|
|
55
|
+
content,
|
|
56
|
+
confirm,
|
|
57
|
+
cancel,
|
|
58
|
+
footer,
|
|
59
|
+
showDelay,
|
|
60
|
+
}: DialogTemplateOptions): ModalState {
|
|
61
|
+
const primary: ModalTemplateButtonSpec = confirm ?? {
|
|
62
|
+
label: DEFAULT_DIALOG_CONFIRM,
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const footerButtons: ModalFooterButton[] =
|
|
66
|
+
primary && !footer
|
|
67
|
+
? [
|
|
68
|
+
...(cancel
|
|
69
|
+
? [
|
|
70
|
+
{
|
|
71
|
+
stackKey,
|
|
72
|
+
role: "close",
|
|
73
|
+
// cancel 버튼은 secondary solid 규격으로 일관된 스킨을 유지한다.
|
|
74
|
+
defaultOptions: {
|
|
75
|
+
label: cancel.label ?? DEFAULT_DIALOG_CANCEL,
|
|
76
|
+
scale: "solid-large",
|
|
77
|
+
priority: "secondary",
|
|
78
|
+
disabled: cancel.disabled,
|
|
79
|
+
onClick: cancel.onClick,
|
|
80
|
+
},
|
|
81
|
+
closeOnClick: cancel.closeOnClick,
|
|
82
|
+
} as ModalFooterButton,
|
|
83
|
+
]
|
|
84
|
+
: []),
|
|
85
|
+
{
|
|
86
|
+
stackKey,
|
|
87
|
+
role: "close",
|
|
88
|
+
// confirm 버튼은 primary solid 규격으로 고정한다.
|
|
89
|
+
defaultOptions: {
|
|
90
|
+
label: primary.label ?? DEFAULT_DIALOG_CONFIRM,
|
|
91
|
+
scale: "solid-large",
|
|
92
|
+
priority: "primary",
|
|
93
|
+
disabled: primary.disabled,
|
|
94
|
+
onClick: primary.onClick,
|
|
95
|
+
},
|
|
96
|
+
closeOnClick: primary.closeOnClick,
|
|
97
|
+
},
|
|
98
|
+
]
|
|
99
|
+
: [];
|
|
100
|
+
|
|
101
|
+
return {
|
|
102
|
+
stackKey,
|
|
103
|
+
modalProps: {
|
|
104
|
+
show: "init",
|
|
105
|
+
showDelay,
|
|
106
|
+
header: <DialogHeader title={title} />,
|
|
107
|
+
body: <DialogBody content={content} />,
|
|
108
|
+
footer,
|
|
109
|
+
footerButtons: footerButtons.length ? footerButtons : undefined,
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type {
|
|
3
|
+
ButtonPriority,
|
|
4
|
+
ButtonScale,
|
|
5
|
+
TextButtonSize,
|
|
6
|
+
} from "@uniai-fe/uds-primitives";
|
|
7
|
+
|
|
8
|
+
import type { ModalStackKey } from "./state";
|
|
9
|
+
|
|
10
|
+
export type ModalFooterButtonAppearance = "default" | "text";
|
|
11
|
+
|
|
12
|
+
export type ModalFooterButtonDefaultOptions = {
|
|
13
|
+
label: ReactNode;
|
|
14
|
+
onClick?: () => void;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
block?: boolean;
|
|
17
|
+
priority?: ButtonPriority;
|
|
18
|
+
scale?: ButtonScale;
|
|
19
|
+
textSize?: TextButtonSize;
|
|
20
|
+
appearance?: ModalFooterButtonAppearance;
|
|
21
|
+
className?: string;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type ModalFooterButtonLinkOptions = {
|
|
25
|
+
href: string;
|
|
26
|
+
target?: string;
|
|
27
|
+
rel?: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export type ModalFooterButton = {
|
|
31
|
+
stackKey: ModalStackKey;
|
|
32
|
+
role: "close" | string;
|
|
33
|
+
defaultOptions: ModalFooterButtonDefaultOptions;
|
|
34
|
+
linkOptions?: ModalFooterButtonLinkOptions;
|
|
35
|
+
closeOnClick?: boolean;
|
|
36
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type {
|
|
2
|
+
ModalShowState,
|
|
3
|
+
ModalStackKey,
|
|
4
|
+
ModalSections,
|
|
5
|
+
ModalProps,
|
|
6
|
+
ModalState,
|
|
7
|
+
ModalStatePatch,
|
|
8
|
+
} from "./state";
|
|
9
|
+
export type {
|
|
10
|
+
ModalFooterButton,
|
|
11
|
+
ModalFooterButtonDefaultOptions,
|
|
12
|
+
ModalFooterButtonLinkOptions,
|
|
13
|
+
ModalFooterButtonAppearance,
|
|
14
|
+
} from "./footer";
|
|
15
|
+
export type { ModalCloseRequest } from "./options";
|
|
16
|
+
export type {
|
|
17
|
+
AlertTemplateOptions,
|
|
18
|
+
DialogTemplateOptions,
|
|
19
|
+
ModalTemplateButtonSpec,
|
|
20
|
+
ModalTemplateResult,
|
|
21
|
+
} from "./templates";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
import type { ModalFooterButton } from "./footer";
|
|
4
|
+
|
|
5
|
+
export type ModalShowState = "init" | boolean;
|
|
6
|
+
|
|
7
|
+
export type ModalStackKey = string;
|
|
8
|
+
|
|
9
|
+
export type ModalSections = {
|
|
10
|
+
header?: ReactNode;
|
|
11
|
+
body: ReactNode;
|
|
12
|
+
footer?: ReactNode;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type ModalProps = ModalSections & {
|
|
16
|
+
show: ModalShowState;
|
|
17
|
+
showDelay?: number;
|
|
18
|
+
footerButtons?: ModalFooterButton[];
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type ModalState = {
|
|
22
|
+
stackKey: ModalStackKey;
|
|
23
|
+
modalProps: ModalProps;
|
|
24
|
+
className?: string;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type ModalStatePatch = {
|
|
28
|
+
stackKey: ModalStackKey;
|
|
29
|
+
modalProps?: Partial<ModalProps>;
|
|
30
|
+
className?: string;
|
|
31
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
import type { ModalState, ModalStackKey } from "./state";
|
|
4
|
+
|
|
5
|
+
export type ModalTemplateButtonSpec = {
|
|
6
|
+
label?: ReactNode;
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
closeOnClick?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
type ModalTemplateBase = {
|
|
13
|
+
stackKey: ModalStackKey;
|
|
14
|
+
showDelay?: number;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type AlertTemplateOptions = ModalTemplateBase & {
|
|
18
|
+
message: ReactNode;
|
|
19
|
+
confirm?: ModalTemplateButtonSpec;
|
|
20
|
+
cancel?: ModalTemplateButtonSpec;
|
|
21
|
+
footer?: ReactNode;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type DialogTemplateOptions = ModalTemplateBase & {
|
|
25
|
+
title?: ReactNode;
|
|
26
|
+
content: ReactNode;
|
|
27
|
+
confirm?: ModalTemplateButtonSpec;
|
|
28
|
+
cancel?: ModalTemplateButtonSpec;
|
|
29
|
+
footer?: ReactNode;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type ModalTemplateResult = ModalState;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
import "./page-frame-mobile-header.scss";
|
|
5
|
+
|
|
6
|
+
export interface PageFrameMobileHeaderProps {
|
|
7
|
+
className?: string;
|
|
8
|
+
title: ReactNode;
|
|
9
|
+
backIcon?: ReactNode;
|
|
10
|
+
onBack?: () => void;
|
|
11
|
+
leftSlot?: ReactNode;
|
|
12
|
+
rightSlot?: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 모바일 서비스 공통 page header; 뒤로가기 버튼 + 타이틀을 노출한다.
|
|
17
|
+
* @component
|
|
18
|
+
*/
|
|
19
|
+
export function PageFrameMobileHeader({
|
|
20
|
+
className,
|
|
21
|
+
title,
|
|
22
|
+
backIcon,
|
|
23
|
+
onBack,
|
|
24
|
+
leftSlot,
|
|
25
|
+
rightSlot,
|
|
26
|
+
}: PageFrameMobileHeaderProps) {
|
|
27
|
+
return (
|
|
28
|
+
<div className={clsx("page-frame-mobile-header", className)}>
|
|
29
|
+
<span className="page-frame-mobile-header__left">
|
|
30
|
+
{leftSlot ??
|
|
31
|
+
(onBack ? (
|
|
32
|
+
<button
|
|
33
|
+
type="button"
|
|
34
|
+
className="page-frame-mobile-header__back"
|
|
35
|
+
onClick={onBack}
|
|
36
|
+
aria-label="뒤로가기"
|
|
37
|
+
>
|
|
38
|
+
<span className="page-frame-mobile-header__back-icon">
|
|
39
|
+
{backIcon ?? "←"}
|
|
40
|
+
</span>
|
|
41
|
+
</button>
|
|
42
|
+
) : (
|
|
43
|
+
<span className="page-frame-mobile-header__back-placeholder" />
|
|
44
|
+
))}
|
|
45
|
+
</span>
|
|
46
|
+
<p className="page-frame-mobile-header__title">{title}</p>
|
|
47
|
+
<span className="page-frame-mobile-header__right">
|
|
48
|
+
{rightSlot ?? null}
|
|
49
|
+
</span>
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
.page-frame-mobile-header {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: space-between;
|
|
6
|
+
gap: var(--spacing-padding-2, 8px);
|
|
7
|
+
min-height: 40px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.page-frame-mobile-header__left,
|
|
11
|
+
.page-frame-mobile-header__right {
|
|
12
|
+
width: 64px;
|
|
13
|
+
height: 40px;
|
|
14
|
+
display: inline-flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.page-frame-mobile-header__back {
|
|
19
|
+
border: none;
|
|
20
|
+
background: none;
|
|
21
|
+
display: inline-flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
gap: var(--spacing-padding-1, 4px);
|
|
24
|
+
padding: var(--spacing-padding-1, 4px);
|
|
25
|
+
font-size: 14px;
|
|
26
|
+
color: var(--color-label-standard);
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.page-frame-mobile-header__back-icon {
|
|
31
|
+
font-size: 18px;
|
|
32
|
+
line-height: 1;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.page-frame-mobile-header__back-placeholder {
|
|
36
|
+
width: 100%;
|
|
37
|
+
height: 100%;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.page-frame-mobile-header__title {
|
|
41
|
+
position: absolute;
|
|
42
|
+
left: 50%;
|
|
43
|
+
transform: translateX(-50%);
|
|
44
|
+
margin: 0;
|
|
45
|
+
font-size: 16px;
|
|
46
|
+
font-weight: 600;
|
|
47
|
+
color: var(--color-label-standard);
|
|
48
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M15.5655 19.4341L8.13126 11.9998L15.5655 4.56554C15.878 4.25312 15.878 3.74686 15.5655 3.43444C15.2531 3.12202 14.7469 3.12202 14.4345 3.43444L6.43462 11.4343C6.1222 11.7467 6.1222 12.253 6.43461 12.5654L14.4345 20.5652C14.7469 20.8776 15.2531 20.8776 15.5655 20.5652C15.8778 20.2528 15.8779 19.7465 15.5655 19.4341Z" fill="#313235"/>
|
|
3
|
+
</svg>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import "./login/index.scss";
|
|
2
|
-
|
|
3
|
-
import { AuthContainer } from "./container";
|
|
4
|
-
import { AuthLogin } from "./login";
|
|
5
|
-
|
|
6
|
-
export const Auth = {
|
|
7
|
-
Container: AuthContainer,
|
|
8
|
-
Login: AuthLogin,
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export type {
|
|
12
|
-
AuthLoginProps,
|
|
13
|
-
AuthLoginFieldOptions,
|
|
14
|
-
AuthLoginFieldConfig,
|
|
15
|
-
AuthLoginFields,
|
|
16
|
-
AuthLoginLinkOptions,
|
|
17
|
-
AuthLoginFormValues,
|
|
18
|
-
UseAuthLoginFormOptions,
|
|
19
|
-
UseAuthLoginFormReturn,
|
|
20
|
-
} from "./login";
|
|
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
|