@tipp/ui 2.3.19 → 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.
Files changed (124) hide show
  1. package/dist/app/index.cjs.map +1 -1
  2. package/dist/app/index.js +91 -91
  3. package/dist/app/platform/coach-question-list.js +31 -31
  4. package/dist/app/platform/contents-card.js +31 -31
  5. package/dist/app/platform/curriculum-card.js +5 -5
  6. package/dist/app/platform/edit-coaching-time.cjs.map +1 -1
  7. package/dist/app/platform/edit-coaching-time.js +72 -72
  8. package/dist/app/platform/edit-service-type.cjs.map +1 -1
  9. package/dist/app/platform/edit-service-type.js +73 -73
  10. package/dist/app/platform/goal-manage-card-edit.cjs.map +1 -1
  11. package/dist/app/platform/goal-manage-card-edit.js +72 -72
  12. package/dist/app/platform/goal-manage-card-read.js +31 -31
  13. package/dist/app/platform/on-offline-radio-card.cjs.map +1 -1
  14. package/dist/app/platform/on-offline-radio-card.js +72 -72
  15. package/dist/app/platform/report-card.js +31 -31
  16. package/dist/app/platform/reservation-card.cjs.map +1 -1
  17. package/dist/app/platform/reservation-card.js +73 -73
  18. package/dist/app/platform/session-card.cjs.map +1 -1
  19. package/dist/app/platform/session-card.js +75 -75
  20. package/dist/app/platform/session-review-simple-read.js +31 -31
  21. package/dist/app/platform/userInfos/coaching-customer-info/index.js +36 -36
  22. package/dist/app/platform/userInfos/coaching-customer-info/large.js +31 -31
  23. package/dist/app/platform/userInfos/coaching-customer-info/medium.js +31 -31
  24. package/dist/app/platform/userInfos/coaching-customer-info/small.js +31 -31
  25. package/dist/app/platform/userInfos/session-user-info-detail.js +31 -31
  26. package/dist/app/platform/userInfos/utils.js +30 -30
  27. package/dist/atoms/bullet-text.js +2 -2
  28. package/dist/atoms/dialog.js +2 -2
  29. package/dist/atoms/field-error-wrapper.js +2 -2
  30. package/dist/atoms/index.js +62 -62
  31. package/dist/atoms/list.js +2 -2
  32. package/dist/atoms/pagination.js +3 -3
  33. package/dist/chunk-3P5XU4EK.js +87 -0
  34. package/dist/chunk-3P5XU4EK.js.map +1 -0
  35. package/dist/chunk-5P7255ZD.js +144 -0
  36. package/dist/chunk-5P7255ZD.js.map +1 -0
  37. package/dist/chunk-6VWGOH4J.js +218 -0
  38. package/dist/chunk-6VWGOH4J.js.map +1 -0
  39. package/dist/chunk-B5J4YCG2.js +98 -0
  40. package/dist/chunk-B5J4YCG2.js.map +1 -0
  41. package/dist/chunk-C5HQZR32.js +196 -0
  42. package/dist/chunk-C5HQZR32.js.map +1 -0
  43. package/dist/chunk-DGOKT7ZK.js +163 -0
  44. package/dist/chunk-DGOKT7ZK.js.map +1 -0
  45. package/dist/chunk-DR3ELFWR.js +69 -0
  46. package/dist/chunk-DR3ELFWR.js.map +1 -0
  47. package/dist/chunk-GRD6VL3Q.js +49 -0
  48. package/dist/chunk-GRD6VL3Q.js.map +1 -0
  49. package/dist/chunk-N3A4EUDH.js +101 -0
  50. package/dist/chunk-N3A4EUDH.js.map +1 -0
  51. package/dist/chunk-OWJKGWFQ.js +89 -0
  52. package/dist/chunk-OWJKGWFQ.js.map +1 -0
  53. package/dist/chunk-P4ELC3C3.js +145 -0
  54. package/dist/chunk-P4ELC3C3.js.map +1 -0
  55. package/dist/chunk-SI6QBFXF.js +29 -0
  56. package/dist/chunk-SI6QBFXF.js.map +1 -0
  57. package/dist/chunk-TKX3HVMK.js +30 -0
  58. package/dist/chunk-TKX3HVMK.js.map +1 -0
  59. package/dist/chunk-TLEAX2CO.js +43 -0
  60. package/dist/chunk-TLEAX2CO.js.map +1 -0
  61. package/dist/chunk-TQCYWSCL.js +69 -0
  62. package/dist/chunk-TQCYWSCL.js.map +1 -0
  63. package/dist/chunk-UFKDKEI7.js +151 -0
  64. package/dist/chunk-UFKDKEI7.js.map +1 -0
  65. package/dist/chunk-WE2VD6CD.js +37 -0
  66. package/dist/chunk-WE2VD6CD.js.map +1 -0
  67. package/dist/chunk-XPTGW7ZC.js +69 -0
  68. package/dist/chunk-XPTGW7ZC.js.map +1 -0
  69. package/dist/chunk-XUTEGDQM.js +51 -0
  70. package/dist/chunk-XUTEGDQM.js.map +1 -0
  71. package/dist/chunk-Z6B4C5AB.js +63 -0
  72. package/dist/chunk-Z6B4C5AB.js.map +1 -0
  73. package/dist/chunk-ZYFRVFJE.js +163 -0
  74. package/dist/chunk-ZYFRVFJE.js.map +1 -0
  75. package/dist/context/index.js +5 -5
  76. package/dist/index.cjs +2 -2
  77. package/dist/index.cjs.map +1 -1
  78. package/dist/index.js +133 -133
  79. package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/index.js +18 -18
  80. package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-comp.js +4 -4
  81. package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-body.js +11 -11
  82. package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-footer.js +2 -2
  83. package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-header.js +3 -3
  84. package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-layout.js +2 -2
  85. package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-radio.js +6 -6
  86. package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-satisfaction-option.js +5 -5
  87. package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-satisfaction-text.js +5 -5
  88. package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-text.js +5 -5
  89. package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/complete-review.js +4 -4
  90. package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/index.js +21 -21
  91. package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/start-review.js +6 -6
  92. package/dist/molecules/curriculumV2/CurriculumContents/curriculum-ai-traning.js +3 -3
  93. package/dist/molecules/curriculumV2/CurriculumContents/curriculum-file-download.js +3 -3
  94. package/dist/molecules/curriculumV2/CurriculumContents/curriculum-review.js +23 -23
  95. package/dist/molecules/curriculumV2/CurriculumContents/index.js +27 -27
  96. package/dist/molecules/curriculumV2/CurriculumSidebar/Items/curriculum-item-title.js +2 -2
  97. package/dist/molecules/curriculumV2/CurriculumSidebar/Items/section-item.js +4 -4
  98. package/dist/molecules/curriculumV2/CurriculumSidebar/index.js +7 -7
  99. package/dist/molecules/curriculumV2/CurriculumSidebar/sidebar-item.js +5 -5
  100. package/dist/molecules/curriculumV2/curriculum-sub-nav.js +4 -4
  101. package/dist/molecules/curriculumV2/curriculum-v2-layout.js +2 -2
  102. package/dist/molecules/curriculumV2/index.js +36 -36
  103. package/dist/molecules/date-picker/date-picker-button.js +6 -6
  104. package/dist/molecules/date-picker/index.js +5 -5
  105. package/dist/molecules/description-json-render.js +5 -5
  106. package/dist/molecules/download-card.js +2 -2
  107. package/dist/molecules/dynamic-field.js +6 -6
  108. package/dist/molecules/dynamic-form.js +7 -7
  109. package/dist/molecules/expand-table/index.js +5 -5
  110. package/dist/molecules/force-refresh.js +2 -2
  111. package/dist/molecules/ghost-post.js +4 -4
  112. package/dist/molecules/index.cjs +2 -2
  113. package/dist/molecules/index.cjs.map +1 -1
  114. package/dist/molecules/index.js +60 -60
  115. package/dist/molecules/learning-post.js +6 -6
  116. package/dist/molecules/navigation.js +3 -3
  117. package/dist/molecules/one-on-one-guide-list.js +3 -3
  118. package/dist/molecules/stepper.js +4 -4
  119. package/dist/molecules/tag-selector.js +5 -5
  120. package/dist/molecules/training-info-guideline.cjs +2 -2
  121. package/dist/molecules/training-info-guideline.cjs.map +1 -1
  122. package/dist/molecules/training-info-guideline.js +7 -7
  123. package/package.json +3 -3
  124. package/src/molecules/training-info-guideline.tsx +2 -2
