2023-12-15 17:34:50 +03:00
|
|
|
import clsx from 'clsx';
|
|
|
|
|
|
|
|
import Overlay from './Overlay';
|
|
|
|
|
2023-07-20 17:11:03 +03:00
|
|
|
interface DropdownProps {
|
|
|
|
stretchLeft?: boolean
|
2023-09-15 23:29:52 +03:00
|
|
|
dimensions?: string
|
2023-12-15 17:34:50 +03:00
|
|
|
children: React.ReactNode
|
2023-07-20 17:11:03 +03:00
|
|
|
}
|
|
|
|
|
2023-12-15 17:34:50 +03:00
|
|
|
function Dropdown({
|
|
|
|
dimensions = 'w-fit',
|
|
|
|
stretchLeft,
|
|
|
|
children
|
|
|
|
}: DropdownProps) {
|
2023-07-20 17:11:03 +03:00
|
|
|
return (
|
2023-12-15 17:34:50 +03:00
|
|
|
<Overlay
|
|
|
|
layer='z-modal-tooltip'
|
|
|
|
position='mt-3'
|
|
|
|
className={clsx(
|
2023-12-17 20:19:28 +03:00
|
|
|
'flex flex-col items-stretch',
|
2023-12-15 17:34:50 +03:00
|
|
|
'border rounded-md shadow-lg',
|
|
|
|
'text-sm',
|
|
|
|
'clr-input',
|
|
|
|
{
|
|
|
|
'right-0': stretchLeft,
|
|
|
|
'left-0': !stretchLeft
|
|
|
|
},
|
|
|
|
dimensions
|
|
|
|
)}
|
|
|
|
>
|
2023-12-04 14:19:54 +03:00
|
|
|
{children}
|
2023-12-15 17:34:50 +03:00
|
|
|
</Overlay>);
|
2023-07-20 17:11:03 +03:00
|
|
|
}
|
|
|
|
|
2023-12-15 17:34:50 +03:00
|
|
|
export default Dropdown;
|