ics-ui-kit 0.1.3 → 0.1.5
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/components/glass-toolbar/GlassToolbar.d.ts +51 -0
- package/dist/components/glass-toolbar/GlassToolbar.stories.d.ts +14 -0
- package/dist/components/glass-toolbar/index.d.ts +2 -0
- package/dist/components/glass-toolbar.d.ts +2 -0
- package/dist/components/glass-toolbar.js +99 -0
- package/dist/components/glass-toolbar.js.map +1 -0
- package/dist/components/resizable/Resizable.d.ts +1 -0
- package/dist/components/resizable/index.d.ts +1 -1
- package/dist/components/resizable.js +78 -77
- package/dist/components/resizable.js.map +1 -1
- package/dist/components/sidebar/Sidebar.stories.d.ts +1 -0
- package/dist/components/toolbar.js +85 -197
- package/dist/components/toolbar.js.map +1 -1
- package/dist/index-BDrapWDv.js +122 -0
- package/dist/index-BDrapWDv.js.map +1 -0
- package/dist/styles-scoped.css +59 -12
- package/dist/styles.css +59 -12
- package/dist/theme.css +17 -13
- package/package.json +1 -1
- package/tailwind.preset.js +4 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as we } from "react/jsx-runtime";
|
|
2
2
|
import * as Rn from "react";
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { T as
|
|
3
|
+
import { forwardRef as nn, createElement as de, useRef as F, useEffect as te, useContext as tn, createContext as Ln, useState as ce, useLayoutEffect as An, useImperativeHandle as rn, useCallback as B, useMemo as kn } from "react";
|
|
4
|
+
import { T as on } from "../index-BVqs-uqP.js";
|
|
5
5
|
import { I as Dn } from "../Icon-DH3ev9GK.js";
|
|
6
6
|
import { c as Hn } from "../createLucideIcon-DwBrHnj9.js";
|
|
7
7
|
/**
|
|
@@ -32,13 +32,13 @@ const A = {
|
|
|
32
32
|
resizeHandleEnabled: "data-panel-resize-handle-enabled",
|
|
33
33
|
resizeHandleId: "data-panel-resize-handle-id",
|
|
34
34
|
resizeHandleState: "data-resize-handle-state"
|
|
35
|
-
}, Fe = 10, re = An,
|
|
35
|
+
}, Fe = 10, re = An, Oe = Rn.useId, Nn = typeof Oe == "function" ? Oe : () => null;
|
|
36
36
|
let $n = 0;
|
|
37
37
|
function Ve(e = null) {
|
|
38
38
|
const n = Nn(), t = F(e || n || null);
|
|
39
39
|
return t.current === null && (t.current = "" + $n++), e ?? t.current;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function ln({
|
|
42
42
|
children: e,
|
|
43
43
|
className: n = "",
|
|
44
44
|
collapsedSize: t,
|
|
@@ -56,7 +56,7 @@ function on({
|
|
|
56
56
|
tagName: y = "div",
|
|
57
57
|
...I
|
|
58
58
|
}) {
|
|
59
|
-
const w =
|
|
59
|
+
const w = tn(Re);
|
|
60
60
|
if (w === null)
|
|
61
61
|
throw Error("Panel components must be rendered within a PanelGroup container");
|
|
62
62
|
const {
|
|
@@ -102,7 +102,7 @@ function on({
|
|
|
102
102
|
return K($), () => {
|
|
103
103
|
V($);
|
|
104
104
|
};
|
|
105
|
-
}, [c, _, K, V]),
|
|
105
|
+
}, [c, _, K, V]), rn(o, () => ({
|
|
106
106
|
collapse: () => {
|
|
107
107
|
b(k.current);
|
|
108
108
|
},
|
|
@@ -143,15 +143,15 @@ function on({
|
|
|
143
143
|
[A.panelSize]: parseFloat("" + ee.flexGrow).toFixed(1)
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
|
-
const
|
|
146
|
+
const an = nn((e, n) => de(ln, {
|
|
147
147
|
...e,
|
|
148
148
|
forwardedRef: n
|
|
149
149
|
}));
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
ln.displayName = "Panel";
|
|
151
|
+
an.displayName = "forwardRef(Panel)";
|
|
152
152
|
let Be = null, Ie = -1, Z = null;
|
|
153
153
|
function _n(e, n, t) {
|
|
154
|
-
const r = (n &
|
|
154
|
+
const r = (n & fn) !== 0, i = (n & pn) !== 0, o = (n & gn) !== 0, l = (n & mn) !== 0;
|
|
155
155
|
if (n) {
|
|
156
156
|
if (r)
|
|
157
157
|
return o ? "se-resize" : l ? "ne-resize" : "e-resize";
|
|
@@ -185,23 +185,23 @@ function Ne(e, n, t) {
|
|
|
185
185
|
Ie = (r = (i = Z.sheet) === null || i === void 0 ? void 0 : i.insertRule(`*{cursor: ${o} !important;}`)) !== null && r !== void 0 ? r : -1;
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function sn(e) {
|
|
189
189
|
return e.type === "keydown";
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function cn(e) {
|
|
192
192
|
return e.type.startsWith("pointer");
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function un(e) {
|
|
195
195
|
return e.type.startsWith("mouse");
|
|
196
196
|
}
|
|
197
197
|
function Le(e) {
|
|
198
|
-
if (
|
|
198
|
+
if (cn(e)) {
|
|
199
199
|
if (e.isPrimary)
|
|
200
200
|
return {
|
|
201
201
|
x: e.clientX,
|
|
202
202
|
y: e.clientY
|
|
203
203
|
};
|
|
204
|
-
} else if (
|
|
204
|
+
} else if (un(e))
|
|
205
205
|
return {
|
|
206
206
|
x: e.clientX,
|
|
207
207
|
y: e.clientY
|
|
@@ -221,16 +221,16 @@ function Bn(e, n, t) {
|
|
|
221
221
|
function Fn(e, n) {
|
|
222
222
|
if (e === n) throw new Error("Cannot compare node with itself");
|
|
223
223
|
const t = {
|
|
224
|
-
a:
|
|
225
|
-
b:
|
|
224
|
+
a: Je(e),
|
|
225
|
+
b: Je(n)
|
|
226
226
|
};
|
|
227
227
|
let r;
|
|
228
228
|
for (; t.a.at(-1) === t.b.at(-1); )
|
|
229
229
|
e = t.a.pop(), n = t.b.pop(), r = e;
|
|
230
230
|
z(r, "Stacking order can only be calculated for elements with a common ancestor");
|
|
231
231
|
const i = {
|
|
232
|
-
a: qe(
|
|
233
|
-
b: qe(
|
|
232
|
+
a: Xe(qe(t.a)),
|
|
233
|
+
b: Xe(qe(t.b))
|
|
234
234
|
};
|
|
235
235
|
if (i.a === i.b) {
|
|
236
236
|
const o = r.childNodes, l = {
|
|
@@ -249,14 +249,14 @@ function Fn(e, n) {
|
|
|
249
249
|
const Vn = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
|
|
250
250
|
function Wn(e) {
|
|
251
251
|
var n;
|
|
252
|
-
const t = getComputedStyle((n =
|
|
252
|
+
const t = getComputedStyle((n = dn(e)) !== null && n !== void 0 ? n : e).display;
|
|
253
253
|
return t === "flex" || t === "inline-flex";
|
|
254
254
|
}
|
|
255
255
|
function Kn(e) {
|
|
256
256
|
const n = getComputedStyle(e);
|
|
257
257
|
return !!(n.position === "fixed" || n.zIndex !== "auto" && (n.position !== "static" || Wn(e)) || +n.opacity < 1 || "transform" in n && n.transform !== "none" || "webkitTransform" in n && n.webkitTransform !== "none" || "mixBlendMode" in n && n.mixBlendMode !== "normal" || "filter" in n && n.filter !== "none" || "webkitFilter" in n && n.webkitFilter !== "none" || "isolation" in n && n.isolation === "isolate" || Vn.test(n.willChange) || n.webkitOverflowScrolling === "touch");
|
|
258
258
|
}
|
|
259
|
-
function
|
|
259
|
+
function qe(e) {
|
|
260
260
|
let n = e.length;
|
|
261
261
|
for (; n--; ) {
|
|
262
262
|
const t = e[n];
|
|
@@ -264,22 +264,22 @@ function Oe(e) {
|
|
|
264
264
|
}
|
|
265
265
|
return null;
|
|
266
266
|
}
|
|
267
|
-
function
|
|
267
|
+
function Xe(e) {
|
|
268
268
|
return e && Number(getComputedStyle(e).zIndex) || 0;
|
|
269
269
|
}
|
|
270
|
-
function
|
|
270
|
+
function Je(e) {
|
|
271
271
|
const n = [];
|
|
272
272
|
for (; e; )
|
|
273
|
-
n.push(e), e =
|
|
273
|
+
n.push(e), e = dn(e);
|
|
274
274
|
return n;
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function dn(e) {
|
|
277
277
|
const {
|
|
278
278
|
parentNode: n
|
|
279
279
|
} = e;
|
|
280
280
|
return n && n instanceof ShadowRoot ? n.host : n;
|
|
281
281
|
}
|
|
282
|
-
const
|
|
282
|
+
const fn = 1, pn = 2, gn = 4, mn = 8, Un = Tn() === "coarse";
|
|
283
283
|
let j = [], ue = !1, Q = /* @__PURE__ */ new Map(), Ae = /* @__PURE__ */ new Map();
|
|
284
284
|
const ve = /* @__PURE__ */ new Set();
|
|
285
285
|
function jn(e, n, t, r, i) {
|
|
@@ -313,7 +313,7 @@ function On(e) {
|
|
|
313
313
|
target: n,
|
|
314
314
|
x: t,
|
|
315
315
|
y: r
|
|
316
|
-
}), Ee(), j.length > 0 && (Ce("down", e), ke(), e.preventDefault(),
|
|
316
|
+
}), Ee(), j.length > 0 && (Ce("down", e), ke(), e.preventDefault(), yn(n) || e.stopImmediatePropagation());
|
|
317
317
|
}
|
|
318
318
|
function $e(e) {
|
|
319
319
|
const {
|
|
@@ -340,13 +340,13 @@ function _e(e) {
|
|
|
340
340
|
x: t,
|
|
341
341
|
y: r
|
|
342
342
|
} = Le(e);
|
|
343
|
-
Ae.clear(), ue = !1, j.length > 0 && (e.preventDefault(),
|
|
343
|
+
Ae.clear(), ue = !1, j.length > 0 && (e.preventDefault(), yn(n) || e.stopImmediatePropagation()), Ce("up", e), We({
|
|
344
344
|
target: n,
|
|
345
345
|
x: t,
|
|
346
346
|
y: r
|
|
347
347
|
}), ke(), Ee();
|
|
348
348
|
}
|
|
349
|
-
function
|
|
349
|
+
function yn(e) {
|
|
350
350
|
let n = e;
|
|
351
351
|
for (; n; ) {
|
|
352
352
|
if (n.hasAttribute(A.resizeHandle))
|
|
@@ -625,18 +625,18 @@ function Jn({
|
|
|
625
625
|
function be(e, n = document) {
|
|
626
626
|
return Array.from(n.querySelectorAll(`[${A.resizeHandleId}][data-panel-group-id="${e}"]`));
|
|
627
627
|
}
|
|
628
|
-
function
|
|
628
|
+
function hn(e, n, t = document) {
|
|
629
629
|
const i = be(e, t).findIndex((o) => o.getAttribute(A.resizeHandleId) === n);
|
|
630
630
|
return i ?? null;
|
|
631
631
|
}
|
|
632
|
-
function
|
|
633
|
-
const r =
|
|
632
|
+
function zn(e, n, t) {
|
|
633
|
+
const r = hn(e, n, t);
|
|
634
634
|
return r != null ? [r, r + 1] : [-1, -1];
|
|
635
635
|
}
|
|
636
636
|
function Yn(e) {
|
|
637
637
|
return e instanceof HTMLElement ? !0 : typeof e == "object" && e !== null && "tagName" in e && "getAttribute" in e;
|
|
638
638
|
}
|
|
639
|
-
function
|
|
639
|
+
function xn(e, n = document) {
|
|
640
640
|
if (Yn(n) && n.dataset.panelGroupId == e)
|
|
641
641
|
return n;
|
|
642
642
|
const t = n.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);
|
|
@@ -693,7 +693,7 @@ function Qn({
|
|
|
693
693
|
z(a, "Eager values not found");
|
|
694
694
|
const {
|
|
695
695
|
panelDataArray: s
|
|
696
|
-
} = a, m =
|
|
696
|
+
} = a, m = xn(t, o);
|
|
697
697
|
z(m != null, `No group found for id "${t}"`);
|
|
698
698
|
const P = be(t, o);
|
|
699
699
|
z(P, `No resize handles found for group id "${t}"`);
|
|
@@ -723,7 +723,7 @@ function Qn({
|
|
|
723
723
|
delta: W(M, O) ? S - O : O - M,
|
|
724
724
|
initialLayout: r,
|
|
725
725
|
panelConstraints: s.map((J) => J.constraints),
|
|
726
|
-
pivotIndices:
|
|
726
|
+
pivotIndices: zn(t, x, o),
|
|
727
727
|
prevLayout: r,
|
|
728
728
|
trigger: "keyboard"
|
|
729
729
|
});
|
|
@@ -743,7 +743,7 @@ function Qn({
|
|
|
743
743
|
};
|
|
744
744
|
}, [o, e, n, t, r, i, l]);
|
|
745
745
|
}
|
|
746
|
-
function
|
|
746
|
+
function Ye(e, n) {
|
|
747
747
|
if (e.length !== n.length)
|
|
748
748
|
return !1;
|
|
749
749
|
for (let t = 0; t < e.length; t++)
|
|
@@ -751,7 +751,7 @@ function Je(e, n) {
|
|
|
751
751
|
return !1;
|
|
752
752
|
return !0;
|
|
753
753
|
}
|
|
754
|
-
function
|
|
754
|
+
function vn(e, n) {
|
|
755
755
|
const t = e === "horizontal", {
|
|
756
756
|
x: r,
|
|
757
757
|
y: i
|
|
@@ -766,13 +766,13 @@ function et(e, n, t, r, i) {
|
|
|
766
766
|
let {
|
|
767
767
|
initialCursorPosition: s
|
|
768
768
|
} = r;
|
|
769
|
-
const m =
|
|
769
|
+
const m = vn(t, e), P = xn(a, i);
|
|
770
770
|
z(P, `No group element found for id "${a}"`);
|
|
771
771
|
const f = P.getBoundingClientRect(), c = o ? f.width : f.height;
|
|
772
772
|
return (m - s) / c * 100;
|
|
773
773
|
}
|
|
774
774
|
function nt(e, n, t, r, i, o) {
|
|
775
|
-
if (
|
|
775
|
+
if (sn(e)) {
|
|
776
776
|
const l = t === "horizontal";
|
|
777
777
|
let a = 0;
|
|
778
778
|
e.shiftKey ? a = 100 : i != null ? a = i : a = 10;
|
|
@@ -887,7 +887,7 @@ function ot(e, n = 10) {
|
|
|
887
887
|
}, n);
|
|
888
888
|
};
|
|
889
889
|
}
|
|
890
|
-
function
|
|
890
|
+
function Ze(e) {
|
|
891
891
|
try {
|
|
892
892
|
if (typeof localStorage < "u")
|
|
893
893
|
e.getItem = (n) => localStorage.getItem(n), e.setItem = (n, t) => {
|
|
@@ -900,10 +900,10 @@ function Ye(e) {
|
|
|
900
900
|
};
|
|
901
901
|
}
|
|
902
902
|
}
|
|
903
|
-
function
|
|
903
|
+
function bn(e) {
|
|
904
904
|
return `react-resizable-panels:${e}`;
|
|
905
905
|
}
|
|
906
|
-
function
|
|
906
|
+
function Sn(e) {
|
|
907
907
|
return e.map((n) => {
|
|
908
908
|
const {
|
|
909
909
|
constraints: t,
|
|
@@ -914,9 +914,9 @@ function bn(e) {
|
|
|
914
914
|
return i ? r : o ? `${o}:${JSON.stringify(t)}` : JSON.stringify(t);
|
|
915
915
|
}).sort((n, t) => n.localeCompare(t)).join(",");
|
|
916
916
|
}
|
|
917
|
-
function
|
|
917
|
+
function Pn(e, n) {
|
|
918
918
|
try {
|
|
919
|
-
const t =
|
|
919
|
+
const t = bn(e), r = n.getItem(t);
|
|
920
920
|
if (r) {
|
|
921
921
|
const i = JSON.parse(r);
|
|
922
922
|
if (typeof i == "object" && i != null)
|
|
@@ -928,12 +928,12 @@ function Sn(e, n) {
|
|
|
928
928
|
}
|
|
929
929
|
function it(e, n, t) {
|
|
930
930
|
var r, i;
|
|
931
|
-
const o = (r =
|
|
931
|
+
const o = (r = Pn(e, t)) !== null && r !== void 0 ? r : {}, l = Sn(n);
|
|
932
932
|
return (i = o[l]) !== null && i !== void 0 ? i : null;
|
|
933
933
|
}
|
|
934
934
|
function lt(e, n, t, r, i) {
|
|
935
935
|
var o;
|
|
936
|
-
const l =
|
|
936
|
+
const l = bn(e), a = Sn(n), s = (o = Pn(e, i)) !== null && o !== void 0 ? o : {};
|
|
937
937
|
s[a] = {
|
|
938
938
|
expandToSizes: Object.fromEntries(t.entries()),
|
|
939
939
|
layout: r
|
|
@@ -944,7 +944,7 @@ function lt(e, n, t, r, i) {
|
|
|
944
944
|
console.error(m);
|
|
945
945
|
}
|
|
946
946
|
}
|
|
947
|
-
function
|
|
947
|
+
function Qe({
|
|
948
948
|
layout: e,
|
|
949
949
|
panelConstraints: n
|
|
950
950
|
}) {
|
|
@@ -984,12 +984,12 @@ function Ze({
|
|
|
984
984
|
return t;
|
|
985
985
|
}
|
|
986
986
|
const at = 100, xe = {
|
|
987
|
-
getItem: (e) => (
|
|
987
|
+
getItem: (e) => (Ze(xe), xe.getItem(e)),
|
|
988
988
|
setItem: (e, n) => {
|
|
989
|
-
|
|
989
|
+
Ze(xe), xe.setItem(e, n);
|
|
990
990
|
}
|
|
991
|
-
},
|
|
992
|
-
function
|
|
991
|
+
}, en = {};
|
|
992
|
+
function wn({
|
|
993
993
|
autoSaveId: e = null,
|
|
994
994
|
children: n,
|
|
995
995
|
className: t = "",
|
|
@@ -1020,7 +1020,7 @@ function Pn({
|
|
|
1020
1020
|
didLogIdAndOrderWarning: !1,
|
|
1021
1021
|
didLogPanelConstraintsWarning: !1,
|
|
1022
1022
|
prevPanelIds: []
|
|
1023
|
-
}),
|
|
1023
|
+
}), rn(i, () => ({
|
|
1024
1024
|
getId: () => C.current.id,
|
|
1025
1025
|
getLayout: () => {
|
|
1026
1026
|
const {
|
|
@@ -1034,11 +1034,11 @@ function Pn({
|
|
|
1034
1034
|
} = C.current, {
|
|
1035
1035
|
layout: v,
|
|
1036
1036
|
panelDataArray: p
|
|
1037
|
-
} = S.current, d =
|
|
1037
|
+
} = S.current, d = Qe({
|
|
1038
1038
|
layout: u,
|
|
1039
1039
|
panelConstraints: p.map((h) => h.constraints)
|
|
1040
1040
|
});
|
|
1041
|
-
|
|
1041
|
+
Ye(v, d) || (b(d), S.current.layout = d, g && g(d), le(p, d, D.current));
|
|
1042
1042
|
}
|
|
1043
1043
|
}), []), re(() => {
|
|
1044
1044
|
C.current.autoSaveId = e, C.current.direction = r, C.current.dragState = y, C.current.id = c, C.current.onLayout = l, C.current.storage = s;
|
|
@@ -1057,8 +1057,8 @@ function Pn({
|
|
|
1057
1057
|
if (e) {
|
|
1058
1058
|
if (w.length === 0 || w.length !== u.length)
|
|
1059
1059
|
return;
|
|
1060
|
-
let g =
|
|
1061
|
-
g == null && (g = ot(lt, at),
|
|
1060
|
+
let g = en[e];
|
|
1061
|
+
g == null && (g = ot(lt, at), en[e] = g);
|
|
1062
1062
|
const v = [...u], p = new Map(M.current);
|
|
1063
1063
|
g(e, v, p, w, s);
|
|
1064
1064
|
}
|
|
@@ -1183,11 +1183,11 @@ function Pn({
|
|
|
1183
1183
|
h == null && (h = tt({
|
|
1184
1184
|
panelDataArray: d
|
|
1185
1185
|
}));
|
|
1186
|
-
const E =
|
|
1186
|
+
const E = Qe({
|
|
1187
1187
|
layout: h,
|
|
1188
1188
|
panelConstraints: d.map((H) => H.constraints)
|
|
1189
1189
|
});
|
|
1190
|
-
|
|
1190
|
+
Ye(p, E) || (b(E), S.current.layout = E, g && g(E), le(d, E, D.current));
|
|
1191
1191
|
}
|
|
1192
1192
|
}), re(() => {
|
|
1193
1193
|
const u = S.current;
|
|
@@ -1214,19 +1214,19 @@ function Pn({
|
|
|
1214
1214
|
panelDataArray: ye
|
|
1215
1215
|
} = S.current, {
|
|
1216
1216
|
initialLayout: Se
|
|
1217
|
-
} = H ?? {}, Me =
|
|
1217
|
+
} = H ?? {}, Me = zn(q, u, h);
|
|
1218
1218
|
let T = nt(d, u, E, H, X, h);
|
|
1219
|
-
const
|
|
1220
|
-
|
|
1219
|
+
const Ue = E === "horizontal";
|
|
1220
|
+
Ue && g && (T = -T);
|
|
1221
1221
|
const En = ye.map((Cn) => Cn.constraints), he = ze({
|
|
1222
1222
|
delta: T,
|
|
1223
1223
|
initialLayout: Se ?? U,
|
|
1224
1224
|
panelConstraints: En,
|
|
1225
1225
|
pivotIndices: Me,
|
|
1226
1226
|
prevLayout: U,
|
|
1227
|
-
trigger:
|
|
1228
|
-
}),
|
|
1229
|
-
(
|
|
1227
|
+
trigger: sn(d) ? "keyboard" : "mouse-or-touch"
|
|
1228
|
+
}), je = !Pe(U, he);
|
|
1229
|
+
(cn(d) || un(d)) && O.current != T && (O.current = T, !je && T !== 0 ? Ue ? Ge(u, T < 0 ? fn : pn) : Ge(u, T < 0 ? gn : mn) : Ge(u, 0)), je && (b(he), S.current.layout = he, L && L(he), le(ye, he, D.current));
|
|
1230
1230
|
};
|
|
1231
1231
|
}, []), G = B((u, g) => {
|
|
1232
1232
|
const {
|
|
@@ -1274,7 +1274,7 @@ function Pn({
|
|
|
1274
1274
|
return;
|
|
1275
1275
|
const d = De(u, x.current);
|
|
1276
1276
|
z(d, `Drag handle element not found for id "${u}"`);
|
|
1277
|
-
const h =
|
|
1277
|
+
const h = vn(v, g);
|
|
1278
1278
|
I({
|
|
1279
1279
|
dragHandleId: u,
|
|
1280
1280
|
dragHandleRect: d.getBoundingClientRect(),
|
|
@@ -1331,12 +1331,12 @@ function Pn({
|
|
|
1331
1331
|
[A.groupId]: c
|
|
1332
1332
|
}));
|
|
1333
1333
|
}
|
|
1334
|
-
const
|
|
1334
|
+
const In = nn((e, n) => de(wn, {
|
|
1335
1335
|
...e,
|
|
1336
1336
|
forwardedRef: n
|
|
1337
1337
|
}));
|
|
1338
|
-
|
|
1339
|
-
|
|
1338
|
+
wn.displayName = "PanelGroup";
|
|
1339
|
+
In.displayName = "forwardRef(PanelGroup)";
|
|
1340
1340
|
function ae(e, n) {
|
|
1341
1341
|
return e.findIndex((t) => t === n || t.id === n.id);
|
|
1342
1342
|
}
|
|
@@ -1376,7 +1376,7 @@ function st({
|
|
|
1376
1376
|
l.preventDefault();
|
|
1377
1377
|
const a = i.getAttribute(A.groupId);
|
|
1378
1378
|
z(a, `No group element found for id "${a}"`);
|
|
1379
|
-
const s = be(a, r), m =
|
|
1379
|
+
const s = be(a, r), m = hn(a, n, r);
|
|
1380
1380
|
z(m !== null, `No resize element found for id "${n}"`);
|
|
1381
1381
|
const P = l.shiftKey ? m > 0 ? m - 1 : s.length - 1 : m + 1 < s.length ? m + 1 : 0;
|
|
1382
1382
|
s[P].focus();
|
|
@@ -1389,7 +1389,7 @@ function st({
|
|
|
1389
1389
|
};
|
|
1390
1390
|
}, [r, e, n, t]);
|
|
1391
1391
|
}
|
|
1392
|
-
function
|
|
1392
|
+
function Ke({
|
|
1393
1393
|
children: e = null,
|
|
1394
1394
|
className: n = "",
|
|
1395
1395
|
disabled: t = !1,
|
|
@@ -1416,7 +1416,7 @@ function In({
|
|
|
1416
1416
|
te(() => {
|
|
1417
1417
|
R.current.onClick = l, R.current.onDragging = a, R.current.onPointerDown = m, R.current.onPointerUp = P;
|
|
1418
1418
|
});
|
|
1419
|
-
const D =
|
|
1419
|
+
const D = tn(Re);
|
|
1420
1420
|
if (D === null)
|
|
1421
1421
|
throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");
|
|
1422
1422
|
const {
|
|
@@ -1519,13 +1519,13 @@ function In({
|
|
|
1519
1519
|
[A.resizeHandleState]: _
|
|
1520
1520
|
});
|
|
1521
1521
|
}
|
|
1522
|
-
|
|
1523
|
-
const ct =
|
|
1522
|
+
Ke.displayName = "PanelResizeHandle";
|
|
1523
|
+
const ct = on({
|
|
1524
1524
|
base: "flex h-full w-full data-[panel-group-direction=vertical]:flex-col"
|
|
1525
1525
|
}), yt = ({
|
|
1526
1526
|
className: e,
|
|
1527
1527
|
...n
|
|
1528
|
-
}) => /* @__PURE__ */ we(
|
|
1528
|
+
}) => /* @__PURE__ */ we(In, { className: ct({ className: e }), ...n }), ht = an, zt = Ke, ut = on({
|
|
1529
1529
|
slots: {
|
|
1530
1530
|
wrapper: [
|
|
1531
1531
|
"relative flex w-px items-center justify-center bg-secondary-border hover:bg-primary-border",
|
|
@@ -1536,16 +1536,17 @@ const ct = rn({
|
|
|
1536
1536
|
handle: "z-10 flex h-4 w-2.5 items-center justify-center rounded-sm border border-secondary-border bg-secondary-border hover:border-primary-border hover:bg-primary-border",
|
|
1537
1537
|
icon: "h-2.5 w-2.5"
|
|
1538
1538
|
}
|
|
1539
|
-
}),
|
|
1539
|
+
}), xt = ({
|
|
1540
1540
|
withHandle: e,
|
|
1541
1541
|
className: n,
|
|
1542
1542
|
...t
|
|
1543
1543
|
}) => {
|
|
1544
1544
|
const r = ut();
|
|
1545
|
-
return /* @__PURE__ */ we(
|
|
1545
|
+
return /* @__PURE__ */ we(Ke, { className: r.wrapper({ className: n }), ...t, children: e && /* @__PURE__ */ we("div", { className: r.handle(), children: /* @__PURE__ */ we(Dn, { icon: Mn, className: r.icon() }) }) });
|
|
1546
1546
|
};
|
|
1547
1547
|
export {
|
|
1548
|
-
|
|
1548
|
+
xt as ResizableHandle,
|
|
1549
|
+
zt as ResizableHandlePrimitive,
|
|
1549
1550
|
ht as ResizablePanel,
|
|
1550
1551
|
yt as ResizablePanelGroup
|
|
1551
1552
|
};
|