@edu-tosel/design 1.0.114 → 1.0.115
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/design/Board.design.js +1 -1
- package/interface/domain/Tag.d.ts +2 -7
- package/interface/domain/Tag.js +4 -10
- package/interface/widget/Carousel.d.ts +6 -2
- package/layout/template/home/layout/Carousel.d.ts +1 -2
- package/layout/template/home/layout/Carousel.js +19 -10
- package/layout/template/home/layout/Header.js +6 -3
- package/package.json +1 -1
- package/version.txt +1 -1
|
@@ -43,8 +43,8 @@ export function Board({ children, action, option, debug, buttons, }) {
|
|
|
43
43
|
positions: "fixed bottom-20 right-4 xl:absolute xl:-bottom-18.5 xl:right-0",
|
|
44
44
|
};
|
|
45
45
|
return (_jsxs("div", { className: cn(container), children: [_jsx(Action.Show, { actions: shows, children: _jsx("div", { className: cn(body), children: children }) }), _jsx("div", { className: cn(button), children: buttons?.map(({ title, onClick, option }) => (_jsx(Label.Button, { title: title, onClick: onClick, option: {
|
|
46
|
-
...option,
|
|
47
46
|
text: "text-white",
|
|
48
47
|
background: "bg-crimson-burgundy",
|
|
48
|
+
...option,
|
|
49
49
|
} }))) })] }));
|
|
50
50
|
}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
type Tag = "NEW" | "REG";
|
|
2
|
-
|
|
3
|
-
title: string;
|
|
4
|
-
background: string;
|
|
5
|
-
}
|
|
6
|
-
declare const TagStyles: Record<Tag, Styles>;
|
|
1
|
+
type Tag = "NEW" | "REG" | "RCU";
|
|
2
|
+
export declare const tagString: Record<Tag, string>;
|
|
7
3
|
export type { Tag };
|
|
8
|
-
export { TagStyles };
|
package/interface/domain/Tag.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
const
|
|
2
|
-
NEW:
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
},
|
|
6
|
-
REG: {
|
|
7
|
-
title: "정기시험",
|
|
8
|
-
background: "bg-crimson-burgundy",
|
|
9
|
-
},
|
|
1
|
+
export const tagString = {
|
|
2
|
+
NEW: "신규론칭",
|
|
3
|
+
REG: "정기시험",
|
|
4
|
+
RCU: "모집 중"
|
|
10
5
|
};
|
|
11
|
-
export { TagStyles };
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { Titles } from "../Property";
|
|
2
2
|
export type { CarouselContent };
|
|
3
|
+
type Tag = "NEW" | "REG" | "RCU";
|
|
3
4
|
interface Option {
|
|
4
5
|
background: string;
|
|
5
6
|
text: string;
|
|
6
7
|
}
|
|
7
|
-
interface CarouselContent
|
|
8
|
-
tag:
|
|
8
|
+
interface CarouselContent {
|
|
9
|
+
tag: {
|
|
10
|
+
type: Tag;
|
|
11
|
+
background: string;
|
|
12
|
+
};
|
|
9
13
|
titles: Titles;
|
|
10
14
|
image?: string;
|
|
11
15
|
option?: Partial<Option>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { CarouselContent } from "../../../../interface";
|
|
2
|
-
import { Tag } from "../../../../interface/domain";
|
|
3
2
|
export default function Carousel({ contents, }: {
|
|
4
|
-
contents: CarouselContent
|
|
3
|
+
contents: CarouselContent[];
|
|
5
4
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
|
+
import { useTransition } from "react-spring";
|
|
3
4
|
import { cn } from "../../../../util";
|
|
4
5
|
import { useEase } from "../../../../hook";
|
|
5
6
|
import { LineBreaks } from "../../../../text";
|
|
6
7
|
import SVG from "../../../../asset/SVG";
|
|
7
|
-
import {
|
|
8
|
+
import { tagString } from "../../../../interface/domain";
|
|
8
9
|
export default function Carousel({ contents, }) {
|
|
9
10
|
const [index, setIndex] = useState(0);
|
|
10
11
|
const [flag, inTime] = useEase(10000, 1000);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
// Automatically change index every 5 seconds
|
|
14
|
+
const interval = setInterval(() => {
|
|
15
|
+
setIndex((prevIndex) => (prevIndex + 1) % contents.length);
|
|
16
|
+
}, 5000);
|
|
17
|
+
return () => clearInterval(interval);
|
|
18
|
+
}, [contents.length]);
|
|
16
19
|
const { tag, titles, image, option } = contents[index];
|
|
17
20
|
const { text, background } = option ?? {};
|
|
18
21
|
const container = {
|
|
@@ -29,15 +32,21 @@ export default function Carousel({ contents, }) {
|
|
|
29
32
|
const tagBox = {
|
|
30
33
|
displays: "flex justify-center items-center",
|
|
31
34
|
sizes: "w-20 h-8",
|
|
32
|
-
background:
|
|
35
|
+
background: tag.background,
|
|
33
36
|
fonts: "text-white font-pretendard-bold text-lg leading-none",
|
|
34
37
|
styles: "rounded-md",
|
|
35
38
|
};
|
|
36
39
|
const buttonBox = {
|
|
37
40
|
positions: "absolute bottom-0 left-0",
|
|
38
|
-
displays: "flex justify-
|
|
41
|
+
displays: "flex justify-center items-center gap-1",
|
|
39
42
|
sizes: "w-23.25 h-6.25 bg-gray-dark rounded-full",
|
|
40
43
|
paddings: "px-1.5 ml-7.5",
|
|
41
44
|
};
|
|
42
|
-
|
|
45
|
+
const transitions = useTransition(!!image, {
|
|
46
|
+
from: { opacity: 0 },
|
|
47
|
+
enter: { opacity: 1 },
|
|
48
|
+
leave: { opacity: 0 },
|
|
49
|
+
config: { duration: 200 },
|
|
50
|
+
});
|
|
51
|
+
return (_jsx("div", { className: cn(container), children: _jsxs("div", { className: cn(body), children: [_jsxs("div", { className: "relative w-72 h-50 flex flex-col pl-7.5", children: [_jsx("div", { className: `${cn(tagBox)} duration-1000 transition-all`, children: tagString[tag.type] }), _jsx("div", { className: "font-pretendard-bold text-2xl mt-2 duration-200 transition-all", children: titles.title }), _jsx(LineBreaks, { className: "mt-7.5 duration-1000 transition-all", texts: titles.subtitle }), _jsxs("div", { className: cn(buttonBox), children: [_jsx("button", { onClick: () => setIndex((index - 1 + contents.length) % contents.length), className: "w-5 h-5 flex justify-center items-center", children: _jsx(SVG.Symbol.LessThan, {}) }), _jsxs("div", { className: "flex flex-row gap-2 justify-center items-center", children: [_jsx("div", { className: "text-white w-2 text-sm", children: index + 1 }), _jsx("div", { className: "w-0.5 h-3 bg-gray-medium" }), _jsx("div", { className: "text-white w-2 text-sm", children: contents.length })] }), _jsx("button", { onClick: () => setIndex((index + 1) % contents.length), className: "w-5 h-5 flex justify-center items-center", children: _jsx(SVG.Symbol.GreaterThan, {}) })] })] }), image && (_jsx("img", { src: image, alt: "carousel-image", className: "absolute bottom-0 right-0 object-cover sm:h-full duration-2000 transition-all" }))] }) }));
|
|
43
52
|
}
|
|
@@ -5,16 +5,19 @@ export default function Header({ logo, rightButton, contents, }) {
|
|
|
5
5
|
const container = {
|
|
6
6
|
displays: "flex justify-center items-center",
|
|
7
7
|
sizes: "w-full",
|
|
8
|
-
styles: "bg-white
|
|
8
|
+
styles: "bg-white box-shadow ",
|
|
9
9
|
};
|
|
10
10
|
const body = {
|
|
11
11
|
displays: "flex items-center justify-center md:justify-between",
|
|
12
12
|
className: "w-full max-w-[1200px] h-15",
|
|
13
|
-
boundaries: "md:px-12",
|
|
13
|
+
boundaries: "md:px-12 py-2.5",
|
|
14
14
|
};
|
|
15
15
|
const buttonBox = {
|
|
16
16
|
fonts: "text-[9px] xs:text-[10px] sm:text-[11px] md:text-[16px] leading-tight",
|
|
17
|
-
texts: "text-gray-dark",
|
|
17
|
+
texts: "text-gray-dark hover:text-black",
|
|
18
|
+
backgrounds: "hover:bg-[#F0F0F0]/50",
|
|
19
|
+
animations: "duration-300",
|
|
20
|
+
sizes: "h-10 rounded-md",
|
|
18
21
|
boundaries: "px-0.5 md:px-2.5",
|
|
19
22
|
};
|
|
20
23
|
return (_jsx("div", { className: cn(container), children: _jsxs("div", { className: cn(body), children: [_jsx("div", { className: "hidden md:block", onClick: logo.onClick, children: logo.node }), _jsxs("div", { className: "flex items-center gap-x-7.5 md:gap-x-12", children: [_jsx("div", { className: "flex items-center gap-2.5", children: contents.map((button, index) => (_jsx("button", { onClick: button.onClick, className: cn(buttonBox), children: button.title }, index))) }), rightButton && (_jsx(Label.Button, { title: rightButton.title, onClick: rightButton?.onClick, option: {
|
package/package.json
CHANGED
package/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.115
|