@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,158 @@
|
|
|
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
|
+
style: { width: "100%" },
|
|
56
|
+
variant: "outline",
|
|
57
|
+
children: /* @__PURE__ */ jsx(
|
|
58
|
+
TrainingInfoGuidelineButtonContent,
|
|
59
|
+
{
|
|
60
|
+
description: value.filename,
|
|
61
|
+
icon: /* @__PURE__ */ jsx(FileTextIcon, {}),
|
|
62
|
+
title: value.downloadButtonName
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
if (value.type === "video") {
|
|
69
|
+
return /* @__PURE__ */ jsxs(Dialog.Root, { children: [
|
|
70
|
+
/* @__PURE__ */ jsx(Dialog.Trigger, { children: /* @__PURE__ */ jsx(Button, { size: "large", style: { width: "100%" }, variant: "outline", children: /* @__PURE__ */ jsx(
|
|
71
|
+
TrainingInfoGuidelineButtonContent,
|
|
72
|
+
{
|
|
73
|
+
description: "\uC601\uC0C1",
|
|
74
|
+
icon: /* @__PURE__ */ jsx(VideoIcon, {}),
|
|
75
|
+
title: value.videoTitle
|
|
76
|
+
}
|
|
77
|
+
) }) }),
|
|
78
|
+
/* @__PURE__ */ jsx(
|
|
79
|
+
Dialog.Content,
|
|
80
|
+
{
|
|
81
|
+
height: "100%",
|
|
82
|
+
maxHeight: "500px",
|
|
83
|
+
maxWidth: "800px",
|
|
84
|
+
title: value.videoTitle,
|
|
85
|
+
width: "100%",
|
|
86
|
+
children: /* @__PURE__ */ jsx(AspectRatio, { ratio: 16 / 9, style: { width: "100%" }, children: /* @__PURE__ */ jsxs(
|
|
87
|
+
Flex,
|
|
88
|
+
{
|
|
89
|
+
align: "center",
|
|
90
|
+
justify: "center",
|
|
91
|
+
style: {
|
|
92
|
+
width: "100%",
|
|
93
|
+
height: "100%",
|
|
94
|
+
backgroundColor: "black",
|
|
95
|
+
position: "relative"
|
|
96
|
+
},
|
|
97
|
+
children: [
|
|
98
|
+
isLoading ? /* @__PURE__ */ jsx(
|
|
99
|
+
Flex,
|
|
100
|
+
{
|
|
101
|
+
align: "center",
|
|
102
|
+
height: "100%",
|
|
103
|
+
justify: "center",
|
|
104
|
+
position: "absolute",
|
|
105
|
+
style: {
|
|
106
|
+
position: "absolute",
|
|
107
|
+
top: 0,
|
|
108
|
+
left: 0,
|
|
109
|
+
zIndex: 1,
|
|
110
|
+
color: "white"
|
|
111
|
+
},
|
|
112
|
+
width: "100%",
|
|
113
|
+
children: /* @__PURE__ */ jsx(Spinner, { size: "3", style: { width: 48, height: 48 } })
|
|
114
|
+
}
|
|
115
|
+
) : null,
|
|
116
|
+
/* @__PURE__ */ jsx(
|
|
117
|
+
"iframe",
|
|
118
|
+
{
|
|
119
|
+
allowFullScreen: true,
|
|
120
|
+
onError: () => {
|
|
121
|
+
setIsLoading(false);
|
|
122
|
+
},
|
|
123
|
+
onLoad: () => {
|
|
124
|
+
setIsLoading(false);
|
|
125
|
+
},
|
|
126
|
+
src: `${value.url}?theme=light`,
|
|
127
|
+
style: { width: "100%", height: "100%", border: "none" },
|
|
128
|
+
title: "Curriculum Video"
|
|
129
|
+
}
|
|
130
|
+
)
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
) })
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
] });
|
|
137
|
+
}
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
function TrainingInfoGuidelineButtonContent({
|
|
141
|
+
icon,
|
|
142
|
+
title,
|
|
143
|
+
description
|
|
144
|
+
}) {
|
|
145
|
+
return /* @__PURE__ */ jsxs(Flex, { align: "center", gap: "2", width: "100%", children: [
|
|
146
|
+
icon,
|
|
147
|
+
/* @__PURE__ */ jsx(Separator, { orientation: "vertical", size: "2" }),
|
|
148
|
+
/* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "1", children: [
|
|
149
|
+
/* @__PURE__ */ jsx(Typo, { children: title }),
|
|
150
|
+
typeof description === "string" && description !== "" ? /* @__PURE__ */ jsx(Typo, { variant: "caption", children: description }) : null
|
|
151
|
+
] })
|
|
152
|
+
] });
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export {
|
|
156
|
+
TrainingInfoGuideline
|
|
157
|
+
};
|
|
158
|
+
//# sourceMappingURL=chunk-XTU7VQ2V.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 { Separator, Typo } from '@/atoms';\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 <Button\n onClick={() => {\n onClickFileDownload({ url: value.url, filename: value.filename });\n }}\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,KAmEI,YArER;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,S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,oBACT,OAAO;AAAA,sBACL,UAAU;AAAA,sBACV,KAAK;AAAA,sBACL,MAAM;AAAA,sBACN,QAAQ;AAAA,sBACR,OAAO;AAAA,oBACT;AAAA,oBACA,OAAM;AAAA,oBAEN,8BAAC,WAAQ,MAAK,KAAI,OAAO,EAAE,OAAO,IAAI,QAAQ,GAAG,GAAG;AAAA;AAAA,gBACtD,IACE;AAAA,gBAEJ;AAAA,kBAAC;AAAA;AAAA,oBACC,iBAAe;AAAA,oBACf,SAAS,MAAM;AACb,mCAAa,KAAK;AAAA,oBACpB;AAAA,oBACA,QAAQ,MAAM;AACZ,mCAAa,KAAK;AAAA,oBACpB;AAAA,oBACA,KAAK,GAAG,MAAM,GAAG;AAAA,oBACjB,OAAO,EAAE,OAAO,QAAQ,QAAQ,QAAQ,QAAQ,OAAO;AAAA,oBACvD,OAAM;AAAA;AAAA,gBACR;AAAA;AAAA;AAAA,UACF,GACF;AAAA;AAAA,MACF;AAAA,OACF;AAAA,EAEJ;AACA,SAAO;AACT;AAQA,SAAS,mCAAmC;AAAA,EAC1C;AAAA,EACA;AAAA,EACA;AACF,GAAgE;AAC9D,SACE,qBAAC,QAAK,OAAM,UAAS,KAAI,KAAI,OAAM,QAChC;AAAA;AAAA,IACD,oBAAC,aAAU,aAAY,YAAW,MAAK,KAAI;AAAA,IAC3C,qBAAC,QAAK,WAAU,UAAS,KAAI,KAC3B;AAAA,0BAAC,QAAM,iBAAM;AAAA,MACZ,OAAO,gBAAgB,YAAY,gBAAgB,KAClD,oBAAC,QAAK,SAAQ,WAAW,uBAAY,IACnC;AAAA,OACN;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {
|
|
2
|
+
curriculum_sidebar_item_wrapper_default
|
|
3
|
+
} from "./chunk-WS7IOHVK.js";
|
|
4
|
+
import {
|
|
5
|
+
section_item_default
|
|
6
|
+
} from "./chunk-SI6QBFXF.js";
|
|
7
|
+
import {
|
|
8
|
+
section_title_default
|
|
9
|
+
} from "./chunk-4TST4UK5.js";
|
|
10
|
+
import {
|
|
11
|
+
getCurriculumIconColor
|
|
12
|
+
} from "./chunk-XW3D3GLY.js";
|
|
13
|
+
import {
|
|
14
|
+
__spreadProps,
|
|
15
|
+
__spreadValues
|
|
16
|
+
} from "./chunk-CRTRMMJ7.js";
|
|
17
|
+
|
|
18
|
+
// src/molecules/curriculumV2/CurriculumSidebar/sidebar-item.tsx
|
|
19
|
+
import { jsx } from "react/jsx-runtime";
|
|
20
|
+
function SidebarItem({ item, selectedIndex, setSelectedIndex, index, done }) {
|
|
21
|
+
if (item.type === "sectionTitle") {
|
|
22
|
+
return /* @__PURE__ */ jsx(section_title_default, __spreadValues({}, item), item.uuid);
|
|
23
|
+
}
|
|
24
|
+
const isSelected = selectedIndex === index;
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
curriculum_sidebar_item_wrapper_default,
|
|
27
|
+
{
|
|
28
|
+
index,
|
|
29
|
+
isSelected,
|
|
30
|
+
onClick: () => {
|
|
31
|
+
setSelectedIndex(index);
|
|
32
|
+
},
|
|
33
|
+
children: /* @__PURE__ */ jsx(
|
|
34
|
+
section_item_default,
|
|
35
|
+
__spreadProps(__spreadValues({}, item), {
|
|
36
|
+
color: getCurriculumIconColor({
|
|
37
|
+
done,
|
|
38
|
+
selected: isSelected
|
|
39
|
+
})
|
|
40
|
+
})
|
|
41
|
+
)
|
|
42
|
+
},
|
|
43
|
+
item.uuid
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
var sidebar_item_default = SidebarItem;
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
sidebar_item_default
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=chunk-XUTEGDQM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/curriculumV2/CurriculumSidebar/sidebar-item.tsx"],"sourcesContent":["import type { CurriculumListContents } from '@/types/curriculum.type'; \nimport { getCurriculumIconColor } from '../../../utils/curriculum.utils';\nimport SectionTitle from './Items/section-title';\nimport CurriculumSidebarItemWrapper from './Items/curriculum-sidebar-item-wrapper';\nimport SectionCommonItem from './Items/section-item';\n\n\ninterface SidebarItemProps {\n item: CurriculumListContents;\n selectedIndex: number;\n setSelectedIndex: (index: number) => void;\n index: number;\n done: boolean;\n}\n\nfunction SidebarItem({item, selectedIndex, setSelectedIndex, index, done}: SidebarItemProps): React.ReactNode {\n \n \n if (item.type === 'sectionTitle') {\n return <SectionTitle key={item.uuid} {...item} />;\n }\n const isSelected = selectedIndex === index;\n\n return (\n <CurriculumSidebarItemWrapper\n index={index}\n isSelected={isSelected}\n key={item.uuid}\n onClick={() => {\n setSelectedIndex(index);\n }}\n >\n <SectionCommonItem\n {...item}\n color={getCurriculumIconColor({\n done,\n selected: isSelected,\n })}\n />\n </CurriculumSidebarItemWrapper>\n );\n }\n\nexport default SidebarItem;"],"mappings":";;;;;;;;;;;;;;;;;;AAmBe;AAJf,SAAS,YAAY,EAAC,MAAM,eAAe,kBAAkB,OAAO,KAAI,GAAsC;AAG5G,MAAI,KAAK,SAAS,gBAAgB;AAC5B,WAAO,oBAAC,0CAAiC,OAAf,KAAK,IAAgB;AAAA,EACjD;AACA,QAAM,aAAa,kBAAkB;AAErC,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MAEA,SAAS,MAAM;AACb,yBAAiB,KAAK;AAAA,MACxB;AAAA,MAEA;AAAA,QAAC;AAAA,yCACK,OADL;AAAA,UAEC,OAAO,uBAAuB;AAAA,YAC5B;AAAA,YACA,UAAU;AAAA,UACZ,CAAC;AAAA;AAAA,MACH;AAAA;AAAA,IAXK,KAAK;AAAA,EAYZ;AAEJ;AAEJ,IAAO,uBAAQ;","names":[]}
|
|
@@ -0,0 +1,163 @@
|
|
|
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
|
+
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", textAlign: "left" },
|
|
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", 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-YBO2LITL.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' , textAlign: 'left'}}\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\">\n {title}\n </Typo>\n {typeof description === 'string' && description !== '' ? (\n <Typo variant=\"caption\" >\n {description}\n </Typo>\n ) : null}\n </Box>\n \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,GA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,aAAY,YAAW,MAAK,KAAI;AAAA,QAC3C,qBAAC,OACC;AAAA,8BAAC,QAAK,IAAG,OACN,iBACH;AAAA,UACC,OAAO,gBAAgB,YAAY,gBAAgB,KAClD,oBAAC,QAAK,SAAQ,WACX,uBACH,IACE;AAAA,WACN;AAAA,SAEF;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Spinner
|
|
3
|
+
} from "./chunk-FR2GDOU2.js";
|
|
4
|
+
import {
|
|
5
|
+
Dialog
|
|
6
|
+
} from "./chunk-AH4A53SZ.js";
|
|
7
|
+
import {
|
|
8
|
+
Flex
|
|
9
|
+
} from "./chunk-25HMMI7R.js";
|
|
10
|
+
import {
|
|
11
|
+
Button
|
|
12
|
+
} from "./chunk-ZVDAEY5Q.js";
|
|
13
|
+
import {
|
|
14
|
+
AspectRatio
|
|
15
|
+
} from "./chunk-EAXUQEO5.js";
|
|
16
|
+
|
|
17
|
+
// src/molecules/training-info-guideline.tsx
|
|
18
|
+
import { useState } from "react";
|
|
19
|
+
import { FileTextIcon, VideoIcon } from "@radix-ui/react-icons";
|
|
20
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
21
|
+
function TrainingInfoGuideline({
|
|
22
|
+
values,
|
|
23
|
+
onClickFileDownload
|
|
24
|
+
}) {
|
|
25
|
+
return /* @__PURE__ */ jsx(Fragment, { children: values.map((value) => /* @__PURE__ */ jsx(
|
|
26
|
+
TrainingInfoGuidelineItem,
|
|
27
|
+
{
|
|
28
|
+
onClickFileDownload,
|
|
29
|
+
value
|
|
30
|
+
},
|
|
31
|
+
getItemKey(value)
|
|
32
|
+
)) });
|
|
33
|
+
}
|
|
34
|
+
function getItemKey(value) {
|
|
35
|
+
return value.url;
|
|
36
|
+
}
|
|
37
|
+
function TrainingInfoGuidelineItem({
|
|
38
|
+
value,
|
|
39
|
+
onClickFileDownload
|
|
40
|
+
}) {
|
|
41
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
42
|
+
if (value.type === "file") {
|
|
43
|
+
return /* @__PURE__ */ jsx(
|
|
44
|
+
Button,
|
|
45
|
+
{
|
|
46
|
+
onClick: () => {
|
|
47
|
+
onClickFileDownload({ url: value.url, filename: value.filename });
|
|
48
|
+
},
|
|
49
|
+
variant: "outline",
|
|
50
|
+
children: /* @__PURE__ */ jsxs(Flex, { align: "center", gap: "2", width: "100%", children: [
|
|
51
|
+
/* @__PURE__ */ jsx(FileTextIcon, {}),
|
|
52
|
+
value.downloadButtonName
|
|
53
|
+
] })
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
if (value.type === "video") {
|
|
58
|
+
return /* @__PURE__ */ jsxs(Dialog.Root, { children: [
|
|
59
|
+
/* @__PURE__ */ jsx(Dialog.Trigger, { children: /* @__PURE__ */ jsxs(Button, { variant: "surface", children: [
|
|
60
|
+
/* @__PURE__ */ jsx(VideoIcon, {}),
|
|
61
|
+
value.videoTitle
|
|
62
|
+
] }) }),
|
|
63
|
+
/* @__PURE__ */ jsx(
|
|
64
|
+
Dialog.Content,
|
|
65
|
+
{
|
|
66
|
+
height: "100%",
|
|
67
|
+
maxHeight: "500px",
|
|
68
|
+
maxWidth: "800px",
|
|
69
|
+
title: value.videoTitle,
|
|
70
|
+
width: "100%",
|
|
71
|
+
children: /* @__PURE__ */ jsx(AspectRatio, { ratio: 16 / 9, style: { width: "100%" }, children: /* @__PURE__ */ jsxs(
|
|
72
|
+
Flex,
|
|
73
|
+
{
|
|
74
|
+
align: "center",
|
|
75
|
+
justify: "center",
|
|
76
|
+
style: {
|
|
77
|
+
width: "100%",
|
|
78
|
+
height: "100%",
|
|
79
|
+
backgroundColor: "black",
|
|
80
|
+
position: "relative"
|
|
81
|
+
},
|
|
82
|
+
children: [
|
|
83
|
+
isLoading ? /* @__PURE__ */ jsx(
|
|
84
|
+
Flex,
|
|
85
|
+
{
|
|
86
|
+
align: "center",
|
|
87
|
+
height: "100%",
|
|
88
|
+
justify: "center",
|
|
89
|
+
position: "absolute",
|
|
90
|
+
style: {
|
|
91
|
+
position: "absolute",
|
|
92
|
+
top: 0,
|
|
93
|
+
left: 0,
|
|
94
|
+
zIndex: 1,
|
|
95
|
+
color: "white"
|
|
96
|
+
},
|
|
97
|
+
width: "100%",
|
|
98
|
+
children: /* @__PURE__ */ jsx(Spinner, { size: "3", style: { width: 48, height: 48 } })
|
|
99
|
+
}
|
|
100
|
+
) : null,
|
|
101
|
+
/* @__PURE__ */ jsx(
|
|
102
|
+
"iframe",
|
|
103
|
+
{
|
|
104
|
+
allowFullScreen: true,
|
|
105
|
+
onError: () => {
|
|
106
|
+
setIsLoading(false);
|
|
107
|
+
},
|
|
108
|
+
onLoad: () => {
|
|
109
|
+
setIsLoading(false);
|
|
110
|
+
},
|
|
111
|
+
src: `${value.url}?theme=light`,
|
|
112
|
+
style: { width: "100%", height: "100%", border: "none" },
|
|
113
|
+
title: "Curriculum Video"
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
) })
|
|
119
|
+
}
|
|
120
|
+
)
|
|
121
|
+
] });
|
|
122
|
+
}
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export {
|
|
127
|
+
TrainingInfoGuideline
|
|
128
|
+
};
|
|
129
|
+
//# sourceMappingURL=chunk-YOADPBEF.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';\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 variant=\"outline\"\n >\n <Flex align=\"center\" gap=\"2\" width=\"100%\" >\n <FileTextIcon />\n {value.downloadButtonName}\n </Flex>\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 variant=\"surface\">\n <VideoIcon />\n {value.videoTitle}\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"],"mappings":";;;;;;;;;;;;;;;;;AAAA,SAAgB,gBAAgB;AAChC,SAAS,cAAc,iBAAiB;AAkBpC,mBAEI,KAoCA,YAtCJ;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,SAAS,MAAM;AACb,8BAAoB,EAAE,KAAK,MAAM,KAAK,UAAU,MAAM,SAAS,CAAC;AAAA,QAClE;AAAA,QACA,SAAQ;AAAA,QAER,+BAAC,QAAK,OAAM,UAAS,KAAI,KAAI,OAAM,QACjC;AAAA,8BAAC,gBAAa;AAAA,UACb,MAAM;AAAA,WACT;AAAA;AAAA,IACF;AAAA,EAEJ;AAGA,MAAI,MAAM,SAAS,SAAS;AAC1B,WACE,qBAAC,OAAO,MAAP,EACC;AAAA,0BAAC,OAAO,SAAP,EACC,+BAAC,UAAO,SAAQ,WACd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