@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/.storybook/Layout.jsx
CHANGED
|
@@ -34,8 +34,10 @@ export interface TextInputAddonProps {
|
|
|
34
34
|
leadIcon?: IconName;
|
|
35
35
|
/** Trailing icon displayed within the input */
|
|
36
36
|
trailIcon?: IconName;
|
|
37
|
-
/** Icon within the input field
|
|
37
|
+
/** Icon within the input field at the begining of the field*/
|
|
38
38
|
inlineIcon?: IconName;
|
|
39
|
+
/** Icon within the input field at the end of the field*/
|
|
40
|
+
inlineTrailingIcon?: IconName;
|
|
39
41
|
/** Trailing label for the input CTA */
|
|
40
42
|
trailLabel?: string;
|
|
41
43
|
/** Leading label for input CTA */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Meta } from
|
|
2
|
-
import { Story } from
|
|
3
|
-
import { TextInputAddonProps } from
|
|
1
|
+
import { Meta } from "@storybook/react/types-6-0";
|
|
2
|
+
import { Story } from "@storybook/react";
|
|
3
|
+
import { TextInputAddonProps } from "./TextInputAddon";
|
|
4
4
|
declare const _default: Meta<import("@storybook/react").Args>;
|
|
5
5
|
export default _default;
|
|
6
6
|
export declare const AllVariations: Story<TextInputAddonProps>;
|
package/lib/index.esm.js
CHANGED
|
@@ -7022,8 +7022,10 @@ function Loader(_a) {
|
|
|
7022
7022
|
var Button = function (_a, ref) {
|
|
7023
7023
|
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;
|
|
7024
7024
|
var iconStyles = cn("h-5 w-5", { "text-white": type === "primary" || type === "danger" }, { "text-purple-700": type === "secondary" }, { "text-gray-700": type === "alternative" });
|
|
7025
|
-
return (React__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" }, {
|
|
7026
|
-
"
|
|
7025
|
+
return (React__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" }, {
|
|
7026
|
+
"cursor-auto opacity-50": isDisabled
|
|
7027
|
+
}, {
|
|
7028
|
+
"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"
|
|
7027
7029
|
}, {
|
|
7028
7030
|
"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"
|
|
7029
7031
|
}, {
|
|
@@ -7033,11 +7035,12 @@ var Button = function (_a, ref) {
|
|
|
7033
7035
|
}, className), onClick: !isDisabled
|
|
7034
7036
|
? onClick
|
|
7035
7037
|
: function () {
|
|
7036
|
-
} },
|
|
7038
|
+
}, disabled: isDisabled, "aria-disabled": isDisabled },
|
|
7037
7039
|
iconObj &&
|
|
7038
7040
|
(isLoading ? (React__default.createElement(Loader, { classes: "h-5 w-5 border-2" })) : (React__default.createElement(React__default.Fragment, null, iconObj))),
|
|
7039
|
-
icon &&
|
|
7040
|
-
|
|
7041
|
+
icon &&
|
|
7042
|
+
(isLoading ? (React__default.createElement(Loader, { classes: "h-5 w-5 border-2" })) : (React__default.createElement(DynamicIcons, { icon: icon, className: iconStyles, outline: false }))),
|
|
7043
|
+
!icon && !iconObj && isLoading && (React__default.createElement(Loader, { classes: "h-5 w-5 border-2" })),
|
|
7041
7044
|
label && React__default.createElement("span", null, label)));
|
|
7042
7045
|
};
|
|
7043
7046
|
var _Button = forwardRef(Button);
|
|
@@ -12500,7 +12503,7 @@ var InputCta = function (_a) {
|
|
|
12500
12503
|
};
|
|
12501
12504
|
|
|
12502
12505
|
var TextInputAddon = function (_a, ref) {
|
|
12503
|
-
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;
|
|
12506
|
+
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;
|
|
12504
12507
|
var _d = useState(Boolean(isFocused)), isFocus = _d[0], setIsFocus = _d[1];
|
|
12505
12508
|
var _e = useState(defaultValue || ""), value = _e[0], setValue = _e[1];
|
|
12506
12509
|
var inputRef = useRef(null);
|
|
@@ -12560,7 +12563,9 @@ var TextInputAddon = function (_a, ref) {
|
|
|
12560
12563
|
}, {
|
|
12561
12564
|
"rounded-none": (trailIcon || trailLabel) &&
|
|
12562
12565
|
(leadIcon || leadLabel)
|
|
12563
|
-
}, className), isDisabled: isDisabled, value: value, defaultValue: defaultValue, maxLength: maxLength, placeholder: placeholder })
|
|
12566
|
+
}, className), isDisabled: isDisabled, value: value, defaultValue: defaultValue, maxLength: maxLength, placeholder: placeholder }),
|
|
12567
|
+
inlineTrailingIcon && (React__default.createElement("div", { className: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3" },
|
|
12568
|
+
React__default.createElement(DynamicIcons, { icon: inlineTrailingIcon, className: "h-5 w-5 bg-white text-gray-400", outline: false })))),
|
|
12564
12569
|
(trailIcon || trailLabel) && (React__default.createElement(InputCta, { icon: trailIcon, ctaLabel: trailLabel, align: "right", isClear: clearCta === "right" || clearCta === "both", onClickHandler: onCtaClick }))),
|
|
12565
12570
|
React__default.createElement("div", { className: "flex flex-row space-x-3" },
|
|
12566
12571
|
React__default.createElement("div", { className: "grow" }, message && (React__default.createElement("span", { className: discriptionStyles }, message))),
|