@tipp/ui 2.3.18 → 2.3.20
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 +91 -91
- package/dist/app/platform/coach-question-list.js +31 -31
- package/dist/app/platform/contents-card.js +31 -31
- package/dist/app/platform/curriculum-card.js +5 -5
- 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.js +31 -31
- 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.js +31 -31
- 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.js +31 -31
- package/dist/app/platform/userInfos/coaching-customer-info/index.js +36 -36
- package/dist/app/platform/userInfos/coaching-customer-info/large.js +31 -31
- package/dist/app/platform/userInfos/coaching-customer-info/medium.js +31 -31
- package/dist/app/platform/userInfos/coaching-customer-info/small.js +31 -31
- package/dist/app/platform/userInfos/session-user-info-detail.js +31 -31
- package/dist/app/platform/userInfos/utils.js +30 -30
- package/dist/atoms/bullet-text.js +2 -2
- package/dist/atoms/dialog.js +2 -2
- package/dist/atoms/field-error-wrapper.js +2 -2
- package/dist/atoms/index.js +62 -62
- package/dist/atoms/list.js +2 -2
- package/dist/atoms/pagination.js +3 -3
- package/dist/chunk-232ZBMFV.js +196 -0
- package/dist/chunk-232ZBMFV.js.map +1 -0
- package/dist/chunk-24572XRX.js +140 -0
- package/dist/chunk-24572XRX.js.map +1 -0
- package/dist/chunk-34XTOQID.js +140 -0
- package/dist/chunk-34XTOQID.js.map +1 -0
- package/dist/chunk-3A3VE6SX.js +160 -0
- package/dist/chunk-3A3VE6SX.js.map +1 -0
- package/dist/chunk-3LEW5RYJ.js +163 -0
- package/dist/chunk-3LEW5RYJ.js.map +1 -0
- package/dist/chunk-3MCSM3WD.js +163 -0
- package/dist/chunk-3MCSM3WD.js.map +1 -0
- package/dist/chunk-3MG2RPYN.js +163 -0
- package/dist/chunk-3MG2RPYN.js.map +1 -0
- package/dist/chunk-3P5XU4EK.js +87 -0
- package/dist/chunk-3P5XU4EK.js.map +1 -0
- package/dist/chunk-4SFBZJWH.js +140 -0
- package/dist/chunk-4SFBZJWH.js.map +1 -0
- package/dist/chunk-5IQ4474Z.js +89 -0
- package/dist/chunk-5IQ4474Z.js.map +1 -0
- package/dist/chunk-5P7255ZD.js +144 -0
- package/dist/chunk-5P7255ZD.js.map +1 -0
- package/dist/chunk-5RMPQM6F.js +163 -0
- package/dist/chunk-5RMPQM6F.js.map +1 -0
- package/dist/chunk-5UUCPFYY.js +140 -0
- package/dist/chunk-5UUCPFYY.js.map +1 -0
- package/dist/chunk-6LZWYVNE.js +160 -0
- package/dist/chunk-6LZWYVNE.js.map +1 -0
- package/dist/chunk-6PJ7QIPK.js +140 -0
- package/dist/chunk-6PJ7QIPK.js.map +1 -0
- package/dist/chunk-6VWGOH4J.js +218 -0
- package/dist/chunk-6VWGOH4J.js.map +1 -0
- package/dist/chunk-7AGAGV4E.js +69 -0
- package/dist/chunk-7AGAGV4E.js.map +1 -0
- package/dist/chunk-7AZNNMJF.js +129 -0
- package/dist/chunk-7AZNNMJF.js.map +1 -0
- package/dist/chunk-7BAQZVH3.js +152 -0
- package/dist/chunk-7BAQZVH3.js.map +1 -0
- package/dist/chunk-7RB2YZCU.js +159 -0
- package/dist/chunk-7RB2YZCU.js.map +1 -0
- package/dist/chunk-A5SSQHU7.js +135 -0
- package/dist/chunk-A5SSQHU7.js.map +1 -0
- package/dist/chunk-B5J4YCG2.js +98 -0
- package/dist/chunk-B5J4YCG2.js.map +1 -0
- package/dist/chunk-BAFUUZ5V.js +163 -0
- package/dist/chunk-BAFUUZ5V.js.map +1 -0
- package/dist/chunk-BT4BMBJC.js +163 -0
- package/dist/chunk-BT4BMBJC.js.map +1 -0
- package/dist/chunk-C5HQZR32.js +196 -0
- package/dist/chunk-C5HQZR32.js.map +1 -0
- package/dist/chunk-D7NY3IWA.js +152 -0
- package/dist/chunk-D7NY3IWA.js.map +1 -0
- package/dist/chunk-DGOKT7ZK.js +163 -0
- package/dist/chunk-DGOKT7ZK.js.map +1 -0
- package/dist/chunk-DL5EXP6Q.js +129 -0
- package/dist/chunk-DL5EXP6Q.js.map +1 -0
- package/dist/chunk-DR3ELFWR.js +69 -0
- package/dist/chunk-DR3ELFWR.js.map +1 -0
- package/dist/chunk-EEXQP6FN.js +129 -0
- package/dist/chunk-EEXQP6FN.js.map +1 -0
- package/dist/chunk-EOPCVKLK.js +69 -0
- package/dist/chunk-EOPCVKLK.js.map +1 -0
- package/dist/chunk-FJYLZOAR.js +140 -0
- package/dist/chunk-FJYLZOAR.js.map +1 -0
- package/dist/chunk-GFRV5VDJ.js +132 -0
- package/dist/chunk-GFRV5VDJ.js.map +1 -0
- package/dist/chunk-GRD6VL3Q.js +49 -0
- package/dist/chunk-GRD6VL3Q.js.map +1 -0
- package/dist/chunk-H53J2DZE.js +157 -0
- package/dist/chunk-H53J2DZE.js.map +1 -0
- package/dist/chunk-HBQ6WF3C.js +196 -0
- package/dist/chunk-HBQ6WF3C.js.map +1 -0
- package/dist/chunk-I6ITAPUG.js +158 -0
- package/dist/chunk-I6ITAPUG.js.map +1 -0
- package/dist/chunk-IPEPHM2U.js +89 -0
- package/dist/chunk-IPEPHM2U.js.map +1 -0
- package/dist/chunk-J65X5ID3.js +136 -0
- package/dist/chunk-J65X5ID3.js.map +1 -0
- package/dist/chunk-K6PJ5GES.js +129 -0
- package/dist/chunk-K6PJ5GES.js.map +1 -0
- package/dist/chunk-LFISV2GU.js +160 -0
- package/dist/chunk-LFISV2GU.js.map +1 -0
- package/dist/chunk-LRTZTSV6.js +135 -0
- package/dist/chunk-LRTZTSV6.js.map +1 -0
- package/dist/chunk-MOITMVXZ.js +159 -0
- package/dist/chunk-MOITMVXZ.js.map +1 -0
- package/dist/chunk-MYGRIOQM.js +163 -0
- package/dist/chunk-MYGRIOQM.js.map +1 -0
- package/dist/chunk-N3A4EUDH.js +101 -0
- package/dist/chunk-N3A4EUDH.js.map +1 -0
- package/dist/chunk-NBVTF6TV.js +163 -0
- package/dist/chunk-NBVTF6TV.js.map +1 -0
- package/dist/chunk-NMOMXXLD.js +163 -0
- package/dist/chunk-NMOMXXLD.js.map +1 -0
- package/dist/chunk-OHSKOJ2Y.js +136 -0
- package/dist/chunk-OHSKOJ2Y.js.map +1 -0
- package/dist/chunk-OWJKGWFQ.js +89 -0
- package/dist/chunk-OWJKGWFQ.js.map +1 -0
- package/dist/chunk-P4ELC3C3.js +145 -0
- package/dist/chunk-P4ELC3C3.js.map +1 -0
- package/dist/chunk-QF22MRN6.js +152 -0
- package/dist/chunk-QF22MRN6.js.map +1 -0
- package/dist/chunk-QHAU3JHA.js +152 -0
- package/dist/chunk-QHAU3JHA.js.map +1 -0
- package/dist/chunk-QQTXIKFT.js +163 -0
- package/dist/chunk-QQTXIKFT.js.map +1 -0
- package/dist/chunk-RQFJZYKH.js +160 -0
- package/dist/chunk-RQFJZYKH.js.map +1 -0
- package/dist/chunk-SI6QBFXF.js +29 -0
- package/dist/chunk-SI6QBFXF.js.map +1 -0
- package/dist/chunk-SRU4OFM3.js +135 -0
- package/dist/chunk-SRU4OFM3.js.map +1 -0
- package/dist/chunk-T5EBUYAB.js +160 -0
- package/dist/chunk-T5EBUYAB.js.map +1 -0
- package/dist/chunk-THTRJNHI.js +159 -0
- package/dist/chunk-THTRJNHI.js.map +1 -0
- package/dist/chunk-TKX3HVMK.js +30 -0
- package/dist/chunk-TKX3HVMK.js.map +1 -0
- package/dist/chunk-TLEAX2CO.js +43 -0
- package/dist/chunk-TLEAX2CO.js.map +1 -0
- package/dist/chunk-TQCYWSCL.js +69 -0
- package/dist/chunk-TQCYWSCL.js.map +1 -0
- package/dist/chunk-UFKDKEI7.js +151 -0
- package/dist/chunk-UFKDKEI7.js.map +1 -0
- package/dist/chunk-WE2VD6CD.js +37 -0
- package/dist/chunk-WE2VD6CD.js.map +1 -0
- package/dist/chunk-WQRH5YGD.js +129 -0
- package/dist/chunk-WQRH5YGD.js.map +1 -0
- package/dist/chunk-X2MARIQ5.js +140 -0
- package/dist/chunk-X2MARIQ5.js.map +1 -0
- package/dist/chunk-XPTGW7ZC.js +69 -0
- package/dist/chunk-XPTGW7ZC.js.map +1 -0
- package/dist/chunk-XTU7VQ2V.js +158 -0
- package/dist/chunk-XTU7VQ2V.js.map +1 -0
- package/dist/chunk-XUTEGDQM.js +51 -0
- package/dist/chunk-XUTEGDQM.js.map +1 -0
- package/dist/chunk-YBO2LITL.js +163 -0
- package/dist/chunk-YBO2LITL.js.map +1 -0
- package/dist/chunk-YOADPBEF.js +129 -0
- package/dist/chunk-YOADPBEF.js.map +1 -0
- package/dist/chunk-YRCJG2BQ.js +163 -0
- package/dist/chunk-YRCJG2BQ.js.map +1 -0
- package/dist/chunk-YXGSOU62.js +129 -0
- package/dist/chunk-YXGSOU62.js.map +1 -0
- package/dist/chunk-Z6B4C5AB.js +63 -0
- package/dist/chunk-Z6B4C5AB.js.map +1 -0
- package/dist/chunk-ZKLZRBDG.js +163 -0
- package/dist/chunk-ZKLZRBDG.js.map +1 -0
- package/dist/chunk-ZYFRVFJE.js +163 -0
- package/dist/chunk-ZYFRVFJE.js.map +1 -0
- package/dist/context/index.js +5 -5
- package/dist/index.cjs +36 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +136 -136
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/index.js +18 -18
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-comp.js +4 -4
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-body.js +11 -11
- 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 +2 -2
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-radio.js +6 -6
- 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 +21 -21
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/start-review.js +6 -6
- package/dist/molecules/curriculumV2/CurriculumContents/curriculum-ai-traning.js +3 -3
- package/dist/molecules/curriculumV2/CurriculumContents/curriculum-file-download.js +3 -3
- package/dist/molecules/curriculumV2/CurriculumContents/curriculum-review.js +23 -23
- package/dist/molecules/curriculumV2/CurriculumContents/index.js +27 -27
- package/dist/molecules/curriculumV2/CurriculumSidebar/Items/curriculum-item-title.js +2 -2
- package/dist/molecules/curriculumV2/CurriculumSidebar/Items/section-item.js +4 -4
- package/dist/molecules/curriculumV2/CurriculumSidebar/index.js +7 -7
- package/dist/molecules/curriculumV2/CurriculumSidebar/sidebar-item.js +5 -5
- package/dist/molecules/curriculumV2/curriculum-sub-nav.js +4 -4
- package/dist/molecules/curriculumV2/curriculum-v2-layout.js +2 -2
- package/dist/molecules/curriculumV2/index.js +36 -36
- package/dist/molecules/date-picker/date-picker-button.js +6 -6
- package/dist/molecules/date-picker/index.js +5 -5
- package/dist/molecules/description-json-render.js +5 -5
- package/dist/molecules/download-card.js +2 -2
- package/dist/molecules/dynamic-field.js +6 -6
- package/dist/molecules/dynamic-form.js +7 -7
- package/dist/molecules/expand-table/index.js +5 -5
- package/dist/molecules/force-refresh.js +2 -2
- package/dist/molecules/ghost-post.js +4 -4
- package/dist/molecules/index.cjs +36 -11
- package/dist/molecules/index.cjs.map +1 -1
- package/dist/molecules/index.js +64 -64
- package/dist/molecules/learning-post.js +6 -6
- 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/dist/molecules/training-info-guideline.cjs +85 -24
- package/dist/molecules/training-info-guideline.cjs.map +1 -1
- package/dist/molecules/training-info-guideline.js +7 -4
- package/package.json +1 -1
- package/src/molecules/training-info-guideline.tsx +51 -10
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Separator
|
|
3
|
+
} from "./chunk-HYITAA4J.js";
|
|
4
|
+
import {
|
|
5
|
+
Spinner
|
|
6
|
+
} from "./chunk-FR2GDOU2.js";
|
|
7
|
+
import {
|
|
8
|
+
Dialog
|
|
9
|
+
} from "./chunk-AH4A53SZ.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
|
+
import {
|
|
20
|
+
AspectRatio
|
|
21
|
+
} from "./chunk-EAXUQEO5.js";
|
|
22
|
+
|
|
23
|
+
// src/molecules/training-info-guideline.tsx
|
|
24
|
+
import { useState } from "react";
|
|
25
|
+
import { FileTextIcon, VideoIcon } from "@radix-ui/react-icons";
|
|
26
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
27
|
+
function TrainingInfoGuideline({
|
|
28
|
+
values,
|
|
29
|
+
onClickFileDownload
|
|
30
|
+
}) {
|
|
31
|
+
return /* @__PURE__ */ jsx(Fragment, { children: values.map((value) => /* @__PURE__ */ jsx(
|
|
32
|
+
TrainingInfoGuidelineItem,
|
|
33
|
+
{
|
|
34
|
+
onClickFileDownload,
|
|
35
|
+
value
|
|
36
|
+
},
|
|
37
|
+
getItemKey(value)
|
|
38
|
+
)) });
|
|
39
|
+
}
|
|
40
|
+
function getItemKey(value) {
|
|
41
|
+
return value.url;
|
|
42
|
+
}
|
|
43
|
+
function TrainingInfoGuidelineItem({
|
|
44
|
+
value,
|
|
45
|
+
onClickFileDownload
|
|
46
|
+
}) {
|
|
47
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
48
|
+
if (value.type === "file") {
|
|
49
|
+
return /* @__PURE__ */ jsx(
|
|
50
|
+
Button,
|
|
51
|
+
{
|
|
52
|
+
onClick: () => {
|
|
53
|
+
onClickFileDownload({ url: value.url, filename: value.filename });
|
|
54
|
+
},
|
|
55
|
+
size: "large",
|
|
56
|
+
style: { width: "100%" },
|
|
57
|
+
variant: "outline",
|
|
58
|
+
children: /* @__PURE__ */ jsx(
|
|
59
|
+
TrainingInfoGuidelineButtonContent,
|
|
60
|
+
{
|
|
61
|
+
description: value.filename,
|
|
62
|
+
icon: /* @__PURE__ */ jsx(FileTextIcon, {}),
|
|
63
|
+
title: value.downloadButtonName
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
if (value.type === "video") {
|
|
70
|
+
return /* @__PURE__ */ jsxs(Dialog.Root, { children: [
|
|
71
|
+
/* @__PURE__ */ jsx(Dialog.Trigger, { children: /* @__PURE__ */ jsx(Button, { size: "large", style: { width: "100%" }, variant: "outline", children: /* @__PURE__ */ jsx(
|
|
72
|
+
TrainingInfoGuidelineButtonContent,
|
|
73
|
+
{
|
|
74
|
+
description: "\uC601\uC0C1",
|
|
75
|
+
icon: /* @__PURE__ */ jsx(VideoIcon, {}),
|
|
76
|
+
title: value.videoTitle
|
|
77
|
+
}
|
|
78
|
+
) }) }),
|
|
79
|
+
/* @__PURE__ */ jsx(
|
|
80
|
+
Dialog.Content,
|
|
81
|
+
{
|
|
82
|
+
height: "100%",
|
|
83
|
+
maxHeight: "500px",
|
|
84
|
+
maxWidth: "800px",
|
|
85
|
+
title: value.videoTitle,
|
|
86
|
+
width: "100%",
|
|
87
|
+
children: /* @__PURE__ */ jsx(AspectRatio, { ratio: 16 / 9, style: { width: "100%" }, children: /* @__PURE__ */ jsxs(
|
|
88
|
+
Flex,
|
|
89
|
+
{
|
|
90
|
+
align: "center",
|
|
91
|
+
justify: "center",
|
|
92
|
+
style: {
|
|
93
|
+
width: "100%",
|
|
94
|
+
height: "100%",
|
|
95
|
+
backgroundColor: "black",
|
|
96
|
+
position: "relative"
|
|
97
|
+
},
|
|
98
|
+
children: [
|
|
99
|
+
isLoading ? /* @__PURE__ */ jsx(
|
|
100
|
+
Flex,
|
|
101
|
+
{
|
|
102
|
+
align: "center",
|
|
103
|
+
height: "100%",
|
|
104
|
+
justify: "center",
|
|
105
|
+
position: "absolute",
|
|
106
|
+
style: {
|
|
107
|
+
position: "absolute",
|
|
108
|
+
top: 0,
|
|
109
|
+
left: 0,
|
|
110
|
+
zIndex: 1,
|
|
111
|
+
color: "white"
|
|
112
|
+
},
|
|
113
|
+
width: "100%",
|
|
114
|
+
children: /* @__PURE__ */ jsx(Spinner, { size: "3", style: { width: 48, height: 48 } })
|
|
115
|
+
}
|
|
116
|
+
) : null,
|
|
117
|
+
/* @__PURE__ */ jsx(
|
|
118
|
+
"iframe",
|
|
119
|
+
{
|
|
120
|
+
allowFullScreen: true,
|
|
121
|
+
onError: () => {
|
|
122
|
+
setIsLoading(false);
|
|
123
|
+
},
|
|
124
|
+
onLoad: () => {
|
|
125
|
+
setIsLoading(false);
|
|
126
|
+
},
|
|
127
|
+
src: `${value.url}?theme=light`,
|
|
128
|
+
style: { width: "100%", height: "100%", border: "none" },
|
|
129
|
+
title: "Curriculum Video"
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
) })
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
] });
|
|
138
|
+
}
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
function TrainingInfoGuidelineButtonContent({
|
|
142
|
+
icon,
|
|
143
|
+
title,
|
|
144
|
+
description
|
|
145
|
+
}) {
|
|
146
|
+
return /* @__PURE__ */ jsxs(Flex, { align: "center", gap: "2", width: "100%", children: [
|
|
147
|
+
icon,
|
|
148
|
+
/* @__PURE__ */ jsx(Separator, { orientation: "vertical", size: "2" }),
|
|
149
|
+
/* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "1", children: [
|
|
150
|
+
/* @__PURE__ */ jsx(Typo, { children: title }),
|
|
151
|
+
typeof description === "string" && description !== "" ? /* @__PURE__ */ jsx(Typo, { variant: "caption", children: description }) : null
|
|
152
|
+
] })
|
|
153
|
+
] });
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export {
|
|
157
|
+
TrainingInfoGuideline
|
|
158
|
+
};
|
|
159
|
+
//# sourceMappingURL=chunk-MOITMVXZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/training-info-guideline.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { FileTextIcon, VideoIcon } from '@radix-ui/react-icons';\nimport { AspectRatio } from '@/atoms/aspect-ratio';\nimport { Button } from '@/atoms/button';\nimport type { TrainingInfoGuidelineContents } from '@/types/training-info-guideline-schema-generated';\nimport { Dialog } from '@/atoms/dialog';\nimport { Spinner } from '@/atoms/spinner';\nimport { Flex } from '../atoms/flex';\nimport { Separator, Typo } from '@/atoms';\n\nexport interface TrainingInfoGuidelineProps {\n values: TrainingInfoGuidelineContents['values'];\n onClickFileDownload: (args: { url: string; filename: string }) => void;\n}\n\nexport function TrainingInfoGuideline({\n values,\n onClickFileDownload,\n}: TrainingInfoGuidelineProps): React.ReactElement {\n return (\n <>\n {values.map((value) => (\n <TrainingInfoGuidelineItem\n key={getItemKey(value)}\n onClickFileDownload={onClickFileDownload}\n value={value}\n />\n ))}\n </>\n );\n}\n\ntype TrainingInfoGuidelineValue =\n TrainingInfoGuidelineContents['values'][number];\n\nfunction getItemKey(value: TrainingInfoGuidelineValue): string {\n return value.url;\n}\n\ninterface TrainingInfoGuidelineItemProps {\n value: TrainingInfoGuidelineValue;\n onClickFileDownload: TrainingInfoGuidelineProps['onClickFileDownload'];\n}\n\nfunction TrainingInfoGuidelineItem({\n value,\n onClickFileDownload,\n}: TrainingInfoGuidelineItemProps): React.ReactElement | null {\n const [isLoading, setIsLoading] = useState(true);\n\n if (value.type === 'file') {\n return (\n <Button\n onClick={() => {\n onClickFileDownload({ url: value.url, filename: value.filename });\n }}\n size=\"large\"\n style={{ width: '100%' }}\n variant=\"outline\"\n >\n <TrainingInfoGuidelineButtonContent\n description={value.filename}\n icon={<FileTextIcon />}\n title={value.downloadButtonName}\n />\n </Button>\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- 차후 다른 타입 추가 시 사용\n if (value.type === 'video') {\n return (\n <Dialog.Root>\n <Dialog.Trigger>\n <Button size=\"large\" style={{ width: '100%' }} variant=\"outline\">\n <TrainingInfoGuidelineButtonContent\n description=\"영상\"\n icon={<VideoIcon />}\n title={value.videoTitle}\n />\n </Button>\n </Dialog.Trigger>\n <Dialog.Content\n height=\"100%\"\n maxHeight=\"500px\"\n maxWidth=\"800px\"\n title={value.videoTitle}\n width=\"100%\"\n >\n <AspectRatio ratio={16 / 9} style={{ width: '100%' }}>\n <Flex\n align=\"center\"\n justify=\"center\"\n style={{\n width: '100%',\n height: '100%',\n backgroundColor: 'black',\n position: 'relative',\n }}\n >\n {isLoading ? (\n <Flex\n align=\"center\"\n height=\"100%\"\n justify=\"center\"\n position=\"absolute\"\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n zIndex: 1,\n color: 'white',\n }}\n width=\"100%\"\n >\n <Spinner size=\"3\" style={{ width: 48, height: 48 }} />\n </Flex>\n ) : null}\n\n <iframe\n allowFullScreen\n onError={() => {\n setIsLoading(false);\n }} // 필요시 에러 메시지로 대체\n onLoad={() => {\n setIsLoading(false);\n }}\n src={`${value.url}?theme=light`}\n style={{ width: '100%', height: '100%', border: 'none' }}\n title=\"Curriculum Video\"\n />\n </Flex>\n </AspectRatio>\n </Dialog.Content>\n </Dialog.Root>\n );\n }\n return null;\n}\n\ninterface TrainingInfoGuidelineButtonContentProps {\n icon: React.ReactNode;\n title: string;\n description?: string;\n}\n\nfunction TrainingInfoGuidelineButtonContent({\n icon,\n title,\n description,\n}: TrainingInfoGuidelineButtonContentProps): React.ReactElement {\n return (\n <Flex align=\"center\" gap=\"2\" width=\"100%\">\n {icon}\n <Separator orientation=\"vertical\" size=\"2\" />\n <Flex direction=\"column\" gap=\"1\">\n <Typo>{title}</Typo>\n {typeof description === 'string' && description !== '' ? (\n <Typo variant=\"caption\">{description}</Typo>\n ) : null}\n </Flex>\n </Flex>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAgB,gBAAgB;AAChC,SAAS,cAAc,iBAAiB;AAmBpC,mBAEI,KAoEI,YAtER;AALG,SAAS,sBAAsB;AAAA,EACpC;AAAA,EACA;AACF,GAAmD;AACjD,SACE,gCACG,iBAAO,IAAI,CAAC,UACX;AAAA,IAAC;AAAA;AAAA,MAEC;AAAA,MACA;AAAA;AAAA,IAFK,WAAW,KAAK;AAAA,EAGvB,CACD,GACH;AAEJ;AAKA,SAAS,WAAW,OAA2C;A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7
|
+
import {
|
|
8
|
+
Dialog
|
|
9
|
+
} from "./chunk-AH4A53SZ.js";
|
|
10
|
+
import {
|
|
11
|
+
Box
|
|
12
|
+
} from "./chunk-4Y5BEXVN.js";
|
|
13
|
+
import {
|
|
14
|
+
Typo
|
|
15
|
+
} from "./chunk-PMJIFLDT.js";
|
|
16
|
+
import {
|
|
17
|
+
Flex
|
|
18
|
+
} from "./chunk-25HMMI7R.js";
|
|
19
|
+
import {
|
|
20
|
+
Button
|
|
21
|
+
} from "./chunk-ZVDAEY5Q.js";
|
|
22
|
+
import {
|
|
23
|
+
AspectRatio
|
|
24
|
+
} from "./chunk-EAXUQEO5.js";
|
|
25
|
+
|
|
26
|
+
// src/molecules/training-info-guideline.tsx
|
|
27
|
+
import { useState } from "react";
|
|
28
|
+
import { FileTextIcon, VideoIcon } from "@radix-ui/react-icons";
|
|
29
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
30
|
+
function TrainingInfoGuideline({
|
|
31
|
+
values,
|
|
32
|
+
onClickFileDownload
|
|
33
|
+
}) {
|
|
34
|
+
return /* @__PURE__ */ jsx(Fragment, { children: values.map((value) => /* @__PURE__ */ jsx(
|
|
35
|
+
TrainingInfoGuidelineItem,
|
|
36
|
+
{
|
|
37
|
+
onClickFileDownload,
|
|
38
|
+
value
|
|
39
|
+
},
|
|
40
|
+
getItemKey(value)
|
|
41
|
+
)) });
|
|
42
|
+
}
|
|
43
|
+
function getItemKey(value) {
|
|
44
|
+
return value.url;
|
|
45
|
+
}
|
|
46
|
+
function TrainingInfoGuidelineItem({
|
|
47
|
+
value,
|
|
48
|
+
onClickFileDownload
|
|
49
|
+
}) {
|
|
50
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
51
|
+
if (value.type === "file") {
|
|
52
|
+
return /* @__PURE__ */ jsx(
|
|
53
|
+
TrainingInfoGuidelineButton,
|
|
54
|
+
{
|
|
55
|
+
description: value.filename,
|
|
56
|
+
icon: /* @__PURE__ */ jsx(FileTextIcon, {}),
|
|
57
|
+
onClick: () => {
|
|
58
|
+
onClickFileDownload({ url: value.url, filename: value.filename });
|
|
59
|
+
},
|
|
60
|
+
title: value.downloadButtonName
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
if (value.type === "video") {
|
|
65
|
+
return /* @__PURE__ */ jsxs(Dialog.Root, { children: [
|
|
66
|
+
/* @__PURE__ */ jsx(Dialog.Trigger, { children: /* @__PURE__ */ jsx(
|
|
67
|
+
TrainingInfoGuidelineButton,
|
|
68
|
+
{
|
|
69
|
+
description: "\uC601\uC0C1",
|
|
70
|
+
icon: /* @__PURE__ */ jsx(VideoIcon, {}),
|
|
71
|
+
title: value.videoTitle
|
|
72
|
+
}
|
|
73
|
+
) }),
|
|
74
|
+
/* @__PURE__ */ jsx(
|
|
75
|
+
Dialog.Content,
|
|
76
|
+
{
|
|
77
|
+
height: "100%",
|
|
78
|
+
maxHeight: "500px",
|
|
79
|
+
maxWidth: "800px",
|
|
80
|
+
title: value.videoTitle,
|
|
81
|
+
width: "100%",
|
|
82
|
+
children: /* @__PURE__ */ jsx(AspectRatio, { ratio: 16 / 9, style: { width: "100%" }, children: /* @__PURE__ */ jsxs(
|
|
83
|
+
Flex,
|
|
84
|
+
{
|
|
85
|
+
align: "center",
|
|
86
|
+
justify: "center",
|
|
87
|
+
style: {
|
|
88
|
+
width: "100%",
|
|
89
|
+
height: "100%",
|
|
90
|
+
backgroundColor: "black",
|
|
91
|
+
position: "relative"
|
|
92
|
+
},
|
|
93
|
+
children: [
|
|
94
|
+
isLoading ? /* @__PURE__ */ jsx(
|
|
95
|
+
Flex,
|
|
96
|
+
{
|
|
97
|
+
align: "center",
|
|
98
|
+
height: "100%",
|
|
99
|
+
justify: "center",
|
|
100
|
+
position: "absolute",
|
|
101
|
+
style: {
|
|
102
|
+
position: "absolute",
|
|
103
|
+
top: 0,
|
|
104
|
+
left: 0,
|
|
105
|
+
zIndex: 1,
|
|
106
|
+
color: "white"
|
|
107
|
+
},
|
|
108
|
+
width: "100%",
|
|
109
|
+
children: /* @__PURE__ */ jsx(Spinner, { size: "3", style: { width: 48, height: 48 } })
|
|
110
|
+
}
|
|
111
|
+
) : null,
|
|
112
|
+
/* @__PURE__ */ jsx(
|
|
113
|
+
"iframe",
|
|
114
|
+
{
|
|
115
|
+
allowFullScreen: true,
|
|
116
|
+
onError: () => {
|
|
117
|
+
setIsLoading(false);
|
|
118
|
+
},
|
|
119
|
+
onLoad: () => {
|
|
120
|
+
setIsLoading(false);
|
|
121
|
+
},
|
|
122
|
+
src: `${value.url}?theme=light`,
|
|
123
|
+
style: { width: "100%", height: "100%", border: "none" },
|
|
124
|
+
title: "Curriculum Video"
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
) })
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
] });
|
|
133
|
+
}
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
function TrainingInfoGuidelineButton({
|
|
137
|
+
icon,
|
|
138
|
+
title,
|
|
139
|
+
description,
|
|
140
|
+
onClick
|
|
141
|
+
}) {
|
|
142
|
+
return /* @__PURE__ */ jsx(
|
|
143
|
+
Button,
|
|
144
|
+
{
|
|
145
|
+
onClick,
|
|
146
|
+
style: { width: "100%", height: "48px" },
|
|
147
|
+
variant: "outline",
|
|
148
|
+
children: /* @__PURE__ */ jsxs(Flex, { align: "center", gap: "2", width: "100%", children: [
|
|
149
|
+
icon,
|
|
150
|
+
/* @__PURE__ */ jsx(Separator, { orientation: "vertical", size: "2" }),
|
|
151
|
+
/* @__PURE__ */ jsxs(Box, { children: [
|
|
152
|
+
/* @__PURE__ */ jsx(Typo, { as: "div", mb: "1", children: title }),
|
|
153
|
+
typeof description === "string" && description !== "" ? /* @__PURE__ */ jsx(Typo, { style: { textAlign: "left" }, variant: "caption", children: description }) : null
|
|
154
|
+
] })
|
|
155
|
+
] })
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export {
|
|
161
|
+
TrainingInfoGuideline
|
|
162
|
+
};
|
|
163
|
+
//# sourceMappingURL=chunk-MYGRIOQM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/training-info-guideline.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { FileTextIcon, VideoIcon } from '@radix-ui/react-icons';\nimport { AspectRatio } from '@/atoms/aspect-ratio';\nimport { Button } from '@/atoms/button';\nimport type { TrainingInfoGuidelineContents } from '@/types/training-info-guideline-schema-generated';\nimport { Dialog } from '@/atoms/dialog';\nimport { Spinner } from '@/atoms/spinner';\nimport { Box } from '@/atoms/box';\nimport { Separator } from '@/atoms/separator';\nimport { Typo } from '@/atoms/typo';\nimport { Flex } from '../atoms/flex';\n\nexport interface TrainingInfoGuidelineProps {\n values: TrainingInfoGuidelineContents['values'];\n onClickFileDownload: (args: { url: string; filename: string }) => void;\n}\n\nexport function TrainingInfoGuideline({\n values,\n onClickFileDownload,\n}: TrainingInfoGuidelineProps): React.ReactElement {\n return (\n <>\n {values.map((value) => (\n <TrainingInfoGuidelineItem\n key={getItemKey(value)}\n onClickFileDownload={onClickFileDownload}\n value={value}\n />\n ))}\n </>\n );\n}\n\ntype TrainingInfoGuidelineValue =\n TrainingInfoGuidelineContents['values'][number];\n\nfunction getItemKey(value: TrainingInfoGuidelineValue): string {\n return value.url;\n}\n\ninterface TrainingInfoGuidelineItemProps {\n value: TrainingInfoGuidelineValue;\n onClickFileDownload: TrainingInfoGuidelineProps['onClickFileDownload'];\n}\n\nfunction TrainingInfoGuidelineItem({\n value,\n onClickFileDownload,\n}: TrainingInfoGuidelineItemProps): React.ReactElement | null {\n const [isLoading, setIsLoading] = useState(true);\n\n if (value.type === 'file') {\n return (\n <TrainingInfoGuidelineButton\n description={value.filename}\n icon={<FileTextIcon />}\n onClick={() => {\n onClickFileDownload({ url: value.url, filename: value.filename });\n }}\n title={value.downloadButtonName}\n />\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- 차후 다른 타입 추가 시 사용\n if (value.type === 'video') {\n return (\n <Dialog.Root>\n <Dialog.Trigger>\n <TrainingInfoGuidelineButton\n description=\"영상\"\n icon={<VideoIcon />}\n title={value.videoTitle}\n />\n </Dialog.Trigger>\n <Dialog.Content\n height=\"100%\"\n maxHeight=\"500px\"\n maxWidth=\"800px\"\n title={value.videoTitle}\n width=\"100%\"\n >\n <AspectRatio ratio={16 / 9} style={{ width: '100%' }}>\n <Flex\n align=\"center\"\n justify=\"center\"\n style={{\n width: '100%',\n height: '100%',\n backgroundColor: 'black',\n position: 'relative',\n }}\n >\n {isLoading ? (\n <Flex\n align=\"center\"\n height=\"100%\"\n justify=\"center\"\n position=\"absolute\"\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n zIndex: 1,\n color: 'white',\n }}\n width=\"100%\"\n >\n <Spinner size=\"3\" style={{ width: 48, height: 48 }} />\n </Flex>\n ) : null}\n\n <iframe\n allowFullScreen\n onError={() => {\n setIsLoading(false);\n }} // 필요시 에러 메시지로 대체\n onLoad={() => {\n setIsLoading(false);\n }}\n src={`${value.url}?theme=light`}\n style={{ width: '100%', height: '100%', border: 'none' }}\n title=\"Curriculum Video\"\n />\n </Flex>\n </AspectRatio>\n </Dialog.Content>\n </Dialog.Root>\n );\n }\n return null;\n}\n\ninterface TrainingInfoGuidelineButtonProps {\n icon: React.ReactNode;\n title: string;\n description?: string;\n onClick?: () => void;\n}\n\nfunction TrainingInfoGuidelineButton({\n icon,\n title,\n description,\n onClick,\n}: TrainingInfoGuidelineButtonProps): React.ReactElement {\n return (\n <Button\n onClick={onClick}\n style={{ width: '100%', height: '48px' }}\n variant=\"outline\"\n >\n <Flex align=\"center\" gap=\"2\" width=\"100%\">\n {icon}\n <Separator orientation=\"vertical\" size=\"2\" />\n <Box>\n <Typo as=\"div\" mb=\"1\">\n {title}\n </Typo>\n {typeof description === 'string' && description !== '' ? (\n <Typo style={{ textAlign: 'left' }} variant=\"caption\">\n {description}\n </Typo>\n ) : null}\n </Box>\n </Flex>\n </Button>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAgB,gBAAgB;AAChC,SAAS,cAAc,iBAAiB;AAqBpC,mBAEI,KA4DI,YA9DR;AALG,SAAS,sBAAsB;AAAA,EACpC;AAAA,EACA;AACF,GAAmD;AACjD,SACE,gCACG,iBAAO,IAAI,CAAC,UACX;AAAA,IAAC;AAAA;AAAA,MAEC;AAAA,MACA;AAAA;AAAA,IAFK,WAAW,KAAK;AAAA,EAGvB,CACD,GACH;AAEJ;AAKA,SAAS,WAAW,OAA2C;AAC7D,SAAO,MAAM;AACf;AAOA,SAAS,0BAA0B;AAAA,EACjC;AAAA,EACA;AACF,GAA8D;AAC5D,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,IAAI;AAE/C,MAAI,MAAM,SAAS,QAAQ;AACzB,WACE;AAAA,MAAC;AAAA;AAAA,QACC,aAAa,MAAM;AAAA,QACnB,MAAM,oBAAC,gBAAa;AAAA,QACpB,SAAS,MAAM;AACb,8BAAoB,EAAE,KAAK,MAAM,KAAK,UAAU,MAAM,SAAS,CAAC;AAAA,QAClE;AAAA,QACA,OAAO,MAAM;AAAA;AAAA,IACf;AAAA,EAEJ;AAGA,MAAI,MAAM,SAAS,SAAS;AAC1B,WACE,qBAAC,OAAO,MAAP,EACC;AAAA,0BAAC,OAAO,SAAP,EACC;AAAA,QAAC;AAAA;AAAA,UACC,aAAY;AAAA,UACZ,MAAM,oBAAC,aAAU;AAAA,UACjB,OAAO,MAAM;AAAA;AAAA,MACf,GACF;AAAA,MACA;AAAA,QAAC,OAAO;AAAA,QAAP;AAAA,UACC,QAAO;AAAA,UACP,WAAU;AAAA,UACV,UAAS;AAAA,UACT,OAAO,MAAM;AAAA,UACb,OAAM;AAAA,UAEN,8BAAC,eAAY,OAAO,KAAK,GAAG,OAAO,EAAE,O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,QAC3C,qBAAC,OACC;AAAA,8BAAC,QAAK,IAAG,OAAM,IAAG,KACf,iBACH;AAAA,UACC,OAAO,gBAAgB,YAAY,gBAAgB,KAClD,oBAAC,QAAK,OAAO,EAAE,WAAW,OAAO,GAAG,SAAQ,WACzC,uBACH,IACE;AAAA,WACN;AAAA,SACF;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ReviewQuestionContentHeader
|
|
3
|
+
} from "./chunk-TLEAX2CO.js";
|
|
4
|
+
import {
|
|
5
|
+
RadioButtonCard
|
|
6
|
+
} from "./chunk-CSKNBWPB.js";
|
|
7
|
+
import {
|
|
8
|
+
Grid
|
|
9
|
+
} from "./chunk-EGEQY3KT.js";
|
|
10
|
+
import {
|
|
11
|
+
Card
|
|
12
|
+
} from "./chunk-RP2RGCAW.js";
|
|
13
|
+
import {
|
|
14
|
+
Box
|
|
15
|
+
} from "./chunk-4Y5BEXVN.js";
|
|
16
|
+
import {
|
|
17
|
+
Flex
|
|
18
|
+
} from "./chunk-25HMMI7R.js";
|
|
19
|
+
import {
|
|
20
|
+
Button
|
|
21
|
+
} from "./chunk-ZVDAEY5Q.js";
|
|
22
|
+
import {
|
|
23
|
+
Typo
|
|
24
|
+
} from "./chunk-PMJIFLDT.js";
|
|
25
|
+
|
|
26
|
+
// src/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-radio.tsx
|
|
27
|
+
import { useCallback, useMemo, useState } from "react";
|
|
28
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
29
|
+
var correctAnswerStyle = {
|
|
30
|
+
backgroundColor: "var(--green-a2)"
|
|
31
|
+
};
|
|
32
|
+
function ReviewQuestionRadio(props) {
|
|
33
|
+
const { question, answer, onChange } = props;
|
|
34
|
+
const [isCheckAnswer, setIsCheckAnswer] = useState(false);
|
|
35
|
+
const checkAnswer = useCallback(() => {
|
|
36
|
+
setIsCheckAnswer(true);
|
|
37
|
+
}, []);
|
|
38
|
+
const isCorrect = isCheckAnswer && Number(answer) === question.correctAnswer;
|
|
39
|
+
const isWrong = isCheckAnswer && Number(answer) !== question.correctAnswer;
|
|
40
|
+
const radioColor = useMemo(() => {
|
|
41
|
+
if (isCorrect) return "green";
|
|
42
|
+
if (isWrong) return "red";
|
|
43
|
+
return void 0;
|
|
44
|
+
}, [isCorrect, isWrong]);
|
|
45
|
+
return /* @__PURE__ */ jsxs(Grid, { height: "100%", rows: "auto 1fr", width: "100%", children: [
|
|
46
|
+
/* @__PURE__ */ jsx(Card, { mb: "4", size: "2", children: /* @__PURE__ */ jsx(
|
|
47
|
+
ReviewQuestionContentHeader,
|
|
48
|
+
{
|
|
49
|
+
icon: question.icon,
|
|
50
|
+
question: question.question,
|
|
51
|
+
title: question.title,
|
|
52
|
+
type: question.type
|
|
53
|
+
}
|
|
54
|
+
) }),
|
|
55
|
+
/* @__PURE__ */ jsxs(Grid, { height: "100%", rows: "1fr auto", width: "100%", children: [
|
|
56
|
+
/* @__PURE__ */ jsx(Box, { position: "relative", children: /* @__PURE__ */ jsx(
|
|
57
|
+
RadioButtonCard.Root,
|
|
58
|
+
{
|
|
59
|
+
color: radioColor,
|
|
60
|
+
onValueChange: onChange,
|
|
61
|
+
style: {
|
|
62
|
+
width: "100%",
|
|
63
|
+
height: "100%",
|
|
64
|
+
overflowY: "auto",
|
|
65
|
+
position: "absolute"
|
|
66
|
+
},
|
|
67
|
+
value: answer,
|
|
68
|
+
children: /* @__PURE__ */ jsx(Flex, { direction: "column", gap: "2", width: "100%", children: question.options.map((option, i) => {
|
|
69
|
+
const isThisOptionCorrect = isCheckAnswer && i === question.correctAnswer;
|
|
70
|
+
const isThisOptionSelected = isCheckAnswer && i === Number(answer);
|
|
71
|
+
const isThisOptionWrong = isCheckAnswer && isThisOptionSelected && i !== question.correctAnswer;
|
|
72
|
+
const style = (() => {
|
|
73
|
+
if (isThisOptionCorrect) return correctAnswerStyle;
|
|
74
|
+
return {};
|
|
75
|
+
})();
|
|
76
|
+
return /* @__PURE__ */ jsx(
|
|
77
|
+
RadioButtonCard.Item,
|
|
78
|
+
{
|
|
79
|
+
style,
|
|
80
|
+
value: i.toString(),
|
|
81
|
+
children: /* @__PURE__ */ jsxs(Box, { children: [
|
|
82
|
+
/* @__PURE__ */ jsx(Typo, { as: "p", children: option.label }),
|
|
83
|
+
isThisOptionCorrect ? /* @__PURE__ */ jsx(Typo, { color: "green", children: "\uC815\uB2F5\uC785\uB2C8\uB2E4" }) : null,
|
|
84
|
+
isThisOptionWrong ? /* @__PURE__ */ jsx(Typo, { color: "red", children: "\uC815\uB2F5\uC774 \uC544\uB2D9\uB2C8\uB2E4" }) : null
|
|
85
|
+
] })
|
|
86
|
+
},
|
|
87
|
+
`${option.label}-${i}`
|
|
88
|
+
);
|
|
89
|
+
}) })
|
|
90
|
+
}
|
|
91
|
+
) }),
|
|
92
|
+
/* @__PURE__ */ jsx(Flex, { justify: "end", mt: "2", children: /* @__PURE__ */ jsx(Button, { onClick: checkAnswer, children: "\uC815\uB2F5 \uD655\uC778" }) })
|
|
93
|
+
] })
|
|
94
|
+
] });
|
|
95
|
+
}
|
|
96
|
+
var review_question_radio_default = ReviewQuestionRadio;
|
|
97
|
+
|
|
98
|
+
export {
|
|
99
|
+
review_question_radio_default
|
|
100
|
+
};
|
|
101
|
+
//# sourceMappingURL=chunk-N3A4EUDH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-radio.tsx"],"sourcesContent":["import React, { useCallback, useMemo, useState } from 'react';\nimport { Box } from '@/atoms/box';\nimport { Button } from '@/atoms/button';\nimport { Card } from '@/atoms/card';\nimport { Flex } from '@/atoms/flex';\nimport { Grid } from '@/atoms/grid';\nimport { Typo } from '@/atoms/typo';\nimport { type CurriculumReviewQuestionRadio } from '@/types/curriculumContents.type'; \nimport { RadioButtonCard } from \"../../../../radio-button-card\";\nimport { ReviewQuestionContentHeader } from './review-comp';\n\ninterface ReviewQuestionRadioProps {\n question: CurriculumReviewQuestionRadio;\n answer: string;\n error?: string;\n onChange: (value: string) => void;\n}\n\nconst correctAnswerStyle: React.CSSProperties = {\n backgroundColor: 'var(--green-a2)',\n};\n\nfunction ReviewQuestionRadio(props: ReviewQuestionRadioProps): React.ReactNode {\n const { question, answer, onChange } = props;\n const [isCheckAnswer, setIsCheckAnswer] = useState(false);\n\n const checkAnswer = useCallback(() => {\n setIsCheckAnswer(true);\n }, []);\n\n const isCorrect = isCheckAnswer && Number(answer) === question.correctAnswer;\n const isWrong = isCheckAnswer && Number(answer) !== question.correctAnswer;\n const radioColor = useMemo(() => {\n if (isCorrect) return 'green';\n if (isWrong) return 'red';\n return undefined;\n }, [isCorrect, isWrong]);\n\n return (\n <Grid height=\"100%\" rows=\"auto 1fr\" width=\"100%\">\n <Card mb=\"4\" size=\"2\">\n <ReviewQuestionContentHeader\n icon={question.icon}\n question={question.question}\n title={question.title}\n type={question.type}\n />\n </Card>\n\n <Grid height=\"100%\" rows=\"1fr auto\" width=\"100%\">\n <Box position=\"relative\">\n <RadioButtonCard.Root\n color={radioColor}\n onValueChange={onChange}\n style={{\n width: '100%',\n height: '100%',\n overflowY: 'auto',\n position: 'absolute',\n }}\n value={answer}\n >\n <Flex direction=\"column\" gap=\"2\" width=\"100%\">\n {question.options.map((option, i) => {\n const isThisOptionCorrect =\n isCheckAnswer && i === question.correctAnswer;\n const isThisOptionSelected =\n isCheckAnswer && i === Number(answer);\n const isThisOptionWrong =\n isCheckAnswer &&\n isThisOptionSelected &&\n i !== question.correctAnswer;\n const style = (() => {\n if (isThisOptionCorrect) return correctAnswerStyle;\n return {};\n })();\n\n return (\n <RadioButtonCard.Item\n // eslint-disable-next-line react/no-array-index-key -- 조합 키로 중복 회피\n key={`${option.label}-${i}`}\n style={style}\n value={i.toString()}\n >\n <Box>\n <Typo as=\"p\">{option.label}</Typo>\n {isThisOptionCorrect ? (\n <Typo color=\"green\">정답입니다</Typo>\n ) : null}\n {isThisOptionWrong ? (\n <Typo color=\"red\">정답이 아닙니다</Typo>\n ) : null}\n </Box>\n </RadioButtonCard.Item>\n );\n })}\n </Flex>\n </RadioButtonCard.Root>\n </Box>\n <Flex justify=\"end\" mt=\"2\">\n <Button onClick={checkAnswer}>정답 확인</Button>\n </Flex>\n </Grid>\n </Grid>\n );\n}\n\nexport default ReviewQuestionRadio;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAgB,aAAa,SAAS,gBAAgB;AAyC9C,cA2CY,YA3CZ;AAvBR,IAAM,qBAA0C;AAAA,EAC9C,iBAAiB;AACnB;AAEA,SAAS,oBAAoB,OAAkD;AAC7E,QAAM,EAAE,UAAU,QAAQ,SAAS,IAAI;AACvC,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAS,KAAK;AAExD,QAAM,cAAc,YAAY,MAAM;AACpC,qBAAiB,IAAI;AAAA,EACvB,GAAG,CAAC,CAAC;AAEL,QAAM,YAAY,iBAAiB,OAAO,MAAM,MAAM,SAAS;AAC/D,QAAM,UAAU,iBAAiB,OAAO,MAAM,MAAM,SAAS;AAC7D,QAAM,aAAa,QAAQ,MAAM;AAC/B,QAAI,UAAW,QAAO;AACtB,QAAI,QAAS,QAAO;AACpB,WAAO;AAAA,EACT,GAAG,CAAC,WAAW,OAAO,CAAC;AAEvB,SACE,qBAAC,QAAK,QAAO,QAAO,MAAK,YAAW,OAAM,QACxC;AAAA,wBAAC,QAAK,IAAG,KAAI,MAAK,KAChB;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,SAAS;AAAA,QACf,UAAU,SAAS;AAAA,QACnB,OAAO,SAAS;AAAA,QAChB,MAAM,SAAS;AAAA;AAAA,IACjB,GACF;AAAA,IAEA,qBAAC,QAAK,QAAO,QAAO,MAAK,YAAW,OAAM,QACxC;AAAA,0BAAC,OAAI,UAAS,YACZ;AAAA,QAAC,gBA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9
|
+
} from "./chunk-AH4A53SZ.js";
|
|
10
|
+
import {
|
|
11
|
+
Box
|
|
12
|
+
} from "./chunk-4Y5BEXVN.js";
|
|
13
|
+
import {
|
|
14
|
+
Typo
|
|
15
|
+
} from "./chunk-PMJIFLDT.js";
|
|
16
|
+
import {
|
|
17
|
+
Flex
|
|
18
|
+
} from "./chunk-25HMMI7R.js";
|
|
19
|
+
import {
|
|
20
|
+
Button
|
|
21
|
+
} from "./chunk-ZVDAEY5Q.js";
|
|
22
|
+
import {
|
|
23
|
+
AspectRatio
|
|
24
|
+
} from "./chunk-EAXUQEO5.js";
|
|
25
|
+
|
|
26
|
+
// src/molecules/training-info-guideline.tsx
|
|
27
|
+
import { useState } from "react";
|
|
28
|
+
import { FileTextIcon, VideoIcon } from "@radix-ui/react-icons";
|
|
29
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
30
|
+
function TrainingInfoGuideline({
|
|
31
|
+
values,
|
|
32
|
+
onClickFileDownload
|
|
33
|
+
}) {
|
|
34
|
+
return /* @__PURE__ */ jsx(Fragment, { children: values.map((value) => /* @__PURE__ */ jsx(
|
|
35
|
+
TrainingInfoGuidelineItem,
|
|
36
|
+
{
|
|
37
|
+
onClickFileDownload,
|
|
38
|
+
value
|
|
39
|
+
},
|
|
40
|
+
getItemKey(value)
|
|
41
|
+
)) });
|
|
42
|
+
}
|
|
43
|
+
function getItemKey(value) {
|
|
44
|
+
return value.url;
|
|
45
|
+
}
|
|
46
|
+
function TrainingInfoGuidelineItem({
|
|
47
|
+
value,
|
|
48
|
+
onClickFileDownload
|
|
49
|
+
}) {
|
|
50
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
51
|
+
if (value.type === "file") {
|
|
52
|
+
return /* @__PURE__ */ jsx(
|
|
53
|
+
TrainingInfoGuidelineButton,
|
|
54
|
+
{
|
|
55
|
+
description: value.filename,
|
|
56
|
+
icon: /* @__PURE__ */ jsx(FileTextIcon, {}),
|
|
57
|
+
onClick: () => {
|
|
58
|
+
onClickFileDownload({ url: value.url, filename: value.filename });
|
|
59
|
+
},
|
|
60
|
+
title: value.downloadButtonName
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
if (value.type === "video") {
|
|
65
|
+
return /* @__PURE__ */ jsxs(Dialog.Root, { children: [
|
|
66
|
+
/* @__PURE__ */ jsx(Dialog.Trigger, { children: /* @__PURE__ */ jsx(
|
|
67
|
+
TrainingInfoGuidelineButton,
|
|
68
|
+
{
|
|
69
|
+
description: "\uC601\uC0C1",
|
|
70
|
+
icon: /* @__PURE__ */ jsx(VideoIcon, {}),
|
|
71
|
+
title: value.videoTitle
|
|
72
|
+
}
|
|
73
|
+
) }),
|
|
74
|
+
/* @__PURE__ */ jsx(
|
|
75
|
+
Dialog.Content,
|
|
76
|
+
{
|
|
77
|
+
height: "100%",
|
|
78
|
+
maxHeight: "500px",
|
|
79
|
+
maxWidth: "800px",
|
|
80
|
+
title: value.videoTitle,
|
|
81
|
+
width: "100%",
|
|
82
|
+
children: /* @__PURE__ */ jsx(AspectRatio, { ratio: 16 / 9, style: { width: "100%" }, children: /* @__PURE__ */ jsxs(
|
|
83
|
+
Flex,
|
|
84
|
+
{
|
|
85
|
+
align: "center",
|
|
86
|
+
justify: "center",
|
|
87
|
+
style: {
|
|
88
|
+
width: "100%",
|
|
89
|
+
height: "100%",
|
|
90
|
+
backgroundColor: "black",
|
|
91
|
+
position: "relative"
|
|
92
|
+
},
|
|
93
|
+
children: [
|
|
94
|
+
isLoading ? /* @__PURE__ */ jsx(
|
|
95
|
+
Flex,
|
|
96
|
+
{
|
|
97
|
+
align: "center",
|
|
98
|
+
height: "100%",
|
|
99
|
+
justify: "center",
|
|
100
|
+
position: "absolute",
|
|
101
|
+
style: {
|
|
102
|
+
position: "absolute",
|
|
103
|
+
top: 0,
|
|
104
|
+
left: 0,
|
|
105
|
+
zIndex: 1,
|
|
106
|
+
color: "white"
|
|
107
|
+
},
|
|
108
|
+
width: "100%",
|
|
109
|
+
children: /* @__PURE__ */ jsx(Spinner, { size: "3", style: { width: 48, height: 48 } })
|
|
110
|
+
}
|
|
111
|
+
) : null,
|
|
112
|
+
/* @__PURE__ */ jsx(
|
|
113
|
+
"iframe",
|
|
114
|
+
{
|
|
115
|
+
allowFullScreen: true,
|
|
116
|
+
onError: () => {
|
|
117
|
+
setIsLoading(false);
|
|
118
|
+
},
|
|
119
|
+
onLoad: () => {
|
|
120
|
+
setIsLoading(false);
|
|
121
|
+
},
|
|
122
|
+
src: `${value.url}?theme=light`,
|
|
123
|
+
style: { width: "100%", height: "100%", border: "none" },
|
|
124
|
+
title: "Curriculum Video"
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
) })
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
] });
|
|
133
|
+
}
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
function TrainingInfoGuidelineButton({
|
|
137
|
+
icon,
|
|
138
|
+
title,
|
|
139
|
+
description,
|
|
140
|
+
onClick
|
|
141
|
+
}) {
|
|
142
|
+
return /* @__PURE__ */ jsx(
|
|
143
|
+
Button,
|
|
144
|
+
{
|
|
145
|
+
onClick,
|
|
146
|
+
style: { width: "100%", height: "48px" },
|
|
147
|
+
variant: "outline",
|
|
148
|
+
children: /* @__PURE__ */ jsxs(Flex, { align: "center", gap: "2", width: "100%", children: [
|
|
149
|
+
icon,
|
|
150
|
+
/* @__PURE__ */ jsx(Separator, { orientation: "vertical", size: "2" }),
|
|
151
|
+
/* @__PURE__ */ jsxs(Box, { children: [
|
|
152
|
+
/* @__PURE__ */ jsx(Typo, { as: "div", mb: "1", children: title }),
|
|
153
|
+
typeof description === "string" && description !== "" ? /* @__PURE__ */ jsx(Typo, { variant: "caption", children: description }) : null
|
|
154
|
+
] })
|
|
155
|
+
] })
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export {
|
|
161
|
+
TrainingInfoGuideline
|
|
162
|
+
};
|
|
163
|
+
//# sourceMappingURL=chunk-NBVTF6TV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/training-info-guideline.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { FileTextIcon, VideoIcon } from '@radix-ui/react-icons';\nimport { AspectRatio } from '@/atoms/aspect-ratio';\nimport { Button } from '@/atoms/button';\nimport type { TrainingInfoGuidelineContents } from '@/types/training-info-guideline-schema-generated';\nimport { Dialog } from '@/atoms/dialog';\nimport { Spinner } from '@/atoms/spinner';\nimport { Box } from '@/atoms/box';\nimport { Separator } from '@/atoms/separator';\nimport { Typo } from '@/atoms/typo';\nimport { Flex } from '../atoms/flex';\n\nexport interface TrainingInfoGuidelineProps {\n values: TrainingInfoGuidelineContents['values'];\n onClickFileDownload: (args: { url: string; filename: string }) => void;\n}\n\nexport function TrainingInfoGuideline({\n values,\n onClickFileDownload,\n}: TrainingInfoGuidelineProps): React.ReactElement {\n return (\n <>\n {values.map((value) => (\n <TrainingInfoGuidelineItem\n key={getItemKey(value)}\n onClickFileDownload={onClickFileDownload}\n value={value}\n />\n ))}\n </>\n );\n}\n\ntype TrainingInfoGuidelineValue =\n TrainingInfoGuidelineContents['values'][number];\n\nfunction getItemKey(value: TrainingInfoGuidelineValue): string {\n return value.url;\n}\n\ninterface TrainingInfoGuidelineItemProps {\n value: TrainingInfoGuidelineValue;\n onClickFileDownload: TrainingInfoGuidelineProps['onClickFileDownload'];\n}\n\nfunction TrainingInfoGuidelineItem({\n value,\n onClickFileDownload,\n}: TrainingInfoGuidelineItemProps): React.ReactElement | null {\n const [isLoading, setIsLoading] = useState(true);\n\n if (value.type === 'file') {\n return (\n <TrainingInfoGuidelineButton\n description={value.filename}\n icon={<FileTextIcon />}\n onClick={() => {\n onClickFileDownload({ url: value.url, filename: value.filename });\n }}\n title={value.downloadButtonName}\n />\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- 차후 다른 타입 추가 시 사용\n if (value.type === 'video') {\n return (\n <Dialog.Root>\n <Dialog.Trigger>\n <TrainingInfoGuidelineButton\n description=\"영상\"\n icon={<VideoIcon />}\n title={value.videoTitle}\n />\n </Dialog.Trigger>\n <Dialog.Content\n height=\"100%\"\n maxHeight=\"500px\"\n maxWidth=\"800px\"\n title={value.videoTitle}\n width=\"100%\"\n >\n <AspectRatio ratio={16 / 9} style={{ width: '100%' }}>\n <Flex\n align=\"center\"\n justify=\"center\"\n style={{\n width: '100%',\n height: '100%',\n backgroundColor: 'black',\n position: 'relative',\n }}\n >\n {isLoading ? (\n <Flex\n align=\"center\"\n height=\"100%\"\n justify=\"center\"\n position=\"absolute\"\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n zIndex: 1,\n color: 'white',\n }}\n width=\"100%\"\n >\n <Spinner size=\"3\" style={{ width: 48, height: 48 }} />\n </Flex>\n ) : null}\n\n <iframe\n allowFullScreen\n onError={() => {\n setIsLoading(false);\n }} // 필요시 에러 메시지로 대체\n onLoad={() => {\n setIsLoading(false);\n }}\n src={`${value.url}?theme=light`}\n style={{ width: '100%', height: '100%', border: 'none' }}\n title=\"Curriculum Video\"\n />\n </Flex>\n </AspectRatio>\n </Dialog.Content>\n </Dialog.Root>\n );\n }\n return null;\n}\n\ninterface TrainingInfoGuidelineButtonProps {\n icon: React.ReactNode;\n title: string;\n description?: string;\n onClick?: () => void;\n}\n\nfunction TrainingInfoGuidelineButton({\n icon,\n title,\n description,\n onClick,\n}: TrainingInfoGuidelineButtonProps): React.ReactElement {\n return (\n <Button\n onClick={onClick}\n style={{ width: '100%', height: '48px' }}\n variant=\"outline\"\n >\n <Flex align=\"center\" gap=\"2\" width=\"100%\">\n {icon}\n <Separator orientation=\"vertical\" size=\"2\" />\n <Box>\n <Typo as=\"div\" mb=\"1\">{title}</Typo>\n {typeof description === 'string' && description !== '' ? (\n <Typo variant=\"caption\">{description}</Typo>\n ) : null}\n </Box>\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