@edu-tosel/design 1.0.269 → 1.0.270

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.
@@ -16,14 +16,18 @@ export default function MyPageLayout({ header, profile, navigations, children, o
16
16
  return clearView();
17
17
  }, [flag]);
18
18
  const container = {
19
- sizes: "min-h-screen h-screen xl:h-auto",
19
+ sizes: "h-screen",
20
20
  background: `${background ?? "bg-white"}`,
21
21
  styles: "font-pretendard-medium",
22
22
  };
23
+ const spacer = {
24
+ displays: "flex shrink-0",
25
+ sizes: "w-full h-15 xl:h-22.5",
26
+ };
23
27
  const body = {
24
- displays: "flex gap-12 xl:gap-7.5 ",
25
- sizes: "h-full ",
26
- paddings: "pt-15 xl:pl-2 2xl:px-12 xl:pt-7.5",
28
+ sizes: "h-[calc(100%-60px)] xl:h-[calc(100%-90px)]",
29
+ displays: "flex gap-0 xl:gap-7.5 relative",
30
+ paddings: "xl:px-5 2xl:pl-12 2xl:pr-11.25",
27
31
  };
28
- return (_jsxs("div", { className: cn(container), onClick: setFlag, children: [_jsx(Header, { ...header }), _jsxs("div", { className: cn(body), children: [_jsxs(Navigation.Container, { children: [_jsx(Profile.Preview, { username: profile.username, email: profile.email, image: profile.image }), navigations.map((nav, index) => (_jsx(Fragment, { children: nav }, index)))] }), children] })] }));
32
+ return (_jsxs("div", { className: cn(container), onClick: setFlag, children: [_jsx(Header, { ...header }), _jsx("div", { className: cn(spacer) }), _jsxs("div", { className: cn(body), children: [_jsxs(Navigation.Container, { children: [_jsx(Profile.Preview, { username: profile.username, email: profile.email, image: profile.image }), navigations.map((nav, index) => (_jsx(Fragment, { children: nav }, index)))] }), children] })] }));
29
33
  }
@@ -63,9 +63,8 @@ export default function NewsPaper({ banners, browse, option, }) {
63
63
  return (_jsxs("div", { className: cn(container), children: [_jsx("div", { className: cn(deckTitlePositioning), children: _jsxs("div", { className: cn(deckTitle), children: [_jsx("div", { children: "\uC0C8\uB85C\uC6B4 \uC18C\uC2DD" }), _jsx(Label.Button, { title: "\uB354 \uBCF4\uAE30", onClick: browse, option: {
64
64
  width: "xs",
65
65
  height: "xs",
66
- text: "text-white hover:text-green-dark",
67
- background: "bg-green-dark hover:bg-white",
68
- boundary: "border-2 hover:border-white border-green-dark",
66
+ text: "text-white hover:text-green-dark font-bold",
67
+ background: "bg-green-dark hover:bg-green-light",
69
68
  } })] }) }), _jsx("div", { className: cn(cardPositioning), children: _jsx("div", { className: cn(cardWrapper), ref: scrollContainerRef, children: _jsx("div", { className: cn(cardDeck), children: banners.map((banner) => (_jsx(Banner, { ...banner }, banner.image.src))) }) }) }), _jsxs("div", { className: cn(buttonPositioning), children: [_jsx("div", { className: cn(hoverButton), onClick: () => handleScroll("left"), children: _jsx("img", { src: "images/home/handle-left.svg", alt: "" }) }), _jsx("div", { className: cn(hoverButton), onClick: () => handleScroll("right"), children: _jsx("img", { src: "images/home/handle-right.svg", alt: "" }) })] })] }));
70
69
  }
