@tipp/ui 2.3.13 → 2.3.15

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 (176) hide show
  1. package/dist/app/index.cjs +183 -160
  2. package/dist/app/index.cjs.map +1 -1
  3. package/dist/app/index.js +80 -78
  4. package/dist/app/platform/coach-question-list.js +26 -26
  5. package/dist/app/platform/contents-card.js +26 -26
  6. package/dist/app/platform/curriculum-card.js +2 -2
  7. package/dist/app/platform/edit-coaching-time.cjs +40 -17
  8. package/dist/app/platform/edit-coaching-time.cjs.map +1 -1
  9. package/dist/app/platform/edit-coaching-time.js +62 -60
  10. package/dist/app/platform/edit-service-type.cjs +42 -17
  11. package/dist/app/platform/edit-service-type.cjs.map +1 -1
  12. package/dist/app/platform/edit-service-type.js +62 -60
  13. package/dist/app/platform/goal-manage-card-edit.cjs +48 -23
  14. package/dist/app/platform/goal-manage-card-edit.cjs.map +1 -1
  15. package/dist/app/platform/goal-manage-card-edit.js +63 -61
  16. package/dist/app/platform/goal-manage-card-read.js +26 -26
  17. package/dist/app/platform/on-offline-radio-card.cjs +46 -23
  18. package/dist/app/platform/on-offline-radio-card.cjs.map +1 -1
  19. package/dist/app/platform/on-offline-radio-card.js +62 -60
  20. package/dist/app/platform/report-card.js +26 -26
  21. package/dist/app/platform/reservation-card.cjs +59 -34
  22. package/dist/app/platform/reservation-card.cjs.map +1 -1
  23. package/dist/app/platform/reservation-card.js +63 -61
  24. package/dist/app/platform/session-card.cjs +79 -56
  25. package/dist/app/platform/session-card.cjs.map +1 -1
  26. package/dist/app/platform/session-card.js +63 -61
  27. package/dist/app/platform/session-review-simple-read.js +26 -26
  28. package/dist/app/platform/userInfos/coaching-customer-info/index.js +28 -28
  29. package/dist/app/platform/userInfos/coaching-customer-info/large.js +26 -26
  30. package/dist/app/platform/userInfos/coaching-customer-info/medium.js +26 -26
  31. package/dist/app/platform/userInfos/coaching-customer-info/small.js +25 -25
  32. package/dist/app/platform/userInfos/session-user-info-detail.js +25 -25
  33. package/dist/app/platform/userInfos/utils.js +25 -25
  34. package/dist/atoms/index.js +60 -60
  35. package/dist/chunk-2GWB6C4M.js +63 -0
  36. package/dist/chunk-2GWB6C4M.js.map +1 -0
  37. package/dist/chunk-3INEXJIV.js +37 -0
  38. package/dist/chunk-3INEXJIV.js.map +1 -0
  39. package/dist/chunk-3RTIQ36S.js +222 -0
  40. package/dist/chunk-3RTIQ36S.js.map +1 -0
  41. package/dist/chunk-3UOA73MU.js +196 -0
  42. package/dist/chunk-3UOA73MU.js.map +1 -0
  43. package/dist/chunk-4CAKGS6P.js +196 -0
  44. package/dist/chunk-4CAKGS6P.js.map +1 -0
  45. package/dist/chunk-4F2XOUIR.js +51 -0
  46. package/dist/chunk-4F2XOUIR.js.map +1 -0
  47. package/dist/chunk-6DAL2GRI.js +196 -0
  48. package/dist/chunk-6DAL2GRI.js.map +1 -0
  49. package/dist/chunk-6IMCKSQD.js +69 -0
  50. package/dist/chunk-6IMCKSQD.js.map +1 -0
  51. package/dist/chunk-7XUN3OQT.js +1 -0
  52. package/dist/chunk-7XUN3OQT.js.map +1 -0
  53. package/dist/chunk-A2DBM6WR.js +51 -0
  54. package/dist/chunk-A2DBM6WR.js.map +1 -0
  55. package/dist/chunk-AULDM6SL.js +89 -0
  56. package/dist/chunk-AULDM6SL.js.map +1 -0
  57. package/dist/chunk-BN24NIPU.js +64 -0
  58. package/dist/chunk-BN24NIPU.js.map +1 -0
  59. package/dist/chunk-CMFHPI3J.js +51 -0
  60. package/dist/chunk-CMFHPI3J.js.map +1 -0
  61. package/dist/chunk-EEJ2JXHV.js +139 -0
  62. package/dist/chunk-EEJ2JXHV.js.map +1 -0
  63. package/dist/chunk-FFAGYBAB.js +64 -0
  64. package/dist/chunk-FFAGYBAB.js.map +1 -0
  65. package/dist/chunk-G6ZTIOUH.js +54 -0
  66. package/dist/chunk-G6ZTIOUH.js.map +1 -0
  67. package/dist/chunk-GAXILFF4.js +63 -0
  68. package/dist/chunk-GAXILFF4.js.map +1 -0
  69. package/dist/chunk-GWJU4LIN.js +222 -0
  70. package/dist/chunk-GWJU4LIN.js.map +1 -0
  71. package/dist/chunk-GZTKJMEK.js +218 -0
  72. package/dist/chunk-GZTKJMEK.js.map +1 -0
  73. package/dist/chunk-JMYWVT4X.js +98 -0
  74. package/dist/chunk-JMYWVT4X.js.map +1 -0
  75. package/dist/chunk-K7NSOSIE.js +1 -0
  76. package/dist/chunk-K7NSOSIE.js.map +1 -0
  77. package/dist/chunk-MFAW7E6L.js +69 -0
  78. package/dist/chunk-MFAW7E6L.js.map +1 -0
  79. package/dist/chunk-N7WM36NN.js +64 -0
  80. package/dist/chunk-N7WM36NN.js.map +1 -0
  81. package/dist/chunk-NCSMSA3X.js +50 -0
  82. package/dist/chunk-NCSMSA3X.js.map +1 -0
  83. package/dist/chunk-NJMRRUNJ.js +218 -0
  84. package/dist/chunk-NJMRRUNJ.js.map +1 -0
  85. package/dist/chunk-PZXLZLQH.js +64 -0
  86. package/dist/chunk-PZXLZLQH.js.map +1 -0
  87. package/dist/chunk-QOA6EEKP.js +89 -0
  88. package/dist/chunk-QOA6EEKP.js.map +1 -0
  89. package/dist/chunk-SLV7LKTR.js +51 -0
  90. package/dist/chunk-SLV7LKTR.js.map +1 -0
  91. package/dist/chunk-T4XIMI4Y.js +64 -0
  92. package/dist/chunk-T4XIMI4Y.js.map +1 -0
  93. package/dist/chunk-TTVJOFG5.js +30 -0
  94. package/dist/chunk-TTVJOFG5.js.map +1 -0
  95. package/dist/chunk-TXMVRPAL.js +139 -0
  96. package/dist/chunk-TXMVRPAL.js.map +1 -0
  97. package/dist/chunk-USNFN36O.js +89 -0
  98. package/dist/chunk-USNFN36O.js.map +1 -0
  99. package/dist/chunk-WU6EJCDT.js +196 -0
  100. package/dist/chunk-WU6EJCDT.js.map +1 -0
  101. package/dist/chunk-YIDE5VOF.js +196 -0
  102. package/dist/chunk-YIDE5VOF.js.map +1 -0
  103. package/dist/chunk-ZP5VSS77.js +89 -0
  104. package/dist/chunk-ZP5VSS77.js.map +1 -0
  105. package/dist/context/dynamic-form-context.cjs +3 -2
  106. package/dist/context/dynamic-form-context.cjs.map +1 -1
  107. package/dist/context/dynamic-form-context.d.cts +2 -1
  108. package/dist/context/dynamic-form-context.d.ts +2 -1
  109. package/dist/context/dynamic-form-context.js +1 -1
  110. package/dist/context/index.cjs +3 -2
  111. package/dist/context/index.cjs.map +1 -1
  112. package/dist/context/index.js +2 -2
  113. package/dist/index.cjs +308 -244
  114. package/dist/index.cjs.map +1 -1
  115. package/dist/index.d.cts +2 -0
  116. package/dist/index.d.ts +2 -0
  117. package/dist/index.js +152 -142
  118. package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/index.js +9 -9
  119. package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-body.js +6 -6
  120. package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-radio.js +2 -2
  121. package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-satisfaction-option.js +2 -2
  122. package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-satisfaction-text.js +1 -1
  123. package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-text.js +3 -3
  124. package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/index.js +12 -12
  125. package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/start-review.js +2 -2
  126. package/dist/molecules/curriculumV2/CurriculumContents/curriculum-review.js +13 -13
  127. package/dist/molecules/curriculumV2/CurriculumContents/index.js +16 -16
  128. package/dist/molecules/curriculumV2/CurriculumSidebar/index.js +4 -4
  129. package/dist/molecules/curriculumV2/CurriculumSidebar/sidebar-item.js +2 -2
  130. package/dist/molecules/curriculumV2/index.js +28 -28
  131. package/dist/molecules/description-json-render.cjs +722 -0
  132. package/dist/molecules/description-json-render.cjs.map +1 -0
  133. package/dist/molecules/description-json-render.d.cts +27 -0
  134. package/dist/molecules/description-json-render.d.ts +27 -0
  135. package/dist/molecules/description-json-render.js +30 -0
  136. package/dist/molecules/description-json-render.js.map +1 -0
  137. package/dist/molecules/dynamic-field.cjs.map +1 -1
  138. package/dist/molecules/dynamic-field.js +3 -3
  139. package/dist/molecules/dynamic-form.cjs +6 -4
  140. package/dist/molecules/dynamic-form.cjs.map +1 -1
  141. package/dist/molecules/dynamic-form.d.cts +2 -1
  142. package/dist/molecules/dynamic-form.d.ts +2 -1
  143. package/dist/molecules/dynamic-form.js +4 -4
  144. package/dist/molecules/expand-table/index.cjs +1 -1
  145. package/dist/molecules/expand-table/index.cjs.map +1 -1
  146. package/dist/molecules/expand-table/index.js +2 -2
  147. package/dist/molecules/index.cjs +65 -5
  148. package/dist/molecules/index.cjs.map +1 -1
  149. package/dist/molecules/index.d.cts +1 -0
  150. package/dist/molecules/index.d.ts +1 -0
  151. package/dist/molecules/index.js +71 -66
  152. package/dist/molecules/learning-post.js +2 -2
  153. package/dist/molecules/stepper.js +2 -2
  154. package/dist/molecules/tag-selector.js +3 -3
  155. package/dist/molecules/time-select.cjs +519 -5
  156. package/dist/molecules/time-select.cjs.map +1 -1
  157. package/dist/molecules/time-select.js +18 -2
  158. package/dist/utils/getCalloutIconComponent.cjs +580 -0
  159. package/dist/utils/getCalloutIconComponent.cjs.map +1 -0
  160. package/dist/utils/getCalloutIconComponent.d.cts +11 -0
  161. package/dist/utils/getCalloutIconComponent.d.ts +11 -0
  162. package/dist/utils/getCalloutIconComponent.js +25 -0
  163. package/dist/utils/getCalloutIconComponent.js.map +1 -0
  164. package/dist/utils/index.cjs +535 -0
  165. package/dist/utils/index.cjs.map +1 -1
  166. package/dist/utils/index.d.cts +2 -0
  167. package/dist/utils/index.d.ts +2 -0
  168. package/dist/utils/index.js +24 -3
  169. package/package.json +1 -1
  170. package/src/context/dynamic-form-context.tsx +3 -1
  171. package/src/molecules/description-json-render.tsx +85 -0
  172. package/src/molecules/dynamic-form.tsx +3 -1
  173. package/src/molecules/expand-table/index.tsx +1 -1
  174. package/src/molecules/index.ts +2 -1
  175. package/src/utils/getCalloutIconComponent.ts +39 -0
  176. package/src/utils/index.ts +1 -0
