@edu-tosel/design 1.0.2 → 1.0.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.
Files changed (67) hide show
  1. package/README.md +44 -30
  2. package/board/index.d.ts +2 -2
  3. package/board/index.js +2 -2
  4. package/board/template/CanvasBoard.d.ts +2 -0
  5. package/board/template/CanvasBoard.js +10 -0
  6. package/board/template/ManageBoard.d.ts +4 -0
  7. package/board/template/ManageBoard.js +27 -0
  8. package/board/widget/Board.d.ts +2 -0
  9. package/board/widget/Board.js +29 -0
  10. package/board/widget/DataField.d.ts +6 -0
  11. package/board/widget/DataField.js +24 -0
  12. package/board/widget/Header.d.ts +2 -0
  13. package/board/widget/Header.js +22 -0
  14. package/board/widget/Tags.d.ts +3 -0
  15. package/board/widget/Tags.js +30 -0
  16. package/card/index.d.ts +5 -4
  17. package/card/index.js +5 -4
  18. package/card/{ChartCard.d.ts → template/ChartCard.d.ts} +1 -2
  19. package/card/{ChartCard.js → template/ChartCard.js} +1 -2
  20. package/card/{ProfileCard.js → template/ProfileCard.js} +2 -2
  21. package/card/template/RowCard.d.ts +5 -0
  22. package/card/template/RowCard.js +26 -0
  23. package/card/{TableCard.d.ts → template/TableCard.d.ts} +1 -2
  24. package/card/{TableCard.js → template/TableCard.js} +1 -2
  25. package/card/{TrumpCard.d.ts → template/TrumpCard.d.ts} +1 -1
  26. package/card/{TrumpCard.js → template/TrumpCard.js} +2 -2
  27. package/card/{Card.d.ts → widget/Card.d.ts} +1 -2
  28. package/card/widget/Card.js +45 -0
  29. package/deck/Deck.d.ts +1 -0
  30. package/deck/Deck.js +11 -10
  31. package/globals.css +2 -2
  32. package/index.d.ts +1 -0
  33. package/index.js +1 -0
  34. package/interface/Board.d.ts +45 -6
  35. package/interface/Card.d.ts +3 -0
  36. package/interface/HTMLElement.d.ts +13 -0
  37. package/interface/HTMLElement.js +1 -0
  38. package/interface/Property.d.ts +3 -1
  39. package/interface/Property.js +2 -0
  40. package/interface/index.d.ts +0 -1
  41. package/interface/index.js +0 -1
  42. package/layout/dashboard/index.js +1 -1
  43. package/menu/SideMenu.d.ts +1 -0
  44. package/menu/SideMenu.js +14 -0
  45. package/menu/index.d.ts +1 -0
  46. package/menu/index.js +1 -0
  47. package/modal/Modal.js +2 -0
  48. package/navigation/Navigation.js +3 -5
  49. package/package.json +1 -1
  50. package/shelf/Shelf.d.ts +1 -1
  51. package/shelf/Shelf.js +2 -2
  52. package/shelf/index.d.ts +1 -1
  53. package/shelf/index.js +1 -1
  54. package/store/index.d.ts +6 -0
  55. package/store/index.js +21 -0
  56. package/tailwind.config.ts +156 -51
  57. package/version.txt +1 -1
  58. package/board/Board.d.ts +0 -2
  59. package/board/Board.js +0 -14
  60. package/board/CanvasBoard.d.ts +0 -2
  61. package/board/CanvasBoard.js +0 -11
  62. package/board/Header.d.ts +0 -6
  63. package/board/Header.js +0 -12
  64. package/board/ListBoard.d.ts +0 -7
  65. package/board/ListBoard.js +0 -7
  66. package/card/Card.js +0 -34
  67. /package/card/{ProfileCard.d.ts → template/ProfileCard.d.ts} +0 -0
package/README.md CHANGED
@@ -1,33 +1,47 @@
1
1
  # TOSEL Design Library
2
+
2
3
  TOSEL 통합 디자인 시스템에 맞춘 UI 라이브러리
3
4
 
