@agility/plenum-ui 1.3.32 → 1.3.34
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/.storybook/Layout.jsx +1 -1
- package/lib/components/Forms/TextInputAddon/TextInputAddon.d.ts +3 -1
- package/lib/components/Forms/TextInputAddon/TextInputAddon.stories.d.ts +3 -3
- package/lib/index.esm.js +12 -7
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +12 -7
- package/lib/index.js.map +1 -1
- package/lib/{index.css → tailwind.css} +256 -63
- package/package.json +3 -3
- package/setupTests.js +3 -3
- package/lib/index.esm.css +0 -1866
package/lib/index.js
CHANGED
|
@@ -7048,8 +7048,10 @@ function Loader(_a) {
|
|
|
7048
7048
|
var Button = function (_a, ref) {
|
|
7049
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;
|
|
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" }, {
|
|
7052
|
-
"
|
|
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" }, {
|
|
7052
|
+
"cursor-auto opacity-50": isDisabled
|
|
7053
|
+
}, {
|
|
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"
|
|
7053
7055
|
}, {
|
|
7054
7056
|
"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"
|
|
7055
7057
|
}, {
|
|
@@ -7059,11 +7061,12 @@ var Button = function (_a, ref) {
|
|
|
7059
7061
|
}, className), onClick: !isDisabled
|
|
7060
7062
|
? onClick
|
|
7061
7063
|
: function () {
|
|
7062
|
-
} },
|
|
7064
|
+
}, disabled: isDisabled, "aria-disabled": isDisabled },
|
|
7063
7065
|
iconObj &&
|
|
7064
7066
|
(isLoading ? (React__default["default"].createElement(Loader, { classes: "h-5 w-5 border-2" })) : (React__default["default"].createElement(React__default["default"].Fragment, null, iconObj))),
|
|
7065
|
-
icon &&
|
|
7066
|
-
|
|
7067
|
+
icon &&
|
|
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
|
+
!icon && !iconObj && isLoading && (React__default["default"].createElement(Loader, { classes: "h-5 w-5 border-2" })),
|
|
7067
7070
|
label && React__default["default"].createElement("span", null, label)));
|
|
7068
7071
|
};
|
|
7069
7072
|
var _Button = React.forwardRef(Button);
|
|
@@ -12526,7 +12529,7 @@ var InputCta = function (_a) {
|
|
|
12526
12529
|
};
|
|
12527
12530
|
|
|
12528
12531
|
var TextInputAddon = function (_a, ref) {
|
|
12529
|
-
var label = _a.label, isFocused = _a.isFocused, isError = _a.isError, id = _a.id, name = _a.name, isRequired = _a.isRequired, type = _a.type, defaultValue = _a.defaultValue, isDisabled = _a.isDisabled, message = _a.message, isShowCounter = _a.isShowCounter, _b = _a.maxLength, maxLength = _b === void 0 ? 100 : _b, placeholder = _a.placeholder, leadIcon = _a.leadIcon, trailIcon = _a.trailIcon, inlineIcon = _a.inlineIcon, trailLabel = _a.trailLabel, leadLabel = _a.leadLabel, _c = _a.clearCta, clearCta = _c === void 0 ? "none" : _c, onChange = _a.onChange, onCtaClick = _a.onCtaClick, externalValue = _a.value, className = _a.className;
|
|
12532
|
+
var label = _a.label, isFocused = _a.isFocused, isError = _a.isError, id = _a.id, name = _a.name, isRequired = _a.isRequired, type = _a.type, defaultValue = _a.defaultValue, isDisabled = _a.isDisabled, message = _a.message, isShowCounter = _a.isShowCounter, _b = _a.maxLength, maxLength = _b === void 0 ? 100 : _b, placeholder = _a.placeholder, leadIcon = _a.leadIcon, trailIcon = _a.trailIcon, inlineIcon = _a.inlineIcon, inlineTrailingIcon = _a.inlineTrailingIcon, trailLabel = _a.trailLabel, leadLabel = _a.leadLabel, _c = _a.clearCta, clearCta = _c === void 0 ? "none" : _c, onChange = _a.onChange, onCtaClick = _a.onCtaClick, externalValue = _a.value, className = _a.className;
|
|
12530
12533
|
var _d = React.useState(Boolean(isFocused)), isFocus = _d[0], setIsFocus = _d[1];
|
|
12531
12534
|
var _e = React.useState(defaultValue || ""), value = _e[0], setValue = _e[1];
|
|
12532
12535
|
var inputRef = React.useRef(null);
|
|
@@ -12586,7 +12589,9 @@ var TextInputAddon = function (_a, ref) {
|
|
|
12586
12589
|
}, {
|
|
12587
12590
|
"rounded-none": (trailIcon || trailLabel) &&
|
|
12588
12591
|
(leadIcon || leadLabel)
|
|
12589
|
-
}, className), isDisabled: isDisabled, value: value, defaultValue: defaultValue, maxLength: maxLength, placeholder: placeholder })
|
|
12592
|
+
}, className), isDisabled: isDisabled, value: value, defaultValue: defaultValue, maxLength: maxLength, placeholder: placeholder }),
|
|
12593
|
+
inlineTrailingIcon && (React__default["default"].createElement("div", { className: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3" },
|
|
12594
|
+
React__default["default"].createElement(DynamicIcons, { icon: inlineTrailingIcon, className: "h-5 w-5 bg-white text-gray-400", outline: false })))),
|
|
12590
12595
|
(trailIcon || trailLabel) && (React__default["default"].createElement(InputCta, { icon: trailIcon, ctaLabel: trailLabel, align: "right", isClear: clearCta === "right" || clearCta === "both", onClickHandler: onCtaClick }))),
|
|
12591
12596
|
React__default["default"].createElement("div", { className: "flex flex-row space-x-3" },
|
|
12592
12597
|
React__default["default"].createElement("div", { className: "grow" }, message && (React__default["default"].createElement("span", { className: discriptionStyles }, message))),
|