@npm_leadtech/legal-contracts-ui 0.52.8 → 0.52.10

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.
@@ -52,26 +52,32 @@ export interface MobileMenuSection {
52
52
  title?: string;
53
53
  icon: ReactNode | null;
54
54
  items?: {
55
- label: string;
56
- href?: string;
55
+ id: string;
56
+ link: ReactNode;
57
57
  }[];
58
58
  seeAll?: ReactNode | null;
59
59
  content?: ReactNode | null;
60
60
  }
61
61
 
62
- export interface NavMenuItemProps {
62
+ export type NavMenuItemProps = {
63
+ id: string;
63
64
  label: string;
64
- href?: string;
65
- hasDropdown?: boolean;
66
- dropdownItems?: NavMenuItemProps[];
67
- dropdownContent?: ReactNode;
65
+ dropdownItems: (NavMenuItemProps | NavMenuLink)[];
66
+ hasDropdown: true;
67
+ isNested?: boolean;
68
+ };
69
+
70
+ export type NavMenuLink = {
71
+ id: string;
72
+ link: ReactNode;
68
73
  tag?: string;
74
+ hasDropdown: false;
69
75
  isNested?: boolean;
70
76
  bold?: boolean;
71
- }
77
+ };
72
78
 
73
79
  export interface NavMenuProps {
74
- navItems: NavMenuItemProps[];
80
+ navItems: (NavMenuItemProps | NavMenuLink)[];
75
81
  className?: string;
76
82
  }
77
83
 
