@mt-gloss/ui 0.1.113 → 0.1.114

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.
@@ -83,20 +83,20 @@ function B({
83
83
  );
84
84
  }
85
85
  B.displayName = "SettingsTabStrip";
86
- const v = T(null);
86
+ const m = T(null);
87
87
  function k() {
88
- const e = y(v);
88
+ const e = y(m);
89
89
  if (!e)
90
90
  throw new Error(
91
91
  "[panels] usePanelContext must be used inside <PanelProvider>. See @mt-gloss/ui/composites/panels."
92
92
  );
93
93
  return e;
94
94
  }
95
- function ie() {
96
- return y(v);
95
+ function oe() {
96
+ return y(m);
97
97
  }
98
- const M = f.number().min(0).max(100), U = f.number().min(7).max(90), V = f.enum(["#1d6fd8", "#10b981", "#f59e0b", "#ef4444", "#8b5cf6"]), K = f.array(f.string().min(1)).max(3);
99
- function j(e, n) {
98
+ const M = f.number().min(0).max(100), U = f.number().min(7).max(90), V = f.enum(["#1d6fd8", "#10b981", "#f59e0b", "#ef4444", "#8b5cf6"]), K = f.array(f.string().min(1)).max(3), j = f.boolean();
99
+ function q(e, n) {
100
100
  if (e === "threshold") {
101
101
  const t = M.safeParse(n);
102
102
  return t.success ? t.data : 80;
@@ -113,9 +113,13 @@ function j(e, n) {
113
113
  const t = K.safeParse(n);
114
114
  return t.success ? t.data : [];
115
115
  }
116
+ if (e === "thresholdEnabled" || e === "accentEnabled") {
117
+ const t = j.safeParse(n);
118
+ return t.success ? t.data : !1;
119
+ }
116
120
  return n;
117
121
  }
118
- const q = {
122
+ const z = {
119
123
  activePanelId: null,
120
124
  activeTrigger: null,
121
125
  bellCutoutOpen: !1,
@@ -125,8 +129,8 @@ const q = {
125
129
  bufferByCard: {},
126
130
  lastClose: null,
127
131
  pendingSideEffects: []
128
- }, m = /* @__PURE__ */ new Set(["settings"]);
129
- function z(e, n) {
132
+ }, v = /* @__PURE__ */ new Set(["settings"]);
133
+ function Y(e, n) {
130
134
  if (e == null || e.kind !== n.kind) return !1;
131
135
  switch (e.kind) {
132
136
  case "bell":
@@ -141,7 +145,7 @@ function z(e, n) {
141
145
  return e.action === n.action && e.blockedCardId === n.blockedCardId && e.activeCardId === n.activeCardId;
142
146
  }
143
147
  }
144
- function Y(e, n) {
148
+ function $(e, n) {
145
149
  switch (n.type) {
146
150
  case "OPEN_PANEL": {
147
151
  if (e.activePanelId && e.isDirty)
@@ -159,7 +163,7 @@ function Y(e, n) {
159
163
  }
160
164
  ]
161
165
  };
162
- if (e.activePanelId === n.panelId && z(e.activeTrigger, n.trigger))
166
+ if (e.activePanelId === n.panelId && Y(e.activeTrigger, n.trigger))
163
167
  return e;
164
168
  const t = e.activePanelId != null ? [
165
169
  {
@@ -221,7 +225,7 @@ function Y(e, n) {
221
225
  case "CLOSE_BELL_CUTOUT":
222
226
  return e.bellCutoutOpen ? { ...e, bellCutoutOpen: !1 } : e;
223
227
  case "SET_BUFFER_VALUE": {
224
- if (e.activePanelId == null || !m.has(e.activePanelId))
228
+ if (e.activePanelId == null || !v.has(e.activePanelId))
225
229
  return {
226
230
  ...e,
227
231
  pendingSideEffects: [
@@ -229,7 +233,7 @@ function Y(e, n) {
229
233
  { type: "INVALID_DISPATCH", reason: "no-buffer-panel" }
230
234
  ]
231
235
  };
232
- const t = e.bufferByCard[n.cardId], r = t == null, l = j(n.key, n.value);
236
+ const t = e.bufferByCard[n.cardId], r = t == null, l = q(n.key, n.value);
233
237
  if (!r && t.changes[n.key] === l)
234
238
  return e;
235
239
  const s = { kind: "settings", changes: {
@@ -267,7 +271,7 @@ function Y(e, n) {
267
271
  };
268
272
  }
269
273
  case "BUFFER_BECOMES_DIRTY":
270
- return e.activePanelId == null || !m.has(e.activePanelId) ? {
274
+ return e.activePanelId == null || !v.has(e.activePanelId) ? {
271
275
  ...e,
272
276
  pendingSideEffects: [
273
277
  ...e.pendingSideEffects,
@@ -303,11 +307,11 @@ function Y(e, n) {
303
307
  return e;
304
308
  }
305
309
  }
306
- function $(e) {
310
+ function Q(e) {
307
311
  return e.activePanelId === "notification-center" ? "notif-center" : e.activePanelId != null && e.bellCutoutOpen ? e.isDirty ? "panel-dirty+cutout" : "panel-clean+cutout" : e.activePanelId != null ? e.isDirty ? "panel-dirty" : "panel-clean" : e.bellCutoutOpen ? "bell-cutout-only" : "idle";
308
312
  }
309
- function Q() {
310
- const [e, n] = N(Y, q), t = C([]), r = C(null);
313
+ function W() {
314
+ const [e, n] = N($, z), t = C([]), r = C(null);
311
315
  d(() => () => {
312
316
  r.current != null && (window.clearTimeout(r.current), r.current = null);
313
317
  }, []), d(() => {
@@ -341,25 +345,25 @@ function Q() {
341
345
  ];
342
346
  }, [e.lastClose]);
343
347
  const l = S(
344
- () => $(e),
348
+ () => Q(e),
345
349
  [e.activePanelId, e.bellCutoutOpen, e.isDirty]
346
350
  ), a = I(() => t.current.slice(), []);
347
351
  return { state: e, surfaceState: l, dispatch: n, getCloseLog: a };
348
352
  }
349
- function oe({ children: e }) {
350
- const n = Q(), t = S(
353
+ function ae({ children: e }) {
354
+ const n = W(), t = S(
351
355
  () => n,
352
356
  // Re-publish only when one of the four coordinator fields changes identity.
353
357
  // dispatch + getCloseLog are stable. state + surfaceState change on dispatch.
354
358
  [n.state, n.surfaceState, n.dispatch, n.getCloseLog]
355
359
  );
356
- return /* @__PURE__ */ c(v.Provider, { value: t, children: e });
360
+ return /* @__PURE__ */ c(m.Provider, { value: t, children: e });
357
361
  }
358
- const W = {
362
+ const G = {
359
363
  position: "relative",
360
364
  pointerEvents: "auto"
361
365
  };
362
- function G({ children: e, onClose: n, footer: t, title: r, variant: l = "default" }) {
366
+ function J({ children: e, onClose: n, footer: t, title: r, variant: l = "default" }) {
363
367
  return /* @__PURE__ */ E(
364
368
  "div",
365
369
  {
@@ -368,7 +372,7 @@ function G({ children: e, onClose: n, footer: t, title: r, variant: l = "default
368
372
  role: "dialog",
369
373
  "aria-modal": "true",
370
374
  className: l === "merged-stage" ? "gloss-panel-chrome gloss-panel-chrome--merged-stage" : "gloss-panel-chrome",
371
- style: W,
375
+ style: G,
372
376
  children: [
373
377
  /* @__PURE__ */ E("div", { className: "gloss-panel-chrome__header", children: [
374
378
  r != null && /* @__PURE__ */ c("span", { className: "gloss-panel-chrome__title", children: r }),
@@ -390,7 +394,7 @@ function G({ children: e, onClose: n, footer: t, title: r, variant: l = "default
390
394
  }
391
395
  );
392
396
  }
393
- function J(e) {
397
+ function X(e) {
394
398
  if (process.env.NODE_ENV === "production" || !e || !e.parentElement) return;
395
399
  const n = e.parentElement, t = window.getComputedStyle(n);
396
400
  t.perspective === "none" && console.warn(
@@ -401,10 +405,10 @@ function J(e) {
401
405
  n
402
406
  );
403
407
  }
404
- function X({ isOpen: e, children: n }) {
408
+ function Z({ isOpen: e, children: n }) {
405
409
  const t = P(), r = C(null);
406
410
  _(() => {
407
- J(r.current);
411
+ X(r.current);
408
412
  }, []);
409
413
  const [l, a] = w(!1);
410
414
  d(() => {
@@ -431,7 +435,7 @@ function X({ isOpen: e, children: n }) {
431
435
  }
432
436
  );
433
437
  }
434
- const Z = {
438
+ const ee = {
435
439
  position: "fixed",
436
440
  top: 0,
437
441
  left: 0,
@@ -442,7 +446,7 @@ const Z = {
442
446
  overflow: "visible",
443
447
  pointerEvents: "none",
444
448
  zIndex: 55
445
- }, ee = {
449
+ }, ne = {
446
450
  position: "fixed",
447
451
  top: "var(--tb-h, 60px)",
448
452
  left: 0,
@@ -458,7 +462,7 @@ const Z = {
458
462
  pointerEvents: "none",
459
463
  background: "rgba(0, 0, 0, 0.04)"
460
464
  };
461
- function ae({ panelComponents: e }) {
465
+ function se({ panelComponents: e }) {
462
466
  const { state: n, dispatch: t, getCloseLog: r } = k(), l = n.activePanelId ? e[n.activePanelId] : null;
463
467
  n.activePanelId && !l && process.env.NODE_ENV !== "production" && console.error(
464
468
  "[panels] No panel component registered for activePanelId:",
@@ -489,17 +493,17 @@ function ae({ panelComponents: e }) {
489
493
  const s = I(() => {
490
494
  t({ type: "CLOSE_PANEL", reason: "nav-escape-hatch" });
491
495
  }, [t]), i = n.activePanelId != null && l != null;
492
- return /* @__PURE__ */ E("div", { "data-panel-host": "true", style: Z, children: [
496
+ return /* @__PURE__ */ E("div", { "data-panel-host": "true", style: ee, children: [
493
497
  i && /* @__PURE__ */ c(
494
498
  "div",
495
499
  {
496
500
  "data-panel-scrim": "true",
497
- style: ee,
501
+ style: ne,
498
502
  onClick: s
499
503
  }
500
504
  ),
501
- /* @__PURE__ */ c(X, { isOpen: i, children: i && /* @__PURE__ */ c(
502
- G,
505
+ /* @__PURE__ */ c(Z, { isOpen: i, children: i && /* @__PURE__ */ c(
506
+ J,
503
507
  {
504
508
  isOpen: !0,
505
509
  onClose: () => t({ type: "CLOSE_PANEL", reason: "header-x" }),
@@ -508,7 +512,7 @@ function ae({ panelComponents: e }) {
508
512
  ) })
509
513
  ] });
510
514
  }
511
- const se = {
515
+ const ce = {
512
516
  "apply-button": !0,
513
517
  // the ONLY commit reason
514
518
  "cancel-button": !1,
@@ -522,17 +526,17 @@ const se = {
522
526
  "nav-escape-hatch": !1
523
527
  };
524
528
  export {
525
- se as C,
526
- oe as P,
529
+ ce as C,
530
+ ae as P,
527
531
  B as S,
528
532
  k as a,
529
- ae as b,
530
- G as c,
531
- Q as d,
532
- $ as e,
533
+ se as b,
534
+ J as c,
535
+ W as d,
536
+ Q as e,
533
537
  P as f,
534
- X as g,
535
- q as i,
536
- Y as r,
537
- ie as u
538
+ Z as g,
539
+ z as i,
540
+ $ as r,
541
+ oe as u
538
542
  };