4
- ## Tech Stack
5
- - tailwindcss 3.4.1
6
- - React 18
7
- - Vite 5
8
-
9
- ## Getting Start
10
- ```bash
11
- # 설치
12
- npm install @edu-tosel/ui@latest
13
-
14
- # 개발환경
15
- npm install # 의존성 설치
16
- npm run dev # 개발자 환경에서 실행
17
- npm run test # jest 실행
18
- npm run build # 빌드
19
- npm run publish # npm 배포
20
- ```
21
-
22
- ## Folder Structure
23
- ### asset
24
- tailwindcss를 조합한 커스텀 클래스 보관
25
-
26
- ### board
27
- ### card
28
- ### deck
29
- ### header
30
- ### modal
31
- ### navigation
32
- ### text
33
- 문자열 조작 컴포넌트 보관
5
+ ## Component
6
+
7
+ 컴포넌트들은 기본적으로 기능 단위로만 구성한다.
8
+
9
+ 도메인은 구분하지 않는다. 단, Layout 컴포넌트에 대해서만 예외적으로 허용한다.
10
+
11
+ ### Board
12
+
13
+ Board 컴포넌트는 가장 큰 단위의 컨테이너이다.
14
+
15
+ 일반적으로
16
+
17
+ ### Card
18
+
19
+ Card 컴포넌트는 여러가지 요소를 담고 있는 컨테이너이다.
20
+
21
+ 일반적으로 가장 최소 단위의 컴포넌트로 사용되며, 다양한 요소를 담을 수 있다.
22
+
23
+ ### Deck
24
+
25
+ Deck 컴포넌트는 여러가지 Card 컴포넌트를 담고 있는 컨테이너이다.
26
+
27
+ Deck 컴포넌트는 담고있는 Card 컴포넌트들을 수평 정렬한다.
28
+
29
+ ### Layout
30
+
31
+ Layout 컴포넌트는 여러가지 컴포넌트를 담고 있는 컨테이너이다.
32
+
33
+ Layout 컴포넌트는 특정 프로젝트에서 반복적으로 사용되는 컴포넌트의 구조를 형성한다.
34
+
35
+ ### Navigation
36
+
37
+ Navigation 컴포넌트는 여러가지 링크를 담고 있는 컨테이너이다.
38
+
39
+ 각각의 링크 컴포넌트의 스타일링은 buttonClassNames로 전달받는다.
40
+
41
+ (Next.js의 Link Component와 React의 Link Component는 호환이 되지 않기 때문.)
42
+
43
+ ### Shelf
44
+
45
+ Shelf 컴포넌트는 Board 컴포넌트 내부에 위치하며 여러가지 Deck 컴포넌트를 담고 있는 컨테이너이다.
46
+
47
+ Shelf 컴포넌트는 담고있는 Deck 컴포넌트들을 수직 정렬한다.
package/board/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import "../globals.css";
2
- export * from "./CanvasBoard";
3
- export * from "./ListBoard";
2
+ export { default as CanvasBoard } from "./template/CanvasBoard";
3
+ export { default as ManageBoard } from "./template/ManageBoard";
package/board/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import "../globals.css";
2
- export * from "./CanvasBoard";
3
- export * from "./ListBoard";
2
+ export { default as CanvasBoard } from "./template/CanvasBoard";
3
+ export { default as ManageBoard } from "./template/ManageBoard";
@@ -0,0 +1,2 @@
1
+ import { BoardProps } from "../../interface/Board";
2
+ export default function CanvasBoard({ children, options }: BoardProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from "../../util";
3
+ import { Board } from "../widget/Board";
4
+ export default function CanvasBoard({ children, options }) {
5
+ const layouts = "flex flex-col lg:flex-row lg:flex-wrap gap-7.5 ";
6
+ const sizes = "h-full ";
7
+ const paddings = "pb-36 xl:pb-0 px-2 xs:px-4 xl:pl-8 xl:pr-2 pt-2 xs:pt-4 xl:pt-8";
8
+ const styles = "overflow-y-scroll ";
9
+ return (_jsx(Board, { options: options, children: _jsx("div", { className: cn(layouts, sizes, paddings, styles), children: children }) }));
10
+ }
@@ -0,0 +1,4 @@
1
+ import { ManageBoardProps } from "../../interface/Board";
2
+ type Item = Record<string, any>;
3
+ export default function ManageBoard<T extends Item>({ header, data, subWidget, options, }: ManageBoardProps<T>): import("react/jsx-runtime").JSX.Element;
4
+ export {};
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Deck } from "../../deck";
3
+ import { SideMenu } from "../../menu";
4
+ import { cn } from "../../util";
5
+ import { Board } from "../widget/Board";
6
+ import BoardHeader from "../widget/Header";
7
+ import BoardDataField from "../widget/DataField";
8
+ import { useWidgetStore } from "../../store";
9
+ export default function ManageBoard({ header, data, subWidget, options, }) {
10
+ const { order: [orderBy, orderHow], } = useWidgetStore();
11
+ const { dataSets, dataField, gap } = data;
12
+ const positions = `flex flex-col gap-${gap ?? 0}`;
13
+ const sizes = `h-full ${dataField ? "xl:h-135" : "xl:h-158"}`;
14
+ const paddings = "pb-60 xl:pb-0 px-2 xs:px-4 xl:pl-8";
15
+ const styles = "overflow-y-scroll";
16
+ return (_jsxs(Board, { options: options, children: [_jsx(BoardHeader, { ...header }), dataField && _jsx(BoardDataField, { dataField: dataField }), _jsx("div", { className: cn(positions, sizes, paddings, styles), children: dataSets.map(({ title: deckTitle, items, renderItem }) => deckTitle ? (_jsx("div", { className: "pt-4", children: _jsx(Deck, { titles: { title: deckTitle ?? "" }, children: items.map((item) => renderItem(item)) }) }, deckTitle)) : (items
17
+ .slice()
18
+ .sort((a, b) => {
19
+ if (orderBy) {
20
+ if (orderHow === "asc")
21
+ return a[orderBy] > b[orderBy] ? 1 : -1;
22
+ return a[orderBy] < b[orderBy] ? 1 : -1;
23
+ }
24
+ return 0;
25
+ })
26
+ .map((item) => renderItem(item)))) }), subWidget && _jsx(SideMenu, {})] }));
27
+ }
@@ -0,0 +1,2 @@
1
+ import { BoardProps } from "../../interface/Board";
2
+ export declare function Board({ children, options }: BoardProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,29 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useWidgetStore } from "../../store";
3
+ import { cn } from "../../util";
4
+ import { useState } from "react";
5
+ export function Board({ children, options }) {
6
+ const { events } = useWidgetStore();
7
+ const { widgets, tabs } = options ?? {};
8
+ const classNames = [
9
+ `h-full xl:min-h-0 `,
10
+ "xl:rounded-xl bg-white relative w-full z-10 overflow-hidden",
11
+ ].join(" ");
12
+ return (_jsxs("div", { className: "h-full xl:min-h-0 xl:h-178 w-full relative ", children: [_jsxs("div", { className: classNames, children: [children, widgets?.map(([widgetEvent, Component]) => {
13
+ return events?.some(({ event }) => event === widgetEvent) ? (_jsx(_Fragment, { children: Component })) : null;
14
+ })] }), tabs && _jsx(BottomTab, { tabs: tabs })] }));
15
+ }
16
+ function BottomTab({ tabs }) {
17
+ const [tabsSelection, setTabsSelection] = useState(tabs.map((_, i) => i === 0));
18
+ const positions = "xl:absolute xl:-bottom-14 xl:left-0 z-5";
19
+ const displays = "hidden xl:flex xl:items-end xl:gap-4";
20
+ const sizes = "xl:h-16";
21
+ const paddings = "xl:px-8 xl:pb-2 ";
22
+ const styles = "bg-white/50 rounded-b-xl ";
23
+ return (_jsx("div", { className: cn(displays, positions, sizes, paddings, styles), children: tabs.map(([title, onClick], index) => (_jsx("button", { onClick: () => {
24
+ setTabsSelection(tabsSelection.map((_, i) => i === index));
25
+ return onClick();
26
+ }, className: `h-9 w-32 rounded-md ${tabsSelection[index]
27
+ ? "border-4 border-blue-500"
28
+ : "border-4 border-red-500"}`, children: title }, title))) }));
29
+ }
@@ -0,0 +1,6 @@
1
+ export default function BoardDataField({ dataField, }: {
2
+ dataField: {
3
+ fields: Record<string, string>;
4
+ sizes: Record<string, string>;
5
+ };
6
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { cn } from "../../util";
3
+ import { useWidgetStore } from "./../../store";
4
+ export default function BoardDataField({ dataField, }) {
5
+ const { order: [orderBy, orderHow], setOrder, } = useWidgetStore();
6
+ const { fields, sizes } = dataField;
7
+ const container = {
8
+ positions: "fixed top-40 left-0 xl:static",
9
+ displays: "flex items-center",
10
+ styles: `bg-gray-200`,
11
+ sizes: "w-full h-23",
12
+ };
13
+ const dataFieldContainer = {
14
+ displays: "flex items-center",
15
+ sizes: "w-full h-12",
16
+ paddings: "px-2 xs:px-4 xl:pl-8 xl:pr-2 ",
17
+ styles: "bg-white-off",
18
+ };
19
+ const block = {
20
+ displays: "xl:hidden block ",
21
+ sizes: container.sizes,
22
+ };
23
+ return (_jsxs(_Fragment, { children: [_jsx("div", { className: cn(container.positions, container.displays, container.sizes, container.styles), children: _jsx("div", { className: cn(dataFieldContainer.displays, dataFieldContainer.sizes, dataFieldContainer.paddings, dataFieldContainer.styles), children: Object.entries(fields).map(([key, value]) => (_jsx("div", { className: `w-${`${sizes[key]}/100`} ?? "auto"}`, children: _jsxs("button", { onClick: () => setOrder(key), className: "flex items-center gap-1", children: [_jsx("div", { children: value }), _jsx("div", { className: "text-xs", children: orderBy === key ? (orderHow === "asc" ? "▼" : "▲") : "" })] }) }, key))) }) }), _jsx("div", { className: cn(block.sizes, block.displays) })] }));
24
+ }
@@ -0,0 +1,2 @@
1
+ import { BoardHeaderProps } from "./../../interface/Board";
2
+ export default function BoardHeader({ title, tags, options, }: BoardHeaderProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { cn } from "../../util";
3
+ import { Input, Select } from "./Tags";
4
+ export default function BoardHeader({ title, tags, options, }) {
5
+ const { selects, inputs } = tags ?? {};
6
+ const { colors } = options ?? {};
7
+ const { bgColor, textColor } = colors ?? {
8
+ bgColor: "gray-200",
9
+ textColor: "black",
10
+ };
11
+ const container = {
12
+ positions: "fixed top-20 left-0 xl:static flex items-center",
13
+ paddings: "px-12",
14
+ styles: `bg-${bgColor} text-${textColor} pl-12 pr-9`,
15
+ sizes: "w-full h-20",
16
+ };
17
+ const block = {
18
+ displays: "xl:hidden block ",
19
+ sizes: container.sizes,
20
+ };
21
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: cn(container.positions, container.paddings, container.sizes, container.styles), children: [_jsx("div", { className: "text-xl font-bold", children: title }), _jsxs("div", { className: "flex items-center ml-auto gap-4", children: [selects?.map(({ width, title, options, onChange }) => (_jsx(Select, { width: width, title: title, selectOptions: options, onChange: onChange }, title))), inputs?.map(({ width, title, placeholder, onChange }) => (_jsx(Input, { width: width, title: title, placeholder: placeholder, onChange: onChange }, title + placeholder)))] })] }), _jsx("div", { className: cn(block.sizes, block.displays) })] }));
22
+ }
@@ -0,0 +1,3 @@
1
+ import { HTMLInputElement, HTMLSelectElement } from "../../interface/HTMLElement";
2
+ export declare function Select({ title, width, onChange, selectOptions, }: HTMLSelectElement): import("react/jsx-runtime").JSX.Element;
3
+ export declare function Input({ title, onChange, placeholder, width, }: HTMLInputElement): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,30 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useId } from "react";
3
+ export function Select({ title, width, onChange, selectOptions, }) {
4
+ const id = useId();
5
+ const widthSize = {
6
+ xs: "w-32",
7
+ sm: "w-48",
8
+ md: "w-64",
9
+ lg: "w-96",
10
+ xl: "w-128",
11
+ "2xl": "w-144",
12
+ full: "w-full",
13
+ };
14
+ const classNames = `${widthSize[width ?? "md"]} h-10 rounded-full pl-4`;
15
+ return (_jsxs("div", { className: "flex justify-center items-center gap-4", children: [_jsx("label", { htmlFor: id, className: "font-bold", children: title }), _jsx("select", { id: id, onChange: (e) => onChange(e.target.value), className: classNames, children: selectOptions?.map(([id, title]) => (_jsx("option", { value: id, children: title }, id))) })] }));
16
+ }
17
+ export function Input({ title, onChange, placeholder, width, }) {
18
+ const id = useId();
19
+ const widthSize = {
20
+ xs: "w-28",
21
+ sm: "w-48",
22
+ md: "w-64",
23
+ lg: "w-96",
24
+ xl: "w-128",
25
+ "2xl": "w-144",
26
+ full: "w-full",
27
+ };
28
+ const classNames = `${widthSize[width ?? "md"]} h-10 rounded-full pl-4`;
29
+ return (_jsxs("div", { className: "flex justify-center items-center gap-4", children: [_jsx("label", { htmlFor: id, className: "font-bold", children: title }), _jsx("input", { className: classNames, id: id, type: "text", placeholder: placeholder ?? "", onChange: (e) => onChange(e.target.value) })] }));
30
+ }
package/card/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- export * from "./ProfileCard";
2
- export * from "./TrumpCard";
3
- export * from "./ChartCard";
4
- export * from "./TableCard";
1
+ export * from "./template/ProfileCard";
2
+ export * from "./template/TrumpCard";
3
+ export * from "./template/ChartCard";
4
+ export * from "./template/TableCard";
5
+ export * from "./template/RowCard";
package/card/index.js CHANGED
@@ -1,4 +1,5 @@
1
- export * from "./ProfileCard";
2
- export * from "./TrumpCard";
3
- export * from "./ChartCard";
4
- export * from "./TableCard";
1
+ export * from "./template/ProfileCard";
2
+ export * from "./template/TrumpCard";
3
+ export * from "./template/ChartCard";
4
+ export * from "./template/TableCard";
5
+ export * from "./template/RowCard";
@@ -1,3 +1,2 @@
1
- import "../globals.css";
2
- import { ChartCardProps } from "../interface/Card";
1
+ import { ChartCardProps } from "../../interface/Card";
3
2
  export declare function ChartCard({ data, xAxis, yAxis, lines, bars, areas, }: ChartCardProps): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import "../globals.css";
