@agility/plenum-ui 1.3.25 → 1.3.28

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.
@@ -42,6 +42,7 @@ export interface TextInputAddonProps {
42
42
  leadLabel?: string;
43
43
  /** Remove bg and border from CTA */
44
44
  clearCta?: "left" | "right" | "both" | "none";
45
+ className?: string;
45
46
  /** Callback on change */
46
47
  onChange?(value: string): void;
47
48
  /** Callback on Cta click */
package/lib/index.esm.js CHANGED
@@ -12507,10 +12507,10 @@ var InputCta = function (_a) {
12507
12507
  var handleClick = function () {
12508
12508
  onClickHandler && onClickHandler();
12509
12509
  };
12510
- var buttonStyle = cn('relative z-10 inline-flex items-center space-x-2 px-4 py-2 border border-gray-300 text-sm font-medium focus:outline-none focus:ring-1 focus:ring-purple-500 focus:border-purple-500', {
12510
+ var buttonStyle = cn('relative inline-flex items-center space-x-2 px-4 py-2 border border-gray-300 text-sm font-medium focus:outline-none focus:ring-1 focus:ring-purple-500 focus:border-purple-500', {
12511
12511
  'rounded-r text-gray-700 -ml-px': align === 'right'
12512
12512
  }, {
12513
- 'rounded-l text-gray-500 -mr-px focus-within:z-10': align === 'left'
12513
+ 'rounded-l text-gray-500 -mr-px': align === 'left'
12514
12514
  }, {
12515
12515
  'cursor-default': !onClickHandler
12516
12516
  }, {
@@ -12530,7 +12530,7 @@ var InputCta = function (_a) {
12530
12530
  };
12531
12531
 
12532
12532
  var TextInputAddon = function (_a, ref) {
12533
- 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;
12533
+ 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;
12534
12534
  var _d = useState(Boolean(isFocused)), isFocus = _d[0], setIsFocus = _d[1];
12535
12535
  var _e = useState(defaultValue || ""), value = _e[0], setValue = _e[1];
12536
12536
  var inputRef = useRef(null);
@@ -12571,22 +12571,26 @@ var TextInputAddon = function (_a, ref) {
12571
12571
  setIsFocus(false);
12572
12572
  // add other focus effects here
12573
12573
  };
12574
- var className = cn("border py-2 px-3 rounded text-sm leading-5 font-normal w-full border-gray-300 outline-purple-500 focus:outline-none focus:ring-1 focus:ring-purple-500 focus:border-purple-500 ", {
12575
- "focus:ring-red-500 !border-red-500 !outline-red-500 shadow-none": isError
12576
- }, { "pl-10": inlineIcon }, {
12577
- "!rounded-r-none !rounded-l": (trailIcon || trailLabel) && !(leadIcon || leadLabel)
12578
- }, {
12579
- "!rounded-r-none !rounded-r": !(trailIcon || trailLabel) && (leadIcon || leadLabel)
12580
- }, { "rounded-none": (trailIcon || trailLabel) && (leadIcon || leadLabel) });
12581
12574
  var discriptionStyles = cn("text-sm mt-1 block", { "text-gray-500": !isError }, { "text-red-500": isError });
12582
12575
  return (React__default.createElement("div", null,
12583
12576
  label && (React__default.createElement(InputLabel, { label: label, isRequired: isRequired, id: id, isError: isError, isDisabled: isDisabled })),
12584
12577
  React__default.createElement("div", { className: "flex" },
12585
12578
  (leadIcon || leadLabel) && (React__default.createElement(InputCta, { icon: leadIcon, ctaLabel: leadLabel, align: "left", isClear: clearCta === "left" || clearCta === "both" })),
12586
- React__default.createElement("div", { className: "relative flex-grow focus-within:z-20" },
12579
+ React__default.createElement("div", { className: "relative flex-grow" },
12587
12580
  inlineIcon && (React__default.createElement("div", { className: "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3" },
12588
12581
  React__default.createElement(DynamicIcons, { icon: inlineIcon, className: "h-5 w-5 text-gray-400", outline: false }))),
12589
- React__default.createElement(_BaseField, { onFocus: handleInputFocus, onBlur: handleInputBlur, onChange: onChange, onValueChange: setValue, ref: ref, type: type, name: name, id: id, className: className, isDisabled: isDisabled, value: value, defaultValue: defaultValue, maxLength: maxLength, placeholder: placeholder })),
12582
+ React__default.createElement(_BaseField, { onFocus: handleInputFocus, onBlur: handleInputBlur, onChange: onChange, onValueChange: setValue, ref: ref, type: type, name: name, id: id, className: cn("w-full rounded border border-gray-300 py-2 px-3 text-sm font-normal leading-5 outline-purple-500 focus:border-purple-500 focus:outline-none focus:ring-1 focus:ring-purple-500 ", {
12583
+ "!border-red-500 shadow-none !outline-red-500 focus:ring-red-500": isError
12584
+ }, { "pl-10": inlineIcon }, {
12585
+ "!rounded-r-none !rounded-l": (trailIcon || trailLabel) &&
12586
+ !(leadIcon || leadLabel)
12587
+ }, {
12588
+ "!rounded-r-none !rounded-r": !(trailIcon || trailLabel) &&
12589
+ (leadIcon || leadLabel)
12590
+ }, {
12591
+ "rounded-none": (trailIcon || trailLabel) &&
12592
+ (leadIcon || leadLabel)
12593
+ }, className), isDisabled: isDisabled, value: value, defaultValue: defaultValue, maxLength: maxLength, placeholder: placeholder })),
12590
12594
  (trailIcon || trailLabel) && (React__default.createElement(InputCta, { icon: trailIcon, ctaLabel: trailLabel, align: "right", isClear: clearCta === "right" || clearCta === "both", onClickHandler: onCtaClick }))),
12591
12595
  React__default.createElement("div", { className: "flex flex-row space-x-3" },
12592
12596
  React__default.createElement("div", { className: "grow" }, message && (React__default.createElement("span", { className: discriptionStyles }, message))),
@@ -12729,7 +12733,7 @@ var Textarea = function (_a, ref) {
12729
12733
  React__default.createElement("div", null,
12730
12734
  React__default.createElement("textarea", { ref: ref, maxLength: maxLength, onChange: handleOnchange, rows: rows, name: name, id: id, className: cn("block w-full rounded focus:border-purple-500 focus:ring-purple-500 sm:text-sm", { "border-gray-300 ": !isError }, {
12731
12735
  "border-red-500 outline-red-500 focus:ring-red-500": isError
12732
- }, className), defaultValue: defaultValue, value: value, placeholder: placeholder })),
12736
+ }, className), disabled: isDisabled, defaultValue: defaultValue, value: value, placeholder: placeholder })),
12733
12737
  React__default.createElement("div", { className: "flex flex-row space-x-3" },
12734
12738
  React__default.createElement("div", { className: "grow" }, message && (React__default.createElement("span", { className: discriptionStyles }, message))),
12735
12739
  isShowCounter && (React__default.createElement("div", { className: "shrink-0" },