@mantine/core
Version:
React components library focused on usability, accessibility and developer experience
1 lines • 1.58 kB
Source Map (JSON)
{"version":3,"file":"DrawerCloseButton.mjs","names":["classes"],"sources":["../../../src/components/Drawer/DrawerCloseButton.tsx"],"sourcesContent":["import { CompoundStylesApiProps, factory, Factory, useProps } from '../../core';\nimport { ModalBaseCloseButton, ModalBaseCloseButtonProps } from '../ModalBase';\nimport { useDrawerContext } from './Drawer.context';\nimport classes from './Drawer.module.css';\n\nexport type DrawerCloseButtonStylesNames = 'close';\n\nexport interface DrawerCloseButtonProps\n extends ModalBaseCloseButtonProps, CompoundStylesApiProps<DrawerCloseButtonFactory> {}\n\nexport type DrawerCloseButtonFactory = Factory<{\n props: DrawerCloseButtonProps;\n ref: HTMLButtonElement;\n stylesNames: DrawerCloseButtonStylesNames;\n compound: true;\n}>;\n\nexport const DrawerCloseButton = factory<DrawerCloseButtonFactory>((_props) => {\n const props = useProps('DrawerCloseButton', null, _props);\n const { classNames, className, style, styles, vars, ...others } = props;\n\n const ctx = useDrawerContext();\n\n return (\n <ModalBaseCloseButton\n {...ctx.getStyles('close', { classNames, style, styles, className })}\n {...others}\n />\n );\n});\n\nDrawerCloseButton.classes = classes;\nDrawerCloseButton.displayName = '@mantine/core/DrawerCloseButton';\n"],"mappings":";;;;;;;;AAiBA,MAAa,oBAAoB,SAAmC,WAAW;CAE7E,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,MAAM,GAAG,WADzC,SAAS,qBAAqB,MAAM,OAAO;AAKzD,QACE,oBAAC,sBAAD;EACE,GAJQ,kBAAkB,CAIlB,UAAU,SAAS;GAAE;GAAY;GAAO;GAAQ;GAAW,CAAC;EACpE,GAAI;EACJ,CAAA;EAEJ;AAEF,kBAAkB,UAAUA;AAC5B,kBAAkB,cAAc"}