UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

1 lines 1.88 kB
{"version":3,"file":"AppShellSection.cjs","names":["polymorphicFactory","useProps","useAppShellContext","Box","classes"],"sources":["../../../../src/components/AppShell/AppShellSection/AppShellSection.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n CompoundStylesApiProps,\n polymorphicFactory,\n PolymorphicFactory,\n useProps,\n} from '../../../core';\nimport { useAppShellContext } from '../AppShell.context';\nimport classes from '../AppShell.module.css';\n\nexport type AppShellSectionStylesNames = 'section';\n\nexport interface AppShellSectionProps\n extends BoxProps, CompoundStylesApiProps<AppShellSectionFactory> {\n /** If set, the section expands to take all available space */\n grow?: boolean;\n}\n\nexport type AppShellSectionFactory = PolymorphicFactory<{\n props: AppShellSectionProps;\n defaultRef: HTMLDivElement;\n defaultComponent: 'div';\n stylesNames: AppShellSectionStylesNames;\n compound: true;\n}>;\n\nexport const AppShellSection = polymorphicFactory<AppShellSectionFactory>((_props) => {\n const { classNames, className, style, styles, vars, grow, mod, ...others } = useProps(\n 'AppShellSection',\n null,\n _props\n );\n\n const ctx = useAppShellContext();\n\n return (\n <Box\n mod={[{ grow }, mod]}\n {...ctx.getStyles('section', { className, style, classNames, styles })}\n {...others}\n />\n );\n});\n\nAppShellSection.classes = classes;\nAppShellSection.displayName = '@mantine/core/AppShellSection';\n"],"mappings":";;;;;;;;;AA2BA,MAAa,kBAAkBA,4BAAAA,oBAA4C,WAAW;CACpF,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,MAAM,MAAM,KAAK,GAAG,WAAWC,kBAAAA,SAC3E,mBACA,MACA,OACD;CAED,MAAM,MAAMC,yBAAAA,oBAAoB;AAEhC,QACE,iBAAA,GAAA,kBAAA,KAACC,YAAAA,KAAD;EACE,KAAK,CAAC,EAAE,MAAM,EAAE,IAAI;EACpB,GAAI,IAAI,UAAU,WAAW;GAAE;GAAW;GAAO;GAAY;GAAQ,CAAC;EACtE,GAAI;EACJ,CAAA;EAEJ;AAEF,gBAAgB,UAAUC,wBAAAA;AAC1B,gBAAgB,cAAc"}