diff --git a/src/mantine-core/src/AppShell/AppShell.story.tsx b/src/mantine-core/src/AppShell/AppShell.story.tsx index 7dd6374b537..f6a08b069d0 100644 --- a/src/mantine-core/src/AppShell/AppShell.story.tsx +++ b/src/mantine-core/src/AppShell/AppShell.story.tsx @@ -32,6 +32,7 @@ export function AltLayout() { return ( @@ -41,7 +42,11 @@ export function AltLayout() { } footer={
Footer
} - navbar={Navbar} + navbar={ + + Navbar + + } aside={} > Content diff --git a/src/mantine-core/src/AppShell/AppShell.tsx b/src/mantine-core/src/AppShell/AppShell.tsx index 963b9a1272b..b24e2e9d6b4 100644 --- a/src/mantine-core/src/AppShell/AppShell.tsx +++ b/src/mantine-core/src/AppShell/AppShell.tsx @@ -4,7 +4,6 @@ import { DefaultProps, Selectors, MantineStyleSystemSize, - getDefaultZIndex, useComponentDefaultProps, } from '@mantine/styles'; import { Box } from '../Box'; @@ -54,7 +53,6 @@ export interface AppShellProps const defaultProps: Partial = { fixed: true, - zIndex: getDefaultZIndex('app'), padding: 'md', }; diff --git a/src/mantine-core/src/AppShell/Aside/Aside.tsx b/src/mantine-core/src/AppShell/Aside/Aside.tsx index 59bce899bfe..8ec4f1640bc 100644 --- a/src/mantine-core/src/AppShell/Aside/Aside.tsx +++ b/src/mantine-core/src/AppShell/Aside/Aside.tsx @@ -1,5 +1,5 @@ import React, { forwardRef } from 'react'; -import { getDefaultZIndex, useComponentDefaultProps } from '@mantine/styles'; +import { useComponentDefaultProps } from '@mantine/styles'; import { ForwardRefWithStaticComponents } from '@mantine/utils'; import { HorizontalSection, @@ -19,7 +19,6 @@ type AsideComponent = ForwardRefWithStaticComponents = { fixed: false, position: { top: 0, right: 0 }, - zIndex: getDefaultZIndex('app'), hiddenBreakpoint: 'md', hidden: false, }; diff --git a/src/mantine-core/src/AppShell/Footer/Footer.tsx b/src/mantine-core/src/AppShell/Footer/Footer.tsx index ef6c93f8348..05a76b5190c 100644 --- a/src/mantine-core/src/AppShell/Footer/Footer.tsx +++ b/src/mantine-core/src/AppShell/Footer/Footer.tsx @@ -1,5 +1,5 @@ import React, { forwardRef } from 'react'; -import { getDefaultZIndex, useComponentDefaultProps } from '@mantine/styles'; +import { useComponentDefaultProps } from '@mantine/styles'; import { VerticalSection, VerticalSectionSharedProps } from '../VerticalSection/VerticalSection'; export interface FooterProps @@ -12,7 +12,6 @@ export interface FooterProps const defaultProps: Partial = { fixed: false, position: { bottom: 0, left: 0, right: 0 }, - zIndex: getDefaultZIndex('app'), }; export const Footer = forwardRef((props: FooterProps, ref) => { diff --git a/src/mantine-core/src/AppShell/Header/Header.tsx b/src/mantine-core/src/AppShell/Header/Header.tsx index 00c5f1e9ac7..426fc7b398e 100644 --- a/src/mantine-core/src/AppShell/Header/Header.tsx +++ b/src/mantine-core/src/AppShell/Header/Header.tsx @@ -1,5 +1,5 @@ import React, { forwardRef } from 'react'; -import { getDefaultZIndex, useComponentDefaultProps } from '@mantine/styles'; +import { useComponentDefaultProps } from '@mantine/styles'; import { VerticalSection, VerticalSectionSharedProps } from '../VerticalSection/VerticalSection'; export interface HeaderProps @@ -12,7 +12,6 @@ export interface HeaderProps const defaultProps: Partial = { fixed: false, position: { top: 0, left: 0, right: 0 }, - zIndex: getDefaultZIndex('app'), }; export const Header = forwardRef((props: HeaderProps, ref) => { diff --git a/src/mantine-core/src/AppShell/HorizontalSection/HorizontalSection.tsx b/src/mantine-core/src/AppShell/HorizontalSection/HorizontalSection.tsx index fa61e7350ce..4725cc7f7b6 100644 --- a/src/mantine-core/src/AppShell/HorizontalSection/HorizontalSection.tsx +++ b/src/mantine-core/src/AppShell/HorizontalSection/HorizontalSection.tsx @@ -51,7 +51,7 @@ export const HorizontalSection = forwardRef height, fixed = false, position, - zIndex = getDefaultZIndex('app'), + zIndex, hiddenBreakpoint = 'md', hidden = false, withBorder = true, @@ -75,7 +75,7 @@ export const HorizontalSection = forwardRef fixed: ctx.fixed || fixed, position, hiddenBreakpoint, - zIndex: ctx.zIndex || zIndex, + zIndex: zIndex || ctx.zIndex || getDefaultZIndex('app'), section, withBorder, layout: ctx.layout, diff --git a/src/mantine-core/src/AppShell/Navbar/Navbar.tsx b/src/mantine-core/src/AppShell/Navbar/Navbar.tsx index 751ad6cfb2f..d919e8c5621 100644 --- a/src/mantine-core/src/AppShell/Navbar/Navbar.tsx +++ b/src/mantine-core/src/AppShell/Navbar/Navbar.tsx @@ -1,5 +1,5 @@ import React, { forwardRef } from 'react'; -import { getDefaultZIndex, useComponentDefaultProps } from '@mantine/styles'; +import { useComponentDefaultProps } from '@mantine/styles'; import { ForwardRefWithStaticComponents } from '@mantine/utils'; import { HorizontalSection, @@ -19,7 +19,6 @@ type NavbarComponent = ForwardRefWithStaticComponents = { fixed: false, position: { top: 0, left: 0 }, - zIndex: getDefaultZIndex('app'), hiddenBreakpoint: 'md', hidden: false, }; diff --git a/src/mantine-core/src/AppShell/VerticalSection/VerticalSection.tsx b/src/mantine-core/src/AppShell/VerticalSection/VerticalSection.tsx index 6c4a7d65148..ba221c0bdd3 100644 --- a/src/mantine-core/src/AppShell/VerticalSection/VerticalSection.tsx +++ b/src/mantine-core/src/AppShell/VerticalSection/VerticalSection.tsx @@ -46,7 +46,7 @@ export const VerticalSection = forwardRef( fixed = false, withBorder = true, position, - zIndex = getDefaultZIndex('app'), + zIndex, section, unstyled, __staticSelector, @@ -55,7 +55,7 @@ export const VerticalSection = forwardRef( ref ) => { const ctx = useAppShellContext(); - const _zIndex = ctx.zIndex || zIndex; + const _zIndex = zIndex || ctx.zIndex || getDefaultZIndex('app'); const { classes, cx, theme } = useStyles( {