@windrun-huaiin/third-ui 5.9.6 → 5.9.7
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/dist/main/index.d.mts +2 -0
- package/dist/main/index.d.ts +2 -0
- package/dist/main/index.js +9 -7
- package/dist/main/index.js.map +1 -1
- package/dist/main/index.mjs +9 -7
- package/dist/main/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/main/x-button.tsx +11 -7
package/dist/main/index.d.mts
CHANGED
|
@@ -81,6 +81,8 @@ interface SplitButtonProps {
|
|
|
81
81
|
loadingText?: string;
|
|
82
82
|
menuWidth?: string;
|
|
83
83
|
className?: string;
|
|
84
|
+
mainButtonClassName?: string;
|
|
85
|
+
dropdownButtonClassName?: string;
|
|
84
86
|
}
|
|
85
87
|
type xButtonProps = SingleButtonProps | SplitButtonProps;
|
|
86
88
|
declare const XButtonIcons: {
|
package/dist/main/index.d.ts
CHANGED
|
@@ -81,6 +81,8 @@ interface SplitButtonProps {
|
|
|
81
81
|
loadingText?: string;
|
|
82
82
|
menuWidth?: string;
|
|
83
83
|
className?: string;
|
|
84
|
+
mainButtonClassName?: string;
|
|
85
|
+
dropdownButtonClassName?: string;
|
|
84
86
|
}
|
|
85
87
|
type xButtonProps = SingleButtonProps | SplitButtonProps;
|
|
86
88
|
declare const XButtonIcons: {
|
package/dist/main/index.js
CHANGED
|
@@ -6121,7 +6121,7 @@ function XButton(props) {
|
|
|
6121
6121
|
setIsLoading(false);
|
|
6122
6122
|
}
|
|
6123
6123
|
});
|
|
6124
|
-
const baseButtonClass = "flex items-center justify-center px-4 py-2 bg-neutral-
|
|
6124
|
+
const baseButtonClass = "flex items-center justify-center px-4 py-2 bg-neutral-200 dark:bg-neutral-800 text-neutral-700 dark:text-white text-sm font-semibold transition-colors hover:bg-neutral-300 dark:hover:bg-neutral-700";
|
|
6125
6125
|
const disabledClass = "opacity-60 cursor-not-allowed";
|
|
6126
6126
|
if (props.type === "single") {
|
|
6127
6127
|
const { button, loadingText: loadingText2, minWidth = "min-w-[110px]", className: className2 = "" } = props;
|
|
@@ -6144,19 +6144,20 @@ function XButton(props) {
|
|
|
6144
6144
|
}
|
|
6145
6145
|
);
|
|
6146
6146
|
}
|
|
6147
|
-
const { mainButton, menuItems, loadingText, menuWidth = "w-40", className = "" } = props;
|
|
6147
|
+
const { mainButton, menuItems, loadingText, menuWidth = "w-40", className = "", mainButtonClassName = "", dropdownButtonClassName = "" } = props;
|
|
6148
6148
|
const isMainDisabled = mainButton.disabled || isLoading;
|
|
6149
6149
|
const actualLoadingText = loadingText || ((_b = mainButton.text) == null ? void 0 : _b.trim()) || "Loading...";
|
|
6150
|
-
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: `relative flex bg-neutral-
|
|
6150
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: `relative flex bg-neutral-200 dark:bg-neutral-800 rounded-full ${className}`, children: [
|
|
6151
6151
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6152
6152
|
"button",
|
|
6153
6153
|
{
|
|
6154
6154
|
onClick: () => handleButtonClick(mainButton.onClick),
|
|
6155
6155
|
disabled: isMainDisabled,
|
|
6156
|
-
className: `flex-1 ${baseButtonClass} rounded-l-full ${isMainDisabled ? disabledClass : ""}`,
|
|
6156
|
+
className: `flex-1 ${baseButtonClass} rounded-l-full ${isMainDisabled ? disabledClass : ""} ${mainButtonClassName}`,
|
|
6157
6157
|
onMouseDown: (e) => {
|
|
6158
6158
|
if (e.button === 2) e.preventDefault();
|
|
6159
6159
|
},
|
|
6160
|
+
style: { borderTopRightRadius: 0, borderBottomRightRadius: 0 },
|
|
6160
6161
|
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
6161
6162
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(globalLucideIcons.Loader2, { className: "w-5 h-5 mr-1 animate-spin" }),
|
|
6162
6163
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { children: actualLoadingText })
|
|
@@ -6169,12 +6170,13 @@ function XButton(props) {
|
|
|
6169
6170
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6170
6171
|
"span",
|
|
6171
6172
|
{
|
|
6172
|
-
className:
|
|
6173
|
+
className: `flex items-center justify-center w-10 py-2 cursor-pointer transition hover:bg-neutral-300 dark:hover:bg-neutral-700 rounded-r-full ${dropdownButtonClassName}`,
|
|
6173
6174
|
onClick: (e) => {
|
|
6174
6175
|
e.stopPropagation();
|
|
6175
6176
|
setMenuOpen((v) => !v);
|
|
6176
6177
|
},
|
|
6177
6178
|
tabIndex: 0,
|
|
6179
|
+
style: { borderTopLeftRadius: 0, borderBottomLeftRadius: 0 },
|
|
6178
6180
|
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(globalLucideIcons.ChevronDown, { className: "w-6 h-6" })
|
|
6179
6181
|
}
|
|
6180
6182
|
),
|
|
@@ -6191,7 +6193,7 @@ function XButton(props) {
|
|
|
6191
6193
|
setMenuOpen(false);
|
|
6192
6194
|
},
|
|
6193
6195
|
disabled: item.disabled,
|
|
6194
|
-
className: `flex items-center w-full px-4 py-3 transition hover:bg-neutral-
|
|
6196
|
+
className: `flex items-center w-full px-4 py-3 transition hover:bg-neutral-300 dark:hover:bg-neutral-600 text-left relative ${item.disabled ? disabledClass : ""}`,
|
|
6195
6197
|
children: [
|
|
6196
6198
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("span", { className: "flex items-center", children: [
|
|
6197
6199
|
item.icon,
|
|
@@ -6201,7 +6203,7 @@ function XButton(props) {
|
|
|
6201
6203
|
"span",
|
|
6202
6204
|
{
|
|
6203
6205
|
className: "absolute right-3 top-1 text-[10px] font-semibold",
|
|
6204
|
-
style: { color: item.tag.color || "#
|
|
6206
|
+
style: { color: item.tag.color || "#A855F7", pointerEvents: "none" },
|
|
6205
6207
|
children: item.tag.text
|
|
6206
6208
|
}
|
|
6207
6209
|
)
|