@daren/code-block
Advanced tools
Comparing version 2.0.4 to 2.0.5
@@ -42,3 +42,4 @@ "use strict"; | ||
showLineNumbers = _ref.showLineNumbers, | ||
theme = _ref.theme; | ||
theme = _ref.theme, | ||
classNameProp = _ref.className; | ||
return /*#__PURE__*/React.createElement(_prismReactRenderer["default"], _extends({}, _prismReactRenderer.defaultProps, { | ||
@@ -55,3 +56,3 @@ code: code, | ||
return /*#__PURE__*/React.createElement("pre", { | ||
className: (0, _utils.cx)(className, 'pr-8 py-4 relative my-5 overflow-x-auto text-sm leading-relaxed rounded', { | ||
className: (0, _utils.cx)(classNameProp, className, 'pr-8 py-4 relative my-5 overflow-x-auto text-sm leading-relaxed rounded-xl', { | ||
'pl-4': !showLineNumbers, | ||
@@ -58,0 +59,0 @@ 'pl-16': showLineNumbers |
@@ -27,3 +27,4 @@ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
showLineNumbers, | ||
theme | ||
theme, | ||
className: classNameProp | ||
} = _ref; | ||
@@ -43,3 +44,3 @@ return /*#__PURE__*/React.createElement(Highlight, _extends({}, defaultProps, { | ||
return /*#__PURE__*/React.createElement("pre", { | ||
className: cx(className, 'pr-8 py-4 relative my-5 overflow-x-auto text-sm leading-relaxed rounded', { | ||
className: cx(classNameProp, className, 'pr-8 py-4 relative my-5 overflow-x-auto text-sm leading-relaxed rounded-xl', { | ||
'pl-4': !showLineNumbers, | ||
@@ -46,0 +47,0 @@ 'pl-16': showLineNumbers |
/// <reference types="react" /> | ||
import { Language, PrismTheme } from 'prism-react-renderer'; | ||
declare type CodeBlockLanguage = Language; | ||
declare function CodeBlock({ code, language, showLineNumbers, theme, }: { | ||
declare function CodeBlock({ code, language, showLineNumbers, theme, className: classNameProp, }: { | ||
code?: string; | ||
@@ -9,4 +9,5 @@ language?: Language; | ||
theme?: PrismTheme; | ||
className?: string; | ||
}): JSX.Element; | ||
export { CodeBlock }; | ||
export type { CodeBlockLanguage }; |
{ | ||
"name": "@daren/code-block", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"repository": { | ||
@@ -51,3 +51,3 @@ "type": "git", | ||
}, | ||
"gitHead": "160319abc027e2250a34d29a4b5b192b5f6c0307" | ||
"gitHead": "a81e566b8e14c9c52114a9822acfa2be1a92442c" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
18622
163