@team-monolith/cds 1.113.2 → 1.114.0

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 (202) hide show
  1. package/@types/emotion.d.ts +160 -160
  2. package/README.md +35 -35
  3. package/dist/CdsProvider.js +4 -4
  4. package/dist/components/AlertDialog/AlertDialog.js +54 -54
  5. package/dist/components/AlertDialog/AlertDialogActions.js +7 -7
  6. package/dist/components/AlertDialog/AlertDialogContent.js +8 -8
  7. package/dist/components/AlertDialog/AlertDialogTitle.js +34 -34
  8. package/dist/components/AnimatedButton.js +32 -32
  9. package/dist/components/Banner.js +51 -51
  10. package/dist/components/Book/Book.js +174 -174
  11. package/dist/components/Button.js +179 -179
  12. package/dist/components/CheckboxInput.js +100 -100
  13. package/dist/components/FileTypeAlertDialog.js +4 -4
  14. package/dist/components/Input.js +53 -53
  15. package/dist/components/InputBase.js +72 -72
  16. package/dist/components/Modal.js +4 -4
  17. package/dist/components/OverflowTooltip.js +4 -4
  18. package/dist/components/Pagination.js +56 -56
  19. package/dist/components/PinInput.js +64 -64
  20. package/dist/components/Popover.js +27 -27
  21. package/dist/components/RadioInput.js +73 -73
  22. package/dist/components/SquareButton.js +109 -109
  23. package/dist/components/Switch.js +69 -69
  24. package/dist/components/SwitchButton.js +107 -107
  25. package/dist/components/Tag.js +72 -72
  26. package/dist/components/Tooltip.js +19 -19
  27. package/dist/foundation/breakpoints.js +16 -16
  28. package/dist/icons/custom/colored/ai-helper.svg +4 -4
  29. package/dist/icons/custom/colored/ai-quiz-color.svg +20 -20
  30. package/dist/icons/custom/colored/badge-color.svg +4 -4
  31. package/dist/icons/custom/colored/badge-gold.svg +11 -11
  32. package/dist/icons/custom/colored/badge-green.svg +11 -11
  33. package/dist/icons/custom/colored/badge-silver.svg +11 -11
  34. package/dist/icons/custom/colored/basic-plus.svg +31 -31
  35. package/dist/icons/custom/colored/basic.svg +3 -3
  36. package/dist/icons/custom/colored/board-color.svg +5 -5
  37. package/dist/icons/custom/colored/cast-cloudy-color.svg +6 -6
  38. package/dist/icons/custom/colored/cast-partly-color.svg +7 -7
  39. package/dist/icons/custom/colored/cast-rainbow-color.svg +13 -13
  40. package/dist/icons/custom/colored/cast-sunny-color.svg +4 -4
  41. package/dist/icons/custom/colored/clap-bronze.svg +8 -8
  42. package/dist/icons/custom/colored/clap-gold.svg +8 -8
  43. package/dist/icons/custom/colored/clap-silver.svg +8 -8
  44. package/dist/icons/custom/colored/class.svg +13 -13
  45. package/dist/icons/custom/colored/codap-color.svg +13 -13
  46. package/dist/icons/custom/colored/ebook-color.svg +5 -5
  47. package/dist/icons/custom/colored/embedded-color.svg +38 -38
  48. package/dist/icons/custom/colored/emo-clap-color.svg +252 -252
  49. package/dist/icons/custom/colored/emo-good-color.svg +68 -68
  50. package/dist/icons/custom/colored/emo-great-color.svg +67 -67
  51. package/dist/icons/custom/colored/emo-heart-color.svg +239 -239
  52. package/dist/icons/custom/colored/emo-hundred-color.svg +194 -194
  53. package/dist/icons/custom/colored/emo-neutral-color.svg +76 -76
  54. package/dist/icons/custom/colored/emo-stars-color.svg +121 -121
  55. package/dist/icons/custom/colored/emo-thumbup-color.svg +238 -238
  56. package/dist/icons/custom/colored/empty.svg +1 -1
  57. package/dist/icons/custom/colored/entry-color.svg +4 -4
  58. package/dist/icons/custom/colored/filename-all-color.svg +4 -4
  59. package/dist/icons/custom/colored/filename-doc-color.svg +5 -5
  60. package/dist/icons/custom/colored/filename-hwp-color.svg +6 -6
  61. package/dist/icons/custom/colored/filename-img-color.svg +6 -6
  62. package/dist/icons/custom/colored/filename-mp4-color.svg +5 -5
  63. package/dist/icons/custom/colored/filename-pdf-color.svg +12 -12
  64. package/dist/icons/custom/colored/filename-ppt-color.svg +6 -6
  65. package/dist/icons/custom/colored/filename-xls-color.svg +5 -5
  66. package/dist/icons/custom/colored/filename-zip-color.svg +5 -5
  67. package/dist/icons/custom/colored/google.svg +13 -13
  68. package/dist/icons/custom/colored/hand-fill.svg +4 -4
  69. package/dist/icons/custom/colored/judge-color.svg +6 -6
  70. package/dist/icons/custom/colored/makecode-color.svg +4 -4
  71. package/dist/icons/custom/colored/master.svg +12 -12
  72. package/dist/icons/custom/colored/material.svg +6 -6
  73. package/dist/icons/custom/colored/medal-bronze.svg +9 -9
  74. package/dist/icons/custom/colored/medal-gold.svg +9 -9
  75. package/dist/icons/custom/colored/medal-silver.svg +9 -9
  76. package/dist/icons/custom/colored/pro.svg +4 -4
  77. package/dist/icons/custom/colored/problem.svg +7 -7
  78. package/dist/icons/custom/colored/python-color.svg +4 -4
  79. package/dist/icons/custom/colored/quiz-color.svg +12 -12
  80. package/dist/icons/custom/colored/resource-color.svg +13 -13
  81. package/dist/icons/custom/colored/scratch-color.svg +6 -6
  82. package/dist/icons/custom/colored/type-helper.svg +9 -9
  83. package/dist/icons/custom/colored/whale.svg +7 -7
  84. package/dist/icons/custom/colored/worksheet-color.svg +5 -5
  85. package/dist/icons/custom/default/ai-quiz.svg +8 -8
  86. package/dist/icons/custom/default/badge.svg +4 -4
  87. package/dist/icons/custom/default/board.svg +5 -5
  88. package/dist/icons/custom/default/cast-cloudy.svg +3 -3
  89. package/dist/icons/custom/default/cast-partly.svg +4 -4
  90. package/dist/icons/custom/default/cast-rainbow.svg +12 -12
  91. package/dist/icons/custom/default/cast-sunny.svg +3 -3
  92. package/dist/icons/custom/default/codap.svg +11 -11
  93. package/dist/icons/custom/default/ebook.svg +3 -3
  94. package/dist/icons/custom/default/embedded.svg +4 -4
  95. package/dist/icons/custom/default/emo-clap.svg +6 -6
  96. package/dist/icons/custom/default/emo-good.svg +12 -12
  97. package/dist/icons/custom/default/emo-great.svg +12 -12
  98. package/dist/icons/custom/default/emo-heart.svg +5 -5
  99. package/dist/icons/custom/default/emo-hundred.svg +3 -3
  100. package/dist/icons/custom/default/emo-neutral.svg +14 -14
  101. package/dist/icons/custom/default/emo-stars.svg +14 -14
  102. package/dist/icons/custom/default/emo-thumbup.svg +3 -3
  103. package/dist/icons/custom/default/entry.svg +4 -4
  104. package/dist/icons/custom/default/fab.svg +10 -10
  105. package/dist/icons/custom/default/grant-alt.svg +5 -5
  106. package/dist/icons/custom/default/grant.svg +4 -4
  107. package/dist/icons/custom/default/hand-line.svg +3 -3
  108. package/dist/icons/custom/default/judge.svg +3 -3
  109. package/dist/icons/custom/default/makecode.svg +5 -5
  110. package/dist/icons/custom/default/pdf.svg +3 -3
  111. package/dist/icons/custom/default/python.svg +7 -7
  112. package/dist/icons/custom/default/quiz.svg +4 -4
  113. package/dist/icons/custom/default/resource.svg +11 -11
  114. package/dist/icons/custom/default/scratch.svg +3 -3
  115. package/dist/icons/custom/default/scroll-alt.svg +5 -5
  116. package/dist/icons/custom/default/scroll-fill.svg +4 -4
  117. package/dist/icons/custom/default/scroll-line.svg +5 -5
  118. package/dist/icons/custom/default/symbol.svg +4 -4
  119. package/dist/icons/custom/default/worksheet.svg +4 -4
  120. package/dist/icons/custom/svgrColoredTemplate.js +26 -26
  121. package/dist/icons/custom/svgrDefaultTemplate.js +26 -26
  122. package/dist/patterns/Accordion.js +20 -20
  123. package/dist/patterns/Dropdown/DropdownItem/DropdownItem.js +60 -60
  124. package/dist/patterns/Dropdown/DropdownMenu/DropdownMenu.js +27 -27
  125. package/dist/patterns/Dropdown/DropdownMenu/style.js +19 -19
  126. package/dist/patterns/LexicalEditor/Plugins.js +38 -37
  127. package/dist/patterns/LexicalEditor/components/FileSelectInput.js +23 -23
  128. package/dist/patterns/LexicalEditor/components/InsertImageDialog/ImagePreview.js +4 -4
  129. package/dist/patterns/LexicalEditor/components/InsertImageDialog/InsertImageDialog.js +20 -17
  130. package/dist/patterns/LexicalEditor/components/InsertVideoDialog/InsertVideoDialog.d.ts +15 -0
  131. package/dist/patterns/LexicalEditor/components/InsertVideoDialog/InsertVideoDialog.js +76 -0
  132. package/dist/patterns/LexicalEditor/components/InsertVideoDialog/index.d.ts +1 -0
  133. package/dist/patterns/LexicalEditor/components/InsertVideoDialog/index.js +1 -0
  134. package/dist/patterns/LexicalEditor/components/UploadFileDialog/UploadFileDialog.js +2 -2
  135. package/dist/patterns/LexicalEditor/hr.svg +3 -3
  136. package/dist/patterns/LexicalEditor/nodes/FileNode/FileComponent.js +44 -44
  137. package/dist/patterns/LexicalEditor/nodes/FileNode/FileDownloadButton.js +25 -25
  138. package/dist/patterns/LexicalEditor/nodes/Form/FormInput.d.ts +2 -0
  139. package/dist/patterns/LexicalEditor/nodes/Form/FormInput.js +4 -2
  140. package/dist/patterns/LexicalEditor/nodes/ImageNode/ImageComponent.js +8 -8
  141. package/dist/patterns/LexicalEditor/nodes/ImageNode/ImageResizer.js +60 -60
  142. package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/InputComponent.js +19 -19
  143. package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SegmentedInput.js +49 -49
  144. package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SettingForm/FormSolution.js +7 -7
  145. package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SettingForm/SettingForm.js +73 -73
  146. package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SettingForm/TextTypeDropdown.js +5 -5
  147. package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/TextInput.js +7 -7
  148. package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SelectBox/SelectBoxComponent.js +69 -69
  149. package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SelectBox/SelectBoxEdit.js +3 -3
  150. package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SelectBox/SelectBoxView.js +15 -15
  151. package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SelectComponent.js +28 -28
  152. package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SettingForm/FormSelection.js +54 -54
  153. package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SettingForm/SettingForm.js +61 -61
  154. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/Evaluation.js +75 -75
  155. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/FormIconAndLabel/FormIconAndLabel.js +17 -17
  156. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/FormIconAndLabel/FormLabel.js +7 -7
  157. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/FormQuestion.js +28 -28
  158. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/SettingForm.js +52 -52
  159. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/EvaluationComponent.js +7 -7
  160. package/dist/patterns/LexicalEditor/nodes/SheetInputNode/InputComponent.js +25 -25
  161. package/dist/patterns/LexicalEditor/nodes/SheetInputNode/SettingForm.js +53 -53
  162. package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SelectBox/SelectBoxComponent.js +54 -54
  163. package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SelectBox/SelectBoxView.js +5 -5
  164. package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SelectComponent.js +21 -21
  165. package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SettingForm/FormSelection.js +42 -42
  166. package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SettingForm/SettingForm.js +71 -71
  167. package/dist/patterns/LexicalEditor/nodes/VideoNode/VideoComponent.d.ts +7 -0
  168. package/dist/patterns/LexicalEditor/nodes/VideoNode/VideoComponent.js +53 -0
  169. package/dist/patterns/LexicalEditor/nodes/VideoNode/VideoNode.d.ts +23 -0
  170. package/dist/patterns/LexicalEditor/nodes/VideoNode/VideoNode.js +52 -0
  171. package/dist/patterns/LexicalEditor/nodes/VideoNode/index.d.ts +1 -0
  172. package/dist/patterns/LexicalEditor/nodes/VideoNode/index.js +1 -0
  173. package/dist/patterns/LexicalEditor/nodes/index.d.ts +1 -0
  174. package/dist/patterns/LexicalEditor/nodes/index.js +1 -0
  175. package/dist/patterns/LexicalEditor/nodes/nodes.d.ts +2 -1
  176. package/dist/patterns/LexicalEditor/nodes/nodes.js +2 -0
  177. package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/ComponentAdder.js +51 -51
  178. package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/ComponentAdderPlugin.js +18 -12
  179. package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/menu.svg +7 -7
  180. package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/plus.svg +2 -2
  181. package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/useContextMenuOptions.d.ts +1 -1
  182. package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/useContextMenuOptions.js +27 -12
  183. package/dist/patterns/LexicalEditor/plugins/ComponentPickerMenuPlugin/ComponentPickerMenuItem.js +32 -32
  184. package/dist/patterns/LexicalEditor/plugins/ComponentPickerMenuPlugin/ComponentPickerMenuList.js +32 -32
  185. package/dist/patterns/LexicalEditor/plugins/ComponentPickerMenuPlugin/ComponentPickerMenuPlugin.d.ts +1 -0
  186. package/dist/patterns/LexicalEditor/plugins/ComponentPickerMenuPlugin/ComponentPickerMenuPlugin.js +30 -19
  187. package/dist/patterns/LexicalEditor/plugins/FloatingLinkEditorPlugin/FloatingLinkEditor.js +49 -49
  188. package/dist/patterns/LexicalEditor/plugins/FloatingTextFormatToolbarPlugin/FloatingTextFormatPopup.js +36 -36
  189. package/dist/patterns/LexicalEditor/plugins/ParagraphPlaceholderPlugin/index.js +7 -7
  190. package/dist/patterns/LexicalEditor/plugins/VideosPlugin/index.d.ts +5 -0
  191. package/dist/patterns/LexicalEditor/plugins/VideosPlugin/index.js +20 -0
  192. package/dist/patterns/LexicalEditor/theme.js +243 -243
  193. package/dist/patterns/SegmentedControl/SegmentedControlButton.js +10 -10
  194. package/dist/patterns/SegmentedControl/SegmentedControlGroup.js +8 -8
  195. package/dist/patterns/SegmentedControl/SegmentedControlSquareButton.js +2 -2
  196. package/dist/patterns/Tabs.js +43 -43
  197. package/dist/patterns/ToggleButtonGroup/ToggleButton.js +40 -40
  198. package/dist/patterns/ToggleButtonGroup/ToggleButtonGroup.js +11 -11
  199. package/dist/utils/hover.js +12 -12
  200. package/dist/utils/reset.js +19 -19
  201. package/dist/utils/visuallyHidden.js +10 -10
  202. package/package.json +93 -92
