@julseb-lib/react 0.1.45 → 0.1.47
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 +28 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +28 -17
- package/dist/index.js.map +1 -1
- package/dist/types/components-props.d.cts +2 -2
- package/dist/types/components-props.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -11653,11 +11653,13 @@ var CodeContainer = (_a) => {
|
|
|
11653
11653
|
var _b = _a, {
|
|
11654
11654
|
children,
|
|
11655
11655
|
code,
|
|
11656
|
-
showNumbers
|
|
11656
|
+
showNumbers,
|
|
11657
|
+
language = "tsx"
|
|
11657
11658
|
} = _b, rest = __objRest(_b, [
|
|
11658
11659
|
"children",
|
|
11659
11660
|
"code",
|
|
11660
|
-
"showNumbers"
|
|
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)(
|
|
11676
|
-
|
|
11677
|
-
{
|
|
11678
|
-
|
|
11679
|
-
|
|
11680
|
-
|
|
11681
|
-
|
|
11682
|
-
|
|
11683
|
-
|
|
11684
|
-
|
|
11685
|
-
|
|
11686
|
-
|
|
11687
|
-
|
|
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 hide-scrollbar",
|
|
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
|
{
|