@team-monolith/cds 0.2.11 → 0.3.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 (147) hide show
  1. package/package.json +1 -1
  2. package/src/cds/components/Button.tsx +0 -5
  3. package/src/cds/components/Input.tsx +7 -2
  4. package/src/cds/foundation/shadows.ts +1 -1
  5. package/src/cds/index.ts +1 -1
  6. package/dist/CodleDesignSystemProvider.d.ts +0 -69
  7. package/dist/CodleDesignSystemProvider.js +0 -96
  8. package/dist/components/AlertDialog/AlertDialog.d.ts +0 -14
  9. package/dist/components/AlertDialog/AlertDialog.js +0 -45
  10. package/dist/components/AlertDialog/AlertDialogActions.d.ts +0 -8
  11. package/dist/components/AlertDialog/AlertDialogActions.js +0 -35
  12. package/dist/components/AlertDialog/AlertDialogContent.d.ts +0 -8
  13. package/dist/components/AlertDialog/AlertDialogContent.js +0 -36
  14. package/dist/components/AlertDialog/AlertDialogTitle.d.ts +0 -13
  15. package/dist/components/AlertDialog/AlertDialogTitle.js +0 -38
  16. package/dist/components/AlertDialog/index.d.ts +0 -4
  17. package/dist/components/AlertDialog/index.js +0 -4
  18. package/dist/components/Banner.d.ts +0 -29
  19. package/dist/components/Banner.js +0 -65
  20. package/dist/components/Button.d.ts +0 -33
  21. package/dist/components/Button.js +0 -72
  22. package/dist/components/CheckboxInput.d.ts +0 -27
  23. package/dist/components/CheckboxInput.js +0 -77
  24. package/dist/components/Input.d.ts +0 -17
  25. package/dist/components/Input.js +0 -72
  26. package/dist/components/InputBase.d.ts +0 -42
  27. package/dist/components/InputBase.js +0 -52
  28. package/dist/components/Pagination.d.ts +0 -27
  29. package/dist/components/Pagination.js +0 -32
  30. package/dist/components/PinInput.d.ts +0 -36
  31. package/dist/components/PinInput.js +0 -154
  32. package/dist/components/RadioInput.d.ts +0 -23
  33. package/dist/components/RadioInput.js +0 -78
  34. package/dist/components/SquareButton.d.ts +0 -26
  35. package/dist/components/SquareButton.js +0 -80
  36. package/dist/components/Switch.d.ts +0 -19
  37. package/dist/components/Switch.js +0 -59
  38. package/dist/components/Tag.d.ts +0 -21
  39. package/dist/components/Tag.js +0 -61
  40. package/dist/components/Tooltip.d.ts +0 -26
  41. package/dist/components/Tooltip.js +0 -50
  42. package/dist/foundation/color.d.ts +0 -75
  43. package/dist/foundation/color.js +0 -75
  44. package/dist/foundation/shadows.d.ts +0 -9
  45. package/dist/foundation/shadows.js +0 -10
  46. package/dist/icons/Arrows/index.d.ts +0 -2
  47. package/dist/icons/Arrows/index.js +0 -2
  48. package/dist/icons/Media/index.d.ts +0 -2
  49. package/dist/icons/Media/index.js +0 -2
  50. package/dist/icons/System/index.d.ts +0 -2
  51. package/dist/icons/System/index.js +0 -2
  52. package/dist/icons/arrows.d.ts +0 -28
  53. package/dist/icons/arrows.js +0 -21
  54. package/dist/icons/brand.d.ts +0 -4
  55. package/dist/icons/brand.js +0 -13
  56. package/dist/icons/design.d.ts +0 -4
  57. package/dist/icons/design.js +0 -13
  58. package/dist/icons/map.d.ts +0 -4
  59. package/dist/icons/map.js +0 -13
  60. package/dist/icons/system.d.ts +0 -31
  61. package/dist/icons/system.js +0 -22
  62. package/dist/index.d.ts +0 -44
  63. package/dist/index.js +0 -44
  64. package/dist/patterns/Card/Card.d.ts +0 -39
  65. package/dist/patterns/Card/Card.js +0 -68
  66. package/dist/patterns/Card/class-icon.svg +0 -28
  67. package/dist/patterns/Card/index.d.ts +0 -2
  68. package/dist/patterns/Card/index.js +0 -2
  69. package/dist/patterns/Card/material-icon.svg +0 -25
  70. package/dist/patterns/Card/problem-icon.svg +0 -25
  71. package/dist/patterns/Card/thumbnail/sample.png +0 -0
  72. package/dist/patterns/Dialog/Dialog.d.ts +0 -12
  73. package/dist/patterns/Dialog/Dialog.js +0 -26
  74. package/dist/patterns/Dialog/DialogContent.d.ts +0 -8
  75. package/dist/patterns/Dialog/DialogContent.js +0 -23
  76. package/dist/patterns/Dialog/DialogNavigation.d.ts +0 -12
  77. package/dist/patterns/Dialog/DialogNavigation.js +0 -25
  78. package/dist/patterns/Dialog/DialogNavigationContext.d.ts +0 -5
  79. package/dist/patterns/Dialog/DialogNavigationContext.js +0 -5
  80. package/dist/patterns/Dialog/DialogNavigationItem.d.ts +0 -10
  81. package/dist/patterns/Dialog/DialogNavigationItem.js +0 -25
  82. package/dist/patterns/Dialog/DialogPanel.d.ts +0 -10
  83. package/dist/patterns/Dialog/DialogPanel.js +0 -31
  84. package/dist/patterns/Dialog/DialogPanels.d.ts +0 -13
  85. package/dist/patterns/Dialog/DialogPanels.js +0 -17
  86. package/dist/patterns/Dialog/DialogPanelsContext.d.ts +0 -5
  87. package/dist/patterns/Dialog/DialogPanelsContext.js +0 -5
  88. package/dist/patterns/Dialog/DialogTitle.d.ts +0 -13
  89. package/dist/patterns/Dialog/DialogTitle.js +0 -26
  90. package/dist/patterns/Dialog/index.d.ts +0 -7
  91. package/dist/patterns/Dialog/index.js +0 -7
  92. package/dist/patterns/Dropdown/Dropdown.d.ts +0 -27
  93. package/dist/patterns/Dropdown/Dropdown.js +0 -41
  94. package/dist/patterns/Dropdown/DropdownItem.d.ts +0 -42
  95. package/dist/patterns/Dropdown/DropdownItem.js +0 -89
  96. package/dist/patterns/Dropdown/DropdownMenu.d.ts +0 -30
  97. package/dist/patterns/Dropdown/DropdownMenu.js +0 -85
  98. package/dist/patterns/Dropdown/index.d.ts +0 -2
  99. package/dist/patterns/Dropdown/index.js +0 -2
  100. package/dist/patterns/EmptyState/EmptyState.d.ts +0 -16
  101. package/dist/patterns/EmptyState/EmptyState.js +0 -36
  102. package/dist/patterns/EmptyState/empty-state-icon.svg +0 -36
  103. package/dist/patterns/EmptyState/index.d.ts +0 -2
  104. package/dist/patterns/EmptyState/index.js +0 -2
  105. package/dist/patterns/Navigation/NavigationContext.d.ts +0 -5
  106. package/dist/patterns/Navigation/NavigationContext.js +0 -5
  107. package/dist/patterns/Navigation/NavigationHorizontal.d.ts +0 -11
  108. package/dist/patterns/Navigation/NavigationHorizontal.js +0 -27
  109. package/dist/patterns/Navigation/NavigationItem.d.ts +0 -9
  110. package/dist/patterns/Navigation/NavigationItem.js +0 -33
  111. package/dist/patterns/Navigation/NavigationVertical.d.ts +0 -14
  112. package/dist/patterns/Navigation/NavigationVertical.js +0 -27
  113. package/dist/patterns/Navigation/index.d.ts +0 -3
  114. package/dist/patterns/Navigation/index.js +0 -3
  115. package/dist/patterns/SegmentedControl/SegmentedControlButton.d.ts +0 -8
  116. package/dist/patterns/SegmentedControl/SegmentedControlButton.js +0 -41
  117. package/dist/patterns/SegmentedControl/SegmentedControlGroup.d.ts +0 -26
  118. package/dist/patterns/SegmentedControl/SegmentedControlGroup.js +0 -50
  119. package/dist/patterns/SegmentedControl/SegmentedControlGroupPropsContext.d.ts +0 -5
  120. package/dist/patterns/SegmentedControl/SegmentedControlGroupPropsContext.js +0 -5
  121. package/dist/patterns/SegmentedControl/SegmentedControlSquareButton.d.ts +0 -8
  122. package/dist/patterns/SegmentedControl/SegmentedControlSquareButton.js +0 -45
  123. package/dist/patterns/SegmentedControl/index.d.ts +0 -3
  124. package/dist/patterns/SegmentedControl/index.js +0 -3
  125. package/dist/patterns/Table/Table.d.ts +0 -18
  126. package/dist/patterns/Table/Table.js +0 -33
  127. package/dist/patterns/Table/TableBody.d.ts +0 -8
  128. package/dist/patterns/Table/TableBody.js +0 -26
  129. package/dist/patterns/Table/TableCell.d.ts +0 -15
  130. package/dist/patterns/Table/TableCell.js +0 -78
  131. package/dist/patterns/Table/TableHead.d.ts +0 -8
  132. package/dist/patterns/Table/TableHead.js +0 -26
  133. package/dist/patterns/Table/TablePropsContext.d.ts +0 -7
  134. package/dist/patterns/Table/TablePropsContext.js +0 -3
  135. package/dist/patterns/Table/TableRow.d.ts +0 -14
  136. package/dist/patterns/Table/TableRow.js +0 -34
  137. package/dist/patterns/Table/TableVariantContext.d.ts +0 -6
  138. package/dist/patterns/Table/TableVariantContext.js +0 -3
  139. package/dist/patterns/Table/index.d.ts +0 -7
  140. package/dist/patterns/Table/index.js +0 -6
  141. package/dist/svg.d.ts +0 -10
  142. package/dist/utils/hover.d.ts +0 -3
  143. package/dist/utils/hover.js +0 -14
  144. package/dist/utils/reset.d.ts +0 -2
  145. package/dist/utils/reset.js +0 -8
  146. package/dist/utils/zIndex.d.ts +0 -3
  147. package/dist/utils/zIndex.js +0 -3
