@team-monolith/cds 1.76.2 → 1.76.4
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,13 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export interface
|
|
2
|
+
export interface ProgressInfo {
|
|
3
3
|
/** 프로그레스 바 상단에 표시되는 텍스트 */
|
|
4
|
-
|
|
4
|
+
title: string;
|
|
5
5
|
/** 프로그레스 바 진행도 (0 ~ 1 사이 숫자) */
|
|
6
|
-
|
|
6
|
+
value: number;
|
|
7
7
|
/** 프로그레스 바 배경 및 텍스트 색상 */
|
|
8
|
-
|
|
8
|
+
baseColor: string;
|
|
9
9
|
/** 프로그레스 바 진행도 색상 */
|
|
10
|
-
|
|
10
|
+
barColor: string;
|
|
11
11
|
}
|
|
12
12
|
export interface BookProps {
|
|
13
13
|
className?: string;
|
|
@@ -34,7 +34,7 @@ export interface BookProps {
|
|
|
34
34
|
/** 커버 색상 */
|
|
35
35
|
coverColor: string;
|
|
36
36
|
/** 진행도 프로그레스 바 영역 */
|
|
37
|
-
|
|
37
|
+
progressInfo?: ProgressInfo;
|
|
38
38
|
}
|
|
39
39
|
declare const _default: React.ForwardRefExoticComponent<BookProps & React.RefAttributes<HTMLDivElement>>;
|
|
40
40
|
export default _default;
|
|
@@ -73,7 +73,7 @@ const CARD_COLOR_PALETTE = (theme) => ({
|
|
|
73
73
|
* @returns
|
|
74
74
|
*/
|
|
75
75
|
function Book(props, ref) {
|
|
76
|
-
const { className, title, subtitle, subtitleBold, coverColor, isHidden = false, buttons, open: controlledOpen, onHoverStart, onHoverEnd, onCoverClick, icon,
|
|
76
|
+
const { className, title, subtitle, subtitleBold, coverColor, isHidden = false, buttons, open: controlledOpen, onHoverStart, onHoverEnd, onCoverClick, icon, progressInfo, } = props;
|
|
77
77
|
const theme = useTheme();
|
|
78
78
|
const [open, setOpen] = useState(false);
|
|
79
79
|
return (_jsxs(Container, Object.assign({ initial: "closed", animate: (controlledOpen !== null && controlledOpen !== void 0 ? controlledOpen : open) ? "open" : "closed", ref: ref, onHoverStart: () => {
|
|
@@ -97,30 +97,29 @@ function Book(props, ref) {
|
|
|
97
97
|
opacity: 0.8;
|
|
98
98
|
` })] })), _jsxs(CoverTexts, Object.assign({ variants: buttons ? textMotion : undefined }, { children: [_jsx(Subtitle, { children: subtitle }), _jsx(Subtitle, Object.assign({ css: css `
|
|
99
99
|
font-weight: 800;
|
|
100
|
-
` }, { children: subtitleBold })), _jsx(CoverTitle, Object.assign({ showProgress: Boolean(
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
` }, { children: progress.progressTitle })), _jsxs("div", Object.assign({ css: css `
|
|
100
|
+
` }, { children: subtitleBold })), _jsx(CoverTitle, Object.assign({ showProgress: Boolean(progressInfo) }, { children: title })), progressInfo && (_jsxs(Progress, { children: [_jsx("div", Object.assign({ css: css `
|
|
101
|
+
color: ${progressInfo.baseColor};
|
|
102
|
+
` }, { children: progressInfo.title })), _jsxs("div", Object.assign({ css: css `
|
|
104
103
|
display: flex;
|
|
105
104
|
justify-content: space-between;
|
|
106
105
|
align-items: center;
|
|
107
106
|
` }, { children: [_jsx("div", Object.assign({ css: css `
|
|
108
107
|
overflow: hidden;
|
|
109
|
-
background-color: ${
|
|
108
|
+
background-color: ${progressInfo.baseColor};
|
|
110
109
|
width: 128px;
|
|
111
110
|
height: 6px;
|
|
112
111
|
border-radius: 3px;
|
|
113
112
|
` }, { children: _jsx("div", { css: css `
|
|
114
|
-
background-color: ${
|
|
115
|
-
width: ${
|
|
113
|
+
background-color: ${progressInfo.barColor};
|
|
114
|
+
width: ${progressInfo.value * 100}%;
|
|
116
115
|
height: 6px;
|
|
117
116
|
` }) })), _jsxs("div", Object.assign({ css: css `
|
|
118
|
-
color: ${
|
|
117
|
+
color: ${progressInfo.baseColor};
|
|
119
118
|
width: 32px;
|
|
120
119
|
display: flex;
|
|
121
120
|
justify-content: center;
|
|
122
121
|
align-items: center;
|
|
123
|
-
` }, { children: [Math.round(
|
|
122
|
+
` }, { children: [Math.round(progressInfo.value * 100), "%"] }))] }))] }))] })), _jsx(BookGradient, {}), _jsx(Buttons, Object.assign({ variants: buttonsMotion, onClick: (e) => {
|
|
124
123
|
// Button 클릭 시에도 CoverClick 이벤트가 발생하지 않도록 막습니다.
|
|
125
124
|
e.stopPropagation();
|
|
126
125
|
} }, { children: buttons }))] })), _jsx(Shelf, {})] })));
|