@@ -15,90 +15,90 @@ import { css, useTheme } from "@emotion/react";
15
15
  import styled from "@emotion/styled";
16
16
  import { forwardRef } from "react";
17
17
  const TYPE_TO_CONTAINER_STYLE = (theme, type) => ({
18
- primary: css `
19
- background: ${theme.color.container.blueContainer};
20
- border: 1px solid ${theme.color.foreground.primary};
21
- color: ${theme.color.container.blueOnContainer};
18
+ primary: css `
19
+ background: ${theme.color.container.blueContainer};
20
+ border: 1px solid ${theme.color.foreground.primary};
21
+ color: ${theme.color.container.blueOnContainer};
22
22
  `,
23
- success: css `
24
- background: ${theme.color.container.greenContainer};
25
- border: 1px solid ${theme.color.background.successActive};
26
- color: ${theme.color.container.greenOnContainer};
23
+ success: css `
24
+ background: ${theme.color.container.greenContainer};
25
+ border: 1px solid ${theme.color.background.successActive};
26
+ color: ${theme.color.container.greenOnContainer};
27
27
  `,
28
- danger: css `
29
- background: ${theme.color.container.redContainer};
30
- border: 1px solid ${theme.color.background.dangerActive};
31
- color: ${theme.color.container.redOnContainer};
28
+ danger: css `
29
+ background: ${theme.color.container.redContainer};
30
+ border: 1px solid ${theme.color.background.dangerActive};
31
+ color: ${theme.color.container.redOnContainer};
32
32
  `,
33
33
  })[type];
34
34
  const TYPE_TO_INDEX_STYLE = (theme, type) => ({
35
- primary: css `
36
- background: ${theme.color.background.primary};
37
- border: 1px solid ${theme.color.background.primary};
38
- color: ${theme.color.foreground.neutralAlt};
35
+ primary: css `
36
+ background: ${theme.color.background.primary};
37
+ border: 1px solid ${theme.color.background.primary};
38
+ color: ${theme.color.foreground.neutralAlt};
39
39
  `,
40
- success: css `
41
- background: ${theme.color.background.successActive};
42
- border: 1px solid ${theme.color.background.successActive};
43
- color: ${theme.color.foreground.neutralAlt};
40
+ success: css `
41
+ background: ${theme.color.background.successActive};
42
+ border: 1px solid ${theme.color.background.successActive};
43
+ color: ${theme.color.foreground.neutralAlt};
44
44
  `,
45
- danger: css `
46
- background: ${theme.color.background.dangerActive};
47
- border: 1px solid ${theme.color.background.dangerActive};
48
- color: ${theme.color.foreground.neutralAlt};
45
+ danger: css `
46
+ background: ${theme.color.background.dangerActive};
47
+ border: 1px solid ${theme.color.background.dangerActive};
48
+ color: ${theme.color.foreground.neutralAlt};
49
49
  `,
50
50
  })[type];
