{"version":3,"file":"Tooltip.cjs","sourceRoot":"","sources":["../../../src/jsx/components/Tooltip.ts"],"names":[],"mappings":";;;AAKA,gDAAmD;AA4BnD,MAAM,IAAI,GAAG,SAAS,CAAC;AAEvB;;;;;;;;;;;;;;;;GAgBG;AACU,QAAA,OAAO,GAAG,IAAA,+BAAmB,EAA4B,IAAI,CAAC,CAAC","sourcesContent":["import type { StandardFormattingElement } from './formatting';\nimport type { IconElement } from './Icon';\nimport type { ImageElement } from './Image';\nimport type { LinkElement } from './Link';\nimport type { TextElement } from './Text';\nimport { createSnapComponent } from '../component';\n\nexport type TooltipChildren =\n  | TextElement\n  | StandardFormattingElement\n  | LinkElement\n  | ImageElement\n  | IconElement\n  | boolean\n  | null;\n\n/**\n * The props of the {@link Tooltip} component.\n *\n * @property children - The children of the box.\n * @property content - The text to display in the tooltip.\n * @category Component Props\n */\nexport type TooltipProps = {\n  children: TooltipChildren;\n  content:\n    | TextElement\n    | StandardFormattingElement\n    | LinkElement\n    | IconElement\n    | string;\n};\n\nconst TYPE = 'Tooltip';\n\n/**\n * A tooltip component, which is used to display text in a tooltip.\n *\n * @param props - The props of the component.\n * @param props.children - The children of the tooltip.\n * @param props.content - The text to display in the tooltip.\n * @returns A tooltip element.\n * @example\n * <Tooltip content=\"Tooltip text\">\n *   <Text>Hello world!</Text>\n * </Tooltip>\n * @example\n * <Tooltip content={<Text>Text with <Bold>formatting</Bold></Text>}>\n *   <Text>Hello world!</Text>\n * </Tooltip>\n * @category Components\n */\nexport const Tooltip = createSnapComponent<TooltipProps, typeof TYPE>(TYPE);\n\n/**\n * A tooltip element.\n *\n * @see {@link Tooltip}\n * @category Elements\n */\nexport type TooltipElement = ReturnType<typeof Tooltip>;\n"]}