@agility/plenum-ui 1.3.34 → 1.3.35
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/components/Button/Button.d.ts +9 -1
- package/lib/index.esm.js +18 -2
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +18 -2
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -7046,9 +7046,9 @@ function Loader(_a) {
|
|
|
7046
7046
|
* Primary UI component for user interaction
|
|
7047
7047
|
*/
|
|
7048
7048
|
var Button = function (_a, ref) {
|
|
7049
|
-
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;
|
|
7049
|
+
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;
|
|
7050
7050
|
var iconStyles = cn("h-5 w-5", { "text-white": type === "primary" || type === "danger" }, { "text-purple-700": type === "secondary" }, { "text-gray-700": type === "alternative" });
|
|
7051
|
-
return (React__default["default"].createElement("button", { ref: ref, type: isSubmit ? "submit" : "button", title: title, 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" }, {
|
|
7051
|
+
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 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" }, {
|
|
7052
7052
|
"cursor-auto opacity-50": isDisabled
|
|
7053
7053
|
}, {
|
|
7054
7054
|
"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"
|
|
@@ -7067,6 +7067,22 @@ var Button = function (_a, ref) {
|
|
|
7067
7067
|
icon &&
|
|
7068
7068
|
(isLoading ? (React__default["default"].createElement(Loader, { classes: "h-5 w-5 border-2" })) : (React__default["default"].createElement(DynamicIcons, { icon: icon, className: iconStyles, outline: false }))),
|
|
7069
7069
|
!icon && !iconObj && isLoading && (React__default["default"].createElement(Loader, { classes: "h-5 w-5 border-2" })),
|
|
7070
|
+
label && React__default["default"].createElement("span", null, label))) : (React__default["default"].createElement("a", { type: isSubmit ? "submit" : "button", title: asLink.title || title, href: asLink.href, 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" }, {
|
|
7071
|
+
"cursor-auto opacity-50": isDisabled
|
|
7072
|
+
}, {
|
|
7073
|
+
"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"
|
|
7074
|
+
}, {
|
|
7075
|
+
"border-purple-100 bg-purple-100 text-purple-700 hover:border-purple-200 hover:bg-purple-200 hover:text-purple-700 active:border-purple-300 active:bg-purple-300": type === "secondary"
|
|
7076
|
+
}, {
|
|
7077
|
+
"border-gray-300 bg-white text-gray-700 hover:bg-gray-50 hover:text-gray-700 active:bg-gray-100": type === "alternative"
|
|
7078
|
+
}, {
|
|
7079
|
+
"border-red-300 bg-red-600 text-white hover:bg-red-700 hover:text-white": type === "danger"
|
|
7080
|
+
}, className), "aria-disabled": isDisabled },
|
|
7081
|
+
iconObj &&
|
|
7082
|
+
(isLoading ? (React__default["default"].createElement(Loader, { classes: "h-5 w-5 border-2" })) : (React__default["default"].createElement(React__default["default"].Fragment, null, iconObj))),
|
|
7083
|
+
icon &&
|
|
7084
|
+
(isLoading ? (React__default["default"].createElement(Loader, { classes: "h-5 w-5 border-2" })) : (React__default["default"].createElement(DynamicIcons, { icon: icon, className: iconStyles, outline: false }))),
|
|
7085
|
+
!icon && !iconObj && isLoading && (React__default["default"].createElement(Loader, { classes: "h-5 w-5 border-2" })),
|
|
7070
7086
|
label && React__default["default"].createElement("span", null, label)));
|
|
7071
7087
|
};
|
|
7072
7088
|
var _Button = React.forwardRef(Button);
|