prometeo-design-system 4.1.0 → 4.1.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/dist/PyrionLayout.es.js +88 -88
- package/dist/TabLinks.d.ts +2 -0
- package/dist/exports/TabLinks.d.ts +1 -0
- package/package.json +1 -1
package/dist/PyrionLayout.es.js
CHANGED
|
@@ -6,9 +6,9 @@ import { createPortal as ze } from "react-dom";
|
|
|
6
6
|
import { useLocation as ht, useNavigate as bt } from "react-router";
|
|
7
7
|
import { B as xt, T as gt } from "./badge-CbqYNrl4.js";
|
|
8
8
|
import { c as A } from "./cn-B6yFEsav.js";
|
|
9
|
-
import { CloseNavBarDesktop as
|
|
9
|
+
import { CloseNavBarDesktop as vt } from "./Icons/CloseNavBarDesktop.es.js";
|
|
10
10
|
import { c as Te } from "./index-BOQuZ0gG.js";
|
|
11
|
-
import
|
|
11
|
+
import wt from "./PlainTooltip.es.js";
|
|
12
12
|
import { CrevronLeft as Nt } from "./Icons/CrevronLeft.es.js";
|
|
13
13
|
import { Scrollable as ye } from "./Scrollable.es.js";
|
|
14
14
|
import ee from "./TicketCard.es.js";
|
|
@@ -21,7 +21,7 @@ import { Close as Ie } from "./Icons/Close.es.js";
|
|
|
21
21
|
import { Help as Ke } from "./Icons/Help.es.js";
|
|
22
22
|
import { Settings as St } from "./Icons/Settings.es.js";
|
|
23
23
|
const Ye = T(Ne(({ children: t, className: r, context: s, modal: l = !1, closeOnOverlayClick: i = !1, unmountChildrenOnClose: n = !0 }, c) => {
|
|
24
|
-
const m = me(t, s), d = typeof window < "u" && window.matchMedia("(min-width: 768px)").matches, { isSidebarOpen: h } = kt(), { closeSidebar: b } = ie(), [
|
|
24
|
+
const m = me(t, s), d = typeof window < "u" && window.matchMedia("(min-width: 768px)").matches, { isSidebarOpen: h } = kt(), { closeSidebar: b } = ie(), [w, u] = Z(() => n ? h : !0), [N, y] = Z(!1);
|
|
25
25
|
return X(() => {
|
|
26
26
|
n && s?.subscribeToSidebarOpen((f) => {
|
|
27
27
|
f ? (y(!1), u(!0)) : y(!0);
|
|
@@ -46,7 +46,7 @@ const Ye = T(Ne(({ children: t, className: r, context: s, modal: l = !1, closeOn
|
|
|
46
46
|
),
|
|
47
47
|
/* @__PURE__ */ e.jsxs("div", { className: A("navigation-drawer-sidebar-inner"), children: [
|
|
48
48
|
/* @__PURE__ */ e.jsx("div", { className: "secure-click-margin" }),
|
|
49
|
-
|
|
49
|
+
w && m
|
|
50
50
|
] })
|
|
51
51
|
] });
|
|
52
52
|
})), Xe = Oe(null), Je = Oe(null), kt = () => {
|
|
@@ -72,7 +72,7 @@ const Ye = T(Ne(({ children: t, className: r, context: s, modal: l = !1, closeOn
|
|
|
72
72
|
} catch {
|
|
73
73
|
}
|
|
74
74
|
}, At = (t) => {
|
|
75
|
-
const { children: r, classNameDrawer: s, classNameSidebar: l, disableDragOpen: i } = t, n = I(null), c = I(null), m = t.outletRef ?? I(null), d = I(null), h = I(He()), b = I(!1),
|
|
75
|
+
const { children: r, classNameDrawer: s, classNameSidebar: l, disableDragOpen: i } = t, n = I(null), c = I(null), m = t.outletRef ?? I(null), d = I(null), h = I(He()), b = I(!1), w = I("drawer"), u = I(/* @__PURE__ */ new Set()), N = I(/* @__PURE__ */ new Set()), y = I(!1), f = I(null), F = x((o) => {
|
|
76
76
|
const p = c.current;
|
|
77
77
|
p && (p.classList.toggle("collapsed", o), p.classList.toggle("expanded", !o));
|
|
78
78
|
}, []), D = x((o) => {
|
|
@@ -98,8 +98,8 @@ const Ye = T(Ne(({ children: t, className: r, context: s, modal: l = !1, closeOn
|
|
|
98
98
|
[D]
|
|
99
99
|
), k = x(
|
|
100
100
|
(o, { notify: p = !0 } = {}) => {
|
|
101
|
-
const g =
|
|
102
|
-
|
|
101
|
+
const g = w.current, O = g !== o;
|
|
102
|
+
w.current = o, window.matchMedia("(min-width: 768px)").matches || P(o !== "drawer", { notify: p });
|
|
103
103
|
const B = g === "sidebar", _ = o === "sidebar";
|
|
104
104
|
p && O && B !== _ && N.current.forEach((Q) => Q(_)), R(o !== "sidebar", { notify: p }), P(o !== "drawer", { notify: p });
|
|
105
105
|
},
|
|
@@ -153,8 +153,8 @@ const Ye = T(Ne(({ children: t, className: r, context: s, modal: l = !1, closeOn
|
|
|
153
153
|
const _ = (S) => {
|
|
154
154
|
O = S.touches[0].clientX, B = S.touches[0].clientY;
|
|
155
155
|
}, Q = (S, U) => {
|
|
156
|
-
const a = window.getComputedStyle(S),
|
|
157
|
-
return /(auto|scroll|overlay)/.test(
|
|
156
|
+
const a = window.getComputedStyle(S), v = U === "x" ? a.overflowX : a.overflowY;
|
|
157
|
+
return /(auto|scroll|overlay)/.test(v) ? U === "x" ? S.scrollWidth > S.clientWidth : S.scrollHeight > S.clientHeight : !1;
|
|
158
158
|
}, $ = (S, U) => {
|
|
159
159
|
let a = S;
|
|
160
160
|
for (; a && a !== o; ) {
|
|
@@ -165,13 +165,13 @@ const Ye = T(Ne(({ children: t, className: r, context: s, modal: l = !1, closeOn
|
|
|
165
165
|
return null;
|
|
166
166
|
}, le = (S, U, a) => a === 0 ? !1 : U === "x" ? a < 0 ? S.scrollLeft + S.clientWidth < S.scrollWidth : S.scrollLeft > 0 : a < 0 ? S.scrollTop + S.clientHeight < S.scrollHeight : S.scrollTop > 0, he = (S) => {
|
|
167
167
|
if (!(S.target instanceof HTMLElement)) return;
|
|
168
|
-
const U = S.touches[0].clientX - O, a = S.touches[0].clientY - B,
|
|
169
|
-
if (C && le(C,
|
|
168
|
+
const U = S.touches[0].clientX - O, a = S.touches[0].clientY - B, v = Math.abs(U) > Math.abs(a) ? "x" : "y", L = v === "x" ? U : a, C = $(S.target, v);
|
|
169
|
+
if (C && le(C, v, L))
|
|
170
170
|
return;
|
|
171
171
|
const z = o.classList.contains("disabled-dragopen"), de = o.classList.contains("disabled-dragopen-sidebar"), Fe = () => S.cancelable ? (S.preventDefault(), !0) : !1;
|
|
172
|
-
if (
|
|
172
|
+
if (v === "x") {
|
|
173
173
|
if (U > 0) {
|
|
174
|
-
if (
|
|
174
|
+
if (w.current === "sidebar" && !de) {
|
|
175
175
|
g = !0;
|
|
176
176
|
return;
|
|
177
177
|
}
|
|
@@ -180,7 +180,7 @@ const Ye = T(Ne(({ children: t, className: r, context: s, modal: l = !1, closeOn
|
|
|
180
180
|
return;
|
|
181
181
|
}
|
|
182
182
|
} else if (U < 0) {
|
|
183
|
-
if (
|
|
183
|
+
if (w.current === "drawer" && !z) {
|
|
184
184
|
g = !0;
|
|
185
185
|
return;
|
|
186
186
|
}
|
|
@@ -237,10 +237,10 @@ const Ye = T(Ne(({ children: t, className: r, context: s, modal: l = !1, closeOn
|
|
|
237
237
|
R(!b.current);
|
|
238
238
|
return;
|
|
239
239
|
}
|
|
240
|
-
const o =
|
|
240
|
+
const o = w.current === "sidebar" ? "outlet" : "sidebar";
|
|
241
241
|
k(o), j(o);
|
|
242
242
|
},
|
|
243
|
-
getIsSidebarOpen: () => d.current ? window.matchMedia("(min-width: 768px)").matches ? !b.current :
|
|
243
|
+
getIsSidebarOpen: () => d.current ? window.matchMedia("(min-width: 768px)").matches ? !b.current : w.current === "sidebar" : !1,
|
|
244
244
|
subscribeToSidebarOpen: (o) => (N.current.add(o), () => {
|
|
245
245
|
N.current.delete(o);
|
|
246
246
|
}),
|
|
@@ -285,11 +285,11 @@ const Ye = T(Ne(({ children: t, className: r, context: s, modal: l = !1, closeOn
|
|
|
285
285
|
E = o;
|
|
286
286
|
return;
|
|
287
287
|
}
|
|
288
|
-
if (o.type ===
|
|
288
|
+
if (o.type === ve && !V) {
|
|
289
289
|
V = o;
|
|
290
290
|
return;
|
|
291
291
|
}
|
|
292
|
-
if (o.type ===
|
|
292
|
+
if (o.type === we && !W) {
|
|
293
293
|
W = o;
|
|
294
294
|
return;
|
|
295
295
|
}
|
|
@@ -303,7 +303,7 @@ const Ye = T(Ne(({ children: t, className: r, context: s, modal: l = !1, closeOn
|
|
|
303
303
|
}
|
|
304
304
|
re.push(o);
|
|
305
305
|
});
|
|
306
|
-
const ce = !!V, Re = V ?? (re.length ? /* @__PURE__ */ e.jsx(
|
|
306
|
+
const ce = !!V, Re = V ?? (re.length ? /* @__PURE__ */ e.jsx(ve, { children: re }) : null), pe = ce ? re : [], ae = ne ?? (!!ne ? /* @__PURE__ */ e.jsx(ke, { children: H }) : null), Ce = W ?? (!!W ? /* @__PURE__ */ e.jsx(we, { children: W }) : null), je = !!se, G = se, oe = ue(() => ({
|
|
307
307
|
isCollapsed: h.current,
|
|
308
308
|
isSidebarOpen: !b.current
|
|
309
309
|
}), [h.current, b.current]);
|
|
@@ -349,7 +349,7 @@ const Ye = T(Ne(({ children: t, className: r, context: s, modal: l = !1, closeOn
|
|
|
349
349
|
type: "button",
|
|
350
350
|
onClick: t,
|
|
351
351
|
className: "collapse-button cursor-pointer text-neutral-default-default hover:text-primary-default transition-colors duration-300 w-max",
|
|
352
|
-
children: /* @__PURE__ */ e.jsx(
|
|
352
|
+
children: /* @__PURE__ */ e.jsx(vt, { size: 32, className: "transition-transform duration-300 p-1" })
|
|
353
353
|
}
|
|
354
354
|
), (t, r) => t.onToggleCollapse === r.onToggleCollapse);
|
|
355
355
|
Qe.displayName = "NavigationDrawerCollapseButton";
|
|
@@ -358,16 +358,16 @@ const Ee = T(({ children: t, className: r, context: s }) => {
|
|
|
358
358
|
return /* @__PURE__ */ e.jsx("div", { className: A("flex items-center justify-between", r), children: l });
|
|
359
359
|
});
|
|
360
360
|
Ee.displayName = "NavigationDrawerHeader";
|
|
361
|
-
const
|
|
361
|
+
const ve = T(({ children: t, className: r, context: s, ...l }) => {
|
|
362
362
|
const i = me(t, s);
|
|
363
363
|
return /* @__PURE__ */ e.jsx("div", { ...l, className: A("w-full flex-1 drawer-content", r), children: i });
|
|
364
364
|
});
|
|
365
|
-
|
|
366
|
-
const
|
|
365
|
+
ve.displayName = "NavigationDrawerContent";
|
|
366
|
+
const we = T(({ children: t, className: r, context: s }) => {
|
|
367
367
|
const l = me(t, s);
|
|
368
368
|
return /* @__PURE__ */ e.jsx("div", { className: A("flex items-center justify-between", r), children: l });
|
|
369
369
|
});
|
|
370
|
-
|
|
370
|
+
we.displayName = "NavigationDrawerFooter";
|
|
371
371
|
const Ze = T(({ className: t }) => /* @__PURE__ */ e.jsx("div", { className: A("w-full border-t border-neutral-strong-default ", t) }));
|
|
372
372
|
Ze.displayName = "NavigationDrawerSpacer";
|
|
373
373
|
const ke = T(Ne(({ children: t, className: r, context: s }, l) => {
|
|
@@ -376,8 +376,8 @@ const ke = T(Ne(({ children: t, className: r, context: s }, l) => {
|
|
|
376
376
|
}), (t, r) => t.children === r.children && t.className === r.className), q = Object.assign(Ve, {
|
|
377
377
|
Root: Ve,
|
|
378
378
|
Header: Ee,
|
|
379
|
-
Content:
|
|
380
|
-
Footer:
|
|
379
|
+
Content: ve,
|
|
380
|
+
Footer: we,
|
|
381
381
|
Spacer: Ze,
|
|
382
382
|
Outlet: ke,
|
|
383
383
|
Sidebar: Ye
|
|
@@ -411,10 +411,10 @@ const Ot = "hover:bg-neutral-medium-hover", Lt = Te("", {
|
|
|
411
411
|
}
|
|
412
412
|
},
|
|
413
413
|
compoundVariants: [
|
|
414
|
-
{ isSelected: !0, disabled: !0, className: "text-neutral-strong-disabled hover:text-neutral-strong-disabled focus:text-neutral-strong-disabled active:text-neutral-strong-disabled" },
|
|
415
|
-
{ isSelected: !1, disabled: !0, className: "text-neutral-strong-disabled hover:text-neutral-strong-disabled focus:text-neutral-strong-disabled active:text-neutral-strong-disabled" },
|
|
416
|
-
{ isSelected: !0, disabled: !1, className: " text-primary-default-default group-active:text-neutral-default-pressed group-focus:text-neutral-default-pressed" },
|
|
417
|
-
{ isSelected: !1, disabled: !1, className: " text-neutral-default-default group-active:text-neutral-default-pressed group-focus:text-neutral-default-pressed" }
|
|
414
|
+
{ isSelected: !0, disabled: !0, className: "text-neutral-strong-disabled hover:text-neutral-strong-disabled focus-visible:text-neutral-strong-disabled active:text-neutral-strong-disabled" },
|
|
415
|
+
{ isSelected: !1, disabled: !0, className: "text-neutral-strong-disabled hover:text-neutral-strong-disabled focus-visible:text-neutral-strong-disabled active:text-neutral-strong-disabled" },
|
|
416
|
+
{ isSelected: !0, disabled: !1, className: " text-primary-default-default group-active:text-neutral-default-pressed group-focus-visible:text-neutral-default-pressed" },
|
|
417
|
+
{ isSelected: !1, disabled: !1, className: " text-neutral-default-default group-active:text-neutral-default-pressed group-focus-visible:text-neutral-default-pressed" }
|
|
418
418
|
]
|
|
419
419
|
}
|
|
420
420
|
), Se = Te(
|
|
@@ -433,10 +433,10 @@ const Ot = "hover:bg-neutral-medium-hover", Lt = Te("", {
|
|
|
433
433
|
}
|
|
434
434
|
},
|
|
435
435
|
compoundVariants: [
|
|
436
|
-
{ isSelected: !0, disabled: !0, className: "text-neutral-strong-disabled hover:text-neutral-strong-disabled focus:text-neutral-strong-disabled active:text-neutral-strong-disabled" },
|
|
437
|
-
{ isSelected: !1, disabled: !0, className: "text-neutral-strong-disabled hover:text-neutral-strong-disabled focus:text-neutral-strong-disabled active:text-neutral-strong-disabled" },
|
|
438
|
-
{ isSelected: !0, disabled: !1, className: "text-primary-default-default group-active:text-neutral-default-pressed group-focus:text-neutral-default-pressed" },
|
|
439
|
-
{ isSelected: !1, disabled: !1, className: "text-neutral-default-default group-active:text-neutral-default-pressed group-focus:text-neutral-default-pressed" }
|
|
436
|
+
{ isSelected: !0, disabled: !0, className: "text-neutral-strong-disabled hover:text-neutral-strong-disabled focus-visible:text-neutral-strong-disabled active:text-neutral-strong-disabled" },
|
|
437
|
+
{ isSelected: !1, disabled: !0, className: "text-neutral-strong-disabled hover:text-neutral-strong-disabled focus-visible:text-neutral-strong-disabled active:text-neutral-strong-disabled" },
|
|
438
|
+
{ isSelected: !0, disabled: !1, className: "text-primary-default-default group-active:text-neutral-default-pressed group-focus-visible:text-neutral-default-pressed" },
|
|
439
|
+
{ isSelected: !1, disabled: !1, className: "text-neutral-default-default group-active:text-neutral-default-pressed group-focus-visible:text-neutral-default-pressed" }
|
|
440
440
|
]
|
|
441
441
|
}
|
|
442
442
|
), It = (t) => {
|
|
@@ -451,14 +451,14 @@ const Ot = "hover:bg-neutral-medium-hover", Lt = Te("", {
|
|
|
451
451
|
onToggleSublinks: d,
|
|
452
452
|
as: h = "div",
|
|
453
453
|
onClick: b,
|
|
454
|
-
onAuxClick:
|
|
454
|
+
onAuxClick: w,
|
|
455
455
|
disabled: u = !1,
|
|
456
456
|
tooltipText: N
|
|
457
457
|
} = t, y = (P) => {
|
|
458
458
|
u || b?.(P);
|
|
459
459
|
}, f = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
460
460
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center flex-nowrap", children: [
|
|
461
|
-
s && (N ? /* @__PURE__ */ e.jsx(
|
|
461
|
+
s && (N ? /* @__PURE__ */ e.jsx(wt, { title: N, disabled: u, children: /* @__PURE__ */ e.jsx(s, { size: 24, className: Se({ disabled: u, isSelected: n }) }) }) : /* @__PURE__ */ e.jsx(s, { size: 24, className: Se({ disabled: u, isSelected: n }) })),
|
|
462
462
|
/* @__PURE__ */ e.jsx("label", { className: Tt({ disabled: u, isSelected: n }), children: r })
|
|
463
463
|
] }),
|
|
464
464
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-1 items-center", children: [
|
|
@@ -497,7 +497,7 @@ const Ot = "hover:bg-neutral-medium-hover", Lt = Te("", {
|
|
|
497
497
|
if (h === "a") {
|
|
498
498
|
const P = {
|
|
499
499
|
onClick: y,
|
|
500
|
-
onAuxClick:
|
|
500
|
+
onAuxClick: w,
|
|
501
501
|
className: F
|
|
502
502
|
};
|
|
503
503
|
return /* @__PURE__ */ e.jsx("a", { ...P, children: f });
|
|
@@ -539,7 +539,7 @@ const Pt = ({ actions: t, activeActionId: r, onActionClick: s, className: l }) =
|
|
|
539
539
|
top: { type: "shadow", behavior: "scroll-on-hover", show: !0 },
|
|
540
540
|
bottom: { type: "shadow", behavior: "scroll-on-hover", show: !0 }
|
|
541
541
|
}, children: t?.map((i) => {
|
|
542
|
-
const { id: n, onClick: c, isView: m = !0, payload: d, ...h } = i, b = n === r,
|
|
542
|
+
const { id: n, onClick: c, isView: m = !0, payload: d, ...h } = i, b = n === r, w = () => {
|
|
543
543
|
s?.(n, d), c?.();
|
|
544
544
|
};
|
|
545
545
|
return m ? /* @__PURE__ */ e.jsx(
|
|
@@ -548,7 +548,7 @@ const Pt = ({ actions: t, activeActionId: r, onActionClick: s, className: l }) =
|
|
|
548
548
|
...h,
|
|
549
549
|
id: n,
|
|
550
550
|
isActive: b,
|
|
551
|
-
onClick:
|
|
551
|
+
onClick: w
|
|
552
552
|
},
|
|
553
553
|
n
|
|
554
554
|
) : null;
|
|
@@ -588,7 +588,7 @@ const _t = (t) => {
|
|
|
588
588
|
}, rt = T(_t);
|
|
589
589
|
rt.displayName = "NavItemSecondary";
|
|
590
590
|
const Rt = Ne((t, r) => {
|
|
591
|
-
const [s, l] = Z(!0), i = I(null), { path: n, title: c, icon: m, count: d, className: h, isSelected: b = !1, onClick:
|
|
591
|
+
const [s, l] = Z(!0), i = I(null), { path: n, title: c, icon: m, count: d, className: h, isSelected: b = !1, onClick: w, sublinks: u, toggleCollapse: N, getIsCollapsed: y, subscribeToCollapse: f, isView: F = !0, disabled: D, tooltipText: P } = t;
|
|
592
592
|
X(() => f ? f((E) => {
|
|
593
593
|
E && l(!0);
|
|
594
594
|
}) : void 0, [f]);
|
|
@@ -615,8 +615,8 @@ const Rt = Ne((t, r) => {
|
|
|
615
615
|
k(!1), N?.();
|
|
616
616
|
return;
|
|
617
617
|
}
|
|
618
|
-
|
|
619
|
-
}, [n,
|
|
618
|
+
w?.(n);
|
|
619
|
+
}, [n, w, u, N, k, y]), J = x(() => {
|
|
620
620
|
window.open(n, "_blank");
|
|
621
621
|
}, [n]), te = () => {
|
|
622
622
|
if (!u || D) return null;
|
|
@@ -625,9 +625,9 @@ const Rt = Ne((t, r) => {
|
|
|
625
625
|
const M = x((E) => {
|
|
626
626
|
if (E.startsWith("./")) {
|
|
627
627
|
const V = n + E.slice(2);
|
|
628
|
-
|
|
628
|
+
w?.(V);
|
|
629
629
|
} else
|
|
630
|
-
|
|
630
|
+
w?.(E);
|
|
631
631
|
}, [n]);
|
|
632
632
|
return X(() => {
|
|
633
633
|
const E = i.current;
|
|
@@ -779,10 +779,10 @@ const Ft = (t) => {
|
|
|
779
779
|
userOptionsControls: h,
|
|
780
780
|
mobileAppSwitcherControls: b
|
|
781
781
|
}) => {
|
|
782
|
-
const { getIsCollapsed:
|
|
783
|
-
const f =
|
|
782
|
+
const { getIsCollapsed: w, toggleCollapse: u, subscribeToCollapse: N } = ie(), y = x(() => {
|
|
783
|
+
const f = w();
|
|
784
784
|
f ? (u(), h.current?.open()) : c?.(f);
|
|
785
|
-
}, [
|
|
785
|
+
}, [w, u, h, c]);
|
|
786
786
|
return X(() => N((f) => {
|
|
787
787
|
f && (h.current?.close(), b.current?.close());
|
|
788
788
|
}), [N, h, b]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
@@ -966,7 +966,7 @@ const Ht = ({ onCloseClick: t, onMarkAllAsRead: r, notificationsListControls: s
|
|
|
966
966
|
removeNotification: d,
|
|
967
967
|
removeAllNotifications: h
|
|
968
968
|
}), [c, m, b, d, h]);
|
|
969
|
-
const
|
|
969
|
+
const w = l.length > 0;
|
|
970
970
|
return /* @__PURE__ */ e.jsxs(
|
|
971
971
|
"section",
|
|
972
972
|
{
|
|
@@ -980,8 +980,8 @@ const Ht = ({ onCloseClick: t, onMarkAllAsRead: r, notificationsListControls: s
|
|
|
980
980
|
/* @__PURE__ */ e.jsx(fe, { onClick: () => t?.(), icon: /* @__PURE__ */ e.jsx(Ie, {}), variant: "text", animate: !1, animateIcon: !1, color: "secondary", className: "size-12" })
|
|
981
981
|
] }),
|
|
982
982
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-3 pb-8 pt-4 px-4", children: [
|
|
983
|
-
r &&
|
|
984
|
-
|
|
983
|
+
r && w && /* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ e.jsx(fe, { onClick: r, label: "Marcar todas como leidas", variant: "text", animate: !1, animateIcon: !1, size: "small" }) }),
|
|
984
|
+
w ? l?.map((u, N) => /* @__PURE__ */ e.jsx(jt, { ...u, className: " border-b border-neutral-strong-default rounded-b-none last:border-b-0" }, N)) : /* @__PURE__ */ e.jsx("p", { className: " prometeo-fonts-body-medium text-neutral-default-hover text-center py-8", children: "No hay notificaciones" })
|
|
985
985
|
] })
|
|
986
986
|
]
|
|
987
987
|
}
|
|
@@ -1047,7 +1047,7 @@ const qt = ({ navigationControlsRef: t }) => {
|
|
|
1047
1047
|
const r = ie();
|
|
1048
1048
|
return t.current.toggleCollapse = r.toggleCollapse, t.current.getIsCollapsed = r.getIsCollapsed, t.current.subscribeToCollapse = r.subscribeToCollapse, t.current.openSidebar = r.openSidebar, t.current.closeSidebar = r.closeSidebar, t.current.toggleSidebar = r.toggleSidebar, t.current.getIsSidebarOpen = r.getIsSidebarOpen, t.current.subscribeToSidebarOpen = r.subscribeToSidebarOpen, t.current.setDrawerDragEnabled = r.setDrawerDragEnabled, t.current.setSidebarDragEnabled = r.setSidebarDragEnabled, null;
|
|
1049
1049
|
}, Kt = (t) => {
|
|
1050
|
-
const { children: r, currentAppSessions: s, resolveUserSecondarySlot: l, resolveSessionSecondarySlot: i, handleNavigation: n, allActions: c, tabs: m, navigationControlsRef: d, sidebarContentRef: h, initialSectionRef: b, userOptionsControls:
|
|
1050
|
+
const { children: r, currentAppSessions: s, resolveUserSecondarySlot: l, resolveSessionSecondarySlot: i, handleNavigation: n, allActions: c, tabs: m, navigationControlsRef: d, sidebarContentRef: h, initialSectionRef: b, userOptionsControls: w, mobileAppSwitcherControls: u, notificationsListControls: N, outletRef: y, ...f } = t;
|
|
1051
1051
|
return /* @__PURE__ */ e.jsxs(q, { disableDragOpen: f.options?.disableDragOpen, outletRef: y, children: [
|
|
1052
1052
|
/* @__PURE__ */ e.jsx(qt, { navigationControlsRef: d }),
|
|
1053
1053
|
/* @__PURE__ */ e.jsx(q.Header, { className: "flex flex-col relative w-full select-none", children: /* @__PURE__ */ e.jsx(
|
|
@@ -1081,7 +1081,7 @@ const qt = ({ navigationControlsRef: t }) => {
|
|
|
1081
1081
|
onLogoutClick: f.onLogoutClick,
|
|
1082
1082
|
options: f.options,
|
|
1083
1083
|
currentSystemId: f.currentSystemId,
|
|
1084
|
-
userOptionsControls:
|
|
1084
|
+
userOptionsControls: w,
|
|
1085
1085
|
mobileAppSwitcherControls: u,
|
|
1086
1086
|
onProfileClick: f.onProfileClick
|
|
1087
1087
|
}
|
|
@@ -1127,7 +1127,7 @@ const ut = Oe(null), br = () => {
|
|
|
1127
1127
|
if (!t)
|
|
1128
1128
|
throw new Error("usePyrionNavigation debe usarse dentro de PyrionNavigationDrawer");
|
|
1129
1129
|
return t;
|
|
1130
|
-
}, xr = ({ children: t, helpSection: r, state: s, links: l, onLinkClick: i, onNavigate: n, onLogoutClick: c, actions: m, activeActionId: d, onActionClick: h, tabsProps: b, currentSystemId:
|
|
1130
|
+
}, xr = ({ children: t, helpSection: r, state: s, links: l, onLinkClick: i, onNavigate: n, onLogoutClick: c, actions: m, activeActionId: d, onActionClick: h, tabsProps: b, currentSystemId: w, onSessionClick: u, onSystemLogoClick: N, onProfileClick: y, ...f }) => {
|
|
1131
1131
|
const D = Object.assign({
|
|
1132
1132
|
closeDrawerOnNavigate: !0,
|
|
1133
1133
|
disableDragOpen: {
|
|
@@ -1139,8 +1139,8 @@ const ut = Oe(null), br = () => {
|
|
|
1139
1139
|
i(a);
|
|
1140
1140
|
return;
|
|
1141
1141
|
}
|
|
1142
|
-
const
|
|
1143
|
-
P(a), D.closeDrawerOnNavigate && ft() && !j.current?.getIsCollapsed?.() && j.current?.toggleCollapse?.(), n && n(
|
|
1142
|
+
const v = window.location.pathname;
|
|
1143
|
+
P(a), D.closeDrawerOnNavigate && ft() && !j.current?.getIsCollapsed?.() && j.current?.toggleCollapse?.(), n && n(v, a);
|
|
1144
1144
|
}, [i, n, P]), ce = (a) => {
|
|
1145
1145
|
a && window.open(a, "_blank");
|
|
1146
1146
|
}, pe = {
|
|
@@ -1155,14 +1155,14 @@ const ut = Oe(null), br = () => {
|
|
|
1155
1155
|
desktop: ce
|
|
1156
1156
|
}
|
|
1157
1157
|
}, Me = x((a) => {
|
|
1158
|
-
const
|
|
1159
|
-
pe.system[
|
|
1158
|
+
const v = R ? "mobile" : "desktop", L = s.enabled_systems.find((C) => C.name === a)?.url;
|
|
1159
|
+
pe.system[v](L), b?.onTabClick?.(a);
|
|
1160
1160
|
}, [R, s.enabled_systems, b?.onTabClick]), ae = x((a) => {
|
|
1161
|
-
const
|
|
1162
|
-
pe.product[
|
|
1163
|
-
}, [R, s.company.products, b?.onTabClick]), Be = x((a,
|
|
1164
|
-
if (
|
|
1165
|
-
|
|
1161
|
+
const v = R ? "mobile" : "desktop", L = s.company.products?.find((C) => C.name === a)?.domain;
|
|
1162
|
+
pe.product[v](L), b?.onTabClick?.(a);
|
|
1163
|
+
}, [R, s.company.products, b?.onTabClick]), Be = x((a, v) => {
|
|
1164
|
+
if (v) {
|
|
1165
|
+
v(a), b?.onTabClick?.(a);
|
|
1166
1166
|
return;
|
|
1167
1167
|
} else
|
|
1168
1168
|
b?.onTabClick?.(a);
|
|
@@ -1171,18 +1171,18 @@ const ut = Oe(null), br = () => {
|
|
|
1171
1171
|
s.enabled_systems.forEach((L) => {
|
|
1172
1172
|
a[L.url] = L.name;
|
|
1173
1173
|
});
|
|
1174
|
-
const
|
|
1174
|
+
const v = window.location.origin;
|
|
1175
1175
|
for (const [L, C] of Object.entries(a))
|
|
1176
|
-
if (
|
|
1176
|
+
if (v === L)
|
|
1177
1177
|
return C;
|
|
1178
1178
|
return "";
|
|
1179
1179
|
}, [s.enabled_systems]), je = b?.currentTabName || Ce(), G = ue(
|
|
1180
1180
|
() => s.sessions || [],
|
|
1181
1181
|
[s.sessions]
|
|
1182
|
-
), oe = (a) => a == null ? null : typeof a == "string" || typeof a == "number" || typeof a == "boolean" ? String(a) : ge(a) ? a : typeof a == "object" ? JSON.stringify(a) : null, o = x((a,
|
|
1182
|
+
), oe = (a) => a == null ? null : typeof a == "string" || typeof a == "number" || typeof a == "boolean" ? String(a) : ge(a) ? a : typeof a == "object" ? JSON.stringify(a) : null, o = x((a, v) => {
|
|
1183
1183
|
if (!a) return null;
|
|
1184
1184
|
if (Array.isArray(a)) {
|
|
1185
|
-
const L = a?.[0] ? xe(
|
|
1185
|
+
const L = a?.[0] ? xe(v, a[0]) : null, C = a?.[1] ? xe(v, a[1]) : null, z = oe(L), de = oe(C);
|
|
1186
1186
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1187
1187
|
/* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-body-small text-neutral-default-default line-clamp-1 whitespace-break-spaces min-w-1/2", children: z }),
|
|
1188
1188
|
de && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1 flex-1 grow shrink-0 min-w-[40%] overflow-hidden", children: [
|
|
@@ -1192,26 +1192,26 @@ const ut = Oe(null), br = () => {
|
|
|
1192
1192
|
] });
|
|
1193
1193
|
}
|
|
1194
1194
|
if (typeof a == "string") {
|
|
1195
|
-
const L = xe(
|
|
1195
|
+
const L = xe(v, a);
|
|
1196
1196
|
return oe(L);
|
|
1197
1197
|
}
|
|
1198
|
-
return typeof a == "function" ? oe(a(
|
|
1198
|
+
return typeof a == "function" ? oe(a(v)) : null;
|
|
1199
1199
|
}, []), p = x(
|
|
1200
1200
|
(a) => {
|
|
1201
|
-
const
|
|
1202
|
-
if (!
|
|
1203
|
-
const L = s.enabled_systems?.find((z) => z._id ===
|
|
1204
|
-
return o(
|
|
1201
|
+
const v = D?.userCardOptions?.secondarySlot;
|
|
1202
|
+
if (!v) return null;
|
|
1203
|
+
const L = s.enabled_systems?.find((z) => z._id === w), C = { company: s.company, user: s.user, system: L, metadata: a };
|
|
1204
|
+
return o(v, C);
|
|
1205
1205
|
},
|
|
1206
|
-
[
|
|
1206
|
+
[w, D?.userCardOptions?.secondarySlot, o, s.company, s.enabled_systems, s.user]
|
|
1207
1207
|
), g = x(
|
|
1208
1208
|
(a) => {
|
|
1209
|
-
const
|
|
1210
|
-
if (!
|
|
1211
|
-
const L = s.enabled_systems?.find((z) => z._id ===
|
|
1212
|
-
return o(
|
|
1209
|
+
const v = D?.sessionCardOptions?.secondarySlot || D?.userCardOptions?.secondarySlot;
|
|
1210
|
+
if (!v) return null;
|
|
1211
|
+
const L = s.enabled_systems?.find((z) => z._id === w), C = { company: s.company, user: a.auth_id, metadata: a?.metadata, system: L };
|
|
1212
|
+
return o(v, C);
|
|
1213
1213
|
},
|
|
1214
|
-
[
|
|
1214
|
+
[w, D?.sessionCardOptions?.secondarySlot, D?.userCardOptions?.secondarySlot, o, s.company]
|
|
1215
1215
|
), O = ue(() => {
|
|
1216
1216
|
const a = [];
|
|
1217
1217
|
return j.current.openNotifications = () => {
|
|
@@ -1244,7 +1244,7 @@ const ut = Oe(null), br = () => {
|
|
|
1244
1244
|
thumbnail: C.thumbnail,
|
|
1245
1245
|
onClick: Me,
|
|
1246
1246
|
id: C._id
|
|
1247
|
-
})) || [],
|
|
1247
|
+
})) || [], v = b?.customTabs?.map((C) => ({
|
|
1248
1248
|
...C,
|
|
1249
1249
|
onClick: () => Be(C.name, C?.onClick)
|
|
1250
1250
|
})) || [], L = s.company.products?.map((C) => ({
|
|
@@ -1252,7 +1252,7 @@ const ut = Oe(null), br = () => {
|
|
|
1252
1252
|
thumbnail: C.thumbnail,
|
|
1253
1253
|
onClick: ae
|
|
1254
1254
|
})) || [];
|
|
1255
|
-
return [...a, ...
|
|
1255
|
+
return [...a, ...v, ...L];
|
|
1256
1256
|
}, [s.enabled_systems, s.company.products, b?.customTabs]), Q = x((a) => {
|
|
1257
1257
|
k.current?.addNewNotification ? k.current.addNewNotification(a) : console.warn("Notifications controls not ready yet");
|
|
1258
1258
|
}, []), $ = x((a) => k.current?.subscribeToUpdates ? k.current.subscribeToUpdates(a) : (console.warn("Notifications controls not ready yet"), () => {
|
|
@@ -1262,19 +1262,19 @@ const ut = Oe(null), br = () => {
|
|
|
1262
1262
|
k.current?.removeAllNotifications ? k.current.removeAllNotifications() : console.warn("Notifications controls not ready yet");
|
|
1263
1263
|
}, []), be = x((a) => {
|
|
1264
1264
|
k.current?.setNotifications ? k.current.setNotifications(a) : console.warn("Notifications controls not ready yet");
|
|
1265
|
-
}, []), S = x((a,
|
|
1266
|
-
const C = /* @__PURE__ */ e.jsxs("div", { className: A(" bg-black/60 z-200 inset-0 h-full w-full grid place-items-center text-neutral-default-default",
|
|
1265
|
+
}, []), S = x((a, v, L) => {
|
|
1266
|
+
const C = /* @__PURE__ */ e.jsxs("div", { className: A(" bg-black/60 z-200 inset-0 h-full w-full grid place-items-center text-neutral-default-default", v ? "fixed" : "sticky"), children: [
|
|
1267
1267
|
!L && /* @__PURE__ */ e.jsx(fe, { label: "", icon: /* @__PURE__ */ e.jsx(Ie, {}), onClick: () => W(!1), variant: "text", className: "absolute top-0 right-0", size: "small", color: "secondary" }),
|
|
1268
1268
|
typeof a == "function" ? a() : a
|
|
1269
1269
|
] });
|
|
1270
1270
|
let z;
|
|
1271
|
-
return
|
|
1271
|
+
return v ? z = ze(C, document.body, `modal-error-${Date.now()}`) : H.current && (z = ze(C, H.current, `modal-error-${Date.now()}`)), ne(z), W(!0), C;
|
|
1272
1272
|
}, [H]), U = x(() => {
|
|
1273
1273
|
W(!1);
|
|
1274
1274
|
}, []);
|
|
1275
1275
|
return j.current.addNewNotification = Q, j.current.subscribeToNotificationsUpdates = $, j.current.removeNotification = le, j.current.removeAllNotifications = he, j.current.setNotifications = be, j.current.showErrorModal = S, j.current.closeErrorModal = U, X(() => {
|
|
1276
|
-
$((a,
|
|
1277
|
-
E(
|
|
1276
|
+
$((a, v) => {
|
|
1277
|
+
E(v);
|
|
1278
1278
|
});
|
|
1279
1279
|
}, [$]), /* @__PURE__ */ e.jsxs(ut.Provider, { value: j.current, children: [
|
|
1280
1280
|
V && re,
|
|
@@ -1293,7 +1293,7 @@ const ut = Oe(null), br = () => {
|
|
|
1293
1293
|
onSessionClick: u,
|
|
1294
1294
|
onLogoutClick: c,
|
|
1295
1295
|
options: D,
|
|
1296
|
-
currentSystemId:
|
|
1296
|
+
currentSystemId: w,
|
|
1297
1297
|
userOptionsControls: J,
|
|
1298
1298
|
mobileAppSwitcherControls: te,
|
|
1299
1299
|
onSystemLogoClick: N,
|
|
@@ -1315,7 +1315,7 @@ const ut = Oe(null), br = () => {
|
|
|
1315
1315
|
tabs: _,
|
|
1316
1316
|
activeColor: "var(--neutral-900)",
|
|
1317
1317
|
currentTabName: je,
|
|
1318
|
-
currentSystemId:
|
|
1318
|
+
currentSystemId: w
|
|
1319
1319
|
}
|
|
1320
1320
|
),
|
|
1321
1321
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1333,7 +1333,7 @@ const ut = Oe(null), br = () => {
|
|
|
1333
1333
|
onSessionClick: u,
|
|
1334
1334
|
onLogoutClick: c,
|
|
1335
1335
|
options: D,
|
|
1336
|
-
currentSystemId:
|
|
1336
|
+
currentSystemId: w,
|
|
1337
1337
|
userOptionsControls: J,
|
|
1338
1338
|
mobileAppSwitcherControls: te,
|
|
1339
1339
|
onSystemLogoClick: N,
|
package/dist/TabLinks.d.ts
CHANGED