@edu-tosel/design 0.1.0
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/README.md +32 -0
- package/asset/colors.d.ts +7 -0
- package/asset/colors.js +7 -0
- package/asset/display.d.ts +20 -0
- package/asset/display.js +44 -0
- package/asset/displayResponsive.d.ts +3 -0
- package/asset/displayResponsive.js +15 -0
- package/asset/position.d.ts +10 -0
- package/asset/position.js +28 -0
- package/asset/shape.d.ts +1 -0
- package/asset/shape.js +3 -0
- package/board/index.d.ts +19 -0
- package/board/index.js +45 -0
- package/card/index.d.ts +29 -0
- package/card/index.js +40 -0
- package/deck/index.d.ts +18 -0
- package/deck/index.js +28 -0
- package/header/index.d.ts +4 -0
- package/header/index.js +26 -0
- package/modal/index.d.ts +9 -0
- package/modal/index.js +36 -0
- package/navigation/index.d.ts +1 -0
- package/navigation/index.js +4 -0
- package/package.json +48 -0
- package/style.css +7 -0
- package/tailwind.config.js +166 -0
- package/text/index.d.ts +5 -0
- package/text/index.js +18 -0
- package/version.txt +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# TOSEL UI Library
|
|
2
|
+
TOSEL 통합 디자인 시스템에 맞춘 UI 라이브러리
|
|
3
|
+
|
|
4
|
+
## Tech Stack
|
|
5
|
+
- tailwindcss 3.4.0
|
|
6
|
+
- React 18
|
|
7
|
+
|
|
8
|
+
## Getting Start
|
|
9
|
+
```bash
|
|
10
|
+
# 설치
|
|
11
|
+
npm install @edu-tosel/ui@latest
|
|
12
|
+
|
|
13
|
+
# 개발환경
|
|
14
|
+
npm install # 의존성 설치
|
|
15
|
+
npm start # React 환경에서 실행
|
|
16
|
+
npm run test # jest 실행
|
|
17
|
+
npm run build # 빌드
|
|
18
|
+
npm run publish # npm 배포
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Folder Structure
|
|
22
|
+
### asset
|
|
23
|
+
tailwindcss를 조합한 커스텀 클래스 보관
|
|
24
|
+
|
|
25
|
+
### board
|
|
26
|
+
### card
|
|
27
|
+
### deck
|
|
28
|
+
### header
|
|
29
|
+
### modal
|
|
30
|
+
### navigation
|
|
31
|
+
### text
|
|
32
|
+
문자열 조작 컴포넌트 보관
|
package/asset/colors.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const row: (gap?: number) => string;
|
|
2
|
+
export declare const col: (gap?: number, width?: number | string) => string;
|
|
3
|
+
export declare const between: {
|
|
4
|
+
row: string;
|
|
5
|
+
col: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const center: {
|
|
8
|
+
col: (gap?: number) => string;
|
|
9
|
+
row: (gap?: number) => string;
|
|
10
|
+
colO: (gap?: number) => string;
|
|
11
|
+
rowO: (gap?: number) => string;
|
|
12
|
+
};
|
|
13
|
+
export declare const grid: {
|
|
14
|
+
col: (col: number, gap?: number) => string;
|
|
15
|
+
row: (row: number, gap?: number) => string;
|
|
16
|
+
};
|
|
17
|
+
export declare const box: {
|
|
18
|
+
row: (height: number, gap?: number) => string;
|
|
19
|
+
col: (width: number, gap?: number) => string;
|
|
20
|
+
};
|
package/asset/display.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export var row = function (gap) {
|
|
2
|
+
if (gap === void 0) { gap = 8; }
|
|
3
|
+
return "flex flex-row gap-".concat(gap, " ");
|
|
4
|
+
};
|
|
5
|
+
export var col = function (gap, width) {
|
|
6
|
+
if (gap === void 0) { gap = 8; }
|
|
7
|
+
return "flex flex-col gap-".concat(gap, " ").concat(width ? "w-".concat(width) : "w-full", " ");
|
|
8
|
+
};
|
|
9
|
+
export var between = {
|
|
10
|
+
row: "flex flex-row justify-between items-center ",
|
|
11
|
+
col: "flex flex-col justify-between items-center ",
|
|
12
|
+
};
|
|
13
|
+
export var center = {
|
|
14
|
+
col: function (gap) {
|
|
15
|
+
if (gap === void 0) { gap = 0; }
|
|
16
|
+
return "gap-".concat(gap, " flex flex-col items-center ");
|
|
17
|
+
},
|
|
18
|
+
row: function (gap) {
|
|
19
|
+
if (gap === void 0) { gap = 0; }
|
|
20
|
+
return "gap-".concat(gap, " flex flex-row items-center ");
|
|
21
|
+
},
|
|
22
|
+
colO: function (gap) {
|
|
23
|
+
if (gap === void 0) { gap = 0; }
|
|
24
|
+
return "gap-".concat(gap, " flex flex-col justify-center items-center ");
|
|
25
|
+
},
|
|
26
|
+
rowO: function (gap) {
|
|
27
|
+
if (gap === void 0) { gap = 0; }
|
|
28
|
+
return "gap-".concat(gap, " flex flex-row justify-center items-center ");
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
export var grid = {
|
|
32
|
+
col: function (col, gap) {
|
|
33
|
+
if (gap === void 0) { gap = 12; }
|
|
34
|
+
return "grid grid-cols-".concat(col, " gap-").concat(gap, " ");
|
|
35
|
+
},
|
|
36
|
+
row: function (row, gap) {
|
|
37
|
+
if (gap === void 0) { gap = 12; }
|
|
38
|
+
return "grid grid-rows-".concat(row, " gap-").concat(gap);
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
export var box = {
|
|
42
|
+
row: function (height, gap) { return "h-".concat(height, " gap-").concat(gap, " flex flex-row "); },
|
|
43
|
+
col: function (width, gap) { return "w-".concat(width, " gap-").concat(gap, " flex flex-col "); },
|
|
44
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export var responsiveColToRow = function () {
|
|
2
|
+
var df = "flex flex-col";
|
|
3
|
+
var mark = "md:flex-row";
|
|
4
|
+
return [df, mark].join(" ");
|
|
5
|
+
};
|
|
6
|
+
export var responsiveRowToCol = function () {
|
|
7
|
+
var df = "flex flex-row";
|
|
8
|
+
var md = "md:flex-col";
|
|
9
|
+
return [df, md].join(" ");
|
|
10
|
+
};
|
|
11
|
+
export var responsiveGridToCol = function (gridCell) {
|
|
12
|
+
var df = "grid grid-cols-".concat(gridCell);
|
|
13
|
+
var md = "md:flex md:flex-col";
|
|
14
|
+
return [df, md].join(" ");
|
|
15
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const fixed: {
|
|
2
|
+
tl: (top: number | string, left: number | string) => string;
|
|
3
|
+
br: (bottom: number | string, right: number | string) => string;
|
|
4
|
+
};
|
|
5
|
+
export declare const absolute: {
|
|
6
|
+
tl: (top?: number, left?: number) => string;
|
|
7
|
+
tr: (top?: number, right?: number) => string;
|
|
8
|
+
br: (bottom?: number, right?: number) => string;
|
|
9
|
+
bl: (bottom?: number, left?: number) => string;
|
|
10
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export var fixed = {
|
|
2
|
+
tl: function (top, left) { return "fixed top-".concat(top, " left-").concat(left, " z-50 "); },
|
|
3
|
+
br: function (bottom, right) {
|
|
4
|
+
return "fixed bottom-".concat(bottom, " right-").concat(right, " z-50 ");
|
|
5
|
+
},
|
|
6
|
+
};
|
|
7
|
+
export var absolute = {
|
|
8
|
+
tl: function (top, left) {
|
|
9
|
+
if (top === void 0) { top = 0; }
|
|
10
|
+
if (left === void 0) { left = 0; }
|
|
11
|
+
return "absolute top-".concat(top, " left-").concat(left, " ");
|
|
12
|
+
},
|
|
13
|
+
tr: function (top, right) {
|
|
14
|
+
if (top === void 0) { top = 0; }
|
|
15
|
+
if (right === void 0) { right = 0; }
|
|
16
|
+
return "absolute top-".concat(top, " right-").concat(right, " ");
|
|
17
|
+
},
|
|
18
|
+
br: function (bottom, right) {
|
|
19
|
+
if (bottom === void 0) { bottom = 0; }
|
|
20
|
+
if (right === void 0) { right = 0; }
|
|
21
|
+
return "absolute bottom-".concat(bottom, " right-").concat(right, " ");
|
|
22
|
+
},
|
|
23
|
+
bl: function (bottom, left) {
|
|
24
|
+
if (bottom === void 0) { bottom = 0; }
|
|
25
|
+
if (left === void 0) { left = 0; }
|
|
26
|
+
return "absolute bottom-".concat(bottom, " left-").concat(left, " ");
|
|
27
|
+
},
|
|
28
|
+
};
|
package/asset/shape.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const circle: (radius: number) => string;
|
package/asset/shape.js
ADDED
package/board/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "../style.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
|
+
bgColor?: string;
|
|
14
|
+
childrens?: React.ReactNode[];
|
|
15
|
+
};
|
|
16
|
+
options?: {
|
|
17
|
+
height?: number;
|
|
18
|
+
};
|
|
19
|
+
}): import("react/jsx-runtime").JSX.Element;
|
package/board/index.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
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 { center, between } from "../asset/display";
|
|
15
|
+
function Header(_a) {
|
|
16
|
+
var title = _a.title, bgColor = _a.bgColor, childrens = _a.childrens;
|
|
17
|
+
var headerClassNames = [
|
|
18
|
+
center.row + between.row,
|
|
19
|
+
"bg-".concat(bgColor || "off-white"),
|
|
20
|
+
"w-full h-22 px-12",
|
|
21
|
+
].join(" ");
|
|
22
|
+
return (_jsxs("div", __assign({ className: headerClassNames }, { children: [_jsx("div", __assign({ className: "text-xl font-bold" }, { children: title })), _jsx("div", __assign({ className: "flex" }, { children: childrens === null || childrens === void 0 ? void 0 : childrens.map(function (children) { return children; }) }))] })));
|
|
23
|
+
}
|
|
24
|
+
function Board(_a) {
|
|
25
|
+
var children = _a.children, header = _a.header, options = _a.options;
|
|
26
|
+
var height = (options !== null && options !== void 0 ? options : {}).height;
|
|
27
|
+
var classNames = [
|
|
28
|
+
"h-".concat(height !== null && height !== void 0 ? height : 186, " ").concat(header ? "" : "pt-8"),
|
|
29
|
+
"rounded-xl bg-white/80 overflow-hidden relative",
|
|
30
|
+
].join(" ");
|
|
31
|
+
return (_jsxs("div", __assign({ className: classNames }, { children: [header ? _jsx(Header, __assign({}, header)) : null, _jsx("div", __assign({ className: "h-full" }, { children: children }))] })));
|
|
32
|
+
}
|
|
33
|
+
export function CanvasBoard(_a) {
|
|
34
|
+
var children = _a.children, options = _a.options;
|
|
35
|
+
var height = (options !== null && options !== void 0 ? options : {}).height;
|
|
36
|
+
var classNames = ["px-12"].join(" ");
|
|
37
|
+
return (_jsx(Board, __assign({ options: { height: height } }, { children: _jsx("div", __assign({ className: classNames }, { children: children })) })));
|
|
38
|
+
}
|
|
39
|
+
export function ListBoard(_a) {
|
|
40
|
+
var children = _a.children, header = _a.header, options = _a.options;
|
|
41
|
+
var title = header.title, bgColor = header.bgColor, childrens = header.childrens;
|
|
42
|
+
var height = (options !== null && options !== void 0 ? options : {}).height;
|
|
43
|
+
var classNames = ["pt-8 px-12 overflow-y-scroll h-full pb-32"].join(" ");
|
|
44
|
+
return (_jsx(Board, __assign({ header: { title: title, bgColor: bgColor, childrens: childrens }, options: { height: height } }, { children: _jsx("div", __assign({ className: classNames }, { children: children })) })));
|
|
45
|
+
}
|
package/card/index.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "../style.css";
|
|
3
|
+
type Level = "PS" | "ST" | "BA" | "JR" | "HJ";
|
|
4
|
+
export declare function Card<T extends string | number>({ children, header, options, }: {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
header?: {
|
|
7
|
+
title: string;
|
|
8
|
+
bgColor?: string;
|
|
9
|
+
childrens?: React.ReactNode[];
|
|
10
|
+
};
|
|
11
|
+
options?: {
|
|
12
|
+
height?: number;
|
|
13
|
+
width?: T;
|
|
14
|
+
};
|
|
15
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function ProfileCard<T extends string | number>({ studentInfo, gradeData, }: {
|
|
17
|
+
studentInfo: {
|
|
18
|
+
name: string;
|
|
19
|
+
age: T;
|
|
20
|
+
birthday: string;
|
|
21
|
+
image?: [string, string];
|
|
22
|
+
};
|
|
23
|
+
gradeData: {
|
|
24
|
+
level?: Level;
|
|
25
|
+
score?: number;
|
|
26
|
+
grade?: number;
|
|
27
|
+
};
|
|
28
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export {};
|
package/card/index.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
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 { center, between } from "../asset/display";
|
|
15
|
+
import { colorsByLevel } from "../asset/colors";
|
|
16
|
+
function Header(_a) {
|
|
17
|
+
var title = _a.title, bgColor = _a.bgColor, childrens = _a.childrens;
|
|
18
|
+
var headerClassNames = [
|
|
19
|
+
center.row + between.row,
|
|
20
|
+
"".concat(bgColor || "bg-off-white"),
|
|
21
|
+
"w-full h-12 px-12",
|
|
22
|
+
].join(" ");
|
|
23
|
+
return (_jsxs("div", __assign({ className: headerClassNames }, { children: [_jsx("div", __assign({ className: "text-xl font-bold" }, { children: title })), _jsx("div", __assign({ className: "flex" }, { children: childrens === null || childrens === void 0 ? void 0 : childrens.map(function (children) { return children; }) }))] })));
|
|
24
|
+
}
|
|
25
|
+
export function Card(_a) {
|
|
26
|
+
var children = _a.children, header = _a.header, options = _a.options;
|
|
27
|
+
var _b = options !== null && options !== void 0 ? options : {}, height = _b.height, width = _b.width;
|
|
28
|
+
var classNames = [
|
|
29
|
+
"h-".concat(height !== null && height !== void 0 ? height : 48, " w-").concat(width !== null && width !== void 0 ? width : "full", " p-4 max-w-232 "),
|
|
30
|
+
"rounded-xl bg-white/80 overflow-hidden relative box-shadow duration-500",
|
|
31
|
+
].join(" ");
|
|
32
|
+
return (_jsxs("div", __assign({ className: classNames }, { children: [header ? _jsx(Header, __assign({}, header)) : null, _jsx("div", __assign({ className: "h-full" }, { children: children }))] })));
|
|
33
|
+
}
|
|
34
|
+
export function ProfileCard(_a) {
|
|
35
|
+
var studentInfo = _a.studentInfo, gradeData = _a.gradeData;
|
|
36
|
+
var name = studentInfo.name, age = studentInfo.age, birthday = studentInfo.birthday, image = studentInfo.image;
|
|
37
|
+
var _b = image !== null && image !== void 0 ? image : [], src = _b[0], url = _b[1];
|
|
38
|
+
var level = gradeData.level, score = gradeData.score, grade = gradeData.grade;
|
|
39
|
+
return (_jsx(Card, __assign({ options: { width: 84 } }, { children: _jsxs("div", __assign({ className: "flex" }, { children: [_jsx("div", { className: "h-20 w-20 overflow-hidden rounded-full bg-black" }), _jsxs("div", __assign({ className: "ml-auto flex flex-col gap-4" }, { children: [_jsxs("div", __assign({ className: "flex w-52 items-end gap-2 border-b-2 border-navy-blue pb-2" }, { children: [_jsx("div", __assign({ className: "text-xl font-bold" }, { children: name })), _jsxs("div", { children: [age, "\uC138"] }), _jsx("div", { children: birthday })] })), _jsxs("div", { children: [_jsx("div", { children: "\uD559\uC6D0\uC0DD" }), _jsx("div", { children: level ? colorsByLevel[level] : "" })] })] }))] })) })));
|
|
40
|
+
}
|
package/deck/index.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "../style.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;
|
package/deck/index.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
export function Deck(_a) {
|
|
15
|
+
var children = _a.children, titles = _a.titles, options = _a.options;
|
|
16
|
+
var _b = titles !== null && titles !== void 0 ? titles : {}, title = _b.title, subTitle = _b.subTitle, gapTitle = _b.gapTitle;
|
|
17
|
+
var _c = options !== null && options !== void 0 ? options : {}, direction = _c.direction, height = _c.height, width = _c.width, gapX = _c.gapX, gapY = _c.gapY, justify = _c.justify;
|
|
18
|
+
var classNames = [
|
|
19
|
+
"flex flex-col",
|
|
20
|
+
"h-".concat(height !== null && height !== void 0 ? height : "auto", " w-").concat(width !== null && width !== void 0 ? width : "full", " gap-").concat(gapTitle !== null && gapTitle !== void 0 ? gapTitle : 4, " "),
|
|
21
|
+
].join(" ");
|
|
22
|
+
var bodyClassNames = [
|
|
23
|
+
"flex-".concat(direction !== null && direction !== void 0 ? direction : "row", " justify-").concat(justify !== null && justify !== void 0 ? justify : "start"),
|
|
24
|
+
"gap-x-".concat(gapX !== null && gapX !== void 0 ? gapX : 5, " gap-y-").concat(gapY !== null && gapY !== void 0 ? gapY : 5),
|
|
25
|
+
"flex w-full duration-500",
|
|
26
|
+
].join(" ");
|
|
27
|
+
return (_jsxs("div", __assign({ className: classNames }, { children: [_jsxs("div", __assign({ className: "pl-1" }, { children: [_jsx("div", __assign({ className: "text-2xl font-bold" }, { children: title })), _jsx("div", __assign({ className: "" }, { children: subTitle }))] })), _jsx("div", __assign({ className: bodyClassNames }, { children: children }))] })));
|
|
28
|
+
}
|
package/header/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
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 { useState } from "react";
|
|
14
|
+
import { circle } from "../asset/shape";
|
|
15
|
+
function Menu() {
|
|
16
|
+
var classNames = ["absolute -left-24 z-40 h-80 w-48 border-2 bg-white "].join(" ");
|
|
17
|
+
return (_jsxs("div", __assign({ className: classNames + " fade-in-100 animate-in" }, { children: [_jsx("div", { children: "\u314E\u3147" }), _jsx("div", { children: "\u314E\u3147" })] })));
|
|
18
|
+
}
|
|
19
|
+
export function DashboardHeader(_a) {
|
|
20
|
+
var title = _a.title, image = _a.image;
|
|
21
|
+
var _b = useState(false), isOpen = _b[0], setIsOpen = _b[1];
|
|
22
|
+
var _c = image !== null && image !== void 0 ? image : [], src = _c[0], url = _c[1];
|
|
23
|
+
return (_jsxs("div", __assign({ className: "relative flex h-20 w-full items-center justify-between bg-white px-19 shadow-black/10 shadow-b-md" }, { children: [_jsxs("div", __assign({ className: "flex h-12 items-center gap-9" }, { children: [src && url ? (_jsx("button", __assign({ onClick: function () {
|
|
24
|
+
window.location.href = url;
|
|
25
|
+
} }, { children: _jsx("img", { src: src, alt: "logo", className: "h-12" }) }))) : (_jsx("div", { children: "TOSEL Lab" })), _jsx("div", __assign({ className: "text-3xl font-bold" }, { children: title }))] })), _jsxs("div", __assign({ className: "relative" }, { children: [_jsx("button", __assign({ onClick: function () { return setIsOpen(!isOpen); }, className: circle(9) + "border-2" }, { children: "+" })), isOpen ? _jsx(Menu, {}) : null] }))] })));
|
|
26
|
+
}
|
package/modal/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
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 Alert(): import("react/jsx-runtime").JSX.Element;
|
package/modal/index.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
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 { absolute } from "../asset/position";
|
|
15
|
+
import { col } from "../asset/display";
|
|
16
|
+
function Modal(_a) {
|
|
17
|
+
var children = _a.children;
|
|
18
|
+
var classNames = [
|
|
19
|
+
absolute.tl() +
|
|
20
|
+
"z-50 flex min-h-screen w-full items-center justify-center bg-black/10 backdrop-blur-sm",
|
|
21
|
+
].join(" ");
|
|
22
|
+
var modalClassNames = ["h-100 w-2/3 min-w-76 max-w-176 rounded-xl bg-white relative"].join(" ");
|
|
23
|
+
return (_jsx("div", __assign({ className: classNames }, { children: _jsx("div", __assign({ className: modalClassNames }, { children: children })) })));
|
|
24
|
+
}
|
|
25
|
+
export function NoticeModal(_a) {
|
|
26
|
+
var titles = _a.titles, children = _a.children, buttons = _a.buttons, close = _a.close;
|
|
27
|
+
var _b = titles || ["", ""], title = _b[0], subTitle = _b[1];
|
|
28
|
+
var buttonClassNames = ["rounded-2xl bg-black px-8 py-2 text-lg font-bold text-white"].join(" ");
|
|
29
|
+
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) {
|
|
30
|
+
var text = _a[0], onClick = _a[1];
|
|
31
|
+
return (_jsx("button", __assign({ className: buttonClassNames, onClick: onClick }, { children: text })));
|
|
32
|
+
}) }))) : null] })), _jsx("button", { className: absolute.tl(5, 7) + "bg-black rounded-full h-9 w-9", onClick: close })] }));
|
|
33
|
+
}
|
|
34
|
+
export function Alert() {
|
|
35
|
+
return (_jsx("div", { children: _jsx("div", {}) }));
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function Navigation(): import("react/jsx-runtime").JSX.Element;
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@edu-tosel/design",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "UI components for International TOSEL Committee",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"jsx",
|
|
7
|
+
"tailwindcss",
|
|
8
|
+
"ui"
|
|
9
|
+
],
|
|
10
|
+
"author": "International TOSEL Committee",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"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
|
+
"react": "^18.2.0",
|
|
17
|
+
"react-dom": "^18.2.0",
|
|
18
|
+
"react-router-dom": "^6.21.1",
|
|
19
|
+
"react-scripts": "5.0.1",
|
|
20
|
+
"tailwind-scrollbar-hide": "^1.1.7",
|
|
21
|
+
"tailwindcss": "^3.4.0",
|
|
22
|
+
"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
|
+
]
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {}
|
|
48
|
+
}
|
package/style.css
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/** @type {import('tailwindcss').Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
content: ["./node_modules/tw-elements/dist/js/**/*.js", "./src/**/*.{js,jsx,ts,tsx}"],
|
|
4
|
+
theme: {
|
|
5
|
+
extend: {
|
|
6
|
+
screens: {
|
|
7
|
+
xxxs: "332px",
|
|
8
|
+
xxs: "393px",
|
|
9
|
+
xs: "480px",
|
|
10
|
+
sm: "640px",
|
|
11
|
+
md: "768px", // IPad Mini
|
|
12
|
+
ml: "964px", // IPad Air, IPad Pro 11.
|
|
13
|
+
lg: "1024px", // IPad Mini Horizontal Viewport
|
|
14
|
+
xl: "1280px",
|
|
15
|
+
"2xl": "1536px",
|
|
16
|
+
},
|
|
17
|
+
colors: {
|
|
18
|
+
"off-white": "#F5F5F5",
|
|
19
|
+
burgundy: "#933652",
|
|
20
|
+
"pale-silver": "#DFD8CA",
|
|
21
|
+
"cosmic-latte": "#FBF3E4",
|
|
22
|
+
"pale-lavender": "#E7E9F2",
|
|
23
|
+
"gray-light": "#F0F0F0",
|
|
24
|
+
"navy-blue": "#173A8B",
|
|
25
|
+
"pastel-blue": "#CED6E6",
|
|
26
|
+
"deep-red": "#760023",
|
|
27
|
+
"rose-velvet": "#AC647A",
|
|
28
|
+
"dark-shade-of-cyan": "#105652",
|
|
29
|
+
"dim-gray": "#4C4C4C",
|
|
30
|
+
"medium-gray": "#7F7F7F",
|
|
31
|
+
|
|
32
|
+
// Brabd Colors
|
|
33
|
+
"ps-pink": "#E3006E",
|
|
34
|
+
"ps-pink-light": "#FFBADB",
|
|
35
|
+
"st-orange": "#ED6A00",
|
|
36
|
+
"st-orange-light": "#F5D2B6",
|
|
37
|
+
"ba-yellow": "#FCCE30",
|
|
38
|
+
"ba-yellow-light": "#FFEFB7",
|
|
39
|
+
"jr-blue": "#52A2DA",
|
|
40
|
+
"jr-blue-light": "#D6EEFF",
|
|
41
|
+
"hj-blue": "#385EAB",
|
|
42
|
+
"hj-blue-light": "#A8BFE5",
|
|
43
|
+
},
|
|
44
|
+
spacing: {
|
|
45
|
+
1: "0.25rem",
|
|
46
|
+
7: "1.75rem",
|
|
47
|
+
12: "3rem",
|
|
48
|
+
15: "3.75rem",
|
|
49
|
+
18: "4.5rem",
|
|
50
|
+
19: "4.75rem",
|
|
51
|
+
22: "5.5rem",
|
|
52
|
+
25: "6.25rem",
|
|
53
|
+
27: "6.75rem",
|
|
54
|
+
30: "7.5rem",
|
|
55
|
+
34: "8.5rem",
|
|
56
|
+
38: "9.5rem",
|
|
57
|
+
40: "10rem",
|
|
58
|
+
42: "10.5rem",
|
|
59
|
+
49: "12.25rem",
|
|
60
|
+
50: "12.5rem",
|
|
61
|
+
52: "13rem",
|
|
62
|
+
56: "14rem",
|
|
63
|
+
64: "16rem",
|
|
64
|
+
68: "17rem",
|
|
65
|
+
69: "17.25rem",
|
|
66
|
+
72: "18rem",
|
|
67
|
+
73: "18.25rem",
|
|
68
|
+
76: "19rem",
|
|
69
|
+
78: "20rem",
|
|
70
|
+
84: "21rem",
|
|
71
|
+
85: "21.25rem",
|
|
72
|
+
88: "22rem",
|
|
73
|
+
90: "22.5rem",
|
|
74
|
+
92: "23rem",
|
|
75
|
+
96: "24rem",
|
|
76
|
+
98: "24.5rem",
|
|
77
|
+
100: "25rem",
|
|
78
|
+
104: "26rem",
|
|
79
|
+
106: "26.5rem",
|
|
80
|
+
108: "27rem",
|
|
81
|
+
110: "27.5rem",
|
|
82
|
+
112: "28rem",
|
|
83
|
+
116: "29rem",
|
|
84
|
+
120: "30rem",
|
|
85
|
+
122: "30.5rem",
|
|
86
|
+
124: "31rem",
|
|
87
|
+
126: "31.5rem",
|
|
88
|
+
128: "32rem",
|
|
89
|
+
132: "33rem",
|
|
90
|
+
136: "34rem",
|
|
91
|
+
140: "35rem",
|
|
92
|
+
144: "36rem",
|
|
93
|
+
148: "37rem",
|
|
94
|
+
160: "40rem",
|
|
95
|
+
176: "44rem",
|
|
96
|
+
180: "45rem",
|
|
97
|
+
182: "45.5rem",
|
|
98
|
+
186: "46.5rem",
|
|
99
|
+
200: "50rem",
|
|
100
|
+
220: "55rem",
|
|
101
|
+
228: "57rem",
|
|
102
|
+
232: "58rem",
|
|
103
|
+
240: "60rem",
|
|
104
|
+
248: "62rem",
|
|
105
|
+
255: "63.75rem",
|
|
106
|
+
256: "64rem",
|
|
107
|
+
260: "65rem",
|
|
108
|
+
272: "68rem",
|
|
109
|
+
280: "70rem",
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
safelist: [
|
|
114
|
+
{
|
|
115
|
+
pattern: /col-.*/,
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
pattern: /row-.*/,
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
pattern: /flex-.*/,
|
|
122
|
+
variants: ["md", "hover", "focus"],
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
pattern: /justify-.*/,
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
pattern: /items-.*/,
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
pattern: /grid-.*/,
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
pattern: /gap-.*/,
|
|
135
|
+
variants: ["md", "hover", "focus"],
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
pattern: /border-.*/,
|
|
139
|
+
},
|
|
140
|
+
{ pattern: /w-.*/ },
|
|
141
|
+
{ pattern: /h-.*/ },
|
|
142
|
+
{
|
|
143
|
+
pattern: /top*.*/,
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
pattern: /bottom*.*/,
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
pattern: /left*.*/,
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
pattern: /right*.*/,
|
|
153
|
+
},
|
|
154
|
+
{ pattern: /bg-.*/ },
|
|
155
|
+
{ pattern: /text-.*/ },
|
|
156
|
+
{
|
|
157
|
+
pattern: /p-.*/,
|
|
158
|
+
},
|
|
159
|
+
],
|
|
160
|
+
plugins: [
|
|
161
|
+
require("tailwind-scrollbar-hide"),
|
|
162
|
+
require("tailwindcss-animate"),
|
|
163
|
+
require("tw-elements/dist/plugin"),
|
|
164
|
+
require("tailwindcss-directional-shadows"),
|
|
165
|
+
],
|
|
166
|
+
};
|
package/text/index.d.ts
ADDED
package/text/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
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 { col } from "../asset/display";
|
|
15
|
+
export function LineBreaks(_a) {
|
|
16
|
+
var texts = _a.texts, gap = _a.gap;
|
|
17
|
+
return (_jsx("div", __assign({ className: col(gap) }, { children: texts.map(function (text) { return (_jsx("div", { children: text })); }) })));
|
|
18
|
+
}
|
package/version.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.1.0
|