@konstructio/ui 0.1.2-alpha.44 → 0.1.2-alpha.46

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.
Files changed (59) hide show
  1. package/dist/components/AlertDialog/AlertDialog.js +39 -37
  2. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
  3. package/dist/components/AlertDialog/components/index.js +1 -1
  4. package/dist/components/Badge/Badge.js +23 -26
  5. package/dist/components/Badge/Badge.variants.js +1 -1
  6. package/dist/components/Button/Button.variants.js +108 -98
  7. package/dist/components/Checkbox/Checkbox.js +104 -100
  8. package/dist/components/Checkbox/Checkbox.variants.js +30 -7
  9. package/dist/components/Filter/Filter.js +1 -1
  10. package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +9 -10
  11. package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +76 -43
  12. package/dist/components/Filter/components/ResetButton/ResetButton.js +21 -32
  13. package/dist/components/Filter/events/index.js +3 -3
  14. package/dist/components/ImageUpload/ImageUpload.js +221 -0
  15. package/dist/components/ImageUpload/ImageUpload.variants.js +109 -0
  16. package/dist/components/Input/Input.variants.js +10 -2
  17. package/dist/components/PhoneNumberInput/PhoneNumberInput.variants.js +4 -4
  18. package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +16 -7
  19. package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +92 -74
  20. package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +53 -29
  21. package/dist/components/PhoneNumberInput/components/Wrapper.js +139 -120
  22. package/dist/components/Select/Select.js +48 -0
  23. package/dist/components/{Dropdown/Dropdown.variants.js → Select/Select.variants.js} +3 -3
  24. package/dist/components/{Dropdown → Select}/components/List/List.js +48 -43
  25. package/dist/components/{Dropdown → Select}/components/List/List.variants.js +8 -5
  26. package/dist/components/{Dropdown → Select}/components/ListItem/ListItem.js +20 -20
  27. package/dist/components/{Dropdown → Select}/components/ListItem/ListItem.variants.js +3 -2
  28. package/dist/components/{Dropdown → Select}/components/Wrapper.js +70 -70
  29. package/dist/components/Select/contexts/index.js +6 -0
  30. package/dist/components/{Dropdown/contexts/dropdown.context.js → Select/contexts/select.context.js} +2 -2
  31. package/dist/components/Select/contexts/select.hook.js +11 -0
  32. package/dist/components/Select/contexts/select.provider.js +58 -0
  33. package/dist/components/{Dropdown → Select}/hooks/useNavigationList.js +3 -3
  34. package/dist/components/{Dropdown/hooks/useDropdown.js → Select/hooks/useSelect.js} +33 -33
  35. package/dist/components/Switch/Switch.js +153 -125
  36. package/dist/components/Switch/Switch.variants.js +15 -6
  37. package/dist/components/Typography/Typography.js +25 -27
  38. package/dist/components/Typography/Typography.variants.js +2 -2
  39. package/dist/components/VirtualizedTable/components/Actions/Actions.js +14 -14
  40. package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +10 -10
  41. package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +1 -1
  42. package/dist/components/index.js +77 -74
  43. package/dist/{index-CPU02rhe.js → index-D6KzX_ef.js} +13 -12
  44. package/dist/index.d.ts +106 -60
  45. package/dist/index.js +109 -106
  46. package/dist/package.json +4 -4
  47. package/dist/styles.css +1 -1
  48. package/dist/ui/civo-theme.css +6 -5
  49. package/dist/ui/theme.css +27 -0
  50. package/dist/x-BXShoIAM.js +8 -0
  51. package/package.json +4 -4
  52. package/dist/components/Dropdown/Dropdown.js +0 -48
  53. package/dist/components/Dropdown/contexts/dropdown.hook.js +0 -13
  54. package/dist/components/Dropdown/contexts/dropdown.provider.js +0 -58
  55. package/dist/components/Dropdown/contexts/index.js +0 -6
  56. /package/dist/components/{Dropdown → Select}/components/EmptyList.js +0 -0
  57. /package/dist/components/{Dropdown → Select}/components/index.js +0 -0
  58. /package/dist/components/{Dropdown → Select}/constants/index.js +0 -0
  59. /package/dist/components/{Dropdown → Select}/constants/pagination.js +0 -0
