neatkit 0.15.3 → 0.16.0

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 (39) hide show
  1. package/dist/{Button-DdxB1ps7.js → Button-DpsjwCjJ.js} +1 -1
  2. package/dist/{Button-pinr6Woy.cjs → Button-ysPCQKRu.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-BphC5b-i.cjs +1 -0
  8. package/dist/{Icon-DK4tkZtF.js → Icon-Dbh4PSBI.js} +145 -99
  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 +1 -1
  15. package/dist/Modal.cjs +1 -1
  16. package/dist/Modal.js +1 -1
  17. package/dist/Select.cjs +1 -1
  18. package/dist/Select.js +1 -1
  19. package/dist/Sidebar.cjs +1 -1
  20. package/dist/Sidebar.js +274 -242
  21. package/dist/Skeleton-CBS-MN5x.cjs +1 -0
  22. package/dist/Skeleton-CEWiIR1S.js +37 -0
  23. package/dist/Skeleton.cjs +1 -1
  24. package/dist/Skeleton.js +2 -29
  25. package/dist/Table-CXX2U8UT.cjs +1 -0
  26. package/dist/{Table-DdTjtnRE.js → Table-DfckcbhA.js} +91 -89
  27. package/dist/Table.cjs +1 -1
  28. package/dist/Table.js +1 -1
  29. package/dist/components/Icon/icons/BinaryIcon.d.ts +11 -0
  30. package/dist/components/Icon/icons/TrashIcon.d.ts +11 -0
  31. package/dist/components/Icon/utils/registry.d.ts +2 -0
  32. package/dist/components/Sidebar/components/SidebarUser.d.ts +2 -2
  33. package/dist/components/Skeleton/Skeleton.d.ts +18 -7
  34. package/dist/components/Table/Table.d.ts +6 -0
  35. package/dist/components/Table/index.d.ts +1 -1
  36. package/dist/style.css +1 -1
  37. package/package.json +1 -1
  38. package/dist/Icon-CgQ62bgw.cjs +0 -1
  39. package/dist/Table-DBkiHOd0.cjs +0 -1
package/dist/Sidebar.js CHANGED
@@ -1,27 +1,27 @@
1
1
  "use client";
2
- import { jsx as p, jsxs as D, Fragment as q } from "react/jsx-runtime";
3
- import { useCallback as _, useSyncExternalStore as le, forwardRef as R, useId as ce, createElement as ye, useState as w, useRef as I, Children as Se, isValidElement as re, Fragment as de, cloneElement as $, useContext as _e, useMemo as te, useEffect as ae } from "react";
2
+ import { jsx as u, jsxs as I, Fragment as le } from "react/jsx-runtime";
3
+ import { useCallback as _, useSyncExternalStore as ce, forwardRef as O, useId as de, createElement as Se, useState as w, useRef as L, Children as _e, isValidElement as re, Fragment as ue, cloneElement as $, useContext as ke, useMemo as te, useEffect as ae } from "react";
4
4
  import { u as K, a as M } from "./effects-DGbA6Q2O.js";
5
- import { g as Ee, a as ue } from "./reference-CXMr27nM.js";
6
- import { F as se, c as ke, d as Ce, b as Ne, P as oe } from "./usePresence-BTRY1_l-.js";
7
- import { B as Y } from "./Button-DdxB1ps7.js";
5
+ import { g as Ee, a as fe } from "./reference-CXMr27nM.js";
6
+ import { F as se, c as Ce, d as Ne, b as Pe, P as ie } from "./usePresence-BTRY1_l-.js";
7
+ import { B as Y } from "./Button-DpsjwCjJ.js";
8
8
  import { T as V } from "./Text-rN6iDo0V.js";
9
- import { u as Pe } from "./useFocusTrap-BxPazAL6.js";
10
- import { u as Te } from "./useScrollLock-Drd7OZRC.js";
11
- import { m as Ie } from "./aria-Bv-xVREf.js";
12
- import { r as Le } from "./useFloatingPosition-DktY7k-t.js";
13
- import { A as Re } from "./Avatar-DjDCFqNG.js";
14
- import { S as Be } from "./Spinner-CmxlDlOk.js";
15
- import { T as Oe } from "./Tooltip-4RWCnb2Q.js";
9
+ import { u as Te } from "./useFocusTrap-BxPazAL6.js";
10
+ import { u as Ie } from "./useScrollLock-Drd7OZRC.js";
11
+ import { m as Le } from "./aria-Bv-xVREf.js";
12
+ import { r as Be } from "./useFloatingPosition-DktY7k-t.js";
13
+ import { A as Oe } from "./Avatar-DjDCFqNG.js";
14
+ import { S as z } from "./Skeleton-CEWiIR1S.js";
15
+ import { T as Re } from "./Tooltip-4RWCnb2Q.js";
16
16
  import { b as Fe } from "./units-CMj64udI.js";
17
17
  function xe(t) {
18
- const { label: n, onToggle: e, panelId: r, reference: u, side: l, sidebarOpen: o } = t;
19
- return /* @__PURE__ */ p(
18
+ const { label: n, onToggle: e, panelId: r, reference: f, side: l, sidebarOpen: i } = t;
19
+ return /* @__PURE__ */ u(
20
20
  Y,
21
21
  {
22
- ref: u,
22
+ ref: f,
23
23
  "aria-controls": r,
24
- "aria-expanded": o,
24
+ "aria-expanded": i,
25
25
  "aria-haspopup": "dialog",
26
26
  "aria-label": n,
27
27
  className: "nk-sidebar__fallback-trigger",
@@ -34,7 +34,7 @@ function xe(t) {
34
34
  );
35
35
  }
36
36
  const H = /* @__PURE__ */ new WeakMap();
37
- function fe(t) {
37
+ function be(t) {
38
38
  const n = H.get(t);
39
39
  if (n) return n;
40
40
  const e = {
@@ -45,8 +45,8 @@ function fe(t) {
45
45
  return H.set(t, e), e;
46
46
  }
47
47
  function De(t, n, e) {
48
- const r = fe(t);
49
- return r.owner !== null && r.owner !== n ? !1 : (r.owner = n, r.state = e, r.listeners.forEach((u) => u()), !0);
48
+ const r = be(t);
49
+ return r.owner !== null && r.owner !== n ? !1 : (r.owner = n, r.state = e, r.listeners.forEach((f) => f()), !0);
50
50
  }
51
51
  function we(t, n) {
52
52
  const e = H.get(t);
@@ -59,7 +59,7 @@ function Ae(t) {
59
59
  function je(t, n) {
60
60
  if (!t) return () => {
61
61
  };
62
- const e = fe(t);
62
+ const e = be(t);
63
63
  return e.listeners.add(n), () => {
64
64
  e.listeners.delete(n);
65
65
  };
@@ -68,172 +68,172 @@ const Me = () => {
68
68
  };
69
69
  function A(t) {
70
70
  const n = K(t).boundaryElement, e = _(
71
- (u) => je(n, u),
71
+ (f) => je(n, f),
72
72
  [n]
73
73
  ), r = _(() => Ae(n), [n]);
74
- return le(e, r, Me);
74
+ return ce(e, r, Me);
75
75
  }
76
76
  function U(t, n) {
77
77
  return t === "both" || t === (n === "overlay" ? "overlay" : "inline");
78
78
  }
79
- const be = R(
79
+ const pe = O(
80
80
  function(n, e) {
81
- const { children: r, className: u, presentation: l = "both", ...o } = n, a = A("Sidebar.Footer");
82
- return U(l, a == null ? void 0 : a.presentation) ? /* @__PURE__ */ p(
81
+ const { children: r, className: f, presentation: l = "both", ...i } = n, a = A("Sidebar.Footer");
82
+ return U(l, a == null ? void 0 : a.presentation) ? /* @__PURE__ */ u(
83
83
  "div",
84
84
  {
85
- ...o,
85
+ ...i,
86
86
  ref: e,
87
- className: ["nk-sidebar__footer", u].filter(Boolean).join(" "),
87
+ className: ["nk-sidebar__footer", f].filter(Boolean).join(" "),
88
88
  children: r
89
89
  }
90
90
  ) : null;
91
91
  }
92
- ), He = R(
92
+ ), He = O(
93
93
  function(n, e) {
94
94
  const {
95
95
  "aria-label": r,
96
- "aria-labelledby": u,
96
+ "aria-labelledby": f,
97
97
  children: l,
98
- className: o,
98
+ className: i,
99
99
  label: a,
100
- presentation: v = "both",
101
- ...f
102
- } = n, y = A("Sidebar.Group"), i = `${ce()}-label`, b = a != null && typeof a != "boolean" && (typeof a != "string" || a.trim() !== "");
103
- if (!U(v, y == null ? void 0 : y.presentation))
100
+ presentation: y = "both",
101
+ ...b
102
+ } = n, v = A("Sidebar.Group"), o = `${de()}-label`, p = a != null && typeof a != "boolean" && (typeof a != "string" || a.trim() !== "");
103
+ if (!U(y, v == null ? void 0 : v.presentation))
104
104
  return null;
105
- const c = u ?? (r === void 0 && b ? i : void 0);
106
- return ye(
105
+ const c = f ?? (r === void 0 && p ? o : void 0);
106
+ return Se(
107
107
  !!(r ?? c) ? "nav" : "div",
108
108
  {
109
- ...f,
109
+ ...b,
110
110
  ref: e,
111
111
  "aria-label": r,
112
112
  "aria-labelledby": c,
113
- className: ["nk-sidebar__group", o].filter(Boolean).join(" ")
113
+ className: ["nk-sidebar__group", i].filter(Boolean).join(" ")
114
114
  },
115
- b ? /* @__PURE__ */ p(
115
+ p ? /* @__PURE__ */ u(
116
116
  V,
117
117
  {
118
118
  as: "h2",
119
119
  className: "nk-sidebar__group-label",
120
- id: i,
120
+ id: o,
121
121
  size: "subtitle",
122
122
  weight: "medium",
123
123
  children: a
124
124
  }
125
125
  ) : null,
126
- /* @__PURE__ */ p("ul", { className: "nk-sidebar__list", children: l })
126
+ /* @__PURE__ */ u("ul", { className: "nk-sidebar__list", children: l })
127
127
  );
128
128
  }
129
- ), Ue = R(
129
+ ), Ue = O(
130
130
  function(n, e) {
131
- const { children: r, className: u, presentation: l = "both", ...o } = n, a = A("Sidebar.Header");
132
- return U(l, a == null ? void 0 : a.presentation) ? /* @__PURE__ */ p(
131
+ const { children: r, className: f, presentation: l = "both", ...i } = n, a = A("Sidebar.Header");
132
+ return U(l, a == null ? void 0 : a.presentation) ? /* @__PURE__ */ u(
133
133
  "div",
134
134
  {
135
- ...o,
135
+ ...i,
136
136
  ref: e,
137
- className: ["nk-sidebar__header", u].filter(Boolean).join(" "),
137
+ className: ["nk-sidebar__header", f].filter(Boolean).join(" "),
138
138
  children: r
139
139
  }
140
140
  ) : null;
141
141
  }
142
- ), ze = R(
142
+ ), Ge = O(
143
143
  function(n, e) {
144
144
  const {
145
145
  active: r = !1,
146
- as: u,
146
+ as: f,
147
147
  children: l,
148
- className: o,
148
+ className: i,
149
149
  disabled: a = !1,
150
- icon: v,
151
- onClick: f,
152
- presentation: y = "both",
153
- type: i,
154
- ...b
155
- } = n, c = A("Sidebar.Item"), s = u ?? "button", d = s === "button", m = b, E = m.href !== void 0 || m.to !== void 0;
150
+ icon: y,
151
+ onClick: b,
152
+ presentation: v = "both",
153
+ type: o,
154
+ ...p
155
+ } = n, c = A("Sidebar.Item"), s = f ?? "button", d = s === "button", m = p, E = m.href !== void 0 || m.to !== void 0;
156
156
  function g(S) {
157
157
  if (a) {
158
158
  S.preventDefault();
159
159
  return;
160
160
  }
161
- f == null || f(S), c != null && c.open && c.presentation === "overlay" && !S.defaultPrevented && c.requestOpenChange(!1, "item");
161
+ b == null || b(S), c != null && c.open && c.presentation === "overlay" && !S.defaultPrevented && c.requestOpenChange(!1, "item");
162
162
  }
163
- return U(y, c == null ? void 0 : c.presentation) ? /* @__PURE__ */ p("li", { className: "nk-sidebar__item-container", children: /* @__PURE__ */ p(
163
+ return U(v, c == null ? void 0 : c.presentation) ? /* @__PURE__ */ u("li", { className: "nk-sidebar__item-container", children: /* @__PURE__ */ u(
164
164
  Y,
165
165
  {
166
- ...b,
166
+ ...p,
167
167
  ref: e,
168
168
  "aria-current": r ? E ? "page" : "true" : void 0,
169
169
  as: s,
170
- className: ["nk-sidebar__item", o].filter(Boolean).join(" "),
170
+ className: ["nk-sidebar__item", i].filter(Boolean).join(" "),
171
171
  "data-active": r || void 0,
172
172
  disabled: a,
173
173
  fullWidth: !0,
174
174
  href: m.href,
175
- icon: v,
175
+ icon: y,
176
176
  onClick: g,
177
177
  shape: "rectangle",
178
178
  size: "small",
179
179
  textAlignment: "left",
180
- type: d ? i ?? "button" : i,
180
+ type: d ? o ?? "button" : o,
181
181
  variant: "ghost",
182
- children: /* @__PURE__ */ p("span", { className: "nk-sidebar__item-label", children: l })
182
+ children: /* @__PURE__ */ u("span", { className: "nk-sidebar__item-label", children: l })
183
183
  }
184
184
  ) }) : null;
185
185
  }
186
- ), Ge = 1;
187
- function qe(t) {
186
+ ), qe = 1;
187
+ function ze(t) {
188
188
  return t == null ? void 0 : t.ResizeObserver;
189
189
  }
190
190
  function $e(t) {
191
191
  return t == null ? void 0 : t.MutationObserver;
192
192
  }
193
193
  function Ve() {
194
- const [t, n] = w(!1), e = I(null), r = _((o) => {
195
- const a = o.scrollHeight - o.scrollTop - o.clientHeight;
196
- n(a > Ge);
197
- }, []), u = _((o) => {
194
+ const [t, n] = w(!1), e = L(null), r = _((i) => {
195
+ const a = i.scrollHeight - i.scrollTop - i.clientHeight;
196
+ n(a > qe);
197
+ }, []), f = _((i) => {
198
198
  var m;
199
- if ((m = e.current) == null || m.call(e), e.current = null, !o) return;
200
- const a = o;
199
+ if ((m = e.current) == null || m.call(e), e.current = null, !i) return;
200
+ const a = i;
201
201
  r(a);
202
- function v() {
202
+ function y() {
203
203
  r(a);
204
204
  }
205
- const f = a.ownerDocument.defaultView;
206
- f == null || f.addEventListener("resize", v);
207
- const y = qe(f), i = y ? new y(v) : void 0;
208
- function b() {
209
- i == null || i.disconnect(), i == null || i.observe(a);
205
+ const b = a.ownerDocument.defaultView;
206
+ b == null || b.addEventListener("resize", y);
207
+ const v = ze(b), o = v ? new v(y) : void 0;
208
+ function p() {
209
+ o == null || o.disconnect(), o == null || o.observe(a);
210
210
  for (const E of a.children)
211
- i == null || i.observe(E);
211
+ o == null || o.observe(E);
212
212
  }
213
- b();
213
+ p();
214
214
  function c(E) {
215
215
  E.some(
216
216
  (S) => S.type === "childList"
217
- ) && b(), v();
217
+ ) && p(), y();
218
218
  }
219
- const s = $e(f), d = s ? new s(c) : void 0;
219
+ const s = $e(b), d = s ? new s(c) : void 0;
220
220
  d == null || d.observe(a, {
221
221
  attributeFilter: ["class", "hidden", "style"],
222
222
  characterData: !0,
223
223
  childList: !0,
224
224
  subtree: !0
225
225
  }), e.current = () => {
226
- f == null || f.removeEventListener("resize", v), i == null || i.disconnect(), d == null || d.disconnect();
226
+ b == null || b.removeEventListener("resize", y), o == null || o.disconnect(), d == null || d.disconnect();
227
227
  };
228
- }, [r]), l = _((o) => {
229
- r(o.currentTarget);
228
+ }, [r]), l = _((i) => {
229
+ r(i.currentTarget);
230
230
  }, [r]);
231
- return { containerReference: u, contentBelow: t, handleScroll: l };
231
+ return { containerReference: f, contentBelow: t, handleScroll: l };
232
232
  }
233
233
  function Ke(t, n) {
234
- for (const e of Se.toArray(t)) {
235
- if (re(e) && e.type === de) {
236
- const r = pe(e.props.children);
234
+ for (const e of _e.toArray(t)) {
235
+ if (re(e) && e.type === ue) {
236
+ const r = he(e.props.children);
237
237
  r.bodyChildren.length > 0 && n.bodyChildren.push($(
238
238
  e,
239
239
  void 0,
@@ -245,10 +245,10 @@ function Ke(t, n) {
245
245
  ));
246
246
  continue;
247
247
  }
248
- re(e) && e.type === be ? n.footerChildren.push(e) : n.bodyChildren.push(e);
248
+ re(e) && e.type === pe ? n.footerChildren.push(e) : n.bodyChildren.push(e);
249
249
  }
250
250
  }
251
- function pe(t) {
251
+ function he(t) {
252
252
  const n = {
253
253
  bodyChildren: [],
254
254
  footerChildren: []
@@ -260,39 +260,39 @@ function me(t) {
260
260
  "aria-label": n,
261
261
  "aria-labelledby": e,
262
262
  children: r,
263
- className: u,
263
+ className: f,
264
264
  height: l,
265
- open: o,
265
+ open: i,
266
266
  panelId: a,
267
- panelReference: v,
268
- presentation: f,
269
- side: y,
270
- state: i,
271
- style: b,
267
+ panelReference: y,
268
+ presentation: b,
269
+ side: v,
270
+ state: o,
271
+ style: p,
272
272
  width: c,
273
273
  ...s
274
- } = t, { containerReference: d, contentBelow: m, handleScroll: E } = Ve(), g = f === "overlay", { bodyChildren: S, footerChildren: B } = pe(r), O = n ?? (e === void 0 ? "Sidebar" : void 0), L = g && o;
275
- let P = b;
276
- return (c !== void 0 || l !== void 0) && (P = { ...b }, l !== void 0 && (P["--nk-sidebar-height"] = l), c !== void 0 && (P["--nk-sidebar-width"] = c)), /* @__PURE__ */ D(
274
+ } = t, { containerReference: d, contentBelow: m, handleScroll: E } = Ve(), g = b === "overlay", { bodyChildren: S, footerChildren: R } = he(r), F = n ?? (e === void 0 ? "Sidebar" : void 0), B = g && i;
275
+ let P = p;
276
+ return (c !== void 0 || l !== void 0) && (P = { ...p }, l !== void 0 && (P["--nk-sidebar-height"] = l), c !== void 0 && (P["--nk-sidebar-width"] = c)), /* @__PURE__ */ I(
277
277
  "aside",
278
278
  {
279
279
  ...s,
280
- ref: v,
281
- "aria-hidden": g && !o ? !0 : void 0,
282
- "aria-label": g && !o ? void 0 : O,
283
- "aria-labelledby": g && !o ? void 0 : e,
284
- "aria-modal": L ? "true" : void 0,
285
- className: ["nk-sidebar", u].filter(Boolean).join(" "),
286
- "data-responsive": f === "pending" || void 0,
287
- "data-side": y,
288
- "data-state": i,
280
+ ref: y,
281
+ "aria-hidden": g && !i ? !0 : void 0,
282
+ "aria-label": g && !i ? void 0 : F,
283
+ "aria-labelledby": g && !i ? void 0 : e,
284
+ "aria-modal": B ? "true" : void 0,
285
+ className: ["nk-sidebar", f].filter(Boolean).join(" "),
286
+ "data-responsive": b === "pending" || void 0,
287
+ "data-side": v,
288
+ "data-state": o,
289
289
  "data-variant": g ? "overlay" : "inline",
290
290
  id: a,
291
- role: L ? "dialog" : void 0,
291
+ role: B ? "dialog" : void 0,
292
292
  style: P,
293
293
  tabIndex: g ? -1 : void 0,
294
294
  children: [
295
- /* @__PURE__ */ p(
295
+ /* @__PURE__ */ u(
296
296
  "div",
297
297
  {
298
298
  ref: d,
@@ -302,7 +302,7 @@ function me(t) {
302
302
  children: S
303
303
  }
304
304
  ),
305
- B
305
+ R
306
306
  ]
307
307
  }
308
308
  );
@@ -312,65 +312,65 @@ function Ye(t) {
312
312
  boundaries: n,
313
313
  initialFocusReference: e,
314
314
  lockScroll: r,
315
- ownerDocument: u,
315
+ ownerDocument: f,
316
316
  panelReference: l,
317
- presenceState: o,
317
+ presenceState: i,
318
318
  restoreFocus: a,
319
- sidebar: v,
320
- side: f,
321
- ...y
322
- } = t, { id: i, open: b, requestOpenChange: c } = v, s = _e(se), d = I(null), [m, E] = w(null), g = K("Sidebar").boundaryElement, S = ke(!0, g), B = _((F) => {
323
- d.current = F, l(F), E(F);
319
+ sidebar: y,
320
+ side: b,
321
+ ...v
322
+ } = t, { id: o, open: p, requestOpenChange: c } = y, s = ke(se), d = L(null), [m, E] = w(null), g = K("Sidebar").boundaryElement, S = Ce(!0, g), R = _((x) => {
323
+ d.current = x, l(x), E(x);
324
324
  }, [l]);
325
325
  M(() => {
326
- m && (m.inert = !b);
327
- }, [b, m]);
328
- const O = _(() => {
326
+ m && (m.inert = !p);
327
+ }, [p, m]);
328
+ const F = _(() => {
329
329
  c(!1, "escape");
330
- }, [c]), L = _(() => {
330
+ }, [c]), B = _(() => {
331
331
  c(!1, "outside");
332
332
  }, [c]);
333
- Ce({
333
+ Ne({
334
334
  boundary: g,
335
- active: b,
335
+ active: p,
336
336
  boundaries: n,
337
337
  dismissOnEscape: !0,
338
338
  dismissOnPointerDownOutside: !0,
339
339
  layerId: S.id,
340
- onEscapeDismiss: O,
341
- onPointerDownOutsideDismiss: L,
342
- ownerDocument: u
340
+ onEscapeDismiss: F,
341
+ onPointerDownOutsideDismiss: B,
342
+ ownerDocument: f
343
343
  });
344
- const P = Pe({
344
+ const P = Te({
345
345
  boundary: g,
346
- active: b,
346
+ active: p,
347
347
  container: m,
348
348
  initialFocusReference: e ?? d,
349
349
  layerId: S.id,
350
350
  restoreFocus: a
351
351
  });
352
- return Te(r && b, u, g), /* @__PURE__ */ p(
352
+ return Ie(r && p, f, g), /* @__PURE__ */ u(
353
353
  se.Provider,
354
354
  {
355
- value: b ? P : s,
356
- children: /* @__PURE__ */ p(
355
+ value: p ? P : s,
356
+ children: /* @__PURE__ */ u(
357
357
  "div",
358
358
  {
359
359
  className: "nk-sidebar__overlay",
360
- "data-side": f,
361
- "data-state": o,
360
+ "data-side": b,
361
+ "data-state": i,
362
362
  role: "presentation",
363
363
  style: { zIndex: S.zIndex },
364
- children: /* @__PURE__ */ p(
364
+ children: /* @__PURE__ */ u(
365
365
  me,
366
366
  {
367
- ...y,
368
- open: b,
369
- panelId: i,
370
- panelReference: B,
367
+ ...v,
368
+ open: p,
369
+ panelId: o,
370
+ panelReference: R,
371
371
  presentation: "overlay",
372
- side: f,
373
- state: o
372
+ side: b,
373
+ state: i
374
374
  }
375
375
  )
376
376
  }
@@ -380,53 +380,93 @@ function Ye(t) {
380
380
  }
381
381
  function Je(t) {
382
382
  const { children: n } = t;
383
- if (n.type === de)
383
+ if (n.type === ue)
384
384
  throw new Error("Sidebar.Trigger requires a single non-Fragment child");
385
- const e = A("Sidebar.Trigger"), r = n.props, u = Ee(n), l = e == null ? void 0 : e.registerTrigger, o = e == null ? void 0 : e.unregisterTrigger, a = I(null), v = _((d) => {
385
+ const e = A("Sidebar.Trigger"), r = n.props, f = Ee(n), l = e == null ? void 0 : e.registerTrigger, i = e == null ? void 0 : e.unregisterTrigger, a = L(null), y = _((d) => {
386
386
  const m = a.current;
387
- m && m !== d && (o == null || o(m)), a.current = d, d && (l == null || l(d)), ue(u, d);
388
- }, [u, l, o]), f = _((d) => {
387
+ m && m !== d && (i == null || i(m)), a.current = d, d && (l == null || l(d)), fe(f, d);
388
+ }, [f, l, i]), b = _((d) => {
389
389
  d.defaultPrevented || !e || e.requestOpenChange(!e.open, "trigger");
390
390
  }, [e]);
391
391
  if (!e) return null;
392
- const { id: y, open: i, presentation: b, variant: c } = e;
392
+ const { id: v, open: o, presentation: p, variant: c } = e;
393
393
  return $(
394
394
  n,
395
- Le(r, {
396
- "aria-controls": i && b === "overlay" ? Ie(r["aria-controls"], y) : r["aria-controls"],
397
- "aria-expanded": i,
395
+ Be(r, {
396
+ "aria-controls": o && p === "overlay" ? Le(r["aria-controls"], v) : r["aria-controls"],
397
+ "aria-expanded": o,
398
398
  "aria-haspopup": r["aria-haspopup"] ?? "dialog",
399
399
  className: "nk-sidebar__trigger",
400
400
  "data-sidebar-variant": c,
401
- onClick: f,
402
- ref: v
401
+ onClick: b,
402
+ ref: y
403
403
  })
404
404
  );
405
405
  }
406
- const Qe = R(
406
+ const Qe = O(
407
407
  function(n, e) {
408
408
  const {
409
409
  actions: r,
410
- className: u,
410
+ className: f,
411
411
  description: l,
412
- image: o,
412
+ image: i,
413
413
  loading: a = !1,
414
- name: v,
415
- onClick: f,
416
- ...y
417
- } = n, i = l != null && typeof l != "boolean", b = /* @__PURE__ */ D(q, { children: [
418
- /* @__PURE__ */ p(
419
- Re,
414
+ name: y,
415
+ onClick: b,
416
+ ...v
417
+ } = n, o = l != null && typeof l != "boolean";
418
+ if (a)
419
+ return /* @__PURE__ */ u(
420
+ "div",
420
421
  {
421
- alt: v,
422
+ ...v,
423
+ ref: e,
424
+ className: ["nk-sidebar__user", f].filter(Boolean).join(" "),
425
+ children: /* @__PURE__ */ I(
426
+ "div",
427
+ {
428
+ "aria-label": "Loading user",
429
+ className: "nk-sidebar__user-details",
430
+ role: "status",
431
+ children: [
432
+ /* @__PURE__ */ u(
433
+ z,
434
+ {
435
+ className: "nk-sidebar__user-avatar",
436
+ height: "var(--nk-space-32)",
437
+ shape: "ellipse",
438
+ width: "var(--nk-space-32)"
439
+ }
440
+ ),
441
+ /* @__PURE__ */ I(
442
+ "div",
443
+ {
444
+ className: "nk-sidebar__user-text",
445
+ style: { gap: "var(--nk-space-8)" },
446
+ children: [
447
+ /* @__PURE__ */ u(z, { height: "var(--nk-space-16)", width: "70%" }),
448
+ o ? /* @__PURE__ */ u(z, { height: "var(--nk-space-12)", width: "50%" }) : null
449
+ ]
450
+ }
451
+ )
452
+ ]
453
+ }
454
+ )
455
+ }
456
+ );
457
+ const p = /* @__PURE__ */ I(le, { children: [
458
+ /* @__PURE__ */ u(
459
+ Oe,
460
+ {
461
+ alt: y,
422
462
  "aria-hidden": !0,
423
463
  className: "nk-sidebar__user-avatar",
424
- image: o
464
+ image: i
425
465
  }
426
466
  ),
427
- /* @__PURE__ */ D("span", { className: "nk-sidebar__user-text", children: [
428
- /* @__PURE__ */ p(V, { as: "span", className: "nk-sidebar__user-name", children: v }),
429
- i ? /* @__PURE__ */ p(
467
+ /* @__PURE__ */ I("span", { className: "nk-sidebar__user-text", children: [
468
+ /* @__PURE__ */ u(V, { as: "span", className: "nk-sidebar__user-name", children: y }),
469
+ o ? /* @__PURE__ */ u(
430
470
  V,
431
471
  {
432
472
  as: "span",
@@ -438,80 +478,72 @@ const Qe = R(
438
478
  ) : null
439
479
  ] })
440
480
  ] });
441
- return /* @__PURE__ */ p(
481
+ return /* @__PURE__ */ I(
442
482
  "div",
443
483
  {
444
- ...y,
484
+ ...v,
445
485
  ref: e,
446
- className: ["nk-sidebar__user", u].filter(Boolean).join(" "),
447
- children: a ? /* @__PURE__ */ p(Be, { className: "nk-sidebar__user-spinner", size: 16 }) : /* @__PURE__ */ D(q, { children: [
448
- f ? /* @__PURE__ */ p(
486
+ className: ["nk-sidebar__user", f].filter(Boolean).join(" "),
487
+ children: [
488
+ b ? /* @__PURE__ */ u(
449
489
  "button",
450
490
  {
451
491
  className: "nk-sidebar__user-details",
452
- onClick: f,
492
+ onClick: b,
493
+ type: "button",
494
+ children: p
495
+ }
496
+ ) : /* @__PURE__ */ u("div", { className: "nk-sidebar__user-details", children: p }),
497
+ r != null && r.length ? /* @__PURE__ */ u("div", { className: "nk-sidebar__user-actions", children: r.map(({ "aria-label": c, icon: s, label: d, ...m }) => /* @__PURE__ */ u(Re, { content: d, children: /* @__PURE__ */ u(
498
+ Y,
499
+ {
500
+ ...m,
501
+ "aria-label": c ?? d,
502
+ className: "nk-sidebar__user-action",
503
+ icon: s,
504
+ shape: "rectangle",
453
505
  type: "button",
454
- children: b
506
+ variant: "ghost"
455
507
  }
456
- ) : /* @__PURE__ */ p("div", { className: "nk-sidebar__user-details", children: b }),
457
- r !== void 0 && r.length > 0 ? /* @__PURE__ */ p("div", { className: "nk-sidebar__user-actions", children: r.map((c) => {
458
- const {
459
- "aria-label": s,
460
- icon: d,
461
- label: m,
462
- ...E
463
- } = c;
464
- return /* @__PURE__ */ p(Oe, { content: m, children: /* @__PURE__ */ p(
465
- Y,
466
- {
467
- ...E,
468
- "aria-label": s ?? m,
469
- className: "nk-sidebar__user-action",
470
- icon: d,
471
- shape: "rectangle",
472
- type: "button",
473
- variant: "ghost"
474
- }
475
- ) }, m);
476
- }) }) : null
477
- ] })
508
+ ) }, d)) }) : null
509
+ ]
478
510
  }
479
511
  );
480
512
  }
481
513
  ), Xe = () => () => {
482
- }, ie = () => {
514
+ }, oe = () => {
483
515
  };
484
516
  function Ze(t, n) {
485
- const e = t === "responsive" ? n : void 0, r = le(
517
+ const e = t === "responsive" ? n : void 0, r = ce(
486
518
  (e == null ? void 0 : e.subscribe) ?? Xe,
487
- (e == null ? void 0 : e.read) ?? ie,
488
- ie
519
+ (e == null ? void 0 : e.read) ?? oe,
520
+ oe
489
521
  );
490
522
  return t !== "responsive" ? t : r === void 0 ? "pending" : r >= Fe("medium") ? "inline" : "overlay";
491
523
  }
492
- const We = 32, en = R(function(n, e) {
524
+ const We = 32, en = O(function(n, e) {
493
525
  var ne;
494
526
  const {
495
527
  defaultOpen: r = !1,
496
- height: u,
528
+ height: f,
497
529
  initialFocusReference: l,
498
- lockScroll: o = !0,
530
+ lockScroll: i = !0,
499
531
  onOpenChange: a,
500
- open: v,
501
- restoreFocus: f = !0,
502
- side: y = "left",
503
- variant: i = "responsive",
504
- width: b,
532
+ open: y,
533
+ restoreFocus: b = !0,
534
+ side: v = "left",
535
+ variant: o = "responsive",
536
+ width: p,
505
537
  ...c
506
- } = n, s = K("Sidebar"), d = `${ce()}-sidebar`, m = I(Symbol("nk-sidebar")).current, E = I(null), g = Ze(i, s == null ? void 0 : s.width), S = v !== void 0, [B, O] = w(r), [L, P] = w(0), [F, he] = w(!1), J = I(null), T = S ? v : B, j = I(a);
538
+ } = n, s = K("Sidebar"), d = `${de()}-sidebar`, m = L(Symbol("nk-sidebar")).current, E = L(null), g = Ze(o, s == null ? void 0 : s.width), S = y !== void 0, [R, F] = w(r), [B, P] = w(0), [x, ge] = w(!1), J = L(null), T = S ? y : R, j = L(a);
507
539
  M(() => {
508
540
  j.current = a;
509
541
  });
510
- const x = _((h, k) => {
542
+ const D = _((h, k) => {
511
543
  var C;
512
- T !== h && (S || O(h), (C = j.current) == null || C.call(j, h, k));
544
+ T !== h && (S || F(h), (C = j.current) == null || C.call(j, h, k));
513
545
  }, [S, T]), Q = _((h) => {
514
- E.current = h, ue(e, h);
546
+ E.current = h, fe(e, h);
515
547
  }, [e]), N = te(
516
548
  () => [E],
517
549
  []
@@ -520,103 +552,103 @@ const We = 32, en = R(function(n, e) {
520
552
  }, [N]), Z = _((h) => {
521
553
  const k = N.findIndex((C) => C.current === h);
522
554
  k > 0 && N.splice(k, 1), P((C) => Math.max(C - 1, 0));
523
- }, [N]), ge = _((h) => {
555
+ }, [N]), ve = _((h) => {
524
556
  const k = J.current;
525
557
  if (k && k !== h) {
526
- const C = N.findIndex((ve) => ve.current === k);
558
+ const C = N.findIndex((ye) => ye.current === k);
527
559
  C > 0 && N.splice(C, 1);
528
560
  }
529
561
  J.current = h, h && N.push({ current: h });
530
- }, [N]), z = te(() => ({
562
+ }, [N]), G = te(() => ({
531
563
  id: d,
532
564
  open: T,
533
565
  presentation: g,
534
566
  registerTrigger: X,
535
- requestOpenChange: x,
567
+ requestOpenChange: D,
536
568
  unregisterTrigger: Z,
537
- variant: i
569
+ variant: o
538
570
  }), [
539
571
  T,
540
572
  d,
541
573
  g,
542
574
  X,
543
- x,
575
+ D,
544
576
  Z,
545
- i
577
+ o
546
578
  ]);
547
579
  M(() => {
548
580
  const h = s == null ? void 0 : s.boundaryElement;
549
581
  if (!h) return;
550
- if (De(h, m, z) === !1)
582
+ if (De(h, m, G) === !1)
551
583
  throw new Error(
552
584
  "A Boundary supports one Sidebar. Neatkit resolves Trigger, Group, and Item interactions against the single Sidebar published to the nearest Boundary, so give each Sidebar a Boundary of its own."
553
585
  );
554
- }, [s == null ? void 0 : s.boundaryElement, m, z]), M(() => {
586
+ }, [s == null ? void 0 : s.boundaryElement, m, G]), M(() => {
555
587
  const h = s == null ? void 0 : s.boundaryElement;
556
588
  if (h)
557
589
  return () => we(h, m);
558
590
  }, [s == null ? void 0 : s.boundaryElement, m]), ae(() => {
559
- g === "inline" && x(!1, "variant");
560
- }, [g, x]), ae(() => {
591
+ g === "inline" && D(!1, "variant");
592
+ }, [g, D]), ae(() => {
561
593
  var C;
562
594
  const h = (C = s == null ? void 0 : s.boundaryElement) == null ? void 0 : C.ownerDocument.defaultView;
563
595
  if (!h) return;
564
596
  const k = h.setTimeout(
565
- () => he(!0),
597
+ () => ge(!0),
566
598
  We
567
599
  );
568
600
  return () => h.clearTimeout(k);
569
601
  }, [s == null ? void 0 : s.boundaryElement]);
570
- const G = Ne(T && g === "overlay"), W = ((ne = s == null ? void 0 : s.boundaryElement) == null ? void 0 : ne.ownerDocument) ?? (typeof document > "u" ? null : document);
602
+ const q = Pe(T && g === "overlay"), W = ((ne = s == null ? void 0 : s.boundaryElement) == null ? void 0 : ne.ownerDocument) ?? (typeof document > "u" ? null : document);
571
603
  if (g !== "overlay")
572
- return /* @__PURE__ */ p(
604
+ return /* @__PURE__ */ u(
573
605
  me,
574
606
  {
575
607
  ...c,
576
- height: u,
608
+ height: f,
577
609
  open: !1,
578
610
  panelId: d,
579
611
  panelReference: Q,
580
612
  presentation: g,
581
- side: y,
582
- width: b
613
+ side: v,
614
+ width: p
583
615
  }
584
616
  );
585
- const ee = F && L === 0 ? /* @__PURE__ */ p(oe, { children: /* @__PURE__ */ p(
617
+ const ee = x && B === 0 ? /* @__PURE__ */ u(ie, { children: /* @__PURE__ */ u(
586
618
  xe,
587
619
  {
588
620
  label: `Open ${c["aria-label"] ?? "Sidebar"}`,
589
- onToggle: () => x(!T, "trigger"),
590
- panelId: G.present ? d : void 0,
591
- reference: ge,
592
- side: y,
621
+ onToggle: () => D(!T, "trigger"),
622
+ panelId: q.present ? d : void 0,
623
+ reference: ve,
624
+ side: v,
593
625
  sidebarOpen: T
594
626
  }
595
627
  ) }) : null;
596
- return !G.present || !W ? ee : /* @__PURE__ */ D(q, { children: [
628
+ return !q.present || !W ? ee : /* @__PURE__ */ I(le, { children: [
597
629
  ee,
598
- /* @__PURE__ */ p(oe, { children: /* @__PURE__ */ p(
630
+ /* @__PURE__ */ u(ie, { children: /* @__PURE__ */ u(
599
631
  Ye,
600
632
  {
601
633
  ...c,
602
634
  boundaries: N,
603
635
  initialFocusReference: l,
604
- lockScroll: o,
636
+ lockScroll: i,
605
637
  ownerDocument: W,
606
638
  panelReference: Q,
607
- presenceState: G.state === "closing" ? "closing" : "open",
608
- restoreFocus: f,
609
- side: y,
610
- sidebar: z,
611
- width: b
639
+ presenceState: q.state === "closing" ? "closing" : "open",
640
+ restoreFocus: b,
641
+ side: v,
642
+ sidebar: G,
643
+ width: p
612
644
  }
613
645
  ) })
614
646
  ] });
615
647
  }), gn = Object.assign(en, {
616
- Footer: be,
648
+ Footer: pe,
617
649
  Group: He,
618
650
  Header: Ue,
619
- Item: ze,
651
+ Item: Ge,
620
652
  Trigger: Je,
621
653
  User: Qe
622
654
  });