UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

1 lines 1.28 kB
{"version":3,"file":"ModalBaseCloseButton.mjs","names":["classes"],"sources":["../../../src/components/ModalBase/ModalBaseCloseButton.tsx"],"sourcesContent":["import cx from 'clsx';\nimport { BoxProps, ElementProps } from '../../core';\nimport { __CloseButtonProps, CloseButton } from '../CloseButton';\nimport { useModalBaseContext } from './ModalBase.context';\nimport classes from './ModalBase.module.css';\n\nexport interface ModalBaseCloseButtonProps\n extends __CloseButtonProps, BoxProps, ElementProps<'button'> {}\n\nexport function ModalBaseCloseButton({ className, onClick, ...others }: ModalBaseCloseButtonProps) {\n const ctx = useModalBaseContext();\n return (\n <CloseButton\n {...others}\n onClick={(event) => {\n ctx.onClose();\n onClick?.(event);\n }}\n className={cx({ [classes.close]: !ctx.unstyled }, className)}\n unstyled={ctx.unstyled}\n />\n );\n}\n\nModalBaseCloseButton.displayName = '@mantine/core/ModalBaseCloseButton';\n"],"mappings":";;;;;;;AASA,SAAgB,qBAAqB,EAAE,WAAW,SAAS,GAAG,UAAqC;CACjG,MAAM,MAAM,oBAAoB;CAChC,OACE,oBAAC,aAAD;EACE,GAAI;EACJ,UAAU,UAAU;GAClB,IAAI,QAAQ;GACZ,UAAU,KAAK;EACjB;EACA,WAAW,GAAG,GAAGA,yBAAQ,QAAQ,CAAC,IAAI,SAAS,GAAG,SAAS;EAC3D,UAAU,IAAI;CACf,CAAA;AAEL;AAEA,qBAAqB,cAAc"}