@edu-tosel/design 1.0.13 → 1.0.15

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 (158) hide show
  1. package/asset/fonts/TimesNewerRoman-Bold.otf +0 -0
  2. package/asset/fonts/TimesNewerRoman-BoldItalic.otf +0 -0
  3. package/board/template/CanvasBoard.d.ts +1 -1
  4. package/board/template/CanvasBoard.js +3 -3
  5. package/board/template/ManageBoard.d.ts +3 -3
  6. package/board/template/ManageBoard.js +17 -21
  7. package/board/template/PaperBoard.d.ts +1 -1
  8. package/board/template/PaperBoard.js +4 -4
  9. package/board/widget/Board.js +12 -18
  10. package/board/widget/DataField.d.ts +4 -3
  11. package/board/widget/DataField.js +19 -13
  12. package/board/widget/Header.d.ts +1 -1
  13. package/board/widget/Header.js +11 -9
  14. package/board/widget/Tags.d.ts +14 -3
  15. package/card/index.d.ts +1 -0
  16. package/card/index.js +1 -0
  17. package/card/template/AddCard.d.ts +2 -0
  18. package/card/template/AddCard.js +11 -0
  19. package/card/template/ChartCard.js +1 -1
  20. package/card/template/InfoCard.d.ts +32 -2
  21. package/card/template/InfoCard.design.d.ts +2 -0
  22. package/card/template/InfoCard.design.js +23 -0
  23. package/card/template/InfoCard.js +72 -8
  24. package/card/template/ReportCard.d.ts +1 -1
  25. package/card/template/ReportCard.js +3 -11
  26. package/card/template/RowCard.d.ts +2 -5
  27. package/card/template/RowCard.js +16 -18
  28. package/card/template/TableCard.d.ts +4 -2
  29. package/card/template/TableCard.js +22 -9
  30. package/card/template/TrumpCard.js +2 -2
  31. package/card/widget/Card.d.ts +1 -1
  32. package/card/widget/Card.js +40 -13
  33. package/deck/index.d.ts +1 -1
  34. package/deck/index.js +1 -1
  35. package/deck/template/Deck.d.ts +6 -0
  36. package/deck/template/Deck.design.d.ts +2 -0
  37. package/deck/template/Deck.design.js +21 -0
  38. package/deck/template/Deck.js +11 -0
  39. package/deck/widget/Deck.d.ts +2 -0
  40. package/deck/widget/Deck.js +14 -0
  41. package/globals.css +119 -1
  42. package/html/index.d.ts +4 -0
  43. package/html/index.js +4 -0
  44. package/html/widget/Button.d.ts +2 -0
  45. package/html/widget/Button.js +15 -0
  46. package/html/widget/DatePicker.d.ts +3 -0
  47. package/html/widget/DatePicker.js +23 -0
  48. package/html/widget/Input.d.ts +2 -0
  49. package/html/widget/Input.js +22 -0
  50. package/html/widget/Select.d.ts +2 -0
  51. package/html/widget/Select.js +160 -0
  52. package/html/widget/Toggle.d.ts +2 -0
  53. package/html/widget/Toggle.js +13 -0
  54. package/index.d.ts +2 -2
  55. package/index.js +2 -2
  56. package/interface/Board.d.ts +16 -19
  57. package/interface/Card.d.ts +47 -37
  58. package/{deck → interface}/Deck.d.ts +4 -7
  59. package/interface/HTMLElement.d.ts +22 -14
  60. package/interface/HTMLElement.js +7 -1
  61. package/interface/Modal.d.ts +6 -1
  62. package/interface/Overlay.d.ts +20 -0
  63. package/interface/Overlay.js +1 -0
  64. package/interface/Property.d.ts +12 -1
  65. package/interface/Shelf.d.ts +22 -0
  66. package/interface/Shelf.js +1 -0
  67. package/interface/Widget.d.ts +19 -0
  68. package/interface/index.d.ts +3 -0
  69. package/interface/index.js +3 -0
  70. package/layout/index.d.ts +4 -1
  71. package/layout/index.js +4 -1
  72. package/layout/template/Gallery.d.ts +7 -0
  73. package/layout/template/Gallery.js +6 -0
  74. package/layout/template/Shelf.d.ts +8 -0
  75. package/layout/template/Shelf.js +41 -0
  76. package/layout/{dashboard → template/dashboard}/Header.d.ts +0 -1
  77. package/layout/template/dashboard/Header.js +17 -0
  78. package/layout/{dashboard → template/dashboard}/index.d.ts +5 -1
  79. package/layout/template/dashboard/index.js +33 -0
  80. package/layout/template/report/Header.js +11 -0
  81. package/layout/widget/Events.d.ts +8 -0
  82. package/layout/widget/Events.js +44 -0
  83. package/layout/widget/Shelf.d.ts +2 -0
  84. package/layout/widget/Shelf.js +25 -0
  85. package/{board → layout}/widget/Tab.js +6 -8
  86. package/modal/index.d.ts +1 -3
  87. package/modal/index.js +1 -3
  88. package/modal/template/Alert.d.ts +2 -0
  89. package/modal/template/Alert.js +8 -0
  90. package/modal/template/Input.d.ts +6 -0
  91. package/modal/template/Input.js +6 -0
  92. package/modal/template/index.d.ts +7 -0
  93. package/modal/template/index.js +7 -0
  94. package/modal/widget/Modal.design.d.ts +2 -0
  95. package/modal/widget/Modal.design.js +64 -0
  96. package/navigation/Navigation.d.ts +1 -1
  97. package/navigation/Navigation.js +21 -17
  98. package/overlay/index.d.ts +1 -0
  99. package/overlay/index.js +1 -0
  100. package/overlay/template/Info.d.ts +2 -0
  101. package/overlay/template/Info.js +5 -0
  102. package/overlay/template/Manage.d.ts +2 -0
  103. package/overlay/template/Manage.js +17 -0
  104. package/overlay/template/index.d.ts +7 -0
  105. package/overlay/template/index.js +7 -0
  106. package/overlay/widget/Overlay.design.d.ts +2 -0
  107. package/overlay/widget/Overlay.design.js +25 -0
  108. package/package.json +6 -2
  109. package/store/index.d.ts +10 -3
  110. package/store/index.js +38 -11
  111. package/tailwind.config.ts +56 -0
  112. package/text/Formatter.d.ts +3 -0
  113. package/text/Formatter.js +18 -0
  114. package/text/index.d.ts +1 -0
  115. package/text/index.js +1 -0
  116. package/util/checkPathMatch.d.ts +2 -0
  117. package/util/checkPathMatch.js +8 -0
  118. package/util/colors.d.ts +2 -1
  119. package/util/colors.js +2 -1
  120. package/util/convertUnixTimestampToDate.d.ts +1 -0
  121. package/util/convertUnixTimestampToDate.js +5 -0
  122. package/util/index.d.ts +3 -0
  123. package/util/index.js +3 -0
  124. package/util/isDebug.d.ts +1 -0
  125. package/util/isDebug.js +5 -0
  126. package/util/sortByOrder.d.ts +4 -0
  127. package/util/sortByOrder.js +20 -0
  128. package/version.txt +1 -1
  129. package/card/template/InfoCardCssCase.d.ts +0 -25
  130. package/card/template/InfoCardCssCase.js +0 -32
  131. package/card/template/PropfileCard.d.ts +0 -2
  132. package/card/template/PropfileCard.js +0 -6
  133. package/deck/Deck.js +0 -22
  134. package/interface/Menu.d.ts +0 -6
  135. package/layout/dashboard/Header.js +0 -19
  136. package/layout/dashboard/index.js +0 -10
  137. package/layout/report/Header.js +0 -11
  138. package/menu/index.d.ts +0 -1
  139. package/menu/index.js +0 -1
  140. package/menu/template/SideMenu.d.ts +0 -2
  141. package/menu/template/SideMenu.js +0 -20
  142. package/menu/widget/HTMLElement.d.ts +0 -8
  143. package/menu/widget/HTMLElement.js +0 -9
  144. package/modal/AlertModal.d.ts +0 -2
  145. package/modal/AlertModal.js +0 -8
  146. package/modal/ControllerModal.d.ts +0 -6
  147. package/modal/ControllerModal.js +0 -6
  148. package/modal/Modal.d.ts +0 -2
  149. package/modal/Modal.js +0 -31
  150. package/modal/TestModal.d.ts +0 -7
  151. package/modal/TestModal.js +0 -6
  152. package/shelf/Shelf.d.ts +0 -3
  153. package/shelf/Shelf.js +0 -4
  154. package/shelf/index.d.ts +0 -1
  155. package/shelf/index.js +0 -1
  156. /package/interface/{Menu.js → Deck.js} +0 -0
  157. /package/layout/{report → template/report}/Header.d.ts +0 -0
  158. /package/{board → layout}/widget/Tab.d.ts +0 -0
