@tipp/ui 2.3.2 → 2.3.4
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/dist/app/index.cjs +4 -2
- package/dist/app/index.cjs.map +1 -1
- package/dist/app/index.js +30 -30
- package/dist/app/platform/coach-question-list.cjs.map +1 -1
- package/dist/app/platform/coach-question-list.js +1 -1
- package/dist/app/platform/contents-card.cjs.map +1 -1
- package/dist/app/platform/contents-card.js +1 -1
- package/dist/app/platform/edit-coaching-time.cjs +4 -2
- package/dist/app/platform/edit-coaching-time.cjs.map +1 -1
- package/dist/app/platform/edit-coaching-time.js +24 -24
- package/dist/app/platform/edit-service-type.cjs +4 -2
- package/dist/app/platform/edit-service-type.cjs.map +1 -1
- package/dist/app/platform/edit-service-type.js +24 -24
- package/dist/app/platform/goal-manage-card-edit.cjs.map +1 -1
- package/dist/app/platform/goal-manage-card-edit.js +23 -23
- package/dist/app/platform/goal-manage-card-read.cjs.map +1 -1
- package/dist/app/platform/goal-manage-card-read.js +1 -1
- package/dist/app/platform/on-offline-radio-card.cjs.map +1 -1
- package/dist/app/platform/on-offline-radio-card.js +23 -23
- package/dist/app/platform/report-card.cjs.map +1 -1
- package/dist/app/platform/report-card.js +1 -1
- package/dist/app/platform/reservation-card.cjs.map +1 -1
- package/dist/app/platform/reservation-card.js +23 -23
- package/dist/app/platform/session-card.cjs +4 -2
- package/dist/app/platform/session-card.cjs.map +1 -1
- package/dist/app/platform/session-card.js +26 -26
- package/dist/app/platform/session-review-simple-read.cjs.map +1 -1
- package/dist/app/platform/session-review-simple-read.js +1 -1
- package/dist/app/platform/userInfos/coaching-customer-info/index.cjs.map +1 -1
- package/dist/app/platform/userInfos/coaching-customer-info/index.js +5 -5
- package/dist/app/platform/userInfos/coaching-customer-info/large.cjs.map +1 -1
- package/dist/app/platform/userInfos/coaching-customer-info/large.js +1 -1
- package/dist/app/platform/userInfos/coaching-customer-info/medium.cjs.map +1 -1
- package/dist/app/platform/userInfos/coaching-customer-info/medium.js +1 -1
- package/dist/app/platform/userInfos/coaching-customer-info/small.cjs.map +1 -1
- package/dist/app/platform/userInfos/coaching-customer-info/small.js +1 -1
- package/dist/app/platform/userInfos/session-user-info-detail.cjs.map +1 -1
- package/dist/app/platform/userInfos/session-user-info-detail.js +1 -1
- package/dist/app/platform/userInfos/utils.cjs.map +1 -1
- package/dist/app/platform/userInfos/utils.js +1 -1
- package/dist/atoms/dialog.cjs +4 -2
- package/dist/atoms/dialog.cjs.map +1 -1
- package/dist/atoms/dialog.d.cts +1 -0
- package/dist/atoms/dialog.d.ts +1 -0
- package/dist/atoms/dialog.js +1 -1
- package/dist/atoms/index.cjs +4 -2
- package/dist/atoms/index.cjs.map +1 -1
- package/dist/atoms/index.js +1 -1
- package/dist/chunk-2MYKSCKP.js +99 -0
- package/dist/chunk-2MYKSCKP.js.map +1 -0
- package/dist/chunk-2ZAUZRYP.js +51 -0
- package/dist/chunk-2ZAUZRYP.js.map +1 -0
- package/dist/chunk-36DXOR67.js +68 -0
- package/dist/chunk-36DXOR67.js.map +1 -0
- package/dist/chunk-3I3IHASZ.js +64 -0
- package/dist/chunk-3I3IHASZ.js.map +1 -0
- package/dist/chunk-3UB5MADH.js +63 -0
- package/dist/chunk-3UB5MADH.js.map +1 -0
- package/dist/chunk-3XVQJ43L.js +69 -0
- package/dist/chunk-3XVQJ43L.js.map +1 -0
- package/dist/chunk-4BRN5AXJ.js +64 -0
- package/dist/chunk-4BRN5AXJ.js.map +1 -0
- package/dist/chunk-4H6OYVRA.js +64 -0
- package/dist/chunk-4H6OYVRA.js.map +1 -0
- package/dist/chunk-4N23WOT7.js +144 -0
- package/dist/chunk-4N23WOT7.js.map +1 -0
- package/dist/chunk-4WJF7WXY.js +192 -0
- package/dist/chunk-4WJF7WXY.js.map +1 -0
- package/dist/chunk-5773MYBI.js +89 -0
- package/dist/chunk-5773MYBI.js.map +1 -0
- package/dist/chunk-65ZUDFPR.js +117 -0
- package/dist/chunk-65ZUDFPR.js.map +1 -0
- package/dist/chunk-6GAZ3JJT.js +144 -0
- package/dist/chunk-6GAZ3JJT.js.map +1 -0
- package/dist/chunk-6K4VIQTT.js +54 -0
- package/dist/chunk-6K4VIQTT.js.map +1 -0
- package/dist/chunk-7BLUAQBV.js +233 -0
- package/dist/chunk-7BLUAQBV.js.map +1 -0
- package/dist/chunk-7IBUQ5XL.js +363 -0
- package/dist/chunk-7IBUQ5XL.js.map +1 -0
- package/dist/chunk-7Y6S4473.js +69 -0
- package/dist/chunk-7Y6S4473.js.map +1 -0
- package/dist/chunk-AGDS5FTY.js +30 -0
- package/dist/chunk-AGDS5FTY.js.map +1 -0
- package/dist/chunk-AH4A53SZ.js +137 -0
- package/dist/chunk-AH4A53SZ.js.map +1 -0
- package/dist/chunk-B5CCM56M.js +135 -0
- package/dist/chunk-B5CCM56M.js.map +1 -0
- package/dist/chunk-B6A7IIYJ.js +70 -0
- package/dist/chunk-B6A7IIYJ.js.map +1 -0
- package/dist/chunk-CLFON5AH.js +87 -0
- package/dist/chunk-CLFON5AH.js.map +1 -0
- package/dist/chunk-CMBTJWVJ.js +69 -0
- package/dist/chunk-CMBTJWVJ.js.map +1 -0
- package/dist/chunk-CMQRNBLB.js +54 -0
- package/dist/chunk-CMQRNBLB.js.map +1 -0
- package/dist/chunk-CMSM5Z5E.js +137 -0
- package/dist/chunk-CMSM5Z5E.js.map +1 -0
- package/dist/chunk-CWHY67LR.js +174 -0
- package/dist/chunk-CWHY67LR.js.map +1 -0
- package/dist/chunk-D6BUWYJI.js +54 -0
- package/dist/chunk-D6BUWYJI.js.map +1 -0
- package/dist/chunk-DCAW5B6B.js +64 -0
- package/dist/chunk-DCAW5B6B.js.map +1 -0
- package/dist/chunk-DGXKSYZ2.js +144 -0
- package/dist/chunk-DGXKSYZ2.js.map +1 -0
- package/dist/chunk-DW25XNLO.js +174 -0
- package/dist/chunk-DW25XNLO.js.map +1 -0
- package/dist/chunk-E5A6QALE.js +196 -0
- package/dist/chunk-E5A6QALE.js.map +1 -0
- package/dist/chunk-ECMGWPU5.js +174 -0
- package/dist/chunk-ECMGWPU5.js.map +1 -0
- package/dist/chunk-FD6QZZQY.js +69 -0
- package/dist/chunk-FD6QZZQY.js.map +1 -0
- package/dist/chunk-FQFLQN6Y.js +63 -0
- package/dist/chunk-FQFLQN6Y.js.map +1 -0
- package/dist/chunk-FT27KFX7.js +145 -0
- package/dist/chunk-FT27KFX7.js.map +1 -0
- package/dist/chunk-G6RTTIKB.js +64 -0
- package/dist/chunk-G6RTTIKB.js.map +1 -0
- package/dist/chunk-GNB7DD7J.js +196 -0
- package/dist/chunk-GNB7DD7J.js.map +1 -0
- package/dist/chunk-GXEWC3QS.js +196 -0
- package/dist/chunk-GXEWC3QS.js.map +1 -0
- package/dist/chunk-HLLWOJOK.js +174 -0
- package/dist/chunk-HLLWOJOK.js.map +1 -0
- package/dist/chunk-JI3K6VKE.js +144 -0
- package/dist/chunk-JI3K6VKE.js.map +1 -0
- package/dist/chunk-JQ7VQ5SB.js +137 -0
- package/dist/chunk-JQ7VQ5SB.js.map +1 -0
- package/dist/chunk-K2ATYWTQ.js +54 -0
- package/dist/chunk-K2ATYWTQ.js.map +1 -0
- package/dist/chunk-KFICWJI6.js +61 -0
- package/dist/chunk-KFICWJI6.js.map +1 -0
- package/dist/chunk-KJBSLION.js +174 -0
- package/dist/chunk-KJBSLION.js.map +1 -0
- package/dist/chunk-KLCL7FKY.js +196 -0
- package/dist/chunk-KLCL7FKY.js.map +1 -0
- package/dist/chunk-KO6ZM4XB.js +37 -0
- package/dist/chunk-KO6ZM4XB.js.map +1 -0
- package/dist/chunk-L6ZQX7HU.js +64 -0
- package/dist/chunk-L6ZQX7HU.js.map +1 -0
- package/dist/chunk-LNRB4XMK.js +87 -0
- package/dist/chunk-LNRB4XMK.js.map +1 -0
- package/dist/chunk-LVICE2MV.js +228 -0
- package/dist/chunk-LVICE2MV.js.map +1 -0
- package/dist/chunk-LWLKHIDE.js +51 -0
- package/dist/chunk-LWLKHIDE.js.map +1 -0
- package/dist/chunk-MBMREYHZ.js +174 -0
- package/dist/chunk-MBMREYHZ.js.map +1 -0
- package/dist/chunk-N5WK2MYE.js +64 -0
- package/dist/chunk-N5WK2MYE.js.map +1 -0
- package/dist/chunk-NIOXLMGY.js +64 -0
- package/dist/chunk-NIOXLMGY.js.map +1 -0
- package/dist/chunk-NQ6NKF3F.js +165 -0
- package/dist/chunk-NQ6NKF3F.js.map +1 -0
- package/dist/chunk-O66FI27Q.js +63 -0
- package/dist/chunk-O66FI27Q.js.map +1 -0
- package/dist/chunk-OB3C3JOM.js +144 -0
- package/dist/chunk-OB3C3JOM.js.map +1 -0
- package/dist/chunk-OQDPY5RB.js +137 -0
- package/dist/chunk-OQDPY5RB.js.map +1 -0
- package/dist/chunk-ORQ4NCWG.js +63 -0
- package/dist/chunk-ORQ4NCWG.js.map +1 -0
- package/dist/chunk-PAM3ZEFI.js +144 -0
- package/dist/chunk-PAM3ZEFI.js.map +1 -0
- package/dist/chunk-PCW3YU6E.js +196 -0
- package/dist/chunk-PCW3YU6E.js.map +1 -0
- package/dist/chunk-Q5Z4EHPC.js +169 -0
- package/dist/chunk-Q5Z4EHPC.js.map +1 -0
- package/dist/chunk-QB73IVKI.js +43 -0
- package/dist/chunk-QB73IVKI.js.map +1 -0
- package/dist/chunk-QGGG4IDX.js +196 -0
- package/dist/chunk-QGGG4IDX.js.map +1 -0
- package/dist/chunk-QPRH6W7T.js +196 -0
- package/dist/chunk-QPRH6W7T.js.map +1 -0
- package/dist/chunk-QRQYMO45.js +196 -0
- package/dist/chunk-QRQYMO45.js.map +1 -0
- package/dist/chunk-RFZPKB5J.js +196 -0
- package/dist/chunk-RFZPKB5J.js.map +1 -0
- package/dist/chunk-RNDGWKZA.js +54 -0
- package/dist/chunk-RNDGWKZA.js.map +1 -0
- package/dist/chunk-RYK2ILB2.js +105 -0
- package/dist/chunk-RYK2ILB2.js.map +1 -0
- package/dist/chunk-SDYFRI7L.js +54 -0
- package/dist/chunk-SDYFRI7L.js.map +1 -0
- package/dist/chunk-SYGLFURC.js +49 -0
- package/dist/chunk-SYGLFURC.js.map +1 -0
- package/dist/chunk-T4O3ONUV.js +64 -0
- package/dist/chunk-T4O3ONUV.js.map +1 -0
- package/dist/chunk-T6BKRGZ7.js +54 -0
- package/dist/chunk-T6BKRGZ7.js.map +1 -0
- package/dist/chunk-TAYCJ2P3.js +145 -0
- package/dist/chunk-TAYCJ2P3.js.map +1 -0
- package/dist/chunk-UCBF57MG.js +196 -0
- package/dist/chunk-UCBF57MG.js.map +1 -0
- package/dist/chunk-UE5S4ECH.js +137 -0
- package/dist/chunk-UE5S4ECH.js.map +1 -0
- package/dist/chunk-UHLHNMKL.js +135 -0
- package/dist/chunk-UHLHNMKL.js.map +1 -0
- package/dist/chunk-UIY4HDKD.js +144 -0
- package/dist/chunk-UIY4HDKD.js.map +1 -0
- package/dist/chunk-UWM72J67.js +151 -0
- package/dist/chunk-UWM72J67.js.map +1 -0
- package/dist/chunk-VG2DMJ2U.js +125 -0
- package/dist/chunk-VG2DMJ2U.js.map +1 -0
- package/dist/chunk-VGNQAHMB.js +79 -0
- package/dist/chunk-VGNQAHMB.js.map +1 -0
- package/dist/chunk-VH2ZMFTB.js +64 -0
- package/dist/chunk-VH2ZMFTB.js.map +1 -0
- package/dist/chunk-VIKHKUHF.js +89 -0
- package/dist/chunk-VIKHKUHF.js.map +1 -0
- package/dist/chunk-VIPNTIPC.js +174 -0
- package/dist/chunk-VIPNTIPC.js.map +1 -0
- package/dist/chunk-W6LDMZNY.js +29 -0
- package/dist/chunk-W6LDMZNY.js.map +1 -0
- package/dist/chunk-WPRRJQOM.js +61 -0
- package/dist/chunk-WPRRJQOM.js.map +1 -0
- package/dist/chunk-WZRGAW43.js +100 -0
- package/dist/chunk-WZRGAW43.js.map +1 -0
- package/dist/chunk-XBNMZOEU.js +144 -0
- package/dist/chunk-XBNMZOEU.js.map +1 -0
- package/dist/chunk-XCYDDU5Y.js +174 -0
- package/dist/chunk-XCYDDU5Y.js.map +1 -0
- package/dist/chunk-XLTMDAE3.js +75 -0
- package/dist/chunk-XLTMDAE3.js.map +1 -0
- package/dist/chunk-XQXNWDM7.js +144 -0
- package/dist/chunk-XQXNWDM7.js.map +1 -0
- package/dist/chunk-YZ7LP3PU.js +101 -0
- package/dist/chunk-YZ7LP3PU.js.map +1 -0
- package/dist/chunk-Z7ZJWOOJ.js +89 -0
- package/dist/chunk-Z7ZJWOOJ.js.map +1 -0
- package/dist/chunk-ZJNWNMA4.js +54 -0
- package/dist/chunk-ZJNWNMA4.js.map +1 -0
- package/dist/chunk-ZLIUPGUQ.js +89 -0
- package/dist/chunk-ZLIUPGUQ.js.map +1 -0
- package/dist/chunk-ZOJRVTUA.js +174 -0
- package/dist/chunk-ZOJRVTUA.js.map +1 -0
- package/dist/index.cjs +4 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +42 -42
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/index.js +5 -5
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-body.js +2 -2
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/index.js +7 -7
- package/dist/molecules/curriculumV2/CurriculumContents/curriculum-review.cjs +4 -2
- package/dist/molecules/curriculumV2/CurriculumContents/curriculum-review.cjs.map +1 -1
- package/dist/molecules/curriculumV2/CurriculumContents/curriculum-review.js +9 -9
- package/dist/molecules/curriculumV2/CurriculumContents/index.cjs +4 -2
- package/dist/molecules/curriculumV2/CurriculumContents/index.cjs.map +1 -1
- package/dist/molecules/curriculumV2/CurriculumContents/index.js +11 -11
- package/dist/molecules/curriculumV2/CurriculumSidebar/index.js +3 -3
- package/dist/molecules/curriculumV2/CurriculumSidebar/sidebar-item.js +2 -2
- package/dist/molecules/curriculumV2/index.cjs +4 -2
- package/dist/molecules/curriculumV2/index.cjs.map +1 -1
- package/dist/molecules/curriculumV2/index.js +19 -19
- package/dist/molecules/index.cjs +4 -2
- package/dist/molecules/index.cjs.map +1 -1
- package/dist/molecules/index.js +35 -35
- package/package.json +1 -1
- package/src/atoms/dialog.tsx +4 -2
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Heading
|
|
3
|
+
} from "./chunk-BESTU2AY.js";
|
|
4
|
+
import {
|
|
5
|
+
usePortalContainer
|
|
6
|
+
} from "./chunk-U7N2PWMO.js";
|
|
7
|
+
import {
|
|
8
|
+
IconButton
|
|
9
|
+
} from "./chunk-XK6VEVOK.js";
|
|
10
|
+
import {
|
|
11
|
+
__objRest,
|
|
12
|
+
__spreadProps,
|
|
13
|
+
__spreadValues
|
|
14
|
+
} from "./chunk-CRTRMMJ7.js";
|
|
15
|
+
|
|
16
|
+
// src/atoms/dialog.tsx
|
|
17
|
+
import * as RadixDialog from "@radix-ui/react-dialog";
|
|
18
|
+
import { Cross1Icon } from "@radix-ui/react-icons";
|
|
19
|
+
import { Flex, Theme } from "@radix-ui/themes";
|
|
20
|
+
import { useEffect, useRef } from "react";
|
|
21
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
22
|
+
var preventDefault = (e) => {
|
|
23
|
+
e.preventDefault();
|
|
24
|
+
};
|
|
25
|
+
function Content2(props) {
|
|
26
|
+
const _a = props, {
|
|
27
|
+
children,
|
|
28
|
+
style = {},
|
|
29
|
+
width,
|
|
30
|
+
maxWidth,
|
|
31
|
+
minWidth,
|
|
32
|
+
maxHeight,
|
|
33
|
+
height,
|
|
34
|
+
minHeight,
|
|
35
|
+
title,
|
|
36
|
+
buttons,
|
|
37
|
+
hideCloseButton,
|
|
38
|
+
className
|
|
39
|
+
} = _a, rest = __objRest(_a, [
|
|
40
|
+
"children",
|
|
41
|
+
"style",
|
|
42
|
+
"width",
|
|
43
|
+
"maxWidth",
|
|
44
|
+
"minWidth",
|
|
45
|
+
"maxHeight",
|
|
46
|
+
"height",
|
|
47
|
+
"minHeight",
|
|
48
|
+
"title",
|
|
49
|
+
"buttons",
|
|
50
|
+
"hideCloseButton",
|
|
51
|
+
"className"
|
|
52
|
+
]);
|
|
53
|
+
const { dialogContainerRef } = usePortalContainer();
|
|
54
|
+
return /* @__PURE__ */ jsx(RadixDialog.Portal, { container: dialogContainerRef.current, children: /* @__PURE__ */ jsx(Theme, { asChild: true, children: /* @__PURE__ */ jsx(RadixDialog.Overlay, { className: "DialogOverlay", children: /* @__PURE__ */ jsxs(
|
|
55
|
+
RadixDialog.Content,
|
|
56
|
+
__spreadProps(__spreadValues({
|
|
57
|
+
className: `DialogContent ${className || ""} rt-BaseDialogContent`,
|
|
58
|
+
onPointerDownOutside: preventDefault,
|
|
59
|
+
style: __spreadValues({
|
|
60
|
+
width,
|
|
61
|
+
maxWidth,
|
|
62
|
+
minWidth,
|
|
63
|
+
maxHeight,
|
|
64
|
+
height,
|
|
65
|
+
minHeight
|
|
66
|
+
}, style)
|
|
67
|
+
}, rest), {
|
|
68
|
+
children: [
|
|
69
|
+
/* @__PURE__ */ jsxs(Flex, { gap: "2", justify: "between", width: "100%", children: [
|
|
70
|
+
/* @__PURE__ */ jsx(RadixDialog.Title, { asChild: true, children: typeof title === "string" && title !== "" ? /* @__PURE__ */ jsx(Heading, { mb: "2", variant: "heading3", children: title }) : title }),
|
|
71
|
+
!hideCloseButton && /* @__PURE__ */ jsx(RadixDialog.Close, { asChild: true, className: "DialogClose", children: /* @__PURE__ */ jsx(IconButton, { color: "gray", variant: "ghost", children: /* @__PURE__ */ jsx(Cross1Icon, {}) }) })
|
|
72
|
+
] }),
|
|
73
|
+
children,
|
|
74
|
+
buttons ? /* @__PURE__ */ jsx(Flex, { gap: "3", justify: "end", mt: "3", width: "100%", children: buttons }) : null
|
|
75
|
+
]
|
|
76
|
+
})
|
|
77
|
+
) }) }) });
|
|
78
|
+
}
|
|
79
|
+
function Close2(_a) {
|
|
80
|
+
var _b = _a, {
|
|
81
|
+
children
|
|
82
|
+
} = _b, rest = __objRest(_b, [
|
|
83
|
+
"children"
|
|
84
|
+
]);
|
|
85
|
+
return /* @__PURE__ */ jsx(RadixDialog.Close, __spreadProps(__spreadValues({ asChild: true }, rest), { children }));
|
|
86
|
+
}
|
|
87
|
+
function Trigger2(_a) {
|
|
88
|
+
var _b = _a, {
|
|
89
|
+
children
|
|
90
|
+
} = _b, rest = __objRest(_b, [
|
|
91
|
+
"children"
|
|
92
|
+
]);
|
|
93
|
+
return /* @__PURE__ */ jsx(RadixDialog.Trigger, __spreadProps(__spreadValues({ asChild: true }, rest), { children }));
|
|
94
|
+
}
|
|
95
|
+
function Root2(props) {
|
|
96
|
+
const prevOpenRef = useRef(void 0);
|
|
97
|
+
const cleanupExecutedRef = useRef(false);
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
const prevOpen = prevOpenRef.current;
|
|
100
|
+
const currentOpen = props.open;
|
|
101
|
+
if (prevOpen === true && currentOpen === false && !cleanupExecutedRef.current) {
|
|
102
|
+
cleanupExecutedRef.current = true;
|
|
103
|
+
const timer = setTimeout(() => {
|
|
104
|
+
var _a;
|
|
105
|
+
try {
|
|
106
|
+
const activeElement = document.activeElement;
|
|
107
|
+
(_a = activeElement == null ? void 0 : activeElement.blur) == null ? void 0 : _a.call(activeElement);
|
|
108
|
+
document.body.style.pointerEvents = "";
|
|
109
|
+
} catch (e) {
|
|
110
|
+
} finally {
|
|
111
|
+
cleanupExecutedRef.current = false;
|
|
112
|
+
}
|
|
113
|
+
}, 100);
|
|
114
|
+
return () => {
|
|
115
|
+
clearTimeout(timer);
|
|
116
|
+
cleanupExecutedRef.current = false;
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
prevOpenRef.current = currentOpen;
|
|
120
|
+
}, [props.open]);
|
|
121
|
+
return /* @__PURE__ */ jsx(RadixDialog.Root, __spreadValues({}, props));
|
|
122
|
+
}
|
|
123
|
+
var Dialog = {
|
|
124
|
+
Root: Root2,
|
|
125
|
+
Trigger: Trigger2,
|
|
126
|
+
Content: Content2,
|
|
127
|
+
Close: Close2,
|
|
128
|
+
Description: RadixDialog.Description,
|
|
129
|
+
Title: RadixDialog.Title
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export {
|
|
133
|
+
Dialog
|
|
134
|
+
};
|
|
135
|
+
//# sourceMappingURL=chunk-B5CCM56M.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/atoms/dialog.tsx"],"sourcesContent":["import * as RadixDialog from '@radix-ui/react-dialog';\nimport { Cross1Icon } from '@radix-ui/react-icons';\nimport { Flex, Theme } from '@radix-ui/themes';\nimport { useEffect, useRef } from 'react';\nimport { usePortalContainer } from '@/theme/portal-provider';\nimport { Heading } from './heading';\nimport { IconButton } from './icon-button';\n\ntype ContentProps = RadixDialog.DialogContentProps & {\n width?: string;\n maxWidth?: string;\n minWidth?: string;\n height?: string;\n maxHeight?: string;\n minHeight?: string;\n title?: string;\n hideCloseButton?: boolean;\n buttons?: React.ReactNode;\n};\n\nconst preventDefault: RadixDialog.DialogContentProps['onPointerDownOutside'] = (\n e\n) => {\n e.preventDefault();\n};\n\nfunction Content(props: ContentProps): React.ReactNode {\n const {\n children,\n style = {},\n width,\n maxWidth,\n minWidth,\n maxHeight,\n height,\n minHeight,\n title,\n buttons,\n hideCloseButton,\n className,\n ...rest\n } = props;\n const { dialogContainerRef } = usePortalContainer();\n\n return (\n <RadixDialog.Portal container={dialogContainerRef.current}>\n <Theme asChild>\n <RadixDialog.Overlay className=\"DialogOverlay\">\n <RadixDialog.Content\n className={`DialogContent ${className || ''} rt-BaseDialogContent`}\n onPointerDownOutside={preventDefault}\n style={{\n width,\n maxWidth,\n minWidth,\n maxHeight,\n height,\n minHeight,\n ...style,\n }}\n {...rest}\n >\n <Flex gap=\"2\" justify=\"between\" width=\"100%\">\n <RadixDialog.Title asChild>\n {typeof title === 'string' && title !== '' ? (\n <Heading mb=\"2\" variant=\"heading3\">\n {title}\n </Heading>\n ) : (\n title\n )}\n </RadixDialog.Title>\n {!hideCloseButton && (\n <RadixDialog.Close asChild className=\"DialogClose\">\n <IconButton color=\"gray\" variant=\"ghost\">\n <Cross1Icon />\n </IconButton>\n </RadixDialog.Close>\n )}\n </Flex>\n {children}\n {buttons ? (\n <Flex gap=\"3\" justify=\"end\" mt=\"3\" width=\"100%\">\n {buttons}\n </Flex>\n ) : null}\n </RadixDialog.Content>\n </RadixDialog.Overlay>\n </Theme>\n </RadixDialog.Portal>\n );\n}\n\nfunction Close({\n children,\n ...rest\n}: RadixDialog.DialogCloseProps): React.ReactNode {\n return (\n <RadixDialog.Close asChild {...rest}>\n {children}\n </RadixDialog.Close>\n );\n}\n\nfunction Trigger({\n children,\n ...rest\n}: RadixDialog.DialogTriggerProps): React.ReactNode {\n return (\n <RadixDialog.Trigger asChild {...rest}>\n {children}\n </RadixDialog.Trigger>\n );\n}\n\nfunction Root(props: RadixDialog.DialogProps): React.ReactNode {\n const prevOpenRef = useRef<boolean | undefined>(undefined);\n const cleanupExecutedRef = useRef<boolean>(false);\n\n // 모달이 닫힌 후 포커스 복원 및 이벤트 정리\n useEffect(() => {\n const prevOpen = prevOpenRef.current;\n const currentOpen = props.open;\n\n // 모달이 열린 상태에서 닫힌 상태로 변경될 때만 실행\n if (prevOpen === true && currentOpen === false && !cleanupExecutedRef.current) {\n cleanupExecutedRef.current = true;\n \n // 모달이 닫힌 후 약간의 지연을 두고 포커스 복원\n const timer = setTimeout(() => {\n try {\n // 활성 요소에 포커스 복원\n const activeElement = document.activeElement as HTMLElement | null;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- 어떤 dom인지 확실하지 않음\n activeElement?.blur?.();\n\n // body의 pointer-events 복원\n document.body.style.pointerEvents = '';\n } catch {\n // 에러 무시\n } finally {\n cleanupExecutedRef.current = false;\n }\n }, 100);\n\n return () => { \n clearTimeout(timer);\n cleanupExecutedRef.current = false;\n };\n }\n\n // 현재 상태를 이전 상태로 업데이트\n prevOpenRef.current = currentOpen;\n }, [props.open]);\n\n return <RadixDialog.Root {...props} />;\n}\n\nexport const Dialog = {\n Root,\n Trigger,\n Content,\n Close,\n Description: RadixDialog.Description,\n Title: RadixDialog.Title,\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,YAAY,iBAAiB;AAC7B,SAAS,kBAAkB;AAC3B,SAAS,MAAM,aAAa;AAC5B,SAAS,WAAW,cAAc;AA2DtB,SAGM,KAHN;AA1CZ,IAAM,iBAAyE,CAC7E,MACG;AACH,IAAE,eAAe;AACnB;AAEA,SAASA,SAAQ,OAAsC;AACrD,QAcI,YAbF;AAAA;AAAA,IACA,QAAQ,CAAC;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAvCJ,IAyCM,IADC,iBACD,IADC;AAAA,IAZH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGF,QAAM,EAAE,mBAAmB,IAAI,mBAAmB;AAElD,SACE,oBAAa,oBAAZ,EAAmB,WAAW,mBAAmB,SAChD,8BAAC,SAAM,SAAO,MACZ,8BAAa,qBAAZ,EAAoB,WAAU,iBAC7B;AAAA,IAAa;AAAA,IAAZ;AAAA,MACC,WAAW,iBAAiB,aAAa,EAAE;AAAA,MAC3C,sBAAsB;AAAA,MACtB,OAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,SACG;AAAA,OAED,OAZL;AAAA,MAcC;AAAA,6BAAC,QAAK,KAAI,KAAI,SAAQ,WAAU,OAAM,QACpC;AAAA,8BAAa,mBAAZ,EAAkB,SAAO,MACvB,iBAAO,UAAU,YAAY,UAAU,KACtC,oBAAC,WAAQ,IAAG,KAAI,SAAQ,YACrB,iBACH,IAEA,OAEJ;AAAA,UACC,CAAC,mBACA,oBAAa,mBAAZ,EAAkB,SAAO,MAAC,WAAU,eACnC,8BAAC,cAAW,OAAM,QAAO,SAAQ,SAC/B,8BAAC,cAAW,GACd,GACF;AAAA,WAEJ;AAAA,QACC;AAAA,QACA,UACC,oBAAC,QAAK,KAAI,KAAI,SAAQ,OAAM,IAAG,KAAI,OAAM,QACtC,mBACH,IACE;AAAA;AAAA;AAAA,EACN,GACF,GACF,GACF;AAEJ;AAEA,SAASC,OAAM,IAGmC;AAHnC,eACb;AAAA;AAAA,EA9FF,IA6Fe,IAEV,iBAFU,IAEV;AAAA,IADH;AAAA;AAGA,SACE,oBAAa,mBAAZ,+BAAkB,SAAO,QAAK,OAA9B,EACE,WACH;AAEJ;AAEA,SAASC,SAAQ,IAGmC;AAHnC,eACf;AAAA;AAAA,EAzGF,IAwGiB,IAEZ,iBAFY,IAEZ;AAAA,IADH;AAAA;AAGA,SACE,oBAAa,qBAAZ,+BAAoB,SAAO,QAAK,OAAhC,EACE,WACH;AAEJ;AAEA,SAASC,MAAK,OAAiD;AAC7D,QAAM,cAAc,OAA4B,MAAS;AACzD,QAAM,qBAAqB,OAAgB,KAAK;AAGhD,YAAU,MAAM;AACd,UAAM,WAAW,YAAY;AAC7B,UAAM,cAAc,MAAM;AAG1B,QAAI,aAAa,QAAQ,gBAAgB,SAAS,CAAC,mBAAmB,SAAS;AAC7E,yBAAmB,UAAU;AAG7B,YAAM,QAAQ,WAAW,MAAM;AAjIrC;AAkIQ,YAAI;AAEF,gBAAM,gBAAgB,SAAS;AAE/B,+DAAe,SAAf;AAGA,mBAAS,KAAK,MAAM,gBAAgB;AAAA,QACtC,SAAQ;AAAA,QAER,UAAE;AACA,6BAAmB,UAAU;AAAA,QAC/B;AAAA,MACF,GAAG,GAAG;AAEN,aAAO,MAAM;AACX,qBAAa,KAAK;AAClB,2BAAmB,UAAU;AAAA,MAC/B;AAAA,IACF;AAGA,gBAAY,UAAU;AAAA,EACxB,GAAG,CAAC,MAAM,IAAI,CAAC;AAEf,SAAO,oBAAa,kBAAZ,mBAAqB,MAAO;AACtC;AAEO,IAAM,SAAS;AAAA,EACpB,MAAAA;AAAA,EACA,SAAAD;AAAA,EACA,SAAAF;AAAA,EACA,OAAAC;AAAA,EACA,aAAyB;AAAA,EACzB,OAAmB;AACrB;","names":["Content","Close","Trigger","Root"]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useCurriculumContext
|
|
3
|
+
} from "./chunk-IYQJIEVM.js";
|
|
4
|
+
import {
|
|
5
|
+
Typo
|
|
6
|
+
} from "./chunk-PMJIFLDT.js";
|
|
7
|
+
import {
|
|
8
|
+
Flex
|
|
9
|
+
} from "./chunk-25HMMI7R.js";
|
|
10
|
+
import {
|
|
11
|
+
Button
|
|
12
|
+
} from "./chunk-ZVDAEY5Q.js";
|
|
13
|
+
import {
|
|
14
|
+
ResetIcon
|
|
15
|
+
} from "./chunk-R7IT4TCD.js";
|
|
16
|
+
|
|
17
|
+
// src/molecules/curriculumV2/CurriculumContents/curriculum-ai-traning.tsx
|
|
18
|
+
import { useMemo } from "react";
|
|
19
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
20
|
+
function CurriculumAiTraning({
|
|
21
|
+
item
|
|
22
|
+
}) {
|
|
23
|
+
const { title, description, buttonTitle } = item;
|
|
24
|
+
const { curriculumCompleteMap, onActionButtonClick } = useCurriculumContext();
|
|
25
|
+
const done = useMemo(() => {
|
|
26
|
+
return Boolean(curriculumCompleteMap[item.uuid]);
|
|
27
|
+
}, [curriculumCompleteMap, item.uuid]);
|
|
28
|
+
const bgColor = done ? "var(--color-panel-solid)" : void 0;
|
|
29
|
+
return /* @__PURE__ */ jsxs(
|
|
30
|
+
Flex,
|
|
31
|
+
{
|
|
32
|
+
align: "center",
|
|
33
|
+
direction: "column",
|
|
34
|
+
height: "100%",
|
|
35
|
+
justify: "center",
|
|
36
|
+
style: {
|
|
37
|
+
backgroundImage: `url(https://tipp-coaching-live.s3.ap-northeast-2.amazonaws.com/images/curriculum_ai_bg.png)`,
|
|
38
|
+
backgroundPosition: "center",
|
|
39
|
+
backgroundSize: "cover",
|
|
40
|
+
backgroundRepeat: "no-repeat"
|
|
41
|
+
},
|
|
42
|
+
width: "100%",
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ jsx(Typo, { color: "gray", weight: "bold", children: title }),
|
|
45
|
+
/* @__PURE__ */ jsx(Typo, { align: "center", as: "p", color: "gray", children: description }),
|
|
46
|
+
/* @__PURE__ */ jsxs(
|
|
47
|
+
Button,
|
|
48
|
+
{
|
|
49
|
+
mt: "3",
|
|
50
|
+
onClick: () => {
|
|
51
|
+
onActionButtonClick(item);
|
|
52
|
+
},
|
|
53
|
+
style: { minWidth: 232, backgroundColor: bgColor },
|
|
54
|
+
variant: done ? "outline" : "solid",
|
|
55
|
+
children: [
|
|
56
|
+
done ? "\uB2E4\uC2DC \uC5F0\uC2B5\uD558\uAE30" : buttonTitle || "\uC2DC\uC791\uD558\uAE30",
|
|
57
|
+
done ? /* @__PURE__ */ jsx(ResetIcon, {}) : null
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
var curriculum_ai_traning_default = CurriculumAiTraning;
|
|
66
|
+
|
|
67
|
+
export {
|
|
68
|
+
curriculum_ai_traning_default
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=chunk-B6A7IIYJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/curriculumV2/CurriculumContents/curriculum-ai-traning.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport type { CurriculumAiTrainingContents } from '@/types/curriculumContents.type';\nimport { Button } from '@/atoms/button';\nimport { Flex } from '@/atoms/flex';\nimport { Typo } from '@/atoms/typo';\nimport { ResetIcon } from '@/icon';\nimport { useCurriculumContext } from '../curriculum-context';\n\ninterface CurriculumAiTraningProps {\n item: CurriculumAiTrainingContents;\n}\n\nfunction CurriculumAiTraning({\n item,\n}: CurriculumAiTraningProps): React.ReactNode {\n const { title, description, buttonTitle } = item;\n const { curriculumCompleteMap, onActionButtonClick } = useCurriculumContext();\n\n const done = useMemo(() => {\n return Boolean(curriculumCompleteMap[item.uuid]);\n }, [curriculumCompleteMap, item.uuid]);\n\n const bgColor= done ? 'var(--color-panel-solid)' : undefined;\n\n return (\n <Flex\n align=\"center\"\n direction=\"column\"\n height=\"100%\"\n justify=\"center\"\n style={{\n backgroundImage: `url(https://tipp-coaching-live.s3.ap-northeast-2.amazonaws.com/images/curriculum_ai_bg.png)`,\n backgroundPosition: 'center',\n backgroundSize: 'cover',\n backgroundRepeat: 'no-repeat',\n }}\n width=\"100%\"\n >\n <Typo color=\"gray\" weight=\"bold\">\n {title}\n </Typo>\n <Typo align=\"center\" as=\"p\" color=\"gray\">\n {description}\n </Typo>\n\n <Button\n mt=\"3\"\n onClick={() => { onActionButtonClick(item); }}\n style={{ minWidth: 232, backgroundColor: bgColor }}\n variant={done ? 'outline' : 'solid'}\n >\n {done ? '다시 연습하기' : buttonTitle || '시작하기'}\n {done ? <ResetIcon/> : null}\n </Button>\n \n </Flex>\n );\n}\n\nexport default CurriculumAiTraning;\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,SAAgB,eAAe;AAsCzB,cAOA,YAPA;AA1BN,SAAS,oBAAoB;AAAA,EAC3B;AACF,GAA8C;AAC5C,QAAM,EAAE,OAAO,aAAa,YAAY,IAAI;AAC5C,QAAM,EAAE,uBAAuB,oBAAoB,IAAI,qBAAqB;AAE5E,QAAM,OAAO,QAAQ,MAAM;AACzB,WAAO,QAAQ,sBAAsB,KAAK,IAAI,CAAC;AAAA,EACjD,GAAG,CAAC,uBAAuB,KAAK,IAAI,CAAC;AAErC,QAAM,UAAU,OAAO,6BAA6B;AAEpD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAM;AAAA,MACN,WAAU;AAAA,MACV,QAAO;AAAA,MACP,SAAQ;AAAA,MACR,OAAO;AAAA,QACL,iBAAiB;AAAA,QACjB,oBAAoB;AAAA,QACpB,gBAAgB;AAAA,QAChB,kBAAkB;AAAA,MACpB;AAAA,MACA,OAAM;AAAA,MAEN;AAAA,4BAAC,QAAK,OAAM,QAAO,QAAO,QACvB,iBACH;AAAA,QACA,oBAAC,QAAK,OAAM,UAAS,IAAG,KAAI,OAAM,QAC/B,uBACH;AAAA,QAEA;AAAA,UAAC;AAAA;AAAA,YACC,IAAG;AAAA,YACH,SAAS,MAAM;AAAE,kCAAoB,IAAI;AAAA,YAAG;AAAA,YAC5C,OAAO,EAAE,UAAU,KAAK,iBAAiB,QAAQ;AAAA,YACjD,SAAS,OAAO,YAAY;AAAA,YAE3B;AAAA,qBAAO,0CAAY,eAAe;AAAA,cAClC,OAAO,oBAAC,aAAS,IAAK;AAAA;AAAA;AAAA,QACzB;AAAA;AAAA;AAAA,EAEF;AAEJ;AAEA,IAAO,gCAAQ;","names":[]}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ReviewQuestionContentHeader
|
|
3
|
+
} from "./chunk-COKJ53M5.js";
|
|
4
|
+
import {
|
|
5
|
+
TextArea
|
|
6
|
+
} from "./chunk-5XYPLDI5.js";
|
|
7
|
+
import {
|
|
8
|
+
Grid
|
|
9
|
+
} from "./chunk-EGEQY3KT.js";
|
|
10
|
+
import {
|
|
11
|
+
Box
|
|
12
|
+
} from "./chunk-4Y5BEXVN.js";
|
|
13
|
+
import {
|
|
14
|
+
Typo
|
|
15
|
+
} from "./chunk-PMJIFLDT.js";
|
|
16
|
+
import {
|
|
17
|
+
Callout
|
|
18
|
+
} from "./chunk-B6XJN6EC.js";
|
|
19
|
+
import {
|
|
20
|
+
Card
|
|
21
|
+
} from "./chunk-RP2RGCAW.js";
|
|
22
|
+
import {
|
|
23
|
+
BellIcon
|
|
24
|
+
} from "./chunk-R7IT4TCD.js";
|
|
25
|
+
|
|
26
|
+
// src/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-text.tsx
|
|
27
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
28
|
+
function ReviewQuestionText(props) {
|
|
29
|
+
const { question, answer, onChange } = props;
|
|
30
|
+
const minLengthNotMet = question.minLength && answer.length < question.minLength;
|
|
31
|
+
const remainingLength = question.minLength && answer.length < question.minLength ? question.minLength - answer.length : 0;
|
|
32
|
+
return /* @__PURE__ */ jsx(
|
|
33
|
+
Card,
|
|
34
|
+
{
|
|
35
|
+
size: "2",
|
|
36
|
+
style: {
|
|
37
|
+
width: "100%",
|
|
38
|
+
height: "100%"
|
|
39
|
+
},
|
|
40
|
+
children: /* @__PURE__ */ jsxs(Grid, { height: "100%", rows: "1fr auto", children: [
|
|
41
|
+
/* @__PURE__ */ jsxs(Grid, { height: "100%", rows: "auto 1fr", width: "100%", children: [
|
|
42
|
+
/* @__PURE__ */ jsx(
|
|
43
|
+
ReviewQuestionContentHeader,
|
|
44
|
+
{
|
|
45
|
+
icon: question.icon,
|
|
46
|
+
question: question.question,
|
|
47
|
+
title: question.title,
|
|
48
|
+
type: question.type
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
/* @__PURE__ */ jsx(
|
|
52
|
+
TextArea,
|
|
53
|
+
{
|
|
54
|
+
mt: "2",
|
|
55
|
+
onChange: (e) => {
|
|
56
|
+
onChange(e.target.value);
|
|
57
|
+
},
|
|
58
|
+
placeholder: question.placeholder,
|
|
59
|
+
value: answer
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
] }),
|
|
63
|
+
minLengthNotMet ? /* @__PURE__ */ jsxs(Box, { mt: "2", children: [
|
|
64
|
+
/* @__PURE__ */ jsx(Typo, { align: "right", as: "p", color: "red", variant: "caption", children: `${remainingLength}\uC790 \uB354 \uC791\uC131\uD574\uC8FC\uC138\uC694.` }),
|
|
65
|
+
question.minLengthInfoMessage ? /* @__PURE__ */ jsxs(
|
|
66
|
+
Callout.Root,
|
|
67
|
+
{
|
|
68
|
+
color: "iris",
|
|
69
|
+
mt: "2",
|
|
70
|
+
style: { alignItems: "center" },
|
|
71
|
+
children: [
|
|
72
|
+
/* @__PURE__ */ jsx(Callout.Icon, { children: /* @__PURE__ */ jsx(BellIcon, {}) }),
|
|
73
|
+
/* @__PURE__ */ jsx(Callout.Text, { children: /* @__PURE__ */ jsx(Typo, { as: "p", variant: "caption", children: question.minLengthInfoMessage }) })
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
) : null
|
|
77
|
+
] }) : null
|
|
78
|
+
] })
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
var review_question_text_default = ReviewQuestionText;
|
|
83
|
+
|
|
84
|
+
export {
|
|
85
|
+
review_question_text_default
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=chunk-CLFON5AH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-text.tsx"],"sourcesContent":["import React from 'react';\nimport { Box } from '@/atoms/box';\nimport { Card } from '@/atoms/card';\nimport { Grid } from '@/atoms/grid';\nimport { TextArea } from '@/atoms/text-area';\nimport { Typo } from '@/atoms/typo';\nimport { BellIcon } from '@/icon';\nimport { type CurriculumReviewQuestionText } from '@/types/curriculumContents.type';\nimport { Callout } from '@/atoms/call-out';\nimport { ReviewQuestionContentHeader } from './review-comp';\n\ninterface ReviewQuestionTextProps {\n question: CurriculumReviewQuestionText;\n answer: string;\n error?: string;\n onChange: (value: string) => void;\n}\n\nfunction ReviewQuestionText(props: ReviewQuestionTextProps): React.ReactNode {\n const { question, answer, onChange } = props;\n\n const minLengthNotMet =\n question.minLength && answer.length < question.minLength;\n\n const remainingLength =\n question.minLength && answer.length < question.minLength\n ? question.minLength - answer.length\n : 0;\n\n return (\n <Card\n size=\"2\"\n style={{\n width: '100%',\n height: '100%',\n }}\n >\n <Grid height=\"100%\" rows=\"1fr auto\">\n <Grid height=\"100%\" rows=\"auto 1fr\" width=\"100%\">\n <ReviewQuestionContentHeader\n icon={question.icon}\n question={question.question}\n title={question.title}\n type={question.type}\n />\n\n <TextArea\n mt=\"2\"\n onChange={(e) => {\n onChange(e.target.value);\n }}\n placeholder={question.placeholder}\n value={answer}\n />\n </Grid>\n {minLengthNotMet ? (\n <Box mt=\"2\">\n <Typo align=\"right\" as=\"p\" color=\"red\" variant=\"caption\">\n {`${remainingLength}자 더 작성해주세요.`}\n </Typo>\n {question.minLengthInfoMessage ? (\n <Callout.Root\n color=\"iris\"\n mt=\"2\"\n style={{ alignItems: 'center' }}\n >\n <Callout.Icon>\n <BellIcon />\n </Callout.Icon>\n <Callout.Text>\n <Typo as=\"p\" variant=\"caption\">\n {question.minLengthInfoMessage}\n </Typo>\n </Callout.Text>\n </Callout.Root>\n ) : null}\n </Box>\n ) : null}\n </Grid>\n </Card>\n );\n}\n\nexport default ReviewQuestionText;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAsCQ,SACE,KADF;AApBR,SAAS,mBAAmB,OAAiD;AAC3E,QAAM,EAAE,UAAU,QAAQ,SAAS,IAAI;AAEvC,QAAM,kBACJ,SAAS,aAAa,OAAO,SAAS,SAAS;AAEjD,QAAM,kBACJ,SAAS,aAAa,OAAO,SAAS,SAAS,YAC3C,SAAS,YAAY,OAAO,SAC5B;AAEN,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,OAAO;AAAA,QACL,OAAO;AAAA,QACP,QAAQ;AAAA,MACV;AAAA,MAEA,+BAAC,QAAK,QAAO,QAAO,MAAK,YACvB;AAAA,6BAAC,QAAK,QAAO,QAAO,MAAK,YAAW,OAAM,QACxC;AAAA;AAAA,YAAC;AAAA;AAAA,cACC,MAAM,SAAS;AAAA,cACf,UAAU,SAAS;AAAA,cACnB,OAAO,SAAS;AAAA,cAChB,MAAM,SAAS;AAAA;AAAA,UACjB;AAAA,UAEA;AAAA,YAAC;AAAA;AAAA,cACC,IAAG;AAAA,cACH,UAAU,CAAC,MAAM;AACf,yBAAS,EAAE,OAAO,KAAK;AAAA,cACzB;AAAA,cACA,aAAa,SAAS;AAAA,cACtB,OAAO;AAAA;AAAA,UACT;AAAA,WACF;AAAA,QACC,kBACC,qBAAC,OAAI,IAAG,KACN;AAAA,8BAAC,QAAK,OAAM,SAAQ,IAAG,KAAI,OAAM,OAAM,SAAQ,WAC5C,aAAG,eAAe,uDACrB;AAAA,UACC,SAAS,uBACR;AAAA,YAAC,QAAQ;AAAA,YAAR;AAAA,cACC,OAAM;AAAA,cACN,IAAG;AAAA,cACH,OAAO,EAAE,YAAY,SAAS;AAAA,cAE9B;AAAA,oCAAC,QAAQ,MAAR,EACC,8BAAC,YAAS,GACZ;AAAA,gBACA,oBAAC,QAAQ,MAAR,EACC,8BAAC,QAAK,IAAG,KAAI,SAAQ,WAClB,mBAAS,sBACZ,GACF;AAAA;AAAA;AAAA,UACF,IACE;AAAA,WACN,IACE;AAAA,SACN;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,+BAAQ;","names":[]}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import {
|
|
2
|
+
review_question_satisfaction_option_default
|
|
3
|
+
} from "./chunk-TNGEPJ3G.js";
|
|
4
|
+
import {
|
|
5
|
+
ReviewQuestionSatisfisText
|
|
6
|
+
} from "./chunk-CC5RCOSM.js";
|
|
7
|
+
import {
|
|
8
|
+
review_question_text_default
|
|
9
|
+
} from "./chunk-CLFON5AH.js";
|
|
10
|
+
import {
|
|
11
|
+
review_question_radio_default
|
|
12
|
+
} from "./chunk-4NNBXE2Q.js";
|
|
13
|
+
|
|
14
|
+
// src/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-body.tsx
|
|
15
|
+
import { jsx } from "react/jsx-runtime";
|
|
16
|
+
function ReviewQuestionBody(props) {
|
|
17
|
+
const { question, answer, error, onChange } = props;
|
|
18
|
+
if (question.type === "question_radio") {
|
|
19
|
+
return /* @__PURE__ */ jsx(
|
|
20
|
+
review_question_radio_default,
|
|
21
|
+
{
|
|
22
|
+
answer,
|
|
23
|
+
error,
|
|
24
|
+
onChange,
|
|
25
|
+
question
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
if (question.type === "question_text") {
|
|
30
|
+
return /* @__PURE__ */ jsx(
|
|
31
|
+
review_question_text_default,
|
|
32
|
+
{
|
|
33
|
+
answer,
|
|
34
|
+
error,
|
|
35
|
+
onChange,
|
|
36
|
+
question
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
if (question.type === "question_satisfaction_option") {
|
|
41
|
+
return /* @__PURE__ */ jsx(
|
|
42
|
+
review_question_satisfaction_option_default,
|
|
43
|
+
{
|
|
44
|
+
answer,
|
|
45
|
+
error,
|
|
46
|
+
onChange,
|
|
47
|
+
question
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
if (question.type === "question_satisfaction_text") {
|
|
52
|
+
return /* @__PURE__ */ jsx(
|
|
53
|
+
ReviewQuestionSatisfisText,
|
|
54
|
+
{
|
|
55
|
+
answer,
|
|
56
|
+
error,
|
|
57
|
+
onChange,
|
|
58
|
+
question
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
var review_question_body_default = ReviewQuestionBody;
|
|
65
|
+
|
|
66
|
+
export {
|
|
67
|
+
review_question_body_default
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=chunk-CMBTJWVJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-body.tsx"],"sourcesContent":["import React from 'react'; \nimport type { ReviewQuestionElement } from '@/types/curriculum.type';\nimport ReviewQuestionRadio from './review-question-radio';\nimport ReviewQuestionText from './review-question-text';\nimport ReviewQuestionSatisfactionOption from './review-question-satisfaction-option';\nimport ReviewQuestionSatisfactionText from './review-question-satisfaction-text';\n\ninterface ReviewQuestionBodyProps {\n question: ReviewQuestionElement;\n answer: string;\n error?: string;\n onChange: (value: string) => void;\n}\n\nfunction ReviewQuestionBody(props: ReviewQuestionBodyProps): React.ReactNode {\n const { question, answer, error, onChange } = props;\n \n if (question.type === 'question_radio') {\n return (\n <ReviewQuestionRadio\n answer={answer}\n error={error}\n onChange={onChange}\n question={question}\n />\n );\n }\n if (question.type === 'question_text') {\n return (\n <ReviewQuestionText\n answer={answer}\n error={error}\n onChange={onChange}\n question={question}\n />\n );\n }\n if (question.type === 'question_satisfaction_option') {\n return (\n <ReviewQuestionSatisfactionOption\n answer={answer}\n error={error}\n onChange={onChange}\n question={question}\n />\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- 그 외의 타입이 있을 경우 있음\n if (question.type === 'question_satisfaction_text') {\n return (\n <ReviewQuestionSatisfactionText\n answer={answer}\n error={error}\n onChange={onChange}\n question={question}\n />\n );\n }\n\n return null;\n}\nexport default ReviewQuestionBody;\n"],"mappings":";;;;;;;;;;;;;;AAmBM;AALN,SAAS,mBAAmB,OAAiD;AAC3E,QAAM,EAAE,UAAU,QAAQ,OAAO,SAAS,IAAI;AAE9C,MAAI,SAAS,SAAS,kBAAkB;AACtC,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,EAEJ;AACA,MAAI,SAAS,SAAS,iBAAiB;AACrC,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,EAEJ;AACA,MAAI,SAAS,SAAS,gCAAgC;AACpD,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,EAEJ;AAGA,MAAI,SAAS,SAAS,8BAA8B;AAClD,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,EAEJ;AAEA,SAAO;AACT;AACA,IAAO,+BAAQ;","names":[]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {
|
|
2
|
+
OnOfflineRadioCard
|
|
3
|
+
} from "./chunk-M2PVHXOE.js";
|
|
4
|
+
import {
|
|
5
|
+
Dialog
|
|
6
|
+
} from "./chunk-UHLHNMKL.js";
|
|
7
|
+
import {
|
|
8
|
+
Box
|
|
9
|
+
} from "./chunk-4Y5BEXVN.js";
|
|
10
|
+
import {
|
|
11
|
+
Typo
|
|
12
|
+
} from "./chunk-PMJIFLDT.js";
|
|
13
|
+
import {
|
|
14
|
+
Flex
|
|
15
|
+
} from "./chunk-25HMMI7R.js";
|
|
16
|
+
import {
|
|
17
|
+
Button
|
|
18
|
+
} from "./chunk-ZVDAEY5Q.js";
|
|
19
|
+
|
|
20
|
+
// src/app/platform/edit-service-type.tsx
|
|
21
|
+
import { useCallback, useState } from "react";
|
|
22
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
23
|
+
function EditServiceType(props) {
|
|
24
|
+
const { defaultServiceType, onClickCancel } = props;
|
|
25
|
+
const [sessionType, setSessionType] = useState(
|
|
26
|
+
defaultServiceType
|
|
27
|
+
);
|
|
28
|
+
const onClickSave = useCallback(() => {
|
|
29
|
+
var _a;
|
|
30
|
+
(_a = props.onClickSave) == null ? void 0 : _a.call(props, sessionType);
|
|
31
|
+
}, [props, sessionType]);
|
|
32
|
+
return /* @__PURE__ */ jsxs(Box, { children: [
|
|
33
|
+
/* @__PURE__ */ jsx(
|
|
34
|
+
Typo,
|
|
35
|
+
{
|
|
36
|
+
as: "p",
|
|
37
|
+
color: "gray",
|
|
38
|
+
mb: { initial: "5", xs: "3" },
|
|
39
|
+
variant: "caption",
|
|
40
|
+
children: "\uC138\uC158 \uC720\uD615\uC5D0 \uB530\uB77C \uCC45\uC815\uB418\uB294 \uCF54\uCE6D \uAE08\uC561\uC774 \uB2EC\uB77C\uC9C0\uBBC0\uB85C, \uC815\uD655\uD558\uAC8C \uC120\uD0DD\uD574\uC8FC\uC138\uC694"
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ jsx(OnOfflineRadioCard, { onValueChange: setSessionType, value: sessionType }),
|
|
44
|
+
/* @__PURE__ */ jsxs(Flex, { gap: "3", justify: "end", mt: { initial: "6", xs: "3" }, children: [
|
|
45
|
+
/* @__PURE__ */ jsx(Dialog.Close, { children: /* @__PURE__ */ jsx(Button, { color: "gray", onClick: onClickCancel, variant: "outline", children: "\uCDE8\uC18C\uD558\uAE30" }) }),
|
|
46
|
+
/* @__PURE__ */ jsx(Dialog.Close, { children: /* @__PURE__ */ jsx(Button, { onClick: onClickSave, children: "\uC800\uC7A5\uD558\uAE30" }) })
|
|
47
|
+
] })
|
|
48
|
+
] });
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export {
|
|
52
|
+
EditServiceType
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=chunk-CMQRNBLB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/app/platform/edit-service-type.tsx"],"sourcesContent":["import React, { useCallback, useState } from 'react';\nimport { Box, Button, Dialog, Flex, Typo } from '@/atoms';\nimport type { ServiceType } from '@/types/biz.type';\nimport { OnOfflineRadioCard } from './on-offline-radio-card';\n\nexport interface EditServiceTypeProps {\n defaultServiceType?: ServiceType;\n onClickSave?: (serviceType: ServiceType) => void;\n onClickCancel?: () => void;\n}\n\nexport function EditServiceType(\n props: EditServiceTypeProps\n): React.ReactNode {\n const { defaultServiceType, onClickCancel } = props;\n const [sessionType, setSessionType] = useState<string | undefined>(\n defaultServiceType\n );\n\n const onClickSave = useCallback(() => {\n props.onClickSave?.(sessionType as ServiceType);\n }, [props, sessionType]);\n\n return (\n <Box>\n <Typo\n as=\"p\"\n color=\"gray\"\n mb={{ initial: '5', xs: '3' }}\n variant=\"caption\"\n >\n 세션 유형에 따라 책정되는 코칭 금액이 달라지므로, 정확하게 선택해주세요\n </Typo>\n <OnOfflineRadioCard onValueChange={setSessionType} value={sessionType} />\n <Flex gap=\"3\" justify=\"end\" mt={{ initial: '6', xs: '3' }}>\n <Dialog.Close>\n <Button color=\"gray\" onClick={onClickCancel} variant=\"outline\">\n 취소하기\n </Button>\n </Dialog.Close>\n <Dialog.Close>\n <Button onClick={onClickSave}>저장하기</Button>\n </Dialog.Close>\n </Flex>\n </Box>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,SAAgB,aAAa,gBAAgB;AAyBvC,cASA,YATA;AAdC,SAAS,gBACd,OACiB;AACjB,QAAM,EAAE,oBAAoB,cAAc,IAAI;AAC9C,QAAM,CAAC,aAAa,cAAc,IAAI;AAAA,IACpC;AAAA,EACF;AAEA,QAAM,cAAc,YAAY,MAAM;AAnBxC;AAoBI,gBAAM,gBAAN,+BAAoB;AAAA,EACtB,GAAG,CAAC,OAAO,WAAW,CAAC;AAEvB,SACE,qBAAC,OACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,IAAG;AAAA,QACH,OAAM;AAAA,QACN,IAAI,EAAE,SAAS,KAAK,IAAI,IAAI;AAAA,QAC5B,SAAQ;AAAA,QACT;AAAA;AAAA,IAED;AAAA,IACA,oBAAC,sBAAmB,eAAe,gBAAgB,OAAO,aAAa;AAAA,IACvE,qBAAC,QAAK,KAAI,KAAI,SAAQ,OAAM,IAAI,EAAE,SAAS,KAAK,IAAI,IAAI,GACtD;AAAA,0BAAC,OAAO,OAAP,EACC,8BAAC,UAAO,OAAM,QAAO,SAAS,eAAe,SAAQ,WAAU,sCAE/D,GACF;AAAA,MACA,oBAAC,OAAO,OAAP,EACC,8BAAC,UAAO,SAAS,aAAa,sCAAI,GACpC;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Heading
|
|
3
|
+
} from "./chunk-BESTU2AY.js";
|
|
4
|
+
import {
|
|
5
|
+
usePortalContainer
|
|
6
|
+
} from "./chunk-U7N2PWMO.js";
|
|
7
|
+
import {
|
|
8
|
+
IconButton
|
|
9
|
+
} from "./chunk-XK6VEVOK.js";
|
|
10
|
+
import {
|
|
11
|
+
__objRest,
|
|
12
|
+
__spreadProps,
|
|
13
|
+
__spreadValues
|
|
14
|
+
} from "./chunk-CRTRMMJ7.js";
|
|
15
|
+
|
|
16
|
+
// src/atoms/dialog.tsx
|
|
17
|
+
import * as RadixDialog from "@radix-ui/react-dialog";
|
|
18
|
+
import { Cross1Icon } from "@radix-ui/react-icons";
|
|
19
|
+
import { Flex, Theme } from "@radix-ui/themes";
|
|
20
|
+
import { useEffect, useRef } from "react";
|
|
21
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
22
|
+
var preventDefault = (e) => {
|
|
23
|
+
e.preventDefault();
|
|
24
|
+
};
|
|
25
|
+
function Content2(props) {
|
|
26
|
+
const _a = props, {
|
|
27
|
+
children,
|
|
28
|
+
style = {},
|
|
29
|
+
width,
|
|
30
|
+
maxWidth,
|
|
31
|
+
minWidth,
|
|
32
|
+
maxHeight,
|
|
33
|
+
height,
|
|
34
|
+
minHeight,
|
|
35
|
+
title,
|
|
36
|
+
buttons,
|
|
37
|
+
size,
|
|
38
|
+
hideCloseButton,
|
|
39
|
+
className
|
|
40
|
+
} = _a, rest = __objRest(_a, [
|
|
41
|
+
"children",
|
|
42
|
+
"style",
|
|
43
|
+
"width",
|
|
44
|
+
"maxWidth",
|
|
45
|
+
"minWidth",
|
|
46
|
+
"maxHeight",
|
|
47
|
+
"height",
|
|
48
|
+
"minHeight",
|
|
49
|
+
"title",
|
|
50
|
+
"buttons",
|
|
51
|
+
"size",
|
|
52
|
+
"hideCloseButton",
|
|
53
|
+
"className"
|
|
54
|
+
]);
|
|
55
|
+
const { dialogContainerRef } = usePortalContainer();
|
|
56
|
+
return /* @__PURE__ */ jsx(RadixDialog.Portal, { container: dialogContainerRef.current, children: /* @__PURE__ */ jsx(Theme, { asChild: true, children: /* @__PURE__ */ jsx(RadixDialog.Overlay, { className: "DialogOverlay", children: /* @__PURE__ */ jsxs(
|
|
57
|
+
RadixDialog.Content,
|
|
58
|
+
__spreadProps(__spreadValues({
|
|
59
|
+
className: `DialogContent ${className || ""} rt-BaseDialogContent rt-DialogContent rt-r-size-${size || "3"}`,
|
|
60
|
+
onPointerDownOutside: preventDefault,
|
|
61
|
+
style: __spreadValues({
|
|
62
|
+
width,
|
|
63
|
+
maxWidth,
|
|
64
|
+
minWidth,
|
|
65
|
+
maxHeight,
|
|
66
|
+
height,
|
|
67
|
+
minHeight
|
|
68
|
+
}, style)
|
|
69
|
+
}, rest), {
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ jsxs(Flex, { gap: "2", justify: "between", width: "100%", children: [
|
|
72
|
+
/* @__PURE__ */ jsx(RadixDialog.Title, { asChild: true, children: typeof title === "string" && title !== "" ? /* @__PURE__ */ jsx(Heading, { mb: "2", variant: "heading3", children: title }) : title }),
|
|
73
|
+
!hideCloseButton && /* @__PURE__ */ jsx(RadixDialog.Close, { asChild: true, className: "DialogClose", children: /* @__PURE__ */ jsx(IconButton, { color: "gray", variant: "ghost", children: /* @__PURE__ */ jsx(Cross1Icon, {}) }) })
|
|
74
|
+
] }),
|
|
75
|
+
children,
|
|
76
|
+
buttons ? /* @__PURE__ */ jsx(Flex, { gap: "3", justify: "end", mt: "3", width: "100%", children: buttons }) : null
|
|
77
|
+
]
|
|
78
|
+
})
|
|
79
|
+
) }) }) });
|
|
80
|
+
}
|
|
81
|
+
function Close2(_a) {
|
|
82
|
+
var _b = _a, {
|
|
83
|
+
children
|
|
84
|
+
} = _b, rest = __objRest(_b, [
|
|
85
|
+
"children"
|
|
86
|
+
]);
|
|
87
|
+
return /* @__PURE__ */ jsx(RadixDialog.Close, __spreadProps(__spreadValues({ asChild: true }, rest), { children }));
|
|
88
|
+
}
|
|
89
|
+
function Trigger2(_a) {
|
|
90
|
+
var _b = _a, {
|
|
91
|
+
children
|
|
92
|
+
} = _b, rest = __objRest(_b, [
|
|
93
|
+
"children"
|
|
94
|
+
]);
|
|
95
|
+
return /* @__PURE__ */ jsx(RadixDialog.Trigger, __spreadProps(__spreadValues({ asChild: true }, rest), { children }));
|
|
96
|
+
}
|
|
97
|
+
function Root2(props) {
|
|
98
|
+
const prevOpenRef = useRef(void 0);
|
|
99
|
+
const cleanupExecutedRef = useRef(false);
|
|
100
|
+
useEffect(() => {
|
|
101
|
+
const prevOpen = prevOpenRef.current;
|
|
102
|
+
const currentOpen = props.open;
|
|
103
|
+
if (prevOpen === true && currentOpen === false && !cleanupExecutedRef.current) {
|
|
104
|
+
cleanupExecutedRef.current = true;
|
|
105
|
+
const timer = setTimeout(() => {
|
|
106
|
+
var _a;
|
|
107
|
+
try {
|
|
108
|
+
const activeElement = document.activeElement;
|
|
109
|
+
(_a = activeElement == null ? void 0 : activeElement.blur) == null ? void 0 : _a.call(activeElement);
|
|
110
|
+
document.body.style.pointerEvents = "";
|
|
111
|
+
} catch (e) {
|
|
112
|
+
} finally {
|
|
113
|
+
cleanupExecutedRef.current = false;
|
|
114
|
+
}
|
|
115
|
+
}, 100);
|
|
116
|
+
return () => {
|
|
117
|
+
clearTimeout(timer);
|
|
118
|
+
cleanupExecutedRef.current = false;
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
prevOpenRef.current = currentOpen;
|
|
122
|
+
}, [props.open]);
|
|
123
|
+
return /* @__PURE__ */ jsx(RadixDialog.Root, __spreadValues({}, props));
|
|
124
|
+
}
|
|
125
|
+
var Dialog = {
|
|
126
|
+
Root: Root2,
|
|
127
|
+
Trigger: Trigger2,
|
|
128
|
+
Content: Content2,
|
|
129
|
+
Close: Close2,
|
|
130
|
+
Description: RadixDialog.Description,
|
|
131
|
+
Title: RadixDialog.Title
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export {
|
|
135
|
+
Dialog
|
|
136
|
+
};
|
|
137
|
+
//# sourceMappingURL=chunk-CMSM5Z5E.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/atoms/dialog.tsx"],"sourcesContent":["import * as RadixDialog from '@radix-ui/react-dialog';\nimport { Cross1Icon } from '@radix-ui/react-icons';\nimport { Flex, Theme } from '@radix-ui/themes';\nimport { useEffect, useRef } from 'react';\nimport { usePortalContainer } from '@/theme/portal-provider';\nimport { Heading } from './heading';\nimport { IconButton } from './icon-button';\n\ntype ContentProps = RadixDialog.DialogContentProps & {\n width?: string;\n maxWidth?: string;\n minWidth?: string;\n height?: string;\n maxHeight?: string;\n minHeight?: string;\n title?: string;\n hideCloseButton?: boolean;\n buttons?: React.ReactNode;\n size?: '1' | '2' | '3' | '4';\n};\n\nconst preventDefault: RadixDialog.DialogContentProps['onPointerDownOutside'] = (\n e\n) => {\n e.preventDefault();\n};\n\nfunction Content(props: ContentProps): React.ReactNode {\n const {\n children,\n style = {},\n width,\n maxWidth,\n minWidth,\n maxHeight,\n height,\n minHeight,\n title,\n buttons,\n size,\n hideCloseButton,\n className,\n ...rest\n } = props;\n const { dialogContainerRef } = usePortalContainer();\n\n return (\n <RadixDialog.Portal container={dialogContainerRef.current}>\n <Theme asChild>\n <RadixDialog.Overlay className=\"DialogOverlay\">\n <RadixDialog.Content\n className={`DialogContent ${className || ''} rt-BaseDialogContent rt-DialogContent rt-r-size-${size||'3'}`}\n onPointerDownOutside={preventDefault}\n style={{\n width,\n maxWidth,\n minWidth,\n maxHeight,\n height,\n minHeight,\n ...style,\n }}\n {...rest}\n >\n <Flex gap=\"2\" justify=\"between\" width=\"100%\">\n <RadixDialog.Title asChild>\n {typeof title === 'string' && title !== '' ? (\n <Heading mb=\"2\" variant=\"heading3\">\n {title}\n </Heading>\n ) : (\n title\n )}\n </RadixDialog.Title>\n {!hideCloseButton && (\n <RadixDialog.Close asChild className=\"DialogClose\">\n <IconButton color=\"gray\" variant=\"ghost\">\n <Cross1Icon />\n </IconButton>\n </RadixDialog.Close>\n )}\n </Flex>\n {children}\n {buttons ? (\n <Flex gap=\"3\" justify=\"end\" mt=\"3\" width=\"100%\">\n {buttons}\n </Flex>\n ) : null}\n </RadixDialog.Content>\n </RadixDialog.Overlay>\n </Theme>\n </RadixDialog.Portal>\n );\n}\n\nfunction Close({\n children,\n ...rest\n}: RadixDialog.DialogCloseProps): React.ReactNode {\n return (\n <RadixDialog.Close asChild {...rest}>\n {children}\n </RadixDialog.Close>\n );\n}\n\nfunction Trigger({\n children,\n ...rest\n}: RadixDialog.DialogTriggerProps): React.ReactNode {\n return (\n <RadixDialog.Trigger asChild {...rest}>\n {children}\n </RadixDialog.Trigger>\n );\n}\n\nfunction Root(props: RadixDialog.DialogProps): React.ReactNode {\n const prevOpenRef = useRef<boolean | undefined>(undefined);\n const cleanupExecutedRef = useRef<boolean>(false);\n\n // 모달이 닫힌 후 포커스 복원 및 이벤트 정리\n useEffect(() => {\n const prevOpen = prevOpenRef.current;\n const currentOpen = props.open;\n\n // 모달이 열린 상태에서 닫힌 상태로 변경될 때만 실행\n if (prevOpen === true && currentOpen === false && !cleanupExecutedRef.current) {\n cleanupExecutedRef.current = true;\n \n // 모달이 닫힌 후 약간의 지연을 두고 포커스 복원\n const timer = setTimeout(() => {\n try {\n // 활성 요소에 포커스 복원\n const activeElement = document.activeElement as HTMLElement | null;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- 어떤 dom인지 확실하지 않음\n activeElement?.blur?.();\n\n // body의 pointer-events 복원\n document.body.style.pointerEvents = '';\n } catch {\n // 에러 무시\n } finally {\n cleanupExecutedRef.current = false;\n }\n }, 100);\n\n return () => { \n clearTimeout(timer);\n cleanupExecutedRef.current = false;\n };\n }\n\n // 현재 상태를 이전 상태로 업데이트\n prevOpenRef.current = currentOpen;\n }, [props.open]);\n\n return <RadixDialog.Root {...props} />;\n}\n\nexport const Dialog = {\n Root,\n Trigger,\n Content,\n Close,\n Description: RadixDialog.Description,\n Title: RadixDialog.Title,\n};\n"],"mappings":"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","names":["Content","Close","Trigger","Root"]}
|