@edu-tosel/design 1.0.270 → 1.0.272
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/layout/template/Event/Many.js +2 -2
- package/layout/template/Event/molecule/Banner.d.ts +3 -0
- package/layout/template/Event/molecule/Banner.js +1 -1
- package/layout/template/home/Float.d.ts +10 -0
- package/layout/template/home/Float.js +18 -0
- package/layout/template/home/index.d.ts +2 -0
- package/layout/template/home/index.js +2 -0
- package/layout/template/home/layout/Navigation.js +23 -6
- package/modal/organism/Pop.d.ts +1 -3
- package/modal/organism/Pop.js +6 -2
- package/modal/template/index.js +5 -6
- package/package.json +1 -1
- package/version.txt +1 -1
|
@@ -3,7 +3,7 @@ import { useState } from "react";
|
|
|
3
3
|
import { IoIosSearch } from "react-icons/io";
|
|
4
4
|
import dayjs from "dayjs";
|
|
5
5
|
import { LineBreaks } from "../../../text";
|
|
6
|
-
import {
|
|
6
|
+
import { Tag } from "./molecule/Banner";
|
|
7
7
|
export default function Many({ events }) {
|
|
8
8
|
const [filter, setFilter] = useState("모두보기");
|
|
9
9
|
const [searchQuery, setSearchQuery] = useState("");
|
|
@@ -25,5 +25,5 @@ export default function Many({ events }) {
|
|
|
25
25
|
return false;
|
|
26
26
|
})
|
|
27
27
|
.filter((event) => event.title.includes(searchQuery));
|
|
28
|
-
return (_jsx("div", { className: "min-h-screen w-full mx-auto", children: _jsx("div", { className: "mmd:max-w-300 h-full flex flex-col mx-auto px-10", children: _jsxs(_Fragment, { children: [_jsxs("div", { className: "flex flex-col sm:flex-row justify-between min-h-14.5 border-b-1", children: [_jsxs("div", { className: "w-full mb-5 h-9 sm:w-80 sm:h-9.5 flex items-center bg-[#f0f0f0]/10 rounded-xl", children: [_jsx(IoIosSearch, { className: "text-xl text-green-dark mr-3" }), _jsx("input", { type: "text", placeholder: "\uD0A4\uC6CC\uB4DC\uB97C \uC785\uB825\uD558\uC138\uC694.", value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), className: "w-full h-full text-sm bg-[#f0f0f0]/10 placeholder:text-[#7f7f7f] placeholder:font-light outline-none" })] }), _jsx("div", { className: "flex h-9 pb-5 sm:pb-0 sm:h-9.5 items-center sm:justify-center ", children: ["모두보기", "진행 중", "예정된", "토셀소식"].map((item) => (_jsx("div", { className: `text-xs sm:text-2xs md:text-xs p-2 sm:p-3 flex items-center justify-center cursor-pointer rounded-lg ${filter === item ? "bg-green-dark/10 text-green-dark" : ""}`, onClick: () => setFilter(item), children: item }, item))) })] }), _jsx("div", { className: "pt-5 grid sm:grid-cols-2 mmd:grid-cols-3 gap-5 rounded-xl", children: filteredEvents.map((event) => (_jsxs("div", { onClick: event.onClick, className: "w-full max-h-84 shadow-md rounded-xl cursor-pointer box-shadow-green transition-all duration-500", children: [_jsx("div", { className: "w-full max-h-50 rounded-t-xl overflow-hidden relative", children: _jsx("img", { src: event.thumbnail, alt: "", className: "w-full" }) }), _jsxs("div", { className: "w-full min-h-34 p-8 gap-3 flex flex-col", children: [_jsx("div", { className: "flex items-center", children: _jsx(
|
|
28
|
+
return (_jsx("div", { className: "min-h-screen w-full mx-auto", children: _jsx("div", { className: "mmd:max-w-300 h-full flex flex-col mx-auto px-10", children: _jsxs(_Fragment, { children: [_jsxs("div", { className: "flex flex-col sm:flex-row justify-between min-h-14.5 border-b-1", children: [_jsxs("div", { className: "w-full mb-5 h-9 sm:w-80 sm:h-9.5 flex items-center bg-[#f0f0f0]/10 rounded-xl", children: [_jsx(IoIosSearch, { className: "text-xl text-green-dark mr-3" }), _jsx("input", { type: "text", placeholder: "\uD0A4\uC6CC\uB4DC\uB97C \uC785\uB825\uD558\uC138\uC694.", value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), className: "w-full h-full text-sm bg-[#f0f0f0]/10 placeholder:text-[#7f7f7f] placeholder:font-light outline-none" })] }), _jsx("div", { className: "flex h-9 pb-5 sm:pb-0 sm:h-9.5 items-center sm:justify-center ", children: ["모두보기", "진행 중", "예정된", "토셀소식"].map((item) => (_jsx("div", { className: `text-xs sm:text-2xs md:text-xs p-2 sm:p-3 flex items-center justify-center cursor-pointer rounded-lg ${filter === item ? "bg-green-dark/10 text-green-dark" : ""}`, onClick: () => setFilter(item), children: item }, item))) })] }), _jsx("div", { className: "pt-5 grid sm:grid-cols-2 mmd:grid-cols-3 gap-5 rounded-xl", children: filteredEvents.map((event) => (_jsxs("div", { onClick: event.onClick, className: "w-full max-h-84 shadow-md rounded-xl cursor-pointer box-shadow-green transition-all duration-500", children: [_jsx("div", { className: "w-full max-h-50 rounded-t-xl overflow-hidden relative", children: _jsx("img", { src: event.thumbnail, alt: "", className: "w-full" }) }), _jsxs("div", { className: "w-full min-h-34 p-8 gap-3 flex flex-col", children: [_jsx("div", { className: "flex items-center", children: _jsx(Tag, { event: event }) }), _jsx(LineBreaks, { className: "text-sm font-bold text-gray-dark flex items-center", texts: event.title })] })] }, event.id))) })] }) }) }));
|
|
29
29
|
}
|
|
@@ -28,7 +28,7 @@ export default function BannerMolecule({ event }) {
|
|
|
28
28
|
text: [button?.option?.text, "font-bold"].join(" "),
|
|
29
29
|
} })] })] }));
|
|
30
30
|
}
|
|
31
|
-
function Tag({ event }) {
|
|
31
|
+
export function Tag({ event }) {
|
|
32
32
|
const { tag } = convertEventElement(event);
|
|
33
33
|
const container = {
|
|
34
34
|
selfAligns: "self-start",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { OnClick } from "../../../interface";
|
|
2
|
+
interface Content {
|
|
3
|
+
image: string;
|
|
4
|
+
onClick: OnClick;
|
|
5
|
+
background?: string;
|
|
6
|
+
}
|
|
7
|
+
export default function Float({ contents }: {
|
|
8
|
+
contents: Content[];
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../../util";
|
|
3
|
+
export default function Float({ contents }) {
|
|
4
|
+
const container = {
|
|
5
|
+
displays: "fixed flex flex-col bottom-16 right-16 z-40 overflow-visible",
|
|
6
|
+
spacings: "gap-5",
|
|
7
|
+
};
|
|
8
|
+
const buttonBox = (background) => ({
|
|
9
|
+
displays: "flex flex-col justify-center items-center",
|
|
10
|
+
spacings: "p-3",
|
|
11
|
+
sizes: "w-16 h-16",
|
|
12
|
+
styles: "rounded-full bg-black overflow-hidden",
|
|
13
|
+
backgrounds: background ?? "bg-white",
|
|
14
|
+
shadows: "shadow-main",
|
|
15
|
+
animation: "hover:scale-110 duration-300 hover:shadow-icon-hover",
|
|
16
|
+
});
|
|
17
|
+
return (_jsx("div", { className: cn(container), children: contents.map(({ image, onClick, background }) => (_jsx("button", { onClick: onClick, className: cn(buttonBox(background)), children: _jsx("img", { src: image, alt: "image", className: "object-contain" }) }, image))) }));
|
|
18
|
+
}
|
|
@@ -5,6 +5,7 @@ import Announcement from "./Announcement";
|
|
|
5
5
|
import NewsPaper from "./NewsPaper";
|
|
6
6
|
import Service from "./Service";
|
|
7
7
|
import Shortcut from "./Shortcut";
|
|
8
|
+
import Float from "./Float";
|
|
8
9
|
declare const Home: {
|
|
9
10
|
Layout: typeof Layout;
|
|
10
11
|
Navigation: typeof Navigation;
|
|
@@ -13,5 +14,6 @@ declare const Home: {
|
|
|
13
14
|
Shortcut: typeof Shortcut;
|
|
14
15
|
Service: typeof Service;
|
|
15
16
|
NewsPaper: typeof NewsPaper;
|
|
17
|
+
Float: typeof Float;
|
|
16
18
|
};
|
|
17
19
|
export default Home;
|
|
@@ -5,6 +5,7 @@ import Announcement from "./Announcement";
|
|
|
5
5
|
import NewsPaper from "./NewsPaper";
|
|
6
6
|
import Service from "./Service";
|
|
7
7
|
import Shortcut from "./Shortcut";
|
|
8
|
+
import Float from "./Float";
|
|
8
9
|
const Home = {
|
|
9
10
|
Layout,
|
|
10
11
|
Navigation,
|
|
@@ -13,5 +14,6 @@ const Home = {
|
|
|
13
14
|
Shortcut,
|
|
14
15
|
Service,
|
|
15
16
|
NewsPaper,
|
|
17
|
+
Float,
|
|
16
18
|
};
|
|
17
19
|
export default Home;
|
|
@@ -61,11 +61,29 @@ export default function Navigation({ browser, calendar, notice, event, }) {
|
|
|
61
61
|
const [position, setPosition] = useState({ x: 0, y: 0 });
|
|
62
62
|
const [tooltipText, setTooltipText] = useState(null);
|
|
63
63
|
const handleMouseMove = (event) => {
|
|
64
|
-
|
|
64
|
+
const viewportScale = window.visualViewport?.scale || 1; // 뷰포트 확대 비율
|
|
65
|
+
// 마우스 좌표를 확대 비율을 고려하여 보정
|
|
66
|
+
const correctedX = event.clientX / viewportScale + 20; // 커서 기준 10px 우측
|
|
67
|
+
const correctedY = (event.clientY - 230) / viewportScale + 10; // 커서 기준 10px 아래
|
|
68
|
+
// 툴팁이 화면을 벗어나지 않도록 조정
|
|
69
|
+
const tooltipWidth = 120; // 예상 툴팁 너비
|
|
70
|
+
const tooltipHeight = 40; // 예상 툴팁 높이
|
|
71
|
+
const viewportWidth = window.innerWidth;
|
|
72
|
+
const viewportHeight = window.innerHeight;
|
|
73
|
+
let adjustedX = correctedX;
|
|
74
|
+
let adjustedY = correctedY;
|
|
75
|
+
if (adjustedX + tooltipWidth > viewportWidth) {
|
|
76
|
+
adjustedX = viewportWidth - tooltipWidth - 10; // 오른쪽 경계 제한
|
|
77
|
+
}
|
|
78
|
+
if (adjustedY + tooltipHeight > viewportHeight) {
|
|
79
|
+
adjustedY = viewportHeight - tooltipHeight - 10; // 하단 경계 제한
|
|
80
|
+
}
|
|
81
|
+
setPosition({ x: adjustedX, y: adjustedY });
|
|
65
82
|
};
|
|
66
83
|
const handleMouseEnter = (event) => {
|
|
67
84
|
const text = event.currentTarget.getAttribute("data-tooltip");
|
|
68
|
-
|
|
85
|
+
if (text)
|
|
86
|
+
setTooltipText(text);
|
|
69
87
|
};
|
|
70
88
|
const handleMouseLeave = () => {
|
|
71
89
|
setTooltipText(null);
|
|
@@ -88,7 +106,7 @@ export default function Navigation({ browser, calendar, notice, event, }) {
|
|
|
88
106
|
boundaries: "rounded-t-lg rounded-b-none md:rounded-r-lg md:rounded-l-none",
|
|
89
107
|
};
|
|
90
108
|
const iconWrapper = {
|
|
91
|
-
displays: "flex justify-center items-center",
|
|
109
|
+
displays: "relative flex justify-center items-center",
|
|
92
110
|
sizes: "w-8 h-8 rounded-md",
|
|
93
111
|
animations: "hover:bg-white/20",
|
|
94
112
|
};
|
|
@@ -113,9 +131,8 @@ export default function Navigation({ browser, calendar, notice, event, }) {
|
|
|
113
131
|
};
|
|
114
132
|
return (_jsxs(_Fragment, { children: [overlayCoverTransition((styles, item) => item && (_jsx(animated.div, { style: styles, className: "bg-white h-screen fixed top-0 left-0 z-40 flex flex-col justify-center items-center overflow-hidden gap-y-14 ", children: _jsxs("div", { className: "flex flex-col justify-center items-center overflow-hidden gap-y-14 transition-none", children: [_jsx("img", { src: "/images/logos/tosel.png", alt: "tosel", width: 368.56, height: 80.07 }), _jsxs("div", { role: "status", children: [_jsxs("svg", { "aria-hidden": "true", className: "w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-green-dark", viewBox: "0 0 100 101", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z", fill: "currentColor" }), _jsx("path", { d: "M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z", fill: "currentFill" })] }), _jsx("span", { className: "sr-only", children: "Loading..." })] }), _jsx("div", { children: "dashboard loading..." })] }) }))), overlayPopTransition((styles, item) => type &&
|
|
115
133
|
item && (_jsx(animated.div, { style: styles, className: cn(blurContainer), children: _jsxs("div", { className: cn(itemBody), onClick: (e) => e.stopPropagation(), children: [_jsxs("div", { className: cn(scrollTitleWrapper), children: [_jsx("div", { className: cn(scrollTitle), children: navigationTypeString[type] }), _jsx("div", { className: "" })] }), _jsx("div", { className: cn(itemsContainer), children: _jsx(NavigationItem, { type: type, calendar: calendar, notice: notice, event: event }) })] }) }))), _jsx("div", { className: "fixed bottom-0 md:top-1/2 md:-translate-y-1/2 flex justify-center items-center z-45", children: _jsxs("div", { onClick: (e) => e.stopPropagation(), className: cn(container), children: [_jsx("button", { className: cn(iconWrapper), onClick: () => handleOpen("calendar"), "data-tooltip": "\uC2DC\uD5D8\uC77C\uC815", onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, onMouseMove: handleMouseMove, children: _jsx(SVG.Icon.Calendar, { size: isMobile ? "md" : "lg" }) }), _jsx("button", { className: cn(iconWrapper), onClick: () => handleOpen("notification"), "data-tooltip": "\uACF5\uC9C0\uC0AC\uD56D", onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, onMouseMove: handleMouseMove, children: _jsx(SVG.Icon.Notification, { size: isMobile ? "md" : "lg" }) }), _jsx("button", { className: cn(iconWrapper), onClick: () => handleOpen("search"), "data-tooltip": "\uAC80\uC0C9\uD558\uAE30", onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, onMouseMove: handleMouseMove, children: _jsx(SVG.Icon.Search, { size: isMobile ? "md" : "lg" }) }), _jsx("button", { className: cn(iconWrapper), onClick: () => handleOpen("browser"), "data-tooltip": "\uB300\uC2DC\uBCF4\uB4DC", onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, onMouseMove: handleMouseMove, children: _jsx(SVG.Icon.Browser, { size: isMobile ? "md" : "lg" }) }), _jsx("button", { className: cn(iconWrapper), onClick: () => handleOpen("event"), "data-tooltip": "\uC0C8\uC18C\uC2DD", onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, onMouseMove: handleMouseMove, children: _jsx(SVG.Icon.Newspaper, { size: isMobile ? "md" : "lg" }) }), tooltipText && (_jsx("div", { className: "absolute bg-gray-900 text-white text-sm px-3 py-1 rounded-lg transition-opacity duration-200 w-20 text-center", style: {
|
|
116
|
-
left: `${position.x
|
|
117
|
-
top: `${position.y
|
|
118
|
-
transform: "translate(-50%, -100%)",
|
|
134
|
+
left: `${position.x}px`,
|
|
135
|
+
top: `${position.y}px`,
|
|
119
136
|
pointerEvents: "none",
|
|
120
137
|
}, children: tooltipText }))] }) })] }));
|
|
121
138
|
}
|
package/modal/organism/Pop.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
-
export default function Pop({
|
|
3
|
-
isOpen: boolean;
|
|
4
|
-
setIsOpen: (value: boolean) => void;
|
|
2
|
+
export default function Pop({ children }: {
|
|
5
3
|
children: ReactNode;
|
|
6
4
|
}): import("react/jsx-runtime").JSX.Element;
|
package/modal/organism/Pop.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../../util";
|
|
3
|
-
|
|
3
|
+
import { useActionStore } from "../../store";
|
|
4
|
+
export default function Pop({ children }) {
|
|
5
|
+
const { events, clearModal } = useActionStore();
|
|
6
|
+
const isOpen = events.find((event) => event.type === "modal");
|
|
4
7
|
const container = {
|
|
5
8
|
positions: "fixed inset-0 z-100",
|
|
6
9
|
displays: "flex flex-col justify-center items-center",
|
|
@@ -12,6 +15,7 @@ export default function Pop({ isOpen, setIsOpen, children, }) {
|
|
|
12
15
|
const wrapper = {
|
|
13
16
|
displays: "flex flex-col justify-end items-center",
|
|
14
17
|
sizes: "w-full h-full",
|
|
18
|
+
//debug: "border-2 border-red-500",
|
|
15
19
|
};
|
|
16
20
|
const body = {
|
|
17
21
|
displays: "flex flex-col rounded-tl-lg rounded-tr-lg bg-white",
|
|
@@ -21,5 +25,5 @@ export default function Pop({ isOpen, setIsOpen, children, }) {
|
|
|
21
25
|
animation: "duration-300",
|
|
22
26
|
pointer: "pointer-events-auto",
|
|
23
27
|
};
|
|
24
|
-
return (_jsx("div", { className: cn(container), onClick: () =>
|
|
28
|
+
return (_jsx("div", { className: cn(container), onClick: () => clearModal(), children: _jsx("div", { className: cn(wrapper), children: _jsx("div", { className: cn(body), children: children }) }) }));
|
|
25
29
|
}
|
package/modal/template/index.js
CHANGED
|
@@ -11,21 +11,20 @@ function Modal({ titles, showAction, buttons, widgets, option }) {
|
|
|
11
11
|
const isMd = useResponsive("md");
|
|
12
12
|
const { className } = option ?? {};
|
|
13
13
|
const container = {
|
|
14
|
-
displays: "flex flex-col",
|
|
14
|
+
displays: "flex flex-col h-full",
|
|
15
15
|
};
|
|
16
16
|
const buttonBox = {
|
|
17
|
-
|
|
18
|
-
displays: "flex gap-1 md:gap-2.5",
|
|
17
|
+
displays: "flex gap-3",
|
|
19
18
|
};
|
|
20
19
|
const widgetBox = {
|
|
21
20
|
displays: "flex flex-col",
|
|
22
|
-
sizes: "w-full min-h-64",
|
|
21
|
+
sizes: "w-full min-h-64 ",
|
|
23
22
|
styles: className ?? "mt-2.5",
|
|
24
23
|
};
|
|
25
24
|
if (!isMd)
|
|
26
|
-
return (_jsx(ModalPop, {
|
|
25
|
+
return (_jsx(ModalPop, { children: _jsxs("div", { className: cn(container), children: [_jsx("div", { className: cn(widgetBox), children: widgets?.map((widget, index) => (_createElement(ModalWidget, { ...widget, key: index }))) }), buttons && (_jsx("div", { className: cn(buttonBox), children: buttons.map(({ title, onClick, option, disabled }) => (_jsx(Label.Button, { title: title, onClick: onClick, disabled: disabled, option: {
|
|
27
26
|
...option,
|
|
28
|
-
width:
|
|
27
|
+
width: "full",
|
|
29
28
|
height: "lg",
|
|
30
29
|
} }, title))) }))] }) }));
|
|
31
30
|
return (_jsx(ModalDesign, { titles: titles, showAction: showAction, option: option, children: _jsxs("div", { className: cn(container), children: [_jsx("div", { className: cn(widgetBox), children: widgets?.map((widget, index) => (_createElement(ModalWidget, { ...widget, key: index }))) }), buttons && (_jsx("div", { className: cn(buttonBox), children: buttons.map(({ title, onClick, option, disabled }) => (_jsx(Label.Button, { title: title, onClick: onClick, disabled: disabled, option: {
|
package/package.json
CHANGED
package/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.272
|