@agility/plenum-ui 1.3.18 → 1.3.19
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/Forms/Select/Select.d.ts +1 -0
- package/lib/index.esm.js +2 -3
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +2 -3
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
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
|
}))));
|