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

27 lines 1.57 kB
import { jsx as _jsx } from "react/jsx-runtime"; import React from 'react'; import { STYLES_NAME } from '../../constants/stylesName/stylesName'; import { useMediaDevice } from '../../hooks/useMediaDevice/useMediaDevice'; import { useStyles } from '../../hooks/useStyles/useStyles'; import { ErrorBoundary } from '../../provider/errorBoundary/errorBoundary'; import { FallbackComponent } from '../../provider/errorBoundary/fallbackComponent'; import { HeaderStandAlone } from './headerStandAlone'; import { useHeaderShadow } from './hook/useHeaderShadow'; const HeaderComponent = React.forwardRef(({ variant, ctv, showShadowFrom, ...props }, ref) => { const styles = useStyles(STYLES_NAME.HEADER, variant, ctv); const device = useMediaDevice(); const { box_shadow } = styles?.container?.scrollShadow || {}; const { headerRef } = useHeaderShadow({ ref, shadow: { boxShadow: box_shadow, showShadowFrom }, }); return _jsx(HeaderStandAlone, { ...props, ref: headerRef, device: device, styles: styles }); }); HeaderComponent.displayName = 'HeaderComponent'; const HeaderBoundary = (props, ref) => (_jsx(ErrorBoundary, { fallBackComponent: _jsx(FallbackComponent, { children: _jsx(HeaderStandAlone, { ...props, ref: ref }) }), children: _jsx(HeaderComponent, { ...props, ref: ref }) })); /** * @deprecated This component has been deprecated and will be removed in the next MAJOR release. Will include all this on the NavBar component */ const Header = React.forwardRef(HeaderBoundary); export { Header }; //# sourceMappingURL=header.js.map