UNPKG

@kubit-ui-web/react-components

Version:

Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience

25 lines 1.29 kB
import { jsx as _jsx } from "react/jsx-runtime"; import React from 'react'; import { ActionBottomSheetControlled } from './actionBottomSheetControlled'; export const ActionBottomSheetUnControlledComponent = ({ open = false, popover, closeIcon, ...props }, ref) => { const [_open, setOpen] = React.useState(open); const handleCloseIconClick = event => { setOpen(false); closeIcon?.onClick?.(event); }; const handlePopoverCloseInternally = () => { setOpen(false); popover?.onCloseInternally?.(); }; return (_jsx(ActionBottomSheetControlled, { ...props, ref: ref, closeIcon: { ...closeIcon, onClick: handleCloseIconClick }, open: _open, popover: { ...popover, onCloseInternally: handlePopoverCloseInternally } })); }; /** * @description * ActionBottomSheetUnControlled component is a controlled action bottom sheet that use a Popover component to show the content. * @param {React.PropsWithChildren<ActionBottomSheetUnControlledType<V>>} props * @returns {JSX.Element} */ const ActionBottomSheetUnControlled = React.forwardRef(ActionBottomSheetUnControlledComponent); export { ActionBottomSheetUnControlled }; export { ActionBottomSheetUnControlled as ActionBottomSheet }; //# sourceMappingURL=actionBottomSheetUnControlled.js.map