@npm_leadtech/legal-contracts-ui 0.72.3 → 0.73.1

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.
@@ -1,12 +1,29 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import l from "clsx";
3
- const m = ({ children: t, variant: r = "default", className: e = "", ...a }) => {
4
- const i = a.href?.toLowerCase().startsWith("mailto:"), c = r === "legal", o = {
1
+ import { jsx as u } from "react/jsx-runtime";
2
+ import h from "clsx";
3
+ const v = ({ children: o, variant: i = "default", className: l = "", ...e }) => {
4
+ const t = e.href || "", r = t.toLowerCase(), c = r.startsWith("mailto:"), n = r.startsWith("tel:"), a = {
5
5
  default: "text-neutral-900 underline ",
6
6
  legal: "text-primary-700 cursor-pointer"
7
- }, s = o[r] ?? o.default;
8
- return c && i ? /* @__PURE__ */ n("span", { className: l(e, s), children: t }) : /* @__PURE__ */ n("a", { className: l(e, s), target: "_blank", rel: "noopener noreferrer", ...a, children: t });
7
+ }, f = a[i] ?? a.default, s = t.startsWith("http") && !n && !c, d = (() => {
8
+ if (!n) return t;
9
+ try {
10
+ return decodeURIComponent(t).replace(/\s/g, "");
11
+ } catch {
12
+ return t.replace(/%20/g, "").replace(/\s/g, "");
13
+ }
14
+ })();
15
+ return /* @__PURE__ */ u(
16
+ "a",
17
+ {
18
+ ...e,
19
+ href: d,
20
+ className: h(l, f),
21
+ target: s ? "_blank" : void 0,
22
+ rel: s ? "noopener noreferrer" : void 0,
23
+ children: o
24
+ }
25
+ );
9
26
  };
10
27
  export {
11
- m as Anchor
28
+ v as Anchor
12
29
  };
@@ -1,50 +1,51 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import a from "react-markdown";
3
- import i from "rehype-raw";
4
- import d from "remark-gfm";
2
+ import a, { defaultUrlTransform as i } from "react-markdown";
3
+ import s from "rehype-raw";
4
+ import f from "remark-gfm";
5
5
  import { Anchor as l } from "./Anchor.js";
6
- import { Blockquote as f } from "./Blockquote.js";
6
+ import { Blockquote as d } from "./Blockquote.js";
7
7
  import { Code as c } from "./Code.js";
8
- import { Header1 as s } from "./Header1.js";
9
- import { Header2 as h } from "./Header2.js";
10
- import { Header3 as u } from "./Header3.js";
11
- import { Header4 as C } from "./Header4.js";
8
+ import { Header1 as h } from "./Header1.js";
9
+ import { Header2 as u } from "./Header2.js";
10
+ import { Header3 as C } from "./Header3.js";
11
+ import { Header4 as T } from "./Header4.js";
12
12
  import { OrderedList as b } from "./OrderedList.js";
13
13
  import { Paragraph as k } from "./Paragraph.js";
14
- import { TableRow as w, TableHeader as g, TableData as H, Table as T } from "./Table.js";
15
- import { UnorderedList as x } from "./UnorderedList.js";
16
- import { Video as P } from "./Video.js";
17
- import { Emphasis as R } from "./Emphasis.js";
14
+ import { TableRow as w, TableHeader as g, TableData as H, Table as x } from "./Table.js";
15
+ import { UnorderedList as P } from "./UnorderedList.js";
16
+ import { Video as R } from "./Video.js";
17
+ import { Emphasis as U } from "./Emphasis.js";
18
18
  import q from "clsx";
19
- const Z = ({ content: m, className: t = "", useCustom: p = !0, variant: e = "default" }) => {
20
- const n = {
21
- h1: s,
22
- h2: (o) => /* @__PURE__ */ r(h, { variant: e, ...o }),
23
- h3: u,
24
- h4: C,
25
- p: (o) => /* @__PURE__ */ r(k, { variant: e, ...o }),
26
- a: (o) => /* @__PURE__ */ r(l, { variant: e, ...o }),
27
- ul: (o) => /* @__PURE__ */ r(x, { variant: e, ...o }),
28
- ol: (o) => /* @__PURE__ */ r(b, { variant: e, ...o }),
19
+ const y = (e) => e.startsWith("tel:") ? e : i(e), $ = ({ content: e, className: t = "", useCustom: n = !0, variant: m = "default" }) => {
20
+ const p = {
21
+ h1: h,
22
+ h2: (o) => /* @__PURE__ */ r(u, { variant: m, ...o }),
23
+ h3: C,
24
+ h4: T,
25
+ p: (o) => /* @__PURE__ */ r(k, { variant: m, ...o }),
26
+ a: (o) => /* @__PURE__ */ r(l, { variant: m, ...o }),
27
+ ul: (o) => /* @__PURE__ */ r(P, { variant: m, ...o }),
28
+ ol: (o) => /* @__PURE__ */ r(b, { variant: m, ...o }),
29
29
  code: c,
30
- blockquote: f,
31
- video: P,
32
- table: T,
30
+ blockquote: d,
31
+ video: R,
32
+ table: x,
33
33
  td: H,
34
34
  th: g,
35
35
  tr: w,
36
- em: R
36
+ em: U
37
37
  };
38
38
  return /* @__PURE__ */ r("div", { className: q("w-full min-w-0", t), children: /* @__PURE__ */ r(
39
39
  a,
40
40
  {
41
- rehypePlugins: [i],
42
- remarkPlugins: [d],
43
- components: p ? n : void 0,
44
- children: m
41
+ rehypePlugins: [s],
42
+ remarkPlugins: [f],
43
+ urlTransform: y,
44
+ components: n ? p : void 0,
45
+ children: e
45
46
  }
46
47
  ) });
47
48
  };
48
49
  export {
49
- Z as Markdown
50
+ $ as Markdown
50
51
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npm_leadtech/legal-contracts-ui",
3
- "version": "0.72.3",
3
+ "version": "0.73.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",