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.
- package/dist/{Button-DdxB1ps7.js → Button-DpsjwCjJ.js} +1 -1
- package/dist/{Button-pinr6Woy.cjs → Button-ysPCQKRu.cjs} +1 -1
- package/dist/Button.cjs +1 -1
- package/dist/Button.js +1 -1
- package/dist/Checkbox.cjs +1 -1
- package/dist/Checkbox.js +1 -1
- package/dist/Icon-BphC5b-i.cjs +1 -0
- package/dist/{Icon-DK4tkZtF.js → Icon-Dbh4PSBI.js} +145 -99
- package/dist/Icon.cjs +1 -1
- package/dist/Icon.js +1 -1
- package/dist/Input.cjs +1 -1
- package/dist/Input.js +1 -1
- package/dist/Markdown.cjs +1 -1
- package/dist/Markdown.js +1 -1
- package/dist/Modal.cjs +1 -1
- package/dist/Modal.js +1 -1
- package/dist/Select.cjs +1 -1
- package/dist/Select.js +1 -1
- package/dist/Sidebar.cjs +1 -1
- package/dist/Sidebar.js +274 -242
- package/dist/Skeleton-CBS-MN5x.cjs +1 -0
- package/dist/Skeleton-CEWiIR1S.js +37 -0
- package/dist/Skeleton.cjs +1 -1
- package/dist/Skeleton.js +2 -29
- package/dist/Table-CXX2U8UT.cjs +1 -0
- package/dist/{Table-DdTjtnRE.js → Table-DfckcbhA.js} +91 -89
- package/dist/Table.cjs +1 -1
- package/dist/Table.js +1 -1
- package/dist/components/Icon/icons/BinaryIcon.d.ts +11 -0
- package/dist/components/Icon/icons/TrashIcon.d.ts +11 -0
- package/dist/components/Icon/utils/registry.d.ts +2 -0
- package/dist/components/Sidebar/components/SidebarUser.d.ts +2 -2
- package/dist/components/Skeleton/Skeleton.d.ts +18 -7
- package/dist/components/Table/Table.d.ts +6 -0
- package/dist/components/Table/index.d.ts +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/Icon-CgQ62bgw.cjs +0 -1
- package/dist/Table-DBkiHOd0.cjs +0 -1
package/dist/Sidebar.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useCallback as _, useSyncExternalStore as
|
|
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
|
|
6
|
-
import { F as se, c as
|
|
7
|
-
import { B as Y } from "./Button-
|
|
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
|
|
10
|
-
import { u as
|
|
11
|
-
import { m as
|
|
12
|
-
import { r as
|
|
13
|
-
import { A as
|
|
14
|
-
import { S as
|
|
15
|
-
import { T as
|
|
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:
|
|
19
|
-
return /* @__PURE__ */
|
|
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:
|
|
22
|
+
ref: f,
|
|
23
23
|
"aria-controls": r,
|
|
24
|
-
"aria-expanded":
|
|
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
|
|
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 =
|
|
49
|
-
return r.owner !== null && r.owner !== n ? !1 : (r.owner = n, r.state = e, r.listeners.forEach((
|
|
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 =
|
|
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
|
-
(
|
|
71
|
+
(f) => je(n, f),
|
|
72
72
|
[n]
|
|
73
73
|
), r = _(() => Ae(n), [n]);
|
|
74
|
-
return
|
|
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
|
|
79
|
+
const pe = O(
|
|
80
80
|
function(n, e) {
|
|
81
|
-
const { children: r, className:
|
|
82
|
-
return U(l, a == null ? void 0 : a.presentation) ? /* @__PURE__ */
|
|
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
|
-
...
|
|
85
|
+
...i,
|
|
86
86
|
ref: e,
|
|
87
|
-
className: ["nk-sidebar__footer",
|
|
87
|
+
className: ["nk-sidebar__footer", f].filter(Boolean).join(" "),
|
|
88
88
|
children: r
|
|
89
89
|
}
|
|
90
90
|
) : null;
|
|
91
91
|
}
|
|
92
|
-
), He =
|
|
92
|
+
), He = O(
|
|
93
93
|
function(n, e) {
|
|
94
94
|
const {
|
|
95
95
|
"aria-label": r,
|
|
96
|
-
"aria-labelledby":
|
|
96
|
+
"aria-labelledby": f,
|
|
97
97
|
children: l,
|
|
98
|
-
className:
|
|
98
|
+
className: i,
|
|
99
99
|
label: a,
|
|
100
|
-
presentation:
|
|
101
|
-
...
|
|
102
|
-
} = n,
|
|
103
|
-
if (!U(
|
|
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 =
|
|
106
|
-
return
|
|
105
|
+
const c = f ?? (r === void 0 && p ? o : void 0);
|
|
106
|
+
return Se(
|
|
107
107
|
!!(r ?? c) ? "nav" : "div",
|
|
108
108
|
{
|
|
109
|
-
...
|
|
109
|
+
...b,
|
|
110
110
|
ref: e,
|
|
111
111
|
"aria-label": r,
|
|
112
112
|
"aria-labelledby": c,
|
|
113
|
-
className: ["nk-sidebar__group",
|
|
113
|
+
className: ["nk-sidebar__group", i].filter(Boolean).join(" ")
|
|
114
114
|
},
|
|
115
|
-
|
|
115
|
+
p ? /* @__PURE__ */ u(
|
|
116
116
|
V,
|
|
117
117
|
{
|
|
118
118
|
as: "h2",
|
|
119
119
|
className: "nk-sidebar__group-label",
|
|
120
|
-
id:
|
|
120
|
+
id: o,
|
|
121
121
|
size: "subtitle",
|
|
122
122
|
weight: "medium",
|
|
123
123
|
children: a
|
|
124
124
|
}
|
|
125
125
|
) : null,
|
|
126
|
-
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ u("ul", { className: "nk-sidebar__list", children: l })
|
|
127
127
|
);
|
|
128
128
|
}
|
|
129
|
-
), Ue =
|
|
129
|
+
), Ue = O(
|
|
130
130
|
function(n, e) {
|
|
131
|
-
const { children: r, className:
|
|
132
|
-
return U(l, a == null ? void 0 : a.presentation) ? /* @__PURE__ */
|
|
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
|
-
...
|
|
135
|
+
...i,
|
|
136
136
|
ref: e,
|
|
137
|
-
className: ["nk-sidebar__header",
|
|
137
|
+
className: ["nk-sidebar__header", f].filter(Boolean).join(" "),
|
|
138
138
|
children: r
|
|
139
139
|
}
|
|
140
140
|
) : null;
|
|
141
141
|
}
|
|
142
|
-
),
|
|
142
|
+
), Ge = O(
|
|
143
143
|
function(n, e) {
|
|
144
144
|
const {
|
|
145
145
|
active: r = !1,
|
|
146
|
-
as:
|
|
146
|
+
as: f,
|
|
147
147
|
children: l,
|
|
148
|
-
className:
|
|
148
|
+
className: i,
|
|
149
149
|
disabled: a = !1,
|
|
150
|
-
icon:
|
|
151
|
-
onClick:
|
|
152
|
-
presentation:
|
|
153
|
-
type:
|
|
154
|
-
...
|
|
155
|
-
} = n, c = A("Sidebar.Item"), s =
|
|
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
|
-
|
|
161
|
+
b == null || b(S), c != null && c.open && c.presentation === "overlay" && !S.defaultPrevented && c.requestOpenChange(!1, "item");
|
|
162
162
|
}
|
|
163
|
-
return U(
|
|
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
|
-
...
|
|
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",
|
|
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:
|
|
175
|
+
icon: y,
|
|
176
176
|
onClick: g,
|
|
177
177
|
shape: "rectangle",
|
|
178
178
|
size: "small",
|
|
179
179
|
textAlignment: "left",
|
|
180
|
-
type: d ?
|
|
180
|
+
type: d ? o ?? "button" : o,
|
|
181
181
|
variant: "ghost",
|
|
182
|
-
children: /* @__PURE__ */
|
|
182
|
+
children: /* @__PURE__ */ u("span", { className: "nk-sidebar__item-label", children: l })
|
|
183
183
|
}
|
|
184
184
|
) }) : null;
|
|
185
185
|
}
|
|
186
|
-
),
|
|
187
|
-
function
|
|
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 =
|
|
195
|
-
const a =
|
|
196
|
-
n(a >
|
|
197
|
-
}, []),
|
|
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, !
|
|
200
|
-
const a =
|
|
199
|
+
if ((m = e.current) == null || m.call(e), e.current = null, !i) return;
|
|
200
|
+
const a = i;
|
|
201
201
|
r(a);
|
|
202
|
-
function
|
|
202
|
+
function y() {
|
|
203
203
|
r(a);
|
|
204
204
|
}
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
const
|
|
208
|
-
function
|
|
209
|
-
|
|
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
|
-
|
|
211
|
+
o == null || o.observe(E);
|
|
212
212
|
}
|
|
213
|
-
|
|
213
|
+
p();
|
|
214
214
|
function c(E) {
|
|
215
215
|
E.some(
|
|
216
216
|
(S) => S.type === "childList"
|
|
217
|
-
) &&
|
|
217
|
+
) && p(), y();
|
|
218
218
|
}
|
|
219
|
-
const s = $e(
|
|
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
|
-
|
|
226
|
+
b == null || b.removeEventListener("resize", y), o == null || o.disconnect(), d == null || d.disconnect();
|
|
227
227
|
};
|
|
228
|
-
}, [r]), l = _((
|
|
229
|
-
r(
|
|
228
|
+
}, [r]), l = _((i) => {
|
|
229
|
+
r(i.currentTarget);
|
|
230
230
|
}, [r]);
|
|
231
|
-
return { containerReference:
|
|
231
|
+
return { containerReference: f, contentBelow: t, handleScroll: l };
|
|
232
232
|
}
|
|
233
233
|
function Ke(t, n) {
|
|
234
|
-
for (const e of
|
|
235
|
-
if (re(e) && e.type ===
|
|
236
|
-
const r =
|
|
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 ===
|
|
248
|
+
re(e) && e.type === pe ? n.footerChildren.push(e) : n.bodyChildren.push(e);
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
|
-
function
|
|
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:
|
|
263
|
+
className: f,
|
|
264
264
|
height: l,
|
|
265
|
-
open:
|
|
265
|
+
open: i,
|
|
266
266
|
panelId: a,
|
|
267
|
-
panelReference:
|
|
268
|
-
presentation:
|
|
269
|
-
side:
|
|
270
|
-
state:
|
|
271
|
-
style:
|
|
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 =
|
|
275
|
-
let P =
|
|
276
|
-
return (c !== void 0 || l !== void 0) && (P = { ...
|
|
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:
|
|
281
|
-
"aria-hidden": g && !
|
|
282
|
-
"aria-label": g && !
|
|
283
|
-
"aria-labelledby": g && !
|
|
284
|
-
"aria-modal":
|
|
285
|
-
className: ["nk-sidebar",
|
|
286
|
-
"data-responsive":
|
|
287
|
-
"data-side":
|
|
288
|
-
"data-state":
|
|
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:
|
|
291
|
+
role: B ? "dialog" : void 0,
|
|
292
292
|
style: P,
|
|
293
293
|
tabIndex: g ? -1 : void 0,
|
|
294
294
|
children: [
|
|
295
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
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:
|
|
315
|
+
ownerDocument: f,
|
|
316
316
|
panelReference: l,
|
|
317
|
-
presenceState:
|
|
317
|
+
presenceState: i,
|
|
318
318
|
restoreFocus: a,
|
|
319
|
-
sidebar:
|
|
320
|
-
side:
|
|
321
|
-
...
|
|
322
|
-
} = t, { id:
|
|
323
|
-
d.current =
|
|
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 = !
|
|
327
|
-
}, [
|
|
328
|
-
const
|
|
326
|
+
m && (m.inert = !p);
|
|
327
|
+
}, [p, m]);
|
|
328
|
+
const F = _(() => {
|
|
329
329
|
c(!1, "escape");
|
|
330
|
-
}, [c]),
|
|
330
|
+
}, [c]), B = _(() => {
|
|
331
331
|
c(!1, "outside");
|
|
332
332
|
}, [c]);
|
|
333
|
-
|
|
333
|
+
Ne({
|
|
334
334
|
boundary: g,
|
|
335
|
-
active:
|
|
335
|
+
active: p,
|
|
336
336
|
boundaries: n,
|
|
337
337
|
dismissOnEscape: !0,
|
|
338
338
|
dismissOnPointerDownOutside: !0,
|
|
339
339
|
layerId: S.id,
|
|
340
|
-
onEscapeDismiss:
|
|
341
|
-
onPointerDownOutsideDismiss:
|
|
342
|
-
ownerDocument:
|
|
340
|
+
onEscapeDismiss: F,
|
|
341
|
+
onPointerDownOutsideDismiss: B,
|
|
342
|
+
ownerDocument: f
|
|
343
343
|
});
|
|
344
|
-
const P =
|
|
344
|
+
const P = Te({
|
|
345
345
|
boundary: g,
|
|
346
|
-
active:
|
|
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
|
|
352
|
+
return Ie(r && p, f, g), /* @__PURE__ */ u(
|
|
353
353
|
se.Provider,
|
|
354
354
|
{
|
|
355
|
-
value:
|
|
356
|
-
children: /* @__PURE__ */
|
|
355
|
+
value: p ? P : s,
|
|
356
|
+
children: /* @__PURE__ */ u(
|
|
357
357
|
"div",
|
|
358
358
|
{
|
|
359
359
|
className: "nk-sidebar__overlay",
|
|
360
|
-
"data-side":
|
|
361
|
-
"data-state":
|
|
360
|
+
"data-side": b,
|
|
361
|
+
"data-state": i,
|
|
362
362
|
role: "presentation",
|
|
363
363
|
style: { zIndex: S.zIndex },
|
|
364
|
-
children: /* @__PURE__ */
|
|
364
|
+
children: /* @__PURE__ */ u(
|
|
365
365
|
me,
|
|
366
366
|
{
|
|
367
|
-
...
|
|
368
|
-
open:
|
|
369
|
-
panelId:
|
|
370
|
-
panelReference:
|
|
367
|
+
...v,
|
|
368
|
+
open: p,
|
|
369
|
+
panelId: o,
|
|
370
|
+
panelReference: R,
|
|
371
371
|
presentation: "overlay",
|
|
372
|
-
side:
|
|
373
|
-
state:
|
|
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 ===
|
|
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,
|
|
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 && (
|
|
388
|
-
}, [
|
|
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:
|
|
392
|
+
const { id: v, open: o, presentation: p, variant: c } = e;
|
|
393
393
|
return $(
|
|
394
394
|
n,
|
|
395
|
-
|
|
396
|
-
"aria-controls":
|
|
397
|
-
"aria-expanded":
|
|
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:
|
|
402
|
-
ref:
|
|
401
|
+
onClick: b,
|
|
402
|
+
ref: y
|
|
403
403
|
})
|
|
404
404
|
);
|
|
405
405
|
}
|
|
406
|
-
const Qe =
|
|
406
|
+
const Qe = O(
|
|
407
407
|
function(n, e) {
|
|
408
408
|
const {
|
|
409
409
|
actions: r,
|
|
410
|
-
className:
|
|
410
|
+
className: f,
|
|
411
411
|
description: l,
|
|
412
|
-
image:
|
|
412
|
+
image: i,
|
|
413
413
|
loading: a = !1,
|
|
414
|
-
name:
|
|
415
|
-
onClick:
|
|
416
|
-
...
|
|
417
|
-
} = n,
|
|
418
|
-
|
|
419
|
-
|
|
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
|
-
|
|
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:
|
|
464
|
+
image: i
|
|
425
465
|
}
|
|
426
466
|
),
|
|
427
|
-
/* @__PURE__ */
|
|
428
|
-
/* @__PURE__ */
|
|
429
|
-
|
|
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__ */
|
|
481
|
+
return /* @__PURE__ */ I(
|
|
442
482
|
"div",
|
|
443
483
|
{
|
|
444
|
-
...
|
|
484
|
+
...v,
|
|
445
485
|
ref: e,
|
|
446
|
-
className: ["nk-sidebar__user",
|
|
447
|
-
children:
|
|
448
|
-
|
|
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:
|
|
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
|
-
|
|
506
|
+
variant: "ghost"
|
|
455
507
|
}
|
|
456
|
-
)
|
|
457
|
-
|
|
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
|
-
},
|
|
514
|
+
}, oe = () => {
|
|
483
515
|
};
|
|
484
516
|
function Ze(t, n) {
|
|
485
|
-
const e = t === "responsive" ? n : void 0, r =
|
|
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) ??
|
|
488
|
-
|
|
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 =
|
|
524
|
+
const We = 32, en = O(function(n, e) {
|
|
493
525
|
var ne;
|
|
494
526
|
const {
|
|
495
527
|
defaultOpen: r = !1,
|
|
496
|
-
height:
|
|
528
|
+
height: f,
|
|
497
529
|
initialFocusReference: l,
|
|
498
|
-
lockScroll:
|
|
530
|
+
lockScroll: i = !0,
|
|
499
531
|
onOpenChange: a,
|
|
500
|
-
open:
|
|
501
|
-
restoreFocus:
|
|
502
|
-
side:
|
|
503
|
-
variant:
|
|
504
|
-
width:
|
|
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 = `${
|
|
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
|
|
542
|
+
const D = _((h, k) => {
|
|
511
543
|
var C;
|
|
512
|
-
T !== h && (S ||
|
|
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,
|
|
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]),
|
|
555
|
+
}, [N]), ve = _((h) => {
|
|
524
556
|
const k = J.current;
|
|
525
557
|
if (k && k !== h) {
|
|
526
|
-
const C = N.findIndex((
|
|
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]),
|
|
562
|
+
}, [N]), G = te(() => ({
|
|
531
563
|
id: d,
|
|
532
564
|
open: T,
|
|
533
565
|
presentation: g,
|
|
534
566
|
registerTrigger: X,
|
|
535
|
-
requestOpenChange:
|
|
567
|
+
requestOpenChange: D,
|
|
536
568
|
unregisterTrigger: Z,
|
|
537
|
-
variant:
|
|
569
|
+
variant: o
|
|
538
570
|
}), [
|
|
539
571
|
T,
|
|
540
572
|
d,
|
|
541
573
|
g,
|
|
542
574
|
X,
|
|
543
|
-
|
|
575
|
+
D,
|
|
544
576
|
Z,
|
|
545
|
-
|
|
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,
|
|
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,
|
|
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" &&
|
|
560
|
-
}, [g,
|
|
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
|
-
() =>
|
|
597
|
+
() => ge(!0),
|
|
566
598
|
We
|
|
567
599
|
);
|
|
568
600
|
return () => h.clearTimeout(k);
|
|
569
601
|
}, [s == null ? void 0 : s.boundaryElement]);
|
|
570
|
-
const
|
|
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__ */
|
|
604
|
+
return /* @__PURE__ */ u(
|
|
573
605
|
me,
|
|
574
606
|
{
|
|
575
607
|
...c,
|
|
576
|
-
height:
|
|
608
|
+
height: f,
|
|
577
609
|
open: !1,
|
|
578
610
|
panelId: d,
|
|
579
611
|
panelReference: Q,
|
|
580
612
|
presentation: g,
|
|
581
|
-
side:
|
|
582
|
-
width:
|
|
613
|
+
side: v,
|
|
614
|
+
width: p
|
|
583
615
|
}
|
|
584
616
|
);
|
|
585
|
-
const ee =
|
|
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: () =>
|
|
590
|
-
panelId:
|
|
591
|
-
reference:
|
|
592
|
-
side:
|
|
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 !
|
|
628
|
+
return !q.present || !W ? ee : /* @__PURE__ */ I(le, { children: [
|
|
597
629
|
ee,
|
|
598
|
-
/* @__PURE__ */
|
|
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:
|
|
636
|
+
lockScroll: i,
|
|
605
637
|
ownerDocument: W,
|
|
606
638
|
panelReference: Q,
|
|
607
|
-
presenceState:
|
|
608
|
-
restoreFocus:
|
|
609
|
-
side:
|
|
610
|
-
sidebar:
|
|
611
|
-
width:
|
|
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:
|
|
648
|
+
Footer: pe,
|
|
617
649
|
Group: He,
|
|
618
650
|
Header: Ue,
|
|
619
|
-
Item:
|
|
651
|
+
Item: Ge,
|
|
620
652
|
Trigger: Je,
|
|
621
653
|
User: Qe
|
|
622
654
|
});
|