@team-monolith/cds 1.66.0 → 1.67.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.
@@ -1,4 +1,5 @@
1
1
  import React from "react";
2
+ import { ButtonProps } from "./Button";
2
3
  export type BannerColor = "red" | "blue" | "green" | "yellow" | "white";
3
4
  export interface BannerProps {
4
5
  className?: string;
@@ -17,6 +18,8 @@ export interface BannerProps {
17
18
  onButtonClick?: () => void;
18
19
  /** 버튼 컴포넌트에 삽입될 ClassName */
19
20
  buttonClassName?: string;
21
+ /** Button에 전달될 Props */
22
+ buttonProps?: Omit<ButtonProps, "className" | "label" | "onClick">;
20
23
  /** 컴포넌트 우측에 표기될 닫기 버튼 유무 */
21
24
  close?: boolean;
22
25
  /** 닫기 버튼 클릭 시 호출될 콜백 함수 */
@@ -48,7 +48,7 @@ const COLOR_PALETTE = (theme, color) => ({
48
48
  * [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=44-2847&t=bhnL1ombbddld3RQ-0)
49
49
  */
50
50
  const Banner = React.forwardRef((props, ref) => {
51
- const { className, component: Component = "div", headline, content, icon, color, buttonLabel, buttonClassName, onButtonClick, close, onClose, fullWidth } = props, other = __rest(props, ["className", "component", "headline", "content", "icon", "color", "buttonLabel", "buttonClassName", "onButtonClick", "close", "onClose", "fullWidth"]);
51
+ const { className, component: Component = "div", headline, content, icon, color, buttonLabel, buttonClassName, onButtonClick, buttonProps, close, onClose, fullWidth } = props, other = __rest(props, ["className", "component", "headline", "content", "icon", "color", "buttonLabel", "buttonClassName", "onButtonClick", "buttonProps", "close", "onClose", "fullWidth"]);
52
52
  const theme = useTheme();
53
53
  return (_jsxs(Component, Object.assign({}, other, { ref: ref, className: className, css: [
54
54
  css `
@@ -73,9 +73,9 @@ const Banner = React.forwardRef((props, ref) => {
73
73
  color: ${COLOR_PALETTE(theme, color).headline};
74
74
  ` }, { children: headline }))), content && (_jsx(ContentDiv, Object.assign({ css: css `
75
75
  color: ${COLOR_PALETTE(theme, color).content};
76
- ` }, { children: content })))] }), buttonLabel && (_jsx(Button, { className: buttonClassName, css: css `
76
+ ` }, { children: content })))] }), buttonLabel && (_jsx(Button, Object.assign({ className: buttonClassName, css: css `
77
77
  color: ${COLOR_PALETTE(theme, color).content};
78
- `, color: "textNeutral", size: "small", label: buttonLabel, onClick: onButtonClick })), close && (_jsx(SquareButton, { css: css `
78
+ `, color: "textNeutral", size: "small", label: buttonLabel, onClick: onButtonClick }, buttonProps))), close && (_jsx(SquareButton, { css: css `
79
79
  > button {
80
80
  color: ${COLOR_PALETTE(theme, color).content};
81
81
  }
@@ -1,17 +1,27 @@
1
1
  import React from "react";
2
2
  export interface BookProps {
3
3
  className?: string;
4
+ /** 제목 영역 (하단에 노출되는) 텍스트 */
4
5
  title?: string;
6
+ /** subtitle 영역 (상단) 텍스트 */
5
7
  subtitle?: string;
8
+ /** subtitleBold 영역 (상단, subtitle 영역보다 1줄 낮음) 텍스트 */
6
9
  subtitleBold?: string;
10
+ /** 숨김 상태인지 여부 */
7
11
  isHidden?: boolean;
12
+ /** 버튼 영역 (최하단에 노출되는) */
8
13
  buttons?: React.ReactNode;
9
14
  /** 전달하면 controlled component로 애니메이션을 제어할 수 있다 */
10
15
  open?: boolean;
16
+ /** 커버 hover 시 발생하는 이벤트 */
11
17
  onHoverStart?: () => void;
18
+ /** 커버 hover 종료 시 발생하는 이벤트 */
12
19
  onHoverEnd?: () => void;
20
+ /** 커버 클릭 시 발생하는 이벤트 */
13
21
  onCoverClick?: () => void;
22
+ /** 커버에 노출되는 아이콘 */
14
23
  icon?: React.ReactNode;
24
+ /** 커버 색상 */
15
25
  coverColor: string;
16
26
  }
17
27
  declare const _default: React.ForwardRefExoticComponent<BookProps & React.RefAttributes<HTMLDivElement>>;
@@ -67,7 +67,7 @@ const CARD_COLOR_PALETTE = (theme) => ({
67
67
  *
68
68
  * 사유2)
69
69
  * 관리/배부 드랍다운 Modal이 Card 위로 그려져 hoverEnd를 유발하기 때문에
70
- * 특성 상황에서는 hoverEnd가 발생했어도 Card를 열고 있어야 합니다.
70
+ * 특정 상황에서는 hoverEnd가 발생했어도 Card를 열고 있어야 합니다.
71
71
  * @param props
72
72
  * @param ref
73
73
  * @returns
@@ -76,9 +76,7 @@ function Book(props, ref) {
76
76
  const { className, title, subtitle, subtitleBold, coverColor, isHidden = false, buttons, open: controlledOpen, onHoverStart, onHoverEnd, onCoverClick, icon, } = props;
77
77
  const theme = useTheme();
78
78
  const [open, setOpen] = useState(false);
79
- return (_jsxs(Container, Object.assign({ initial: "closed", animate: (controlledOpen !== undefined ? controlledOpen : open)
80
- ? "open"
81
- : "closed", ref: ref, onHoverStart: () => {
79
+ return (_jsxs(Container, Object.assign({ initial: "closed", animate: (controlledOpen !== null && controlledOpen !== void 0 ? controlledOpen : open) ? "open" : "closed", ref: ref, onHoverStart: () => {
82
80
  setOpen(true);
83
81
  onHoverStart === null || onHoverStart === void 0 ? void 0 : onHoverStart();
84
82
  }, onHoverEnd: () => {
@@ -97,9 +95,6 @@ function Book(props, ref) {
97
95
  top: 50%;
98
96
  transform: translate(-50%, -50%);
99
97
  opacity: 0.8;
100
-
101
- width: 24px;
102
- height: 24px;
103
98
  ` })] })), _jsxs(CoverTexts, Object.assign({ variants: buttons ? textMotion : undefined }, { children: [_jsx(Subtitle, { children: subtitle }), _jsx(Subtitle, Object.assign({ css: css `
104
99
  font-weight: 800;
105
100
  ` }, { children: subtitleBold })), _jsx(CoverTitle, { children: title })] })), _jsx(BookGradient, {}), _jsx(Buttons, Object.assign({ variants: buttonsMotion, onClick: (e) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-monolith/cds",
3
- "version": "1.66.0",
3
+ "version": "1.67.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": false,