@edu-tosel/design 0.1.2 → 0.1.3

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 CHANGED
@@ -1,32 +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
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
32
  문자열 조작 컴포넌트 보관
@@ -0,0 +1,2 @@
1
+ declare function classNames(...props: string[]): string;
2
+ export { classNames as cn };
@@ -0,0 +1,9 @@
1
+ function classNames() {
2
+ var props = [];
3
+ for (var _i = 0; _i < arguments.length; _i++) {
4
+ props[_i] = arguments[_i];
5
+ }
6
+ var array = props.map(function (prop) { return prop.split(" "); });
7
+ return array.flat().join(" ");
8
+ }
9
+ export { classNames as cn };
package/asset/colors.d.ts CHANGED
@@ -5,3 +5,6 @@ export declare const colorsByLevel: {
5
5
  JR: string;
6
6
  HJ: string;
7
7
  };
8
+ export declare const gradient: {
9
+ lab: string;
10
+ };
package/asset/colors.js CHANGED
@@ -5,3 +5,6 @@ export var colorsByLevel = {
5
5
  JR: "jr-blue",
6
6
  HJ: "hj-blue",
7
7
  };
8
+ export var gradient = {
9
+ lab: "bg-gradient-to-br from-violet-light/20 to-blue-sky/40 ",
10
+ };
@@ -9,6 +9,11 @@ export declare const center: {
9
9
  row: (gap?: number) => string;
10
10
  colO: (gap?: number) => string;
11
11
  rowO: (gap?: number) => string;
12
+ screen: {
13
+ default: string;
14
+ col: (gap?: number) => string;
15
+ row: (gap?: number) => string;
16
+ };
12
17
  };
13
18
  export declare const grid: {
14
19
  col: (col: number, gap?: number) => string;
package/asset/display.js CHANGED
@@ -27,6 +27,17 @@ export var center = {
27
27
  if (gap === void 0) { gap = 0; }
28
28
  return "gap-".concat(gap, " flex flex-row justify-center items-center ");
29
29
  },
30
+ screen: {
31
+ default: "flex justify-center items-center min-h-screen w-full overflow-hidden min-h-screen relative ",
32
+ col: function (gap) {
33
+ if (gap === void 0) { gap = 0; }
34
+ return "gap-".concat(gap, " flex flex-col justify-center items-center min-h-screen w-full ");
35
+ },
36
+ row: function (gap) {
37
+ if (gap === void 0) { gap = 0; }
38
+ return "gap-".concat(gap, " flex flex-row justify-center items-center min-h-screen w-full ");
39
+ },
40
+ },
30
41
  };
31
42
  export var grid = {
32
43
  col: function (col, gap) {
@@ -0,0 +1,7 @@
1
+ type Color = [string, string];
2
+ export declare const buttonStyle: {
3
+ default: (colorSet: [Color, Color] | [Color], size?: {
4
+ width: number;
5
+ } | undefined) => string;
6
+ };
7
+ export {};
@@ -0,0 +1,15 @@
1
+ export var buttonStyle = {
2
+ default: function (colorSet, size) {
3
+ var colors = colorSet[0], hoverColors = colorSet[1];
4
+ var bgColor = colors[0], textColor = colors[1];
5
+ var _a = hoverColors || ["", ""], bgHoverColor = _a[0], textHoverColor = _a[1];
6
+ var width = (size || { width: 32 }).width;
7
+ var classNames = [
8
+ "w-".concat(width),
9
+ "bg-".concat(bgColor, " ").concat(bgHoverColor ? "hover:bg-".concat(bgHoverColor) : ""),
10
+ "text-".concat(textColor, " ").concat(textHoverColor ? "hover:text-".concat(textHoverColor) : ""),
11
+ "font-bold py-2 px-4 rounded",
12
+ ];
13
+ return classNames.join(" ");
14
+ },
15
+ };
@@ -3,8 +3,12 @@ export declare const fixed: {
3
3
  br: (bottom: number | string, right: number | string) => string;
4
4
  };
5
5
  export declare const absolute: {
6
- tl: (top?: number, left?: number) => string;
7
- tr: (top?: number, right?: number) => string;
6
+ tl: (top?: number | string, left?: number | string) => string;
7
+ tr: (top?: number | string, right?: number | string) => string;
8
8
  br: (bottom?: number, right?: number) => string;
9
9
  bl: (bottom?: number, left?: number) => string;
10
+ full: {
11
+ tl: (top?: number | string, left?: number | string) => string;
12
+ bl: (bottom?: number | string, left?: number | string) => string;
13
+ };
10
14
  };
package/asset/position.js CHANGED
@@ -6,14 +6,30 @@ export var fixed = {
6
6
  };
7
7
  export var absolute = {
8
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, " ");
9
+ var topClass = function () {
10
+ if (typeof top === "number" && top < 0)
11
+ return "-top-".concat(Math.abs(top));
12
+ return "top-".concat(top);
13
+ };
14
+ var leftClass = function () {
15
+ if (typeof left === "number" && left < 0)
16
+ return "-left-".concat(Math.abs(left));
17
+ return "left-".concat(left);
18
+ };
19
+ return "absolute ".concat(topClass(), " ").concat(leftClass(), " ");
12
20
  },
13
21
  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, " ");
