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