@mantine/core
Version:
React components library focused on usability, accessibility and developer experience
60 lines (57 loc) • 1.88 kB
JavaScript
'use client';
import { jsx } from 'react/jsx-runtime';
import cx from 'clsx';
import { RemoveScroll } from 'react-remove-scroll';
import 'react';
import '@mantine/hooks';
import '../../../core/MantineProvider/Mantine.context.mjs';
import '../../../core/MantineProvider/default-theme.mjs';
import '../../../core/MantineProvider/MantineProvider.mjs';
import '../../../core/MantineProvider/MantineThemeProvider/MantineThemeProvider.mjs';
import { useProps } from '../../../core/MantineProvider/use-props/use-props.mjs';
import '../../../core/MantineProvider/MantineCssVariables/MantineCssVariables.mjs';
import { Box } from '../../../core/Box/Box.mjs';
import { factory } from '../../../core/factory/factory.mjs';
import '../../../core/DirectionProvider/DirectionProvider.mjs';
import { useAppShellContext } from '../AppShell.context.mjs';
import classes from '../AppShell.module.css.mjs';
const defaultProps = {};
const AppShellHeader = factory((_props, ref) => {
const props = useProps("AppShellHeader", defaultProps, _props);
const {
classNames,
className,
style,
styles,
unstyled,
vars,
withBorder,
zIndex,
mod,
...others
} = props;
const ctx = useAppShellContext();
if (ctx.disabled) {
return null;
}
return /* @__PURE__ */ jsx(
Box,
{
component: "header",
ref,
mod: [{ "with-border": withBorder ?? ctx.withBorder }, mod],
...ctx.getStyles("header", {
className: cx({ [RemoveScroll.classNames.zeroRight]: ctx.offsetScrollbars }, className),
classNames,
styles,
style
}),
...others,
__vars: { "--app-shell-header-z-index": (zIndex ?? ctx.zIndex)?.toString() }
}
);
});
AppShellHeader.classes = classes;
AppShellHeader.displayName = "@mantine/core/AppShellHeader";
export { AppShellHeader };
//# sourceMappingURL=AppShellHeader.mjs.map