@edu-tosel/design 1.0.15 → 1.0.17

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 (43) hide show
  1. package/README.md +0 -5
  2. package/board/widget/Header.js +1 -1
  3. package/card/template/AddCard.d.ts +1 -1
  4. package/card/template/AddCard.js +11 -5
  5. package/html/widget/Select.js +14 -4
  6. package/index.d.ts +0 -1
  7. package/index.js +0 -1
  8. package/interaction/widget/LoadingWorm.js +1 -1
  9. package/interface/Card.d.ts +2 -0
  10. package/interface/Modal.d.ts +1 -0
  11. package/layout/template/dashboard/Header.js +1 -1
  12. package/layout/template/dashboard/index.js +2 -2
  13. package/modal/template/Alert.js +1 -2
  14. package/modal/template/Input.d.ts +1 -1
  15. package/modal/template/Input.js +2 -2
  16. package/modal/widget/Modal.design.d.ts +1 -1
  17. package/modal/widget/Modal.design.js +3 -3
  18. package/navigation/Navigation.js +2 -2
  19. package/package.json +1 -1
  20. package/tailwind.config.ts +1 -88
  21. package/text/Formatter.d.ts +1 -1
  22. package/text/Formatter.js +76 -13
  23. package/util/colors.d.ts +8 -1
  24. package/util/colors.js +6 -3
  25. package/util/index.d.ts +1 -3
  26. package/util/index.js +1 -3
  27. package/version.txt +1 -1
  28. package/deck/index.d.ts +0 -1
  29. package/deck/index.js +0 -1
  30. package/deck/template/Deck.d.ts +0 -6
  31. package/deck/template/Deck.design.d.ts +0 -2
  32. package/deck/template/Deck.design.js +0 -21
  33. package/deck/template/Deck.js +0 -11
  34. package/deck/widget/Deck.d.ts +0 -2
  35. package/deck/widget/Deck.js +0 -14
  36. package/interface/Deck.d.ts +0 -15
  37. package/interface/Deck.js +0 -1
  38. package/util/display.d.ts +0 -25
  39. package/util/display.js +0 -25
  40. package/util/displayResponsive.d.ts +0 -3
  41. package/util/displayResponsive.js +0 -15
  42. package/util/position.d.ts +0 -14
  43. package/util/position.js +0 -44
package/README.md CHANGED
@@ -20,11 +20,6 @@ Card 컴포넌트는 여러가지 요소를 담고 있는 컨테이너이다.
20
20
 
21
21
  일반적으로 가장 최소 단위의 컴포넌트로 사용되며, 다양한 요소를 담을 수 있다.
22
22
 
23
- ### Deck
24
-
25
- Deck 컴포넌트는 여러가지 Card 컴포넌트를 담고 있는 컨테이너이다.
26
-
27
- Deck 컴포넌트는 담고있는 Card 컴포넌트들을 수평 정렬한다.
28
23
 
29
24
  ### Layout
30
25
 
