@team-monolith/cds 1.109.2 → 1.110.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 (45) hide show
  1. package/dist/components/AlertDialog/AlertDialog.d.ts +4 -0
  2. package/dist/components/AlertDialog/AlertDialog.js +8 -2
  3. package/dist/components/AlertDialog/AlertDialogActions.d.ts +3 -0
  4. package/dist/components/AlertDialog/AlertDialogActions.js +4 -1
  5. package/dist/components/AlertDialog/AlertDialogContent.d.ts +3 -0
  6. package/dist/components/AlertDialog/AlertDialogContent.js +4 -1
  7. package/dist/components/AlertDialog/AlertDialogTitle.d.ts +6 -0
  8. package/dist/components/AlertDialog/AlertDialogTitle.js +12 -4
  9. package/dist/components/AnimatedButton.d.ts +3 -0
  10. package/dist/components/AnimatedButton.js +7 -13
  11. package/dist/components/Banner.d.ts +1 -0
  12. package/dist/components/Banner.js +2 -1
  13. package/dist/components/Book/Book.d.ts +9 -0
  14. package/dist/components/Book/Book.js +16 -7
  15. package/dist/components/Button.d.ts +4 -0
  16. package/dist/components/Button.js +6 -2
  17. package/dist/components/CheckboxInput.d.ts +5 -0
  18. package/dist/components/CheckboxInput.js +8 -1
  19. package/dist/components/FileTypeAlertDialog.d.ts +7 -0
  20. package/dist/components/FileTypeAlertDialog.js +10 -4
  21. package/dist/components/Input.d.ts +5 -0
  22. package/dist/components/Input.js +6 -1
  23. package/dist/components/InputBase.d.ts +6 -0
  24. package/dist/components/InputBase.js +7 -1
  25. package/dist/components/OverflowTooltip.d.ts +4 -0
  26. package/dist/components/OverflowTooltip.js +17 -1
  27. package/dist/components/Pagination.d.ts +3 -0
  28. package/dist/components/Pagination.js +16 -1
  29. package/dist/components/PinInput.d.ts +7 -0
  30. package/dist/components/PinInput.js +9 -2
  31. package/dist/components/Popover.d.ts +7 -0
  32. package/dist/components/Popover.js +8 -1
  33. package/dist/components/RadioInput.d.ts +5 -0
  34. package/dist/components/RadioInput.js +6 -1
  35. package/dist/components/SquareButton.d.ts +3 -0
  36. package/dist/components/SquareButton.js +6 -1
  37. package/dist/components/Switch.d.ts +3 -0
  38. package/dist/components/Switch.js +4 -1
  39. package/dist/components/SwitchButton.d.ts +4 -0
  40. package/dist/components/SwitchButton.js +8 -2
  41. package/dist/components/Tag.d.ts +5 -0
  42. package/dist/components/Tag.js +8 -3
  43. package/dist/components/Tooltip.d.ts +4 -0
  44. package/dist/components/Tooltip.js +7 -3
  45. package/package.json +1 -1
@@ -1,5 +1,9 @@
1
1
  import React from "react";
2
2
  import { PolymorphicProps } from "@mui/base";
