@edu-tosel/design 1.0.17 → 1.0.19

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 (101) hide show
  1. package/board/template/CanvasBoard.js +4 -3
  2. package/board/template/ManageBoard.js +3 -4
  3. package/board/template/PaperBoard.js +1 -1
  4. package/card/index.d.ts +3 -5
  5. package/card/index.js +3 -5
  6. package/card/template/AddCard.js +1 -1
  7. package/card/template/ChartCard.js +2 -2
  8. package/card/template/InfoCard.d.ts +13 -20
  9. package/card/template/InfoCard.js +47 -40
  10. package/card/template/NavCard.d.ts +15 -0
  11. package/card/template/NavCard.js +44 -0
  12. package/card/template/TableCard.js +9 -17
  13. package/card/widget/{Card.js → Card.design.js} +12 -27
  14. package/card/{template → widget}/InfoCard.design.js +7 -7
  15. package/card/widget/NavCard.design.d.ts +2 -0
  16. package/card/widget/NavCard.design.js +32 -0
  17. package/globals.css +18 -2
  18. package/html/index.d.ts +2 -1
  19. package/html/index.js +2 -1
  20. package/html/template/Label.d.ts +8 -0
  21. package/html/template/Label.js +14 -0
  22. package/html/widget/DatePicker.js +1 -1
  23. package/html/widget/EmailInput.d.ts +2 -0
  24. package/html/widget/EmailInput.js +44 -0
  25. package/html/widget/Input.js +6 -4
  26. package/html/widget/Label.design.d.ts +2 -0
  27. package/html/widget/Label.design.js +36 -0
  28. package/html/widget/Select.js +5 -5
  29. package/html/widget/Toggle.d.ts +1 -1
  30. package/html/widget/Toggle.js +3 -2
  31. package/interaction/index.d.ts +2 -5
  32. package/interaction/index.js +2 -5
  33. package/interaction/template/Loading.d.ts +9 -0
  34. package/interaction/template/Loading.js +9 -0
  35. package/interaction/template/NoData.d.ts +5 -0
  36. package/interaction/template/NoData.js +9 -0
  37. package/interaction/widget/Jumper.design.d.ts +1 -0
  38. package/interaction/widget/{LoadingJumper.js → Jumper.design.js} +1 -1
  39. package/interaction/widget/Script.design.d.ts +3 -0
  40. package/interaction/widget/{NoData.js → Script.design.js} +2 -2
  41. package/interaction/widget/Spinner.design.d.ts +1 -0
  42. package/interaction/widget/{LoadingSpinner.js → Spinner.design.js} +1 -1
  43. package/interaction/widget/Worm.design.d.ts +1 -0
  44. package/interaction/widget/{LoadingWorm.js → Worm.design.js} +1 -1
  45. package/interface/Card.d.ts +48 -41
  46. package/interface/HTMLElement.d.ts +7 -3
  47. package/interface/Layout.d.ts +20 -0
  48. package/interface/Layout.js +1 -0
  49. package/interface/Property.d.ts +1 -1
  50. package/interface/Widget.d.ts +23 -0
  51. package/interface/index.d.ts +1 -0
  52. package/interface/index.js +1 -0
  53. package/layout/index.d.ts +3 -1
  54. package/layout/index.js +3 -1
  55. package/layout/template/DataField.d.ts +8 -0
  56. package/layout/template/DataField.js +16 -0
  57. package/layout/{widget → template}/Events.d.ts +1 -1
  58. package/layout/template/Gallery.js +2 -2
  59. package/layout/template/Row.d.ts +8 -0
  60. package/layout/template/Row.js +24 -0
  61. package/layout/template/Shelf.js +1 -1
  62. package/layout/template/dashboard/Header.d.ts +2 -4
  63. package/layout/template/dashboard/Header.js +7 -5
  64. package/layout/template/dashboard/index.d.ts +2 -6
  65. package/layout/template/dashboard/index.js +6 -6
  66. package/layout/widget/DataField.design.d.ts +2 -0
  67. package/{board/widget/DataField.js → layout/widget/DataField.design.js} +8 -8
  68. package/layout/widget/Row.design.d.ts +2 -0
  69. package/layout/widget/Row.design.js +16 -0
  70. package/overlay/template/Manage.js +1 -1
  71. package/package.json +1 -1
  72. package/tailwind.config.ts +15 -3
  73. package/version.txt +1 -1
  74. package/board/widget/DataField.d.ts +0 -7
  75. package/board/widget/Tags.d.ts +0 -14
  76. package/board/widget/Tags.js +0 -30
  77. package/card/template/ProfileCard.d.ts +0 -14
  78. package/card/template/ProfileCard.js +0 -8
  79. package/card/template/ReportCard.d.ts +0 -33
  80. package/card/template/ReportCard.js +0 -15
  81. package/card/template/RowCard.d.ts +0 -2
  82. package/card/template/RowCard.js +0 -24
  83. package/card/template/TrumpCard.d.ts +0 -2
  84. package/card/template/TrumpCard.js +0 -19
  85. package/html/widget/Button.d.ts +0 -2
  86. package/html/widget/Button.js +0 -15
  87. package/interaction/template/Exception.d.ts +0 -2
  88. package/interaction/template/Exception.js +0 -10
  89. package/interaction/widget/LoadingJumper.d.ts +0 -1
  90. package/interaction/widget/LoadingSpinner.d.ts +0 -1
  91. package/interaction/widget/LoadingWorm.d.ts +0 -1
  92. package/interaction/widget/NoData.d.ts +0 -1
  93. /package/board/widget/{Board.d.ts → Board.design.d.ts} +0 -0
  94. /package/board/widget/{Board.js → Board.design.js} +0 -0
  95. /package/card/widget/{Card.d.ts → Card.design.d.ts} +0 -0
  96. /package/card/{template → widget}/InfoCard.design.d.ts +0 -0
  97. /package/layout/{widget → template}/Events.js +0 -0
  98. /package/layout/widget/{Shelf.d.ts → Shelf.design.d.ts} +0 -0
  99. /package/layout/widget/{Shelf.js → Shelf.design.js} +0 -0
  100. /package/layout/widget/{Tab.d.ts → Tab.design.d.ts} +0 -0
  101. /package/layout/widget/{Tab.js → Tab.design.js} +0 -0