@@ -1,154 +0,0 @@
1
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
- return cooked;
4
- };
5
- var __assign = (this && this.__assign) || function () {
6
- __assign = Object.assign || function(t) {
7
- for (var s, i = 1, n = arguments.length; i < n; i++) {
8
- s = arguments[i];
9
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10
- t[p] = s[p];
11
- }
12
- return t;
13
- };
14
- return __assign.apply(this, arguments);
15
- };
16
- var __rest = (this && this.__rest) || function (s, e) {
17
- var t = {};
18
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
19
- t[p] = s[p];
20
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
21
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
22
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
23
- t[p[i]] = s[p[i]];
24
- }
25
- return t;
26
- };
27
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
28
- /** @jsxImportSource @emotion/react */
29
- import { css } from "@emotion/react";
30
- import styled from "@emotion/styled";
31
- import React, { useRef, useState } from "react";
32
- import { InputBase } from "./InputBase";
33
- var SIZE_TO_STYLES = function (size) {
34
- return ({
35
- small: css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 36px;\n "], ["\n width: 36px;\n "]))),
36
- medium: css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 48px;\n "], ["\n width: 48px;\n "]))),
37
- large: css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: 56px;\n "], ["\n width: 56px;\n "]))),
38
- }[size]);
39
- };
40
- var COLOR_TO_HINT_STYLES = function (theme, color, disabled) {
41
- return disabled
42
- ? css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), theme.color.foreground.neutralBaseDisabled) : {
43
- default: css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), theme.color.foreground.neutralBaseDisabled),
44
- activePrimary: css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), theme.color.foreground.neutralBaseDisabled),
45
- activeDanger: css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), theme.color.foreground.danger),
46
- activeSuccess: css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), theme.color.foreground.success),
47
- }[color];
48
- };
49
- var SIZE_TO_FONT_STYLES = function (size) {
50
- return ({
51
- small: css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n font-size: 14px;\n line-height: 20px;\n svg {\n width: 16px;\n height: 16px;\n }\n "], ["\n font-size: 14px;\n line-height: 20px;\n svg {\n width: 16px;\n height: 16px;\n }\n "]))),
52
- medium: css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n font-size: 16px;\n line-height: 24px;\n svg {\n width: 16px;\n height: 16px;\n }\n "], ["\n font-size: 16px;\n line-height: 24px;\n svg {\n width: 16px;\n height: 16px;\n }\n "]))),
53
- large: css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n font-size: 18px;\n line-height: 28px;\n svg {\n width: 18px;\n height: 18px;\n }\n "], ["\n font-size: 18px;\n line-height: 28px;\n svg {\n width: 18px;\n height: 18px;\n }\n "]))),
54
- }[size]);
55
- };
56
- /** i번째 값을 value로 바꾸는 setState Wrapper 함수 */
57
- function updateFocus(value, i, setFocus) {
58
- setFocus(function (prevFocus) {
59
- var newFocus = prevFocus.slice();
60
- newFocus[i] = value;
61
- return newFocus;
62
- });
63
- }
64
- /**
65
- * [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=26-11031&t=n7a8XP4k8R2TGmiO-0)
66
- */
67
- var PinInput = React.forwardRef(function (props, ref) {
68
- var className = props.className, autoFocus = props.autoFocus, size = props.size, placeholder = props.placeholder, label = props.label, hintText = props.hintText, hintIcon = props.hintIcon, _a = props.disabled, disabled = _a === void 0 ? false : _a, error = props.error, positive = props.positive, onChange = props.onChange, values = props.values, other = __rest(props, ["className", "autoFocus", "size", "placeholder", "label", "hintText", "hintIcon", "disabled", "error", "positive", "onChange", "values"]);
69
- return (_jsxs(PinInputWrapper, __assign({ className: className, size: size, ref: ref }, other, { children: [label ? (_jsxs(Label, __assign({ disabled: disabled }, { children: [label, " ", _jsx(PinInputComponent, __assign({}, props))] }))) : (_jsx(PinInputComponent, __assign({}, props))), hintText && (_jsxs(Hint, __assign({ color: error ? "activeDanger" : positive ? "activeSuccess" : "default", disabled: disabled }, { children: [hintIcon, hintText] })))] })));
70
- });
71
- function PinInputComponent(props) {
72
- var autoFocus = props.autoFocus, size = props.size, placeholder = props.placeholder, _a = props.disabled, disabled = _a === void 0 ? false : _a, error = props.error, positive = props.positive, onChange = props.onChange, values = props.values;
73
- var _b = useState([]), focus = _b[0], setFocus = _b[1];
74
- var refs = useRef([]);
75
- return (_jsx(PinInputContainer, { children: values.map(function (value, i) { return (_jsx(SqaureInput, { color: error
76
- ? "activeDanger"
77
- : positive
78
- ? "activeSuccess"
79
- : focus[i]
80
- ? "activePrimary"
81
- : "default", inputRef: function (element) {
82
- refs.current[i] = element;
83
- }, onChange: function (event) {
84
- var _a;
85
- var eventValue = event.target.value;
86
- if (eventValue.length > 2) {
87
- // 복붙으로 입력을 입력한 경우
88
- if (eventValue.length === values.length &&
89
- eventValue.match(/^[0-9]+$/)) {
90
- onChange({ values: eventValue.split(""), event: event });
91
- }
92
- return;
93
- }
94
- // 값을 지웠을 때
95
- if (eventValue === "") {
96
- var newValues = values.slice();
97
- newValues[i] = "";
98
- onChange({ values: newValues, event: event });
99
- return;
100
- }
101
- // 원래 값이 있었고, 새 값을 입력했을 때
102
- // 입력 완료된 값(2자리)으로부터 새로 입력한 숫자를 추출한다.
103
- var currentValue = values[i];
104
- var newValue = eventValue;
105
- if (currentValue[0] === eventValue[0]) {
106
- // 예) 이전 값: '2', 입력된 상태: '23' 인 경우
107
- newValue = eventValue[1]; // 뒷 자리가 새로 입력된 숫자
108
- }
109
- else if (currentValue[0] === eventValue[1]) {
110
- // 예) 이전 값: '2', 입력된 상태: '32' 인 경우
111
- newValue = eventValue[0]; // 앞 자리가 새로 입력된 숫자
112
- }
113
- // 새로 입력된 값이 숫자일때만 onChange를 실행
114
- if (newValue.match(/^[0-9]$/)) {
115
- var newValues = values.slice();
116
- newValues[i] = newValue;
117
- onChange({ values: newValues, event: event });
118
- // 자동으로 다음 input으로 포커스 이동시킴.
119
- if (i < values.length - 1) {
120
- (_a = refs.current[i + 1]) === null || _a === void 0 ? void 0 : _a.focus();
121
- }
122
- }
123
- }, placeholder: focus[i] ? "" : placeholder, disabled: disabled, size: size, inputProps: {
124
- autoFocus: autoFocus ? i === 0 : false,
125
- onBlur: function () { return updateFocus(false, i, setFocus); },
126
- onFocus: function () { return updateFocus(true, i, setFocus); },
127
- onKeyDown: function (e) {
128
- var _a;
129
- // Backspace 키로 이전 input으로의 포커스 이동
130
- if (e.key === "Backspace" && values[i] === "" && i > 0) {
131
- (_a = refs.current[i - 1]) === null || _a === void 0 ? void 0 : _a.focus();
132
- }
133
- },
134
- }, fullWidth: true, value: value }, i)); }) }));
135
- }
136
- var PinInputWrapper = styled.span(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n display: inline-flex;\n flex-direction: column;\n gap: 8px;\n ", "\n"], ["\n display: inline-flex;\n flex-direction: column;\n gap: 8px;\n ", "\n"])), function (_a) {
137
- var size = _a.size;
138
- return SIZE_TO_FONT_STYLES(size);
139
- });
140
- var PinInputContainer = styled.span(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n display: inline-flex;\n gap: 8px;\n"], ["\n display: inline-flex;\n gap: 8px;\n"])));
141
- var SqaureInput = styled(InputBase)(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n ", "\n padding: 0;\n input {\n text-align: center;\n }\n"], ["\n ", "\n padding: 0;\n input {\n text-align: center;\n }\n"])), function (_a) {
142
- var size = _a.size;
143
- return SIZE_TO_STYLES(size);
144
- });
145
- var Hint = styled.div(function (_a) {
146
- var theme = _a.theme, color = _a.color, disabled = _a.disabled;
147
- return css(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: 4px;\n ", ";\n "], ["\n display: flex;\n align-items: center;\n gap: 4px;\n ", ";\n "])), COLOR_TO_HINT_STYLES(theme, color, disabled));
148
- });
149
- var Label = styled.label(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: 8px;\n ", "\n"], ["\n display: flex;\n flex-direction: column;\n gap: 8px;\n ", "\n"])), function (_a) {
150
- var theme = _a.theme, disabled = _a.disabled;
151
- return disabled && css(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), theme.color.foreground.neutralBaseDisabled);
152
- });
153
- export default PinInput;
154
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17;
@@ -1,23 +0,0 @@
1
- import * as React from "react";
2
- import { InputHTMLAttributes } from "react";
3
- export type RadioInputType = "default" | "selected";
4
- export interface RadioInputProps {
5
- className?: string;
6
- /** 라디오 버튼의 선택 여부(Controlled) */
7
- checked: boolean;
8
- /** 라디오 버튼의 라벨 */
9
- label?: string;
10
- /** 라디오 버튼의 하단 마진(8px) 여부 */
11
- spacer?: boolean;
12
- /** 라디오 버튼의 비활성화 여부 */
13
- disabled?: boolean;
14
- /** 라디오 버튼 선택값 변경시 호출되는 함수 */
15
- onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
16
- /** HTML input 태그에 전달될 props */
17
- inputProps?: InputHTMLAttributes<HTMLInputElement>;
18
- }
19
- /**
20
- * [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=420-3704&t=lvpbJKdtz7Lb8wIQ-0)
21
- */
22
- declare const RadioInput: React.ForwardRefExoticComponent<RadioInputProps & React.RefAttributes<any>>;
23
- export default RadioInput;
@@ -1,78 +0,0 @@
1
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
- return cooked;
4
- };
5
- var __assign = (this && this.__assign) || function () {
6
- __assign = Object.assign || function(t) {
7
- for (var s, i = 1, n = arguments.length; i < n; i++) {
8
- s = arguments[i];
9
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10
- t[p] = s[p];
11
- }
12
- return t;
13
- };
14
- return __assign.apply(this, arguments);
15
- };
16
- var __rest = (this && this.__rest) || function (s, e) {
17
- var t = {};
18
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
19
- t[p] = s[p];
20
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
21
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
22
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
23
- t[p[i]] = s[p[i]];
24
- }
25
- return t;
26
- };
27
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
28
- /** @jsxImportSource @emotion/react */
29
- import { css, useTheme } from "@emotion/react";
30
- import * as React from "react";
31
- import styled from "@emotion/styled";
32
- import { ZINDEX } from "../utils/zIndex";
33
- var TYPE_TO_ICON_STYLE = function (theme, type, disabled) {
34
- return {
35
- default: css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n path {\n stroke: ", ";\n fill: ", ";\n }\n ", "\n "], ["\n path {\n stroke: ", ";\n fill: ", ";\n }\n ", "\n "])), theme.color.background.neutralAltActive, theme.color.background.neutralBase, disabled
36
- ? css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n cursor: default;\n path {\n stroke: ", ";\n fill: ", ";\n }\n "], ["\n cursor: default;\n path {\n stroke: ", ";\n fill: ", ";\n }\n "])), theme.color.background.primaryDisabled, theme.color.background.neutralAlt) : css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n input[type=\"radio\"]:hover + & {\n path {\n stroke: ", ";\n }\n }\n "], ["\n input[type=\"radio\"]:hover + & {\n path {\n stroke: ", ";\n }\n }\n "])), theme.color.background.primary)),
37
- selected: css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n path {\n stroke: ", ";\n fill: ", ";\n }\n rect {\n fill: ", ";\n }\n ", "\n "], ["\n path {\n stroke: ", ";\n fill: ", ";\n }\n rect {\n fill: ", ";\n }\n ", "\n "])), theme.color.background.primary, theme.color.background.neutralBase, theme.color.background.primary, disabled
38
- ? css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n cursor: default;\n path {\n stroke: ", ";\n fill: ", ";\n }\n rect {\n fill: ", ";\n }\n "], ["\n cursor: default;\n path {\n stroke: ", ";\n fill: ", ";\n }\n rect {\n fill: ", ";\n }\n "])), theme.color.background.primaryDisabled, theme.color.background.neutralAlt, theme.color.background.primaryDisabled) : css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n input[type=\"radio\"]:hover + & {\n path {\n stroke: ", ";\n }\n rect {\n fill: ", ";\n }\n }\n "], ["\n input[type=\"radio\"]:hover + & {\n path {\n stroke: ", ";\n }\n rect {\n fill: ", ";\n }\n }\n "])), theme.color.background.primaryActive, theme.color.background.primaryActive)),
39
- }[type];
40
- };
41
- /**
42
- * [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=420-3704&t=lvpbJKdtz7Lb8wIQ-0)
43
- */
44
- var RadioInput = React.forwardRef(function (props, ref) {
45
- var className = props.className, checked = props.checked, label = props.label, spacer = props.spacer, disabled = props.disabled, onChange = props.onChange, inputProps = props.inputProps, other = __rest(props, ["className", "checked", "label", "spacer", "disabled", "onChange", "inputProps"]);
46
- if (!label) {
47
- return _jsx(RadioButton, __assign({}, props, { ref: ref }));
48
- }
49
- var radioProps = {
50
- checked: checked,
51
- spacer: spacer,
52
- disabled: disabled,
53
- onChange: onChange,
54
- inputProps: inputProps,
55
- };
56
- return (_jsxs(Label, __assign({ className: className, ref: ref }, other, { children: [_jsx(RadioButton, __assign({}, radioProps)), _jsx("span", __assign({ css: css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n margin-left: 8px;\n "], ["\n margin-left: 8px;\n "]))) }, { children: label }))] })));
57
- });
58
- var RadioButton = React.forwardRef(function (props, ref) {
59
- var className = props.className, checked = props.checked, label = props.label, _a = props.spacer, spacer = _a === void 0 ? false : _a, _b = props.disabled, disabled = _b === void 0 ? false : _b, onChange = props.onChange, inputProps = props.inputProps, other = __rest(props, ["className", "checked", "label", "spacer", "disabled", "onChange", "inputProps"]);
60
- var type = props.checked ? "selected" : "default";
61
- return (_jsxs(RadioButtonContainer, __assign({ className: className, spacer: spacer, ref: ref }, other, { children: [_jsx(StyledInput, __assign({ type: "radio" }, inputProps, { checked: checked, disabled: disabled, onChange: onChange })), _jsx(RadioButtonIcon, { type: type, disabled: disabled })] })));
62
- });
63
- var Label = styled.label(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n display: flex;\n position: relative;\n width: fit-content;\n font-size: 14px;\n font-weight: 500;\n line-height: 16px;\n color: ", ";\n align-self: center;\n"], ["\n display: flex;\n position: relative;\n width: fit-content;\n font-size: 14px;\n font-weight: 500;\n line-height: 16px;\n color: ", ";\n align-self: center;\n"])), function (_a) {
64
- var theme = _a.theme;
65
- return theme.color.foreground.neutralBase;
66
- });
67
- var RadioButtonContainer = styled.span(function (_a) {
68
- var spacer = _a.spacer;
69
- return css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n display: inline-flex;\n position: relative;\n width: 16px;\n height: 16px;\n cursor: pointer;\n margin-bottom: ", ";\n "], ["\n display: inline-flex;\n position: relative;\n width: 16px;\n height: 16px;\n cursor: pointer;\n margin-bottom: ", ";\n "])), spacer ? "8px" : "0");
70
- });
71
- var StyledInput = styled.input(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n cursor: inherit;\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n width: 16px;\n height: 16px;\n margin: 0;\n padding: 0;\n // input \uCEF4\uD3EC\uB10C\uD2B8\uB294 \uBCF4\uC774\uC9C0 \uC54A\uC9C0\uB9CC, \uD074\uB9AD\uC774 \uAC00\uB2A5\uD558\uAC8C z-index\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n z-index: ", ";\n"], ["\n cursor: inherit;\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n width: 16px;\n height: 16px;\n margin: 0;\n padding: 0;\n // input \uCEF4\uD3EC\uB10C\uD2B8\uB294 \uBCF4\uC774\uC9C0 \uC54A\uC9C0\uB9CC, \uD074\uB9AD\uC774 \uAC00\uB2A5\uD558\uAC8C z-index\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n z-index: ", ";\n"])), ZINDEX.inputBase);
72
- // default와 selected 구조가 유사하여 하나의 컴포넌트로 표현합니다.
73
- var RadioButtonIcon = function (props) {
74
- var theme = useTheme();
75
- return (_jsxs("svg", __assign({ width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", css: TYPE_TO_ICON_STYLE(theme, props.type, props.disabled) }, { children: [_jsx("path", { d: "M0.5 8C0.5 3.85786 3.85786 0.5 8 0.5C12.1421 0.5 15.5 3.85786 15.5 8C15.5 12.1421 12.1421 15.5 8 15.5C3.85786 15.5 0.5 12.1421 0.5 8Z", fill: "currentColor", stroke: "currentColor" }), props.type === "selected" && (_jsx("rect", { x: "4", y: "4", width: "8", height: "8", rx: "4", fill: "currentColor" }))] })));
76
- };
77
- export default RadioInput;
78
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10;
@@ -1,26 +0,0 @@
1
- import React from "react";
2
- export type SquareButtonColor = "danger" | "primary" | "secondary" | "icon";
3
- export type SquareButtonSize = "large" | "medium" | "small" | "xsmall";
4
- export interface SquareButtonProps {
5
- className?: string;
6
- component?: React.ElementType;
7
- /** 비활성화 여부 */
8
- disabled?: boolean;
9
- /** 컴포넌트 색상 */
10
- color: SquareButtonColor;
11
- /** 컴포넌트 크기 */
12
- size: SquareButtonSize;
13
- /** 컴포넌트 내 표기될 아이콘 */
14
- icon: React.ReactNode;
15
- /** 컴포넌트 하단에 표기될 문자열 */
16
- label?: string;
17
- /** 전체 너비 유무 */
18
- fullWidth?: boolean;
19
- /** 버튼 클릭 시 호출될 콜백 함수 */
20
- onClick?: () => void;
21
- }
22
- /**
23
- * [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=22-374&t=kTLv3t86qtGalHSS-0)
24
- */
25
- declare const SquareButton: React.ForwardRefExoticComponent<SquareButtonProps & React.RefAttributes<any>>;
26
- export default SquareButton;
@@ -1,80 +0,0 @@
1
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
- return cooked;
4
- };
5
- var __assign = (this && this.__assign) || function () {
6
- __assign = Object.assign || function(t) {
7
- for (var s, i = 1, n = arguments.length; i < n; i++) {
8
- s = arguments[i];
9
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10
- t[p] = s[p];
11
- }
12
- return t;
13
- };
14
- return __assign.apply(this, arguments);
15
- };
16
- var __rest = (this && this.__rest) || function (s, e) {
17
- var t = {};
18
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
19
- t[p] = s[p];
20
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
21
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
22
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
23
- t[p[i]] = s[p[i]];
24
- }
25
- return t;
26
- };
27
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
28
- /** @jsxImportSource @emotion/react */
29
- import { css } from "@emotion/react";
30
- import styled from "@emotion/styled";
31
- import React from "react";
32
- import { HOVER } from "../utils/hover";
33
- var COLOR_TO_BUTTON_STYLE = function (theme, color) {
34
- return ({
35
- danger: css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border: none;\n background: ", ";\n color: ", ";\n\n ", "\n &:disabled {\n background: ", ";\n }\n "], ["\n border: none;\n background: ", ";\n color: ", ";\n\n ", "\n &:disabled {\n background: ", ";\n }\n "])), theme.color.background.danger, theme.color.foreground.neutralAlt, HOVER(css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background: ", ";\n "], ["\n background: ", ";\n "])), theme.color.background.dangerActive)), theme.color.background.dangerDisabled),
36
- secondary: css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n background: ", ";\n border: none;\n color: ", ";\n\n ", "\n &:disabled {\n background: ", ";\n color: ", ";\n }\n "], ["\n background: ", ";\n border: none;\n color: ", ";\n\n ", "\n &:disabled {\n background: ", ";\n color: ", ";\n }\n "])), theme.color.background.neutralAlt, theme.color.foreground.neutralBase, HOVER(css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n background: ", ";\n color: ", ";\n "], ["\n background: ", ";\n color: ", ";\n "])), theme.color.background.neutralAltActive, theme.color.foreground.neutralBase)), theme.color.background.neutralAlt, theme.color.foreground.neutralBaseDisabled),
37
- primary: css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n background: ", ";\n border: none;\n color: ", ";\n\n ", "\n &:disabled {\n background: ", ";\n }\n "], ["\n background: ", ";\n border: none;\n color: ", ";\n\n ", "\n &:disabled {\n background: ", ";\n }\n "])), theme.color.background.primary, theme.color.foreground.neutralAlt, HOVER(css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background: ", ";\n "], ["\n background: ", ";\n "])), theme.color.background.primaryActive)), theme.color.background.primaryDisabled),
38
- icon: css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n background: none;\n border: none;\n color: ", ";\n\n ", "\n &:disabled {\n background: none;\n color: ", ";\n }\n "], ["\n background: none;\n border: none;\n color: ", ";\n\n ", "\n &:disabled {\n background: none;\n color: ", ";\n }\n "])), theme.color.foreground.neutralBase, HOVER(css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n background: ", ";\n color: ", ";\n "], ["\n background: ", ";\n color: ", ";\n "])), theme.color.background.neutralAltActive, theme.color.foreground.neutralBase)), theme.color.foreground.neutralBaseDisabled),
39
- }[color]);
40
- };
41
- var SIZE_TO_BUTTON_STYLE = {
42
- large: css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n width: 56px;\n height: 56px;\n padding: 16px;\n\n svg {\n width: 24px;\n height: 24px;\n }\n "], ["\n width: 56px;\n height: 56px;\n padding: 16px;\n\n svg {\n width: 24px;\n height: 24px;\n }\n "]))),
43
- medium: css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n width: 48px;\n height: 48px;\n padding: 14px;\n\n svg {\n width: 20px;\n height: 20px;\n }\n "], ["\n width: 48px;\n height: 48px;\n padding: 14px;\n\n svg {\n width: 20px;\n height: 20px;\n }\n "]))),
44
- small: css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n width: 36px;\n height: 36px;\n padding: 10px;\n\n svg {\n width: 16px;\n height: 16px;\n }\n "], ["\n width: 36px;\n height: 36px;\n padding: 10px;\n\n svg {\n width: 16px;\n height: 16px;\n }\n "]))),
45
- xsmall: css(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n width: 24px;\n height: 24px;\n padding: 6px;\n\n svg {\n width: 12px;\n height: 12px;\n }\n "], ["\n width: 24px;\n height: 24px;\n padding: 6px;\n\n svg {\n width: 12px;\n height: 12px;\n }\n "]))),
46
- };
47
- var SIZE_TO_LABEL_STYLE = {
48
- large: css(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n font-size: 18px;\n line-height: 28px;\n "], ["\n font-size: 18px;\n line-height: 28px;\n "]))),
49
- medium: css(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n font-size: 18px;\n line-height: 28px;\n "], ["\n font-size: 18px;\n line-height: 28px;\n "]))),
50
- small: css(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n font-size: 18px;\n line-height: 28px;\n "], ["\n font-size: 18px;\n line-height: 28px;\n "]))),
51
- xsmall: css(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n font-size: 14px;\n line-height: 22px;\n "], ["\n font-size: 14px;\n line-height: 22px;\n "]))),
52
- };
53
- /**
54
- * [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=22-374&t=kTLv3t86qtGalHSS-0)
55
- */
56
- var SquareButton = React.forwardRef(function (props, ref) {
57
- var className = props.className, _a = props.component, Component = _a === void 0 ? "span" : _a, disabled = props.disabled, color = props.color, size = props.size, icon = props.icon, label = props.label, fullWidth = props.fullWidth, onClick = props.onClick, other = __rest(props, ["className", "component", "disabled", "color", "size", "icon", "label", "fullWidth", "onClick"]);
58
- return (_jsxs(Component, __assign({}, other, { ref: ref, className: className, css: css(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 8px;\n\n width: ", ";\n "], ["\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 8px;\n\n width: ", ";\n "])), fullWidth ? "100%" : "fit-content") }, { children: [_jsx(Button, __assign({ color: color, size: size, disabled: disabled, fullWidth: fullWidth, onClick: onClick }, { children: icon })), label && (_jsx(Label, __assign({ disabled: disabled, size: size }, { children: label })))] })));
59
- });
60
- var Button = styled.button(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n border-radius: 8px;\n cursor: pointer;\n &:disabled {\n cursor: default;\n }\n ", "\n ", "\n ", "\n"], ["\n border-radius: 8px;\n cursor: pointer;\n &:disabled {\n cursor: default;\n }\n ", "\n ", "\n ", "\n"])), function (_a) {
61
- var theme = _a.theme, color = _a.color;
62
- return COLOR_TO_BUTTON_STYLE(theme, color);
63
- }, function (_a) {
64
- var size = _a.size;
65
- return SIZE_TO_BUTTON_STYLE[size];
66
- }, function (_a) {
67
- var fullWidth = _a.fullWidth;
68
- return fullWidth && "width: 100%;";
69
- });
70
- var Label = styled.span(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n font-weight: 400;\n color: ", ";\n ", "\n"], ["\n font-weight: 400;\n color: ", ";\n ", "\n"])), function (_a) {
71
- var theme = _a.theme, disabled = _a.disabled;
72
- return disabled
73
- ? theme.color.foreground.neutralBaseDisabled
74
- : theme.color.foreground.neutralBase;
75
- }, function (_a) {
76
- var size = _a.size;
77
- return SIZE_TO_LABEL_STYLE[size];
78
- });
79
- export default SquareButton;
80
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19;
@@ -1,19 +0,0 @@
1
- import React from "react";
2
- export type SwitchSize = "small" | "large";
3
- export interface SwitchProps {
4
- className?: string;
5
- /** 스위치 체크 상태 여부 */
6
- checked: boolean;
7
- /** 스위치 활성화 여부
8
- * @default false */
9
- disabled?: boolean;
10
- /** 스위치 크기 */
11
- size: SwitchSize;
12
- /** 스위치 상태 변경 시 호출될 콜백 함수 */
13
- onChange?: (event: React.ChangeEvent<HTMLInputElement>, checked: boolean) => void;
14
- }
15
- /**
16
- * [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=36-1577&t=9sDLb4XIOdmF2VMc-0)
17
- */
18
- declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<any>>;
19
- export default Switch;
@@ -1,59 +0,0 @@
1
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
- return cooked;
4
- };
5
- var __assign = (this && this.__assign) || function () {
6
- __assign = Object.assign || function(t) {
7
- for (var s, i = 1, n = arguments.length; i < n; i++) {
8
- s = arguments[i];
9
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10
- t[p] = s[p];
11
- }
12
- return t;
13
- };
14
- return __assign.apply(this, arguments);
15
- };
16
- var __rest = (this && this.__rest) || function (s, e) {
17
- var t = {};
18
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
19
- t[p] = s[p];
20
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
21
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
22
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
23
- t[p[i]] = s[p[i]];
24
- }
25
- return t;
26
- };
27
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
28
- /** @jsxImportSource @emotion/react */
29
- import styled from "@emotion/styled";
30
- import React from "react";
31
- import { Switch as MuiSwitch } from "@mui/material";
32
- import { css } from "@emotion/react";
33
- /**
34
- * [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=36-1577&t=9sDLb4XIOdmF2VMc-0)
35
- */
36
- var Switch = React.forwardRef(function (props, ref) {
37
- var className = props.className, checked = props.checked, _a = props.disabled, disabled = _a === void 0 ? false : _a, size = props.size, onChange = props.onChange, other = __rest(props, ["className", "checked", "disabled", "size", "onChange"]);
38
- return (_jsx(StyledSwitch, __assign({}, other, { ref: ref, className: className, checked: checked, disabled: disabled, onChange: onChange, switchSize: size })));
39
- });
40
- var SIZE_TO_SWTICH_SIZE = {
41
- large: {
42
- width: "44px",
43
- height: "22px",
44
- translateX: "22px",
45
- thumbSize: "18px",
46
- },
47
- small: {
48
- width: "28px",
49
- height: "16px",
50
- translateX: "12px",
51
- thumbSize: "12px",
52
- },
53
- };
54
- var StyledSwitch = styled(MuiSwitch)(function (_a) {
55
- var theme = _a.theme, switchSize = _a.switchSize;
56
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: ", ";\n height: ", ";\n padding: 0; // \uAE30\uC874 Mui padding \uC18D\uC131 override\n & .MuiSwitch-switchBase {\n padding: 2px;\n &.Mui-checked {\n transform: translateX(", ");\n color: ", ";\n & + .MuiSwitch-track {\n opacity: 1;\n background-color: ", ";\n }\n &.Mui-disabled + .MuiSwitch-track {\n opacity: 1;\n background-color: ", ";\n }\n }\n &.Mui-disabled + .MuiSwitch-track {\n opacity: 1;\n background-color: ", ";\n }\n &:hover {\n background-color: inherit; // \uAE30\uC874 Mui hover \uC18D\uC131 override\n }\n }\n .Mui-disabled .MuiSwitch-thumb {\n filter: none;\n box-shadow: none;\n background-color: ", ";\n }\n\n .MuiSwitch-thumb {\n box-shadow: none;\n filter: drop-shadow(0px 2px 4px rgba(0, 35, 11, 0.2));\n width: ", ";\n height: ", ";\n border-radius: 77px;\n transition: width 300ms;\n }\n .MuiSwitch-track {\n border-radius: 16px;\n opacity: 1;\n background-color: ", ";\n box-sizing: border-box;\n }\n "], ["\n width: ", ";\n height: ", ";\n padding: 0; // \uAE30\uC874 Mui padding \uC18D\uC131 override\n & .MuiSwitch-switchBase {\n padding: 2px;\n &.Mui-checked {\n transform: translateX(", ");\n color: ", ";\n & + .MuiSwitch-track {\n opacity: 1;\n background-color: ", ";\n }\n &.Mui-disabled + .MuiSwitch-track {\n opacity: 1;\n background-color: ", ";\n }\n }\n &.Mui-disabled + .MuiSwitch-track {\n opacity: 1;\n background-color: ", ";\n }\n &:hover {\n background-color: inherit; // \uAE30\uC874 Mui hover \uC18D\uC131 override\n }\n }\n .Mui-disabled .MuiSwitch-thumb {\n filter: none;\n box-shadow: none;\n background-color: ", ";\n }\n\n .MuiSwitch-thumb {\n box-shadow: none;\n filter: drop-shadow(0px 2px 4px rgba(0, 35, 11, 0.2));\n width: ", ";\n height: ", ";\n border-radius: 77px;\n transition: width 300ms;\n }\n .MuiSwitch-track {\n border-radius: 16px;\n opacity: 1;\n background-color: ", ";\n box-sizing: border-box;\n }\n "])), SIZE_TO_SWTICH_SIZE[switchSize].width, SIZE_TO_SWTICH_SIZE[switchSize].height, SIZE_TO_SWTICH_SIZE[switchSize].translateX, theme.color.foreground.neutralAlt, theme.color.background.primary, theme.color.background.primaryDisabled, theme.color.background.neutralAltDisabled, theme.color.foreground.neutralAltDisabled, SIZE_TO_SWTICH_SIZE[switchSize].thumbSize, SIZE_TO_SWTICH_SIZE[switchSize].thumbSize, theme.color.background.neutralAltActive);
57
- });
58
- export default Switch;
59
- var templateObject_1;
@@ -1,21 +0,0 @@
1
- import React from "react";
2
- export type TagColor = "default" | "red" | "teal" | "orange" | "blue" | "green" | "yellow" | "black";
3
- export interface TagProps {
4
- className?: string;
5
- component?: React.ElementType;
6
- /** 컴포넌트 내 표기될 문자열 */
7
- label: string;
8
- /** 컴포넌트 좌측에 표기될 아이콘 */
9
- icon?: React.ReactNode;
10
- /** 컴포넌트의 색상 */
11
- color?: TagColor;
12
- /** 컴포넌트 우측에 표기될 닫기 버튼 유무 */
13
- close: boolean;
14
- /** 닫기 버튼 클릭 시 호출될 콜백 함수 */
15
- onClick?: () => void;
16
- }
17
- /**
18
- * [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=42-869&t=HZXCHP0r0tbvMA6v-0)
19
- */
20
- declare const Tag: React.ForwardRefExoticComponent<TagProps & React.RefAttributes<any>>;
21
- export default Tag;
@@ -1,61 +0,0 @@
1
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
- return cooked;
4
- };
5
- var __assign = (this && this.__assign) || function () {
6
- __assign = Object.assign || function(t) {
7
- for (var s, i = 1, n = arguments.length; i < n; i++) {
8
- s = arguments[i];
9
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10
- t[p] = s[p];
11
- }
12
- return t;
13
- };
14
- return __assign.apply(this, arguments);
15
- };
16
- var __rest = (this && this.__rest) || function (s, e) {
17
- var t = {};
18
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
19
- t[p] = s[p];
20
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
21
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
22
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
23
- t[p[i]] = s[p[i]];
24
- }
25
- return t;
26
- };
27
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
28
- /** @jsxImportSource @emotion/react */
29
- import { css } from "@emotion/react";
30
- import styled from "@emotion/styled";
31
- import React from "react";
32
- import { CloseFillIcon } from "../icons/system";
33
- import { useTheme } from "@emotion/react";
34
- var COLOR_TO_STYLE = function (theme, color) {
35
- return ({
36
- default: css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n box-sizing: border-box;\n background: ", ";\n border: 1px solid ", ";\n color: ", ";\n "], ["\n box-sizing: border-box;\n background: ", ";\n border: 1px solid ", ";\n color: ", ";\n "])), theme.color.container.marbleContainer, theme.color.container.marbleOnContainer, theme.color.container.marbleOnContainer),
37
- red: css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n box-sizing: border-box;\n background: ", ";\n border: 1px solid ", ";\n color: ", ";\n "], ["\n box-sizing: border-box;\n background: ", ";\n border: 1px solid ", ";\n color: ", ";\n "])), theme.color.container.dangerContainer, theme.color.container.dangerOnContainer, theme.color.container.dangerOnContainer),
38
- teal: css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n box-sizing: border-box;\n background: ", ";\n border: 1px solid ", ";\n color: ", ";\n "], ["\n box-sizing: border-box;\n background: ", ";\n border: 1px solid ", ";\n color: ", ";\n "])), theme.color.container.infoContainer, theme.color.container.infoOnContainer, theme.color.container.infoOnContainer),
39
- orange: css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n box-sizing: border-box;\n background: ", ";\n border: 1px solid ", ";\n color: ", ";\n "], ["\n box-sizing: border-box;\n background: ", ";\n border: 1px solid ", ";\n color: ", ";\n "])), theme.color.container.secondaryContainer, theme.color.container.secondaryOnContainer, theme.color.container.secondaryOnContainer),
40
- blue: css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n box-sizing: border-box;\n background: ", ";\n border: 1px solid ", ";\n color: ", ";\n "], ["\n box-sizing: border-box;\n background: ", ";\n border: 1px solid ", ";\n color: ", ";\n "])), theme.color.container.primaryContainer, theme.color.container.primaryOnContainer, theme.color.container.primaryOnContainer),
41
- green: css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n box-sizing: border-box;\n background: ", ";\n border: 1px solid ", ";\n color: ", ";\n "], ["\n box-sizing: border-box;\n background: ", ";\n border: 1px solid ", ";\n color: ", ";\n "])), theme.color.container.successContainer, theme.color.container.successOnContainer, theme.color.container.successOnContainer),
42
- yellow: css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n box-sizing: border-box;\n background: ", ";\n border: 1px solid ", ";\n color: ", ";\n "], ["\n box-sizing: border-box;\n background: ", ";\n border: 1px solid ", ";\n color: ", ";\n "])), theme.color.container.warningContainer, theme.color.container.warningOnContainer, theme.color.container.warningOnContainer),
43
- black: css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n background: ", ";\n color: ", ";\n "], ["\n background: ", ";\n color: ", ";\n "])), theme.color.container.obsidianContainer, theme.color.container.obsidianOnContainer),
44
- }[color]);
45
- };
46
- /**
47
- * [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=42-869&t=HZXCHP0r0tbvMA6v-0)
48
- */
49
- var Tag = React.forwardRef(function (props, ref) {
50
- var className = props.className, _a = props.component, Component = _a === void 0 ? "span" : _a, label = props.label, icon = props.icon, _b = props.color, color = _b === void 0 ? "default" : _b, close = props.close, onClick = props.onClick, other = __rest(props, ["className", "component", "label", "icon", "color", "close", "onClick"]);
51
- var theme = useTheme();
52
- return (_jsxs(Component, __assign({}, other, { ref: ref, className: className, css: [
53
- css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n box-sizing: border-box;\n display: flex;\n // flex\uAC00 \uD654\uBA74 \uC804\uCCB4\uB85C \uD655\uC7A5\uB418\uC9C0 \uC54A\uACE0 \uB0B4\uBD80\uC758 \uC544\uC774\uCF58\uACFC \uD14D\uC2A4\uD2B8\uB9CC \uD3EC\uD568\uD55C\uB2E4.\n padding: 1px 8px;\n align-items: center;\n gap: 3px;\n width: fit-content;\n border-radius: 8px;\n\n svg {\n width: 14px;\n height: 14px;\n }\n "], ["\n box-sizing: border-box;\n display: flex;\n // flex\uAC00 \uD654\uBA74 \uC804\uCCB4\uB85C \uD655\uC7A5\uB418\uC9C0 \uC54A\uACE0 \uB0B4\uBD80\uC758 \uC544\uC774\uCF58\uACFC \uD14D\uC2A4\uD2B8\uB9CC \uD3EC\uD568\uD55C\uB2E4.\n padding: 1px 8px;\n align-items: center;\n gap: 3px;\n width: fit-content;\n border-radius: 8px;\n\n svg {\n width: 14px;\n height: 14px;\n }\n "]))),
54
- COLOR_TO_STYLE(theme, color),
55
- close
56
- ? css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n cursor: pointer;\n "], ["\n cursor: pointer;\n "]))) : undefined,
57
- ], onClick: onClick }, { children: [icon, _jsx("span", __assign({ css: css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n font-weight: 400;\n font-size: 12px;\n line-height: 20px;\n "], ["\n font-weight: 400;\n font-size: 12px;\n line-height: 20px;\n "]))) }, { children: label })), close && _jsx(StyledCloseFillIcon, {})] })));
58
- });
59
- var StyledCloseFillIcon = styled(CloseFillIcon)(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n width: 10px;\n height: 10px;\n"], ["\n width: 10px;\n height: 10px;\n"])));
60
- export default Tag;
61
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12;
@@ -1,26 +0,0 @@
1
- import React from "react";
2
- export interface TooltipProps {
3
- className?: string;
4
- /** 툴팁에 표시될 제목 텍스트 */
5
- title?: string;
6
- /** 툴팁에 표시될 text 영역 값 */
7
- text: React.ReactNode;
8
- /** `true` 값일때 Tooltip을 오픈합니다. */
9
- open?: boolean;
10
- /** Tooltip이 오픈될 때 호출되는 함수. */
11
- onOpen?: (event: React.SyntheticEvent) => void;
12
- /** Tooltip이 닫힐 때 호출되는 함수. */
13
- onClose?: (event: React.SyntheticEvent | Event) => void;
14
- /**
15
- * Tooltip placement.
16
- * @default bottom
17
- */
18
- placement?: "bottom-end" | "bottom-start" | "bottom" | "left-end" | "left-start" | "left" | "right-end" | "right-start" | "right" | "top-end" | "top-start" | "top";
19
- /** 툴팁을 표시할 객체입니다. ref를 props로 받을 수 있어야합니다. */
20
- children: React.ReactElement<any, any>;
21
- }
22
- /**
23
- * [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=172-626&t=aFkKTFgWq2xFFGC5-0)
24
- */
25
- declare const Tooltip: React.ForwardRefExoticComponent<TooltipProps & React.RefAttributes<any>>;
26
- export default Tooltip;