@team-monolith/cds 1.103.4 → 1.105.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 (183) hide show
  1. package/@types/emotion.d.ts +158 -158
  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 +33 -34
  8. package/dist/components/AnimatedButton.js +32 -32
  9. package/dist/components/Banner.js +51 -51
  10. package/dist/components/Book/Book.d.ts +3 -3
  11. package/dist/components/Book/Book.js +173 -174
  12. package/dist/components/Button.js +179 -179
  13. package/dist/components/CheckboxInput.js +100 -100
  14. package/dist/components/FileTypeAlertDialog.js +4 -4
  15. package/dist/components/Input.js +53 -53
  16. package/dist/components/InputBase.js +72 -72
  17. package/dist/components/Modal.js +4 -4
  18. package/dist/components/OverflowTooltip.js +4 -4
  19. package/dist/components/Pagination.js +56 -56
  20. package/dist/components/PinInput.js +64 -64
  21. package/dist/components/Popover.js +27 -27
  22. package/dist/components/RadioInput.js +73 -73
  23. package/dist/components/SquareButton.js +109 -109
  24. package/dist/components/Switch.js +69 -69
  25. package/dist/components/SwitchButton.js +107 -107
  26. package/dist/components/Tag.d.ts +2 -2
  27. package/dist/components/Tag.js +68 -68
  28. package/dist/components/Tooltip.js +19 -19
  29. package/dist/foundation/breakpoints.js +16 -16
  30. package/dist/icons/custom/colored/ai-helper.svg +4 -4
  31. package/dist/icons/custom/colored/ai-quiz-color.svg +20 -20
  32. package/dist/icons/custom/colored/badge-color.svg +4 -4
  33. package/dist/icons/custom/colored/badge-gold.svg +11 -11
  34. package/dist/icons/custom/colored/badge-green.svg +11 -11
  35. package/dist/icons/custom/colored/badge-silver.svg +11 -11
  36. package/dist/icons/custom/colored/basic-plus.svg +31 -31
  37. package/dist/icons/custom/colored/basic.svg +3 -3
  38. package/dist/icons/custom/colored/board-color.svg +5 -5
  39. package/dist/icons/custom/colored/cast-cloudy-color.svg +6 -6
  40. package/dist/icons/custom/colored/cast-partly-color.svg +7 -7
  41. package/dist/icons/custom/colored/cast-rainbow-color.svg +13 -13
  42. package/dist/icons/custom/colored/cast-sunny-color.svg +4 -4
  43. package/dist/icons/custom/colored/clap-bronze.svg +8 -8
  44. package/dist/icons/custom/colored/clap-gold.svg +8 -8
  45. package/dist/icons/custom/colored/clap-silver.svg +8 -8
  46. package/dist/icons/custom/colored/class.svg +13 -13
  47. package/dist/icons/custom/colored/codap-color.svg +13 -13
  48. package/dist/icons/custom/colored/ebook-color.svg +5 -5
  49. package/dist/icons/custom/colored/embedded-color.svg +38 -38
  50. package/dist/icons/custom/colored/emo-clap-color.svg +252 -252
  51. package/dist/icons/custom/colored/emo-good-color.svg +68 -68
  52. package/dist/icons/custom/colored/emo-great-color.svg +67 -67
  53. package/dist/icons/custom/colored/emo-heart-color.svg +239 -239
  54. package/dist/icons/custom/colored/emo-hundred-color.svg +194 -194
  55. package/dist/icons/custom/colored/emo-neutral-color.svg +76 -76
  56. package/dist/icons/custom/colored/emo-stars-color.svg +121 -121
  57. package/dist/icons/custom/colored/emo-thumbup-color.svg +238 -238
  58. package/dist/icons/custom/colored/empty.svg +1 -1
  59. package/dist/icons/custom/colored/entry-color.svg +4 -4
  60. package/dist/icons/custom/colored/filename-all-color.svg +4 -4
  61. package/dist/icons/custom/colored/filename-doc-color.svg +5 -5
  62. package/dist/icons/custom/colored/filename-hwp-color.svg +6 -6
  63. package/dist/icons/custom/colored/filename-img-color.svg +6 -6
  64. package/dist/icons/custom/colored/filename-mp4-color.svg +5 -5
  65. package/dist/icons/custom/colored/filename-pdf-color.svg +12 -12
  66. package/dist/icons/custom/colored/filename-ppt-color.svg +6 -6
  67. package/dist/icons/custom/colored/filename-xls-color.svg +5 -5
  68. package/dist/icons/custom/colored/filename-zip-color.svg +5 -5
  69. package/dist/icons/custom/colored/google.svg +13 -13
  70. package/dist/icons/custom/colored/hand-fill.svg +4 -4
  71. package/dist/icons/custom/colored/judge-color.svg +6 -6
  72. package/dist/icons/custom/colored/makecode-color.svg +4 -4
  73. package/dist/icons/custom/colored/master.svg +12 -12
  74. package/dist/icons/custom/colored/material.svg +6 -6
  75. package/dist/icons/custom/colored/medal-bronze.svg +9 -9
  76. package/dist/icons/custom/colored/medal-gold.svg +9 -9
  77. package/dist/icons/custom/colored/medal-silver.svg +9 -9
  78. package/dist/icons/custom/colored/pro.svg +4 -4
  79. package/dist/icons/custom/colored/problem.svg +7 -7
  80. package/dist/icons/custom/colored/python-color.svg +4 -4
  81. package/dist/icons/custom/colored/quiz-color.svg +12 -12
  82. package/dist/icons/custom/colored/resource-color.svg +13 -13
  83. package/dist/icons/custom/colored/scratch-color.svg +6 -6
  84. package/dist/icons/custom/colored/type-helper.svg +9 -9
  85. package/dist/icons/custom/colored/whale.svg +7 -7
  86. package/dist/icons/custom/colored/worksheet-color.svg +5 -5
  87. package/dist/icons/custom/default/ai-quiz.svg +8 -8
  88. package/dist/icons/custom/default/badge.svg +4 -4
  89. package/dist/icons/custom/default/board.svg +5 -5
  90. package/dist/icons/custom/default/cast-cloudy.svg +3 -3
  91. package/dist/icons/custom/default/cast-partly.svg +4 -4
  92. package/dist/icons/custom/default/cast-rainbow.svg +12 -12
  93. package/dist/icons/custom/default/cast-sunny.svg +3 -3
  94. package/dist/icons/custom/default/codap.svg +11 -11
  95. package/dist/icons/custom/default/ebook.svg +3 -3
  96. package/dist/icons/custom/default/embedded.svg +4 -4
  97. package/dist/icons/custom/default/emo-clap.svg +6 -6
  98. package/dist/icons/custom/default/emo-good.svg +12 -12
  99. package/dist/icons/custom/default/emo-great.svg +12 -12
  100. package/dist/icons/custom/default/emo-heart.svg +5 -5
  101. package/dist/icons/custom/default/emo-hundred.svg +3 -3
  102. package/dist/icons/custom/default/emo-neutral.svg +14 -14
  103. package/dist/icons/custom/default/emo-stars.svg +14 -14
  104. package/dist/icons/custom/default/emo-thumbup.svg +3 -3
  105. package/dist/icons/custom/default/entry.svg +4 -4
  106. package/dist/icons/custom/default/fab.svg +10 -10
  107. package/dist/icons/custom/default/grant-alt.svg +5 -5
  108. package/dist/icons/custom/default/grant.svg +4 -4
  109. package/dist/icons/custom/default/hand-line.svg +3 -3
  110. package/dist/icons/custom/default/judge.svg +3 -3
  111. package/dist/icons/custom/default/makecode.svg +5 -5
  112. package/dist/icons/custom/default/pdf.svg +3 -3
  113. package/dist/icons/custom/default/python.svg +7 -7
  114. package/dist/icons/custom/default/quiz.svg +4 -4
  115. package/dist/icons/custom/default/resource.svg +11 -11
  116. package/dist/icons/custom/default/scratch.svg +3 -3
  117. package/dist/icons/custom/default/scroll-alt.svg +5 -5
  118. package/dist/icons/custom/default/scroll-fill.svg +4 -4
  119. package/dist/icons/custom/default/scroll-line.svg +5 -5
  120. package/dist/icons/custom/default/symbol.svg +4 -4
  121. package/dist/icons/custom/default/worksheet.svg +4 -4
  122. package/dist/icons/custom/svgrColoredTemplate.js +26 -26
  123. package/dist/icons/custom/svgrDefaultTemplate.js +26 -26
  124. package/dist/patterns/Accordion.js +20 -20
  125. package/dist/patterns/Dropdown/DropdownItem/DropdownItem.js +58 -58
  126. package/dist/patterns/Dropdown/DropdownMenu/DropdownMenu.js +27 -27
  127. package/dist/patterns/Dropdown/DropdownMenu/style.js +19 -19
  128. package/dist/patterns/LexicalEditor/Plugins.js +36 -36
  129. package/dist/patterns/LexicalEditor/components/FileSelectInput.js +23 -23
  130. package/dist/patterns/LexicalEditor/components/InsertImageDialog/ImagePreview.js +4 -4
  131. package/dist/patterns/LexicalEditor/components/InsertImageDialog/InsertImageDialog.js +15 -15
  132. package/dist/patterns/LexicalEditor/components/UploadFileDialog/UploadFileDialog.js +2 -2
  133. package/dist/patterns/LexicalEditor/hr.svg +3 -3
  134. package/dist/patterns/LexicalEditor/nodes/FileNode/FileComponent.js +44 -44
  135. package/dist/patterns/LexicalEditor/nodes/FileNode/FileDownloadButton.js +25 -25
  136. package/dist/patterns/LexicalEditor/nodes/ImageNode/ImageComponent.js +8 -8
  137. package/dist/patterns/LexicalEditor/nodes/ImageNode/ImageResizer.js +60 -60
  138. package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/InputComponent.js +19 -19
  139. package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SegmentedInput.js +49 -49
  140. package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SettingForm/FormSolution.js +7 -7
  141. package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SettingForm/SettingForm.js +73 -73
  142. package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SettingForm/TextTypeDropdown.js +5 -5
  143. package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/TextInput.js +7 -7
  144. package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SelectBox/SelectBoxComponent.js +69 -69
  145. package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SelectBox/SelectBoxEdit.js +3 -3
  146. package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SelectBox/SelectBoxView.js +15 -15
  147. package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SelectComponent.js +28 -28
  148. package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SettingForm/FormSelection.js +54 -54
  149. package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SettingForm/SettingForm.js +61 -61
  150. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/Evaluation.js +75 -75
  151. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/FormIconAndLabel/FormIconAndLabel.js +17 -17
  152. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/FormIconAndLabel/FormLabel.js +7 -7
  153. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/FormQuestion.js +28 -28
  154. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/SettingForm.js +52 -52
  155. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/EvaluationComponent.js +7 -7
  156. package/dist/patterns/LexicalEditor/nodes/SheetInputNode/InputComponent.js +25 -25
  157. package/dist/patterns/LexicalEditor/nodes/SheetInputNode/SettingForm.js +53 -53
  158. package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SelectBox/SelectBoxComponent.js +54 -54
  159. package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SelectBox/SelectBoxView.js +5 -5
  160. package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SelectComponent.js +21 -21
  161. package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SettingForm/FormSelection.js +42 -42
  162. package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SettingForm/SettingForm.js +71 -71
  163. package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/ComponentAdder.js +51 -51
  164. package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/ComponentAdderPlugin.js +11 -11
  165. package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/menu.svg +7 -7
  166. package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/plus.svg +2 -2
  167. package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/useContextMenuOptions.js +10 -10
  168. package/dist/patterns/LexicalEditor/plugins/ComponentPickerMenuPlugin/ComponentPickerMenuItem.js +32 -32
  169. package/dist/patterns/LexicalEditor/plugins/ComponentPickerMenuPlugin/ComponentPickerMenuList.js +32 -32
  170. package/dist/patterns/LexicalEditor/plugins/ComponentPickerMenuPlugin/ComponentPickerMenuPlugin.js +12 -12
  171. package/dist/patterns/LexicalEditor/plugins/FloatingLinkEditorPlugin/FloatingLinkEditor.js +49 -49
  172. package/dist/patterns/LexicalEditor/plugins/FloatingTextFormatToolbarPlugin/FloatingTextFormatPopup.js +36 -36
  173. package/dist/patterns/LexicalEditor/plugins/ParagraphPlaceholderPlugin/index.js +7 -7
  174. package/dist/patterns/LexicalEditor/theme.js +243 -243
  175. package/dist/patterns/SegmentedControl/SegmentedControlButton.js +10 -10
  176. package/dist/patterns/SegmentedControl/SegmentedControlGroup.js +8 -8
  177. package/dist/patterns/SegmentedControl/SegmentedControlSquareButton.js +2 -2
  178. package/dist/patterns/ToggleButtonGroup/ToggleButton.js +40 -40
  179. package/dist/patterns/ToggleButtonGroup/ToggleButtonGroup.js +11 -11
  180. package/dist/utils/hover.js +12 -12
  181. package/dist/utils/reset.js +19 -19
  182. package/dist/utils/visuallyHidden.js +10 -10
  183. package/package.json +92 -92
