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

29 lines 2.17 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.HeaderStructure = void 0; const jsx_runtime_1 = require("react/jsx-runtime"); const react_1 = __importDefault(require("react")); const stylesName_1 = require("../../constants/stylesName/stylesName"); const useMediaDevice_1 = require("../../hooks/useMediaDevice/useMediaDevice"); const useScrollPosition_1 = require("../../hooks/useScrollPosition/useScrollPosition"); const useStyles_1 = require("../../hooks/useStyles/useStyles"); const errorBoundary_1 = require("../../provider/errorBoundary/errorBoundary"); const fallbackComponent_1 = require("../../provider/errorBoundary/fallbackComponent"); const headerStructureStandAlone_1 = require("./headerStructureStandAlone"); const HeaderStructureComponent = react_1.default.forwardRef(({ variant, ctv, ...props }, ref) => { const styles = (0, useStyles_1.useStyles)(stylesName_1.STYLES_NAME.HEADER_STRUCTURE, variant, ctv); const device = (0, useMediaDevice_1.useMediaDevice)(); const scroll = (0, useScrollPosition_1.useScrollPosition)(); return ((0, jsx_runtime_1.jsx)(headerStructureStandAlone_1.HeaderStandAlone, { ...props, ref: ref, device: device, scrolling: scroll > 0, styles: styles })); }); HeaderStructureComponent.displayName = 'HeaderStructureComponent'; const HeaderStructureBoundary = (props, ref) => ((0, jsx_runtime_1.jsx)(errorBoundary_1.ErrorBoundary, { fallBackComponent: (0, jsx_runtime_1.jsx)(fallbackComponent_1.FallbackComponent, { children: (0, jsx_runtime_1.jsx)(headerStructureStandAlone_1.HeaderStandAlone, { scrolling: false, ...props, ref: ref }) }), children: (0, jsx_runtime_1.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_1.default.forwardRef(HeaderStructureBoundary); exports.HeaderStructure = HeaderStructure; //# sourceMappingURL=headerStructure.js.map