@team-monolith/cds 1.76.1 → 1.76.3
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.
- package/@types/emotion.d.ts +14 -14
- package/dist/CdsProvider.js +28 -28
- package/dist/components/Book/Book.d.ts +11 -1
- package/dist/components/Book/Book.js +29 -7
- package/package.json +1 -1
package/@types/emotion.d.ts
CHANGED
|
@@ -120,20 +120,20 @@ interface CodleColors {
|
|
|
120
120
|
decorativeSilver: string;
|
|
121
121
|
decorativeGray: string;
|
|
122
122
|
decorativeBlack: string;
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
123
|
+
decorativeRedContainer: string;
|
|
124
|
+
decorativeRedOnContainer: string;
|
|
125
|
+
decorativeIndigoContainer: string;
|
|
126
|
+
decorativeIndigoOnContainer: string;
|
|
127
|
+
decorativeGreenContainer: string;
|
|
128
|
+
decorativeGreenOnContainer: string;
|
|
129
|
+
decorativePurpleContainer: string;
|
|
130
|
+
decorativePurpleOnContainer: string;
|
|
131
|
+
decorativeGoldContainer: string;
|
|
132
|
+
decorativeGoldOnContainer: string;
|
|
133
|
+
decorativeGrayContainer: string;
|
|
134
|
+
decorativeGrayOnContainer: string;
|
|
135
|
+
decorativeBlackContainer: string;
|
|
136
|
+
decorativeBlackOnContainer: string;
|
|
137
137
|
};
|
|
138
138
|
blanket: {
|
|
139
139
|
neutral: string;
|
package/dist/CdsProvider.js
CHANGED
|
@@ -125,20 +125,20 @@ export const light = {
|
|
|
125
125
|
decorativeSilver: "#6A7781",
|
|
126
126
|
decorativeGray: "#747474",
|
|
127
127
|
decorativeBlack: "#474658",
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
128
|
+
decorativeRedContainer: "#FFCDD7",
|
|
129
|
+
decorativeRedOnContainer: "#FE5375",
|
|
130
|
+
decorativeIndigoContainer: "#CED1FF",
|
|
131
|
+
decorativeIndigoOnContainer: "#8088FF",
|
|
132
|
+
decorativeGreenContainer: "#BCF1D1",
|
|
133
|
+
decorativeGreenOnContainer: "#4AC078",
|
|
134
|
+
decorativePurpleContainer: "#E5CAEF",
|
|
135
|
+
decorativePurpleOnContainer: "#C673E4",
|
|
136
|
+
decorativeGoldContainer: "#E3D7C2",
|
|
137
|
+
decorativeGoldOnContainer: "#B09666",
|
|
138
|
+
decorativeGrayContainer: "#D6D6D6",
|
|
139
|
+
decorativeGrayOnContainer: "#969696",
|
|
140
|
+
decorativeBlackContainer: "#CAC8D8",
|
|
141
|
+
decorativeBlackOnContainer: "#474658",
|
|
142
142
|
},
|
|
143
143
|
blanket: {
|
|
144
144
|
neutral: COLOR.alpha030,
|
|
@@ -270,20 +270,20 @@ export const dark = {
|
|
|
270
270
|
decorativeSilver: "#6A7781",
|
|
271
271
|
decorativeGray: "#747474",
|
|
272
272
|
decorativeBlack: "#474658",
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
273
|
+
decorativeRedContainer: "#FFCDD7",
|
|
274
|
+
decorativeRedOnContainer: "#FE5375",
|
|
275
|
+
decorativeIndigoContainer: "#CED1FF",
|
|
276
|
+
decorativeIndigoOnContainer: "#8088FF",
|
|
277
|
+
decorativeGreenContainer: "#BCF1D1",
|
|
278
|
+
decorativeGreenOnContainer: "#4AC078",
|
|
279
|
+
decorativePurpleContainer: "#E5CAEF",
|
|
280
|
+
decorativePurpleOnContainer: "#C673E4",
|
|
281
|
+
decorativeGoldContainer: "#E3D7C2",
|
|
282
|
+
decorativeGoldOnContainer: "#B09666",
|
|
283
|
+
decorativeGrayContainer: "#D6D6D6",
|
|
284
|
+
decorativeGrayOnContainer: "#969696",
|
|
285
|
+
decorativeBlackContainer: "#CAC8D8",
|
|
286
|
+
decorativeBlackOnContainer: "#474658",
|
|
287
287
|
},
|
|
288
288
|
blanket: {
|
|
289
289
|
neutral: COLOR.alphaf20,
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
export interface ProgressInfo {
|
|
3
|
+
/** 프로그레스 바 상단에 표시되는 텍스트 */
|
|
4
|
+
progressTitle: string;
|
|
5
|
+
/** 프로그레스 바 진행도 (0 ~ 1 사이 숫자) */
|
|
6
|
+
progressValue: number;
|
|
7
|
+
/** 프로그레스 바 배경 및 텍스트 색상 */
|
|
8
|
+
progressBaseColor: string;
|
|
9
|
+
/** 프로그레스 바 진행도 색상 */
|
|
10
|
+
progressBarColor: string;
|
|
11
|
+
}
|
|
2
12
|
export interface BookProps {
|
|
3
13
|
className?: string;
|
|
4
14
|
/** 제목 영역 (하단에 노출되는) 텍스트 */
|
|
@@ -24,7 +34,7 @@ export interface BookProps {
|
|
|
24
34
|
/** 커버 색상 */
|
|
25
35
|
coverColor: string;
|
|
26
36
|
/** 진행도 프로그레스 바 영역 */
|
|
27
|
-
|
|
37
|
+
progressInfo?: ProgressInfo;
|
|
28
38
|
}
|
|
29
39
|
declare const _default: React.ForwardRefExoticComponent<BookProps & React.RefAttributes<HTMLDivElement>>;
|
|
30
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,7 +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:
|
|
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.progressBaseColor};
|
|
102
|
+
` }, { children: progressInfo.progressTitle })), _jsxs("div", Object.assign({ css: css `
|
|
103
|
+
display: flex;
|
|
104
|
+
justify-content: space-between;
|
|
105
|
+
align-items: center;
|
|
106
|
+
` }, { children: [_jsx("div", Object.assign({ css: css `
|
|
107
|
+
overflow: hidden;
|
|
108
|
+
background-color: ${progressInfo.progressBaseColor};
|
|
109
|
+
width: 128px;
|
|
110
|
+
height: 6px;
|
|
111
|
+
border-radius: 3px;
|
|
112
|
+
` }, { children: _jsx("div", { css: css `
|
|
113
|
+
background-color: ${progressInfo.progressBarColor};
|
|
114
|
+
width: ${progressInfo.progressValue * 100}%;
|
|
115
|
+
height: 6px;
|
|
116
|
+
` }) })), _jsxs("div", Object.assign({ css: css `
|
|
117
|
+
color: ${progressInfo.progressBaseColor};
|
|
118
|
+
width: 32px;
|
|
119
|
+
display: flex;
|
|
120
|
+
justify-content: center;
|
|
121
|
+
align-items: center;
|
|
122
|
+
` }, { children: [Math.round(progressInfo.progressValue * 100), "%"] }))] }))] }))] })), _jsx(BookGradient, {}), _jsx(Buttons, Object.assign({ variants: buttonsMotion, onClick: (e) => {
|
|
101
123
|
// Button 클릭 시에도 CoverClick 이벤트가 발생하지 않도록 막습니다.
|
|
102
124
|
e.stopPropagation();
|
|
103
125
|
} }, { children: buttons }))] })), _jsx(Shelf, {})] })));
|
|
@@ -143,12 +165,13 @@ const CoverTexts = styled(motion.div) `
|
|
|
143
165
|
flex-direction: column;
|
|
144
166
|
gap: 4px;
|
|
145
167
|
`;
|
|
146
|
-
const CoverTitle = styled
|
|
147
|
-
|
|
168
|
+
const CoverTitle = styled("h1", {
|
|
169
|
+
shouldForwardProp: (prop) => prop !== "showProgress",
|
|
170
|
+
})(({ theme, showProgress }) => css `
|
|
148
171
|
word-wrap: break-word;
|
|
149
172
|
word-break: keep-all;
|
|
150
173
|
|
|
151
|
-
margin: auto 0 ${showProgress ?
|
|
174
|
+
margin: auto 0 ${showProgress ? "4px" : "8px"} 0;
|
|
152
175
|
color: ${CARD_COLOR_PALETTE(theme).text};
|
|
153
176
|
|
|
154
177
|
/* Alt/Paragraph/16px-Eb */
|
|
@@ -164,8 +187,7 @@ const CoverTitle = styled.h1 `
|
|
|
164
187
|
display: -webkit-box;
|
|
165
188
|
-webkit-line-clamp: 7;
|
|
166
189
|
-webkit-box-orient: vertical;
|
|
167
|
-
`
|
|
168
|
-
`;
|
|
190
|
+
`);
|
|
169
191
|
const BookGradient = styled.div `
|
|
170
192
|
width: 200px;
|
|
171
193
|
height: ${BOOK_HEIGHT}px;
|