neatkit 0.9.0 → 0.11.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/Boundary.cjs +1 -1
- package/dist/Boundary.js +191 -120
- package/dist/{Button-DU4j_IED.cjs → Button-DtrX4X-s.cjs} +1 -1
- package/dist/{Button-BV5OUXpc.js → Button-LmEHdRkW.js} +2 -2
- package/dist/Button.cjs +1 -1
- package/dist/Button.js +1 -1
- package/dist/Checkbox.cjs +1 -1
- package/dist/Checkbox.js +112 -111
- package/dist/Field.cjs +1 -1
- package/dist/Field.js +57 -62
- package/dist/Icon-CMSHMSDJ.cjs +1 -0
- package/dist/{Icon-CxK1wlGk.js → Icon-NT3kRJYz.js} +275 -94
- package/dist/Icon.cjs +1 -1
- package/dist/Icon.js +1 -1
- package/dist/Input.cjs +1 -1
- package/dist/Input.js +53 -52
- package/dist/Markdown.cjs +1 -1
- package/dist/Markdown.js +1 -1
- package/dist/Modal.cjs +1 -1
- package/dist/Modal.js +58 -57
- package/dist/PinInput.cjs +1 -1
- package/dist/PinInput.js +89 -88
- package/dist/Popover.cjs +1 -1
- package/dist/Popover.js +117 -119
- package/dist/Progress.cjs +1 -0
- package/dist/Progress.js +40 -0
- package/dist/Radio.cjs +1 -1
- package/dist/Radio.js +48 -47
- package/dist/Select.cjs +1 -1
- package/dist/Select.js +364 -359
- package/dist/Sidebar.cjs +1 -1
- package/dist/Sidebar.js +381 -332
- package/dist/Spinner-BE0F4y2S.cjs +1 -0
- package/dist/Spinner-CmxlDlOk.js +23 -0
- package/dist/Spinner.cjs +1 -1
- package/dist/Spinner.js +1 -1
- package/dist/Switch.cjs +1 -1
- package/dist/Switch.js +1 -1
- package/dist/{Table-qetwZpTC.cjs → Table-Bjw9lUKS.cjs} +1 -1
- package/dist/{Table-CADupJEU.js → Table-GeoE4h-u.js} +2 -2
- package/dist/Table.cjs +1 -1
- package/dist/Table.js +1 -1
- package/dist/TextArea.cjs +1 -1
- package/dist/TextArea.js +1 -1
- package/dist/Tooltip-CpyROf6x.js +225 -0
- package/dist/Tooltip-DDPh_YFO.cjs +1 -0
- package/dist/Tooltip.cjs +1 -1
- package/dist/Tooltip.js +1 -1
- package/dist/aria-Bv-xVREf.js +17 -0
- package/dist/aria-DM-xYEHQ.cjs +1 -0
- package/dist/components/Boundary/hooks/useDocumentBackground.d.ts +28 -0
- package/dist/components/Icon/icons/AppleIcon.d.ts +11 -0
- package/dist/components/Icon/icons/BingIcon.d.ts +11 -0
- package/dist/components/Icon/icons/FacebookIcon.d.ts +11 -0
- package/dist/components/Icon/icons/GoogleIcon.d.ts +11 -0
- package/dist/components/Icon/icons/InstagramIcon.d.ts +11 -0
- package/dist/components/Icon/icons/MicrosoftIcon.d.ts +11 -0
- package/dist/components/Icon/icons/TwitterIcon.d.ts +11 -0
- package/dist/components/Icon/utils/registry.d.ts +7 -0
- package/dist/components/PinInput/PinInput.d.ts +1 -1
- package/dist/components/Portal/hooks/useAnchoredPosition.d.ts +59 -0
- package/dist/components/Progress/Progress.d.ts +38 -0
- package/dist/components/Progress/index.d.ts +2 -0
- package/dist/components/Progress/utils/value.d.ts +25 -0
- package/dist/components/Radio/Radio.d.ts +1 -1
- package/dist/components/Select/Select.d.ts +6 -74
- package/dist/components/Select/components/CustomSelect.d.ts +59 -0
- package/dist/components/Select/components/NativeSelect.d.ts +26 -0
- package/dist/components/Select/components/SelectListbox.d.ts +50 -0
- package/dist/components/Select/hooks/useSelectFormReset.d.ts +27 -0
- package/dist/components/Select/hooks/useSelectPosition.d.ts +12 -0
- package/dist/components/Select/hooks/useTypeahead.d.ts +14 -0
- package/dist/components/Select/utils/options.d.ts +38 -0
- package/dist/components/Sidebar/Sidebar.d.ts +30 -24
- package/dist/components/Sidebar/components/SidebarFallbackTrigger.d.ts +32 -0
- package/dist/components/Sidebar/components/SidebarOverlay.d.ts +3 -4
- package/dist/components/Sidebar/components/SidebarPanel.d.ts +3 -3
- package/dist/components/Sidebar/components/SidebarTrigger.d.ts +4 -0
- package/dist/effects-D98vUn6N.cjs +1 -0
- package/dist/effects-DGbA6Q2O.js +18 -0
- package/dist/style.css +1 -1
- package/dist/useAnchoredPosition-C0VS7hm6.js +105 -0
- package/dist/useAnchoredPosition-D7GRFzoX.cjs +1 -0
- package/dist/useFloatingPosition-DQgw-w_Z.cjs +1 -0
- package/dist/useFloatingPosition-MGoyautY.js +57 -0
- package/dist/useFocusTrap-BxPazAL6.js +136 -0
- package/dist/useFocusTrap-CrMcAu8s.cjs +1 -0
- package/dist/{usePresence-CqegYqy4.js → usePresence-BTRY1_l-.js} +47 -56
- package/dist/usePresence-Dm0mls5p.cjs +1 -0
- package/dist/utils/aria.d.ts +4 -5
- package/dist/utils/trigger.d.ts +46 -0
- package/package.json +6 -1
- package/dist/Icon-BIBzgznI.cjs +0 -1
- package/dist/Spinner-BXgw60UC.cjs +0 -1
- package/dist/Spinner-CVYvk6YK.js +0 -25
- package/dist/Tooltip-B2d5ss7S.cjs +0 -1
- package/dist/Tooltip-BK64rkxV.js +0 -231
- package/dist/aria-Bntn6ad_.cjs +0 -1
- package/dist/aria-CeA9QfD1.js +0 -15
- package/dist/effects-D5CWf-Pl.js +0 -8
- package/dist/effects-D85L_7zM.cjs +0 -1
- package/dist/floating-position-DIjh2wnP.cjs +0 -1
- package/dist/floating-position-DvR6e334.js +0 -50
- package/dist/useFloatingPosition-B3ZC-v3v.js +0 -43
- package/dist/useFloatingPosition-GzkP9dCc.cjs +0 -1
- package/dist/useFocusTrap-BrFZdMqQ.cjs +0 -1
- package/dist/useFocusTrap-DhVnlboe.js +0 -136
- package/dist/usePresence-B5RYv4e1.cjs +0 -1
package/dist/Sidebar.js
CHANGED
|
@@ -1,272 +1,290 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useCallback as k, useSyncExternalStore as
|
|
4
|
-
import { u as
|
|
5
|
-
import { g as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { u as
|
|
10
|
-
import { u as
|
|
11
|
-
import { m as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
function
|
|
18
|
-
const n =
|
|
19
|
-
|
|
2
|
+
import { jsx as l, jsxs as R, Fragment as H } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback as k, useSyncExternalStore as ie, forwardRef as O, useId as oe, createElement as fe, useContext as me, useRef as I, useState as C, Fragment as ge, cloneElement as ve, useMemo as re, useEffect as ne } from "react";
|
|
4
|
+
import { u as W, a as D } from "./effects-DGbA6Q2O.js";
|
|
5
|
+
import { g as he, a as le } from "./reference-CXMr27nM.js";
|
|
6
|
+
import { F as ae, c as ye, d as Se, b as _e, P as te } from "./usePresence-BTRY1_l-.js";
|
|
7
|
+
import { B as K } from "./Button-LmEHdRkW.js";
|
|
8
|
+
import { T as $ } from "./Text-rN6iDo0V.js";
|
|
9
|
+
import { u as ke } from "./useFocusTrap-BxPazAL6.js";
|
|
10
|
+
import { u as Ee } from "./useScrollLock-Drd7OZRC.js";
|
|
11
|
+
import { m as Ne } from "./aria-Bv-xVREf.js";
|
|
12
|
+
import { r as Pe } from "./useFloatingPosition-MGoyautY.js";
|
|
13
|
+
import { A as we } from "./Avatar-DjDCFqNG.js";
|
|
14
|
+
import { S as Ie } from "./Spinner-CmxlDlOk.js";
|
|
15
|
+
import { T as Oe } from "./Tooltip-CpyROf6x.js";
|
|
16
|
+
import { b as Te } from "./units-BmjPCccF.js";
|
|
17
|
+
function Be(a) {
|
|
18
|
+
const { label: r, onToggle: e, panelId: n, reference: u, side: i, sidebarOpen: c } = a;
|
|
19
|
+
return /* @__PURE__ */ l(
|
|
20
|
+
K,
|
|
21
|
+
{
|
|
22
|
+
ref: u,
|
|
23
|
+
"aria-controls": n,
|
|
24
|
+
"aria-expanded": c,
|
|
25
|
+
"aria-haspopup": "dialog",
|
|
26
|
+
"aria-label": r,
|
|
27
|
+
className: "nk-sidebar__fallback-trigger",
|
|
28
|
+
"data-side": i,
|
|
29
|
+
icon: "burger",
|
|
30
|
+
onClick: e
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
const A = /* @__PURE__ */ new WeakMap();
|
|
35
|
+
function ce(a) {
|
|
36
|
+
const r = A.get(a);
|
|
37
|
+
if (r) return r;
|
|
20
38
|
const e = {
|
|
21
39
|
listeners: /* @__PURE__ */ new Set(),
|
|
22
40
|
owner: null,
|
|
23
41
|
state: void 0
|
|
24
42
|
};
|
|
25
|
-
return
|
|
43
|
+
return A.set(a, e), e;
|
|
26
44
|
}
|
|
27
|
-
function
|
|
28
|
-
const
|
|
29
|
-
return
|
|
45
|
+
function Fe(a, r, e) {
|
|
46
|
+
const n = ce(a);
|
|
47
|
+
return n.owner !== null && n.owner !== r ? !1 : (n.owner = r, n.state = e, n.listeners.forEach((u) => u()), !0);
|
|
30
48
|
}
|
|
31
|
-
function
|
|
32
|
-
const e =
|
|
33
|
-
!e || e.owner !==
|
|
49
|
+
function xe(a, r) {
|
|
50
|
+
const e = A.get(a);
|
|
51
|
+
!e || e.owner !== r || (e.owner = null, e.state = void 0, e.listeners.forEach((n) => n()));
|
|
34
52
|
}
|
|
35
|
-
function
|
|
36
|
-
var
|
|
37
|
-
return
|
|
53
|
+
function Le(a) {
|
|
54
|
+
var r;
|
|
55
|
+
return a ? (r = A.get(a)) == null ? void 0 : r.state : void 0;
|
|
38
56
|
}
|
|
39
|
-
function
|
|
40
|
-
if (!
|
|
57
|
+
function Re(a, r) {
|
|
58
|
+
if (!a) return () => {
|
|
41
59
|
};
|
|
42
|
-
const e =
|
|
43
|
-
return e.listeners.add(
|
|
44
|
-
e.listeners.delete(
|
|
60
|
+
const e = ce(a);
|
|
61
|
+
return e.listeners.add(r), () => {
|
|
62
|
+
e.listeners.delete(r);
|
|
45
63
|
};
|
|
46
64
|
}
|
|
47
|
-
const
|
|
65
|
+
const Ce = () => {
|
|
48
66
|
};
|
|
49
|
-
function
|
|
50
|
-
const
|
|
51
|
-
(
|
|
52
|
-
[
|
|
53
|
-
),
|
|
54
|
-
return
|
|
67
|
+
function F(a) {
|
|
68
|
+
const r = W(a).boundaryElement, e = k(
|
|
69
|
+
(u) => Re(r, u),
|
|
70
|
+
[r]
|
|
71
|
+
), n = k(() => Le(r), [r]);
|
|
72
|
+
return ie(e, n, Ce);
|
|
55
73
|
}
|
|
56
|
-
function
|
|
57
|
-
return
|
|
74
|
+
function j(a, r) {
|
|
75
|
+
return a === "both" || a === (r === "overlay" ? "overlay" : "inline");
|
|
58
76
|
}
|
|
59
|
-
const
|
|
60
|
-
function(
|
|
61
|
-
const { children:
|
|
62
|
-
return
|
|
77
|
+
const De = O(
|
|
78
|
+
function(r, e) {
|
|
79
|
+
const { children: n, className: u, presentation: i = "both", ...c } = r, s = F("Sidebar.Footer");
|
|
80
|
+
return j(i, s == null ? void 0 : s.presentation) ? /* @__PURE__ */ l(
|
|
63
81
|
"div",
|
|
64
82
|
{
|
|
65
|
-
...
|
|
83
|
+
...c,
|
|
66
84
|
ref: e,
|
|
67
|
-
className: ["nk-sidebar__footer",
|
|
68
|
-
children:
|
|
85
|
+
className: ["nk-sidebar__footer", u].filter(Boolean).join(" "),
|
|
86
|
+
children: n
|
|
69
87
|
}
|
|
70
88
|
) : null;
|
|
71
89
|
}
|
|
72
|
-
),
|
|
73
|
-
function(
|
|
90
|
+
), Ae = O(
|
|
91
|
+
function(r, e) {
|
|
74
92
|
const {
|
|
75
|
-
"aria-label":
|
|
76
|
-
"aria-labelledby":
|
|
77
|
-
children:
|
|
78
|
-
className:
|
|
79
|
-
label:
|
|
93
|
+
"aria-label": n,
|
|
94
|
+
"aria-labelledby": u,
|
|
95
|
+
children: i,
|
|
96
|
+
className: c,
|
|
97
|
+
label: s,
|
|
80
98
|
presentation: y = "both",
|
|
81
|
-
...
|
|
82
|
-
} =
|
|
83
|
-
if (!
|
|
99
|
+
...g
|
|
100
|
+
} = r, h = F("Sidebar.Group"), v = `${oe()}-label`, b = s != null && typeof s != "boolean" && (typeof s != "string" || s.trim() !== "");
|
|
101
|
+
if (!j(y, h == null ? void 0 : h.presentation))
|
|
84
102
|
return null;
|
|
85
|
-
const
|
|
86
|
-
return
|
|
87
|
-
!!(
|
|
103
|
+
const o = u ?? (n === void 0 && b ? v : void 0);
|
|
104
|
+
return fe(
|
|
105
|
+
!!(n ?? o) ? "nav" : "div",
|
|
88
106
|
{
|
|
89
|
-
...
|
|
107
|
+
...g,
|
|
90
108
|
ref: e,
|
|
91
|
-
"aria-label":
|
|
92
|
-
"aria-labelledby":
|
|
93
|
-
className: ["nk-sidebar__group",
|
|
109
|
+
"aria-label": n,
|
|
110
|
+
"aria-labelledby": o,
|
|
111
|
+
className: ["nk-sidebar__group", c].filter(Boolean).join(" ")
|
|
94
112
|
},
|
|
95
|
-
|
|
96
|
-
|
|
113
|
+
b ? /* @__PURE__ */ l(
|
|
114
|
+
$,
|
|
97
115
|
{
|
|
98
116
|
as: "h2",
|
|
99
117
|
className: "nk-sidebar__group-label",
|
|
100
118
|
id: v,
|
|
101
119
|
size: "subtitle",
|
|
102
120
|
weight: "medium",
|
|
103
|
-
children:
|
|
121
|
+
children: s
|
|
104
122
|
}
|
|
105
123
|
) : null,
|
|
106
|
-
/* @__PURE__ */
|
|
124
|
+
/* @__PURE__ */ l("ul", { className: "nk-sidebar__list", children: i })
|
|
107
125
|
);
|
|
108
126
|
}
|
|
109
|
-
),
|
|
110
|
-
function(
|
|
111
|
-
const { children:
|
|
112
|
-
return
|
|
127
|
+
), je = O(
|
|
128
|
+
function(r, e) {
|
|
129
|
+
const { children: n, className: u, presentation: i = "both", ...c } = r, s = F("Sidebar.Header");
|
|
130
|
+
return j(i, s == null ? void 0 : s.presentation) ? /* @__PURE__ */ l(
|
|
113
131
|
"div",
|
|
114
132
|
{
|
|
115
|
-
...
|
|
133
|
+
...c,
|
|
116
134
|
ref: e,
|
|
117
|
-
className: ["nk-sidebar__header",
|
|
118
|
-
children:
|
|
135
|
+
className: ["nk-sidebar__header", u].filter(Boolean).join(" "),
|
|
136
|
+
children: n
|
|
119
137
|
}
|
|
120
138
|
) : null;
|
|
121
139
|
}
|
|
122
|
-
),
|
|
123
|
-
function(
|
|
140
|
+
), Ue = O(
|
|
141
|
+
function(r, e) {
|
|
124
142
|
const {
|
|
125
|
-
active:
|
|
126
|
-
as:
|
|
127
|
-
children:
|
|
128
|
-
className:
|
|
129
|
-
disabled:
|
|
143
|
+
active: n = !1,
|
|
144
|
+
as: u,
|
|
145
|
+
children: i,
|
|
146
|
+
className: c,
|
|
147
|
+
disabled: s = !1,
|
|
130
148
|
icon: y,
|
|
131
|
-
onClick:
|
|
132
|
-
presentation:
|
|
149
|
+
onClick: g,
|
|
150
|
+
presentation: h = "both",
|
|
133
151
|
type: v,
|
|
134
|
-
...
|
|
135
|
-
} =
|
|
136
|
-
function
|
|
137
|
-
if (
|
|
138
|
-
|
|
152
|
+
...b
|
|
153
|
+
} = r, o = F("Sidebar.Item"), t = u ?? "button", d = t === "button", f = b, E = f.href !== void 0 || f.to !== void 0;
|
|
154
|
+
function m(N) {
|
|
155
|
+
if (s) {
|
|
156
|
+
N.preventDefault();
|
|
139
157
|
return;
|
|
140
158
|
}
|
|
141
|
-
|
|
159
|
+
g == null || g(N), o != null && o.open && o.presentation === "overlay" && !N.defaultPrevented && o.requestOpenChange(!1, "item");
|
|
142
160
|
}
|
|
143
|
-
return
|
|
144
|
-
|
|
161
|
+
return j(h, o == null ? void 0 : o.presentation) ? /* @__PURE__ */ l("li", { className: "nk-sidebar__item-container", children: /* @__PURE__ */ l(
|
|
162
|
+
K,
|
|
145
163
|
{
|
|
146
|
-
...
|
|
164
|
+
...b,
|
|
147
165
|
ref: e,
|
|
148
|
-
"aria-current":
|
|
149
|
-
as:
|
|
150
|
-
className: ["nk-sidebar__item",
|
|
151
|
-
"data-active":
|
|
152
|
-
disabled:
|
|
166
|
+
"aria-current": n ? E ? "page" : "true" : void 0,
|
|
167
|
+
as: t,
|
|
168
|
+
className: ["nk-sidebar__item", c].filter(Boolean).join(" "),
|
|
169
|
+
"data-active": n || void 0,
|
|
170
|
+
disabled: s,
|
|
153
171
|
fullWidth: !0,
|
|
154
|
-
href:
|
|
172
|
+
href: f.href,
|
|
155
173
|
icon: y,
|
|
156
|
-
onClick:
|
|
174
|
+
onClick: m,
|
|
157
175
|
shape: "rectangle",
|
|
158
176
|
textAlignment: "left",
|
|
159
|
-
type:
|
|
177
|
+
type: d ? v ?? "button" : v,
|
|
160
178
|
variant: "ghost",
|
|
161
|
-
children: /* @__PURE__ */
|
|
179
|
+
children: /* @__PURE__ */ l("span", { className: "nk-sidebar__item-label", children: i })
|
|
162
180
|
}
|
|
163
181
|
) }) : null;
|
|
164
182
|
}
|
|
165
183
|
);
|
|
166
|
-
function
|
|
184
|
+
function de(a) {
|
|
167
185
|
const {
|
|
168
|
-
"aria-label":
|
|
186
|
+
"aria-label": r,
|
|
169
187
|
"aria-labelledby": e,
|
|
170
|
-
children:
|
|
171
|
-
className:
|
|
172
|
-
|
|
173
|
-
open:
|
|
174
|
-
panelId:
|
|
188
|
+
children: n,
|
|
189
|
+
className: u,
|
|
190
|
+
height: i,
|
|
191
|
+
open: c,
|
|
192
|
+
panelId: s,
|
|
175
193
|
panelReference: y,
|
|
176
|
-
presentation:
|
|
177
|
-
side:
|
|
194
|
+
presentation: g,
|
|
195
|
+
side: h,
|
|
178
196
|
state: v,
|
|
179
|
-
style:
|
|
180
|
-
width:
|
|
181
|
-
...
|
|
182
|
-
} =
|
|
183
|
-
let
|
|
184
|
-
return (
|
|
197
|
+
style: b,
|
|
198
|
+
width: o,
|
|
199
|
+
...t
|
|
200
|
+
} = a, d = g === "overlay", f = r ?? (e === void 0 ? "Sidebar" : void 0), E = d && c;
|
|
201
|
+
let m = b;
|
|
202
|
+
return (o !== void 0 || i !== void 0) && (m = { ...b }, i !== void 0 && (m["--nk-sidebar-height"] = i), o !== void 0 && (m["--nk-sidebar-width"] = o)), /* @__PURE__ */ l(
|
|
185
203
|
"aside",
|
|
186
204
|
{
|
|
187
|
-
...
|
|
205
|
+
...t,
|
|
188
206
|
ref: y,
|
|
189
|
-
"aria-hidden":
|
|
190
|
-
"aria-label":
|
|
191
|
-
"aria-labelledby":
|
|
192
|
-
"aria-modal":
|
|
193
|
-
className: ["nk-sidebar",
|
|
194
|
-
"data-responsive":
|
|
195
|
-
"data-side":
|
|
207
|
+
"aria-hidden": d && !c ? !0 : void 0,
|
|
208
|
+
"aria-label": d && !c ? void 0 : f,
|
|
209
|
+
"aria-labelledby": d && !c ? void 0 : e,
|
|
210
|
+
"aria-modal": E ? "true" : void 0,
|
|
211
|
+
className: ["nk-sidebar", u].filter(Boolean).join(" "),
|
|
212
|
+
"data-responsive": g === "pending" || void 0,
|
|
213
|
+
"data-side": h,
|
|
196
214
|
"data-state": v,
|
|
197
|
-
"data-variant":
|
|
198
|
-
id:
|
|
199
|
-
role:
|
|
200
|
-
style:
|
|
201
|
-
tabIndex:
|
|
202
|
-
children: /* @__PURE__ */
|
|
215
|
+
"data-variant": d ? "overlay" : "inline",
|
|
216
|
+
id: s,
|
|
217
|
+
role: E ? "dialog" : void 0,
|
|
218
|
+
style: m,
|
|
219
|
+
tabIndex: d ? -1 : void 0,
|
|
220
|
+
children: /* @__PURE__ */ l("div", { className: "nk-sidebar__body", children: n })
|
|
203
221
|
}
|
|
204
222
|
);
|
|
205
223
|
}
|
|
206
|
-
function
|
|
224
|
+
function ze(a) {
|
|
207
225
|
const {
|
|
208
|
-
boundaries:
|
|
226
|
+
boundaries: r,
|
|
209
227
|
initialFocusReference: e,
|
|
210
|
-
lockScroll:
|
|
211
|
-
ownerDocument:
|
|
212
|
-
panelReference:
|
|
213
|
-
presenceState:
|
|
214
|
-
restoreFocus:
|
|
228
|
+
lockScroll: n,
|
|
229
|
+
ownerDocument: u,
|
|
230
|
+
panelReference: i,
|
|
231
|
+
presenceState: c,
|
|
232
|
+
restoreFocus: s,
|
|
215
233
|
sidebar: y,
|
|
216
|
-
side:
|
|
217
|
-
...
|
|
218
|
-
} =
|
|
219
|
-
|
|
220
|
-
}, [o]);
|
|
221
|
-
R(() => {
|
|
222
|
-
c && (c.inert = !p);
|
|
223
|
-
}, [p, c]);
|
|
224
|
-
const D = k(() => {
|
|
225
|
-
i(!1, "escape");
|
|
226
|
-
}, [i]), N = k(() => {
|
|
227
|
-
i(!1, "outside");
|
|
234
|
+
side: g,
|
|
235
|
+
...h
|
|
236
|
+
} = a, { id: v, open: b, requestOpenChange: o } = y, t = me(ae), d = I(null), [f, E] = C(null), m = W("Sidebar").boundaryElement, N = ye(!0, m), U = k((T) => {
|
|
237
|
+
d.current = T, i(T), E(T);
|
|
228
238
|
}, [i]);
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
239
|
+
D(() => {
|
|
240
|
+
f && (f.inert = !b);
|
|
241
|
+
}, [b, f]);
|
|
242
|
+
const z = k(() => {
|
|
243
|
+
o(!1, "escape");
|
|
244
|
+
}, [o]), G = k(() => {
|
|
245
|
+
o(!1, "outside");
|
|
246
|
+
}, [o]);
|
|
247
|
+
Se({
|
|
248
|
+
boundary: m,
|
|
249
|
+
active: b,
|
|
250
|
+
boundaries: r,
|
|
233
251
|
dismissOnEscape: !0,
|
|
234
252
|
dismissOnPointerDownOutside: !0,
|
|
235
|
-
layerId:
|
|
236
|
-
onEscapeDismiss:
|
|
237
|
-
onPointerDownOutsideDismiss:
|
|
238
|
-
ownerDocument:
|
|
253
|
+
layerId: N.id,
|
|
254
|
+
onEscapeDismiss: z,
|
|
255
|
+
onPointerDownOutsideDismiss: G,
|
|
256
|
+
ownerDocument: u
|
|
239
257
|
});
|
|
240
|
-
const
|
|
241
|
-
boundary:
|
|
242
|
-
active:
|
|
243
|
-
container:
|
|
244
|
-
initialFocusReference: e ??
|
|
245
|
-
layerId:
|
|
246
|
-
restoreFocus:
|
|
258
|
+
const x = ke({
|
|
259
|
+
boundary: m,
|
|
260
|
+
active: b,
|
|
261
|
+
container: f,
|
|
262
|
+
initialFocusReference: e ?? d,
|
|
263
|
+
layerId: N.id,
|
|
264
|
+
restoreFocus: s
|
|
247
265
|
});
|
|
248
|
-
return
|
|
249
|
-
|
|
266
|
+
return Ee(n && b, u, m), /* @__PURE__ */ l(
|
|
267
|
+
ae.Provider,
|
|
250
268
|
{
|
|
251
|
-
value:
|
|
252
|
-
children: /* @__PURE__ */
|
|
269
|
+
value: b ? x : t,
|
|
270
|
+
children: /* @__PURE__ */ l(
|
|
253
271
|
"div",
|
|
254
272
|
{
|
|
255
273
|
className: "nk-sidebar__overlay",
|
|
256
|
-
"data-side":
|
|
257
|
-
"data-state":
|
|
274
|
+
"data-side": g,
|
|
275
|
+
"data-state": c,
|
|
258
276
|
role: "presentation",
|
|
259
|
-
style: { zIndex:
|
|
260
|
-
children: /* @__PURE__ */
|
|
261
|
-
|
|
277
|
+
style: { zIndex: N.zIndex },
|
|
278
|
+
children: /* @__PURE__ */ l(
|
|
279
|
+
de,
|
|
262
280
|
{
|
|
263
|
-
...
|
|
264
|
-
open:
|
|
281
|
+
...h,
|
|
282
|
+
open: b,
|
|
265
283
|
panelId: v,
|
|
266
|
-
panelReference:
|
|
284
|
+
panelReference: U,
|
|
267
285
|
presentation: "overlay",
|
|
268
|
-
side:
|
|
269
|
-
state:
|
|
286
|
+
side: g,
|
|
287
|
+
state: c
|
|
270
288
|
}
|
|
271
289
|
)
|
|
272
290
|
}
|
|
@@ -274,217 +292,248 @@ function Te(t) {
|
|
|
274
292
|
}
|
|
275
293
|
);
|
|
276
294
|
}
|
|
277
|
-
function
|
|
278
|
-
const { children:
|
|
279
|
-
if (
|
|
295
|
+
function Ge(a) {
|
|
296
|
+
const { children: r } = a;
|
|
297
|
+
if (r.type === ge)
|
|
280
298
|
throw new Error("Sidebar.Trigger requires a single non-Fragment child");
|
|
281
|
-
const e =
|
|
282
|
-
const
|
|
283
|
-
|
|
284
|
-
}, [
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
}, [r, e]);
|
|
299
|
+
const e = F("Sidebar.Trigger"), n = r.props, u = he(r), i = e == null ? void 0 : e.registerTrigger, c = e == null ? void 0 : e.unregisterTrigger, s = I(null), y = k((d) => {
|
|
300
|
+
const f = s.current;
|
|
301
|
+
f && f !== d && (c == null || c(f)), s.current = d, d && (i == null || i(d)), le(u, d);
|
|
302
|
+
}, [u, i, c]), g = k((d) => {
|
|
303
|
+
d.defaultPrevented || !e || e.requestOpenChange(!e.open, "trigger");
|
|
304
|
+
}, [e]);
|
|
288
305
|
if (!e) return null;
|
|
289
|
-
const { id:
|
|
290
|
-
return
|
|
291
|
-
|
|
292
|
-
{
|
|
293
|
-
"aria-controls": v &&
|
|
306
|
+
const { id: h, open: v, presentation: b, variant: o } = e;
|
|
307
|
+
return ve(
|
|
308
|
+
r,
|
|
309
|
+
Pe(n, {
|
|
310
|
+
"aria-controls": v && b === "overlay" ? Ne(n["aria-controls"], h) : n["aria-controls"],
|
|
294
311
|
"aria-expanded": v,
|
|
295
|
-
"aria-haspopup":
|
|
296
|
-
className:
|
|
297
|
-
"data-sidebar-variant":
|
|
298
|
-
onClick:
|
|
312
|
+
"aria-haspopup": n["aria-haspopup"] ?? "dialog",
|
|
313
|
+
className: "nk-sidebar__trigger",
|
|
314
|
+
"data-sidebar-variant": o,
|
|
315
|
+
onClick: g,
|
|
299
316
|
ref: y
|
|
300
|
-
}
|
|
317
|
+
})
|
|
301
318
|
);
|
|
302
319
|
}
|
|
303
|
-
const
|
|
304
|
-
function(
|
|
320
|
+
const Me = O(
|
|
321
|
+
function(r, e) {
|
|
305
322
|
const {
|
|
306
|
-
actions:
|
|
307
|
-
className:
|
|
308
|
-
description:
|
|
309
|
-
image:
|
|
310
|
-
loading:
|
|
323
|
+
actions: n,
|
|
324
|
+
className: u,
|
|
325
|
+
description: i,
|
|
326
|
+
image: c,
|
|
327
|
+
loading: s = !1,
|
|
311
328
|
name: y,
|
|
312
|
-
onClick:
|
|
313
|
-
...
|
|
314
|
-
} =
|
|
315
|
-
/* @__PURE__ */
|
|
316
|
-
|
|
329
|
+
onClick: g,
|
|
330
|
+
...h
|
|
331
|
+
} = r, v = i != null && typeof i != "boolean", b = /* @__PURE__ */ R(H, { children: [
|
|
332
|
+
/* @__PURE__ */ l(
|
|
333
|
+
we,
|
|
317
334
|
{
|
|
318
335
|
alt: y,
|
|
319
336
|
"aria-hidden": !0,
|
|
320
337
|
className: "nk-sidebar__user-avatar",
|
|
321
|
-
image:
|
|
338
|
+
image: c
|
|
322
339
|
}
|
|
323
340
|
),
|
|
324
|
-
/* @__PURE__ */
|
|
325
|
-
/* @__PURE__ */
|
|
326
|
-
v ? /* @__PURE__ */
|
|
327
|
-
|
|
341
|
+
/* @__PURE__ */ R("span", { className: "nk-sidebar__user-text", children: [
|
|
342
|
+
/* @__PURE__ */ l($, { as: "span", className: "nk-sidebar__user-name", children: y }),
|
|
343
|
+
v ? /* @__PURE__ */ l(
|
|
344
|
+
$,
|
|
328
345
|
{
|
|
329
346
|
as: "span",
|
|
330
347
|
className: "nk-sidebar__user-description",
|
|
331
348
|
size: "caption",
|
|
332
349
|
tone: "muted",
|
|
333
|
-
children:
|
|
350
|
+
children: i
|
|
334
351
|
}
|
|
335
352
|
) : null
|
|
336
353
|
] })
|
|
337
354
|
] });
|
|
338
|
-
return /* @__PURE__ */
|
|
355
|
+
return /* @__PURE__ */ l(
|
|
339
356
|
"div",
|
|
340
357
|
{
|
|
341
|
-
...
|
|
358
|
+
...h,
|
|
342
359
|
ref: e,
|
|
343
|
-
className: ["nk-sidebar__user",
|
|
344
|
-
children:
|
|
345
|
-
|
|
360
|
+
className: ["nk-sidebar__user", u].filter(Boolean).join(" "),
|
|
361
|
+
children: s ? /* @__PURE__ */ l(Ie, { className: "nk-sidebar__user-spinner", size: 16 }) : /* @__PURE__ */ R(H, { children: [
|
|
362
|
+
g ? /* @__PURE__ */ l(
|
|
346
363
|
"button",
|
|
347
364
|
{
|
|
348
365
|
className: "nk-sidebar__user-details",
|
|
349
|
-
onClick:
|
|
366
|
+
onClick: g,
|
|
350
367
|
type: "button",
|
|
351
|
-
children:
|
|
368
|
+
children: b
|
|
352
369
|
}
|
|
353
|
-
) : /* @__PURE__ */
|
|
354
|
-
|
|
370
|
+
) : /* @__PURE__ */ l("div", { className: "nk-sidebar__user-details", children: b }),
|
|
371
|
+
n !== void 0 && n.length > 0 ? /* @__PURE__ */ l("div", { className: "nk-sidebar__user-actions", children: n.map((o) => {
|
|
355
372
|
const {
|
|
356
|
-
"aria-label":
|
|
357
|
-
icon:
|
|
358
|
-
label:
|
|
359
|
-
...
|
|
360
|
-
} =
|
|
361
|
-
return /* @__PURE__ */
|
|
362
|
-
|
|
373
|
+
"aria-label": t,
|
|
374
|
+
icon: d,
|
|
375
|
+
label: f,
|
|
376
|
+
...E
|
|
377
|
+
} = o;
|
|
378
|
+
return /* @__PURE__ */ l(Oe, { content: f, children: /* @__PURE__ */ l(
|
|
379
|
+
K,
|
|
363
380
|
{
|
|
364
|
-
...
|
|
365
|
-
"aria-label":
|
|
381
|
+
...E,
|
|
382
|
+
"aria-label": t ?? f,
|
|
366
383
|
className: "nk-sidebar__user-action",
|
|
367
|
-
icon:
|
|
384
|
+
icon: d,
|
|
368
385
|
shape: "rectangle",
|
|
369
386
|
type: "button",
|
|
370
387
|
variant: "ghost"
|
|
371
388
|
}
|
|
372
|
-
) },
|
|
389
|
+
) }, f);
|
|
373
390
|
}) }) : null
|
|
374
391
|
] })
|
|
375
392
|
}
|
|
376
393
|
);
|
|
377
394
|
}
|
|
378
|
-
),
|
|
379
|
-
},
|
|
395
|
+
), qe = () => () => {
|
|
396
|
+
}, se = () => {
|
|
380
397
|
};
|
|
381
|
-
function
|
|
382
|
-
const e =
|
|
383
|
-
(e == null ? void 0 : e.subscribe) ??
|
|
384
|
-
(e == null ? void 0 : e.read) ??
|
|
385
|
-
|
|
398
|
+
function He(a, r) {
|
|
399
|
+
const e = a === "responsive" ? r : void 0, n = ie(
|
|
400
|
+
(e == null ? void 0 : e.subscribe) ?? qe,
|
|
401
|
+
(e == null ? void 0 : e.read) ?? se,
|
|
402
|
+
se
|
|
386
403
|
);
|
|
387
|
-
return
|
|
404
|
+
return a !== "responsive" ? a : n === void 0 ? "pending" : n >= Te("md") ? "inline" : "overlay";
|
|
388
405
|
}
|
|
389
|
-
const
|
|
390
|
-
var
|
|
406
|
+
const $e = 32, We = O(function(r, e) {
|
|
407
|
+
var ee;
|
|
391
408
|
const {
|
|
392
|
-
defaultOpen:
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
lockScroll:
|
|
396
|
-
onOpenChange:
|
|
409
|
+
defaultOpen: n = !1,
|
|
410
|
+
height: u,
|
|
411
|
+
initialFocusReference: i,
|
|
412
|
+
lockScroll: c = !0,
|
|
413
|
+
onOpenChange: s,
|
|
397
414
|
open: y,
|
|
398
|
-
restoreFocus:
|
|
399
|
-
side:
|
|
415
|
+
restoreFocus: g = !0,
|
|
416
|
+
side: h = "left",
|
|
400
417
|
variant: v = "responsive",
|
|
401
|
-
width:
|
|
402
|
-
...
|
|
403
|
-
} =
|
|
404
|
-
|
|
405
|
-
|
|
418
|
+
width: b,
|
|
419
|
+
...o
|
|
420
|
+
} = r, t = W("Sidebar"), d = `${oe()}-sidebar`, f = I(Symbol("nk-sidebar")).current, E = I(null), m = He(v, t == null ? void 0 : t.width), N = y !== void 0, [U, z] = C(n), [G, x] = C(0), [T, ue] = C(!1), V = I(null), w = N ? y : U, L = I(s);
|
|
421
|
+
D(() => {
|
|
422
|
+
L.current = s;
|
|
406
423
|
});
|
|
407
|
-
const
|
|
408
|
-
var
|
|
409
|
-
|
|
410
|
-
}, [
|
|
411
|
-
|
|
412
|
-
}, [e]),
|
|
413
|
-
() => [
|
|
424
|
+
const B = k((p, S) => {
|
|
425
|
+
var _;
|
|
426
|
+
w !== p && (N || z(p), (_ = L.current) == null || _.call(L, p, S));
|
|
427
|
+
}, [N, w]), Y = k((p) => {
|
|
428
|
+
E.current = p, le(e, p);
|
|
429
|
+
}, [e]), P = re(
|
|
430
|
+
() => [E],
|
|
414
431
|
[]
|
|
415
|
-
),
|
|
416
|
-
|
|
417
|
-
}, [
|
|
418
|
-
const
|
|
419
|
-
|
|
420
|
-
}, [
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
432
|
+
), J = k((p) => {
|
|
433
|
+
P.push({ current: p }), x((S) => S + 1);
|
|
434
|
+
}, [P]), Q = k((p) => {
|
|
435
|
+
const S = P.findIndex((_) => _.current === p);
|
|
436
|
+
S > 0 && P.splice(S, 1), x((_) => Math.max(_ - 1, 0));
|
|
437
|
+
}, [P]), pe = k((p) => {
|
|
438
|
+
const S = V.current;
|
|
439
|
+
if (S && S !== p) {
|
|
440
|
+
const _ = P.findIndex((be) => be.current === S);
|
|
441
|
+
_ > 0 && P.splice(_, 1);
|
|
442
|
+
}
|
|
443
|
+
V.current = p, p && P.push({ current: p });
|
|
444
|
+
}, [P]), M = re(() => ({
|
|
445
|
+
id: d,
|
|
446
|
+
open: w,
|
|
447
|
+
presentation: m,
|
|
448
|
+
registerTrigger: J,
|
|
449
|
+
requestOpenChange: B,
|
|
450
|
+
unregisterTrigger: Q,
|
|
427
451
|
variant: v
|
|
428
452
|
}), [
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
453
|
+
w,
|
|
454
|
+
d,
|
|
455
|
+
m,
|
|
456
|
+
J,
|
|
457
|
+
B,
|
|
458
|
+
Q,
|
|
435
459
|
v
|
|
436
460
|
]);
|
|
437
|
-
|
|
438
|
-
const
|
|
439
|
-
if (!
|
|
440
|
-
if (
|
|
461
|
+
D(() => {
|
|
462
|
+
const p = t == null ? void 0 : t.boundaryElement;
|
|
463
|
+
if (!p) return;
|
|
464
|
+
if (Fe(p, f, M) === !1)
|
|
441
465
|
throw new Error(
|
|
442
466
|
"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."
|
|
443
467
|
);
|
|
444
|
-
}, [
|
|
445
|
-
const
|
|
446
|
-
if (
|
|
447
|
-
return () =>
|
|
448
|
-
}, [
|
|
449
|
-
|
|
450
|
-
}, [
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
468
|
+
}, [t == null ? void 0 : t.boundaryElement, f, M]), D(() => {
|
|
469
|
+
const p = t == null ? void 0 : t.boundaryElement;
|
|
470
|
+
if (p)
|
|
471
|
+
return () => xe(p, f);
|
|
472
|
+
}, [t == null ? void 0 : t.boundaryElement, f]), ne(() => {
|
|
473
|
+
m === "inline" && B(!1, "variant");
|
|
474
|
+
}, [m, B]), ne(() => {
|
|
475
|
+
var _;
|
|
476
|
+
const p = (_ = t == null ? void 0 : t.boundaryElement) == null ? void 0 : _.ownerDocument.defaultView;
|
|
477
|
+
if (!p) return;
|
|
478
|
+
const S = p.setTimeout(
|
|
479
|
+
() => ue(!0),
|
|
480
|
+
$e
|
|
481
|
+
);
|
|
482
|
+
return () => p.clearTimeout(S);
|
|
483
|
+
}, [t == null ? void 0 : t.boundaryElement]);
|
|
484
|
+
const q = _e(w && m === "overlay"), X = ((ee = t == null ? void 0 : t.boundaryElement) == null ? void 0 : ee.ownerDocument) ?? (typeof document > "u" ? null : document);
|
|
485
|
+
if (m !== "overlay")
|
|
486
|
+
return /* @__PURE__ */ l(
|
|
487
|
+
de,
|
|
488
|
+
{
|
|
489
|
+
...o,
|
|
490
|
+
height: u,
|
|
491
|
+
open: !1,
|
|
492
|
+
panelId: d,
|
|
493
|
+
panelReference: Y,
|
|
494
|
+
presentation: m,
|
|
495
|
+
side: h,
|
|
496
|
+
width: b
|
|
497
|
+
}
|
|
498
|
+
);
|
|
499
|
+
const Z = T && G === 0 ? /* @__PURE__ */ l(te, { children: /* @__PURE__ */ l(
|
|
500
|
+
Be,
|
|
466
501
|
{
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
panelReference: G,
|
|
474
|
-
restoreFocus: m,
|
|
475
|
-
sidebar: j,
|
|
476
|
-
side: g,
|
|
477
|
-
width: p
|
|
502
|
+
label: `Open ${o["aria-label"] ?? "Sidebar"}`,
|
|
503
|
+
onToggle: () => B(!w, "trigger"),
|
|
504
|
+
panelId: q.present ? d : void 0,
|
|
505
|
+
reference: pe,
|
|
506
|
+
side: h,
|
|
507
|
+
sidebarOpen: w
|
|
478
508
|
}
|
|
479
|
-
) });
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
509
|
+
) }) : null;
|
|
510
|
+
return !q.present || !X ? Z : /* @__PURE__ */ R(H, { children: [
|
|
511
|
+
Z,
|
|
512
|
+
/* @__PURE__ */ l(te, { children: /* @__PURE__ */ l(
|
|
513
|
+
ze,
|
|
514
|
+
{
|
|
515
|
+
...o,
|
|
516
|
+
boundaries: P,
|
|
517
|
+
initialFocusReference: i,
|
|
518
|
+
lockScroll: c,
|
|
519
|
+
ownerDocument: X,
|
|
520
|
+
panelReference: Y,
|
|
521
|
+
presenceState: q.state === "closing" ? "closing" : "open",
|
|
522
|
+
restoreFocus: g,
|
|
523
|
+
side: h,
|
|
524
|
+
sidebar: M,
|
|
525
|
+
width: b
|
|
526
|
+
}
|
|
527
|
+
) })
|
|
528
|
+
] });
|
|
529
|
+
}), lr = Object.assign(We, {
|
|
530
|
+
Footer: De,
|
|
531
|
+
Group: Ae,
|
|
532
|
+
Header: je,
|
|
533
|
+
Item: Ue,
|
|
534
|
+
Trigger: Ge,
|
|
535
|
+
User: Me
|
|
487
536
|
});
|
|
488
537
|
export {
|
|
489
|
-
|
|
538
|
+
lr as default
|
|
490
539
|
};
|