@edu-tosel/design 0.1.5 → 0.1.6

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.
Files changed (52) hide show
  1. package/board/Board.d.ts +7 -0
  2. package/board/Board.js +9 -0
  3. package/board/CanvasBoard.d.ts +7 -0
  4. package/board/CanvasBoard.js +11 -0
  5. package/board/Header.d.ts +6 -0
  6. package/board/Header.js +12 -0
  7. package/board/ListBoard.d.ts +7 -0
  8. package/board/ListBoard.js +7 -0
  9. package/board/index.d.ts +2 -18
  10. package/board/index.js +2 -33
  11. package/card/Card.d.ts +9 -8
  12. package/card/Card.js +26 -15
  13. package/card/ChartCard.d.ts +20 -0
  14. package/card/ChartCard.js +7 -0
  15. package/card/ProfileCard.js +1 -1
  16. package/card/TableCard.d.ts +12 -0
  17. package/card/TableCard.js +13 -0
  18. package/card/TrumpCard.d.ts +19 -0
  19. package/card/TrumpCard.js +19 -0
  20. package/card/index.d.ts +3 -0
  21. package/card/index.js +3 -0
  22. package/deck/Deck.d.ts +15 -0
  23. package/deck/Deck.js +14 -0
  24. package/deck/index.d.ts +1 -18
  25. package/deck/index.js +1 -16
  26. package/index.d.ts +9 -0
  27. package/index.js +9 -0
  28. package/layout/dashboard/Header.js +11 -7
  29. package/layout/dashboard/index.d.ts +3 -1
  30. package/layout/dashboard/index.js +5 -3
  31. package/modal/Modal.d.ts +8 -0
  32. package/modal/Modal.js +21 -0
  33. package/modal/index.d.ts +1 -9
  34. package/modal/index.js +1 -23
  35. package/navigation/Navigation.d.ts +5 -0
  36. package/navigation/Navigation.js +26 -0
  37. package/navigation/index.d.ts +1 -6
  38. package/navigation/index.js +1 -16
  39. package/package.json +3 -1
  40. package/shelf/Shelf.d.ts +4 -0
  41. package/shelf/Shelf.js +4 -0
  42. package/shelf/index.d.ts +1 -0
  43. package/shelf/index.js +1 -0
  44. package/tailwind.config.js +57 -2
  45. package/text/LineBreaks.d.ts +4 -0
  46. package/text/LineBreaks.js +5 -0
  47. package/text/index.d.ts +1 -5
  48. package/text/index.js +1 -6
  49. package/util/colors.js +1 -1
  50. package/version.txt +1 -1
  51. package/header/index.d.ts +0 -1
  52. package/header/index.js +0 -1
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ export declare function Board({ children, options, }: {
3
+ children: React.ReactNode;
4
+ options: {
5
+ height?: number;
6
+ };
7
+ }): import("react/jsx-runtime").JSX.Element;
package/board/Board.js ADDED
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export function Board({ children, options, }) {
3
+ const { height } = options ?? {};
4
+ const classNames = [
5
+ `min-h-screen xl:min-h-0 xl:h-186 `,
6
+ "xl:rounded-xl bg-white/80 relative w-full ",
7
+ ].join(" ");
8
+ return _jsx("div", { className: classNames + "", children: children });
9
+ }
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ export declare function CanvasBoard({ children, options, }: {
3
+ children: React.ReactNode;
4
+ options?: {
5
+ height?: number;
6
+ };
7
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from "../util";
3
+ import { Board } from "./Board";
4
+ export function CanvasBoard({ children, options, }) {
5
+ const { height } = options ?? {};
6
+ const layouts = "flex flex-wrap gap-12 ";
7
+ const sizes = "h-full ";
8
+ const paddings = "pb-36 xl:pb-12 px-2 xs:px-4 xl:pl-10 xl:pr-2 pt-2 xs:pt-4 xl:pt-8";
9
+ const styles = "xl:overflow-y-scroll ";
10
+ return (_jsx(Board, { options: { height }, children: _jsx("div", { className: cn(layouts, sizes, paddings, styles), children: children }) }));
11
+ }
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ export declare function Header({ title, colors, childrens, }: {
3
+ title: string;
4
+ colors?: [string, string];
5
+ childrens?: React.ReactNode[];
6
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { between, center } from "../util";
3
+ export function Header({ title, colors, childrens, }) {
4
+ const [bgColor, textColor] = colors ?? ["bg", "text"];
5
+ const headerClassNames = [
6
+ center.row + between.row,
7
+ `bg-${bgColor || "white-off"}`,
8
+ `text-${textColor || "black"}`,
9
+ "w-full h-22 px-12 ",
10
+ ].join(" ");
11
+ return (_jsxs("div", { className: headerClassNames, children: [_jsx("div", { className: "text-xl font-bold", children: title }), _jsx("div", { className: "flex", children: childrens?.map((children) => children) })] }));
12
+ }
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ export declare function ListBoard({ children, options, }: {
3
+ children: React.ReactNode;
4
+ options?: {
5
+ height?: number;
6
+ };
7
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Board } from "./Board";
3
+ export function ListBoard({ children, options, }) {
4
+ const { height } = options ?? {};
5
+ const classNames = ["pt-8 px-12 overflow-y-scroll h-full pb-32"].join(" ");
6
+ return (_jsx(Board, { options: { height }, children: _jsx("div", { className: classNames, children: children }) }));
7
+ }
package/board/index.d.ts CHANGED
@@ -1,19 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "../globals.css";
3
- export declare function CanvasBoard({ children, options, }: {
4
- children: React.ReactNode;
5
- options?: {
6
- height?: number;
7
- };
8
- }): import("react/jsx-runtime").JSX.Element;
9
- export declare function ListBoard({ children, header, options, }: {
10
- children: React.ReactNode;
11
- header: {
12
- title: string;
13
- colors?: [string, string];
14
- childrens?: React.ReactNode[];
15
- };
16
- options?: {
17
- height?: number;
18
- };
19
- }): import("react/jsx-runtime").JSX.Element;
2
+ export * from "./CanvasBoard";
3
+ export * from "./ListBoard";
package/board/index.js CHANGED
@@ -1,34 +1,3 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
1
  import "../globals.css";
3
- import { center, between } from "../util";
4
- function Header({ title, colors, childrens, }) {
5
- const [bgColor, textColor] = colors ?? ["bg", "text"];
6
- const headerClassNames = [
7
- center.row + between.row,
8
- `bg-${bgColor || "white-off"}`,
9
- `text-${textColor || "black"}`,
10
- "w-full h-22 px-12",
11
- ].join(" ");
12
- return (_jsxs("div", { className: headerClassNames, children: [_jsx("div", { className: "text-xl font-bold", children: title }), _jsx("div", { className: "flex", children: childrens?.map((children) => children) })] }));
13
- }
14
- function Board({ children, header, options, }) {
15
- const { height } = options ?? {};
16
- const classNames = [
17
- `h-${height ?? 186} ${header ? "" : "pt-8"}`,
18
- "rounded-xl bg-white/80 overflow-hidden relative w-full",
19
- ].join(" ");
20
- return (_jsxs("div", { className: classNames, children: [header ? _jsx(Header, { ...header }) : null, _jsx("div", { className: "h-full", children: children })] }));
21
- }
22
- export function CanvasBoard({ children, options, }) {
23
- const { height } = options ?? {};
24
- const classNames = ["px-12"].join(" ");
25
- return (_jsx(Board, { options: { height }, children: _jsx("div", { className: classNames, children: children }) }));
26
- }
27
- export function ListBoard({ children, header, options, }) {
28
- const { title, colors, childrens } = header;
29
- const { height } = options ?? {};
30
- const classNames = [
31
- "scrollbar pt-8 px-12 overflow-y-scroll h-full pb-32",
32
- ].join(" ");
33
- return (_jsx(Board, { header: { title, colors, childrens }, options: { height }, children: _jsx("div", { className: classNames, children: children }) }));
34
- }
2
+ export * from "./CanvasBoard";
3
+ export * from "./ListBoard";
package/card/Card.d.ts CHANGED
@@ -1,14 +1,15 @@
1
1
  /// <reference types="react" />
2
2
  import "../globals.css";
3
- export declare function Card<T extends string | number>({ children, header, options, }: {
3
+ export type Size = "small" | "medium" | "large" | "xLarge";
4
+ export declare function Card({ children, options, }: {
4
5
  children: React.ReactNode;
5
- header?: {
6
- title: string;
7
- bgColor?: string;
8
- childrens?: React.ReactNode[];
9
- };
10
6
  options?: {
11
- height?: number;
12
- width?: T;
7
+ height?: Size;
8
+ width?: Size;
9
+ text?: {
10
+ size?: string;
11
+ color?: string;
12
+ };
13
+ onClick?: () => unknown | (() => Promise<unknown>);
13
14
  };
14
15
  }): import("react/jsx-runtime").JSX.Element;
package/card/Card.js CHANGED
@@ -1,19 +1,30 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import "../globals.css";
3
- import { center, between } from "../util";
4
- function Header({ title, bgColor, childrens, }) {
5
- const headerClassNames = [
6
- center.row + between.row,
7
- `${bgColor || "bg-white-off"}`,
8
- "w-full h-12 px-12",
3
+ import { cn } from "../util";
4
+ const widthSize = {
5
+ small: "md:w-60",
6
+ medium: "md:w-90",
7
+ large: "md:w-135",
8
+ xLarge: "md:w-225",
9
+ };
10
+ const heightSize = {
11
+ small: "h-72 sm:h-48",
12
+ medium: "h-72 sm:h-48",
13
+ large: "h-80",
14
+ xLarge: "h-80",
15
+ };
16
+ export function Card({ children, options, }) {
17
+ const { height, width, text, onClick } = options ?? {};
18
+ const { size: textSize, color: textColor } = text ?? {};
19
+ const sizes = [
20
+ `${heightSize[height ?? "small"]}`,
21
+ `w-full ${widthSize[width ?? "small"]}`,
9
22
  ].join(" ");
10
- return (_jsxs("div", { className: headerClassNames, children: [_jsx("div", { className: "text-xl font-bold", children: title }), _jsx("div", { className: "flex", children: childrens?.map((children) => children) })] }));
11
- }
12
- export function Card({ children, header, options, }) {
13
- const { height, width } = options ?? {};
14
- const classNames = [
15
- `h-${height ?? 48} w-${width ?? "full"} p-4 max-w-232 `,
16
- "rounded-xl bg-white/80 overflow-hidden relative box-shadow duration-500",
23
+ const positions = "relative";
24
+ const styles = [
25
+ `${onClick ? "cursor-pointer" : ""}`,
26
+ `text-${textSize ?? "base"}`,
27
+ `rounded-xl bg-white/80 overflow-hidden box-shadow duration-500`,
17
28
  ].join(" ");
18
- return (_jsxs("div", { className: classNames, children: [header ? _jsx(Header, { ...header }) : null, _jsx("div", { className: "h-full", children: children })] }));
29
+ return (_jsx("div", { onClick: onClick, className: cn(sizes, positions, styles), children: children }));
19
30
  }
@@ -0,0 +1,20 @@
1
+ import "../globals.css";
2
+ interface ChartCardProps {
3
+ data: Record<string, string | number>[];
4
+ xAxis: string;
5
+ yAxis: string;
6
+ lines?: {
7
+ dataKey: string;
8
+ stroke: string;
9
+ }[];
10
+ bars?: {
11
+ dataKey: string;
12
+ fill: string;
13
+ }[];
14
+ areas?: {
15
+ dataKey: string;
16
+ fill: string;
17
+ }[];
18
+ }
19
+ export declare function ChartCard({ data, xAxis, yAxis, lines, bars, areas, }: ChartCardProps): import("react/jsx-runtime").JSX.Element;
20
+ export {};
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import "../globals.css";
3
+ import { Area, Bar, ComposedChart, Line, ResponsiveContainer, Tooltip, XAxis, YAxis, } from "recharts";
4
+ import { Card } from "./Card";
5
+ export function ChartCard({ data, xAxis, yAxis, lines, bars, areas, }) {
6
+ return (_jsx(Card, { options: { width: "xLarge", height: "large", text: { size: "xs" } }, children: _jsx(ResponsiveContainer, { width: "100%", height: "100%", children: _jsxs(ComposedChart, { data: data, children: [_jsx(XAxis, { dataKey: xAxis }), _jsx(YAxis, { dataKey: yAxis }), _jsx(Tooltip, {}), lines?.map((line) => (_jsx(Line, { ...line }, line.dataKey))), bars?.map((bar) => (_jsx(Bar, { ...bar }, bar.dataKey))), areas?.map((area) => (_jsx(Area, { ...area }, area.dataKey)))] }) }) }));
7
+ }
@@ -4,5 +4,5 @@ import { colorsByLevel } from "../util";
4
4
  export function ProfileCard({ info, gradeData, }) {
5
5
  const { name, birthday, image } = info;
6
6
  const { level, score, grade } = gradeData ?? {};
7
- return (_jsx(Card, { options: { width: 84 }, children: _jsxs("div", { className: "flex", children: [_jsx("img", { src: image, alt: "profile", className: "h-20 w-20 overflow-hidden rounded-full object-cover " }), _jsxs("div", { className: "ml-auto flex flex-col gap-4", children: [_jsxs("div", { className: "flex w-52 items-end gap-2 border-b-2 border-blue-navy pb-2", children: [_jsx("div", { className: "text-xl font-bold", children: name }), _jsx("div", { children: birthday })] }), _jsxs("div", { children: [_jsx("div", { children: "\uD559\uC6D0\uC0DD" }), _jsx("div", { children: level ? colorsByLevel[level] : "" })] })] })] }) }));
7
+ return (_jsx(Card, { options: { width: "small" }, children: _jsxs("div", { className: "flex", children: [_jsx("img", { src: image, alt: "profile", className: "h-20 w-20 overflow-hidden rounded-full object-cover " }), _jsxs("div", { className: "ml-auto flex flex-col gap-4", children: [_jsxs("div", { className: "flex w-52 items-end gap-2 border-b-2 border-blue-navy pb-2", children: [_jsx("div", { className: "text-xl font-bold", children: name }), _jsx("div", { children: birthday })] }), _jsxs("div", { children: [_jsx("div", { children: "\uD559\uC6D0\uC0DD" }), _jsx("div", { children: level ? colorsByLevel[level] : "" })] })] })] }) }));
8
8
  }
@@ -0,0 +1,12 @@
1
+ import "../globals.css";
2
+ export declare function TableCard({ data, fields, sizes, options, }: {
3
+ data: Record<string, string>[];
4
+ fields: Record<string, string>;
5
+ sizes: Record<string, string>;
6
+ options?: {
7
+ color?: {
8
+ background: string;
9
+ text: string;
10
+ };
11
+ };
12
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import "../globals.css";
3
+ import { Card } from "./Card";
4
+ export function TableCard({ data, fields, sizes, options, }) {
5
+ const { color } = options ?? {};
6
+ const { background: bgColor, text: textColor } = color ?? {};
7
+ const keys = Object.keys(fields);
8
+ const fieldsClassNames = [
9
+ `flex h-11 items-center font-bold pl-4`,
10
+ `bg-${bgColor ?? "gray-300"} text-${textColor ?? "black"}`,
11
+ ].join(" ");
12
+ return (_jsx(Card, { options: { width: "large", height: "large" }, children: _jsxs("div", { className: "overflow-hidden text-xs xs:text-sm sm:text-base", children: [_jsx("div", { className: fieldsClassNames, children: keys.map((key) => (_jsx("div", { className: `w-${sizes[key]}`, children: fields[key] }, key))) }), data.map((row, index) => (_jsx("div", { className: "flex items-center pl-4 h-11 ", children: keys.map((key) => (_jsx("div", { className: `truncate w-${sizes[key] ?? "auto"}`, children: row[key] }, key))) }, index)))] }) }));
13
+ }
@@ -0,0 +1,19 @@
1
+ import { Size } from "./Card";
2
+ type ImageSize = "sub" | "full";
3
+ export declare function TrumpCard({ titles, options, }: {
4
+ titles: {
5
+ title: string;
6
+ subTitle?: string[];
7
+ color?: string;
8
+ };
9
+ options?: {
10
+ width?: Size;
11
+ image?: {
12
+ path: string;
13
+ size?: ImageSize;
14
+ };
15
+ onClick?: () => unknown | (() => Promise<unknown>);
16
+ subButton?: [string, string, () => unknown | (() => Promise<unknown>)];
17
+ };
18
+ }): import("react/jsx-runtime").JSX.Element;
19
+ export {};
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { LineBreaks } from "../text";
3
+ import { Card } from "./Card";
4
+ export function TrumpCard({ titles, options, }) {
5
+ const { title, subTitle, color: titleColor } = titles;
6
+ const { onClick, width, image, subButton } = options ?? {};
7
+ const [buttonText, buttonBgColor, buttonAction] = subButton ?? [
8
+ null,
9
+ "red-crimson",
10
+ () => { },
11
+ ];
12
+ const { path, size } = image ?? { size: "sub" };
13
+ const imageClassNames = () => {
14
+ if (size === "full")
15
+ return "w-full h-full object-cover";
16
+ return "absolute bottom-0 right-0 w-full xs:w-auto max-w-120 z-0 max-h-44 object-contain";
17
+ };
18
+ return (_jsxs(Card, { options: { width: width, onClick: onClick }, children: [_jsxs("div", { className: `absolute top-8 left-8 w-48 flex flex-col gap-2 z-10 text-${titleColor}`, children: [_jsx("div", { className: "text-xl font-bold", children: title }), _jsx(LineBreaks, { gap: 0, texts: subTitle ?? [""] }), subButton ? (_jsx("button", { className: `text-white rounded-md bg-${buttonBgColor} w-45 h-11 flex justify-center items-center`, onClick: buttonAction, children: buttonText })) : null] }), path ? (_jsx("img", { src: path, alt: "trump-image", loading: "lazy", className: imageClassNames() })) : null] }));
19
+ }
package/card/index.d.ts CHANGED
@@ -1 +1,4 @@
1
1
  export * from "./ProfileCard";
2
+ export * from "./TrumpCard";
3
+ export * from "./ChartCard";
4
+ export * from "./TableCard";
package/card/index.js CHANGED
@@ -1 +1,4 @@
1
1
  export * from "./ProfileCard";
2
+ export * from "./TrumpCard";
3
+ export * from "./ChartCard";
4
+ export * from "./TableCard";
package/deck/Deck.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ export declare function Deck<T extends string | number>({ children, titles, options, }: {
3
+ children: React.ReactNode;
4
+ titles?: {
5
+ title: string;
6
+ subTitle?: string;
7
+ gapTitle?: number;
8
+ };
9
+ options?: {
10
+ width?: T;
11
+ height?: number;
12
+ gapX?: number;
13
+ gapY?: number;
14
+ };
15
+ }): import("react/jsx-runtime").JSX.Element;
package/deck/Deck.js ADDED
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export function Deck({ children, titles, options, }) {
3
+ const { title, subTitle, gapTitle } = titles ?? {};
4
+ const { height, gapX, gapY } = options ?? {};
5
+ const containerClassNames = [
6
+ `flex flex-col h-${height ?? "auto"} gap-${gapTitle ?? 4} `,
7
+ ].join(" ");
8
+ const bodyClassNames = [
9
+ `flex flex-col sm:flex-row `,
10
+ `gap-x-${gapX ?? 5} gap-y-${gapY ?? 5}`,
11
+ "duration-500",
12
+ ].join(" ");
13
+ return (_jsxs("div", { className: containerClassNames, children: [_jsxs("div", { className: "pl-1", children: [_jsx("div", { className: "text-xl xl:text-2xl font-bold", children: title }), _jsx("div", { className: "", children: subTitle })] }), _jsx("div", { className: bodyClassNames, children: children })] }));
14
+ }
package/deck/index.d.ts CHANGED
@@ -1,18 +1 @@
1
- /// <reference types="react" />
2
- import "../globals.css";
3
- export declare function Deck<T extends string | number>({ children, titles, options, }: {
4
- children: React.ReactNode;
5
- titles?: {
6
- title: string;
7
- subTitle?: string;
8
- gapTitle?: number;
9
- };
10
- options?: {
11
- direction?: "row" | "col" | "wrap";
12
- justify?: "start" | "end" | "center" | "between" | "around" | "evenly";
13
- width?: T;
14
- height?: number;
15
- gapX?: number;
16
- gapY?: number;
17
- };
18
- }): import("react/jsx-runtime").JSX.Element;
1
+ export * from "./Deck";
package/deck/index.js CHANGED
@@ -1,16 +1 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import "../globals.css";
3
- export function Deck({ children, titles, options, }) {
4
- const { title, subTitle, gapTitle } = titles ?? {};
5
- const { direction, height, width, gapX, gapY, justify } = options ?? {};
6
- const classNames = [
7
- "flex flex-col",
8
- `h-${height ?? "auto"} w-${width ?? "full"} gap-${gapTitle ?? 4} `,
9
- ].join(" ");
10
- const bodyClassNames = [
11
- `flex-${direction ?? "row"} justify-${justify ?? "start"}`,
12
- `gap-x-${gapX ?? 5} gap-y-${gapY ?? 5}`,
13
- "flex w-full duration-500",
14
- ].join(" ");
15
- return (_jsxs("div", { className: classNames, children: [_jsxs("div", { className: "pl-1", children: [_jsx("div", { className: "text-2xl font-bold", children: title }), _jsx("div", { className: "", children: subTitle })] }), _jsx("div", { className: bodyClassNames, children: children })] }));
16
- }
1
+ export * from "./Deck";
package/index.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ import "./globals.css";
2
+ export * from "./board";
3
+ export * from "./card";
4
+ export * from "./deck";
5
+ export * from "./layout";
6
+ export * from "./modal";
7
+ export * from "./navigation";
8
+ export * from "./shelf";
9
+ export * from "./text";
package/index.js ADDED
@@ -0,0 +1,9 @@
1
+ import "./globals.css";
2
+ export * from "./board";
3
+ export * from "./card";
4
+ export * from "./deck";
5
+ export * from "./layout";
6
+ export * from "./modal";
7
+ export * from "./navigation";
8
+ export * from "./shelf";
9
+ export * from "./text";
@@ -1,15 +1,19 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import "../../globals.css";
3
3
  import { useState } from "react";
4
- import { circle } from "../../util";
4
+ import { cn } from "../../util";
5
5
  export function Header({ title, image, }) {
6
6
  const [isOpen, setIsOpen] = useState(false);
7
7
  const [src, href] = image ?? [];
8
- return (_jsxs("div", { className: "relative flex h-20 w-full items-center justify-between bg-white px-19 shadow-black/10 shadow-b-md", children: [_jsxs("div", { className: "flex h-12 items-center gap-9", children: [src && href ? (_jsx("a", { href: href, children: _jsx("img", { src: src, alt: "logo", className: "h-12" }) })) : (_jsx("div", { children: "TOSEL Lab" })), _jsx("div", { className: "text-3xl font-bold", children: title })] }), _jsxs("div", { className: "relative", children: [_jsx("button", { onClick: () => setIsOpen(!isOpen), className: circle(9) + "border-2", children: "+" }), isOpen ? _jsx(Menu, {}) : null] })] }));
8
+ return (_jsx("div", { className: "fixed top-0 left-0 xl:relative flex h-20 w-full items-center justify-between bg-white px-9 shadow-black/10 shadow-b-md z-40", children: _jsxs("div", { className: "flex h-12 items-center gap-12", children: [src && href ? (_jsx("a", { href: href, children: _jsx("img", { src: src, alt: "logo", className: "h-12 w-50" }) })) : (_jsx("div", { className: "text-2xl", children: "TOSEL" })), _jsx("div", { className: "text-3xl font-bold ", children: title })] }) }));
9
9
  }
10
- function Menu() {
11
- const classNames = [
12
- "absolute -left-24 z-40 h-80 w-48 border-2 bg-white ",
13
- ].join(" ");
14
- return (_jsxs("div", { className: classNames + " fade-in-100 animate-in", children: [_jsx("div", { children: "\u314E\u3147" }), _jsx("div", { children: "\u314E\u3147" })] }));
10
+ function Menu({ flag }) {
11
+ const positions = "absolute right-0 z-40 ";
12
+ const layouts = "w-48 overflow-hidden";
13
+ const styles = "shadow-md bg-white";
14
+ const animations = () => {
15
+ const height = flag ? "h-80" : "h-0";
16
+ return [height, "duration-500"].join(" ");
17
+ };
18
+ return (_jsxs("div", { className: cn(positions, layouts, styles, animations()), children: [_jsx("div", { children: "\u314E\u3147" }), _jsx("div", { children: "\u314E\u3147" })] }));
15
19
  }
@@ -1,5 +1,7 @@
1
1
  /// <reference types="react" />
2
- export declare function DashboardLayout({ navigations, children, }: {
2
+ export declare function DashboardLayout({ subject, colors, navigations, children, }: {
3
+ subject: [string, string, string];
4
+ colors?: [string, string];
3
5
  navigations: React.ReactNode[];
4
6
  children: React.ReactNode;
5
7
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Fragment } from "react";
3
3
  import { NavigationContainer } from "../../navigation";
4
- import { gradient } from "../../util";
5
4
  import { Header } from "./Header";
6
- export function DashboardLayout({ navigations, children, }) {
7
- return (_jsxs("div", { className: gradient.lab + "min-h-screen font-pretendard-medium", children: [_jsx(Header, { title: "dashboard", image: ["/images/tosel-blue-lab-spiral.png", "https://lab.tosel.co.kr"] }), _jsxs("div", { className: "flex gap-12 px-9 pt-16", children: [_jsx(NavigationContainer, { children: navigations.map((nav, index) => (_jsx(Fragment, { children: nav }, index))) }), children] })] }));
5
+ import { cn } from "../../util";
6
+ export function DashboardLayout({ subject, colors, navigations, children, }) {
7
+ const [title, image, imageUrl] = subject ?? ["", "", ""];
8
+ const [bgColor, textColor] = colors ?? ["white", "black"];
9
+ return (_jsxs("div", { className: cn(`bg-${bgColor}`, `text-${textColor}`, `min-h-screen font-pretendard-medium`), children: [_jsx(Header, { title: title, image: [image, imageUrl] }), _jsxs("div", { className: "flex gap-12 xl:px-9 xl:pt-12 mt-20 xl:m-0", children: [_jsx(NavigationContainer, { children: navigations.map((nav, index) => (_jsx(Fragment, { children: nav }, index))) }), children] })] }));
8
10
  }
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ export declare function NoticeModal({ titles, children, buttons, close, }: {
3
+ titles?: string[];
4
+ children: React.ReactNode;
5
+ buttons?: [string, () => unknown | (() => Promise<unknown>)][];
6
+ close: () => void;
7
+ }): import("react/jsx-runtime").JSX.Element;
8
+ export declare function AlertModal(): import("react/jsx-runtime").JSX.Element;
package/modal/Modal.js ADDED
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { col, absolute } from "../util";
3
+ function Modal({ children }) {
4
+ const classNames = [
5
+ "z-50 flex min-h-screen w-full items-center justify-center bg-black/10 backdrop-blur-sm fixed top-0 left-0",
6
+ ].join(" ");
7
+ const modalClassNames = [
8
+ "h-100 w-2/3 min-w-76 max-w-176 rounded-xl bg-white relative",
9
+ ].join(" ");
10
+ return (_jsx("div", { className: classNames, children: _jsx("div", { className: modalClassNames, children: children }) }));
11
+ }
12
+ export function NoticeModal({ titles, children, buttons, close, }) {
13
+ const [title, subTitle] = titles || ["", ""];
14
+ const buttonClassNames = [
15
+ "rounded-2xl bg-black px-8 py-2 text-lg font-bold text-white",
16
+ ].join(" ");
17
+ return (_jsxs(Modal, { children: [_jsxs("div", { className: col(3) + "px-25 pt-18 h-full pb-12", children: [_jsxs("div", { className: col(6), children: [_jsx("div", { className: "text-3xl font-bold", children: title }), _jsx("div", { className: "h-2 w-14 rounded-full bg-pale-lavender" }), _jsx("div", { className: "text-xl font-bold", children: subTitle })] }), _jsx("div", { children: children }), buttons ? (_jsx("div", { className: "mt-auto flex justify-end gap-4", children: buttons.map(([text, onClick]) => (_jsx("button", { className: buttonClassNames, onClick: onClick, children: text }, text))) })) : null] }), _jsx("button", { className: absolute.tl(5, 7) + "bg-black rounded-full h-9 w-9", onClick: close })] }));
18
+ }
19
+ export function AlertModal() {
20
+ return (_jsx("div", { children: _jsx("div", {}) }));
21
+ }
package/modal/index.d.ts CHANGED
@@ -1,9 +1 @@
1
- /// <reference types="react" />
2
- import "../globals.css";
3
- export declare function NoticeModal({ titles, children, buttons, close, }: {
4
- titles?: string[];
5
- children: React.ReactNode;
6
- buttons?: [string, () => unknown | (() => Promise<unknown>)][];
7
- close?: () => void;
8
- }): import("react/jsx-runtime").JSX.Element;
9
- export declare function AlertModal(): import("react/jsx-runtime").JSX.Element;
1
+ export * from "./Modal";
package/modal/index.js CHANGED
@@ -1,23 +1 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import "../globals.css";
3
- import { col, absolute } from "../util";
4
- function Modal({ children }) {
5
- const classNames = [
6
- absolute.tl() +
7
- "z-50 flex min-h-screen w-full items-center justify-center bg-black/10 backdrop-blur-sm",
8
- ].join(" ");
9
- const modalClassNames = [
10
- "h-100 w-2/3 min-w-76 max-w-176 rounded-xl bg-white relative",
11
- ].join(" ");
12
- return (_jsx("div", { className: classNames, children: _jsx("div", { className: modalClassNames, children: children }) }));
13
- }
14
- export function NoticeModal({ titles, children, buttons, close, }) {
15
- const [title, subTitle] = titles || ["", ""];
16
- const buttonClassNames = [
17
- "rounded-2xl bg-black px-8 py-2 text-lg font-bold text-white",
18
- ].join(" ");
19
- return (_jsxs(Modal, { children: [_jsxs("div", { className: col(3) + "px-25 pt-18 h-full pb-12", children: [_jsxs("div", { className: col(6), children: [_jsx("div", { className: "text-3xl font-bold", children: title }), _jsx("div", { className: "h-2 w-14 rounded-full bg-pale-lavender" }), _jsx("div", { className: "text-xl font-bold", children: subTitle })] }), _jsx("div", { children: children }), buttons ? (_jsx("div", { className: "mt-auto flex justify-end gap-4", children: buttons.map(([text, onClick]) => (_jsx("button", { className: buttonClassNames, onClick: onClick, children: text }, text))) })) : null] }), _jsx("button", { className: absolute.tl(5, 7) + "bg-black rounded-full h-9 w-9", onClick: close })] }));
20
- }
21
- export function AlertModal() {
22
- return (_jsx("div", { children: _jsx("div", {}) }));
23
- }
1
+ export * from "./Modal";
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export declare const buttonClassNames: (href: string, nowPath: string, color?: [string, string]) => string;
3
+ export declare function NavigationContainer({ children, }: {
4
+ children: React.ReactNode;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { center, cn } from "../util";
3
+ export const buttonClassNames = (href, nowPath, color) => {
4
+ const [text, bg] = color ?? ["black", "white"];
5
+ const classNames = [
6
+ center.row(6),
7
+ `text-${text}`,
8
+ "font-bold w-full xl:w-50 h-11 xl:rounded-2xl flex justify-center xl:justify-start xl:pl-5",
9
+ ].join(" ");
10
+ const checkPathMatch = (href, nowPath) => {
11
+ if (href === "")
12
+ return !nowPath.slice(1).includes("/");
13
+ return nowPath.includes(href);
14
+ };
15
+ const toggle = checkPathMatch(href, nowPath)
16
+ ? `bg-${bg}`
17
+ : "bg-gray-500 xl:bg-transparent";
18
+ return [classNames, toggle].join(" ");
19
+ };
20
+ export function NavigationContainer({ children, }) {
21
+ const layouts = "flex flex-row xl:flex-col z-40";
22
+ const positions = "fixed bottom-0 left-0 xl:static";
23
+ const sizes = "w-full xl:w-auto";
24
+ const styles = "";
25
+ return (_jsx("div", { className: cn(layouts, positions, sizes, styles), children: children }));
26
+ }
@@ -1,6 +1 @@
1
- /// <reference types="react" />
2
- import "../globals.css";
3
- export declare const buttonClassNames: (href: string, nowPath: string, color?: [string, string]) => string;
4
- export declare function NavigationContainer({ children, }: {
5
- children: React.ReactNode;
6
- }): import("react/jsx-runtime").JSX.Element;
1
+ export * from "./Navigation";
@@ -1,16 +1 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import "../globals.css";
3
- import { center } from "../util";
4
- export const buttonClassNames = (href, nowPath, color) => {
5
- const [text, bg] = color ?? ["black", "white"];
6
- const classNames = [
7
- center.row(6),
8
- `text-${text}`,
9
- "font-bold w-50 h-11 rounded-2xl pl-5",
10
- ].join(" ");
11
- const toggle = nowPath === href ? `bg-${bg}` : "bg-transparent";
12
- return [classNames, toggle].join(" ");
13
- };
14
- export function NavigationContainer({ children, }) {
15
- return _jsx("div", { className: center.col() + "w-54", children: children });
16
- }
1
+ export * from "./Navigation";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edu-tosel/design",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "UI components for International TOSEL Committee",
5
5
  "keywords": [
6
6
  "jsx",
@@ -15,6 +15,8 @@
15
15
  "react": "^18.2.0",
16
16
  "react-dom": "^18.2.0",
17
17
  "react-router-dom": "^6.21.3",
18
+ "recharts": "^2.11.0",
19
+ "tailwind-scrollbar-hide": "^1.1.7",
18
20
  "tailwindcss-animate": "^1.0.7",
19
21
  "typescript": "^5.2.2"
20
22
  },
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export declare function Shelf({ children }: {
3
+ children: React.ReactNode;
4
+ }): import("react/jsx-runtime").JSX.Element;
package/shelf/Shelf.js ADDED
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export function Shelf({ children }) {
3
+ return (_jsx("div", { className: "inline-flex flex-col gap-12 w-full xl:w-auto", children: children }));
4
+ }
@@ -0,0 +1 @@
1
+ export * from "./Shelf";
package/shelf/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from "./Shelf";
@@ -1,5 +1,5 @@
1
1
  import tailwindcss from "tailwindcss";
2
- // import tailwindScrollbarHide from "tailwind-scrollbar-hide";
2
+ import tailwindScrollbarHide from "tailwind-scrollbar-hide";
3
3
  import tailwindcssAnimate from "tailwindcss-animate";
4
4
  // import twElements from "tw-elements/dist/plugin";
5
5
  // import tailwindcssDirectionalShadows from "tailwindcss-directional-shadows";
@@ -92,6 +92,8 @@ export default {
92
92
  "55/100": "55%",
93
93
  "65/100": "65%",
94
94
  "85/100": "85%",
95
+ 90: "22.5rem",
96
+ 120: "30rem",
95
97
  176: "44rem",
96
98
  478: "478px",
97
99
  },
@@ -106,6 +108,10 @@ export default {
106
108
  "7/10": "70%",
107
109
  "9/10": "90%",
108
110
  },
111
+ maxHeight: {
112
+ 44: "11rem",
113
+ "9/10": "90%",
114
+ },
109
115
  spacing: {
110
116
  "sun-calc": "calc(50% - 6rem)",
111
117
  1: "0.25rem",
@@ -124,9 +130,13 @@ export default {
124
130
  38: "9.5rem",
125
131
  40: "10rem",
126
132
  42: "10.5rem",
133
+ 44: "11rem",
134
+ 45: "11.25rem",
135
+ 48: "12rem",
127
136
  49: "12.25rem",
128
137
  50: "12.5rem",
129
138
  52: "13rem",
139
+ 54: "13.5rem",
130
140
  56: "14rem",
131
141
  62: "15.5rem",
132
142
  64: "16rem",
@@ -158,6 +168,7 @@ export default {
158
168
  126: "31.5rem",
159
169
  128: "32rem",
160
170
  132: "33rem",
171
+ 135: "33.75rem",
161
172
  136: "34rem",
162
173
  140: "35rem",
163
174
  144: "36rem",
@@ -170,9 +181,12 @@ export default {
170
181
  180: "45rem",
171
182
  182: "45.5rem",
172
183
  186: "46.5rem",
184
+ 190: "47.5rem",
173
185
  200: "50rem",
174
186
  216: "54rem",
175
187
  220: "55rem",
188
+ 224: "56rem",
189
+ 225: "56.25rem",
176
190
  228: "57rem",
177
191
  232: "58rem",
178
192
  240: "60rem",
@@ -180,6 +194,7 @@ export default {
180
194
  255: "63.75rem",
181
195
  256: "64rem",
182
196
  260: "65rem",
197
+ 264: "66rem",
183
198
  272: "68rem",
184
199
  280: "70rem",
185
200
  288: "72rem",
@@ -188,6 +203,7 @@ export default {
188
203
  320: "80rem",
189
204
  360: "90rem",
190
205
  386: "96.5rem",
206
+ 408: "102rem",
191
207
  480: "120rem",
192
208
  500: "125rem",
193
209
  520: "140rem",
@@ -221,10 +237,12 @@ export default {
221
237
  2500: "2500ms",
222
238
  2700: "2700ms",
223
239
  3000: "3000ms",
240
+ 3300: "3300ms",
224
241
  4000: "4000ms",
225
242
  5000: "5000ms",
226
243
  },
227
244
  transitionDuration: {
245
+ 300: "300ms",
228
246
  2000: "2000ms",
229
247
  60000: "60000ms",
230
248
  300000: "300000ms",
@@ -265,6 +283,16 @@ export default {
265
283
  },
266
284
  },
267
285
  safelist: [
286
+ {
287
+ pattern: /animate-.*/,
288
+ },
289
+ {
290
+ pattern: /shadow-.*/,
291
+ },
292
+
293
+ {
294
+ pattern: /flex-.*/,
295
+ },
268
296
  {
269
297
  pattern: /overflow-*./,
270
298
  },
@@ -295,6 +323,9 @@ export default {
295
323
  {
296
324
  pattern: /min-.*/,
297
325
  },
326
+ {
327
+ pattern: /max-.*/,
328
+ },
298
329
  { pattern: /w-.*/ },
299
330
  { pattern: /h-.*/ },
300
331
  {
@@ -317,6 +348,30 @@ export default {
317
348
  {
318
349
  pattern: /p-.*/,
319
350
  },
351
+ {
352
+ pattern: /px-.*/,
353
+ },
354
+ {
355
+ pattern: /pl-.*/,
356
+ },
357
+ {
358
+ pattern: /py-.*/,
359
+ },
360
+ {
361
+ pattern: /pb-.*/,
362
+ },
363
+ {
364
+ pattern: /m-.*/,
365
+ },
366
+ {
367
+ pattern: /mx-.*/,
368
+ },
369
+ {
370
+ pattern: /my-.*/,
371
+ },
372
+ {
373
+ pattern: /z-.*/,
374
+ },
320
375
  {
321
376
  pattern: /from-.*/,
322
377
  },
@@ -330,5 +385,5 @@ export default {
330
385
  pattern: /delay-.*/,
331
386
  },
332
387
  ],
333
- plugins: [tailwindcss(), tailwindcssAnimate],
388
+ plugins: [tailwindcss(), tailwindcssAnimate, tailwindScrollbarHide],
334
389
  };
@@ -0,0 +1,4 @@
1
+ export declare function LineBreaks({ texts, gap }: {
2
+ texts: string[];
3
+ gap?: number;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { col } from "../util";
3
+ export function LineBreaks({ texts, gap }) {
4
+ return (_jsx("div", { className: col(gap), children: texts.map((text, index) => (_jsx("div", { className: "leading-tight", children: text }, index))) }));
5
+ }
package/text/index.d.ts CHANGED
@@ -1,5 +1 @@
1
- import "../globals.css";
2
- export declare function LineBreaks({ texts, gap }: {
3
- texts: string[];
4
- gap?: number;
5
- }): import("react/jsx-runtime").JSX.Element;
1
+ export * from "./LineBreaks";
package/text/index.js CHANGED
@@ -1,6 +1 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import "../globals.css";
3
- import { col } from "../util";
4
- export function LineBreaks({ texts, gap }) {
5
- return (_jsx("div", { className: col(gap), children: texts.map((text, index) => (_jsx("div", { children: text }, index))) }));
6
- }
1
+ export * from "./LineBreaks";
package/util/colors.js CHANGED
@@ -6,5 +6,5 @@ export const colorsByLevel = {
6
6
  HJ: "hj-blue",
7
7
  };
8
8
  export const gradient = {
9
- lab: "bg-gradient-to-br from-violet-light/20 to-blue-sky/40 ",
9
+ lab: "gradient-to-br from-violet-light/20 to-blue-sky/40 ",
10
10
  };
package/version.txt CHANGED
@@ -1 +1 @@
1
- 0.1.5
1
+ 0.1.6
package/header/index.d.ts DELETED
@@ -1 +0,0 @@
1
- import "../globals.css";
package/header/index.js DELETED
@@ -1 +0,0 @@
1
- import "../globals.css";