3
2
  import { Area, Bar, ComposedChart, Line, ResponsiveContainer, Tooltip, XAxis, YAxis, } from "recharts";
4
- import { Card } from "./Card";
3
+ import { Card } from "../widget/Card";
5
4
  export function ChartCard({ data, xAxis, yAxis, lines, bars, areas, }) {
6
5
  return (_jsx(Card, { options: { width: "xl", height: "lg", 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
6
  }
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Card } from "./Card";
3
- import { colorsByLevel } from "../util";
2
+ import { Card } from "../widget/Card";
3
+ 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 ?? {};
@@ -0,0 +1,5 @@
1
+ export default function RowCard<T extends Record<string, any>>({ row, fields, sizes, }: {
2
+ row: T;
3
+ fields: Partial<Record<keyof T, "text" | ["select", [string, string][]]>>;
4
+ sizes: Partial<Record<keyof T, string>>;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Card } from "../widget/Card";
3
+ import { useWidgetStore } from "../../store";
4
+ import { useId, useState } from "react";
5
+ export default function RowCard({ row, fields, sizes, }) {
6
+ const [rowState, setRowState] = useState(row);
7
+ const { setView, setTempData } = useWidgetStore();
8
+ const entries = Object.entries(fields).map(([key, type]) => [type, key, rowState[key]]);
9
+ return (_jsx(Card, { options: {
10
+ width: "full",
11
+ height: "xs",
12
+ boundary: "none",
13
+ rounded: "none",
14
+ }, children: _jsxs("div", { className: "flex items-center h-full", children: [entries.map(([type, key, value]) => (_jsx("div", { className: `w-${`${sizes[key]}/100`} ?? "auto"}`, children: Array.isArray(type) && type[0] === "select" ? (_jsx(Select, { type: type, entry: [key, value], row: rowState, setRow: setRowState }, key + type + value.toString())) : (_jsx("div", { className: "w-full truncate", children: value ?? "No Data" }, key + value.toString())) }, key))), _jsx("button", { onClick: () => {
15
+ setTempData(row);
16
+ setView("sideMenu");
17
+ }, children: "click" })] }) }));
18
+ }
19
+ function Select({ type, entry, row, setRow, }) {
20
+ const id = useId();
21
+ const [key, value] = entry;
22
+ return (_jsx("select", { value: value, onChange: (e) => setRow({
23
+ ...row,
24
+ [key]: e.target.value,
25
+ }), children: type[1].map(([value, title]) => (_jsx("option", { value: value, children: title }, id + value))) }, id));
26
+ }
@@ -1,3 +1,2 @@
1
- import "../globals.css";
2
- import { TableCardProps } from "../interface/Card";
1
+ import { TableCardProps } from "../../interface/Card";
3
2
  export declare function TableCard({ data, fields, sizes, options }: TableCardProps): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import "../globals.css";
3
- import { Card } from "./Card";
2
+ import { Card } from "../widget/Card";
4
3
  export function TableCard({ data, fields, sizes, options }) {
5
4
  const { color } = options ?? {};
6
5
  const { background: bgColor, text: textColor } = color ?? {};
@@ -1,2 +1,2 @@
1
- import { TrumpCardProps } from "../interface/Card";
1
+ import { TrumpCardProps } from "../../interface/Card";
2
2
  export declare function TrumpCard({ titles, options }: TrumpCardProps): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { LineBreaks } from "../text";
3
- import { Card } from "./Card";
2
+ import { LineBreaks } from "../../text";
3
+ import { Card } from "../widget/Card";
4
4
  export function TrumpCard({ titles, options }) {
5
5
  const { title, subTitle, color: titleColor } = titles;
6
6
  const { onClick, width, image, subButton } = options ?? {};
@@ -1,3 +1,2 @@
1
- import "../globals.css";
2
- import { CardProps } from "../interface/Card";
1
+ import { CardProps } from "../../interface/Card";
3
2
  export declare function Card({ children, options }: CardProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,45 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from "../../util";
3
+ const widthSize = {
4
+ xs: "w-full md:w-60",
5
+ sm: "w-full md:w-90",
6
+ md: "w-full md:w-112.5",
7
+ lg: "w-full md:w-127.5",
8
+ xl: "w-full lg:w-187.5",
9
+ "2xl": "w-full lg:w-247.5",
10
+ full: "w-full",
11
+ };
12
+ const heightSize = {
13
+ xs: "min-h-16",
14
+ sm: "h-72 sm:h-48",
15
+ md: "h-72 sm:h-48",
16
+ lg: "h-80",
17
+ xl: "h-125",
18
+ "2xl": "",
19
+ };
20
+ export function Card({ children, options }) {
21
+ const { boundary, rounded, height, width, text, onClick } = options ?? {};
22
+ const { size: textSize, color: textColor } = text ?? {};
23
+ const setBoundary = () => {
24
+ if (boundary === "shadow")
25
+ return "box-shadow";
26
+ if (boundary === "border")
27
+ return "border-2";
28
+ if (boundary === "none")
29
+ return "";
30
+ return "box-shadow";
31
+ };
32
+ const sizes = [
33
+ `${heightSize[height ?? "sm"]}`,
34
+ `${widthSize[width ?? "sm"]}`,
35
+ ].join(" ");
36
+ const positions = "relative";
37
+ const styles = [
38
+ `${onClick ? "cursor-pointer" : ""}`,
39
+ `text-${textSize ?? "base"}`,
40
+ setBoundary(),
41
+ `rounded-${rounded ?? "xl"}`,
42
+ `bg-white/80 duration-500 overflow-hidden`,
43
+ ].join(" ");
44
+ return (_jsx("div", { onClick: onClick, className: cn(sizes, positions, styles), children: children }));
45
+ }
package/deck/Deck.d.ts CHANGED
@@ -7,6 +7,7 @@ export declare function Deck<T extends string | number>({ children, titles, opti
7
7
  gapTitle?: number;
8
8
  };
9
9
  options?: {
10
+ overflowScroll?: boolean;
10
11
  width?: T;
11
12
  height?: number;
12
13
  gapX?: number;
package/deck/Deck.js CHANGED
@@ -1,14 +1,15 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from "../util";
2
3
  export function Deck({ children, titles, options, }) {
3
4
  const { title, subTitle, gapTitle } = titles ?? {};
4
- const { height, gapX, gapY } = options ?? {};
5
- const containerClassNames = [
6
- `flex sm:w-full flex-col h-${height ?? "auto"} gap-${gapTitle ?? 4} `,
7
- ].join(" ");
8
- const bodyClassNames = [
9
- `flex flex-col sm:flex-row sm:w-full `,
10
- `gap-x-${gapX ?? 7.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 })] }));
5
+ const { height, gapX, gapY, overflowScroll } = options ?? {};
6
+ const container = {
7
+ positions: `flex flex-col gap-${gapTitle ?? 4}`,
8
+ sizes: `sm:w-full h-${height ?? "auto"} `,
9
+ };
10
+ const body = {
11
+ positions: `flex flex-col sm:flex-row sm:w-full gap-x-${gapX ?? 7.5} gap-y-${gapY ?? 5}`,
12
+ styles: `${overflowScroll ? "overflow-x-scroll" : ""} duration-500`,
13
+ };
14
+ return (_jsxs("div", { className: cn(container.positions, container.sizes), 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: cn(body.positions, body.styles), children: children })] }));
14
15
  }
package/globals.css CHANGED
@@ -23,14 +23,14 @@
23
23
  }
24
24
 
25
25
  ::-webkit-scrollbar {
26
- width: 8px;
26
+ width: 3px;
27
27
  }
28
28
 
29
29
  ::-webkit-scrollbar-track {
30
30
  background-color: transparent;
31
31
  }
32
32
  ::-webkit-scrollbar-thumb {
33
- background-color: #173a8b;
33
+ background-color: #808080;
34
34
  opacity: 0.5;
35
35
  border-radius: 10px;
36
36
  }
package/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export * from "./board";
3
3
  export * from "./card";
4
4
  export * from "./deck";
5
5
  export * from "./layout";
6
+ export * from "./menu";
6
7
  export * from "./modal";
7
8
  export * from "./navigation";
8
9
  export * from "./shelf";
package/index.js CHANGED
@@ -3,6 +3,7 @@ export * from "./board";
3
3
  export * from "./card";
4
4
  export * from "./deck";
5
5
  export * from "./layout";
6
+ export * from "./menu";
6
7
  export * from "./modal";
7
8
  export * from "./navigation";
8
9
  export * from "./shelf";
@@ -1,10 +1,49 @@
1
- /// <reference types="react" />
2
- export interface BoardProps {
3
- children: React.ReactNode;
4
- widget?: {
5
- widgets: [[string, React.ReactNode]];
1
+ import { Dispatch } from "react";
2
+ import { Button, Size } from "./Property";
3
+ export interface BoardHeaderProps {
4
+ title?: string;
5
+ tags?: {
6
+ selects?: {
7
+ title: string;
8
+ onChange: Dispatch<string>;
9
+ options: [string | number, string][];
10
+ width?: Size;
11
+ }[];
12
+ inputs?: {
13
+ title: string;
14
+ onChange: Dispatch<string>;
15
+ placeholder: string;
16
+ width?: Size;
17
+ }[];
6
18
  };
7
19
  options?: {
8
- height?: number;
20
+ colors?: {
21
+ bgColor?: string;
22
+ textColor?: string;
23
+ };
24
+ };
25
+ }
26
+ export interface BoardProps {
27
+ children?: React.ReactNode;
28
+ options?: {
29
+ widgets?: [string, React.ReactNode][];
30
+ tabs?: Button[];
31
+ color?: string;
32
+ };
33
+ }
34
+ export interface ManageBoardProps<T> extends BoardProps {
35
+ data: {
36
+ dataSets: {
37
+ title?: string;
38
+ items: T[];
39
+ renderItem: (items: T) => React.ReactNode;
40
+ }[];
41
+ dataField?: {
42
+ fields: Record<string, string>;
43
+ sizes: Record<string, string>;
44
+ };
45
+ gap?: number;
9
46
  };
47
+ header?: BoardHeaderProps;
48
+ subWidget?: React.ReactNode;
10
49
  }
@@ -15,6 +15,8 @@ import { ImageSize, Size } from "./Property";
15
15
  export interface CardProps {
16
16
  children: React.ReactNode;
17
17
  options?: {
18
+ boundary?: "shadow" | "border" | "none";
19
+ rounded?: string;
18
20
  height?: Size;
19
21
  width?: Size;
20
22
  text?: {
@@ -22,6 +24,7 @@ export interface CardProps {
22
24
  color?: string;
23
25
  };
24
26
  onClick?: () => unknown | (() => Promise<unknown>);
27
+ overflow?: "hiden" | "auto";
25
28
  };
26
29
  }
27
30
  export interface ChartCardProps {
@@ -0,0 +1,13 @@
1
+ import { Dispatch } from "react";
2
+ import { Size } from "./Property";
3
+ export interface HTMLElement {
4
+ title: string;
5
+ onChange: Dispatch<string>;
6
+ width?: Size;
7
+ }
8
+ export interface HTMLSelectElement extends HTMLElement {
9
+ selectOptions?: [string | number, string][];
10
+ }
11
+ export interface HTMLInputElement extends HTMLElement {
12
+ placeholder?: string;
13
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -8,8 +8,10 @@
8
8
  * @property {"md"} md - Medium size
9
9
  * @property {"lg"} lg - Large size
10
10
  * @property {"xl"} xl - Extra large size
11
+ * @property {"2xl"} 2xl - Double extra large size
12
+ * @property {"full"} full - Full size
11
13
  */
12
- export type Size = "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
14
+ export type Size = "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full";
13
15
  /**
14
16
  * Image size type
15
17
  * @enum {string}
@@ -8,5 +8,7 @@
8
8
  * @property {"md"} md - Medium size
9
9
  * @property {"lg"} lg - Large size
10
10
  * @property {"xl"} xl - Extra large size
11
+ * @property {"2xl"} 2xl - Double extra large size
12
+ * @property {"full"} full - Full size
11
13
  */
12
14
  export {};
@@ -1,3 +1,2 @@
1
1
  export * from "./Property";
2
2
  export * from "./Widget";
3
- export * from "./Board";
@@ -1,3 +1,2 @@
1
1
  export * from "./Property";
2
2
  export * from "./Widget";
3
- export * from "./Board";
@@ -6,5 +6,5 @@ import { cn } from "../../util";
6
6
  export function DashboardLayout({ subject, colors, navigations, children, }) {
7
7
  const [title, image, imageUrl] = subject ?? ["", "", ""];
8
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:gap-8 xl:pl-2 2xl:px-9 xl:pt-12 mt-20 xl:m-0", children: [_jsx(NavigationContainer, { children: navigations.map((nav, index) => (_jsx(Fragment, { children: nav }, index))) }), children] })] }));
9
+ return (_jsxs("div", { className: cn(`bg-${bgColor}`, `text-${textColor}`, `min-h-screen h-screen xl:h-auto font-pretendard-medium`), children: [_jsx(Header, { title: title, image: [image, imageUrl] }), _jsxs("div", { className: "h-full flex gap-12 pt-20 xl:gap-8 xl:pl-2 2xl:px-9 xl:pt-10 xl:m-0 ", children: [_jsx(NavigationContainer, { children: navigations.map((nav, index) => (_jsx(Fragment, { children: nav }, index))) }), children] })] }));
10
10
  }
@@ -0,0 +1 @@
1
+ export default function SideMenu(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import { useWidgetStore } from "../store";
3
+ import { cn } from "../util";
4
+ export default function SideMenu() {
5
+ const { tempData, clearTempData, events, removeView } = useWidgetStore();
6
+ const isOpen = events.some(({ event }) => event === "sideMenu");
7
+ const positions = "absolute top-20 right-0";
8
+ const sizes = `${isOpen ? "w-160" : "w-0"} h-full bg-gray-200`;
9
+ const styles = `${isOpen ? "opacity-100 z-30" : "opacity-0 z-0"} bg-gray-200 duration-500 `;
10
+ return (_jsx("div", { className: cn(positions, sizes, styles), children: _jsxs("div", { className: "relative w-full h-full", children: [_jsx("div", { children: Object.entries(tempData).map(([key, value]) => (_jsxs("div", { className: "text-2xl font-bold", children: [key, ": ", value] }, key))) }), _jsx("button", { onClick: () => {
11
+ clearTempData();
12
+ return removeView("sideMenu");
13
+ }, className: "absolute left-0 top-2/5 text-3xl font-bold", children: ">" })] }) }));
14
+ }
@@ -0,0 +1 @@
1
+ export { default as SideMenu } from "./SideMenu";
package/menu/index.js ADDED
@@ -0,0 +1 @@
1
+ export { default as SideMenu } from "./SideMenu";
package/modal/Modal.js CHANGED
@@ -9,6 +9,7 @@ const widthSize = {
9
9
  lg: "w-full min-w-76 max-w-360",
10
10
  xl: "w-2/3 min-w-76 max-w-176",
11
11
  "2xl": "w-2/3 min-w-76 max-w-176",
12
+ full: "w-full",
12
13
  };
13
14
  const heightSize = {
14
15
  xs: "",
@@ -17,6 +18,7 @@ const heightSize = {
17
18
  lg: "h-120",
18
19
  xl: "h-180",
19
20
  "2xl": "w-2/3 min-w-76 max-w-176",
21
+ full: "h-full",
20
22
  };
21
23
  export function Modal({ children, options }) {
22
24
  const { buttons, width, height } = options ?? {};
@@ -8,9 +8,7 @@ export const buttonClassNames = (href, nowPath, color) => {
8
8
  "font-bold w-full xl:w-50 h-11 xl:rounded-2xl flex justify-center xl:justify-start xl:pl-5",
9
9
  ].join(" ");
10
10
  const checkPathMatch = (href, nowPath) => {
11
- if (href === "")
12
- return !nowPath.slice(1).includes("/");
13
- return nowPath.includes(href);
11
+ return href.split("/").pop() === nowPath.split("/").pop();
14
12
  };
15
13
  const toggle = checkPathMatch(href, nowPath)
16
14
  ? `bg-${bg}`
@@ -18,9 +16,9 @@ export const buttonClassNames = (href, nowPath, color) => {
18
16
  return [classNames, toggle].join(" ");
19
17
  };
20
18
  export function NavigationContainer({ children, }) {
21
- const layouts = "flex flex-row xl:flex-col z-40";
19
+ const displays = "flex flex-row xl:flex-col z-40";
22
20
  const positions = "fixed bottom-0 left-0 xl:static";
23
21
  const sizes = "w-full xl:w-auto";
24
22
  const styles = "";
25
- return (_jsx("div", { className: cn(layouts, positions, sizes, styles), children: children }));
23
+ return (_jsx("div", { className: cn(displays, positions, sizes, styles), children: children }));
26
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edu-tosel/design",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "UI components for International TOSEL Committee",
5
5
  "keywords": [
6
6
  "jsx",
package/shelf/Shelf.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
- export declare function Shelf({ children }: {
2
+ export default function Shelf({ children }: {
3
3
  children: React.ReactNode;
4
4
  }): import("react/jsx-runtime").JSX.Element;
package/shelf/Shelf.js CHANGED
@@ -1,4 +1,4 @@
1
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 xl:w-auto", children: children }));
2
+ export default function Shelf({ children }) {
3
+ return _jsx("div", { className: "inline-flex flex-col gap-8 xl:w-auto", children: children });
4
4
  }
package/shelf/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "./Shelf";
1
+ export { default as Shelf } from "./Shelf";
package/shelf/index.js CHANGED
@@ -1 +1 @@
1
- export * from "./Shelf";
1
+ export { default as Shelf } from "./Shelf";
package/store/index.d.ts CHANGED
@@ -2,9 +2,15 @@ import { WidgetEvent } from "../interface/Widget";
2
2
  interface WidgetProps {
3
3
  events: WidgetEvent[];
4
4
  setView: (prop: string) => void;
5
+ removeView: (prop: string) => void;
5
6
  setModal: (prop: string) => void;
6
7
  removeModal: (prop: string) => void;
7
8
  clearModal: () => void;
9
+ order: [string, "asc" | "desc"];
10
+ setOrder: (prop: string) => void;
11
+ tempData: Record<string, string | number>;
12
+ setTempData: (prop: Record<string, string | number>) => void;
13
+ clearTempData: () => void;
8
14
  }
9
15
  export declare const useWidgetStore: import("zustand").UseBoundStore<import("zustand").StoreApi<WidgetProps>>;
10
16
  export {};
package/store/index.js CHANGED
@@ -4,6 +4,24 @@ export const useWidgetStore = create((set) => ({
4
4
  setView: (prop) => set((state) => ({
5
5
  events: [...state.events, { event: prop, type: "view" }],
6
6
  })),
7
+ removeView: (prop) => {
8
+ set((state) => ({
9
+ events: state.events.filter(({ event }) => event !== prop),
10
+ }));
11
+ },
12
+ order: ["", "asc"],
13
+ setOrder: (prop) => {
14
+ set((state) => {
15
+ if (state.order[0] !== prop) {
16
+ return {
17
+ order: [prop, "asc"],
18
+ };
19
+ }
20
+ return {
21
+ order: [prop, state.order[1] === "asc" ? "desc" : "asc"],
22
+ };
23
+ });
24
+ },
7
25
  setModal: (prop) => set((state) => ({
8
26
  events: [...state.events, { event: prop, type: "modal" }],
9
27
  })),
@@ -15,4 +33,7 @@ export const useWidgetStore = create((set) => ({
15
33
  clearModal: () => set((state) => ({
16
34
  events: state.events.filter(({ type }) => type !== "modal"),
17
35
  })),
36
+ tempData: {},
37
+ setTempData: (prop) => set((state) => ({ tempData: { ...state.tempData, ...prop } })),
38
+ clearTempData: () => set({ tempData: {} }),
18
39
  }));
@@ -56,57 +56,7 @@ export default {
56
56
  "hj-blue": "#385EAB",
57
57
  "hj-blue-light": "#A8BFE5",
58
58
  },
59
- inset: {
60
- "1/20": "5%",
61
- "1/10": "10%",
62
- "2/10": "5%",
63
- "1/5": "20%",
64
- "2/5": "40%",
65
- "1/4": "25%",
66
- "1/3": "33.3333333%",
67
- "5/100": "5%",
68
- "10/100": "10%",
69
- "15/100": "15%",
70
- "43/100": "43%",
71
- "46/100": "46%",
72
- },
73
- width: {
74
- "2/3": "66.6666667%",
75
- "1/7": "14.2857143%",
76
- "2/7": "28.5714286%",
77
- "3/7": "42.8571429%",
78
- "4/7": "57.1428571%",
79
- "1/8": "12.5%",
80
- "3/10": "30%",
81
- "1/10": "10%",
82
- "4/10": "40%",
83
- "6/10": "60%",
84
- "7/10": "70%",
85
- "9/10": "90%",
86
- "10/100": "10%",
87
- "12/100": "12%",
88
- "15/100": "15%",
89
- "35/100": "35%",
90
- "45/100": "45%",
91
- "55/100": "55%",
92
- "65/100": "65%",
93
- "85/100": "85%",
94
- 90: "22.5rem",
95
- 120: "30rem",
96
- 176: "44rem",
97
- 478: "478px",
98
- },
99
- height: {
100
- "4/7": "57.1428571%",
101
- "3/7": "42.8571429%",
102
- "5/12": "41.6666667%",
103
- "1/10": "10%",
104
- "3/10": "30%",
105
- "4/10": "40%",
106
- "6/10": "60%",
107
- "7/10": "70%",
108
- "9/10": "90%",
109
- },
59
+
110
60
  maxHeight: {
111
61
  44: "11rem",
112
62
  "9/10": "90%",
@@ -116,17 +66,23 @@ export default {
116
66
  1: "0.25rem",
117
67
  7: "1.75rem",
118
68
  7.5: "1.875rem",
69
+ 8: "2rem",
70
+ 9: "2.25rem",
119
71
  11: "2.75rem",
120
72
  12: "3rem",
73
+ 14: "3.5rem",
121
74
  15: "3.75rem",
75
+ 16: "4rem",
122
76
  18: "4.5rem",
123
77
  19: "4.75rem",
124
78
  22: "5.5rem",
79
+ 23: "5.75rem",
125
80
  25: "6.25rem",
126
81
  26: "6.5rem",
127
82
  27: "6.75rem",
128
83
  30: "7.5rem",
129
84
  34: "8.5rem",
85
+ 36: "9rem",
130
86
  38: "9.5rem",
131
87
  40: "10rem",
132
88
  42: "10.5rem",
@@ -175,16 +131,21 @@ export default {
175
131
  140: "35rem",
176
132
  144: "36rem",
177
133
  148: "37rem",
134
+ 158: "39.5rem",
178
135
  160: "40rem",
179
136
  164: "41rem",
180
137
  168: "42rem",
181
138
  172: "43rem",
182
139
  176: "44rem",
140
+ 178: "44.5rem",
183
141
  180: "45rem",
184
142
  182: "45.5rem",
143
+ 184: "46rem",
185
144
  186: "46.5rem",
186
145
  187.5: "46.875rem",
146
+ 188: "47rem",
187
147
  190: "47.5rem",
148
+ 192: "48rem",
188
149
  200: "50rem",
189
150
  216: "54rem",
190
151
  220: "55rem",
@@ -248,6 +209,7 @@ export default {
248
209
  },
249
210
  transitionDuration: {
250
211
  300: "300ms",
212
+ 1000: "1000ms",
251
213
  2000: "2000ms",
252
214
  60000: "60000ms",
253
215
  300000: "300000ms",
@@ -301,6 +263,149 @@ export default {
301
263
  xl: "1280px",
302
264
  "2xl": "1536px",
303
265
  },
266
+ inset: {
267
+ "1/20": "5%",
268
+ "1/10": "10%",
269
+ "2/10": "5%",
270
+ "1/5": "20%",
271
+ "2/5": "40%",
272
+ "1/4": "25%",
273
+ "1/3": "33.3333333%",
274
+ "5/100": "5%",
275
+ "10/100": "10%",
276
+ "15/100": "15%",
277
+ "43/100": "43%",
278
+ "46/100": "46%",
279
+ },
280
+ width: {
281
+ 90: "22.5rem",
282
+ 120: "30rem",
283
+ 176: "44rem",
284
+ "2/3": "66.6666667%",
285
+ "1/7": "14.2857143%",
286
+ "2/7": "28.5714286%",
287
+ "3/7": "42.8571429%",
288
+ "4/7": "57.1428571%",
289
+ "1/8": "12.5%",
290
+ "3/10": "30%",
291
+ "1/10": "10%",
292
+ "4/10": "40%",
293
+ "6/10": "60%",
294
+ "7/10": "70%",
295
+ "9/10": "90%",
296
+ // percentile width
297
+ "1/100": "1%",
298
+ "2/100": "2%",
299
+ "3/100": "3%",
300
+ "4/100": "4%",
301
+ "5/100": "5%",
302
+ "6/100": "6%",
303
+ "7/100": "7%",
304
+ "8/100": "8%",
305
+ "9/100": "9%",
306
+ "10/100": "10%",
307
+ "11/100": "11%",
308
+ "12/100": "12%",
309
+ "13/100": "13%",
310
+ "14/100": "14%",
311
+ "15/100": "15%",
312
+ "16/100": "16%",
313
+ "17/100": "17%",
314
+ "18/100": "18%",
315
+ "19/100": "19%",
316
+ "20/100": "20%",
317
+ "21/100": "21%",
318
+ "22/100": "22%",
319
+ "23/100": "23%",
320
+ "24/100": "24%",
321
+ "25/100": "25%",
322
+ "26/100": "26%",
323
+ "27/100": "27%",
324
+ "28/100": "28%",
325
+ "29/100": "29%",
326
+ "30/100": "30%",
327
+ "31/100": "31%",
328
+ "32/100": "32%",
329
+ "33/100": "33%",
330
+ "34/100": "34%",
331
+ "35/100": "35%",
332
+ "36/100": "36%",
333
+ "37/100": "37%",
334
+ "38/100": "38%",
335
+ "39/100": "39%",
336
+ "40/100": "40%",
337
+ "41/100": "41%",
338
+ "42/100": "42%",
339
+ "43/100": "43%",
340
+ "44/100": "44%",
341
+ "45/100": "45%",
342
+ "46/100": "46%",
343
+ "47/100": "47%",
344
+ "48/100": "48%",
345
+ "49/100": "49%",
346
+ "50/100": "50%",
347
+ "51/100": "51%",
348
+ "52/100": "52%",
349
+ "53/100": "53%",
350
+ "54/100": "54%",
351
+ "55/100": "55%",
352
+ "56/100": "56%",
353
+ "57/100": "57%",
354
+ "58/100": "58%",
355
+ "59/100": "59%",
356
+ "60/100": "60%",
357
+ "61/100": "61%",
358
+ "62/100": "62%",
359
+ "63/100": "63%",
360
+ "64/100": "64%",
361
+ "65/100": "65%",
362
+ "66/100": "66%",
363
+ "67/100": "67%",
364
+ "68/100": "68%",
365
+ "69/100": "69%",
366
+ "70/100": "70%",
367
+ "71/100": "71%",
368
+ "72/100": "72%",
369
+ "73/100": "73%",
370
+ "74/100": "74%",
371
+ "75/100": "75%",
372
+ "76/100": "76%",
373
+ "77/100": "77%",
374
+ "78/100": "78%",
375
+ "79/100": "79%",
376
+ "80/100": "80%",
377
+ "81/100": "81%",
378
+ "82/100": "82%",
379
+ "83/100": "83%",
380
+ "84/100": "84%",
381
+ "85/100": "85%",
382
+ "86/100": "86%",
383
+ "87/100": "87%",
384
+ "88/100": "88%",
385
+ "89/100": "89%",
386
+ "90/100": "90%",
387
+ "91/100": "91%",
388
+ "92/100": "92%",
389
+ "93/100": "93%",
390
+ "94/100": "94%",
391
+ "95/100": "95%",
392
+ "96/100": "96%",
393
+ "97/100": "97%",
394
+ "98/100": "98%",
395
+ "99/100": "99%",
396
+ "100/100": "100%",
397
+ },
398
+ height: {
399
+ "4/7": "57.1428571%",
400
+ "3/7": "42.8571429%",
401
+ "5/12": "41.6666667%",
402
+ "1/10": "10%",
403
+ "3/10": "30%",
404
+ "4/10": "40%",
405
+ "6/10": "60%",
406
+ "7/10": "70%",
407
+ "9/10": "90%",
408
+ },
304
409
  },
305
410
  },
306
411
  safelist: [
package/version.txt CHANGED
@@ -1 +1 @@
1
- 1.0.2
1
+ 1.0.3
package/board/Board.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import { BoardProps } from "../interface/Board";
2
- export declare function Board({ children, widget, options }: BoardProps): import("react/jsx-runtime").JSX.Element;
package/board/Board.js DELETED
@@ -1,14 +0,0 @@
1
- import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useWidgetStore } from "../store";
3
- export function Board({ children, widget, options }) {
4
- const { events } = useWidgetStore();
5
- const { height } = options ?? {};
6
- const { widgets } = widget ?? {};
7
- const classNames = [
8
- `min-h-screen xl:min-h-0 xl:h-186 `,
9
- "xl:rounded-xl bg-white/80 relative w-full ",
10
- ].join(" ");
11
- return (_jsxs("div", { className: classNames + "", children: [children, widgets?.map(([widgetEvent, Component]) => {
12
- return events?.some(({ event }) => event === widgetEvent) ? (_jsx(_Fragment, { children: Component })) : null;
13
- })] }));
14
- }
@@ -1,2 +0,0 @@
1
- import { BoardProps } from "../interface/Board";
2
- export declare function CanvasBoard({ children, widget, options }: BoardProps): import("react/jsx-runtime").JSX.Element;
@@ -1,11 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from "../util";
3
- import { Board } from "./Board";
4
- export function CanvasBoard({ children, widget, options }) {
5
- const { height } = options ?? {};
6
- const layouts = "flex flex-col lg:flex-row lg:flex-wrap gap-7.5 ";
7
- const sizes = "h-full ";
8
- const paddings = "pb-36 xl:pb-12 px-2 xs:px-4 xl:pl-8 xl:pr-2 pt-2 xs:pt-4 xl:pt-8";
9
- const styles = "xl:overflow-y-scroll ";
10
- return (_jsx(Board, { widget: widget, options: { height }, children: _jsx("div", { className: cn(layouts, sizes, paddings, styles), children: children }) }));
11
- }
package/board/Header.d.ts DELETED
@@ -1,6 +0,0 @@
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;
package/board/Header.js DELETED
@@ -1,12 +0,0 @@
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
- }
@@ -1,7 +0,0 @@
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;
@@ -1,7 +0,0 @@
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/card/Card.js DELETED
@@ -1,34 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import "../globals.css";
3
- import { cn } from "../util";
4
- const widthSize = {
5
- xs: "md:w-60",
6
- sm: "md:w-90",
7
- md: "md:w-112.5",
8
- lg: "md:w-127.5",
9
- xl: "lg:w-187.5",
10
- "2xl": "lg:w-247.5",
11
- };
12
- const heightSize = {
13
- xs: "",
14
- sm: "h-72 sm:h-48",
15
- md: "h-72 sm:h-48",
16
- lg: "h-80",
17
- xl: "h-125",
18
- "2xl": "",
19
- };
20
- export function Card({ children, options }) {
21
- const { height, width, text, onClick } = options ?? {};
22
- const { size: textSize, color: textColor } = text ?? {};
23
- const sizes = [
24
- `${heightSize[height ?? "sm"]}`,
25
- `w-full ${widthSize[width ?? "sm"]}`,
26
- ].join(" ");
27
- const positions = "relative";
28
- const styles = [
29
- `${onClick ? "cursor-pointer" : ""}`,
30
- `text-${textSize ?? "base"}`,
31
- `rounded-xl bg-white/80 overflow-hidden box-shadow duration-500`,
32
- ].join(" ");
33
- return (_jsx("div", { onClick: onClick, className: cn(sizes, positions, styles), children: children }));
34
- }