neatkit 0.16.5 → 0.16.7

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 (44) hide show
  1. package/dist/{Button-ZzJbnjNg.js → Button-Dsr1zrKT.js} +1 -1
  2. package/dist/{Button-CYFy6sTv.cjs → Button-DyO8fkk1.cjs} +1 -1
  3. package/dist/Button.cjs +1 -1
  4. package/dist/Button.js +1 -1
  5. package/dist/Checkbox.cjs +1 -1
  6. package/dist/Checkbox.js +1 -1
  7. package/dist/{Icon-BHNINDhB.js → Icon-B9-_-fzr.js} +25 -16
  8. package/dist/{Icon-De6sqmQ9.cjs → Icon-Yl22zVSN.cjs} +1 -1
  9. package/dist/Icon.cjs +1 -1
  10. package/dist/Icon.js +1 -1
  11. package/dist/Input.cjs +1 -1
  12. package/dist/Input.js +1 -1
  13. package/dist/Markdown.cjs +1 -1
  14. package/dist/Markdown.js +7 -2
  15. package/dist/Modal.cjs +1 -1
  16. package/dist/Modal.js +26 -26
  17. package/dist/Popover.cjs +1 -1
  18. package/dist/Popover.js +81 -82
  19. package/dist/Select.cjs +1 -1
  20. package/dist/Select.js +280 -283
  21. package/dist/Sidebar.cjs +1 -1
  22. package/dist/Sidebar.js +21 -21
  23. package/dist/{Table-WlCsBVHC.js → Table-CURYs469.js} +2 -2
  24. package/dist/{Table-DEjAMnG3.cjs → Table-DTxKbMgJ.cjs} +1 -1
  25. package/dist/Table.cjs +1 -1
  26. package/dist/Table.js +1 -1
  27. package/dist/{Tooltip-4RWCnb2Q.js → Tooltip-BuRMZ4p_.js} +35 -35
  28. package/dist/{Tooltip-B2rZmRCs.cjs → Tooltip-tzVg8Bky.cjs} +1 -1
  29. package/dist/Tooltip.cjs +1 -1
  30. package/dist/Tooltip.js +1 -1
  31. package/dist/components/Markdown/utils/security.d.ts +2 -2
  32. package/dist/components/Popover/Popover.d.ts +10 -8
  33. package/dist/components/Portal/hooks/useDismissableLayer.d.ts +7 -4
  34. package/dist/components/Select/components/CustomSelect.d.ts +5 -4
  35. package/dist/components/Select/components/SelectListbox.d.ts +2 -4
  36. package/dist/components/Sidebar/Sidebar.d.ts +1 -1
  37. package/dist/style.css +1 -1
  38. package/dist/{useFocusTrap-BxPazAL6.js → useFocusTrap-BL3fDmTs.js} +1 -1
  39. package/dist/{useFocusTrap-CrMcAu8s.cjs → useFocusTrap-C--8mnsI.cjs} +1 -1
  40. package/dist/usePresence-BYnWctTh.js +232 -0
  41. package/dist/usePresence-HVr855AK.cjs +1 -0
  42. package/package.json +1 -1
  43. package/dist/usePresence-BTRY1_l-.js +0 -212
  44. package/dist/usePresence-Dm0mls5p.cjs +0 -1
package/dist/Select.js CHANGED
@@ -1,118 +1,118 @@
1
1
  "use client";
