{"version":3,"file":"DropdownCloser.cjs","sources":["../../../src/components/Dropdown/DropdownCloser.tsx"],"sourcesContent":["'use client'\n\nimport { type ComponentProps, type FC, type PropsWithChildren, useContext, useMemo } from 'react'\nimport { tv } from 'tailwind-variants'\n\nimport { DropdownContentContext } from './DropdownContent'\nimport { DropdownContentInnerContext } from './DropdownContentInner'\n\nconst classNameGenerator = tv({\n  base: 'smarthr-ui-Dropdown-closer',\n  variants: {\n    controllable: {\n      false: 'shr-flex shr-flex-col',\n    },\n  },\n})\n\ntype Props = PropsWithChildren<ComponentProps<'div'>>\n\nexport const DropdownCloser: FC<Props> = ({ children, className }) => {\n  const { onClickCloser: onDelegateClick, controllable } = useContext(DropdownContentContext)\n  const { maxHeight } = useContext(DropdownContentInnerContext)\n\n  const actualClassName = useMemo(\n    () => classNameGenerator({ controllable, className }),\n    [controllable, className],\n  )\n  const style = useMemo(\n    () => ({\n      maxHeight: controllable ? undefined : maxHeight,\n    }),\n    [maxHeight, controllable],\n  )\n\n  return (\n    <div role=\"presentation\" onClick={onDelegateClick} className={actualClassName} style={style}>\n      {children}\n    </div>\n  )\n}\n"],"names":[],"mappings":";;;;;;;;;AAQA;AACE;AACA;AACE;AACE;AACD;AACF;AACF;AAIM;AACL;;;AAOA;;AAGG;;AASL;;"}