@edu-tosel/design 0.1.4 → 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 (72) hide show
  1. package/README.md +32 -31
  2. package/board/Board.d.ts +7 -0
  3. package/board/Board.js +9 -0
  4. package/board/CanvasBoard.d.ts +7 -0
  5. package/board/CanvasBoard.js +11 -0
  6. package/board/Header.d.ts +6 -0
  7. package/board/Header.js +12 -0
  8. package/board/ListBoard.d.ts +7 -0
  9. package/board/ListBoard.js +7 -0
  10. package/board/index.d.ts +3 -19
  11. package/board/index.js +3 -47
  12. package/card/Card.d.ts +15 -14
  13. package/card/Card.js +30 -32
  14. package/card/ChartCard.d.ts +20 -0
  15. package/card/ChartCard.js +7 -0
  16. package/card/ProfileCard.d.ts +14 -14
  17. package/card/ProfileCard.js +8 -20
  18. package/card/TableCard.d.ts +12 -0
  19. package/card/TableCard.js +13 -0
  20. package/card/TrumpCard.d.ts +19 -0
  21. package/card/TrumpCard.js +19 -0
  22. package/card/index.d.ts +4 -1
  23. package/card/index.js +4 -1
  24. package/deck/Deck.d.ts +15 -0
  25. package/deck/Deck.js +14 -0
  26. package/deck/index.d.ts +1 -18
  27. package/deck/index.js +1 -28
  28. package/{style.css → globals.css} +40 -41
  29. package/index.d.ts +9 -0
  30. package/index.js +9 -0
  31. package/{header/index.d.ts → layout/dashboard/Header.d.ts} +5 -5
  32. package/layout/dashboard/Header.js +19 -0
  33. package/layout/dashboard/index.d.ts +7 -0
  34. package/layout/dashboard/index.js +10 -0
  35. package/layout/index.d.ts +1 -0
  36. package/layout/index.js +1 -0
  37. package/modal/Modal.d.ts +8 -0
  38. package/modal/Modal.js +21 -0
  39. package/modal/index.d.ts +1 -9
  40. package/modal/index.js +1 -35
  41. package/navigation/Navigation.d.ts +5 -0
  42. package/navigation/Navigation.js +26 -0
  43. package/navigation/index.d.ts +1 -6
  44. package/navigation/index.js +1 -24
  45. package/package.json +6 -30
  46. package/shelf/Shelf.d.ts +4 -0
  47. package/shelf/Shelf.js +4 -0
  48. package/shelf/index.d.ts +1 -0
  49. package/shelf/index.js +1 -0
  50. package/tailwind.config.js +389 -319
  51. package/text/LineBreaks.d.ts +4 -0
  52. package/text/LineBreaks.js +5 -0
  53. package/text/index.d.ts +1 -5
  54. package/text/index.js +1 -18
  55. package/util/classNames.d.ts +1 -1
  56. package/util/classNames.js +4 -8
  57. package/util/colors.d.ts +10 -10
  58. package/util/colors.js +10 -10
  59. package/util/display.d.ts +25 -25
  60. package/util/display.js +25 -55
  61. package/util/displayResponsive.d.ts +3 -3
  62. package/util/displayResponsive.js +15 -15
  63. package/util/index.d.ts +7 -7
  64. package/util/index.js +7 -7
  65. package/util/pattern.d.ts +7 -7
  66. package/util/pattern.js +15 -15
  67. package/util/position.d.ts +14 -14
  68. package/util/position.js +44 -56
  69. package/util/shape.d.ts +1 -1
  70. package/util/shape.js +3 -3
  71. package/version.txt +1 -1
  72. package/header/index.js +0 -25
