@edu-tosel/design 1.0.31 → 1.0.32
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/interface/Layout.d.ts +18 -0
- package/layout/widget/dashboard/Header.d.ts +1 -1
- package/layout/widget/dashboard/Header.js +11 -4
- package/layout/widget/dashboard/Layout.js +2 -2
- package/layout/widget/dashboard/Notification.d.ts +2 -0
- package/layout/widget/dashboard/Notification.js +36 -0
- package/package.json +1 -1
- package/tailwind.config.ts +3 -0
- package/version.txt +1 -1
package/interface/Layout.d.ts
CHANGED
|
@@ -1,9 +1,22 @@
|
|
|
1
|
+
interface Notification {
|
|
2
|
+
id: number;
|
|
3
|
+
userId: number;
|
|
4
|
+
script: string;
|
|
5
|
+
isRead: boolean;
|
|
6
|
+
link: string | null;
|
|
7
|
+
createdAt: Date;
|
|
8
|
+
updatedAt: Date;
|
|
9
|
+
}
|
|
1
10
|
export interface DashboardHeaderProps {
|
|
2
11
|
title: string;
|
|
3
12
|
logo: {
|
|
4
13
|
image: string;
|
|
5
14
|
href?: string;
|
|
6
15
|
};
|
|
16
|
+
notification: {
|
|
17
|
+
notifications: Partial<Notification>[];
|
|
18
|
+
flag: boolean;
|
|
19
|
+
};
|
|
7
20
|
options?: {
|
|
8
21
|
background?: string;
|
|
9
22
|
text?: string;
|
|
@@ -18,3 +31,8 @@ export interface DashboardProps {
|
|
|
18
31
|
background?: string;
|
|
19
32
|
};
|
|
20
33
|
}
|
|
34
|
+
export interface DashboardNotification {
|
|
35
|
+
isVisible?: boolean;
|
|
36
|
+
notifications: Partial<Notification>[];
|
|
37
|
+
}
|
|
38
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DashboardHeaderProps } from "../../../interface";
|
|
2
|
-
export declare function Header({ title, logo, options }: DashboardHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function Header({ title, logo, notification, options, }: DashboardHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,10 +3,11 @@ import { cn } from "../../../util";
|
|
|
3
3
|
import { useWidgetStore } from "../../../store";
|
|
4
4
|
import Menu from "./Menu";
|
|
5
5
|
import { Events } from "../..";
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import Notification from "./Notification";
|
|
7
|
+
export function Header({ title, logo, notification, options, }) {
|
|
8
|
+
const { setView, setIsOwn } = useWidgetStore();
|
|
9
|
+
const { notifications, flag } = notification;
|
|
8
10
|
const { text, background, className } = options ?? {};
|
|
9
|
-
const { isDark, setDark } = useWidgetStore();
|
|
10
11
|
const container = {
|
|
11
12
|
positions: "fixed xl:static top-0 left-0 z-40",
|
|
12
13
|
displays: "flex items-center justify-between ",
|
|
@@ -16,7 +17,13 @@ export function Header({ title, logo, options }) {
|
|
|
16
17
|
styles: "px-5 xl:px-8 2xl:px-16 ",
|
|
17
18
|
className,
|
|
18
19
|
};
|
|
19
|
-
return (_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "flex h-12 items-center gap-8 xl:gap-24 2xl:gap-26", children: [logo ? (_jsx("a", { href: logo.href, children: _jsx("img", { src: logo.image, alt: "logo", className: "h-6.25 w-28.78" }) })) : (_jsx("div", { className: "text-2xl", children: "TOSEL" })), _jsx("div", { className: "text-3xl font-pretendard-bold", children: title })] }), _jsx("div", { className: "relative flex gap-5.25", children: _jsxs(Events.Show, { widgets: [
|
|
20
|
+
return (_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "flex h-12 items-center gap-8 xl:gap-24 2xl:gap-26", children: [logo ? (_jsx("a", { href: logo.href, children: _jsx("img", { src: logo.image, alt: "logo", className: "h-6.25 w-28.78" }) })) : (_jsx("div", { className: "text-2xl", children: "TOSEL" })), _jsx("div", { className: "text-3xl font-pretendard-bold", children: title })] }), _jsx("div", { className: "relative flex gap-5.25", children: _jsxs(Events.Show, { widgets: [
|
|
21
|
+
["notification", _jsx(Notification, { notifications: notifications })],
|
|
22
|
+
["menu", _jsx(Menu, { image: "/images/hani.png" })],
|
|
23
|
+
], children: [_jsxs("button", { className: "relative", onClick: () => {
|
|
24
|
+
setIsOwn(true);
|
|
25
|
+
return setView("notification");
|
|
26
|
+
}, children: [_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "25", height: "25", viewBox: "0 0 25 25", fill: "none", children: _jsx("path", { d: "M15.4759 17.7938C17.4168 17.564 19.3237 17.1059 21.1572 16.4292C19.6044 14.7092 18.7465 12.4734 18.7499 10.1562V9.375C18.7499 7.7174 18.0914 6.12769 16.9193 4.95558C15.7472 3.78348 14.1575 3.125 12.4999 3.125C10.8423 3.125 9.25257 3.78348 8.08047 4.95558C6.90837 6.12769 6.24989 7.7174 6.24989 9.375V10.1562C6.25303 12.4736 5.39466 14.7093 3.84155 16.4292C5.64676 17.0958 7.54989 17.5594 9.52384 17.7938M15.4759 17.7938C13.4988 18.0283 11.5009 18.0283 9.52384 17.7938M15.4759 17.7938C15.626 18.2624 15.6634 18.7598 15.5849 19.2455C15.5064 19.7313 15.3143 20.1917 15.0242 20.5891C14.7342 20.9866 14.3544 21.31 13.9157 21.5329C13.4771 21.7559 12.9919 21.8721 12.4999 21.8721C12.0078 21.8721 11.5227 21.7559 11.0841 21.5329C10.6454 21.31 10.2656 20.9866 9.97553 20.5891C9.68548 20.1917 9.49339 19.7313 9.4149 19.2455C9.33641 18.7598 9.37374 18.2624 9.52384 17.7938", stroke: "#910023", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }), flag && (_jsx("div", { className: "bg-red-500 w-2 h-2 rounded-full absolute top-0 right-0" }))] }), _jsx("svg", { className: "cursor-pointer", onClick: () => {
|
|
20
27
|
setIsOwn(true);
|
|
21
28
|
return setView("menu");
|
|
22
29
|
}, xmlns: "http://www.w3.org/2000/svg", width: "25", height: "25", viewBox: "0 0 25 25", fill: "none", children: _jsx("path", { d: "M18.7313 19.5053C18.0034 18.5416 17.0618 17.7601 15.9804 17.2223C14.8991 16.6846 13.7077 16.4052 12.5 16.4063C11.2924 16.4052 10.101 16.6846 9.01964 17.2223C7.93832 17.7601 6.99664 18.5416 6.26878 19.5053M18.7313 19.5053C20.1516 18.2419 21.1533 16.5767 21.6054 14.7304C22.0576 12.884 21.9378 10.9439 21.262 9.16722C20.5862 7.39055 19.3862 5.86128 17.8213 4.78224C16.2564 3.7032 14.4004 3.12537 12.4995 3.12537C10.5986 3.12537 8.74267 3.7032 7.17775 4.78224C5.61282 5.86128 4.41288 7.39055 3.73705 9.16722C3.06122 10.9439 2.94144 12.884 3.3936 14.7304C3.84575 16.5767 4.84847 18.2419 6.26878 19.5053M18.7313 19.5053C17.0167 21.0346 14.7976 21.8783 12.5 21.8751C10.2021 21.8786 7.98361 21.0349 6.26878 19.5053M15.625 10.1563C15.625 10.9851 15.2958 11.78 14.7097 12.366C14.1237 12.9521 13.3288 13.2813 12.5 13.2813C11.6712 13.2813 10.8764 12.9521 10.2903 12.366C9.70427 11.78 9.37503 10.9851 9.37503 10.1563C9.37503 9.32751 9.70427 8.53265 10.2903 7.9466C10.8764 7.36055 11.6712 7.03131 12.5 7.03131C13.3288 7.03131 14.1237 7.36055 14.7097 7.9466C15.2958 8.53265 15.625 9.32751 15.625 10.1563Z", stroke: "#910023", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })] }) })] }));
|
|
@@ -6,7 +6,7 @@ import { cn } from "../../../util";
|
|
|
6
6
|
import { useWidgetStore } from "../../../store";
|
|
7
7
|
export default function Layout({ header, navigations, children, options, }) {
|
|
8
8
|
const { isDark, flag, setFlag, isOwn, setIsOwn, clearView } = useWidgetStore();
|
|
9
|
-
const { title, options: headerOptions, logo } = header;
|
|
9
|
+
const { title, options: headerOptions, logo, notification } = header;
|
|
10
10
|
const { background } = options ?? {};
|
|
11
11
|
useEffect(() => {
|
|
12
12
|
if (isOwn) {
|
|
@@ -25,5 +25,5 @@ export default function Layout({ header, navigations, children, options, }) {
|
|
|
25
25
|
displays: "flex gap-12 xl:gap-7.5 ",
|
|
26
26
|
paddings: "pt-15 xl:pl-2 2xl:px-12 xl:pt-7.5",
|
|
27
27
|
};
|
|
28
|
-
return (_jsxs("div", { className: cn(container), onClick: setFlag, children: [_jsx(Header, { title: title, options: headerOptions, logo: logo }), _jsxs("div", { className: cn(body), children: [_jsx(NavigationContainer, { children: navigations.map((nav, index) => (_jsx(Fragment, { children: nav }, index))) }), children] })] }));
|
|
28
|
+
return (_jsxs("div", { className: cn(container), onClick: setFlag, children: [_jsx(Header, { title: title, notification: notification, options: headerOptions, logo: logo }), _jsxs("div", { className: cn(body), children: [_jsx(NavigationContainer, { children: navigations.map((nav, index) => (_jsx(Fragment, { children: nav }, index))) }), children] })] }));
|
|
29
29
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useTransition, animated } from "react-spring";
|
|
3
|
+
import { cn } from "../../../util";
|
|
4
|
+
export default function Notification({ isVisible, notifications, }) {
|
|
5
|
+
const container = {
|
|
6
|
+
positions: "absolute right-12 z-45",
|
|
7
|
+
displays: "flex flex-col ",
|
|
8
|
+
sizes: "w-60 h-45",
|
|
9
|
+
styles: "box-shadow rounded-md overflow-hidden",
|
|
10
|
+
};
|
|
11
|
+
const headerBox = {
|
|
12
|
+
displays: "flex items-center",
|
|
13
|
+
paddings: " pl-2.5",
|
|
14
|
+
sizes: "w-full h-8.5",
|
|
15
|
+
styles: "bg-white text-gray-dim font-pretendard-bold text-sm",
|
|
16
|
+
};
|
|
17
|
+
const body = {
|
|
18
|
+
sizes: "w-full h-36.5",
|
|
19
|
+
paddings: "py-1.25",
|
|
20
|
+
background: "bg-gray-light",
|
|
21
|
+
styles: "overflow-y-scroll",
|
|
22
|
+
};
|
|
23
|
+
const contentBox = {
|
|
24
|
+
paddings: "px-2.5 py-1.25",
|
|
25
|
+
fonts: "text-xs",
|
|
26
|
+
};
|
|
27
|
+
const transitions = useTransition(isVisible, {
|
|
28
|
+
from: { opacity: 0 },
|
|
29
|
+
enter: { opacity: 1 },
|
|
30
|
+
leave: { opacity: 0 },
|
|
31
|
+
config: { duration: 200 },
|
|
32
|
+
});
|
|
33
|
+
return transitions((styles, item) => item && (_jsxs(animated.div, { style: styles, className: cn(container), children: [_jsx("div", { className: cn(headerBox), children: "\uC0C8 \uC54C\uB9BC" }), _jsx("div", { className: cn(body), children: notifications.map(({ id, script, link }) => (_jsx("div", { onClick: () => {
|
|
34
|
+
link && window.open(link, "_blank");
|
|
35
|
+
}, className: cn(contentBox, link ? "cursor-pointer" : ""), children: script }, id))) })] })));
|
|
36
|
+
}
|
package/package.json
CHANGED
package/tailwind.config.ts
CHANGED
|
@@ -89,6 +89,7 @@ export default {
|
|
|
89
89
|
"sun-calc": "calc(50% - 6rem)",
|
|
90
90
|
0.5: "0.125rem",
|
|
91
91
|
1: "0.25rem",
|
|
92
|
+
1.25: "0.3125rem",
|
|
92
93
|
2.5: "0.625rem",
|
|
93
94
|
3.5: "0.875rem",
|
|
94
95
|
3.75: "0.9375rem",
|
|
@@ -103,6 +104,7 @@ export default {
|
|
|
103
104
|
7: "1.75rem",
|
|
104
105
|
7.5: "1.875rem",
|
|
105
106
|
8: "2rem",
|
|
107
|
+
8.5: "2.125rem",
|
|
106
108
|
9: "2.25rem",
|
|
107
109
|
9.25: "2.3125rem",
|
|
108
110
|
9.5: "2.375rem",
|
|
@@ -141,6 +143,7 @@ export default {
|
|
|
141
143
|
30: "7.5rem",
|
|
142
144
|
34: "8.5rem",
|
|
143
145
|
36: "9rem",
|
|
146
|
+
36.5: "9.125rem",
|
|
144
147
|
36.75: "9.1875rem",
|
|
145
148
|
38: "9.5rem",
|
|
146
149
|
40: "10rem",
|
package/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.32
|