@@ -0,0 +1,44 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useId, useState } from "react";
3
+ import { cn } from "../../util";
4
+ const widthSize = {
5
+ xs: "w-28",
6
+ sm: "w-48",
7
+ md: "w-64",
8
+ lg: "w-96",
9
+ xl: "w-128",
10
+ "2xl": "w-144",
11
+ full: "w-full",
12
+ };
13
+ export default function EmailInput({ state, placeholder, options, }) {
14
+ const { width } = options ?? {};
15
+ const id = useId();
16
+ const [value, setValue] = state;
17
+ const [focused, setFocused] = useState(false);
18
+ const { text } = options ?? {};
19
+ const isValidEmail = (email) => {
20
+ return /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(email);
21
+ };
22
+ const emailCss = {
23
+ true: "rounded-md pl-4 pr-4 pt-2 pb-2 bg-slate-200 text-xs focus:outline-none focus:bg-white focus:text-black box-green-focus transition-all",
24
+ false: "rounded-md pl-4 pr-4 pt-2 pb-2 text-xs bg-[#F9E4E6] focus:outline-none text-[#FF8383] box-shadow-focus-red transition-all peer",
25
+ allTrue: "rounded-md pl-4 pr-4 pt-2 pb-2 bg-white text-xs focus:outline-none box-green focus:bg-white focus:text-black box-shadow-focus transition-all",
26
+ allTrueFocus: "rounded-md pl-4 pr-4 pt-2 pb-2 bg-white text-xs focus:outline-none transition-all box-green-focus",
27
+ };
28
+ const container = {
29
+ width: `${widthSize[width ?? "md"]} h-8`,
30
+ };
31
+ const handleBlur = () => {
32
+ setFocused(false);
33
+ };
34
+ const handleFocus = () => {
35
+ setFocused(true);
36
+ };
37
+ return (_jsxs("div", { className: "relative", children: [_jsx("input", { className: cn(container) +
38
+ " " +
39
+ (value === "" || isValidEmail(value)
40
+ ? emailCss.true
41
+ : emailCss.false) +
42
+ (isValidEmail(value) && !focused ? emailCss.allTrue : ""), id: id, type: "text", placeholder: placeholder ?? "E-mail을 입력해주세요.", onChange: (e) => setValue(e.target.value), onBlur: handleBlur, onFocus: handleFocus }), value === "" ||
43
+ (!isValidEmail(value) && (_jsx("div", { className: "absolute inset-y-0 right-0 flex items-center pr-3", children: _jsx("span", { className: "text-[#FF8383]", children: "!" }) }))), value.length > 5 && !isValidEmail(value) && (_jsx("div", { className: "absolute top-4 left-40 w-60 h-12 bg-black opacity-60 z-100 text-white p-2 text-xs rounded-md shadow-md invisible peer-hover:visible", children: text }))] }));
44
+ }
@@ -11,12 +11,14 @@ const widthSize = {
11
11
  full: "w-full",
12
12
  };
