{"version":3,"file":"TourTitle.mjs","names":["classes"],"sources":["../../../../src/components/Tour/TourTitle/TourTitle.tsx"],"sourcesContent":["import { useEffect } from 'react';\nimport {\n  Box,\n  BoxProps,\n  CompoundStylesApiProps,\n  ElementProps,\n  factory,\n  Factory,\n  useProps,\n} from '../../../core';\nimport { useTourContext } from '../Tour.context';\nimport classes from '../Tour.module.css';\n\nexport type TourTitleStylesNames = 'title';\n\nexport interface TourTitleProps\n  extends BoxProps, CompoundStylesApiProps<TourTitleFactory>, ElementProps<'h3'> {}\n\nexport type TourTitleFactory = Factory<{\n  props: TourTitleProps;\n  ref: HTMLHeadingElement;\n  stylesNames: TourTitleStylesNames;\n  compound: true;\n}>;\n\nconst defaultProps: Partial<TourTitleProps> = {};\n\nexport const TourTitle = factory<TourTitleFactory>((_props) => {\n  const props = useProps('TourTitle', defaultProps, _props);\n  const { children, classNames, className, style, styles, vars, id, ...others } = props;\n  const ctx = useTourContext();\n  const { registerTitle } = ctx;\n  const resolvedId = id ?? ctx.titleId;\n\n  useEffect(() => {\n    registerTitle(resolvedId);\n    return () => registerTitle(null);\n  }, [registerTitle, resolvedId]);\n\n  return (\n    <Box\n      component=\"h3\"\n      id={resolvedId}\n      {...ctx.getStyles('title', { className, classNames, style, styles })}\n      {...others}\n    >\n      {children}\n    </Box>\n  );\n});\n\nTourTitle.classes = classes;\nTourTitle.displayName = '@mantine/core/TourTitle';\n\nexport namespace TourTitle {\n  export type Props = TourTitleProps;\n}\n"],"mappings":";;;;;;;;;AAyBA,MAAM,eAAwC,CAAC;AAE/C,MAAa,YAAY,SAA2B,WAAW;CAE7D,MAAM,EAAE,UAAU,YAAY,WAAW,OAAO,QAAQ,MAAM,IAAI,GAAG,WADvD,SAAS,aAAa,cAAc,MACkC;CACpF,MAAM,MAAM,eAAe;CAC3B,MAAM,EAAE,kBAAkB;CAC1B,MAAM,aAAa,MAAM,IAAI;CAE7B,gBAAgB;EACd,cAAc,UAAU;EACxB,aAAa,cAAc,IAAI;CACjC,GAAG,CAAC,eAAe,UAAU,CAAC;CAE9B,OACE,oBAAC,KAAD;EACE,WAAU;EACV,IAAI;EACJ,GAAI,IAAI,UAAU,SAAS;GAAE;GAAW;GAAY;GAAO;EAAO,CAAC;EACnE,GAAI;EAEH;CACE,CAAA;AAET,CAAC;AAED,UAAU,UAAUA;AACpB,UAAU,cAAc"}