@adamosuiteservices/ui 1.4.6 → 1.6.6

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.
package/dist/combobox.js CHANGED
@@ -1,183 +1,183 @@
1
- import { j as w } from "./jsx-runtime-BzflLqGi.js";
2
- import * as a from "react";
1
+ import { j as b } from "./jsx-runtime-BzflLqGi.js";
2
+ import * as n from "react";
3
3
  import { useState as fe } from "react";
4
- import { c as A } from "./index-CRiPKpXj.js";
4
+ import { c as M } from "./index-CRiPKpXj.js";
5
5
  import { B as Ce } from "./button-2GdKenQI.js";
6
- import { R as Ie, P as je, O as Re, a as Ae } from "./index-DMLQL2aG.js";
7
- import { P as N } from "./index-BMWt1NBG.js";
8
- import { u as O } from "./index-Cv867SGx.js";
9
- import { c as G } from "./index-DLcqcWxM.js";
10
- import { c as $e } from "./createLucideIcon-B_8CJpcQ.js";
11
- import { P as Me, a as Ne, b as Pe } from "./popover-3rIoNCXs.js";
6
+ import { R as Ie, P as je, O as Re, a as Ae } from "./index-DniCthJA.js";
7
+ import { P as D } from "./index-BMWt1NBG.js";
8
+ import { u as T } from "./index-Cv867SGx.js";
9
+ import { c as X } from "./index-DLcqcWxM.js";
10
+ import { c as Ne } from "./createLucideIcon-B_8CJpcQ.js";
11
+ import { P as $e, a as Me, b as Pe } from "./popover-3rIoNCXs.js";
12
12
  import { C as De } from "./checkbox-Dr487kAg.js";
13
13
  import { C as Le } from "./chevron-down-CpVS2Z7w.js";
14
- import { C as ze } from "./check-Ci0GjV-B.js";
14
+ import { C as Fe } from "./check-Ci0GjV-B.js";
15
15
  /**
16
16
  * @license lucide-react v0.546.0 - ISC
17
17
  *
18
18
  * This source code is licensed under the ISC license.
19
19
  * See the LICENSE file in the root directory of this source tree.
20
20
  */