22
+ var topClass = function () {
23
+ if (typeof top === "number" && top < 0)
24
+ return "-top-".concat(Math.abs(top), " ");
25
+ return "top-".concat(top);
26
+ };
27
+ var rightClass = function () {
28
+ if (typeof right === "number" && right < 0)
29
+ return "-right-".concat(Math.abs(right), " ");
30
+ return "right-".concat(right);
31
+ };
32
+ return "absolute ".concat(topClass(), " ").concat(rightClass(), " ");
17
33
  },
18
34
  br: function (bottom, right) {
19
35
  if (bottom === void 0) { bottom = 0; }
@@ -25,4 +41,16 @@ export var absolute = {
25
41
  if (left === void 0) { left = 0; }
26
42
  return "absolute bottom-".concat(bottom, " left-").concat(left, " ");
27
43
  },
44
+ full: {
45
+ tl: function (top, left) {
46
+ if (!(typeof top === "number") || !(typeof left === "number"))
47
+ return "absolute top-".concat(top, " left-").concat(left, " w-full ");
48
+ var topClass = top >= 0 ? "top-".concat(top) : "-top-".concat(Math.abs(top));
49
+ var leftClass = left >= 0 ? "left-".concat(left) : "-left-".concat(Math.abs(left));
50
+ return "absolute w-full ".concat(topClass, " ").concat(leftClass, " ");
51
+ },
52
+ bl: function (bottom, left) {
53
+ return "absolute bottom-".concat(bottom !== null && bottom !== void 0 ? bottom : 0, " left-").concat(left !== null && left !== void 0 ? left : 0, " w-full ");
54
+ },
55
+ },
28
56
  };
package/board/index.d.ts CHANGED
@@ -10,7 +10,7 @@ export declare function ListBoard({ children, header, options, }: {
10
10
  children: React.ReactNode;
11
11
  header: {
12
12
  title: string;
13
- bgColor?: string;
13
+ colors?: [string, string];
14
14
  childrens?: React.ReactNode[];
15
15
  };
16
16
  options?: {
package/board/index.js CHANGED
@@ -11,12 +11,14 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import "../style.css";
14
- import { center, between } from "../asset/display";
14
+ import { center, between } from "../util";
15
15
  function Header(_a) {
16
- var title = _a.title, bgColor = _a.bgColor, childrens = _a.childrens;
16
+ var title = _a.title, colors = _a.colors, childrens = _a.childrens;
17
+ var _b = colors !== null && colors !== void 0 ? colors : ["bg", "text"], bgColor = _b[0], textColor = _b[1];
17
18
  var headerClassNames = [
18
19
  center.row + between.row,
19
- "bg-".concat(bgColor || "off-white"),
20
+ "bg-".concat(bgColor || "white-off"),
21
+ "text-".concat(textColor || "black"),
20
22
  "w-full h-22 px-12",
21
23
  ].join(" ");
22
24
  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; }) }))] })));
