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

23 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 { useScrollPosition } from '../../hooks/useScrollPosition/useScrollPosition'; import { useStyles } from '../../hooks/useStyles/useStyles'; import { ErrorBoundary } from '../../provider/errorBoundary/errorBoundary'; import { FallbackComponent } from '../../provider/errorBoundary/fallbackComponent'; import { HeaderStandAlone } from './headerStructureStandAlone'; const HeaderStructureComponent = React.forwardRef(({ variant, ctv, ...props }, ref) => { const styles = useStyles(STYLES_NAME.HEADER_STRUCTURE, variant, ctv); const device = useMediaDevice(); const scroll = useScrollPosition(); return (_jsx(HeaderStandAlone, { ...props, ref: ref, device: device, scrolling: scroll > 0, styles: styles })); }); HeaderStructureComponent.displayName = 'HeaderStructureComponent'; const HeaderStructureBoundary = (props, ref) => (_jsx(ErrorBoundary, { fallBackComponent: _jsx(FallbackComponent, { children: _jsx(HeaderStandAlone, { scrolling: false, ...props, ref: ref }) }), children: _jsx(HeaderStructureComponent, { ...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 HeaderStructure = React.forwardRef(HeaderStructureBoundary); export { HeaderStructure }; //# sourceMappingURL=headerStructure.js.map