@edu-tosel/design 1.0.293 → 1.0.295
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/layout/template/Announcement/One.d.ts +3 -1
- package/layout/template/Announcement/One.js +9 -3
- package/package.json +1 -1
- package/version.txt +1 -1
- package/widget/design/Label.design.js +1 -0
- package/widget/index.d.ts +1 -0
- package/widget/index.js +1 -0
- package/widget/template/SelectRoll.d.ts +15 -0
- package/widget/template/SelectRoll.js +42 -0
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { Button as _Button } from "../../../interface";
|
|
1
2
|
interface OneLayoutProps {
|
|
2
3
|
title: string;
|
|
3
4
|
date: string;
|
|
4
5
|
content: string;
|
|
6
|
+
button?: _Button;
|
|
5
7
|
}
|
|
6
|
-
export default function One({ title, date, content }: OneLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default function One({ title, date, content, button }: OneLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
7
9
|
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cn, isHTMLString } from "../../../util";
|
|
3
|
-
|
|
3
|
+
import { Label } from "../../../widget";
|
|
4
|
+
export default function One({ title, date, content, button }) {
|
|
4
5
|
const body = {
|
|
5
6
|
sizes: "w-full max-w-[1200px]",
|
|
6
|
-
boundaries: "pl-12
|
|
7
|
+
boundaries: "pb-8 px-3.5 md:pl-12 md:pr-0",
|
|
7
8
|
};
|
|
8
9
|
const titleBox = {
|
|
9
10
|
sizes: "w-full h-30",
|
|
@@ -13,5 +14,10 @@ export default function One({ title, date, content }) {
|
|
|
13
14
|
const contentBox = {
|
|
14
15
|
boundaries: "pt-12",
|
|
15
16
|
};
|
|
16
|
-
return (_jsxs("div", { className: cn(body), children: [_jsxs("div", { className: cn(titleBox), children: [_jsx("div", { className: "text-[24px] font-pretendard-bold", children: title }), _jsx("div", { className: "text-gray-medium", children: date })] }), isHTMLString(content) ? (_jsx("div", { dangerouslySetInnerHTML: { __html: content }, className: cn(contentBox) })) : (_jsx("div", { className: cn(contentBox), children: content }))
|
|
17
|
+
return (_jsxs("div", { className: cn(body), children: [_jsxs("div", { className: cn(titleBox), children: [_jsx("div", { className: "text-[24px] font-pretendard-bold", children: title }), _jsx("div", { className: "text-gray-medium", children: date })] }), isHTMLString(content) ? (_jsx("div", { dangerouslySetInnerHTML: { __html: content }, className: cn(contentBox) })) : (_jsx("div", { className: cn(contentBox), children: content })), _jsx("div", { className: "pt-6", children: button && (_jsx(Label.Button, { ...button, option: {
|
|
18
|
+
width: "full",
|
|
19
|
+
height: "lg",
|
|
20
|
+
background: "bg-green-dark",
|
|
21
|
+
text: "text-white",
|
|
22
|
+
} })) })] }));
|
|
17
23
|
}
|
package/package.json
CHANGED
package/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.295
|
package/widget/index.d.ts
CHANGED
|
@@ -10,3 +10,4 @@ export { default as Switch } from "./template/Switch";
|
|
|
10
10
|
export { default as Toggle } from "./template/Toggle";
|
|
11
11
|
export { default as Obstacle } from "./template/Obstacle";
|
|
12
12
|
export { default as Pagination } from "./template/Pagination";
|
|
13
|
+
export { default as SelectRoll } from "./template/SelectRoll";
|
package/widget/index.js
CHANGED
|
@@ -10,3 +10,4 @@ export { default as Switch } from "./template/Switch";
|
|
|
10
10
|
export { default as Toggle } from "./template/Toggle";
|
|
11
11
|
export { default as Obstacle } from "./template/Obstacle";
|
|
12
12
|
export { default as Pagination } from "./template/Pagination";
|
|
13
|
+
export { default as SelectRoll } from "./template/SelectRoll";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface SelectRollOption {
|
|
2
|
+
key: string;
|
|
3
|
+
value: string;
|
|
4
|
+
option?: {
|
|
5
|
+
background?: string;
|
|
6
|
+
text?: string;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
interface SelectRollProps {
|
|
10
|
+
options: SelectRollOption[];
|
|
11
|
+
value: string;
|
|
12
|
+
onChange: (value: string) => void;
|
|
13
|
+
}
|
|
14
|
+
export default function SelectRoll({ options, value, onChange, }: SelectRollProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// /Users/design/Documents/GitHub/design/src/widget/template/SelectRoll.tsx
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { cn } from "../../util";
|
|
5
|
+
export default function SelectRoll({ options, value, onChange, }) {
|
|
6
|
+
const [isHover, setIsHover] = useState(false);
|
|
7
|
+
const currentIndex = options.findIndex((option) => option.key === value);
|
|
8
|
+
const handlePrev = () => {
|
|
9
|
+
if (currentIndex > 0) {
|
|
10
|
+
onChange(options[currentIndex - 1].key);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
const handleNext = () => {
|
|
14
|
+
if (currentIndex < options.length - 1) {
|
|
15
|
+
onChange(options[currentIndex + 1].key);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
const currentOption = options[currentIndex];
|
|
19
|
+
const container = {
|
|
20
|
+
styles: "group cursor-default",
|
|
21
|
+
displays: "flex justify-center",
|
|
22
|
+
sizes: "w-[120px]",
|
|
23
|
+
};
|
|
24
|
+
const body = {
|
|
25
|
+
positions: "relative",
|
|
26
|
+
displays: "flex justify-center items-center",
|
|
27
|
+
backgrounds: currentOption?.option?.background || "bg-gray-100",
|
|
28
|
+
texts: currentOption?.option?.text || "text-black",
|
|
29
|
+
sizes: "w-[120px] h-[30px]",
|
|
30
|
+
transitions: "duration-300",
|
|
31
|
+
hoverAct: isHover ? "w-[120px]" : "w-[100px]",
|
|
32
|
+
fonts: "text-[12px]",
|
|
33
|
+
styles: "rounded-[6px] leading-none overflow-hidden",
|
|
34
|
+
};
|
|
35
|
+
const toggle = {
|
|
36
|
+
positions: "absolute",
|
|
37
|
+
displays: "flex justify-center items-center",
|
|
38
|
+
sizes: "w-[20px] h-full",
|
|
39
|
+
styles: "duration-300 text-gray-dark",
|
|
40
|
+
};
|
|
41
|
+
return (_jsx("div", { className: cn(container), children: _jsxs("div", { className: cn(body), onMouseLeave: () => setIsHover(false), onMouseEnter: () => setIsHover(true), children: [currentOption?.value, _jsx("button", { onClick: handlePrev, className: cn(toggle, "-left-4 group-hover:left-1"), children: "-" }), _jsx("button", { onClick: handleNext, className: cn(toggle, "-right-4 group-hover:right-1"), children: "+" })] }) }));
|
|
42
|
+
}
|