@@ -12,7 +12,7 @@ export default function BoardHeader({ titles, tags, options, }) {
12
12
  const container = {
13
13
  positions: "fixed top-15 xl:top-0 left-0 z-20 xl:relative flex items-center",
14
14
  paddings: "px-7.5",
15
- styles: `bg-${bgColor} text-${textColor}`,
15
+ styles: `${bgColor} ${textColor}`,
16
16
  sizes: "w-full h-19",
17
17
  border: "border-b-2 border-green-dark",
18
18
  };
@@ -1,2 +1,2 @@
1
1
  import { AddCardProps } from "../../interface";
2
- export default function AddCard({ onClick, options }: AddCardProps): import("react/jsx-runtime").JSX.Element;
2
+ export default function AddCard({ title, icon, onClick, options, }: AddCardProps): import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,17 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { cn } from "../../util";
3
3
  import { Card } from "../widget/Card";
4
- export default function AddCard({ onClick, options }) {
4
+ export default function AddCard({ title, icon, onClick, options, }) {
5
5
  const { width } = options ?? {};
6
6
  const container = {
7
- displays: "flex justify-center items-center",
8
- text: "text-3xl",
7
+ displays: "flex flex-col justify-center items-center gap-2",
8
+ text: "text-xs",
9
+ styles: "duration-500 hover:bg-gray-light",
9
10
  };
10
- return _jsx(Card, { options: { width, classNames: cn(container), onClick }, children: "+" });
11
+ const iconBody = {
12
+ displays: "flex items-center justify-center ",
13
+ sizes: "w-9 h-9",
14
+ styles: "bg-gray-light rounded-full",
15
+ };
16
+ return (_jsxs(Card, { options: { width, classNames: cn(container), onClick }, children: [icon && (_jsx("div", { className: cn(iconBody), children: _jsx("img", { src: icon }) })), title && _jsx("div", { children: title })] }));
11
17
  }
@@ -21,29 +21,39 @@ export default function Select({ state, selectOptions, options, }) {
21
21
  setIsActive(false);
22
22
  return setIsButton(false);
23
23
  }, [flag]);
24
+ const levelsKey = {
25
+ CoCoon: "CC",
26
+ "Pre-Starter": "PS",
27
+ Starter: "ST",
28
+ Basic: "BA",
29
+ Junior: "JR",
30
+ "High Junior": "HJ",
31
+ };
24
32
  const [isActive, setIsActive] = useState(false);
25
33
  const [isButton, setIsButton] = useState(false);
26
34
  const [selectedItem, setSelectedItem] = useState(null);
27
35
  const handleItemClick = (title) => {
28
36
  setSelectedItem(title);
29
37
  setIsActive(false);
38
+ const selectedValue = levelsKey[title] || title;
39
+ setValue(selectedValue);
30
40
  };
31
41
  // css
32
42
  const levels = [
33
43
  "CoCoon",
34
- "PreStarter",
44
+ "Pre-Starter",
35
45
  "Starter",
36
46
  "Basic",
37
47
  "Junior",
38
- "HighJunior",
48
+ "High Junior",
39
49
  ];
40
50
  const colorMap = {
41
51
  CoCoon: "bg-cocoon-green",
42
- PreStarter: "bg-ps-pink",
52
+ "Pre-Starter": "bg-ps-pink",
43
53
  Starter: "bg-st-orange",
44
54
  Basic: "bg-ba-yellow",
45
55
  Junior: "bg-jr-blue",
46
- HighJunior: "bg-hj-blue",
56
+ "High Junior": "bg-hj-blue",
47
57
  };
48
58
  const isActiveCss = () => {
49
59
  if (isActive)
package/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import "./globals.css";
2
2
  export * from "./board";
3
3
  export * from "./card";
4
- export * from "./deck";
5
4
  export * from "./layout";
6
5
  export * from "./html";
7
6
  export * from "./interaction";
package/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import "./globals.css";
2
2
  export * from "./board";
3
3
  export * from "./card";
4
- export * from "./deck";
5
4
  export * from "./layout";
6
5
  export * from "./html";
7
6
  export * from "./interaction";
@@ -18,6 +18,6 @@ function SubComponent({ index, ease, }) {
18
18
  `z-${50 - index}`,
19
19
  ].join(" ");
20
20
  const sizes = "w-25 h-20";
21
- const styles = `duration-${timer} rounded-lg bg-${gradient.lab} opacity-40`;
21
+ const styles = `duration-${timer} rounded-lg bg-${gradient.bg.lab} opacity-40`;
22
22
  return (_jsxs("div", { className: cn(positions, sizes, styles), children: [_jsxs("div", { children: ["Index is ", index] }), _jsxs("div", { className: "text-xs", children: [timer, "ms \uB3D9\uC548 ", flag.toString()] })] }));
23
23
  }
@@ -86,6 +86,8 @@ export interface InfoCardProps extends CardProps {
86
86
  } & CardOptions;
87
87
  }
88
88
  export interface AddCardProps extends Omit<CardProps, "children"> {
89
+ title?: string;
90
+ icon?: string;
89
91
  onClick: OnClick;
90
92
  }
