@mt-gloss/ui 0.1.146 → 0.1.148
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/{COMMITS-PC2MRjv_.js → COMMITS-eopq0SRK.js} +79 -78
- package/composites-panels.js +453 -433
- package/index.js +2 -2
- package/lib/composites/panels/shells/CatalogReplaceShell.d.ts +9 -1
- package/lib/composites/panels/shells/SettingsShell.d.ts +16 -1
- package/lib/primitives/dashboard/SettingsTabStrip/types.d.ts +1 -1
- package/package.json +1 -1
- package/ui.css +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { motion as
|
|
1
|
+
import { jsx as s, jsxs as N } from "react/jsx-runtime";
|
|
2
|
+
import { motion as se } from "framer-motion";
|
|
3
3
|
import B, { useSyncExternalStore as le, useState as F, useRef as O, useMemo as z, useEffect as w, useCallback as T, createContext as ae, useContext as W, useReducer as ce, useId as X, useLayoutEffect as G } from "react";
|
|
4
4
|
import { z as K } from "zod";
|
|
5
5
|
const Xe = {
|
|
@@ -75,22 +75,23 @@ const me = {
|
|
|
75
75
|
threshold: "Threshold",
|
|
76
76
|
timeframe: "Timeframe",
|
|
77
77
|
slots: "Slots",
|
|
78
|
-
color: "Color"
|
|
78
|
+
color: "Color",
|
|
79
|
+
info: "Info"
|
|
79
80
|
};
|
|
80
81
|
function ge({
|
|
81
82
|
dimensions: e,
|
|
82
83
|
activeTab: n,
|
|
83
84
|
onSelect: t,
|
|
84
85
|
reduced: r,
|
|
85
|
-
labels:
|
|
86
|
+
labels: i,
|
|
86
87
|
ariaLabel: a = "Settings dimensions"
|
|
87
88
|
}) {
|
|
88
89
|
const c = ee(), o = r ?? c;
|
|
89
90
|
if (e.length < 2) return null;
|
|
90
|
-
const p = (d) =>
|
|
91
|
+
const p = (d) => i?.[d] ?? me[d], u = (d, m) => {
|
|
91
92
|
d.key === "ArrowRight" ? (d.preventDefault(), t(e[(m + 1) % e.length])) : d.key === "ArrowLeft" ? (d.preventDefault(), t(e[(m - 1 + e.length) % e.length])) : d.key === "Home" ? (d.preventDefault(), t(e[0])) : d.key === "End" && (d.preventDefault(), t(e[e.length - 1]));
|
|
92
93
|
};
|
|
93
|
-
return /* @__PURE__ */
|
|
94
|
+
return /* @__PURE__ */ s(
|
|
94
95
|
"div",
|
|
95
96
|
{
|
|
96
97
|
role: "tablist",
|
|
@@ -111,9 +112,9 @@ function ge({
|
|
|
111
112
|
onClick: () => t(d),
|
|
112
113
|
onKeyDown: (k) => u(k, m),
|
|
113
114
|
children: [
|
|
114
|
-
/* @__PURE__ */
|
|
115
|
-
_ && !o && /* @__PURE__ */
|
|
116
|
-
|
|
115
|
+
/* @__PURE__ */ s("span", { className: "settings-tab-strip__label", children: p(d) }),
|
|
116
|
+
_ && !o && /* @__PURE__ */ s(
|
|
117
|
+
se.span,
|
|
117
118
|
{
|
|
118
119
|
layoutId: "settings-active-tab-indicator",
|
|
119
120
|
"data-layout-id": "settings-active-tab-indicator",
|
|
@@ -142,8 +143,8 @@ function Q(e, n) {
|
|
|
142
143
|
return t ? t.zoneKey : U(e, n);
|
|
143
144
|
}
|
|
144
145
|
function ve(e, n, t) {
|
|
145
|
-
const r = [...e], [
|
|
146
|
-
return r.splice(t, 0,
|
|
146
|
+
const r = [...e], [i] = r.splice(n, 1);
|
|
147
|
+
return r.splice(t, 0, i), r;
|
|
147
148
|
}
|
|
148
149
|
function he(e) {
|
|
149
150
|
return e.map((n) => `${n.zoneKey}:${n.items.map((t) => t.id).join(",")}`).join("|");
|
|
@@ -153,7 +154,7 @@ function ye(e) {
|
|
|
153
154
|
() => e.zones.map((l) => l.maxItems !== void 0 && l.items.length > l.maxItems ? (process.env.NODE_ENV !== "production" && console.warn(
|
|
154
155
|
`useSortableZones: zone "${l.zoneKey}" exceeds maxItems (${l.items.length} > ${l.maxItems}); trimming to cap.`
|
|
155
156
|
), { ...l, items: l.items.slice(0, l.maxItems) }) : l)
|
|
156
|
-
), [r,
|
|
157
|
+
), [r, i] = F(null), [a, c] = F(null), o = O(null), p = O(e.onZoneChange);
|
|
157
158
|
p.current = e.onZoneChange;
|
|
158
159
|
const u = z(
|
|
159
160
|
() => he(e.zones),
|
|
@@ -177,7 +178,7 @@ function ye(e) {
|
|
|
177
178
|
break;
|
|
178
179
|
}
|
|
179
180
|
}
|
|
180
|
-
o.current = y,
|
|
181
|
+
o.current = y, i(C), c(y);
|
|
181
182
|
},
|
|
182
183
|
[n]
|
|
183
184
|
), _ = T(
|
|
@@ -193,7 +194,7 @@ function ye(e) {
|
|
|
193
194
|
), k = T(
|
|
194
195
|
(l) => {
|
|
195
196
|
const { active: g, over: C } = l, y = () => {
|
|
196
|
-
o.current = null,
|
|
197
|
+
o.current = null, i(null), c(null);
|
|
197
198
|
};
|
|
198
199
|
if (!C) {
|
|
199
200
|
y();
|
|
@@ -223,12 +224,12 @@ function ye(e) {
|
|
|
223
224
|
const h = x[x.length - 1];
|
|
224
225
|
x = x.slice(0, S.maxItems - 1), j = [...D, h];
|
|
225
226
|
}
|
|
226
|
-
const q = Math.min(oe, x.length),
|
|
227
|
+
const q = Math.min(oe, x.length), ie = [
|
|
227
228
|
...x.slice(0, q),
|
|
228
229
|
M,
|
|
229
230
|
...x.slice(q)
|
|
230
231
|
];
|
|
231
|
-
f[E] = { ...v, items: j }, f[I] = { ...S, items:
|
|
232
|
+
f[E] = { ...v, items: j }, f[I] = { ...S, items: ie };
|
|
232
233
|
}
|
|
233
234
|
t(f), p.current?.(f), y();
|
|
234
235
|
},
|
|
@@ -280,9 +281,9 @@ function Se(e, n) {
|
|
|
280
281
|
const t = [], r = e ?? {};
|
|
281
282
|
for (const a of Ee)
|
|
282
283
|
r[a] === void 0 && t.push(`@dnd-kit/core:${a}`);
|
|
283
|
-
const
|
|
284
|
+
const i = n ?? {};
|
|
284
285
|
for (const a of Ie)
|
|
285
|
-
|
|
286
|
+
i[a] === void 0 && t.push(`@dnd-kit/sortable:${a}`);
|
|
286
287
|
return t.length === 0 ? { ok: !0 } : { ok: !1, missing: t };
|
|
287
288
|
}
|
|
288
289
|
function Ce() {
|
|
@@ -308,7 +309,7 @@ function Ce() {
|
|
|
308
309
|
})(), R);
|
|
309
310
|
}
|
|
310
311
|
function be(e) {
|
|
311
|
-
const { zones: n, onZoneChange: t, renderZone: r, renderItem:
|
|
312
|
+
const { zones: n, onZoneChange: t, renderZone: r, renderItem: i, renderDragOverlay: a } = e, c = ye({ zones: n, onZoneChange: t }), [o, p] = B.useState(L);
|
|
312
313
|
return B.useEffect(() => {
|
|
313
314
|
if (o) return;
|
|
314
315
|
let u = !0;
|
|
@@ -317,18 +318,18 @@ function be(e) {
|
|
|
317
318
|
}), () => {
|
|
318
319
|
u = !1;
|
|
319
320
|
};
|
|
320
|
-
}, [o]), o ? /* @__PURE__ */
|
|
321
|
+
}, [o]), o ? /* @__PURE__ */ s(
|
|
321
322
|
ne,
|
|
322
323
|
{
|
|
323
324
|
state: c,
|
|
324
325
|
modules: o,
|
|
325
326
|
renderZone: r,
|
|
326
|
-
renderItem:
|
|
327
|
+
renderItem: i,
|
|
327
328
|
renderDragOverlay: a
|
|
328
329
|
}
|
|
329
|
-
) : /* @__PURE__ */
|
|
330
|
-
const d = u.items.map((m) => /* @__PURE__ */
|
|
331
|
-
return /* @__PURE__ */
|
|
330
|
+
) : /* @__PURE__ */ s("div", { "data-sortable-zones-passive": "true", children: c.zones.map((u) => {
|
|
331
|
+
const d = u.items.map((m) => /* @__PURE__ */ s(B.Fragment, { children: i(m) }, m.id));
|
|
332
|
+
return /* @__PURE__ */ s("div", { ...c.getZoneProps(u.zoneKey), children: r(u.zoneKey, u.items, d) }, u.zoneKey);
|
|
332
333
|
}) });
|
|
333
334
|
}
|
|
334
335
|
be.displayName = "SortableZones";
|
|
@@ -337,7 +338,7 @@ function ne({
|
|
|
337
338
|
modules: n,
|
|
338
339
|
renderZone: t,
|
|
339
340
|
renderItem: r,
|
|
340
|
-
renderDragOverlay:
|
|
341
|
+
renderDragOverlay: i
|
|
341
342
|
}) {
|
|
342
343
|
const { core: a, sortable: c, utilities: o } = n, { DndContext: p, DragOverlay: u, useSensors: d, useSensor: m, useDroppable: _, PointerSensor: k, KeyboardSensor: A, closestCenter: H } = a, { SortableContext: l, verticalListSortingStrategy: g } = c, C = d(
|
|
343
344
|
m(k, { activationConstraint: { distance: 5 } }),
|
|
@@ -353,7 +354,7 @@ function ne({
|
|
|
353
354
|
onDragEnd: e.handleDragEnd,
|
|
354
355
|
children: [
|
|
355
356
|
e.zones.map((f) => {
|
|
356
|
-
const E = f.items.map((v) => v.id), I = f.items.map((v) => /* @__PURE__ */
|
|
357
|
+
const E = f.items.map((v) => v.id), I = f.items.map((v) => /* @__PURE__ */ s(
|
|
357
358
|
te,
|
|
358
359
|
{
|
|
359
360
|
id: v.id,
|
|
@@ -363,30 +364,30 @@ function ne({
|
|
|
363
364
|
},
|
|
364
365
|
v.id
|
|
365
366
|
));
|
|
366
|
-
return /* @__PURE__ */
|
|
367
|
+
return /* @__PURE__ */ s(
|
|
367
368
|
re,
|
|
368
369
|
{
|
|
369
370
|
zoneKey: f.zoneKey,
|
|
370
371
|
zoneProps: e.getZoneProps(f.zoneKey),
|
|
371
372
|
useDroppable: _,
|
|
372
|
-
children: /* @__PURE__ */
|
|
373
|
+
children: /* @__PURE__ */ s(P, { items: E, strategy: g, children: t(f.zoneKey, f.items, I) })
|
|
373
374
|
},
|
|
374
375
|
f.zoneKey
|
|
375
376
|
);
|
|
376
377
|
}),
|
|
377
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ s(b, { children: e.activeItem ? i?.(e.activeItem) ?? r(e.activeItem) : null })
|
|
378
379
|
]
|
|
379
380
|
}
|
|
380
381
|
);
|
|
381
382
|
}
|
|
382
383
|
ne.displayName = "SortableZonesInner";
|
|
383
384
|
function te({ id: e, useSortable: n, cssHelper: t, children: r }) {
|
|
384
|
-
const { attributes:
|
|
385
|
+
const { attributes: i, listeners: a, setNodeRef: c, transform: o, transition: p, isDragging: u } = n({ id: e }), d = {
|
|
385
386
|
transform: t?.Transform?.toString(o) ?? void 0,
|
|
386
387
|
transition: p,
|
|
387
388
|
opacity: u ? 0.5 : 1
|
|
388
389
|
};
|
|
389
|
-
return /* @__PURE__ */
|
|
390
|
+
return /* @__PURE__ */ s("div", { ref: c, style: d, "data-sortable-item-id": e, ...i, ...a, children: r });
|
|
390
391
|
}
|
|
391
392
|
te.displayName = "SortableItem";
|
|
392
393
|
function re({
|
|
@@ -395,8 +396,8 @@ function re({
|
|
|
395
396
|
useDroppable: t,
|
|
396
397
|
children: r
|
|
397
398
|
}) {
|
|
398
|
-
const { setNodeRef:
|
|
399
|
-
return /* @__PURE__ */
|
|
399
|
+
const { setNodeRef: i, isOver: a } = t({ id: e });
|
|
400
|
+
return /* @__PURE__ */ s("div", { ref: i, "data-zone-is-over": a || void 0, ...n, children: r });
|
|
400
401
|
}
|
|
401
402
|
re.displayName = "ZoneDroppable";
|
|
402
403
|
const V = ae(null);
|
|
@@ -501,12 +502,12 @@ function ke(e, n) {
|
|
|
501
502
|
case "CLOSE_PANEL": {
|
|
502
503
|
if (e.activePanelId == null)
|
|
503
504
|
return e;
|
|
504
|
-
const t = e.activePanelId, r = e.activeTrigger?.cardId ?? null,
|
|
505
|
+
const t = e.activePanelId, r = e.activeTrigger?.cardId ?? null, i = r != null ? e.bufferByCard[r] : void 0, a = e.isDirty ? n.reason === "apply-button" ? r != null && i != null ? [
|
|
505
506
|
{
|
|
506
507
|
type: "COMMIT_BUFFER",
|
|
507
|
-
payload: { cardId: r, delta:
|
|
508
|
+
payload: { cardId: r, delta: i }
|
|
508
509
|
}
|
|
509
|
-
] : [{ type: "COMMIT_BUFFER" }] : [{ type: "DISCARD_BUFFER" }] : [], c = r != null &&
|
|
510
|
+
] : [{ type: "COMMIT_BUFFER" }] : [{ type: "DISCARD_BUFFER" }] : [], c = r != null && i != null ? (() => {
|
|
510
511
|
const o = { ...e.bufferByCard };
|
|
511
512
|
return delete o[r], o;
|
|
512
513
|
})() : e.bufferByCard;
|
|
@@ -546,12 +547,12 @@ function ke(e, n) {
|
|
|
546
547
|
{ type: "INVALID_DISPATCH", reason: "no-buffer-panel" }
|
|
547
548
|
]
|
|
548
549
|
};
|
|
549
|
-
const t = e.bufferByCard[n.cardId], r = t == null,
|
|
550
|
-
if (!r && t.changes[n.key] ===
|
|
550
|
+
const t = e.bufferByCard[n.cardId], r = t == null, i = Oe(n.key, n.value);
|
|
551
|
+
if (!r && t.changes[n.key] === i)
|
|
551
552
|
return e;
|
|
552
553
|
const c = { kind: "settings", changes: {
|
|
553
554
|
...t?.kind === "settings" ? t.changes : {},
|
|
554
|
-
[n.key]:
|
|
555
|
+
[n.key]: i
|
|
555
556
|
} }, o = { ...e.bufferByCard, [n.cardId]: c }, p = r ? [
|
|
556
557
|
{
|
|
557
558
|
type: "SCHEDULE_TIMER",
|
|
@@ -568,8 +569,8 @@ function ke(e, n) {
|
|
|
568
569
|
case "CLEAR_BUFFER": {
|
|
569
570
|
if (e.bufferByCard[n.cardId] == null)
|
|
570
571
|
return e;
|
|
571
|
-
const r = Object.keys(e.bufferByCard).length === 1,
|
|
572
|
-
delete
|
|
572
|
+
const r = Object.keys(e.bufferByCard).length === 1, i = { ...e.bufferByCard };
|
|
573
|
+
delete i[n.cardId];
|
|
573
574
|
const a = r && e.isDirty ? [
|
|
574
575
|
{
|
|
575
576
|
type: "SCHEDULE_TIMER",
|
|
@@ -579,7 +580,7 @@ function ke(e, n) {
|
|
|
579
580
|
] : [];
|
|
580
581
|
return {
|
|
581
582
|
...e,
|
|
582
|
-
bufferByCard:
|
|
583
|
+
bufferByCard: i,
|
|
583
584
|
pendingSideEffects: [...e.pendingSideEffects, ...a]
|
|
584
585
|
};
|
|
585
586
|
}
|
|
@@ -657,11 +658,11 @@ function Me() {
|
|
|
657
658
|
c
|
|
658
659
|
];
|
|
659
660
|
}, [e.lastClose]);
|
|
660
|
-
const
|
|
661
|
+
const i = z(
|
|
661
662
|
() => Le(e),
|
|
662
663
|
[e.activePanelId, e.bellCutoutOpen, e.isDirty]
|
|
663
664
|
), a = T(() => t.current.slice(), []);
|
|
664
|
-
return { state: e, surfaceState:
|
|
665
|
+
return { state: e, surfaceState: i, dispatch: n, getCloseLog: a };
|
|
665
666
|
}
|
|
666
667
|
function sn({ children: e }) {
|
|
667
668
|
const n = Me(), t = z(
|
|
@@ -670,12 +671,12 @@ function sn({ children: e }) {
|
|
|
670
671
|
// dispatch + getCloseLog are stable. state + surfaceState change on dispatch.
|
|
671
672
|
[n.state, n.surfaceState, n.dispatch, n.getCloseLog]
|
|
672
673
|
);
|
|
673
|
-
return /* @__PURE__ */
|
|
674
|
+
return /* @__PURE__ */ s(V.Provider, { value: t, children: e });
|
|
674
675
|
}
|
|
675
676
|
function Re({ title: e, onClose: n, titleId: t }) {
|
|
676
677
|
return /* @__PURE__ */ N("div", { className: "gloss-panel-chrome-v2__header", children: [
|
|
677
|
-
e != null && /* @__PURE__ */
|
|
678
|
-
/* @__PURE__ */
|
|
678
|
+
e != null && /* @__PURE__ */ s("span", { id: t, className: "gloss-panel-chrome-v2__title", children: e }),
|
|
679
|
+
/* @__PURE__ */ s(
|
|
679
680
|
"button",
|
|
680
681
|
{
|
|
681
682
|
id: "panel-close",
|
|
@@ -689,7 +690,7 @@ function Re({ title: e, onClose: n, titleId: t }) {
|
|
|
689
690
|
] });
|
|
690
691
|
}
|
|
691
692
|
function Fe({ children: e }) {
|
|
692
|
-
return /* @__PURE__ */
|
|
693
|
+
return /* @__PURE__ */ s(
|
|
693
694
|
"div",
|
|
694
695
|
{
|
|
695
696
|
"data-panel-stage": !0,
|
|
@@ -700,15 +701,15 @@ function Fe({ children: e }) {
|
|
|
700
701
|
);
|
|
701
702
|
}
|
|
702
703
|
function Ae({ children: e }) {
|
|
703
|
-
return /* @__PURE__ */
|
|
704
|
+
return /* @__PURE__ */ s("div", { className: "gloss-panel-chrome-v2__navigation", children: e });
|
|
704
705
|
}
|
|
705
706
|
function He({ children: e }) {
|
|
706
|
-
return /* @__PURE__ */
|
|
707
|
+
return /* @__PURE__ */ s("div", { className: "gloss-panel-chrome-v2__body", children: e });
|
|
707
708
|
}
|
|
708
709
|
function Be({ left: e, right: n }) {
|
|
709
710
|
return /* @__PURE__ */ N("div", { className: "gloss-panel-chrome-v2__footer", children: [
|
|
710
|
-
/* @__PURE__ */
|
|
711
|
-
/* @__PURE__ */
|
|
711
|
+
/* @__PURE__ */ s("div", { className: "gloss-panel-chrome-v2__footer-left", children: e }),
|
|
712
|
+
/* @__PURE__ */ s("div", { className: "gloss-panel-chrome-v2__footer-right", children: n })
|
|
712
713
|
] });
|
|
713
714
|
}
|
|
714
715
|
function Ze({
|
|
@@ -716,7 +717,7 @@ function Ze({
|
|
|
716
717
|
onClose: n,
|
|
717
718
|
title: t,
|
|
718
719
|
variant: r = "no-stage",
|
|
719
|
-
stage:
|
|
720
|
+
stage: i,
|
|
720
721
|
navigation: a,
|
|
721
722
|
footer: c
|
|
722
723
|
}) {
|
|
@@ -733,12 +734,12 @@ function Ze({
|
|
|
733
734
|
"aria-label": u ? void 0 : "Panel",
|
|
734
735
|
className: `gloss-panel-chrome-v2 gloss-panel-chrome-v2--${r}${o ? " gloss-panel-chrome-v2--headerless" : ""}`,
|
|
735
736
|
children: [
|
|
736
|
-
!o && /* @__PURE__ */
|
|
737
|
-
r === "with-stage" && /* @__PURE__ */
|
|
738
|
-
a != null && /* @__PURE__ */
|
|
739
|
-
/* @__PURE__ */
|
|
740
|
-
c != null && /* @__PURE__ */
|
|
741
|
-
o && /* @__PURE__ */
|
|
737
|
+
!o && /* @__PURE__ */ s(Re, { title: t, onClose: n, titleId: p }),
|
|
738
|
+
r === "with-stage" && /* @__PURE__ */ s(Fe, { children: i }),
|
|
739
|
+
a != null && /* @__PURE__ */ s(Ae, { children: a }),
|
|
740
|
+
/* @__PURE__ */ s(He, { children: e }),
|
|
741
|
+
c != null && /* @__PURE__ */ s(Be, { left: c.left, right: c.right }),
|
|
742
|
+
o && /* @__PURE__ */ s(
|
|
742
743
|
"button",
|
|
743
744
|
{
|
|
744
745
|
id: "panel-close",
|
|
@@ -755,19 +756,19 @@ function Ze({
|
|
|
755
756
|
}
|
|
756
757
|
function ln({ isOpen: e }) {
|
|
757
758
|
const n = Pe();
|
|
758
|
-
return /* @__PURE__ */
|
|
759
|
+
return /* @__PURE__ */ s(
|
|
759
760
|
Ze,
|
|
760
761
|
{
|
|
761
762
|
variant: "no-stage",
|
|
762
763
|
title: "Notifications",
|
|
763
764
|
onClose: () => n?.dispatch({ type: "CLOSE_PANEL", reason: "header-x" }),
|
|
764
|
-
children: /* @__PURE__ */
|
|
765
|
+
children: /* @__PURE__ */ s(
|
|
765
766
|
"div",
|
|
766
767
|
{
|
|
767
768
|
"data-shell": "notification-center",
|
|
768
769
|
"data-panel": "notification-center",
|
|
769
770
|
"aria-hidden": !e,
|
|
770
|
-
children: /* @__PURE__ */
|
|
771
|
+
children: /* @__PURE__ */ s("p", { children: "No notifications" })
|
|
771
772
|
}
|
|
772
773
|
)
|
|
773
774
|
}
|
|
@@ -777,21 +778,21 @@ const Ke = {
|
|
|
777
778
|
position: "relative",
|
|
778
779
|
pointerEvents: "auto"
|
|
779
780
|
};
|
|
780
|
-
function Ue({ children: e, onClose: n, footer: t, title: r, variant:
|
|
781
|
+
function Ue({ children: e, onClose: n, footer: t, title: r, variant: i = "default" }) {
|
|
781
782
|
const a = `panel-close-${X().replace(/:/g, "-")}`;
|
|
782
783
|
return /* @__PURE__ */ N(
|
|
783
784
|
"div",
|
|
784
785
|
{
|
|
785
786
|
"data-chrome": "panel",
|
|
786
|
-
"data-chrome-variant":
|
|
787
|
+
"data-chrome-variant": i,
|
|
787
788
|
role: "dialog",
|
|
788
789
|
"aria-modal": "true",
|
|
789
|
-
className:
|
|
790
|
+
className: i === "merged-stage" ? "gloss-panel-chrome gloss-panel-chrome--merged-stage" : "gloss-panel-chrome",
|
|
790
791
|
style: Ke,
|
|
791
792
|
children: [
|
|
792
793
|
/* @__PURE__ */ N("div", { className: "gloss-panel-chrome__header", children: [
|
|
793
|
-
r != null && /* @__PURE__ */
|
|
794
|
-
/* @__PURE__ */
|
|
794
|
+
r != null && /* @__PURE__ */ s("span", { className: "gloss-panel-chrome__title", children: r }),
|
|
795
|
+
/* @__PURE__ */ s(
|
|
795
796
|
"button",
|
|
796
797
|
{
|
|
797
798
|
id: a,
|
|
@@ -803,8 +804,8 @@ function Ue({ children: e, onClose: n, footer: t, title: r, variant: s = "defaul
|
|
|
803
804
|
}
|
|
804
805
|
)
|
|
805
806
|
] }),
|
|
806
|
-
/* @__PURE__ */
|
|
807
|
-
t != null && /* @__PURE__ */
|
|
807
|
+
/* @__PURE__ */ s("div", { className: "gloss-panel-chrome__body", children: e }),
|
|
808
|
+
t != null && /* @__PURE__ */ s("div", { className: "gloss-panel-chrome__footer", children: t })
|
|
808
809
|
]
|
|
809
810
|
}
|
|
810
811
|
);
|
|
@@ -829,7 +830,7 @@ function Ve({ isOpen: e, children: n }) {
|
|
|
829
830
|
G(() => {
|
|
830
831
|
ze(r.current);
|
|
831
832
|
}, []);
|
|
832
|
-
const [
|
|
833
|
+
const [i, a] = F(!1);
|
|
833
834
|
w(() => {
|
|
834
835
|
if (!e) {
|
|
835
836
|
a(!1);
|
|
@@ -840,10 +841,10 @@ function Ve({ isOpen: e, children: n }) {
|
|
|
840
841
|
}, [e]);
|
|
841
842
|
const c = [
|
|
842
843
|
"gloss-panel-mount",
|
|
843
|
-
|
|
844
|
+
i ? "has-panel" : "",
|
|
844
845
|
t ? "reduced-motion" : ""
|
|
845
846
|
].filter(Boolean).join(" ");
|
|
846
|
-
return /* @__PURE__ */
|
|
847
|
+
return /* @__PURE__ */ s(
|
|
847
848
|
"div",
|
|
848
849
|
{
|
|
849
850
|
ref: r,
|
|
@@ -880,8 +881,8 @@ const $e = {
|
|
|
880
881
|
background: "rgba(0, 0, 0, 0.04)"
|
|
881
882
|
};
|
|
882
883
|
function an({ panelComponents: e }) {
|
|
883
|
-
const { state: n, dispatch: t, getCloseLog: r } = _e(),
|
|
884
|
-
n.activePanelId && !
|
|
884
|
+
const { state: n, dispatch: t, getCloseLog: r } = _e(), i = n.activePanelId ? e[n.activePanelId] : null;
|
|
885
|
+
n.activePanelId && !i && process.env.NODE_ENV !== "production" && console.error(
|
|
885
886
|
"[panels] No panel component registered for activePanelId:",
|
|
886
887
|
n.activePanelId
|
|
887
888
|
), w(() => {
|
|
@@ -907,21 +908,21 @@ function an({ panelComponents: e }) {
|
|
|
907
908
|
o.__panelsHostHandle?.dispatch === t && delete o.__panelsHostHandle;
|
|
908
909
|
};
|
|
909
910
|
}, [t, r]);
|
|
910
|
-
const c = n.activePanelId != null &&
|
|
911
|
+
const c = n.activePanelId != null && i != null;
|
|
911
912
|
return /* @__PURE__ */ N("div", { "data-panel-host": "true", style: $e, children: [
|
|
912
|
-
c && /* @__PURE__ */
|
|
913
|
+
c && /* @__PURE__ */ s(
|
|
913
914
|
"div",
|
|
914
915
|
{
|
|
915
916
|
"data-panel-scrim": "true",
|
|
916
917
|
style: je
|
|
917
918
|
}
|
|
918
919
|
),
|
|
919
|
-
/* @__PURE__ */
|
|
920
|
+
/* @__PURE__ */ s(Ve, { isOpen: c, children: c && /* @__PURE__ */ s(
|
|
920
921
|
Ue,
|
|
921
922
|
{
|
|
922
923
|
isOpen: !0,
|
|
923
924
|
onClose: () => t({ type: "CLOSE_PANEL", reason: "header-x" }),
|
|
924
|
-
children: /* @__PURE__ */ i
|
|
925
|
+
children: /* @__PURE__ */ s(i, { isOpen: !0 })
|
|
925
926
|
}
|
|
926
927
|
) })
|
|
927
928
|
] });
|