@julseb-lib/react 0.1.44 → 0.1.46

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
@@ -11653,11 +11653,13 @@ var CodeContainer = (_a) => {
11653
11653
  var _b = _a, {
11654
11654
  children,
11655
11655
  code,
11656
- hideNumbers
11656
+ showNumbers,
11657
+ language = "tsx"
11657
11658
  } = _b, rest = __objRest(_b, [
11658
11659
  "children",
11659
11660
  "code",
11660
- "hideNumbers"
11661
+ "showNumbers",
11662
+ "language"
11661
11663
  ]);
11662
11664
  const [hasCopied, setHasCopied] = (0, import_react56.useState)(false);
11663
11665
  const copyToClipboard = () => {
@@ -11672,21 +11674,30 @@ var CodeContainer = (_a) => {
11672
11674
  setTimeout(() => setHasCopied(false), 1e3);
11673
11675
  };
11674
11676
  return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "relative bg-[#282c34] p-6", children: [
11675
- /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_prism_react_renderer.Highlight, __spreadProps(__spreadValues({ theme: import_prism_react_renderer.themes.oneDark, code: children }, rest), { children: ({ style, tokens, getLineProps, getTokenProps }) => /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
11676
- "pre",
11677
- {
11678
- style,
11679
- className: "relative max-w-full overflow-x-scroll",
11680
- children: tokens.map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", __spreadProps(__spreadValues({}, getLineProps({ line })), { children: [
11681
- !hideNumbers && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "mr-6", children: i + 1 }),
11682
- line.map((token, key) => /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
11683
- "span",
11684
- __spreadValues({}, getTokenProps({ token })),
11685
- key
11686
- ))
11687
- ] }), i))
11688
- }
11689
- ) })),
11677
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
11678
+ import_prism_react_renderer.Highlight,
11679
+ __spreadProps(__spreadValues({
11680
+ theme: import_prism_react_renderer.themes.oneDark,
11681
+ language,
11682
+ code: children
11683
+ }, rest), {
11684
+ children: ({ style, tokens, getLineProps, getTokenProps }) => /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
11685
+ "pre",
11686
+ {
11687
+ style,
11688
+ className: "relative max-w-full overflow-x-scroll",
11689
+ children: tokens.map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", __spreadProps(__spreadValues({}, getLineProps({ line })), { children: [
11690
+ showNumbers && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "mr-6", children: i + 1 }),
11691
+ line.map((token, key) => /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
11692
+ "span",
11693
+ __spreadValues({}, getTokenProps({ token })),
11694
+ key
11695
+ ))
11696
+ ] }), i))
11697
+ }
11698
+ )
11699
+ })
11700
+ ),
11690
11701
  /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
11691
11702
  ButtonIcon,
11692
11703
  {