@edu-tosel/design 1.0.102 → 1.0.104

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,6 +1,8 @@
1
+ import { OnClick } from "../../../interface";
1
2
  type Content = {
2
3
  title: string;
3
4
  date: string;
5
+ onClick?: OnClick;
4
6
  };
5
7
  interface ManyLayoutProps {
6
8
  contents: Content[];
@@ -6,11 +6,12 @@ export default function Many({ contents }) {
6
6
  sizes: "w-full max-w-[1200px]",
7
7
  boundaries: "pl-12 ",
8
8
  };
9
- const box = {
9
+ const box = (flag) => ({
10
10
  displays: "flex flex-col gap-y-2",
11
- sizes: "h-25",
11
+ sizes: "h-25 w-full",
12
12
  boundaries: "pt-7.5 border-b-1",
13
13
  fonts: "leading-tight",
14
- };
15
- return (_jsx(Announcement.Layout, { children: _jsx("div", { className: cn(body), children: contents.map((content) => (_jsxs("div", { className: cn(box), children: [_jsx("div", { className: "text-[16px] text-gray-dark font-pretendard-bold", children: content.title }), _jsx("div", { className: "text-[12px] text-gray-medium", children: content.date })] }))) }) }));
14
+ pointers: flag ? "cursor-pointer" : "cursor-default",
15
+ });
16
+ return (_jsx(Announcement.Layout, { children: _jsx("div", { className: cn(body), children: contents.map((content) => (_jsxs("button", { onClick: content.onClick, className: cn(box(!!content.onClick)), children: [_jsx("div", { className: "text-[16px] text-gray-dark font-pretendard-bold", children: content.title }), _jsx("div", { className: "text-[12px] text-gray-medium", children: content.date })] }))) }) }));
16
17
  }
