@team-monolith/cds 1.91.2 → 1.92.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 { TagProps } from "../Tag";
|
|
2
3
|
export declare const bookClasses: {
|
|
3
4
|
readonly cover: "Book-cover";
|
|
4
5
|
readonly progressText: "Book-progressText";
|
|
@@ -35,6 +36,8 @@ export interface BookProps {
|
|
|
35
36
|
icon?: React.ReactNode;
|
|
36
37
|
/** 진행도 프로그레스 바 표시를 위한 정보 */
|
|
37
38
|
progressInfo?: ProgressInfo;
|
|
39
|
+
/** 상단에 노출될 Tag 컴포넌트 관련 속성 */
|
|
40
|
+
tagProps?: TagProps;
|
|
38
41
|
}
|
|
39
42
|
/**
|
|
40
43
|
* Framer Motion의 whileHover를 사용하지 않고 직접 애니메이션 상태를 관리합니다.
|
|
@@ -6,6 +6,7 @@ import { forwardRef, useState } from "react";
|
|
|
6
6
|
import { shadows } from "../../foundation/shadows";
|
|
7
7
|
import { EyeOffFillIcon } from "../../icons";
|
|
8
8
|
import { motion } from "framer-motion";
|
|
9
|
+
import { Tag } from "../Tag";
|
|
9
10
|
export const bookClasses = {
|
|
10
11
|
cover: "Book-cover",
|
|
11
12
|
progressText: "Book-progressText",
|
|
@@ -79,7 +80,7 @@ const CARD_COLOR_PALETTE = (theme) => ({
|
|
|
79
80
|
* @returns
|
|
80
81
|
*/
|
|
81
82
|
export const Book = forwardRef(function Book(props, ref) {
|
|
82
|
-
const { className, title, subtitle, subtitleBold, isHidden = false, buttons, open: controlledOpen, onHoverStart, onHoverEnd, onCoverClick, icon, progressInfo, } = props;
|
|
83
|
+
const { className, title, subtitle, subtitleBold, isHidden = false, buttons, open: controlledOpen, onHoverStart, onHoverEnd, onCoverClick, icon, progressInfo, tagProps, } = props;
|
|
83
84
|
const theme = useTheme();
|
|
84
85
|
const [open, setOpen] = useState(false);
|
|
85
86
|
return (_jsxs(Container, Object.assign({ className: className, initial: "closed", animate: (controlledOpen !== null && controlledOpen !== void 0 ? controlledOpen : open) ? "open" : "closed", ref: ref, onHoverStart: () => {
|
|
@@ -101,7 +102,7 @@ export const Book = forwardRef(function Book(props, ref) {
|
|
|
101
102
|
top: 50%;
|
|
102
103
|
transform: translate(-50%, -50%);
|
|
103
104
|
opacity: 0.8;
|
|
104
|
-
` })] })), _jsxs(CoverTexts, Object.assign({ variants: buttons ? textMotion : undefined }, { children: [_jsx(Subtitle, { children: subtitle }), _jsx(Subtitle, Object.assign({ css: css `
|
|
105
|
+
` })] })), _jsxs(CoverTexts, Object.assign({ variants: buttons ? textMotion : undefined }, { children: [tagProps && _jsx(Tag, Object.assign({}, tagProps)), _jsx(Subtitle, { children: subtitle }), _jsx(Subtitle, Object.assign({ css: css `
|
|
105
106
|
font-weight: 800;
|
|
106
107
|
` }, { children: subtitleBold })), _jsx(CoverTitle, Object.assign({ showProgress: Boolean(progressInfo) }, { children: title })), progressInfo && (_jsxs(Progress, { children: [_jsx("div", Object.assign({ className: bookClasses.progressText }, { children: progressInfo.title })), _jsxs("div", Object.assign({ css: css `
|
|
107
108
|
display: flex;
|
package/dist/components/Tag.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export type TagColor = "default" | "red" | "teal" | "orange" | "blue" | "green" | "yellow" | "black"
|
|
2
|
+
export type TagColor = "default" | "red" | "teal" | "orange" | "blue" | "green" | "yellow" | "black";
|
|
3
3
|
export interface TagProps {
|
|
4
4
|
className?: string;
|
|
5
5
|
component?: React.ElementType;
|
package/dist/components/Tag.js
CHANGED
|
@@ -63,10 +63,6 @@ const COLOR_TO_STYLE = (theme, color) => ({
|
|
|
63
63
|
background: ${theme.color.container.obsidianContainer};
|
|
64
64
|
color: ${theme.color.container.obsidianOnContainer};
|
|
65
65
|
`,
|
|
66
|
-
ai: css `
|
|
67
|
-
background: linear-gradient(94deg, #5898ff 5.24%, #c673e4 96.99%);
|
|
68
|
-
color: ${theme.color.container.obsidianOnContainer};
|
|
69
|
-
`,
|
|
70
66
|
})[color];
|
|
71
67
|
/**
|
|
72
68
|
* [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=42-869&t=HZXCHP0r0tbvMA6v-0)
|