@npm_leadtech/legal-contracts-ui 0.68.0 → 0.68.2

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.
@@ -54,11 +54,11 @@ export interface DefaultSubtypeDocumentProps extends BaseSubtypeDocumentProps {
54
54
 
55
55
  export interface DocumentCategoriesProps {
56
56
  title: string;
57
- categories: Array<{
57
+ categories: {
58
58
  id: string;
59
59
  title: string;
60
60
  icon: ReactNode;
61
- }>;
61
+ }[];
62
62
  }
63
63
 
64
64
  export interface DocumentItemProps {
@@ -1,30 +1,30 @@
1
- import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
- import { JumboCard as i } from "./JumboCard.js";
3
- import { Breadcrumb as s } from "./Breadcrumb.js";
4
- import { DocumentCategories as x } from "./DocumentCategories.js";
5
- import { DocumentSection as n } from "./DocumentSection.js";
6
- import { ContentItem as f } from "./ContentItem.js";
7
- import { FaqSection as u } from "./FaqSection.js";
8
- const v = ({
9
- jumbo: r,
10
- breadcrumb: a,
11
- categories: o,
12
- documentSections: t,
13
- contentItems: p,
14
- faqSection: c
15
- }) => /* @__PURE__ */ l("main", { className: "mx-auto flex-1 px-6 py-8 lg:px-8 xl:max-w-300 xl:px-0", children: [
16
- /* @__PURE__ */ e(i, { ...r }),
17
- /* @__PURE__ */ e(s, { ...a, className: "pb-4" }),
18
- /* @__PURE__ */ l("div", { className: "mx-auto flex flex-col justify-center gap-30 text-neutral-800 lg:flex-row", children: [
19
- /* @__PURE__ */ e(x, { ...o }),
20
- /* @__PURE__ */ l("div", { className: "flex flex-col gap-10 pb-15.5", children: [
21
- t.map((m) => /* @__PURE__ */ e(n, { ...m }, m.id)),
1
+ import { jsxs as m, jsx as e } from "react/jsx-runtime";
2
+ import { JumboCard as p } from "./JumboCard.js";
3
+ import { Breadcrumb as c } from "./Breadcrumb.js";
4
+ import { DocumentCategories as n } from "./DocumentCategories.js";
5
+ import { DocumentSection as x } from "./DocumentSection.js";
6
+ import { ContentItem as d } from "./ContentItem.js";
7
+ import { FaqSection as f } from "./FaqSection.js";
8
+ const w = ({
9
+ jumbo: l,
10
+ breadcrumb: r,
11
+ categories: t,
12
+ documentSections: o,
13
+ contentItems: s,
14
+ faqSection: i
15
+ }) => /* @__PURE__ */ m("main", { className: "mx-auto flex-1 px-6 py-8 lg:px-8 xl:max-w-300 xl:px-0", children: [
16
+ /* @__PURE__ */ e(p, { ...l }),
17
+ /* @__PURE__ */ e(c, { ...r, className: "pb-4" }),
18
+ /* @__PURE__ */ m("div", { className: "mx-auto flex justify-center gap-4 text-neutral-800 lg:gap-26.5 xl:gap-31.5", children: [
19
+ /* @__PURE__ */ e("aside", { className: "sticky top-14 hidden self-start md:block", children: /* @__PURE__ */ e(n, { ...t }) }),
20
+ /* @__PURE__ */ m("div", { className: "flex flex-col gap-10", children: [
21
+ o.map((a) => /* @__PURE__ */ e(x, { ...a }, a.id)),
22
22
  /* @__PURE__ */ e("span", { className: "h-px w-full bg-neutral-200" }),
23
- /* @__PURE__ */ e("div", { className: "w-full", children: p.map((m) => /* @__PURE__ */ e(f, { ...m }, m.id)) }),
24
- /* @__PURE__ */ e(u, { ...c })
23
+ /* @__PURE__ */ e("div", { className: "w-full", children: s.map((a) => /* @__PURE__ */ e(d, { ...a }, a.id)) }),
24
+ /* @__PURE__ */ e(f, { ...i })
25
25
  ] })
26
26
  ] })
27
27
  ] });
28
28
  export {
29
- v as AllDocumentsTemplate
29
+ w as AllDocumentsTemplate
30
30
  };
@@ -66,11 +66,11 @@ export interface DefaultSubtypeDocumentProps extends BaseSubtypeDocumentProps {
66
66
 
67
67
  export interface DocumentCategoriesProps {
68
68
  title: string;
69
- categories: Array<{
69
+ categories: {
70
70
  id: string;
71
71
  title: string;
72
72
  icon: ReactNode;
73
- }>;
73
+ }[];
74
74
  }
75
75
 
76
76
  export interface DocumentItemProps {
@@ -5,10 +5,10 @@ export declare const DocumentCategories: FC<DocumentCategoriesProps>;
5
5
 
6
6
  export declare interface DocumentCategoriesProps {
7
7
  title: string;
8
- categories: Array<{
8
+ categories: {
9
9
  id: string;
10
10
  title: string;
11
11
  icon: ReactNode;
12
- }>;
12
+ }[];
13
13
  }
14
14
 
@@ -1,28 +1,48 @@
1
- import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
- const d = ({ categories: t, title: n }) => t.length === 0 ? null : /* @__PURE__ */ l("div", { className: "top-28 flex min-w-72 flex-col gap-6 rounded bg-white py-6 md:sticky", children: [
3
- /* @__PURE__ */ l("div", { children: [
4
- /* @__PURE__ */ e("p", { className: "text-big font-bold text-neutral-800", children: n }),
5
- /* @__PURE__ */ e("div", { className: "mt-4 h-px w-full bg-neutral-200", "aria-hidden": !0 })
6
- ] }),
7
- /* @__PURE__ */ e("ul", { className: "flex flex-col gap-3", children: t.map((r, i) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ l(
8
- "a",
9
- {
10
- href: `#${r.id}`,
11
- className: `text-small flex items-center gap-4 rounded px-2 py-2 transition-colors ${i === 0 ? "bg-primary-50 text-primary-700 font-bold" : "hover:text-primary-700 text-neutral-800"}`,
12
- children: [
13
- /* @__PURE__ */ e(
14
- "span",
15
- {
16
- className: `flex h-10 w-10 items-center justify-center rounded border ${i === 0 ? "border-primary-500 bg-white" : "border-neutral-200"}`,
17
- "aria-hidden": !0,
18
- children: r.icon
19
- }
20
- ),
21
- /* @__PURE__ */ e("span", { className: "flex-1", children: r.title })
22
- ]
23
- }
24
- ) }, r.id)) })
25
- ] });
1
+ "use client";
2
+ import { jsxs as s, jsx as n } from "react/jsx-runtime";
3
+ import { useState as d, useEffect as f } from "react";
4
+ import m from "clsx";
5
+ const p = ({ categories: t, title: a }) => {
6
+ const [c, o] = d(t[0]?.id || "");
7
+ return f(() => {
8
+ if (t.length === 0) return;
9
+ const e = new IntersectionObserver(
10
+ (l) => {
11
+ l.forEach((i) => {
12
+ i.isIntersecting && o(i.target.id);
13
+ });
14
+ },
15
+ { rootMargin: "-10% 0px -80% 0px", threshold: 0.1 }
16
+ );
17
+ return t.forEach((l) => {
18
+ const i = l.id, r = document.getElementById(i);
19
+ r && e.observe(r);
20
+ }), () => {
21
+ e.disconnect();
22
+ };
23
+ }, [t]), t.length === 0 ? null : /* @__PURE__ */ s("div", { className: "flex w-full max-w-71 min-w-65 flex-col gap-4 rounded bg-white", children: [
24
+ /* @__PURE__ */ n("p", { className: "text-big font-bold text-neutral-800", children: a }),
25
+ /* @__PURE__ */ n("span", { className: "h-px w-full bg-neutral-200", "aria-hidden": !0 }),
26
+ /* @__PURE__ */ n("ul", { className: "flex flex-col gap-4", children: t.map((e) => {
27
+ const l = c === e.id;
28
+ return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ s(
29
+ "a",
30
+ {
31
+ href: `#${e.id}`,
32
+ className: m(
33
+ "text-small flex items-center gap-4 text-neutral-800 transition-all",
34
+ l && "font-bold"
35
+ ),
36
+ children: [
37
+ e.icon,
38
+ /* @__PURE__ */ n("span", { className: "flex-1", children: e.title })
39
+ ]
40
+ }
41
+ ) }, e.id);
42
+ }) }),
43
+ /* @__PURE__ */ n("span", { className: "h-px w-full bg-neutral-200", "aria-hidden": !0 })
44
+ ] });
45
+ };
26
46
  export {
27
- d as DocumentCategories
47
+ p as DocumentCategories
28
48
  };
@@ -1,6 +1,6 @@
1
1
  import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
2
  import { DocumentItem as i } from "./DocumentItem.js";
3
- const o = ({ id: r, title: s, description: t, icon: c, documents: m }) => /* @__PURE__ */ l("article", { id: r, className: "flex max-w-198 scroll-mt-25 flex-col gap-6", children: [
3
+ const o = ({ id: r, title: s, description: t, icon: c, documents: m }) => /* @__PURE__ */ l("article", { id: r, className: "flex max-w-198 scroll-mt-14 flex-col gap-6", children: [
4
4
  /* @__PURE__ */ l("div", { className: "flex gap-4 rounded bg-neutral-50 p-6", children: [
5
5
  c,
6
6
  /* @__PURE__ */ l("div", { className: "flex flex-1 flex-col gap-2 text-neutral-800", children: [
@@ -8,7 +8,7 @@ const o = ({ id: r, title: s, description: t, icon: c, documents: m }) => /* @__
8
8
  /* @__PURE__ */ e("p", { className: "text-medium", children: t })
9
9
  ] })
10
10
  ] }),
11
- /* @__PURE__ */ e("div", { className: "flex flex-wrap justify-between gap-6", children: m.map((a) => /* @__PURE__ */ e(i, { ...a, className: "w-full md:w-48/100" }, a.id)) })
11
+ /* @__PURE__ */ e("div", { className: "flex flex-wrap justify-between gap-6", children: m.map((a) => /* @__PURE__ */ e(i, { ...a, className: "w-full lg:w-47/100" }, a.id)) })
12
12
  ] });
13
13
  export {
14
14
  o as DocumentSection