@@ -0,0 +1,51 @@
1
+ import {
2
+ getCalloutIconComponent
3
+ } from "./chunk-3INEXJIV.js";
4
+ import {
5
+ List
6
+ } from "./chunk-JIJLOKVN.js";
7
+ import {
8
+ Box
9
+ } from "./chunk-4Y5BEXVN.js";
10
+ import {
11
+ Typo
12
+ } from "./chunk-PMJIFLDT.js";
13
+ import {
14
+ Callout
15
+ } from "./chunk-B6XJN6EC.js";
16
+
17
+ // src/molecules/description-json-render.tsx
18
+ import { jsx, jsxs } from "react/jsx-runtime";
19
+ function DescriptionJsonRender(props) {
20
+ const { value } = props;
21
+ return /* @__PURE__ */ jsx(Box, { children: value.values.map((block, index) => {
22
+ if (block.type === "bullet-list") {
23
+ return (
24
+ // eslint-disable-next-line react/no-array-index-key -- 블록 타입과 인덱스를 키로 사용
25
+ /* @__PURE__ */ jsx(Box, { mb: "2", pl: "4", children: /* @__PURE__ */ jsx(List.Root, { preSpace: "small", children: block.value.map((v, i) => (
26
+ // eslint-disable-next-line react/no-array-index-key -- 블록 타입과 인덱스를 키로 사용
27
+ /* @__PURE__ */ jsx(List.Item, { children: v }, `${index}-${i}`)
28
+ )) }) }, `${block.type}-${index}`)
29
+ );
30
+ }
31
+ if (block.type === "callout") {
32
+ const Icon = getCalloutIconComponent(block.icon);
33
+ return (
34
+ // eslint-disable-next-line react/no-array-index-key -- 블록 타입과 인덱스를 키로 사용
35
+ /* @__PURE__ */ jsx(Box, { mb: "2", children: /* @__PURE__ */ jsxs(Callout.Root, { children: [
36
+ /* @__PURE__ */ jsx(Callout.Icon, { children: /* @__PURE__ */ jsx(Icon, {}) }),
37
+ /* @__PURE__ */ jsx(Callout.Text, { children: block.value })
38
+ ] }) }, `${block.type}-${index}`)
39
+ );
40
+ }
41
+ return (
42
+ // eslint-disable-next-line react/no-array-index-key -- 블록 타입과 인덱스를 키로 사용
43
+ /* @__PURE__ */ jsx(Typo, { mb: "2", weight: "regular", children: block.value }, `${block.type}-${index}`)
44
+ );
45
+ }) });
46
+ }
47
+
48
+ export {
49
+ DescriptionJsonRender
50
+ };
51
+ //# sourceMappingURL=chunk-CMFHPI3J.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/molecules/description-json-render.tsx"],"sourcesContent":["import React from 'react';\nimport { Box } from '@/atoms/box';\nimport { Callout } from '@/atoms/call-out';\nimport { List } from '@/atoms/list';\nimport { Typo } from '@/atoms/typo';\nimport { getCalloutIconComponent } from '@/utils/getCalloutIconComponent';\n\nexport type DescriptionBlockType = 'callout' | 'typo' | 'bullet-list';\n\nexport interface DescriptionCalloutBlock {\n type: 'callout';\n icon: string;\n value: string;\n}\n\nexport interface DescriptionTypoBlock {\n type: 'typo';\n value: string;\n}\n\nexport interface DescriptionBulletListBlock {\n type: 'bullet-list';\n value: string[];\n}\n\nexport type DescriptionBlock =\n | DescriptionCalloutBlock\n | DescriptionTypoBlock\n | DescriptionBulletListBlock;\n\nexport interface Description {\n version: number;\n values: DescriptionBlock[];\n}\n\nexport interface DescriptionJsonRenderProps {\n value: Description;\n}\n\nexport function DescriptionJsonRender(\n props: DescriptionJsonRenderProps\n): React.ReactElement {\n const { value } = props;\n return (\n <Box>\n {value.values.map((block, index) => {\n if (block.type === 'bullet-list') {\n return (\n // eslint-disable-next-line react/no-array-index-key -- 블록 타입과 인덱스를 키로 사용\n <Box key={`${block.type}-${index}`} mb=\"2\" pl=\"4\">\n <List.Root preSpace='small'>\n {block.value.map((v, i) => (\n // eslint-disable-next-line react/no-array-index-key -- 블록 타입과 인덱스를 키로 사용\n <List.Item key={`${index}-${i}`}>{v}</List.Item>\n ))}\n </List.Root>\n </Box>\n );\n }\n\n if (block.type === 'callout') {\n const Icon = getCalloutIconComponent(block.icon);\n return (\n // eslint-disable-next-line react/no-array-index-key -- 블록 타입과 인덱스를 키로 사용\n <Box key={`${block.type}-${index}`} mb=\"2\">\n <Callout.Root>\n <Callout.Icon>\n <Icon />\n </Callout.Icon>\n <Callout.Text>{block.value}</Callout.Text>\n </Callout.Root>\n </Box>\n );\n }\n\n return (\n // eslint-disable-next-line react/no-array-index-key -- 블록 타입과 인덱스를 키로 사용\n <Typo key={`${block.type}-${index}`} mb=\"2\" weight=\"regular\">\n {block.value}\n </Typo>\n );\n })}\n </Box>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAqDkB,cAYJ,YAZI;AAdX,SAAS,sBACd,OACoB;AACpB,QAAM,EAAE,MAAM,IAAI;AAClB,SACE,oBAAC,OACE,gBAAM,OAAO,IAAI,CAAC,OAAO,UAAU;AAClC,QAAI,MAAM,SAAS,eAAe;AAChC;AAAA;AAAA,QAEE,oBAAC,OAAmC,IAAG,KAAI,IAAG,KAC5C,8BAAC,KAAK,MAAL,EAAU,UAAS,SACjB,gBAAM,MAAM,IAAI,CAAC,GAAG;AAAA;AAAA,UAEnB,oBAAC,KAAK,MAAL,EAAiC,eAAlB,GAAG,KAAK,IAAI,CAAC,EAAO;AAAA,SACrC,GACH,KANQ,GAAG,MAAM,IAAI,IAAI,KAAK,EAOhC;AAAA;AAAA,IAEJ;AAEA,QAAI,MAAM,SAAS,WAAW;AAC5B,YAAM,OAAO,wBAAwB,MAAM,IAAI;AAC/C;AAAA;AAAA,QAEE,oBAAC,OAAmC,IAAG,KACrC,+BAAC,QAAQ,MAAR,EACC;AAAA,8BAAC,QAAQ,MAAR,EACC,8BAAC,QAAK,GACR;AAAA,UACA,oBAAC,QAAQ,MAAR,EAAc,gBAAM,OAAM;AAAA,WAC7B,KANQ,GAAG,MAAM,IAAI,IAAI,KAAK,EAOhC;AAAA;AAAA,IAEJ;AAEA;AAAA;AAAA,MAEE,oBAAC,QAAoC,IAAG,KAAI,QAAO,WAChD,gBAAM,SADE,GAAG,MAAM,IAAI,IAAI,KAAK,EAEjC;AAAA;AAAA,EAEJ,CAAC,GACH;AAEJ;","names":[]}
@@ -0,0 +1,139 @@
1
+ import {
2
+ TextArea
3
+ } from "./chunk-5XYPLDI5.js";
4
+ import {
5
+ TextField
6
+ } from "./chunk-6NPTJBFE.js";
7
+ import {
8
+ RadioGroup
9
+ } from "./chunk-6DJOIRMF.js";
10
+ import {
11
+ Select
12
+ } from "./chunk-X2GMDZ7M.js";
13
+ import {
14
+ CheckboxGroup
15
+ } from "./chunk-W7X7KSJP.js";
16
+ import {
17
+ Checkbox
18
+ } from "./chunk-VYCYVN3L.js";
19
+ import {
20
+ useDynamicForm
21
+ } from "./chunk-NCSMSA3X.js";
22
+ import {
23
+ __spreadProps,
24
+ __spreadValues
25
+ } from "./chunk-CRTRMMJ7.js";
26
+
27
+ // src/molecules/dynamic-field.tsx
28
+ import { jsx, jsxs } from "react/jsx-runtime";
29
+ function DynamicFormField({
30
+ field
31
+ }) {
32
+ const {
33
+ getFieldValue,
34
+ getFieldError,
35
+ getFieldTouched,
36
+ setFieldValue,
37
+ handleChange,
38
+ handleBlur,
39
+ readonly
40
+ } = useDynamicForm();
41
+ const { name, type } = field;
42
+ const value = getFieldValue(name);
43
+ const error = getFieldError(name);
44
+ const touched = getFieldTouched(name);
45
+ const hasError = Boolean(error && touched);
46
+ const commonProps = {
47
+ name,
48
+ value: String(value || ""),
49
+ onChange: readonly ? void 0 : handleChange,
50
+ onBlur: readonly ? void 0 : handleBlur,
51
+ error: hasError,
52
+ disabled: readonly
53
+ };
54
+ switch (type) {
55
+ case "short_text":
56
+ case "email":
57
+ return /* @__PURE__ */ jsx(
58
+ TextField.Root,
59
+ __spreadProps(__spreadValues({}, commonProps), {
60
+ placeholder: field.placeholder,
61
+ type: type === "short_text" ? "text" : type
62
+ })
63
+ );
64
+ case "number":
65
+ return /* @__PURE__ */ jsx(
66
+ TextField.Root,
67
+ __spreadProps(__spreadValues({}, commonProps), {
68
+ inputMode: "numeric",
69
+ pattern: "[0-9]*",
70
+ placeholder: field.placeholder,
71
+ type: "number"
72
+ })
73
+ );
74
+ case "long_text":
75
+ return /* @__PURE__ */ jsx(TextArea, __spreadProps(__spreadValues({}, commonProps), { placeholder: field.placeholder, rows: 4 }));
76
+ case "dropdown":
77
+ return /* @__PURE__ */ jsxs(
78
+ Select.Root,
79
+ {
80
+ onValueChange: readonly ? void 0 : (newValue) => {
81
+ void setFieldValue(name, newValue);
82
+ },
83
+ value,
84
+ disabled: readonly,
85
+ children: [
86
+ /* @__PURE__ */ jsx(Select.Trigger, { placeholder: field.placeholder }),
87
+ /* @__PURE__ */ jsx(Select.Content, { children: field.options.map((option) => /* @__PURE__ */ jsx(Select.Item, { value: String(option.value), children: option.label }, option.value)) })
88
+ ]
89
+ }
90
+ );
91
+ case "choice":
92
+ return /* @__PURE__ */ jsx(
93
+ RadioGroup.Root,
94
+ {
95
+ onValueChange: readonly ? void 0 : (newValue) => {
96
+ void setFieldValue(name, newValue);
97
+ },
98
+ orientation: field.orientation,
99
+ value: String(value || ""),
100
+ disabled: readonly,
101
+ children: field.options.map((option) => /* @__PURE__ */ jsx(RadioGroup.Item, { value: String(option.value), children: option.label }, option.value))
102
+ }
103
+ );
104
+ case "choices":
105
+ return /* @__PURE__ */ jsx(
106
+ CheckboxGroup.Root,
107
+ {
108
+ onValueChange: readonly ? void 0 : (newValue) => {
109
+ void setFieldValue(name, newValue);
110
+ },
111
+ orientation: field.orientation,
112
+ value: Array.isArray(value) ? value.map(String) : [],
113
+ disabled: readonly,
114
+ children: field.options.map((option) => /* @__PURE__ */ jsx(CheckboxGroup.Item, { value: String(option.value), children: option.label }, option.value))
115
+ }
116
+ );
117
+ case "yes_no":
118
+ return /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "flex-start", gap: "8px" }, children: [
119
+ /* @__PURE__ */ jsx(
120
+ Checkbox,
121
+ {
122
+ checked: Boolean(value),
123
+ onCheckedChange: readonly ? void 0 : (checked) => {
124
+ void setFieldValue(name, checked);
125
+ },
126
+ disabled: readonly
127
+ }
128
+ ),
129
+ field.description ? /* @__PURE__ */ jsx("div", { style: { fontSize: "14px", color: "#666", lineHeight: "1.4" }, children: field.description }) : null
130
+ ] });
131
+ default:
132
+ return null;
133
+ }
134
+ }
135
+
136
+ export {
137
+ DynamicFormField
138
+ };
139
+ //# sourceMappingURL=chunk-EEJ2JXHV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/molecules/dynamic-field.tsx"],"sourcesContent":["\nimport { useDynamicForm } from '../context/dynamic-form-context';\nimport { TextField } from '../atoms/text-field';\nimport { TextArea } from '../atoms/text-area';\nimport { Select } from '../atoms/select';\nimport { CheckboxGroup } from '../atoms/check-box-group';\nimport { RadioGroup } from '../atoms/radio-group';\nimport { Checkbox } from '../atoms/check-box';\nimport type { DynamicFormFieldSchema } from '../types/dynamic-form-schema-generated';\n\ninterface DynamicFormFieldRendererProps {\n field: DynamicFormFieldSchema;\n}\n\nexport function DynamicFormField({\n field,\n}: DynamicFormFieldRendererProps): React.ReactElement | null {\n const {\n getFieldValue,\n getFieldError,\n getFieldTouched,\n setFieldValue,\n handleChange,\n handleBlur,\n readonly,\n } = useDynamicForm();\n const { name, type } = field;\n\n const value = getFieldValue(name);\n const error = getFieldError(name);\n const touched = getFieldTouched(name);\n const hasError = Boolean(error && touched);\n\n const commonProps = {\n name,\n value: String(value || ''),\n onChange: readonly ? undefined : handleChange,\n onBlur: readonly ? undefined : handleBlur,\n error: hasError,\n disabled: readonly,\n };\n\n switch (type) {\n case 'short_text':\n case 'email':\n return (\n <TextField.Root \n {...commonProps} \n placeholder={field.placeholder}\n type={type === 'short_text' ? 'text' : type}\n />\n );\n case 'number':\n return (\n <TextField.Root\n {...commonProps}\n inputMode=\"numeric\"\n pattern=\"[0-9]*\"\n placeholder={field.placeholder}\n type=\"number\"\n />\n );\n case 'long_text':\n return <TextArea {...commonProps} placeholder={field.placeholder} rows={4} />;\n\n case 'dropdown':\n return (\n <Select.Root\n onValueChange={readonly ? undefined : (newValue: string) => {\n void setFieldValue(name, newValue);\n }}\n value={value as string}\n disabled={readonly}\n >\n <Select.Trigger placeholder={field.placeholder} />\n <Select.Content>\n {field.options.map((option) => (\n <Select.Item key={option.value} value={String(option.value)}>\n {option.label}\n </Select.Item>\n ))}\n </Select.Content>\n </Select.Root>\n );\n\n case 'choice':\n return (\n <RadioGroup.Root\n onValueChange={readonly ? undefined : (newValue: string) => {\n void setFieldValue(name, newValue);\n }}\n orientation={field.orientation}\n value={String(value || '')}\n disabled={readonly}\n >\n {field.options.map((option) => (\n <RadioGroup.Item key={option.value} value={String(option.value)}>\n {option.label}\n </RadioGroup.Item>\n ))}\n </RadioGroup.Root>\n );\n\n case 'choices':\n return (\n <CheckboxGroup.Root\n onValueChange={readonly ? undefined : (newValue: string[]) => {\n void setFieldValue(name, newValue);\n }}\n orientation={field.orientation}\n value={Array.isArray(value) ? value.map(String) : []}\n disabled={readonly}\n >\n {field.options.map((option) => (\n <CheckboxGroup.Item key={option.value} value={String(option.value)}>\n {option.label}\n </CheckboxGroup.Item>\n ))}\n </CheckboxGroup.Root>\n );\n\n case 'yes_no':\n return (\n <div style={{ display: 'flex', alignItems: 'flex-start', gap: '8px' }}>\n <Checkbox\n checked={Boolean(value)}\n onCheckedChange={readonly ? undefined : (checked: boolean) => {\n void setFieldValue(name, checked);\n }}\n disabled={readonly}\n />\n {field.description ? (\n <div style={{ fontSize: '14px', color: '#666', lineHeight: '1.4' }}>\n {field.description}\n </div>\n ) : null}\n </div>\n );\n\n default:\n return null;\n }\n}\n"],"mappings":"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","names":[]}
@@ -0,0 +1,64 @@
1
+ import {
2
+ curriculum_ai_traning_default
3
+ } from "./chunk-3PE6OFB3.js";
4
+ import {
5
+ curriculum_review_default
6
+ } from "./chunk-WU6EJCDT.js";
7
+ import {
8
+ curriculum_video_default
9
+ } from "./chunk-QGKQ3IX7.js";
10
+ import {
11
+ useCurriculumContext
12
+ } from "./chunk-ZFWZAZPG.js";
13
+ import {
14
+ Typo
15
+ } from "./chunk-PMJIFLDT.js";
16
+ import {
17
+ Flex
18
+ } from "./chunk-25HMMI7R.js";
19
+ import {
20
+ InfoCircledIcon
21
+ } from "./chunk-W5TPOFOO.js";
22
+
23
+ // src/molecules/curriculumV2/CurriculumContents/index.tsx
24
+ import { jsx, jsxs } from "react/jsx-runtime";
25
+ function CurriculumBody() {
26
+ const { selectedItem, selectedSectionTitle } = useCurriculumContext();
27
+ switch (selectedItem.type) {
28
+ case "video":
29
+ return /* @__PURE__ */ jsx(curriculum_video_default, { item: selectedItem });
30
+ case "review":
31
+ return /* @__PURE__ */ jsx(
32
+ curriculum_review_default,
33
+ {
34
+ item: selectedItem,
35
+ sectionTitle: selectedSectionTitle == null ? void 0 : selectedSectionTitle.title
36
+ }
37
+ );
38
+ case "aiTraining":
39
+ return /* @__PURE__ */ jsx(curriculum_ai_traning_default, { item: selectedItem });
40
+ default:
41
+ return /* @__PURE__ */ jsxs(
42
+ Flex,
43
+ {
44
+ align: "center",
45
+ direction: "column",
46
+ gap: "2",
47
+ height: "100%",
48
+ justify: "center",
49
+ width: "100%",
50
+ children: [
51
+ /* @__PURE__ */ jsx(InfoCircledIcon, { height: 24, width: 24 }),
52
+ /* @__PURE__ */ jsx(Typo, { children: "\uCEE8\uD150\uCE20\uB97C \uB85C\uB529 \uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4" }),
53
+ /* @__PURE__ */ jsx(Typo, { align: "center", color: "gray", variant: "caption", children: `[debug info]
54
+ ${JSON.stringify(selectedItem)}` })
55
+ ]
56
+ }
57
+ );
58
+ }
59
+ }
60
+
61
+ export {
62
+ CurriculumBody
63
+ };
64
+ //# sourceMappingURL=chunk-FFAGYBAB.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';\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 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":";;;;;;;;;;;;;;;;;;;;;;;AAca,cAYL,YAZK;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,IAEF,KAAK;AACH,aAAO,oBAAC,iCAAoB,MAAM,cAAa;AAAA,IACnD;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,54 @@
1
+ import {
2
+ getCalloutIconComponent
3
+ } from "./chunk-3INEXJIV.js";
4
+ import {
5
+ List
6
+ } from "./chunk-JIJLOKVN.js";
7
+ import {
8
+ Box
9
+ } from "./chunk-4Y5BEXVN.js";
10
+ import {
11
+ Typo
12
+ } from "./chunk-PMJIFLDT.js";
13
+ import {
14
+ Callout
15
+ } from "./chunk-B6XJN6EC.js";
16
+
17
+ // src/molecules/description-json-render.tsx
18
+ import { jsx, jsxs } from "react/jsx-runtime";
19
+ function DescriptionJsonRender(props) {
20
+ const { value } = props;
21
+ return;
22
+ value.values.map(
23
+ (block, index) => {
24
+ if (block.type === "bullet-list") {
25
+ return (
26
+ // eslint-disable-next-line react/no-array-index-key -- 블록 타입과 인덱스를 키로 사용
27
+ /* @__PURE__ */ jsx(Box, { mb: "2", pl: "4", children: /* @__PURE__ */ jsx(List.Root, { preSpace: "small", children: block.value.map((v, i) => (
28
+ // eslint-disable-next-line react/no-array-index-key -- 블록 타입과 인덱스를 키로 사용
29
+ /* @__PURE__ */ jsx(List.Item, { children: v }, `${index}-${i}`)
30
+ )) }) }, `${block.type}-${index}`)
31
+ );
32
+ }
33
+ if (block.type === "callout") {
34
+ const Icon = getCalloutIconComponent(block.icon);
35
+ return (
36
+ // eslint-disable-next-line react/no-array-index-key -- 블록 타입과 인덱스를 키로 사용
37
+ /* @__PURE__ */ jsx(Box, { mb: "2", children: /* @__PURE__ */ jsxs(Callout.Root, { children: [
38
+ /* @__PURE__ */ jsx(Callout.Icon, { children: /* @__PURE__ */ jsx(Icon, {}) }),
39
+ /* @__PURE__ */ jsx(Callout.Text, { children: block.value })
40
+ ] }) }, `${block.type}-${index}`)
41
+ );
42
+ }
43
+ return (
44
+ // eslint-disable-next-line react/no-array-index-key -- 블록 타입과 인덱스를 키로 사용
45
+ /* @__PURE__ */ jsx(Typo, { mb: "2", weight: "regular", children: block.value }, `${block.type}-${index}`)
46
+ );
47
+ }
48
+ );
49
+ }
50
+
51
+ export {
52
+ DescriptionJsonRender
53
+ };
54
+ //# sourceMappingURL=chunk-G6ZTIOUH.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/molecules/description-json-render.tsx"],"sourcesContent":["import React from 'react';\nimport { Box } from '@/atoms/box';\nimport { Callout } from '@/atoms/call-out';\nimport { List } from '@/atoms/list';\nimport { Typo } from '@/atoms/typo';\nimport { getCalloutIconComponent } from '@/utils/getCalloutIconComponent';\n\nexport type DescriptionBlockType = 'callout' | 'typo' | 'bullet-list';\n\nexport interface DescriptionCalloutBlock {\n type: 'callout';\n icon: string;\n value: string;\n}\n\nexport interface DescriptionTypoBlock {\n type: 'typo';\n value: string;\n}\n\nexport interface DescriptionBulletListBlock {\n type: 'bullet-list';\n value: string[];\n}\n\nexport type DescriptionBlock =\n | DescriptionCalloutBlock\n | DescriptionTypoBlock\n | DescriptionBulletListBlock;\n\nexport interface Description {\n version: number;\n values: DescriptionBlock[];\n}\n\nexport interface DescriptionJsonRenderProps {\n value: Description;\n}\n\nexport function DescriptionJsonRender(\n props: DescriptionJsonRenderProps\n): React.ReactElement {\n const { value } = props;\n return \n value.values.map((block, index) => {\n if (block.type === 'bullet-list') {\n return (\n // eslint-disable-next-line react/no-array-index-key -- 블록 타입과 인덱스를 키로 사용\n <Box key={`${block.type}-${index}`} mb=\"2\" pl=\"4\">\n <List.Root preSpace='small'>\n {block.value.map((v, i) => (\n // eslint-disable-next-line react/no-array-index-key -- 블록 타입과 인덱스를 키로 사용\n <List.Item key={`${index}-${i}`}>{v}</List.Item>\n ))}\n </List.Root>\n </Box>\n );\n }\n\n if (block.type === 'callout') {\n const Icon = getCalloutIconComponent(block.icon);\n return (\n // eslint-disable-next-line react/no-array-index-key -- 블록 타입과 인덱스를 키로 사용\n <Box key={`${block.type}-${index}`} mb=\"2\">\n <Callout.Root>\n <Callout.Icon>\n <Icon />\n </Callout.Icon>\n <Callout.Text>{block.value}</Callout.Text>\n </Callout.Root>\n </Box>\n );\n }\n\n return (\n // eslint-disable-next-line react/no-array-index-key -- 블록 타입과 인덱스를 키로 사용\n <Typo key={`${block.type}-${index}`} mb=\"2\" weight=\"regular\">\n {block.value}\n </Typo>\n );\n } \n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAoDkB,cAYJ,YAZI;AAbX,SAAS,sBACd,OACoB;AACpB,QAAM,EAAE,MAAM,IAAI;AAClB;AACI,QAAM,OAAO;AAAA,IAAI,CAAC,OAAO,UAAU;AACjC,UAAI,MAAM,SAAS,eAAe;AAChC;AAAA;AAAA,UAEE,oBAAC,OAAmC,IAAG,KAAI,IAAG,KAC5C,8BAAC,KAAK,MAAL,EAAU,UAAS,SACjB,gBAAM,MAAM,IAAI,CAAC,GAAG;AAAA;AAAA,YAEnB,oBAAC,KAAK,MAAL,EAAiC,eAAlB,GAAG,KAAK,IAAI,CAAC,EAAO;AAAA,WACrC,GACH,KANQ,GAAG,MAAM,IAAI,IAAI,KAAK,EAOhC;AAAA;AAAA,MAEJ;AAEA,UAAI,MAAM,SAAS,WAAW;AAC5B,cAAM,OAAO,wBAAwB,MAAM,IAAI;AAC/C;AAAA;AAAA,UAEE,oBAAC,OAAmC,IAAG,KACrC,+BAAC,QAAQ,MAAR,EACC;AAAA,gCAAC,QAAQ,MAAR,EACC,8BAAC,QAAK,GACR;AAAA,YACA,oBAAC,QAAQ,MAAR,EAAc,gBAAM,OAAM;AAAA,aAC7B,KANQ,GAAG,MAAM,IAAI,IAAI,KAAK,EAOhC;AAAA;AAAA,MAEJ;AAEA;AAAA;AAAA,QAEE,oBAAC,QAAoC,IAAG,KAAI,QAAO,WAChD,gBAAM,SADE,GAAG,MAAM,IAAI,IAAI,KAAK,EAEjC;AAAA;AAAA,IAEF;AAAA,EACN;AACF;","names":[]}
@@ -0,0 +1,63 @@
1
+ import {
2
+ review_question_footer_default
3
+ } from "./chunk-PLXD7ZKF.js";
4
+ import {
5
+ review_question_header_default
6
+ } from "./chunk-SAEPW5JF.js";
7
+ import {
8
+ review_question_layout_default
9
+ } from "./chunk-VK6INFSB.js";
10
+ import {
11
+ review_question_body_default
12
+ } from "./chunk-6IMCKSQD.js";
13
+
14
+ // src/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/index.tsx
15
+ import { jsx } from "react/jsx-runtime";
16
+ function ReviewQuestion({
17
+ question,
18
+ index,
19
+ total,
20
+ answer,
21
+ error,
22
+ onChange,
23
+ onNext,
24
+ onPrev,
25
+ isLast,
26
+ isNextDisabled,
27
+ onSubmit,
28
+ isLoading
29
+ }) {
30
+ return /* @__PURE__ */ jsx(
31
+ review_question_layout_default,
32
+ {
33
+ Body: /* @__PURE__ */ jsx(
34
+ review_question_body_default,
35
+ {
36
+ answer,
37
+ error,
38
+ onChange,
39
+ question
40
+ }
41
+ ),
42
+ Footer: /* @__PURE__ */ jsx(
43
+ review_question_footer_default,
44
+ {
45
+ index,
46
+ isLast,
47
+ isLoading,
48
+ isNextButtonDisabled: isNextDisabled,
49
+ onNext,
50
+ onPrev,
51
+ onSubmit
52
+ }
53
+ ),
54
+ Header: /* @__PURE__ */ jsx(review_question_header_default, { index, total })
55
+ }
56
+ );
57
+ }
58
+ var ReviewQuestion_default = ReviewQuestion;
59
+
60
+ export {
61
+ ReviewQuestion_default
62
+ };
63
+ //# sourceMappingURL=chunk-GAXILFF4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/index.tsx"],"sourcesContent":["import React from 'react';\nimport type { ReviewQuestionElement } from '@/types/curriculum.type';\nimport ReviewQuestionLayout from './review-question-layout';\nimport ReviewQuestionHeader from './review-question-header';\nimport ReviewQuestionFooter from './review-question-footer';\nimport ReviewQuestionBody from './review-question-body';\n\ninterface ReviewQuestionProps {\n question: ReviewQuestionElement;\n index: number;\n total: number;\n answer: string;\n error?: string;\n onChange: (value: string) => void;\n onNext: () => void;\n onPrev: () => void;\n isLast: boolean;\n isNextDisabled?: boolean;\n onSubmit: () => void;\n isLoading?: boolean;\n}\n\nfunction ReviewQuestion({\n question,\n index,\n total,\n answer,\n error,\n onChange,\n onNext,\n onPrev,\n isLast,\n isNextDisabled,\n onSubmit,\n isLoading,\n}: ReviewQuestionProps): React.ReactElement {\n \n return (\n <ReviewQuestionLayout\n Body={\n <ReviewQuestionBody\n answer={answer}\n error={error}\n onChange={onChange}\n question={question}\n />\n }\n Footer={\n <ReviewQuestionFooter\n index={index}\n isLast={isLast}\n isLoading={isLoading}\n isNextButtonDisabled={isNextDisabled}\n onNext={onNext}\n onPrev={onPrev}\n onSubmit={onSubmit}\n />\n }\n Header={<ReviewQuestionHeader index={index} total={total} />}\n />\n );\n}\n\nexport default ReviewQuestion;\n"],"mappings":";;;;;;;;;;;;;;AAwCQ;AAlBR,SAAS,eAAe;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA4C;AAE1C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MACE;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA;AAAA,MACF;AAAA,MAEF,QACE;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,UACA,sBAAsB;AAAA,UACtB;AAAA,UACA;AAAA,UACA;AAAA;AAAA,MACF;AAAA,MAEF,QAAQ,oBAAC,kCAAqB,OAAc,OAAc;AAAA;AAAA,EAC5D;AAEJ;AAEA,IAAO,yBAAQ;","names":[]}
@@ -0,0 +1,222 @@
1
+ import {
2
+ Row
3
+ } from "./chunk-JCG2AUFJ.js";
4
+ import {
5
+ Spinner
6
+ } from "./chunk-FR2GDOU2.js";
7
+ import {
8
+ Pagination
9
+ } from "./chunk-FG3WT6OL.js";
10
+ import {
11
+ Typo
12
+ } from "./chunk-PMJIFLDT.js";
13
+ import {
14
+ Flex
15
+ } from "./chunk-25HMMI7R.js";
16
+ import {
17
+ TriangleArrowUpIcon
18
+ } from "./chunk-2O45FRFQ.js";
19
+ import {
20
+ TriangleArrowDownIcon
21
+ } from "./chunk-776WBOKL.js";
22
+
23
+ // src/molecules/expand-table/index.tsx
24
+ import {
25
+ flexRender,
26
+ getCoreRowModel,
27
+ useReactTable,
28
+ getSortedRowModel,
29
+ createColumnHelper,
30
+ getPaginationRowModel
31
+ } from "@tanstack/react-table";
32
+ import { useCallback, useMemo, useState } from "react";
33
+ import { ScrollArea } from "@radix-ui/themes";
34
+ import { jsx, jsxs } from "react/jsx-runtime";
35
+ var sortButtonColorMapper = {
36
+ card: {
37
+ selected: "var(--iris-10)",
38
+ unselected: "var(--iris-6)"
39
+ },
40
+ sprite: {
41
+ // selected: 'var(--gray-a12)',
42
+ // unselected: 'var(--gray-a6)',
43
+ selected: "var(--iris-10)",
44
+ unselected: "var(--iris-6)"
45
+ },
46
+ "sprite-border": {
47
+ selected: "var(--iris-10)",
48
+ unselected: "var(--iris-6)"
49
+ }
50
+ };
51
+ function ExpandTable(props) {
52
+ const {
53
+ data,
54
+ columns,
55
+ ExpandComp,
56
+ placeholder,
57
+ onRowClick,
58
+ tableStyle,
59
+ showPagination = true,
60
+ isLoading,
61
+ pageIndex = 0,
62
+ pageSize = 10,
63
+ siblingCount = 2,
64
+ getRowStyle,
65
+ getCellStyle,
66
+ variant = "card"
67
+ } = props;
68
+ const defaultAlign = "left";
69
+ const [pagination, setPagination] = useState({
70
+ pageIndex: pageIndex || 0,
71
+ pageSize: pageSize || 9999
72
+ });
73
+ const [sorting, setSorting] = useState([]);
74
+ const { getRowModel, getHeaderGroups, setPageIndex } = useReactTable({
75
+ data: data || [],
76
+ columns,
77
+ getCoreRowModel: getCoreRowModel(),
78
+ getSortedRowModel: getSortedRowModel(),
79
+ state: {
80
+ sorting,
81
+ pagination
82
+ },
83
+ onSortingChange: setSorting,
84
+ getPaginationRowModel: getPaginationRowModel(),
85
+ onPaginationChange: setPagination
86
+ });
87
+ const gridTemplateColumns = useMemo(() => {
88
+ return columns.map((col) => {
89
+ var _a;
90
+ if ((_a = col.meta) == null ? void 0 : _a.autoSize) return `minmax(${col.size || 50}px, 1fr)`;
91
+ return `${col.size || 150}px`;
92
+ }).join(" ");
93
+ }, [columns]);
94
+ const rowModels = getRowModel();
95
+ const onChangePagination = useCallback(
96
+ (page) => {
97
+ setPageIndex(page - 1);
98
+ },
99
+ [setPageIndex]
100
+ );
101
+ const helpCompRender = useCallback(
102
+ (rowLength) => {
103
+ if (isLoading) {
104
+ return /* @__PURE__ */ jsx(
105
+ Flex,
106
+ {
107
+ align: "center",
108
+ height: "100%",
109
+ justify: "center",
110
+ p: "5",
111
+ width: "100%",
112
+ children: /* @__PURE__ */ jsx(Spinner, {})
113
+ }
114
+ );
115
+ }
116
+ if (rowLength === 0) {
117
+ return /* @__PURE__ */ jsx("div", { className: "tr", children: /* @__PURE__ */ jsx(Flex, { align: "center", justify: "center", children: placeholder || /* @__PURE__ */ jsx(Typo, { color: "gray", mb: "6", mt: "6", variant: "body", children: "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4" }) }) }, "expand_placeholder");
118
+ }
119
+ return null;
120
+ },
121
+ [isLoading, placeholder]
122
+ );
123
+ const pageCount = useMemo(() => {
124
+ if (!data) return 0;
125
+ return Math.ceil(data.length / pageSize);
126
+ }, [data, pageSize]);
127
+ return /* @__PURE__ */ jsxs("div", { className: `expand-table-wrapper ${variant}`, children: [
128
+ /* @__PURE__ */ jsxs("div", { className: "expand-table", style: tableStyle, children: [
129
+ /* @__PURE__ */ jsx("div", { className: "thead", children: getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx(
130
+ "div",
131
+ {
132
+ className: "tr",
133
+ style: { gridTemplateColumns },
134
+ children: headerGroup.headers.map((header) => {
135
+ var _a;
136
+ const sortable = header.column.getCanSort();
137
+ const sortedState = header.column.getIsSorted();
138
+ const justifyContent = ((_a = header.column.columnDef.meta) == null ? void 0 : _a.align) || defaultAlign;
139
+ if (sortable) {
140
+ return /* @__PURE__ */ jsx("div", { className: `${justifyContent} th`, children: /* @__PURE__ */ jsxs(
141
+ "button",
142
+ {
143
+ onClick: header.column.getToggleSortingHandler(),
144
+ style: { cursor: "pointer" },
145
+ type: "button",
146
+ children: [
147
+ /* @__PURE__ */ jsx(Typo, { as: "div", variant: "body", children: flexRender(
148
+ header.column.columnDef.header,
149
+ header.getContext()
150
+ ) }),
151
+ /* @__PURE__ */ jsxs(
152
+ Flex,
153
+ {
154
+ direction: "column",
155
+ style: { marginLeft: "var(--space-2)" },
156
+ children: [
157
+ sortedState === false && /* @__PURE__ */ jsx(
158
+ TriangleArrowDownIcon,
159
+ {
160
+ color: sortButtonColorMapper[variant].unselected
161
+ }
162
+ ),
163
+ sortedState === "asc" && /* @__PURE__ */ jsx(
164
+ TriangleArrowUpIcon,
165
+ {
166
+ color: sortButtonColorMapper[variant].selected
167
+ }
168
+ ),
169
+ sortedState === "desc" && /* @__PURE__ */ jsx(
170
+ TriangleArrowDownIcon,
171
+ {
172
+ color: sortButtonColorMapper[variant].selected
173
+ }
174
+ )
175
+ ]
176
+ }
177
+ )
178
+ ]
179
+ }
180
+ ) }, header.id);
181
+ }
182
+ return /* @__PURE__ */ jsx("div", { className: `${justifyContent} th`, children: /* @__PURE__ */ jsx(Typo, { as: "div", variant: "body", children: flexRender(
183
+ header.column.columnDef.header,
184
+ header.getContext()
185
+ ) }) }, header.id);
186
+ })
187
+ },
188
+ headerGroup.id
189
+ )) }),
190
+ /* @__PURE__ */ jsx(ScrollArea, { className: "tbody", children: helpCompRender(rowModels.rows.length) || rowModels.rows.map((row) => {
191
+ return /* @__PURE__ */ jsx(
192
+ Row,
193
+ {
194
+ ExpandComp,
195
+ defaultAlign,
196
+ getCellStyle,
197
+ getRowStyle,
198
+ gridTemplateColumns,
199
+ onRowClick,
200
+ row
201
+ },
202
+ `row_${row.id}`
203
+ );
204
+ }) })
205
+ ] }),
206
+ showPagination ? /* @__PURE__ */ jsx(Flex, { justify: "end", pt: "4", width: "100%", children: /* @__PURE__ */ jsx(
207
+ Pagination,
208
+ {
209
+ count: pageCount,
210
+ onChange: onChangePagination,
211
+ page: pagination.pageIndex + 1,
212
+ siblingCount
213
+ }
214
+ ) }) : null
215
+ ] });
216
+ }
217
+
218
+ export {
219
+ createColumnHelper,
220
+ ExpandTable
221
+ };
222
+ //# sourceMappingURL=chunk-GWJU4LIN.js.map