@mantine/core
Version:
React components library focused on usability, accessibility and developer experience
1 lines • 2.34 kB
Source Map (JSON)
{"version":3,"file":"DrawerContent.cjs","names":["factory","useProps","useDrawerContext","NativeScrollArea","ModalBaseContent","classes"],"sources":["../../../src/components/Drawer/DrawerContent.tsx"],"sourcesContent":["import { CompoundStylesApiProps, factory, Factory, useProps } from '../../core';\nimport { ModalBaseContent, ModalBaseContentProps, NativeScrollArea } from '../ModalBase';\nimport { useDrawerContext } from './Drawer.context';\nimport classes from './Drawer.module.css';\n\nexport type DrawerContentStylesNames = 'content' | 'inner';\n\nexport interface DrawerContentProps\n extends ModalBaseContentProps, CompoundStylesApiProps<DrawerContentFactory> {\n __hidden?: boolean;\n}\n\nexport type DrawerContentFactory = Factory<{\n props: DrawerContentProps;\n ref: HTMLDivElement;\n stylesNames: DrawerContentStylesNames;\n compound: true;\n}>;\n\nexport const DrawerContent = factory<DrawerContentFactory>((_props) => {\n const props = useProps('DrawerContent', null, _props);\n const { classNames, className, style, styles, vars, children, radius, __hidden, ...others } =\n props;\n\n const ctx = useDrawerContext();\n const Scroll: React.FC<any> = ctx.scrollAreaComponent || NativeScrollArea;\n\n return (\n <ModalBaseContent\n {...ctx.getStyles('content', { className, style, styles, classNames })}\n innerProps={ctx.getStyles('inner', { className, style, styles, classNames })}\n {...others}\n radius={radius || ctx.radius || 0}\n data-hidden={__hidden || undefined}\n >\n <Scroll style={{ height: 'calc(100vh - var(--drawer-offset) * 2)' }}>{children}</Scroll>\n </ModalBaseContent>\n );\n});\n\nDrawerContent.classes = classes;\nDrawerContent.displayName = '@mantine/core/DrawerContent';\n"],"mappings":";;;;;;;;;;AAmBA,MAAa,gBAAgBA,gBAAAA,SAA+B,WAAW;CAErE,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,MAAM,UAAU,QAAQ,UAAU,GAAG,WADrEC,kBAAAA,SAAS,iBAAiB,MAAM,OAAO;CAIrD,MAAM,MAAMC,uBAAAA,kBAAkB;CAC9B,MAAM,SAAwB,IAAI,uBAAuBC,yBAAAA;AAEzD,QACE,iBAAA,GAAA,kBAAA,KAACC,yBAAAA,kBAAD;EACE,GAAI,IAAI,UAAU,WAAW;GAAE;GAAW;GAAO;GAAQ;GAAY,CAAC;EACtE,YAAY,IAAI,UAAU,SAAS;GAAE;GAAW;GAAO;GAAQ;GAAY,CAAC;EAC5E,GAAI;EACJ,QAAQ,UAAU,IAAI,UAAU;EAChC,eAAa,YAAY,KAAA;YAEzB,iBAAA,GAAA,kBAAA,KAAC,QAAD;GAAQ,OAAO,EAAE,QAAQ,0CAA0C;GAAG;GAAkB,CAAA;EACvE,CAAA;EAErB;AAEF,cAAc,UAAUC,sBAAAA;AACxB,cAAc,cAAc"}