@@ -26,8 +26,8 @@ export declare interface MobileMenuSection {
26
26
  title?: string;
27
27
  icon: ReactNode | null;
28
28
  items?: {
29
- label: string;
30
- href?: string;
29
+ id: string;
30
+ link: ReactNode;
31
31
  }[];
32
32
  seeAll?: ReactNode | null;
33
33
  content?: ReactNode | null;
@@ -1,68 +1,68 @@
1
- import { jsxs as r, jsx as l } from "react/jsx-runtime";
1
+ import { jsxs as l, jsx as r } from "react/jsx-runtime";
2
2
  import "react";
3
- import { SearchBar as f } from "./SearchBar.js";
4
- import { PhoneTalkIcon as o } from "./PhoneTalkIcon.js";
5
- import { CloseIcon as x } from "./CloseIcon.js";
3
+ import { SearchBar as u } from "./SearchBar.js";
4
+ import { PhoneTalkIcon as x } from "./PhoneTalkIcon.js";
5
+ import { CloseIcon as f } from "./CloseIcon.js";
6
6
  const y = ({
7
- isOpen: m,
8
- onClose: s,
7
+ isOpen: n,
8
+ onClose: m,
9
9
  logo: c,
10
10
  userActions: d,
11
- searchBarProps: p,
12
- sections: u = [],
11
+ searchBarProps: o,
12
+ sections: p = [],
13
13
  contactInfo: t
14
- }) => m ? /* @__PURE__ */ r("div", { className: "fixed inset-0 z-50 flex flex-col overflow-y-auto bg-white text-neutral-800 lg:hidden", children: [
15
- /* @__PURE__ */ r("div", { className: "flex items-center justify-between px-6 py-4", children: [
14
+ }) => n ? /* @__PURE__ */ l("div", { className: "fixed inset-0 z-50 flex flex-col overflow-y-auto bg-white text-neutral-800 lg:hidden", children: [
15
+ /* @__PURE__ */ l("div", { className: "flex items-center justify-between px-6 py-4", children: [
16
16
  c,
17
- /* @__PURE__ */ l(
17
+ /* @__PURE__ */ r(
18
18
  "button",
19
19
  {
20
20
  className: "flex cursor-pointer items-center justify-center p-2",
21
- onClick: s,
21
+ onClick: m,
22
22
  "aria-label": "Close menu",
23
- children: /* @__PURE__ */ l(x, {})
23
+ children: /* @__PURE__ */ r(f, {})
24
24
  }
25
25
  )
26
26
  ] }),
27
- /* @__PURE__ */ r("div", { className: "flex flex-1 flex-col pb-6", children: [
28
- /* @__PURE__ */ r("div", { className: "flex flex-col gap-6 px-6", children: [
29
- /* @__PURE__ */ l("div", { className: "flex items-center gap-4", children: d }),
30
- /* @__PURE__ */ l(f, { ...p })
27
+ /* @__PURE__ */ l("div", { className: "flex flex-1 flex-col pb-6", children: [
28
+ /* @__PURE__ */ l("div", { className: "flex flex-col gap-6 px-6", children: [
29
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-4", children: d }),
30
+ /* @__PURE__ */ r(u, { ...o })
31
31
  ] }),
32
- /* @__PURE__ */ l("nav", { className: "flex flex-col gap-0", children: u.map((e, n) => {
32
+ /* @__PURE__ */ r("nav", { className: "flex flex-col gap-0", children: p.map((e, i) => {
33
33
  const a = e.icon != null;
34
- return e.content != null ? /* @__PURE__ */ l("div", { className: "flex items-center px-6 pb-8", children: e.content }, e.id ?? `custom-${n.toString()}`) : /* @__PURE__ */ r(
34
+ return e.content != null ? /* @__PURE__ */ r("div", { className: "flex items-center px-6 pb-8", children: e.content }, e.id ?? `custom-${i.toString()}`) : /* @__PURE__ */ l(
35
35
  "div",
36
36
  {
37
37
  className: e.title !== "" && !a ? "border-t border-b border-neutral-200 pt-4" : "",
38
38
  children: [
39
- e.title && /* @__PURE__ */ r("div", { className: `flex items-center gap-2 px-6 ${a ? "bg-neutral-50 py-4" : ""}`, children: [
40
- e.icon != null && /* @__PURE__ */ l("span", { className: "text-primary-700", children: e.icon }),
41
- /* @__PURE__ */ l("h4", { className: "text-medium font-semibold", children: e.title })
39
+ e.title && /* @__PURE__ */ l("div", { className: `flex items-center gap-2 px-6 ${a ? "bg-neutral-50 py-4" : ""}`, children: [
40
+ e.icon != null && /* @__PURE__ */ r("span", { className: "text-primary-700", children: e.icon }),
41
+ /* @__PURE__ */ r("h4", { className: "text-medium font-semibold", children: e.title })
42
42
  ] }),
43
- e.items != null && /* @__PURE__ */ r("ul", { className: `flex flex-col gap-4 ${a ? "p-6" : "px-6 py-4"}`, children: [
44
- e.items.map((i) => /* @__PURE__ */ l("li", { children: /* @__PURE__ */ l("a", { href: i.href ?? "#", className: "text-medium", onClick: s, children: i.label }) }, i.label)),
45
- e.seeAll != null && /* @__PURE__ */ l("li", { className: "font-semibold", children: e.seeAll })
43
+ e.items != null && /* @__PURE__ */ l("ul", { className: `flex flex-col gap-4 ${a ? "p-6" : "px-6 py-4"}`, children: [
44
+ e.items.map((s) => /* @__PURE__ */ r("li", { className: "text-medium", children: s.link }, s.id)),
45
+ e.seeAll != null && /* @__PURE__ */ r("li", { className: "font-semibold", children: e.seeAll })
46
46
  ] })
47
47
  ]
48
48
  },
49
- e.id ?? e.title ?? n.toString()
49
+ e.id ?? e.title ?? i.toString()
50
50
  );
51
51
  }) }),
52
- t && /* @__PURE__ */ r("div", { className: "mt-auto flex flex-col items-center justify-center border-t border-neutral-100 p-6", children: [
53
- /* @__PURE__ */ r(
52
+ t && /* @__PURE__ */ l("div", { className: "mt-auto flex flex-col items-center justify-center border-t border-neutral-100 p-6", children: [
53
+ /* @__PURE__ */ l(
54
54
  "a",
55
55
  {
56
56
  href: `tel:${t.phoneNumber.replaceAll(" ", "")}`,
57
57
  className: "bg-primary-700 flex w-full items-center justify-center gap-2 rounded-md p-3 text-base font-semibold text-white",
58
58
  children: [
59
- /* @__PURE__ */ l(o, { fill: "#ffff" }),
59
+ /* @__PURE__ */ r(x, { fill: "#ffff" }),
60
60
  t.phoneNumber
61
61
  ]
62
62
  }
63
63
  ),
64
- t.contactHours && /* @__PURE__ */ r("p", { className: "text-small mt-4 text-base text-neutral-500", children: [
65
- t.contactHoursLabel != null && /* @__PURE__ */ r("span", { children: [
64
+ t.contactHours && /* @__PURE__ */ l("p", { className: "text-small mt-4 text-base text-neutral-500", children: [
65
+ t.contactHoursLabel != null && /* @__PURE__ */ l("span", { children: [
66
66
  t.contactHoursLabel,
67
67
  " "
68
68
  ] }),
@@ -3,19 +3,25 @@ import { ReactNode } from 'react';
3
3
 
4
4
  export declare const NavMenu: FC<NavMenuProps>;
5
5
 
6
- export interface NavMenuItemProps {
6
+ export type NavMenuItemProps = {
7
+ id: string;
7
8
  label: string;
8
- href?: string;
9
- hasDropdown?: boolean;
10
- dropdownItems?: NavMenuItemProps[];
11
- dropdownContent?: ReactNode;
9
+ dropdownItems: (NavMenuItemProps | NavMenuLink)[];
10
+ hasDropdown: true;
11
+ isNested?: boolean;
12
+ };
13
+
14
+ export type NavMenuLink = {
15
+ id: string;
16
+ link: ReactNode;
12
17
  tag?: string;
18
+ hasDropdown: false;
13
19
  isNested?: boolean;
14
20
  bold?: boolean;
15
- }
21
+ };
16
22
 
17
23
  export declare interface NavMenuProps {
18
- navItems: NavMenuItemProps[];
24
+ navItems: (NavMenuItemProps | NavMenuLink)[];
19
25
  className?: string;
20
26
  }
21
27
 
@@ -1,7 +1,7 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { NavMenuItem as a } from "./NavMenuItem.js";
4
- const o = ({ navItems: m, className: t = "" }) => /* @__PURE__ */ e("nav", { className: t, children: /* @__PURE__ */ e("ul", { className: "text-medium flex flex-wrap items-center gap-4 xl:gap-8", children: m.map((r) => /* @__PURE__ */ e(a, { ...r }, r.label)) }) });
4
+ const o = ({ navItems: m, className: t = "" }) => /* @__PURE__ */ e("nav", { className: t, children: /* @__PURE__ */ e("ul", { className: "text-medium flex flex-wrap items-center gap-4 xl:gap-8", children: m.map((r) => /* @__PURE__ */ e(a, { ...r }, r.id)) }) });
5
5
  export {
6
6
  o as NavMenu
7
7
  };
@@ -1,16 +1,22 @@
1
1
  import { FC } from 'react';
2
2
  import { ReactNode } from 'react';
3
3
 
4
- export declare const NavMenuItem: FC<NavMenuItemProps>;
4
+ export declare const NavMenuItem: FC<NavMenuItemProps | NavMenuLink>;
5
5
 
6
- export declare interface NavMenuItemProps {
6
+ export declare type NavMenuItemProps = {
7
+ id: string;
7
8
  label: string;
8
- href?: string;
9
- hasDropdown?: boolean;
10
- dropdownItems?: NavMenuItemProps[];
11
- dropdownContent?: ReactNode;
9
+ dropdownItems: (NavMenuItemProps | NavMenuLink)[];
10
+ hasDropdown: true;
11
+ isNested?: boolean;
12
+ };
13
+
14
+ export declare type NavMenuLink = {
15
+ id: string;
16
+ link: ReactNode;
12
17
  tag?: string;
18
+ hasDropdown: false;
13
19
  isNested?: boolean;
14
20
  bold?: boolean;
15
- }
21
+ };
16
22
 
@@ -1,23 +1,15 @@
1
- import { jsxs as n, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
2
  import "react";
3
- import { ChevronDownIcon as f } from "./ChevronDownIcon.js";
4
- import { ChevronRightIcon as v } from "./ChevronRightIcon.js";
5
- const h = ({
6
- label: l,
7
- href: c,
8
- dropdownItems: r,
9
- tag: i,
10
- hasDropdown: e = !1,
11
- isNested: d = !1,
12
- bold: p = !1
13
- }) => {
14
- const u = e && r != null && r.length > 0, g = e ? "span" : "a", s = {
3
+ import { ChevronDownIcon as g } from "./ChevronDownIcon.js";
4
+ import { ChevronRightIcon as f } from "./ChevronRightIcon.js";
5
+ const h = (o) => {
6
+ const { hasDropdown: a, isNested: i } = o, n = {
15
7
  topLevel: {
16
8
  liClass: "group relative py-2",
17
9
  triggerClass: "hover:text-neutral-600",
18
10
  dropdownPosition: "top-full left-0",
19
11
  dropdownTrigger: "group-hover:pointer-events-auto group-hover:opacity-100",
20
- Icon: f,
12
+ Icon: g,
21
13
  iconClass: "transition-transform duration-200 group-hover:rotate-180"
22
14
  },
23
15
  nested: {
@@ -25,37 +17,44 @@ const h = ({
25
17
  triggerClass: "p-1 hover:bg-primary-100 w-full rounded",
26
18
  dropdownPosition: "top-0 left-full -mt-4 pl-6",
27
19
  dropdownTrigger: "group-hover/nested:pointer-events-auto group-hover/nested:opacity-100",
28
- Icon: v,
20
+ Icon: f,
29
21
  iconClass: ""
30
22
  }
31
- }, o = d ? s.nested : s.topLevel, m = o.Icon;
32
- return /* @__PURE__ */ n("li", { className: `${o.liClass} `, children: [
33
- /* @__PURE__ */ n(
34
- g,
35
- {
36
- href: e ? void 0 : c ?? "#",
37
- role: e ? "button" : void 0,
38
- className: `text-small flex w-full items-center justify-between gap-1 font-medium text-nowrap text-neutral-800 transition-colors ${e ? "cursor-pointer" : ""} ${o.triggerClass} `,
39
- "aria-haspopup": e ? "menu" : void 0,
40
- "aria-expanded": e ? "false" : void 0,
41
- title: e ? void 0 : l,
42
- children: [
43
- /* @__PURE__ */ n("span", { className: "flex items-center gap-1", children: [
44
- /* @__PURE__ */ t("span", { className: `text-medium ${p ? "font-bold" : ""}`, children: l }),
45
- i && /* @__PURE__ */ t("span", { className: "bg-secondary-200 text-extra-small rounded px-1 font-bold", children: i })
46
- ] }),
47
- e && /* @__PURE__ */ t(m, { className: o.iconClass, fill: "#000", width: 20, height: 20 })
48
- ]
49
- }
50
- ),
51
- u && /* @__PURE__ */ t(
52
- "div",
53
- {
54
- className: `pointer-events-none absolute z-50 min-w-48 opacity-0 transition-opacity duration-200 ${o.dropdownPosition} ${o.dropdownTrigger} `,
55
- children: /* @__PURE__ */ t("div", { className: "rounded-md border border-neutral-200 bg-white p-4 shadow-lg", children: /* @__PURE__ */ t("ul", { className: "flex flex-col gap-2", children: r.map((a) => /* @__PURE__ */ t(h, { ...a, isNested: !0 }, a.label)) }) })
56
- }
57
- )
58
- ] });
23
+ }, t = i ? n.nested : n.topLevel, d = t.Icon;
24
+ if (a) {
25
+ const { dropdownItems: u, label: m } = o;
26
+ return /* @__PURE__ */ r("li", { className: `${t.liClass} `, children: [
27
+ /* @__PURE__ */ r(
28
+ "button",
29
+ {
30
+ className: `text-small flex w-full cursor-pointer items-center justify-between gap-1 font-medium text-nowrap text-neutral-800 transition-colors ${t.triggerClass} `,
31
+ "aria-haspopup": "menu",
32
+ children: [
33
+ /* @__PURE__ */ e("span", { className: "text-medium", children: m }),
34
+ /* @__PURE__ */ e(d, { className: t.iconClass, fill: "#000", width: 20, height: 20 })
35
+ ]
36
+ }
37
+ ),
38
+ /* @__PURE__ */ e(
39
+ "div",
40
+ {
41
+ className: `pointer-events-none absolute z-50 min-w-48 opacity-0 transition-opacity duration-200 ${t.dropdownPosition} ${t.dropdownTrigger} `,
42
+ children: /* @__PURE__ */ e("div", { className: "rounded-md border border-neutral-200 bg-white p-4 shadow-lg", children: /* @__PURE__ */ e("ul", { className: "flex flex-col gap-2", children: u.map((l) => /* @__PURE__ */ e(h, { ...l, isNested: !0 }, l.id)) }) })
43
+ }
44
+ )
45
+ ] });
46
+ }
47
+ const { link: c, tag: s, bold: p } = o;
48
+ return /* @__PURE__ */ e("li", { className: `${t.liClass} `, children: /* @__PURE__ */ r(
49
+ "span",
50
+ {
51
+ className: `text-small relative flex w-full items-center justify-between gap-1 font-medium text-nowrap text-neutral-800 transition-colors ${t.triggerClass} `,
52
+ children: [
53
+ /* @__PURE__ */ e("span", { className: `text-medium flex-1 ${p ? "font-bold" : ""} [&_a]:after:absolute [&_a]:after:inset-0`, children: c }),
54
+ s && /* @__PURE__ */ e("span", { className: "bg-secondary-200 text-extra-small rounded px-1 font-bold", children: s })
55
+ ]
56
+ }
57
+ ) });
59
58
  };
60
59
  export {
61
60
  h as NavMenuItem