@@ -1,41 +1,40 @@
1
- @tailwind base;
2
- @tailwind components;
3
- @tailwind utilities;
4
-
5
- @font-face {
6
- font-family: "Pretendard-Medium";
7
- src: url("../public/fonts/Pretendard-Medium.otf") format("opentype");
8
- }
9
-
10
- @font-face{
11
- font-family: "Kostar";
12
- src: url("../public/fonts/Kostar.ttf") format("truetype");
13
- }
14
-
15
- @font-face{
16
- font-family: "NicoMoji";
17
- src: url("../public/fonts/NicoMoji.ttf") format("truetype");
18
- }
19
-
20
- @font-face{
21
- font-family: "Megrim";
22
- src: url("../public/fonts/Megrim.ttf") format("trueType");
23
- }
24
-
25
- ::-webkit-scrollbar {
26
- width: 8px;
27
- }
28
-
29
- ::-webkit-scrollbar-track {
30
- background-color: transparent;
31
- }
32
- ::-webkit-scrollbar-thumb {
33
- background-color: #173a8b;
34
- opacity: 0.5;
35
- border-radius: 10px;
36
- }
37
-
38
-
39
- .box-shadow {
40
- box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.15);
41
- }
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
4
+
5
+ @font-face {
6
+ font-family: "Pretendard-Medium";
7
+ src: url("/fonts/Pretendard-Medium.otf") format("opentype");
8
+ }
9
+
10
+ @font-face {
11
+ font-family: "Kostar";
12
+ src: url("/fonts/Kostar.ttf") format("truetype");
13
+ }
14
+
15
+ @font-face {
16
+ font-family: "NicoMoji";
17
+ src: url("/fonts/NicoMoji.ttf") format("truetype");
18
+ }
19
+
20
+ @font-face {
21
+ font-family: "Megrim";
22
+ src: url("/fonts/Megrim.ttf") format("trueType");
23
+ }
24
+
25
+ ::-webkit-scrollbar {
26
+ width: 8px;
27
+ }
28
+
29
+ ::-webkit-scrollbar-track {
30
+ background-color: transparent;
31
+ }
32
+ ::-webkit-scrollbar-thumb {
33
+ background-color: #173a8b;
34
+ opacity: 0.5;
35
+ border-radius: 10px;
36
+ }
37
+
38
+ .box-shadow {
39
+ box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.15);
40
+ }
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,5 +1,5 @@
1
- import "../style.css";
2
- export declare function DashboardHeader({ title, image }: {
3
- title: string;
4
- image?: [string, string];
5
- }): import("react/jsx-runtime").JSX.Element;
1
+ import "../../globals.css";
2
+ export declare function Header({ title, image, }: {
3
+ title: string;
4
+ image?: [string, string];
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import "../../globals.css";
3
+ import { useState } from "react";
4
+ import { cn } from "../../util";
5
+ export function Header({ title, image, }) {
6
+ const [isOpen, setIsOpen] = useState(false);
7
+ const [src, href] = image ?? [];
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
+ }
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" })] }));
19
+ }
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ export declare function DashboardLayout({ subject, colors, navigations, children, }: {
3
+ subject: [string, string, string];
4
+ colors?: [string, string];
5
+ navigations: React.ReactNode[];
6
+ children: React.ReactNode;
7
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Fragment } from "react";
3
+ import { NavigationContainer } from "../../navigation";
4
+ import { Header } from "./Header";
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] })] }));
10
+ }
@@ -0,0 +1 @@
1
+ export * from "./dashboard";
@@ -0,0 +1 @@
1
+ export * from "./dashboard";
@@ -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 "../style.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,35 +1 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- import "../style.css";
14
- import { col, absolute } from "../util";
15
- function Modal(_a) {
16
- var children = _a.children;
17
- var classNames = [
18
- absolute.tl() +
19
- "z-50 flex min-h-screen w-full items-center justify-center bg-black/10 backdrop-blur-sm",
20
- ].join(" ");
21
- var modalClassNames = ["h-100 w-2/3 min-w-76 max-w-176 rounded-xl bg-white relative"].join(" ");
22
- return (_jsx("div", __assign({ className: classNames }, { children: _jsx("div", __assign({ className: modalClassNames }, { children: children })) })));
23
- }
24
- export function NoticeModal(_a) {
25
- var titles = _a.titles, children = _a.children, buttons = _a.buttons, close = _a.close;
26
- var _b = titles || ["", ""], title = _b[0], subTitle = _b[1];
27
- var buttonClassNames = ["rounded-2xl bg-black px-8 py-2 text-lg font-bold text-white"].join(" ");
28
- return (_jsxs(Modal, { children: [_jsxs("div", __assign({ className: col(3) + "px-25 pt-18 h-full pb-12" }, { children: [_jsxs("div", __assign({ className: col(6) }, { children: [_jsx("div", __assign({ className: "text-3xl font-bold" }, { children: title })), _jsx("div", { className: "h-2 w-14 rounded-full bg-pale-lavender" }), _jsx("div", __assign({ className: "text-xl font-bold" }, { children: subTitle }))] })), _jsx("div", { children: children }), buttons ? (_jsx("div", __assign({ className: "mt-auto flex justify-end gap-4" }, { children: buttons.map(function (_a) {
29
- var text = _a[0], onClick = _a[1];
30
- return (_jsx("button", __assign({ className: buttonClassNames, onClick: onClick }, { children: text }), text));
31
- }) }))) : null] })), _jsx("button", { className: absolute.tl(5, 7) + "bg-black rounded-full h-9 w-9", onClick: close })] }));
32
- }
33
- export function AlertModal() {
34
- return (_jsx("div", { children: _jsx("div", {}) }));
35
- }
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 "../style.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,24 +1 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- import "../style.css";
14
- import { center } from "../util";
15
- export var buttonClassNames = function (href, nowPath, color) {
16
- var _a = color !== null && color !== void 0 ? color : ["black", "white"], text = _a[0], bg = _a[1];
17
- var classNames = [center.row(6), "text-".concat(text), "font-bold w-50 h-11 rounded-2xl pl-5"].join(" ");
18
- var toggle = nowPath === href ? "bg-".concat(bg) : "bg-transparent";
19
- return [classNames, toggle].join(" ");
20
- };
21
- export function NavigationContainer(_a) {
22
- var children = _a.children;
23
- return _jsx("div", __assign({ className: center.col() + "w-54" }, { children: children }));
24
- }
1
+ export * from "./Navigation";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edu-tosel/design",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "UI components for International TOSEL Committee",
5
5
  "keywords": [
6
6
  "jsx",
@@ -9,40 +9,16 @@
9
9
  ],
