UNPKG

@mantine/code-highlight

Version:

Code highlight with Mantine theme

33 lines (32 loc) 1.42 kB
"use client"; const require_CodeHighlight_context = require("../CodeHighlight.context.cjs"); let _mantine_core = require("@mantine/core"); let react_jsx_runtime = require("react/jsx-runtime"); //#region packages/@mantine/code-highlight/src/CodeHighlight/CodeHighlightControl/CodeHighlightControl.tsx const CodeHighlightControl = (0, _mantine_core.polymorphicFactory)((_props) => { const { children, vars, tooltipLabel, ...others } = (0, _mantine_core.useProps)("CodeHighlightControl", null, _props); const ctx = require_CodeHighlight_context.useCodeHighlightContext(); const tooltipStyles = ctx.getStyles("controlTooltip"); const control = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.ActionIcon, { ...ctx.getStyles("control"), ...others, variant: "none", "data-code-color-scheme": ctx.codeColorScheme, children }); if (tooltipLabel) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Tooltip, { label: tooltipLabel, fz: "sm", position: "bottom", classNames: { tooltip: tooltipStyles.className }, styles: { tooltip: tooltipStyles.style }, "data-code-color-scheme": ctx.codeColorScheme, transitionProps: { duration: 0 }, children: control }); return control; }); CodeHighlightControl.displayName = "@mantine/code-highlight/CodeHighlightControl"; //#endregion exports.CodeHighlightControl = CodeHighlightControl; //# sourceMappingURL=CodeHighlightControl.cjs.map