@mantine/code-highlight
Version:
Code highlight with Mantine theme
41 lines (40 loc) • 1.51 kB
JavaScript
"use client";
import CodeHighlight_module_default from "../CodeHighlight.module.mjs";
import { CodeHighlight } from "./CodeHighlight.mjs";
import { createVarsResolver, factory, getRadius, getThemeColor, useProps, useStyles } from "@mantine/core";
import { jsx } from "react/jsx-runtime";
//#region packages/@mantine/code-highlight/src/CodeHighlight/InlineCodeHighlight.tsx
const varsResolver = createVarsResolver((theme, { background, radius }) => ({ inlineCodeHighlight: {
"--ch-background": background ? getThemeColor(background, theme) : void 0,
"--ch-radius": typeof radius !== "undefined" ? getRadius(radius) : void 0
} }));
const InlineCodeHighlight = factory((_props) => {
const props = useProps("InlineCodeHighlight", null, _props);
const { classNames, className, style, styles, unstyled, vars, attributes, ref, ...others } = props;
const getStyles = useStyles({
name: "InlineCodeHighlight",
classes: CodeHighlight_module_default,
props,
className,
style,
classNames,
styles,
unstyled,
attributes,
vars,
varsResolver,
rootSelector: "inlineCodeHighlight"
});
return /* @__PURE__ */ jsx(CodeHighlight, {
...others,
ref,
...getStyles("inlineCodeHighlight"),
__inline: true
});
});
InlineCodeHighlight.displayName = "@mantine/code-highlight/InlineCodeHighlight";
InlineCodeHighlight.classes = CodeHighlight_module_default;
InlineCodeHighlight.varsResolver = varsResolver;
//#endregion
export { InlineCodeHighlight };
//# sourceMappingURL=InlineCodeHighlight.mjs.map