@npm_leadtech/legal-contracts-ui 0.55.2 → 0.56.0

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