@agility/plenum-ui 1.3.43 → 1.3.45
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/lib/index.js
CHANGED
|
@@ -7047,7 +7047,7 @@ function Loader(_a) {
|
|
|
7047
7047
|
var Button = function (_a, ref) {
|
|
7048
7048
|
var _b = _a.type, type = _b === void 0 ? "primary" : _b, _c = _a.size, size = _c === void 0 ? "base" : _c, onClick = _a.onClick, label = _a.label, isDisabled = _a.isDisabled, icon = _a.icon, iconObj = _a.iconObj, _d = _a.isLoading, isLoading = _d === void 0 ? false : _d, _e = _a.isSubmit, isSubmit = _e === void 0 ? false : _e, _f = _a.isWidthFull, isWidthFull = _f === void 0 ? false : _f, className = _a.className, title = _a.title, asLink = _a.asLink;
|
|
7049
7049
|
var iconStyles = cn("h-5 w-5", { "text-white": type === "primary" || type === "danger" }, { "text-purple-700": type === "secondary" }, { "text-gray-700": type === "alternative" });
|
|
7050
|
-
return !asLink ? (React__default["default"].createElement("button", { ref: ref, type: isSubmit ? "submit" : "button", title: title, className: cn("inline-flex items-center justify-center space-x-2
|
|
7050
|
+
return !asLink ? (React__default["default"].createElement("button", { ref: ref, type: isSubmit ? "submit" : "button", title: title, className: cn("inline-flex items-center justify-center space-x-2 border transition-all", { "w-full": isWidthFull === true }, { "rounded-[3px] px-4 py-2 text-sm": size === "sm" }, { "rounded px-5 py-2 text-base": size === "base" }, { "rounded px-5 py-2 text-lg": size === "lg" }, {
|
|
7051
7051
|
"cursor-auto opacity-50": isDisabled
|
|
7052
7052
|
}, {
|
|
7053
7053
|
"active: border-purple-600 bg-purple-600 text-white hover:border-purple-700 hover:bg-purple-700 active:border-purple-800 active:bg-purple-800": type === "primary"
|
|
@@ -7066,7 +7066,11 @@ var Button = function (_a, ref) {
|
|
|
7066
7066
|
icon &&
|
|
7067
7067
|
(isLoading ? (React__default["default"].createElement(Loader, { classes: "h-5 w-5 border-2 m-0" })) : (React__default["default"].createElement(DynamicIcons, { icon: icon, className: iconStyles, outline: false }))),
|
|
7068
7068
|
!icon && !iconObj && isLoading && (React__default["default"].createElement(Loader, { classes: "h-5 w-5 border-2 m-0" })),
|
|
7069
|
-
label && React__default["default"].createElement("span", null, label))) : (React__default["default"].createElement("a", { type: isSubmit ? "submit" : "button", title: asLink.title || title, href: asLink.href, target: asLink.target,
|
|
7069
|
+
label && React__default["default"].createElement("span", null, label))) : (React__default["default"].createElement("a", { type: isSubmit ? "submit" : "button", title: asLink.title || title, href: asLink.href, target: asLink.target, onClick: function (e) {
|
|
7070
|
+
if (!isDisabled && onClick) {
|
|
7071
|
+
onClick(e);
|
|
7072
|
+
}
|
|
7073
|
+
}, className: cn("inline-flex items-center justify-center space-x-2 rounded border transition-all", { "w-full": isWidthFull === true }, { "px-4 py-2 text-sm": size === "sm" }, { "px-5 py-2 text-base": size === "base" }, { "px-5 py-2 text-lg": size === "lg" }, {
|
|
7070
7074
|
"cursor-auto opacity-50": isDisabled
|
|
7071
7075
|
}, {
|
|
7072
7076
|
"active: border-purple-600 bg-purple-600 text-white hover:border-purple-700 hover:bg-purple-700 active:border-purple-800 active:bg-purple-800": type === "primary"
|