21
- const Fe = [
21
+ const Ve = [
22
22
  ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
23
23
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
24
- ], Ke = $e("search", Fe);
25
- var pe = 1, Oe = 0.9, qe = 0.8, Be = 0.17, te = 0.1, re = 0.999, Ve = 0.9999, Te = 0.99, _e = /[\\\/_+.#"@\[\(\{&]/, Ge = /[\\\/_+.#"@\[\(\{&]/g, Ue = /[\s-]/, ge = /[\s-]/g;
26
- function ae(e, n, r, s, o, u, d) {
27
- if (u === n.length) return o === e.length ? pe : Te;
28
- var m = `${o},${u}`;
29
- if (d[m] !== void 0) return d[m];
30
- for (var x = s.charAt(u), i = r.indexOf(x, o), h = 0, b, v, S, C; i >= 0; ) b = ae(e, n, r, s, i + 1, u + 1, d), b > h && (i === o ? b *= pe : _e.test(e.charAt(i - 1)) ? (b *= qe, S = e.slice(o, i - 1).match(Ge), S && o > 0 && (b *= Math.pow(re, S.length))) : Ue.test(e.charAt(i - 1)) ? (b *= Oe, C = e.slice(o, i - 1).match(ge), C && o > 0 && (b *= Math.pow(re, C.length))) : (b *= Be, o > 0 && (b *= Math.pow(re, i - o))), e.charAt(i) !== n.charAt(u) && (b *= Ve)), (b < te && r.charAt(i - 1) === s.charAt(u + 1) || s.charAt(u + 1) === s.charAt(u) && r.charAt(i - 1) !== s.charAt(u)) && (v = ae(e, n, r, s, i + 1, u + 2, d), v * te > b && (b = v * te)), b > h && (h = b), i = r.indexOf(x, i + 1);
31
- return d[m] = h, h;
24
+ ], ze = Ne("search", Ve);
25
+ var pe = 1, Ke = 0.9, Oe = 0.8, qe = 0.17, re = 0.1, ae = 0.999, Be = 0.9999, Te = 0.99, _e = /[\\\/_+.#"@\[\(\{&]/, Ge = /[\\\/_+.#"@\[\(\{&]/g, Ue = /[\s-]/, ge = /[\s-]/g;
26
+ function le(e, a, r, m, i, u, s) {
27
+ if (u === a.length) return i === e.length ? pe : Te;
28
+ var f = `${i},${u}`;
29
+ if (s[f] !== void 0) return s[f];
30
+ for (var v = m.charAt(u), o = r.indexOf(v, i), x = 0, d, S, E, $; o >= 0; ) d = le(e, a, r, m, o + 1, u + 1, s), d > x && (o === i ? d *= pe : _e.test(e.charAt(o - 1)) ? (d *= Oe, E = e.slice(i, o - 1).match(Ge), E && i > 0 && (d *= Math.pow(ae, E.length))) : Ue.test(e.charAt(o - 1)) ? (d *= Ke, $ = e.slice(i, o - 1).match(ge), $ && i > 0 && (d *= Math.pow(ae, $.length))) : (d *= qe, i > 0 && (d *= Math.pow(ae, o - i))), e.charAt(o) !== a.charAt(u) && (d *= Be)), (d < re && r.charAt(o - 1) === m.charAt(u + 1) || m.charAt(u + 1) === m.charAt(u) && r.charAt(o - 1) !== m.charAt(u)) && (S = le(e, a, r, m, o + 1, u + 2, s), S * re > d && (d = S * re)), d > x && (x = d), o = r.indexOf(v, o + 1);
31
+ return s[f] = x, x;
32
32
  }
33
- function ve(e) {
33
+ function he(e) {
34
34
  return e.toLowerCase().replace(ge, " ");
35
35
  }
36
- function He(e, n, r) {
37
- return e = r && r.length > 0 ? `${e + " " + r.join(" ")}` : e, ae(e, n, ve(e), ve(n), 0, 0, {});
36
+ function He(e, a, r) {
37
+ return e = r && r.length > 0 ? `${e + " " + r.join(" ")}` : e, le(e, a, he(e), he(a), 0, 0, {});
38
38
  }
39
- var _ = '[cmdk-group=""]', ne = '[cmdk-group-items=""]', We = '[cmdk-group-heading=""]', be = '[cmdk-item=""]', he = `${be}:not([aria-disabled="true"])`, le = "cmdk-item-select", F = "data-value", Je = (e, n, r) => He(e, n, r), xe = a.createContext(void 0), U = () => a.useContext(xe), ye = a.createContext(void 0), oe = () => a.useContext(ye), ke = a.createContext(void 0), we = a.forwardRef((e, n) => {
40
- let r = K(() => {
39
+ var J = '[cmdk-group=""]', ne = '[cmdk-group-items=""]', We = '[cmdk-group-heading=""]', be = '[cmdk-item=""]', ve = `${be}:not([aria-disabled="true"])`, oe = "cmdk-item-select", q = "data-value", Je = (e, a, r) => He(e, a, r), xe = n.createContext(void 0), Y = () => n.useContext(xe), ye = n.createContext(void 0), ie = () => n.useContext(ye), ke = n.createContext(void 0), we = n.forwardRef((e, a) => {
40
+ let r = B(() => {
41
41
  var t, c;
42
42
  return { search: "", value: (c = (t = e.value) != null ? t : e.defaultValue) != null ? c : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
43
- }), s = K(() => /* @__PURE__ */ new Set()), o = K(() => /* @__PURE__ */ new Map()), u = K(() => /* @__PURE__ */ new Map()), d = K(() => /* @__PURE__ */ new Set()), m = Ee(e), { label: x, children: i, value: h, onValueChange: b, filter: v, shouldFilter: S, loop: C, disablePointerSelection: D = !1, vimBindings: $ = !0, ...L } = e, B = O(), V = O(), p = O(), I = a.useRef(null), k = ot();
44
- P(() => {
45
- if (h !== void 0) {
46
- let t = h.trim();
47
- r.current.value = t, E.emit();
43
+ }), m = B(() => /* @__PURE__ */ new Set()), i = B(() => /* @__PURE__ */ new Map()), u = B(() => /* @__PURE__ */ new Map()), s = B(() => /* @__PURE__ */ new Set()), f = Se(e), { label: v, children: o, value: x, onValueChange: d, filter: S, shouldFilter: E, loop: $, disablePointerSelection: G = !1, vimBindings: g = !0, ...U } = e, j = T(), H = T(), L = T(), R = n.useRef(null), k = ot();
44
+ z(() => {
45
+ if (x !== void 0) {
46
+ let t = x.trim();
47
+ r.current.value = t, C.emit();
48
48
  }
49
- }, [h]), P(() => {
50
- k(6, ie);
49
+ }, [x]), z(() => {
50
+ k(6, de);
51
51
  }, []);
52
- let E = a.useMemo(() => ({ subscribe: (t) => (d.current.add(t), () => d.current.delete(t)), snapshot: () => r.current, setState: (t, c, f) => {
53
- var l, g, y, R;
52
+ let C = n.useMemo(() => ({ subscribe: (t) => (s.current.add(t), () => s.current.delete(t)), snapshot: () => r.current, setState: (t, c, h) => {
53
+ var l, y, w, A;
54
54
  if (!Object.is(r.current[t], c)) {
55
- if (r.current[t] = c, t === "search") Q(), X(), k(1, Y);
55
+ if (r.current[t] = c, t === "search") V(), N(), k(1, F);
56
56
  else if (t === "value") {
57
57
  if (document.activeElement.hasAttribute("cmdk-input") || document.activeElement.hasAttribute("cmdk-root")) {
58
- let j = document.getElementById(p);
59
- j ? j.focus() : (l = document.getElementById(B)) == null || l.focus();
58
+ let I = document.getElementById(L);
59
+ I ? I.focus() : (l = document.getElementById(j)) == null || l.focus();
60
60
  }
61
61
  if (k(7, () => {
62
- var j;
63
- r.current.selectedItemId = (j = z()) == null ? void 0 : j.id, E.emit();
64
- }), f || k(5, ie), ((g = m.current) == null ? void 0 : g.value) !== void 0) {
65
- let j = c ?? "";
66
- (R = (y = m.current).onValueChange) == null || R.call(y, j);
62
+ var I;
63
+ r.current.selectedItemId = (I = O()) == null ? void 0 : I.id, C.emit();
64
+ }), h || k(5, de), ((y = f.current) == null ? void 0 : y.value) !== void 0) {
65
+ let I = c ?? "";
66
+ (A = (w = f.current).onValueChange) == null || A.call(w, I);
67
67
  return;
68
68
  }
69
69
  }
70
- E.emit();
70
+ C.emit();
71
71
  }
72
72
  }, emit: () => {
73
- d.current.forEach((t) => t());
74
- } }), []), J = a.useMemo(() => ({ value: (t, c, f) => {
73
+ s.current.forEach((t) => t());
74
+ } }), []), K = n.useMemo(() => ({ value: (t, c, h) => {
75
75
  var l;
76
- c !== ((l = u.current.get(t)) == null ? void 0 : l.value) && (u.current.set(t, { value: c, keywords: f }), r.current.filtered.items.set(t, de(c, f)), k(2, () => {
77
- X(), E.emit();
76
+ c !== ((l = u.current.get(t)) == null ? void 0 : l.value) && (u.current.set(t, { value: c, keywords: h }), r.current.filtered.items.set(t, p(c, h)), k(2, () => {
77
+ N(), C.emit();
78
78
  }));
79
- }, item: (t, c) => (s.current.add(t), c && (o.current.has(c) ? o.current.get(c).add(t) : o.current.set(c, /* @__PURE__ */ new Set([t]))), k(3, () => {
80
- Q(), X(), r.current.value || Y(), E.emit();
79
+ }, item: (t, c) => (m.current.add(t), c && (i.current.has(c) ? i.current.get(c).add(t) : i.current.set(c, /* @__PURE__ */ new Set([t]))), k(3, () => {
80
+ V(), N(), r.current.value || F(), C.emit();
81
81
  }), () => {
82
- u.current.delete(t), s.current.delete(t), r.current.filtered.items.delete(t);
83
- let f = z();
82
+ u.current.delete(t), m.current.delete(t), r.current.filtered.items.delete(t);
83
+ let h = O();
84
84
  k(4, () => {
85
- Q(), f?.getAttribute("id") === t && Y(), E.emit();
85
+ V(), h?.getAttribute("id") === t && F(), C.emit();
86
86
  });
87
- }), group: (t) => (o.current.has(t) || o.current.set(t, /* @__PURE__ */ new Set()), () => {
88
- u.current.delete(t), o.current.delete(t);
89
- }), filter: () => m.current.shouldFilter, label: x || e["aria-label"], getDisablePointerSelection: () => m.current.disablePointerSelection, listId: B, inputId: p, labelId: V, listInnerRef: I }), []);
90
- function de(t, c) {
91
- var f, l;
92
- let g = (l = (f = m.current) == null ? void 0 : f.filter) != null ? l : Je;
93
- return t ? g(t, r.current.search, c) : 0;
87
+ }), group: (t) => (i.current.has(t) || i.current.set(t, /* @__PURE__ */ new Set()), () => {
88
+ u.current.delete(t), i.current.delete(t);
89
+ }), filter: () => f.current.shouldFilter, label: v || e["aria-label"], getDisablePointerSelection: () => f.current.disablePointerSelection, listId: j, inputId: L, labelId: H, listInnerRef: R }), []);
90
+ function p(t, c) {
91
+ var h, l;
92
+ let y = (l = (h = f.current) == null ? void 0 : h.filter) != null ? l : Je;
93
+ return t ? y(t, r.current.search, c) : 0;
94
94
  }
95
- function X() {
96
- if (!r.current.search || m.current.shouldFilter === !1) return;
95
+ function N() {
96
+ if (!r.current.search || f.current.shouldFilter === !1) return;
97
97
  let t = r.current.filtered.items, c = [];
98
98
  r.current.filtered.groups.forEach((l) => {
99
- let g = o.current.get(l), y = 0;
100
- g.forEach((R) => {
101
- let j = t.get(R);
102
- y = Math.max(j, y);
103
- }), c.push([l, y]);
99
+ let y = i.current.get(l), w = 0;
100
+ y.forEach((A) => {
101
+ let I = t.get(A);
102
+ w = Math.max(I, w);
103
+ }), c.push([l, w]);
104
104
  });
105
- let f = I.current;
106
- T().sort((l, g) => {
107
- var y, R;
108
- let j = l.getAttribute("id"), H = g.getAttribute("id");
109
- return ((y = t.get(H)) != null ? y : 0) - ((R = t.get(j)) != null ? R : 0);
105
+ let h = R.current;
106
+ W().sort((l, y) => {
107
+ var w, A;
108
+ let I = l.getAttribute("id"), Q = y.getAttribute("id");
109
+ return ((w = t.get(Q)) != null ? w : 0) - ((A = t.get(I)) != null ? A : 0);
110
110
  }).forEach((l) => {
111
- let g = l.closest(ne);
112
- g ? g.appendChild(l.parentElement === g ? l : l.closest(`${ne} > *`)) : f.appendChild(l.parentElement === f ? l : l.closest(`${ne} > *`));
113
- }), c.sort((l, g) => g[1] - l[1]).forEach((l) => {
114
- var g;
115
- let y = (g = I.current) == null ? void 0 : g.querySelector(`${_}[${F}="${encodeURIComponent(l[0])}"]`);
116
- y?.parentElement.appendChild(y);
111
+ let y = l.closest(ne);
112
+ y ? y.appendChild(l.parentElement === y ? l : l.closest(`${ne} > *`)) : h.appendChild(l.parentElement === h ? l : l.closest(`${ne} > *`));
113
+ }), c.sort((l, y) => y[1] - l[1]).forEach((l) => {
114
+ var y;
115
+ let w = (y = R.current) == null ? void 0 : y.querySelector(`${J}[${q}="${encodeURIComponent(l[0])}"]`);
116
+ w?.parentElement.appendChild(w);
117
117
  });
118
118
  }
119
- function Y() {
120
- let t = T().find((f) => f.getAttribute("aria-disabled") !== "true"), c = t?.getAttribute(F);
121
- E.setState("value", c || void 0);
119
+ function F() {
120
+ let t = W().find((h) => h.getAttribute("aria-disabled") !== "true"), c = t?.getAttribute(q);
121
+ C.setState("value", c || void 0);
122
122
  }
123
- function Q() {
124
- var t, c, f, l;
125
- if (!r.current.search || m.current.shouldFilter === !1) {
126
- r.current.filtered.count = s.current.size;
123
+ function V() {
124
+ var t, c, h, l;
125
+ if (!r.current.search || f.current.shouldFilter === !1) {
126
+ r.current.filtered.count = m.current.size;
127
127
  return;
128
128
  }
129
129
  r.current.filtered.groups = /* @__PURE__ */ new Set();
130
- let g = 0;
131
- for (let y of s.current) {
132
- let R = (c = (t = u.current.get(y)) == null ? void 0 : t.value) != null ? c : "", j = (l = (f = u.current.get(y)) == null ? void 0 : f.keywords) != null ? l : [], H = de(R, j);
133
- r.current.filtered.items.set(y, H), H > 0 && g++;
130
+ let y = 0;
131
+ for (let w of m.current) {
132
+ let A = (c = (t = u.current.get(w)) == null ? void 0 : t.value) != null ? c : "", I = (l = (h = u.current.get(w)) == null ? void 0 : h.keywords) != null ? l : [], Q = p(A, I);
133
+ r.current.filtered.items.set(w, Q), Q > 0 && y++;
134
134
  }
135
- for (let [y, R] of o.current) for (let j of R) if (r.current.filtered.items.get(j) > 0) {
136
- r.current.filtered.groups.add(y);
135
+ for (let [w, A] of i.current) for (let I of A) if (r.current.filtered.items.get(I) > 0) {
136
+ r.current.filtered.groups.add(w);
137
137
  break;
138
138
  }
139
- r.current.filtered.count = g;
139
+ r.current.filtered.count = y;
140
140
  }
141
- function ie() {
142
- var t, c, f;
143
- let l = z();
144
- l && (((t = l.parentElement) == null ? void 0 : t.firstChild) === l && ((f = (c = l.closest(_)) == null ? void 0 : c.querySelector(We)) == null || f.scrollIntoView({ block: "nearest" })), l.scrollIntoView({ block: "nearest" }));
141
+ function de() {
142
+ var t, c, h;
143
+ let l = O();
144
+ l && (((t = l.parentElement) == null ? void 0 : t.firstChild) === l && ((h = (c = l.closest(J)) == null ? void 0 : c.querySelector(We)) == null || h.scrollIntoView({ block: "nearest" })), l.scrollIntoView({ block: "nearest" }));
145
145
  }
146
- function z() {
146
+ function O() {
147
147
  var t;
148
- return (t = I.current) == null ? void 0 : t.querySelector(`${be}[aria-selected="true"]`);
148
+ return (t = R.current) == null ? void 0 : t.querySelector(`${be}[aria-selected="true"]`);
149
149
  }
150
- function T() {
150
+ function W() {
151
151
  var t;
152
- return Array.from(((t = I.current) == null ? void 0 : t.querySelectorAll(he)) || []);
153
- }
154
- function Z(t) {
155
- let c = T()[t];
156
- c && E.setState("value", c.getAttribute(F));
152
+ return Array.from(((t = R.current) == null ? void 0 : t.querySelectorAll(ve)) || []);
157
153
  }
158
154
  function ee(t) {
155
+ let c = W()[t];
156
+ c && C.setState("value", c.getAttribute(q));
157
+ }
158
+ function te(t) {
159
159
  var c;
160
- let f = z(), l = T(), g = l.findIndex((R) => R === f), y = l[g + t];
161
- (c = m.current) != null && c.loop && (y = g + t < 0 ? l[l.length - 1] : g + t === l.length ? l[0] : l[g + t]), y && E.setState("value", y.getAttribute(F));
160
+ let h = O(), l = W(), y = l.findIndex((A) => A === h), w = l[y + t];
161
+ (c = f.current) != null && c.loop && (w = y + t < 0 ? l[l.length - 1] : y + t === l.length ? l[0] : l[y + t]), w && C.setState("value", w.getAttribute(q));
162
162
  }
163
163
  function ue(t) {
164
- let c = z(), f = c?.closest(_), l;
165
- for (; f && !l; ) f = t > 0 ? at(f, _) : lt(f, _), l = f?.querySelector(he);
166
- l ? E.setState("value", l.getAttribute(F)) : ee(t);
164
+ let c = O(), h = c?.closest(J), l;
165
+ for (; h && !l; ) h = t > 0 ? nt(h, J) : lt(h, J), l = h?.querySelector(ve);
166
+ l ? C.setState("value", l.getAttribute(q)) : te(t);
167
167
  }
168
- let ce = () => Z(T().length - 1), se = (t) => {
169
- t.preventDefault(), t.metaKey ? ce() : t.altKey ? ue(1) : ee(1);
168
+ let ce = () => ee(W().length - 1), se = (t) => {
169
+ t.preventDefault(), t.metaKey ? ce() : t.altKey ? ue(1) : te(1);
170
170
  }, me = (t) => {
171
- t.preventDefault(), t.metaKey ? Z(0) : t.altKey ? ue(-1) : ee(-1);
171
+ t.preventDefault(), t.metaKey ? ee(0) : t.altKey ? ue(-1) : te(-1);
172
172
  };
173
- return a.createElement(N.div, { ref: n, tabIndex: -1, ...L, "cmdk-root": "", onKeyDown: (t) => {
173
+ return n.createElement(D.div, { ref: a, tabIndex: -1, ...U, "cmdk-root": "", onKeyDown: (t) => {
174
174
  var c;
175
- (c = L.onKeyDown) == null || c.call(L, t);
176
- let f = t.nativeEvent.isComposing || t.keyCode === 229;
177
- if (!(t.defaultPrevented || f)) switch (t.key) {
175
+ (c = U.onKeyDown) == null || c.call(U, t);
176
+ let h = t.nativeEvent.isComposing || t.keyCode === 229;
177
+ if (!(t.defaultPrevented || h)) switch (t.key) {
178
178
  case "n":
179
179
  case "j": {
180
- $ && t.ctrlKey && se(t);
180
+ g && t.ctrlKey && se(t);
181
181
  break;
182
182
  }
183
183
  case "ArrowDown": {
@@ -186,7 +186,7 @@ var _ = '[cmdk-group=""]', ne = '[cmdk-group-items=""]', We = '[cmdk-group-headi
186
186
  }
187
187
  case "p":
188
188
  case "k": {
189
- $ && t.ctrlKey && me(t);
189
+ g && t.ctrlKey && me(t);
190
190
  break;
191
191
  }
192
192
  case "ArrowUp": {
@@ -194,7 +194,7 @@ var _ = '[cmdk-group=""]', ne = '[cmdk-group-items=""]', We = '[cmdk-group-headi
194
194
  break;
195
195
  }
196
196
  case "Home": {
197
- t.preventDefault(), Z(0);
197
+ t.preventDefault(), ee(0);
198
198
  break;
199
199
  }
200
200
  case "End": {
@@ -203,167 +203,167 @@ var _ = '[cmdk-group=""]', ne = '[cmdk-group-items=""]', We = '[cmdk-group-headi
203
203
  }
204
204
  case "Enter": {
205
205
  t.preventDefault();
206
- let l = z();
206
+ let l = O();
207
207
  if (l) {
208
- let g = new Event(le);
209
- l.dispatchEvent(g);
208
+ let y = new Event(oe);
209
+ l.dispatchEvent(y);
210
210
  }
211
211
  }
212
212
  }
213
- } }, a.createElement("label", { "cmdk-label": "", htmlFor: J.inputId, id: J.labelId, style: it }, x), W(e, (t) => a.createElement(ye.Provider, { value: E }, a.createElement(xe.Provider, { value: J }, t))));
214
- }), Xe = a.forwardRef((e, n) => {
215
- var r, s;
216
- let o = O(), u = a.useRef(null), d = a.useContext(ke), m = U(), x = Ee(e), i = (s = (r = x.current) == null ? void 0 : r.forceMount) != null ? s : d?.forceMount;
217
- P(() => {
218
- if (!i) return m.item(o, d?.id);
219
- }, [i]);
220
- let h = Se(o, u, [e.value, e.children, u], e.keywords), b = oe(), v = M((k) => k.value && k.value === h.current), S = M((k) => i || m.filter() === !1 ? !0 : k.search ? k.filtered.items.get(o) > 0 : !0);
221
- a.useEffect(() => {
213
+ } }, n.createElement("label", { "cmdk-label": "", htmlFor: K.inputId, id: K.labelId, style: dt }, v), Z(e, (t) => n.createElement(ye.Provider, { value: C }, n.createElement(xe.Provider, { value: K }, t))));
214
+ }), Xe = n.forwardRef((e, a) => {
215
+ var r, m;
216
+ let i = T(), u = n.useRef(null), s = n.useContext(ke), f = Y(), v = Se(e), o = (m = (r = v.current) == null ? void 0 : r.forceMount) != null ? m : s?.forceMount;
217
+ z(() => {
218
+ if (!o) return f.item(i, s?.id);
219
+ }, [o]);
220
+ let x = Ee(i, u, [e.value, e.children, u], e.keywords), d = ie(), S = P((k) => k.value && k.value === x.current), E = P((k) => o || f.filter() === !1 ? !0 : k.search ? k.filtered.items.get(i) > 0 : !0);
221
+ n.useEffect(() => {
222
222
  let k = u.current;
223
- if (!(!k || e.disabled)) return k.addEventListener(le, C), () => k.removeEventListener(le, C);
224
- }, [S, e.onSelect, e.disabled]);
225
- function C() {
226
- var k, E;
227
- D(), (E = (k = x.current).onSelect) == null || E.call(k, h.current);
223
+ if (!(!k || e.disabled)) return k.addEventListener(oe, $), () => k.removeEventListener(oe, $);
224
+ }, [E, e.onSelect, e.disabled]);
225
+ function $() {
226
+ var k, C;
227
+ G(), (C = (k = v.current).onSelect) == null || C.call(k, x.current);
228
228
  }
229
- function D() {
230
- b.setState("value", h.current, !0);
229
+ function G() {
230
+ d.setState("value", x.current, !0);
231
231
  }
232
- if (!S) return null;
233
- let { disabled: $, value: L, onSelect: B, forceMount: V, keywords: p, ...I } = e;
234
- return a.createElement(N.div, { ref: G(u, n), ...I, id: o, "cmdk-item": "", role: "option", "aria-disabled": !!$, "aria-selected": !!v, "data-disabled": !!$, "data-selected": !!v, onPointerMove: $ || m.getDisablePointerSelection() ? void 0 : D, onClick: $ ? void 0 : C }, e.children);
235
- }), Ye = a.forwardRef((e, n) => {
236
- let { heading: r, children: s, forceMount: o, ...u } = e, d = O(), m = a.useRef(null), x = a.useRef(null), i = O(), h = U(), b = M((S) => o || h.filter() === !1 ? !0 : S.search ? S.filtered.groups.has(d) : !0);
237
- P(() => h.group(d), []), Se(d, m, [e.value, e.heading, x]);
238
- let v = a.useMemo(() => ({ id: d, forceMount: o }), [o]);
239
- return a.createElement(N.div, { ref: G(m, n), ...u, "cmdk-group": "", role: "presentation", hidden: b ? void 0 : !0 }, r && a.createElement("div", { ref: x, "cmdk-group-heading": "", "aria-hidden": !0, id: i }, r), W(e, (S) => a.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": r ? i : void 0 }, a.createElement(ke.Provider, { value: v }, S))));
240
- }), Qe = a.forwardRef((e, n) => {
241
- let { alwaysRender: r, ...s } = e, o = a.useRef(null), u = M((d) => !d.search);
242
- return !r && !u ? null : a.createElement(N.div, { ref: G(o, n), ...s, "cmdk-separator": "", role: "separator" });
243
- }), Ze = a.forwardRef((e, n) => {
244
- let { onValueChange: r, ...s } = e, o = e.value != null, u = oe(), d = M((i) => i.search), m = M((i) => i.selectedItemId), x = U();
245
- return a.useEffect(() => {
232
+ if (!E) return null;
233
+ let { disabled: g, value: U, onSelect: j, forceMount: H, keywords: L, ...R } = e;
234
+ return n.createElement(D.div, { ref: X(u, a), ...R, id: i, "cmdk-item": "", role: "option", "aria-disabled": !!g, "aria-selected": !!S, "data-disabled": !!g, "data-selected": !!S, onPointerMove: g || f.getDisablePointerSelection() ? void 0 : G, onClick: g ? void 0 : $ }, e.children);
235
+ }), Ye = n.forwardRef((e, a) => {
236
+ let { heading: r, children: m, forceMount: i, ...u } = e, s = T(), f = n.useRef(null), v = n.useRef(null), o = T(), x = Y(), d = P((E) => i || x.filter() === !1 ? !0 : E.search ? E.filtered.groups.has(s) : !0);
237
+ z(() => x.group(s), []), Ee(s, f, [e.value, e.heading, v]);
238
+ let S = n.useMemo(() => ({ id: s, forceMount: i }), [i]);
239
+ return n.createElement(D.div, { ref: X(f, a), ...u, "cmdk-group": "", role: "presentation", hidden: d ? void 0 : !0 }, r && n.createElement("div", { ref: v, "cmdk-group-heading": "", "aria-hidden": !0, id: o }, r), Z(e, (E) => n.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": r ? o : void 0 }, n.createElement(ke.Provider, { value: S }, E))));
240
+ }), Qe = n.forwardRef((e, a) => {
241
+ let { alwaysRender: r, ...m } = e, i = n.useRef(null), u = P((s) => !s.search);
242
+ return !r && !u ? null : n.createElement(D.div, { ref: X(i, a), ...m, "cmdk-separator": "", role: "separator" });
243
+ }), Ze = n.forwardRef((e, a) => {
244
+ let { onValueChange: r, ...m } = e, i = e.value != null, u = ie(), s = P((o) => o.search), f = P((o) => o.selectedItemId), v = Y();
245
+ return n.useEffect(() => {
246
246
  e.value != null && u.setState("search", e.value);
247
- }, [e.value]), a.createElement(N.input, { ref: n, ...s, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": x.listId, "aria-labelledby": x.labelId, "aria-activedescendant": m, id: x.inputId, type: "text", value: o ? e.value : d, onChange: (i) => {
248
- o || u.setState("search", i.target.value), r?.(i.target.value);
247
+ }, [e.value]), n.createElement(D.input, { ref: a, ...m, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": v.listId, "aria-labelledby": v.labelId, "aria-activedescendant": f, id: v.inputId, type: "text", value: i ? e.value : s, onChange: (o) => {
248
+ i || u.setState("search", o.target.value), r?.(o.target.value);
249
249
  } });
250
- }), et = a.forwardRef((e, n) => {
251
- let { children: r, label: s = "Suggestions", ...o } = e, u = a.useRef(null), d = a.useRef(null), m = M((i) => i.selectedItemId), x = U();
252
- return a.useEffect(() => {
253
- if (d.current && u.current) {
254
- let i = d.current, h = u.current, b, v = new ResizeObserver(() => {
255
- b = requestAnimationFrame(() => {
256
- let S = i.offsetHeight;
257
- h.style.setProperty("--cmdk-list-height", S.toFixed(1) + "px");
250
+ }), et = n.forwardRef((e, a) => {
251
+ let { children: r, label: m = "Suggestions", ...i } = e, u = n.useRef(null), s = n.useRef(null), f = P((o) => o.selectedItemId), v = Y();
252
+ return n.useEffect(() => {
253
+ if (s.current && u.current) {
254
+ let o = s.current, x = u.current, d, S = new ResizeObserver(() => {
255
+ d = requestAnimationFrame(() => {
256
+ let E = o.offsetHeight;
257
+ x.style.setProperty("--cmdk-list-height", E.toFixed(1) + "px");
258
258
  });
259
259
  });
260
- return v.observe(i), () => {
261
- cancelAnimationFrame(b), v.unobserve(i);
260
+ return S.observe(o), () => {
261
+ cancelAnimationFrame(d), S.unobserve(o);
262
262
  };
263
263
  }
264
- }, []), a.createElement(N.div, { ref: G(u, n), ...o, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": m, "aria-label": s, id: x.listId }, W(e, (i) => a.createElement("div", { ref: G(d, x.listInnerRef), "cmdk-list-sizer": "" }, i)));
265
- }), tt = a.forwardRef((e, n) => {
266
- let { open: r, onOpenChange: s, overlayClassName: o, contentClassName: u, container: d, ...m } = e;
267
- return a.createElement(Ie, { open: r, onOpenChange: s }, a.createElement(je, { container: d }, a.createElement(Re, { "cmdk-overlay": "", className: o }), a.createElement(Ae, { "aria-label": e.label, "cmdk-dialog": "", className: u }, a.createElement(we, { ref: n, ...m }))));
268
- }), rt = a.forwardRef((e, n) => M((r) => r.filtered.count === 0) ? a.createElement(N.div, { ref: n, ...e, "cmdk-empty": "", role: "presentation" }) : null), nt = a.forwardRef((e, n) => {
269
- let { progress: r, children: s, label: o = "Loading...", ...u } = e;
270
- return a.createElement(N.div, { ref: n, ...u, "cmdk-loading": "", role: "progressbar", "aria-valuenow": r, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": o }, W(e, (d) => a.createElement("div", { "aria-hidden": !0 }, d)));
271
- }), q = Object.assign(we, { List: et, Item: Xe, Input: Ze, Group: Ye, Separator: Qe, Dialog: tt, Empty: rt, Loading: nt });
272
- function at(e, n) {
264
+ }, []), n.createElement(D.div, { ref: X(u, a), ...i, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": f, "aria-label": m, id: v.listId }, Z(e, (o) => n.createElement("div", { ref: X(s, v.listInnerRef), "cmdk-list-sizer": "" }, o)));
265
+ }), tt = n.forwardRef((e, a) => {
266
+ let { open: r, onOpenChange: m, overlayClassName: i, contentClassName: u, container: s, ...f } = e;
267
+ return n.createElement(Ie, { open: r, onOpenChange: m }, n.createElement(je, { container: s }, n.createElement(Re, { "cmdk-overlay": "", className: i }), n.createElement(Ae, { "aria-label": e.label, "cmdk-dialog": "", className: u }, n.createElement(we, { ref: a, ...f }))));
268
+ }), rt = n.forwardRef((e, a) => P((r) => r.filtered.count === 0) ? n.createElement(D.div, { ref: a, ...e, "cmdk-empty": "", role: "presentation" }) : null), at = n.forwardRef((e, a) => {
269
+ let { progress: r, children: m, label: i = "Loading...", ...u } = e;
270
+ return n.createElement(D.div, { ref: a, ...u, "cmdk-loading": "", role: "progressbar", "aria-valuenow": r, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": i }, Z(e, (s) => n.createElement("div", { "aria-hidden": !0 }, s)));
271
+ }), _ = Object.assign(we, { List: et, Item: Xe, Input: Ze, Group: Ye, Separator: Qe, Dialog: tt, Empty: rt, Loading: at });
272
+ function nt(e, a) {
273
273
  let r = e.nextElementSibling;
274
274
  for (; r; ) {
275
- if (r.matches(n)) return r;
275
+ if (r.matches(a)) return r;
276
276
  r = r.nextElementSibling;
277
277
  }
278
278
  }
279
- function lt(e, n) {
279
+ function lt(e, a) {
280
280
  let r = e.previousElementSibling;
281
281
  for (; r; ) {
282
- if (r.matches(n)) return r;
282
+ if (r.matches(a)) return r;
283
283
  r = r.previousElementSibling;
284
284
  }
285
285
  }
286
- function Ee(e) {
287
- let n = a.useRef(e);
288
- return P(() => {
289
- n.current = e;
290
- }), n;
286
+ function Se(e) {
287
+ let a = n.useRef(e);
288
+ return z(() => {
289
+ a.current = e;
290
+ }), a;
291
291
  }
292
- var P = typeof window > "u" ? a.useEffect : a.useLayoutEffect;
293
- function K(e) {
294
- let n = a.useRef();
295
- return n.current === void 0 && (n.current = e()), n;
292
+ var z = typeof window > "u" ? n.useEffect : n.useLayoutEffect;
293
+ function B(e) {
294
+ let a = n.useRef();
295
+ return a.current === void 0 && (a.current = e()), a;
296
296
  }
297
- function M(e) {
298
- let n = oe(), r = () => e(n.snapshot());
299
- return a.useSyncExternalStore(n.subscribe, r, r);
297
+ function P(e) {
298
+ let a = ie(), r = () => e(a.snapshot());
299
+ return n.useSyncExternalStore(a.subscribe, r, r);
300
300
  }
301
- function Se(e, n, r, s = []) {
302
- let o = a.useRef(), u = U();
303
- return P(() => {
304
- var d;
305
- let m = (() => {
306
- var i;
307
- for (let h of r) {
308
- if (typeof h == "string") return h.trim();
309
- if (typeof h == "object" && "current" in h) return h.current ? (i = h.current.textContent) == null ? void 0 : i.trim() : o.current;
301
+ function Ee(e, a, r, m = []) {
302
+ let i = n.useRef(), u = Y();
303
+ return z(() => {
304
+ var s;
305
+ let f = (() => {
306
+ var o;
307
+ for (let x of r) {
308
+ if (typeof x == "string") return x.trim();
309
+ if (typeof x == "object" && "current" in x) return x.current ? (o = x.current.textContent) == null ? void 0 : o.trim() : i.current;
310
310
  }
311
- })(), x = s.map((i) => i.trim());
312
- u.value(e, m, x), (d = n.current) == null || d.setAttribute(F, m), o.current = m;
313
- }), o;
311
+ })(), v = m.map((o) => o.trim());
312
+ u.value(e, f, v), (s = a.current) == null || s.setAttribute(q, f), i.current = f;
313
+ }), i;
314
314
  }
315
315
  var ot = () => {
316
- let [e, n] = a.useState(), r = K(() => /* @__PURE__ */ new Map());
317
- return P(() => {
318
- r.current.forEach((s) => s()), r.current = /* @__PURE__ */ new Map();
319
- }, [e]), (s, o) => {
320
- r.current.set(s, o), n({});
316
+ let [e, a] = n.useState(), r = B(() => /* @__PURE__ */ new Map());
317
+ return z(() => {
318
+ r.current.forEach((m) => m()), r.current = /* @__PURE__ */ new Map();
319
+ }, [e]), (m, i) => {
320
+ r.current.set(m, i), a({});
321
321
  };
322
322
  };
323
- function dt(e) {
324
- let n = e.type;
325
- return typeof n == "function" ? n(e.props) : "render" in n ? n.render(e.props) : e;
323
+ function it(e) {
324
+ let a = e.type;
325
+ return typeof a == "function" ? a(e.props) : "render" in a ? a.render(e.props) : e;
326
326
  }
327
- function W({ asChild: e, children: n }, r) {
328
- return e && a.isValidElement(n) ? a.cloneElement(dt(n), { ref: n.ref }, r(n.props.children)) : r(n);
327
+ function Z({ asChild: e, children: a }, r) {
328
+ return e && n.isValidElement(a) ? n.cloneElement(it(a), { ref: a.ref }, r(a.props.children)) : r(a);
329
329
  }
330
- var it = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
330
+ var dt = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
331
331
  function ut({
332
332
  className: e,
333
- ...n
333
+ ...a
334
334
  }) {
335
- return /* @__PURE__ */ w.jsx(
336
- q,
335
+ return /* @__PURE__ */ b.jsx(
336
+ _,
337
337
  {
338
338
  "data-slot": "command",
339
- className: A(
339
+ className: M(
340
340
  "adm:bg-popover adm:text-popover-foreground adm:flex adm:h-full adm:w-full adm:flex-col adm:overflow-hidden adm:rounded-md",
341
341
  e
342
342
  ),
343
- ...n
343
+ ...a
344
344
  }
345
345
  );
346
346
  }
347
347
  function ct({
348
348
  className: e,
349
- ...n
349
+ ...a
350
350
  }) {
351
- return /* @__PURE__ */ w.jsxs(
351
+ return /* @__PURE__ */ b.jsxs(
352
352
  "div",
353
353
  {
354
354
  "data-slot": "command-input-wrapper",
355
355
  className: "adm:flex adm:h-9 adm:items-center adm:gap-2 adm:border-b adm:px-3",
356
356
  children: [
357
- /* @__PURE__ */ w.jsx(Ke, { className: "adm:size-4 adm:shrink-0 adm:opacity-50" }),
358
- /* @__PURE__ */ w.jsx(
359
- q.Input,
357
+ /* @__PURE__ */ b.jsx(ze, { className: "adm:size-4 adm:shrink-0 adm:opacity-50" }),
358
+ /* @__PURE__ */ b.jsx(
359
+ _.Input,
360
360
  {
361
361
  "data-slot": "command-input",
362
- className: A(
362
+ className: M(
363
363
  "adm:placeholder:text-muted-foreground adm:flex adm:h-10 adm:w-full adm:rounded-md adm:bg-transparent adm:py-3 adm:text-sm adm:outline-hidden adm:disabled:cursor-not-allowed adm:disabled:opacity-50",
364
364
  e
365
365
  ),
366
- ...n
366
+ ...a
367
367
  }
368
368
  )
369
369
  ]
@@ -372,136 +372,173 @@ function ct({
372
372
  }
373
373
  function st({
374
374
  className: e,
375
- ...n
375
+ ...a
376
376
  }) {
377
- return /* @__PURE__ */ w.jsx(
378
- q.List,
377
+ return /* @__PURE__ */ b.jsx(
378
+ _.List,
379
379
  {
380
380
  "data-slot": "command-list",
381
- className: A(
381
+ className: M(
382
382
  "adm:max-h-[300px] adm:scroll-py-1 adm:overflow-x-hidden adm:overflow-y-auto",
383
383
  e
384
384
  ),
385
- ...n
385
+ ...a
386
386
  }
387
387
  );
388
388
  }
389
389
  function mt({
390
390
  className: e,
391
- ...n
391
+ ...a
392
392
  }) {
393
- return /* @__PURE__ */ w.jsx(
394
- q.Empty,
393
+ return /* @__PURE__ */ b.jsx(
394
+ _.Empty,
395
395
  {
396
396
  "data-slot": "command-empty",
397
- className: A("adm:py-6 adm:text-center adm:text-sm", e),
398
- ...n
397
+ className: M("adm:py-6 adm:text-center adm:text-sm", e),
398
+ ...a
399
399
  }
400
400
  );
401
401
  }
402
402
  function ft({
403
403
  className: e,
404
- ...n
404
+ ...a
405
405
  }) {
406
- return /* @__PURE__ */ w.jsx(
407
- q.Group,
406
+ return /* @__PURE__ */ b.jsx(
407
+ _.Group,
408
408
  {
409
409
  "data-slot": "command-group",
410
- className: A(
410
+ className: M(
411
411
  "adm:text-foreground adm:overflow-hidden adm:p-1 adm:**:**:**:**:**:**:[&_[cmdk-group-heading]]:text-muted-foreground adm:**:**:**:**:**:**:[&_[cmdk-group-heading]]:px-2 adm:**:**:**:**:**:**:[&_[cmdk-group-heading]]:py-1.5 adm:**:**:**:**:**:**:[&_[cmdk-group-heading]]:text-xs adm:**:**:**:**:**:**:[&_[cmdk-group-heading]]:font-medium",
412
412
  e
413
413
  ),
414
- ...n
414
+ ...a
415
415
  }
416
416
  );
417
417
  }
418
418
  function pt({
419
419
  className: e,
420
- ...n
420
+ ...a
421
421
  }) {
422
- return /* @__PURE__ */ w.jsx(
423
- q.Item,
422
+ return /* @__PURE__ */ b.jsx(
423
+ _.Item,
424
424
  {
425
425
  "data-slot": "command-item",
426
- className: A(
426
+ className: M(
427
427
  "adm:data-[selected=true]:bg-accent adm:data-[selected=true]:text-accent-foreground adm:[&_svg:not([class*=text-])]:text-muted-foreground adm:relative adm:flex adm:cursor-default adm:items-center adm:gap-2 adm:rounded-sm adm:px-2 adm:py-1.5 adm:text-sm adm:outline-hidden adm:select-none adm:data-[disabled=true]:pointer-events-none adm:data-[disabled=true]:opacity-50 adm:[&_svg]:pointer-events-none adm:[&_svg]:shrink-0 adm:[&_svg:not([class*=size-])]:size-4",
428
428
  e
429
429
  ),
430
- ...n
430
+ ...a
431
431
  }
432
432
  );
433
433
  }
434
434
  function Rt({
435
435
  searchable: e,
436
- multiple: n,
437
- value: r,
438
- onValueChange: s,
439
- labels: o,
440
- options: u,
441
- classNames: d,
442
- selectedFeedback: m = "checkbox"
436
+ multiple: a,
437
+ icon: r,
438
+ showIcon: m,
439
+ value: i,
440
+ onValueChange: u,
441
+ labels: s,
442
+ options: f,
443
+ classNames: v,
444
+ selectedFeedback: o = "checkbox",
445
+ alwaysShowPlaceholder: x = !1,
446
+ renders: d
443
447
  }) {
444
- const [x, i] = fe(!1), [h, b] = fe(n ? [] : ""), v = r !== void 0 ? r : h, C = { ...{
448
+ const [S, E] = fe(!1), [$, G] = fe(a ? [] : ""), g = i !== void 0 ? i : $, j = { ...{
445
449
  placeholder: "Select options...",
446
450
  searchPlaceholder: "Search options...",
447
451
  noItemsFound: "No options found.",
448
452
  multipleSelected: (p) => `${p} options selected`
449
- }, ...o }, D = (p) => {
450
- s ? s(p) : b(p);
451
- }, $ = () => n && Array.isArray(v) ? v.length === 0 ? C.placeholder : v.length === 1 ? u.find((p) => p.value === v[0])?.label : C.multipleSelected?.(v.length) || `${v.length} options selected` : !n && typeof v == "string" && v ? u.find((p) => p.value === v)?.label : C.placeholder, L = (p) => n && Array.isArray(v) ? v.includes(p) : v === p, B = (p) => {
452
- if (n) {
453
- const I = Array.isArray(v) ? v : [], k = I.includes(p) ? I.filter((E) => E !== p) : [...I, p];
454
- D(k);
453
+ }, ...s }, H = (p) => {
454
+ u ? u(p) : G(p);
455
+ }, L = () => a && Array.isArray(g) ? g.length === 0 ? null : g.length === 1 ? f.find((p) => p.value === g[0])?.label : j.multipleSelected?.(g.length) || `${g.length} options selected` : !a && typeof g == "string" && g ? f.find((p) => p.value === g)?.label : null, R = () => a && Array.isArray(g) ? g.length > 0 : typeof g == "string" && g !== "", k = (p) => a && Array.isArray(g) ? g.includes(p) : g === p, C = (p) => {
456
+ if (a) {
457
+ const N = Array.isArray(g) ? g : [], F = N.includes(p) ? N.filter((V) => V !== p) : [...N, p];
458
+ H(F);
455
459
  } else
456
- D(p === v ? "" : p), i(!1);
457
- }, V = (p) => {
458
- const I = L(p);
459
- return m === "check" ? /* @__PURE__ */ w.jsx("span", { className: A("adm:absolute adm:right-2 adm:flex adm:size-3.5 adm:items-center adm:justify-center", d?.check), children: I && /* @__PURE__ */ w.jsx(ze, { className: "adm:size-4" }) }) : /* @__PURE__ */ w.jsx(
460
+ H(p === g ? "" : p), E(!1);
461
+ }, K = (p) => {
462
+ const N = k(p), F = f.find((V) => V.value === p);
463
+ return d?.selectedFeedback ? d.selectedFeedback({
464
+ option: F,
465
+ isSelected: N,
466
+ type: o
467
+ }) : o === "check" ? /* @__PURE__ */ b.jsx("span", { className: M("adm:absolute adm:right-2 adm:flex adm:size-3.5 adm:items-center adm:justify-center", v?.check), children: N && /* @__PURE__ */ b.jsx(Fe, { className: "adm:size-4" }) }) : /* @__PURE__ */ b.jsx(
460
468
  De,
461
469
  {
462
- checked: I,
463
- className: d?.checkbox
470
+ checked: N,
471
+ className: v?.checkbox
464
472
  }
465
473
  );
466
474
  };
467
- return /* @__PURE__ */ w.jsxs(Me, { open: x, onOpenChange: i, children: [
468
- /* @__PURE__ */ w.jsx(Ne, { asChild: !0, children: /* @__PURE__ */ w.jsxs(
475
+ return /* @__PURE__ */ b.jsxs($e, { open: S, onOpenChange: E, children: [
476
+ /* @__PURE__ */ b.jsx(Me, { asChild: !0, children: d?.trigger ? d.trigger({
477
+ open: S,
478
+ value: g,
479
+ displayText: L() ?? null,
480
+ placeholder: j.placeholder || "",
481
+ hasValue: R(),
482
+ icon: r,
483
+ showIcon: m
484
+ }) : /* @__PURE__ */ b.jsxs(
469
485
  Ce,
470
486
  {
471
487
  variant: "outline",
472
488
  role: "combobox",
473
- "aria-expanded": x,
474
- className: A("adm:justify-between adm:font-normal", d?.trigger),
489
+ "aria-expanded": S,
490
+ className: M("adm:justify-between adm:font-normal", v?.trigger),
475
491
  children: [
476
- $(),
477
- /* @__PURE__ */ w.jsx(Le, { className: "adm:size-4 adm:opacity-50" })
492
+ /* @__PURE__ */ b.jsxs("span", { className: "adm:flex adm:items-center adm:gap-2", children: [
493
+ m && r && /* @__PURE__ */ b.jsx(r, { className: "adm:opacity-50" }),
494
+ x && R() && (d?.placeholder ? d.placeholder({
495
+ text: j.placeholder || "",
496
+ hasValue: R()
497
+ }) : /* @__PURE__ */ b.jsx("span", { className: "adm:opacity-70", children: j.placeholder })),
498
+ R() ? d?.displayValue ? d.displayValue({
499
+ text: L() ?? null,
500
+ value: g
501
+ }) : /* @__PURE__ */ b.jsx("span", { children: L() }) : d?.placeholder ? d.placeholder({
502
+ text: j.placeholder || "",
503
+ hasValue: R()
504
+ }) : /* @__PURE__ */ b.jsx("span", { children: j.placeholder })
505
+ ] }),
506
+ d?.triggerIcon ? d.triggerIcon({ open: S }) : /* @__PURE__ */ b.jsx(Le, { className: "adm:size-4 adm:opacity-50" })
478
507
  ]
479
508
  }
480
509
  ) }),
481
- /* @__PURE__ */ w.jsx(Pe, { align: "start", className: A("adm:p-0", d?.popover), children: /* @__PURE__ */ w.jsxs(ut, { className: d?.command, children: [
482
- e && /* @__PURE__ */ w.jsx(
510
+ /* @__PURE__ */ b.jsx(Pe, { align: "start", className: M("adm:p-0", v?.popover), children: /* @__PURE__ */ b.jsxs(ut, { className: v?.command, children: [
511
+ e && (d?.searchInput ? d.searchInput({
512
+ placeholder: j.searchPlaceholder || ""
513
+ }) : /* @__PURE__ */ b.jsx(
483
514
  ct,
484
515
  {
485
- placeholder: C.searchPlaceholder,
486
- className: d?.input
516
+ placeholder: j.searchPlaceholder,
517
+ className: v?.input
487
518
  }
488
- ),
489
- /* @__PURE__ */ w.jsxs(st, { className: d?.list, children: [
490
- /* @__PURE__ */ w.jsx(mt, { className: d?.empty, children: C.noItemsFound }),
491
- /* @__PURE__ */ w.jsx(ft, { className: d?.group, children: u.map((p) => /* @__PURE__ */ w.jsxs(
519
+ )),
520
+ /* @__PURE__ */ b.jsxs(st, { className: v?.list, children: [
521
+ /* @__PURE__ */ b.jsx(mt, { className: v?.empty, children: d?.empty ? d.empty({
522
+ text: j.noItemsFound || ""
523
+ }) : j.noItemsFound }),
524
+ /* @__PURE__ */ b.jsx(ft, { className: v?.group, children: f.map((p) => d?.option ? /* @__PURE__ */ b.jsx("div", { children: d.option({
525
+ option: p,
526
+ isSelected: k(p.value),
527
+ selectedFeedback: o
528
+ }) }, p.value) : /* @__PURE__ */ b.jsxs(
492
529
  pt,
493
530
  {
494
531
  value: p.value,
495
- onSelect: B,
532
+ onSelect: C,
496
533
  disabled: p.disabled,
497
- className: A(
498
- d?.item,
499
- m === "check" && "adm:pr-8"
534
+ className: M(
535
+ v?.item,
536
+ o === "check" && "adm:pr-8"
500
537
  ),
501
538
  children: [
502
- m === "checkbox" && V(p.value),
503
- p.label,
504
- m === "check" && V(p.value)
539
+ o === "checkbox" && K(p.value),
540
+ d?.optionLabel ? d.optionLabel({ option: p }) : p.label,
541
+ o === "check" && K(p.value)
505
542
  ]
506
543
  },
507
544
  p.value