@@ -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: "\uD30C\uC77C \uB2E4\uC6B4\uB85C\uB4DC",
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 \uC790\uB8CC",
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-DGOKT7ZK.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=\"파일 다운로드\"\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":"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","names":[]}
@@ -0,0 +1,69 @@
1
+ import {
2
+ curriculum_review_default
3
+ } from "./chunk-C5HQZR32.js";
4
+ import {
5
+ curriculum_video_default
6
+ } from "./chunk-QGKQ3IX7.js";
7
+ import {
8
+ curriculum_ai_traning_default
9
+ } from "./chunk-AZ2ZKABM.js";
10
+ import {
11
+ curriculum_file_download_default
12
+ } from "./chunk-PEFP2QUH.js";
13
+ import {
14
+ useCurriculumContext
15
+ } from "./chunk-Y7SJF3Y3.js";
16
+ import {
17
+ Flex
18
+ } from "./chunk-25HMMI7R.js";
19
+ import {
20
+ InfoCircledIcon
21
+ } from "./chunk-W5TPOFOO.js";
22
+ import {
23
+ Typo
24
+ } from "./chunk-PMJIFLDT.js";
25
+
26
+ // src/molecules/curriculumV2/CurriculumContents/index.tsx
27
+ import { jsx, jsxs } from "react/jsx-runtime";
28
+ function CurriculumBody() {
29
+ const { selectedItem, selectedSectionTitle } = useCurriculumContext();
30
+ switch (selectedItem.type) {
31
+ case "video":
32
+ return /* @__PURE__ */ jsx(curriculum_video_default, { item: selectedItem });
33
+ case "review":
34
+ return /* @__PURE__ */ jsx(
35
+ curriculum_review_default,
36
+ {
37
+ item: selectedItem,
38
+ sectionTitle: selectedSectionTitle == null ? void 0 : selectedSectionTitle.title
39
+ }
40
+ );
41
+ case "aiTraining":
42
+ return /* @__PURE__ */ jsx(curriculum_ai_traning_default, { item: selectedItem });
43
+ case "fileDownload":
44
+ return /* @__PURE__ */ jsx(curriculum_file_download_default, { item: selectedItem });
45
+ default:
46
+ return /* @__PURE__ */ jsxs(
47
+ Flex,
48
+ {
49
+ align: "center",
50
+ direction: "column",
51
+ gap: "2",
52
+ height: "100%",
53
+ justify: "center",
54
+ width: "100%",
55
+ children: [
56
+ /* @__PURE__ */ jsx(InfoCircledIcon, { height: 24, width: 24 }),
57
+ /* @__PURE__ */ jsx(Typo, { children: "\uCEE8\uD150\uCE20\uB97C \uB85C\uB529 \uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4" }),
58
+ /* @__PURE__ */ jsx(Typo, { align: "center", color: "gray", variant: "caption", children: `[debug info]
59
+ ${JSON.stringify(selectedItem)}` })
60
+ ]
61
+ }
62
+ );
63
+ }
64
+ }
65
+
66
+ export {
67
+ CurriculumBody
68
+ };
69
+ //# sourceMappingURL=chunk-DR3ELFWR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/molecules/curriculumV2/CurriculumContents/index.tsx"],"sourcesContent":["import React from 'react';\nimport { Flex } from '@/atoms/flex';\nimport { Typo } from '@/atoms/typo';\nimport { InfoCircledIcon } from '@/icon';\nimport { useCurriculumContext } from '../curriculum-context';\nimport CurriculumVideo from './curriculum-video';\nimport CurriculumReview from './curriculum-review';\nimport CurriculumAiTraning from './curriculum-ai-traning';\nimport CurriculumFileDownload from './curriculum-file-download';\n\nexport function CurriculumBody(): React.ReactNode {\n const { selectedItem, selectedSectionTitle } = useCurriculumContext();\n\n switch (selectedItem.type) {\n case 'video':\n return <CurriculumVideo item={selectedItem} />;\n case 'review':\n return (\n <CurriculumReview\n item={selectedItem}\n sectionTitle={selectedSectionTitle?.title}\n />\n );\n case 'aiTraining':\n return <CurriculumAiTraning item={selectedItem} />;\n case 'fileDownload':\n return <CurriculumFileDownload item={selectedItem} />;\n default:\n return (\n <Flex\n align=\"center\"\n direction=\"column\"\n gap=\"2\"\n height=\"100%\"\n justify=\"center\"\n width=\"100%\"\n >\n <InfoCircledIcon height={24} width={24} />\n <Typo>컨텐츠를 로딩 할 수 없습니다</Typo>\n <Typo align=\"center\" color=\"gray\" variant=\"caption\">\n {`[debug info]\n ${JSON.stringify(selectedItem)}`}\n </Typo>\n </Flex>\n );\n }\n} "],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAea,cAcL,YAdK;AALN,SAAS,iBAAkC;AAChD,QAAM,EAAE,cAAc,qBAAqB,IAAI,qBAAqB;AAEpE,UAAQ,aAAa,MAAM;AAAA,IACzB,KAAK;AACH,aAAO,oBAAC,4BAAgB,MAAM,cAAc;AAAA,IAC9C,KAAK;AACH,aACE;AAAA,QAAC;AAAA;AAAA,UACC,MAAM;AAAA,UACN,cAAc,6DAAsB;AAAA;AAAA,MACtC;AAAA,IAEJ,KAAK;AACH,aAAO,oBAAC,iCAAoB,MAAM,cAAc;AAAA,IAClD,KAAK;AACH,aAAO,oBAAC,oCAAuB,MAAM,cAAc;AAAA,IACrD;AACE,aACE;AAAA,QAAC;AAAA;AAAA,UACC,OAAM;AAAA,UACN,WAAU;AAAA,UACV,KAAI;AAAA,UACJ,QAAO;AAAA,UACP,SAAQ;AAAA,UACR,OAAM;AAAA,UAEN;AAAA,gCAAC,mBAAgB,QAAQ,IAAI,OAAO,IAAI;AAAA,YACxC,oBAAC,QAAK,0FAAgB;AAAA,YACtB,oBAAC,QAAK,OAAM,UAAS,OAAM,QAAO,SAAQ,WACvC;AAAA,cACC,KAAK,UAAU,YAAY,CAAC,IAChC;AAAA;AAAA;AAAA,MACF;AAAA,EAEN;AACF;","names":[]}
@@ -0,0 +1,49 @@
1
+ import {
2
+ ReviewQuestionContentHeader
3
+ } from "./chunk-TLEAX2CO.js";
4
+ import {
5
+ TextArea
6
+ } from "./chunk-5XYPLDI5.js";
7
+ import {
8
+ Grid
9
+ } from "./chunk-EGEQY3KT.js";
10
+ import {
11
+ Card
12
+ } from "./chunk-RP2RGCAW.js";
13
+
14
+ // src/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-satisfaction-text.tsx
15
+ import { jsx, jsxs } from "react/jsx-runtime";
16
+ function ReviewQuestionSatisfisText(props) {
17
+ var _a, _b;
18
+ const { question, answer, onChange } = props;
19
+ return /* @__PURE__ */ jsx(Card, { size: "2", style: { height: "100%", width: "100%" }, children: /* @__PURE__ */ jsxs(Grid, { height: "100%", rows: "auto 1fr", children: [
20
+ /* @__PURE__ */ jsx(
21
+ ReviewQuestionContentHeader,
22
+ {
23
+ icon: question.icon,
24
+ question: (_a = question.question) != null ? _a : "\uC774\uBC88 \uD559\uC2B5\uC5D0 \uB300\uD574 \uCD94\uAC00\uB85C \uB0A8\uAE38 \uC758\uACAC\uC774 \uC788\uB2E4\uBA74 \uACF5\uC720\uD574\uC8FC\uC138\uC694.",
25
+ title: (_b = question.title) != null ? _b : "\uB9CC\uC871\uB3C4 \uC870\uC0AC",
26
+ type: question.type
27
+ }
28
+ ),
29
+ /* @__PURE__ */ jsx(
30
+ TextArea,
31
+ {
32
+ mt: "2",
33
+ onChange: (e) => {
34
+ onChange(e.target.value);
35
+ },
36
+ placeholder: question.placeholder,
37
+ style: {
38
+ height: "100%"
39
+ },
40
+ value: answer
41
+ }
42
+ )
43
+ ] }) });
44
+ }
45
+
46
+ export {
47
+ ReviewQuestionSatisfisText
48
+ };
49
+ //# sourceMappingURL=chunk-GRD6VL3Q.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-satisfaction-text.tsx"],"sourcesContent":["import React from 'react';\nimport { type CurriculumReviewQuestionSatisfactionText } from '@/types/curriculumContents.type';\nimport { Card } from '@/atoms/card';\nimport { Grid } from '@/atoms/grid';\nimport { TextArea } from '@/atoms/text-area';\nimport { ReviewQuestionContentHeader } from './review-comp';\n\ninterface ReviewQuestionSatisfactionTextProps {\n question: CurriculumReviewQuestionSatisfactionText;\n answer: string;\n error?: string;\n onChange: (value: string) => void;\n}\n\nexport default function ReviewQuestionSatisfisText(\n props: ReviewQuestionSatisfactionTextProps\n): React.ReactNode {\n const { question, answer, onChange } = props;\n\n return (\n <Card size=\"2\" style={{ height: '100%', width: '100%' }}>\n <Grid height=\"100%\" rows=\"auto 1fr\">\n <ReviewQuestionContentHeader\n icon={question.icon}\n question={\n question.question ??\n '이번 학습에 대해 추가로 남길 의견이 있다면 공유해주세요.'\n }\n title={question.title ?? '만족도 조사'}\n type={question.type}\n />\n <TextArea\n mt=\"2\"\n onChange={(e) => {\n onChange(e.target.value);\n }}\n placeholder={question.placeholder}\n style={{\n height: '100%',\n }}\n value={answer}\n />\n </Grid>\n </Card>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAqBM,SACE,KADF;AAPS,SAAR,2BACL,OACiB;AAhBnB;AAiBE,QAAM,EAAE,UAAU,QAAQ,SAAS,IAAI;AAEvC,SACE,oBAAC,QAAK,MAAK,KAAI,OAAO,EAAE,QAAQ,QAAQ,OAAO,OAAO,GACpD,+BAAC,QAAK,QAAO,QAAO,MAAK,YACvB;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,SAAS;AAAA,QACf,WACE,cAAS,aAAT,YACA;AAAA,QAEF,QAAO,cAAS,UAAT,YAAkB;AAAA,QACzB,MAAM,SAAS;AAAA;AAAA,IACjB;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,IAAG;AAAA,QACH,UAAU,CAAC,MAAM;AACf,mBAAS,EAAE,OAAO,KAAK;AAAA,QACzB;AAAA,QACA,aAAa,SAAS;AAAA,QACtB,OAAO;AAAA,UACL,QAAQ;AAAA,QACV;AAAA,QACA,OAAO;AAAA;AAAA,IACT;AAAA,KACF,GACF;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,gBAAgB;AAAA,QAAhB;AAAA,UACC,OAAO;AAAA,UACP,eAAe;AAAA,UACf,OAAO;AAAA,YACL,OAAO;AAAA,YACP,QAAQ;AAAA,YACR,WAAW;AAAA,YACX,UAAU;AAAA,UACZ;AAAA,UACA,OAAO;AAAA,UAEP,8BAAC,QAAK,WAAU,UAAS,KAAI,KAAI,OAAM,QACpC,mBAAS,QAAQ,IAAI,CAAC,QAAQ,MAAM;AACnC,kBAAM,sBACJ,iBAAiB,MAAM,SAAS;AAClC,kBAAM,uBACJ,iBAAiB,MAAM,OAAO,MAAM;AACtC,kBAAM,oBACJ,iBACA,wBACA,MAAM,SAAS;AACjB,kBAAM,SAAS,MAAM;AACnB,kBAAI,oBAAqB,QAAO;AAChC,qBAAO,CAAC;AAAA,YACV,GAAG;AAEH,mBACE;AAAA,cAAC,gBAAgB;AAAA,cAAhB;AAAA,gBAGC;AAAA,gBACA,OAAO,EAAE,SAAS;AAAA,gBAElB,+BAAC,OACC;AAAA,sCAAC,QAAK,IAAG,KAAK,iBAAO,OAAM;AAAA,kBAC1B,sBACC,oBAAC,QAAK,OAAM,SAAQ,4CAAK,IACvB;AAAA,kBACH,oBACC,oBAAC,QAAK,OAAM,OAAM,yDAAQ,IACxB;AAAA,mBACN;AAAA;AAAA,cAZK,GAAG,OAAO,KAAK,IAAI,CAAC;AAAA,YAa3B;AAAA,UAEJ,CAAC,GACH;AAAA;AAAA,MACF,GACF;AAAA,MACA,oBAAC,QAAK,SAAQ,OAAM,IAAG,KACrB,8BAAC,UAAO,SAAS,aAAa,uCAAK,GACrC;AAAA,OACF;AAAA,KACF;AAEJ;AAEA,IAAO,gCAAQ;","names":[]}
@@ -0,0 +1,89 @@
1
+ import {
2
+ start_review_default
3
+ } from "./chunk-UFKDKEI7.js";
4
+ import {
5
+ ReviewQuestion_default
6
+ } from "./chunk-Z6B4C5AB.js";
7
+ import {
8
+ complete_review_default
9
+ } from "./chunk-PYGTM7ML.js";
10
+ import {
11
+ CurriculumReviewProvider,
12
+ useCurriculumReviewContext
13
+ } from "./chunk-GMKRNFH5.js";
14
+
15
+ // src/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/index.tsx
16
+ import { jsx } from "react/jsx-runtime";
17
+ function CurriculumReviewStepsInner() {
18
+ const {
19
+ formik,
20
+ step,
21
+ handleStart,
22
+ handleNext,
23
+ handlePrev,
24
+ onClickReviewMyAnswer,
25
+ handleSubmit,
26
+ currentQuestion,
27
+ currentAnswer,
28
+ currentError,
29
+ reviewContents,
30
+ handleAnswerChange
31
+ } = useCurriculumReviewContext();
32
+ const { questions } = reviewContents;
33
+ if (step === 0) {
34
+ return /* @__PURE__ */ jsx(start_review_default, { onStart: handleStart });
35
+ }
36
+ if (step > 0 && step <= questions.length && currentQuestion) {
37
+ return /* @__PURE__ */ jsx(
38
+ ReviewQuestion_default,
39
+ {
40
+ answer: currentAnswer,
41
+ error: currentError,
42
+ index: step - 1,
43
+ isLast: step === questions.length,
44
+ isLoading: formik.isSubmitting,
45
+ isNextDisabled: currentError !== void 0,
46
+ onChange: handleAnswerChange,
47
+ onNext: handleNext,
48
+ onPrev: handlePrev,
49
+ onSubmit: handleSubmit,
50
+ question: currentQuestion,
51
+ total: questions.length
52
+ }
53
+ );
54
+ }
55
+ return /* @__PURE__ */ jsx(complete_review_default, { onClickReviewMyAnswer });
56
+ }
57
+ function CurriculumReviewSteps({
58
+ contents,
59
+ title,
60
+ onClickEndReview,
61
+ onSubmit,
62
+ defaultValues,
63
+ curriculum,
64
+ onReviewValueChange,
65
+ mode,
66
+ done
67
+ }) {
68
+ return /* @__PURE__ */ jsx(
69
+ CurriculumReviewProvider,
70
+ {
71
+ curriculum,
72
+ defaultValues,
73
+ done,
74
+ mode,
75
+ onClickEndReview,
76
+ onReviewValueChange,
77
+ onSubmit,
78
+ reviewContents: contents,
79
+ sectionTitle: title,
80
+ children: /* @__PURE__ */ jsx(CurriculumReviewStepsInner, {})
81
+ }
82
+ );
83
+ }
84
+ var CurriculumReviewSteps_default = CurriculumReviewSteps;
85
+
86
+ export {
87
+ CurriculumReviewSteps_default
88
+ };
89
+ //# sourceMappingURL=chunk-OWJKGWFQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/index.tsx"],"sourcesContent":["import React from 'react';\nimport { type CurriculumReviewContents } from '@/types/curriculumContents.type';\nimport type { Curriculum } from '@/types'; \nimport {\n CurriculumReviewProvider,\n useCurriculumReviewContext,\n} from './curriculum-review-context';\nimport StartReview from './start-review';\nimport CompleteReview from './complete-review';\nimport ReviewQuestion from './ReviewQuestion';\n \nfunction CurriculumReviewStepsInner(): React.ReactNode {\n const {\n formik,\n step,\n handleStart,\n handleNext,\n handlePrev,\n onClickReviewMyAnswer,\n handleSubmit,\n currentQuestion,\n currentAnswer,\n currentError,\n reviewContents,\n handleAnswerChange,\n } = useCurriculumReviewContext();\n const { questions } = reviewContents;\n\n if (step === 0) {\n return <StartReview onStart={handleStart} />;\n }\n if (step > 0 && step <= questions.length && currentQuestion) {\n return (\n <ReviewQuestion\n answer={currentAnswer}\n error={currentError}\n index={step - 1}\n isLast={step === questions.length}\n isLoading={formik.isSubmitting}\n isNextDisabled={currentError !== undefined}\n onChange={handleAnswerChange}\n onNext={handleNext}\n onPrev={handlePrev}\n onSubmit={handleSubmit}\n question={currentQuestion}\n total={questions.length}\n />\n );\n }\n return <CompleteReview onClickReviewMyAnswer={onClickReviewMyAnswer} />;\n}\n\ninterface CurriculumReviewStepsProps {\n contents: CurriculumReviewContents;\n title: string | undefined;\n onClickEndReview: () => void;\n onSubmit: (values: Record<string, string>) => Promise<boolean>;\n defaultValues?: Record<string, string>;\n curriculum: Curriculum;\n onReviewValueChange: ({\n reviewId,\n answer,\n }: {\n reviewId: string;\n answer: Record<string, string>;\n }) => void;\n mode: 'edit' | 'create';\n done: boolean; \n}\n\nfunction CurriculumReviewSteps({\n contents,\n title,\n onClickEndReview,\n onSubmit,\n defaultValues,\n curriculum,\n onReviewValueChange,\n mode,\n done,\n}: CurriculumReviewStepsProps): React.ReactNode { \n\n return (\n <CurriculumReviewProvider\n curriculum={curriculum}\n defaultValues={defaultValues}\n done={done}\n mode={mode}\n onClickEndReview={onClickEndReview}\n onReviewValueChange={onReviewValueChange}\n onSubmit={onSubmit}\n reviewContents={contents}\n sectionTitle={title}\n >\n <CurriculumReviewStepsInner />\n </CurriculumReviewProvider>\n );\n}\n\nexport default CurriculumReviewSteps;\n"],"mappings":";;;;;;;;;;;;;;;AA6BW;AAlBX,SAAS,6BAA8C;AACrD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,2BAA2B;AAC/B,QAAM,EAAE,UAAU,IAAI;AAEtB,MAAI,SAAS,GAAG;AACd,WAAO,oBAAC,wBAAY,SAAS,aAAa;AAAA,EAC5C;AACA,MAAI,OAAO,KAAK,QAAQ,UAAU,UAAU,iBAAiB;AAC3D,WACE;AAAA,MAAC;AAAA;AAAA,QACC,QAAQ;AAAA,QACR,OAAO;AAAA,QACP,OAAO,OAAO;AAAA,QACd,QAAQ,SAAS,UAAU;AAAA,QAC3B,WAAW,OAAO;AAAA,QAClB,gBAAgB,iBAAiB;AAAA,QACjC,UAAU;AAAA,QACV,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR,UAAU;AAAA,QACV,UAAU;AAAA,QACV,OAAO,UAAU;AAAA;AAAA,IACnB;AAAA,EAEJ;AACA,SAAO,oBAAC,2BAAe,uBAA8C;AACvE;AAoBA,SAAS,sBAAsB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAgD;AAE9C,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,gBAAgB;AAAA,MAChB,cAAc;AAAA,MAEd,8BAAC,8BAA2B;AAAA;AAAA,EAC9B;AAEJ;AAEA,IAAO,gCAAQ;","names":[]}
@@ -0,0 +1,145 @@
1
+ import {
2
+ TextArea
3
+ } from "./chunk-5XYPLDI5.js";
4
+ import {
5
+ TextField
6
+ } from "./chunk-6NPTJBFE.js";
7
+ import {
8
+ Select
9
+ } from "./chunk-X2GMDZ7M.js";
10
+ import {
11
+ RadioGroup
12
+ } from "./chunk-6DJOIRMF.js";
13
+ import {
14
+ CheckboxGroup
15
+ } from "./chunk-W7X7KSJP.js";
16
+ import {
17
+ Checkbox
18
+ } from "./chunk-VYCYVN3L.js";
19
+ import {
20
+ Flex
21
+ } from "./chunk-25HMMI7R.js";
22
+ import {
23
+ useDynamicForm
24
+ } from "./chunk-NCSMSA3X.js";
25
+ import {
26
+ Typo
27
+ } from "./chunk-PMJIFLDT.js";
28
+ import {
29
+ __spreadProps,
30
+ __spreadValues
31
+ } from "./chunk-CRTRMMJ7.js";
32
+
33
+ // src/molecules/dynamic-field.tsx
34
+ import { jsx, jsxs } from "react/jsx-runtime";
35
+ function DynamicFormField({
36
+ field
37
+ }) {
38
+ const {
39
+ getFieldValue,
40
+ getFieldError,
41
+ getFieldTouched,
42
+ setFieldValue,
43
+ handleChange,
44
+ handleBlur,
45
+ readonly
46
+ } = useDynamicForm();
47
+ const { name, type } = field;
48
+ const value = getFieldValue(name);
49
+ const error = getFieldError(name);
50
+ const touched = getFieldTouched(name);
51
+ const hasError = Boolean(error && touched);
52
+ const commonProps = {
53
+ name,
54
+ value: String(value || ""),
55
+ onChange: readonly ? void 0 : handleChange,
56
+ onBlur: readonly ? void 0 : handleBlur,
57
+ error: hasError,
58
+ disabled: readonly
59
+ };
60
+ switch (type) {
61
+ case "short_text":
62
+ case "email":
63
+ return /* @__PURE__ */ jsx(
64
+ TextField.Root,
65
+ __spreadProps(__spreadValues({}, commonProps), {
66
+ placeholder: field.placeholder,
67
+ type: type === "short_text" ? "text" : type
68
+ })
69
+ );
70
+ case "number":
71
+ return /* @__PURE__ */ jsx(
72
+ TextField.Root,
73
+ __spreadProps(__spreadValues({}, commonProps), {
74
+ inputMode: "numeric",
75
+ pattern: "[0-9]*",
76
+ placeholder: field.placeholder,
77
+ type: "number"
78
+ })
79
+ );
80
+ case "long_text":
81
+ return /* @__PURE__ */ jsx(TextArea, __spreadProps(__spreadValues({ rows: 4 }, commonProps), { placeholder: field.placeholder }));
82
+ case "dropdown":
83
+ return /* @__PURE__ */ jsxs(
84
+ Select.Root,
85
+ {
86
+ disabled: readonly,
87
+ onValueChange: readonly ? void 0 : (newValue) => {
88
+ void setFieldValue(name, newValue);
89
+ },
90
+ value,
91
+ children: [
92
+ /* @__PURE__ */ jsx(Select.Trigger, { placeholder: field.placeholder }),
93
+ /* @__PURE__ */ jsx(Select.Content, { children: field.options.map((option) => /* @__PURE__ */ jsx(Select.Item, { value: String(option.value), children: option.label }, option.value)) })
94
+ ]
95
+ }
96
+ );
97
+ case "choice":
98
+ return /* @__PURE__ */ jsx(
99
+ RadioGroup.Root,
100
+ {
101
+ disabled: readonly,
102
+ onValueChange: readonly ? void 0 : (newValue) => {
103
+ void setFieldValue(name, newValue);
104
+ },
105
+ orientation: field.orientation,
106
+ value: String(value || ""),
107
+ children: field.options.map((option) => /* @__PURE__ */ jsx(RadioGroup.Item, { value: String(option.value), children: option.label }, option.value))
108
+ }
109
+ );
110
+ case "choices":
111
+ return /* @__PURE__ */ jsx(
112
+ CheckboxGroup.Root,
113
+ {
114
+ disabled: readonly,
115
+ onValueChange: readonly ? void 0 : (newValue) => {
116
+ void setFieldValue(name, newValue);
117
+ },
118
+ orientation: field.orientation,
119
+ value: Array.isArray(value) ? value.map(String) : [],
120
+ children: field.options.map((option) => /* @__PURE__ */ jsx(CheckboxGroup.Item, { value: String(option.value), children: option.label }, option.value))
121
+ }
122
+ );
123
+ case "yes_no":
124
+ return /* @__PURE__ */ jsxs(Flex, { gap: "2", children: [
125
+ /* @__PURE__ */ jsx(
126
+ Checkbox,
127
+ {
128
+ checked: Boolean(value),
129
+ disabled: readonly,
130
+ onCheckedChange: readonly ? void 0 : (checked) => {
131
+ void setFieldValue(name, checked);
132
+ }
133
+ }
134
+ ),
135
+ field.description ? /* @__PURE__ */ jsx(Typo, { color: "gray", variant: "caption", children: field.description }) : null
136
+ ] });
137
+ default:
138
+ return null;
139
+ }
140
+ }
141
+
142
+ export {
143
+ DynamicFormField
144
+ };
145
+ //# sourceMappingURL=chunk-P4ELC3C3.js.map