@edu-tosel/design 1.0.151 → 1.0.153

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/asset/SVG.d.ts CHANGED
@@ -23,7 +23,7 @@ declare const SVG: {
23
23
  Notification: ({ onClick }: IconProps) => import("react/jsx-runtime").JSX.Element;
24
24
  Search: ({ onClick }: IconProps) => import("react/jsx-runtime").JSX.Element;
25
25
  Browser: ({ onClick }: IconProps) => import("react/jsx-runtime").JSX.Element;
26
- Gift: ({ onClick }: IconProps) => import("react/jsx-runtime").JSX.Element;
26
+ Event: ({ onClick }: IconProps) => import("react/jsx-runtime").JSX.Element;
27
27
  Document: ({ theme }: {
28
28
  theme: "red" | "blue";
29
29
  }) => import("react/jsx-runtime").JSX.Element;
@@ -7,7 +7,7 @@ declare const Icon: {
7
7
  Notification: typeof Notification;
8
8
  Search: typeof Search;
9
9
  Browser: typeof Browser;
10
- Gift: typeof Gift;
10
+ Event: typeof Event;
11
11
  Document: typeof Document;
12
12
  };
13
13
  export default Icon;
@@ -15,7 +15,7 @@ declare function Calendar({ onClick }: IconProps): import("react/jsx-runtime").J
15
15
  declare function Notification({ onClick }: IconProps): import("react/jsx-runtime").JSX.Element;
16
16
  declare function Search({ onClick }: IconProps): import("react/jsx-runtime").JSX.Element;
17
17
  declare function Browser({ onClick }: IconProps): import("react/jsx-runtime").JSX.Element;
18
- declare function Gift({ onClick }: IconProps): import("react/jsx-runtime").JSX.Element;
18
+ declare function Event({ onClick }: IconProps): import("react/jsx-runtime").JSX.Element;
19
19
  declare function Document({ theme }: {
20
20
  theme: "blue" | "red";
21
21
  }): import("react/jsx-runtime").JSX.Element;
package/asset/svg/Icon.js CHANGED
@@ -4,7 +4,7 @@ const Icon = {
4
4
  Notification,
5
5
  Search,
6
6
  Browser,
7
- Gift,
7
+ Event,
8
8
  Document,
9
9
  };
10
10
  export default Icon;
@@ -20,7 +20,7 @@ function Search({ onClick }) {
20
20
  function Browser({ onClick }) {
21
21
  return (_jsx("svg", { onClick: onClick, xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: _jsx("path", { d: "M3 8.25V18C3 18.5967 3.23705 19.169 3.65901 19.591C4.08097 20.0129 4.65326 20.25 5.25 20.25H18.75C19.3467 20.25 19.919 20.0129 20.341 19.591C20.7629 19.169 21 18.5967 21 18V8.25M3 8.25V6C3 5.40326 3.23705 4.83097 3.65901 4.40901C4.08097 3.98705 4.65326 3.75 5.25 3.75H18.75C19.3467 3.75 19.919 3.98705 20.341 4.40901C20.7629 4.83097 21 5.40326 21 6V8.25M3 8.25H21M5.25 6H5.258V6.008H5.25V6ZM7.5 6H7.508V6.008H7.5V6ZM9.75 6H9.758V6.008H9.75V6Z", stroke: "white", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }) }));
22
22
  }
23
- function Gift({ onClick }) {
23
+ function Event({ onClick }) {
24
24
  return (_jsx("svg", { onClick: onClick, xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: _jsx("path", { d: "M21 11.25V19.5C21 19.8978 20.842 20.2794 20.5607 20.5607C20.2794 20.842 19.8978 21 19.5 21H5.25C4.85218 21 4.47064 20.842 4.18934 20.5607C3.90804 20.2794 3.75 19.8978 3.75 19.5V11.25M12 4.875C12 4.35583 11.846 3.84831 11.5576 3.41663C11.2692 2.98495 10.8592 2.6485 10.3795 2.44982C9.89989 2.25114 9.37209 2.19915 8.86289 2.30044C8.35369 2.40173 7.88596 2.65173 7.51884 3.01885C7.15173 3.38596 6.90172 3.85369 6.80044 4.36289C6.69915 4.87209 6.75114 5.39989 6.94982 5.87954C7.1485 6.3592 7.48495 6.76917 7.91663 7.05761C8.34831 7.34605 8.85582 7.5 9.375 7.5H12M12 4.875V7.5M12 4.875C12 4.35583 12.154 3.84831 12.4424 3.41663C12.7308 2.98495 13.1408 2.6485 13.6205 2.44982C14.1001 2.25114 14.6279 2.19915 15.1371 2.30044C15.6463 2.40173 16.114 2.65173 16.4812 3.01885C16.8483 3.38596 17.0983 3.85369 17.1996 4.36289C17.3008 4.87209 17.2489 5.39989 17.0502 5.87954C16.8515 6.3592 16.5151 6.76917 16.0834 7.05761C15.6517 7.34605 15.1442 7.5 14.625 7.5H12M12 7.5V21M3.375 11.25H21.375C21.996 11.25 22.5 10.746 22.5 10.125V8.625C22.5 8.004 21.996 7.5 21.375 7.5H3.375C2.754 7.5 2.25 8.004 2.25 8.625V10.125C2.25 10.746 2.754 11.25 3.375 11.25Z", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }));
25
25
  }
26
26
  function Document({ theme }) {
@@ -10,7 +10,7 @@ const Icon = {
10
10
  Notification,
11
11
  Search,
12
12
  Browser,
13
- Gift,
13
+ Event,
14
14
  Document,
15
15
  };
16
16
 
@@ -100,7 +100,7 @@ function Browser({ onClick }: IconProps) {
100
100
  );
101
101
  }
102
102
 
103
- function Gift({ onClick }: IconProps) {
103
+ function Event({ onClick }: IconProps) {
104
104
  return (
105
105
  <svg
106
106
  onClick={onClick}
@@ -36,7 +36,7 @@ export function Board({ children, action, option, debug, buttons, }) {
36
36
  background: `${background ?? "bg-white"} `,
37
37
  styles: "text-black overflow-hidden",
38
38
  rounded: `rounded-none ${isRounded ? "xl:rounded-xl" : ""}`,
39
- boundary,
39
+ boundary: boundary ?? "border-0",
40
40
  className,
41
41
  };
42
42
  const button = {
@@ -43,7 +43,7 @@ export default function CardDesign({ header, disabled, children, option, debug,
43
43
  sizes: `${widthSize[width ?? "sm"]} ${heightSize[height ?? "xs"]}`,
44
44
  onClick: onClick ? "cursor-pointer" : "",
45
45
  text: `${text ?? "text-base"} text-black `,
46
- boundary: boundary ?? "box-shadow",
46
+ boundary: boundary ?? "shadow-main hover:shadow-green",
47
47
  rounded: `rounded-${rounded ?? "xl"}`,
48
48
  bgColor: `${background ?? "bg-white/80"} `,
49
49
  styles: "duration-500 ",
@@ -6,6 +6,7 @@ export function InfoCardDesign({ titles: { title, subtitle }, topRight, debug, i
6
6
  const container = {
7
7
  displays: "flex flex-col",
8
8
  paddings: "pt-5 px-5",
9
+ text: "break-keep",
9
10
  };
10
11
  const topBox = {
11
12
  container: {
@@ -6,9 +6,10 @@ function Academy({ titles, data, buttons, option }) {
6
6
  return (_jsx(InfoCardDesign, { titles: titles, option: {
7
7
  ...option,
8
8
  titleBorder: "border-green-dark",
9
- background: "",
9
+ background: "bg-none",
10
10
  width: option?.width ?? "xs",
11
11
  height: option?.height ?? "md",
12
+ boundary: "border-white border-0",
12
13
  }, children: _jsxs("div", { className: "mt-2.5 flex flex-col gap-2.5", children: [_jsx("div", { className: "w-full", children: data.address }), _jsx("div", { className: "flex gap-2.5", children: buttons.map(({ title, onClick }, index) => (_jsx(Label.Button, { title: title, onClick: onClick, option: {
13
14
  background: !index ? "bg-gray-medium" : "bg-green-dark",
14
15
  text: "text-white",
@@ -21,7 +22,7 @@ function Digital({ image, data, option }) {
21
22
  width: "md",
22
23
  height: "md",
23
24
  titleBorder: "border-crimson-burgundy",
24
- boundary: "border-2 border-crimson-burgundy",
25
+ background: "bg-white",
25
26
  onClick: option?.onClick,
26
27
  }, titles: {
27
28
  title: "Digital Student Card",
package/globals.css CHANGED
@@ -257,3 +257,13 @@ input[type="date"]::-webkit-calendar-picker-indicator {
257
257
  opacity: 0;
258
258
  transition: opacity 0.5s ease-in-out;
259
259
  }
260
+
261
+ .text-gradient-green-to-red {
262
+ background: var(
263
+ --gradient-main,
264
+ linear-gradient(269deg, #760023 0%, #105652 100%)
265
+ );
266
+ background-clip: text;
267
+ -webkit-background-clip: text;
268
+ -webkit-text-fill-color: transparent;
269
+ }
@@ -37,7 +37,7 @@ export interface InputWidget extends Widget {
37
37
  title?: string;
38
38
  state: State<string> | State<string | undefined>;
39
39
  onKeyDown?: (e: React.KeyboardEvent, value: string) => void;
40
- placeholder?: string;
40
+ placeholder?: string | (() => string | undefined);
41
41
  isValid?: IsValid;
42
42
  type?: InputType;
43
43
  button?: LabelWidget;
@@ -25,7 +25,7 @@ export function Header({ title, logo, notification, menu, option, }) {
25
25
  ], children: menu?.profile ? (_jsx(SVG.Profile, { onClick: () => {
26
26
  setIsOwn(true);
27
27
  return setView("menu");
28
- }, color: iconColor })) : (_jsx(Label.Button, { title: "\uB300\uC2DC\uBCF4\uB4DC", onClick: () => option?.onClick && option.onClick(), option: {
28
+ }, color: iconColor })) : (_jsx(Label.Button, { title: "\uB85C\uADF8\uC778", onClick: () => option?.onClick && option.onClick(), option: {
29
29
  width: "sm",
30
30
  height: "xs",
31
31
  background: gradient.bg.greenToRed,
@@ -9,7 +9,7 @@ function Academy({ onClick }) {
9
9
  boundary: "box-shadow shadow-green-dark",
10
10
  onMouse: [onMouse, _],
11
11
  width: "2xs",
12
- height: "3xs",
12
+ height: "4xs",
13
13
  }, children: [_jsx("div", { className: "text-gray-medium group-hover:text-green-dark duration-300", children: "\uB098\uC758 \uD559\uC6D0" }), _jsx("svg", { className: "absolute bottom-5 right-5 ", xmlns: "http://www.w3.org/2000/svg", width: "60", height: "60", viewBox: "0 0 60 60", fill: "none", children: _jsx("path", { className: "duration-300", d: "M9 53H52M10.9545 6H50.0455M12.9091 6V53M48.0909 6V53M22.6818 15.7917H26.5909M22.6818 23.625H26.5909M22.6818 31.4583H26.5909M34.4091 15.7917H38.3182M34.4091 23.625H38.3182M34.4091 31.4583H38.3182M22.6818 53V44.1875C22.6818 42.566 23.9953 41.25 25.6136 41.25H35.3864C37.0047 41.25 38.3182 42.566 38.3182 44.1875V53", stroke: !onMouse ? "#7F7F7F" : "#105652", strokeWidth: "4", strokeLinecap: "round", strokeLinejoin: "round" }) })] }));
14
14
  }
15
15
  function Payment({ onClick }) {
@@ -18,7 +18,7 @@ function Payment({ onClick }) {
18
18
  className: "pt-5 pl-5",
19
19
  background: "group bg-green-dark/10 hover:bg-green-dark/30 ",
20
20
  width: "2xs",
21
- height: "3xs",
21
+ height: "4xs",
22
22
  boundary: "",
23
23
  }, children: [_jsx("div", { className: "opacity-0 group-hover:opacity-100 duration-300", children: "\uACB0\uC81C \uC815\uBCF4" }), _jsxs("div", { className: "absolute top-5 group-hover:top-11.25 left-5 flex flex-col gap-1.5 duration-300", children: [_jsx("div", { className: "w-24 h-1.5 bg-green-dark/30 group-hover:bg-green-dark/40 duration-300" }), _jsx("div", { className: "w-14.25 h-1.5 bg-green-dark/30 group-hover:bg-green-dark/40 duration-300" })] }), _jsx("div", { className: "absolute top-5 right-5 w-12.25 h-7 rounded-full bg-[#CFDDDC]" }), _jsx("div", { className: "absolute left-0 bottom-5 w-full h-5 bg-green-dark" })] }));
24
24
  }
@@ -22,8 +22,7 @@ function Profile({ name, birthday, image, modify }) {
22
22
  return (_jsxs(Card, { option: {
23
23
  className: "flex gap-x-7.5 items-center pl-5",
24
24
  width: "md",
25
- height: "3xs",
26
- boundary: "border-1 border-black",
25
+ height: "4xs",
27
26
  }, children: [_jsxs("button", { onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false), onClick: modify.image, className: "w-20 h-20 overflow-hidden rounded-md relative", children: [_jsx("img", { src: image, alt: "profile-image", className: "bg-cover" }), transitions((styles, item) => item && (_jsxs(animated.div, { style: styles, className: cn(hoverBox), children: [_jsx(SVG.Image, {}), _jsx("div", { className: "text-white text-xs leading-none", children: "\uC0AC\uC9C4 \uBC14\uAFB8\uAE30" })] })))] }), _jsxs("div", { className: "flex flex-col h-20", children: [_jsx("div", { className: "text-xl leading-none font-pretendard-bold text-gray-dark", children: name }), _jsx("div", { className: "leading-none text-gray-medium mt-1.25", children: birthday }), _jsxs("div", { className: "flex gap-3 mt-auto", children: [_jsx(Label.Button, { title: "\uC2E4\uBA85 \uC218\uC815", option: { width: "sm", height: "xs" }, onClick: modify.name }), _jsx(Label.Button, { title: "\uC0DD\uC77C \uC218\uC815", option: { width: "sm", height: "xs" }, onClick: modify.birthday })] })] })] }));
28
27
  }
29
28
  function Detail({ titles, infos, toggle, }) {
@@ -36,14 +35,14 @@ function Detail({ titles, infos, toggle, }) {
36
35
  return (_jsxs(Card, { option: {
37
36
  className: "pt-5 px-5",
38
37
  width: "md",
39
- height: "xs",
38
+ height: "2xs",
40
39
  background: gradient.bg.greenToRedSoft,
41
40
  boundary: "",
42
- }, children: [_jsxs("div", { className: "h-13.25 flex flex-col text-gray-dark border-b-1 border-crimson-burgundy", children: [_jsx("div", { className: "text-xl font-pretendard-bold h-6 leading-none", children: titles.title }), _jsx("div", { className: "h-4.75 leading-none", children: titles.subtitle })] }), _jsx("div", { className: "mt-4.25 flex flex-col gap-2.5 ", children: infos?.map(({ title, content, button }, index) => (_jsxs("div", { className: cn(infoBox), children: [title === "phone" ? (_jsx(SVG.Phone, {})) : title === "email" ? (_jsx(SVG.Email, {})) : (_jsx("div", { className: "font-pretendard-bold mr-5 w-7", children: title })), _jsx("div", { className: "leading-none flex items-center w-60", children: content }), button && (_jsx(Label.Button, { title: button.title, onClick: button.onClick, option: {
41
+ }, children: [_jsxs("div", { className: "h-13.25 flex flex-col", children: [_jsx("div", { className: "text-base font-bold h-6 leading-none ", children: titles.title }), _jsx("div", { className: "h-4.75 text-sm leading-none", children: titles.subtitle }), _jsx("div", { className: "h-0.5 w-full bg-gradient-to-r from-green-dark/50 to-red-crimson/50" })] }), _jsx("div", { className: "mt-4.25 flex flex-col gap-2.5 ", children: infos?.map(({ title, content, button }, index) => (_jsxs("div", { className: cn(infoBox), children: [title === "phone" ? (_jsx(SVG.Phone, {})) : title === "email" ? (_jsx(SVG.Email, {})) : (_jsx("div", { className: "font-pretendard-bold mr-5 w-7 flex items-center", children: title })), _jsx("div", { className: "leading-none flex items-center w-60", children: content }), button && (_jsx(Label.Button, { title: button.title, onClick: button.onClick, option: {
43
42
  className: "ml-auto",
44
43
  background: gradient.bg.greenToRed,
45
44
  text: "text-white",
46
- width: "sm",
45
+ width: "xs",
47
46
  height: "xs",
48
47
  } }))] }, id + index))) }), toggle && (_jsxs("div", { className: "flex gap-2.5 items-center absolute bottom-5 right-5", children: [_jsx("div", { className: "text-xs leading-none text-green-dark", children: "\uD559\uC6D0\uC73C\uB85C \uBC1B\uAE30" }), _jsx(Toggle, { state: toggle })] }))] }));
49
48
  }
@@ -1,6 +1,6 @@
1
1
  import Layout from "./layout";
2
2
  import Carousel from "./layout/Carousel";
3
- import Navigation from "./Navigation";
3
+ import Navigation from "./layout/Navigation";
4
4
  import Notice from "./Notice";
5
5
  import Promotion from "./Promotion";
6
6
  import Service from "./Service";
@@ -1,6 +1,6 @@
1
1
  import Layout from "./layout";
2
2
  import Carousel from "./layout/Carousel";
3
- import Navigation from "./Navigation";
3
+ import Navigation from "./layout/Navigation";
4
4
  import Notice from "./Notice";
5
5
  import Promotion from "./Promotion";
6
6
  import Service from "./Service";
@@ -0,0 +1,36 @@
1
+ import { OnClick } from "../../../../interface";
2
+ interface Browser {
3
+ onClick: OnClick;
4
+ }
5
+ interface Calendar {
6
+ schedules: {
7
+ onClick?: OnClick;
8
+ category: string;
9
+ title: string;
10
+ description?: string | [string] | [string, string];
11
+ }[];
12
+ }
13
+ interface Notice {
14
+ announcements: {
15
+ onClick?: OnClick;
16
+ title: string;
17
+ date: string;
18
+ description?: string | [string] | [string, string];
19
+ }[];
20
+ }
21
+ interface Event {
22
+ events: {
23
+ onClick?: OnClick;
24
+ title: string;
25
+ category: string;
26
+ thumbnail?: string;
27
+ }[];
28
+ }
29
+ interface HomeNavigationProps {
30
+ browser: Browser;
31
+ calendar: Calendar;
32
+ notice: Notice;
33
+ event: Event;
34
+ }
35
+ export default function Navigation({ browser, calendar, notice, event, }: HomeNavigationProps): import("react/jsx-runtime").JSX.Element;
36
+ export {};
@@ -0,0 +1,73 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useEffect, useState } from "react";
3
+ import { animated, useTransition } from "react-spring";
4
+ import SVG from "../../../../asset/SVG";
5
+ import { cn } from "../../../../util";
6
+ import { useActionStore } from "../../../../store";
7
+ import { LineBreaks } from "../../../../text";
8
+ export default function Navigation({ browser, calendar, notice, event, }) {
9
+ const { flag } = useActionStore();
10
+ const [isOpen, setIsOpen] = useState(false);
11
+ const [isHidden, setIsHidden] = useState(false);
12
+ const [type, setType] = useState();
13
+ const container = {
14
+ displays: "flex flex-col justify-center gap-y-5 items-center",
15
+ sizes: !isOpen ? "h-80 rounded-r-xl" : "h-screen",
16
+ widths: !isHidden ? "w-[56px] duration-100" : "w-0 duration-500",
17
+ backgrounds: "bg-gradient-to-b from-green-dark to-crimson-burgundy",
18
+ };
19
+ const overlayPopTransition = useTransition(!isHidden && isOpen, {
20
+ from: { width: "0%" },
21
+ enter: { width: "30%" },
22
+ leave: { width: "0%" },
23
+ config: { duration: 100 },
24
+ });
25
+ const overlayCoverTransition = useTransition(isHidden, {
26
+ from: { width: "0%" },
27
+ enter: { width: "100%" },
28
+ config: { duration: 500 },
29
+ });
30
+ useEffect(() => {
31
+ if (isHidden) {
32
+ const timer = setTimeout(() => {
33
+ browser.onClick();
34
+ }, 2000);
35
+ return () => clearTimeout(timer);
36
+ }
37
+ }, [isHidden]);
38
+ useEffect(() => {
39
+ setIsOpen(false);
40
+ setType(undefined);
41
+ }, [flag]);
42
+ const handleOpen = (type) => {
43
+ setType(type);
44
+ if (type === "browser")
45
+ setIsHidden(true);
46
+ return setIsOpen(true);
47
+ };
48
+ const itemContainer = {
49
+ positions: "fixed top-0 left-0 z-40 ",
50
+ sizes: "h-screen ",
51
+ boundaries: "pl-[56px]",
52
+ styles: "overflow-hidden bg-white ",
53
+ };
54
+ const itemBody = {
55
+ boundaries: "px-7.5 pt-[34px]",
56
+ };
57
+ return (_jsxs(_Fragment, { children: [overlayCoverTransition((styles, item) => item && (_jsxs(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: [_jsx("img", { src: "/images/logos/tosel.png", alt: "tosel", width: 368.56, height: 80.07 }), _jsx("div", { children: "dashboard loading..." })] }))), overlayPopTransition((styles, item) => type &&
58
+ item && (_jsx(animated.div, { style: styles, className: cn(itemContainer), children: _jsxs("div", { className: cn(itemBody), children: [_jsx("div", { className: "text-[26px] font-bold text-gradient-green-to-red ", children: navigationTypeString[type] }), _jsx(NavigationItem, { type: type, calendar: calendar, notice: notice, event: event })] }) }))), _jsx("div", { className: "fixed top-1/2 -translate-y-1/2 flex justify-center items-center z-45", children: _jsxs("div", { onClick: (e) => e.stopPropagation(), className: cn(container), children: [_jsx(SVG.Icon.Calendar, { onClick: () => handleOpen("calendar") }), _jsx(SVG.Icon.Notification, { onClick: () => handleOpen("notification") }), _jsx(SVG.Icon.Search, { onClick: () => handleOpen("search") }), _jsx(SVG.Icon.Browser, { onClick: () => handleOpen("browser") }), _jsx(SVG.Icon.Event, { onClick: () => handleOpen("event") })] }) })] }));
59
+ }
60
+ const navigationTypeString = {
61
+ calendar: "시험 일정",
62
+ notification: "공지사항",
63
+ event: "이벤트",
64
+ };
65
+ function NavigationItem({ type, calendar, notice, event, }) {
66
+ if (type === "calendar")
67
+ return (_jsx("div", { className: "mt-[34px] flex flex-col gap-y-[15px]", children: calendar.schedules.map(({ category, title, description, onClick }) => (_jsxs("div", { onClick: onClick, className: "flex flex-col justify-between w-full h-[184px] box-shadow rounded-[10px] p-7.5", children: [_jsxs("div", { children: [_jsx("div", { className: "text-[15px] text-gray-medium", children: category }), _jsx("div", { className: "text-[20px] font-bold text-gray-dark", children: title })] }), _jsx(LineBreaks, { texts: description, className: "text-gray-dark text-[18px]" })] }))) }));
68
+ if (type === "notification")
69
+ return (_jsx("div", { className: "mt-[34px] flex flex-col gap-y-[15px]", children: notice.announcements.map(({ title, date, description, onClick }) => (_jsxs("div", { onClick: onClick, className: "flex flex-col justify-between w-full h-[140px] box-shadow rounded-[10px] p-7.5", children: [_jsxs("div", { children: [_jsx("div", { className: "text-[15px] text-gray-medium", children: date }), _jsx("div", { className: "text-[20px] font-bold text-gray-dark", children: title })] }), _jsx(LineBreaks, { texts: description, className: "text-gray-dark text-[18px]" })] }))) }));
70
+ if (type === "event")
71
+ return (_jsx("div", { className: "mt-[34px] flex flex-col gap-y-[15px]", children: event.events.map(({ title, category, thumbnail, onClick }) => (_jsxs("div", { onClick: onClick, className: "flex flex-col justify-between w-full box-shadow rounded-[10px] p-7.5", children: [_jsxs("div", { className: "h-[92px] border-b-2", children: [_jsx("div", { className: "text-[15px] text-gray-medium", children: category }), _jsx("div", { className: "text-[20px] font-bold text-gray-dark", children: title })] }), _jsx("div", { className: "image-container pt-[15px]", children: _jsx("img", { src: thumbnail, alt: title, className: "w-full" }) })] }))) }));
72
+ return null;
73
+ }
@@ -2,11 +2,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { cn } from "../../../../util";
3
3
  import Footer from "./Footer";
4
4
  import Header from "./Header";
5
+ import { useActionStore } from "../../../../store";
5
6
  export default function Layout({ contents, children, logo, rightButton, }) {
6
7
  const container = {
7
8
  displays: "flex flex-col",
8
9
  sizes: "w-full min-h-screen",
9
10
  overflows: "overflow-x-hidden ",
10
11
  };
11
- return (_jsxs("div", { className: cn(container), children: [_jsx(Header, { logo: logo, rightButton: rightButton, contents: contents }), _jsx("div", { className: "w-full max-w-[1200px] h-15" }), children, _jsx(Footer, {})] }));
12
+ const { setFlag } = useActionStore();
13
+ return (_jsxs("div", { className: cn(container), onClick: setFlag, children: [_jsx(Header, { logo: logo, rightButton: rightButton, contents: contents }), _jsx("div", { className: "w-full max-w-[1200px] h-15" }), children, _jsx(Footer, {})] }));
12
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edu-tosel/design",
3
- "version": "1.0.151",
3
+ "version": "1.0.153",
4
4
  "description": "UI components for International TOSEL Committee",
5
5
  "keywords": [
6
6
  "jsx",
package/util/colors.js CHANGED
@@ -9,11 +9,11 @@ export const gradientBackground = {
9
9
  lab: "bg-gradient-to-br from-violet-light/20 to-blue-sky/40 ",
10
10
  labSoft: "bg-gradient-to-br from-[#797EF6]/32 to-[#44C5F3]/20",
11
11
  greenToRed: "bg-gradient-to-r from-green-dark to-red-crimson",
12
- greenToRedSoft: "bg-gradient-to-r from-green-dark/20 to-red-crimson/20",
12
+ greenToRedSoft: "bg-gradient-to-r from-green-dark/10 to-red-crimson/10",
13
13
  };
14
14
  export const gradientBorder = {
15
15
  greenToRed: "border-gradient-to-r from-green-dark to-crimson-burgundy",
16
- greenToRedSoft: "border-gradient-to-r from-green-dark/20 to-red-crimson/20",
16
+ greenToRedSoft: "border-gradient-to-r from-green-dark/10 to-red-crimson/10",
17
17
  };
18
18
  export const gradient = {
19
19
  bg: gradientBackground,
package/version.txt CHANGED
@@ -1 +1 @@
1
- 1.0.151
1
+ 1.0.153
@@ -43,7 +43,7 @@ export default function InputForm({ title, state, placeholder, isValid, type, on
43
43
  !(isValid === false) &&
44
44
  "shadow-[0px_0px_10px_0px_rgba(16,86,82,0.38)]",
45
45
  };
46
- return (_jsxs("div", { children: [title && _jsx("div", { className: "text-gray-dark", children: title }), _jsxs("div", { className: cn(container), children: [_jsx("div", { onClick: () => ref.current?.focus(), className: cn(placeholderBox), children: placeholder }), _jsx("input", { ref: ref, className: cn(inputBox), value: value, onKeyDown: onKeyDown && ((e) => onKeyDown(e, value ?? "")), onFocus: () => setOnFocus(true), onBlur: () => setOnFocus(false), onChange: (e) => {
46
+ return (_jsxs("div", { children: [title && _jsx("div", { className: "text-gray-dark", children: title }), _jsxs("div", { className: cn(container), children: [_jsx("div", { onClick: () => ref.current?.focus(), className: cn(placeholderBox), children: typeof placeholder === "function" ? placeholder() : placeholder }), _jsx("input", { ref: ref, className: cn(inputBox), value: value, onKeyDown: onKeyDown && ((e) => onKeyDown(e, value ?? "")), onFocus: () => setOnFocus(true), onBlur: () => setOnFocus(false), onChange: (e) => {
47
47
  if (maxLength && e.target.value.length > maxLength)
48
48
  return;
49
49
  setValue(e.target.value);
@@ -42,7 +42,9 @@ function Input({ state, onKeyDown, placeholder, option }) {
42
42
  styles: "focus:outline-none bg-transparent",
43
43
  pointers: "cursor-default",
44
44
  };
45
- return (_jsx("div", { className: cn(container), children: _jsxs("div", { className: cn(body), onClick: () => ref.current?.focus(), 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: "M21.8758 21.8748L16.4623 16.4613M16.4623 16.4613C17.9275 14.9961 18.7506 13.0089 18.7506 10.9368C18.7506 8.86474 17.9275 6.87752 16.4623 5.41234C14.9971 3.94715 13.0099 3.12402 10.9378 3.12402C8.86571 3.12402 6.8785 3.94715 5.41331 5.41234C3.94813 6.87752 3.125 8.86474 3.125 10.9368C3.125 13.0089 3.94813 14.9961 5.41331 16.4613C6.8785 17.9265 8.86571 18.7496 10.9378 18.7496C13.0099 18.7496 14.9971 17.9265 16.4623 16.4613Z", stroke: "#105652", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }) }), _jsx("input", { id: id, ref: ref, className: cn(inputBox), type: "text", value: value, onFocus: () => setIsFocus(true), onBlur: () => setIsFocus(false), placeholder: placeholder ?? "입력해주세요", onKeyDown: onKeyDown && ((e) => onKeyDown(e, value ?? "")), onChange: (e) => setValue(e.target.value) }), _jsx(Obstacle, { disabled: disabled })] }) }));
45
+ return (_jsx("div", { className: cn(container), children: _jsxs("div", { className: cn(body), onClick: () => ref.current?.focus(), 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: "M21.8758 21.8748L16.4623 16.4613M16.4623 16.4613C17.9275 14.9961 18.7506 13.0089 18.7506 10.9368C18.7506 8.86474 17.9275 6.87752 16.4623 5.41234C14.9971 3.94715 13.0099 3.12402 10.9378 3.12402C8.86571 3.12402 6.8785 3.94715 5.41331 5.41234C3.94813 6.87752 3.125 8.86474 3.125 10.9368C3.125 13.0089 3.94813 14.9961 5.41331 16.4613C6.8785 17.9265 8.86571 18.7496 10.9378 18.7496C13.0099 18.7496 14.9971 17.9265 16.4623 16.4613Z", stroke: "#105652", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }) }), _jsx("input", { id: id, ref: ref, className: cn(inputBox), type: "text", value: value, onFocus: () => setIsFocus(true), onBlur: () => setIsFocus(false), placeholder: typeof placeholder === "function"
46
+ ? placeholder()
47
+ : placeholder ?? "입력해주세요", onKeyDown: onKeyDown && ((e) => onKeyDown(e, value ?? "")), onChange: (e) => setValue(e.target.value) }), _jsx(Obstacle, { disabled: disabled })] }) }));
46
48
  }
47
49
  Input.Form = Form;
48
50
  export default Input;
@@ -1,9 +0,0 @@
1
- import { OnClick } from "../../../interface";
2
- interface Browser {
3
- onClick: OnClick;
4
- }
5
- interface HomeNavigationProps {
6
- browser: Browser;
7
- }
8
- export default function Navigation({ browser }: HomeNavigationProps): import("react/jsx-runtime").JSX.Element;
9
- export {};
@@ -1,42 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useEffect, useState } from "react";
3
- import { animated, useTransition } from "react-spring";
4
- import SVG from "../../../asset/SVG";
5
- import { cn } from "../../../util";
6
- export default function Navigation({ browser }) {
7
- const [flag, setFlag] = useState(false);
8
- const [isOpen, setIsOpen] = useState(false);
9
- const container = {
10
- displays: "flex flex-col justify-center gap-y-5 items-center",
11
- sizes: !isOpen ? "h-80" : "h-screen",
12
- backgrounds: "bg-gradient-to-b from-green-dark to-crimson-burgundy",
13
- animations: "duration-500",
14
- styles: "rounded-r-xl",
15
- };
16
- const transition = useTransition(!flag, {
17
- from: { width: 56 },
18
- leave: { width: 56, duration: 500 },
19
- });
20
- const overlayTransition = useTransition(flag, {
21
- from: { width: "0%" },
22
- enter: { width: "100%" },
23
- config: { duration: 500 },
24
- });
25
- useEffect(() => {
26
- if (flag) {
27
- const timer = setTimeout(() => {
28
- browser.onClick();
29
- }, 2000);
30
- return () => clearTimeout(timer);
31
- }
32
- }, [flag]);
33
- const handleOpen = () => {
34
- setIsOpen(!isOpen);
35
- console.log(isOpen);
36
- return;
37
- };
38
- return (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed top-1/2 -translate-y-1/2 flex justify-center items-center z-45 border-4 border-red-500", children: transition((styles, item) => item && (_jsxs(animated.div, { style: styles, className: cn(container), children: [_jsx(SVG.Icon.Calendar, { onClick: handleOpen }), _jsx(SVG.Icon.Notification, { onClick: handleOpen }), _jsx(SVG.Icon.Search, { onClick: handleOpen }), _jsx(SVG.Icon.Browser, { onClick: () => {
39
- setFlag(true);
40
- browser.onClick;
41
- } }), _jsx(SVG.Icon.Gift, {})] }))) }), overlayTransition((styles, item) => item && (_jsxs(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: [_jsx("img", { src: "/images/logos/tosel.png", alt: "tosel", width: 368.56, height: 80.07 }), _jsx("div", { children: "dashboard loading..." })] })))] }));
42
- }
@@ -1,2 +0,0 @@
1
- import { InputWidget } from "../../interface";
2
- export default function EmailInput({ state, placeholder, option, }: InputWidget): import("react/jsx-runtime").JSX.Element;
@@ -1,46 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useId, useState } from "react";
3
- import { cn } from "../../util";
4
- const widthSize = {
5
- xs: "w-28",
6
- sm: "w-48",
7
- md: "w-64",
8
- lg: "w-96",
9
- xl: "w-128",
10
- "2xl": "w-144",
11
- full: "w-full",
12
- };
13
- export default function EmailInput({ state, placeholder, option, }) {
14
- const { width } = option ?? {};
15
- const id = useId();
16
- const [value, setValue] = state;
17
- const [focused, setFocused] = useState(false);
18
- const { text } = option ?? {};
19
- const isValidEmail = (email) => {
20
- return /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(email);
21
- };
22
- const emailCss = {
23
- true: "rounded-md pl-4 pr-4 pt-2 pb-2 bg-slate-200 text-xs focus:outline-none focus:bg-white focus:text-black box-green-focus transition-all",
24
- false: "rounded-md pl-4 pr-4 pt-2 pb-2 text-xs bg-[#F9E4E6] focus:outline-none text-[#FF8383] box-shadow-focus-red transition-all peer",
25
- allTrue: "rounded-md pl-4 pr-4 pt-2 pb-2 bg-white text-xs focus:outline-none box-green focus:bg-white focus:text-black box-shadow-focus transition-all",
26
- allTrueFocus: "rounded-md pl-4 pr-4 pt-2 pb-2 bg-white text-xs focus:outline-none transition-all box-green-focus",
27
- };
28
- const container = {
29
- width: `${widthSize[width ?? "md"]} h-8`,
30
- };
31
- const handleBlur = () => {
32
- setFocused(false);
33
- };
34
- const handleFocus = () => {
35
- setFocused(true);
36
- };
37
- return (_jsxs("div", { className: "relative", children: [_jsx("input", { className: cn(container) +
38
- " " +
39
- (value === "" || isValidEmail(value)
40
- ? emailCss.true
41
- : emailCss.false) +
42
- (isValidEmail(value) && !focused ? emailCss.allTrue : ""), id: id, type: "text", placeholder: placeholder ?? "E-mail을 입력해주세요.", onChange: (e) => setValue(e.target.value), onBlur: handleBlur, onFocus: handleFocus }), value === "" ||
43
- (!isValidEmail(value) && (_jsx("div", { className: "absolute inset-y-0 right-0 flex items-center pr-3", children: _jsx("span", { className: "text-[#FF8383]", children: "!" }) }))), typeof value === "string" &&
44
- value.length > 5 &&
45
- !isValidEmail(value) && (_jsx("div", { className: "absolute top-4 left-40 w-60 h-12 bg-black opacity-60 z-100 text-white p-2 text-xs rounded-md shadow-md invisible peer-hover:visible", children: text }))] }));
46
- }