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