@edu-tosel/design 1.0.98 → 1.0.99
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/card/template/ConfirmCard/index.d.ts +1 -11
- package/card/template/ProgressCard/Large.d.ts +1 -1
- package/card/template/ProgressCard/Large.js +2 -1
- package/card/template/ProgressCard/Small.js +1 -0
- package/globals.css +3 -0
- package/interface/Card.d.ts +10 -1
- package/layout/template/promotion/Layout.js +46 -5
- package/package.json +2 -1
- package/version.txt +1 -1
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
interface ConfirmCardProps {
|
|
3
|
-
titles: Titles;
|
|
4
|
-
action?: Omit<ActionProps, "shows">;
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
buttons: [LabelWidget, LabelWidget];
|
|
7
|
-
option?: {
|
|
8
|
-
className?: string;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
1
|
+
import { ConfirmCardProps } from "../../../interface";
|
|
11
2
|
export default function ConfirmCard(props: ConfirmCardProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ProgressCardProps } from "../../../interface";
|
|
2
|
-
export default function ProgressCardLG({ titles, checks, displays, theme, }: ProgressCardProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function ProgressCardLG({ titles, checks, displays, theme, option, }: ProgressCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -15,7 +15,7 @@ const text = {
|
|
|
15
15
|
green: "text-green-dark",
|
|
16
16
|
blue: "text-blue-navy",
|
|
17
17
|
};
|
|
18
|
-
export default function ProgressCardLG({ titles, checks, displays, theme, }) {
|
|
18
|
+
export default function ProgressCardLG({ titles, checks, displays, theme, option, }) {
|
|
19
19
|
const progressBox = {
|
|
20
20
|
positions: "absolute top-7.5 left-7.5",
|
|
21
21
|
displays: "flex",
|
|
@@ -34,6 +34,7 @@ export default function ProgressCardLG({ titles, checks, displays, theme, }) {
|
|
|
34
34
|
};
|
|
35
35
|
const occupied = Math.round((checks.filter((value) => !!value).length / displays.length) * 100);
|
|
36
36
|
return (_jsxs(CardDesign, { option: {
|
|
37
|
+
...option,
|
|
37
38
|
width: "2xl",
|
|
38
39
|
height: "2xs",
|
|
39
40
|
}, children: [_jsx("div", { className: cn(progressBox), children: displays.map(({ title }, index) => (_jsxs("div", { className: cn(stepBox(checks[index])), children: [_jsx("div", { children: title }), _jsx(SVG.Operation.Checked, { flag: checks[index], size: 25, theme: theme })] }, title))) }), _jsxs("div", { className: cn(titleBox), children: [_jsx("div", { className: `text-xl leading-none font-pretendard-bold ${text[theme ?? "green"]}`, children: titles.title }), _jsx("div", { className: "text-base leading-none", children: titles.subtitle })] }), _jsx("div", { className: "absolute bottom-0 left-0 bg-gray-light w-full h-2.5", children: _jsx("div", { className: `h-full ${widthSizes[occupied]} ${bg[theme ?? "green"]}` }) })] }));
|
|
@@ -40,6 +40,7 @@ export default function ProgressCardSmall({ titles, displays, checks, nowFocus,
|
|
|
40
40
|
styles: text[theme],
|
|
41
41
|
};
|
|
42
42
|
return (_jsxs(CardDesign, { option: {
|
|
43
|
+
...option,
|
|
43
44
|
width: size ?? "md",
|
|
44
45
|
height: "5xs",
|
|
45
46
|
}, children: [_jsx("div", { className: cn(progressBox), children: displays.map(({ title, subtitle }, index) => (_jsxs("div", { className: cn(stepBox(index === nowFocus)), children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "leading-none text-[12px] font-pretendard-bold", children: title }), _jsx(SVG.Operation.Checked, { flag: checks[index], size: 25, theme: "green" })] }), _jsx("div", { className: `text-[12px] ${text[theme]}`, children: subtitle })] }, title))) }), _jsxs("div", { className: cn(titleBox), children: [_jsx("div", { className: cn(titleStyle), children: titles.title }), _jsx("div", { className: `text-[12px] leading-none ${text[theme]}`, children: titles.subtitle })] })] }));
|
package/globals.css
CHANGED
package/interface/Card.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ import { Theme } from "./Theme";
|
|
|
4
4
|
import { Flexify } from "./UtilityType";
|
|
5
5
|
import { ButtonWidgetOption, SelectSwitchWidgetOption, SelectToggleWidgetOption } from "./widget/WidgetOption";
|
|
6
6
|
import { ReactNode } from "react";
|
|
7
|
+
import { ActionProps } from "./Action";
|
|
8
|
+
import { LabelWidget } from "./widget";
|
|
7
9
|
interface CardOption {
|
|
8
10
|
className?: string;
|
|
9
11
|
boundary?: string;
|
|
@@ -153,7 +155,7 @@ export interface ProgressCardProps {
|
|
|
153
155
|
theme?: Theme;
|
|
154
156
|
option?: {
|
|
155
157
|
size?: Size;
|
|
156
|
-
};
|
|
158
|
+
} & CardOption;
|
|
157
159
|
}
|
|
158
160
|
export type ControlContentWidgetOption<T> = ButtonWidgetOption | SelectSwitchWidgetOption<T> | SelectToggleWidgetOption<T>;
|
|
159
161
|
export interface ControlContent<T> {
|
|
@@ -164,4 +166,11 @@ export interface ControlCardProps<T> {
|
|
|
164
166
|
contents: ControlContent<T>[];
|
|
165
167
|
option?: CardOption;
|
|
166
168
|
}
|
|
169
|
+
export interface ConfirmCardProps {
|
|
170
|
+
titles: Titles;
|
|
171
|
+
action?: Omit<ActionProps, "shows">;
|
|
172
|
+
children?: React.ReactNode;
|
|
173
|
+
buttons: [LabelWidget, LabelWidget];
|
|
174
|
+
option?: CardOption;
|
|
175
|
+
}
|
|
167
176
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
2
3
|
import { IoIosSearch } from "react-icons/io";
|
|
4
|
+
import dayjs from "dayjs";
|
|
5
|
+
import { BsCreditCard } from "react-icons/bs";
|
|
3
6
|
export default function Layout() {
|
|
4
|
-
// 0 : 기간 제한 있음
|
|
5
|
-
// 1 : 기간 제한 없음 -> 상시 이벤트
|
|
6
|
-
// 2 : 기간 제한 없음 & 소식
|
|
7
7
|
const eventsData = [
|
|
8
8
|
{
|
|
9
9
|
id: 1,
|
|
@@ -63,5 +63,46 @@ export default function Layout() {
|
|
|
63
63
|
title: "토셀, 경찰대학교 편입학전형 / 졸업인증 평가 반영",
|
|
64
64
|
},
|
|
65
65
|
];
|
|
66
|
-
|
|
66
|
+
const [selectedEvent, setSelectedEvent] = useState(null);
|
|
67
|
+
const handleCardClick = (event) => {
|
|
68
|
+
setSelectedEvent(event);
|
|
69
|
+
};
|
|
70
|
+
const handleBackToList = () => {
|
|
71
|
+
setSelectedEvent(null);
|
|
72
|
+
};
|
|
73
|
+
const getStatusText = (event) => {
|
|
74
|
+
const now = dayjs();
|
|
75
|
+
const startDate = dayjs(event.startDate);
|
|
76
|
+
const endDate = event.endDate ? dayjs(event.endDate) : dayjs(event.endData);
|
|
77
|
+
if (event.type === "0") {
|
|
78
|
+
if (now.isBefore(startDate)) {
|
|
79
|
+
return (_jsx("span", { className: "px-2 py-1 text-2xs font-semibold rounded-md bg-green-dark text-white", children: "\uC624\uD508\uC608\uC815" }));
|
|
80
|
+
}
|
|
81
|
+
else if (now.isAfter(endDate)) {
|
|
82
|
+
return (_jsx("span", { className: "px-2 py-1 text-2xs font-semibold rounded-md bg-gray-light text-gray-mid", children: "\uB9C8\uAC10" }));
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
const diff = endDate.diff(now, "day");
|
|
86
|
+
return (_jsxs("span", { className: "px-2 py-1 text-2xs font-semibold rounded-md bg-green-dark/10 text-green-dark", children: ["\uC9C4\uD589\uC911 | D-", diff] }));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
else if (event.type === "1") {
|
|
90
|
+
return (_jsx("div", { className: "w-[63px] h-[22px] rounded-md bg-black flex items-center justify-center", style: {
|
|
91
|
+
background: "linear-gradient(269deg, rgba(118, 0, 35, 0.10) 0%, rgba(16, 86, 82, 0.10) 100%)",
|
|
92
|
+
}, children: _jsx("div", { className: "px-2 py-1 text-2xs font-semibold rounded-md", style: {
|
|
93
|
+
background: "linear-gradient(269deg, rgba(118, 0, 35) 0%, rgba(16, 86, 82) 100%)",
|
|
94
|
+
WebkitBackgroundClip: "text",
|
|
95
|
+
WebkitTextFillColor: "transparent",
|
|
96
|
+
}, children: "\uC0C1\uC2DC \uC774\uBCA4\uD2B8" }) }));
|
|
97
|
+
}
|
|
98
|
+
else if (event.type === "2") {
|
|
99
|
+
return (_jsx("span", { className: "px-2 py-1 text-2xs font-semibold rounded-md bg-blue-navy/10 text-blue-navy", children: "\uD1A0\uC140 \uC18C\uC2DD" }));
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
return "";
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
return (_jsxs("div", { className: "min-h-screen w-full mx-auto", children: [_jsx("img", { src: "/images/promotion/promotionHeader.png", alt: "" }), _jsx("div", { className: "w-[1200px] h-full flex flex-col mx-auto", children: selectedEvent ? (_jsxs("div", { className: "flex", children: [_jsx("div", { className: "min-w-[320px] h-auto p-5", children: _jsxs("div", { className: "w-full h-auto rounded-xl transition-all duration-500", children: [_jsx("div", { className: "w-full h-50 overflow-hidden", children: _jsx("img", { src: selectedEvent.img, alt: "", className: "rounded-xl h-full object-cover" }) }), _jsxs("div", { className: "w-full h-auto pt-5 gap-3 flex flex-col", children: [_jsx("div", { className: "flex items-center", children: getStatusText(selectedEvent) }), _jsx("div", { className: "text-sm font-bold text-gray-dark flex items-center mb-2", children: selectedEvent.title }), _jsxs("div", { className: "w-full h-12 flex items-center justify-center rounded-md text-white cursor-pointer font-bold gap-3", style: {
|
|
106
|
+
background: "linear-gradient(269deg, rgba(118, 0, 35) 0%, rgba(16, 86, 82) 100%)",
|
|
107
|
+
}, children: [_jsx(BsCreditCard, { className: "text-xl" }), "\uC5F0\uB3D9\uD558\uACE0 \uCFE0\uD3F0\uBC1B\uAE30"] })] })] }, selectedEvent.id) }), _jsxs("div", { className: "flex-grow p-5", children: [_jsx("div", { children: _jsx("img", { src: selectedEvent.body, className: "w-full rounded-xl object-cover", alt: "" }) }), _jsx("button", { onClick: handleBackToList, className: "p-5 bg-green-dark/5 text-green-dark rounded-xl flex items-center justify-center hover:bg-green-dark/20 transition-all", children: "\uBAA9\uB85D\uC73C\uB85C \uB3CC\uC544\uAC00\uAE30" })] })] })) : (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex justify-between h-14.5 border-b-1", children: [_jsxs("div", { className: "w-80 h-9.5 flex items-center bg-[#f0f0f0]/10 rounded-xl", children: [_jsx(IoIosSearch, { className: "text-2xl text-green-dark mr-3" }), _jsx("input", { type: "text", placeholder: "\uD0A4\uC6CC\uB4DC\uB97C \uC785\uB825\uD558\uC138\uC694.", className: "w-full h-full text-md bg-[#f0f0f0]/10 placeholder:text-[#7f7f7f] placeholder:font-light outline-none" })] }), _jsx("div", { className: "flex h-9.5 items-center justify-center", children: ["모두보기", "진행 중", "예정된", "토셀소식"].map((item) => (_jsx("div", { className: "text-xs p-3 flex items-center justify-center cursor-pointer", children: item }, item))) })] }), _jsx("div", { className: "pt-5 flex grid grid-cols-3 gap-5 rounded-xl", children: eventsData.map((event) => (_jsxs("div", { onClick: () => handleCardClick(event), className: "w-full h-84 shadow-md rounded-xl cursor-pointer box-shadow-green transition-all duration-500", children: [_jsx("div", { className: "w-full h-50 rounded-t-xl overflow-hidden", children: _jsx("img", { src: event.img, alt: "" }) }), _jsxs("div", { className: "w-full h-34 p-8 gap-3 flex flex-col", children: [_jsx("div", { className: "flex items-center", children: getStatusText(event) }), _jsx("div", { className: "text-sm font-bold text-gray-dark flex items-center", children: event.title })] })] }, event.id))) })] })) })] }));
|
|
67
108
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edu-tosel/design",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.99",
|
|
4
4
|
"description": "UI components for International TOSEL Committee",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jsx",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"date-fns": "^2.30.0",
|
|
18
18
|
"date-fns-tz": "^2.0.1",
|
|
19
|
+
"dayjs": "^1.11.12",
|
|
19
20
|
"react": "^18.2.0",
|
|
20
21
|
"react-beautiful-dnd": "^13.1.1",
|
|
21
22
|
"react-datepicker": "^6.4.0",
|
package/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.99
|