@@ -16,54 +16,54 @@ import * as React from "react";
16
16
  import styled from "@emotion/styled";
17
17
  import { ZINDEX } from "../utils/zIndex";
18
18
  const TYPE_TO_ICON_STYLE = (theme, type, disabled) => ({
19
- default: css `
20
- path {
21
- stroke: ${theme.color.background.neutralAltActive};
22
- fill: ${theme.color.background.neutralBase};
23
- }
19
+ default: css `
20
+ path {
21
+ stroke: ${theme.color.background.neutralAltActive};
22
+ fill: ${theme.color.background.neutralBase};
23
+ }
24
24
  ${disabled
25
- ? css `
26
- path {
27
- stroke: ${theme.color.foreground.neutralBaseDisabled};
28
- fill: ${theme.color.background.neutralBaseDisabled};
29
- }
25
+ ? css `
26
+ path {
27
+ stroke: ${theme.color.foreground.neutralBaseDisabled};
28
+ fill: ${theme.color.background.neutralBaseDisabled};
29
+ }
30
30
  `
31
- : css `
32
- input[type="radio"]:hover + & {
33
- path {
34
- stroke: ${theme.color.background.primary};
35
- }
36
- }
37
- `}
31
+ : css `
32
+ input[type="radio"]:hover + & {
33
+ path {
34
+ stroke: ${theme.color.background.primary};
35
+ }
36
+ }
37
+ `}
38
38
  `,
39
- selected: css `
40
- path {
41
- stroke: ${theme.color.background.primary};
42
- fill: ${theme.color.background.neutralBase};
43
- }
44
- rect {
45
- fill: ${theme.color.background.primary};
46
- }
39
+ selected: css `
40
+ path {
41
+ stroke: ${theme.color.background.primary};
42
+ fill: ${theme.color.background.neutralBase};
43
+ }
44
+ rect {
45
+ fill: ${theme.color.background.primary};
46
+ }
47
47
  ${disabled
48
- ? css `
49
- path {
50
- stroke: ${theme.color.background.primaryDisabled};
51
- fill: ${theme.color.background.neutralBaseDisabled};
52
- }
53
- rect {
54
- fill: ${theme.color.background.primaryDisabled};
55
- }
48
+ ? css `
49
+ path {
50
+ stroke: ${theme.color.background.primaryDisabled};
51
+ fill: ${theme.color.background.neutralBaseDisabled};
52
+ }
53
+ rect {
54
+ fill: ${theme.color.background.primaryDisabled};
55
+ }
56
56
  `
57
- : css `
58
- input[type="radio"]:hover + & {
59
- path {
60
- stroke: ${theme.color.background.primaryActive};
61
- }
62
- rect {
63
- fill: ${theme.color.background.primaryActive};
64
- }
65
- }
66
- `}
57
+ : css `
58
+ input[type="radio"]:hover + & {
59
+ path {
60
+ stroke: ${theme.color.background.primaryActive};
61
+ }
62
+ rect {
63
+ fill: ${theme.color.background.primaryActive};
64
+ }
65
+ }
66
+ `}
67
67
  `,
68
68
  })[type];
69
69
  /**
@@ -81,8 +81,8 @@ export const RadioInput = React.forwardRef(function RadioInput(props, ref) {
81
81
  onChange,
82
82
  inputProps,
83
83
  };
84
- return (_jsxs(Label, Object.assign({ className: className, ref: ref, disabled: disabled !== null && disabled !== void 0 ? disabled : false }, other, { children: [_jsx(RadioButton, Object.assign({}, radioProps)), _jsx("span", { css: css `
85
- margin-left: 8px;
84
+ return (_jsxs(Label, Object.assign({ className: className, ref: ref, disabled: disabled !== null && disabled !== void 0 ? disabled : false }, other, { children: [_jsx(RadioButton, Object.assign({}, radioProps)), _jsx("span", { css: css `
85
+ margin-left: 8px;
86
86
  `, children: label })] })));
87
87
  });
88
88
  const RadioButton = React.forwardRef(function RadioButton(props, ref) {
@@ -90,38 +90,38 @@ const RadioButton = React.forwardRef(function RadioButton(props, ref) {
90
90
  const type = props.checked ? "selected" : "default";
91
91
  return (_jsxs(RadioButtonContainer, Object.assign({ className: className, spacer: spacer, disabled: disabled, ref: ref }, other, { children: [_jsx(StyledInput, Object.assign({ type: "radio" }, inputProps, { checked: checked, disabled: disabled, onChange: onChange })), _jsx(RadioButtonIcon, { type: type, disabled: disabled })] })));
92
92
  });
93
- const Label = styled.label `
94
- display: flex;
95
- position: relative;
96
- width: fit-content;
97
- font-size: 14px;
98
- font-weight: 500;
99
- line-height: 16px;
93
+ const Label = styled.label `
94
+ display: flex;
95
+ position: relative;
96
+ width: fit-content;
97
+ font-size: 14px;
98
+ font-weight: 500;
99
+ line-height: 16px;
100
100
  color: ${({ theme, disabled }) => disabled
101
101
  ? theme.color.foreground.neutralBaseDisabled
102
- : theme.color.foreground.neutralBase};
103
- align-self: center;
102
+ : theme.color.foreground.neutralBase};
103
+ align-self: center;
104
104
  `;
105
- const RadioButtonContainer = styled.span(({ spacer, disabled }) => css `
106
- display: inline-flex;
107
- position: relative;
108
- width: 16px;
109
- height: 16px;
110
- cursor: ${disabled ? "default" : "pointer"};
111
- margin-bottom: ${spacer ? "8px" : "0"};
105
+ const RadioButtonContainer = styled.span(({ spacer, disabled }) => css `
106
+ display: inline-flex;
107
+ position: relative;
108
+ width: 16px;
109
+ height: 16px;
110
+ cursor: ${disabled ? "default" : "pointer"};
111
+ margin-bottom: ${spacer ? "8px" : "0"};
112
112
  `);
113
- const StyledInput = styled.input `
114
- cursor: inherit;
115
- position: absolute;
116
- top: 0;
117
- left: 0;
118
- opacity: 0;
119
- width: 16px;
120
- height: 16px;
121
- margin: 0;
122
- padding: 0;
123
- // input 컴포넌트는 보이지 않지만, 클릭이 가능하게 z-index를 설정합니다.
124
- z-index: ${ZINDEX.inputBase};
113
+ const StyledInput = styled.input `
114
+ cursor: inherit;
115
+ position: absolute;
116
+ top: 0;
117
+ left: 0;
118
+ opacity: 0;
119
+ width: 16px;
120
+ height: 16px;
121
+ margin: 0;
122
+ padding: 0;
123
+ // input 컴포넌트는 보이지 않지만, 클릭이 가능하게 z-index를 설정합니다.
124
+ z-index: ${ZINDEX.inputBase};
125
125
  `;
126
126
  // default와 selected 구조가 유사하여 하나의 컴포넌트로 표현합니다.
127
127
  const RadioButtonIcon = (props) => {
@@ -17,128 +17,128 @@ import { HOVER } from "../utils/hover";
17
17
  import { Spinner } from "./Spinner";
18
18
  const COLOR_TO_BUTTON_STYLE = (theme, color, disabled) => ({
19
19
  danger: disabled
20
- ? css `
21
- background: ${theme.color.background.dangerDisabled};
22
- color: ${theme.color.foreground.neutralAltDisabled};
20
+ ? css `
21
+ background: ${theme.color.background.dangerDisabled};
22
+ color: ${theme.color.foreground.neutralAltDisabled};
23
23
  `
24
- : css `
25
- background: ${theme.color.background.danger};
26
- color: ${theme.color.foreground.neutralAlt};
27
- ${HOVER(css `
28
- background: ${theme.color.background.dangerActive};
29
- color: ${theme.color.foreground.neutralAltActive};
30
- `)}
24
+ : css `
25
+ background: ${theme.color.background.danger};
26
+ color: ${theme.color.foreground.neutralAlt};
27
+ ${HOVER(css `
28
+ background: ${theme.color.background.dangerActive};
29
+ color: ${theme.color.foreground.neutralAltActive};
30
+ `)}
31
31
  `,
32
32
  grey: disabled
33
- ? css `
34
- background: ${theme.color.background.neutralAltDisabled};
35
- color: ${theme.color.foreground.neutralBaseDisabled};
33
+ ? css `
34
+ background: ${theme.color.background.neutralAltDisabled};
35
+ color: ${theme.color.foreground.neutralBaseDisabled};
36
36
  `
37
- : css `
38
- background: ${theme.color.background.neutralAlt};
39
- color: ${theme.color.foreground.neutralBase};
40
- ${HOVER(css `
41
- background: ${theme.color.background.neutralAltActive};
42
- color: ${theme.color.foreground.neutralBaseActive};
43
- `)}
37
+ : css `
38
+ background: ${theme.color.background.neutralAlt};
39
+ color: ${theme.color.foreground.neutralBase};
40
+ ${HOVER(css `
41
+ background: ${theme.color.background.neutralAltActive};
42
+ color: ${theme.color.foreground.neutralBaseActive};
43
+ `)}
44
44
  `,
45
45
  primary: disabled
46
- ? css `
47
- background: ${theme.color.background.primaryDisabled};
48
- color: ${theme.color.foreground.neutralAltDisabled};
46
+ ? css `
47
+ background: ${theme.color.background.primaryDisabled};
48
+ color: ${theme.color.foreground.neutralAltDisabled};
49
49
  `
50
- : css `
51
- background: ${theme.color.background.primary};
52
- color: ${theme.color.foreground.neutralAlt};
53
- ${HOVER(css `
54
- background: ${theme.color.background.primaryActive};
55
- color: ${theme.color.foreground.neutralAltActive};
56
- `)}
50
+ : css `
51
+ background: ${theme.color.background.primary};
52
+ color: ${theme.color.foreground.neutralAlt};
53
+ ${HOVER(css `
54
+ background: ${theme.color.background.primaryActive};
55
+ color: ${theme.color.foreground.neutralAltActive};
56
+ `)}
57
57
  `,
58
58
  icon: disabled
59
- ? css `
60
- background: none;
61
- color: ${theme.color.foreground.neutralBaseDisabled};
59
+ ? css `
60
+ background: none;
61
+ color: ${theme.color.foreground.neutralBaseDisabled};
62
62
  `
63
- : css `
64
- background: none;
65
- color: ${theme.color.foreground.neutralBase};
66
- ${HOVER(css `
67
- background: ${theme.color.blanket.neutralLight};
68
- color: ${theme.color.foreground.neutralBaseActive};
69
- `)}
63
+ : css `
64
+ background: none;
65
+ color: ${theme.color.foreground.neutralBase};
66
+ ${HOVER(css `
67
+ background: ${theme.color.blanket.neutralLight};
68
+ color: ${theme.color.foreground.neutralBaseActive};
69
+ `)}
70
70
  `,
71
71
  black: disabled
72
- ? css `
73
- background: ${theme.color.background.inverseDisabled};
74
- color: ${theme.color.foreground.neutralAltDisabled};
72
+ ? css `
73
+ background: ${theme.color.background.inverseDisabled};
74
+ color: ${theme.color.foreground.neutralAltDisabled};
75
75
  `
76
- : css `
77
- background: ${theme.color.background.inverse};
78
- color: ${theme.color.foreground.neutralAlt};
79
- ${HOVER(css `
80
- background: ${theme.color.background.inverseActive};
81
- color: ${theme.color.foreground.neutralAltActive};
82
- `)}
76
+ : css `
77
+ background: ${theme.color.background.inverse};
78
+ color: ${theme.color.foreground.neutralAlt};
79
+ ${HOVER(css `
80
+ background: ${theme.color.background.inverseActive};
81
+ color: ${theme.color.foreground.neutralAltActive};
82
+ `)}
83
83
  `,
84
84
  white: disabled
85
- ? css `
86
- background: ${theme.color.background.neutralAltDisabled};
87
- color: ${theme.color.foreground.neutralBaseDisabled};
85
+ ? css `
86
+ background: ${theme.color.background.neutralAltDisabled};
87
+ color: ${theme.color.foreground.neutralBaseDisabled};
88
88
  `
89
- : css `
90
- background: ${theme.color.background.neutralBase};
91
- color: ${theme.color.foreground.neutralBase};
92
- ${HOVER(css `
93
- background: ${theme.color.background.neutralAltActive};
94
- color: ${theme.color.foreground.neutralBaseActive};
95
- `)}
89
+ : css `
90
+ background: ${theme.color.background.neutralBase};
91
+ color: ${theme.color.foreground.neutralBase};
92
+ ${HOVER(css `
93
+ background: ${theme.color.background.neutralAltActive};
94
+ color: ${theme.color.foreground.neutralBaseActive};
95
+ `)}
96
96
  `,
97
97
  })[color];
98
98
  const SIZE_TO_BUTTON_STYLE = {
99
- large: css `
100
- width: 56px;
101
- height: 56px;
102
- padding: 12px;
103
- border-radius: 8px;
104
-
105
- svg {
106
- width: 32px;
107
- height: 32px;
108
- }
99
+ large: css `
100
+ width: 56px;
101
+ height: 56px;
102
+ padding: 12px;
103
+ border-radius: 8px;
104
+
105
+ svg {
106
+ width: 32px;
107
+ height: 32px;
108
+ }
109
109
  `,
110
- medium: css `
111
- width: 48px;
112
- height: 48px;
113
- padding: 10px;
114
- border-radius: 8px;
115
-
116
- svg {
117
- width: 28px;
118
- height: 28px;
119
- }
110
+ medium: css `
111
+ width: 48px;
112
+ height: 48px;
113
+ padding: 10px;
114
+ border-radius: 8px;
115
+
116
+ svg {
117
+ width: 28px;
118
+ height: 28px;
119
+ }
120
120
  `,
121
- small: css `
122
- width: 36px;
123
- height: 36px;
124
- padding: 8px;
125
- border-radius: 8px;
126
-
127
- svg {
128
- width: 20px;
129
- height: 20px;
130
- }
121
+ small: css `
122
+ width: 36px;
123
+ height: 36px;
124
+ padding: 8px;
125
+ border-radius: 8px;
126
+
127
+ svg {
128
+ width: 20px;
129
+ height: 20px;
130
+ }
131
131
  `,
132
- xsmall: css `
133
- width: 28px;
134
- height: 28px;
135
- padding: 6px;
136
- border-radius: 4px;
137
-
138
- svg {
139
- width: 16px;
140
- height: 16px;
141
- }
132
+ xsmall: css `
133
+ width: 28px;
134
+ height: 28px;
135
+ padding: 6px;
136
+ border-radius: 4px;
137
+
138
+ svg {
139
+ width: 16px;
140
+ height: 16px;
141
+ }
142
142
  `,
143
143
  };
144
144
  /**
@@ -148,17 +148,17 @@ export const SquareButton = React.forwardRef(function SquareButton(props, ref) {
148
148
  const { className, component: Component = "button", disabled, color, size, icon, onClick, loading = false } = props, other = __rest(props, ["className", "component", "disabled", "color", "size", "icon", "onClick", "loading"]);
149
149
  const theme = useTheme();
150
150
  return (_jsx(Component, Object.assign({ type: Component === "button" || Component === "input" ? "button" : undefined }, other, { ref: ref, className: className, css: [
151
- css `
152
- border: none;
153
-
151
+ css `
152
+ border: none;
153
+
154
154
  ${disabled || loading
155
- ? css `
156
- cursor: default;
157
- pointer-events: none;
155
+ ? css `
156
+ cursor: default;
157
+ pointer-events: none;
158
158
  `
159
- : css `
160
- cursor: pointer;
161
- `}
159
+ : css `
160
+ cursor: pointer;
161
+ `}
162
162
  `,
163
163
  COLOR_TO_BUTTON_STYLE(theme, color, Boolean(disabled || loading)),
164
164
  SIZE_TO_BUTTON_STYLE[size],
@@ -38,73 +38,73 @@ const SIZE_TO_SWTICH_SIZE = {
38
38
  };
39
39
  const StyledSwitch = styled(MuiSwitch, {
40
40
  shouldForwardProp: (prop) => prop !== "switchSize",
41
- })(({ theme, switchSize }) => css `
42
- // Specificity를 높이기 위해 최상위에 &.MuiSwitch-root를 추가
43
- &.MuiSwitch-root {
44
- width: ${SIZE_TO_SWTICH_SIZE[switchSize].width};
45
- height: ${SIZE_TO_SWTICH_SIZE[switchSize].height};
46
- padding: 0; // 기존 Mui padding 속성 override
47
- .MuiSwitch-switchBase {
48
- padding: 2px;
49
- &.Mui-checked {
50
- transform: translateX(${SIZE_TO_SWTICH_SIZE[switchSize].translateX});
51
- }
52
- }
53
-
54
- .MuiSwitch-thumb {
55
- box-shadow: none;
56
- filter: drop-shadow(0px 2px 4px rgba(0, 35, 11, 0.2));
57
- width: ${SIZE_TO_SWTICH_SIZE[switchSize].thumbSize};
58
- height: ${SIZE_TO_SWTICH_SIZE[switchSize].thumbSize};
59
- border-radius: 77px;
60
- transition: color 0.3s ease;
61
-
62
- color: ${theme.color.foreground.primary};
63
- }
64
-
65
- .MuiSwitch-track {
66
- border-radius: 16px;
67
- opacity: 1;
68
- box-sizing: border-box;
69
-
70
- background: none;
71
- border: 1px solid ${theme.color.background.primary};
72
- }
73
-
74
- .Mui-disabled {
75
- & + .MuiSwitch-track {
76
- opacity: 1;
77
- border-color: ${theme.color.background.primaryDisabled};
78
- }
79
-
80
- .MuiSwitch-thumb {
81
- filter: none;
82
- color: ${theme.color.foreground.primaryDisabled};
83
- }
84
- }
85
-
86
- .Mui-checked {
87
- & + .MuiSwitch-track {
88
- opacity: 1;
89
- border-color: ${theme.color.background.primary};
90
- background-color: ${theme.color.background.primary};
91
- }
92
-
93
- .MuiSwitch-thumb {
94
- color: ${theme.color.background.neutralBase};
95
- }
96
- }
97
-
98
- .Mui-checked.Mui-disabled {
99
- & + .MuiSwitch-track {
100
- opacity: 1;
101
- border-color: ${theme.color.background.primaryDisabled};
102
- background-color: ${theme.color.background.primaryDisabled};
103
- }
104
-
105
- .MuiSwitch-thumb {
106
- color: ${theme.color.background.neutralBaseDisabled};
107
- }
108
- }
109
- }
41
+ })(({ theme, switchSize }) => css `
42
+ // Specificity를 높이기 위해 최상위에 &.MuiSwitch-root를 추가
43
+ &.MuiSwitch-root {
44
+ width: ${SIZE_TO_SWTICH_SIZE[switchSize].width};
45
+ height: ${SIZE_TO_SWTICH_SIZE[switchSize].height};
46
+ padding: 0; // 기존 Mui padding 속성 override
47
+ .MuiSwitch-switchBase {
48
+ padding: 2px;
49
+ &.Mui-checked {
50
+ transform: translateX(${SIZE_TO_SWTICH_SIZE[switchSize].translateX});
51
+ }
52
+ }
53
+
54
+ .MuiSwitch-thumb {
55
+ box-shadow: none;
56
+ filter: drop-shadow(0px 2px 4px rgba(0, 35, 11, 0.2));
57
+ width: ${SIZE_TO_SWTICH_SIZE[switchSize].thumbSize};
58
+ height: ${SIZE_TO_SWTICH_SIZE[switchSize].thumbSize};
59
+ border-radius: 77px;
60
+ transition: color 0.3s ease;
61
+
62
+ color: ${theme.color.foreground.primary};
63
+ }
64
+
65
+ .MuiSwitch-track {
66
+ border-radius: 16px;
67
+ opacity: 1;
68
+ box-sizing: border-box;
69
+
70
+ background: none;
71
+ border: 1px solid ${theme.color.background.primary};
72
+ }
73
+
74
+ .Mui-disabled {
75
+ & + .MuiSwitch-track {
76
+ opacity: 1;
77
+ border-color: ${theme.color.background.primaryDisabled};
78
+ }
79
+
80
+ .MuiSwitch-thumb {
81
+ filter: none;
82
+ color: ${theme.color.foreground.primaryDisabled};
83
+ }
84
+ }
85
+
86
+ .Mui-checked {
87
+ & + .MuiSwitch-track {
88
+ opacity: 1;
89
+ border-color: ${theme.color.background.primary};
90
+ background-color: ${theme.color.background.primary};
91
+ }
92
+
93
+ .MuiSwitch-thumb {
94
+ color: ${theme.color.background.neutralBase};
95
+ }
96
+ }
97
+
98
+ .Mui-checked.Mui-disabled {
99
+ & + .MuiSwitch-track {
100
+ opacity: 1;
101
+ border-color: ${theme.color.background.primaryDisabled};
102
+ background-color: ${theme.color.background.primaryDisabled};
103
+ }
104
+
105
+ .MuiSwitch-thumb {
106
+ color: ${theme.color.background.neutralBaseDisabled};
107
+ }
108
+ }
109
+ }
110
110
  `);