2
- import { jsx as h, jsxs as O } from "react/jsx-runtime";
3
- import { useRef as S, useEffect as Q, useCallback as I, useMemo as Ee, useId as xe, useState as Y, forwardRef as De } from "react";
4
- import { u as ee } from "./effects-DGbA6Q2O.js";
5
- import { h as le, r as oe } from "./aria-Bv-xVREf.js";
6
- import { a as Oe } from "./reference-CXMr27nM.js";
7
- import { I as G } from "./Icon-BHNINDhB.js";
8
- import { c as Re, d as Le, b as Ne, P as Pe } from "./usePresence-BTRY1_l-.js";
9
- import { c as Ae, u as Te } from "./useAnchoredPosition-xI79veB2.js";
10
- function Se(t) {
11
- const { form: n, onReset: a, resetValue: i, triggerReference: s } = t, r = S(null);
12
- return Q(() => {
13
- var d;
14
- const c = (d = s.current) == null ? void 0 : d.form;
15
- if (!c) return;
16
- function l() {
17
- const u = r.current;
18
- if (u) {
19
- const b = Array.from(u.options), g = b.find(
20
- (y) => y.value === i
21
- ) ?? b[0];
22
- b.forEach((y) => {
23
- y.defaultSelected = y === g;
2
+ import { jsx as m, jsxs as O } from "react/jsx-runtime";
3
+ import { useRef as P, useEffect as X, useCallback as I, useMemo as ke, useId as xe, useState as j, forwardRef as Ee } from "react";
4
+ import { u as z } from "./effects-DGbA6Q2O.js";
5
+ import { h as se, r as le } from "./aria-Bv-xVREf.js";
6
+ import { a as Re } from "./reference-CXMr27nM.js";
7
+ import { I as W } from "./Icon-B9-_-fzr.js";
8
+ import { c as De, d as Oe, b as Le, P as Ne } from "./usePresence-BYnWctTh.js";
9
+ import { c as Ae, u as Pe } from "./useAnchoredPosition-xI79veB2.js";
10
+ function Te(t) {
11
+ const { form: n, onReset: a, resetValue: r, triggerReference: s } = t, l = P(null);
12
+ return X(() => {
13
+ var c;
14
+ const d = (c = s.current) == null ? void 0 : c.form;
15
+ if (!d) return;
16
+ function i() {
17
+ const h = l.current;
18
+ if (h) {
19
+ const y = Array.from(h.options), g = y.find(
20
+ (p) => p.value === r
21
+ ) ?? y[0];
22
+ y.forEach((p) => {
23
+ p.defaultSelected = p === g;
24
24
  });
25
25
  }
26
26
  a();
27
27
  }
28
- return c.addEventListener("reset", l), () => c.removeEventListener("reset", l);
29
- }, [n, a, i, s]), r;
28
+ return d.addEventListener("reset", i), () => d.removeEventListener("reset", i);
29
+ }, [n, a, r, s]), l;
30
30
  }
31
- const $ = 8, B = 4, He = 160, Me = 72;
32
- function Ve(t, n, a, i = "start") {
33
- const s = a.bottom - t.bottom - B - $, r = t.top - a.top - B - $, c = s < He && r > s, l = Math.max(
34
- Me,
35
- c ? r : s
36
- ), d = Math.max(
31
+ const C = 8, U = 4, Se = 160, He = 72;
32
+ function Me(t, n, a, r = "start") {
33
+ const s = a.bottom - t.bottom - U - C, l = t.top - a.top - U - C, d = s < Se && l > s, i = Math.max(
34
+ He,
35
+ d ? l : s
36
+ ), c = Math.max(
37
37
  t.width,
38
38
  (n == null ? void 0 : n.width) ?? t.width
39
- ), u = a.left + $, b = Ae(
40
- i,
39
+ ), h = a.left + C, y = Ae(
40
+ r,
41
41
  t.left,
42
42
  t.width,
43
- d
43
+ c
44
44
  ), g = Math.min(
45
- Math.max(u, b),
45
+ Math.max(h, y),
46
46
  Math.max(
47
- u,
48
- a.right - $ - d
47
+ h,
48
+ a.right - C - c
49
49
  )
50
- ), y = c ? Math.max(
51
- a.top + $,
52
- t.top - B - Math.min((n == null ? void 0 : n.height) ?? l, l)
53
- ) : t.bottom + B;
50
+ ), p = d ? Math.max(
51
+ a.top + C,
52
+ t.top - U - Math.min((n == null ? void 0 : n.height) ?? i, i)
53
+ ) : t.bottom + U;
54
54
  return {
55
55
  left: g,
56
- maxHeight: l,
56
+ maxHeight: i,
57
57
  minWidth: t.width,
58
- top: y
58
+ top: p
59
59
  };
60
60
  }
61
- function Ce(t, n, a, i, s = "start") {
62
- const r = I(
63
- (c) => {
64
- const { panelSize: l, triggerBounds: d, visibleBounds: u } = c;
65
- return Ve(
66
- d,
67
- l,
68
- u,
61
+ function Ve(t, n, a, r, s = "start") {
62
+ const l = I(
63
+ (d) => {
64
+ const { panelSize: i, triggerBounds: c, visibleBounds: h } = d;
65
+ return Me(
66
+ c,
67
+ i,
68
+ h,
69
69
  s
70
70
  );
71
71
  },
72
72
  [s]
73
73
  );
74
- return Te({
74
+ return Pe({
75
75
  active: t,
76
- boundary: i,
77
- fit: r,
76
+ boundary: r,
77
+ fit: l,
78
78
  panel: a,
79
79
  trigger: n
80
80
  });
81
81
  }
82
- const We = 500;
83
- function $e(t) {
84
- const n = S(""), a = S(null), i = S(null);
85
- return Q(() => () => {
86
- const s = i.current;
82
+ const Ce = 500;
83
+ function We(t) {
84
+ const n = P(""), a = P(null), r = P(null);
85
+ return X(() => () => {
86
+ const s = r.current;
87
87
  s && a.current !== null && s.clearTimeout(a.current);
88
88
  }, []), I((s) => {
89
- var d;
90
- const r = (d = t.current) == null ? void 0 : d.ownerDocument.defaultView;
91
- if (!r) return null;
92
- i.current = r;
93
- const c = n.current + s, l = Array.from(c).every((u) => u === s);
94
- return n.current = l ? s : c, a.current !== null && r.clearTimeout(a.current), a.current = r.setTimeout(() => {
89
+ var c;
90
+ const l = (c = t.current) == null ? void 0 : c.ownerDocument.defaultView;
91
+ if (!l) return null;
92
+ r.current = l;
93
+ const d = n.current + s, i = Array.from(d).every((h) => h === s);
94
+ return n.current = i ? s : d, a.current !== null && l.clearTimeout(a.current), a.current = l.setTimeout(() => {
95
95
  n.current = "", a.current = null;
96
- }, We), n.current;
96
+ }, Ce), n.current;
97
97
  }, [t]);
98
98
  }
99
- function z(t, n, a) {
99
+ function Z(t, n, a) {
100
100
  if (t.length === 0) return -1;
101
- for (let i = 1; i <= t.length; i += 1) {
102
- const s = (n + a * i + t.length) % t.length;
101
+ for (let r = 1; r <= t.length; r += 1) {
102
+ const s = (n + a * r + t.length) % t.length;
103
103
  if (!t[s].disabled) return s;
104
104
  }
105
105
  return -1;
106
106
  }
107
- function Ge(t, n, a) {
108
- for (let i = 1; i <= t.length; i += 1) {
109
- const s = (a + i + t.length) % t.length, r = t[s];
110
- if (!r.disabled && r.label.toLocaleLowerCase().startsWith(n))
107
+ function $e(t, n, a) {
108
+ for (let r = 1; r <= t.length; r += 1) {
109
+ const s = (a + r + t.length) % t.length, l = t[s];
110
+ if (!l.disabled && l.label.toLocaleLowerCase().startsWith(n))
111
111
  return s;
112
112
  }
113
113
  return -1;
114
114
  }
115
- function Ke(t) {
115
+ function Ge(t) {
116
116
  const n = /* @__PURE__ */ new Set();
117
117
  t.forEach((a) => {
118
118
  if (n.has(a.value))
@@ -120,282 +120,280 @@ function Ke(t) {
120
120
  n.add(a.value);
121
121
  });
122
122
  }
123
- function qe(t) {
123
+ function Ke(t) {
124
124
  const {
125
125
  active: n,
126
126
  align: a,
127
- closeOnEscape: i,
128
- closeOnOutsideInteraction: s,
129
127
  highlightedIndex: r,
130
- id: c,
128
+ id: s,
131
129
  listboxReference: l,
132
130
  onEscapeDismiss: d,
133
- onEscapeKeyDown: u,
134
- onHighlight: b,
135
- onOutsideDismiss: g,
131
+ onEscapeKeyDown: i,
132
+ onHighlight: c,
133
+ onOutsideDismiss: h,
136
134
  onPointerDownOutside: y,
137
- onSelect: R,
138
- options: L,
139
- ownerDocument: H,
140
- position: E,
141
- selectedValue: x,
142
- state: N,
143
- triggerReference: K
144
- } = t, m = S(null), q = ee("Select").boundaryElement, D = Re(!0, q), F = Ee(
145
- () => [K, m],
146
- [K]
147
- ), j = I(
148
- (f) => {
149
- m.current = f, l(f);
135
+ onSelect: g,
136
+ options: p,
137
+ ownerDocument: R,
138
+ persistent: Y,
139
+ position: w,
140
+ selectedValue: k,
141
+ state: B,
142
+ triggerReference: f
143
+ } = t, $ = P(null), T = z("Select").boundaryElement, D = De(!0, T), G = ke(
144
+ () => [f, $],
145
+ [f]
146
+ ), K = I(
147
+ (u) => {
148
+ $.current = u, l(u);
150
149
  },
151
150
  [l]
152
151
  );
153
- return Le({
152
+ return Oe({
154
153
  active: n,
155
- boundaries: F,
156
- boundary: q,
157
- dismissOnEscape: i,
158
- dismissOnPointerDownOutside: s,
154
+ boundaries: G,
155
+ boundary: T,
156
+ dismissOnEscape: !0,
157
+ dismissOnOutsideInteraction: Y ? "none" : "pass-through",
159
158
  layerId: D.id,
160
159
  onEscapeDismiss: d,
161
- onEscapeKeyDown: u,
160
+ onEscapeKeyDown: i,
161
+ onOutsideDismiss: h,
162
162
  onPointerDownOutside: y,
163
- onPointerDownOutsideDismiss: g,
164
- ownerDocument: H
165
- }), /* @__PURE__ */ h(
163
+ ownerDocument: R
164
+ }), /* @__PURE__ */ m(
166
165
  "div",
167
166
  {
168
167
  "aria-hidden": n ? void 0 : !0,
169
- "aria-labelledby": c,
168
+ "aria-labelledby": s,
170
169
  className: "nk-select__listbox",
171
170
  "data-align": a,
172
- "data-state": N,
173
- id: `${c}-listbox`,
174
- ref: j,
171
+ "data-state": B,
172
+ id: `${s}-listbox`,
173
+ ref: K,
175
174
  role: "listbox",
176
- style: E ? {
177
- left: E.left,
178
- maxHeight: E.maxHeight,
179
- minWidth: E.minWidth,
180
- top: E.top,
175
+ style: w ? {
176
+ left: w.left,
177
+ maxHeight: w.maxHeight,
178
+ minWidth: w.minWidth,
179
+ top: w.top,
181
180
  zIndex: D.zIndex
182
181
  } : { visibility: "hidden", zIndex: D.zIndex },
183
- children: L.map((f, M) => /* @__PURE__ */ O(
182
+ children: p.map((u, S) => /* @__PURE__ */ O(
184
183
  "div",
185
184
  {
186
- "aria-disabled": f.disabled || void 0,
187
- "aria-selected": f.value === x,
185
+ "aria-disabled": u.disabled || void 0,
186
+ "aria-selected": u.value === k,
188
187
  className: "nk-select__option",
189
- "data-highlighted": M === r || void 0,
190
- "data-selected": f.value === x || void 0,
191
- id: `${c}-option-${M}`,
192
- onPointerDown: (J) => {
193
- J.preventDefault(), f.disabled || R(f);
188
+ "data-highlighted": S === r || void 0,
189
+ "data-selected": u.value === k || void 0,
190
+ id: `${s}-option-${S}`,
191
+ onPointerDown: (Q) => {
192
+ Q.preventDefault(), u.disabled || g(u);
194
193
  },
195
194
  onPointerMove: () => {
196
- f.disabled || b(M);
195
+ u.disabled || c(S);
197
196
  },
198
197
  role: "option",
199
198
  children: [
200
- f.icon ? /* @__PURE__ */ h(G, { type: f.icon }) : null,
201
- /* @__PURE__ */ h("span", { className: "nk-select__option-label", children: f.label }),
202
- f.value === x ? /* @__PURE__ */ h(G, { className: "nk-select__check", type: "checkmark" }) : null
199
+ u.icon ? /* @__PURE__ */ m(W, { type: u.icon }) : null,
200
+ /* @__PURE__ */ m("span", { className: "nk-select__option-label", children: u.label }),
201
+ u.value === k ? /* @__PURE__ */ m(W, { className: "nk-select__check", type: "checkmark" }) : null
203
202
  ]
204
203
  },
205
- f.value
204
+ u.value
206
205
  ))
207
206
  }
208
207
  );
209
208
  }
210
- function Fe(t, n, a) {
211
- n.current = t, Oe(a, t);
209
+ function qe(t, n, a) {
210
+ n.current = t, Re(a, t);
212
211
  }
213
- function je(t) {
214
- var ae;
212
+ function Fe(t) {
213
+ var ne;
215
214
  const {
216
215
  "aria-invalid": n,
217
216
  align: a = "start",
218
- className: i,
219
- closeOnEscape: s = !0,
220
- closeOnOutsideInteraction: r = !0,
221
- defaultValue: c = "",
217
+ className: r,
218
+ defaultValue: s = "",
222
219
  disabled: l = !1,
223
220
  displayOverride: d,
224
- form: u,
225
- forwardedReference: b,
226
- id: g,
221
+ form: i,
222
+ forwardedReference: c,
223
+ id: h,
227
224
  invalid: y = !1,
228
- name: R,
229
- onChange: L,
230
- onClick: H,
231
- onEscapeKeyDown: E,
232
- onKeyDown: x,
233
- onOpenChange: N,
234
- onPointerDownOutside: K,
235
- options: m,
236
- placeholder: q,
225
+ name: g,
226
+ onChange: p,
227
+ onClick: R,
228
+ onEscapeKeyDown: Y,
229
+ onKeyDown: w,
230
+ onOpenChange: k,
231
+ onPointerDownOutside: B,
232
+ options: f,
233
+ placeholder: $,
234
+ persistent: T = !1,
237
235
  required: D = !1,
238
- style: F,
239
- value: j,
240
- width: f,
241
- ...M
236
+ style: G,
237
+ value: K,
238
+ width: u,
239
+ ...S
242
240
  } = t;
243
- Ke(m);
244
- const J = xe(), P = g ?? J, w = S(null), [V, ie] = Y(null), [p, re] = Y(!1), [_, C] = Y(-1), [ce, te] = Y(c), A = j !== void 0, T = A ? j : ce, de = m.find(
245
- (e) => e.value === T
246
- ), ue = y || le(n), fe = oe(y, n), Z = Ne(p), W = ((ae = w.current) == null ? void 0 : ae.ownerDocument) ?? (typeof document > "u" ? null : document), me = ee("Select").boundaryElement, he = Ce(
247
- Z.present,
248
- w.current,
249
- V,
250
- me,
241
+ Ge(f);
242
+ const Q = xe(), L = h ?? Q, _ = P(null), [H, oe] = j(null), [v, re] = j(!1), [x, M] = j(-1), [ie, ee] = j(s), N = K !== void 0, A = N ? K : ie, ce = f.find(
243
+ (e) => e.value === A
244
+ ), de = y || se(n), ue = le(y, n), J = Le(v), V = ((ne = _.current) == null ? void 0 : ne.ownerDocument) ?? (typeof document > "u" ? null : document), fe = z("Select").boundaryElement, me = Ve(
245
+ J.present,
246
+ _.current,
247
+ H,
248
+ fe,
251
249
  a
252
- ), pe = $e(w), ve = f === void 0 ? F : { ...F, width: f }, U = d ?? de, be = I(
253
- (e) => Fe(
250
+ ), he = We(_), pe = u === void 0 ? G : { ...G, width: u }, q = d ?? ce, ve = I(
251
+ (e) => qe(
254
252
  e,
255
- w,
256
- b
253
+ _,
254
+ c
257
255
  ),
258
- [b]
259
- ), v = I((e) => {
260
- p !== e && (re(e), N == null || N(e));
261
- }, [N, p]), ye = I(() => {
262
- A || te(c), v(!1);
263
- }, [c, A, v]), Ie = Se({
264
- form: u,
265
- onReset: ye,
266
- resetValue: A ? T : c,
267
- triggerReference: w
268
- }), X = I((e = 1) => {
269
- const o = m.findIndex(
270
- (se) => se.value === T && !se.disabled
271
- ), k = e === 1 ? -1 : m.length;
272
- C(
273
- o >= 0 ? o : z(m, k, e)
274
- ), v(!0);
275
- }, [m, T, v]), ne = I((e) => {
256
+ [c]
257
+ ), b = I((e) => {
258
+ v !== e && (re(e), k == null || k(e));
259
+ }, [k, v]), be = I(() => {
260
+ N || ee(s), b(!1);
261
+ }, [s, N, b]), ye = Te({
262
+ form: i,
263
+ onReset: be,
264
+ resetValue: N ? A : s,
265
+ triggerReference: _
266
+ }), F = I((e = 1) => {
267
+ const o = f.findIndex(
268
+ (ae) => ae.value === A && !ae.disabled
269
+ ), E = e === 1 ? -1 : f.length;
270
+ M(
271
+ o >= 0 ? o : Z(f, E, e)
272
+ ), b(!0);
273
+ }, [f, A, b]), te = I((e) => {
276
274
  var o;
277
- l || e.disabled || (A || te(e.value), v(!1), (o = w.current) == null || o.focus(), L == null || L(e.value));
278
- }, [l, A, L, v]), ge = I(() => {
275
+ l || e.disabled || (N || ee(e.value), b(!1), (o = _.current) == null || o.focus(), p == null || p(e.value));
276
+ }, [l, N, p, b]), ge = I(() => {
279
277
  var e;
280
- v(!1), (e = w.current) == null || e.focus();
281
- }, [v]), we = I(() => {
282
- v(!1);
283
- }, [v]);
284
- function _e(e) {
285
- H == null || H(e), !(e.defaultPrevented || l) && (p ? v(!1) : X());
278
+ b(!1), (e = _.current) == null || e.focus();
279
+ }, [b]), Ie = I(() => {
280
+ b(!1);
281
+ }, [b]);
282
+ function we(e) {
283
+ R == null || R(e), !(e.defaultPrevented || l) && (v ? b(!1) : F());
286
284
  }
287
- function ke(e) {
288
- if (x == null || x(e), !(e.defaultPrevented || l)) {
285
+ function _e(e) {
286
+ if (w == null || w(e), !(e.defaultPrevented || l)) {
289
287
  if (e.key === "ArrowDown" || e.key === "ArrowUp") {
290
288
  e.preventDefault();
291
289
  const o = e.key === "ArrowDown" ? 1 : -1;
292
- p ? C(
293
- (k) => z(m, k, o)
294
- ) : X(o);
290
+ v ? M(
291
+ (E) => Z(f, E, o)
292
+ ) : F(o);
295
293
  return;
296
294
  }
297
295
  if (e.key === "Home" || e.key === "End") {
298
- if (e.preventDefault(), !p) X(e.key === "Home" ? 1 : -1);
296
+ if (e.preventDefault(), !v) F(e.key === "Home" ? 1 : -1);
299
297
  else {
300
- const o = e.key === "Home" ? 1 : -1, k = o === 1 ? -1 : m.length;
301
- C(
302
- z(m, k, o)
298
+ const o = e.key === "Home" ? 1 : -1, E = o === 1 ? -1 : f.length;
299
+ M(
300
+ Z(f, E, o)
303
301
  );
304
302
  }
305
303
  return;
306
304
  }
307
305
  if (e.key === "Enter" || e.key === " ") {
308
306
  e.preventDefault();
309
- const o = m[_];
310
- p && o ? ne(o) : p || X();
307
+ const o = f[x];
308
+ v && o ? te(o) : v || F();
311
309
  return;
312
310
  }
313
311
  if (e.key === "Tab") {
314
- v(!1);
312
+ T || b(!1);
315
313
  return;
316
314
  }
317
315
  if (e.key.length === 1 && !e.altKey && !e.ctrlKey && !e.metaKey) {
318
- const o = pe(e.key.toLocaleLowerCase());
316
+ const o = he(e.key.toLocaleLowerCase());
319
317
  if (o === null) return;
320
- const k = Ge(
321
- m,
318
+ const E = $e(
319
+ f,
322
320
  o,
323
- _
321
+ x
324
322
  );
325
- k >= 0 && (e.preventDefault(), p || v(!0), C(k));
323
+ E >= 0 && (e.preventDefault(), v || b(!0), M(E));
326
324
  }
327
325
  }
328
326
  }
329
- return Q(() => {
330
- l && v(!1);
331
- }, [l, v]), Q(() => {
327
+ return X(() => {
328
+ l && b(!1);
329
+ }, [l, b]), X(() => {
332
330
  var e;
333
- if (p && _ >= 0) {
334
- const o = W == null ? void 0 : W.getElementById(
335
- `${P}-option-${_}`
331
+ if (v && x >= 0) {
332
+ const o = V == null ? void 0 : V.getElementById(
333
+ `${L}-option-${x}`
336
334
  );
337
- o && (V != null && V.contains(o)) && ((e = o.scrollIntoView) == null || e.call(o, { block: "nearest" }));
335
+ o && (H != null && H.contains(o)) && ((e = o.scrollIntoView) == null || e.call(o, { block: "nearest" }));
338
336
  }
339
- }, [_, P, V, p]), /* @__PURE__ */ O(
337
+ }, [x, L, H, v]), /* @__PURE__ */ O(
340
338
  "span",
341
339
  {
342
- className: ["nk-select", i].filter(Boolean).join(" "),
340
+ className: ["nk-select", r].filter(Boolean).join(" "),
343
341
  "data-disabled": l || void 0,
344
- "data-invalid": ue || void 0,
342
+ "data-invalid": de || void 0,
345
343
  "data-mode": "custom",
346
- "data-open": p || void 0,
347
- style: ve,
344
+ "data-open": v || void 0,
345
+ style: pe,
348
346
  children: [
349
347
  /* @__PURE__ */ O(
350
348
  "button",
351
349
  {
352
- ...M,
353
- ref: be,
354
- "aria-activedescendant": p && _ >= 0 ? `${P}-option-${_}` : void 0,
355
- "aria-controls": `${P}-listbox`,
356
- "aria-expanded": p,
350
+ ...S,
351
+ ref: ve,
352
+ "aria-activedescendant": v && x >= 0 ? `${L}-option-${x}` : void 0,
353
+ "aria-controls": `${L}-listbox`,
354
+ "aria-expanded": v,
357
355
  "aria-haspopup": "listbox",
358
- "aria-invalid": fe,
356
+ "aria-invalid": ue,
359
357
  "aria-required": D || void 0,
360
358
  "aria-autocomplete": "none",
361
359
  className: "nk-select__trigger",
362
360
  disabled: l,
363
- form: u,
364
- id: P,
365
- onClick: _e,
366
- onKeyDown: ke,
361
+ form: i,
362
+ id: L,
363
+ onClick: we,
364
+ onKeyDown: _e,
367
365
  role: "combobox",
368
366
  type: "button",
369
367
  children: [
370
- U ? /* @__PURE__ */ O("span", { className: "nk-select__value", children: [
371
- U.icon ? /* @__PURE__ */ h(G, { type: U.icon }) : null,
372
- /* @__PURE__ */ h("span", { className: "nk-select__value-label", children: U.label })
373
- ] }) : /* @__PURE__ */ h("span", { className: "nk-select__placeholder", children: q }),
374
- /* @__PURE__ */ h(G, { className: "nk-select__icon", type: "chevron-down" })
368
+ q ? /* @__PURE__ */ O("span", { className: "nk-select__value", children: [
369
+ q.icon ? /* @__PURE__ */ m(W, { type: q.icon }) : null,
370
+ /* @__PURE__ */ m("span", { className: "nk-select__value-label", children: q.label })
371
+ ] }) : /* @__PURE__ */ m("span", { className: "nk-select__placeholder", children: $ }),
372
+ /* @__PURE__ */ m(W, { className: "nk-select__icon", type: "chevron-down" })
375
373
  ]
376
374
  }
377
375
  ),
378
- R || D ? /* @__PURE__ */ O(
376
+ g || D ? /* @__PURE__ */ O(
379
377
  "select",
380
378
  {
381
- ref: Ie,
379
+ ref: ye,
382
380
  "aria-hidden": "true",
383
381
  className: "nk-select__form-control",
384
382
  disabled: l,
385
- form: u,
386
- name: R,
383
+ form: i,
384
+ name: g,
387
385
  onChange: () => {
388
386
  },
389
387
  onInvalid: (e) => {
390
388
  var o;
391
- e.preventDefault(), (o = w.current) == null || o.focus();
389
+ e.preventDefault(), (o = _.current) == null || o.focus();
392
390
  },
393
391
  required: D,
394
392
  tabIndex: -1,
395
- value: T,
393
+ value: A,
396
394
  children: [
397
- /* @__PURE__ */ h("option", { value: "" }),
398
- m.map((e) => /* @__PURE__ */ h(
395
+ /* @__PURE__ */ m("option", { value: "" }),
396
+ f.map((e) => /* @__PURE__ */ m(
399
397
  "option",
400
398
  {
401
399
  disabled: e.disabled,
@@ -407,88 +405,87 @@ function je(t) {
407
405
  ]
408
406
  }
409
407
  ) : null,
410
- Z.present && W ? /* @__PURE__ */ h(Pe, { children: /* @__PURE__ */ h(
411
- qe,
408
+ J.present && V ? /* @__PURE__ */ m(Ne, { children: /* @__PURE__ */ m(
409
+ Ke,
412
410
  {
413
- active: p,
411
+ active: v,
414
412
  align: a,
415
- closeOnEscape: s,
416
- closeOnOutsideInteraction: r,
417
- highlightedIndex: _,
418
- id: P,
419
- listboxReference: ie,
413
+ highlightedIndex: x,
414
+ id: L,
415
+ listboxReference: oe,
420
416
  onEscapeDismiss: ge,
421
- onEscapeKeyDown: E,
422
- onHighlight: C,
423
- onOutsideDismiss: we,
424
- onPointerDownOutside: K,
425
- onSelect: ne,
426
- options: m,
427
- ownerDocument: W,
428
- position: he,
429
- selectedValue: T,
430
- state: Z.state === "closing" ? "closing" : "open",
431
- triggerReference: w
417
+ onEscapeKeyDown: Y,
418
+ onHighlight: M,
419
+ onOutsideDismiss: Ie,
420
+ onPointerDownOutside: B,
421
+ onSelect: te,
422
+ options: f,
423
+ ownerDocument: V,
424
+ persistent: T,
425
+ position: me,
426
+ selectedValue: A,
427
+ state: J.state === "closing" ? "closing" : "open",
428
+ triggerReference: _
432
429
  }
433
430
  ) }) : null
434
431
  ]
435
432
  }
436
433
  );
437
434
  }
438
- function Ue(t) {
435
+ function je(t) {
439
436
  const {
440
437
  "aria-invalid": n,
441
438
  children: a,
442
- className: i,
439
+ className: r,
443
440
  defaultValue: s,
444
- disabled: r = !1,
445
- forwardedReference: c,
446
- invalid: l = !1,
447
- placeholder: d,
448
- style: u,
449
- value: b,
441
+ disabled: l = !1,
442
+ forwardedReference: d,
443
+ invalid: i = !1,
444
+ placeholder: c,
445
+ style: h,
446
+ value: y,
450
447
  ...g
451
- } = t, y = oe(l, n), R = l || le(n);
448
+ } = t, p = le(i, n), R = i || se(n);
452
449
  return /* @__PURE__ */ O(
453
450
  "span",
454
451
  {
455
- className: ["nk-select", i].filter(Boolean).join(" "),
456
- "data-disabled": r || void 0,
452
+ className: ["nk-select", r].filter(Boolean).join(" "),
453
+ "data-disabled": l || void 0,
457
454
  "data-invalid": R || void 0,
458
455
  "data-mode": "native",
459
- style: u,
456
+ style: h,
460
457
  children: [
461
458
  /* @__PURE__ */ O(
462
459
  "select",
463
460
  {
464
461
  ...g,
465
- ref: c,
466
- "aria-invalid": y,
462
+ ref: d,
463
+ "aria-invalid": p,
467
464
  className: "nk-select__control",
468
- defaultValue: b === void 0 ? s ?? (d !== void 0 ? "" : void 0) : void 0,
469
- disabled: r,
470
- value: b,
465
+ defaultValue: y === void 0 ? s ?? (c !== void 0 ? "" : void 0) : void 0,
466
+ disabled: l,
467
+ value: y,
471
468
  children: [
472
- d !== void 0 ? /* @__PURE__ */ h("option", { disabled: !0, value: "", children: d }) : null,
469
+ c !== void 0 ? /* @__PURE__ */ m("option", { disabled: !0, value: "", children: c }) : null,
473
470
  a
474
471
  ]
475
472
  }
476
473
  ),
477
- /* @__PURE__ */ h(G, { className: "nk-select__icon", type: "chevron-down" })
474
+ /* @__PURE__ */ m(W, { className: "nk-select__icon", type: "chevron-down" })
478
475
  ]
479
476
  }
480
477
  );
481
478
  }
482
- const tt = De(function(n, a) {
483
- const { options: i } = n;
484
- return ee("Select"), i !== void 0 ? /* @__PURE__ */ h(
485
- je,
479
+ const et = Ee(function(n, a) {
480
+ const { options: r } = n;
481
+ return z("Select"), r !== void 0 ? /* @__PURE__ */ m(
482
+ Fe,
486
483
  {
487
484
  ...n,
488
485
  forwardedReference: a
489
486
  }
490
- ) : /* @__PURE__ */ h(
491
- Ue,
487
+ ) : /* @__PURE__ */ m(
488
+ je,
492
489
  {
493
490
  ...n,
494
491
  forwardedReference: a
@@ -496,5 +493,5 @@ const tt = De(function(n, a) {
496
493
  );
497
494
  });
498
495
  export {
499
- tt as default
496
+ et as default
500
497
  };