3
+ export declare const alertDialogClasses: {
4
+ readonly root: "AlertDialog";
5
+ readonly icon: "AlertDialog-icon";
6
+ };
3
7
  export interface AlertDialogOwnProps<RootComponentType extends React.ElementType> {
4
8
  className?: string;
5
9
  component?: RootComponentType;
@@ -19,13 +19,19 @@ import { MOBILE } from "../../foundation/breakpoints";
19
19
  import { AlertDialogContext } from "./AlertDialogContext";
20
20
  import { ZINDEX } from "../../utils/zIndex";
21
21
  import { Modal } from "../..";
22
+ export const alertDialogClasses = {
23
+ root: "AlertDialog",
24
+ icon: "AlertDialog-icon",
25
+ };
22
26
  export const AlertDialog = React.forwardRef(function AlertDialog(props, ref) {
23
27
  const { className, component: Component = "div", open, onClose, children, icon, disableIconPadding, zIndex } = props, other = __rest(props, ["className", "component", "open", "onClose", "children", "icon", "disableIconPadding", "zIndex"]);
24
28
  const theme = useTheme();
25
29
  const paddingAreaName = disableIconPadding ? "content" : "iconPadding";
26
30
  return (_jsx(Modal, Object.assign({ open: open, onClose: onClose, ref: ref, sx: {
27
31
  zIndex: zIndex !== null && zIndex !== void 0 ? zIndex : ZINDEX.ALERT,
28
- } }, other, { children: _jsxs(Component, { className: className, css: css `
32
+ } }, other, { children: _jsxs(Component, { className: [alertDialogClasses.root, className]
33
+ .filter(Boolean)
34
+ .join(" "), css: css `
29
35
  width: 480px;
30
36
  max-height: calc(100% - 48px);
31
37
  background: ${theme.color.background.neutralBase};
@@ -65,7 +71,7 @@ export const AlertDialog = React.forwardRef(function AlertDialog(props, ref) {
65
71
  "content"
66
72
  "actions";
67
73
  `)}
68
- `, children: [icon && _jsx(IconDiv, { children: icon }), _jsx(AlertDialogContext.Provider, { value: { icon }, children: children })] }) })));
74
+ `, children: [icon && (_jsx(IconDiv, { className: alertDialogClasses.icon, children: icon })), _jsx(AlertDialogContext.Provider, { value: { icon }, children: children })] }) })));
69
75
  });
70
76
  const IconDiv = styled.div `
71
77
  display: flex;
@@ -1,4 +1,7 @@
1
1
  import React from "react";
2
+ export declare const alertDialogActionsClasses: {
3
+ readonly root: "AlertDialogActions";
4
+ };
2
5
  export interface AlertDialogActionsProps {
3
6
  className?: string;
4
7
  component?: React.ElementType;
@@ -13,9 +13,12 @@ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
13
13
  /** @jsxImportSource @emotion/react */
14
14
  import { css } from "@emotion/react";
15
15
  import React from "react";
16
+ export const alertDialogActionsClasses = {
17
+ root: "AlertDialogActions",
18
+ };
16
19
  export const AlertDialogActions = React.forwardRef(function AlertDialogActions(props, ref) {
17
20
  const { className, component: Component = "div", children } = props, other = __rest(props, ["className", "component", "children"]);
18
- return (_jsx(Component, Object.assign({}, other, { ref: ref, className: className, css: css `
21
+ return (_jsx(Component, Object.assign({}, other, { ref: ref, className: [alertDialogActionsClasses.root, className].filter(Boolean).join(" "), css: css `
19
22
  grid-area: actions;
20
23
 
21
24
  margin-top: 8px;
@@ -1,4 +1,7 @@
1
1
  import React from "react";
2
+ export declare const alertDialogContentClasses: {
3
+ readonly root: "AlertDialogContent";
4
+ };
2
5
  export interface AlertDialogContentProps {
3
6
  className?: string;
4
7
  component?: React.ElementType;
@@ -13,10 +13,13 @@ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
13
13
  /** @jsxImportSource @emotion/react */
14
14
  import { css, useTheme } from "@emotion/react";
15
15
  import React from "react";
16
+ export const alertDialogContentClasses = {
17
+ root: "AlertDialogContent",
18
+ };
16
19
  export const AlertDialogContent = React.forwardRef(function AlertDialogContent(props, ref) {
17
20
  const { className, component: Component = "div", children } = props, other = __rest(props, ["className", "component", "children"]);
18
21
  const theme = useTheme();
19
- return (_jsx(Component, Object.assign({}, other, { ref: ref, className: className, css: css `
22
+ return (_jsx(Component, Object.assign({}, other, { ref: ref, className: [alertDialogContentClasses.root, className].filter(Boolean).join(" "), css: css `
20
23
  grid-area: content;
21
24
 
22
25
  font-style: normal;
@@ -1,4 +1,10 @@
1
1
  import React from "react";
2
+ export declare const alertDialogTitleClasses: {
3
+ readonly root: "AlertDialogTitle";
4
+ readonly content: "AlertDialogTitle-content";
5
+ readonly icon: "AlertDialogTitle-icon";
6
+ readonly closeButton: "AlertDialogTitle-closeButton";
7
+ };
2
8
  export interface AlertDialogTitleProps {
3
9
  className?: string;
4
10
  component?: React.ElementType;
@@ -17,11 +17,19 @@ import { SquareButton } from "../SquareButton";
17
17
  import { CloseFillIcon } from "../../icons";
18
18
  import { AlertDialogContext } from "./AlertDialogContext";
19
19
  import { MOBILE } from "../../foundation/breakpoints";
20
+ export const alertDialogTitleClasses = {
21
+ root: "AlertDialogTitle",
22
+ content: "AlertDialogTitle-content",
23
+ icon: "AlertDialogTitle-icon",
24
+ closeButton: "AlertDialogTitle-closeButton",
25
+ };
20
26
  export const AlertDialogTitle = React.forwardRef(function AlertDialogTitle(props, ref) {
21
27
  const { className, component: Component = "div", onClose, children } = props, other = __rest(props, ["className", "component", "onClose", "children"]);
22
28
  const { icon } = React.useContext(AlertDialogContext);
23
29
  const theme = useTheme();
24
- return (_jsx(_Fragment, { children: _jsxs(Component, Object.assign({}, other, { ref: ref, className: className, css: css `
30
+ return (_jsx(_Fragment, { children: _jsxs(Component, Object.assign({}, other, { ref: ref, className: [alertDialogTitleClasses.root, className]
31
+ .filter(Boolean)
32
+ .join(" "), css: css `
25
33
  grid-area: title;
26
34
  font-family: ${theme.fontFamily.ui};
27
35
  font-style: normal;
@@ -35,14 +43,14 @@ export const AlertDialogTitle = React.forwardRef(function AlertDialogTitle(props
35
43
 
36
44
  display: flex;
37
45
  justify-content: space-between;
38
- `, children: [_jsxs("div", { css: css `
46
+ `, children: [_jsxs("div", { className: alertDialogTitleClasses.content, css: css `
39
47
  display: flex;
40
48
  flex-direction: column;
41
49
  justify-content: center;
42
50
  align-items: flex-start;
43
51
  gap: 16px;
44
52
  text-align: left;
45
- `, children: [icon && (_jsx("div", { css: css `
53
+ `, children: [icon && (_jsx("div", { className: alertDialogTitleClasses.icon, css: css `
46
54
  display: none;
47
55
  ${MOBILE(css `
48
56
  display: flex;
@@ -55,5 +63,5 @@ export const AlertDialogTitle = React.forwardRef(function AlertDialogTitle(props
55
63
  height: 32px;
56
64
  }
57
65
  `)}
58
- `, children: icon })), children] }), onClose && (_jsx(SquareButton, { color: "icon", size: "small", icon: _jsx(CloseFillIcon, {}), onClick: onClose, "aria-label": "\uB2EB\uAE30" }))] })) }));
66
+ `, children: icon })), children] }), onClose && (_jsx(SquareButton, { className: alertDialogTitleClasses.closeButton, color: "icon", size: "small", icon: _jsx(CloseFillIcon, {}), onClick: onClose, "aria-label": "\uB2EB\uAE30" }))] })) }));
59
67
  });
@@ -1,5 +1,8 @@
1
1
  import React from "react";
2
2
  import { ButtonColor, ButtonProps } from "..";
3
+ export declare const animatedButtonClasses: {
4
+ readonly root: "AnimatedButton";
5
+ };
3
6
  type BackgroundButtonColor = Exclude<ButtonColor, "textNeutral" | "textDanger" | "textPrimary">;
4
7
  /**
5
8
  * 반짝이는 애니메이션 효과가 적용된 Button 컴포넌트
@@ -1,18 +1,10 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
1
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
13
2
  /** @jsxImportSource @emotion/react */
14
3
  import { css, keyframes, useTheme } from "@emotion/react";
15
4
  import { Button } from "..";
5
+ export const animatedButtonClasses = {
6
+ root: "AnimatedButton",
7
+ };
16
8
  const DARK_BLACK_COLOR = "#202020";
17
9
  const getGradient = (baseColor, activeColor) => css `
18
10
  background-image: repeating-linear-gradient(
@@ -56,9 +48,11 @@ const backgroundSlideAnimation = keyframes `
56
48
  * 반짝이는 애니메이션 효과가 적용된 Button 컴포넌트
57
49
  */
58
50
  export function AnimatedButton(props) {
59
- const { color, loading, disabled } = props, _other = __rest(props, ["color", "loading", "disabled"]);
51
+ const { color, loading, disabled, className } = props;
60
52
  const theme = useTheme();
61
- return (_jsx(Button, Object.assign({}, props, { css: disabled || loading
53
+ return (_jsx(Button, Object.assign({}, props, { className: [animatedButtonClasses.root, className]
54
+ .filter(Boolean)
55
+ .join(" "), css: disabled || loading
62
56
  ? []
63
57
  : [
64
58
  css `
@@ -2,6 +2,7 @@ import React from "react";
2
2
  import { ButtonProps } from "./Button";
3
3
  export type BannerColor = "red" | "blue" | "green" | "yellow" | "white";
4
4
  export declare const bannerClasses: {
5
+ readonly root: "Banner";
5
6
  readonly icon: "Banner-icon";
6
7
  readonly textContainer: "Banner-textContainer";
7
8
  readonly headline: "Banner-textContainer-headline";
@@ -18,6 +18,7 @@ import { CloseFillIcon } from "../icons";
18
18
  import { SquareButton } from "./SquareButton";
19
19
  import { Button } from "./Button";
20
20
  export const bannerClasses = {
21
+ root: "Banner",
21
22
  icon: "Banner-icon",
22
23
  textContainer: "Banner-textContainer",
23
24
  headline: "Banner-textContainer-headline",
@@ -58,7 +59,7 @@ const COLOR_PALETTE = (theme, color) => ({
58
59
  export const Banner = React.forwardRef(function Banner(props, ref) {
59
60
  const { className, component: Component = "div", headline, content, icon, color, buttonLabel, onButtonClick, buttonProps, close, onClose, fullWidth } = props, other = __rest(props, ["className", "component", "headline", "content", "icon", "color", "buttonLabel", "onButtonClick", "buttonProps", "close", "onClose", "fullWidth"]);
60
61
  const theme = useTheme();
61
- return (_jsxs(Component, Object.assign({}, other, { ref: ref, className: className, css: [
62
+ return (_jsxs(Component, Object.assign({}, other, { ref: ref, className: [bannerClasses.root, className].filter(Boolean).join(" "), css: [
62
63
  css `
63
64
  display: flex;
64
65
  align-items: center;
@@ -1,10 +1,19 @@
1
1
  import React from "react";
2
2
  import { TagProps } from "../Tag";
3
3
  export declare const bookClasses: {
4
+ readonly root: "Book";
4
5
  readonly cover: "Book-cover";
6
+ readonly coverTexts: "Book-coverTexts";
7
+ readonly coverTitle: "Book-coverTitle";
8
+ readonly subtitle: "Book-subtitle";
9
+ readonly progress: "Book-progress";
5
10
  readonly progressText: "Book-progressText";
6
11
  readonly progressBase: "Book-progressBase";
7
12
  readonly progressBar: "Book-progressBar";
13
+ readonly buttons: "Book-buttons";
14
+ readonly shelf: "Book-shelf";
15
+ readonly hide: "Book-hide";
16
+ readonly coverIcon: "Book-coverIcon";
8
17
  };
9
18
  export interface ProgressInfo {
10
19
  /** 프로그레스 바 상단에 표시되는 내용. */
@@ -8,10 +8,19 @@ import { EyeOffFillIcon } from "../../icons";
8
8
  import { motion } from "framer-motion";
9
9
  import { Tag } from "../Tag";
10
10
  export const bookClasses = {
11
+ root: "Book",
11
12
  cover: "Book-cover",
13
+ coverTexts: "Book-coverTexts",
14
+ coverTitle: "Book-coverTitle",
15
+ subtitle: "Book-subtitle",
16
+ progress: "Book-progress",
12
17
  progressText: "Book-progressText",
13
18
  progressBase: "Book-progressBase",
14
19
  progressBar: "Book-progressBar",
20
+ buttons: "Book-buttons",
21
+ shelf: "Book-shelf",
22
+ hide: "Book-hide",
23
+ coverIcon: "Book-coverIcon",
15
24
  };
16
25
  // 이 ZINDEX는 Book 컴포넌트 내의 Stacking Context 에서 활용되므로
17
26
  // 다른 글로벌 ZINDEX와 충돌을 고려할 필요가 없습니다.
@@ -83,7 +92,7 @@ export const Book = forwardRef(function Book(props, ref) {
83
92
  const { className, title, subtitle, subtitleBold, isHidden = false, buttons, open: controlledOpen, onHoverStart, onHoverEnd, onCoverClick, icon, progressInfo, tagsProps, } = props;
84
93
  const theme = useTheme();
85
94
  const [open, setOpen] = useState(false);
86
- return (_jsxs(Container, { className: className, initial: "closed", animate: (controlledOpen !== null && controlledOpen !== void 0 ? controlledOpen : open) ? "open" : "closed", ref: ref, onHoverStart: () => {
95
+ return (_jsxs(Container, { className: [bookClasses.root, className].filter(Boolean).join(" "), initial: "closed", animate: (controlledOpen !== null && controlledOpen !== void 0 ? controlledOpen : open) ? "open" : "closed", ref: ref, onHoverStart: () => {
87
96
  setOpen(true);
88
97
  onHoverStart === null || onHoverStart === void 0 ? void 0 : onHoverStart();
89
98
  }, onHoverEnd: () => {
@@ -95,20 +104,20 @@ export const Book = forwardRef(function Book(props, ref) {
95
104
  `, variants: coverMotion, onClick: () => {
96
105
  setOpen(!open);
97
106
  onCoverClick === null || onCoverClick === void 0 ? void 0 : onCoverClick();
98
- }, children: [icon && _jsx(CoverIcon, { children: icon }), isHidden && (_jsxs(_Fragment, { children: [_jsx(Hide, {}), _jsx(EyeOffFillIcon, { color: theme.color.foreground.neutralAlt, css: css `
107
+ }, children: [icon && _jsx(CoverIcon, { className: bookClasses.coverIcon, children: icon }), isHidden && (_jsxs(_Fragment, { children: [_jsx(Hide, { className: bookClasses.hide }), _jsx(EyeOffFillIcon, { color: theme.color.foreground.neutralAlt, css: css `
99
108
  position: absolute;
100
109
  z-index: ${ZINDEX_HIDE};
101
110
  left: 50%;
102
111
  top: 50%;
103
112
  transform: translate(-50%, -50%);
104
113
  opacity: 0.8;
105
- ` })] })), _jsxs(CoverTexts, { variants: buttons ? textMotion : undefined, children: [tagsProps && tagsProps.length > 0 && (_jsx("div", { css: css `
114
+ ` })] })), _jsxs(CoverTexts, { className: bookClasses.coverTexts, variants: buttons ? textMotion : undefined, children: [tagsProps && tagsProps.length > 0 && (_jsx("div", { css: css `
106
115
  display: flex;
107
116
  gap: 4px;
108
117
  flex-wrap: wrap;
109
- `, children: tagsProps.map((tagProps, index) => (_jsx(Tag, Object.assign({}, tagProps), index))) })), _jsx(Subtitle, { children: subtitle }), _jsx(Subtitle, { css: css `
118
+ `, children: tagsProps.map((tagProps, index) => (_jsx(Tag, Object.assign({}, tagProps), index))) })), _jsx(Subtitle, { className: bookClasses.subtitle, children: subtitle }), _jsx(Subtitle, { className: bookClasses.subtitle, css: css `
110
119
  font-weight: 800;
111
- `, children: subtitleBold }), _jsx(CoverTitle, { showProgress: Boolean(progressInfo), children: title }), progressInfo && (_jsxs(Progress, { children: [_jsx("div", { className: bookClasses.progressText, children: progressInfo.title }), _jsxs("div", { css: css `
120
+ `, children: subtitleBold }), _jsx(CoverTitle, { className: bookClasses.coverTitle, showProgress: Boolean(progressInfo), children: title }), progressInfo && (_jsxs(Progress, { className: bookClasses.progress, children: [_jsx("div", { className: bookClasses.progressText, children: progressInfo.title }), _jsxs("div", { css: css `
112
121
  display: flex;
113
122
  justify-content: space-between;
114
123
  align-items: center;
@@ -125,10 +134,10 @@ export const Book = forwardRef(function Book(props, ref) {
125
134
  display: flex;
126
135
  justify-content: center;
127
136
  align-items: center;
128
- `, children: [Math.round(progressInfo.value * 100), "%"] })] })] }))] }), _jsx(BookGradient, {}), _jsx(Buttons, { variants: buttonsMotion, onClick: (e) => {
137
+ `, children: [Math.round(progressInfo.value * 100), "%"] })] })] }))] }), _jsx(BookGradient, {}), _jsx(Buttons, { className: bookClasses.buttons, variants: buttonsMotion, onClick: (e) => {
129
138
  // Button 클릭 시에도 CoverClick 이벤트가 발생하지 않도록 막습니다.
130
139
  e.stopPropagation();
131
- }, children: buttons })] }), _jsx(Shelf, {})] }));
140
+ }, children: buttons })] }), _jsx(Shelf, { className: bookClasses.shelf })] }));
132
141
  });
133
142
  const Container = styled(motion.div) `
134
143
  position: relative;
@@ -2,6 +2,10 @@ import React from "react";
2
2
  import { PolymorphicProps } from "@mui/base";
3
3
  export type ButtonColor = "primary" | "grey" | "danger" | "textNeutral" | "textDanger" | "textPrimary" | "black" | "white";
4
4
  export type ButtonSize = "large" | "medium" | "small" | "xsmall";
5
+ export declare const buttonClasses: {
6
+ readonly root: "Button";
7
+ readonly label: "Button-label";
8
+ };
5
9
  export interface ButtonOwnProps<RootComponentType extends React.ElementType> {
6
10
  className?: string;
7
11
  component?: RootComponentType;
@@ -16,6 +16,10 @@ import styled from "@emotion/styled";
16
16
  import React from "react";
17
17
  import { HOVER } from "../utils/hover";
18
18
  import { Spinner } from "..";
19
+ export const buttonClasses = {
20
+ root: "Button",
21
+ label: "Button-label",
22
+ };
19
23
  const COLOR_TO_BUTTON_STYLE = (theme, color, disabled) => ({
20
24
  primary: css `
21
25
  ${disabled
@@ -212,7 +216,7 @@ const SIZE_TO_LABEL_STYLE = {
212
216
  export const Button = React.forwardRef(function Button(props, ref) {
213
217
  const { className, component: Component = "button", disabled, color, size, startIcon, endIcon, label, fullWidth, bold = false, loading = false } = props, other = __rest(props, ["className", "component", "disabled", "color", "size", "startIcon", "endIcon", "label", "fullWidth", "bold", "loading"]);
214
218
  const theme = useTheme();
215
- return (_jsxs(Component, Object.assign({ type: Component === "button" || Component === "input" ? "button" : undefined }, other, { className: className, ref: ref, css: [
219
+ return (_jsxs(Component, Object.assign({ type: Component === "button" || Component === "input" ? "button" : undefined }, other, { className: [buttonClasses.root, className].filter(Boolean).join(" "), ref: ref, css: [
216
220
  css `
217
221
  display: inline-flex;
218
222
  align-items: center;
@@ -243,7 +247,7 @@ export const Button = React.forwardRef(function Button(props, ref) {
243
247
  `,
244
248
  COLOR_TO_BUTTON_STYLE(theme, color, Boolean(disabled || loading)),
245
249
  SIZE_TO_BUTTON_STYLE[size],
246
- ], disabled: disabled || loading, children: [loading ? _jsx(Spinner, {}) : startIcon, label && (_jsx(Label, { size: size, bold: bold, children: label })), endIcon] })));
250
+ ], disabled: disabled || loading, children: [loading ? _jsx(Spinner, {}) : startIcon, label && (_jsx(Label, { className: buttonClasses.label, size: size, bold: bold, children: label })), endIcon] })));
247
251
  });
248
252
  const Label = styled.span `
249
253
  font-weight: ${({ bold }) => (bold ? 700 : 400)};
@@ -1,6 +1,11 @@
1
1
  import * as React from "react";
2
2
  import { InputHTMLAttributes } from "react";
3
3
  export type CheckboxInputType = "default" | "checked" | "partial";
4
+ export declare const checkboxInputClasses: {
5
+ readonly root: "CheckboxInput";
6
+ readonly checkbox: "CheckboxInput-checkbox";
7
+ readonly label: "CheckboxInput-label";
8
+ };
4
9
  export interface CheckboxInputProps {
5
10
  className?: string;
6
11
  /** 체크박스의 체크 여부(Controlled) */
@@ -15,6 +15,11 @@ import { css, useTheme } from "@emotion/react";
15
15
  import * as React from "react";
16
16
  import styled from "@emotion/styled";
17
17
  import { ZINDEX } from "../utils/zIndex";
18
+ export const checkboxInputClasses = {
19
+ root: "CheckboxInput",
20
+ checkbox: "CheckboxInput-checkbox",
21
+ label: "CheckboxInput-label",
22
+ };
18
23
  const CHECKBOX_ICON_STYLE = (theme, type, disabled) => ({
19
24
  default: css `
20
25
  rect {
@@ -112,7 +117,9 @@ export const CheckboxInput = React.forwardRef(function CheckboxInput(props, ref)
112
117
  onChange,
113
118
  inputProps,
114
119
  };
115
- return (_jsxs(Label, Object.assign({ className: className, ref: ref, disabled: disabled !== null && disabled !== void 0 ? disabled : false }, other, { children: [_jsx(Checkbox, Object.assign({}, checkboxProps)), _jsx("span", { css: css `
120
+ return (_jsxs(Label, Object.assign({ className: [checkboxInputClasses.root, className]
121
+ .filter(Boolean)
122
+ .join(" "), ref: ref, disabled: disabled !== null && disabled !== void 0 ? disabled : false }, other, { children: [_jsx(Checkbox, Object.assign({ className: checkboxInputClasses.checkbox }, checkboxProps)), _jsx("span", { className: checkboxInputClasses.label, css: css `
116
123
  margin-left: 8px;
117
124
  `, children: label })] })));
118
125
  });
@@ -1,5 +1,12 @@
1
1
  import React from "react";
2
+ export declare const fileTypeAlertDialogClasses: {
3
+ readonly root: "FileTypeAlertDialog";
4
+ readonly title: "FileTypeAlertDialog-title";
5
+ readonly content: "FileTypeAlertDialog-content";
6
+ readonly actions: "FileTypeAlertDialog-actions";
7
+ };
2
8
  interface FileTypeAlertDialogProps {
9
+ className?: string;
3
10
  open: boolean;
4
11
  onClose: () => void;
5
12
  /** 다이얼로그에 표시될 콘텐츠 */
@@ -4,14 +4,20 @@ import { css, useTheme } from "@emotion/react";
4
4
  import { AlertDialog, AlertDialogActions, AlertDialogContent, AlertDialogTitle, } from "./AlertDialog";
5
5
  import { AlertFillIcon } from "../icons";
6
6
  import { Button } from "./Button";
7
+ export const fileTypeAlertDialogClasses = {
8
+ root: "FileTypeAlertDialog",
9
+ title: "FileTypeAlertDialog-title",
10
+ content: "FileTypeAlertDialog-content",
11
+ actions: "FileTypeAlertDialog-actions",
12
+ };
7
13
  export function FileTypeAlertDialog(props) {
8
- const { open, onClose, content, openFileBrowser } = props;
14
+ const { className, open, onClose, content, openFileBrowser } = props;
9
15
  const theme = useTheme();
10
- return (_jsxs(AlertDialog, { open: open, onClose: onClose, icon: _jsx(AlertFillIcon, { css: css `
16
+ return (_jsxs(AlertDialog, { className: [fileTypeAlertDialogClasses.root, className].filter(Boolean).join(" "), open: open, onClose: onClose, icon: _jsx(AlertFillIcon, { css: css `
11
17
  color: ${theme.color.background.danger};
12
- ` }), children: [_jsx(AlertDialogTitle, { css: css `
18
+ ` }), children: [_jsx(AlertDialogTitle, { className: fileTypeAlertDialogClasses.title, css: css `
13
19
  font-weight: 700;
14
- `, onClose: onClose, children: "\uD30C\uC77C \uD615\uC2DD\uC744 \uD655\uC778\uD574\uC8FC\uC138\uC694." }), _jsx(AlertDialogContent, { children: content }), _jsxs(AlertDialogActions, { children: [_jsx(Button, { color: "grey", label: "\uB2EB\uAE30", size: "medium", onClick: onClose, bold: true }), _jsx(Button, { color: "primary", label: "\uB2E4\uC2DC \uC5C5\uB85C\uB4DC", size: "medium", onClick: () => {
20
+ `, onClose: onClose, children: "\uD30C\uC77C \uD615\uC2DD\uC744 \uD655\uC778\uD574\uC8FC\uC138\uC694." }), _jsx(AlertDialogContent, { className: fileTypeAlertDialogClasses.content, children: content }), _jsxs(AlertDialogActions, { className: fileTypeAlertDialogClasses.actions, children: [_jsx(Button, { color: "grey", label: "\uB2EB\uAE30", size: "medium", onClick: onClose, bold: true }), _jsx(Button, { color: "primary", label: "\uB2E4\uC2DC \uC5C5\uB85C\uB4DC", size: "medium", onClick: () => {
15
21
  onClose();
16
22
  openFileBrowser();
17
23
  }, bold: true })] })] }));
@@ -2,6 +2,11 @@ import React from "react";
2
2
  import { InputBaseColor, InputBaseProps, InputBaseSize } from "./InputBase";
3
3
  export type InputColor = InputBaseColor;
4
4
  export type InputSize = InputBaseSize;
5
+ export declare const inputClasses: {
6
+ readonly root: "Input";
7
+ readonly label: "Input-label";
8
+ readonly hint: "Input-hint";
9
+ };
5
10
  export type InputProps = InputBaseProps & {
6
11
  /** Input 컴포넌트 상단에 노출될 문자열 */
7
12
  label?: string;
@@ -15,6 +15,11 @@ import { css } from "@emotion/react";
15
15
  import styled from "@emotion/styled";
16
16
  import React from "react";
17
17
  import { InputBase, } from "./InputBase";
18
+ export const inputClasses = {
19
+ root: "Input",
20
+ label: "Input-label",
21
+ hint: "Input-hint",
22
+ };
18
23
  const COLOR_TO_HINT_STYLES = (theme, color, disabled) => disabled
19
24
  ? css `
20
25
  color: ${theme.color.foreground.neutralBaseDisabled};
@@ -72,7 +77,7 @@ export const Input = React.forwardRef(function Input(props, ref) {
72
77
  /* eslint-enable @typescript-eslint/no-unused-vars */
73
78
  other = __rest(props, ["label", "hintText", "hintIcon", "className", "color", "size", "placeholder", "disabled", "startIcon", "startLabel", "endLabel", "endIcon", "inputProps", "inputRef", "fullWidth", "onChange", "onClear", "defaultValue", "value"]);
74
79
  const { className: _className } = props, inputBaseProps = __rest(props, ["className"]);
75
- return (_jsxs(InputWrapper, Object.assign({ className: props.className, size: props.size, fullWidth: props.fullWidth, ref: ref }, other, { children: [label ? (_jsxs(Label, { disabled: props.disabled, children: [label, " ", _jsx(InputBase, Object.assign({}, inputBaseProps))] })) : (_jsx(InputBase, Object.assign({}, inputBaseProps))), hintText && (_jsxs(Hint, { color: props.color, disabled: props.disabled, children: [hintIcon, hintText] }))] })));
80
+ return (_jsxs(InputWrapper, Object.assign({ className: [inputClasses.root, props.className].filter(Boolean).join(" "), size: props.size, fullWidth: props.fullWidth, ref: ref }, other, { children: [label ? (_jsxs(Label, { className: inputClasses.label, disabled: props.disabled, children: [label, " ", _jsx(InputBase, Object.assign({}, inputBaseProps))] })) : (_jsx(InputBase, Object.assign({}, inputBaseProps))), hintText && (_jsxs(Hint, { className: inputClasses.hint, color: props.color, disabled: props.disabled, children: [hintIcon, hintText] }))] })));
76
81
  });
77
82
  const InputWrapper = styled("span", {
78
83
  shouldForwardProp: (prop) => prop !== "fullWidth",
@@ -1,6 +1,12 @@
1
1
  import { ForwardedRef, InputHTMLAttributes } from "react";
2
2
  export type InputBaseColor = "default" | "base" | "activePrimary" | "activeDanger" | "activeSuccess";
3
3
  export type InputBaseSize = "large" | "medium" | "small";
4
+ export declare const inputBaseClasses: {
5
+ readonly root: "InputBase";
6
+ readonly startLabel: "InputBase-startLabel";
7
+ readonly endLabel: "InputBase-endLabel";
8
+ readonly clearButton: "InputBase-clearButton";
9
+ };
4
10
  export type InputBaseProps = InputBaseCommonProps & (InputBaseInputProps | InputBaseTextAreaProps);
5
11
  interface InputBaseCommonProps {
6
12
  className?: string;
@@ -5,6 +5,12 @@ import styled from "@emotion/styled";
5
5
  import { CloseCircleFillIcon } from "../icons";
6
6
  import { RESET_BUTTON } from "../utils/reset";
7
7
  import { TextareaAutosize } from "@mui/material";
8
+ export const inputBaseClasses = {
9
+ root: "InputBase",
10
+ startLabel: "InputBase-startLabel",
11
+ endLabel: "InputBase-endLabel",
12
+ clearButton: "InputBase-clearButton",
13
+ };
8
14
  // border를 none으로 설정하지 않고 transparent로 설정한 이유는
9
15
  // border의 존재에 따라 크기가 달라지는 것을 방지하기 위함입니다.
10
16
  // 이 컴포넌트는 multiline을 고려하여 height를 명시적으로 지정하지 않았습니다.
@@ -97,7 +103,7 @@ function InputComponent(props) {
97
103
  }
98
104
  export function InputBase(props) {
99
105
  const { className, color, size, disabled = false, startIcon, startLabel, endLabel, endIcon, fullWidth = false, onClear, } = props;
100
- return (_jsxs(InputContainer, { className: className, disabled: disabled, color: color, inputSize: size, fullWidth: fullWidth, children: [startIcon, startLabel && _jsx("span", { children: startLabel }), _jsx(InputComponent, Object.assign({}, props)), endLabel && _jsx("span", { children: endLabel }), endIcon, onClear && (_jsx(ClearButton, { type: "button", onClick: onClear, disabled: disabled, tabIndex: -1, children: _jsx(CloseCircleFillIcon, {}) }))] }));
106
+ return (_jsxs(InputContainer, { className: [inputBaseClasses.root, className].filter(Boolean).join(" "), disabled: disabled, color: color, inputSize: size, fullWidth: fullWidth, children: [startIcon, startLabel && (_jsx("span", { className: inputBaseClasses.startLabel, children: startLabel })), _jsx(InputComponent, Object.assign({}, props)), endLabel && (_jsx("span", { className: inputBaseClasses.endLabel, children: endLabel })), endIcon, onClear && (_jsx(ClearButton, { className: inputBaseClasses.clearButton, type: "button", onClick: onClear, disabled: disabled, tabIndex: -1, children: _jsx(CloseCircleFillIcon, {}) }))] }));
101
107
  }
102
108
  const InputContainer = styled("div", {
103
109
  shouldForwardProp: (prop) => !["inputSize", "fullWidth"].includes(prop),
@@ -1,6 +1,10 @@
1
1
  /** @jsxImportSource @emotion/react */
2
2
  import { SerializedStyles } from "@emotion/react";
3
3
  import { TooltipProps } from "./Tooltip";
4
+ export declare const overflowTooltipClasses: {
5
+ readonly root: "OverflowTooltip";
6
+ readonly overflow: "OverflowTooltip-overflow";
7
+ };
4
8
  interface OverflowTooltipProps extends Omit<TooltipProps, "open" | "onOpen" | "onClose" | "children"> {
5
9
  className?: string;
6
10
  childrenCss?: SerializedStyles;
@@ -1,12 +1,28 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
1
12
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
13
  import styled from "@emotion/styled";
3
14
  import { useRef, useState } from "react";
4
15
  import { Tooltip } from "./Tooltip";
16
+ export const overflowTooltipClasses = {
17
+ root: "OverflowTooltip",
18
+ overflow: "OverflowTooltip-overflow",
19
+ };
5
20
  /**
6
21
  * 인자로 주어진 텍스트를 그립니다.
7
22
  * 공간이 부족하면 ...으로 표시하고 툴팁으로 전체 내용을 노출합니다.
8
23
  */
9
24
  export function OverflowTooltip(props) {
25
+ const { className } = props, otherProps = __rest(props, ["className"]);
10
26
  const tooltipRef = useRef(null);
11
27
  const [isTooltipOpen, setIsTooltipOpen] = useState(false);
12
28
  const getIsOverflow = () => {
@@ -23,7 +39,7 @@ export function OverflowTooltip(props) {
23
39
  const handleClose = () => {
24
40
  setIsTooltipOpen(false);
25
41
  };
26
- return (_jsx(Tooltip, Object.assign({ open: isTooltipOpen, onOpen: handleOpen, onClose: handleClose }, props, { children: _jsx(OverflowDiv, { css: props.childrenCss, ref: tooltipRef, onMouseOver: handleOpen, children: props.text }) })));
42
+ return (_jsx(Tooltip, Object.assign({ className: [overflowTooltipClasses.root, className].filter(Boolean).join(" "), open: isTooltipOpen, onOpen: handleOpen, onClose: handleClose }, otherProps, { children: _jsx(OverflowDiv, { className: overflowTooltipClasses.overflow, css: props.childrenCss, ref: tooltipRef, onMouseOver: handleOpen, children: props.text }) })));
27
43
  }
28
44
  const OverflowDiv = styled.div `
29
45
  overflow: hidden;
@@ -1,4 +1,7 @@
1
1
  import * as React from "react";
2
+ export declare const paginationClasses: {
3
+ readonly root: "Pagination";
4
+ };
2
5
  export interface PaginationProps {
3
6
  className?: string;
4
7
  /** 시작과 끝에 오는 페이지의 수 */
@@ -1,3 +1,14 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
1
12
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
13
  /** @jsxImportSource @emotion/react */
3
14
  import { css } from "@emotion/react";
@@ -5,11 +16,15 @@ import * as React from "react";
5
16
  import styled from "@emotion/styled";
6
17
  import { Pagination as MuiPagination } from "@mui/material";
7
18
  import { HOVER } from "../utils/hover";
19
+ export const paginationClasses = {
20
+ root: "Pagination",
21
+ };
8
22
  /**
9
23
  * [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=35-798&t=6OdVgm0hiYaq5PFw-0)
10
24
  */
11
25
  export const Pagination = React.forwardRef(function Pagination(props, ref) {
12
- return (_jsx(StyledPagination, Object.assign({ siblingCount: 2, shape: "rounded" }, props, { ref: ref, getItemAriaLabel: (type, page, selected) => {
26
+ const { className } = props, other = __rest(props, ["className"]);
27
+ return (_jsx(StyledPagination, Object.assign({ siblingCount: 2, shape: "rounded" }, other, { className: [paginationClasses.root, className].filter(Boolean).join(" "), ref: ref, getItemAriaLabel: (type, page, selected) => {
13
28
  if (type === "previous")
14
29
  return "이전 페이지로 이동";
15
30
  if (type === "next")
@@ -1,4 +1,11 @@
1
1
  import React from "react";
2
+ export declare const pinInputClasses: {
3
+ readonly root: "PinInput";
4
+ readonly label: "PinInput-label";
5
+ readonly container: "PinInput-container";
6
+ readonly input: "PinInput-input";
7
+ readonly hint: "PinInput-hint";
8
+ };
2
9
  export type PinInputColor = "default" | "activePrimary" | "activeDanger" | "activeSuccess";
3
10
  export type PinInputSize = "large" | "medium" | "small";
4
11
  export interface PinInputProps {
@@ -15,6 +15,13 @@ import { css } from "@emotion/react";
15
15
  import styled from "@emotion/styled";
16
16
  import React, { useRef, useState } from "react";
17
17
  import { InputBase } from "./InputBase";
18
+ export const pinInputClasses = {
19
+ root: "PinInput",
20
+ label: "PinInput-label",
21
+ container: "PinInput-container",
22
+ input: "PinInput-input",
23
+ hint: "PinInput-hint",
24
+ };
18
25
  const SIZE_TO_STYLES = (size) => ({
19
26
  small: css `
20
27
  width: 36px;
@@ -83,13 +90,13 @@ function updateFocus(value, i, setFocus) {
83
90
  */
84
91
  export const PinInput = React.forwardRef(function PinInput(props, ref) {
85
92
  const { className, autoFocus: _autoFocus, size, placeholder: _placeholder, label, hintText, hintIcon, disabled = false, error, positive, onChange: _onChange, values: _values } = props, other = __rest(props, ["className", "autoFocus", "size", "placeholder", "label", "hintText", "hintIcon", "disabled", "error", "positive", "onChange", "values"]);
86
- return (_jsxs(PinInputWrapper, Object.assign({ className: className, size: size, ref: ref }, other, { children: [label ? (_jsxs(Label, { disabled: disabled, children: [label, " ", _jsx(PinInputComponent, Object.assign({}, props))] })) : (_jsx(PinInputComponent, Object.assign({}, props))), hintText && (_jsxs(Hint, { color: error ? "activeDanger" : positive ? "activeSuccess" : "default", disabled: disabled, children: [hintIcon, hintText] }))] })));
93
+ return (_jsxs(PinInputWrapper, Object.assign({ className: [pinInputClasses.root, className].filter(Boolean).join(" "), size: size, ref: ref }, other, { children: [label ? (_jsxs(Label, { className: pinInputClasses.label, disabled: disabled, children: [label, " ", _jsx(PinInputComponent, Object.assign({}, props))] })) : (_jsx(PinInputComponent, Object.assign({}, props))), hintText && (_jsxs(Hint, { className: pinInputClasses.hint, color: error ? "activeDanger" : positive ? "activeSuccess" : "default", disabled: disabled, children: [hintIcon, hintText] }))] })));
87
94
  });
88
95
  function PinInputComponent(props) {
89
96
  const { autoFocus, size, placeholder, disabled = false, error, positive, onChange, values, } = props;
90
97
  const [focus, setFocus] = useState([]);
91
98
  const refs = useRef([]);
92
- return (_jsx(PinInputContainer, { children: values.map((value, i) => (_jsx(SqaureInput, { color: error
99
+ return (_jsx(PinInputContainer, { className: pinInputClasses.container, children: values.map((value, i) => (_jsx(SqaureInput, { className: pinInputClasses.input, color: error
93
100
  ? "activeDanger"
94
101
  : positive
95
102
  ? "activeSuccess"
@@ -1,4 +1,11 @@
1
1
  import React from "react";
2
+ export declare const popoverClasses: {
3
+ readonly root: "Popover";
4
+ readonly icon: "Popover-icon";
5
+ readonly contentArea: "Popover-contentArea";
6
+ readonly headline: "Popover-headline";
7
+ readonly content: "Popover-content";
8
+ };
2
9
  export interface PopoverProps {
3
10
  className?: string;
4
11
  /** 제목 */
@@ -3,9 +3,16 @@ import styled from "@emotion/styled";
3
3
  import React from "react";
4
4
  import { shadows } from "../foundation/shadows";
5
5
  import { css } from "@emotion/react";
6
+ export const popoverClasses = {
7
+ root: "Popover",
8
+ icon: "Popover-icon",
9
+ contentArea: "Popover-contentArea",
10
+ headline: "Popover-headline",
11
+ content: "Popover-content",
12
+ };
6
13
  export const Popover = React.forwardRef(function Popover(props, ref) {
7
14
  const { className, headline, content, icon, button } = props;
8
- return (_jsxs(Container, { ref: ref, className: className, children: [icon && _jsx(Icon, { children: icon }), _jsxs(ContentArea, { children: [headline && _jsx(Headline, { children: headline }), content && _jsx(Content, { children: content })] }), button] }));
15
+ return (_jsxs(Container, { ref: ref, className: [popoverClasses.root, className].filter(Boolean).join(" "), children: [icon && _jsx(Icon, { className: popoverClasses.icon, children: icon }), _jsxs(ContentArea, { className: popoverClasses.contentArea, children: [headline && (_jsx(Headline, { className: popoverClasses.headline, children: headline })), content && (_jsx(Content, { className: popoverClasses.content, children: content }))] }), button] }));
9
16
  });
10
17
  const Container = styled.div(({ theme }) => css `
11
18
  display: inline-flex;
@@ -1,6 +1,11 @@
1
1
  import * as React from "react";
2
2
  import { InputHTMLAttributes } from "react";
3
3
  export type RadioInputType = "default" | "selected";
4
+ export declare const radioInputClasses: {
5
+ readonly root: "RadioInput";
6
+ readonly radio: "RadioInput-radio";
7
+ readonly label: "RadioInput-label";
8
+ };
4
9
  export interface RadioInputProps {
5
10
  className?: string;
6
11
  /** 라디오 버튼의 선택 여부(Controlled) */
@@ -15,6 +15,11 @@ import { css, useTheme } from "@emotion/react";
15
15
  import * as React from "react";
16
16
  import styled from "@emotion/styled";
17
17
  import { ZINDEX } from "../utils/zIndex";
18
+ export const radioInputClasses = {
19
+ root: "RadioInput",
20
+ radio: "RadioInput-radio",
21
+ label: "RadioInput-label",
22
+ };
18
23
  const TYPE_TO_ICON_STYLE = (theme, type, disabled) => ({
19
24
  default: css `
20
25
  path {
@@ -81,7 +86,7 @@ export const RadioInput = React.forwardRef(function RadioInput(props, ref) {
81
86
  onChange,
82
87
  inputProps,
83
88
  };
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 `
89
+ return (_jsxs(Label, Object.assign({ className: [radioInputClasses.root, className].filter(Boolean).join(" "), ref: ref, disabled: disabled !== null && disabled !== void 0 ? disabled : false }, other, { children: [_jsx(RadioButton, Object.assign({ className: radioInputClasses.radio }, radioProps)), _jsx("span", { className: radioInputClasses.label, css: css `
85
90
  margin-left: 8px;
86
91
  `, children: label })] })));
87
92
  });
@@ -2,6 +2,9 @@ import React from "react";
2
2
  import { PolymorphicProps } from "@mui/base";
3
3
  export type SquareButtonColor = "danger" | "primary" | "grey" | "icon" | "black" | "white";
4
4
  export type SquareButtonSize = "large" | "medium" | "small" | "xsmall";
5
+ export declare const squareButtonClasses: {
6
+ readonly root: "SquareButton";
7
+ };
5
8
  export interface SquareButtonOwnProps<RootComponentType extends React.ElementType> {
6
9
  className?: string;
7
10
  component?: RootComponentType;
@@ -15,6 +15,9 @@ import { css, useTheme } from "@emotion/react";
15
15
  import React from "react";
16
16
  import { HOVER } from "../utils/hover";
17
17
  import { Spinner } from "./Spinner";
18
+ export const squareButtonClasses = {
19
+ root: "SquareButton",
20
+ };
18
21
  const COLOR_TO_BUTTON_STYLE = (theme, color, disabled) => ({
19
22
  danger: disabled
20
23
  ? css `
@@ -147,7 +150,9 @@ const SIZE_TO_BUTTON_STYLE = {
147
150
  export const SquareButton = React.forwardRef(function SquareButton(props, ref) {
148
151
  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
152
  const theme = useTheme();
150
- return (_jsx(Component, Object.assign({ type: Component === "button" || Component === "input" ? "button" : undefined }, other, { ref: ref, className: className, css: [
153
+ return (_jsx(Component, Object.assign({ type: Component === "button" || Component === "input" ? "button" : undefined }, other, { ref: ref, className: [squareButtonClasses.root, className]
154
+ .filter(Boolean)
155
+ .join(" "), css: [
151
156
  css `
152
157
  border: none;
153
158
 
@@ -1,6 +1,9 @@
1
1
  import React from "react";
2
2
  import { SwitchProps as MuiSwitchProps } from "@mui/material";
3
3
  export type SwitchSize = "small" | "large";
4
+ export declare const switchClasses: {
5
+ readonly root: "Switch";
6
+ };
4
7
  export interface SwitchProps extends Omit<MuiSwitchProps, "size"> {
5
8
  className?: string;
6
9
  /** 스위치 체크 상태 여부 */
@@ -15,12 +15,15 @@ import styled from "@emotion/styled";
15
15
  import React from "react";
16
16
  import { Switch as MuiSwitch, } from "@mui/material";
17
17
  import { css } from "@emotion/react";
18
+ export const switchClasses = {
19
+ root: "Switch",
20
+ };
18
21
  /**
19
22
  * [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=36-1577&t=9sDLb4XIOdmF2VMc-0)
20
23
  */
21
24
  export const Switch = React.forwardRef(function Switch(props, ref) {
22
25
  const { className, checked, disabled = false, size, onChange } = props, other = __rest(props, ["className", "checked", "disabled", "size", "onChange"]);
23
- return (_jsx(StyledSwitch, Object.assign({}, other, { ref: ref, className: className, checked: checked, disabled: disabled, onChange: onChange, switchSize: size })));
26
+ return (_jsx(StyledSwitch, Object.assign({}, other, { ref: ref, className: [switchClasses.root, className].filter(Boolean).join(" "), checked: checked, disabled: disabled, onChange: onChange, switchSize: size })));
24
27
  });
25
28
  const SIZE_TO_SWTICH_SIZE = {
26
29
  large: {
@@ -2,6 +2,10 @@ import { PolymorphicProps } from "@mui/base";
2
2
  import React from "react";
3
3
  export type SwitchButtonColor = "grey" | "white" | "none";
4
4
  export type SwitchButtonSize = "medium" | "xsmall";
5
+ export declare const switchButtonClasses: {
6
+ readonly root: "SwitchButton";
7
+ readonly content: "SwitchButton-content";
8
+ };
5
9
  export interface SwitchButtonOwnProps<RootComponentType extends React.ElementType> {
6
10
  className?: string;
7
11
  component?: RootComponentType;
@@ -15,6 +15,10 @@ import { css, useTheme } from "@emotion/react";
15
15
  import { HOVER } from "../utils/hover";
16
16
  import React from "react";
17
17
  import styled from "@emotion/styled";
18
+ export const switchButtonClasses = {
19
+ root: "SwitchButton",
20
+ content: "SwitchButton-content",
21
+ };
18
22
  const COLOR_TO_SWITCH_BUTTON_STYLE = (theme, color, isOn) => ({
19
23
  grey: css `
20
24
  ${isOn
@@ -129,7 +133,9 @@ const SIZE_TO_SWITCH_BUTTON_STYLE = (size) => ({
129
133
  export const SwitchButton = React.forwardRef(function SwitchButton(props, ref) {
130
134
  const { className, component: Component = "button", color, size, isOn, onIcon, offIcon, content, onClick } = props, other = __rest(props, ["className", "component", "color", "size", "isOn", "onIcon", "offIcon", "content", "onClick"]);
131
135
  const theme = useTheme();
132
- return (_jsxs(Component, Object.assign({ type: "button" }, other, { className: className, ref: ref, css: [
136
+ return (_jsxs(Component, Object.assign({ type: "button" }, other, { className: [switchButtonClasses.root, className]
137
+ .filter(Boolean)
138
+ .join(" "), ref: ref, css: [
133
139
  css `
134
140
  display: flex;
135
141
  justify-content: center;
@@ -142,7 +148,7 @@ export const SwitchButton = React.forwardRef(function SwitchButton(props, ref) {
142
148
  `,
143
149
  COLOR_TO_SWITCH_BUTTON_STYLE(theme, color, isOn),
144
150
  SIZE_TO_SWITCH_BUTTON_STYLE(size),
145
- ], onClick: onClick, children: [isOn ? onIcon : offIcon, content && _jsx(Content, { children: content })] })));
151
+ ], onClick: onClick, children: [isOn ? onIcon : offIcon, content && (_jsx(Content, { className: switchButtonClasses.content, children: content }))] })));
146
152
  });
147
153
  const Content = styled.span(({ theme }) => css `
148
154
  color: ${theme.color.foreground.neutralBase};
@@ -1,4 +1,9 @@
1
1
  import React from "react";
2
+ export declare const tagClasses: {
3
+ readonly root: "Tag";
4
+ readonly label: "Tag-label";
5
+ readonly closeButton: "Tag-closeButton";
6
+ };
2
7
  export type TagColor = "default" | "red" | "teal" | "orange" | "blue" | "green" | "yellow" | "black" | "white" | "ai";
3
8
  export interface TagProps {
4
9
  className?: string;
@@ -16,6 +16,11 @@ import styled from "@emotion/styled";
16
16
  import React from "react";
17
17
  import { CloseFillIcon } from "../icons";
18
18
  import { useTheme } from "@emotion/react";
19
+ export const tagClasses = {
20
+ root: "Tag",
21
+ label: "Tag-label",
22
+ closeButton: "Tag-closeButton",
23
+ };
19
24
  const COLOR_TO_STYLE = (theme, color) => ({
20
25
  default: css `
21
26
  box-sizing: border-box;
@@ -78,7 +83,7 @@ const COLOR_TO_STYLE = (theme, color) => ({
78
83
  export const Tag = React.forwardRef(function Tag(props, ref) {
79
84
  const { className, component: Component = "span", label, icon, color = "default", bold, close, onClick } = props, other = __rest(props, ["className", "component", "label", "icon", "color", "bold", "close", "onClick"]);
80
85
  const theme = useTheme();
81
- return (_jsxs(Component, Object.assign({}, other, { ref: ref, className: className, css: [
86
+ return (_jsxs(Component, Object.assign({}, other, { ref: ref, className: [tagClasses.root, className].filter(Boolean).join(" "), css: [
82
87
  css `
83
88
  box-sizing: border-box;
84
89
  display: flex;
@@ -101,11 +106,11 @@ export const Tag = React.forwardRef(function Tag(props, ref) {
101
106
  cursor: pointer;
102
107
  `
103
108
  : undefined,
104
- ], onClick: onClick, children: [icon, _jsx("span", { css: css `
109
+ ], onClick: onClick, children: [icon, _jsx("span", { className: tagClasses.label, css: css `
105
110
  font-weight: ${bold ? 700 : 400};
106
111
  font-size: 12px;
107
112
  line-height: 20px;
108
- `, children: label }), close && _jsx(StyledCloseFillIcon, {})] })));
113
+ `, children: label }), close && _jsx(StyledCloseFillIcon, { className: tagClasses.closeButton })] })));
109
114
  });
110
115
  const StyledCloseFillIcon = styled(CloseFillIcon) `
111
116
  width: 10px;
@@ -1,4 +1,8 @@
1
1
  import React from "react";
2
+ export declare const tooltipClasses: {
3
+ readonly root: "Tooltip";
4
+ readonly title: "Tooltip-title";
5
+ };
2
6
  export interface TooltipProps {
3
7
  className?: string;
4
8
  /** 툴팁에 표시될 제목 텍스트 */
@@ -15,6 +15,10 @@ import { css } from "@emotion/react";
15
15
  import styled from "@emotion/styled";
16
16
  import React from "react";
17
17
  import { Tooltip as MuiTooltip, } from "@mui/material";
18
+ export const tooltipClasses = {
19
+ root: "Tooltip",
20
+ title: "Tooltip-title",
21
+ };
18
22
  /**
19
23
  * ReactElement를 받아서 tabIndex를 부여하여 focusable한 element로 변환합니다.
20
24
  * 만약
@@ -45,11 +49,11 @@ function addTabIndexIfNeeded(element) {
45
49
  * [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=172-626&t=aFkKTFgWq2xFFGC5-0)
46
50
  */
47
51
  export const Tooltip = React.forwardRef(function Tooltip(props, ref) {
48
- const { title, text, children } = props, restProps = __rest(props, ["title", "text", "children"]);
52
+ const { title, text, children, className } = props, restProps = __rest(props, ["title", "text", "children", "className"]);
49
53
  const focusableChildren = addTabIndexIfNeeded(children);
50
- return (_jsx(StyledTooltip, Object.assign({ ref: ref, title:
54
+ return (_jsx(StyledTooltip, Object.assign({ ref: ref, className: [tooltipClasses.root, className].filter(Boolean).join(" "), title:
51
55
  // title이 없고 text가 null인 경우 툴팁을 표시하지 않음
52
- !title && text === null ? null : (_jsxs(_Fragment, { children: [title && _jsx(TitleDiv, { children: title }), text] })), describeChild: true }, restProps, { children: focusableChildren })));
56
+ !title && text === null ? null : (_jsxs(_Fragment, { children: [title && (_jsx(TitleDiv, { className: tooltipClasses.title, children: title })), text] })), describeChild: true }, restProps, { children: focusableChildren })));
53
57
  });
54
58
  // https://mui.com/material-ui/react-tooltip/#customization
55
59
  const StyledTooltip = styled((_a) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-monolith/cds",
3
- "version": "1.109.2",
3
+ "version": "1.110.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": false,