@mt-gloss/ui 0.1.150 → 0.1.152

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.
@@ -1,14 +1,9 @@
1
+ import "@mt-gloss/motion";
1
2
  import { jsx as s, jsxs as N } from "react/jsx-runtime";
2
3
  import { motion as se } from "framer-motion";
3
4
  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
5
  import { z as K } from "zod";
5
- const Xe = {
6
- forwardStaggerMs: 50,
7
- reverseStaggerMs: 30,
8
- springStiffness: 380,
9
- springDamping: 32,
10
- reverseVelocityMultiplier: 1.4
11
- }, Ge = {
6
+ const Ge = {
12
7
  enterDurationMs: 220,
13
8
  exitDurationMs: 140,
14
9
  enterEasing: "cubic-bezier(0.34, 1.56, 0.64, 1)",
@@ -207,18 +202,18 @@ function ye(e) {
207
202
  }
208
203
  let f = n.map((E) => ({ ...E, items: [...E.items] }));
209
204
  if (b === P) {
210
- const E = f.findIndex((D) => D.zoneKey === b), I = f[E], v = I.items.findIndex((D) => D.id === g.id), S = I.items.findIndex((D) => D.id === C.id), M = S >= 0 ? S : Math.max(0, I.items.length - 1);
205
+ const E = f.findIndex((D) => D.zoneKey === b), I = f[E], v = I.items.findIndex((D) => D.id === g.id), S = I.items.findIndex((D) => D.id === C.id), R = S >= 0 ? S : Math.max(0, I.items.length - 1);
211
206
  f[E] = {
212
207
  ...I,
213
- items: ve(I.items, v, M)
208
+ items: ve(I.items, v, R)
214
209
  };
215
210
  } else {
216
- const E = f.findIndex((h) => h.zoneKey === b), I = f.findIndex((h) => h.zoneKey === P), v = f[E], S = f[I], M = v.items.find((h) => h.id === g.id);
217
- if (!M) {
211
+ const E = f.findIndex((h) => h.zoneKey === b), I = f.findIndex((h) => h.zoneKey === P), v = f[E], S = f[I], R = v.items.find((h) => h.id === g.id);
212
+ if (!R) {
218
213
  y();
219
214
  return;
220
215
  }
221
- const D = v.items.filter((h) => h.id !== g.id), $ = S.items.findIndex((h) => h.id === C.id), oe = $ >= 0 ? $ : S.items.length;
216
+ const D = v.items.filter((h) => h.id !== g.id), V = S.items.findIndex((h) => h.id === C.id), oe = V >= 0 ? V : S.items.length;
222
217
  let j = D, x = [...S.items];
223
218
  if (S.maxItems !== void 0 && x.length >= S.maxItems) {
224
219
  const h = x[x.length - 1];
@@ -226,7 +221,7 @@ function ye(e) {
226
221
  }
227
222
  const q = Math.min(oe, x.length), ie = [
228
223
  ...x.slice(0, q),
229
- M,
224
+ R,
230
225
  ...x.slice(q)
231
226
  ];
232
227
  f[E] = { ...v, items: j }, f[I] = { ...S, items: ie };
@@ -262,7 +257,7 @@ function ye(e) {
262
257
  handleDragEnd: k
263
258
  };
264
259
  }
265
- let L = null, R = null, Z = !1;
260
+ let L = null, M = null, Z = !1;
266
261
  const Ee = [
267
262
  "DndContext",
268
263
  "DragOverlay",
@@ -287,7 +282,7 @@ function Se(e, n) {
287
282
  return t.length === 0 ? { ok: !0 } : { ok: !1, missing: t };
288
283
  }
289
284
  function Ce() {
290
- return L ? Promise.resolve(L) : Z ? Promise.resolve(null) : R || (R = (async () => {
285
+ return L ? Promise.resolve(L) : Z ? Promise.resolve(null) : M || (M = (async () => {
291
286
  try {
292
287
  const [e, n, t] = await Promise.all([
293
288
  import("@dnd-kit/core"),
@@ -306,7 +301,7 @@ function Ce() {
306
301
  } catch {
307
302
  return Z = !0, null;
308
303
  }
309
- })(), R);
304
+ })(), M);
310
305
  }
311
306
  function be(e) {
312
307
  const { zones: n, onZoneChange: t, renderZone: r, renderItem: i, renderDragOverlay: a } = e, c = ye({ zones: n, onZoneChange: t }), [o, p] = B.useState(L);
@@ -400,9 +395,9 @@ function re({
400
395
  return /* @__PURE__ */ s("div", { ref: i, "data-zone-is-over": a || void 0, ...n, children: r });
401
396
  }
402
397
  re.displayName = "ZoneDroppable";
403
- const V = ae(null);
398
+ const $ = ae(null);
404
399
  function _e() {
405
- const e = W(V);
400
+ const e = W($);
406
401
  if (!e)
407
402
  throw new Error(
408
403
  "[panels] usePanelContext must be used inside <PanelProvider>. See @mt-gloss/ui/composites/panels."
@@ -410,7 +405,7 @@ function _e() {
410
405
  return e;
411
406
  }
412
407
  function Pe() {
413
- return W(V);
408
+ return W($);
414
409
  }
415
410
  const De = [
416
411
  "today",
@@ -624,7 +619,7 @@ function ke(e, n) {
624
619
  function Le(e) {
625
620
  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";
626
621
  }
627
- function Me() {
622
+ function Re() {
628
623
  const [e, n] = ce(ke, we), t = O([]), r = O(null);
629
624
  w(() => () => {
630
625
  r.current != null && (window.clearTimeout(r.current), r.current = null);
@@ -665,15 +660,15 @@ function Me() {
665
660
  return { state: e, surfaceState: i, dispatch: n, getCloseLog: a };
666
661
  }
667
662
  function sn({ children: e }) {
668
- const n = Me(), t = z(
663
+ const n = Re(), t = z(
669
664
  () => n,
670
665
  // Re-publish only when one of the four coordinator fields changes identity.
671
666
  // dispatch + getCloseLog are stable. state + surfaceState change on dispatch.
672
667
  [n.state, n.surfaceState, n.dispatch, n.getCloseLog]
673
668
  );
674
- return /* @__PURE__ */ s(V.Provider, { value: t, children: e });
669
+ return /* @__PURE__ */ s($.Provider, { value: t, children: e });
675
670
  }
676
- function Re({ title: e, onClose: n, titleId: t }) {
671
+ function Me({ title: e, onClose: n, titleId: t }) {
677
672
  return /* @__PURE__ */ N("div", { className: "gloss-panel-chrome-v2__header", children: [
678
673
  e != null && /* @__PURE__ */ s("span", { id: t, className: "gloss-panel-chrome-v2__title", children: e }),
679
674
  /* @__PURE__ */ s(
@@ -734,7 +729,7 @@ function Ze({
734
729
  "aria-label": u ? void 0 : "Panel",
735
730
  className: `gloss-panel-chrome-v2 gloss-panel-chrome-v2--${r}${o ? " gloss-panel-chrome-v2--headerless" : ""}`,
736
731
  children: [
737
- !o && /* @__PURE__ */ s(Re, { title: t, onClose: n, titleId: p }),
732
+ !o && /* @__PURE__ */ s(Me, { title: t, onClose: n, titleId: p }),
738
733
  r === "with-stage" && /* @__PURE__ */ s(Fe, { children: i }),
739
734
  a != null && /* @__PURE__ */ s(Ae, { children: a }),
740
735
  /* @__PURE__ */ s(He, { children: e }),
@@ -825,7 +820,7 @@ function ze(e) {
825
820
  n
826
821
  );
827
822
  }
828
- function Ve({ isOpen: e, children: n }) {
823
+ function $e({ isOpen: e, children: n }) {
829
824
  const t = ee(), r = O(null);
830
825
  G(() => {
831
826
  ze(r.current);
@@ -855,7 +850,7 @@ function Ve({ isOpen: e, children: n }) {
855
850
  }
856
851
  );
857
852
  }
858
- const $e = {
853
+ const Ve = {
859
854
  position: "fixed",
860
855
  top: 0,
861
856
  left: 0,
@@ -909,7 +904,7 @@ function an({ panelComponents: e }) {
909
904
  };
910
905
  }, [t, r]);
911
906
  const c = n.activePanelId != null && i != null;
912
- return /* @__PURE__ */ N("div", { "data-panel-host": "true", style: $e, children: [
907
+ return /* @__PURE__ */ N("div", { "data-panel-host": "true", style: Ve, children: [
913
908
  c && /* @__PURE__ */ s(
914
909
  "div",
915
910
  {
@@ -917,7 +912,7 @@ function an({ panelComponents: e }) {
917
912
  style: je
918
913
  }
919
914
  ),
920
- /* @__PURE__ */ s(Ve, { isOpen: c, children: c && /* @__PURE__ */ s(
915
+ /* @__PURE__ */ s($e, { isOpen: c, children: c && /* @__PURE__ */ s(
921
916
  Ue,
922
917
  {
923
918
  isOpen: !0,
@@ -951,27 +946,26 @@ export {
951
946
  sn as P,
952
947
  be as S,
953
948
  nn as a,
954
- rn as b,
955
- Xe as c,
956
- ye as d,
957
- _e as e,
958
- an as f,
949
+ ye as b,
950
+ rn as c,
951
+ _e as d,
952
+ an as e,
953
+ Re as f,
959
954
  on as g,
960
- Me as h,
961
- ke as i,
962
- we as j,
963
- Le as k,
964
- ge as l,
965
- ee as m,
966
- Ze as n,
967
- Ve as o,
955
+ ke as h,
956
+ we as i,
957
+ Le as j,
958
+ ge as k,
959
+ ee as l,
960
+ Ze as m,
961
+ $e as n,
962
+ Me as o,
968
963
  en as p,
969
- Re as q,
964
+ Fe as q,
970
965
  Je as r,
971
966
  Ge as s,
972
- Fe as t,
967
+ Ae as t,
973
968
  Pe as u,
974
- Ae as v,
975
- He as w,
976
- Be as x
969
+ He as v,
970
+ Be as w
977
971
  };