@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
@@ -52,7 +52,7 @@ const a = e(
52
52
  "bg-transparent",
53
53
  "border-none",
54
54
  "outline-none",
55
- "text-zinc-700",
55
+ "text-metal-700",
56
56
  "text-sm",
57
57
  "capitalize",
58
58
  "placeholder:text-sm",
@@ -69,7 +69,7 @@ const a = e(
69
69
  "dark:text-metal-50"
70
70
  ]);
71
71
  export {
72
- a as dropdownVariants,
73
72
  t as inputVariants,
74
- d as labelVariants
73
+ d as labelVariants,
74
+ a as selectVariants
75
75
  };
@@ -3,75 +3,75 @@ import { S as Z } from "../../../../index-BvoZGpli.js";
3
3
  import { d as B } from "../../../../debounce-BFejQm9P.js";
4
4
  import { forwardRef as G, useRef as C, useState as J, useImperativeHandle as K, useMemo as M, useEffect as Q } from "react";
5
5
  import { Loading as R } from "../../../Loading/Loading.js";
6
- import { cn as s } from "../../../../utils/index.js";
6
+ import { cn as o } from "../../../../utils/index.js";
7
7
  import { useNavigationUlList as W } from "../../hooks/useNavigationList.js";
8
8
  import { ListItem as b } from "../ListItem/ListItem.js";
9
9
  import { listVariants as X } from "./List.variants.js";
10
10
  import { DEFAULT_LIST_SIZE as Y } from "../../constants/pagination.js";
