@agility/plenum-ui 1.3.18 → 1.3.21
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
|
@@ -12765,7 +12765,7 @@ var _Textarea = React.forwardRef(Textarea);
|
|
|
12765
12765
|
|
|
12766
12766
|
/** Comment */
|
|
12767
12767
|
var Select = function (_a) {
|
|
12768
|
-
var label = _a.label, id = _a.id, name = _a.name, options = _a.options, onChange = _a.onChange, isDisabled = _a.isDisabled, isError = _a.isError, isRequired = _a.isRequired, value = _a.value;
|
|
12768
|
+
var label = _a.label, id = _a.id, name = _a.name, options = _a.options, onChange = _a.onChange, isDisabled = _a.isDisabled, isError = _a.isError, isRequired = _a.isRequired, value = _a.value, className = _a.className;
|
|
12769
12769
|
var _b = React.useState(value || options[0].value), selectedOption = _b[0], setSelectedOption = _b[1];
|
|
12770
12770
|
var uniqueID = useId();
|
|
12771
12771
|
if (!id)
|
|
@@ -12782,11 +12782,10 @@ var Select = function (_a) {
|
|
|
12782
12782
|
typeof onChange == "function" && onChange(targetValue);
|
|
12783
12783
|
setSelectedOption(targetValue);
|
|
12784
12784
|
};
|
|
12785
|
-
var selectStyles = cn("block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none", "focus:ring-purple-500 focus:border-purple-500 sm:text-sm rounded", { "border-red-500": isError }, { "border-gray-300": !isError });
|
|
12786
12785
|
var wrapperStyle = cn({ "opacity-50": isDisabled });
|
|
12787
12786
|
return (React__default["default"].createElement("div", { className: wrapperStyle },
|
|
12788
12787
|
label && (React__default["default"].createElement(InputLabel, { isPlaceholder: true, isActive: true, label: label, isRequired: isRequired, id: id, isError: isError, isDisabled: isDisabled })),
|
|
12789
|
-
React__default["default"].createElement("select", { id: id, name: name, className:
|
|
12788
|
+
React__default["default"].createElement("select", { id: id, name: name, className: cn("block w-full border-gray-300 py-2 pl-3 pr-10 text-base focus:outline-none", "rounded focus:border-purple-500 focus:ring-purple-500 sm:text-sm", { "border-red-500": isError }, { "border-gray-300": !isError }, className), onChange: handleChange, disabled: isDisabled, value: selectedOption }, options.map(function (_a) {
|
|
12790
12789
|
var value = _a.value, label = _a.label;
|
|
12791
12790
|
return (React__default["default"].createElement("option", { key: value, value: value }, label));
|
|
12792
12791
|
}))));
|
|
@@ -12795,6 +12794,9 @@ var Select = function (_a) {
|
|
|
12795
12794
|
/** Comment */
|
|
12796
12795
|
var Checkbox = function (_a) {
|
|
12797
12796
|
var label = _a.label, id = _a.id, isDisabled = _a.isDisabled, isChecked = _a.isChecked, isRequired = _a.isRequired, isError = _a.isError, message = _a.message, value = _a.value, onChange = _a.onChange;
|
|
12797
|
+
var uniqueID = useId();
|
|
12798
|
+
if (!id)
|
|
12799
|
+
id = "cb-".concat(uniqueID);
|
|
12798
12800
|
var checboxStyles = cn('focus:ring-purple-500 h-4 w-4 text-purple-600 border-gray-300 rounded', { 'border-red-500 shadow-none': isError });
|
|
12799
12801
|
var wrapperStyles = cn('relative flex items-start', { 'opacity-50': isDisabled });
|
|
12800
12802
|
var handleChange = function (e) {
|
|
@@ -12804,7 +12806,7 @@ var Checkbox = function (_a) {
|
|
|
12804
12806
|
};
|
|
12805
12807
|
return (React__default["default"].createElement("div", { className: wrapperStyles },
|
|
12806
12808
|
React__default["default"].createElement("div", { className: "flex items-center h-5" },
|
|
12807
|
-
React__default["default"].createElement("input", { id: id, "aria-describedby": "".concat(id, "-description"), name: id, value: value, type: "checkbox", className: checboxStyles, disabled: isDisabled,
|
|
12809
|
+
React__default["default"].createElement("input", { id: id, "aria-describedby": "".concat(id, "-description"), name: id, value: value, type: "checkbox", className: checboxStyles, disabled: isDisabled, checked: isChecked, onChange: function (e) {
|
|
12808
12810
|
handleChange(e);
|
|
12809
12811
|
} })),
|
|
12810
12812
|
React__default["default"].createElement("div", { className: "ml-3 text-sm" },
|