lawgic-dev-kit 0.23.6 → 0.24.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,5 +1,5 @@
1
1
  import { j as t } from "../../../_virtual/jsx-runtime.js";
2
- import { useState as b, useRef as w, useEffect as P } from "react";
2
+ import { useState as b, useRef as w, useEffect as _ } from "react";
3
3
  import { useController as se } from "react-hook-form";
4
4
  import { useFloating as re, useClick as le, useDismiss as ne, useInteractions as ae, useTransitionStyles as ie } from "../../../node_modules/@floating-ui/react/dist/floating-ui.react.js";
5
5
  import { useTheme as ce } from "../../../hooks/useTheme.js";
@@ -9,22 +9,22 @@ import { offset as ue, flip as me, shift as fe, size as xe, arrow as he } from "
9
9
  const Le = ({
10
10
  countries: v = de,
11
11
  name: C,
12
- control: _,
13
- label: z = "select_a_country",
14
- placeholder: F = "type_to_search",
12
+ control: z,
13
+ label: F = "select_a_country",
14
+ placeholder: M = "type_to_search",
15
15
  language: p = "en",
16
- className: M = "",
17
- translateKey: D
16
+ className: D = "",
17
+ translateKey: A
18
18
  }) => {
19
- var O, I, R;
20
- const { t: r } = ce(), { field: l, fieldState: A } = se({
19
+ var I, R, B;
20
+ const { t: r } = ce(), { field: l, fieldState: Y } = se({
21
21
  name: C,
22
- control: _,
22
+ control: z,
23
23
  rules: { validate: {} },
24
24
  defaultValue: null
25
25
  }), [n, u] = b(!1), [c, j] = b(""), [o, S] = b(
26
26
  l.value || null
27
- ), m = w(null), y = w(null), f = w(null), { x: Y, y: H, strategy: U, refs: N, context: x, placement: V, middlewareData: L } = re({
27
+ ), m = w(null), y = w(null), f = w(null), { x: H, y: U, strategy: V, refs: N, context: x, placement: W, middlewareData: L } = re({
28
28
  open: n,
29
29
  onOpenChange: u,
30
30
  middleware: [
@@ -43,10 +43,10 @@ const Le = ({
43
43
  ],
44
44
  placement: "bottom-start",
45
45
  whileElementsMounted: pe
46
- }), W = le(x), X = ne(x), { getReferenceProps: q, getFloatingProps: G } = ae([
47
- W,
48
- X
49
- ]), { isMounted: $, styles: J } = ie(x, {
46
+ }), X = le(x), q = ne(x), { getReferenceProps: G, getFloatingProps: J } = ae([
47
+ X,
48
+ q
49
+ ]), { isMounted: $, styles: K } = ie(x, {
50
50
  duration: {
51
51
  open: 200,
52
52
  close: 150
@@ -59,21 +59,21 @@ const Le = ({
59
59
  if (!c.trim()) return !0;
60
60
  const s = p === "es" && e.labelES ? e.labelES.toLowerCase() : e.label.toLowerCase(), i = e.code ? e.code.toLowerCase() : "";
61
61
  return s.includes(c.toLowerCase()) || i.includes(c.toLowerCase());
62
- }), K = (e) => {
62
+ }), Q = (e) => {
63
63
  S(e), u(!1), j(""), l.onChange(e);
64
- }, Q = () => {
64
+ }, Z = () => {
65
65
  u(!n), !n && m.current && setTimeout(() => {
66
66
  var e;
67
67
  (e = m.current) == null || e.focus();
68
68
  }, 100);
69
- }, Z = () => {
69
+ }, ee = () => {
70
70
  setTimeout(() => {
71
71
  n || l.onBlur();
72
72
  }, 200);
73
73
  };
74
- P(() => {
74
+ _(() => {
75
75
  S(l.value);
76
- }, [l.value]), P(() => {
76
+ }, [l.value]), _(() => {
77
77
  const e = (s) => {
78
78
  f.current && !f.current.contains(s.target) && l.onBlur();
79
79
  };
@@ -84,26 +84,26 @@ const Le = ({
84
84
  const h = (e) => {
85
85
  var s;
86
86
  return e ? e.codeISO2 ? e.codeISO2.toLowerCase() : ((s = e.code) == null ? void 0 : s.toLowerCase()) || "" : "";
87
- }, T = (O = L.arrow) == null ? void 0 : O.x, k = (I = L.arrow) == null ? void 0 : I.y, a = {
87
+ }, T = (I = L.arrow) == null ? void 0 : I.x, k = (R = L.arrow) == null ? void 0 : R.y, a = {
88
88
  top: "bottom",
89
89
  right: "left",
90
90
  bottom: "top",
91
91
  left: "right"
92
- }[V.split("-")[0]], ee = q({
93
- onClick: Q,
94
- onBlur: Z
95
- }), te = r(z), oe = r(F), d = (R = A.error) == null ? void 0 : R.message;
92
+ }[W.split("-")[0]], te = G({
93
+ onClick: Z,
94
+ onBlur: ee
95
+ }), O = r(F), oe = r(M), d = (B = Y.error) == null ? void 0 : B.message;
96
96
  return /* @__PURE__ */ t.jsxs(
97
97
  "div",
98
98
  {
99
99
  ref: f,
100
- className: `w-full relative flex flex-col gap-8 ${M}`,
100
+ className: `w-full relative flex flex-col gap-8 ${D}`,
101
101
  children: [
102
- /* @__PURE__ */ t.jsx(
102
+ O && /* @__PURE__ */ t.jsx(
103
103
  "label",
104
104
  {
105
105
  className: `text-gray-600 font-600 group ${d && "!text-red-500"} text-label`,
106
- children: te
106
+ children: O
107
107
  }
108
108
  ),
109
109
  /* @__PURE__ */ t.jsxs(
@@ -111,7 +111,7 @@ const Le = ({
111
111
  {
112
112
  ref: N.setReference,
113
113
  className: `flex items-center justify-between bg-light rounded-full p-16 cursor-pointer border transition-all duration-200 hover:border-blue-400 ${d && "border-red-500 hover:border-red-600"} ${$ ? "border-blue-400" : "border-blue-100"}`,
114
- ...ee,
114
+ ...te,
115
115
  tabIndex: 0,
116
116
  children: [
117
117
  o != null && o.code ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center w-full gap-10", children: [
@@ -160,19 +160,19 @@ const Le = ({
160
160
  ]
161
161
  }
162
162
  ),
163
- d && /* @__PURE__ */ t.jsx("p", { className: "mt-1 text-sm text-red-600", children: r(d, { x: r(D || "") || r(C) }) }),
163
+ d && /* @__PURE__ */ t.jsx("p", { className: "mt-1 text-sm text-red-600", children: r(d, { x: r(A || "") || r(C) }) }),
164
164
  $ && /* @__PURE__ */ t.jsxs(
165
165
  "div",
166
166
  {
167
167
  ref: N.setFloating,
168
168
  style: {
169
- position: U,
170
- top: H ?? 0,
171
- left: Y ?? 0,
172
- ...J
169
+ position: V,
170
+ top: U ?? 0,
171
+ left: H ?? 0,
172
+ ...K
173
173
  },
174
174
  className: "z-10 w-full bg-white border border-blue-400 rounded-3xl shadow-lg overflow-auto",
175
- ...G(),
175
+ ...J(),
176
176
  children: [
177
177
  /* @__PURE__ */ t.jsx(
178
178
  "div",
@@ -209,14 +209,14 @@ const Le = ({
209
209
  }
210
210
  ) }),
211
211
  /* @__PURE__ */ t.jsx("div", { children: E.length > 0 ? /* @__PURE__ */ t.jsx("ul", { className: "flex flex-col", children: E.map((e, s) => {
212
- var B;
213
- const i = e.codeISO2 ? e.codeISO2.toLowerCase() : ((B = e.code) == null ? void 0 : B.toLowerCase()) || "";
212
+ var P;
213
+ const i = e.codeISO2 ? e.codeISO2.toLowerCase() : ((P = e.code) == null ? void 0 : P.toLowerCase()) || "";
214
214
  return /* @__PURE__ */ t.jsxs(
215
215
  "li",
216
216
  {
217
217
  className: "flex items-center gap-10 px-16 py-8 transition-all duration-200 hover:bg-blue-100/50 cursor-pointer",
218
218
  onClick: (g) => {
219
- g.stopPropagation(), K(e);
219
+ g.stopPropagation(), Q(e);
220
220
  },
221
221
  children: [
222
222
  i && /* @__PURE__ */ t.jsx(
@@ -8,26 +8,26 @@ import { offset as se, flip as re, shift as le, size as ne, arrow as ae } from "
8
8
  const ge = ({
9
9
  countries: p,
10
10
  name: a,
11
- control: u,
12
- label: x = "select_a_country",
11
+ control: x,
12
+ label: m = "select_a_country",
13
13
  placeholder: g = "type_to_search",
14
14
  language: i = "en",
15
15
  className: l = ""
16
16
  }) => {
17
- const { t: m } = D();
17
+ const { t: f } = D();
18
18
  return /* @__PURE__ */ t.jsx(
19
19
  K,
20
20
  {
21
21
  name: a,
22
- control: u,
23
- render: ({ field: { onChange: f, value: n }, fieldState: { error: r } }) => /* @__PURE__ */ t.jsx(
22
+ control: x,
23
+ render: ({ field: { onChange: h, value: n }, fieldState: { error: r } }) => /* @__PURE__ */ t.jsx(
24
24
  ie,
25
25
  {
26
26
  countries: p,
27
27
  value: n,
28
- onChange: f,
29
- label: m(x),
30
- placeholder: m(g),
28
+ onChange: h,
29
+ label: f(m),
30
+ placeholder: f(g),
31
31
  language: i,
32
32
  error: r == null ? void 0 : r.message,
33
33
  className: l
@@ -38,15 +38,15 @@ const ge = ({
38
38
  }, ie = ({
39
39
  countries: p,
40
40
  value: a,
41
- onChange: u,
42
- label: x = "select_a_country",
41
+ onChange: x,
42
+ label: m = "select_a_country",
43
43
  placeholder: g = "type_to_search",
44
44
  language: i = "en",
45
45
  error: l,
46
- className: m = ""
46
+ className: f = ""
47
47
  }) => {
48
48
  var _, I;
49
- const { t: f } = D(), [n, r] = S(!1), [h, y] = S(""), [o, N] = S(
49
+ const { t: h } = D(), [n, r] = S(!1), [u, y] = S(""), [o, N] = S(
50
50
  a || null
51
51
  ), b = z(null), v = z(null), { x: F, y: P, strategy: M, refs: $, context: w, placement: A, middlewareData: L } = Q({
52
52
  open: n,
@@ -80,11 +80,11 @@ const ge = ({
80
80
  transform: "translateY(-4px)"
81
81
  }
82
82
  }), T = (Array.isArray(p) ? p : []).filter((e) => {
83
- if (!h.trim()) return !0;
83
+ if (!u.trim()) return !0;
84
84
  const s = i === "es" && e.labelES ? e.labelES.toLowerCase() : e.label.toLowerCase(), d = e.code ? e.code.toLowerCase() : "";
85
- return s.includes(h.toLowerCase()) || d.includes(h.toLowerCase());
85
+ return s.includes(u.toLowerCase()) || d.includes(u.toLowerCase());
86
86
  }), X = (e) => {
87
- N(e), r(!1), y(""), u(e);
87
+ N(e), r(!1), y(""), x(e);
88
88
  }, q = () => {
89
89
  r(!n), !n && b.current && setTimeout(() => {
90
90
  var e;
@@ -105,12 +105,12 @@ const ge = ({
105
105
  }[A.split("-")[0]], G = H({
106
106
  onClick: q
107
107
  });
108
- return /* @__PURE__ */ t.jsxs("div", { className: `w-full relative flex flex-col gap-8 ${m}`, children: [
109
- /* @__PURE__ */ t.jsx(
108
+ return /* @__PURE__ */ t.jsxs("div", { className: `w-full relative flex flex-col gap-8 ${f}`, children: [
109
+ m && /* @__PURE__ */ t.jsx(
110
110
  "label",
111
111
  {
112
112
  className: `text-gray-600 font-600 group ${l && "!text-red-500"} text-label`,
113
- children: x
113
+ children: m
114
114
  }
115
115
  ),
116
116
  /* @__PURE__ */ t.jsxs(
@@ -142,7 +142,7 @@ const ge = ({
142
142
  ),
143
143
  /* @__PURE__ */ t.jsxs("span", { className: "flex-grow", children: [
144
144
  i === "es" && o.labelES ? o.labelES : o.label,
145
- o.code ? ` (${o.code})` : f("select_country")
145
+ o.code ? ` (${o.code})` : h("select_country")
146
146
  ] })
147
147
  ] }) : /* @__PURE__ */ t.jsx("span", { className: "text-gray-500", children: g }),
148
148
  /* @__PURE__ */ t.jsx(
@@ -204,8 +204,8 @@ const ge = ({
204
204
  ref: b,
205
205
  type: "text",
206
206
  className: "w-full p-16",
207
- placeholder: f("search") + "...",
208
- value: h,
207
+ placeholder: h("search") + "...",
208
+ value: u,
209
209
  onChange: (e) => y(e.target.value),
210
210
  onClick: (e) => e.stopPropagation(),
211
211
  autoFocus: !0
@@ -5,19 +5,19 @@ import { FontAwesomeIcon as $ } from "../../../node_modules/@fortawesome/react-f
5
5
  import { faEye as j, faEyeSlash as v } from "../../../node_modules/@fortawesome/pro-light-svg-icons/index.js";
6
6
  import { useTheme as N } from "../../../hooks/useTheme.js";
7
7
  const V = ({
8
- label: i,
8
+ label: a,
9
9
  control: c,
10
10
  name: e,
11
11
  placeholder: p,
12
12
  className: x = "",
13
13
  disabled: t = !1,
14
14
  size: d = "md",
15
- leftSide: a
15
+ leftSide: n
16
16
  }) => {
17
17
  const {
18
- field: { value: n = "", onChange: m, ref: g, onBlur: f },
18
+ field: { value: u = "", onChange: m, ref: g, onBlur: f },
19
19
  fieldState: { error: o }
20
- } = w({ name: e, control: c }), [s, h] = y(!1), { t: u } = N(), l = {
20
+ } = w({ name: e, control: c }), [s, h] = y(!1), { t: i } = N(), l = {
21
21
  sm: {
22
22
  container: "px-16 py-8",
23
23
  text: "text-sm",
@@ -39,11 +39,11 @@ const V = ({
39
39
  className: `flex flex-col group select-none ${l.gap} ${t && "cursor-not-allowed"} ${x}`,
40
40
  htmlFor: e,
41
41
  children: [
42
- /* @__PURE__ */ r.jsx(
42
+ a && /* @__PURE__ */ r.jsx(
43
43
  "h6",
44
44
  {
45
45
  className: `text-gray-600 font-600 leading-none group ${o && "!text-red-500"} ${l.label} ${t && "text-gray-300"}`,
46
- children: i
46
+ children: a
47
47
  }
48
48
  ),
49
49
  /* @__PURE__ */ r.jsxs(
@@ -59,7 +59,7 @@ const V = ({
59
59
 
60
60
  w-full h-full rounded-full border
61
61
 
62
- ${n && !t ? "border-blue-200" : "border-blue-100"}
62
+ ${u && !t ? "border-blue-200" : "border-blue-100"}
63
63
  ${!t && "group-hover:border-blue-300"}
64
64
  ${t && "cursor-not-allowed"}
65
65
 
@@ -68,7 +68,7 @@ const V = ({
68
68
  group-disabled:bg-gray-500
69
69
  `,
70
70
  children: [
71
- a && a,
71
+ n && n,
72
72
  /* @__PURE__ */ r.jsx(
73
73
  "input",
74
74
  {
@@ -79,7 +79,7 @@ const V = ({
79
79
  name: e,
80
80
  disabled: t,
81
81
  placeholder: p,
82
- value: n,
82
+ value: u,
83
83
  onChange: (b) => m(b.target.value),
84
84
  onBlur: f,
85
85
  ref: g,
@@ -97,7 +97,7 @@ const V = ({
97
97
  ]
98
98
  }
99
99
  ),
100
- (o == null ? void 0 : o.message) && /* @__PURE__ */ r.jsx("h4", { className: `font-500 text-red-500 leading-none ${l.error}`, children: u(o.message, { x: u(e) }) })
100
+ (o == null ? void 0 : o.message) && /* @__PURE__ */ r.jsx("h4", { className: `font-500 text-red-500 leading-none ${l.error}`, children: i(o.message, { x: i(e) }) })
101
101
  ]
102
102
  }
103
103
  );
@@ -1,5 +1,5 @@
1
1
  import { j as t } from "../../../_virtual/jsx-runtime.js";
2
- import { useState as f, useRef as h, useEffect as A } from "react";
2
+ import { useState as f, useRef as h, useEffect as H } from "react";
3
3
  import { useController as xe } from "react-hook-form";
4
4
  import { useFloating as be, useClick as we, useDismiss as Ce, useInteractions as ve, useTransitionStyles as ye } from "../../../node_modules/@floating-ui/react/dist/floating-ui.react.js";
5
5
  import { FontAwesomeIcon as je } from "../../../node_modules/@fortawesome/react-fontawesome/index.es.js";
@@ -10,22 +10,22 @@ import { autoUpdate as Te } from "../../../node_modules/@floating-ui/dom/dist/fl
10
10
  import { offset as Ie, flip as $e, shift as Ee, size as Oe, arrow as Pe } from "../../../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js";
11
11
  const Ye = ({
12
12
  name: v,
13
- control: H,
14
- label: Y = "phone_number",
15
- placeholder: U = "enter_phone_number",
16
- language: W = "en",
17
- className: X = "",
18
- translateKey: q,
13
+ control: Y,
14
+ label: U = "phone_number",
15
+ placeholder: W = "enter_phone_number",
16
+ language: X = "en",
17
+ className: q = "",
18
+ translateKey: G,
19
19
  countries: i = Le
20
20
  }) => {
21
- var z, F, D, V;
21
+ var F, D, V, A;
22
22
  const { t: l } = Se(), { field: s, fieldState: y } = xe({
23
23
  name: v,
24
- control: H,
24
+ control: Y,
25
25
  rules: { validate: {} }
26
- }), j = ((z = s.value) == null ? void 0 : z.split(" ")) || [], G = j[0] || null, J = j[1] || "", K = i.find((e) => G === e.phone), [c, g] = f(!1), [d, N] = f(""), [r, S] = f(
27
- K || null
28
- ), [L, T] = f(J), [Q, I] = f(!1), x = h(null), $ = h(null), E = h(null), b = h(null), { x: Z, y: ee, strategy: te, refs: O, context: w, placement: oe, middlewareData: P } = be({
26
+ }), j = ((F = s.value) == null ? void 0 : F.split(" ")) || [], J = j[0] || null, K = j[1] || "", Q = i.find((e) => J === e.phone), [c, g] = f(!1), [d, N] = f(""), [r, S] = f(
27
+ Q || null
28
+ ), [L, T] = f(K), [Z, I] = f(!1), x = h(null), $ = h(null), E = h(null), b = h(null), { x: ee, y: te, strategy: oe, refs: O, context: w, placement: ne, middlewareData: P } = be({
29
29
  open: c,
30
30
  onOpenChange: g,
31
31
  middleware: [
@@ -44,10 +44,10 @@ const Ye = ({
44
44
  ],
45
45
  placement: "bottom-start",
46
46
  whileElementsMounted: Te
47
- }), ne = we(w), re = Ce(w), { getReferenceProps: se, getFloatingProps: le } = ve([
48
- ne,
49
- re
50
- ]), { isMounted: ae, styles: ie } = ye(w, {
47
+ }), re = we(w), se = Ce(w), { getReferenceProps: le, getFloatingProps: ae } = ve([
48
+ re,
49
+ se
50
+ ]), { isMounted: ie, styles: ce } = ye(w, {
51
51
  duration: {
52
52
  open: 200,
53
53
  close: 150
@@ -58,22 +58,22 @@ const Ye = ({
58
58
  }
59
59
  }), R = (Array.isArray(i) ? i : []).filter((e) => {
60
60
  if (!d.trim()) return !0;
61
- const o = W === "es" && e.labelES ? e.labelES.toLowerCase() : e.label.toLowerCase(), n = e.code ? e.code.toLowerCase() : "", a = e.phone ? e.phone.toLowerCase() : "";
61
+ const o = X === "es" && e.labelES ? e.labelES.toLowerCase() : e.label.toLowerCase(), n = e.code ? e.code.toLowerCase() : "", a = e.phone ? e.phone.toLowerCase() : "";
62
62
  return o.includes(d.toLowerCase()) || n.includes(d.toLowerCase()) || a.includes(d.toLowerCase());
63
- }), ce = (e) => {
63
+ }), de = (e) => {
64
64
  S(e), g(!1), N("");
65
65
  const o = `${e.phone} ${L}`;
66
66
  s.onChange(o), setTimeout(() => {
67
67
  var n;
68
68
  (n = E.current) == null || n.focus();
69
69
  }, 100);
70
- }, de = (e) => {
70
+ }, ue = (e) => {
71
71
  const o = e.target.value;
72
72
  if (T(o), r) {
73
73
  const n = `${r.phone} ${o}`;
74
74
  s.onChange(n);
75
75
  }
76
- }, ue = () => {
76
+ }, pe = () => {
77
77
  g(!c), !c && x.current && setTimeout(() => {
78
78
  var e;
79
79
  (e = x.current) == null || e.focus();
@@ -82,19 +82,19 @@ const Ye = ({
82
82
  setTimeout(() => {
83
83
  c || s.onBlur();
84
84
  }, 200);
85
- }, pe = () => {
86
- I(!0);
87
85
  }, me = () => {
86
+ I(!0);
87
+ }, fe = () => {
88
88
  I(!1);
89
89
  };
90
- A(() => {
90
+ H(() => {
91
91
  if (s.value) {
92
92
  const e = s.value.split(" "), o = e[0] || "", n = e[1] || "", a = i.find(
93
93
  (m) => m.phone === o
94
94
  );
95
95
  a && S(a), T(n);
96
96
  }
97
- }, [s.value, i]), A(() => {
97
+ }, [s.value, i]), H(() => {
98
98
  const e = (o) => {
99
99
  b.current && !b.current.contains(o.target) && s.onBlur();
100
100
  };
@@ -105,21 +105,21 @@ const Ye = ({
105
105
  const C = (e) => {
106
106
  var o;
107
107
  return e ? e.codeISO2 ? e.codeISO2.toLowerCase() : ((o = e.code) == null ? void 0 : o.toLowerCase()) || "" : "";
108
- }, M = (F = P.arrow) == null ? void 0 : F.x, k = (D = P.arrow) == null ? void 0 : D.y, u = {
108
+ }, M = (D = P.arrow) == null ? void 0 : D.x, k = (V = P.arrow) == null ? void 0 : V.y, u = {
109
109
  top: "bottom",
110
110
  right: "left",
111
111
  bottom: "top",
112
112
  left: "right"
113
- }[oe.split("-")[0]], fe = se({
114
- onClick: ue,
113
+ }[ne.split("-")[0]], he = le({
114
+ onClick: pe,
115
115
  onBlur: B
116
- }), _ = () => y.error ? "border-red-500" : Q || c ? "border-blue-400" : "border-blue-100", he = l(Y), ge = l(U), p = (V = y.error) == null ? void 0 : V.message;
117
- return /* @__PURE__ */ t.jsxs("div", { className: `w-full relative flex flex-col gap-8 ${X}`, children: [
118
- /* @__PURE__ */ t.jsx(
116
+ }), _ = () => y.error ? "border-red-500" : Z || c ? "border-blue-400" : "border-blue-100", z = l(U), ge = l(W), p = (A = y.error) == null ? void 0 : A.message;
117
+ return /* @__PURE__ */ t.jsxs("div", { className: `w-full relative flex flex-col gap-8 ${q}`, children: [
118
+ z && /* @__PURE__ */ t.jsx(
119
119
  "label",
120
120
  {
121
121
  className: `text-gray-600 font-600 group ${p && "!text-red-500"} text-label`,
122
- children: he
122
+ children: z
123
123
  }
124
124
  ),
125
125
  /* @__PURE__ */ t.jsxs(
@@ -127,8 +127,8 @@ const Ye = ({
127
127
  {
128
128
  ref: b,
129
129
  className: "flex items-center w-full",
130
- onMouseEnter: pe,
131
- onMouseLeave: me,
130
+ onMouseEnter: me,
131
+ onMouseLeave: fe,
132
132
  children: [
133
133
  /* @__PURE__ */ t.jsxs(
134
134
  "div",
@@ -136,7 +136,7 @@ const Ye = ({
136
136
  ref: O.setReference,
137
137
  className: `flex items-center justify-between text-lg max-w-120 font-600 bg-light rounded-l-full p-16 cursor-pointer border border-r-0 transition-all duration-200 ${p ? "border-red-500" : _()}`,
138
138
  style: { minWidth: "140px" },
139
- ...fe,
139
+ ...he,
140
140
  tabIndex: 0,
141
141
  children: [
142
142
  r != null && r.code ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center truncate", children: [
@@ -182,26 +182,26 @@ const Ye = ({
182
182
  className: `placeholder:text-gray-400 flex-grow bg-light rounded-r-full font-600 text-body-m p-16 border transition-all duration-200 ${p ? "border-red-500" : _()}`,
183
183
  placeholder: ge,
184
184
  value: L,
185
- onChange: de,
185
+ onChange: ue,
186
186
  onBlur: B
187
187
  }
188
188
  )
189
189
  ]
190
190
  }
191
191
  ),
192
- p && /* @__PURE__ */ t.jsx("p", { className: "mt-1 text-sm text-red-600", children: l(p, { x: l(q || "") || v }) }),
193
- ae && /* @__PURE__ */ t.jsxs(
192
+ p && /* @__PURE__ */ t.jsx("p", { className: "mt-1 text-sm text-red-600", children: l(p, { x: l(G || "") || v }) }),
193
+ ie && /* @__PURE__ */ t.jsxs(
194
194
  "div",
195
195
  {
196
196
  ref: O.setFloating,
197
197
  style: {
198
- position: te,
199
- top: ee ?? 0,
200
- left: Z ?? 0,
201
- ...ie
198
+ position: oe,
199
+ top: te ?? 0,
200
+ left: ee ?? 0,
201
+ ...ce
202
202
  },
203
203
  className: "z-10 w-fit bg-white border border-blue-400 rounded-3xl shadow-lg overflow-auto max-w-120",
204
- ...le(),
204
+ ...ae(),
205
205
  children: [
206
206
  /* @__PURE__ */ t.jsx(
207
207
  "div",
@@ -245,7 +245,7 @@ const Ye = ({
245
245
  {
246
246
  className: "flex items-center justify-between gap-10 px-16 py-8 transition-all duration-200 hover:bg-blue-100/50 cursor-pointer",
247
247
  onClick: (m) => {
248
- m.stopPropagation(), ce(e);
248
+ m.stopPropagation(), de(e);
249
249
  },
250
250
  children: [
251
251
  n && /* @__PURE__ */ t.jsx(
@@ -0,0 +1,5 @@
1
+ import { default as React } from 'react';
2
+ import { TextAreaProps } from './TextArea.types';
3
+ import { FieldValues } from 'react-hook-form';
4
+ declare const TextArea: <T extends FieldValues = FieldValues>({ label, control, name, placeholder, className, disabled, translateKey, size, rows, ...props }: TextAreaProps<T>) => React.ReactElement;
5
+ export default TextArea;
@@ -0,0 +1,92 @@
1
+ import { j as l } from "../../../_virtual/jsx-runtime.js";
2
+ import { useController as j } from "react-hook-form";
3
+ import { useTheme as N } from "../../../hooks/useTheme.js";
4
+ import "react";
5
+ const T = ({
6
+ label: s,
7
+ control: u,
8
+ name: r,
9
+ placeholder: x,
10
+ className: c = "",
11
+ disabled: e = !1,
12
+ translateKey: d = "",
13
+ size: i = "md",
14
+ rows: p = 4,
15
+ ...g
16
+ }) => {
17
+ const {
18
+ field: { value: n = "", onChange: m, ref: f, onBlur: h },
19
+ fieldState: { error: t }
20
+ } = j({ name: r, control: u }), { t: a } = N(), o = {
21
+ sm: {
22
+ container: "px-16 py-8",
23
+ text: "text-sm",
24
+ label: "text-sm",
25
+ error: "text-sm",
26
+ gap: "gap-8"
27
+ },
28
+ md: {
29
+ container: "p-16",
30
+ text: "text-14",
31
+ label: "text-14",
32
+ error: "text-sm",
33
+ gap: "gap-8"
34
+ }
35
+ }[i], b = a(r), $ = a(d);
36
+ return /* @__PURE__ */ l.jsxs(
37
+ "label",
38
+ {
39
+ className: `flex flex-col group select-none ${o.gap} ${e && "cursor-not-allowed"} ${c}`,
40
+ htmlFor: r,
41
+ children: [
42
+ s && /* @__PURE__ */ l.jsx(
43
+ "h6",
44
+ {
45
+ className: `text-gray-600 font-600 leading-none group ${t && "text-red-500!"} ${o.label} ${e && "text-gray-300"}`,
46
+ children: s
47
+ }
48
+ ),
49
+ /* @__PURE__ */ l.jsx(
50
+ "div",
51
+ {
52
+ className: `
53
+ ${o.container}
54
+
55
+ ${t && "border-red-500!"}
56
+
57
+ !bg-blue-50
58
+
59
+ rounded-2xl border
60
+
61
+ ${n && !e ? "border-blue-200" : "border-blue-100"}
62
+ ${!e && "group-hover:border-blue-300"}
63
+ ${e && "cursor-not-allowed"}
64
+
65
+ group-focus-within:border-blue-500 transition-colors duration-200 ease-in-out
66
+ `,
67
+ children: /* @__PURE__ */ l.jsx(
68
+ "textarea",
69
+ {
70
+ id: r,
71
+ name: r,
72
+ disabled: e,
73
+ placeholder: x,
74
+ value: n,
75
+ onChange: (y) => m(y.target.value),
76
+ onBlur: h,
77
+ ref: f,
78
+ rows: p,
79
+ className: `bg-transparent w-full font-600 placeholder:font-600 select-text ${o.text} disabled:text-gray-300 disabled:placeholder:text-gray-300 placeholder:text-gray-400 disabled:cursor-not-allowed resize-none outline-hidden`,
80
+ ...g
81
+ }
82
+ )
83
+ }
84
+ ),
85
+ (t == null ? void 0 : t.message) && /* @__PURE__ */ l.jsx("h4", { className: `font-500 text-red-500 leading-none ${o.error}`, children: a(t.message, { x: $ || b }) })
86
+ ]
87
+ }
88
+ );
89
+ };
90
+ export {
91
+ T as default
92
+ };
@@ -0,0 +1,12 @@
1
+ import { Control, FieldValues, Path } from 'react-hook-form';
2
+ export type TextAreaProps<T extends FieldValues = FieldValues> = {
3
+ label?: string;
4
+ placeholder?: string;
5
+ className?: string;
6
+ disabled?: boolean;
7
+ translateKey?: string;
8
+ size?: 'sm' | 'md';
9
+ rows?: number;
10
+ control: Control<T>;
11
+ name: Path<T>;
12
+ } & Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'size'>;
@@ -0,0 +1 @@
1
+ export { default as TextArea } from './TextArea';