@edu-tosel/design 1.0.94 → 1.0.95

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.
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from "react";
2
- import { OnClick, State } from "./Property";
2
+ import { Button, OnClick, State } from "./Property";
3
3
  import { ShowAction } from "./Action";
4
4
  interface Notification {
5
5
  id: number;
@@ -14,7 +14,6 @@ interface NotificationProps {
14
14
  notifications?: Partial<Notification>[];
15
15
  flag: boolean;
16
16
  onClick: OnClick;
17
- color?: string;
18
17
  }
19
18
  export interface MenuProps {
20
19
  showAction?: ShowAction;
@@ -26,7 +25,8 @@ export interface MenuProps {
26
25
  input?: {
27
26
  password: State<string | undefined>;
28
27
  };
29
- onClick: OnClick;
28
+ medium?: Button[];
29
+ bottom: Button[];
30
30
  }
31
31
  export interface DashboardHeaderProps {
32
32
  title: string;
@@ -34,9 +34,11 @@ export interface DashboardHeaderProps {
34
34
  notification: NotificationProps;
35
35
  menu?: MenuProps;
36
36
  option?: {
37
+ onClick?: OnClick;
37
38
  background?: string;
38
39
  text?: string;
39
40
  className?: string;
41
+ iconColor?: string;
40
42
  };
41
43
  }
42
44
  export interface DashboardProps {
@@ -8,8 +8,8 @@ import SVG from "../../../asset/SVG";
8
8
  import { Label } from "../../../widget";
9
9
  export function Header({ title, logo, notification, menu, option, }) {
10
10
  const { setView, setIsOwn } = useActionStore();
11
- const { notifications, flag, onClick, color } = notification;
12
- const { text, background, className } = option ?? {};
11
+ const { notifications, flag, onClick } = notification;
12
+ const { text, background, className, iconColor } = option ?? {};
13
13
  const container = {
14
14
  positions: "fixed xl:static top-0 left-0 z-40",
15
15
  displays: "flex items-center justify-between ",
@@ -26,13 +26,13 @@ export function Header({ title, logo, notification, menu, option, }) {
26
26
  setIsOwn(true);
27
27
  onClick && onClick();
28
28
  return setView("notification");
29
- }, color: color }), menu?.profile ? (_jsx(SVG.Profile, { onClick: () => {
29
+ }, color: iconColor }), menu?.profile ? (_jsx(SVG.Profile, { onClick: () => {
30
30
  setIsOwn(true);
31
31
  return setView("menu");
32
- }, color: color })) : (_jsx(Label.Button, { title: "\uB300\uC2DC\uBCF4\uB4DC\uB85C", onClick: menu?.onClick, option: {
32
+ }, color: iconColor })) : (_jsx(Label.Button, { title: "\uB300\uC2DC\uBCF4\uB4DC", onClick: () => option?.onClick && option.onClick(), option: {
33
33
  width: "sm",
34
34
  height: "xs",
35
- text: "text-white",
36
35
  background: gradient.bg.greenToRed,
36
+ text: "text-white",
37
37
  } }))] }) })] }));
38
38
  }
@@ -9,9 +9,8 @@ export default function Layout({ header, navigations, children, option, }) {
9
9
  const { title, option: headerOption, logo, notification, menu } = header;
10
10
  const { background } = option ?? {};
11
11
  useEffect(() => {
12
- if (isOwn) {
12
+ if (isOwn)
13
13
  return setIsOwn(false);
14
- }
15
14
  return clearView();
16
15
  }, [flag]);
17
16
  const container = {
@@ -1,2 +1,2 @@
1
1
  import { MenuProps } from "../../../interface";
2
- export default function Menu({ showAction, profile, input, onClick, }: MenuProps): JSX.Element;
2
+ export default function Menu({ showAction, profile, input, medium, bottom, }: MenuProps): JSX.Element;
@@ -3,7 +3,7 @@ import { useTransition, animated } from "react-spring";
3
3
  import { cn, gradient } from "../../../util";
4
4
  import { useActionStore } from "../../../store";
5
5
  import { Label } from "../../../widget";
6
- export default function Menu({ showAction, profile, input, onClick, }) {
6
+ export default function Menu({ showAction, profile, input, medium, bottom, }) {
7
7
  const { isVisible } = showAction ?? {};
8
8
  const { setIsOwn, removeModal } = useActionStore();
9
9
  const container = {
@@ -18,10 +18,14 @@ export default function Menu({ showAction, profile, input, onClick, }) {
18
18
  leave: { opacity: 0 },
19
19
  config: { duration: 200 },
20
20
  });
21
- return transitions((styles, item) => item && (_jsxs(animated.div, { style: styles, className: cn(container), onClick: () => setIsOwn(true), children: [_jsxs("div", { className: "h-17.75 flex gap-12 justify-center items-center text-black border-b-2 pb-2.5", children: [_jsxs("div", { children: [_jsx("div", { children: profile?.name }), _jsx("div", { className: "text-xs", children: profile?.belong })] }), _jsx("div", { className: "relative w-15 h-15 rounded-md overflow-hidden", children: _jsx("img", { className: "bg-cover rounded-md", src: profile?.image, alt: "profile-image" }) })] }), _jsxs("div", { className: "flex flex-col gap-2.5 pt-2.5", children: [_jsx("input", { className: "w-47.5 h-6.25 border-2 text-black", value: input?.password[0], onChange: (e) => input?.password[1](e.target.value), type: "password" }), _jsxs("div", { className: "flex gap-2.5", children: [_jsx(Label.Button, { title: "\uCDE8\uC18C", onClick: () => removeModal("menu"), option: {
21
+ return transitions((styles, item) => item && (_jsxs(animated.div, { style: styles, className: cn(container), onClick: () => setIsOwn(true), children: [_jsxs("div", { className: "h-17.75 flex gap-12 justify-center items-center text-black border-b-2 pb-2.5", children: [_jsxs("div", { children: [_jsx("div", { children: profile?.name }), _jsx("div", { className: "text-xs", children: profile?.belong })] }), _jsx("div", { className: "relative w-15 h-15 rounded-md overflow-hidden", children: _jsx("img", { className: "bg-cover rounded-md", src: profile?.image, alt: "profile-image" }) })] }), _jsxs("div", { className: "flex flex-col gap-2.5 pt-2.5", children: [_jsx("input", { className: "w-47.5 h-6.25 border-2 text-black", value: input?.password[0], onChange: (e) => input?.password[1](e.target.value), type: "password" }), medium?.map((button) => (_jsx(Label.Button, { title: button.title, onClick: button.onClick, option: {
22
+ ...button.option,
23
+ width: "full",
24
+ height: "xs",
25
+ } }))), _jsxs("div", { className: "flex gap-2.5", children: [_jsx(Label.Button, { title: bottom[0].title, onClick: bottom[0].onClick, option: {
22
26
  width: "sm",
23
27
  height: "xs",
24
- } }), _jsx(Label.Button, { title: "\uD655\uC778", onClick: onClick, option: {
28
+ } }), _jsx(Label.Button, { title: bottom[1].title, onClick: bottom[1].onClick, option: {
25
29
  background: gradient.bg.greenToRed,
26
30
  text: "text-white",
27
31
  width: "sm",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edu-tosel/design",
3
- "version": "1.0.94",
3
+ "version": "1.0.95",
4
4
  "description": "UI components for International TOSEL Committee",
5
5
  "keywords": [
6
6
  "jsx",
package/version.txt CHANGED
@@ -1 +1 @@
1
- 1.0.94
1
+ 1.0.95