@konstructio/ui 0.1.2-alpha.29 → 0.1.2-alpha.30

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.
@@ -0,0 +1,99 @@
1
+ import { Body as g } from "./components/Modal/components/Body/Body.js";
2
+ import { Footer as v } from "./components/Modal/components/Footer/Footer.js";
3
+ import { Header as w } from "./components/Modal/components/Header/Header.js";
4
+ import { jsx as t, jsxs as f } from "react/jsx-runtime";
5
+ import { Children as i, isValidElement as s, useEffect as A } from "react";
6
+ import { createPortal as N } from "react-dom";
7
+ import { R } from "./index-DrWQH0QF.js";
8
+ import { R as k } from "./Combination-VYaRRJBZ.js";
9
+ import { cn as p } from "./utils/index.js";
10
+ import { buttonCloseVariants as x, modalVariants as B } from "./components/Modal/components/Wrapper/Wrapper.variants.js";
11
+ import { X as E } from "./x-DPU9OdYH.js";
12
+ const F = ({
13
+ buttonCloseClassName: m,
14
+ children: e,
15
+ className: d,
16
+ showCloseButton: l = !0,
17
+ theme: a,
18
+ onClose: n
19
+ }) => {
20
+ const c = i.toArray(e).find(
21
+ (o) => s(o) && o.type === r.Header
22
+ ), y = i.toArray(e).find(
23
+ (o) => s(o) && o.type === r.Body
24
+ ), u = i.toArray(e).find(
25
+ (o) => s(o) && o.type === r.Footer
26
+ ), b = i.toArray(e).filter(
27
+ (o) => !s(o) || ![r.Header, r.Body, r.Footer].includes(
28
+ o.type
29
+ )
30
+ );
31
+ return /* @__PURE__ */ t(k, { children: /* @__PURE__ */ f(
32
+ "div",
33
+ {
34
+ className: "fixed inset-0 grid place-content-center",
35
+ "data-theme": a,
36
+ children: [
37
+ /* @__PURE__ */ t(
38
+ "div",
39
+ {
40
+ className: "absolute inset-0 bg-black opacity-75 animate-in fade-in-0",
41
+ onClick: n,
42
+ role: "presentation"
43
+ }
44
+ ),
45
+ /* @__PURE__ */ f(
46
+ "div",
47
+ {
48
+ className: p(
49
+ B({
50
+ className: d
51
+ })
52
+ ),
53
+ role: "dialog",
54
+ "aria-modal": "true",
55
+ children: [
56
+ c,
57
+ l && /* @__PURE__ */ f(
58
+ "button",
59
+ {
60
+ className: p(
61
+ x({
62
+ className: m
63
+ })
64
+ ),
65
+ onClick: n,
66
+ children: [
67
+ /* @__PURE__ */ t(E, {}),
68
+ /* @__PURE__ */ t(R, { children: "Dismiss modal" })
69
+ ]
70
+ }
71
+ ),
72
+ y ?? b,
73
+ u
74
+ ]
75
+ }
76
+ )
77
+ ]
78
+ }
79
+ ) });
80
+ }, r = ({ isOpen: m, onClose: e, container: d, ...l }) => (A(() => {
81
+ const a = new AbortController(), n = (c) => {
82
+ c.code === "Escape" && e?.();
83
+ };
84
+ return window.addEventListener("keydown", n, {
85
+ signal: a.signal
86
+ }), () => {
87
+ a.abort();
88
+ };
89
+ }, [e]), m ? N(
90
+ /* @__PURE__ */ t(F, { ...l, onClose: e }),
91
+ d || document.body
92
+ ) : null);
93
+ r.Header = w;
94
+ r.Body = g;
95
+ r.Footer = v;
96
+ export {
97
+ r as M,
98
+ F as W
99
+ };
@@ -1,7 +1,7 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "react-dom";
4
- import { M as d } from "../../Modal-Dpk-1N9W.js";
4
+ import { M as d } from "../../Modal-5xSxFoaD.js";
5
5
  import "./components/Header/Header.js";
6
6
  import "./components/Body/Body.js";
7
7
  import "./components/Footer/Footer.js";
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
2
2
  import "../../../../index-DrWQH0QF.js";
3
3
  import "react";
4
4
  import "../../../../Combination-VYaRRJBZ.js";
5
- import { W as f } from "../../../../Modal-Dpk-1N9W.js";
5
+ import { W as f } from "../../../../Modal-5xSxFoaD.js";
6
6
  import "../../../../utils/index.js";
7
7
  import "./Wrapper.variants.js";
8
8
  import "../../../../x-DPU9OdYH.js";
@@ -1,7 +1,7 @@
1
1
  import { Body as e } from "./Body/Body.js";
2
2
  import { Footer as t } from "./Footer/Footer.js";
3
3
  import { Header as m } from "./Header/Header.js";
4
- import { W as a } from "../../../Modal-Dpk-1N9W.js";
4
+ import { W as a } from "../../../Modal-5xSxFoaD.js";
5
5
  export {
6
6
  e as Body,
7
7
  t as Footer,
@@ -555,8 +555,8 @@ function G(r) {
555
555
  });
556
556
  }
