@julseb-lib/react 0.1.43 → 0.1.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs
CHANGED
|
@@ -11652,10 +11652,12 @@ var import_jsx_runtime130 = require("react/jsx-runtime");
|
|
|
11652
11652
|
var CodeContainer = (_a) => {
|
|
11653
11653
|
var _b = _a, {
|
|
11654
11654
|
children,
|
|
11655
|
-
code
|
|
11655
|
+
code,
|
|
11656
|
+
showNumbers
|
|
11656
11657
|
} = _b, rest = __objRest(_b, [
|
|
11657
11658
|
"children",
|
|
11658
|
-
"code"
|
|
11659
|
+
"code",
|
|
11660
|
+
"showNumbers"
|
|
11659
11661
|
]);
|
|
11660
11662
|
const [hasCopied, setHasCopied] = (0, import_react56.useState)(false);
|
|
11661
11663
|
const copyToClipboard = () => {
|
|
@@ -11676,7 +11678,7 @@ var CodeContainer = (_a) => {
|
|
|
11676
11678
|
style,
|
|
11677
11679
|
className: "relative max-w-full overflow-x-scroll",
|
|
11678
11680
|
children: tokens.map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", __spreadProps(__spreadValues({}, getLineProps({ line })), { children: [
|
|
11679
|
-
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "mr-6", children: i + 1 }),
|
|
11681
|
+
showNumbers && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "mr-6", children: i + 1 }),
|
|
11680
11682
|
line.map((token, key) => /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
11681
11683
|
"span",
|
|
11682
11684
|
__spreadValues({}, getTokenProps({ token })),
|
|
@@ -11688,8 +11690,8 @@ var CodeContainer = (_a) => {
|
|
|
11688
11690
|
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
11689
11691
|
ButtonIcon,
|
|
11690
11692
|
{
|
|
11691
|
-
icon: hasCopied ? /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_bi27.BiCheck, { size:
|
|
11692
|
-
className: "top-2 right-2 absolute",
|
|
11693
|
+
icon: hasCopied ? /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_bi27.BiCheck, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_bi27.BiClipboard, { size: 16 }),
|
|
11694
|
+
className: "top-2 right-2 absolute size-8",
|
|
11693
11695
|
color: hasCopied ? "success" : "primary",
|
|
11694
11696
|
onClick: copyToClipboard
|
|
11695
11697
|
}
|