{"version":3,"file":"TourCloseButton.cjs","names":["useProps","useTourContext","CloseButton"],"sources":["../../../../src/components/Tour/TourCloseButton/TourCloseButton.tsx"],"sourcesContent":["import { useProps } from '../../../core';\nimport { CloseButton, type __CloseButtonProps } from '../../CloseButton';\nimport { useTourContext } from '../Tour.context';\n\nexport interface TourCloseButtonProps extends __CloseButtonProps {\n  /** Called when the close button is clicked */\n  onClick?: React.MouseEventHandler<HTMLButtonElement>;\n}\n\nconst defaultProps: Partial<TourCloseButtonProps> = {};\n\nexport function TourCloseButton(_props: TourCloseButtonProps) {\n  const props = useProps('TourCloseButton', defaultProps, _props);\n  const { onClick, ...others } = props;\n  const ctx = useTourContext();\n\n  if (!ctx.withCloseButton) {\n    return null;\n  }\n\n  return (\n    <CloseButton\n      aria-label={ctx.labels.close}\n      {...ctx.getStyles('closeButton')}\n      onClick={(event: React.MouseEvent<HTMLButtonElement>) => {\n        ctx.close();\n        onClick?.(event);\n      }}\n      {...others}\n    />\n  );\n}\n\nTourCloseButton.displayName = '@mantine/core/TourCloseButton';\n\nexport namespace TourCloseButton {\n  export type Props = TourCloseButtonProps;\n}\n"],"mappings":";;;;;;AASA,MAAM,eAA8C,CAAC;AAErD,SAAgB,gBAAgB,QAA8B;CAE5D,MAAM,EAAE,SAAS,GAAG,WADNA,kBAAAA,SAAS,mBAAmB,cAAc,MACrB;CACnC,MAAM,MAAMC,qBAAAA,eAAe;CAE3B,IAAI,CAAC,IAAI,iBACP,OAAO;CAGT,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,oBAAAA,aAAD;EACE,cAAY,IAAI,OAAO;EACvB,GAAI,IAAI,UAAU,aAAa;EAC/B,UAAU,UAA+C;GACvD,IAAI,MAAM;GACV,UAAU,KAAK;EACjB;EACA,GAAI;CACL,CAAA;AAEL;AAEA,gBAAgB,cAAc"}