11
- import { useDropdownContext as $ } from "../../contexts/dropdown.hook.js";
11
+ import { useSelectContext as $ } from "../../contexts/select.hook.js";
12
12
  const fe = G(
13
13
  ({
14
14
  additionalOptions: F,
15
15
  className: N,
16
- inputRef: i,
16
+ inputRef: l,
17
17
  isLoading: E,
18
- itemClassName: l,
18
+ itemClassName: i,
19
19
  name: I,
20
- searchable: y = !1,
20
+ searchable: x = !1,
21
21
  listItemSecondRowClassName: c,
22
- wrapperInputRef: j,
22
+ wrapperInputRef: S,
23
23
  isInfiniteScrollEnabled: u,
24
24
  onFetchMoreOptions: f,
25
- noOptionsText: L
26
- }, O) => {
27
- const n = C(null), m = C(null), [p, w] = J(!1), {
28
- isOpen: P,
25
+ noOptionsText: y
26
+ }, j) => {
27
+ const n = C(null), m = C(null), [p, L] = J(!1), {
28
+ isOpen: O,
29
29
  searchTerm: g,
30
- canFilter: S,
30
+ canFilter: P,
31
31
  canContinueFetching: a,
32
32
  page: d,
33
- options: x,
33
+ options: w,
34
34
  isTyping: k,
35
35
  setOptions: T,
36
- setPage: D,
37
- setCanContinueFetching: U
36
+ setPage: U,
37
+ setCanContinueFetching: _
38
38
  } = $();
39
- K(O, () => n.current, [n]);
40
- const h = y && S ? x.filter((e) => {
39
+ K(j, () => n.current, [n]);
40
+ const h = x && P ? w.filter((e) => {
41
41
  const t = g.toLowerCase();
42
42
  return (typeof e.label == "string" ? e.label.toLowerCase() : "").includes(t);
43
- }) : x;
43
+ }) : w;
44
44
  W({
45
45
  ulRef: n,
46
- wrapperInputRef: j,
47
- searchable: y,
46
+ wrapperInputRef: S,
47
+ searchable: x,
48
48
  filteredOptions: h
49
49
  });
50
- const _ = h.filter(
51
- (e, t, o) => t === o.findIndex((v) => v.value === e.value)
52
- ), q = h.length === 0, z = M(
50
+ const q = h.filter(
51
+ (e, t, s) => t === s.findIndex((v) => v.value === e.value)
52
+ ), z = h.length === 0, A = M(
53
53
  () => B(async (e) => {
54
54
  const [t] = e;
55
55
  if (t.isIntersecting && !p && f && a)
56
56
  try {
57
- w(!0);
58
- const o = d + 1, { data: v, hasMore: A } = await f({
59
- page: o,
57
+ L(!0);
58
+ const s = d + 1, { data: v, hasMore: D } = await f({
59
+ page: s,
60
60
  pageSize: Y,
61
61
  termOfSearch: g
62
62
  });
63
- D(o), U(A), T((H) => [...H, ...v]);
63
+ U(s), _(D), T((H) => [...H, ...v]);
64
64
  } catch {
65
65
  console.error("Error fetching more options");
66
66
  } finally {
67
- w(!1);
67
+ L(!1);
68
68
  }
69
69
  }, 100),
70
70
  [p, f, g, d]
71
71
  );
72
72
  return Q(() => {
73
73
  if (u && a && m.current && !k) {
74
- const e = new IntersectionObserver(z, {
74
+ const e = new IntersectionObserver(A, {
75
75
  threshold: 0.1
76
76
  });
77
77
  return e.observe(m.current), () => e.disconnect();
@@ -88,36 +88,36 @@ const fe = G(
88
88
  ref: n,
89
89
  title: I,
90
90
  role: "listbox",
91
- className: s(X({ className: N })),
92
- "data-state": P ? "open" : "closed",
91
+ className: o(X({ className: N })),
92
+ "data-state": O ? "open" : "closed",
93
93
  children: [
94
94
  E ? /* @__PURE__ */ r(
95
95
  b,
96
96
  {
97
- className: s("select-none", l),
97
+ className: o("select-none", i),
98
98
  isClickable: !1,
99
- inputRef: i,
99
+ inputRef: l,
100
100
  value: "Loading...",
101
101
  label: "Loading...",
102
102
  listItemSecondRowClassName: c
103
103
  }
104
- ) : q ? /* @__PURE__ */ r(
104
+ ) : z ? /* @__PURE__ */ r(
105
105
  b,
106
106
  {
107
107
  isEmpty: !0,
108
- className: s("select-none", l),
108
+ className: o("select-none", i),
109
109
  isClickable: !1,
110
- inputRef: i,
111
- value: L ?? "",
112
- label: L ?? "No options",
110
+ inputRef: l,
111
+ value: y ?? "",
112
+ label: y ?? "No options",
113
113
  listItemSecondRowClassName: c
114
114
  }
115
- ) : _.map((e) => /* @__PURE__ */ r(
115
+ ) : q.map((e) => /* @__PURE__ */ r(
116
116
  b,
117
117
  {
118
- className: s("select-none", l),
118
+ className: o("select-none", i),
119
119
  isClickable: !0,
120
- inputRef: i,
120
+ inputRef: l,
121
121
  listItemSecondRowClassName: c,
122
122
  ...e
123
123
  },
@@ -137,14 +137,17 @@ const fe = G(
137
137
  F?.map((e, t) => /* @__PURE__ */ r("li", { role: "option", "data-action": "true", children: /* @__PURE__ */ r(
138
138
  Z,
139
139
  {
140
- className: s(
140
+ className: o(
141
141
  "flex",
142
- "p-2",
142
+ "min-h-10",
143
+ "py-2",
144
+ "px-6",
143
145
  "w-full",
144
146
  "h-full",
145
147
  "gap-1",
146
148
  "items-center",
147
149
  "text-sm",
150
+ "[&>svg]:-ml-1",
148
151
  "[&>svg]:w-3.5",
149
152
  "[&>svg]:h-3.5",
150
153
  "[&>svg]:shrink-0",
@@ -152,7 +155,9 @@ const fe = G(
152
155
  "select-none",
153
156
  "hover:bg-gray-50",
154
157
  "hover:dark:bg-metal-700",
155
- "focus:outline-0"
158
+ "focus:outline-0",
159
+ "text-blue-600",
160
+ "dark:text-aurora-500"
156
161
  ),
157
162
  children: e
158
163
  }
@@ -1,5 +1,6 @@
1
- import { c as o } from "../../../../index-D29mdTf5.js";
2
- const t = o([
1
+ import { c as t } from "../../../../index-D29mdTf5.js";
2
+ const o = t([
3
+ "scrollbar",
3
4
  "absolute",
4
5
  "bg-white",
5
6
  "border",
@@ -11,7 +12,7 @@ const t = o([
11
12
  "top-full",
12
13
  "w-full",
13
14
  "z-10",
14
- "max-h-46.25",
15
+ "max-h-44",
15
16
  "overflow-y-auto",
16
17
  "border-gray-200",
17
18
  "text-zinc-700",
@@ -21,8 +22,10 @@ const t = o([
21
22
  "duration-200",
22
23
  "dark:bg-metal-800",
23
24
  "dark:border-metal-700",
24
- "dark:text-metal-50"
25
+ "dark:text-metal-50",
26
+ "[&>li:first-child]:mt-2",
27
+ "[&>li:last-child]:mb-2"
25
28
  ]);
26
29
  export {
27
- t as listVariants
30
+ o as listVariants
28
31
  };
@@ -1,9 +1,9 @@
1
1
  import { jsx as n, jsxs as d } from "react/jsx-runtime";
2
2
  import { useRef as I, useCallback as u } from "react";
3
- import { cn as l } from "../../../../utils/index.js";
3
+ import { cn as s } from "../../../../utils/index.js";
4
4
  import { Typography as y } from "../../../Typography/Typography.js";
5
5
  import { listItemVariants as L } from "./ListItem.variants.js";
6
- import { useDropdownContext as V } from "../../contexts/dropdown.hook.js";
6
+ import { useSelectContext as V } from "../../contexts/select.hook.js";
7
7
  function j(c, r) {
8
8
  const i = r.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), o = new RegExp(`(${i})`, "gi");
9
9
  return c.split(o).map((a, t) => a.toLowerCase() === r.toLowerCase() ? /* @__PURE__ */ n(
@@ -23,18 +23,18 @@ const K = ({
23
23
  listItemSecondRowClassName: a,
24
24
  ...t
25
25
  }) => {
26
- const { searchTerm: m, highlightSearchEnabled: h, setValue: p, toggleOpen: x } = V(), b = I(null), f = u(
26
+ const { searchTerm: m, highlightSearchEnabled: h, setValue: x, toggleOpen: g } = V(), b = I(null), f = u(
27
27
  (e) => {
28
- p(e.value, o), x(!1);
28
+ x(e.value, o), g(!1);
29
29
  },
30
- [p, x]
31
- ), w = u(
32
- (e, s) => {
33
- e.key === "Enter" && (e.stopPropagation(), f(s));
30
+ [x, g]
31
+ ), N = u(
32
+ (e, l) => {
33
+ e.key === "Enter" && (e.stopPropagation(), f(l));
34
34
  },
35
35
  [f]
36
- ), N = u(
37
- ({ label: e, rightComponent: s, subLabel: g, rightComponentClassName: C }) => {
36
+ ), w = u(
37
+ ({ label: e, rightComponent: l, subLabel: p, rightComponentClassName: C }) => {
38
38
  if (c)
39
39
  return /* @__PURE__ */ n(
40
40
  y,
@@ -53,25 +53,25 @@ const K = ({
53
53
  variant: "body2",
54
54
  className: "text-zinc-700 dark:text-metal-50 font-medium",
55
55
  children: [
56
- s ? /* @__PURE__ */ d(
56
+ l ? /* @__PURE__ */ d(
57
57
  "span",
58
58
  {
59
- className: l("flex gap-2 items-center", C),
59
+ className: s("flex gap-2 items-center", C),
60
60
  children: [
61
61
  k,
62
62
  " ",
63
- s
63
+ l
64
64
  ]
65
65
  }
66
66
  ) : k,
67
- g ? /* @__PURE__ */ n(
67
+ p ? /* @__PURE__ */ n(
68
68
  "span",
69
69
  {
70
- className: l(
70
+ className: s(
71
71
  "block font-normal text-sm text-metal-800 dark:text-metal-50",
72
72
  a
73
73
  ),
74
- children: g
74
+ children: p
75
75
  }
76
76
  ) : null
77
77
  ]
@@ -86,17 +86,17 @@ const K = ({
86
86
  ref: b,
87
87
  role: "option",
88
88
  "data-action": "false",
89
- className: l(L({ className: i })),
89
+ className: s(L({ className: i })),
90
90
  tabIndex: 0,
91
91
  onClick: (e) => {
92
92
  r && (f(t), e.stopPropagation());
93
93
  },
94
- onKeyDown: (e) => w(e, t),
94
+ onKeyDown: (e) => N(e, t),
95
95
  children: [
96
96
  t.leftIcon ? /* @__PURE__ */ n(
97
97
  "span",
98
98
  {
99
- className: l(
99
+ className: s(
100
100
  "w-4 h-4 flex justify-center",
101
101
  {
102
102
  "items-center": !t.subLabel,
@@ -107,7 +107,7 @@ const K = ({
107
107
  children: t.leftIcon
108
108
  }
109
109
  ) : null,
110
- N(t)
110
+ w(t)
111
111
  ]
112
112
  }
113
113
  );
@@ -1,8 +1,8 @@
1
1
  import { c as r } from "../../../../index-D29mdTf5.js";
2
2
  const t = r([
3
3
  "cursor-pointer",
4
- "py-2",
5
- "px-2",
4
+ "py-1.5",
5
+ "px-6",
6
6
  "h-full",
7
7
  "focus-visible:outline-none",
8
8
  "m-0",
@@ -12,6 +12,7 @@ const t = r([
12
12
  "gap-3",
13
13
  "transition-bg",
14
14
  "duration-250",
15
+ "min-h-10",
15
16
  "hover:bg-gray-50",
16
17
  "focus:bg-gray-50",
17
18
  "dark:hover:bg-metal-700",
@@ -1,14 +1,14 @@
1
1
  import { jsxs as u, jsx as r } from "react/jsx-runtime";
2
- import { forwardRef as Z, useId as ee, useRef as C, useMemo as te, useImperativeHandle as ae, useEffect as re } from "react";
3
- import { S as ne } from "../../../loader-juvMSJ9L.js";
4
- import { Typography as oe } from "../../Typography/Typography.js";
5
- import { cn as o } from "../../../utils/index.js";
6
- import { labelVariants as le, inputVariants as se, dropdownVariants as ie } from "../Dropdown.variants.js";
7
- import { useDropdown as ce } from "../hooks/useDropdown.js";
2
+ import { forwardRef as Z, useId as ee, useRef as w, useMemo as te, useImperativeHandle as ae, useEffect as re } from "react";
3
+ import { S as le } from "../../../loader-juvMSJ9L.js";
4
+ import { Typography as ne } from "../../Typography/Typography.js";
5
+ import { cn as n } from "../../../utils/index.js";
6
+ import { labelVariants as oe, inputVariants as se, selectVariants as ce } from "../Select.variants.js";
7
+ import { useSelect as ie } from "../hooks/useSelect.js";
8
8
  import { List as me } from "./List/List.js";
9
9
  import { c as pe } from "../../../createLucideIcon-D4r5Phnh.js";
10
10
  import { C as ue } from "../../../chevron-up-DrQr2Fwd.js";
11
- import { useDropdownContext as fe } from "../contexts/dropdown.hook.js";
11
+ import { useSelectContext as fe } from "../contexts/select.hook.js";
12
12
  const de = [
13
13
  ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
14
14
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
@@ -20,69 +20,69 @@ const de = [
20
20
  disabled: t = !1,
21
21
  error: f,
22
22
  iconClassName: R,
23
- inputClassName: F,
23
+ inputClassName: S,
24
+ isInfiniteScrollEnabled: F = !1,
24
25
  isLoading: g,
25
26
  isRequired: h,
26
27
  label: v,
27
- labelClassName: S,
28
- listClassName: T,
29
- listItemClassName: D,
30
- listItemSecondRowClassName: E,
28
+ labelClassName: T,
29
+ listClassName: E,
30
+ listItemClassName: M,
31
+ listItemSecondRowClassName: W,
31
32
  name: d,
32
- placeholder: w,
33
+ noOptionsText: _,
34
+ placeholder: N,
33
35
  searchable: k = !1,
34
- showSearchIcon: N,
35
- theme: M,
36
- wrapperClassName: W,
37
- isInfiniteScrollEnabled: _ = !1,
38
- onFetchMoreOptions: $,
39
- onBlur: H,
40
- onSearchChange: P,
41
- noOptionsText: U,
36
+ showSearchIcon: C,
37
+ theme: $,
38
+ wrapperClassName: H,
39
+ onFetchMoreOptions: P,
40
+ onBlur: U,
41
+ onSearchChange: q,
42
42
  ...y
43
- }, q) => {
44
- const I = ee(), s = C(null), L = C(null), A = C(0), {
45
- isOpen: i,
46
- searchTerm: B,
47
- value: l,
48
- options: n,
49
- setValue: c,
50
- setSearchTerm: G,
51
- setCanFilter: J,
43
+ }, A) => {
44
+ const I = ee(), s = w(null), L = w(null), B = w(0), {
45
+ isOpen: c,
46
+ options: l,
47
+ searchTerm: D,
48
+ value: o,
49
+ setCanFilter: G,
50
+ setSearchTerm: J,
51
+ setValue: i,
52
52
  toggleOpen: K
53
- } = fe(), e = te(() => n.find(({ value: a }) => a === l), [n, l]), { wrapperRef: Q, wrapperInputRef: V, handleOpen: j } = ce({
53
+ } = fe(), e = te(() => l.find(({ value: a }) => a === o), [l, o]), { wrapperRef: Q, wrapperInputRef: V, handleOpen: j } = ie({
54
54
  ulRef: L,
55
55
  inputRef: s,
56
56
  disabled: t,
57
57
  internalValue: e,
58
- onBlur: H
58
+ onBlur: U
59
59
  }), m = d ? `${I}-${d}` : I;
60
- ae(q, () => s.current, [s]), re(() => {
61
- if (x && !l) {
62
- const a = n && n.find((p) => p.value === x);
63
- a && c(a.value);
60
+ ae(A, () => s.current, [s]), re(() => {
61
+ if (x && !o) {
62
+ const a = l && l.find((p) => p.value === x);
63
+ a && i(a.value);
64
64
  }
65
- }, [x, n, c, l]);
65
+ }, [x, l, i, o]);
66
66
  const X = (a) => {
67
67
  const p = a.target.value;
68
- J(!0), c(""), G(p ?? ""), P?.(p);
69
- const O = n.find(
68
+ G(!0), i(""), J(p ?? ""), q?.(p);
69
+ const O = l.find(
70
70
  (Y) => Y.value.toLocaleLowerCase() === p.toLocaleLowerCase()
71
71
  );
72
- c(O ? O.value : e?.value ?? "");
72
+ i(O ? O.value : e?.value ?? "");
73
73
  };
74
74
  return /* @__PURE__ */ u(
75
75
  "div",
76
76
  {
77
77
  ref: Q,
78
- className: o("flex flex-col w-full relative", W),
79
- "data-theme": M,
78
+ className: n("flex flex-col w-full relative", H),
79
+ "data-theme": $,
80
80
  children: [
81
81
  v ? /* @__PURE__ */ u(
82
82
  "label",
83
83
  {
84
84
  id: m,
85
- className: o(le({ className: S })),
85
+ className: n(oe({ className: T })),
86
86
  htmlFor: m,
87
87
  onClick: () => !t && j(),
88
88
  children: [
@@ -96,21 +96,21 @@ const de = [
96
96
  {
97
97
  ref: V,
98
98
  id: m,
99
- className: o(
100
- ie({ className: z, hasError: !!f, disabled: t })
99
+ className: n(
100
+ ce({ className: z, hasError: !!f, disabled: t })
101
101
  ),
102
102
  role: "combobox",
103
- onClick: () => !t && K(!i),
104
- "aria-expanded": i,
105
- tabIndex: A.current,
103
+ onClick: () => !t && K(!c),
104
+ "aria-expanded": c,
105
+ tabIndex: B.current,
106
106
  "aria-labelledby": m,
107
107
  children: [
108
108
  /* @__PURE__ */ u("div", { className: "flex gap-2.5 items-center flex-1", children: [
109
- e?.leftIcon && !N && /* @__PURE__ */ r("span", { className: "w-4 h-4 flex justify-center items-center dark:text-metal-50", children: e.leftIcon }),
110
- N && /* @__PURE__ */ r(
109
+ e?.leftIcon && !C && /* @__PURE__ */ r("span", { className: "w-4 h-4 flex justify-center items-center dark:text-metal-50", children: e.leftIcon }),
110
+ C && /* @__PURE__ */ r(
111
111
  xe,
112
112
  {
113
- className: o(
113
+ className: n(
114
114
  "w-4",
115
115
  "h-4",
116
116
  "text-zinc-500",
@@ -126,16 +126,16 @@ const de = [
126
126
  "input",
127
127
  {
128
128
  type: "text",
129
- value: i ? B : e?.label ?? l ?? "",
129
+ value: c ? D : e?.label ?? o ?? "",
130
130
  onChange: X,
131
- placeholder: w,
132
- className: o(se({ className: F }), {
131
+ placeholder: N,
132
+ className: n(se({ className: S }), {
133
133
  "text-red-700 placeholder:text-red-700": !!f
134
134
  }),
135
135
  onClick: (a) => {
136
136
  a.stopPropagation(), t || j();
137
137
  },
138
- "aria-label": v || w,
138
+ "aria-label": v || N,
139
139
  "aria-labelledby": m,
140
140
  required: h,
141
141
  autoComplete: "off",
@@ -145,10 +145,10 @@ const de = [
145
145
  ...y
146
146
  }
147
147
  ) : /* @__PURE__ */ u(
148
- oe,
148
+ ne,
149
149
  {
150
150
  variant: "body2",
151
- className: o(
151
+ className: n(
152
152
  "flex-1 text-zinc-400 text-sm dark:text-metal-400 flex gap-2 items-center",
153
153
  {
154
154
  "text-red-700": !!f,
@@ -159,18 +159,18 @@ const de = [
159
159
  e?.wrapperClassNameOnSelectedValue
160
160
  ),
161
161
  children: [
162
- e?.label || w,
162
+ e?.label || N,
163
163
  " ",
164
164
  e?.showRightComponentOnselectedValue ? e?.rightComponent : null
165
165
  ]
166
166
  }
167
167
  )
168
168
  ] }),
169
- g ? /* @__PURE__ */ r(ne, { className: "w-4 h-4 text-metal-400 animate-spin select-none" }) : !N && /* @__PURE__ */ r(
169
+ g ? /* @__PURE__ */ r(le, { className: "w-4 h-4 text-metal-400 animate-spin select-none" }) : !C && /* @__PURE__ */ r(
170
170
  ue,
171
171
  {
172
- "data-state": i ? "open" : "closed",
173
- className: o(
172
+ "data-state": c ? "open" : "closed",
173
+ className: n(
174
174
  "w-4 h-4 text-zinc-500 transition-all duration-100 data-[state=open]:rotate-0 data-[state=closed]:rotate-180 select-none dark:group-focus-within:text-metal-50",
175
175
  R,
176
176
  {
@@ -193,27 +193,27 @@ const de = [
193
193
  "aria-hidden": "true",
194
194
  required: h,
195
195
  inert: !0,
196
- defaultValue: e?.value ?? l ?? void 0,
196
+ defaultValue: e?.value ?? o ?? void 0,
197
197
  ...y
198
198
  }
199
199
  ),
200
- i && /* @__PURE__ */ r(
200
+ c && /* @__PURE__ */ r(
201
201
  me,
202
202
  {
203
203
  ref: L,
204
204
  additionalOptions: b,
205
- className: T,
206
- itemClassName: D,
205
+ className: E,
206
+ itemClassName: M,
207
207
  name: d,
208
208
  wrapperInputRef: V,
209
209
  inputRef: s,
210
- options: n,
210
+ options: l,
211
211
  isLoading: !!g,
212
212
  searchable: k,
213
- listItemSecondRowClassName: E,
214
- isInfiniteScrollEnabled: _,
215
- onFetchMoreOptions: $,
216
- noOptionsText: U
213
+ listItemSecondRowClassName: W,
214
+ isInfiniteScrollEnabled: F,
215
+ onFetchMoreOptions: P,
216
+ noOptionsText: _
217
217
  }
218
218
  )
219
219
  ]
@@ -0,0 +1,6 @@
1
+ import { useSelectContext as r } from "./select.hook.js";
2
+ import { SelectProvider as x } from "./select.provider.js";
3
+ export {
4
+ x as SelectProvider,
5
+ r as useSelectContext
6
+ };
@@ -1,5 +1,5 @@
1
1
  import { createContext as e } from "react";
2
- const t = e({
2
+ const r = e({
3
3
  highlightSearchEnabled: !1,
4
4
  isOpen: !1,
5
5
  searchTerm: "",
@@ -32,5 +32,5 @@ const t = e({
32
32
  }
33
33
  });
34
34
  export {
35
- t as DropdownContext
35
+ r as SelectContext
36
36
  };
@@ -0,0 +1,11 @@
1
+ import { useContext as e } from "react";
2
+ import { SelectContext as o } from "./select.context.js";
3
+ const c = () => {
4
+ const t = e(o);
5
+ if (!t)
6
+ throw new Error("useSelectContext must be used within a SelectProvider");
7
+ return t;
8
+ };
9
+ export {
10
+ c as useSelectContext
11
+ };