@@ -1 +1,10 @@
1
- export default function Header(): import("react/jsx-runtime").JSX.Element;
1
+ import { ReactNode } from "react";
2
+ import { Button as _Button, OnClick } from "../../../../interface";
3
+ export default function Header({ logo, rightButton, contents, }: {
4
+ logo: {
5
+ node: ReactNode;
6
+ onClick?: OnClick;
7
+ };
8
+ rightButton?: _Button;
9
+ contents: _Button[];
10
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cn } from "../../../../util";
3
- export default function Header() {
2
+ import { cn, gradient } from "../../../../util";
3
+ import { Label } from "../../../../widget";
4
+ export default function Header({ logo, rightButton, contents, }) {
4
5
  const container = {
5
6
  displays: "flex justify-center items-center",
6
7
  sizes: "w-full",
@@ -8,27 +9,18 @@ export default function Header() {
8
9
  };
9
10
  const body = {
10
11
  displays: "flex items-center justify-between",
11
- className: "w-full max-w-262 h-25",
12
+ className: "w-full max-w-[1200px] h-15",
13
+ boundaries: "px-12",
12
14
  };
13
- return (_jsx("div", { className: cn(container), children: _jsxs("div", { className: cn(body), children: [_jsx("img", { src: "/images/logos/tosel.png", alt: "tosel-logo", width: 147, height: 31.93 }), _jsx("div", { className: "flex items-center gap-7.5", children: buttons.map((button, index) => (_jsx("div", { children: button.title }, index))) })] }) }));
15
+ const buttonBox = {
16
+ fonts: "text-[16px] leading-tight",
17
+ texts: "text-gray-dark",
18
+ boundaries: "px-2.5",
19
+ };
20
+ return (_jsx("div", { className: cn(container), children: _jsxs("div", { className: cn(body), children: [_jsx("div", { onClick: logo.onClick, children: logo.node }), _jsxs("div", { className: "flex items-center gap-x-12", children: [_jsx("div", { className: "flex items-center gap-2.5", children: contents.map((button, index) => (_jsx("button", { onClick: button.onClick, className: cn(buttonBox), children: button.title }, index))) }), rightButton && (_jsx(Label.Button, { title: rightButton.title, onClick: rightButton?.onClick, option: {
21
+ width: "2xs",
22
+ height: "4xs",
23
+ background: gradient.bg.greenToRed,
24
+ text: "text-white",
25
+ } }))] })] }) }));
14
26
  }
15
- const buttons = [
16
- {
17
- title: "About Us",
18
- },
19
- {
20
- title: "정기시험",
21
- },
22
- {
23
- title: "교재/학습",
24
- },
25
- {
26
- title: "LAB",
27
- },
28
- {
29
- title: "올림피아드",
30
- },
31
- {
32
- title: "게시판",
33
- },
34
- ];
@@ -1,3 +1,11 @@
1
- export default function Layout({ children }: {
1
+ import { Button, OnClick } from "../../../../interface";
2
+ import { ReactNode } from "react";
3
+ export default function Layout({ contents, children, logo, rightButton, }: {
4
+ contents: Button[];
2
5
  children: React.ReactNode;
6
+ logo: {
7
+ node: ReactNode;
8
+ onClick?: OnClick;
9
+ };
10
+ rightButton?: Button;
3
11
  }): import("react/jsx-runtime").JSX.Element;
@@ -2,11 +2,11 @@ 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
- export default function Layout({ children }) {
5
+ export default function Layout({ contents, children, logo, rightButton, }) {
6
6
  const container = {
7
7
  displays: "flex flex-col",
8
8
  sizes: "w-full min-h-screen",
9
9
  overflows: "overflow-x-hidden",
10
10
  };
11
- return (_jsxs("div", { className: cn(container), children: [_jsx(Header, {}), children, _jsx(Footer, {})] }));
11
+ return (_jsxs("div", { className: cn(container), children: [_jsx(Header, { logo: logo, rightButton: rightButton, contents: contents }), children, _jsx(Footer, {})] }));
12
12
  }
@@ -1,6 +1,6 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Input } from "../../../widget";
3
3
  function WithTitle(props) {
4
- return (_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("div", { className: "leading-none", children: props.title }), _jsx(Input.Form, { ...props })] }));
4
+ return (_jsx("div", { className: "flex flex-col gap-1", children: _jsx(Input.Form, { ...props }) }));
5
5
  }
6
6
  export default WithTitle;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edu-tosel/design",
3
- "version": "1.0.102",
3
+ "version": "1.0.104",
4
4
  "description": "UI components for International TOSEL Committee",
5
5
  "keywords": [
6
6
  "jsx",
package/version.txt CHANGED
@@ -1 +1 @@
1
- 1.0.102
1
+ 1.0.104
@@ -2,8 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { cn } from "../../util";
3
3
  import { Obstacle } from "../..";
4
4
  const widthSize = {
5
- "3xs": "w-7",
6
- "2xs": "w-10",
5
+ "4xs": "w-7",
6
+ "3xs": "w-10",
7
+ "2xs": "w-13",
7
8
  xs: "w-20",
8
9
  sm: "w-22.5",
9
10
  md: "w-45",
@@ -11,6 +12,7 @@ const widthSize = {
11
12
  full: "w-full",
12
13
  };
13
14
  const heightSize = {
15
+ "4xs": "h-5", // 20px
14
16
  "3xs": "h-5.5", // 22px
15
17
  "2xs": "h-6.25", // 25px
16
18
  xs: "h-7.5",
@@ -29,7 +31,10 @@ export default function LabelDesign({ title, onClick, option, hoverState, }) {
29
31
  texts: text ?? "text-gray-dim",
30
32
  animation: "duration-500",
31
33
  fonts: "font-pretendard-light",
32
- styles: height === "xs" || height === "2xs" || height === "3xs"
34
+ styles: height === "xs" ||
35
+ height === "2xs" ||
36
+ height === "3xs" ||
37
+ height === "4xs"
33
38
  ? "rounded-md text-xs"
34
39
  : "rounded-lgx",
35
40
  };