@mt-gloss/ui 0.1.95 → 0.1.97

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.
Files changed (27) hide show
  1. package/composites-panels.js +593 -189
  2. package/index.d.ts +6 -0
  3. package/index.js +1294 -1150
  4. package/lib/composites/dashboard/BellCutout/BellCutout.d.ts +11 -0
  5. package/lib/composites/dashboard/BellCutout/index.d.ts +2 -0
  6. package/lib/composites/dashboard/BellPopover/BellPopover.d.ts +12 -0
  7. package/lib/composites/dashboard/BellPopover/index.d.ts +2 -0
  8. package/lib/composites/dashboard/index.d.ts +2 -0
  9. package/lib/composites/index.d.ts +1 -0
  10. package/lib/composites/panels/coordinator/PANEL_IDS.d.ts +8 -0
  11. package/lib/composites/panels/index.d.ts +16 -0
  12. package/lib/composites/panels/shells/CatalogAddShell.d.ts +19 -0
  13. package/lib/composites/panels/shells/CatalogReplaceShell.d.ts +13 -0
  14. package/lib/composites/panels/shells/PageMgmtShell.d.ts +10 -0
  15. package/lib/composites/panels/shells/index.d.ts +15 -0
  16. package/lib/composites/panels/shells/internals/CatalogFooter.d.ts +18 -0
  17. package/lib/composites/panels/shells/internals/CatalogLensPicker.d.ts +6 -0
  18. package/lib/composites/panels/shells/internals/CatalogTileGrid.d.ts +17 -0
  19. package/lib/composites/panels/shells/internals/PageMgmtFooter.d.ts +16 -0
  20. package/lib/composites/panels/shells/internals/PageMgmtRow.d.ts +8 -0
  21. package/lib/composites/panels/shells/internals/catalog-mocks.d.ts +20 -0
  22. package/lib/composites/panels/shells/internals/page-mgmt-mocks.d.ts +12 -0
  23. package/lib/composites/portal/BodyPortal.d.ts +18 -0
  24. package/lib/composites/portal/index.d.ts +4 -0
  25. package/lib/composites/portal/usePortalAnchor.d.ts +17 -0
  26. package/package.json +1 -1
  27. package/ui.css +1 -1