51
51
  /** 비지니스 로직과 무관한 SelectBox를 그리는 공통 컴포넌트입니다. */
52
52
  export const SelectBoxComponent = forwardRef(function SelectBoxComponent(props, ref) {
53
53
  const { className, indexClassName, contentClassName, type, index, image, text, endIcon, onClick } = props, restProps = __rest(props, ["className", "indexClassName", "contentClassName", "type", "index", "image", "text", "endIcon", "onClick"]);
54
54
  const theme = useTheme();
55
- return (_jsxs(Container, Object.assign({ className: className, ref: ref }, restProps, { css: type ? TYPE_TO_CONTAINER_STYLE(theme, type) : undefined, onClick: onClick, children: [_jsx(Index, { className: indexClassName, "aria-hidden": "true", css: type ? TYPE_TO_INDEX_STYLE(theme, type) : undefined, children: index }), _jsxs(Content, { className: contentClassName, "aria-hidden": "true", children: [image && (_jsx("img", { "aria-hidden": "true", src: image.src, alt: image.altText, css: css `
56
- height: auto;
57
- // 이미지로 인해 좌우로 스크롤이 생기는 것을 방지
58
- max-width: 100%;
59
- width: fit-content;
60
- border-radius: 6px;
55
+ return (_jsxs(Container, Object.assign({ className: className, ref: ref }, restProps, { css: type ? TYPE_TO_CONTAINER_STYLE(theme, type) : undefined, onClick: onClick, children: [_jsx(Index, { className: indexClassName, "aria-hidden": "true", css: type ? TYPE_TO_INDEX_STYLE(theme, type) : undefined, children: index }), _jsxs(Content, { className: contentClassName, "aria-hidden": "true", children: [image && (_jsx("img", { "aria-hidden": "true", src: image.src, alt: image.altText, css: css `
56
+ height: auto;
57
+ // 이미지로 인해 좌우로 스크롤이 생기는 것을 방지
58
+ max-width: 100%;
59
+ width: fit-content;
60
+ border-radius: 6px;
61
61
  ` })), text] }), endIcon] })));
62
62
  });
63
- const Container = styled.div(({ theme, onClick }) => css `
64
- ${onClick && "cursor: pointer;"}
65
- display: flex;
66
- box-sizing: border-box;
67
- width: 400px;
68
- padding: 12px;
69
- gap: 12px;
70
- border-radius: 8px;
71
- background: ${theme.color.background.neutralAlt};
72
- border: 1px solid transparent;
73
- color: ${theme.color.foreground.neutralBase};
63
+ const Container = styled.div(({ theme, onClick }) => css `
64
+ ${onClick && "cursor: pointer;"}
65
+ display: flex;
66
+ box-sizing: border-box;
67
+ width: 400px;
68
+ padding: 12px;
69
+ gap: 12px;
70
+ border-radius: 8px;
71
+ background: ${theme.color.background.neutralAlt};
72
+ border: 1px solid transparent;
73
+ color: ${theme.color.foreground.neutralBase};
74
74
  `);
75
- const Index = styled.div(({ theme }) => css `
76
- display: flex;
77
- box-sizing: border-box;
78
- width: 20px;
79
- height: 20px;
80
- padding: 4px;
81
-
82
- user-select: none; /* Standard syntax */
83
-
84
- justify-content: center;
85
- align-items: center;
86
- border-radius: 4px;
87
- border: 1px solid ${theme.color.background.neutralAltActive};
88
- background: ${theme.color.background.neutralBase};
89
- color: ${theme.color.foreground.neutralBaseDisabled};
90
- font-family: ${theme.fontFamily.ui};
91
- font-size: 14px;
92
- font-weight: 800;
93
- line-height: 16px;
75
+ const Index = styled.div(({ theme }) => css `
76
+ display: flex;
77
+ box-sizing: border-box;
78
+ width: 20px;
79
+ height: 20px;
80
+ padding: 4px;
81
+
82
+ user-select: none; /* Standard syntax */
83
+
84
+ justify-content: center;
85
+ align-items: center;
86
+ border-radius: 4px;
87
+ border: 1px solid ${theme.color.background.neutralAltActive};
88
+ background: ${theme.color.background.neutralBase};
89
+ color: ${theme.color.foreground.neutralBaseDisabled};
90
+ font-family: ${theme.fontFamily.ui};
91
+ font-size: 14px;
92
+ font-weight: 800;
93
+ line-height: 16px;
94
94
  `);
95
- const Content = styled.div(({ theme }) => css `
96
- display: flex;
97
- flex-direction: column;
98
- gap: 12px;
99
- flex: 1;
100
- font-family: ${theme.fontFamily.ui};
101
- font-size: 16px;
102
- font-weight: 400;
103
- line-height: 20px;
95
+ const Content = styled.div(({ theme }) => css `
96
+ display: flex;
97
+ flex-direction: column;
98
+ gap: 12px;
99
+ flex: 1;
100
+ font-family: ${theme.fontFamily.ui};
101
+ font-size: 16px;
102
+ font-weight: 400;
103
+ line-height: 20px;
104
104
  `);
@@ -6,8 +6,8 @@ import { SelectBoxComponent } from "./SelectBoxComponent";
6
6
  export function SelectBoxEdit(props) {
7
7
  const { index, isAnswer, image, text, onClick } = props;
8
8
  const theme = useTheme();
9
- return (_jsx(SelectBoxComponent, { index: index, image: image, text: text, endIcon: isAnswer && (_jsx(CheckboxCircleFillIcon, { color: theme.color.foreground.success, css: css `
10
- width: 16px;
11
- height: 16px;
9
+ return (_jsx(SelectBoxComponent, { index: index, image: image, text: text, endIcon: isAnswer && (_jsx(CheckboxCircleFillIcon, { color: theme.color.foreground.success, css: css `
10
+ width: 16px;
11
+ height: 16px;
12
12
  ` })), onClick: onClick }));
13
13
  }
@@ -7,17 +7,17 @@ import { Tag } from "../../../../../components/Tag";
7
7
  import { useRef } from "react";
8
8
  import { useEventListener } from "usehooks-ts";
9
9
  const TYPE_TO_INDEX_ICON = (type) => ({
10
- primary: (_jsx(CheckFillIcon, { css: css `
11
- width: 12px;
12
- height: 12px;
10
+ primary: (_jsx(CheckFillIcon, { css: css `
11
+ width: 12px;
12
+ height: 12px;
13
13
  ` })),
14
- success: (_jsx(CheckboxCircleFillIcon, { css: css `
15
- width: 12px;
16
- height: 12px;
14
+ success: (_jsx(CheckboxCircleFillIcon, { css: css `
15
+ width: 12px;
16
+ height: 12px;
17
17
  ` })),
18
- danger: (_jsx(CloseCircleFillIcon, { css: css `
19
- width: 12px;
20
- height: 12px;
18
+ danger: (_jsx(CloseCircleFillIcon, { css: css `
19
+ width: 12px;
20
+ height: 12px;
21
21
  ` })),
22
22
  })[type];
23
23
  /**
@@ -72,14 +72,14 @@ export function SelectBoxView(props) {
72
72
  useEventListener("keydown", handleKeyDown);
73
73
  // text가 있으면 text, 없으면 image의 altText, 없으면 index를 aria-label로 사용
74
74
  const ariaText = text || (image && image.altText) || index.toString() + "번 선택지";
75
- return (_jsx(SelectBoxComponent, { css: css `
76
- width: 100%;
75
+ return (_jsx(SelectBoxComponent, { css: css `
76
+ width: 100%;
77
77
  `, ref: boxRef, role: multipleSelectionsEnabled ? "checkbox" : "radio", "aria-checked": isSelected, "aria-label": [ariaText, description].filter(Boolean).join(" "), tabIndex: onClick ? 0 : -1, type: type, index: type ? TYPE_TO_INDEX_ICON(type) : index, image: image, text: text, onClick: onClick,
78
78
  // 선택되지 않았으나 정답일 때 정답 태그를 표시
79
79
  endIcon: isAnswer &&
80
- !isSelected && (_jsx(Tag, { label: "\uC815\uB2F5", icon: _jsx(CheckboxCircleFillIcon, {}), color: "green", css: css `
81
- span {
82
- font-weight: 700;
83
- }
80
+ !isSelected && (_jsx(Tag, { label: "\uC815\uB2F5", icon: _jsx(CheckboxCircleFillIcon, {}), color: "green", css: css `
81
+ span {
82
+ font-weight: 700;
83
+ }
84
84
  ` })) }));
85
85
  }
@@ -23,16 +23,16 @@ export function SelectComponent(props) {
23
23
  selections.filter((s) => "isAnswer" in s && s.isAnswer).length > 1);
24
24
  // view
25
25
  if (!isEditable) {
26
- return (_jsxs("fieldset", { css: css `
27
- display: flex;
28
- flex-direction: column;
29
- gap: 4px;
30
- border: none;
31
- margin: 0;
32
- padding: 0;
33
- `, children: [multipleSelectionsEnabled && (_jsxs(Alert, { children: [_jsx(AlarmWarningFillIcon, { css: css `
34
- width: 14px;
35
- height: 14px;
26
+ return (_jsxs("fieldset", { css: css `
27
+ display: flex;
28
+ flex-direction: column;
29
+ gap: 4px;
30
+ border: none;
31
+ margin: 0;
32
+ padding: 0;
33
+ `, children: [multipleSelectionsEnabled && (_jsxs(Alert, { children: [_jsx(AlarmWarningFillIcon, { css: css `
34
+ width: 14px;
35
+ height: 14px;
36
36
  ` }), "\uC9C8\uBB38\uC5D0 \uD574\uB2F9\uD558\uB294 \uB2F5\uC744 \uBAA8\uB450 \uACE0\uB974\uB294 \uBB38\uC81C\uC785\uB2C8\uB2E4."] })), selections.map((selection, index) => (_jsx(SelectBoxView, { multipleSelectionsEnabled: multipleSelectionsEnabled, index: index + 1, isAnswer: showQuizSolution && "isAnswer" in selection
37
37
  ? selection.isAnswer
38
38
  : undefined, isSelected: selected.includes(selection.value), image: selection.show.image, text: selection.show.text, onClick: freezeProblemNode
@@ -65,28 +65,28 @@ export function SelectComponent(props) {
65
65
  } }, index)))] }));
66
66
  }
67
67
  // 교사 edit view
68
- return (_jsxs(_Fragment, { children: [_jsxs("div", { css: css `
69
- display: flex;
70
- gap: 4px;
71
- `, children: [_jsx("div", { css: css `
72
- display: flex;
73
- flex-direction: column;
74
- gap: 4px;
68
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { css: css `
69
+ display: flex;
70
+ gap: 4px;
71
+ `, children: [_jsx("div", { css: css `
72
+ display: flex;
73
+ flex-direction: column;
74
+ gap: 4px;
75
75
  `, children: selections.map((selection, index) => (_jsx(SelectBoxEdit, { index: index + 1, isAnswer: "isAnswer" in selection && selection.isAnswer, image: selection.show.image, text: selection.show.text === "" && selection.show.image === null
76
76
  ? `${index + 1}번 선택지`
77
77
  : selection.show.text, onClick: () => setSettingOpen(true) }, index))) }), _jsx(SquareButton, { size: "small", color: "icon", icon: _jsx(Settings3FillIcon, {}), onClick: () => {
78
78
  setSettingOpen(true);
79
79
  }, "aria-label": "\uC120\uD0DD\uC9C0 \uC124\uC815" })] }), settingOpen && (_jsx(SettingForm, { selections: selections, nodeKey: nodeKey, onClose: () => setSettingOpen(false) }))] }));
80
80
  }
81
- const Alert = styled.div(({ theme }) => css `
82
- display: flex;
83
- gap: 4px;
84
- margin-bottom: 12px;
85
- color: ${theme.color.foreground.neutralBaseDisabled};
86
- /* Default/Label/12px-Md */
87
- font-family: ${theme.fontFamily.ui};
88
- font-size: 12px;
89
- font-style: normal;
90
- font-weight: 500;
91
- line-height: 16px; /* 133.333% */
81
+ const Alert = styled.div(({ theme }) => css `
82
+ display: flex;
83
+ gap: 4px;
84
+ margin-bottom: 12px;
85
+ color: ${theme.color.foreground.neutralBaseDisabled};
86
+ /* Default/Label/12px-Md */
87
+ font-family: ${theme.fontFamily.ui};
88
+ font-size: 12px;
89
+ font-style: normal;
90
+ font-weight: 500;
91
+ line-height: 16px; /* 133.333% */
92
92
  `);
@@ -19,21 +19,21 @@ export function FormSelection(props) {
19
19
  name: `selections.${index}`,
20
20
  rules,
21
21
  });
22
- return (_jsxs(Container, { children: [_jsx(Index, { children: index + 1 }), _jsxs("div", { css: css `
23
- display: flex;
24
- flex: 1;
25
- flex-direction: column;
26
- gap: 4px;
22
+ return (_jsxs(Container, { children: [_jsx(Index, { children: index + 1 }), _jsxs("div", { css: css `
23
+ display: flex;
24
+ flex: 1;
25
+ flex-direction: column;
26
+ gap: 4px;
27
27
  `, children: [_jsx(InsertImageDialog, { title: value.show.image ? "이미지 바꾸기" : "이미지 삽입하기", open: imageOpen, imageProps: (_a = value.show.image) !== null && _a !== void 0 ? _a : undefined, onClose: () => setImageOpen(false), onChange: (props) => onChange(Object.assign(Object.assign({}, value), { show: Object.assign(Object.assign({}, value.show), { image: props }) })), onDelete: value.show.image
28
28
  ? () => {
29
29
  onChange(Object.assign(Object.assign({}, value), { show: Object.assign(Object.assign({}, value.show), { image: null }) }));
30
30
  }
31
- : undefined }), value.show.image && (_jsx("img", { src: value.show.image.src, alt: value.show.image.altText, css: css `
32
- height: auto;
33
- // 이미지로 인해 좌우로 스크롤이 생기는 것을 방지
34
- max-width: min(400px, 100%);
35
- width: fit-content;
36
- border-radius: 6px;
31
+ : undefined }), value.show.image && (_jsx("img", { src: value.show.image.src, alt: value.show.image.altText, css: css `
32
+ height: auto;
33
+ // 이미지로 인해 좌우로 스크롤이 생기는 것을 방지
34
+ max-width: min(400px, 100%);
35
+ width: fit-content;
36
+ border-radius: 6px;
37
37
  `, draggable: "false" })), _jsx(Input, { size: "small", color: invalid
38
38
  ? "activeDanger"
39
39
  : inputFocused
@@ -45,55 +45,55 @@ export function FormSelection(props) {
45
45
  onBlur: () => {
46
46
  setInputFocused(false);
47
47
  },
48
- }, placeholder: `${index + 1}번 선택지`, hintIcon: invalid ? _jsx(ErrorWarningFillIcon, {}) : undefined, hintText: error === null || error === void 0 ? void 0 : error.message, multiline: true, fullWidth: true, css: css `
49
- flex: 1;
50
- ` })] }), _jsxs("div", { css: css `
51
- display: flex;
52
- height: 36px;
53
- gap: 8px;
54
- align-items: center;
48
+ }, placeholder: `${index + 1}번 선택지`, hintIcon: invalid ? _jsx(ErrorWarningFillIcon, {}) : undefined, hintText: error === null || error === void 0 ? void 0 : error.message, multiline: true, fullWidth: true, css: css `
49
+ flex: 1;
50
+ ` })] }), _jsxs("div", { css: css `
51
+ display: flex;
52
+ height: 36px;
53
+ gap: 8px;
54
+ align-items: center;
55
55
  `, children: [_jsx(SquareButton, { color: "icon", size: "xsmall", icon: value.show.image ? _jsx(ImageEditFillIcon, {}) : _jsx(ImageAddFillIcon, {}), onClick: () => {
56
56
  setImageOpen(true);
57
57
  }, "aria-label": value.show.image ? "이미지 바꾸기" : "이미지 삽입하기" }), _jsxs(Answer, { children: ["\uC815\uB2F5", _jsx(Switch, { checked: Boolean(value.isAnswer), size: "small", onChange: () => {
58
58
  onChange(Object.assign(Object.assign({}, value), { isAnswer: !value.isAnswer }));
59
59
  } })] }), onDelete && (_jsx(SquareButton, { color: "white", size: "xsmall", icon: _jsx(DeleteBinLineIcon, {}), onClick: onDelete, "aria-label": "\uC0AD\uC81C" }))] })] }));
60
60
  }
61
- const Container = styled.div(({ theme }) => css `
62
- display: flex;
63
- padding: 4px 12px;
64
- gap: 8px;
65
- border-radius: 8px;
66
- background: ${theme.color.background.neutralAlt};
61
+ const Container = styled.div(({ theme }) => css `
62
+ display: flex;
63
+ padding: 4px 12px;
64
+ gap: 8px;
65
+ border-radius: 8px;
66
+ background: ${theme.color.background.neutralAlt};
67
67
  `);
68
- const Index = styled.div(({ theme }) => css `
69
- display: flex;
70
- box-sizing: border-box;
71
- width: 20px;
72
- height: 20px;
73
- padding: 4px;
74
- margin-top: 8px;
75
- justify-content: center;
76
- align-items: center;
77
- border-radius: 4px;
78
- border: 1px solid ${theme.color.background.neutralAltActive};
79
- background: ${theme.color.background.neutralBase};
80
- color: ${theme.color.foreground.neutralBaseDisabled};
81
- font-family: ${theme.fontFamily.ui};
82
- font-size: 14px;
83
- font-weight: 800;
84
- line-height: 16px;
68
+ const Index = styled.div(({ theme }) => css `
69
+ display: flex;
70
+ box-sizing: border-box;
71
+ width: 20px;
72
+ height: 20px;
73
+ padding: 4px;
74
+ margin-top: 8px;
75
+ justify-content: center;
76
+ align-items: center;
77
+ border-radius: 4px;
78
+ border: 1px solid ${theme.color.background.neutralAltActive};
79
+ background: ${theme.color.background.neutralBase};
80
+ color: ${theme.color.foreground.neutralBaseDisabled};
81
+ font-family: ${theme.fontFamily.ui};
82
+ font-size: 14px;
83
+ font-weight: 800;
84
+ line-height: 16px;
85
85
  `);
86
- const Answer = styled.label(({ theme }) => css `
87
- display: flex;
88
- align-items: center;
89
- padding-right: 4px;
90
- gap: 8px;
91
- color: ${theme.color.foreground.neutralBase};
92
- cursor: pointer;
93
- /* Default/Label/14px-Md */
94
- font-family: ${theme.fontFamily.ui};
95
- font-size: 14px;
96
- font-style: normal;
97
- font-weight: 500;
98
- line-height: 16px; /* 114.286% */
86
+ const Answer = styled.label(({ theme }) => css `
87
+ display: flex;
88
+ align-items: center;
89
+ padding-right: 4px;
90
+ gap: 8px;
91
+ color: ${theme.color.foreground.neutralBase};
92
+ cursor: pointer;
93
+ /* Default/Label/14px-Md */
94
+ font-family: ${theme.fontFamily.ui};
95
+ font-size: 14px;
96
+ font-style: normal;
97
+ font-weight: 500;
98
+ line-height: 16px; /* 114.286% */
99
99
  `);
@@ -61,9 +61,9 @@ export function SettingForm(props) {
61
61
  const answersCount = watch("selections").filter((selection) => selection.isAnswer).length;
62
62
  const hasMultipleAnswers = answersCount > 1;
63
63
  const hasAnswer = answersCount > 0;
64
- return (_jsxs(Form, { onSubmit: handleSubmit(onSettingSubmit), children: [_jsxs(Title, { children: [_jsx(ListRadioIcon, { css: css `
65
- width: 12px;
66
- height: 12px;
64
+ return (_jsxs(Form, { onSubmit: handleSubmit(onSettingSubmit), children: [_jsxs(Title, { children: [_jsx(ListRadioIcon, { css: css `
65
+ width: 12px;
66
+ height: 12px;
67
67
  ` }), "\uAC1D\uAD00\uC2DD \uC785\uB825 \uCE78"] }), _jsxs(Content, { children: [_jsxs(FormArea, { children: [_jsx(Label, { children: "\uB2F5\uC548" }), fields.map((field, index) => (_jsx(FormSelection, { index: index, control: control, rules: {
68
68
  validate: {
69
69
  validateRequired,
@@ -86,70 +86,70 @@ export function SettingForm(props) {
86
86
  },
87
87
  value: uid(),
88
88
  });
89
- }, disabled: fields.length >= 9 }), hasMultipleAnswers && (_jsxs(Alert, { children: [_jsx(AlarmWarningFillIcon, { css: css `
90
- width: 14px;
91
- height: 14px;
89
+ }, disabled: fields.length >= 9 }), hasMultipleAnswers && (_jsxs(Alert, { children: [_jsx(AlarmWarningFillIcon, { css: css `
90
+ width: 14px;
91
+ height: 14px;
92
92
  ` }), "\uC815\uB2F5\uC774 \uC5EC\uB7EC \uAC1C\uC778 \uBB38\uC81C\uC5D0\uB294 \uC815\uB2F5\uC744 \uBAA8\uB450 \uC120\uD0DD\uD574\uC57C \uD55C\uB2E4\uB294 \uC548\uB0B4\uAC00 \uC81C\uACF5\uB429\uB2C8\uB2E4."] }))] }), _jsxs(Buttons, { children: [_jsx(Button, { color: "grey", size: "xsmall", label: "\uB2EB\uAE30", onClick: onClose }), _jsx(Tooltip, { open: !hasAnswer && tooltipOpen, text: "\uC120\uD0DD\uC9C0 \uC911 \uC815\uB2F5\uC744 \uD45C\uC2DC\uD574\uC8FC\uC138\uC694.", onOpen: () => setTooltipOpen(true), onClose: () => setTooltipOpen(false), placement: "top-end", children: _jsx("span", { children: _jsx(Button, { color: "primary", size: "xsmall", label: "\uC774\uB300\uB85C \uB123\uAE30", type: "submit", disabled: !hasAnswer }) }) })] })] }));
93
93
  }
94
- const Form = styled.form(({ theme }) => css `
95
- display: flex;
96
- width: 620px;
97
- flex-direction: column;
98
- border-radius: 6px;
99
- border: 1px solid ${theme.color.background.neutralAltActive};
100
- background: ${theme.color.background.neutralBase};
101
- box-shadow: ${shadows.shadow08};
94
+ const Form = styled.form(({ theme }) => css `
95
+ display: flex;
96
+ width: 620px;
97
+ flex-direction: column;
98
+ border-radius: 6px;
99
+ border: 1px solid ${theme.color.background.neutralAltActive};
100
+ background: ${theme.color.background.neutralBase};
101
+ box-shadow: ${shadows.shadow08};
102
102
  `);
103
- const Title = styled.div(({ theme }) => css `
104
- display: flex;
105
- padding: 8px 12px;
106
- gap: 4px;
107
- align-items: center;
108
- color: ${theme.color.foreground.neutralBase};
109
- /* Default/Label/12px-Md */
110
- font-family: ${theme.fontFamily.ui};
111
- font-size: 12px;
112
- font-style: normal;
113
- font-weight: 500;
114
- line-height: 16px; /* 133.333% */
103
+ const Title = styled.div(({ theme }) => css `
104
+ display: flex;
105
+ padding: 8px 12px;
106
+ gap: 4px;
107
+ align-items: center;
108
+ color: ${theme.color.foreground.neutralBase};
109
+ /* Default/Label/12px-Md */
110
+ font-family: ${theme.fontFamily.ui};
111
+ font-size: 12px;
112
+ font-style: normal;
113
+ font-weight: 500;
114
+ line-height: 16px; /* 133.333% */
115
115
  `);
116
- const Content = styled.div(({ theme }) => css `
117
- display: flex;
118
- flex-direction: column;
119
- gap: 12px;
120
- padding: 12px;
121
- border-top: 1px solid ${theme.color.background.neutralAltActive};
122
- border-bottom: 1px solid ${theme.color.background.neutralAltActive};
116
+ const Content = styled.div(({ theme }) => css `
117
+ display: flex;
118
+ flex-direction: column;
119
+ gap: 12px;
120
+ padding: 12px;
121
+ border-top: 1px solid ${theme.color.background.neutralAltActive};
122
+ border-bottom: 1px solid ${theme.color.background.neutralAltActive};
123
123
  `);
124
- const FormArea = styled.div `
125
- display: flex;
126
- flex-direction: column;
127
- gap: 8px;
124
+ const FormArea = styled.div `
125
+ display: flex;
126
+ flex-direction: column;
127
+ gap: 8px;
128
128
  `;
129
- const Label = styled.div(({ theme }) => css `
130
- color: ${theme.color.foreground.neutralBaseDisabled};
131
- /* Default/Label/12px-Md */
132
- font-family: ${theme.fontFamily.ui};
133
- font-size: 12px;
134
- font-style: normal;
135
- font-weight: 500;
136
- line-height: 16px; /* 133.333% */
129
+ const Label = styled.div(({ theme }) => css `
130
+ color: ${theme.color.foreground.neutralBaseDisabled};
131
+ /* Default/Label/12px-Md */
132
+ font-family: ${theme.fontFamily.ui};
133
+ font-size: 12px;
134
+ font-style: normal;
135
+ font-weight: 500;
136
+ line-height: 16px; /* 133.333% */
137
137
  `);
138
- const Buttons = styled.div `
139
- display: flex;
140
- padding: 12px;
141
- justify-content: flex-end;
142
- align-items: center;
143
- gap: 8px;
138
+ const Buttons = styled.div `
139
+ display: flex;
140
+ padding: 12px;
141
+ justify-content: flex-end;
142
+ align-items: center;
143
+ gap: 8px;
144
144
  `;
145
- const Alert = styled.div(({ theme }) => css `
146
- display: flex;
147
- gap: 4px;
148
- color: ${theme.color.foreground.neutralBaseDisabled};
149
- /* Default/Label/12px-Md */
150
- font-family: ${theme.fontFamily.ui};
151
- font-size: 12px;
152
- font-style: normal;
153
- font-weight: 500;
154
- line-height: 16px; /* 133.333% */
145
+ const Alert = styled.div(({ theme }) => css `
146
+ display: flex;
147
+ gap: 4px;
148
+ color: ${theme.color.foreground.neutralBaseDisabled};
149
+ /* Default/Label/12px-Md */
150
+ font-family: ${theme.fontFamily.ui};
151
+ font-size: 12px;
152
+ font-style: normal;
153
+ font-weight: 500;
154
+ line-height: 16px; /* 133.333% */
155
155
  `);