@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
17 lines • 1.79 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import React from 'react';
import { pickAriaProps } from '../../utils/aria/aria';
import { CssAnimation } from '../cssAnimation/cssAnimation';
import { Overlay } from '../overlay/overlay';
import { PopoverAnimationStyled, PopoverStyled } from './popover.styled';
const PopoverStandAloneComponent = ({ children, animationExecution, animationConfig, dataTestId = 'popover', ...props }, ref) => {
const ariaProps = pickAriaProps(props);
if (props.open) {
return (_jsxs("div", { ref: ref, children: [props.hasBackDrop && _jsx(Overlay, { variant: props.styles[props.device]?.overlay }), _jsx(PopoverAnimationStyled, { ref: props.forwardedRef, as: animationConfig ? CssAnimation : 'div', "data-testid": dataTestId, exec: animationExecution, id: props.id, options: animationConfig?.animationOptions, variant: animationConfig?.animation, children: _jsx(PopoverStyled
// Allow to identificate the element
, { "data-popover": true, ...ariaProps, align: props.align, as: props.component, autoWidth: props?.autoWidth, bottom: props?.bottom, device: props.device, extraAlignGap: props.extraAlignGap, extraWidth: props.extraWidth || props.styles?.[props.device]?.extraWidth, extraWidthSide: props.extraWidthSide || props.styles?.[props.device]?.extraWidthSide, left: props?.left, open: props.open, positionVariant: props.positionVariant, right: props?.right, role: props.role, tabIndex: props.tabIndex, top: props?.top, onKeyDown: props.onKeyDown, ...props.styles, children: children }) })] }));
}
return _jsx(PopoverAnimationStyled, { id: props.id });
};
export const PopoverStandAlone = React.forwardRef(PopoverStandAloneComponent);
//# sourceMappingURL=popoverStandAlone.js.map