@edu-tosel/design 1.0.16 → 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.
- package/board/widget/Header.js +1 -1
- package/interaction/widget/LoadingWorm.js +1 -1
- package/layout/template/dashboard/Header.js +1 -1
- package/layout/template/dashboard/index.js +2 -2
- package/modal/template/Alert.js +1 -2
- package/navigation/Navigation.js +2 -2
- package/package.json +1 -1
- package/tailwind.config.ts +0 -88
- package/text/Formatter.d.ts +1 -1
- package/text/Formatter.js +76 -13
- package/util/colors.d.ts +8 -1
- package/util/colors.js +6 -3
- package/util/index.d.ts +0 -3
- package/util/index.js +0 -3
- package/version.txt +1 -1
- package/util/display.d.ts +0 -25
- package/util/display.js +0 -25
- package/util/displayResponsive.d.ts +0 -3
- package/util/displayResponsive.js +0 -15
- package/util/position.d.ts +0 -14
- package/util/position.js +0 -44
package/board/widget/Header.js
CHANGED
|
@@ -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:
|
|
15
|
+
styles: `${bgColor} ${textColor}`,
|
|
16
16
|
sizes: "w-full h-19",
|
|
17
17
|
border: "border-b-2 border-green-dark",
|
|
18
18
|
};
|
|
@@ -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
|
}
|
|
@@ -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 ?
|
|
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 ?
|
|
20
|
-
styles:
|
|
19
|
+
background: !isDark ? bgColor : "bg-black/80",
|
|
20
|
+
styles: `${textColor} font-pretendard-medium`,
|
|
21
21
|
dark: isDark && "dark",
|
|
22
22
|
};
|
|
23
23
|
const body = {
|
package/modal/template/Alert.js
CHANGED
|
@@ -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
|
|
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
|
}
|
package/navigation/Navigation.js
CHANGED
|
@@ -12,10 +12,10 @@ export const buttonClassNames = (href, nowPath, color) => {
|
|
|
12
12
|
};
|
|
13
13
|
const toggle = checkPathMatch(href, nowPath)
|
|
14
14
|
? !isDark
|
|
15
|
-
?
|
|
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
|
|
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
package/tailwind.config.ts
CHANGED
|
@@ -492,54 +492,7 @@ export default {
|
|
|
492
492
|
},
|
|
493
493
|
},
|
|
494
494
|
safelist: [
|
|
495
|
-
{
|
|
496
|
-
pattern: /font-.*/,
|
|
497
|
-
},
|
|
498
|
-
{
|
|
499
|
-
pattern: /animate-.*/,
|
|
500
|
-
},
|
|
501
|
-
{
|
|
502
|
-
pattern: /shadow-.*/,
|
|
503
|
-
},
|
|
504
|
-
|
|
505
|
-
{
|
|
506
|
-
pattern: /flex-.*/,
|
|
507
|
-
},
|
|
508
|
-
{
|
|
509
|
-
pattern: /overflow-*./,
|
|
510
|
-
},
|
|
511
|
-
{
|
|
512
|
-
pattern: /col-.*/,
|
|
513
|
-
},
|
|
514
|
-
{
|
|
515
|
-
pattern: /row-.*/,
|
|
516
|
-
},
|
|
517
|
-
{
|
|
518
|
-
pattern: /flex-.*/,
|
|
519
|
-
},
|
|
520
|
-
{
|
|
521
|
-
pattern: /justify-.*/,
|
|
522
|
-
},
|
|
523
|
-
{
|
|
524
|
-
pattern: /items-.*/,
|
|
525
|
-
},
|
|
526
|
-
{
|
|
527
|
-
pattern: /grid-.*/,
|
|
528
|
-
},
|
|
529
|
-
{
|
|
530
|
-
pattern: /gap-.*/,
|
|
531
|
-
},
|
|
532
|
-
{
|
|
533
|
-
pattern: /border-.*/,
|
|
534
|
-
},
|
|
535
|
-
{
|
|
536
|
-
pattern: /min-.*/,
|
|
537
|
-
},
|
|
538
|
-
{
|
|
539
|
-
pattern: /max-.*/,
|
|
540
|
-
},
|
|
541
495
|
{ pattern: /w-.*/ },
|
|
542
|
-
{ pattern: /h-.*/ },
|
|
543
496
|
{
|
|
544
497
|
pattern: /top-.*/,
|
|
545
498
|
},
|
|
@@ -558,50 +511,9 @@ export default {
|
|
|
558
511
|
{
|
|
559
512
|
pattern: /right*.*/,
|
|
560
513
|
},
|
|
561
|
-
{ pattern: /bg-.*/ },
|
|
562
|
-
{ pattern: /text-.*/ },
|
|
563
|
-
{
|
|
564
|
-
pattern: /p-.*/,
|
|
565
|
-
},
|
|
566
|
-
{
|
|
567
|
-
pattern: /px-.*/,
|
|
568
|
-
},
|
|
569
|
-
{
|
|
570
|
-
pattern: /pl-.*/,
|
|
571
|
-
},
|
|
572
|
-
{
|
|
573
|
-
pattern: /py-.*/,
|
|
574
|
-
},
|
|
575
|
-
{
|
|
576
|
-
pattern: /pb-.*/,
|
|
577
|
-
},
|
|
578
|
-
{
|
|
579
|
-
pattern: /m-.*/,
|
|
580
|
-
},
|
|
581
|
-
{
|
|
582
|
-
pattern: /mx-.*/,
|
|
583
|
-
},
|
|
584
|
-
{
|
|
585
|
-
pattern: /my-.*/,
|
|
586
|
-
},
|
|
587
|
-
{
|
|
588
|
-
pattern: /z-.*/,
|
|
589
|
-
},
|
|
590
|
-
{
|
|
591
|
-
pattern: /from-.*/,
|
|
592
|
-
},
|
|
593
|
-
{
|
|
594
|
-
pattern: /to-.*/,
|
|
595
|
-
},
|
|
596
|
-
{
|
|
597
|
-
pattern: /via-.*/,
|
|
598
|
-
},
|
|
599
514
|
{
|
|
600
515
|
pattern: /delay-.*/,
|
|
601
516
|
},
|
|
602
|
-
{
|
|
603
|
-
pattern: /overflow-.*/,
|
|
604
|
-
},
|
|
605
517
|
{
|
|
606
518
|
pattern: /duration-.*/,
|
|
607
519
|
},
|
package/text/Formatter.d.ts
CHANGED
package/text/Formatter.js
CHANGED
|
@@ -1,18 +1,81 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
37
|
+
}
|
|
38
|
+
else if (line.startsWith("## ")) {
|
|
12
39
|
return (_jsx("div", { className: "text-2xl", children: line.replace("## ", "") }, index));
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
@@ -4,10 +4,7 @@ export { default as isDebug } from "./isDebug";
|
|
|
4
4
|
export { default as sortByOrder } from "./sortByOrder";
|
|
5
5
|
export { default as checkPathMatch } from "./checkPathMatch";
|
|
6
6
|
export * from "./colors";
|
|
7
|
-
export * from "./display";
|
|
8
|
-
export * from "./displayResponsive";
|
|
9
7
|
export * from "./hooks";
|
|
10
8
|
export * from "./pattern";
|
|
11
|
-
export * from "./position";
|
|
12
9
|
export * from "./shape";
|
|
13
10
|
export * from "./hooks";
|
package/util/index.js
CHANGED
|
@@ -4,10 +4,7 @@ export { default as isDebug } from "./isDebug";
|
|
|
4
4
|
export { default as sortByOrder } from "./sortByOrder";
|
|
5
5
|
export { default as checkPathMatch } from "./checkPathMatch";
|
|
6
6
|
export * from "./colors";
|
|
7
|
-
export * from "./display";
|
|
8
|
-
export * from "./displayResponsive";
|
|
9
7
|
export * from "./hooks";
|
|
10
8
|
export * from "./pattern";
|
|
11
|
-
export * from "./position";
|
|
12
9
|
export * from "./shape";
|
|
13
10
|
export * from "./hooks";
|
package/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.17
|
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,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
|
-
};
|
package/util/position.d.ts
DELETED
|
@@ -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
|
-
};
|