10
10
  "author": "International TOSEL Committee",
11
11
  "license": "MIT",
12
+ "type": "module",
13
+ "scripts": {},
12
14
  "dependencies": {
13
- "@testing-library/jest-dom": "^5.17.0",
14
- "@testing-library/react": "^14.1.2",
15
- "@testing-library/user-event": "^13.5.0",
16
15
  "react": "^18.2.0",
17
16
  "react-dom": "^18.2.0",
18
- "react-router-dom": "^6.21.1",
19
- "react-scripts": "5.0.1",
17
+ "react-router-dom": "^6.21.3",
18
+ "recharts": "^2.11.0",
20
19
  "tailwind-scrollbar-hide": "^1.1.7",
21
- "tailwindcss": "^3.4.0",
22
20
  "tailwindcss-animate": "^1.0.7",
23
- "tailwindcss-directional-shadows": "^0.0.6",
24
- "tw-elements": "^1.1.0",
25
- "typescript": "^4.9.5",
26
- "web-vitals": "^2.1.4"
27
- },
28
- "scripts": {},
29
- "eslintConfig": {
30
- "extends": [
31
- "react-app",
32
- "react-app/jest"
33
- ]
34
- },
35
- "browserslist": {
36
- "production": [
37
- ">0.2%",
38
- "not dead",
39
- "not op_mini all"
40
- ],
41
- "development": [
42
- "last 1 chrome version",
43
- "last 1 firefox version",
44
- "last 1 safari version"
45
- ]
21
+ "typescript": "^5.2.2"
46
22
  },
47
23
  "devDependencies": {}
48
24
  }
@@ -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";