@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.
- package/dist/components/Anchor.js +24 -7
- package/dist/components/Markdown.js +32 -31
- package/package.json +1 -1
|
@@ -1,12 +1,29 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
const
|
|
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
|
-
},
|
|
8
|
-
|
|
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
|
-
|
|
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
|
|
4
|
-
import
|
|
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
|
|
6
|
+
import { Blockquote as d } from "./Blockquote.js";
|
|
7
7
|
import { Code as c } from "./Code.js";
|
|
8
|
-
import { Header1 as
|
|
9
|
-
import { Header2 as
|
|
10
|
-
import { Header3 as
|
|
11
|
-
import { Header4 as
|
|
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
|
|
15
|
-
import { UnorderedList as
|
|
16
|
-
import { Video as
|
|
17
|
-
import { Emphasis as
|
|
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
|
|
20
|
-
const
|
|
21
|
-
h1:
|
|
22
|
-
h2: (o) => /* @__PURE__ */ r(
|
|
23
|
-
h3:
|
|
24
|
-
h4:
|
|
25
|
-
p: (o) => /* @__PURE__ */ r(k, { variant:
|
|
26
|
-
a: (o) => /* @__PURE__ */ r(l, { variant:
|
|
27
|
-
ul: (o) => /* @__PURE__ */ r(
|
|
28
|
-
ol: (o) => /* @__PURE__ */ r(b, { variant:
|
|
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:
|
|
31
|
-
video:
|
|
32
|
-
table:
|
|
30
|
+
blockquote: d,
|
|
31
|
+
video: R,
|
|
32
|
+
table: x,
|
|
33
33
|
td: H,
|
|
34
34
|
th: g,
|
|
35
35
|
tr: w,
|
|
36
|
-
em:
|
|
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: [
|
|
42
|
-
remarkPlugins: [
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
50
|
+
$ as Markdown
|
|
50
51
|
};
|