@@ -1,11 +1,12 @@
1
- import { jsx as g, jsxs as _ } from "react/jsx-runtime";
1
+ import { jsx as g, jsxs as R } from "react/jsx-runtime";
2
2
  import * as S from "react";
3
- import { useRef as R, useMemo as T, useEffect as k } from "react";
4
- import { flushSync as D } from "react-dom";
3
+ import { useRef as T, useMemo as k, useEffect as D } from "react";
4
+ import { flushSync as W } from "react-dom";
5
5
  import { Typography as O } from "../../../Typography/Typography.js";
6
- import { TruncateText as W } from "../TruncateText/TruncateText.js";
7
- import { usePhoneNumberContext as L } from "../../contexts/phone-number.hook.js";
8
- function y(r, l, e) {
6
+ import { cn as z } from "../../../../utils/index.js";
7
+ import { TruncateText as L } from "../TruncateText/TruncateText.js";
8
+ import { usePhoneNumberContext as V } from "../../contexts/phone-number.hook.js";
9
+ function x(r, l, e) {
9
10
  let s = e.initialDeps ?? [], t, o = !0;
10
11
  function n() {
11
12
  var i, a, u;
@@ -17,7 +18,7 @@ function y(r, l, e) {
17
18
  s = d;
18
19
  let m;
19
20
  if (e.key && ((a = e.debug) != null && a.call(e)) && (m = Date.now()), t = l(...d), e.key && ((u = e.debug) != null && u.call(e))) {
20
- const v = Math.round((Date.now() - c) * 100) / 100, f = Math.round((Date.now() - m) * 100) / 100, x = f / 16, E = (p, w) => {
21
+ const v = Math.round((Date.now() - c) * 100) / 100, f = Math.round((Date.now() - m) * 100) / 100, y = f / 16, E = (p, w) => {
21
22
  for (p = String(p); p.length < w; )
22
23
  p = " " + p;
23
24
  return p;
@@ -29,7 +30,7 @@ function y(r, l, e) {
29
30
  font-weight: bold;
30
31
  color: hsl(${Math.max(
31
32
  0,
32
- Math.min(120 - 120 * x, 120)
33
+ Math.min(120 - 120 * y, 120)
33
34
  )}deg 100% 31%);`,
34
35
  e?.key
35
36
  );
@@ -40,25 +41,25 @@ function y(r, l, e) {
40
41
  s = i;
41
42
  }, n;
42
43
  }
43
- function z(r, l) {
44
+ function C(r, l) {
44
45
  if (r === void 0)
45
46
  throw new Error("Unexpected undefined");
46
47
  return r;
47
48
  }
48
- const V = (r, l) => Math.abs(r - l) < 1.01, j = (r, l, e) => {
49
+ const j = (r, l) => Math.abs(r - l) < 1.01, P = (r, l, e) => {
49
50
  let s;
50
51
  return function(...t) {
51
52
  r.clearTimeout(s), s = r.setTimeout(() => l.apply(this, t), e);
52
53
  };
53
- }, C = (r) => {
54
+ }, I = (r) => {
54
55
  const { offsetWidth: l, offsetHeight: e } = r;
55
56
  return { width: l, height: e };
56
- }, P = (r) => r, B = (r) => {
57
+ }, B = (r) => r, H = (r) => {
57
58
  const l = Math.max(r.startIndex - r.overscan, 0), e = Math.min(r.endIndex + r.overscan, r.count - 1), s = [];
58
59
  for (let t = l; t <= e; t++)
59
60
  s.push(t);
60
61
  return s;
61
- }, H = (r, l) => {
62
+ }, $ = (r, l) => {
62
63
  const e = r.scrollElement;
63
64
  if (!e)
64
65
  return;
@@ -69,7 +70,7 @@ const V = (r, l) => Math.abs(r - l) < 1.01, j = (r, l, e) => {
69
70
  const { width: i, height: a } = n;
70
71
  l({ width: Math.round(i), height: Math.round(a) });
71
72
  };
72
- if (t(C(e)), !s.ResizeObserver)
73
+ if (t(I(e)), !s.ResizeObserver)
73
74
  return () => {
74
75
  };
75
76
  const o = new s.ResizeObserver((n) => {
@@ -82,16 +83,16 @@ const V = (r, l) => Math.abs(r - l) < 1.01, j = (r, l, e) => {
82
83
  return;
83
84
  }
84
85
  }
85
- t(C(e));
86
+ t(I(e));
86
87
  };
87
88
  r.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(i) : i();
88
89
  });
89
90
  return o.observe(e, { box: "border-box" }), () => {
90
91
  o.unobserve(e);
91
92
  };
92
- }, I = {
93
+ }, A = {
93
94
  passive: !0
94
- }, A = typeof window > "u" ? !0 : "onscrollend" in window, $ = (r, l) => {
95
+ }, F = typeof window > "u" ? !0 : "onscrollend" in window, q = (r, l) => {
95
96
  const e = r.scrollElement;
96
97
  if (!e)
97
98
  return;
@@ -99,8 +100,8 @@ const V = (r, l) => Math.abs(r - l) < 1.01, j = (r, l, e) => {
99
100
  if (!s)
100
101
  return;
101
102
  let t = 0;
102
- const o = r.options.useScrollendEvent && A ? () => {
103
- } : j(
103
+ const o = r.options.useScrollendEvent && F ? () => {
104
+ } : P(
104
105
  s,
105
106
  () => {
106
107
  l(t, !1);
@@ -110,12 +111,12 @@ const V = (r, l) => Math.abs(r - l) < 1.01, j = (r, l, e) => {
110
111
  const { horizontal: d, isRtl: h } = r.options;
111
112
  t = d ? e.scrollLeft * (h && -1 || 1) : e.scrollTop, o(), l(t, c);
112
113
  }, i = n(!0), a = n(!1);
113
- e.addEventListener("scroll", i, I);
114
- const u = r.options.useScrollendEvent && A;
115
- return u && e.addEventListener("scrollend", a, I), () => {
114
+ e.addEventListener("scroll", i, A);
115
+ const u = r.options.useScrollendEvent && F;
116
+ return u && e.addEventListener("scrollend", a, A), () => {
116
117
  e.removeEventListener("scroll", i), u && e.removeEventListener("scrollend", a);
117
118
  };
118
- }, q = (r, l, e) => {
119
+ }, U = (r, l, e) => {
119
120
  if (l?.borderBoxSize) {
120
121
  const s = l.borderBoxSize[0];
121
122
  if (s)
@@ -124,7 +125,7 @@ const V = (r, l) => Math.abs(r - l) < 1.01, j = (r, l, e) => {
124
125
  );
125
126
  }
126
127
  return r[e.options.horizontal ? "offsetWidth" : "offsetHeight"];
127
- }, U = (r, {
128
+ }, K = (r, {
128
129
  adjustments: l = 0,
129
130
  behavior: e
130
131
  }, s) => {
@@ -135,7 +136,7 @@ const V = (r, l) => Math.abs(r - l) < 1.01, j = (r, l, e) => {
135
136
  behavior: e
136
137
  });
137
138
  };
138
- class K {
139
+ class G {
139
140
  constructor(l) {
140
141
  this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.currentScrollToIndex = null, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.prevLanes = void 0, this.lanesChangedFlag = !1, this.lanesSettling = !1, this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.observer = /* @__PURE__ */ (() => {
141
142
  let e = null;
@@ -173,11 +174,11 @@ class K {
173
174
  scrollPaddingStart: 0,
174
175
  scrollPaddingEnd: 0,
175
176
  horizontal: !1,
176
- getItemKey: P,
177
- rangeExtractor: B,
177
+ getItemKey: B,
178
+ rangeExtractor: H,
178
179
  onChange: () => {
179
180
  },
180
- measureElement: q,
181
+ measureElement: U,
181
182
  initialRect: { width: 0, height: 0 },
182
183
  scrollMargin: 0,
183
184
  gap: 0,
@@ -194,7 +195,7 @@ class K {
194
195
  }, this.notify = (e) => {
195
196
  var s, t;
196
197
  (t = (s = this.options).onChange) == null || t.call(s, this, e);
197
- }, this.maybeNotify = y(
198
+ }, this.maybeNotify = x(
198
199
  () => (this.calculateRange(), [
199
200
  this.isScrolling,
200
201
  this.range ? this.range.startIndex : null,
@@ -252,7 +253,7 @@ class K {
252
253
  break;
253
254
  }
254
255
  return o.size === this.options.lanes ? Array.from(o.values()).sort((n, i) => n.end === i.end ? n.index - i.index : n.end - i.end)[0] : void 0;
255
- }, this.getMeasurementOptions = y(
256
+ }, this.getMeasurementOptions = x(
256
257
  () => [
257
258
  this.options.count,
258
259
  this.options.paddingStart,
@@ -270,13 +271,9 @@ class K {
270
271
  lanes: i
271
272
  }),
272
273
  {
273
- key: !1,
274
- skipInitialOnChange: !0,
275
- onChange: () => {
276
- this.notify(this.isScrolling);
277
- }
274
+ key: !1
278
275
  }
279
- ), this.getMeasurements = y(
276
+ ), this.getMeasurements = x(
280
277
  () => [this.getMeasurementOptions(), this.itemSizeCache],
281
278
  ({ count: e, paddingStart: s, scrollMargin: t, getItemKey: o, enabled: n, lanes: i }, a) => {
282
279
  if (!n)
@@ -298,19 +295,19 @@ class K {
298
295
  }
299
296
  for (let h = u; h < e; h++) {
300
297
  const m = o(h), v = this.laneAssignments.get(h);
301
- let f, x;
298
+ let f, y;
302
299
  if (v !== void 0 && this.options.lanes > 1) {
303
300
  f = v;
304
301
  const b = d[f], M = b !== void 0 ? c[b] : void 0;
305
- x = M ? M.end + this.options.gap : s + t;
302
+ y = M ? M.end + this.options.gap : s + t;
306
303
  } else {
307
304
  const b = this.options.lanes === 1 ? c[h - 1] : this.getFurthestMeasurement(c, h);
308
- x = b ? b.end + this.options.gap : s + t, f = b ? b.lane : h % this.options.lanes, this.options.lanes > 1 && this.laneAssignments.set(h, f);
305
+ y = b ? b.end + this.options.gap : s + t, f = b ? b.lane : h % this.options.lanes, this.options.lanes > 1 && this.laneAssignments.set(h, f);
309
306
  }
310
- const E = a.get(m), p = typeof E == "number" ? E : this.options.estimateSize(h), w = x + p;
307
+ const E = a.get(m), p = typeof E == "number" ? E : this.options.estimateSize(h), w = y + p;
311
308
  c[h] = {
312
309
  index: h,
313
- start: x,
310
+ start: y,
314
311
  size: p,
315
312
  end: w,
316
313
  key: m,
@@ -323,14 +320,14 @@ class K {
323
320
  key: process.env.NODE_ENV !== "production" && "getMeasurements",
324
321
  debug: () => this.options.debug
325
322
  }
326
- ), this.calculateRange = y(
323
+ ), this.calculateRange = x(
327
324
  () => [
328
325
  this.getMeasurements(),
329
326
  this.getSize(),
330
327
  this.getScrollOffset(),
331
328
  this.options.lanes
332
329
  ],
333
- (e, s, t, o) => this.range = e.length > 0 && s > 0 ? G({
330
+ (e, s, t, o) => this.range = e.length > 0 && s > 0 ? J({
334
331
  measurements: e,
335
332
  outerSize: s,
336
333
  scrollOffset: t,
@@ -340,7 +337,7 @@ class K {
340
337
  key: process.env.NODE_ENV !== "production" && "calculateRange",
341
338
  debug: () => this.options.debug
342
339
  }
343
- ), this.getVirtualIndexes = y(
340
+ ), this.getVirtualIndexes = x(
344
341
  () => {
345
342
  let e = null, s = null;
346
343
  const t = this.calculateRange();
@@ -390,7 +387,7 @@ class K {
390
387
  return;
391
388
  }
392
389
  this._measureElement(e, void 0);
393
- }, this.getVirtualItems = y(
390
+ }, this.getVirtualItems = x(
394
391
  () => [this.getVirtualIndexes(), this.getMeasurements()],
395
392
  (e, s) => {
396
393
  const t = [];
@@ -407,11 +404,11 @@ class K {
407
404
  ), this.getVirtualItemForOffset = (e) => {
408
405
  const s = this.getMeasurements();
409
406
  if (s.length !== 0)
410
- return z(
411
- s[N(
407
+ return C(
408
+ s[_(
412
409
  0,
413
410
  s.length - 1,
414
- (t) => z(s[t]).start,
411
+ (t) => C(s[t]).start,
415
412
  e
416
413
  )]
417
414
  );
@@ -477,7 +474,7 @@ class K {
477
474
  console.warn("Failed to get offset for index:", e);
478
475
  return;
479
476
  }
480
- V(f[0], v) || a(h);
477
+ j(f[0], v) || a(h);
481
478
  };
482
479
  this.isDynamicMode() ? this.targetWindow.requestAnimationFrame(m) : m();
483
480
  });
@@ -525,7 +522,7 @@ class K {
525
522
  }, this.setOptions(l);
526
523
  }
527
524
  }
528
- const N = (r, l, e, s) => {
525
+ const _ = (r, l, e, s) => {
529
526
  for (; r <= l; ) {
530
527
  const t = (r + l) / 2 | 0, o = e(t);
531
528
  if (o < s)
@@ -537,7 +534,7 @@ const N = (r, l, e, s) => {
537
534
  }
538
535
  return r > 0 ? r - 1 : 0;
539
536
  };
540
- function G({
537
+ function J({
541
538
  measurements: r,
542
539
  outerSize: l,
543
540
  scrollOffset: e,
@@ -549,7 +546,7 @@ function G({
549
546
  startIndex: 0,
550
547
  endIndex: t
551
548
  };
552
- let n = N(
549
+ let n = _(
553
550
  0,
554
551
  t,
555
552
  o,
@@ -573,8 +570,8 @@ function G({
573
570
  }
574
571
  return { startIndex: n, endIndex: i };
575
572
  }
576
- const F = typeof document < "u" ? S.useLayoutEffect : S.useEffect;
577
- function J({
573
+ const N = typeof document < "u" ? S.useLayoutEffect : S.useEffect;
574
+ function Q({
578
575
  useFlushSync: r = !0,
579
576
  ...l
580
577
  }) {
@@ -582,48 +579,48 @@ function J({
582
579
  ...l,
583
580
  onChange: (o, n) => {
584
581
  var i;
585
- r && n ? D(e) : e(), (i = l.onChange) == null || i.call(l, o, n);
582
+ r && n ? W(e) : e(), (i = l.onChange) == null || i.call(l, o, n);
586
583
  }
587
584
  }, [t] = S.useState(
588
- () => new K(s)
585
+ () => new G(s)
589
586
  );
590
- return t.setOptions(s), F(() => t._didMount(), []), F(() => t._willUpdate()), t;
587
+ return t.setOptions(s), N(() => t._didMount(), []), N(() => t._willUpdate()), t;
591
588
  }
592
- function Q(r) {
593
- return J({
594
- observeElementRect: H,
595
- observeElementOffset: $,
596
- scrollToFn: U,
589
+ function X(r) {
590
+ return Q({
591
+ observeElementRect: $,
592
+ observeElementOffset: q,
593
+ scrollToFn: K,
597
594
  ...r
598
595
  });
599
596
  }
600
- const ne = ({
597
+ const oe = ({
601
598
  showFlagOnSearch: r,
602
599
  showNameOnSearch: l
603
600
  }) => {
604
- const e = R(null), { termOfSearch: s, countries: t, handleSelectCountry: o } = L(), n = T(() => t.filter(
601
+ const e = T(null), { termOfSearch: s, countries: t, handleSelectCountry: o } = V(), n = k(() => t.filter(
605
602
  (a) => a.name.toLocaleLowerCase().includes(s.toLowerCase())
606
- ), [s]), i = Q({
603
+ ), [s]), i = X({
607
604
  count: n.length,
608
605
  overscan: 5,
609
606
  getScrollElement: () => e.current,
610
607
  estimateSize: () => 40
611
608
  });
612
- return k(() => {
609
+ return D(() => {
613
610
  n.length > 0 && i.scrollToIndex(0);
614
611
  }, [s, i]), n.length === 0 ? /* @__PURE__ */ g("div", { className: "overflow-y-auto max-h-60 snap-y snap-mandatory", children: /* @__PURE__ */ g("ul", { className: "relative", children: /* @__PURE__ */ g("li", { className: "w-full flex items-center h-10 select-none px-6", children: /* @__PURE__ */ g(
615
612
  O,
616
613
  {
617
614
  variant: "body2",
618
615
  component: "span",
619
- className: "flex gap-2 items-center text-left text-slate-800 dark:text-slate-50",
616
+ className: "flex gap-2 items-center text-left",
620
617
  children: "No options"
621
618
  }
622
619
  ) }) }) }) : /* @__PURE__ */ g(
623
620
  "div",
624
621
  {
625
622
  ref: e,
626
- className: "overflow-y-auto max-h-60 snap-y snap-mandatory",
623
+ className: "overflow-y-auto max-h-60 snap-y snap-mandatory scrollbar",
627
624
  children: /* @__PURE__ */ g(
628
625
  "ul",
629
626
  {
@@ -634,7 +631,16 @@ const ne = ({
634
631
  return /* @__PURE__ */ g(
635
632
  "li",
636
633
  {
637
- className: "absolute w-full snap-start snap-always scroll-m-0 flex items-center h-10",
634
+ className: z(
635
+ "absolute",
636
+ "w-full",
637
+ "snap-start",
638
+ "snap-always",
639
+ "scroll-m-0",
640
+ "flex",
641
+ "items-center",
642
+ "h-10"
643
+ ),
638
644
  style: {
639
645
  top: a.start,
640
646
  height: a.size
@@ -642,17 +648,29 @@ const ne = ({
642
648
  children: /* @__PURE__ */ g(
643
649
  "button",
644
650
  {
645
- className: "w-full h-full cursor-pointer px-6 hover:bg-gray-50 transition-colors duration-150 focus-visible:outline-0 hover:outline-gray-100 focus:bg-gray-50 dark:hover:bg-slate-700",
651
+ className: z(
652
+ "w-full",
653
+ "h-full",
654
+ "cursor-pointer",
655
+ "px-6",
656
+ "hover:bg-gray-50",
657
+ "transition-colors",
658
+ "duration-150",
659
+ "focus-visible:outline-0",
660
+ "hover:outline-gray-100",
661
+ "focus:bg-gray-50",
662
+ "dark:hover:bg-metal-700"
663
+ ),
646
664
  onClick: () => o(u),
647
- children: /* @__PURE__ */ _(
665
+ children: /* @__PURE__ */ R(
648
666
  O,
649
667
  {
650
668
  variant: "body2",
651
669
  component: "span",
652
- className: "flex gap-2 items-center text-left text-slate-800 dark:text-slate-50",
670
+ className: "flex gap-2 items-center text-left",
653
671
  children: [
654
672
  r && /* @__PURE__ */ g(c, {}),
655
- l && /* @__PURE__ */ g(W, { text: d, prefix: h })
673
+ l && /* @__PURE__ */ g(L, { text: d, prefix: h })
656
674
  ]
657
675
  }
658
676
  )
@@ -668,5 +686,5 @@ const ne = ({
668
686
  );
669
687
  };
670
688
  export {
671
- ne as FlagSelectorList
689
+ oe as FlagSelectorList
672
690
  };
@@ -1,36 +1,60 @@
1
- import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
- import { useCallback as d } from "react";
3
- import { Input as c } from "../../../Input/Input.js";
1
+ import { jsxs as s, jsx as r } from "react/jsx-runtime";
2
+ import { useCallback as c } from "react";
3
+ import { Input as d } from "../../../Input/Input.js";
4
4
  import { FlagSelectorList as p } from "../FlagSelectorList/FlagSelectorList.js";
5
- import { usePhoneNumberContext as u } from "../../contexts/phone-number.hook.js";
6
- const S = ({
7
- placeholder: r = "Search",
5
+ import { cn as u } from "../../../../utils/index.js";
6
+ import { usePhoneNumberContext as h } from "../../contexts/phone-number.hook.js";
7
+ const C = ({
8
+ placeholder: e = "Search",
8
9
  showFlagOnSearch: o,
9
- showInputFilter: a,
10
- showNameOnSearch: t,
11
- showPlaceHolder: l = !0
10
+ showInputFilter: t,
11
+ showNameOnSearch: a,
12
+ showPlaceHolder: m = !0
12
13
  }) => {
13
- const { onChangeTermOfSearch: s } = u(), m = d((n) => {
14
- s(n.target.value);
14
+ const { onChangeTermOfSearch: l } = h(), n = c((i) => {
15
+ l(i.target.value);
15
16
  }, []);
16
- return /* @__PURE__ */ i("div", { className: "absolute top-full mt-1.5 animate-in fade-in-0 zoom-in-95 w-full border border-gray-100 bg-white shadow-sm py-2 z-10 rounded-sm dark:bg-slate-800 dark:border-slate-600", children: [
17
- a && /* @__PURE__ */ e("div", { className: "px-6 py-2.5", children: /* @__PURE__ */ e(
18
- c,
19
- {
20
- isSearch: !0,
21
- placeholder: l ? r : void 0,
22
- onChange: m
23
- }
24
- ) }),
25
- /* @__PURE__ */ e(
26
- p,
27
- {
28
- showFlagOnSearch: o,
29
- showNameOnSearch: t
30
- }
31
- )
32
- ] });
17
+ return /* @__PURE__ */ s(
18
+ "div",
19
+ {
20
+ className: u(
21
+ "absolute",
22
+ "top-full",
23
+ "mt-1.5",
24
+ "animate-in",
25
+ "fade-in-0",
26
+ "zoom-in-95",
27
+ "w-full",
28
+ "border",
29
+ "border-gray-100",
30
+ "bg-white",
31
+ "shadow-sm",
32
+ "py-2",
33
+ "z-10",
34
+ "rounded-sm",
35
+ "dark:bg-metal-800",
36
+ "dark:border-metal-700"
37
+ ),
38
+ children: [
39
+ t && /* @__PURE__ */ r("div", { className: "px-6 py-2.5", children: /* @__PURE__ */ r(
40
+ d,
41
+ {
42
+ isSearch: !0,
43
+ placeholder: m ? e : void 0,
44
+ onChange: n
45
+ }
46
+ ) }),
47
+ /* @__PURE__ */ r(
48
+ p,
49
+ {
50
+ showFlagOnSearch: o,
51
+ showNameOnSearch: a
52
+ }
53
+ )
54
+ ]
55
+ }
56
+ );
33
57
  };
34
58
  export {
35
- S as FlagSelectorWrapper
59
+ C as FlagSelectorWrapper
36
60
  };