{"version":3,"file":"RichTextEditorToolbar.mjs","names":["classes"],"sources":["../../src/RichTextEditorToolbar/RichTextEditorToolbar.tsx"],"sourcesContent":["import {\n  Box,\n  BoxProps,\n  CompoundStylesApiProps,\n  ElementProps,\n  factory,\n  Factory,\n  rem,\n  useProps,\n} from '@mantine/core';\nimport { useRichTextEditorContext } from '../RichTextEditor.context';\nimport classes from '../RichTextEditor.module.css';\n\nexport type RichTextEditorToolbarStylesNames = 'toolbar';\n\nexport interface RichTextEditorToolbarProps\n  extends BoxProps, CompoundStylesApiProps<RichTextEditorToolbarFactory>, ElementProps<'div'> {\n  /** Determines whether `position: sticky` styles should be added to the toolbar @default false */\n  sticky?: boolean;\n\n  /** Sets top style to offset elements with fixed position @default 0 */\n  stickyOffset?: React.CSSProperties['top'];\n}\n\nexport type RichTextEditorToolbarFactory = Factory<{\n  props: RichTextEditorToolbarProps;\n  ref: HTMLDivElement;\n  stylesNames: RichTextEditorToolbarStylesNames;\n  compound: true;\n}>;\n\nexport const RichTextEditorToolbar = factory<RichTextEditorToolbarFactory>((_props) => {\n  const props = useProps('RichTextEditorToolbar', null, _props);\n  const {\n    classNames,\n    className,\n    style,\n    styles,\n    vars,\n    sticky,\n    stickyOffset,\n    mod,\n    variant,\n    ...others\n  } = props;\n  const ctx = useRichTextEditorContext();\n\n  return (\n    <Box\n      mod={[{ sticky }, mod]}\n      variant={variant || ctx.variant}\n      {...ctx.getStyles('toolbar', { className, style, styles, classNames })}\n      {...others}\n      __vars={{ '--rte-sticky-offset': rem(stickyOffset) }}\n    />\n  );\n});\n\nRichTextEditorToolbar.classes = classes;\nRichTextEditorToolbar.displayName = '@mantine/tiptap/RichTextEditorToolbar';\n"],"mappings":";;;;;;AA+BA,MAAa,wBAAwB,SAAuC,WAAW;CAErF,MAAM,EACJ,YACA,WACA,OACA,QACA,MACA,QACA,cACA,KACA,SACA,GAAG,WAXS,SAAS,yBAAyB,MAAM,MAY9C;CACR,MAAM,MAAM,yBAAyB;CAErC,OACE,oBAAC,KAAD;EACE,KAAK,CAAC,EAAE,OAAO,GAAG,GAAG;EACrB,SAAS,WAAW,IAAI;EACxB,GAAI,IAAI,UAAU,WAAW;GAAE;GAAW;GAAO;GAAQ;EAAW,CAAC;EACrE,GAAI;EACJ,QAAQ,EAAE,uBAAuB,IAAI,YAAY,EAAE;CACpD,CAAA;AAEL,CAAC;AAED,sBAAsB,UAAUA;AAChC,sBAAsB,cAAc"}