@mantine/core
Version:
React components library focused on usability, accessibility and developer experience
1 lines • 2.45 kB
Source Map (JSON)
{"version":3,"file":"AppShellHeader.cjs","names":["factory","useProps","useAppShellContext","Box","RemoveScroll","classes"],"sources":["../../../../src/components/AppShell/AppShellHeader/AppShellHeader.tsx"],"sourcesContent":["import cx from 'clsx';\nimport { RemoveScroll } from 'react-remove-scroll';\nimport {\n Box,\n BoxProps,\n ElementProps,\n factory,\n Factory,\n StylesApiProps,\n useProps,\n} from '../../../core';\nimport { useAppShellContext } from '../AppShell.context';\nimport type { AppShellCompoundProps } from '../AppShell.types';\nimport classes from '../AppShell.module.css';\n\nexport type AppShellHeaderStylesNames = 'header';\n\nexport interface AppShellHeaderProps\n extends\n BoxProps,\n AppShellCompoundProps,\n StylesApiProps<AppShellHeaderFactory>,\n ElementProps<'header'> {}\n\nexport type AppShellHeaderFactory = Factory<{\n props: AppShellHeaderProps;\n ref: HTMLElement;\n stylesNames: AppShellHeaderStylesNames;\n}>;\n\nexport const AppShellHeader = factory<AppShellHeaderFactory>((_props) => {\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n withBorder,\n zIndex,\n mod,\n ...others\n } = useProps('AppShellHeader', null, _props);\n\n const ctx = useAppShellContext();\n\n if (ctx.disabled) {\n return null;\n }\n\n return (\n <Box\n component=\"header\"\n mod={[{ 'with-border': withBorder ?? ctx.withBorder }, mod]}\n {...ctx.getStyles('header', {\n className: cx({ [RemoveScroll.classNames.zeroRight]: ctx.offsetScrollbars }, className),\n classNames,\n styles,\n style,\n })}\n {...others}\n __vars={{ '--app-shell-header-z-index': (zIndex ?? ctx.zIndex)?.toString() }}\n />\n );\n});\n\nAppShellHeader.classes = classes;\nAppShellHeader.displayName = '@mantine/core/AppShellHeader';\n"],"mappings":";;;;;;;;;;;;AA8BA,MAAa,iBAAiBA,gBAAAA,SAAgC,WAAW;CACvE,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,YACA,QACA,KACA,GAAG,WACDC,kBAAAA,SAAS,kBAAkB,MAAM,OAAO;CAE5C,MAAM,MAAMC,yBAAAA,oBAAoB;AAEhC,KAAI,IAAI,SACN,QAAO;AAGT,QACE,iBAAA,GAAA,kBAAA,KAACC,YAAAA,KAAD;EACE,WAAU;EACV,KAAK,CAAC,EAAE,eAAe,cAAc,IAAI,YAAY,EAAE,IAAI;EAC3D,GAAI,IAAI,UAAU,UAAU;GAC1B,YAAA,GAAA,KAAA,SAAc,GAAGC,oBAAAA,aAAa,WAAW,YAAY,IAAI,kBAAkB,EAAE,UAAU;GACvF;GACA;GACA;GACD,CAAC;EACF,GAAI;EACJ,QAAQ,EAAE,+BAA+B,UAAU,IAAI,SAAS,UAAU,EAAE;EAC5E,CAAA;EAEJ;AAEF,eAAe,UAAUC,wBAAAA;AACzB,eAAe,cAAc"}