13
13
  export default function Input({ state, placeholder, options, }) {
14
- const [_, onChange] = state;
15
14
  const { width } = options ?? {};
16
15
  const id = useId();
16
+ const [value, setValue] = state;
17
17
  const container = {
18
- width: `${widthSize[width ?? "md"]} h-10`,
19
- styles: "rounded-full pl-4 border-4",
18
+ width: `${widthSize[width ?? "md"]} h-8`,
19
+ styles: "rounded-md pl-4 pr-4 pt-2 pb-2 bg-slate-200 text-xs",
20
+ pseudo: "focus:outline-none focus:bg-white focus:text-black box-shadow-focus",
21
+ effect: `transition-all`,
20
22
  };
21
- return (_jsx("input", { className: cn(container), id: id, type: "text", placeholder: placeholder ?? "", onChange: (e) => onChange(e.target.value) }));
23
+ return (_jsx("input", { className: cn(container), id: id, type: "text", placeholder: placeholder ?? "ID를 입력해주세요", onChange: (e) => setValue(e.target.value) }));
22
24
  }
@@ -0,0 +1,2 @@
1
+ import { HTMLLabelElement } from "../../interface";
2
+ export default function LabelDesign({ title, onClick, options, }: HTMLLabelElement): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,36 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { cn } from "../../util";
4
+ const widthSize = {
5
+ sm: "w-22.5",
6
+ md: "w-45",
7
+ lg: "w-50",
8
+ };
9
+ const heightSize = {
10
+ xs: "h-6.25",
11
+ sm: "h-11.25",
12
+ };
13
+ export default function LabelDesign({ title, onClick, options, }) {
14
+ const [hover, setHover] = useState(false);
15
+ const { width, height, text, background, className, disabled } = options ?? {};
16
+ const container = {
17
+ positions: "relative z-10",
18
+ sizes: `${widthSize[width ?? "sm"]} ${heightSize[height ?? "xs"]}`,
19
+ };
20
+ const body = {
21
+ positions: "absolute top-0 left-0",
22
+ displays: "flex justify-center items-center",
23
+ sizes: "w-full h-full",
24
+ clickable: onClick && "cursor-pointer",
25
+ background: background ?? "bg-gray-light",
26
+ texts: text ?? "text-gray-dim",
27
+ animation: "duration-500",
28
+ styles: height !== "xs" ? "rounded-xl" : "rounded-md text-xs",
29
+ };
30
+ const obstacle = {
31
+ positions: "absolute",
32
+ sizes: "w-full h-full",
33
+ background: "bg-white/80 rounded-xl",
34
+ };
35
+ return (_jsx("div", { className: className, children: _jsxs("div", { className: cn(container), children: [_jsx("div", { className: cn(body), onClick: onClick, onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false), children: title }), disabled && (_jsx("div", { onClick: typeof disabled === "function" ? disabled : undefined, className: cn(obstacle) }))] }) }));
36
+ }
@@ -64,28 +64,28 @@ export default function Select({ state, selectOptions, options, }) {
64
64
  const { width } = options ?? {};
65
65
  const dropdown = {
66
66
  size: `w-40 h-6`,
67
- styles: "cursor-pointer pt-4 pb-4 pl-4 pr-4 font-bold text-sm bg-white",
67
+ styles: "cursor-pointer pt-4 pb-4 pl-2 pr-4 font-bold text-xs bg-white",
68
68
  display: `flex items-center`,
69
69
  hover: `hover:rounded-md`,
70
70
  effect: `transition-all`,
71
71
  function: `${isActiveCss()}`,
72
- etc: "asdfasdf",
72
+ etc: "box-inner-shadow",
73
73
  };
74
74
  const dropdownInput = {
75
75
  size: `w-40 h-6 `,
76
- styles: "shadow-md text-sm p-4 font-bold bg-white text-left cursor-text border-1 rounded-md ",
76
+ styles: "shadow-md text-xs pt-4 pb-4 pl-2 pr-4 font-bold bg-white text-left cursor-text border-1 rounded-md ",
77
77
  display: "absolute top-12 flex items-center z-10 ",
78
78
  focus: "focus:outline-none focus:border-[#44C5F3] focus:border-1 ",
79
79
  };
80
80
  const dropdownContent = {
81
81
  size: `w-40 min-h-6 max-h-48 overflow-y-auto `,
82
- styles: `text-sm mt-1 border-1 rounded-md shadow-md`,
82
+ styles: `text-xs mt-1 border-1 rounded-md shadow-md`,
83
83
  display: `absolute z-40`,
84
84
  function: `${dropdownTop}`,
85
85
  };
86
86
  const dropdownItem = {
87
87
  size: `${widthSize[width ?? "full"]} h-6 `,
88
- styles: `text-sm text-left p-4 font-bold cursor-pointer `,
88
+ styles: `text-xs text-left pt-4 pb-4 pl-2 pr-4 font-bold cursor-pointer `,
89
89
  display: `flex items-center z-40`,
90
90
  hover: `hover:bg-slate-200 `,
91
91
  effect: `transition-all `,
@@ -1,2 +1,2 @@
1
1
  import { HTMLToggleElement } from "../../interface";
2
- export default function Toggle({ state: [chekced, setChecked], isDisabled, labels, }: HTMLToggleElement): import("react/jsx-runtime").JSX.Element;
2
+ export default function Toggle({ state: [chekced, setChecked], labels, options, }: HTMLToggleElement): import("react/jsx-runtime").JSX.Element;
@@ -8,6 +8,7 @@ const widthSize = {
8
8
  "2xl": "w-144",
9
9
  full: "w-full",
10
10
  };
11
- export default function Toggle({ state: [chekced, setChecked], isDisabled, labels, }) {
12
- return (_jsxs("div", { className: "w-24 h-6 flex", children: [_jsx("label", { htmlFor: "", className: "inline-flex items-center gap-2 ", children: _jsx("input", { disabled: isDisabled, type: "checkbox", className: "bg-red-crimson appearance-none relative rounded-full w-10 h-5 cursor-pointer", checked: chekced, onChange: (e) => setChecked(e.target.checked) }) }), _jsx("div", { className: "ml-2 transition-all", children: labels.map(([status, label]) => (status === chekced ? label : "")) })] }));
11
+ export default function Toggle({ state: [chekced, setChecked], labels, options, }) {
12
+ const { disabled } = options ?? {};
13
+ return (_jsxs("div", { className: "w-24 h-6 flex", children: [_jsx("label", { htmlFor: "", className: "inline-flex items-center gap-2 ", children: _jsx("input", { disabled: typeof disabled === "boolean" && disabled, type: "checkbox", className: "bg-red-crimson appearance-none relative rounded-full w-10 h-5 cursor-pointer", checked: chekced, onChange: (e) => setChecked(e.target.checked) }) }), _jsx("div", { className: "ml-2 transition-all", children: labels.map(([status, label]) => (status === chekced ? label : "")) })] }));
13
14
  }
@@ -1,5 +1,2 @@
1
- export { default as Exception } from "./template/Exception";
2
- export { default as LoadingSpinner } from "./widget/LoadingSpinner";
3
- export { default as LoadingJumper } from "./widget/LoadingJumper";
4
- export { default as LoadingWorm } from "./widget/LoadingWorm";
5
- export { default as NoData } from "./widget/NoData";
1
+ export { default as Loading } from "./template/Loading";
2
+ export { default as NoData } from "./template/NoData";
@@ -1,5 +1,2 @@
1
- export { default as Exception } from "./template/Exception";
2
- export { default as LoadingSpinner } from "./widget/LoadingSpinner";
3
- export { default as LoadingJumper } from "./widget/LoadingJumper";
4
- export { default as LoadingWorm } from "./widget/LoadingWorm";
5
- export { default as NoData } from "./widget/NoData";
1
+ export { default as Loading } from "./template/Loading";
2
+ export { default as NoData } from "./template/NoData";
@@ -0,0 +1,9 @@
1
+ import Jumper from "../widget/Jumper.design";
2
+ import Spinner from "../widget/Spinner.design";
3
+ import Worm from "../widget/Worm.design";
4
+ declare const Loading: {
5
+ Jumper: typeof Jumper;
6
+ Spinner: typeof Spinner;
7
+ Worm: typeof Worm;
8
+ };
9
+ export default Loading;
@@ -0,0 +1,9 @@
1
+ import Jumper from "../widget/Jumper.design";
2
+ import Spinner from "../widget/Spinner.design";
3
+ import Worm from "../widget/Worm.design";
4
+ const Loading = {
5
+ Jumper,
6
+ Spinner,
7
+ Worm,
8
+ };
9
+ export default Loading;
@@ -0,0 +1,5 @@
1
+ declare function Script(): import("react/jsx-runtime").JSX.Element;
2
+ declare const NoData: {
3
+ Script: typeof Script;
4
+ };
5
+ export default NoData;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import ScriptDesign from "../widget/Script.design";
3
+ function Script() {
4
+ return _jsx(ScriptDesign, { script: "No Data" });
5
+ }
6
+ const NoData = {
7
+ Script,
8
+ };
9
+ export default NoData;
@@ -0,0 +1 @@
1
+ export default function Jumper(): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- export default function LoadingJumper() {
2
+ export default function Jumper() {
3
3
  return (_jsxs("div", { className: "w-full h-full flex items-center justify-center mt-10", children: [_jsx("div", { className: "w-6 h-6 mx-2 bg-gradient-to-br from-[#9979F6] to-[#44C5F3] opacity-40 rounded-full animate-bounce" }), _jsx("div", { className: "w-6 h-6 mx-2 bg-gradient-to-br from-[#9979F6] to-[#44C5F3] opacity-40 rounded-full animate-bounce delay-100" }), _jsx("div", { className: "w-6 h-6 mx-2 bg-gradient-to-br from-[#9979F6] to-[#44C5F3] opacity-40 rounded-full animate-bounce delay-200" })] }));
4
4
  }
@@ -0,0 +1,3 @@
1
+ export default function Script({ script }: {
2
+ script: string;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- export default function NoData() {
3
- return (_jsx("div", { className: "w-full h-full flex items-center justify-center", children: "NoData" }));
2
+ export default function Script({ script }) {
3
+ return (_jsx("div", { className: "w-full h-full flex items-center justify-center", children: script }));
4
4
  }
@@ -0,0 +1 @@
1
+ export default function Spinner(): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  // NOTE: This is Prototype code and should be replaced with a proper loading spinner
3
- export default function LoadingSpinner() {
3
+ export default function Spinner() {
4
4
  return (_jsx("div", { className: "w-full h-full flex items-center justify-center", children: _jsx("div", { className: "w-30 h-30", children: _jsxs("svg", { "aria-hidden": "true", className: "inline w-20 h-20 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600", viewBox: "0 0 100 101", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z", fill: "currentColor" }), _jsx("path", { d: "M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z", fill: "currentFill" })] }) }) }));
5
5
  }
@@ -0,0 +1 @@
1
+ export default function Worm(): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { cn, gradient, useEase } from "../../util";
3
- export default function LoadingWorm() {
3
+ export default function Worm() {
4
4
  const numbers = [-2, -1, 0, 1, 2];
5
5
  const ease = useEase(1000, 500);
6
6
  return (_jsx("div", { className: "w-full h-full flex justify-center items-center", children: _jsx("div", { className: "relative w-25 h-20 ", children: numbers.map((number) => (_jsx(SubComponent, { index: number, ease: ease }, number))) }) }));
@@ -5,31 +5,14 @@ interface CardOptions {
5
5
  rounded?: string;
6
6
  height?: Size;
7
7
  width?: Size;
8
- background?: {
9
- color?: string;
10
- };
11
- text?: {
12
- size?: string;
13
- color?: string;
14
- };
15
- border?: {
16
- color?: string;
17
- };
18
- onClick?: () => unknown | (() => Promise<unknown>);
8
+ background?: string;
9
+ text?: string;
10
+ border?: string;
11
+ onClick?: OnClick;
19
12
  overflow?: "hiden" | "y-scroll" | "auto";
13
+ noPadding?: boolean;
14
+ noShadow?: boolean;
20
15
  }
21
- /**
22
- * CardProps is an interface.
23
- * @interface CardProps
24
- * @property {React.ReactNode} children
25
- * @property {object} options
26
- * @property {Size} options.height
27
- * @property {Size} options.width
28
- * @property {object} options.text
29
- * @property {string} options.text.size
30
- * @property {string} options.text.color
31
- * @property {() => unknown | (() => Promise<unknown>)} options.onClick
32
- */
33
16
  export interface CardProps {
34
17
  children: React.ReactNode;
35
18
  header?: React.ReactNode;
@@ -57,44 +40,68 @@ export interface ChartCardProps extends Omit<CardProps, "children"> {
57
40
  score: number;
58
41
  };
59
42
  }
60
- export interface TableCardProps<T> extends Omit<CardProps, "children"> {
61
- dataSets: T[];
62
- dataField: {
63
- [p in keyof T]: Partial<DataField>;
64
- };
65
- options?: CardOptions;
43
+ interface ButtonInLay {
44
+ title: string;
45
+ onClick: OnClick;
46
+ disabled?: boolean | OnClick;
47
+ width?: Size;
48
+ height?: Size;
49
+ background?: string;
50
+ text?: string;
66
51
  }
67
- export interface TrumpCardProps {
52
+ export interface NavCardProps extends Omit<CardProps, "children"> {
68
53
  titles: Titles;
69
- options?: {
70
- width?: Size;
54
+ options?: CardOptions & {
55
+ buttonInLay?: ButtonInLay;
71
56
  image?: {
72
57
  path: string;
73
58
  size?: ImageSize;
74
59
  };
75
- onClick?: () => unknown | (() => Promise<unknown>);
76
- subButton?: [string, string, () => unknown | (() => Promise<unknown>)];
77
60
  };
78
61
  }
62
+ export interface NavCardBannerProps extends NavCardProps {
63
+ }
64
+ export interface NavCardButtonProps extends NavCardProps {
65
+ onClick: OnClick;
66
+ }
67
+ export interface NavCardButtonInLayProps extends NavCardProps {
68
+ buttonInLay: ButtonInLay;
69
+ }
79
70
  export interface InfoCardProps extends CardProps {
80
71
  titles: Titles;
81
72
  button?: Button;
82
73
  options?: {
83
- titleBorderColor?: string;
84
- rightTextColor?: string;
85
- buttonBackgroundColor?: string;
74
+ titleBorder?: string;
86
75
  } & CardOptions;
87
76
  }
77
+ export interface InfoCardExamProps extends Omit<InfoCardProps, "children"> {
78
+ data: {
79
+ status: string;
80
+ examDate: string;
81
+ endDate: string;
82
+ manager: string;
83
+ isPublic: boolean;
84
+ };
85
+ }
86
+ export interface InfoCardProductProps extends Omit<InfoCardProps, "children"> {
87
+ data: {
88
+ date?: string;
89
+ status?: string;
90
+ receiver?: string | null;
91
+ requester?: string | null;
92
+ button?: Button;
93
+ };
94
+ }
88
95
  export interface AddCardProps extends Omit<CardProps, "children"> {
89
96
  title?: string;
90
97
  icon?: string;
91
98
  onClick: OnClick;
92
99
  }
93
- export interface RowCardProps<T> {
94
- onClick?: OnClick;
95
- dataSet: T;
96
- dataField?: {
100
+ export interface TableCardProps<T> extends Omit<CardProps, "children"> {
101
+ dataSets: T[];
102
+ dataField: {
97
103
  [p in keyof T]?: Partial<DataField>;
98
104
  };
105
+ options?: CardOptions;
99
106
  }
100
107
  export {};
@@ -9,12 +9,17 @@ export declare const HTMLElementType: {
9
9
  export type HTMLElementType = (typeof HTMLElementType)[keyof typeof HTMLElementType];
10
10
  export interface HTMLElement {
11
11
  options?: {
12
+ className?: string;
12
13
  width?: Size;
14
+ height?: Size;
15
+ background?: string;
16
+ text?: string;
17
+ disabled?: boolean | OnClick;
13
18
  };
14
19
  }
15
- export interface HTMLButtonElement extends HTMLElement {
20
+ export interface HTMLLabelElement extends HTMLElement {
16
21
  title: string;
17
- onClick: OnClick;
22
+ onClick?: OnClick;
18
23
  }
19
24
  export interface HTMLSelectElement extends HTMLElement {
20
25
  state: State<string>;
@@ -27,5 +32,4 @@ export interface HTMLInputElement extends HTMLElement {
27
32
  export interface HTMLToggleElement extends HTMLElement {
28
33
  state: State<boolean>;
29
34
  labels: [[true, string], [false, string]];
30
- isDisabled?: boolean;
31
35
  }
@@ -0,0 +1,20 @@
1
+ export interface DashboardHeaderProps {
2
+ title: string;
3
+ logo: {
4
+ image: string;
5
+ href?: string;
6
+ };
7
+ options?: {
8
+ background?: string;
9
+ text?: string;
10
+ className?: string;
11
+ };
12
+ }
13
+ export interface DashboardProps {
14
+ header: DashboardHeaderProps;
15
+ navigations: React.ReactNode[];
16
+ children: React.ReactNode;
17
+ options?: {
18
+ background?: string;
19
+ };
20
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -24,6 +24,7 @@ export type State<T> = [T, StateAction<T>];
24
24
  * @property {"2xl"} 2xl - Double extra large size
25
25
  * @property {"full"} full - Full size
26
26
  */
27
+ export type ImageSize = "sub" | "full";
27
28
  export type Size = "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "auto";
28
29
  /**
29
30
  * Image size type
@@ -33,7 +34,6 @@ export type Size = "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "auto";
33
34
  * @property {"sub"} sub - Sub size
34
35
  * @property {"full"} full - Full size
35
36
  */
36
- export type ImageSize = "sub" | "full";
37
37
  export type OnClick = () => unknown | (() => Promise<unknown>);
38
38
  export type Button = [string, OnClick];
39
39
  export type Scripts = {
@@ -1,3 +1,4 @@
1
+ import { DataField, OnClick } from "./Property";
1
2
  export interface WidgetEvent {
2
3
  event: string;
3
4
  type: "view" | "modal";
@@ -20,4 +21,26 @@ export interface EventsProps {
20
21
  replaces?: Event<boolean | string | null | undefined>[];
21
22
  shows?: Event<boolean | string>[];
22
23
  }
24
+ export interface DataFieldProps<T> {
25
+ id: string;
26
+ dataField: {
27
+ [p in keyof T]?: Partial<DataField>;
28
+ };
29
+ options?: {
30
+ position?: string;
31
+ padding?: string;
32
+ };
33
+ }
34
+ export interface RowProps<T> {
35
+ onClick?: OnClick;
36
+ dataSet: T;
37
+ dataField?: {
38
+ [p in keyof T]?: Partial<DataField>;
39
+ };
40
+ options?: {
41
+ size?: string;
42
+ padding?: string;
43
+ text?: string;
44
+ };
45
+ }
23
46
  export {};
@@ -1,5 +1,6 @@
1
1
  export * from "./Card";
2
2
  export * from "./HTMLElement";
3
+ export * from "./Layout";
3
4
  export * from "./Overlay";
4
5
  export * from "./Property";
5
6
  export * from "./Shelf";
@@ -1,5 +1,6 @@
1
1
  export * from "./Card";
2
2
  export * from "./HTMLElement";
3
+ export * from "./Layout";
3
4
  export * from "./Overlay";
4
5
  export * from "./Property";
5
6
  export * from "./Shelf";
package/layout/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
- export { default as Events } from "./widget/Events";
1
+ export { default as Events } from "./template/Events";
2
2
  export { default as Dashboard } from "./template/dashboard";
3
+ export { default as DataField } from "./template/DataField";
3
4
  export { default as Gallery } from "./template/Gallery";
5
+ export { default as Row } from "./template/Row";
4
6
  export { default as Shelf } from "./template/Shelf";
package/layout/index.js CHANGED
@@ -1,4 +1,6 @@
1
- export { default as Events } from "./widget/Events";
1
+ export { default as Events } from "./template/Events";
2
2
  export { default as Dashboard } from "./template/dashboard";
3
+ export { default as DataField } from "./template/DataField";
3
4
  export { default as Gallery } from "./template/Gallery";
5
+ export { default as Row } from "./template/Row";
4
6
  export { default as Shelf } from "./template/Shelf";
@@ -0,0 +1,8 @@
1
+ import { DataFieldProps } from "../../interface";
2
+ declare function Board<T>({ id, dataField }: DataFieldProps<T>): import("react/jsx-runtime").JSX.Element;
3
+ declare function Card<T>({ id, dataField }: DataFieldProps<T>): import("react/jsx-runtime").JSX.Element;
4
+ declare const DataField: {
5
+ Board: typeof Board;
6
+ Card: typeof Card;
7
+ };
8
+ export default DataField;
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import DataFieldDesign from "../widget/DataField.design";
3
+ function Board({ id, dataField }) {
4
+ return (_jsx(DataFieldDesign, { id: id, dataField: dataField, options: {
5
+ position: "fixed top-34 xl:top-0 left-0 xl:relative z-20",
6
+ padding: "px-2 xs:px-4 xl:px-7.5",
7
+ } }));
8
+ }
9
+ function Card({ id, dataField }) {
10
+ return (_jsx(DataFieldDesign, { id: id, dataField: dataField, options: { padding: "px-2 xs:px-4 xl:px-7.5" } }));
11
+ }
12
+ const DataField = {
13
+ Board,
14
+ Card,
15
+ };
16
+ export default DataField;
@@ -1,4 +1,4 @@
1
- import { ReplaceProps, ShowProps } from "./../../interface/Widget";
1
+ import { ReplaceProps, ShowProps } from "../../interface/Widget";
2
2
  declare function Show({ widgets, children }: ShowProps): import("react/jsx-runtime").JSX.Element;
3
3
  declare function Replace({ widgets, children }: ReplaceProps): import("react/jsx-runtime").JSX.Element;
4
4
  declare const Events: {
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import Events from "../widget/Events";
3
- import Tab from "../widget/Tab";
2
+ import Events from "./Events";
3
+ import Tab from "../widget/Tab.design";
4
4
  export default function Gallery({ widgets, children, }) {
5
5
  return (_jsxs("div", { className: "relative w-full flex", children: [_jsx(Events.Replace, { widgets: widgets?.replaces, children: _jsx(Events.Show, { widgets: widgets?.shows, children: children }) }), widgets?.tabs && _jsx(Tab, { tabs: widgets?.tabs })] }));
6
6
  }
@@ -0,0 +1,8 @@
1
+ import { RowProps } from "../../interface";
2
+ declare function Board<T extends Record<string, any>>({ dataSet, dataField, onClick, }: RowProps<T>): import("react/jsx-runtime").JSX.Element;
3
+ declare function Card<T extends Record<string, any>>({ dataSet, dataField, onClick, }: RowProps<T>): import("react/jsx-runtime").JSX.Element;
4
+ declare const Row: {
5
+ Board: typeof Board;
6
+ Card: typeof Card;
7
+ };
8
+ export default Row;
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useId } from "react";
3
+ import RowDesign from "../widget/Row.design";
4
+ function Board({ dataSet, dataField, onClick, }) {
5
+ const id = useId();
6
+ return (_jsx(RowDesign, { onClick: onClick, dataSet: dataSet, dataField: dataField, options: {
7
+ size: "w-full h-12",
8
+ padding: "px-2 xs:px-4 xl:px-7.5",
9
+ text: "text-xl",
10
+ } }, id));
11
+ }
12
+ function Card({ dataSet, dataField, onClick, }) {
13
+ const id = useId();
14
+ return (_jsx(RowDesign, { onClick: onClick, dataSet: dataSet, dataField: dataField, options: {
15
+ size: "w-full h-10",
16
+ padding: "px-2 xs:px-4 xl:px-7.5",
17
+ text: "text-base",
18
+ } }, id));
19
+ }
20
+ const Row = {
21
+ Board,
22
+ Card,
23
+ };
24
+ export default Row;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { cn } from "../../util";
3
- import ShelfDesign from "../widget/Shelf";
3
+ import ShelfDesign from "../widget/Shelf.design";
4
4
  function Shelf({ titles, debug, children }) {
5
5
  const container = {
6
6
  displays: "inline-flex flex-col gap-12 w-full",
@@ -1,4 +1,2 @@
1
- export declare function Header({ title, image, }: {
2
- title: string;
3
- image?: [string, string];
4
- }): import("react/jsx-runtime").JSX.Element;
1
+ import { DashboardHeaderProps } from "../../../interface";
2
+ export declare function Header({ title, logo, options }: DashboardHeaderProps): import("react/jsx-runtime").JSX.Element;