{"version":3,"sources":["../../src/Dropdown/Dropdown.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport React, { ElementType, FC } from 'react';\nimport { Dropdown as BSDRopdown, DropdownProps as BSDRopdownProps } from 'reactstrap';\nexport interface DropdownProps extends BSDRopdownProps {\n  tag?: ElementType;\n  inNavbar?: boolean;\n  textCenter?: boolean;\n  theme?: string;\n  /** Classi aggiuntive da usare per il componente Button */\n  className?: string;\n  testId?: string;\n}\n\nexport const Dropdown: FC<DropdownProps> = ({\n  className,\n  testId,\n  children,\n  inNavbar,\n  textCenter,\n  theme,\n  ...attributes\n}) => {\n  const classes = classNames(className, {\n    'text-center': textCenter\n  });\n\n  const [isOpen, setIsOpen] = React.useState(false);\n  const toggle = () => setIsOpen(!isOpen);\n\n  return (\n    <BSDRopdown\n      menuRole='menu'\n      color={theme}\n      isOpen={isOpen}\n      toggle={toggle}\n      className={classes}\n      data-testid={testId}\n      {...attributes}\n      inNavbar={inNavbar}\n      nav={inNavbar}\n    >\n      {\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        React.Children.map(children, (child: any) => React.cloneElement(child, { inNavbar: inNavbar }))\n      }\n    </BSDRopdown>\n  );\n};\n"],"mappings":"0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,cAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAuB,2BACvBC,EAAuC,sBACvCC,EAAyE,sBAW5DJ,EAA8B,CAAC,CAC1C,UAAAK,EACA,OAAAC,EACA,SAAAC,EACA,SAAAC,EACA,WAAAC,EACA,MAAAC,EACA,GAAGC,CACL,IAAM,CACJ,IAAMC,KAAU,EAAAC,SAAWR,EAAW,CACpC,cAAeI,CACjB,CAAC,EAEK,CAACK,EAAQC,CAAS,EAAI,EAAAC,QAAM,SAAS,EAAK,EAGhD,OACE,EAAAA,QAAA,cAAC,EAAAC,SAAA,CACC,SAAS,OACT,MAAOP,EACP,OAAQI,EACR,OAPW,IAAMC,EAAU,CAACD,CAAM,EAQlC,UAAWF,EACX,cAAaN,EACZ,GAAGK,EACJ,SAAUH,EACV,IAAKA,GAIH,EAAAQ,QAAM,SAAS,IAAIT,EAAWW,GAAe,EAAAF,QAAM,aAAaE,EAAO,CAAE,SAAUV,CAAS,CAAC,CAAC,CAElG,CAEJ","names":["Dropdown_exports","__export","Dropdown","__toCommonJS","import_classnames","import_react","import_reactstrap","className","testId","children","inNavbar","textCenter","theme","attributes","classes","classNames","isOpen","setIsOpen","React","BSDRopdown","child"]}