91
93
  export interface RowCardProps<T> {
@@ -1,6 +1,7 @@
1
1
  import { Button, Scripts, Size } from "./Property";
2
2
  export interface ModalProps {
3
3
  isVisible?: boolean;
4
+ event?: string;
4
5
  children: React.ReactNode;
5
6
  classNames?: string;
6
7
  options?: {
@@ -10,7 +10,7 @@ export function Header({ title, image, }) {
10
10
  positions: "fixed xl:static top-0 left-0 z-40",
11
11
  displays: "flex items-center justify-between ",
12
12
  sizes: "h-15 w-full",
13
- background: !isDark ? `bg-${gradient.greenToRed}` : "bg-black",
13
+ background: !isDark ? `${gradient.bg.greenToRed}` : "bg-black",
14
14
  styles: "px-5 xl:px-8 2xl:px-16 ",
15
15
  };
16
16
  return (_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "flex h-12 items-center gap-8 xl:gap-24 2xl:gap-22", children: [src && href ? (_jsx("a", { href: href, children: _jsx("img", { src: src, alt: "logo", className: "h-6.25 w-28.78" }) })) : (_jsx("div", { className: "text-2xl", children: "TOSEL" })), _jsx("div", { className: "text-3xl font-bold text-white ", children: title })] }), _jsx("button", { onClick: setDark, className: "text-white", children: "DARK" })] }));
@@ -16,8 +16,8 @@ function Layout({ subject, colors, navigations, children, }) {
16
16
  }, [flag]);
17
17
  const container = {
18
18
  sizes: "min-h-screen h-screen xl:h-auto",
19
- background: !isDark ? `bg-${bgColor}` : "bg-black/80",
20
- styles: `text-${textColor} font-pretendard-medium`,
19
+ background: !isDark ? bgColor : "bg-black/80",
20
+ styles: `${textColor} font-pretendard-medium`,
21
21
  dark: isDark && "dark",
22
22
  };
23
23
  const body = {
@@ -1,8 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { col } from "../../util";
3
2
  import ModalDesign from "../widget/Modal.design";
4
3
  export default function Alert({ isVisible, title, scripts, options, }) {
5
4
  const { script, subScript } = scripts ?? {};
6
5
  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 })] }) }) }));
