dhre-component-lib 0.8.13 → 0.8.15

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.
@@ -9,6 +9,8 @@ type ButtonProps = {
9
9
  disabled?: boolean;
10
10
  width?: string;
11
11
  height?: string;
12
+ id?: string;
13
+ type?: "button" | "submit" | "reset";
12
14
  borderRadius?: string;
13
15
  className?: string;
14
16
  loaderThickness?: number;
package/dist/index.d.ts CHANGED
@@ -37,6 +37,8 @@ type ButtonProps = {
37
37
  disabled?: boolean;
38
38
  width?: string;
39
39
  height?: string;
40
+ id?: string;
41
+ type?: "button" | "submit" | "reset";
40
42
  borderRadius?: string;
41
43
  className?: string;
42
44
  loaderThickness?: number;
package/dist/index.esm.js CHANGED
@@ -21634,6 +21634,10 @@ const OTPInput = ({ length = 4, onChange, autoFocus = false, onResend, resendDel
21634
21634
  }
21635
21635
  };
21636
21636
  const handleKeyDown = (e, index) => {
21637
+ if (e.key === "Enter") {
21638
+ e.stopPropagation();
21639
+ return;
21640
+ }
21637
21641
  if (!!patternRegex && !patternRegex.test(e.key) && e.key !== "Backspace") {
21638
21642
  e.preventDefault();
21639
21643
  return;
@@ -21678,7 +21682,7 @@ const OTPInput = ({ length = 4, onChange, autoFocus = false, onResend, resendDel
21678
21682
  React__default.createElement("div", { className: "timerText" },
21679
21683
  timer ? icon : "",
21680
21684
  timer > 0 ? `00:${timer} secs` : ""),
21681
- React__default.createElement("button", { onClick: handleResendClick, disabled: timer > 0 || disableResend, style: {
21685
+ React__default.createElement("button", { type: "button", onClick: handleResendClick, disabled: timer > 0 || disableResend, style: {
21682
21686
  border: "none",
21683
21687
  background: "none",
21684
21688
  cursor: timer > 0 || disableResend ? "not-allowed" : "pointer",
@@ -21699,6 +21703,16 @@ const Search = ({ searchIcon, crossIcon, disabled = false, onSearch, onSelectSug
21699
21703
  useEffect(() => {
21700
21704
  queryRef.current = query;
21701
21705
  }, [query]);
21706
+ useEffect(() => {
21707
+ if (!!suggestions?.length && query.length >= 3 && shouldShowAll) {
21708
+ setShowSuggestions(true);
21709
+ setFilteredSuggestions(suggestions);
21710
+ }
21711
+ else {
21712
+ setFilteredSuggestions([]);
21713
+ setShowSuggestions(false);
21714
+ }
21715
+ }, [suggestions]);
21702
21716
  const handleChange = (e) => {
21703
21717
  if (disabled)
21704
21718
  return;
@@ -21729,8 +21743,8 @@ const Search = ({ searchIcon, crossIcon, disabled = false, onSearch, onSelectSug
21729
21743
  onSearch(queryRef.current);
21730
21744
  }, 500);
21731
21745
  setTimeoutId(newTimeoutId);
21732
- if (suggestions && value) {
21733
- const filtered = shouldShowAll ? suggestions : suggestions.filter((suggestion) => suggestion.title.toLowerCase().includes(value.toLowerCase()));
21746
+ if (suggestions && value && !shouldShowAll) {
21747
+ const filtered = suggestions.filter((suggestion) => suggestion.title.toLowerCase().includes(value.toLowerCase()));
21734
21748
  setFilteredSuggestions(filtered);
21735
21749
  setShowSuggestions(true);
21736
21750
  }