71
70
  function Banner({ onClick, image, option }) {
@@ -3,7 +3,7 @@ import { cn } from "../../../util";
3
3
  export default function ShortcutBanner({ shortcuts, }) {
4
4
  const container = {
5
5
  displays: "flex justify-center items-center",
6
- spacings: "px-5 pt-16 pb-24"
6
+ spacings: "px-5 pt-16 pb-24",
7
7
  };
8
8
  const buttonWrapper = {
9
9
  displays: "flex justify-center items-center flex-wrap",
@@ -13,20 +13,20 @@ export default function ShortcutBanner({ shortcuts, }) {
13
13
  };
14
14
  const buttonSet = {
15
15
  displays: "group flex flex-col justify-center items-center",
16
- sizes: "w-16 hover:scale-110",
17
- animation: "duration-300",
18
- spacings: "gap-2"
16
+ sizes: "w-16",
17
+ spacings: "gap-2",
19
18
  };
20
19
  const tagBox = {
21
20
  displays: "flex justify-center items-center",
22
21
  sizes: "w-full h-6.25 ",
23
- fonts: "text-xs font-pretendard-var font-medium text-gray-medium group-hover:text-green-dark",
24
- styles: "bg-gray-light/40 group-hover:bg-green-light rounded-md",
25
- sapcings: "",
22
+ fonts: "text-xs font-pretendard-var font-medium text-gray-dark group-hover:text-green-dark",
23
+ animation: "duration-100",
26
24
  };
27
25
  const iconContainer = {
28
- sizes: "w-16 h-16 rounded-lg",
29
- background: "group-hover:bg-gray-light/40"
26
+ sizes: "w-16 h-16 rounded-lg overflow-hidden",
27
+ shadows: "shadow-icon-default",
28
+ animation: "duration-100",
29
+ hoveraction: "group-hover:shadow-icon-hover group-hover:scale-105",
30
30
  };
31
31
  return (_jsx("div", { className: cn(container), children: _jsx("div", { className: cn(buttonWrapper), children: shortcuts.map((shortcut) => (_jsxs("button", { onClick: shortcut.onClick, className: cn(buttonSet), children: [_jsx("div", { className: cn(iconContainer), children: _jsx("img", { src: shortcut.icon, alt: shortcut.title }) }), _jsx("div", { className: cn(tagBox), children: shortcut.title })] }, shortcut.title))) }) }));
32
32
  }
@@ -57,6 +57,19 @@ export default function Navigation({ browser, calendar, notice, event, }) {
57
57
  setIsHidden(true);
58
58
  return setIsOpen(true);
59
59
  };
60
+ //tooltip
61
+ const [position, setPosition] = useState({ x: 0, y: 0 });
62
+ const [tooltipText, setTooltipText] = useState(null);
63
+ const handleMouseMove = (event) => {
64
+ setPosition({ x: event.clientX, y: event.clientY });
65
+ };
66
+ const handleMouseEnter = (event) => {
67
+ const text = event.currentTarget.getAttribute("data-tooltip");
68
+ setTooltipText(text);
69
+ };
70
+ const handleMouseLeave = () => {
71
+ setTooltipText(null);
72
+ };
60
73
  const blurContainer = {
61
74
  positions: "fixed inset-0 z-40",
62
75
  sizes: "h-screen w-full",
@@ -99,7 +112,12 @@ export default function Navigation({ browser, calendar, notice, event, }) {
99
112
  textStyles: "text-lg font-bold text-green-dark",
100
113
  };
101
114
  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 &&
102
- 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("div", { className: cn(iconWrapper), onClick: () => handleOpen("calendar"), children: _jsx(SVG.Icon.Calendar, { size: isMobile ? "md" : "lg" }) }), _jsx("div", { className: cn(iconWrapper), onClick: () => handleOpen("notification"), children: _jsx(SVG.Icon.Notification, { size: isMobile ? "md" : "lg" }) }), _jsx("div", { className: cn(iconWrapper), onClick: () => handleOpen("search"), children: _jsx(SVG.Icon.Search, { size: isMobile ? "md" : "lg" }) }), _jsx("div", { className: cn(iconWrapper), onClick: () => handleOpen("browser"), children: _jsx(SVG.Icon.Browser, { size: isMobile ? "md" : "lg" }) }), _jsx("div", { className: cn(iconWrapper), onClick: () => handleOpen("event"), children: _jsx(SVG.Icon.Newspaper, { size: isMobile ? "md" : "lg" }) })] }) })] }));
115
+ 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 + 40}px`,
117
+ top: `${position.y - 200}px`,
118
+ transform: "translate(-50%, -100%)",
119
+ pointerEvents: "none",
120
+ }, children: tooltipText }))] }) })] }));
103
121
  }
104
122
  const navigationTypeString = {
105
123
  calendar: "시험 접수 일정",
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from "react";
2
+ export default function Pop({ isOpen, setIsOpen, children, }: {
3
+ isOpen: boolean;
4
+ setIsOpen: (value: boolean) => void;
5
+ children: ReactNode;
6
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,25 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from "../../util";
3
+ export default function Pop({ isOpen, setIsOpen, children, }) {
4
+ const container = {
5
+ positions: "fixed inset-0 z-100",
6
+ displays: "flex flex-col justify-center items-center",
7
+ backgrounds: "bg-black/20 backdrop-blur-sm duration-300",
8
+ animation: isOpen
9
+ ? "opacity-100 pointer-events-auto"
10
+ : "opacity-0 pointer-events-none",
11
+ };
12
+ const wrapper = {
13
+ displays: "flex flex-col justify-end items-center",
14
+ sizes: "w-full h-full",
15
+ };
16
+ const body = {
17
+ displays: "flex flex-col rounded-tl-lg rounded-tr-lg bg-white",
18
+ sizes: "w-full h-fit max-w-120",
19
+ spacings: "p-5 gap-5",
20
+ position: isOpen ? "translate-y-0" : "translate-y-full",
21
+ animation: "duration-300",
22
+ pointer: "pointer-events-auto",
23
+ };
24
+ return (_jsx("div", { className: cn(container), onClick: () => setIsOpen(false), children: _jsx("div", { className: cn(wrapper), children: _jsx("div", { className: cn(body), children: children }) }) }));
25
+ }
@@ -1,7 +1,13 @@
1
- import Alert from "./Alert";
2
- import Input from "./Input";
3
- declare const Modal: {
4
- Alert: typeof Alert;
5
- Input: typeof Input;
6
- };
1
+ import _Input from "./Input";
2
+ import { ConfirmModalWidget, ModalProps } from "../../interface/Modal";
3
+ import { Button } from "../../interface";
4
+ interface ModalExtends<T = any> extends Omit<ModalProps, "children"> {
5
+ buttons?: [Button] | [Button, Button];
6
+ widgets?: ConfirmModalWidget<T>[];
7
+ }
8
+ declare function Modal({ titles, showAction, buttons, widgets, option }: ModalExtends): import("react/jsx-runtime").JSX.Element;
9
+ declare namespace Modal {
10
+ var Alert: typeof import("./Alert").default;
11
+ var Input: typeof _Input;
12
+ }
7
13
  export default Modal;
@@ -1,7 +1,64 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { createElement as _createElement } from "react";
1
3
  import Alert from "./Alert";
2
- import Input from "./Input";
3
- const Modal = {
4
- Alert,
5
- Input,
6
- };
4
+ import _Input from "./Input";
5
+ import { Input, Label, Select } from "../../widget";
6
+ import { cn } from "../../util";
7
+ import ModalDesign from "../design/Modal.design";
8
+ import { useResponsive } from "../../hook";
9
+ import ModalPop from "../organism/Pop";
10
+ function Modal({ titles, showAction, buttons, widgets, option }) {
11
+ const isMd = useResponsive("md");
12
+ const { className } = option ?? {};
13
+ const container = {
14
+ displays: "flex flex-col",
15
+ };
16
+ const buttonBox = {
17
+ positions: "absolute bottom-4 md:bottom-5 right-2 md:right-5",
18
+ displays: "flex gap-1 md:gap-2.5",
19
+ };
20
+ const widgetBox = {
21
+ displays: "flex flex-col",
22
+ sizes: "w-full min-h-64",
23
+ styles: className ?? "mt-2.5",
24
+ };
25
+ if (!isMd)
26
+ return (_jsx(ModalPop, { isOpen: true, setIsOpen: () => { }, 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
+ ...option,
28
+ width: option?.width ?? "lg",
29
+ height: "lg",
30
+ } }, title))) }))] }) }));
31
+ 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: {
32
+ ...option,
33
+ width: option?.width ?? "lg",
34
+ height: "lg",
35
+ } }, title))) }))] }) }));
36
+ }
37
+ function ModalWidget({ type, data }) {
38
+ const arrange = "w-full justify-center flex";
39
+ if (type === "selectSwitch")
40
+ return (_jsx(Select.Switch, { ...data, option: {
41
+ ...data.option,
42
+ className: arrange,
43
+ } }));
44
+ if (type === "selectHandle")
45
+ return (_jsx(Select.Handle, { ...data, option: {
46
+ ...data.option,
47
+ className: arrange,
48
+ } }));
49
+ if (type === "selectPagination")
50
+ return (_jsx(Select.Pagination, { ...data, option: {
51
+ ...data.option,
52
+ className: "flex w-full justify-end",
53
+ } }));
54
+ if (type === "selectTag")
55
+ return _jsx(Select.Tag, { ...data });
56
+ if (type === "inputForm")
57
+ return _jsx(Input.Form, { ...data });
58
+ if (typeof type === "undefined")
59
+ return data;
60
+ return null;
61
+ }
62
+ Modal.Alert = Alert;
63
+ Modal.Input = _Input;
7
64
  export default Modal;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edu-tosel/design",
3
- "version": "1.0.269",
3
+ "version": "1.0.270",
4
4
  "description": "UI components for International TOSEL Committee",
5
5
  "keywords": [
6
6
  "jsx",
@@ -34,6 +34,8 @@ export default {
34
34
  main: "0 2px 10px 0px rgba(0, 0, 0, 0.14)",
35
35
  "main-small": "0 0px 5px 0px rgba(0, 0, 0, 0.1)",
36
36
  "main-hover": "0 10px 12px 0px rgba(0, 0, 0, 0.3)",
37
+ "icon-default": "0 3px 7px 0px rgba(0, 0, 0, 0.1)",
38
+ "icon-hover": "0 3px 10px 0px rgba(6, 86, 82, 0.38)",
37
39
  green: "0 0px 10px 0px rgba(16, 86, 82, 0.38)",
38
40
  },
39
41
  flex: {
package/version.txt CHANGED
@@ -1 +1 @@
1
- 1.0.269
1
+ 1.0.270
@@ -18,6 +18,7 @@ const heightSize = {
18
18
  xs: "h-7.5",
19
19
  sm: "h-11.25",
20
20
  md: "h-12.25",
21
+ lg: "h-[45px]",
21
22
  };
22
23
  export default function LabelDesign({ title, onClick, disabled, option, hoverState, }) {
23
24
  const [hover, setHover] = hoverState ?? [false, () => { }];
@@ -35,7 +36,7 @@ export default function LabelDesign({ title, onClick, disabled, option, hoverSta
35
36
  clickable: onClick && "cursor-pointer",
36
37
  texts: text ?? "text-gray-dim",
37
38
  animation: "duration-500",
38
- fonts: "font-pretendard-light",
39
+ fonts: "font-pretendard-var font-medium",
39
40
  boundary,
40
41
  styles: height === "xs" ||
41
42
  height === "2xs" ||