@julseb-lib/react 0.1.45 → 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.d.cts CHANGED
@@ -3221,11 +3221,13 @@ declare const SrOnly: FC$1<ILibSrOnly>;
3221
3221
  * @extends HighlightProps
3222
3222
  *
3223
3223
  * @prop {string} [props.children] - The code string to be highlighted and displayed. If starting with "$ ", it will be removed before copying. Default: undefined.
3224
+ * @prop {boolean} [props.showNumbers] Possible values: true, false. Default: false. - If true, shows the line numbers in the code block.
3225
+ * @prop {string} [props.language] Possible values: any valid Prism language string (e.g., "tsx", "js", "shell"). Default: "tsx". - The language for syntax highlighting.
3224
3226
  * @prop {...HighlightProps} [props.<other>] - All other props from `HighlightProps` except "children" and "code".
3225
3227
  *
3226
3228
  * @returns {JSX.Element} The rendered code block with syntax highlighting and a copy button.
3227
3229
  *
3228
- * @see https://doc-julseb-lib-react.vercel.app/components/CodeContainer
3230
+ * @see https://doc-julseb-lib-react.vercel.app/components/code-container
3229
3231
  */
3230
3232
  declare const CodeContainer: FC$1<ILibCodeContainer>;
3231
3233
 
package/dist/index.d.ts CHANGED
@@ -3221,11 +3221,13 @@ declare const SrOnly: FC$1<ILibSrOnly>;
3221
3221
  * @extends HighlightProps
3222
3222
  *
3223
3223
  * @prop {string} [props.children] - The code string to be highlighted and displayed. If starting with "$ ", it will be removed before copying. Default: undefined.
3224
+ * @prop {boolean} [props.showNumbers] Possible values: true, false. Default: false. - If true, shows the line numbers in the code block.
3225
+ * @prop {string} [props.language] Possible values: any valid Prism language string (e.g., "tsx", "js", "shell"). Default: "tsx". - The language for syntax highlighting.
3224
3226
  * @prop {...HighlightProps} [props.<other>] - All other props from `HighlightProps` except "children" and "code".
3225
3227
  *
3226
3228
  * @returns {JSX.Element} The rendered code block with syntax highlighting and a copy button.
3227
3229
  *
3228
- * @see https://doc-julseb-lib-react.vercel.app/components/CodeContainer
3230
+ * @see https://doc-julseb-lib-react.vercel.app/components/code-container
3229
3231
  */
3230
3232
  declare const CodeContainer: FC$1<ILibCodeContainer>;
3231
3233
 
package/dist/index.js CHANGED
@@ -11494,11 +11494,13 @@ var CodeContainer = (_a) => {
11494
11494
  var _b = _a, {
11495
11495
  children,
11496
11496
  code,
11497
- showNumbers
11497
+ showNumbers,
11498
+ language = "tsx"
11498
11499
  } = _b, rest = __objRest(_b, [
11499
11500
  "children",
11500
11501
  "code",
11501
- "showNumbers"
11502
+ "showNumbers",
11503
+ "language"
11502
11504
  ]);
11503
11505
  const [hasCopied, setHasCopied] = useState29(false);
11504
11506
  const copyToClipboard = () => {
@@ -11513,21 +11515,30 @@ var CodeContainer = (_a) => {
11513
11515
  setTimeout(() => setHasCopied(false), 1e3);
11514
11516
  };
11515
11517
  return /* @__PURE__ */ jsxs55("div", { className: "relative bg-[#282c34] p-6", children: [
11516
- /* @__PURE__ */ jsx129(Highlight2, __spreadProps(__spreadValues({ theme: themes.oneDark, code: children }, rest), { children: ({ style, tokens, getLineProps, getTokenProps }) => /* @__PURE__ */ jsx129(
11517
- "pre",
11518
- {
11519
- style,
11520
- className: "relative max-w-full overflow-x-scroll",
11521
- children: tokens.map((line, i) => /* @__PURE__ */ jsxs55("div", __spreadProps(__spreadValues({}, getLineProps({ line })), { children: [
11522
- showNumbers && /* @__PURE__ */ jsx129("span", { className: "mr-6", children: i + 1 }),
11523
- line.map((token, key) => /* @__PURE__ */ jsx129(
11524
- "span",
11525
- __spreadValues({}, getTokenProps({ token })),
11526
- key
11527
- ))
11528
- ] }), i))
11529
- }
11530
- ) })),
11518
+ /* @__PURE__ */ jsx129(
11519
+ Highlight2,
11520
+ __spreadProps(__spreadValues({
11521
+ theme: themes.oneDark,
11522
+ language,
11523
+ code: children
11524
+ }, rest), {
11525
+ children: ({ style, tokens, getLineProps, getTokenProps }) => /* @__PURE__ */ jsx129(
11526
+ "pre",
11527
+ {
11528
+ style,
11529
+ className: "relative max-w-full overflow-x-scroll",
11530
+ children: tokens.map((line, i) => /* @__PURE__ */ jsxs55("div", __spreadProps(__spreadValues({}, getLineProps({ line })), { children: [
11531
+ showNumbers && /* @__PURE__ */ jsx129("span", { className: "mr-6", children: i + 1 }),
11532
+ line.map((token, key) => /* @__PURE__ */ jsx129(
11533
+ "span",
11534
+ __spreadValues({}, getTokenProps({ token })),
11535
+ key
11536
+ ))
11537
+ ] }), i))
11538
+ }
11539
+ )
11540
+ })
11541
+ ),
11531
11542
  /* @__PURE__ */ jsx129(
11532
11543
  ButtonIcon,
11533
11544
  {