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

24 lines 1.23 kB
import { jsx as _jsx } from "react/jsx-runtime"; import React from 'react'; import { STYLES_NAME } from '../../constants/stylesName/stylesName'; // context import { useStyles } from '../../hooks/useStyles/useStyles'; import { ErrorBoundary } from '../../provider/errorBoundary/errorBoundary'; import { FallbackComponent } from '../../provider/errorBoundary/fallbackComponent'; import { OverlayStandAlone } from './overlayStandAlone'; const OverlayComponent = React.forwardRef((props, ref) => { const styles = useStyles(STYLES_NAME.OVERLAY, props.variant, props.ctv); return _jsx(OverlayStandAlone, { ...props, ref: ref, styles: styles }); }); OverlayComponent.displayName = 'OverlayComponent'; const OverlayBoundary = (props, ref) => (_jsx(ErrorBoundary, { fallBackComponent: _jsx(FallbackComponent, { children: _jsx(OverlayStandAlone, { ...props, ref: ref, styles: {} }) }), children: _jsx(OverlayComponent, { ...props, ref: ref }) })); const Overlay = React.forwardRef(OverlayBoundary); /** * @description * Overlay component is used to create a background overlay. * @param {React.PropsWithChildren<IOverlay<V>} props * @returns {JSX.Element} * @constructor */ export { Overlay }; //# sourceMappingURL=overlay.js.map