gridsmith-ui 0.32.0 → 0.33.1
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/CHANGELOG.md +64 -1
- package/README.md +4 -2
- package/dist/charts.d.ts +10 -1
- package/dist/charts.js +115 -50
- package/dist/charts.js.map +1 -1
- package/dist/chat.js +6 -6
- package/dist/{chunk-WSKPESAX.js → chunk-4FX6UCSS.js} +5 -5
- package/dist/{chunk-WSKPESAX.js.map → chunk-4FX6UCSS.js.map} +1 -1
- package/dist/{chunk-DO6DLTFK.js → chunk-4TQVFRKK.js} +6 -6
- package/dist/{chunk-DO6DLTFK.js.map → chunk-4TQVFRKK.js.map} +1 -1
- package/dist/{chunk-HCEHTJ5E.js → chunk-77X7AHFB.js} +3 -3
- package/dist/{chunk-HCEHTJ5E.js.map → chunk-77X7AHFB.js.map} +1 -1
- package/dist/{chunk-SIEU4H3H.js → chunk-BL2C35BN.js} +43 -33
- package/dist/chunk-BL2C35BN.js.map +1 -0
- package/dist/chunk-GIA4BMGI.js +18 -0
- package/dist/chunk-GIA4BMGI.js.map +1 -0
- package/dist/{chunk-2724SJO2.js → chunk-HDFTENVW.js} +7 -3
- package/dist/chunk-HDFTENVW.js.map +1 -0
- package/dist/{chunk-OVHM55JF.js → chunk-MPXE2XOP.js} +41 -6
- package/dist/chunk-MPXE2XOP.js.map +1 -0
- package/dist/{chunk-XBVZIN26.js → chunk-MW5CJOJN.js} +10 -8
- package/dist/chunk-MW5CJOJN.js.map +1 -0
- package/dist/{chunk-QY2RA2HO.js → chunk-N6QLEZFH.js} +5 -5
- package/dist/{chunk-QY2RA2HO.js.map → chunk-N6QLEZFH.js.map} +1 -1
- package/dist/{chunk-TMPPBXX3.js → chunk-NFVJEICH.js} +3 -3
- package/dist/{chunk-TMPPBXX3.js.map → chunk-NFVJEICH.js.map} +1 -1
- package/dist/{chunk-JHZ22HQP.js → chunk-NJG6JQGC.js} +61 -222
- package/dist/chunk-NJG6JQGC.js.map +1 -0
- package/dist/chunk-P3NUUIL6.js +9 -0
- package/dist/chunk-P3NUUIL6.js.map +1 -0
- package/dist/{chunk-NGZJK57C.js → chunk-PT4HYHI3.js} +10 -9
- package/dist/chunk-PT4HYHI3.js.map +1 -0
- package/dist/chunk-R7FG4ZQ5.js +16 -0
- package/dist/chunk-R7FG4ZQ5.js.map +1 -0
- package/dist/chunk-T33JK3ZE.js +81 -0
- package/dist/chunk-T33JK3ZE.js.map +1 -0
- package/dist/chunk-UI4BSRCQ.js +213 -0
- package/dist/chunk-UI4BSRCQ.js.map +1 -0
- package/dist/{chunk-HUVZQOU4.js → chunk-XJGFZ5CP.js} +5 -5
- package/dist/{chunk-HUVZQOU4.js.map → chunk-XJGFZ5CP.js.map} +1 -1
- package/dist/{chunk-R2IAK3J3.js → chunk-ZTS6HJAU.js} +3 -3
- package/dist/{chunk-R2IAK3J3.js.map → chunk-ZTS6HJAU.js.map} +1 -1
- package/dist/dashboard.d.ts +207 -0
- package/dist/dashboard.js +1210 -0
- package/dist/dashboard.js.map +1 -0
- package/dist/data-grid.js +10 -9
- package/dist/data-grid.js.map +1 -1
- package/dist/editor-mentions.js +2 -2
- package/dist/editor.js +2 -2
- package/dist/index.d.ts +64 -8
- package/dist/index.js +245 -147
- package/dist/index.js.map +1 -1
- package/dist/kanban.js +8 -8
- package/dist/resizable.js +9 -8
- package/dist/resizable.js.map +1 -1
- package/dist/utils.d.ts +51 -1
- package/dist/utils.js +55 -4
- package/dist/utils.js.map +1 -1
- package/dist/virtualized.js +8 -8
- package/package.json +6 -1
- package/dist/chunk-2724SJO2.js.map +0 -1
- package/dist/chunk-H732QL56.js +0 -71
- package/dist/chunk-H732QL56.js.map +0 -1
- package/dist/chunk-JHZ22HQP.js.map +0 -1
- package/dist/chunk-LJYSVZMI.js +0 -25
- package/dist/chunk-LJYSVZMI.js.map +0 -1
- package/dist/chunk-NGZJK57C.js.map +0 -1
- package/dist/chunk-OVHM55JF.js.map +0 -1
- package/dist/chunk-SIEU4H3H.js.map +0 -1
- package/dist/chunk-XBVZIN26.js.map +0 -1
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useKeyboardScroll } from './chunk-H732QL56.js';
|
|
3
2
|
import { PreferencesContext } from './chunk-QOMP4D6V.js';
|
|
4
|
-
import { FormChangeCtx } from './chunk-72SDAX54.js';
|
|
5
3
|
import { SurfaceBoundary } from './chunk-RS624TD5.js';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
4
|
+
import { useTextOverflow } from './chunk-ZTS6HJAU.js';
|
|
5
|
+
import { useOverlayMark, useDirtyGuard, DiscardConfirm, OverlayMarkScope, OverlayCloseCtx, OVERLAY_ROOT_ATTR } from './chunk-UI4BSRCQ.js';
|
|
6
|
+
import { useBreakpoint } from './chunk-ZHUVLBCC.js';
|
|
7
|
+
import { useKeyboardScroll } from './chunk-T33JK3ZE.js';
|
|
8
|
+
import { useRevealFocus, AutoTooltip } from './chunk-77X7AHFB.js';
|
|
9
|
+
import { warnOnce, Icon } from './chunk-53F7GVBQ.js';
|
|
10
|
+
import { cn, FOCUS_INSET_WHILE_STOP, usePopupFocus, usePosition, FOCUS_RING, FOCUS_INSET, useLatest, useOverlayLayer, lockBodyScroll, unlockBodyScroll, useReturnFocus, useFocusTrap, inertOutside, focusInitial, useNonModalDialog, OVERLAY_CLOSE_ATTR, OVERLAY_SURFACE, GLASS_OVERLAY, GROUP_FOCUS_RING } from './chunk-HDFTENVW.js';
|
|
11
|
+
import { createContext, version, forwardRef, useState, useRef, useCallback, useLayoutEffect, useId, useEffect, useContext, useMemo } from 'react';
|
|
13
12
|
import { createPortal } from 'react-dom';
|
|
14
13
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
15
14
|
|
|
@@ -251,182 +250,6 @@ function defaultMaxWidth(container) {
|
|
|
251
250
|
const base = container instanceof HTMLElement ? container.clientWidth : typeof window !== "undefined" ? window.innerWidth : 1200;
|
|
252
251
|
return Math.round(base * 0.6);
|
|
253
252
|
}
|
|
254
|
-
var OVERLAY_ROOT_ATTR = "data-overlay-root";
|
|
255
|
-
function controlsOf(root) {
|
|
256
|
-
if (!root) return "";
|
|
257
|
-
const controls = root.querySelectorAll("input, select, textarea, [role='combobox'], [role='radiogroup'], [role='checkbox'], [role='switch'], [role='slider'], [role='spinbutton'], [contenteditable='true']");
|
|
258
|
-
return Array.from(controls).map((el) => el.id || el.getAttribute("name") || el.getAttribute("role") || el.tagName).join("|");
|
|
259
|
-
}
|
|
260
|
-
var OverlayMarkCtx = createContext(null);
|
|
261
|
-
function OverlayMarkScope({ mark, children }) {
|
|
262
|
-
return /* @__PURE__ */ jsx(OverlayMarkCtx, { value: mark, children: /* @__PURE__ */ jsx(FormChangeCtx, { value: null, children }) });
|
|
263
|
-
}
|
|
264
|
-
function useOverlayMark(open) {
|
|
265
|
-
const forms = useRef(/* @__PURE__ */ new Map());
|
|
266
|
-
const count = useRef(0);
|
|
267
|
-
const round = useRef(0);
|
|
268
|
-
const [changed, setChanged] = useState(false);
|
|
269
|
-
const [holds, setHolds] = useState(0);
|
|
270
|
-
const [pends, setPends] = useState(0);
|
|
271
|
-
const [answers, setAnswers] = useState([]);
|
|
272
|
-
const [wasOpen, setWasOpen] = useState(open);
|
|
273
|
-
if (open !== wasOpen) {
|
|
274
|
-
setWasOpen(open);
|
|
275
|
-
if (!open) {
|
|
276
|
-
setChanged(false);
|
|
277
|
-
setAnswers([]);
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
useEffect(() => {
|
|
281
|
-
if (open) return;
|
|
282
|
-
round.current++;
|
|
283
|
-
for (const [id, f] of forms.current) {
|
|
284
|
-
if (f.mounted) f.stamp = 0;
|
|
285
|
-
else forms.current.delete(id);
|
|
286
|
-
}
|
|
287
|
-
}, [open]);
|
|
288
|
-
const mark = useMemo(() => ({
|
|
289
|
-
report: (form) => {
|
|
290
|
-
const f = forms.current.get(form) ?? { stamp: 0, mounted: true };
|
|
291
|
-
f.stamp = ++count.current;
|
|
292
|
-
forms.current.set(form, f);
|
|
293
|
-
setChanged(true);
|
|
294
|
-
},
|
|
295
|
-
attach: (form) => {
|
|
296
|
-
const f = forms.current.get(form) ?? { stamp: 0, mounted: true };
|
|
297
|
-
f.mounted = true;
|
|
298
|
-
forms.current.set(form, f);
|
|
299
|
-
return () => {
|
|
300
|
-
const gone = forms.current.get(form);
|
|
301
|
-
if (!gone) return;
|
|
302
|
-
if (gone.stamp > 0) gone.mounted = false;
|
|
303
|
-
else forms.current.delete(form);
|
|
304
|
-
};
|
|
305
|
-
},
|
|
306
|
-
submit: (form, from) => {
|
|
307
|
-
const root = from.element()?.closest(`[${OVERLAY_ROOT_ATTR}]`) ?? null;
|
|
308
|
-
const answer = { form, since: count.current, root, controls: controlsOf(root), ...from };
|
|
309
|
-
const at = round.current;
|
|
310
|
-
let settled = false;
|
|
311
|
-
return {
|
|
312
|
-
settle: (how) => {
|
|
313
|
-
if (settled || at !== round.current) return;
|
|
314
|
-
settled = true;
|
|
315
|
-
setAnswers((list) => [...list, { ...answer, how }]);
|
|
316
|
-
}
|
|
317
|
-
};
|
|
318
|
-
},
|
|
319
|
-
hold: () => {
|
|
320
|
-
setHolds((n) => n + 1);
|
|
321
|
-
let released = false;
|
|
322
|
-
return () => {
|
|
323
|
-
if (released) return;
|
|
324
|
-
released = true;
|
|
325
|
-
setHolds((n) => n - 1);
|
|
326
|
-
};
|
|
327
|
-
},
|
|
328
|
-
pend: () => {
|
|
329
|
-
setPends((n) => n + 1);
|
|
330
|
-
let released = false;
|
|
331
|
-
return () => {
|
|
332
|
-
if (released) return;
|
|
333
|
-
released = true;
|
|
334
|
-
setPends((n) => n - 1);
|
|
335
|
-
};
|
|
336
|
-
},
|
|
337
|
-
open
|
|
338
|
-
}), [open]);
|
|
339
|
-
useEffect(() => {
|
|
340
|
-
if (!answers.length) return;
|
|
341
|
-
for (const a of answers) {
|
|
342
|
-
const form = a.element();
|
|
343
|
-
if (form?.isConnected && (form.querySelector("[aria-invalid='true']") || a.failing())) continue;
|
|
344
|
-
if (a.how === "returned") {
|
|
345
|
-
const now = a.root?.isConnected ? controlsOf(a.root) : "";
|
|
346
|
-
if (now !== "" && now !== a.controls) continue;
|
|
347
|
-
}
|
|
348
|
-
for (const [id, f] of forms.current) {
|
|
349
|
-
if (f.stamp === 0 || f.stamp > a.since || id !== a.form && f.mounted) continue;
|
|
350
|
-
if (f.mounted) forms.current.set(id, { ...f, stamp: 0 });
|
|
351
|
-
else forms.current.delete(id);
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
setAnswers([]);
|
|
355
|
-
setChanged([...forms.current.values()].some((f) => f.stamp > 0));
|
|
356
|
-
}, [answers]);
|
|
357
|
-
return { marked: changed || holds > 0, pending: pends > 0, mark };
|
|
358
|
-
}
|
|
359
|
-
var OverlayCloseCtx = createContext(null);
|
|
360
|
-
function useDirtyGuard(dirty, onClose, onDiscard) {
|
|
361
|
-
const [wantsConfirm, setWantsConfirm] = useState(false);
|
|
362
|
-
const confirming = wantsConfirm && !!dirty;
|
|
363
|
-
const pending = useRef(void 0);
|
|
364
|
-
const runAfter = useCallback((then) => {
|
|
365
|
-
if (typeof then === "function" && then !== onClose) then();
|
|
366
|
-
}, [onClose]);
|
|
367
|
-
const requestClose = useCallback((then) => {
|
|
368
|
-
if (!dirty) {
|
|
369
|
-
onClose();
|
|
370
|
-
runAfter(then);
|
|
371
|
-
return;
|
|
372
|
-
}
|
|
373
|
-
pending.current = then;
|
|
374
|
-
setWantsConfirm((c) => !c);
|
|
375
|
-
}, [dirty, onClose, runAfter]);
|
|
376
|
-
const keep = useCallback(() => {
|
|
377
|
-
pending.current = void 0;
|
|
378
|
-
setWantsConfirm(false);
|
|
379
|
-
}, []);
|
|
380
|
-
const discard = useCallback(() => {
|
|
381
|
-
setWantsConfirm(false);
|
|
382
|
-
onDiscard?.();
|
|
383
|
-
onClose();
|
|
384
|
-
const then = pending.current;
|
|
385
|
-
pending.current = void 0;
|
|
386
|
-
runAfter(then);
|
|
387
|
-
}, [onClose, onDiscard, runAfter]);
|
|
388
|
-
return { confirming, requestClose, keep, discard };
|
|
389
|
-
}
|
|
390
|
-
function DiscardConfirm({ open, onKeep, onDiscard }) {
|
|
391
|
-
const keepRef = useRef(null);
|
|
392
|
-
const returnTo = useRef(null);
|
|
393
|
-
const overlay = useRef(null);
|
|
394
|
-
useEffect(() => {
|
|
395
|
-
if (!open) return;
|
|
396
|
-
const active = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
397
|
-
overlay.current = keepRef.current?.closest("[role='dialog'], [role='alertdialog']") ?? null;
|
|
398
|
-
returnTo.current = active && active !== document.body && overlay.current?.contains(active) ? active : null;
|
|
399
|
-
keepRef.current?.focus();
|
|
400
|
-
return () => {
|
|
401
|
-
if (document.activeElement !== document.body) return;
|
|
402
|
-
const back = returnTo.current;
|
|
403
|
-
if (back && back.isConnected) {
|
|
404
|
-
back.focus();
|
|
405
|
-
return;
|
|
406
|
-
}
|
|
407
|
-
const first = overlay.current?.querySelector("button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex='-1'])");
|
|
408
|
-
(first ?? overlay.current)?.focus();
|
|
409
|
-
};
|
|
410
|
-
}, [open]);
|
|
411
|
-
if (!open) return null;
|
|
412
|
-
return /* @__PURE__ */ jsxs(
|
|
413
|
-
"div",
|
|
414
|
-
{
|
|
415
|
-
role: "group",
|
|
416
|
-
"aria-label": "Unsaved changes",
|
|
417
|
-
"data-discard-confirm": "",
|
|
418
|
-
className: "shrink-0 flex flex-wrap items-center justify-between gap-ds-3 border-t-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)] bg-[var(--ds-status-warning-bg)]",
|
|
419
|
-
style: { padding: "var(--ds-space-3) var(--ds-page-gutter)" },
|
|
420
|
-
children: [
|
|
421
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-[var(--ds-text-primary)]", children: "You have unsaved changes." }),
|
|
422
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-ds-2", children: [
|
|
423
|
-
/* @__PURE__ */ jsx(Button, { type: "button", ref: keepRef, variant: "secondary", size: "sm", onClick: onKeep, children: "Keep editing" }),
|
|
424
|
-
/* @__PURE__ */ jsx(Button, { type: "button", variant: "destructive", size: "sm", onClick: onDiscard, children: "Discard changes" })
|
|
425
|
-
] })
|
|
426
|
-
]
|
|
427
|
-
}
|
|
428
|
-
);
|
|
429
|
-
}
|
|
430
253
|
var DrawerWidthCtx = createContext(null);
|
|
431
254
|
var BulkBarHostCtx = createContext(null);
|
|
432
255
|
var BulkBarPresenceCtx = createContext(null);
|
|
@@ -479,6 +302,7 @@ function useScrollbarInset() {
|
|
|
479
302
|
}, []);
|
|
480
303
|
}
|
|
481
304
|
var insetLessScrollbar = (gutter) => `max(0px, calc(${gutter} - var(--gs-scrollbar, 0px)))`;
|
|
305
|
+
var AsideSlotContext = createContext(false);
|
|
482
306
|
var DrawerFooterCtx = createContext(null);
|
|
483
307
|
var DrawerScopeCtx = createContext(null);
|
|
484
308
|
var slideClasses = {
|
|
@@ -815,7 +639,7 @@ function DrawerPanel({ form, open, onClose, position = "right", width = "400px",
|
|
|
815
639
|
...barStack ? { scrollPaddingBottom: bulkBarRoom(barStack) } : {}
|
|
816
640
|
},
|
|
817
641
|
children: [
|
|
818
|
-
/* @__PURE__ */ jsx(BulkBarHostCtx, { value: barHost, children: /* @__PURE__ */ jsx(SurfaceBoundary, { children }) }),
|
|
642
|
+
/* @__PURE__ */ jsx(BulkBarHostCtx, { value: barHost, children: /* @__PURE__ */ jsx(SurfaceBoundary, { children: /* @__PURE__ */ jsx(AsideSlotContext, { value: true, children }) }) }),
|
|
819
643
|
/* @__PURE__ */ jsx(BulkBarSpacer, { room: barStack })
|
|
820
644
|
]
|
|
821
645
|
}
|
|
@@ -901,8 +725,47 @@ var AppShell = forwardRef(function AppShell2({
|
|
|
901
725
|
}, ref) {
|
|
902
726
|
if (REACT_VERSION_PROBLEM) throw new Error(REACT_VERSION_PROBLEM);
|
|
903
727
|
const [sidebarOpen, setSidebarOpen] = useState(false);
|
|
904
|
-
const [
|
|
905
|
-
const [
|
|
728
|
+
const [ownAsideOpen, setAsideOpen] = useState(false);
|
|
729
|
+
const [ownAsideFloating, setAsideFloating] = useState(false);
|
|
730
|
+
const [leftAsideHost, setLeftAsideHost] = useState(null);
|
|
731
|
+
const [rightAsideHost, setRightAsideHost] = useState(null);
|
|
732
|
+
const asides = useRef(/* @__PURE__ */ new Map());
|
|
733
|
+
const opened = useRef([]);
|
|
734
|
+
const [openings, setOpenings] = useState(0);
|
|
735
|
+
const [docked, setDocked] = useState(null);
|
|
736
|
+
const [asked, setAsked] = useState([]);
|
|
737
|
+
const reportAside = useCallback((onClose, state) => {
|
|
738
|
+
if (state) asides.current.set(onClose, state);
|
|
739
|
+
else asides.current.delete(onClose);
|
|
740
|
+
if (state?.opened) {
|
|
741
|
+
opened.current.push(onClose);
|
|
742
|
+
setOpenings((n) => n + 1);
|
|
743
|
+
}
|
|
744
|
+
let next = null;
|
|
745
|
+
for (const s of asides.current.values()) if (s.open && s.docked) next = { side: s.side, floating: s.floating };
|
|
746
|
+
setDocked((d) => d?.side === next?.side && d?.floating === next?.floating ? d : next);
|
|
747
|
+
}, []);
|
|
748
|
+
useLayoutEffect(() => {
|
|
749
|
+
const keys = opened.current.filter((key) => asides.current.get(key)?.open);
|
|
750
|
+
opened.current = [];
|
|
751
|
+
if (keys.length === 0) return;
|
|
752
|
+
let winner2 = keys[keys.length - 1];
|
|
753
|
+
for (const key of keys) if (asides.current.get(key)?.page) winner2 = key;
|
|
754
|
+
const closing = [...asides.current].filter(([key, s]) => key !== winner2 && s.open).map(([key]) => key);
|
|
755
|
+
for (const key of closing) key.current();
|
|
756
|
+
if (closing.length > 0) setAsked(closing);
|
|
757
|
+
}, [openings]);
|
|
758
|
+
useLayoutEffect(() => {
|
|
759
|
+
for (const key of asked) {
|
|
760
|
+
const s = asides.current.get(key);
|
|
761
|
+
if (!s?.open) continue;
|
|
762
|
+
const name = typeof document !== "undefined" && document.getElementById(s.name)?.textContent?.trim() || s.name;
|
|
763
|
+
warnOnce("AsidePanel", `"${name}" stayed open as another opened: one AsidePanel is open at a time in a shell, the last opened, so its onClose must close it (set its open to false).`);
|
|
764
|
+
}
|
|
765
|
+
}, [asked]);
|
|
766
|
+
const asideOpen = docked !== null || ownAsideOpen;
|
|
767
|
+
const asideFloating = docked ? docked.floating : ownAsideFloating;
|
|
768
|
+
const asideFloatingSide = docked ? docked.floating ? docked.side : null : ownAsideOpen && ownAsideFloating ? asideSide : null;
|
|
906
769
|
const isMobile = useBreakpoint("md");
|
|
907
770
|
const isSmallMobile = useBreakpoint("sm");
|
|
908
771
|
const isTablet = isMobile && !isSmallMobile;
|
|
@@ -987,8 +850,8 @@ var AppShell = forwardRef(function AppShell2({
|
|
|
987
850
|
return /* @__PURE__ */ jsx(PreferencesContext, { value: preferences ?? null, children: /* @__PURE__ */ jsx(DrawerWidthCtx, { value: drawerWidth, children: /* @__PURE__ */ jsx(
|
|
988
851
|
AppShellContext,
|
|
989
852
|
{
|
|
990
|
-
value: { hasSidebar, hasMobileMenu, hasMobileNav, sidebarOpen, setSidebarOpen, isMobile, isTablet, sidebarCollapsed, setSidebarCollapsed: setUserCollapsed, asideOpen, setAsideOpen, asideSide, asideFloating, setAsideFloating, container: shellEl, theme: theme ?? null, isHome, navbarFloating, sidebarFloating, registerChrome, hasLauncher, launcherCorner, registerLauncher, hasFooter, focus: focus ?? null, hasUnsavedChanges: unsavedCount > 0, addUnsavedChanges, drawerWidth, navigate: navigate ?? null, flowLeft: leftCount > 0, markFlowLeft },
|
|
991
|
-
children: /* @__PURE__ */ jsxs("div", { ref: (el) => {
|
|
853
|
+
value: { hasSidebar, hasMobileMenu, hasMobileNav, sidebarOpen, setSidebarOpen, isMobile, isTablet, sidebarCollapsed, setSidebarCollapsed: setUserCollapsed, asideOpen, setAsideOpen, asideSide, asideFloating, setAsideFloating, asideFloatingSide, reportAside, asideHosts: { left: leftAsideHost, right: rightAsideHost }, container: shellEl, theme: theme ?? null, isHome, navbarFloating, sidebarFloating, registerChrome, hasLauncher, launcherCorner, registerLauncher, hasFooter, focus: focus ?? null, hasUnsavedChanges: unsavedCount > 0, addUnsavedChanges, drawerWidth, navigate: navigate ?? null, flowLeft: leftCount > 0, markFlowLeft },
|
|
854
|
+
children: /* @__PURE__ */ jsx(AsideSlotContext, { value: false, children: /* @__PURE__ */ jsxs("div", { ref: (el) => {
|
|
992
855
|
setShellEl(el);
|
|
993
856
|
if (typeof ref === "function") ref(el);
|
|
994
857
|
else if (ref) ref.current = el;
|
|
@@ -1010,7 +873,8 @@ var AppShell = forwardRef(function AppShell2({
|
|
|
1010
873
|
layout === "multi-column" && navbarSlot,
|
|
1011
874
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-1 min-h-0", children: [
|
|
1012
875
|
hasSidebar && !isMobile && /* @__PURE__ */ jsx("div", { className: "shrink-0 h-full", children: sidebar }),
|
|
1013
|
-
aside && asideSide === "left" && aside,
|
|
876
|
+
aside && asideSide === "left" && /* @__PURE__ */ jsx(AsideSlotContext, { value: true, children: aside }),
|
|
877
|
+
/* @__PURE__ */ jsx("div", { ref: setLeftAsideHost, "data-shell-aside-host": "left", className: "contents" }),
|
|
1014
878
|
/* @__PURE__ */ jsxs("div", { className: "relative flex-1 flex flex-col min-w-0 min-h-0", children: [
|
|
1015
879
|
layout === "sidebar" && navbarSlot,
|
|
1016
880
|
layout === "stacked" && navbarSlot,
|
|
@@ -1051,7 +915,8 @@ var AppShell = forwardRef(function AppShell2({
|
|
|
1051
915
|
) }),
|
|
1052
916
|
/* @__PURE__ */ jsx("div", { ref: setBarLayer, "data-bulk-bar-layer": "", className: BULK_BAR_LAYER, style: { paddingBottom: `calc(${BULK_BAR_GAP}px + ${barSafe})` } })
|
|
1053
917
|
] }),
|
|
1054
|
-
|
|
918
|
+
/* @__PURE__ */ jsx("div", { ref: setRightAsideHost, "data-shell-aside-host": "right", className: "contents" }),
|
|
919
|
+
aside && asideSide === "right" && /* @__PURE__ */ jsx(AsideSlotContext, { value: true, children: aside })
|
|
1055
920
|
] }),
|
|
1056
921
|
showMobileDrawer && isMobile && // Under the navbar, the menu is modal over the page with the navbar in its scope: the rest inert, Tab cycling the
|
|
1057
922
|
// two, Escape closing it (the Authoring Practices; Sprint 25.29 item 9). The stacked shell, with no offset, traps
|
|
@@ -1076,7 +941,7 @@ var AppShell = forwardRef(function AppShell2({
|
|
|
1076
941
|
) }),
|
|
1077
942
|
isSmallMobile && hasMobileNav && /* @__PURE__ */ jsx("div", { className: "sticky bottom-0 z-[var(--ds-z-sticky)]", children: mobileNav }),
|
|
1078
943
|
!isSmallMobile && launcher
|
|
1079
|
-
] })
|
|
944
|
+
] }) })
|
|
1080
945
|
}
|
|
1081
946
|
) }) });
|
|
1082
947
|
});
|
|
@@ -1379,33 +1244,7 @@ var Breadcrumbs = forwardRef(function Breadcrumbs2({
|
|
|
1379
1244
|
dropdown
|
|
1380
1245
|
] });
|
|
1381
1246
|
});
|
|
1382
|
-
function useCompact(ref, breakpoint, band = 0) {
|
|
1383
|
-
const px = typeof breakpoint === "number" ? breakpoint : readBreakpointPx(breakpoint);
|
|
1384
|
-
const width = useElementWidth(ref);
|
|
1385
|
-
return useBelow(width, px, band);
|
|
1386
|
-
}
|
|
1387
|
-
function useBelow(width, threshold, band = 0) {
|
|
1388
|
-
const [below, setBelow] = useState(false);
|
|
1389
|
-
const next = width > 0 && width < (below ? threshold + band : threshold);
|
|
1390
|
-
if (next !== below) setBelow(next);
|
|
1391
|
-
return next;
|
|
1392
|
-
}
|
|
1393
|
-
function useElementWidth(ref) {
|
|
1394
|
-
const [width, setWidth] = useState(0);
|
|
1395
|
-
const check = useCallback(() => {
|
|
1396
|
-
const next = ref.current?.offsetWidth ?? 0;
|
|
1397
|
-
if (next > 0) setWidth(next);
|
|
1398
|
-
}, [ref]);
|
|
1399
|
-
useLayoutEffect(() => {
|
|
1400
|
-
check();
|
|
1401
|
-
if (!ref.current || typeof ResizeObserver === "undefined") return;
|
|
1402
|
-
const observer = new ResizeObserver(check);
|
|
1403
|
-
observer.observe(ref.current);
|
|
1404
|
-
return () => observer.disconnect();
|
|
1405
|
-
}, [check, ref]);
|
|
1406
|
-
return width;
|
|
1407
|
-
}
|
|
1408
1247
|
|
|
1409
|
-
export { AppShell, BULK_BAR_LAYER, BULK_BAR_WINDOW_LAYER, Breadcrumbs, BulkBarHostCtx, BulkBarPresenceCtx, BulkBarSpacer,
|
|
1410
|
-
//# sourceMappingURL=chunk-
|
|
1411
|
-
//# sourceMappingURL=chunk-
|
|
1248
|
+
export { AppShell, AsideSlotContext, BULK_BAR_LAYER, BULK_BAR_WINDOW_LAYER, Breadcrumbs, BulkBarHostCtx, BulkBarPresenceCtx, BulkBarSpacer, Drawer, DrawerFooterCtx, DrawerPanel, LAUNCHER_INSET_PRIORITY, NAVBAR_INSET_PRIORITY, PANEL_INSET_PRIORITY, REACT_VERSION_PROBLEM, ResizeEdge, SkipLink, TOAST_INSET_VARS, besideRoom, bulkBarRoom, crumbGoes, defaultMaxWidth, insetLessScrollbar, pxOf, useAppShell, useBulkBarHost, useCloseSettle, useCornerInset, useCrumbFollow, useRememberedWidth, useScrollbarInset, useUnsavedChanges };
|
|
1249
|
+
//# sourceMappingURL=chunk-NJG6JQGC.js.map
|
|
1250
|
+
//# sourceMappingURL=chunk-NJG6JQGC.js.map
|