@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.mjs
CHANGED
|
@@ -6078,7 +6078,7 @@ function XButton(props) {
|
|
|
6078
6078
|
setIsLoading(false);
|
|
6079
6079
|
}
|
|
6080
6080
|
});
|
|
6081
|
-
const baseButtonClass = "flex items-center justify-center px-4 py-2 bg-neutral-
|
|
6081
|
+
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";
|
|
6082
6082
|
const disabledClass = "opacity-60 cursor-not-allowed";
|
|
6083
6083
|
if (props.type === "single") {
|
|
6084
6084
|
const { button, loadingText: loadingText2, minWidth = "min-w-[110px]", className: className2 = "" } = props;
|
|
@@ -6101,19 +6101,20 @@ function XButton(props) {
|
|
|
6101
6101
|
}
|
|
6102
6102
|
);
|
|
6103
6103
|
}
|
|
6104
|
-
const { mainButton, menuItems, loadingText, menuWidth = "w-40", className = "" } = props;
|
|
6104
|
+
const { mainButton, menuItems, loadingText, menuWidth = "w-40", className = "", mainButtonClassName = "", dropdownButtonClassName = "" } = props;
|
|
6105
6105
|
const isMainDisabled = mainButton.disabled || isLoading;
|
|
6106
6106
|
const actualLoadingText = loadingText || ((_b = mainButton.text) == null ? void 0 : _b.trim()) || "Loading...";
|
|
6107
|
-
return /* @__PURE__ */ jsxs26("div", { className: `relative flex bg-neutral-
|
|
6107
|
+
return /* @__PURE__ */ jsxs26("div", { className: `relative flex bg-neutral-200 dark:bg-neutral-800 rounded-full ${className}`, children: [
|
|
6108
6108
|
/* @__PURE__ */ jsx56(
|
|
6109
6109
|
"button",
|
|
6110
6110
|
{
|
|
6111
6111
|
onClick: () => handleButtonClick(mainButton.onClick),
|
|
6112
6112
|
disabled: isMainDisabled,
|
|
6113
|
-
className: `flex-1 ${baseButtonClass} rounded-l-full ${isMainDisabled ? disabledClass : ""}`,
|
|
6113
|
+
className: `flex-1 ${baseButtonClass} rounded-l-full ${isMainDisabled ? disabledClass : ""} ${mainButtonClassName}`,
|
|
6114
6114
|
onMouseDown: (e) => {
|
|
6115
6115
|
if (e.button === 2) e.preventDefault();
|
|
6116
6116
|
},
|
|
6117
|
+
style: { borderTopRightRadius: 0, borderBottomRightRadius: 0 },
|
|
6117
6118
|
children: isLoading ? /* @__PURE__ */ jsxs26(Fragment9, { children: [
|
|
6118
6119
|
/* @__PURE__ */ jsx56(globalLucideIcons.Loader2, { className: "w-5 h-5 mr-1 animate-spin" }),
|
|
6119
6120
|
/* @__PURE__ */ jsx56("span", { children: actualLoadingText })
|
|
@@ -6126,12 +6127,13 @@ function XButton(props) {
|
|
|
6126
6127
|
/* @__PURE__ */ jsx56(
|
|
6127
6128
|
"span",
|
|
6128
6129
|
{
|
|
6129
|
-
className:
|
|
6130
|
+
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}`,
|
|
6130
6131
|
onClick: (e) => {
|
|
6131
6132
|
e.stopPropagation();
|
|
6132
6133
|
setMenuOpen((v) => !v);
|
|
6133
6134
|
},
|
|
6134
6135
|
tabIndex: 0,
|
|
6136
|
+
style: { borderTopLeftRadius: 0, borderBottomLeftRadius: 0 },
|
|
6135
6137
|
children: /* @__PURE__ */ jsx56(globalLucideIcons.ChevronDown, { className: "w-6 h-6" })
|
|
6136
6138
|
}
|
|
6137
6139
|
),
|
|
@@ -6148,7 +6150,7 @@ function XButton(props) {
|
|
|
6148
6150
|
setMenuOpen(false);
|
|
6149
6151
|
},
|
|
6150
6152
|
disabled: item.disabled,
|
|
6151
|
-
className: `flex items-center w-full px-4 py-3 transition hover:bg-neutral-
|
|
6153
|
+
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 : ""}`,
|
|
6152
6154
|
children: [
|
|
6153
6155
|
/* @__PURE__ */ jsxs26("span", { className: "flex items-center", children: [
|
|
6154
6156
|
item.icon,
|
|
@@ -6158,7 +6160,7 @@ function XButton(props) {
|
|
|
6158
6160
|
"span",
|
|
6159
6161
|
{
|
|
6160
6162
|
className: "absolute right-3 top-1 text-[10px] font-semibold",
|
|
6161
|
-
style: { color: item.tag.color || "#
|
|
6163
|
+
style: { color: item.tag.color || "#A855F7", pointerEvents: "none" },
|
|
6162
6164
|
children: item.tag.text
|
|
6163
6165
|
}
|
|
6164
6166
|
)
|