@@ -1,36 +1,391 @@
1
- import { a as h, f as S, u as b, g as N, c as A } from "./COMMITS-By42AA8m.js";
2
- import { C as ee, b as ne, P as te, e as oe, i as re, r as se, d as ie } from "./COMMITS-By42AA8m.js";
3
- import { jsx as a, jsxs as m, Fragment as I } from "react/jsx-runtime";
4
- import { useEffect as y, useRef as L, useLayoutEffect as C, useCallback as v } from "react";
5
- function x({ children: e }) {
6
- return /* @__PURE__ */ a("div", { className: "clone-stage", children: e });
1
+ import { a as C, f as L, u as K, g, c as b } from "./COMMITS-By42AA8m.js";
2
+ import { C as we, b as Ae, P as _e, e as Le, i as Oe, r as xe, d as Ie } from "./COMMITS-By42AA8m.js";
3
+ import { jsx as o, jsxs as c, Fragment as j } from "react/jsx-runtime";
4
+ import { useState as m, useRef as O, createContext as x, useContext as I, useEffect as N, useLayoutEffect as q, useCallback as T } from "react";
5
+ function B({ children: e }) {
6
+ return /* @__PURE__ */ o("div", { className: "clone-stage", children: e });
7
7
  }
8
- function O({ span: e, rotating: n = !0, children: t }) {
9
- const r = ["clone-card", `span-${e}`, n ? "rotating" : ""].filter(Boolean).join(" ");
10
- return /* @__PURE__ */ a("div", { className: r, children: t });
8
+ function G({ span: e, rotating: t = !0, children: a }) {
9
+ const n = ["clone-card", `span-${e}`, t ? "rotating" : ""].filter(Boolean).join(" ");
10
+ return /* @__PURE__ */ o("div", { className: n, children: a });
11
11
  }
12
- function K({
12
+ function he({
13
13
  isOpen: e,
14
- cardSpan: n,
15
- cardLabel: t = "Metric",
16
- cardValue: r = "—"
14
+ cardSpan: t,
15
+ cardLabel: a = "Metric",
16
+ cardValue: n = "—"
17
17
  }) {
18
- const o = h()?.state.activeTrigger, i = o?.kind === "card-overflow" ? o.cardId : null, l = S(), c = o?.span;
19
- return /* @__PURE__ */ m("div", { "data-shell": "settings", "aria-hidden": !e, children: [
20
- /* @__PURE__ */ a(x, { children: /* @__PURE__ */ m(O, { span: n ?? c ?? 1, rotating: !l, children: [
21
- /* @__PURE__ */ a("div", { style: { fontSize: 9, textTransform: "uppercase", letterSpacing: "0.06em", color: "#9ca3af", marginBottom: 6 }, children: t }),
22
- /* @__PURE__ */ a("div", { style: { fontSize: 22, fontWeight: 700, color: "#111827", lineHeight: 1 }, children: r })
18
+ const r = C()?.state.activeTrigger, s = r?.kind === "card-overflow" ? r.cardId : null, i = L(), d = r?.span;
19
+ return /* @__PURE__ */ c("div", { "data-shell": "settings", "aria-hidden": !e, children: [
20
+ /* @__PURE__ */ o(B, { children: /* @__PURE__ */ c(G, { span: t ?? d ?? 1, rotating: !i, children: [
21
+ /* @__PURE__ */ o("div", { style: { fontSize: 9, textTransform: "uppercase", letterSpacing: "0.06em", color: "#9ca3af", marginBottom: 6 }, children: a }),
22
+ /* @__PURE__ */ o("div", { style: { fontSize: 22, fontWeight: 700, color: "#111827", lineHeight: 1 }, children: n })
23
23
  ] }) }),
24
- /* @__PURE__ */ a("p", { style: { margin: "12px 0 0", fontSize: 14, color: "#495057" }, children: i ? `Settings for card: ${i}` : "Settings" }),
25
- /* @__PURE__ */ a("p", { style: { margin: "8px 0 0", fontSize: 12, color: "#adb5bd" }, children: "Configuration options coming soon." })
24
+ /* @__PURE__ */ o("p", { style: { margin: "12px 0 0", fontSize: 14, color: "#495057" }, children: s ? `Settings for card: ${s}` : "Settings" }),
25
+ /* @__PURE__ */ o("p", { style: { margin: "8px 0 0", fontSize: 12, color: "#adb5bd" }, children: "Configuration options coming soon." })
26
26
  ] });
27
27
  }
28
- const z = {
28
+ function M({ lenses: e, activeLens: t, onLensChange: a }) {
29
+ const [n, l] = m(!1), r = O(null), s = () => {
30
+ r.current != null && (window.clearTimeout(r.current), r.current = null);
31
+ }, i = () => {
32
+ s(), r.current = window.setTimeout(() => l(!1), 100);
33
+ }, d = e.filter((u) => u !== t);
34
+ return /* @__PURE__ */ o("div", { className: "cat-segmented-wrap", children: /* @__PURE__ */ c("div", { className: "cat-segmented", children: [
35
+ /* @__PURE__ */ o(
36
+ "button",
37
+ {
38
+ type: "button",
39
+ className: "cat-seg active",
40
+ "data-lens": t,
41
+ "aria-pressed": "true",
42
+ children: t
43
+ }
44
+ ),
45
+ /* @__PURE__ */ c(
46
+ "div",
47
+ {
48
+ className: "cat-seg-more",
49
+ onMouseEnter: () => {
50
+ s(), l(!0);
51
+ },
52
+ onMouseLeave: i,
53
+ children: [
54
+ /* @__PURE__ */ o("button", { type: "button", className: "cat-seg cat-seg-more-btn", "aria-haspopup": "menu", "aria-expanded": n, children: "More ▾" }),
55
+ n && /* @__PURE__ */ o(
56
+ "div",
57
+ {
58
+ className: "cat-seg-overflow",
59
+ role: "menu",
60
+ onMouseEnter: s,
61
+ onMouseLeave: i,
62
+ children: d.map((u) => /* @__PURE__ */ o(
63
+ "button",
64
+ {
65
+ type: "button",
66
+ "data-lens": u,
67
+ role: "menuitem",
68
+ onClick: () => {
69
+ a(u), l(!1);
70
+ },
71
+ children: u
72
+ },
73
+ u
74
+ ))
75
+ }
76
+ )
77
+ ]
78
+ }
79
+ )
80
+ ] }) });
81
+ }
82
+ function U(e) {
83
+ return e.split("·").map((t, a) => {
84
+ const n = t.trim(), l = n.match(/^([$+\-]?[\d,]+(?:\.\d+)?[%+]?)\s*(.*)$/), r = l ? l[1] : "", s = l ? l[2] : n;
85
+ return /* @__PURE__ */ c("span", { children: [
86
+ /* @__PURE__ */ o("strong", { children: r }),
87
+ /* @__PURE__ */ o("small", { children: s })
88
+ ] }, a);
89
+ });
90
+ }
91
+ function D({ tiles: e, selectedTileId: t, onSelectTile: a }) {
92
+ return /* @__PURE__ */ o("div", { className: "cat-tiles", children: e.map((n) => {
93
+ const l = n.id === t, r = n.stack === !0, s = ["cat-tile"];
94
+ return r && s.push("span-2"), l && s.push("selected"), /* @__PURE__ */ c(
95
+ "button",
96
+ {
97
+ type: "button",
98
+ className: s.join(" "),
99
+ "data-metric": n.id,
100
+ "data-desc": n.desc,
101
+ "aria-pressed": l,
102
+ onClick: () => a(n.id, n.desc),
103
+ children: [
104
+ /* @__PURE__ */ o("span", { className: "cat-tile-label", children: n.label }),
105
+ /* @__PURE__ */ o("span", { className: "cat-tile-value", children: r ? U(n.value) : n.value }),
106
+ n.variants && n.variants.length > 0 && /* @__PURE__ */ o("span", { className: "cat-tile-variants", "aria-hidden": "true", children: n.variants.map((i) => /* @__PURE__ */ o("span", { children: i }, i)) })
107
+ ]
108
+ },
109
+ n.id
110
+ );
111
+ }) });
112
+ }
113
+ const E = x(null);
114
+ function Y() {
115
+ return I(E);
116
+ }
117
+ function V({ mode: e, dispatch: t }) {
118
+ const a = Y();
119
+ if (a == null && e == null) return null;
120
+ const n = a?.mode ?? e ?? "add", l = a?.selectedTileId ?? null, r = a?.description ?? null, s = l == null;
121
+ return /* @__PURE__ */ c("div", { className: "panel-footer catalog", children: [
122
+ /* @__PURE__ */ o("div", { className: "cat-description", id: "cat-desc", children: r ?? /* @__PURE__ */ o("em", { children: "Tap a metric to see its description" }) }),
123
+ /* @__PURE__ */ c("div", { style: { display: "flex", padding: "10px 14px", gap: 8 }, children: [
124
+ /* @__PURE__ */ o("div", { className: "spacer", style: { flex: 1 } }),
125
+ /* @__PURE__ */ o(
126
+ "button",
127
+ {
128
+ id: "btn-cat-cancel",
129
+ type: "button",
130
+ className: "btn btn-ghost",
131
+ onClick: () => t({ type: "CLOSE_PANEL", reason: "cancel-button" }),
132
+ children: "Cancel"
133
+ }
134
+ ),
135
+ n === "add" && /* @__PURE__ */ o(
136
+ "button",
137
+ {
138
+ id: "btn-cat-add",
139
+ type: "button",
140
+ className: "btn btn-primary",
141
+ disabled: s,
142
+ onClick: () => t({ type: "CLOSE_PANEL", reason: "apply-button" }),
143
+ children: "Add metric"
144
+ }
145
+ ),
146
+ n === "replace" && /* @__PURE__ */ o(
147
+ "button",
148
+ {
149
+ id: "btn-cat-replace",
150
+ type: "button",
151
+ className: "btn btn-primary",
152
+ disabled: s,
153
+ onClick: () => t({ type: "CLOSE_PANEL", reason: "apply-button" }),
154
+ children: "Replace metric"
155
+ }
156
+ )
157
+ ] })
158
+ ] });
159
+ }
160
+ const R = [
161
+ "Revenue",
162
+ "Order flow",
163
+ "Rep performance",
164
+ "Brand portfolio",
165
+ "Account coverage",
166
+ "Commission"
167
+ ], k = "Order flow", z = {
168
+ Revenue: [
169
+ { id: "rev-mtd", label: "Revenue MTD", value: "$184K", desc: "Month-to-date revenue across all manufacturers and territories." },
170
+ { id: "rev-ytd", label: "Revenue YTD", value: "$2.1M", desc: "Year-to-date revenue including pending and posted orders.", variants: ["1×1", "1×3"] },
171
+ { id: "rev-yoy", label: "YoY Δ", value: "+12.4%", desc: "Revenue growth versus the prior comparable period." },
172
+ { id: "rev-avg", label: "Avg order", value: "$1,820", desc: "Average order value over the last 30 days." }
173
+ ],
174
+ "Order flow": [
175
+ {
176
+ id: "of-funnel",
177
+ label: "Order funnel",
178
+ value: "New 42 · Incomplete 18 · Transmitted 91",
179
+ stack: !0,
180
+ desc: "Funnel snapshot — new orders, incomplete (awaiting attention), and transmitted to manufacturer.",
181
+ variants: ["1×3"]
182
+ },
183
+ { id: "of-incomplete", label: "Incomplete", value: "18", desc: "Orders started but not yet transmitted." },
184
+ { id: "of-transmitted", label: "Transmitted", value: "91", desc: "Orders successfully sent to manufacturer." },
185
+ { id: "of-today", label: "New today", value: "7", desc: "Orders created in the current calendar day." },
186
+ { id: "of-velocity", label: "Order velocity", value: "+3.1/d", desc: "Rolling 7-day order-creation rate change." }
187
+ ],
188
+ "Rep performance": [
189
+ { id: "rp-leader", label: "#1 Rep", value: "A. Chen", desc: "Top revenue performer in the current period." },
190
+ { id: "rp-quota", label: "Below quota", value: "4 reps", desc: "Reps currently tracking below pace-to-quota." },
191
+ { id: "rp-commission", label: "Commission pace", value: "$48K", desc: "Projected commission pool at current burn rate." },
192
+ { id: "rp-active", label: "Active reps", value: "14", desc: "Reps with at least one order this period." }
193
+ ],
194
+ "Brand portfolio": [
195
+ { id: "bp-top", label: "Top brand", value: "Acme Co.", desc: "Highest-revenue manufacturer this period." },
196
+ { id: "bp-mix", label: "Mix Δ", value: "+2pp", desc: "Portfolio mix shift versus the prior period." },
197
+ { id: "bp-coverage", label: "Brand coverage", value: "73%", desc: "Percent of accounts with at least one active brand." },
198
+ { id: "bp-new", label: "New brand adds", value: "3", desc: "Brands with first-order activity this period." }
199
+ ],
200
+ "Account coverage": [
201
+ { id: "ac-active", label: "Active accounts", value: "128", desc: "Accounts with at least one order in the period." },
202
+ { id: "ac-untouched", label: "Untouched", value: "34", desc: "Accounts with zero activity in the period." },
203
+ { id: "ac-concentration", label: "Concentration", value: "38% top-5", desc: "Revenue concentration in top-5 accounts." },
204
+ { id: "ac-new", label: "New accounts", value: "6", desc: "Accounts with first-ever order this period." }
205
+ ],
206
+ Commission: [
207
+ { id: "cm-projected", label: "Projected", value: "$48K", desc: "Forecast commission at current pace." },
208
+ { id: "cm-paid", label: "Paid", value: "$31K", desc: "Commission posted to ledger this period." },
209
+ { id: "cm-pending", label: "Pending", value: "$17K", desc: "Commission earned but not yet posted." },
210
+ { id: "cm-rate", label: "Effective rate", value: "6.8%", desc: "Realized commission rate across all orders." }
211
+ ]
212
+ };
213
+ function ve({
214
+ isOpen: e,
215
+ lenses: t = R,
216
+ defaultLens: a = k,
217
+ tilesByLens: n = z,
218
+ footerSlot: l
219
+ }) {
220
+ const [r, s] = m(a), [i, d] = m(null), [u, p] = m(null), v = n[r] ?? [];
221
+ return /* @__PURE__ */ c(
222
+ E.Provider,
223
+ {
224
+ value: { mode: "add", selectedTileId: i, description: u },
225
+ children: [
226
+ /* @__PURE__ */ c("div", { "data-shell": "catalog-add", "aria-hidden": !e, children: [
227
+ /* @__PURE__ */ o("h3", { children: "Add a metric" }),
228
+ /* @__PURE__ */ o(
229
+ M,
230
+ {
231
+ lenses: t,
232
+ activeLens: r,
233
+ onLensChange: (f) => {
234
+ s(f), d(null), p(null);
235
+ }
236
+ }
237
+ ),
238
+ /* @__PURE__ */ o(
239
+ D,
240
+ {
241
+ tiles: v,
242
+ selectedTileId: i,
243
+ onSelectTile: (f, h) => {
244
+ d(f), p(h);
245
+ }
246
+ }
247
+ )
248
+ ] }),
249
+ l
250
+ ]
251
+ }
252
+ );
253
+ }
254
+ function ge({
255
+ isOpen: e,
256
+ replacingLabel: t,
257
+ lenses: a = R,
258
+ defaultLens: n = k,
259
+ tilesByLens: l = z,
260
+ footerSlot: r
261
+ }) {
262
+ const [s, i] = m(n), [d, u] = m(null), [p, v] = m(null), f = l[s] ?? [];
263
+ return /* @__PURE__ */ c(
264
+ E.Provider,
265
+ {
266
+ value: { mode: "replace", selectedTileId: d, description: p },
267
+ children: [
268
+ /* @__PURE__ */ c("div", { "data-shell": "catalog-replace", "aria-hidden": !e, children: [
269
+ /* @__PURE__ */ o("h3", { children: "Replace metric" }),
270
+ t && /* @__PURE__ */ c("p", { className: "cat-subtitle", children: [
271
+ "replacing ",
272
+ t
273
+ ] }),
274
+ /* @__PURE__ */ o(
275
+ M,
276
+ {
277
+ lenses: a,
278
+ activeLens: s,
279
+ onLensChange: (h) => {
280
+ i(h), u(null), v(null);
281
+ }
282
+ }
283
+ ),
284
+ /* @__PURE__ */ o(
285
+ D,
286
+ {
287
+ tiles: f,
288
+ selectedTileId: d,
289
+ onSelectTile: (h, H) => {
290
+ u(h), v(H);
291
+ }
292
+ }
293
+ )
294
+ ] }),
295
+ r
296
+ ]
297
+ }
298
+ );
299
+ }
300
+ function W({ page: e, onRename: t, onKebab: a, onDragStart: n }) {
301
+ const l = ["pm-row"];
302
+ return e.active && l.push("active"), /* @__PURE__ */ c("div", { className: l.join(" "), "data-page-id": e.id, role: "listitem", children: [
303
+ /* @__PURE__ */ o(
304
+ "div",
305
+ {
306
+ className: "pm-handle",
307
+ "aria-hidden": "true",
308
+ onMouseDown: () => n?.(e.id),
309
+ children: "⋮⋮"
310
+ }
311
+ ),
312
+ /* @__PURE__ */ o("div", { className: "pm-name", onClick: () => t?.(e.id), children: e.name }),
313
+ /* @__PURE__ */ o(
314
+ "button",
315
+ {
316
+ type: "button",
317
+ className: "pm-kebab",
318
+ "aria-label": "Page options",
319
+ onClick: () => a?.(e.id),
320
+ children: "⋯"
321
+ }
322
+ )
323
+ ] });
324
+ }
325
+ const $ = x(null);
326
+ function Q() {
327
+ return I($);
328
+ }
329
+ function J(e = {}) {
330
+ const a = Q()?.setPages;
331
+ return /* @__PURE__ */ c(
332
+ "div",
333
+ {
334
+ className: "panel-footer pm",
335
+ style: { display: "flex", justifyContent: "flex-end", padding: "10px 14px" },
336
+ children: [
337
+ /* @__PURE__ */ o("div", { className: "spacer", style: { flex: 1 } }),
338
+ /* @__PURE__ */ o(
339
+ "button",
340
+ {
341
+ id: "btn-new-page",
342
+ type: "button",
343
+ className: "btn btn-primary",
344
+ onClick: () => {
345
+ a && a((n) => [
346
+ ...n,
347
+ { id: `new-${Date.now()}`, name: "Untitled", active: !1 }
348
+ ]);
349
+ },
350
+ children: "+ New page"
351
+ }
352
+ )
353
+ ]
354
+ }
355
+ );
356
+ }
357
+ const X = [
358
+ { id: "p-pipeline", name: "My Pipeline", active: !0 },
359
+ { id: "p-numbers", name: "My Numbers", active: !1 },
360
+ { id: "p-morning", name: "My Morning", active: !1 },
361
+ { id: "p-accounts", name: "My Accounts", active: !1 }
362
+ ];
363
+ function be({
364
+ isOpen: e,
365
+ pages: t = X,
366
+ footerSlot: a
367
+ }) {
368
+ const [n, l] = m(() => [...t]);
369
+ return /* @__PURE__ */ c($.Provider, { value: { pages: n, setPages: l }, children: [
370
+ /* @__PURE__ */ c("div", { "data-shell": "page-management", "aria-hidden": !e, children: [
371
+ /* @__PURE__ */ o("h3", { children: "Manage pages" }),
372
+ /* @__PURE__ */ o("div", { className: "pm-list", role: "list", children: n.map((r) => /* @__PURE__ */ o(W, { page: r }, r.id)) })
373
+ ] }),
374
+ a
375
+ ] });
376
+ }
377
+ const ye = {
378
+ SETTINGS: "settings",
379
+ CATALOG_ADD: "catalog-add",
380
+ CATALOG_REPLACE: "catalog-replace",
381
+ PAGE_MGMT: "page-management",
382
+ NOTIFICATION_CENTER: "notification-center"
383
+ }, Z = {
29
384
  position: "fixed",
30
385
  inset: 0,
31
386
  pointerEvents: "none",
32
387
  zIndex: 55
33
- }, D = {
388
+ }, ee = {
34
389
  position: "absolute",
35
390
  inset: 0,
36
391
  zIndex: 1,
@@ -39,259 +394,308 @@ const z = {
39
394
  pointerEvents: "none",
40
395
  background: "rgba(0, 0, 0, 0.04)"
41
396
  };
42
- function G() {
43
- const { state: e, dispatch: n, getCloseLog: t } = b();
44
- y(() => {
397
+ function Pe() {
398
+ const { state: e, dispatch: t, getCloseLog: a } = K();
399
+ N(() => {
45
400
  if (e.activePanelId == null) return;
46
- function o(i) {
47
- i.key === "Escape" && n({ type: "CLOSE_PANEL", reason: "escape-key" });
401
+ function r(s) {
402
+ s.key === "Escape" && t({ type: "CLOSE_PANEL", reason: "escape-key" });
48
403
  }
49
- return document.addEventListener("keydown", o), () => document.removeEventListener("keydown", o);
50
- }, [e.activePanelId, n]);
51
- const r = L(e);
52
- C(() => {
53
- r.current = e;
54
- }), y(() => {
404
+ return document.addEventListener("keydown", r), () => document.removeEventListener("keydown", r);
405
+ }, [e.activePanelId, t]);
406
+ const n = O(e);
407
+ q(() => {
408
+ n.current = e;
409
+ }), N(() => {
55
410
  if (process.env.NODE_ENV === "production") return;
56
- const o = window;
57
- return o.__panelsHostHandle && console.warn("[panels] multiple PanelHost/PanelHostShell instances mounted; dev handle is unreliable"), o.__panelsHostHandle = {
58
- dispatch: n,
59
- getState: () => r.current,
60
- getCloseLog: t
411
+ const r = window;
412
+ return r.__panelsHostHandle && console.warn("[panels] multiple PanelHost/PanelHostShell instances mounted; dev handle is unreliable"), r.__panelsHostHandle = {
413
+ dispatch: t,
414
+ getState: () => n.current,
415
+ getCloseLog: a
61
416
  }, () => {
62
- o.__panelsHostHandle?.dispatch === n && delete window.__panelsHostHandle;
417
+ r.__panelsHostHandle?.dispatch === t && delete window.__panelsHostHandle;
63
418
  };
64
- }, [n, t]);
65
- const s = v(() => {
66
- n({ type: "CLOSE_PANEL", reason: "nav-escape-hatch" });
67
- }, [n]);
68
- return /* @__PURE__ */ a("div", { "data-panel-host": "true", style: z, children: e.activePanelId != null && /* @__PURE__ */ a(
419
+ }, [t, a]);
420
+ const l = T(() => {
421
+ t({ type: "CLOSE_PANEL", reason: "nav-escape-hatch" });
422
+ }, [t]);
423
+ return /* @__PURE__ */ o("div", { "data-panel-host": "true", style: Z, children: e.activePanelId != null && /* @__PURE__ */ o(
69
424
  "div",
70
425
  {
71
426
  "data-panel-scrim": "true",
72
- style: D,
73
- onClick: s
427
+ style: ee,
428
+ onClick: l
74
429
  }
75
430
  ) });
76
431
  }
77
- function Q({ panelComponents: e }) {
78
- const n = h();
79
- if (n == null) return null;
80
- const { state: t, dispatch: r } = n;
81
- if (t.activePanelId == null) return null;
82
- const s = e[t.activePanelId];
83
- if (s == null)
432
+ function Se({ panelComponents: e }) {
433
+ const t = C();
434
+ if (t == null) return null;
435
+ const { state: a, dispatch: n } = t;
436
+ if (a.activePanelId == null) return null;
437
+ const l = e[a.activePanelId];
438
+ if (l == null)
84
439
  return process.env.NODE_ENV !== "production" && console.error(
85
440
  "[panels] No panel component registered for activePanelId:",
86
- t.activePanelId
441
+ a.activePanelId
87
442
  ), null;
88
- const o = t.activePanelId === "settings" ? /* @__PURE__ */ m(I, { children: [
89
- /* @__PURE__ */ a(
90
- "button",
443
+ if (a.activePanelId === "settings")
444
+ return /* @__PURE__ */ o(g, { isOpen: !0, children: /* @__PURE__ */ o(
445
+ b,
91
446
  {
92
- id: "settings-cancel",
93
- type: "button",
94
- className: "gloss-panel-chrome__footer-btn",
95
- onClick: () => r({ type: "CLOSE_PANEL", reason: "cancel-button" }),
96
- children: "Cancel"
447
+ isOpen: !0,
448
+ onClose: () => n({ type: "CLOSE_PANEL", reason: "header-x" }),
449
+ footer: /* @__PURE__ */ c(j, { children: [
450
+ /* @__PURE__ */ o(
451
+ "button",
452
+ {
453
+ id: "settings-cancel",
454
+ type: "button",
455
+ className: "gloss-panel-chrome__footer-btn",
456
+ onClick: () => n({ type: "CLOSE_PANEL", reason: "cancel-button" }),
457
+ children: "Cancel"
458
+ }
459
+ ),
460
+ /* @__PURE__ */ o(
461
+ "button",
462
+ {
463
+ id: "settings-apply",
464
+ type: "button",
465
+ className: "gloss-panel-chrome__footer-btn gloss-panel-chrome__footer-btn--primary",
466
+ onClick: () => n({ type: "CLOSE_PANEL", reason: "apply-button" }),
467
+ children: "Apply"
468
+ }
469
+ )
470
+ ] }),
471
+ children: /* @__PURE__ */ o(l, { isOpen: !0 })
97
472
  }
98
- ),
99
- /* @__PURE__ */ a(
100
- "button",
473
+ ) });
474
+ if (a.activePanelId === "catalog-add" || a.activePanelId === "catalog-replace") {
475
+ const r = a.activePanelId === "catalog-replace" ? "replace" : "add";
476
+ return /* @__PURE__ */ o(g, { isOpen: !0, children: /* @__PURE__ */ o(
477
+ b,
101
478
  {
102
- id: "settings-apply",
103
- type: "button",
104
- className: "gloss-panel-chrome__footer-btn gloss-panel-chrome__footer-btn--primary",
105
- onClick: () => r({ type: "CLOSE_PANEL", reason: "apply-button" }),
106
- children: "Apply"
479
+ isOpen: !0,
480
+ onClose: () => n({ type: "CLOSE_PANEL", reason: "header-x" }),
481
+ footer: null,
482
+ children: /* @__PURE__ */ o(
483
+ l,
484
+ {
485
+ isOpen: !0,
486
+ footerSlot: /* @__PURE__ */ o(V, { mode: r, dispatch: n })
487
+ }
488
+ )
107
489
  }
108
- )
109
- ] }) : null;
110
- return /* @__PURE__ */ a(N, { isOpen: !0, children: /* @__PURE__ */ a(
111
- A,
490
+ ) });
491
+ }
492
+ return a.activePanelId === "page-management" ? /* @__PURE__ */ o(g, { isOpen: !0, children: /* @__PURE__ */ o(
493
+ b,
494
+ {
495
+ isOpen: !0,
496
+ onClose: () => n({ type: "CLOSE_PANEL", reason: "header-x" }),
497
+ footer: null,
498
+ children: /* @__PURE__ */ o(l, { isOpen: !0, footerSlot: /* @__PURE__ */ o(J, {}) })
499
+ }
500
+ ) }) : /* @__PURE__ */ o(g, { isOpen: !0, children: /* @__PURE__ */ o(
501
+ b,
112
502
  {
113
503
  isOpen: !0,
114
- onClose: () => r({ type: "CLOSE_PANEL", reason: "header-x" }),
115
- footer: o,
116
- children: /* @__PURE__ */ a(s, { isOpen: !0 })
504
+ onClose: () => n({ type: "CLOSE_PANEL", reason: "header-x" }),
505
+ footer: null,
506
+ children: /* @__PURE__ */ o(l, { isOpen: !0 })
117
507
  }
118
508
  ) });
119
509
  }
120
- function P(e) {
510
+ function w(e) {
121
511
  return e === null ? null : e.kind === "manage-pages-action" ? `global-${e.align ?? "left"}` : e.kind === "card-overflow" || e.kind === "empty-cell" ? `section-${e.sectionIndex}` : null;
122
512
  }
123
- const T = 685, g = 627, k = "cubic-bezier(0.22, 1, 0.36, 1)", H = 200;
124
- function w(e, n) {
125
- if (typeof window > "u") return n;
126
- const t = window.getComputedStyle(document.documentElement).getPropertyValue(e).trim();
127
- if (!t) return n;
128
- const r = parseFloat(t);
129
- return Number.isNaN(r) ? n : t.endsWith("s") && !t.endsWith("ms") ? r * 1e3 : r;
513
+ const te = 685, A = 627, ne = "cubic-bezier(0.22, 1, 0.36, 1)", ae = 200;
514
+ function F(e, t) {
515
+ if (typeof window > "u") return t;
516
+ const a = window.getComputedStyle(document.documentElement).getPropertyValue(e).trim();
517
+ if (!a) return t;
518
+ const n = parseFloat(a);
519
+ return Number.isNaN(n) ? t : a.endsWith("s") && !a.endsWith("ms") ? n * 1e3 : n;
130
520
  }
131
- function M(e, n) {
132
- return typeof window > "u" ? n : window.getComputedStyle(document.documentElement).getPropertyValue(e).trim() || n;
521
+ function oe(e, t) {
522
+ return typeof window > "u" ? t : window.getComputedStyle(document.documentElement).getPropertyValue(e).trim() || t;
133
523
  }
134
- function d(e) {
524
+ function y(e) {
135
525
  e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger });
136
526
  }
137
- function R(e) {
138
- const { mountEl: n, chromeEl: t, reducedMotion: r, onAssert: s } = e;
139
- if (n == null || t == null) {
140
- d(e), s?.({ branch: "slide-fallback-no-dom", timestamp: Date.now() });
527
+ function re(e) {
528
+ const { mountEl: t, chromeEl: a, reducedMotion: n, onAssert: l } = e;
529
+ if (t == null || a == null) {
530
+ y(e), l?.({ branch: "slide-fallback-no-dom", timestamp: Date.now() });
141
531
  return;
142
532
  }
143
- if (r) {
144
- e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), s?.({ branch: "slide-reduced-motion", timestamp: Date.now() });
533
+ if (n) {
534
+ e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), l?.({ branch: "slide-reduced-motion", timestamp: Date.now() });
145
535
  return;
146
536
  }
147
- if (typeof t.animate != "function") {
148
- d(e), s?.({ branch: "slide-no-waapi", timestamp: Date.now() });
537
+ if (typeof a.animate != "function") {
538
+ y(e), l?.({ branch: "slide-no-waapi", timestamp: Date.now() });
149
539
  return;
150
540
  }
151
- const o = t.cloneNode(!0);
152
- o.id = "panel-chrome-frozen", o.style.cssText = "position:absolute;left:8px;right:8px;top:8px;z-index:1;pointer-events:none;", n.appendChild(o), t.style.zIndex = "2", e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger });
153
- const i = w("--panel-open-dur", T), l = M("--panel-easing", k), c = t.animate(
541
+ const r = a.cloneNode(!0);
542
+ r.id = "panel-chrome-frozen", r.style.cssText = "position:absolute;left:8px;right:8px;top:8px;z-index:1;pointer-events:none;", t.appendChild(r), a.style.zIndex = "2", e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger });
543
+ const s = F("--panel-open-dur", te), i = oe("--panel-easing", ne), d = a.animate(
154
544
  [{ transform: "translateY(100%)" }, { transform: "translateY(0)" }],
155
- { duration: i, easing: l, fill: "forwards" }
545
+ { duration: s, easing: i, fill: "forwards" }
156
546
  );
157
- c.addEventListener(
547
+ d.addEventListener(
158
548
  "finish",
159
549
  () => {
160
- o.remove(), t.style.zIndex = "", c.cancel(), s?.({ branch: "slide-complete", frozen: "cleaned", timestamp: Date.now() });
550
+ r.remove(), a.style.zIndex = "", d.cancel(), l?.({ branch: "slide-complete", frozen: "cleaned", timestamp: Date.now() });
161
551
  },
162
552
  { once: !0 }
163
553
  );
164
554
  }
165
- function F(e) {
166
- const { mountEl: n, onAssert: t } = e;
167
- if (n == null) {
168
- e.dispatch({ type: "CLOSE_PANEL", reason: "mutex-handoff" }), setTimeout(() => d(e), g), t?.({ branch: "handoff-fallback-no-mount", timestamp: Date.now() });
555
+ function le(e) {
556
+ const { mountEl: t, onAssert: a } = e;
557
+ if (t == null) {
558
+ e.dispatch({ type: "CLOSE_PANEL", reason: "mutex-handoff" }), setTimeout(() => y(e), A), a?.({ branch: "handoff-fallback-no-mount", timestamp: Date.now() });
169
559
  return;
170
560
  }
171
- const r = w("--panel-close-dur", g);
172
- let s = !1, o = null;
173
- const i = (c) => {
174
- c.target !== n || c.propertyName !== "max-height" || s || (s = !0, o != null && clearTimeout(o), n.removeEventListener("transitionend", i), e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), t?.({ branch: "handoff-complete", timestamp: Date.now() }));
175
- }, l = () => {
176
- s || (s = !0, n.removeEventListener("transitionend", i), e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), t?.({ branch: "handoff-forced", timestamp: Date.now() }));
561
+ const n = F("--panel-close-dur", A);
562
+ let l = !1, r = null;
563
+ const s = (d) => {
564
+ d.target !== t || d.propertyName !== "max-height" || l || (l = !0, r != null && clearTimeout(r), t.removeEventListener("transitionend", s), e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), a?.({ branch: "handoff-complete", timestamp: Date.now() }));
565
+ }, i = () => {
566
+ l || (l = !0, t.removeEventListener("transitionend", s), e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), a?.({ branch: "handoff-forced", timestamp: Date.now() }));
177
567
  };
178
- n.addEventListener("transitionend", i), e.dispatch({ type: "CLOSE_PANEL", reason: "mutex-handoff" }), o = setTimeout(l, r + H);
568
+ t.addEventListener("transitionend", s), e.dispatch({ type: "CLOSE_PANEL", reason: "mutex-handoff" }), r = setTimeout(i, n + ae);
179
569
  }
180
- function $(e) {
181
- const { state: n, onAssert: t } = e;
182
- if (n.activePanelId && n.isDirty) {
183
- e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), t?.({ branch: "blocked-dirty", timestamp: Date.now() });
570
+ function se(e) {
571
+ const { state: t, onAssert: a } = e;
572
+ if (t.activePanelId && t.isDirty) {
573
+ e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), a?.({ branch: "blocked-dirty", timestamp: Date.now() });
184
574
  return;
185
575
  }
186
- const r = P(n.activeTrigger), s = P(e.trigger);
187
- if (!!n.activePanelId && r != null && r === s) {
188
- R(e);
576
+ const n = w(t.activeTrigger), l = w(e.trigger);
577
+ if (!!t.activePanelId && n != null && n === l) {
578
+ re(e);
189
579
  return;
190
580
  }
191
- if (n.activePanelId) {
192
- F(e);
581
+ if (t.activePanelId) {
582
+ le(e);
193
583
  return;
194
584
  }
195
- d(e), t?.({ branch: "fresh-open", timestamp: Date.now() });
585
+ y(e), a?.({ branch: "fresh-open", timestamp: Date.now() });
196
586
  }
197
- function q() {
587
+ function ie() {
198
588
  if (!(typeof window > "u"))
199
589
  return window.__panelsAsserter;
200
590
  }
201
- function J() {
202
- const e = h(), n = S();
203
- return v(
204
- (t, r) => {
591
+ function Ce() {
592
+ const e = C(), t = L();
593
+ return T(
594
+ (a, n) => {
205
595
  if (!e)
206
596
  return;
207
- const s = typeof document < "u" ? document.querySelector('[data-mount="panel"]') : null, o = typeof document < "u" ? document.querySelector('[data-chrome="panel"]') : null, i = {
208
- panelId: t,
209
- trigger: r,
597
+ const l = typeof document < "u" ? document.querySelector('[data-mount="panel"]') : null, r = typeof document < "u" ? document.querySelector('[data-chrome="panel"]') : null, s = {
598
+ panelId: a,
599
+ trigger: n,
210
600
  state: e.state,
211
601
  dispatch: e.dispatch,
212
- mountEl: s,
213
- chromeEl: o,
214
- reducedMotion: n,
215
- onAssert: (l) => {
216
- q()?.recordTransition?.(l);
602
+ mountEl: l,
603
+ chromeEl: r,
604
+ reducedMotion: t,
605
+ onAssert: (i) => {
606
+ ie()?.recordTransition?.(i);
217
607
  }
218
608
  };
219
- $(i);
609
+ se(s);
220
610
  },
221
- [e, n]
611
+ [e, t]
222
612
  );
223
613
  }
224
- let u = !1, f = null;
225
- function E() {
614
+ let P = !1, S = null;
615
+ function _() {
226
616
  const e = [];
227
- let n = "cleaned";
228
- document.querySelectorAll("#panel-chrome-frozen").length > 0 && (e.push("#panel-chrome-frozen"), n = "lingering");
229
- const r = document.querySelectorAll(".gloss-panel-mount");
230
- r.length > 1 && e.push(`mount-count=${r.length}`);
231
- const s = r[0] ?? null, o = s ? s.querySelectorAll(".gloss-panel-chrome") : [];
232
- o.length > 1 && e.push(`chrome-count=${o.length}`);
233
- const i = o[0] ?? null;
234
- if (i) {
235
- const p = i.style.zIndex;
617
+ let t = "cleaned";
618
+ document.querySelectorAll("#panel-chrome-frozen").length > 0 && (e.push("#panel-chrome-frozen"), t = "lingering");
619
+ const n = document.querySelectorAll(".gloss-panel-mount");
620
+ n.length > 1 && e.push(`mount-count=${n.length}`);
621
+ const l = n[0] ?? null, r = l ? l.querySelectorAll(".gloss-panel-chrome") : [];
622
+ r.length > 1 && e.push(`chrome-count=${r.length}`);
623
+ const s = r[0] ?? null;
624
+ if (s) {
625
+ const p = s.style.zIndex;
236
626
  p !== "" && p !== "2" && e.push(`chrome-zindex=${p}`);
237
627
  }
238
- const l = s ? "present" : "absent", c = i ? "present" : "absent";
628
+ const i = l ? "present" : "absent", d = s ? "present" : "absent";
239
629
  return {
240
630
  valid: e.length === 0,
241
- mount: l,
242
- chrome: c,
243
- frozen: n,
631
+ mount: i,
632
+ chrome: d,
633
+ frozen: t,
244
634
  orphans: e,
245
635
  timestamp: Date.now()
246
636
  };
247
637
  }
248
- function U() {
638
+ function ce() {
249
639
  return {
250
- enable: V,
251
- disable: j,
252
- isEnabled: () => u,
253
- getLastReport: () => f,
640
+ enable: de,
641
+ disable: ue,
642
+ isEnabled: () => P,
643
+ getLastReport: () => S,
254
644
  recordTransition: (e) => {
255
- u && (f = { ...e, ...E() });
645
+ P && (S = { ...e, ..._() });
256
646
  },
257
647
  assertOnce: () => {
258
- const e = E();
259
- return f = e, e;
648
+ const e = _();
649
+ return S = e, e;
260
650
  }
261
651
  };
262
652
  }
263
- function V() {
264
- if (u = !0, typeof window > "u") return;
653
+ function de() {
654
+ if (P = !0, typeof window > "u") return;
265
655
  const e = window;
266
- e.__panelsAsserter || (e.__panelsAsserter = U(), console.info(
656
+ e.__panelsAsserter || (e.__panelsAsserter = ce(), console.info(
267
657
  "[panels] Q12-12 asserter enabled. Inspect via window.__panelsAsserter.getLastReport()."
268
658
  ));
269
659
  }
270
- function j() {
271
- u = !1;
660
+ function ue() {
661
+ P = !1;
272
662
  }
273
663
  export {
274
- ee as COMMITS,
275
- O as CloneCard,
276
- x as CloneStage,
277
- A as PanelChrome,
278
- ne as PanelHost,
279
- G as PanelHostShell,
280
- N as PanelMount,
281
- te as PanelProvider,
282
- Q as PanelSlot,
283
- K as SettingsShell,
284
- E as assertPanelDomShape,
285
- oe as deriveSurfaceState,
286
- j as disablePanelAsserter,
287
- V as enablePanelAsserter,
288
- re as initialState,
289
- P as positionKey,
290
- se as reducer,
291
- $ as transitionToPanel,
292
- b as usePanelContext,
293
- h as usePanelContextOptional,
294
- ie as usePanelCoordinator,
295
- S as useReducedMotionPanel,
296
- J as useTransitionToPanel
664
+ we as COMMITS,
665
+ ve as CatalogAddShell,
666
+ V as CatalogFooter,
667
+ ge as CatalogReplaceShell,
668
+ E as CatalogStateContext,
669
+ G as CloneCard,
670
+ B as CloneStage,
671
+ k as MOCK_DEFAULT_LENS,
672
+ R as MOCK_LENSES,
673
+ X as MOCK_PAGES,
674
+ z as MOCK_TILES_BY_LENS,
675
+ ye as PANEL_IDS,
676
+ J as PageMgmtFooter,
677
+ be as PageMgmtShell,
678
+ $ as PageMgmtStateContext,
679
+ b as PanelChrome,
680
+ Ae as PanelHost,
681
+ Pe as PanelHostShell,
682
+ g as PanelMount,
683
+ _e as PanelProvider,
684
+ Se as PanelSlot,
685
+ he as SettingsShell,
686
+ _ as assertPanelDomShape,
687
+ Le as deriveSurfaceState,
688
+ ue as disablePanelAsserter,
689
+ de as enablePanelAsserter,
690
+ Oe as initialState,
691
+ w as positionKey,
692
+ xe as reducer,
693
+ se as transitionToPanel,
694
+ Y as useCatalogState,
695
+ Q as usePageMgmtState,
696
+ K as usePanelContext,
697
+ C as usePanelContextOptional,
698
+ Ie as usePanelCoordinator,
699
+ L as useReducedMotionPanel,
700
+ Ce as useTransitionToPanel
297
701
  };