@npm_leadtech/legal-contracts-ui 0.54.1 → 0.54.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.
|
@@ -1,34 +1,33 @@
|
|
|
1
|
-
import { jsxs as r, Fragment as
|
|
1
|
+
import { jsxs as r, Fragment as b, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { SearchIcon as
|
|
4
|
-
import { CloseIcon as
|
|
5
|
-
import { HighlightedText as
|
|
6
|
-
const
|
|
3
|
+
import { SearchIcon as p } from "./SearchIcon.js";
|
|
4
|
+
import { CloseIcon as u } from "./CloseIcon.js";
|
|
5
|
+
import { HighlightedText as x } from "./HighlightedText.js";
|
|
6
|
+
const y = ({
|
|
7
7
|
items: i,
|
|
8
|
-
placeholder:
|
|
9
|
-
isOpen:
|
|
10
|
-
onToggle:
|
|
8
|
+
placeholder: n,
|
|
9
|
+
isOpen: h = !1,
|
|
10
|
+
onToggle: s,
|
|
11
11
|
searchValue: t = "",
|
|
12
|
-
onInputChange:
|
|
12
|
+
onInputChange: d,
|
|
13
13
|
onClear: c,
|
|
14
|
-
noResultsText: b,
|
|
15
14
|
allDocumentsItem: l
|
|
16
15
|
}) => {
|
|
17
|
-
const
|
|
18
|
-
return /* @__PURE__ */ r(
|
|
16
|
+
const o = t.length > 0;
|
|
17
|
+
return /* @__PURE__ */ r(b, { children: [
|
|
19
18
|
/* @__PURE__ */ r("div", { className: "relative hidden lg:block", children: [
|
|
20
19
|
/* @__PURE__ */ e(
|
|
21
20
|
"button",
|
|
22
21
|
{
|
|
23
22
|
"aria-label": "Search",
|
|
24
23
|
className: "hover:bg-primary-100 cursor-pointer rounded-full p-2 transition-colors",
|
|
25
|
-
onClick:
|
|
26
|
-
"aria-expanded":
|
|
27
|
-
children: /* @__PURE__ */ e(
|
|
24
|
+
onClick: s,
|
|
25
|
+
"aria-expanded": h,
|
|
26
|
+
children: /* @__PURE__ */ e(p, {})
|
|
28
27
|
}
|
|
29
28
|
),
|
|
30
|
-
|
|
31
|
-
/* @__PURE__ */ e("div", { className: "fixed inset-0 z-40", onClick:
|
|
29
|
+
h && /* @__PURE__ */ r(b, { children: [
|
|
30
|
+
/* @__PURE__ */ e("div", { className: "fixed inset-0 z-40", onClick: s, "aria-hidden": "true" }),
|
|
32
31
|
/* @__PURE__ */ r("div", { className: "absolute top-full left-0 z-50 mt-2 max-h-[50dvh] w-80 animate-[slideDown_0.2s_ease-out] overflow-y-auto rounded-lg border border-neutral-200 bg-white shadow-lg", children: [
|
|
33
32
|
/* @__PURE__ */ e("div", { className: "border-b border-neutral-200 p-3", children: /* @__PURE__ */ r("div", { className: "flex items-center gap-2 rounded-md px-3 py-2", children: [
|
|
34
33
|
/* @__PURE__ */ e(
|
|
@@ -36,31 +35,31 @@ const w = ({
|
|
|
36
35
|
{
|
|
37
36
|
type: "text",
|
|
38
37
|
value: t,
|
|
39
|
-
onChange:
|
|
40
|
-
placeholder:
|
|
38
|
+
onChange: d,
|
|
39
|
+
placeholder: n,
|
|
41
40
|
className: "flex-1 text-base text-neutral-800 outline-none placeholder:text-neutral-400",
|
|
42
41
|
autoFocus: !0
|
|
43
42
|
}
|
|
44
43
|
),
|
|
45
|
-
|
|
44
|
+
o && /* @__PURE__ */ e(
|
|
46
45
|
"button",
|
|
47
46
|
{
|
|
48
47
|
onClick: c,
|
|
49
48
|
className: "cursor-pointer rounded-full p-0.5 transition-colors hover:bg-neutral-200",
|
|
50
49
|
"aria-label": "Clear search",
|
|
51
|
-
children: /* @__PURE__ */ e(
|
|
50
|
+
children: /* @__PURE__ */ e(u, { width: 14, height: 14 })
|
|
52
51
|
}
|
|
53
52
|
)
|
|
54
53
|
] }) }),
|
|
55
54
|
/* @__PURE__ */ r("div", { className: "overflow-y-auto", children: [
|
|
56
|
-
i.length > 0 &&
|
|
55
|
+
i.length > 0 && o && /* @__PURE__ */ e("ul", { className: "py-2", children: i.map((a) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
57
56
|
"a",
|
|
58
57
|
{
|
|
59
58
|
href: a.href,
|
|
60
59
|
className: "hover:bg-primary-50 block px-4 py-2.5 text-base text-neutral-800 transition-colors",
|
|
61
|
-
children: /* @__PURE__ */ e(
|
|
60
|
+
children: /* @__PURE__ */ e(x, { text: a.label, highlight: t })
|
|
62
61
|
}
|
|
63
|
-
) }, a.href)) })
|
|
62
|
+
) }, a.href)) }),
|
|
64
63
|
l && /* @__PURE__ */ e("ul", { className: "py-2", children: /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
65
64
|
"a",
|
|
66
65
|
{
|
|
@@ -80,30 +79,30 @@ const w = ({
|
|
|
80
79
|
{
|
|
81
80
|
type: "text",
|
|
82
81
|
value: t,
|
|
83
|
-
onChange:
|
|
84
|
-
placeholder:
|
|
82
|
+
onChange: d,
|
|
83
|
+
placeholder: n,
|
|
85
84
|
className: "flex-1 bg-transparent text-base text-neutral-800 outline-none placeholder:text-neutral-400"
|
|
86
85
|
}
|
|
87
86
|
),
|
|
88
|
-
|
|
87
|
+
o ? /* @__PURE__ */ e(
|
|
89
88
|
"button",
|
|
90
89
|
{
|
|
91
90
|
onClick: c,
|
|
92
91
|
className: "cursor-pointer rounded-full p-1 transition-colors hover:bg-neutral-200",
|
|
93
92
|
"aria-label": "Clear search",
|
|
94
|
-
children: /* @__PURE__ */ e(
|
|
93
|
+
children: /* @__PURE__ */ e(u, { width: 16, height: 16 })
|
|
95
94
|
}
|
|
96
|
-
) : /* @__PURE__ */ e(
|
|
95
|
+
) : /* @__PURE__ */ e(p, { fill: "var(--neutral-500)", width: 20, height: 20 })
|
|
97
96
|
] }),
|
|
98
|
-
|
|
99
|
-
i.length > 0
|
|
97
|
+
o && /* @__PURE__ */ r("div", { className: "absolute mt-2 w-11/12 overflow-y-auto rounded-md border border-neutral-200 bg-white shadow-sm", children: [
|
|
98
|
+
i.length > 0 && /* @__PURE__ */ e("ul", { className: "py-2", children: i.map((a) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
100
99
|
"a",
|
|
101
100
|
{
|
|
102
101
|
href: a.href,
|
|
103
102
|
className: "hover:bg-primary-50 block px-4 py-3 text-base text-neutral-800 transition-colors",
|
|
104
|
-
children: /* @__PURE__ */ e(
|
|
103
|
+
children: /* @__PURE__ */ e(x, { text: a.label, highlight: t })
|
|
105
104
|
}
|
|
106
|
-
) }, a.href)) })
|
|
105
|
+
) }, a.href)) }),
|
|
107
106
|
l && /* @__PURE__ */ e("ul", { className: "py-2", children: /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
108
107
|
"a",
|
|
109
108
|
{
|
|
@@ -117,5 +116,5 @@ const w = ({
|
|
|
117
116
|
] });
|
|
118
117
|
};
|
|
119
118
|
export {
|
|
120
|
-
|
|
119
|
+
y as SearchBar
|
|
121
120
|
};
|