@@ -26,7 +28,7 @@ function Board(_a) {
26
28
  var height = (options !== null && options !== void 0 ? options : {}).height;
27
29
  var classNames = [
28
30
  "h-".concat(height !== null && height !== void 0 ? height : 186, " ").concat(header ? "" : "pt-8"),
29
- "rounded-xl bg-white/80 overflow-hidden relative",
31
+ "rounded-xl bg-white/80 overflow-hidden relative w-full",
30
32
  ].join(" ");
31
33
  return (_jsxs("div", __assign({ className: classNames }, { children: [header ? _jsx(Header, __assign({}, header)) : null, _jsx("div", __assign({ className: "h-full" }, { children: children }))] })));
32
34
  }
@@ -38,8 +40,8 @@ export function CanvasBoard(_a) {
38
40
  }
39
41
  export function ListBoard(_a) {
40
42
  var children = _a.children, header = _a.header, options = _a.options;
41
- var title = header.title, bgColor = header.bgColor, childrens = header.childrens;
43
+ var title = header.title, colors = header.colors, childrens = header.childrens;
42
44
  var height = (options !== null && options !== void 0 ? options : {}).height;
43
45
  var classNames = ["scrollbar 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 })) })));
46
+ return (_jsx(Board, __assign({ header: { title: title, colors: colors, childrens: childrens }, options: { height: height } }, { children: _jsx("div", __assign({ className: classNames }, { children: children })) })));
45
47
  }
package/card/Card.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ import "../style.css";
3
+ export declare function Card<T extends string | number>({ children, header, options, }: {
4
+ children: React.ReactNode;
5
+ header?: {
6
+ title: string;
7
+ bgColor?: string;
8
+ childrens?: React.ReactNode[];
9
+ };
10
+ options?: {
11
+ height?: number;
12
+ width?: T;
13
+ };
14
+ }): import("react/jsx-runtime").JSX.Element;
package/card/Card.js ADDED
@@ -0,0 +1,32 @@
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 "../util";
15
+ function Header(_a) {
16
+ var title = _a.title, bgColor = _a.bgColor, childrens = _a.childrens;
17
+ var headerClassNames = [
18
+ center.row + between.row,
19
+ "".concat(bgColor || "bg-white-off"),
20
+ "w-full h-12 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
+ export function Card(_a) {
25
+ var children = _a.children, header = _a.header, options = _a.options;
26
+ var _b = options !== null && options !== void 0 ? options : {}, height = _b.height, width = _b.width;
27
+ var classNames = [
28
+ "h-".concat(height !== null && height !== void 0 ? height : 48, " w-").concat(width !== null && width !== void 0 ? width : "full", " p-4 max-w-232 "),
29
+ "rounded-xl bg-white/80 overflow-hidden relative box-shadow duration-500",
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
+ }
@@ -0,0 +1,14 @@
1
+ type Level = "PS" | "ST" | "BA" | "JR" | "HJ";
2
+ export declare function ProfileCard<T extends string | number>({ info, gradeData, }: {
3
+ info: {
4
+ name: string;
5
+ birthday: string;
6
+ image?: string;
7
+ };
8
+ gradeData?: {
9
+ level?: Level;
10
+ score?: number;
11
+ grade?: number;
12
+ };
13
+ }): import("react/jsx-runtime").JSX.Element;
14
+ export {};
@@ -0,0 +1,20 @@
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 { Card } from "./Card";
14
+ import { colorsByLevel } from "../util";
15
+ export function ProfileCard(_a) {
16
+ var info = _a.info, gradeData = _a.gradeData;
17
+ var name = info.name, birthday = info.birthday, image = info.image;
18
+ var _b = gradeData !== null && gradeData !== void 0 ? gradeData : {}, level = _b.level, score = _b.score, grade = _b.grade;
19
+ return (_jsx(Card, __assign({ options: { width: 84 } }, { children: _jsxs("div", __assign({ className: "flex" }, { children: [_jsx("img", { src: image, alt: "profile", className: "h-20 w-20 overflow-hidden rounded-full object-cover " }), _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-blue-navy pb-2" }, { children: [_jsx("div", __assign({ 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] : "" })] })] }))] })) })));
20
+ }
package/card/index.d.ts CHANGED
@@ -1,29 +1 @@
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 {};
1
+ export * from "./ProfileCard";
package/card/index.js CHANGED
@@ -1,40 +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 { 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
- }
1
+ export * from "./ProfileCard";
package/header/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import "../style.css";
1
2
  export declare function DashboardHeader({ title, image }: {
2
3
  title: string;
3
4
  image?: [string, string];
package/header/index.js CHANGED
@@ -10,8 +10,9 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import "../style.css";
13
14
  import { useState } from "react";
14
- import { circle } from "../asset/shape";
15
+ import { circle } from "../util";
15
16
  function Menu() {
16
17
  var classNames = ["absolute -left-24 z-40 h-80 w-48 border-2 bg-white "].join(" ");
17
18
  return (_jsxs("div", __assign({ className: classNames + " fade-in-100 animate-in" }, { children: [_jsx("div", { children: "\u314E\u3147" }), _jsx("div", { children: "\u314E\u3147" })] })));
@@ -19,8 +20,6 @@ function Menu() {
19
20
  export function DashboardHeader(_a) {
20
21
  var title = _a.title, image = _a.image;
21
22
  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] }))] })));
23
+ var _c = image !== null && image !== void 0 ? image : [], src = _c[0], href = _c[1];
24
+ 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 && href ? (_jsx("a", __assign({ href: href }, { 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
25
  }
package/modal/index.js CHANGED
@@ -11,8 +11,7 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import "../style.css";
14
- import { absolute } from "../asset/position";
15
- import { col } from "../asset/display";
14
+ import { col, absolute } from "../util";
16
15
  function Modal(_a) {
17
16
  var children = _a.children;
18
17
  var classNames = [
@@ -1,8 +1,6 @@
1
+ /// <reference types="react" />
1
2
  import "../style.css";
2
- export default function Navigation({ contents, }: {
3
- contents: {
4
- title: string;
5
- href: string;
6
- icon: string;
7
- }[];
3
+ export declare const buttonClassNames: (href: string, nowPath: string, color?: [string, string]) => string;
4
+ export declare function NavigationContainer({ children }: {
5
+ children: React.ReactNode;
8
6
  }): import("react/jsx-runtime").JSX.Element;
@@ -11,23 +11,14 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import "../style.css";
14
- import { useState } from "react";
15
- import { center } from "../asset/display";
16
- export default function Navigation(_a) {
17
- var contents = _a.contents;
18
- var pathname = window.location.pathname;
19
- var _b = useState(pathname), nowPath = _b[0], setNowPath = _b[1];
20
- var bgColor = function (href) {
21
- if (nowPath === href)
22
- return "bg-white ";
23
- return "bg-transparent ";
24
- };
25
- var buttonClassNames = [center.row(6), "w-50 h-11 rounded-2xl pl-5 h"].join(" ");
26
- return (_jsx("div", __assign({ className: center.col() + "w-54" }, { children: contents.map(function (_a) {
27
- var title = _a.title, href = _a.href;
28
- return (_jsx("button", __assign({ onClick: function () {
29
- setNowPath(href);
30
- window.history.pushState({ data: href }, "", href);
31
- }, className: bgColor(href) + buttonClassNames }, { children: title }), href));
32
- }) })));
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 }));
33
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edu-tosel/design",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "UI components for International TOSEL Committee",
5
5
  "keywords": [
6
6
  "jsx",
package/style.css CHANGED
@@ -1,20 +1,41 @@
1
- @tailwind base;
2
- @tailwind components;
3
- @tailwind utilities;
4
-
5
- ::-webkit-scrollbar {
6
- width: 8px;
7
- }
8
-
9
- ::-webkit-scrollbar-track {
10
- background-color: transparent;
11
- }
12
- ::-webkit-scrollbar-thumb {
13
- background-color: #173a8b;
14
- opacity: 0.5;
15
- border-radius: 10px;
16
- }
17
-
18
- .box-shadow {
19
- box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.2);
20
- }
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
+ }