@@ -4,16 +4,14 @@ import { cn } from "../../util";
4
4
  export default function Tab({ tabs }) {
5
5
  const [tabsSelection, setTabsSelection] = useState(tabs.map((_, i) => i === 0));
6
6
  const container = {
7
- positions: "xl:absolute xl:-bottom-14 xl:left-0 z-5",
8
- displays: "hidden xl:flex xl:items-end xl:gap-4",
9
- sizes: "xl:h-16",
10
- paddings: "xl:px-8 xl:pb-2 ",
11
- styles: "bg-white/50 rounded-b-xl ",
7
+ positions: "xl:absolute xl:-bottom-18 xl:left-0 z-5",
8
+ displays: "hidden xl:flex xl:items-center xl:gap-2.5",
9
+ sizes: "xl:h-14.5",
10
+ paddings: "px-2.5",
11
+ styles: "bg-white/30 rounded-xl ",
12
12
  };
13
13
  return (_jsx("div", { className: cn(container), children: tabs.map(([title, onClick], index) => (_jsx("button", { onClick: () => {
14
14
  setTabsSelection(tabsSelection.map((_, i) => i === index));
15
15
  return onClick();
16
- }, className: `h-9 w-32 rounded-md ${tabsSelection[index]
17
- ? "border-4 border-blue-500"
18
- : "border-4 border-red-500"}`, children: title }, title))) }));
16
+ }, className: `text-green-dark duration-500 h-9 w-32 rounded-md ${tabsSelection[index] && "bg-white rounded-2xl"}`, children: title }, title))) }));
19
17
  }
