thailife-react 0.0.31 → 0.0.33

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/dist/cjs/index.js CHANGED
@@ -399,7 +399,7 @@ const Radio = React.forwardRef(function RadioItem(_a, ref) {
399
399
  });
400
400
  Radio.displayName = "Radio";
401
401
 
402
- const Select = React.forwardRef(({ options, value, placeholder = 'Select an option', disabled = false, className = '', onChange, register, }, ref) => {
402
+ const Select = React.forwardRef(({ options, value, placeholder = 'Select an option', disabled = false, className = '', onChange, register, error, }, ref) => {
403
403
  const [isOpen, setIsOpen] = React.useState(false);
404
404
  const [selectedValue, setSelectedValue] = React.useState(value || '');
405
405
  const selectRef = React.useRef(null);
@@ -424,7 +424,7 @@ const Select = React.forwardRef(({ options, value, placeholder = 'Select an opti
424
424
  };
425
425
  }, []);
426
426
  return (React.createElement("div", { ref: ref, className: `relative ${className}` },
427
- React.createElement("button", Object.assign({ type: "button", onClick: () => !disabled && setIsOpen(!isOpen), disabled: disabled, className: `w-full px-4 h-[44px] text-left bg-white border border-gray-300 rounded-md focus:outline-none focus:border-2 focus:border-primary ${disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer'} flex items-center justify-between` }, register),
427
+ React.createElement("button", Object.assign({ type: "button", onClick: () => !disabled && setIsOpen(!isOpen), disabled: disabled, className: `w-full px-4 h-[44px] text-left bg-white border rounded-md focus:outline-none focus:border-2 ${error ? 'border-danger focus:border-danger' : 'border-gray-300 focus:border-primary'} ${disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer'} flex items-center justify-between` }, register),
428
428
  React.createElement("div", { className: "flex items-center" },
429
429
  (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.icon) && (React.createElement("span", { className: "mr-2" }, selectedOption.icon)),
430
430
  React.createElement("span", { className: selectedOption ? 'text-gray-900' : 'text-gray-500' }, selectedOption ? selectedOption.label : placeholder)),