dhre-component-lib 0.2.7 → 0.2.8

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.
@@ -8,6 +8,7 @@ type AccordionProps = {
8
8
  border?: boolean;
9
9
  upArrowIcon: React.ReactNode;
10
10
  downArrowIcon: React.ReactNode;
11
+ openByDefault?: boolean;
11
12
  };
12
13
  declare const Accordion: React.FC<AccordionProps>;
13
14
  export default Accordion;
package/dist/index.d.ts CHANGED
@@ -210,6 +210,7 @@ type AccordionProps = {
210
210
  border?: boolean;
211
211
  upArrowIcon: React.ReactNode;
212
212
  downArrowIcon: React.ReactNode;
213
+ openByDefault?: boolean;
213
214
  };
214
215
  declare const Accordion: React.FC<AccordionProps>;
215
216
 
package/dist/index.esm.js CHANGED
@@ -9356,13 +9356,20 @@ const Search = ({ searchIcon, crossIcon, disabled = false, onSearch, onSelectSug
9356
9356
  return;
9357
9357
  const value = e.target.value;
9358
9358
  setQuery(value);
9359
+ if (value.length < 3) {
9360
+ setBorderClass("default-border");
9361
+ setShowSuggestions(false);
9362
+ if (timeoutId)
9363
+ clearTimeout(timeoutId);
9364
+ return;
9365
+ }
9359
9366
  setBorderClass("typing-border");
9360
9367
  if (timeoutId)
9361
9368
  clearTimeout(timeoutId);
9362
9369
  const newTimeoutId = setTimeout(() => {
9363
9370
  setBorderClass("stopped-border");
9364
9371
  onSearch(queryRef.current);
9365
- }, 2000);
9372
+ }, 500);
9366
9373
  setTimeoutId(newTimeoutId);
9367
9374
  if (suggestions && value) {
9368
9375
  const filtered = suggestions
@@ -9438,8 +9445,8 @@ const Modal = ({ isOpen, onClose, title, children, crossIcon }) => {
9438
9445
  var css = ".accordion {\n padding: 10px;\n cursor: pointer;\n display: flex;\n flex-direction: column;\n}\n.accordion.with-border {\n border: 1px solid #CECECE;\n padding: 24px 16px 24px 16px;\n border-radius: 16px;\n}\n.accordion.without-border {\n border-bottom: 1px solid #686868;\n padding: 16px 0px 16px 0px;\n margin-top: 16px;\n}\n.accordion .accordion-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n.accordion .accordion-header .accordion-icon {\n margin-right: 10px;\n}\n.accordion .accordion-header .accordion-text {\n display: flex;\n flex-direction: column;\n}\n.accordion .accordion-header .accordian-arrow {\n display: flex;\n justify-content: flex-end;\n}\n.accordion .accordion-content {\n padding: 16px 4px 16px 4px;\n}";
9439
9446
  n(css,{});
9440
9447
 
9441
- const Accordion = ({ icon, title, description, children, border = false, upArrowIcon, downArrowIcon }) => {
9442
- const [isOpen, setIsOpen] = useState(false);
9448
+ const Accordion = ({ icon, title, description, children, border = false, upArrowIcon, downArrowIcon, openByDefault }) => {
9449
+ const [isOpen, setIsOpen] = useState(openByDefault ? true : false);
9443
9450
  const toggleAccordion = () => {
9444
9451
  setIsOpen(!isOpen);
9445
9452
  };