package/modal/index.d.ts CHANGED
@@ -1,3 +1 @@
1
- export { default as TestModal } from "./TestModal";
2
- export { default as AlertModal } from "./AlertModal";
3
- export { default as ControllerModal } from "./ControllerModal";
1
+ export { default as Modal } from "./template";
package/modal/index.js CHANGED
@@ -1,3 +1 @@
1
- export { default as TestModal } from "./TestModal";
2
- export { default as AlertModal } from "./AlertModal";
3
- export { default as ControllerModal } from "./ControllerModal";
1
+ export { default as Modal } from "./template";
@@ -0,0 +1,2 @@
1
+ import { AlertModalProps } from "../../interface/Modal";
2
+ export default function Alert({ isVisible, title, scripts, options, }: AlertModalProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { col } from "../../util";
3
+ import ModalDesign from "../widget/Modal.design";
4
+ export default function Alert({ isVisible, title, scripts, options, }) {
5
+ const { script, subScript } = scripts ?? {};
6
+ const { buttons } = options ?? {};
7
+ return (_jsx(ModalDesign, { isVisible: isVisible, classNames: "pt-18 px-25", options: { buttons, isCloseButton: true }, children: _jsx("div", { className: col(3), children: _jsxs("div", { className: col(6), children: [_jsx("div", { className: "text-3xl font-bold", children: title }), _jsx("div", { className: "h-2 w-14 rounded-full bg-pale-lavender" }), _jsx("div", { className: "text-xl font-bold", children: script })] }) }) }));
8
+ }
@@ -0,0 +1,6 @@
1
+ import { State } from "../../interface";
2
+ import { ModalProps } from "../../interface/Modal";
3
+ export default function Input<T>({ isVisible, title, options, state, }: Omit<ModalProps, "children"> & {
4
+ title?: string;
5
+ state: State<T>;
6
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import ModalDesign from "../widget/Modal.design";
3
+ export default function Input({ isVisible, title, options, state, }) {
4
+ const { buttons } = options ?? {};
5
+ return (_jsxs(ModalDesign, { isVisible: isVisible, classNames: "pt-18 px-25", options: { buttons, isCloseButton: true }, children: [_jsx("div", { className: "text-xl font-bold", children: title }), _jsx("input", { className: "border-2 border-black w-80 h-8", value: state[0], onChange: (e) => state[1](e.target.value) })] }));
6
+ }
@@ -0,0 +1,7 @@
1
+ import Alert from "./Alert";
2
+ import Input from "./Input";
3
+ declare const Modal: {
4
+ Alert: typeof Alert;
5
+ Input: typeof Input;
6
+ };
7
+ export default Modal;
@@ -0,0 +1,7 @@
1
+ import Alert from "./Alert";
2
+ import Input from "./Input";
3
+ const Modal = {
4
+ Alert,
5
+ Input,
6
+ };
7
+ export default Modal;
@@ -0,0 +1,2 @@
1
+ import { ModalProps } from "../../interface/Modal";
2
+ export default function ModalDesign({ isVisible, children, options, debug, }: ModalProps): import("react").ReactPortal;
@@ -0,0 +1,64 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import ReactDOM from "react-dom";
3
+ import { useTransition, animated } from "react-spring";
4
+ import { useWidgetStore } from "../../store";
5
+ import { cn } from "../../util";
6
+ import isDebug from "../../util/isDebug";
7
+ const widthSize = {
8
+ xs: "w-2/3 min-w-76 max-w-176",
9
+ sm: "w-2/3 min-w-76 max-w-176",
10
+ md: "w-2/3 min-w-76 max-w-176",
11
+ lg: "w-full min-w-76 max-w-360",
12
+ xl: "w-2/3 min-w-76 max-w-360",
13
+ "2xl": "w-2/3 min-w-76 max-w-360",
14
+ full: "w-full",
15
+ };
16
+ const heightSize = {
17
+ xs: "",
18
+ sm: "h-100",
19
+ md: "h-72 sm:h-48",
20
+ lg: "h-120",
21
+ xl: "h-180",
22
+ "2xl": "w-2/3 min-w-76 max-w-176",
23
+ full: "h-full",
24
+ };
25
+ export default function ModalDesign({ isVisible, children, options, debug, }) {
26
+ const { buttons, width, height, closeButtonColor, isCloseButton } = options ?? {};
27
+ const { clearModal } = useWidgetStore();
28
+ const background = {
29
+ positions: "z-50 fixed top-0 left-0",
30
+ displays: "flex items-center justify-center ",
31
+ sizes: "min-h-screen w-full ",
32
+ styles: "bg-black/10 backdrop-blur-sm ",
33
+ };
34
+ const container = {
35
+ paddings: "pl-25 pt-18 pb-12",
36
+ sizes: `${heightSize[height ?? "sm"]} ${widthSize[width ?? "md"]}`,
37
+ styles: "rounded-xl bg-white relative overflow-hidden",
38
+ debug: debug && isDebug(`border-2 border-${debug}`),
39
+ };
40
+ const button = {
41
+ container: {
42
+ positions: "absolute bottom-8 right-10",
43
+ displays: "flex justify-end gap-4",
44
+ },
45
+ body: {
46
+ paddings: "px-8 py-2 ",
47
+ styles: "rounded-2xl bg-black text-2xl font-bold text-white",
48
+ },
49
+ };
50
+ const closeButton = {
51
+ positions: "absolute top-5 left-7",
52
+ displays: "flex justify-center items-center",
53
+ sizes: "h-9 w-9",
54
+ background: closeButtonColor ?? "bg-black",
55
+ styles: "rounded-full",
56
+ };
57
+ const transitions = useTransition(isVisible, {
58
+ from: { opacity: 0 },
59
+ enter: { opacity: 1 },
60
+ leave: { opacity: 0 },
61
+ config: { duration: 200 },
62
+ });
63
+ return ReactDOM.createPortal(transitions((styles, item) => item && (_jsx(animated.div, { style: styles, className: cn(background), children: _jsxs("div", { className: cn(container), children: [children, buttons ? (_jsx("div", { className: cn(button.container), children: buttons.map(([text, onClick]) => (_jsx("button", { className: cn(button.body), onClick: onClick, children: text }, text))) })) : null, isCloseButton && (_jsx("button", { className: cn(closeButton), onClick: clearModal, children: _jsx("div", { className: "x-shape" }) }))] }) }))), document.body);
64
+ }
@@ -1,4 +1,4 @@
1
- export declare const buttonClassNames: (href: string, nowPath: string, color?: [string, string]) => string;
1
+ export declare const buttonClassNames: (href: string, nowPath: string, color?: [string, [string, string]]) => string;
2
2
  export declare function NavigationContainer({ children, }: {
3
3
  children: React.ReactNode;
4
4
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,24 +1,28 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { center, cn } from "../util";
2
+ import { cn } from "../util";
3
+ import { useWidgetStore } from "../store";
4
+ import checkPathMatch from "../util/checkPathMatch";
3
5
  export const buttonClassNames = (href, nowPath, color) => {
4
- const [bg, text] = color ?? ["white", "black"];
5
- const classNames = [
6
- center.row(6),
7
- `text-${text}`,
8
- "font-bold w-full xl:w-50 h-11 xl:rounded-2xl flex justify-center xl:justify-start xl:pl-5",
9
- ].join(" ");
10
- const checkPathMatch = (href, nowPath) => {
11
- return href.split("/").pop() === nowPath.split("/").pop();
6
+ const { isDark } = useWidgetStore();
7
+ const [bg, [text, selectedText]] = color ?? ["white", ["white", "black"]];
8
+ const container = {
9
+ displays: "flex flex-row items-center justify-center xl:justify-start gap-2.5",
10
+ sizes: " w-full xl:w-51 h-11 ",
11
+ styles: "xl:rounded-2xl xl:pl-5 font-bold ",
12
12
  };
13
13
  const toggle = checkPathMatch(href, nowPath)
14
- ? `bg-${bg}`
15
- : "bg-gray-500 xl:bg-transparent";
16
- return [classNames, toggle].join(" ");
14
+ ? !isDark
15
+ ? `bg-${bg} text-${selectedText}`
16
+ : "bg-white text-black"
17
+ : (!isDark ? "bg-white " : "bg-black ") +
18
+ `xl:bg-transparent xl:hover:bg-white/50 hover:text-green-dark text-${text} dark:text-white`;
19
+ return [cn(container), toggle].join(" ");
17
20
  };
18
21
  export function NavigationContainer({ children, }) {
19
- const displays = "flex flex-row xl:flex-col z-40";
20
- const positions = "fixed bottom-0 left-0 xl:static";
21
- const sizes = "w-full xl:w-auto";
22
- const styles = "";
23
- return (_jsx("div", { className: cn(displays, positions, sizes, styles), children: children }));
22
+ const container = {
23
+ positions: "fixed xl:static bottom-0 left-0 z-40",
24
+ displays: "flex flex-row xl:flex-col",
25
+ sizes: "w-full xl:w-auto",
26
+ };
27
+ return _jsx("div", { className: cn(container), children: children });
24
28
  }
@@ -0,0 +1 @@
1
+ export { default as Overlay } from "./template";
@@ -0,0 +1 @@
1
+ export { default as Overlay } from "./template";
@@ -0,0 +1,2 @@
1
+ import { InfoOverlayProps } from "../../interface/Overlay";
2
+ export default function Info({ event, isVisible, }: Omit<InfoOverlayProps, "titles">): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import OverlayDesign from "../widget/Overlay.design";
3
+ export default function Info({ event, isVisible, }) {
4
+ return (_jsx(OverlayDesign, { titles: { title: "유저 관리" }, event: event, isVisible: isVisible, children: _jsx("div", { children: "TEST" }) }));
5
+ }
@@ -0,0 +1,2 @@
1
+ import { ManageOverlayProps } from "../../interface";
2
+ export default function Manage({ titles, isVisible, event, elements, }: ManageOverlayProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Select, Toggle } from "../..";
3
+ import OverlayDesign from "../widget/Overlay.design";
4
+ import { useId } from "react";
5
+ export default function Manage({ titles, isVisible, event, elements, }) {
6
+ const id = useId();
7
+ return (_jsx(OverlayDesign, { titles: titles, event: event, isVisible: isVisible, children: elements?.map(({ title, type, labels, state, isDisabled, selectOptions }) => {
8
+ if (type === "select")
9
+ return (_jsx(Frame, { title: title, children: _jsx(Select, { state: state, selectOptions: selectOptions }) }, id + title));
10
+ if (type === "toggle")
11
+ return (_jsx(Frame, { title: title, children: _jsx(Toggle, { state: state, labels: labels, isDisabled: isDisabled }) }, id + title));
12
+ return null;
13
+ }) }));
14
+ }
15
+ function Frame({ title, children, }) {
16
+ return (_jsxs("div", { className: "flex items-center gap-3.75", children: [_jsx("div", { className: "w-20 text-sm font-bold text-gray-dim", children: title }), children] }));
17
+ }
@@ -0,0 +1,7 @@
1
+ import Info from "./Info";
2
+ import Manage from "./Manage";
3
+ declare const Overlay: {
4
+ Info: typeof Info;
5
+ Manage: typeof Manage;
6
+ };
7
+ export default Overlay;
@@ -0,0 +1,7 @@
1
+ import Info from "./Info";
2
+ import Manage from "./Manage";
3
+ const Overlay = {
4
+ Info,
5
+ Manage,
6
+ };
7
+ export default Overlay;
@@ -0,0 +1,2 @@
1
+ import { OverlayProps } from "../../interface";
2
+ export default function OverlayDesign({ titles, children, event, isVisible, }: OverlayProps): JSX.Element;
@@ -0,0 +1,25 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useTransition, animated } from "react-spring";
3
+ import { cn } from "../../util";
4
+ import { useWidgetStore } from "../../store";
5
+ export default function OverlayDesign({ titles, children, event, isVisible, }) {
6
+ const { removeView, setIsOwn } = useWidgetStore();
7
+ const { title } = titles;
8
+ const container = {
9
+ positions: "absolute top-0 right-0 z-30",
10
+ sizes: "h-full h",
11
+ styles: "box-shadow-sm bg-white",
12
+ };
13
+ const body = {
14
+ positions: "relative",
15
+ paddings: "pt-12 pl-12",
16
+ displays: "flex flex-col gap-3.5",
17
+ };
18
+ const transitions = useTransition(isVisible, {
19
+ from: { width: "0%" },
20
+ enter: { width: "80%", maxWidth: "540px" },
21
+ leave: { width: "0%" },
22
+ config: { duration: 300 },
23
+ });
24
+ return transitions((styles, item) => item && (_jsxs(animated.div, { style: styles, className: cn(container), onClick: () => setIsOwn(true), children: [_jsxs("div", { className: cn(body), children: [_jsx("div", { className: "font-bold text-2xl", children: title }), _jsx("div", { className: "flex flex-col gap-3", children: children })] }), event && (_jsx("button", { className: "absolute top-3 left-3 bg-black w-6 h-6", onClick: () => removeView(event) }))] })));
25
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edu-tosel/design",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "description": "UI components for International TOSEL Committee",
5
5
  "keywords": [
6
6
  "jsx",
@@ -14,11 +14,15 @@
14
14
  "type": "module",
15
15
  "scripts": {},
16
16
  "dependencies": {
17
- "@edu-tosel/design": "^1.0.11",
17
+ "date-fns": "^2.30.0",
18
+ "date-fns-tz": "^2.0.1",
18
19
  "react": "^18.2.0",
20
+ "react-datepicker": "^6.4.0",
19
21
  "react-dom": "^18.2.0",
22
+ "react-icons": "^5.0.1",
20
23
  "react-lottie-player": "^1.5.6",
21
24
  "react-router-dom": "^6.21.3",
25
+ "react-spring": "^9.7.3",
22
26
  "recharts": "^2.11.0",
23
27
  "tailwind-scrollbar-hide": "^1.1.7",
24
28
  "tailwindcss-animate": "^1.0.7",
package/store/index.d.ts CHANGED
@@ -1,16 +1,23 @@
1
- import { WidgetEvent } from "../interface/Widget";
1
+ import { Order, WidgetEvent } from "../interface";
2
2
  interface WidgetProps {
3
3
  events: WidgetEvent[];
4
4
  setView: (prop: string) => void;
5
5
  removeView: (prop: string) => void;
6
+ clearView: () => void;
6
7
  setModal: (prop: string) => void;
7
8
  removeModal: (prop: string) => void;
8
9
  clearModal: () => void;
9
- order: [string, "asc" | "desc"];
10
- setOrder: (prop: string) => void;
10
+ order: Record<string, Order[]>;
11
+ setOrder: (prop: string, id: string) => void;
11
12
  tempData: Record<string, string | number>;
12
13
  setTempData: (prop: Record<string, string | number>) => void;
13
14
  clearTempData: () => void;
15
+ flag: boolean;
16
+ setFlag: () => void;
17
+ isOwn: boolean;
18
+ setIsOwn: (prop: boolean) => void;
19
+ isDark: boolean;
20
+ setDark: () => void;
14
21
  }
15
22
  export declare const useWidgetStore: import("zustand").UseBoundStore<import("zustand").StoreApi<WidgetProps>>;
16
23
  export {};
package/store/index.js CHANGED
@@ -1,24 +1,45 @@
1
1
  import { create } from "zustand";
2
2
  export const useWidgetStore = create((set) => ({
3
3
  events: [],
4
- setView: (prop) => set((state) => ({
5
- events: [...state.events, { event: prop, type: "view" }],
6
- })),
4
+ setView: (prop) => set((state) => {
5
+ if (state.events.find(({ event }) => event === prop) !== undefined)
6
+ return state;
7
+ return {
8
+ events: [...state.events, { event: prop, type: "view" }],
9
+ };
10
+ }),
7
11
  removeView: (prop) => {
8
12
  set((state) => ({
9
13
  events: state.events.filter(({ event }) => event !== prop),
10
14
  }));
11
15
  },
12
- order: ["", "asc"],
13
- setOrder: (prop) => {
16
+ clearView: () => set((state) => ({
17
+ events: state.events.filter(({ type }) => type !== "view"),
18
+ })),
19
+ order: {},
20
+ setOrder: (id, prop) => {
14
21
  set((state) => {
15
- if (state.order[0] !== prop) {
16
- return {
17
- order: [prop, "asc"],
18
- };
19
- }
22
+ const currentOrder = state.order[id] ?? [];
23
+ const update = () => {
24
+ const temp = currentOrder.find(({ orderBy }) => orderBy === prop);
25
+ if (temp !== undefined) {
26
+ return {
27
+ ...temp,
28
+ orderHow: temp.orderHow === "asc"
29
+ ? "desc"
30
+ : temp.orderHow === "desc"
31
+ ? ""
32
+ : "asc",
33
+ };
34
+ }
35
+ return { orderBy: prop, orderHow: "asc" };
36
+ };
37
+ const updatedOrder = [
38
+ ...currentOrder.filter(({ orderBy }) => orderBy !== prop),
39
+ update(),
40
+ ];
20
41
  return {
21
- order: [prop, state.order[1] === "asc" ? "desc" : "asc"],
42
+ order: { ...state.order, [id]: updatedOrder },
22
43
  };
23
44
  });
24
45
  },
@@ -36,4 +57,10 @@ export const useWidgetStore = create((set) => ({
36
57
  tempData: {},
37
58
  setTempData: (prop) => set((state) => ({ tempData: { ...state.tempData, ...prop } })),
38
59
  clearTempData: () => set({ tempData: {} }),
60
+ flag: false,
61
+ setFlag: () => set((state) => ({ flag: !state.flag })),
62
+ isOwn: false,
63
+ setIsOwn: (prop) => set({ isOwn: prop }),
64
+ isDark: false,
65
+ setDark: () => set((state) => ({ isDark: !state.isDark })),
39
66
  }));
@@ -17,6 +17,8 @@ export default {
17
17
  kostar: ["kostar"],
18
18
  nicomoji: ["nicomoji"],
19
19
  megrim: ["megrim"],
20
+ "times-newer-roman-bold": ["times-newer-roman-bold"],
21
+ "times-newer-roman-bolditalic": ["times-newer-roman-bolditalic"],
20
22
  },
21
23
  backgroundImage: {
22
24
  "image-space": "url('/images/home/space.png')",
@@ -26,6 +28,22 @@ export default {
26
28
  "0%, 100%": { backgroundPosition: "left center" },
27
29
  "50%": { backgroundPosition: "right center" },
28
30
  },
31
+ fadeIn: {
32
+ from: { opacity: "0" },
33
+ to: { opacity: "1" },
34
+ },
35
+ fadeOut: {
36
+ from: { opacity: "1" },
37
+ to: { opacity: "0" },
38
+ },
39
+ increaseWidth: {
40
+ from: { width: "0%" },
41
+ to: { width: "33.3%" },
42
+ },
43
+ decreaseWidth: {
44
+ from: { width: "33.3%" },
45
+ to: { width: "0%" },
46
+ },
29
47
  },
30
48
  colors: {
31
49
  "white-off": "#F5F5F5",
@@ -45,6 +63,7 @@ export default {
45
63
  "silver-pale": "#DFD8CA",
46
64
 
47
65
  // Brand Colors
66
+ "cocoon-green": "#00E35B",
48
67
  "ps-pink": "#E3006E",
49
68
  "ps-pink-light": "#FFBADB",
50
69
  "st-orange": "#ED6A00",
@@ -64,22 +83,36 @@ export default {
64
83
  spacing: {
65
84
  "sun-calc": "calc(50% - 6rem)",
66
85
  1: "0.25rem",
86
+ 2.5: "0.625rem",
87
+ 3.75: "0.9375rem",
88
+ 4.75: "1.1875rem",
89
+ 6.25: "1.5625rem",
90
+ 6.5: "1.625rem",
67
91
  7: "1.75rem",
68
92
  7.5: "1.875rem",
69
93
  8: "2rem",
70
94
  9: "2.25rem",
71
95
  11: "2.75rem",
72
96
  12: "3rem",
97
+ 13.25: "3.3125rem",
98
+ 13.75: "3.4375rem",
73
99
  14: "3.5rem",
100
+ 14.5: "3.625rem",
74
101
  15: "3.75rem",
75
102
  16: "4rem",
76
103
  18: "4.5rem",
104
+ 18.75: "4.6875rem",
77
105
  19: "4.75rem",
106
+ 19.25: "4.8125rem",
107
+ 21: "5.25rem",
108
+ 21.75: "5.4375rem",
78
109
  22: "5.5rem",
79
110
  23: "5.75rem",
80
111
  25: "6.25rem",
81
112
  26: "6.5rem",
82
113
  27: "6.75rem",
114
+ 28.78: "7.195rem",
115
+ 29: "7.25rem",
83
116
  30: "7.5rem",
84
117
  34: "8.5rem",
85
118
  36: "9rem",
@@ -92,11 +125,14 @@ export default {
92
125
  48: "12rem",
93
126
  49: "12.25rem",
94
127
  50: "12.5rem",
128
+ 51: "12.75rem",
95
129
  52: "13rem",
130
+ 52.5: "13.125rem",
96
131
  54: "13.5rem",
97
132
  56: "14rem",
98
133
  62: "15.5rem",
99
134
  64: "16rem",
135
+ 67.5: "16.875rem",
100
136
  68: "17rem",
101
137
  69: "17.25rem",
102
138
  70: "17.5rem",
@@ -129,13 +165,24 @@ export default {
129
165
  132: "33rem",
130
166
  135: "33.75rem",
131
167
  136: "34rem",
168
+ 138.75: "34.6875rem",
132
169
  140: "35rem",
133
170
  144: "36rem",
171
+ 145: "36.25rem",
172
+ 145.25: "36.375rem",
173
+ 146: "36.5rem",
174
+ 147: "36.75rem",
134
175
  148: "37rem",
176
+ 151.5: "37.875rem",
177
+ 151.75: "37.9375rem",
178
+ 152: "38rem",
179
+ 153: "38.25rem",
135
180
  158: "39.5rem",
181
+ 159: "39.75rem",
136
182
  160: "40rem",
137
183
  164: "41rem",
138
184
  168: "42rem",
185
+ 171.5: "42.875rem",
139
186
  172: "43rem",
140
187
  176: "44rem",
141
188
  178: "44.5rem",
@@ -261,6 +308,8 @@ export default {
261
308
  "7xl": "4.5rem",
262
309
  "8xl": "6rem",
263
310
  "9xl": "8rem",
311
+ "10xl": "10rem",
312
+ "11xl": "12rem",
264
313
  },
265
314
  screens: {
266
315
  xxxs: "332px",
@@ -409,6 +458,7 @@ export default {
409
458
  "100/100": "100%",
410
459
  },
411
460
  height: {
461
+ "2/3": "66.6666667%",
412
462
  "4/7": "57.1428571%",
413
463
  "3/7": "42.8571429%",
414
464
  "5/12": "41.6666667%",
@@ -420,6 +470,8 @@ export default {
420
470
  "9/10": "90%",
421
471
  },
422
472
  zIndex: {
473
+ "100": "100",
474
+ "90": "90",
423
475
  "50": "50",
424
476
  "49": "49",
425
477
  "48": "48",
@@ -439,6 +491,9 @@ export default {
439
491
  },
440
492
  },
441
493
  safelist: [
494
+ {
495
+ pattern: /font-.*/,
496
+ },
442
497
  {
443
498
  pattern: /animate-.*/,
444
499
  },
@@ -551,4 +606,5 @@ export default {
551
606
  },
552
607
  ],
553
608
  plugins: [tailwindcssAnimate],
609
+ darkMode: "selector",
554
610
  } satisfies Config;
@@ -0,0 +1,3 @@
1
+ export declare function Formatter({ script }: {
2
+ script: string;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ export function Formatter({ script }) {
3
+ const lines = script.split("\n");
4
+ const htmlRegex = /<div.*?>.*?<\/div>/gs;
5
+ const result = lines.map((line, index) => {
6
+ const htmlMatch = line.match(htmlRegex);
7
+ if (htmlMatch)
8
+ return (_jsx("div", { dangerouslySetInnerHTML: { __html: htmlMatch[0] } }, index));
9
+ if (line.startsWith("# "))
10
+ return (_jsx("div", { className: "text-3xl", children: line.replace("# ", "") }, index));
11
+ if (line.startsWith("## "))
12
+ return (_jsx("div", { className: "text-2xl", children: line.replace("## ", "") }, index));
13
+ if (line.startsWith("```"))
14
+ return (_jsx("div", { className: "bg-gray-200 p-2", children: line.replace(/^```|```$/g, "") }, index));
15
+ return _jsx("div", { children: line }, index);
16
+ });
17
+ return _jsx(_Fragment, { children: result });
18
+ }
package/text/index.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export * from "./LineBreaks";
2
+ export * from "./Formatter";
package/text/index.js CHANGED
@@ -1 +1,2 @@
1
1
  export * from "./LineBreaks";
2
+ export * from "./Formatter";
@@ -0,0 +1,2 @@
1
+ declare const checkPathMatch: (href: string, nowPath: string) => boolean;
2
+ export default checkPathMatch;
@@ -0,0 +1,8 @@
1
+ const checkPathMatch = (href, nowPath) => {
2
+ const nowPathFormat = nowPath
3
+ .split("/")
4
+ .filter((segment) => !/^\d+$/.test(segment))
5
+ .join("/");
6
+ return href.split("/").pop() === nowPathFormat.split("/").pop();
7
+ };
8
+ export default checkPathMatch;
package/util/colors.d.ts CHANGED
@@ -7,5 +7,6 @@ export declare const colorsByLevel: {
7
7
  };
8
8
  export declare const gradient: {
9
9
  lab: string;
10
- green_to_red: string;
10
+ greenToRed: string;
11
+ greenToRedSoft: string;
11
12
  };
package/util/colors.js CHANGED
@@ -7,5 +7,6 @@ export const colorsByLevel = {
7
7
  };
8
8
  export const gradient = {
9
9
  lab: "gradient-to-br from-violet-light/20 to-blue-sky/40 ",
10
- green_to_red: "gradient-to-r from-green-dark/20 to-red-crimson/20",
10
+ greenToRed: "gradient-to-r from-green-dark to-red-crimson",
11
+ greenToRedSoft: "gradient-to-r from-green-dark/20 to-red-crimson/20",
11
12
  };
@@ -0,0 +1 @@
1
+ export default function convertUnixTimestampToDate(unixTimestamp: number): string;