@team-monolith/cds 1.61.0 → 1.61.2
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
CHANGED
|
@@ -106,6 +106,20 @@ interface CodleColors {
|
|
|
106
106
|
ebookAlt: string;
|
|
107
107
|
makecode: string;
|
|
108
108
|
makecodeAlt: string;
|
|
109
|
+
decorativeRed: string;
|
|
110
|
+
decorativePink: string;
|
|
111
|
+
decorativeAmber: string;
|
|
112
|
+
decorativeGrass: string;
|
|
113
|
+
decorativeGreen: string;
|
|
114
|
+
decorativeBlue: string;
|
|
115
|
+
decorativeIndigo: string;
|
|
116
|
+
decorativePurple: string;
|
|
117
|
+
decorativeBrown: string;
|
|
118
|
+
decorativeCopper: string;
|
|
119
|
+
decorativeGold: string;
|
|
120
|
+
decorativeSilver: string;
|
|
121
|
+
decorativeGray: string;
|
|
122
|
+
decorativeBlack: string;
|
|
109
123
|
};
|
|
110
124
|
blanket: {
|
|
111
125
|
neutral: string;
|
|
@@ -111,6 +111,20 @@ export const light = {
|
|
|
111
111
|
ebookAlt: "#E0F2FF",
|
|
112
112
|
makecode: "#AA278F",
|
|
113
113
|
makecodeAlt: "#FFE0F9",
|
|
114
|
+
decorativeRed: "#D73152",
|
|
115
|
+
decorativePink: "#D13D78",
|
|
116
|
+
decorativeAmber: "#CC4827",
|
|
117
|
+
decorativeGrass: "#6E7B3F",
|
|
118
|
+
decorativeGreen: "#26864B",
|
|
119
|
+
decorativeBlue: "#0076D0",
|
|
120
|
+
decorativeIndigo: "#5863FF",
|
|
121
|
+
decorativePurple: "#9A3BBC",
|
|
122
|
+
decorativeBrown: "#996C49",
|
|
123
|
+
decorativeCopper: "#8A6470",
|
|
124
|
+
decorativeGold: "#876E3F",
|
|
125
|
+
decorativeSilver: "#6A7781",
|
|
126
|
+
decorativeGray: "#747474",
|
|
127
|
+
decorativeBlack: "#474658",
|
|
114
128
|
},
|
|
115
129
|
blanket: {
|
|
116
130
|
neutral: COLOR.alpha030,
|
|
@@ -228,6 +242,20 @@ export const dark = {
|
|
|
228
242
|
ebookAlt: "#475966",
|
|
229
243
|
makecode: "#AA278F",
|
|
230
244
|
makecodeAlt: "#664760",
|
|
245
|
+
decorativeRed: "#D73152",
|
|
246
|
+
decorativePink: "#D13D78",
|
|
247
|
+
decorativeAmber: "#CC4827",
|
|
248
|
+
decorativeGrass: "#6E7B3F",
|
|
249
|
+
decorativeGreen: "#26864B",
|
|
250
|
+
decorativeBlue: "#0076D0",
|
|
251
|
+
decorativeIndigo: "#5863FF",
|
|
252
|
+
decorativePurple: "#9A3BBC",
|
|
253
|
+
decorativeBrown: "#996C49",
|
|
254
|
+
decorativeCopper: "#8A6470",
|
|
255
|
+
decorativeGold: "#876E3F",
|
|
256
|
+
decorativeSilver: "#6A7781",
|
|
257
|
+
decorativeGray: "#747474",
|
|
258
|
+
decorativeBlack: "#474658",
|
|
231
259
|
},
|
|
232
260
|
blanket: {
|
|
233
261
|
neutral: COLOR.alphaf20,
|
|
@@ -12,6 +12,7 @@ export interface BookProps {
|
|
|
12
12
|
onHoverEnd?: () => void;
|
|
13
13
|
onCoverClick?: () => void;
|
|
14
14
|
icon?: React.ReactNode;
|
|
15
|
+
coverColor: string;
|
|
15
16
|
}
|
|
16
17
|
declare const _default: React.ForwardRefExoticComponent<BookProps & React.RefAttributes<HTMLDivElement>>;
|
|
17
18
|
export default _default;
|
|
@@ -54,7 +54,6 @@ const buttonsMotion = {
|
|
|
54
54
|
};
|
|
55
55
|
const CARD_COLOR_PALETTE = (theme) => ({
|
|
56
56
|
border: theme.color.foreground.primaryDisabled,
|
|
57
|
-
backgrond: theme.color.background.primary,
|
|
58
57
|
text: theme.color.foreground.neutralAlt,
|
|
59
58
|
});
|
|
60
59
|
/**
|
|
@@ -74,7 +73,7 @@ const CARD_COLOR_PALETTE = (theme) => ({
|
|
|
74
73
|
* @returns
|
|
75
74
|
*/
|
|
76
75
|
function Book(props, ref) {
|
|
77
|
-
const { className, title, chapter, courseType, isHidden = false, buttons, open: controlledOpen, onHoverStart, onHoverEnd, onCoverClick, icon, } = props;
|
|
76
|
+
const { className, title, chapter, courseType, coverColor, isHidden = false, buttons, open: controlledOpen, onHoverStart, onHoverEnd, onCoverClick, icon, } = props;
|
|
78
77
|
const theme = useTheme();
|
|
79
78
|
const [open, setOpen] = useState(false);
|
|
80
79
|
return (_jsxs(Container, Object.assign({ initial: "closed", animate: (controlledOpen !== undefined ? controlledOpen : open)
|
|
@@ -85,7 +84,7 @@ function Book(props, ref) {
|
|
|
85
84
|
}, onHoverEnd: () => {
|
|
86
85
|
setOpen(false);
|
|
87
86
|
onHoverEnd === null || onHoverEnd === void 0 ? void 0 : onHoverEnd();
|
|
88
|
-
} }, { children: [_jsxs(Cover, Object.assign({ className: className, variants: coverMotion, onClick: () => {
|
|
87
|
+
} }, { children: [_jsxs(Cover, Object.assign({ className: className, backgroundColor: coverColor, variants: coverMotion, onClick: () => {
|
|
89
88
|
setOpen(!open);
|
|
90
89
|
onCoverClick === null || onCoverClick === void 0 ? void 0 : onCoverClick();
|
|
91
90
|
} }, { children: [icon && _jsx(CoverIcon, { children: icon }), isHidden && (_jsxs(_Fragment, { children: [_jsx(Hide, {}), _jsx(EyeOffFillIcon, { color: theme.color.foreground.neutralAlt, css: css `
|
|
@@ -112,11 +111,11 @@ const Container = styled(motion.div) `
|
|
|
112
111
|
|
|
113
112
|
padding-top: ${HOVER_Y_OFFSET}px;
|
|
114
113
|
`;
|
|
115
|
-
const Cover = styled(motion.div)(({
|
|
114
|
+
const Cover = styled(motion.div)(({ backgroundColor }) => css `
|
|
116
115
|
height: ${BOOK_HEIGHT}px;
|
|
117
116
|
|
|
118
117
|
border-radius: 8px;
|
|
119
|
-
background: ${
|
|
118
|
+
background: ${backgroundColor};
|
|
120
119
|
box-shadow: ${shadows.shadow04};
|
|
121
120
|
|
|
122
121
|
display: flex;
|