@edu-tosel/design 1.0.348 → 1.0.349
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.
|
@@ -4,6 +4,12 @@ type ShortcutContent = {
|
|
|
4
4
|
label?: string;
|
|
5
5
|
title?: string;
|
|
6
6
|
content?: string;
|
|
7
|
+
button?: {
|
|
8
|
+
text: string;
|
|
9
|
+
option?: string;
|
|
10
|
+
align?: "left" | "center" | "right";
|
|
11
|
+
onClick?: () => void;
|
|
12
|
+
};
|
|
7
13
|
};
|
|
8
14
|
export default function ShortcutBanner({ shortcuts, }: {
|
|
9
15
|
shortcuts: (Button & {
|
|
@@ -51,7 +51,6 @@ function ScrollMode({ shortcuts, selectedIndex, setSelectedIndex, }) {
|
|
|
51
51
|
};
|
|
52
52
|
return (_jsx("div", { className: cn(scrollWrapper), children: _jsx("div", { className: cn(buttonWrapper), children: shortcuts.map((shortcut, index) => (_jsxs("button", { onClick: () => {
|
|
53
53
|
setSelectedIndex(index);
|
|
54
|
-
shortcut.onClick?.();
|
|
55
54
|
}, className: cn(buttonSet, selectedIndex === index ? "border-b-[3px] border-black" : ""), children: [_jsx("div", { className: cn(iconContainer, shortcut.background ?? "bg-gray-100"), children: _jsx("img", { src: shortcut.icon, alt: shortcut.title }) }), _jsx("div", { className: cn(tagBox), children: shortcut.title })] }, shortcut.title))) }) }));
|
|
56
55
|
}
|
|
57
56
|
function GridMode({ shortcuts, selectedIndex, setSelectedIndex, }) {
|
|
@@ -90,7 +89,6 @@ function GridMode({ shortcuts, selectedIndex, setSelectedIndex, }) {
|
|
|
90
89
|
};
|
|
91
90
|
return (_jsx("div", { className: cn(container), children: _jsx("div", { className: cn(gridWrapper), children: shortcuts.map((shortcut, index) => (_jsxs("button", { onClick: () => {
|
|
92
91
|
setSelectedIndex(index);
|
|
93
|
-
shortcut.onClick?.();
|
|
94
92
|
}, className: cn(buttonSet, selectedIndex === index ? "border-b-[3px] border-black" : ""), children: [_jsx("div", { className: cn(iconContainer, shortcut.background ?? "bg-gray-100"), children: _jsx("img", { src: shortcut.icon, alt: shortcut.title }) }), _jsx("div", { className: cn(tagBox), children: shortcut.title })] }, shortcut.title))) }) }));
|
|
95
93
|
}
|
|
96
94
|
function ShortcutContent({ content }) {
|
|
@@ -129,7 +127,18 @@ function ShortcutContent({ content }) {
|
|
|
129
127
|
const contentStyle = {
|
|
130
128
|
fonts: "text-base md:text-lg text-gray-600 leading-relaxed",
|
|
131
129
|
};
|
|
132
|
-
|
|
130
|
+
const getButtonAlignClass = (align) => {
|
|
131
|
+
switch (align) {
|
|
132
|
+
case "left":
|
|
133
|
+
return "justify-start";
|
|
134
|
+
case "right":
|
|
135
|
+
return "justify-end";
|
|
136
|
+
case "center":
|
|
137
|
+
default:
|
|
138
|
+
return "justify-center";
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
return (_jsxs("div", { className: cn(container), children: [content.image && (_jsx("div", { className: cn(imageContainer), children: _jsx("img", { src: content.image, alt: content.title || "Content image", className: "w-full h-auto object-contain" }) })), _jsxs("div", { className: cn(textContainer), children: [content.label && (_jsx("div", { className: cn(labelStyle), children: content.label })), content.title && (_jsx("div", { className: cn(titleStyle), children: content.title })), content.content && (_jsx("div", { className: cn(contentStyle), children: content.content })), content.button && (_jsx("div", { className: `flex ${getButtonAlignClass(content.button.align)}`, children: _jsx("button", { onClick: content.button.onClick, className: content.button.option || "px-6 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600 transition-colors", children: content.button.text }) }))] })] }));
|
|
133
142
|
}
|
|
134
143
|
function ModeToggle({ state, selectOptions: selectOptionsInput, option, }) {
|
|
135
144
|
const selectOptions = selectOptionsInput?.map(toSelectOption);
|
package/package.json
CHANGED
package/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.349
|