6
+ return (_jsx(ModalDesign, { isVisible: isVisible, classNames: "pt-18 px-25", options: { buttons, isCloseButton: true }, children: _jsx("div", { className: "flex flex-col gap-3", children: _jsxs("div", { className: "flex flex-col gap-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
7
  }
@@ -1,6 +1,6 @@
1
1
  import { State } from "../../interface";
2
2
  import { ModalProps } from "../../interface/Modal";
3
- export default function Input<T>({ isVisible, title, options, state, }: Omit<ModalProps, "children"> & {
3
+ export default function Input<T>({ isVisible, event, title, options, state, }: Omit<ModalProps, "children"> & {
4
4
  title?: string;
5
5
  state: State<T>;
6
6
  }): 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 ModalDesign from "../widget/Modal.design";
3
- export default function Input({ isVisible, title, options, state, }) {
3
+ export default function Input({ isVisible, event, title, options, state, }) {
4
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) })] }));
5
+ return (_jsxs(ModalDesign, { isVisible: isVisible, event: event, 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
6
  }
@@ -1,2 +1,2 @@
1
1
  import { ModalProps } from "../../interface/Modal";
2
- export default function ModalDesign({ isVisible, children, options, debug, }: ModalProps): import("react").ReactPortal;
2
+ export default function ModalDesign({ isVisible, event, children, options, debug, }: ModalProps): import("react").ReactPortal;
@@ -22,9 +22,9 @@ const heightSize = {
22
22
  "2xl": "w-2/3 min-w-76 max-w-176",
23
23
  full: "h-full",
24
24
  };
25
- export default function ModalDesign({ isVisible, children, options, debug, }) {
25
+ export default function ModalDesign({ isVisible, event, children, options, debug, }) {
26
26
  const { buttons, width, height, closeButtonColor, isCloseButton } = options ?? {};
27
- const { clearModal } = useWidgetStore();
27
+ const { setIsOwn, removeModal } = useWidgetStore();
28
28
  const background = {
29
29
  positions: "z-50 fixed top-0 left-0",
30
30
  displays: "flex items-center justify-center ",
@@ -60,5 +60,5 @@ export default function ModalDesign({ isVisible, children, options, debug, }) {
60
60
  leave: { opacity: 0 },
61
61
  config: { duration: 200 },
62
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);
63
+ return ReactDOM.createPortal(transitions((styles, item) => item && (_jsx(animated.div, { style: styles, className: cn(background), onClick: () => setIsOwn(true), 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 && event && (_jsx("button", { className: cn(closeButton), onClick: () => removeModal(event), children: _jsx("div", { className: "x-shape" }) }))] }) }))), document.body);
64
64
  }
@@ -12,10 +12,10 @@ export const buttonClassNames = (href, nowPath, color) => {
12
12
  };
13
13
  const toggle = checkPathMatch(href, nowPath)
14
14
  ? !isDark
15
- ? `bg-${bg} text-${selectedText}`
15
+ ? `${bg} ${selectedText}`
16
16
  : "bg-white text-black"
17
17
  : (!isDark ? "bg-white " : "bg-black ") +
18
- `xl:bg-transparent xl:hover:bg-white/50 hover:text-green-dark text-${text} dark:text-white`;
18
+ `xl:bg-transparent xl:hover:bg-white/50 hover:text-green-dark ${text} dark:text-white`;
19
19
  return [cn(container), toggle].join(" ");
20
20
  };
21
21
  export function NavigationContainer({ children, }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edu-tosel/design",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
4
4
  "description": "UI components for International TOSEL Committee",
5
5
  "keywords": [
6
6
  "jsx",
@@ -84,6 +84,7 @@ export default {
84
84
  "sun-calc": "calc(50% - 6rem)",
85
85
  1: "0.25rem",
86
86
  2.5: "0.625rem",
87
+ 3.5: "0.875rem",
87
88
  3.75: "0.9375rem",
88
89
  4.75: "1.1875rem",
89
90
  6.25: "1.5625rem",
@@ -491,54 +492,7 @@ export default {
491
492
  },
492
493
  },
493
494
  safelist: [
494
- {
495
- pattern: /font-.*/,
496
- },
497
- {
498
- pattern: /animate-.*/,
499
- },
500
- {
501
- pattern: /shadow-.*/,
502
- },
503
-
504
- {
505
- pattern: /flex-.*/,
506
- },
507
- {
508
- pattern: /overflow-*./,
509
- },
510
- {
511
- pattern: /col-.*/,
512
- },
513
- {
514
- pattern: /row-.*/,
515
- },
516
- {
517
- pattern: /flex-.*/,
518
- },
519
- {
520
- pattern: /justify-.*/,
521
- },
522
- {
523
- pattern: /items-.*/,
524
- },
525
- {
526
- pattern: /grid-.*/,
527
- },
528
- {
529
- pattern: /gap-.*/,
530
- },
531
- {
532
- pattern: /border-.*/,
533
- },
534
- {
535
- pattern: /min-.*/,
536
- },
537
- {
538
- pattern: /max-.*/,
539
- },
540
495
  { pattern: /w-.*/ },
541
- { pattern: /h-.*/ },
542
496
  {
543
497
  pattern: /top-.*/,
544
498
  },
@@ -557,50 +511,9 @@ export default {
557
511
  {
558
512
  pattern: /right*.*/,
559
513
  },
560
- { pattern: /bg-.*/ },
561
- { pattern: /text-.*/ },
562
- {
563
- pattern: /p-.*/,
564
- },
565
- {
566
- pattern: /px-.*/,
567
- },
568
- {
569
- pattern: /pl-.*/,
570
- },
571
- {
572
- pattern: /py-.*/,
573
- },
574
- {
575
- pattern: /pb-.*/,
576
- },
577
- {
578
- pattern: /m-.*/,
579
- },
580
- {
581
- pattern: /mx-.*/,
582
- },
583
- {
584
- pattern: /my-.*/,
585
- },
586
- {
587
- pattern: /z-.*/,
588
- },
589
- {
590
- pattern: /from-.*/,
591
- },
592
- {
593
- pattern: /to-.*/,
594
- },
595
- {
596
- pattern: /via-.*/,
597
- },
598
514
  {
599
515
  pattern: /delay-.*/,
600
516
  },
601
- {
602
- pattern: /overflow-.*/,
603
- },
604
517
  {
605
518
  pattern: /duration-.*/,
606
519
  },
@@ -1,3 +1,3 @@
1
- export declare function Formatter({ script }: {
1
+ export default function Formatter({ script }: {
2
2
  script: string;
3
3
  }): import("react/jsx-runtime").JSX.Element;
package/text/Formatter.js CHANGED
@@ -1,18 +1,81 @@
1
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
- export function Formatter({ script }) {
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Fragment, useId } from "react";
3
+ export default function Formatter({ script }) {
4
+ const parses = parseType(script);
5
+ const results = parses.map(([type, content], index) => {
6
+ if (type === "code")
7
+ return (_jsx("div", { className: "bg-gray-500 p-2", children: parseCodeLines(content) }, index));
8
+ else
9
+ return _jsx("div", { children: parseTextLines(content) }, index);
10
+ });
11
+ return _jsx("div", { className: "flex flex-col", children: results });
12
+ }
13
+ function parseType(script) {
14
+ const segments = script.split("```");
15
+ return segments.reduce((acc, segment, index) => {
16
+ if (index % 2 === 0) {
17
+ acc.push(["text", segment]);
18
+ }
19
+ else {
20
+ acc.push(["code", segment]);
21
+ }
22
+ return acc;
23
+ }, []);
24
+ }
25
+ function parseCodeLines(script) {
26
+ const lines = script.split("\n");
27
+ return lines.map((line, index) => _jsx("div", { children: line }, index));
28
+ }
29
+ function parseTextLines(script) {
3
30
  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("# "))
31
+ return lines.map((line, index) => {
32
+ if (line === "") {
33
+ return _jsx("br", {}, index);
34
+ }
35
+ else if (line.startsWith("# ")) {
10
36
  return (_jsx("div", { className: "text-3xl", children: line.replace("# ", "") }, index));
11
- if (line.startsWith("## "))
37
+ }
38
+ else if (line.startsWith("## ")) {
12
39
  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);
40
+ }
41
+ else if (line.startsWith("### ")) {
42
+ return (_jsx("div", { className: "text-xl", children: line.replace("### ", "") }, index));
43
+ }
44
+ else {
45
+ return (_jsx("div", { children: _jsx(Parse, { script: line }) }, index));
46
+ }
47
+ });
48
+ }
49
+ function Parse({ script }) {
50
+ const id = useId();
51
+ const arrs = [[[], script]];
52
+ const arrs2 = parseStyles("**", "bold", arrs);
53
+ const arrs3 = parseStyles("*", "italic", arrs2);
54
+ const parseFontType = (types) => {
55
+ if (types.length === 0)
56
+ return "";
57
+ const classNames = types.map((type) => {
58
+ if (type === "bold")
59
+ return "font-bold";
60
+ if (type === "italic")
61
+ return "italic";
62
+ return "";
63
+ });
64
+ return classNames.join(" ");
65
+ };
66
+ return (_jsx(Fragment, { children: arrs3.map(([types, script], index) => (_jsx("span", { className: parseFontType(types), children: script }, id + index))) }, id));
67
+ }
68
+ function parseStyles(trigger, type, props) {
69
+ const result = props.flatMap(([types, script]) => {
70
+ const segments = script.split(trigger);
71
+ return segments.map((segment, index) => {
72
+ if (index % 2 !== 0) {
73
+ return [[...types, type], segment];
74
+ }
75
+ else {
76
+ return [[...types], segment];
77
+ }
78
+ });
16
79
  });
17
- return _jsx(_Fragment, { children: result });
80
+ return result;
18
81
  }
package/util/colors.d.ts CHANGED
@@ -5,8 +5,15 @@ export declare const colorsByLevel: {
5
5
  JR: string;
6
6
  HJ: string;
7
7
  };
8
- export declare const gradient: {
8
+ export declare const gradientBackground: {
9
9
  lab: string;
10
10
  greenToRed: string;
11
11
  greenToRedSoft: string;
12
12
  };
13
+ export declare const gradient: {
14
+ bg: {
15
+ lab: string;
16
+ greenToRed: string;
17
+ greenToRedSoft: string;
18
+ };
19
+ };
package/util/colors.js CHANGED
@@ -5,8 +5,11 @@ export const colorsByLevel = {
5
5
  JR: "jr-blue",
6
6
  HJ: "hj-blue",
7
7
  };
8
+ export const gradientBackground = {
9
+ lab: "bg-gradient-to-br from-violet-light/20 to-blue-sky/40 ",
10
+ greenToRed: "bg-gradient-to-r from-green-dark to-red-crimson",
11
+ greenToRedSoft: "bg-gradient-to-r from-green-dark/20 to-red-crimson/20",
12
+ };
8
13
  export const gradient = {
9
- lab: "gradient-to-br from-violet-light/20 to-blue-sky/40 ",
10
- greenToRed: "gradient-to-r from-green-dark to-red-crimson",
11
- greenToRedSoft: "gradient-to-r from-green-dark/20 to-red-crimson/20",
14
+ bg: gradientBackground,
12
15
  };
package/util/index.d.ts CHANGED
@@ -2,11 +2,9 @@ export { default as cn } from "./classNames";
2
2
  export { default as unixToDate } from "./convertUnixTimestampToDate";
3
3
  export { default as isDebug } from "./isDebug";
4
4
  export { default as sortByOrder } from "./sortByOrder";
5
+ export { default as checkPathMatch } from "./checkPathMatch";
5
6
  export * from "./colors";
6
- export * from "./display";
7
- export * from "./displayResponsive";
8
7
  export * from "./hooks";
9
8
  export * from "./pattern";
10
- export * from "./position";
11
9
  export * from "./shape";
12
10
  export * from "./hooks";
package/util/index.js CHANGED
@@ -2,11 +2,9 @@ export { default as cn } from "./classNames";
2
2
  export { default as unixToDate } from "./convertUnixTimestampToDate";
3
3
  export { default as isDebug } from "./isDebug";
4
4
  export { default as sortByOrder } from "./sortByOrder";
5
+ export { default as checkPathMatch } from "./checkPathMatch";
5
6
  export * from "./colors";
6
- export * from "./display";
7
- export * from "./displayResponsive";
8
7
  export * from "./hooks";
9
8
  export * from "./pattern";
10
- export * from "./position";
11
9
  export * from "./shape";
12
10
  export * from "./hooks";
package/version.txt CHANGED
@@ -1 +1 @@
1
- 1.0.15
1
+ 1.0.17
package/deck/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export { default as Deck } from "./template/Deck";
package/deck/index.js DELETED
@@ -1 +0,0 @@
1
- export { default as Deck } from "./template/Deck";
@@ -1,6 +0,0 @@
1
- import { DeckProps } from "../../interface/Deck";
2
- declare function Deck<T extends string | number>(props: DeckProps<T>): import("react/jsx-runtime").JSX.Element;
3
- declare namespace Deck {
4
- var Sub: <T extends string | number>({ titles, children, options, debug, }: DeckProps<T>) => import("react/jsx-runtime").JSX.Element;
5
- }
6
- export default Deck;
@@ -1,2 +0,0 @@
1
- import { DeckProps } from "../../interface/Deck";
2
- export default function DeckDesign<T extends string | number>({ children, titles, options, debug, }: DeckProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -1,21 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cn, isDebug } from "../../util";
3
- import { Deck } from "./../widget/Deck";
4
- export default function DeckDesign({ children, titles, options, debug, }) {
5
- const { title, subtitle, isSub } = titles ?? {};
6
- const { height } = options ?? {};
7
- const container = {
8
- displays: "flex flex-col gap-4",
9
- sizes: `w-full h-${height ?? "auto"} `,
10
- debug: debug && isDebug(`border-2 border-${debug}`),
11
- };
12
- const titleBox = {
13
- container: "flex flex-col gap-1",
14
- title: {
15
- text: isSub ? "text-base xl:text-lg" : "text-xl xl:text-2xl",
16
- font: "font-bold",
17
- },
18
- subtitle: isSub ? "text-xs xl:text-sm" : "text-sm xl:text-base",
19
- };
20
- return (_jsxs("div", { className: cn(container), children: [titles && (_jsxs("div", { children: [_jsx("div", { className: cn(titleBox.title), children: title }), _jsx("div", { className: cn(titleBox.subtitle), children: subtitle })] })), _jsx(Deck, { children: children })] }));
21
- }
@@ -1,11 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import DeckDesign from "./Deck.design";
3
- function Deck(props) {
4
- return _jsx(DeckDesign, { ...props });
5
- }
6
- function Sub({ titles, children, options, debug, }) {
7
- const { title, subtitle } = titles ?? { title: "" };
8
- return (_jsx(DeckDesign, { titles: { title, subtitle, isSub: true }, debug: debug, ...options, children: children }));
9
- }
10
- Deck.Sub = Sub;
11
- export default Deck;
@@ -1,2 +0,0 @@
1
- import { DeckProps } from "../../interface/Deck";
2
- export declare function Deck<T extends string | number>({ children, options, }: DeckProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -1,14 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from "../../util";
3
- export function Deck({ children, options, }) {
4
- const { flex, justify, gapX, gapY, overflowScroll } = options ?? {};
5
- const body = {
6
- displays: `flex flex-col flex-wrap gap-y-${gapY ?? 5}`,
7
- flex: flex === "col" ? "sm:flex-col" : "sm:flex-row",
8
- justify: `justify-${justify ?? "start"}`,
9
- gapX: `${`gap-x-${gapX ?? 7.5}`}`,
10
- sizes: "sm:w-full ",
11
- styles: `${overflowScroll ? "overflow-x-scroll" : ""} duration-500`,
12
- };
13
- return _jsx("div", { className: cn(body), children: children });
14
- }
@@ -1,15 +0,0 @@
1
- import { Titles } from "./Property";
2
- export interface DeckProps<T> {
3
- children: React.ReactNode;
4
- titles?: Titles;
5
- options?: {
6
- flex?: "col" | "row";
7
- justify?: "between";
8
- overflowScroll?: boolean;
9
- width?: T;
10
- height?: number;
11
- gapX?: number;
12
- gapY?: number;
13
- };
14
- debug?: string;
15
- }
package/interface/Deck.js DELETED
@@ -1 +0,0 @@
1
- export {};
package/util/display.d.ts DELETED
@@ -1,25 +0,0 @@
1
- export declare const row: (gap?: number) => string;
2
- export declare const col: (gap?: number, width?: number | string) => string;
3
- export declare const between: {
4
- row: string;
5
- col: string;
6
- };
7
- export declare const center: {
8
- col: (gap?: number) => string;
9
- row: (gap?: number) => string;
10
- colO: (gap?: number) => string;
11
- rowO: (gap?: number) => string;
12
- screen: {
13
- default: string;
14
- col: (gap?: number) => string;
15
- row: (gap?: number) => string;
16
- };
17
- };
18
- export declare const grid: {
19
- col: (col: number, gap?: number) => string;
20
- row: (row: number, gap?: number) => string;
21
- };
22
- export declare const box: {
23
- row: (height: number, gap?: number) => string;
24
- col: (width: number, gap?: number) => string;
25
- };
package/util/display.js DELETED
@@ -1,25 +0,0 @@
1
- export const row = (gap = 8) => `flex flex-row gap-${gap} `;
2
- export const col = (gap = 8, width) => `flex flex-col gap-${gap} ${width ? `w-${width}` : "w-full"} `;
3
- export const between = {
4
- row: "flex flex-row justify-between items-center ",
5
- col: "flex flex-col justify-between items-center ",
6
- };
7
- export const center = {
8
- col: (gap = 0) => `gap-${gap} flex flex-col items-center `,
9
- row: (gap = 0) => `gap-${gap} flex flex-row items-center `,
10
- colO: (gap = 0) => `gap-${gap} flex flex-col justify-center items-center `,
11
- rowO: (gap = 0) => `gap-${gap} flex flex-row justify-center items-center `,
12
- screen: {
13
- default: "flex justify-center items-center min-h-screen w-full overflow-hidden min-h-screen relative ",
14
- col: (gap = 0) => `gap-${gap} flex flex-col justify-center items-center min-h-screen w-full `,
15
- row: (gap = 0) => `gap-${gap} flex flex-row justify-center items-center min-h-screen w-full `,
16
- },
17
- };
18
- export const grid = {
19
- col: (col, gap = 12) => `grid grid-cols-${col} gap-${gap} `,
20
- row: (row, gap = 12) => `grid grid-rows-${row} gap-${gap}`,
21
- };
22
- export const box = {
23
- row: (height, gap) => `h-${height} gap-${gap} flex flex-row `,
24
- col: (width, gap) => `w-${width} gap-${gap} flex flex-col `,
25
- };
@@ -1,3 +0,0 @@
1
- export declare const responsiveColToRow: () => string;
2
- export declare const responsiveRowToCol: () => string;
3
- export declare const responsiveGridToCol: (gridCell: number) => string;
@@ -1,15 +0,0 @@
1
- export const responsiveColToRow = () => {
2
- const df = "flex flex-col";
3
- const mark = "md:flex-row";
4
- return [df, mark].join(" ");
5
- };
6
- export const responsiveRowToCol = () => {
7
- const df = "flex flex-row";
8
- const md = "md:flex-col";
9
- return [df, md].join(" ");
10
- };
11
- export const responsiveGridToCol = (gridCell) => {
12
- const df = `grid grid-cols-${gridCell}`;
13
- const md = "md:flex md:flex-col";
14
- return [df, md].join(" ");
15
- };
@@ -1,14 +0,0 @@
1
- export declare const fixed: {
2
- tl: (top: number | string, left: number | string) => string;
3
- br: (bottom: number | string, right: number | string) => string;
4
- };
5
- export declare const absolute: {
6
- tl: (top?: number | string, left?: number | string) => string;
7
- tr: (top?: number | string, right?: number | string) => string;
8
- br: (bottom?: number, right?: number) => string;
9
- bl: (bottom?: number, left?: number) => string;
10
- full: {
11
- tl: (top?: number | string, left?: number | string) => string;
12
- bl: (bottom?: number | string, left?: number | string) => string;
13
- };
14
- };
package/util/position.js DELETED
@@ -1,44 +0,0 @@
1
- export const fixed = {
2
- tl: (top, left) => `fixed top-${top} left-${left} z-50 `,
3
- br: (bottom, right) => `fixed bottom-${bottom} right-${right} z-50 `,
4
- };
5
- export const absolute = {
6
- tl: (top, left) => {
7
- const topClass = () => {
8
- if (typeof top === "number" && top < 0)
9
- return `-top-${Math.abs(top)}`;
10
- return `top-${top}`;
11
- };
12
- const leftClass = () => {
13
- if (typeof left === "number" && left < 0)
14
- return `-left-${Math.abs(left)}`;
15
- return `left-${left}`;
16
- };
17
- return `absolute ${topClass()} ${leftClass()} `;
18
- },
19
- tr: (top, right) => {
20
- const topClass = () => {
21
- if (typeof top === "number" && top < 0)
22
- return `-top-${Math.abs(top)} `;
23
- return `top-${top}`;
24
- };
25
- const rightClass = () => {
26
- if (typeof right === "number" && right < 0)
27
- return `-right-${Math.abs(right)} `;
28
- return `right-${right}`;
29
- };
30
- return `absolute ${topClass()} ${rightClass()} `;
31
- },
32
- br: (bottom = 0, right = 0) => `absolute bottom-${bottom} right-${right} `,
33
- bl: (bottom = 0, left = 0) => `absolute bottom-${bottom} left-${left} `,
34
- full: {
35
- tl: (top, left) => {
36
- if (!(typeof top === "number") || !(typeof left === "number"))
37
- return `absolute top-${top} left-${left} w-full `;
38
- const topClass = top >= 0 ? `top-${top}` : `-top-${Math.abs(top)}`;
39
- const leftClass = left >= 0 ? `left-${left}` : `-left-${Math.abs(left)}`;
40
- return `absolute w-full ${topClass} ${leftClass} `;
41
- },
42
- bl: (bottom, left) => `absolute bottom-${bottom ?? 0} left-${left ?? 0} w-full `,
43
- },
44
- };