@tipp/ui 2.3.3 → 2.3.5
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.map +1 -1
- package/dist/app/index.js +90 -90
- package/dist/app/platform/coach-question-list.cjs.map +1 -1
- package/dist/app/platform/coach-question-list.js +30 -30
- package/dist/app/platform/contents-card.cjs.map +1 -1
- package/dist/app/platform/contents-card.js +30 -30
- package/dist/app/platform/curriculum-card.js +7 -7
- package/dist/app/platform/edit-coaching-time.cjs.map +1 -1
- package/dist/app/platform/edit-coaching-time.js +72 -72
- package/dist/app/platform/edit-service-type.cjs.map +1 -1
- package/dist/app/platform/edit-service-type.js +73 -73
- package/dist/app/platform/goal-manage-card-edit.cjs.map +1 -1
- package/dist/app/platform/goal-manage-card-edit.js +72 -72
- package/dist/app/platform/goal-manage-card-read.cjs.map +1 -1
- package/dist/app/platform/goal-manage-card-read.js +30 -30
- package/dist/app/platform/on-offline-radio-card.cjs.map +1 -1
- package/dist/app/platform/on-offline-radio-card.js +72 -72
- package/dist/app/platform/report-card.cjs.map +1 -1
- package/dist/app/platform/report-card.js +30 -30
- package/dist/app/platform/reservation-card.cjs.map +1 -1
- package/dist/app/platform/reservation-card.js +73 -73
- package/dist/app/platform/session-card.cjs.map +1 -1
- package/dist/app/platform/session-card.js +75 -75
- package/dist/app/platform/session-review-simple-read.cjs.map +1 -1
- package/dist/app/platform/session-review-simple-read.js +30 -30
- package/dist/app/platform/userInfos/coaching-customer-info/index.cjs.map +1 -1
- package/dist/app/platform/userInfos/coaching-customer-info/index.js +35 -35
- package/dist/app/platform/userInfos/coaching-customer-info/large.cjs.map +1 -1
- package/dist/app/platform/userInfos/coaching-customer-info/large.js +30 -30
- package/dist/app/platform/userInfos/coaching-customer-info/medium.cjs.map +1 -1
- package/dist/app/platform/userInfos/coaching-customer-info/medium.js +30 -30
- package/dist/app/platform/userInfos/coaching-customer-info/small.cjs.map +1 -1
- package/dist/app/platform/userInfos/coaching-customer-info/small.js +30 -30
- package/dist/app/platform/userInfos/session-user-info-detail.cjs.map +1 -1
- package/dist/app/platform/userInfos/session-user-info-detail.js +30 -30
- package/dist/app/platform/userInfos/utils.cjs.map +1 -1
- package/dist/app/platform/userInfos/utils.js +29 -29
- package/dist/atoms/bullet-text.js +2 -2
- package/dist/atoms/dialog.js +2 -2
- package/dist/atoms/drawer.cjs +8 -14
- package/dist/atoms/drawer.cjs.map +1 -1
- package/dist/atoms/drawer.js +1 -2
- package/dist/atoms/field-error-wrapper.js +2 -2
- package/dist/atoms/index.cjs +3 -6
- package/dist/atoms/index.cjs.map +1 -1
- package/dist/atoms/index.js +63 -63
- package/dist/atoms/list.js +2 -2
- package/dist/atoms/pagination.js +3 -3
- package/dist/chunk-2QHFHCXL.js +64 -0
- package/dist/chunk-2QHFHCXL.js.map +1 -0
- package/dist/chunk-2ZAUZRYP.js +51 -0
- package/dist/chunk-2ZAUZRYP.js.map +1 -0
- package/dist/chunk-3GLSHF4F.js +99 -0
- package/dist/chunk-3GLSHF4F.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-44VLRAHW.js +74 -0
- package/dist/chunk-44VLRAHW.js.map +1 -0
- package/dist/chunk-4H6OYVRA.js +64 -0
- package/dist/chunk-4H6OYVRA.js.map +1 -0
- package/dist/chunk-5773MYBI.js +89 -0
- package/dist/chunk-5773MYBI.js.map +1 -0
- package/dist/chunk-5RDI5OIK.js +89 -0
- package/dist/chunk-5RDI5OIK.js.map +1 -0
- package/dist/chunk-5ZEQ33PC.js +57 -0
- package/dist/chunk-5ZEQ33PC.js.map +1 -0
- package/dist/chunk-7AHPQJD2.js +196 -0
- package/dist/chunk-7AHPQJD2.js.map +1 -0
- package/dist/chunk-7PTZCSIA.js +144 -0
- package/dist/chunk-7PTZCSIA.js.map +1 -0
- package/dist/chunk-7ZMY4CAZ.js +30 -0
- package/dist/chunk-7ZMY4CAZ.js.map +1 -0
- package/dist/chunk-AGDS5FTY.js +30 -0
- package/dist/chunk-AGDS5FTY.js.map +1 -0
- package/dist/chunk-AQVIQODP.js +69 -0
- package/dist/chunk-AQVIQODP.js.map +1 -0
- package/dist/chunk-CQSM6JCO.js +65 -0
- package/dist/chunk-CQSM6JCO.js.map +1 -0
- package/dist/chunk-DGXKSYZ2.js +144 -0
- package/dist/chunk-DGXKSYZ2.js.map +1 -0
- package/dist/chunk-ECMGWPU5.js +174 -0
- package/dist/chunk-ECMGWPU5.js.map +1 -0
- package/dist/chunk-EDDPJB52.js +61 -0
- package/dist/chunk-EDDPJB52.js.map +1 -0
- package/dist/chunk-FD6QZZQY.js +69 -0
- package/dist/chunk-FD6QZZQY.js.map +1 -0
- package/dist/chunk-FGNKLXJK.js +165 -0
- package/dist/chunk-FGNKLXJK.js.map +1 -0
- package/dist/chunk-FT27KFX7.js +145 -0
- package/dist/chunk-FT27KFX7.js.map +1 -0
- package/dist/chunk-G52YPZRU.js +95 -0
- package/dist/chunk-G52YPZRU.js.map +1 -0
- package/dist/chunk-JNYTH4BZ.js +151 -0
- package/dist/chunk-JNYTH4BZ.js.map +1 -0
- package/dist/chunk-JQ7VQ5SB.js +137 -0
- package/dist/chunk-JQ7VQ5SB.js.map +1 -0
- package/dist/chunk-K4JKFIA2.js +196 -0
- package/dist/chunk-K4JKFIA2.js.map +1 -0
- package/dist/chunk-KFICWJI6.js +61 -0
- package/dist/chunk-KFICWJI6.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-LKEYLW4N.js +174 -0
- package/dist/chunk-LKEYLW4N.js.map +1 -0
- package/dist/chunk-LNRB4XMK.js +87 -0
- package/dist/chunk-LNRB4XMK.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-NJ56ZKR4.js +63 -0
- package/dist/chunk-NJ56ZKR4.js.map +1 -0
- package/dist/chunk-OQPXX6GH.js +89 -0
- package/dist/chunk-OQPXX6GH.js.map +1 -0
- package/dist/chunk-ORQ4NCWG.js +63 -0
- package/dist/chunk-ORQ4NCWG.js.map +1 -0
- package/dist/chunk-OW53EUJW.js +95 -0
- package/dist/chunk-OW53EUJW.js.map +1 -0
- package/dist/chunk-QB73IVKI.js +43 -0
- package/dist/chunk-QB73IVKI.js.map +1 -0
- package/dist/chunk-QFEZIPWJ.js +64 -0
- package/dist/chunk-QFEZIPWJ.js.map +1 -0
- package/dist/chunk-RYK2ILB2.js +105 -0
- package/dist/chunk-RYK2ILB2.js.map +1 -0
- package/dist/chunk-S2M6OJER.js +95 -0
- package/dist/chunk-S2M6OJER.js.map +1 -0
- package/dist/chunk-SYGLFURC.js +49 -0
- package/dist/chunk-SYGLFURC.js.map +1 -0
- package/dist/chunk-SZA3RAKD.js +51 -0
- package/dist/chunk-SZA3RAKD.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-UCBF57MG.js +196 -0
- package/dist/chunk-UCBF57MG.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-VIKHKUHF.js +89 -0
- package/dist/chunk-VIKHKUHF.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-WS7IOHVK.js +51 -0
- package/dist/chunk-WS7IOHVK.js.map +1 -0
- package/dist/chunk-YZ7LP3PU.js +101 -0
- package/dist/chunk-YZ7LP3PU.js.map +1 -0
- package/dist/chunk-ZADYUJIV.js +64 -0
- package/dist/chunk-ZADYUJIV.js.map +1 -0
- package/dist/context/index.js +5 -5
- package/dist/index.cjs +3 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +12 -0
- package/dist/index.js +150 -150
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/index.js +16 -16
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-comp.js +4 -4
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-body.js +9 -9
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-footer.js +2 -2
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-header.js +3 -3
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-layout.js +3 -3
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-radio.js +5 -5
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-satisfaction-option.js +5 -5
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-satisfaction-text.js +5 -5
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-text.js +5 -5
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/complete-review.js +4 -4
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/index.js +20 -20
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/start-review.js +7 -7
- package/dist/molecules/curriculumV2/CurriculumContents/curriculum-ai-traning.js +3 -3
- package/dist/molecules/curriculumV2/CurriculumContents/curriculum-review.js +22 -22
- package/dist/molecules/curriculumV2/CurriculumContents/index.js +26 -26
- package/dist/molecules/curriculumV2/CurriculumSidebar/Items/curriculum-item-title.js +2 -2
- package/dist/molecules/curriculumV2/CurriculumSidebar/Items/curriculum-sidebar-item-wrapper.js +2 -2
- package/dist/molecules/curriculumV2/CurriculumSidebar/Items/section-item.js +4 -4
- package/dist/molecules/curriculumV2/CurriculumSidebar/index.js +9 -9
- package/dist/molecules/curriculumV2/CurriculumSidebar/sidebar-item.js +7 -7
- package/dist/molecules/curriculumV2/curriculum-sub-nav.js +4 -4
- package/dist/molecules/curriculumV2/curriculum-v2-layout.js +3 -3
- package/dist/molecules/curriculumV2/index.js +37 -37
- package/dist/molecules/date-picker/date-picker-button.js +6 -6
- package/dist/molecules/date-picker/index.js +5 -5
- package/dist/molecules/download-card.js +2 -2
- package/dist/molecules/dynamic-field.js +4 -4
- package/dist/molecules/dynamic-form.js +5 -5
- package/dist/molecules/expand-table/index.js +4 -4
- package/dist/molecules/force-refresh.js +2 -2
- package/dist/molecules/ghost-post.js +4 -4
- package/dist/molecules/index.js +72 -72
- package/dist/molecules/learning-post.js +5 -5
- package/dist/molecules/navigation.js +3 -3
- package/dist/molecules/one-on-one-guide-list.js +3 -3
- package/dist/molecules/stepper.js +4 -4
- package/dist/molecules/tag-selector.js +5 -5
- package/package.json +1 -1
- package/src/atoms/drawer.tsx +17 -18
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DatePickerButton
|
|
3
|
+
} from "./chunk-XLTMDAE3.js";
|
|
4
|
+
import {
|
|
5
|
+
Form
|
|
6
|
+
} from "./chunk-2OMSNCRH.js";
|
|
7
|
+
import {
|
|
8
|
+
TextArea
|
|
9
|
+
} from "./chunk-5XYPLDI5.js";
|
|
10
|
+
import {
|
|
11
|
+
TextField
|
|
12
|
+
} from "./chunk-6NPTJBFE.js";
|
|
13
|
+
import {
|
|
14
|
+
Flex
|
|
15
|
+
} from "./chunk-25HMMI7R.js";
|
|
16
|
+
import {
|
|
17
|
+
Button
|
|
18
|
+
} from "./chunk-ZVDAEY5Q.js";
|
|
19
|
+
import {
|
|
20
|
+
Card
|
|
21
|
+
} from "./chunk-RP2RGCAW.js";
|
|
22
|
+
import {
|
|
23
|
+
__spreadValues
|
|
24
|
+
} from "./chunk-CRTRMMJ7.js";
|
|
25
|
+
|
|
26
|
+
// src/app/platform/goal-manage-card-edit.tsx
|
|
27
|
+
import { useCallback, useState } from "react";
|
|
28
|
+
import { format } from "date-fns";
|
|
29
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
30
|
+
var initialValues = {
|
|
31
|
+
goal: "",
|
|
32
|
+
effect: "",
|
|
33
|
+
huddle: "",
|
|
34
|
+
dueDate: void 0
|
|
35
|
+
};
|
|
36
|
+
var dummyFn = () => {
|
|
37
|
+
};
|
|
38
|
+
function GoalManageCardEdit(props) {
|
|
39
|
+
const { defaultValues, errors } = props;
|
|
40
|
+
const [values, setValues] = useState(defaultValues || initialValues);
|
|
41
|
+
const onChange = useCallback(
|
|
42
|
+
(v) => {
|
|
43
|
+
var _a;
|
|
44
|
+
setValues((prev) => __spreadValues(__spreadValues({}, prev), v));
|
|
45
|
+
(_a = props.onChange) == null ? void 0 : _a.call(props, v);
|
|
46
|
+
},
|
|
47
|
+
[props]
|
|
48
|
+
);
|
|
49
|
+
const onClickInit = useCallback(() => {
|
|
50
|
+
var _a;
|
|
51
|
+
setValues(initialValues);
|
|
52
|
+
(_a = props.onChange) == null ? void 0 : _a.call(props, defaultValues || initialValues);
|
|
53
|
+
}, [defaultValues, props]);
|
|
54
|
+
const onClickSubmit = useCallback(() => {
|
|
55
|
+
var _a;
|
|
56
|
+
(_a = props.onSubmit) == null ? void 0 : _a.call(props, values);
|
|
57
|
+
}, [props, values]);
|
|
58
|
+
return /* @__PURE__ */ jsx(Card, { style: { width: "100%" }, children: /* @__PURE__ */ jsxs(Form.Root, { onSubmit: dummyFn, children: [
|
|
59
|
+
/* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "5", children: [
|
|
60
|
+
/* @__PURE__ */ jsxs(Form.Field, { name: "title", children: [
|
|
61
|
+
/* @__PURE__ */ jsx(Form.Label, { children: "\uC774\uBC88 \uCF54\uCE6D\uC758 \uBAA9\uD45C\uB294 \uC544\uB798\uC640 \uAC19\uC2B5\uB2C8\uB2E4" }),
|
|
62
|
+
/* @__PURE__ */ jsx(
|
|
63
|
+
TextField.Root,
|
|
64
|
+
{
|
|
65
|
+
error: Boolean(errors == null ? void 0 : errors.goal),
|
|
66
|
+
onChange: (e) => {
|
|
67
|
+
onChange({ goal: e.target.value });
|
|
68
|
+
},
|
|
69
|
+
placeholder: "\uC774\uBC88 \uCF54\uCE6D \uACFC\uC815\uC758 \uBAA9\uD45C\uB97C \uD55C \uBB38\uC7A5\uC73C\uB85C \uC801\uC5B4\uC8FC\uC138\uC694",
|
|
70
|
+
value: values.goal
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
/* @__PURE__ */ jsx(Form.Message, { forceMatch: Boolean(errors == null ? void 0 : errors.goal), children: errors == null ? void 0 : errors.goal })
|
|
74
|
+
] }),
|
|
75
|
+
/* @__PURE__ */ jsxs(Form.Field, { name: "effect", children: [
|
|
76
|
+
/* @__PURE__ */ jsx(Form.Label, { children: "\uAE30\uB300\uD6A8\uACFC" }),
|
|
77
|
+
/* @__PURE__ */ jsx(
|
|
78
|
+
TextArea,
|
|
79
|
+
{
|
|
80
|
+
error: Boolean(errors == null ? void 0 : errors.effect),
|
|
81
|
+
onChange: (e) => {
|
|
82
|
+
onChange({ effect: e.target.value });
|
|
83
|
+
},
|
|
84
|
+
placeholder: "\uC608\uC2DC : \uD300\uC6D0\uB4E4\uACFC \uB354 \uCE5C\uBC00\uD574\uC9C0\uACE0, \uD300\uC6D0\uB4E4\uC5D0 \uB300\uD55C \uC774\uD574\uB3C4\uAC00 \uC313\uC774\uBA70 \uB354 \uD6A8\uC728\uC801\uC778 \uC778\uC7AC\uAD00\uB9AC\uB97C \uC704\uD55C \uAD00\uACC4\uD615\uC131\uC774 \uAC00\uB2A5\uD574\uC9D1\uB2C8\uB2E4.",
|
|
85
|
+
resize: "vertical",
|
|
86
|
+
value: values.effect
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
/* @__PURE__ */ jsx(Form.Message, { forceMatch: Boolean(errors == null ? void 0 : errors.effect), children: errors == null ? void 0 : errors.effect })
|
|
90
|
+
] }),
|
|
91
|
+
/* @__PURE__ */ jsxs(Form.Field, { name: "huddle", children: [
|
|
92
|
+
/* @__PURE__ */ jsx(Form.Label, { children: "\uBC29\uD574\uC694\uC18C" }),
|
|
93
|
+
/* @__PURE__ */ jsx(
|
|
94
|
+
TextArea,
|
|
95
|
+
{
|
|
96
|
+
error: Boolean(errors == null ? void 0 : errors.huddle),
|
|
97
|
+
onChange: (e) => {
|
|
98
|
+
onChange({ huddle: e.target.value });
|
|
99
|
+
},
|
|
100
|
+
placeholder: `- \uAC11\uC790\uAE30 \uC7A1\uD788\uB294 \uBBF8\uD305\uB4E4
|
|
101
|
+
- MZ \uC138\uB300\uC640\uC758 \uC790\uC5F0\uC2A4\uB7FD\uC9C0 \uC54A\uC740 \uC18C\uD1B5
|
|
102
|
+
- \uB300\uD654\uC5D0\uC11C \uCC38\uC744\uC131 \uBD80\uC871`,
|
|
103
|
+
resize: "vertical",
|
|
104
|
+
value: values.huddle
|
|
105
|
+
}
|
|
106
|
+
),
|
|
107
|
+
/* @__PURE__ */ jsx(Form.Message, { forceMatch: Boolean(errors == null ? void 0 : errors.huddle), children: errors == null ? void 0 : errors.huddle })
|
|
108
|
+
] }),
|
|
109
|
+
/* @__PURE__ */ jsxs(Form.Field, { name: "dueDate", children: [
|
|
110
|
+
/* @__PURE__ */ jsx(Form.Label, { children: "\uBAA9\uD45C \uB2EC\uC131 \uAE30\uD55C\uC740 \uB2E4\uC74C\uACFC \uAC19\uC2B5\uB2C8\uB2E4" }),
|
|
111
|
+
/* @__PURE__ */ jsx(
|
|
112
|
+
DatePickerButton,
|
|
113
|
+
{
|
|
114
|
+
format: (v) => format(v, "yyyy\uB144 MM\uC6D4 dd\uC77C"),
|
|
115
|
+
onChange: (date) => {
|
|
116
|
+
date && onChange({ dueDate: date });
|
|
117
|
+
},
|
|
118
|
+
placeholder: "YYYY\uB144 MM\uC6D4 DD\uC77C",
|
|
119
|
+
selected: values.dueDate
|
|
120
|
+
}
|
|
121
|
+
),
|
|
122
|
+
/* @__PURE__ */ jsx(Form.Message, { forceMatch: Boolean(errors == null ? void 0 : errors.dueDate), children: errors == null ? void 0 : errors.dueDate })
|
|
123
|
+
] })
|
|
124
|
+
] }),
|
|
125
|
+
/* @__PURE__ */ jsxs(Flex, { gap: "3", justify: "end", width: "100%", children: [
|
|
126
|
+
/* @__PURE__ */ jsx(
|
|
127
|
+
Button,
|
|
128
|
+
{
|
|
129
|
+
color: "gray",
|
|
130
|
+
onClick: onClickInit,
|
|
131
|
+
size: "small",
|
|
132
|
+
type: "button",
|
|
133
|
+
variant: "outline",
|
|
134
|
+
children: "\uCD08\uAE30\uD654\uD558\uAE30"
|
|
135
|
+
}
|
|
136
|
+
),
|
|
137
|
+
/* @__PURE__ */ jsx(Button, { onClick: onClickSubmit, size: "small", type: "button", children: "\uC800\uC7A5\uD558\uAE30" })
|
|
138
|
+
] })
|
|
139
|
+
] }) });
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export {
|
|
143
|
+
GoalManageCardEdit
|
|
144
|
+
};
|
|
145
|
+
//# sourceMappingURL=chunk-FT27KFX7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/app/platform/goal-manage-card-edit.tsx"],"sourcesContent":["import React, { useCallback, useState } from 'react';\nimport { format } from 'date-fns';\nimport { Button, Card, Flex, Form, TextArea, TextField } from '../../atoms';\nimport { DatePickerButton } from '../../molecules';\n\ninterface Values {\n goal?: string;\n effect?: string;\n huddle?: string;\n dueDate?: Date;\n}\n\ninterface GoalManageCardEditProps {\n onChange?: (values: Partial<Values>) => void;\n defaultValues?: Values;\n errors?: { [key in keyof Values]: string };\n onSubmit?: (values: Values) => void;\n}\n\nconst initialValues: Values = {\n goal: '',\n effect: '',\n huddle: '',\n dueDate: undefined,\n};\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function -- dummy용 함수\nconst dummyFn = (): void => {};\n\nexport function GoalManageCardEdit(\n props: GoalManageCardEditProps\n): React.ReactNode {\n const { defaultValues, errors } = props;\n const [values, setValues] = useState(defaultValues || initialValues);\n\n const onChange = useCallback(\n (v: Partial<Values>) => {\n setValues((prev) => ({ ...prev, ...v }));\n props.onChange?.(v);\n },\n [props]\n );\n\n const onClickInit = useCallback(() => {\n setValues(initialValues);\n props.onChange?.(defaultValues || initialValues);\n }, [defaultValues, props]);\n\n const onClickSubmit = useCallback(() => {\n props.onSubmit?.(values);\n }, [props, values]);\n\n return (\n <Card style={{ width: '100%' }}>\n <Form.Root onSubmit={dummyFn}>\n <Flex direction=\"column\" gap=\"5\">\n <Form.Field name=\"title\">\n <Form.Label>이번 코칭의 목표는 아래와 같습니다</Form.Label>\n <TextField.Root\n error={Boolean(errors?.goal)}\n onChange={(e) => {\n onChange({ goal: e.target.value });\n }}\n placeholder=\"이번 코칭 과정의 목표를 한 문장으로 적어주세요\"\n value={values.goal}\n />\n <Form.Message forceMatch={Boolean(errors?.goal)}>\n {errors?.goal}\n </Form.Message>\n </Form.Field>\n\n <Form.Field name=\"effect\">\n <Form.Label>기대효과</Form.Label>\n <TextArea\n error={Boolean(errors?.effect)}\n onChange={(e) => {\n onChange({ effect: e.target.value });\n }}\n placeholder=\"예시 : 팀원들과 더 친밀해지고, 팀원들에 대한 이해도가 쌓이며 더 효율적인 인재관리를 위한 관계형성이 가능해집니다.\"\n resize=\"vertical\"\n value={values.effect}\n />\n <Form.Message forceMatch={Boolean(errors?.effect)}>\n {errors?.effect}\n </Form.Message>\n </Form.Field>\n\n <Form.Field name=\"huddle\">\n <Form.Label>방해요소</Form.Label>\n <TextArea\n error={Boolean(errors?.huddle)}\n onChange={(e) => {\n onChange({ huddle: e.target.value });\n }}\n placeholder={`- 갑자기 잡히는 미팅들\n- MZ 세대와의 자연스럽지 않은 소통\n- 대화에서 참을성 부족`}\n resize=\"vertical\"\n value={values.huddle}\n />\n <Form.Message forceMatch={Boolean(errors?.huddle)}>\n {errors?.huddle}\n </Form.Message>\n </Form.Field>\n\n <Form.Field name=\"dueDate\">\n <Form.Label>목표 달성 기한은 다음과 같습니다</Form.Label>\n <DatePickerButton\n format={(v) => format(v, 'yyyy년 MM월 dd일')}\n onChange={(date) => {\n date && onChange({ dueDate: date });\n }}\n placeholder=\"YYYY년 MM월 DD일\"\n selected={values.dueDate}\n />\n <Form.Message forceMatch={Boolean(errors?.dueDate)}>\n {errors?.dueDate}\n </Form.Message>\n </Form.Field>\n </Flex>\n\n <Flex gap=\"3\" justify=\"end\" width=\"100%\">\n <Button\n color=\"gray\"\n onClick={onClickInit}\n size=\"small\"\n type=\"button\"\n variant=\"outline\"\n >\n 초기화하기\n </Button>\n <Button onClick={onClickSubmit} size=\"small\" type=\"button\">\n 저장하기\n </Button>\n </Flex>\n </Form.Root>\n </Card>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAgB,aAAa,gBAAgB;AAC7C,SAAS,cAAc;AAuDb,SACE,KADF;AArCV,IAAM,gBAAwB;AAAA,EAC5B,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AACX;AAGA,IAAM,UAAU,MAAY;AAAC;AAEtB,SAAS,mBACd,OACiB;AACjB,QAAM,EAAE,eAAe,OAAO,IAAI;AAClC,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,iBAAiB,aAAa;AAEnE,QAAM,W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AQ,MAAK,UAAS,sCAE3D;AAAA,OACF;AAAA,KACF,GACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ClosePanelArrowIcon
|
|
3
|
+
} from "./chunk-645GPOW2.js";
|
|
4
|
+
import {
|
|
5
|
+
usePortalContainer
|
|
6
|
+
} from "./chunk-U7N2PWMO.js";
|
|
7
|
+
import {
|
|
8
|
+
IconButton
|
|
9
|
+
} from "./chunk-XK6VEVOK.js";
|
|
10
|
+
import {
|
|
11
|
+
Flex
|
|
12
|
+
} from "./chunk-25HMMI7R.js";
|
|
13
|
+
import {
|
|
14
|
+
__objRest,
|
|
15
|
+
__spreadProps,
|
|
16
|
+
__spreadValues
|
|
17
|
+
} from "./chunk-CRTRMMJ7.js";
|
|
18
|
+
|
|
19
|
+
// src/atoms/drawer.tsx
|
|
20
|
+
import * as Dialog from "@radix-ui/react-dialog";
|
|
21
|
+
import { Grid, Theme } from "@radix-ui/themes";
|
|
22
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
23
|
+
function Root2(props) {
|
|
24
|
+
return /* @__PURE__ */ jsx(Dialog.Root, __spreadValues({}, props));
|
|
25
|
+
}
|
|
26
|
+
var preventDefault = (e) => {
|
|
27
|
+
e.preventDefault();
|
|
28
|
+
};
|
|
29
|
+
function Content2(props) {
|
|
30
|
+
const _a = props, {
|
|
31
|
+
position = "right",
|
|
32
|
+
className,
|
|
33
|
+
children,
|
|
34
|
+
HeaderContent,
|
|
35
|
+
hideHeader
|
|
36
|
+
} = _a, rest = __objRest(_a, [
|
|
37
|
+
"position",
|
|
38
|
+
"className",
|
|
39
|
+
"children",
|
|
40
|
+
"HeaderContent",
|
|
41
|
+
"hideHeader"
|
|
42
|
+
]);
|
|
43
|
+
const mobileHeaderSize = 48;
|
|
44
|
+
const desktopHeaderSize = 64;
|
|
45
|
+
const separatorSize = 1;
|
|
46
|
+
const { drawerContainerRef } = usePortalContainer();
|
|
47
|
+
return /* @__PURE__ */ jsx(Dialog.Portal, { container: drawerContainerRef.current, children: /* @__PURE__ */ jsxs(Theme, { children: [
|
|
48
|
+
/* @__PURE__ */ jsx(Dialog.Overlay, { className: "DrawerOverlay" }),
|
|
49
|
+
/* @__PURE__ */ jsx(
|
|
50
|
+
Dialog.Content,
|
|
51
|
+
__spreadProps(__spreadValues({
|
|
52
|
+
className: `DrawerContent ${position} ${className || ""}`,
|
|
53
|
+
onPointerDownOutside: preventDefault
|
|
54
|
+
}, rest), {
|
|
55
|
+
children: /* @__PURE__ */ jsxs(
|
|
56
|
+
Grid,
|
|
57
|
+
{
|
|
58
|
+
height: "100%",
|
|
59
|
+
overflow: "hidden",
|
|
60
|
+
rows: hideHeader ? "1" : {
|
|
61
|
+
initial: `${mobileHeaderSize}px ${separatorSize}px calc(100% - ${mobileHeaderSize + separatorSize}px)`,
|
|
62
|
+
sm: `${desktopHeaderSize}px ${separatorSize}px calc(100% - ${desktopHeaderSize + separatorSize}px)`
|
|
63
|
+
},
|
|
64
|
+
children: [
|
|
65
|
+
!hideHeader && /* @__PURE__ */ jsxs(Flex, { align: "center", gap: "3", px: { initial: "4", md: "6" }, children: [
|
|
66
|
+
/* @__PURE__ */ jsx(Dialog.Close, { asChild: true, children: /* @__PURE__ */ jsx(IconButton, { color: "gray", variant: "outline", children: /* @__PURE__ */ jsx(ClosePanelArrowIcon, {}) }) }),
|
|
67
|
+
HeaderContent
|
|
68
|
+
] }),
|
|
69
|
+
children
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
})
|
|
74
|
+
)
|
|
75
|
+
] }) });
|
|
76
|
+
}
|
|
77
|
+
function Trigger2(props) {
|
|
78
|
+
return /* @__PURE__ */ jsx(Dialog.Trigger, __spreadValues({ asChild: true }, props));
|
|
79
|
+
}
|
|
80
|
+
var Drawer = {
|
|
81
|
+
Root: Dialog.Root,
|
|
82
|
+
Trigger: Trigger2,
|
|
83
|
+
Content: Content2,
|
|
84
|
+
Close: Dialog.Close,
|
|
85
|
+
Title: Dialog.Title,
|
|
86
|
+
Description: Dialog.Description
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export {
|
|
90
|
+
Root2 as Root,
|
|
91
|
+
Content2 as Content,
|
|
92
|
+
Trigger2 as Trigger,
|
|
93
|
+
Drawer
|
|
94
|
+
};
|
|
95
|
+
//# sourceMappingURL=chunk-G52YPZRU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/atoms/drawer.tsx"],"sourcesContent":["import React from 'react';\nimport * as Dialog from '@radix-ui/react-dialog';\nimport { Grid, Theme } from '@radix-ui/themes';\nimport { usePortalContainer } from '@/theme/portal-provider';\nimport { ClosePanelArrowIcon } from '../icons/close-panel-arrow';\nimport { Flex } from './flex';\nimport { IconButton } from './icon-button';\n\nexport function Root(props: Dialog.DialogProps): React.ReactNode {\n return <Dialog.Root {...props} />;\n}\n\ntype ContentProps = Dialog.DialogContentProps & {\n /** Drawer가 붙는 위치, 기본값 right */\n position?: 'left' | 'right' | 'bottom' | 'top';\n HeaderContent?: React.ReactNode;\n hideHeader?: boolean;\n};\n\nconst preventDefault: Dialog.DialogContentProps['onPointerDownOutside'] = (\n e\n) => {\n e.preventDefault();\n};\n\nexport function Content(props: ContentProps): React.ReactNode {\n const {\n position = 'right',\n className,\n children,\n HeaderContent,\n hideHeader,\n ...rest\n } = props;\n\n const mobileHeaderSize = 48;\n const desktopHeaderSize = 64;\n const separatorSize = 1;\n const { drawerContainerRef } = usePortalContainer();\n\n return (\n <Dialog.Portal container={drawerContainerRef.current}>\n <Theme>\n <Dialog.Overlay className=\"DrawerOverlay\" />\n <Dialog.Content\n className={`DrawerContent ${position} ${className || ''}`}\n onPointerDownOutside={preventDefault}\n {...rest}\n >\n <Grid\n height=\"100%\"\n overflow=\"hidden\"\n rows={\n hideHeader\n ? '1'\n : {\n initial: `${mobileHeaderSize}px ${separatorSize}px calc(100% - ${mobileHeaderSize + separatorSize}px)`,\n sm: `${desktopHeaderSize}px ${separatorSize}px calc(100% - ${desktopHeaderSize + separatorSize}px)`,\n }\n }\n >\n {!hideHeader && (\n <Flex align=\"center\" gap=\"3\" px={{ initial: '4', md: '6' }}>\n <Dialog.Close asChild>\n <IconButton color=\"gray\" variant=\"outline\">\n <ClosePanelArrowIcon />\n </IconButton>\n </Dialog.Close>\n {HeaderContent}\n </Flex>\n )}\n {children}\n </Grid>\n </Dialog.Content>\n </Theme>\n </Dialog.Portal>\n );\n}\n\nexport function Trigger(props: Dialog.DialogTriggerProps): React.ReactNode {\n return <Dialog.Trigger asChild {...props} />;\n}\n\nexport const Drawer = {\n Root: Dialog.Root,\n Trigger,\n Content,\n Close: Dialog.Close,\n Title: Dialog.Title,\n Description: Dialog.Description,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AACA,YAAY,YAAY;AACxB,SAAS,MAAM,aAAa;AAOnB,cAqDK,YArDL;AADF,SAASA,MAAK,OAA4C;AAC/D,SAAO,oBAAQ,aAAP,mBAAgB,MAAO;AACjC;AASA,IAAM,iBAAoE,CACxE,MACG;AACH,IAAE,eAAe;AACnB;AAEO,SAASC,SAAQ,OAAsC;AAC5D,QAOI,YANF;AAAA,eAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EA/BJ,IAiCM,IADC,iBACD,IADC;AAAA,IALH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAIF,QAAM,mBAAmB;AACzB,QAAM,oBAAoB;AAC1B,QAAM,gBAAgB;AACtB,QAAM,EAAE,mBAAmB,IAAI,mBAAmB;AAElD,SACE,oBAAQ,eAAP,EAAc,WAAW,mBAAmB,SAC3C,+BAAC,SACC;AAAA,wBAAQ,gBAAP,EAAe,WAAU,iBAAgB;AAAA,IAC1C;AAAA,MAAQ;AAAA,MAAP;AAAA,QACC,WAAW,iBAAiB,QAAQ,IAAI,aAAa,EAAE;AAAA,QACvD,sBAAsB;AAAA,SAClB,OAHL;AAAA,QAKC;AAAA,UAAC;AAAA;AAAA,YACC,QAAO;AAAA,YACP,UAAS;AAAA,YACT,MACE,aACI,MACA;AAAA,cACE,SAAS,GAAG,gBAAgB,MAAM,aAAa,kBAAkB,mBAAmB,aAAa;AAAA,cACjG,IAAI,GAAG,iBAAiB,MAAM,aAAa,kBAAkB,oBAAoB,aAAa;AAAA,YAChG;AAAA,YAGL;AAAA,eAAC,cACA,qBAAC,QAAK,OAAM,UAAS,KAAI,KAAI,IAAI,EAAE,SAAS,KAAK,IAAI,IAAI,GACvD;AAAA,oCAAQ,cAAP,EAAa,SAAO,MACnB,8BAAC,cAAW,OAAM,QAAO,SAAQ,WAC/B,8BAAC,uBAAoB,GACvB,GACF;AAAA,gBACC;AAAA,iBACH;AAAA,cAED;AAAA;AAAA;AAAA,QACH;AAAA;AAAA,IACF;AAAA,KACF,GACF;AAEJ;AAEO,SAASC,SAAQ,OAAmD;AACzE,SAAO,oBAAQ,gBAAP,iBAAe,SAAO,QAAK,MAAO;AAC5C;AAEO,IAAM,SAAS;AAAA,EACpB,MAAa;AAAA,EACb,SAAAA;AAAA,EACA,SAAAD;AAAA,EACA,OAAc;AAAA,EACd,OAAc;AAAA,EACd,aAAoB;AACtB;","names":["Root","Content","Trigger"]}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useCurriculumReviewContext
|
|
3
|
+
} from "./chunk-GMKRNFH5.js";
|
|
4
|
+
import {
|
|
5
|
+
getCurriculumIcon,
|
|
6
|
+
getCurriculumQuestionIconColor,
|
|
7
|
+
getCurriculumQuestionTypeDescription
|
|
8
|
+
} from "./chunk-JF7JAMOQ.js";
|
|
9
|
+
import {
|
|
10
|
+
Separator
|
|
11
|
+
} from "./chunk-HYITAA4J.js";
|
|
12
|
+
import {
|
|
13
|
+
Grid
|
|
14
|
+
} from "./chunk-EGEQY3KT.js";
|
|
15
|
+
import {
|
|
16
|
+
Flex
|
|
17
|
+
} from "./chunk-25HMMI7R.js";
|
|
18
|
+
import {
|
|
19
|
+
Button
|
|
20
|
+
} from "./chunk-ZVDAEY5Q.js";
|
|
21
|
+
import {
|
|
22
|
+
Badge
|
|
23
|
+
} from "./chunk-U3BQT7ZO.js";
|
|
24
|
+
import {
|
|
25
|
+
Box
|
|
26
|
+
} from "./chunk-4Y5BEXVN.js";
|
|
27
|
+
import {
|
|
28
|
+
Heading
|
|
29
|
+
} from "./chunk-BESTU2AY.js";
|
|
30
|
+
import {
|
|
31
|
+
Typo
|
|
32
|
+
} from "./chunk-PMJIFLDT.js";
|
|
33
|
+
|
|
34
|
+
// src/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/start-review.tsx
|
|
35
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
36
|
+
var renderPreviewContent = (args) => {
|
|
37
|
+
const { question } = args;
|
|
38
|
+
const Icon = getCurriculumIcon({
|
|
39
|
+
type: question.type,
|
|
40
|
+
icon: question.icon
|
|
41
|
+
});
|
|
42
|
+
const getDescription = () => {
|
|
43
|
+
return [
|
|
44
|
+
getCurriculumQuestionTypeDescription(question.type),
|
|
45
|
+
question.duration ? `${question.duration}\uBD84` : ""
|
|
46
|
+
].filter(Boolean).join(" | ");
|
|
47
|
+
};
|
|
48
|
+
return /* @__PURE__ */ jsxs(
|
|
49
|
+
Grid,
|
|
50
|
+
{
|
|
51
|
+
columns: "16px 1fr",
|
|
52
|
+
gap: "2",
|
|
53
|
+
px: "4",
|
|
54
|
+
py: "2",
|
|
55
|
+
width: "100%",
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ jsx(Box, { mt: "1", children: /* @__PURE__ */ jsx(Icon, { color: getCurriculumQuestionIconColor(question.type) }) }),
|
|
58
|
+
/* @__PURE__ */ jsxs(Box, { children: [
|
|
59
|
+
/* @__PURE__ */ jsx(Typo, { as: "p", color: "gray", weight: "bold", children: question.title }),
|
|
60
|
+
/* @__PURE__ */ jsx(Typo, { color: "gray", children: getDescription() })
|
|
61
|
+
] })
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
question.uuid
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
var getReviewContentValue = (question, answer) => {
|
|
68
|
+
var _a, _b, _c;
|
|
69
|
+
if (question.type === "question_satisfaction_option") {
|
|
70
|
+
return (_c = (_b = (_a = question.options) == null ? void 0 : _a.find((option) => option.value === Number(answer))) == null ? void 0 : _b.label) != null ? _c : "";
|
|
71
|
+
}
|
|
72
|
+
return answer;
|
|
73
|
+
};
|
|
74
|
+
var renderReviewContent = (args) => {
|
|
75
|
+
const { question, answer } = args;
|
|
76
|
+
const Icon = getCurriculumIcon({
|
|
77
|
+
type: question.type,
|
|
78
|
+
icon: question.icon
|
|
79
|
+
});
|
|
80
|
+
const color = getCurriculumQuestionIconColor(question.type);
|
|
81
|
+
const badgeColor = ["question_radio", "question_satisfaction_option"].includes(question.type) ? "accent" : "neutral";
|
|
82
|
+
const value = getReviewContentValue(question, answer);
|
|
83
|
+
return /* @__PURE__ */ jsxs(
|
|
84
|
+
Grid,
|
|
85
|
+
{
|
|
86
|
+
columns: "16px 1fr",
|
|
87
|
+
gap: "2",
|
|
88
|
+
px: "4",
|
|
89
|
+
py: "2",
|
|
90
|
+
width: "100%",
|
|
91
|
+
children: [
|
|
92
|
+
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Icon, { color }) }),
|
|
93
|
+
/* @__PURE__ */ jsxs(Box, { children: [
|
|
94
|
+
/* @__PURE__ */ jsx(Typo, { as: "p", color: "gray", mb: "2", weight: "bold", children: question.title }),
|
|
95
|
+
/* @__PURE__ */ jsx(Badge, { color: badgeColor, size: "large", style: { whiteSpace: "break-spaces", lineBreak: "anywhere" }, children: value || "(\uBBF8 \uC751\uB2F5)" })
|
|
96
|
+
] })
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
question.uuid
|
|
100
|
+
);
|
|
101
|
+
};
|
|
102
|
+
function StartReview({ onStart }) {
|
|
103
|
+
const { curriculum, reviewContents, sectionTitle, done, formik } = useCurriculumReviewContext();
|
|
104
|
+
return /* @__PURE__ */ jsx(
|
|
105
|
+
Flex,
|
|
106
|
+
{
|
|
107
|
+
align: "center",
|
|
108
|
+
direction: "column",
|
|
109
|
+
height: "100%",
|
|
110
|
+
justify: "center",
|
|
111
|
+
width: "100%",
|
|
112
|
+
children: /* @__PURE__ */ jsxs(
|
|
113
|
+
Flex,
|
|
114
|
+
{
|
|
115
|
+
align: "center",
|
|
116
|
+
direction: "column",
|
|
117
|
+
height: "100%",
|
|
118
|
+
justify: "center",
|
|
119
|
+
maxWidth: "650px",
|
|
120
|
+
pb: { initial: "6", sm: "0" },
|
|
121
|
+
pt: { initial: "4", sm: "0" },
|
|
122
|
+
px: { initial: "4", sm: "0" },
|
|
123
|
+
width: "100%",
|
|
124
|
+
children: [
|
|
125
|
+
/* @__PURE__ */ jsx(Typo, { color: "gray", mb: "1", children: curriculum.title }),
|
|
126
|
+
/* @__PURE__ */ jsx(Heading, { variant: "heading3", children: reviewContents.title }),
|
|
127
|
+
/* @__PURE__ */ jsx(Separator, { my: "4", style: { width: 100 } }),
|
|
128
|
+
/* @__PURE__ */ jsxs(Typo, { align: "left", as: "p", color: "gray", mb: "4", children: [
|
|
129
|
+
/* @__PURE__ */ jsx(Typo, { as: "span", weight: "bold", children: sectionTitle }),
|
|
130
|
+
" ",
|
|
131
|
+
/* @__PURE__ */ jsx(Typo, { children: reviewContents.description })
|
|
132
|
+
] }),
|
|
133
|
+
/* @__PURE__ */ jsx(Box, { mb: "5", overflowY: "auto", width: "100%", children: reviewContents.questions.map((question) => {
|
|
134
|
+
if (done) {
|
|
135
|
+
return renderReviewContent({ question, answer: formik.values.answers[question.uuid] });
|
|
136
|
+
}
|
|
137
|
+
return renderPreviewContent({ question });
|
|
138
|
+
}) }),
|
|
139
|
+
/* @__PURE__ */ jsx(Button, { color: "yellow", onClick: onStart, variant: done ? "outline" : "solid", children: done ? "\uB098\uC758 \uC751\uB2F5 \uC218\uC815\uD558\uAE30" : reviewContents.buttonTitle })
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
}
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
var start_review_default = StartReview;
|
|
147
|
+
|
|
148
|
+
export {
|
|
149
|
+
start_review_default
|
|
150
|
+
};
|
|
151
|
+
//# sourceMappingURL=chunk-JNYTH4BZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/start-review.tsx"],"sourcesContent":["import React from 'react'; \nimport type { BadgeProps } from '@/atoms/badge';\nimport { Badge } from '@/atoms/badge';\nimport { Box } from '@/atoms/box';\nimport { Button } from '@/atoms/button';\nimport { Flex } from '@/atoms/flex';\nimport { Grid } from '@/atoms/grid';\nimport { Heading } from '@/atoms/heading';\nimport { Separator } from '@/atoms/separator';\nimport { Typo } from '@/atoms/typo';\nimport {\n getCurriculumIcon,\n getCurriculumQuestionIconColor,\n getCurriculumQuestionTypeDescription,\n} from '@/utils/curriculum.utils';\nimport type { ReviewQuestionElement } from '@/types/curriculum.type';\nimport { useCurriculumReviewContext } from './curriculum-review-context';\n\ninterface StartReviewProps {\n onStart: () => void;\n}\n\n\nconst renderPreviewContent = (args: {\n question: ReviewQuestionElement;\n}):React.ReactElement => {\n const { question } = args;\n const Icon = getCurriculumIcon({\n type: question.type,\n icon: question.icon,\n });\n const getDescription = (): string => {\n return [\n getCurriculumQuestionTypeDescription(question.type),\n question.duration ? `${question.duration}분` : '',\n ]\n .filter(Boolean)\n .join(' | ');\n };\n\n return (\n <Grid\n columns=\"16px 1fr\"\n gap=\"2\"\n key={question.uuid}\n px=\"4\"\n py=\"2\"\n width=\"100%\"\n >\n <Box mt=\"1\">\n <Icon color={getCurriculumQuestionIconColor(question.type)} />\n </Box>\n <Box>\n <Typo as=\"p\" color=\"gray\" weight=\"bold\">\n {question.title}\n </Typo>\n <Typo color=\"gray\">{getDescription()}</Typo>\n </Box>\n </Grid>\n );\n};\n\n\nconst getReviewContentValue = (question: ReviewQuestionElement, answer: string): string => {\n if(question.type === 'question_satisfaction_option'){ \n return question.options?.find((option)=>option.value === Number(answer))?.label ?? '';\n }\n return answer\n}\n\n\nconst renderReviewContent = (args: {\n question: ReviewQuestionElement;\n answer: string;\n}):React.ReactElement => {\n const { question, answer } = args;\n const Icon = getCurriculumIcon({\n type: question.type,\n icon: question.icon,\n }); \n\n const color = getCurriculumQuestionIconColor(question.type);\n const badgeColor: BadgeProps['color'] = ['question_radio','question_satisfaction_option'].includes(question.type) ? 'accent' : 'neutral';\n const value = getReviewContentValue(question, answer);\n\n return (\n <Grid\n columns=\"16px 1fr\"\n gap=\"2\"\n key={question.uuid}\n px=\"4\"\n py=\"2\"\n width=\"100%\"\n >\n <Box>\n <Icon color={color} />\n </Box>\n\n <Box>\n <Typo as=\"p\" color=\"gray\" mb=\"2\" weight=\"bold\">{question.title}</Typo>\n <Badge color={badgeColor} size=\"large\" style={{whiteSpace: 'break-spaces', lineBreak: 'anywhere'}}>\n {value || '(미 응답)'}\n </Badge>\n </Box>\n \n </Grid>\n );\n};\n\nfunction StartReview({ onStart }: StartReviewProps): React.ReactNode {\n const { curriculum, reviewContents, sectionTitle, done,formik } =\n useCurriculumReviewContext();\n\n return (\n <Flex\n align=\"center\"\n direction=\"column\"\n height=\"100%\"\n justify=\"center\"\n width=\"100%\"\n >\n <Flex\n align=\"center\"\n direction=\"column\"\n height=\"100%\"\n justify=\"center\"\n maxWidth=\"650px\"\n pb={{initial: '6', sm: '0'}}\n pt={{initial: '4', sm: '0'}}\n px={{initial: '4', sm: '0'}}\n width=\"100%\"\n >\n <Typo color=\"gray\" mb=\"1\">{curriculum.title}</Typo>\n <Heading variant=\"heading3\">{reviewContents.title}</Heading>\n <Separator my=\"4\" style={{ width: 100 }} />\n\n <Typo align=\"left\" as=\"p\" color=\"gray\" mb=\"4\">\n <Typo as=\"span\" weight=\"bold\">\n {sectionTitle}\n </Typo>\n {' '}\n <Typo>{reviewContents.description}</Typo>\n </Typo>\n\n <Box mb=\"5\" overflowY=\"auto\" width=\"100%\">\n {reviewContents.questions.map((question)=>{\n if(done){\n return renderReviewContent({ question, answer: formik.values.answers[question.uuid]});\n }\n return renderPreviewContent({ question });\n })}\n </Box>\n <Button color=\"yellow\" onClick={onStart} variant={done ? 'outline' : 'solid'}>\n {done ? '나의 응답 수정하기' : reviewContents.buttonTitle}\n </Button>\n </Flex>\n </Flex>\n );\n}\n\nexport default StartReview;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDQ,cAEF,YAFE;AA3BR,IAAM,uBAAuB,CAAC,SAEL;AACvB,QAAM,EAAE,SAAS,IAAI;AACrB,QAAM,OAAO,kBAAkB;AAAA,IAC7B,MAAM,SAAS;AAAA,IACf,MAAM,SAAS;AAAA,EACjB,CAAC;AACD,QAAM,iBAAiB,MAAc;AACnC,WAAO;AAAA,MACL,qCAAqC,SAAS,IAAI;AAAA,MAClD,SAAS,WAAW,GAAG,SAAS,QAAQ,WAAM;AAAA,IAChD,EACG,OAAO,OAAO,EACd,KAAK,KAAK;AAAA,EACf;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,SAAQ;AAAA,MACR,KAAI;AAAA,MAEJ,IAAG;AAAA,MACH,IAAG;AAAA,MACH,OAAM;AAAA,MAEN;AAAA,4BAAC,OAAI,IAAG,KACN,8BAAC,QAAK,OAAO,+BAA+B,SAAS,IAAI,GAAG,GAC9D;AAAA,QACA,qBAAC,OACC;AAAA,8BAAC,QAAK,IAAG,KAAI,OAAM,QAAO,QAAO,QAC9B,mBAAS,OACZ;AAAA,UACA,oBAAC,QAAK,OAAM,QAAQ,yBAAe,GAAE;AAAA,WACvC;AAAA;AAAA;AAAA,IAbK,SAAS;AAAA,EAchB;AAEJ;AAGA,IAAM,wBAAwB,CAAC,UAAiC,WAA2B;AA/D3F;AAgEE,MAAG,SAAS,SAAS,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U2AY.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: "rt-BaseDialogScroll rt-DialogScroll 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-JQ7VQ5SB.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=\"rt-BaseDialogScroll rt-DialogScroll 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":";;;;;;;;;;;;;;;;AAAA,YAAY,iBAAiB;AAC7B,SAAS,kBAAkB;AAC3B,SAA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