557
557
  const te = ({
558
- showNameOnSearch: r,
559
- showFlagOnSearch: l
558
+ showFlagOnSearch: r,
559
+ showNameOnSearch: l
560
560
  }) => {
561
561
  const e = R(null), { termOfSearch: t, countries: s, handleSelectCountry: i } = A(), n = F(() => s.filter(
562
562
  (a) => a.name.toLocaleLowerCase().includes(t.toLowerCase())
@@ -608,8 +608,8 @@ const te = ({
608
608
  component: "span",
609
609
  className: "flex gap-2 items-center text-left text-slate-800 dark:text-slate-50",
610
610
  children: [
611
- l && /* @__PURE__ */ f(h, {}),
612
- r && /* @__PURE__ */ f(D, { text: u, prefix: d })
611
+ r && /* @__PURE__ */ f(h, {}),
612
+ l && /* @__PURE__ */ f(D, { text: u, prefix: d })
613
613
  ]
614
614
  }
615
615
  )
@@ -1,27 +1,36 @@
1
- import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
- import { useCallback as m } from "react";
3
- import { Input as i } from "../../../Input/Input.js";
4
- import { FlagSelectorList as p } from "../FlagSelectorList/FlagSelectorList.js";
5
- import { usePhoneNumberContext as c } from "../../contexts/phone-number.hook.js";
6
- const g = ({
7
- showInputFilter: r,
8
- showNameOnSearch: o,
9
- showFlagOnSearch: a
1
+ import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
+ import { useCallback as d } from "react";
3
+ import { Input as p } from "../../../Input/Input.js";
4
+ import { FlagSelectorList as c } from "../FlagSelectorList/FlagSelectorList.js";
5
+ import { usePhoneNumberContext as u } from "../../contexts/phone-number.hook.js";
6
+ const S = ({
7
+ placeholder: r = "Search",
8
+ showFlagOnSearch: o,
9
+ showInputFilter: t,
10
+ showNameOnSearch: a,
11
+ showPlaceHolder: s = !0
10
12
  }) => {
11
- const { onChangeTermOfSearch: t } = c(), s = m((l) => {
12
- t(l.target.value);
13
+ const { onChangeTermOfSearch: l } = u(), n = d((m) => {
14
+ l(m.target.value);
13
15
  }, []);
14
- return /* @__PURE__ */ n("div", { className: "absolute top-full mt-1.5 animate-in fade-in-0 zoom-in-95 w-full border border-transparent bg-white shadow-sm py-2 z-10 rounded-sm dark:bg-slate-800 dark:border-slate-600", children: [
15
- r && /* @__PURE__ */ e("div", { className: "px-6 py-2.5", children: /* @__PURE__ */ e(i, { isSearch: !0, placeholder: "Search", onChange: s }) }),
16
- /* @__PURE__ */ e(
16
+ return /* @__PURE__ */ i("div", { className: "absolute top-full mt-1.5 animate-in fade-in-0 zoom-in-95 w-full border border-transparent bg-white shadow-sm py-2 z-10 rounded-sm dark:bg-slate-800 dark:border-slate-600", children: [
17
+ t && /* @__PURE__ */ e("div", { className: "px-6 py-2.5", children: /* @__PURE__ */ e(
17
18
  p,
18
19
  {
19
- showNameOnSearch: o,
20
- showFlagOnSearch: a
20
+ isSearch: !0,
21
+ placeholder: s ? r : void 0,
22
+ onChange: n
23
+ }
24
+ ) }),
25
+ /* @__PURE__ */ e(
26
+ c,
27
+ {
28
+ showFlagOnSearch: o,
29
+ showNameOnSearch: a
21
30
  }
22
31
  )
23
32
  ] });
24
33
  };
25
34
  export {
26
- g as FlagSelectorWrapper
35
+ S as FlagSelectorWrapper
27
36
  };
@@ -14,12 +14,12 @@ function se(e, t) {
14
14
  return r;
15
15
  }
16
16
  function Ue(e, t, n) {
17
- return t = Y(t), function(r, a) {
18
- if (a && (typeof a == "object" || typeof a == "function")) return a;
19
- if (a !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
20
- return function(o) {
21
- if (o === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
22
- return o;
17
+ return t = Y(t), function(r, o) {
18
+ if (o && (typeof o == "object" || typeof o == "function")) return o;
19
+ if (o !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
20
+ return function(a) {
21
+ if (a === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
22
+ return a;
23
23
  }(r);
24
24
  }(e, Oe() ? Reflect.construct(t, n || [], Y(e).constructor) : t.apply(e, n));
25
25
  }
@@ -40,46 +40,46 @@ function ge(e, t) {
40
40
  }
41
41
  }(e)) || t) {
42
42
  n && (e = n);
43
- var r = 0, a = function() {
43
+ var r = 0, o = function() {
44
44
  };
45
- return { s: a, n: function() {
45
+ return { s: o, n: function() {
46
46
  return r >= e.length ? { done: !0 } : { done: !1, value: e[r++] };
47
47
  }, e: function(i) {
48
48
  throw i;
49
- }, f: a };
49
+ }, f: o };
50
50
  }
51
51
  throw new TypeError(`Invalid attempt to iterate non-iterable instance.
52
52
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
53
53
  }
54
- var o, l = !0, u = !1;
54
+ var a, l = !0, u = !1;
55
55
  return { s: function() {
56
56
  n = n.call(e);
57
57
  }, n: function() {
58
58
  var i = n.next();
59
59
  return l = i.done, i;
60
60
  }, e: function(i) {
61
- u = !0, o = i;
61
+ u = !0, a = i;
62
62
  }, f: function() {
63
63
  try {
64
64
  l || n.return == null || n.return();
65
65
  } finally {
66
- if (u) throw o;
66
+ if (u) throw a;
67
67
  }
68
68
  } };
69
69
  }
70
70
  function be(e, t, n) {
71
71
  return (t = function(r) {
72
- var a = function(o, l) {
73
- if (typeof o != "object" || !o) return o;
74
- var u = o[Symbol.toPrimitive];
72
+ var o = function(a, l) {
73
+ if (typeof a != "object" || !a) return a;
74
+ var u = a[Symbol.toPrimitive];
75
75
  if (u !== void 0) {
76
- var i = u.call(o, l);
76
+ var i = u.call(a, l);
77
77
  if (typeof i != "object") return i;
78
78
  throw new TypeError("@@toPrimitive must return a primitive value.");
79
79
  }
80
- return (l === "string" ? String : Number)(o);
80
+ return (l === "string" ? String : Number)(a);
81
81
  }(r, "string");
82
- return typeof a == "symbol" ? a : a + "";
82
+ return typeof o == "symbol" ? o : o + "";
83
83
  }(t)) in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
84
84
  }
85
85
  function Y(e) {
@@ -105,8 +105,8 @@ function pe(e, t) {
105
105
  var n = Object.keys(e);
106
106
  if (Object.getOwnPropertySymbols) {
107
107
  var r = Object.getOwnPropertySymbols(e);
108
- t && (r = r.filter(function(a) {
109
- return Object.getOwnPropertyDescriptor(e, a).enumerable;
108
+ t && (r = r.filter(function(o) {
109
+ return Object.getOwnPropertyDescriptor(e, o).enumerable;
110
110
  })), n.push.apply(n, r);
111
111
  }
112
112
  return n;
@@ -124,7 +124,7 @@ function J(e) {
124
124
  }
125
125
  function _e(e, t) {
126
126
  if (e == null) return {};
127
- var n, r, a = function(l, u) {
127
+ var n, r, o = function(l, u) {
128
128
  if (l == null) return {};
129
129
  var i = {};
130
130
  for (var c in l) if ({}.hasOwnProperty.call(l, c)) {
@@ -134,10 +134,10 @@ function _e(e, t) {
134
134
  return i;
135
135
  }(e, t);
136
136
  if (Object.getOwnPropertySymbols) {
137
- var o = Object.getOwnPropertySymbols(e);
138
- for (r = 0; r < o.length; r++) n = o[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
137
+ var a = Object.getOwnPropertySymbols(e);
138
+ for (r = 0; r < a.length; r++) n = a[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (o[n] = e[n]);
139
139
  }
140
- return a;
140
+ return o;
141
141
  }
142
142
  function te(e, t) {
143
143
  return te = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
@@ -145,90 +145,90 @@ function te(e, t) {
145
145
  }, te(e, t);
146
146
  }
147
147
  function U(e, t) {
148
- var n, r = t.replacementChars, a = t.replacement, o = t.separate, l = r, u = "", i = ge(e);
148
+ var n, r = t.replacementChars, o = t.replacement, a = t.separate, l = r, u = "", i = ge(e);
149
149
  try {
150
150
  for (i.s(); !(n = i.n()).done; ) {
151
- var c, p = n.value, s = !Object.prototype.hasOwnProperty.call(a, p) && ((c = a[l[0]]) === null || c === void 0 ? void 0 : c.test(p));
152
- (o && p === l[0] || s) && (l = l.slice(1), u += p);
151
+ var c, p = n.value, f = !Object.prototype.hasOwnProperty.call(o, p) && ((c = o[l[0]]) === null || c === void 0 ? void 0 : c.test(p));
152
+ (a && p === l[0] || f) && (l = l.slice(1), u += p);
153
153
  }
154
- } catch (O) {
155
- i.e(O);
154
+ } catch (b) {
155
+ i.e(b);
156
156
  } finally {
157
157
  i.f();
158
158
  }
159
159
  return u;
160
160
  }
161
161
  function Se(e, t) {
162
- var n, r = t.mask, a = t.replacement, o = t.separate, l = t.showMask, u = 0, i = "", c = ge(r);
162
+ var n, r = t.mask, o = t.replacement, a = t.separate, l = t.showMask, u = 0, i = "", c = ge(r);
163
163
  try {
164
164
  for (c.s(); !(n = c.n()).done; ) {
165
165
  var p = n.value;
166
166
  if (!l && e[u] === void 0) break;
167
- Object.prototype.hasOwnProperty.call(a, p) && e[u] !== void 0 ? i += e[u++] : i += p;
167
+ Object.prototype.hasOwnProperty.call(o, p) && e[u] !== void 0 ? i += e[u++] : i += p;
168
168
  }
169
- } catch (O) {
170
- c.e(O);
169
+ } catch (b) {
170
+ c.e(b);
171
171
  } finally {
172
172
  c.f();
173
173
  }
174
- if (o && !l) {
175
- for (var s = r.length - 1; s >= 0 && i[s] === r[s]; s--) ;
176
- i = i.slice(0, s + 1);
174
+ if (a && !l) {
175
+ for (var f = r.length - 1; f >= 0 && i[f] === r[f]; f--) ;
176
+ i = i.slice(0, f + 1);
177
177
  }
178
178
  return i;
179
179
  }
180
180
  function we(e, t) {
181
- for (var n = t.mask, r = t.replacement, a = [], o = 0; o < n.length; o++) {
182
- var l, u = (l = e[o]) !== null && l !== void 0 ? l : n[o], i = Object.prototype.hasOwnProperty.call(r, u) ? "replacement" : e[o] !== void 0 && e[o] !== n[o] ? "input" : "mask";
183
- a.push({ type: i, value: u, index: o });
181
+ for (var n = t.mask, r = t.replacement, o = [], a = 0; a < n.length; a++) {
182
+ var l, u = (l = e[a]) !== null && l !== void 0 ? l : n[a], i = Object.prototype.hasOwnProperty.call(r, u) ? "replacement" : e[a] !== void 0 && e[a] !== n[a] ? "input" : "mask";
183
+ o.push({ type: i, value: u, index: a });
184
184
  }
185
- return a;
185
+ return o;
186
186
  }
187
187
  function K(e) {
188
188
  return e.length > 0 ? be({}, e, /./) : {};
189
189
  }
190
190
  function ne(e, t) {
191
- for (var n = t.start, r = n === void 0 ? 0 : n, a = t.end, o = t.mask, l = t.replacement, u = t.separate, i = e.slice(r, a), c = o.slice(r, a), p = "", s = 0; s < c.length; s++) {
192
- var O = Object.prototype.hasOwnProperty.call(l, c[s]);
193
- O && i[s] !== void 0 && i[s] !== c[s] ? p += i[s] : O && u && (p += c[s]);
191
+ for (var n = t.start, r = n === void 0 ? 0 : n, o = t.end, a = t.mask, l = t.replacement, u = t.separate, i = e.slice(r, o), c = a.slice(r, o), p = "", f = 0; f < c.length; f++) {
192
+ var b = Object.prototype.hasOwnProperty.call(l, c[f]);
193
+ b && i[f] !== void 0 && i[f] !== c[f] ? p += i[f] : b && u && (p += c[f]);
194
194
  }
195
195
  return p;
196
196
  }
197
197
  function ke(e, t) {
198
- var n = t.mask, r = t.replacement, a = typeof r == "string" ? K(r) : r, o = RegExp("[^".concat(Object.keys(a).join(""), "]"), "g");
199
- return Se(U(e, { replacementChars: n.replace(o, ""), replacement: a, separate: !1 }), { mask: n, replacement: a, separate: !1, showMask: !1 });
198
+ var n = t.mask, r = t.replacement, o = typeof r == "string" ? K(r) : r, a = RegExp("[^".concat(Object.keys(o).join(""), "]"), "g");
199
+ return Se(U(e, { replacementChars: n.replace(a, ""), replacement: o, separate: !1 }), { mask: n, replacement: o, separate: !1, showMask: !1 });
200
200
  }
201
201
  function We(e, t) {
202
- var n = t.mask, r = t.replacement, a = typeof r == "string" ? K(r) : r, o = ne(e, { mask: n, replacement: a, separate: !1 }), l = RegExp("[^".concat(Object.keys(a).join(""), "]"), "g");
203
- return U(o, { replacementChars: n.replace(l, ""), replacement: a, separate: !1 });
202
+ var n = t.mask, r = t.replacement, o = typeof r == "string" ? K(r) : r, a = ne(e, { mask: n, replacement: o, separate: !1 }), l = RegExp("[^".concat(Object.keys(o).join(""), "]"), "g");
203
+ return U(a, { replacementChars: n.replace(l, ""), replacement: o, separate: !1 });
204
204
  }
205
205
  function Ze(e, t) {
206
- var n = t.mask, r = t.replacement, a = typeof r == "string" ? K(r) : r;
207
- return we(ke(e, { mask: n, replacement: a }), { mask: n, replacement: a });
206
+ var n = t.mask, r = t.replacement, o = typeof r == "string" ? K(r) : r;
207
+ return we(ke(e, { mask: n, replacement: o }), { mask: n, replacement: o });
208
208
  }
209
209
  var Je = ["[", "]", "\\", "/", "^", "$", ".", "|", "?", "*", "+", "(", ")", "{", "}"];
210
210
  function fe(e) {
211
211
  return Je.includes(e) ? "\\".concat(e) : e;
212
212
  }
213
213
  function Ye(e, t) {
214
- for (var n = t.mask, r = t.replacement, a = typeof r == "string" ? K(r) : r, o = e === "partial" || e === "partial-inexact", l = e === "full" || e === "partial", u = "", i = 0; i < n.length; i++) {
214
+ for (var n = t.mask, r = t.replacement, o = typeof r == "string" ? K(r) : r, a = e === "partial" || e === "partial-inexact", l = e === "full" || e === "partial", u = "", i = 0; i < n.length; i++) {
215
215
  var c = n[i];
216
- i === 0 && (u = "^"), o && (u += "("), u += Object.prototype.hasOwnProperty.call(a, c) ? "".concat(l ? "(?!".concat(fe(c), ")") : "", "(").concat(a[c].source, ")") : fe(c), i === n.length - 1 && (o && (u += ")?".repeat(n.length)), u += "$");
216
+ i === 0 && (u = "^"), a && (u += "("), u += Object.prototype.hasOwnProperty.call(o, c) ? "".concat(l ? "(?!".concat(fe(c), ")") : "", "(").concat(o[c].source, ")") : fe(c), i === n.length - 1 && (a && (u += ")?".repeat(n.length)), u += "$");
217
217
  }
218
218
  return u;
219
219
  }
220
220
  function Qe(e, t) {
221
- return new Proxy(e, { set: function(n, r, a) {
222
- return r === "current" && (a !== e.current && (e.current !== null && t.unregister(e.current), a !== null && t.register(a)), n[r] = a, !0);
221
+ return new Proxy(e, { set: function(n, r, o) {
222
+ return r === "current" && (o !== e.current && (e.current !== null && t.unregister(e.current), o !== null && t.register(o)), n[r] = o, !0);
223
223
  } });
224
224
  }
225
225
  function qe(e, t, n) {
226
- return t = z(t), function(r, a) {
227
- if (a && (typeof a == "object" || typeof a == "function")) return a;
228
- if (a !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
229
- return function(o) {
230
- if (o === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
231
- return o;
226
+ return t = z(t), function(r, o) {
227
+ if (o && (typeof o == "object" || typeof o == "function")) return o;
228
+ if (o !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
229
+ return function(a) {
230
+ if (a === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
231
+ return a;
232
232
  }(r);
233
233
  }(e, ae() ? Reflect.construct(t, n || [], z(e).constructor) : t.apply(e, n));
234
234
  }
@@ -240,17 +240,17 @@ function Me(e, t, n) {
240
240
  }
241
241
  function Xe(e, t, n) {
242
242
  return (t = function(r) {
243
- var a = function(o, l) {
244
- if (typeof o != "object" || !o) return o;
245
- var u = o[Symbol.toPrimitive];
243
+ var o = function(a, l) {
244
+ if (typeof a != "object" || !a) return a;
245
+ var u = a[Symbol.toPrimitive];
246
246
  if (u !== void 0) {
247
- var i = u.call(o, l);
247
+ var i = u.call(a, l);
248
248
  if (typeof i != "object") return i;
249
249
  throw new TypeError("@@toPrimitive must return a primitive value.");
250
250
  }
251
- return (l === "string" ? String : Number)(o);
251
+ return (l === "string" ? String : Number)(a);
252
252
  }(r, "string");
253
- return typeof a == "symbol" ? a : a + "";
253
+ return typeof o == "symbol" ? o : o + "";
254
254
  }(t)) in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
255
255
  }
256
256
  function z(e) {
@@ -276,8 +276,8 @@ function de(e, t) {
276
276
  var n = Object.keys(e);
277
277
  if (Object.getOwnPropertySymbols) {
278
278
  var r = Object.getOwnPropertySymbols(e);
279
- t && (r = r.filter(function(a) {
280
- return Object.getOwnPropertyDescriptor(e, a).enumerable;
279
+ t && (r = r.filter(function(o) {
280
+ return Object.getOwnPropertyDescriptor(e, o).enumerable;
281
281
  })), n.push.apply(n, r);
282
282
  }
283
283
  return n;
@@ -295,7 +295,7 @@ function ve(e) {
295
295
  }
296
296
  function tt(e, t) {
297
297
  if (e == null) return {};
298
- var n, r, a = function(l, u) {
298
+ var n, r, o = function(l, u) {
299
299
  if (l == null) return {};
300
300
  var i = {};
301
301
  for (var c in l) if ({}.hasOwnProperty.call(l, c)) {
@@ -305,10 +305,10 @@ function tt(e, t) {
305
305
  return i;
306
306
  }(e, t);
307
307
  if (Object.getOwnPropertySymbols) {
308
- var o = Object.getOwnPropertySymbols(e);
309
- for (r = 0; r < o.length; r++) n = o[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
308
+ var a = Object.getOwnPropertySymbols(e);
309
+ for (r = 0; r < a.length; r++) n = a[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (o[n] = e[n]);
310
310
  }
311
- return a;
311
+ return o;
312
312
  }
313
313
  function H(e, t) {
314
314
  return H = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
@@ -318,11 +318,11 @@ function H(e, t) {
318
318
  function re(e) {
319
319
  var t = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
320
320
  return re = function(n) {
321
- if (n === null || !function(a) {
321
+ if (n === null || !function(o) {
322
322
  try {
323
- return Function.toString.call(a).indexOf("[native code]") !== -1;
323
+ return Function.toString.call(o).indexOf("[native code]") !== -1;
324
324
  } catch {
325
- return typeof a == "function";
325
+ return typeof o == "function";
326
326
  }
327
327
  }(n)) return n;
328
328
  if (typeof n != "function") throw new TypeError("Super expression must either be null or a function");
@@ -331,11 +331,11 @@ function re(e) {
331
331
  t.set(n, r);
332
332
  }
333
333
  function r() {
334
- return function(a, o, l) {
334
+ return function(o, a, l) {
335
335
  if (ae()) return Reflect.construct.apply(null, arguments);
336
336
  var u = [null];
337
- u.push.apply(u, o);
338
- var i = new (a.bind.apply(a, u))();
337
+ u.push.apply(u, a);
338
+ var i = new (o.bind.apply(o, u))();
339
339
  return l && H(i, l.prototype), i;
340
340
  }(n, arguments, z(this).constructor);
341
341
  }
@@ -351,50 +351,50 @@ var $ = function(e) {
351
351
  }(re(Error)), me, nt = ["options"], he = ["text", "email", "tel", "search", "url"], Ee = Me(function e(t) {
352
352
  var n = t.init, r = t.tracking;
353
353
  Pe(this, e);
354
- var a = /* @__PURE__ */ new WeakMap();
355
- this.register = function(o) {
354
+ var o = /* @__PURE__ */ new WeakMap();
355
+ this.register = function(a) {
356
356
  var l;
357
- if (he.includes(o.type)) {
358
- var u = (l = o._wrapperState) !== null && l !== void 0 ? l : {}, i = u.initialValue, c = i === void 0 ? "" : i, p = u.controlled, s = p !== void 0 && p, O = n({ initialValue: o.value || c, controlled: s }), P = O.value, E = O.options, v = { value: P, options: E, fallbackOptions: E }, d = { id: -1, cachedId: -1 }, f = { value: "", selectionStart: 0, selectionEnd: 0 }, g = Object.getOwnPropertyDescriptor("_valueTracker" in o ? o : HTMLInputElement.prototype, "value");
359
- Object.defineProperty(o, "value", ve(ve({}, g), {}, { set: function(h) {
360
- var y;
361
- f.value = h, g == null || (y = g.set) === null || y === void 0 || y.call(o, h);
362
- } })), o.value = P;
363
- var b = function() {
364
- var h = function() {
365
- var y, S;
366
- f.selectionStart = (y = o.selectionStart) !== null && y !== void 0 ? y : 0, f.selectionEnd = (S = o.selectionEnd) !== null && S !== void 0 ? S : 0, d.id = window.setTimeout(h);
357
+ if (he.includes(a.type)) {
358
+ var u = (l = a._wrapperState) !== null && l !== void 0 ? l : {}, i = u.initialValue, c = i === void 0 ? "" : i, p = u.controlled, f = p !== void 0 && p, b = n({ initialValue: a.value || c, controlled: f }), M = b.value, j = b.options, h = { value: M, options: j, fallbackOptions: j }, v = { id: -1, cachedId: -1 }, s = { value: "", selectionStart: 0, selectionEnd: 0 }, O = Object.getOwnPropertyDescriptor("_valueTracker" in a ? a : HTMLInputElement.prototype, "value");
359
+ Object.defineProperty(a, "value", ve(ve({}, O), {}, { set: function(y) {
360
+ var m;
361
+ s.value = y, O == null || (m = O.set) === null || m === void 0 || m.call(a, y);
362
+ } })), a.value = M;
363
+ var S = function() {
364
+ var y = function() {
365
+ var m, k;
366
+ s.selectionStart = (m = a.selectionStart) !== null && m !== void 0 ? m : 0, s.selectionEnd = (k = a.selectionEnd) !== null && k !== void 0 ? k : 0, v.id = window.setTimeout(y);
367
367
  };
368
- d.id = window.setTimeout(h);
369
- }, k = function() {
370
- window.clearTimeout(d.id), d.id = -1, d.cachedId = -1;
371
- }, m = function(h) {
368
+ v.id = window.setTimeout(y);
369
+ }, w = function() {
370
+ window.clearTimeout(v.id), v.id = -1, v.cachedId = -1;
371
+ }, d = function(y) {
372
372
  try {
373
- var y, S;
374
- if (d.cachedId === d.id) throw new $("The input selection has not been updated.");
375
- d.cachedId = d.id;
376
- var w = o.value, M = o.selectionStart, C = o.selectionEnd;
377
- if (M === null || C === null) throw new $("The selection attributes have not been initialized.");
378
- var j, T = f.value;
379
- if (h.inputType === void 0 && (f.selectionStart = 0, f.selectionEnd = T.length), M > f.selectionStart ? j = "insert" : M <= f.selectionStart && M < f.selectionEnd ? j = "deleteBackward" : M === f.selectionEnd && w.length < T.length && (j = "deleteForward"), j === void 0 || (j === "deleteBackward" || j === "deleteForward") && w.length > T.length) throw new $("Input type detection error.");
380
- var I = "", N = f.selectionStart, B = f.selectionEnd;
381
- if (j === "insert") I = w.slice(f.selectionStart, M);
373
+ var m, k;
374
+ if (v.cachedId === v.id) throw new $("The input selection has not been updated.");
375
+ v.cachedId = v.id;
376
+ var P = a.value, g = a.selectionStart, T = a.selectionEnd;
377
+ if (g === null || T === null) throw new $("The selection attributes have not been initialized.");
378
+ var C, E = s.value;
379
+ if (y.inputType === void 0 && (s.selectionStart = 0, s.selectionEnd = E.length), g > s.selectionStart ? C = "insert" : g <= s.selectionStart && g < s.selectionEnd ? C = "deleteBackward" : g === s.selectionEnd && P.length < E.length && (C = "deleteForward"), C === void 0 || (C === "deleteBackward" || C === "deleteForward") && P.length > E.length) throw new $("Input type detection error.");
380
+ var I = "", N = s.selectionStart, B = s.selectionEnd;
381
+ if (C === "insert") I = P.slice(s.selectionStart, g);
382
382
  else {
383
- var D = T.length - w.length;
384
- N = M, B = M + D;
383
+ var D = E.length - P.length;
384
+ N = g, B = g + D;
385
385
  }
386
- v.value !== T ? v.options = v.fallbackOptions : v.fallbackOptions = v.options;
387
- var F = v.options, R = r({ inputType: j, previousValue: T, previousOptions: F, value: w, addedValue: I, changeStart: N, changeEnd: B, selectionStart: M, selectionEnd: C }), _ = R.options, A = tt(R, nt);
388
- o.value = A.value, o.setSelectionRange(A.selectionStart, A.selectionEnd), v.value = A.value, v.options = _, f.selectionStart = A.selectionStart, f.selectionEnd = A.selectionEnd, (y = o._valueTracker) === null || y === void 0 || (S = y.setValue) === null || S === void 0 || S.call(y, T);
386
+ h.value !== E ? h.options = h.fallbackOptions : h.fallbackOptions = h.options;
387
+ var F = h.options, R = r({ inputType: C, previousValue: E, previousOptions: F, value: P, addedValue: I, changeStart: N, changeEnd: B, selectionStart: g, selectionEnd: T }), _ = R.options, A = tt(R, nt);
388
+ a.value = A.value, a.setSelectionRange(A.selectionStart, A.selectionEnd), h.value = A.value, h.options = _, s.selectionStart = A.selectionStart, s.selectionEnd = A.selectionEnd, (m = a._valueTracker) === null || m === void 0 || (k = m.setValue) === null || k === void 0 || k.call(m, E);
389
389
  } catch (W) {
390
- if (o.value = f.value, o.setSelectionRange(f.selectionStart, f.selectionEnd), h.preventDefault(), h.stopPropagation(), W.name !== "SyntheticChangeError") throw W;
390
+ if (a.value = s.value, a.setSelectionRange(s.selectionStart, s.selectionEnd), y.preventDefault(), y.stopPropagation(), W.name !== "SyntheticChangeError") throw W;
391
391
  }
392
392
  };
393
- document.activeElement === o && b(), o.addEventListener("focus", b), o.addEventListener("blur", k), o.addEventListener("input", m), a.set(o, { onFocus: b, onBlur: k, onInput: m });
393
+ document.activeElement === a && S(), a.addEventListener("focus", S), a.addEventListener("blur", w), a.addEventListener("input", d), o.set(a, { onFocus: S, onBlur: w, onInput: d });
394
394
  } else process.env.NODE_ENV !== "production" && console.warn("Warn: The input element type does not match one of the types: ".concat(he.join(", "), "."));
395
- }, this.unregister = function(o) {
396
- var l = a.get(o);
397
- l !== void 0 && (o.removeEventListener("focus", l.onFocus), o.removeEventListener("blur", l.onBlur), o.removeEventListener("input", l.onInput), a.delete(o));
395
+ }, this.unregister = function(a) {
396
+ var l = o.get(a);
397
+ l !== void 0 && (a.removeEventListener("focus", l.onFocus), a.removeEventListener("blur", l.onBlur), a.removeEventListener("input", l.onInput), o.delete(a));
398
398
  };
399
399
  });
400
400
  me = Ee, Object.defineProperty(me.prototype, Symbol.toStringTag, { writable: !1, enumerable: !1, configurable: !0, value: "Input" });
@@ -408,44 +408,44 @@ var X = function(e) {
408
408
  };
409
409
  }, ye, rt = ["track", "modify"];
410
410
  function x(e) {
411
- var t, n, r, a;
412
- return { mask: (t = e.mask) !== null && t !== void 0 ? t : "", replacement: typeof e.replacement == "string" ? K(e.replacement) : (n = e.replacement) !== null && n !== void 0 ? n : {}, showMask: (r = e.showMask) !== null && r !== void 0 && r, separate: (a = e.separate) !== null && a !== void 0 && a, track: e.track, modify: e.modify };
411
+ var t, n, r, o;
412
+ return { mask: (t = e.mask) !== null && t !== void 0 ? t : "", replacement: typeof e.replacement == "string" ? K(e.replacement) : (n = e.replacement) !== null && n !== void 0 ? n : {}, showMask: (r = e.showMask) !== null && r !== void 0 && r, separate: (o = e.separate) !== null && o !== void 0 && o, track: e.track, modify: e.modify };
413
413
  }
414
414
  var Ce = function(e) {
415
415
  function t() {
416
416
  var n, r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
417
- return $e(this, t), (n = Ue(this, t, [{ init: function(a) {
418
- var o = a.initialValue, l = a.controlled, u = x(r), i = u.mask, c = u.replacement, p = u.separate, s = u.showMask;
419
- return o = l || o ? o : s ? i : "", process.env.NODE_ENV !== "production" && function(O) {
420
- var P = O.initialValue, E = O.mask, v = O.replacement;
421
- P.length > E.length && console.error(X(Error)("The initialized value of the `value` or `defaultValue` property is longer than the value specified in the `mask` property. Check the correctness of the initialized value in the specified property.", 'Invalid value: "'.concat(P, '".'), "To initialize an unmasked value, use the `format` utility. More details https://github.com/GoncharukOrg/react-input/tree/main/packages/mask#initializing-the-value."));
422
- var d = Object.keys(v).filter(function(m) {
423
- return m.length > 1;
417
+ return $e(this, t), (n = Ue(this, t, [{ init: function(o) {
418
+ var a = o.initialValue, l = o.controlled, u = x(r), i = u.mask, c = u.replacement, p = u.separate, f = u.showMask;
419
+ return a = l || a ? a : f ? i : "", process.env.NODE_ENV !== "production" && function(b) {
420
+ var M = b.initialValue, j = b.mask, h = b.replacement;
421
+ M.length > j.length && console.error(X(Error)("The initialized value of the `value` or `defaultValue` property is longer than the value specified in the `mask` property. Check the correctness of the initialized value in the specified property.", 'Invalid value: "'.concat(M, '".'), "To initialize an unmasked value, use the `format` utility. More details https://github.com/GoncharukOrg/react-input/tree/main/packages/mask#initializing-the-value."));
422
+ var v = Object.keys(h).filter(function(d) {
423
+ return d.length > 1;
424
424
  });
425
- d.length > 0 && console.error(X(Error)("Object keys in the `replacement` property are longer than one character. Replacement keys must be one character long. Check the correctness of the value in the specified property.", "Invalid keys: ".concat(d.join(", "), "."), "To initialize an unmasked value, use the `format` utility. More details https://github.com/GoncharukOrg/react-input/tree/main/packages/mask#initializing-the-value."));
426
- for (var f = E.slice(0, P.length), g = -1, b = 0; b < f.length; b++) {
427
- var k = Object.prototype.hasOwnProperty.call(v, f[b]);
428
- if (!(f[b] === P[b] || k && v[f[b]].test(P[b]))) {
429
- g = b;
425
+ v.length > 0 && console.error(X(Error)("Object keys in the `replacement` property are longer than one character. Replacement keys must be one character long. Check the correctness of the value in the specified property.", "Invalid keys: ".concat(v.join(", "), "."), "To initialize an unmasked value, use the `format` utility. More details https://github.com/GoncharukOrg/react-input/tree/main/packages/mask#initializing-the-value."));
426
+ for (var s = j.slice(0, M.length), O = -1, S = 0; S < s.length; S++) {
427
+ var w = Object.prototype.hasOwnProperty.call(h, s[S]);
428
+ if (!(s[S] === M[S] || w && h[s[S]].test(M[S]))) {
429
+ O = S;
430
430
  break;
431
431
  }
432
432
  }
433
- g !== -1 && console.error(X(Error)("An invalid character was found in the initialized property value `value` or `defaultValue` (index: ".concat(g, "). Check the correctness of the initialized value in the specified property."), 'Invalid value: "'.concat(P, '".'), "To initialize an unmasked value, use the `format` utility. More details https://github.com/GoncharukOrg/react-input/tree/main/packages/mask#initializing-the-value."));
434
- }({ initialValue: o, mask: i, replacement: c }), { value: o, options: { mask: i, replacement: c, separate: p } };
435
- }, tracking: function(a) {
436
- var o = a.inputType, l = a.previousValue, u = a.previousOptions, i = a.addedValue, c = a.changeStart, p = a.changeEnd, s = x(r), O = s.track, P = s.modify, E = _e(s, rt), v = E.mask, d = E.replacement, f = E.showMask, g = E.separate, b = J(J({}, o === "insert" ? { inputType: o, data: i } : { inputType: o, data: null }), {}, { value: l, selectionStart: c, selectionEnd: p }), k = O?.(b);
437
- if (k === !1) throw new $("Custom tracking stop.");
438
- k === null ? i = "" : k !== !0 && k !== void 0 && (i = k);
439
- var m = P?.(b);
440
- m?.mask !== void 0 && (v = m.mask), m?.replacement !== void 0 && (d = typeof m?.replacement == "string" ? K(m?.replacement) : m.replacement), m?.showMask !== void 0 && (f = m.showMask), m?.separate !== void 0 && (g = m.separate);
441
- var h = ne(l, J({ end: c }, u)), y = ne(l, J({ start: p }, u)), S = RegExp("[^".concat(Object.keys(d).join(""), "]"), "g"), w = v.replace(S, "");
442
- if (h && (h = U(h, { replacementChars: w, replacement: d, separate: g }), w = w.slice(h.length)), i && (i = U(i, { replacementChars: w, replacement: d, separate: !1 }), w = w.slice(i.length)), o === "insert" && i === "") throw new $("The character does not match the key value of the `replacement` object.");
443
- if (g) {
444
- var M = v.slice(c, p).replace(S, ""), C = M.length - i.length;
445
- C < 0 ? y = y.slice(-C) : C > 0 && (y = M.slice(-C) + y);
433
+ O !== -1 && console.error(X(Error)("An invalid character was found in the initialized property value `value` or `defaultValue` (index: ".concat(O, "). Check the correctness of the initialized value in the specified property."), 'Invalid value: "'.concat(M, '".'), "To initialize an unmasked value, use the `format` utility. More details https://github.com/GoncharukOrg/react-input/tree/main/packages/mask#initializing-the-value."));
434
+ }({ initialValue: a, mask: i, replacement: c }), { value: a, options: { mask: i, replacement: c, separate: p } };
435
+ }, tracking: function(o) {
436
+ var a = o.inputType, l = o.previousValue, u = o.previousOptions, i = o.addedValue, c = o.changeStart, p = o.changeEnd, f = x(r), b = f.track, M = f.modify, j = _e(f, rt), h = j.mask, v = j.replacement, s = j.showMask, O = j.separate, S = J(J({}, a === "insert" ? { inputType: a, data: i } : { inputType: a, data: null }), {}, { value: l, selectionStart: c, selectionEnd: p }), w = b?.(S);
437
+ if (w === !1) throw new $("Custom tracking stop.");
438
+ w === null ? i = "" : w !== !0 && w !== void 0 && (i = w);
439
+ var d = M?.(S);
440
+ d?.mask !== void 0 && (h = d.mask), d?.replacement !== void 0 && (v = typeof d?.replacement == "string" ? K(d?.replacement) : d.replacement), d?.showMask !== void 0 && (s = d.showMask), d?.separate !== void 0 && (O = d.separate);
441
+ var y = ne(l, J({ end: c }, u)), m = ne(l, J({ start: p }, u)), k = RegExp("[^".concat(Object.keys(v).join(""), "]"), "g"), P = h.replace(k, "");
442
+ if (y && (y = U(y, { replacementChars: P, replacement: v, separate: O }), P = P.slice(y.length)), i && (i = U(i, { replacementChars: P, replacement: v, separate: !1 }), P = P.slice(i.length)), a === "insert" && i === "") throw new $("The character does not match the key value of the `replacement` object.");
443
+ if (O) {
444
+ var g = h.slice(c, p).replace(k, ""), T = g.length - i.length;
445
+ T < 0 ? m = m.slice(-T) : T > 0 && (m = g.slice(-T) + m);
446
446
  }
447
- y && (y = U(y, { replacementChars: w, replacement: d, separate: g }));
448
- var j = Se(h + i + y, { mask: v, replacement: d, separate: g, showMask: f }), T = function(I) {
447
+ m && (m = U(m, { replacementChars: P, replacement: v, separate: O }));
448
+ var C = Se(y + i + m, { mask: h, replacement: v, separate: O, showMask: s }), E = function(I) {
449
449
  var N, B, D, F = I.inputType, R = I.value, _ = I.addedValue, A = I.beforeChangeValue, W = I.mask, oe = I.replacement, je = I.separate, Q = we(R, { mask: W, replacement: oe }).filter(function(q) {
450
450
  var ue = q.type;
451
451
  return ue === "input" || je && ue === "replacement";
@@ -467,24 +467,24 @@ var Ce = function(e) {
467
467
  return Object.prototype.hasOwnProperty.call(oe, q);
468
468
  });
469
469
  return le !== -1 ? le : R.length;
470
- }({ inputType: o, value: j, addedValue: i, beforeChangeValue: h, mask: v, replacement: d, separate: g });
471
- return { value: j, selectionStart: T, selectionEnd: T, options: { mask: v, replacement: d, separate: g } };
472
- } }])).format = function(a) {
473
- return ke(a, x(r));
474
- }, n.formatToParts = function(a) {
475
- return Ze(a, x(r));
476
- }, n.unformat = function(a) {
477
- return We(a, x(r));
478
- }, n.generatePattern = function(a) {
479
- return Ye(a, x(r));
470
+ }({ inputType: a, value: C, addedValue: i, beforeChangeValue: y, mask: h, replacement: v, separate: O });
471
+ return { value: C, selectionStart: E, selectionEnd: E, options: { mask: h, replacement: v, separate: O } };
472
+ } }])).format = function(o) {
473
+ return ke(o, x(r));
474
+ }, n.formatToParts = function(o) {
475
+ return Ze(o, x(r));
476
+ }, n.unformat = function(o) {
477
+ return We(o, x(r));
478
+ }, n.generatePattern = function(o) {
479
+ return Ye(o, x(r));
480
480
  }, n;
481
481
  }
482
482
  return He(t, Ee), ze(t);
483
483
  }();
484
484
  ye = Ce, Object.defineProperty(ye.prototype, Symbol.toStringTag, { writable: !1, enumerable: !1, configurable: !0, value: "Mask" });
485
485
  function at() {
486
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = e.mask, n = e.replacement, r = e.showMask, a = e.separate, o = e.track, l = e.modify, u = ee(null), i = ee({ mask: t, replacement: n, showMask: r, separate: a, track: o, modify: l });
487
- return i.current.mask = t, i.current.replacement = n, i.current.showMask = r, i.current.separate = a, i.current.track = o, i.current.modify = l, Ie(function() {
486
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = e.mask, n = e.replacement, r = e.showMask, o = e.separate, a = e.track, l = e.modify, u = ee(null), i = ee({ mask: t, replacement: n, showMask: r, separate: o, track: a, modify: l });
487
+ return i.current.mask = t, i.current.replacement = n, i.current.showMask = r, i.current.separate = o, i.current.track = a, i.current.modify = l, Ie(function() {
488
488
  return Qe(u, new Ce(i.current));
489
489
  }, []);
490
490
  }
@@ -496,79 +496,81 @@ Te.registerLocale(lt);
496
496
  const gt = Ae(
497
497
  ({
498
498
  disabled: e = !1,
499
- isRequired: t,
500
- label: n,
501
- labelClassName: r,
502
- name: a,
503
- showFlagOnSearch: o = !0,
504
- showInputFilter: l = !0,
505
- showNameOnSearch: u = !0,
506
- wrapperClassName: i,
507
- helperText: c,
508
- helperTextClassName: p,
509
- error: s,
510
- ...O
511
- }, P) => {
512
- const E = a ?? Ne(), v = ee(null), {
513
- isOpenSelector: d,
514
- value: f,
515
- selectedCountry: g,
516
- onChangeValue: b,
517
- handleOpenSelector: k
518
- } = xe(), m = typeof s == "string" && s.length >= 0, h = at({
519
- mask: Ke(g),
499
+ error: t,
500
+ helperText: n,
501
+ helperTextClassName: r,
502
+ isRequired: o,
503
+ label: a,
504
+ labelClassName: l,
505
+ name: u,
506
+ placeholder: i,
507
+ showFlagOnSearch: c = !0,
508
+ showInputFilter: p = !0,
509
+ showNameOnSearch: f = !0,
510
+ wrapperClassName: b,
511
+ showPlaceHolder: M,
512
+ ...j
513
+ }, h) => {
514
+ const v = u ?? Ne(), s = ee(null), {
515
+ isOpenSelector: O,
516
+ value: S,
517
+ selectedCountry: w,
518
+ onChangeValue: d,
519
+ handleOpenSelector: y
520
+ } = xe(), m = typeof t == "string" && t.length >= 0, k = at({
521
+ mask: Ke(w),
520
522
  replacement: { _: /\d/ }
521
523
  });
522
- Be(P, () => h.current, [h]);
523
- const y = Re(
524
- (S) => {
525
- S.target.value.startsWith(g.prefix) ? b(S.target.value) : b(`${g.prefix} `);
524
+ Be(h, () => k.current, [k]);
525
+ const P = Re(
526
+ (g) => {
527
+ g.target.value.startsWith(w.prefix) ? d(g.target.value) : d(`${w.prefix} `);
526
528
  },
527
- [g.prefix, b]
529
+ [w.prefix, d]
528
530
  );
529
531
  return ce(() => {
530
- const S = new AbortController(), w = (C) => {
531
- C.key === "Escape" && k(!1);
532
- }, M = (C) => {
533
- v.current?.contains(C.target) || k(!1);
532
+ const g = new AbortController(), T = (E) => {
533
+ E.key === "Escape" && y(!1);
534
+ }, C = (E) => {
535
+ s.current?.contains(E.target) || y(!1);
534
536
  };
535
- return document.addEventListener("keydown", w, {
536
- signal: S.signal
537
- }), document.addEventListener("mousedown", M, {
538
- signal: S.signal
537
+ return document.addEventListener("keydown", T, {
538
+ signal: g.signal
539
+ }), document.addEventListener("mousedown", C, {
540
+ signal: g.signal
539
541
  }), document.addEventListener(
540
542
  "visibilitychange",
541
543
  () => {
542
- document.hidden && k(!1);
544
+ document.hidden && y(!1);
543
545
  },
544
546
  {
545
- signal: S.signal
547
+ signal: g.signal
546
548
  }
547
549
  ), () => {
548
- S.abort();
550
+ g.abort();
549
551
  };
550
- }, [k, v]), ce(() => {
551
- h.current && (h.current.value = g.prefix + " ");
552
- }, [g.code]), /* @__PURE__ */ Z("div", { className: "w-full flex flex-col gap-2", children: [
553
- n ? /* @__PURE__ */ Z(
552
+ }, [y, s]), ce(() => {
553
+ k.current && (k.current.value = w.prefix + " ");
554
+ }, [w.code]), /* @__PURE__ */ Z("div", { className: "w-full flex flex-col gap-2", children: [
555
+ a ? /* @__PURE__ */ Z(
554
556
  "label",
555
557
  {
556
- id: E,
557
- className: Le({ className: r }),
558
- onClick: () => !e && h.current?.focus(),
558
+ id: v,
559
+ className: Le({ className: l }),
560
+ onClick: () => !e && k.current?.focus(),
559
561
  children: [
560
- n,
561
- t && /* @__PURE__ */ V("span", { className: "text-red-600 ml-1", children: "*" })
562
+ a,
563
+ o && /* @__PURE__ */ V("span", { className: "text-red-600 ml-1", children: "*" })
562
564
  ]
563
565
  }
564
566
  ) : null,
565
567
  /* @__PURE__ */ Z(
566
568
  "div",
567
569
  {
568
- ref: v,
569
- "data-state": d ? "open" : "closed",
570
+ ref: s,
571
+ "data-state": O ? "open" : "closed",
570
572
  className: Ve({
571
- className: i,
573
+ className: b,
572
574
  variant: m ? "error" : "default"
573
575
  }),
574
576
  children: [
@@ -577,40 +579,42 @@ const gt = Ae(
577
579
  /* @__PURE__ */ V(
578
580
  "input",
579
581
  {
580
- id: n ? E : void 0,
581
- ref: h,
582
- name: a,
582
+ id: a ? v : void 0,
583
+ ref: k,
584
+ name: u,
583
585
  autoComplete: "off",
584
586
  className: "outline-0 w-full caret-slate-800 text-slate-800 bg-transparent dark:caret-slate-50 dark:text-slate-50 disabled:cursor-not-allowed disabled:opacity-50",
585
587
  type: "tel",
586
588
  inputMode: "tel",
587
- value: f,
588
- onChange: y,
589
+ value: S,
590
+ onChange: P,
589
591
  disabled: e,
590
- ...O
592
+ ...j
591
593
  }
592
594
  )
593
595
  ] }),
594
- d && /* @__PURE__ */ V(
596
+ O && /* @__PURE__ */ V(
595
597
  Fe,
596
598
  {
597
- showNameOnSearch: u,
598
- showFlagOnSearch: o,
599
- showInputFilter: l
599
+ placeholder: i,
600
+ showFlagOnSearch: c,
601
+ showInputFilter: p,
602
+ showNameOnSearch: f,
603
+ showPlaceHolder: M
600
604
  }
601
605
  )
602
606
  ]
603
607
  }
604
608
  ),
605
- s ? /* @__PURE__ */ V("span", { className: "text-xs text-red-700 dark:text-red-500", children: s }) : null,
606
- !s && c ? /* @__PURE__ */ V(
609
+ t ? /* @__PURE__ */ V("span", { className: "text-xs text-red-700 dark:text-red-500", children: t }) : null,
610
+ !t && n ? /* @__PURE__ */ V(
607
611
  "span",
608
612
  {
609
613
  className: Ge(
610
614
  "text-xs text-slate-600 dark:text-slate-200 kubefirst-dark:text-slate-200",
611
- p
615
+ r
612
616
  ),
613
- children: c
617
+ children: n
614
618
  }
615
619
  ) : null
616
620
  ] });
@@ -13,7 +13,7 @@ import { DropdownButton as h } from "./DropdownButton/DropdownButton.js";
13
13
  import { Filter as P } from "./Filter/Filter.js";
14
14
  import { Input as w } from "./Input/Input.js";
15
15
  import { Loading as k } from "./Loading/Loading.js";
16
- import { M as G } from "../Modal-Dpk-1N9W.js";
16
+ import { M as G } from "../Modal-5xSxFoaD.js";
17
17
  import { NumberInput as L } from "./NumberInput/NumberInput.js";
18
18
  import { PhoneNumberInput as y } from "./PhoneNumberInput/PhoneNumberInput.js";
19
19
  import { PieChart as O } from "./PieChart/PieChart.js";
package/dist/index.d.ts CHANGED
@@ -365,6 +365,7 @@ declare interface ModalProps extends PropsWithChildren, VariantProps<typeof moda
365
365
  className?: string;
366
366
  container?: Element | DocumentFragment;
367
367
  isOpen?: boolean;
368
+ showCloseButton?: boolean;
368
369
  theme?: Theme;
369
370
  onClose?: () => void;
370
371
  }
@@ -519,19 +520,21 @@ declare type Props = {
519
520
  };
520
521
 
521
522
  declare type Props_2 = InputHTMLAttributes<HTMLInputElement> & {
522
- name?: string;
523
- label?: string;
524
- isRequired?: boolean;
525
- wrapperClassName?: string;
526
523
  defaultCountryCode?: RegionCode;
527
- showNameOnSearch?: boolean;
528
- showFlagOnSearch?: boolean;
529
- showInputFilter?: boolean;
530
524
  disabled?: boolean;
531
- labelClassName?: string;
525
+ error?: string;
532
526
  helperText?: string;
533
527
  helperTextClassName?: string;
534
- error?: string;
528
+ isRequired?: boolean;
529
+ label?: string;
530
+ labelClassName?: string;
531
+ name?: string;
532
+ placeholder?: string;
533
+ showFlagOnSearch?: boolean;
534
+ showInputFilter?: boolean;
535
+ showNameOnSearch?: boolean;
536
+ showPlaceHolder?: boolean;
537
+ wrapperClassName?: string;
535
538
  };
536
539
 
537
540
  /**
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ import { BadgeMultiSelect as k } from "./components/Filter/components/BadgeDropd
16
16
  import { DateFilterDropdown as G } from "./components/Filter/components/DateFilterDropdown/DateFilterDropdown.js";
17
17
  import { Input as L } from "./components/Input/Input.js";
18
18
  import { Loading as y } from "./components/Loading/Loading.js";
19
- import { M as O } from "./Modal-Dpk-1N9W.js";
19
+ import { M as O } from "./Modal-5xSxFoaD.js";
20
20
  import { NumberInput as j } from "./components/NumberInput/NumberInput.js";
21
21
  import { PhoneNumberInput as E } from "./components/PhoneNumberInput/PhoneNumberInput.js";
22
22
  import { PieChart as J } from "./components/PieChart/PieChart.js";
package/dist/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@konstructio/ui",
3
3
  "description": "A set of reusable and customizable React components built for konstruct.io",
4
4
  "private": false,
5
- "version": "0.1.2-alpha.28",
5
+ "version": "0.1.2-alpha.29",
6
6
  "type": "module",
7
7
  "license": "MIT",
8
8
  "main": "dist/index.js",
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@konstructio/ui",
3
3
  "description": "A set of reusable and customizable React components built for konstruct.io",
4
4
  "private": false,
5
- "version": "0.1.2-alpha.29",
5
+ "version": "0.1.2-alpha.30",
6
6
  "type": "module",
7
7
  "license": "MIT",
8
8
  "main": "dist/index.js",
@@ -1,98 +0,0 @@
1
- import { Body as b } from "./components/Modal/components/Body/Body.js";
2
- import { Footer as g } from "./components/Modal/components/Footer/Footer.js";
3
- import { Header as v } from "./components/Modal/components/Header/Header.js";
4
- import { jsx as n, jsxs as f } from "react/jsx-runtime";
5
- import { Children as i, isValidElement as s, useEffect as w } from "react";
6
- import { createPortal as A } from "react-dom";
7
- import { R as N } from "./index-DrWQH0QF.js";
8
- import { R } from "./Combination-VYaRRJBZ.js";
9
- import { cn as p } from "./utils/index.js";
10
- import { buttonCloseVariants as k, modalVariants as x } from "./components/Modal/components/Wrapper/Wrapper.variants.js";
11
- import { X as B } from "./x-DPU9OdYH.js";
12
- const E = ({
13
- children: e,
14
- theme: t,
15
- className: m,
16
- buttonCloseClassName: d,
17
- onClose: a
18
- }) => {
19
- const l = i.toArray(e).find(
20
- (o) => s(o) && o.type === r.Header
21
- ), c = i.toArray(e).find(
22
- (o) => s(o) && o.type === r.Body
23
- ), y = i.toArray(e).find(
24
- (o) => s(o) && o.type === r.Footer
25
- ), u = i.toArray(e).filter(
26
- (o) => !s(o) || ![r.Header, r.Body, r.Footer].includes(
27
- o.type
28
- )
29
- );
30
- return /* @__PURE__ */ n(R, { children: /* @__PURE__ */ f(
31
- "div",
32
- {
33
- className: "fixed inset-0 grid place-content-center",
34
- "data-theme": t,
35
- children: [
36
- /* @__PURE__ */ n(
37
- "div",
38
- {
39
- className: "absolute inset-0 bg-black opacity-75 animate-in fade-in-0",
40
- onClick: a,
41
- role: "presentation"
42
- }
43
- ),
44
- /* @__PURE__ */ f(
45
- "div",
46
- {
47
- className: p(
48
- x({
49
- className: m
50
- })
51
- ),
52
- role: "dialog",
53
- "aria-modal": "true",
54
- children: [
55
- l,
56
- /* @__PURE__ */ f(
57
- "button",
58
- {
59
- className: p(
60
- k({
61
- className: d
62
- })
63
- ),
64
- onClick: a,
65
- children: [
66
- /* @__PURE__ */ n(B, {}),
67
- /* @__PURE__ */ n(N, { children: "Dismiss modal" })
68
- ]
69
- }
70
- ),
71
- c ?? u,
72
- y
73
- ]
74
- }
75
- )
76
- ]
77
- }
78
- ) });
79
- }, r = ({ isOpen: e, onClose: t, container: m, ...d }) => (w(() => {
80
- const a = new AbortController(), l = (c) => {
81
- c.code === "Escape" && t?.();
82
- };
83
- return window.addEventListener("keydown", l, {
84
- signal: a.signal
85
- }), () => {
86
- a.abort();
87
- };
88
- }, [t]), e ? A(
89
- /* @__PURE__ */ n(E, { ...d, onClose: t }),
90
- m || document.body
91
- ) : null);
92
- r.Header = v;
93
- r.Body = b;
94
- r.Footer = g;
95
- export {
96
- r as M,
97
- E as W
98
- };