UNPKG

@mantine/code-highlight

Version:

Code highlight with Mantine theme

39 lines (36 loc) 1.35 kB
'use client'; import { jsx } from 'react/jsx-runtime'; import { createVarsResolver, getThemeColor, getRadius, factory, useProps, useStyles } from '@mantine/core'; import { CodeHighlight } from './CodeHighlight.mjs'; import classes from '../CodeHighlight.module.css.mjs'; const defaultProps = {}; 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, ref) => { const props = useProps("InlineCodeHighlight", defaultProps, _props); const { classNames, className, style, styles, unstyled, vars, ...others } = props; const getStyles = useStyles({ name: "InlineCodeHighlight", classes, props, className, style, classNames, styles, unstyled, vars, varsResolver, rootSelector: "inlineCodeHighlight" }); return /* @__PURE__ */ jsx(CodeHighlight, { ...others, ref, ...getStyles("inlineCodeHighlight"), __inline: true }); }); InlineCodeHighlight.displayName = "@mantine/code-highlight/InlineCodeHighlight"; InlineCodeHighlight.classes = classes; export { InlineCodeHighlight }; //# sourceMappingURL=InlineCodeHighlight.mjs.map