prometeo-design-system 3.1.7 → 4.1.0
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/{CardProfile-y9Knsg26.js → CardProfile-C1F83KJV.js} +1 -1
- package/dist/CardProfile.es.js +1 -1
- package/dist/{DatePicker-6eb-0Ns5.js → DatePicker-QuBgR5DQ.js} +799 -794
- package/dist/DatePicker.es.js +1 -1
- package/dist/DialogModal.es.js +25 -22
- package/dist/Icons/ReassignmentFill.es.js +1 -1
- package/dist/Icons/StarFill.d.ts +6 -0
- package/dist/Icons/StarFill.es.js +19 -0
- package/dist/Icons/components/StarFill.d.ts +4 -0
- package/dist/Icons/index.d.ts +1 -0
- package/dist/Icons/types.d.ts +4 -2
- package/dist/Icons.es.js +18 -16
- package/dist/Input.es.js +56 -52
- package/dist/PlainTooltip.d.ts +6 -0
- package/dist/PlainTooltip.es.js +72 -0
- package/dist/PyrionLayout.d.ts +6 -0
- package/dist/PyrionLayout.es.js +1357 -0
- package/dist/RecurrentDatePicker.es.js +2 -2
- package/dist/RecurrentDatePickerRRule.es.js +1 -1
- package/dist/Scrollable.es.js +118 -86
- package/dist/Select.es.js +524 -524
- package/dist/SelectSearch.es.js +44 -43
- package/dist/TabLinks.es.js +81 -52
- package/dist/{badge-B1IK_-i5.js → badge-CbqYNrl4.js} +28 -28
- package/dist/components/DatePicker/DatePicker.d.ts +1 -0
- package/dist/components/Input/Input.d.ts +1 -0
- package/dist/components/NavigationDrawer/NavigationDrawer.d.ts +19 -11
- package/dist/components/NavigationDrawer/NavigationDrawerActionItem.d.ts +5 -3
- package/dist/components/NavigationDrawer/NavigationDrawerActions.d.ts +3 -3
- package/dist/components/NavigationDrawer/NavigationDrawerItemBase.d.ts +1 -0
- package/dist/components/NavigationDrawer/NavigationDrawerLinkItem.d.ts +3 -2
- package/dist/components/NavigationDrawer/NavigationDrawerNavlinks.d.ts +2 -2
- package/dist/components/NavigationDrawer/NavigationDrawerSidebar.d.ts +11 -0
- package/dist/components/NotificationCard/NotificationCard.d.ts +3 -2
- package/dist/components/PlainTooltip/PlainTooltip.d.ts +11 -0
- package/dist/components/PyrionNavigationDrawer/PLContent.d.ts +10 -0
- package/dist/components/PyrionNavigationDrawer/PLFooter.d.ts +21 -0
- package/dist/components/PyrionNavigationDrawer/PLHeader.d.ts +10 -0
- package/dist/components/PyrionNavigationDrawer/PLHelpSection.d.ts +8 -0
- package/dist/components/PyrionNavigationDrawer/{PyrionNavigationDrawerMobileAppSwitcher.d.ts → PLMobileAppSwitcher.d.ts} +3 -3
- package/dist/components/PyrionNavigationDrawer/PLNotificationsList.d.ts +15 -0
- package/dist/components/PyrionNavigationDrawer/PLSidebar.d.ts +12 -0
- package/dist/components/PyrionNavigationDrawer/PLSidebarContent.d.ts +17 -0
- package/dist/components/PyrionNavigationDrawer/{PyrionNavigationDrawerSystemLogo.d.ts → PLSystemLogo.d.ts} +1 -1
- package/dist/components/PyrionNavigationDrawer/PLSystemSessions.d.ts +14 -0
- package/dist/components/PyrionNavigationDrawer/PLayoutBase.d.ts +42 -0
- package/dist/components/PyrionNavigationDrawer/PyrionLayout.d.ts +146 -0
- package/dist/components/PyrionNavigationDrawer/index.d.ts +3 -2
- package/dist/components/Scrollable/Scrollable.d.ts +1 -0
- package/dist/components/Select/Select.d.ts +1 -0
- package/dist/components/TabLinks/TabLinks.d.ts +10 -1
- package/dist/components/TabSwitch/TabSwitch.d.ts +2 -0
- package/dist/exports/PlainTooltip.d.ts +2 -0
- package/dist/exports/PyrionLayout.d.ts +2 -0
- package/dist/exports/usePyrionNavigation.d.ts +1 -1
- package/dist/hooks/useDevice.d.ts +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/prometeo-design-system.es.js +2421 -402
- package/dist/styles.css +1 -1
- package/dist/useDevice-vwn4GLwK.js +16 -0
- package/dist/useDevice.es.js +2 -11
- package/dist/usePyrionNavigation.es.js +1 -1
- package/package.json +8 -16
- package/src/styles/base.css +1 -0
- package/dist/LayoutGeneric-CfWhV1ov.js +0 -26
- package/dist/LayoutGeneric.d.ts +0 -6
- package/dist/LayoutGeneric.es.js +0 -4
- package/dist/PyrionNavigationDrawer.d.ts +0 -6
- package/dist/PyrionNavigationDrawer.es.js +0 -962
- package/dist/SwipeContainer.d.ts +0 -4
- package/dist/SwipeContainer.es.js +0 -185
- package/dist/components/PyrionNavigationDrawer/PyrionHelpSection.d.ts +0 -8
- package/dist/components/PyrionNavigationDrawer/PyrionNavigationDrawer.d.ts +0 -130
- package/dist/components/PyrionNavigationDrawer/PyrionNotificationsList.d.ts +0 -8
- package/dist/components/PyrionNavigationDrawer/SidebarContent.d.ts +0 -13
- package/dist/components/PyrionNavigationDrawer/SystemSessions.d.ts +0 -12
- package/dist/components/SwipeContainer/SwipeContainer.d.ts +0 -19
- package/dist/exports/LayoutGeneric.d.ts +0 -2
- package/dist/exports/PyrionNavigationDrawer.d.ts +0 -2
- package/dist/exports/SwipeContainer.d.ts +0 -1
|
@@ -0,0 +1,1357 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-GkKLlHH4.js";
|
|
2
|
+
import { u as We, g as ft } from "./useDevice-vwn4GLwK.js";
|
|
3
|
+
import { g as xe } from "./utils-X4-h3cum.js";
|
|
4
|
+
import Ue, { memo as T, forwardRef as Ne, useState as Z, useEffect as X, useContext as $e, createContext as Oe, useRef as I, useCallback as x, Children as mt, isValidElement as ge, useMemo as ue, useImperativeHandle as Le, use as pt } from "react";
|
|
5
|
+
import { createPortal as ze } from "react-dom";
|
|
6
|
+
import { useLocation as ht, useNavigate as bt } from "react-router";
|
|
7
|
+
import { B as xt, T as gt } from "./badge-CbqYNrl4.js";
|
|
8
|
+
import { c as A } from "./cn-B6yFEsav.js";
|
|
9
|
+
import { CloseNavBarDesktop as wt } from "./Icons/CloseNavBarDesktop.es.js";
|
|
10
|
+
import { c as Te } from "./index-BOQuZ0gG.js";
|
|
11
|
+
import vt from "./PlainTooltip.es.js";
|
|
12
|
+
import { CrevronLeft as Nt } from "./Icons/CrevronLeft.es.js";
|
|
13
|
+
import { Scrollable as ye } from "./Scrollable.es.js";
|
|
14
|
+
import ee from "./TicketCard.es.js";
|
|
15
|
+
import yt from "./Avatar.es.js";
|
|
16
|
+
import fe from "./Button.es.js";
|
|
17
|
+
import { Logout as Ct } from "./Icons/Logout.es.js";
|
|
18
|
+
import jt from "./NotificationCard.es.js";
|
|
19
|
+
import { Notifications as qe } from "./Icons/Notifications.es.js";
|
|
20
|
+
import { Close as Ie } from "./Icons/Close.es.js";
|
|
21
|
+
import { Help as Ke } from "./Icons/Help.es.js";
|
|
22
|
+
import { Settings as St } from "./Icons/Settings.es.js";
|
|
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(), [v, u] = Z(() => n ? h : !0), [N, y] = Z(!1);
|
|
25
|
+
return X(() => {
|
|
26
|
+
n && s?.subscribeToSidebarOpen((f) => {
|
|
27
|
+
f ? (y(!1), u(!0)) : y(!0);
|
|
28
|
+
});
|
|
29
|
+
}, [n, s]), X(() => {
|
|
30
|
+
const f = c && typeof c == "object" && "current" in c ? c.current : null;
|
|
31
|
+
if (!f) return;
|
|
32
|
+
const F = () => {
|
|
33
|
+
N && (u(!1), y(!1));
|
|
34
|
+
};
|
|
35
|
+
return f.addEventListener("transitionend", F), () => f.removeEventListener("transitionend", F);
|
|
36
|
+
}, [N]), /* @__PURE__ */ e.jsxs("div", { ref: c, className: A("sidebar", d ? "collapsed" : "expanded", "h-full overflow-auto", r), "aria-modal": l || void 0, children: [
|
|
37
|
+
l && d && /* @__PURE__ */ e.jsx(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
className: A("navigation-drawer-sidebar-overlay"),
|
|
41
|
+
onClick: (f) => {
|
|
42
|
+
f.preventDefault(), f.stopPropagation(), i && b?.();
|
|
43
|
+
},
|
|
44
|
+
"aria-hidden": "true"
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
/* @__PURE__ */ e.jsxs("div", { className: A("navigation-drawer-sidebar-inner"), children: [
|
|
48
|
+
/* @__PURE__ */ e.jsx("div", { className: "secure-click-margin" }),
|
|
49
|
+
v && m
|
|
50
|
+
] })
|
|
51
|
+
] });
|
|
52
|
+
})), Xe = Oe(null), Je = Oe(null), kt = () => {
|
|
53
|
+
const t = $e(Xe);
|
|
54
|
+
if (!t) throw new Error("useDrawerState must be used within NavigationDrawer");
|
|
55
|
+
return t;
|
|
56
|
+
}, ie = () => {
|
|
57
|
+
const t = $e(Je);
|
|
58
|
+
if (!t) throw new Error("useDrawerActions must be used within NavigationDrawer");
|
|
59
|
+
return t;
|
|
60
|
+
}, me = (t, r) => typeof t == "function" ? r ? t(r) : null : t, Ge = "navigation-drawer-collapsed", He = () => {
|
|
61
|
+
if (typeof window > "u") return !1;
|
|
62
|
+
try {
|
|
63
|
+
const t = sessionStorage.getItem(Ge);
|
|
64
|
+
return t ? JSON.parse(t) : !1;
|
|
65
|
+
} catch {
|
|
66
|
+
return !1;
|
|
67
|
+
}
|
|
68
|
+
}, Dt = (t) => {
|
|
69
|
+
if (!(typeof window > "u"))
|
|
70
|
+
try {
|
|
71
|
+
sessionStorage.setItem(Ge, JSON.stringify(t));
|
|
72
|
+
} catch {
|
|
73
|
+
}
|
|
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), v = I("drawer"), u = I(/* @__PURE__ */ new Set()), N = I(/* @__PURE__ */ new Set()), y = I(!1), f = I(null), F = x((o) => {
|
|
76
|
+
const p = c.current;
|
|
77
|
+
p && (p.classList.toggle("collapsed", o), p.classList.toggle("expanded", !o));
|
|
78
|
+
}, []), D = x((o) => {
|
|
79
|
+
const p = d.current;
|
|
80
|
+
if (!p) return;
|
|
81
|
+
p.classList.toggle("collapsed", o), p.classList.toggle("expanded", !o);
|
|
82
|
+
const g = n.current;
|
|
83
|
+
g && (g.classList.toggle("sidebar-collapsed", o), g.classList.toggle("sidebar-expanded", !o));
|
|
84
|
+
}, []), P = x(
|
|
85
|
+
(o, { notify: p = !0 } = {}) => {
|
|
86
|
+
const g = h.current !== o;
|
|
87
|
+
h.current = o, Dt(o), F(o), p && g && u.current.forEach((O) => O(o));
|
|
88
|
+
},
|
|
89
|
+
[F]
|
|
90
|
+
), R = x(
|
|
91
|
+
(o, { notify: p = !0 } = {}) => {
|
|
92
|
+
const g = b.current !== o;
|
|
93
|
+
if (b.current = o, D(o), p && g) {
|
|
94
|
+
const O = !o;
|
|
95
|
+
N.current.forEach((B) => B(O));
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
[D]
|
|
99
|
+
), k = x(
|
|
100
|
+
(o, { notify: p = !0 } = {}) => {
|
|
101
|
+
const g = v.current, O = g !== o;
|
|
102
|
+
v.current = o, window.matchMedia("(min-width: 768px)").matches || P(o !== "drawer", { notify: p });
|
|
103
|
+
const B = g === "sidebar", _ = o === "sidebar";
|
|
104
|
+
p && O && B !== _ && N.current.forEach((Q) => Q(_)), R(o !== "sidebar", { notify: p }), P(o !== "drawer", { notify: p });
|
|
105
|
+
},
|
|
106
|
+
[P, R]
|
|
107
|
+
), j = x((o) => {
|
|
108
|
+
const p = n.current;
|
|
109
|
+
if (!p || window.matchMedia("(min-width: 768px)").matches) return;
|
|
110
|
+
y.current = !0;
|
|
111
|
+
const g = m.current?.offsetLeft ?? 0, O = d.current?.offsetLeft ?? g, B = o === "drawer" ? 0 : o === "sidebar" ? O : g;
|
|
112
|
+
f.current = B, p.scrollTo({ left: B, behavior: "smooth" });
|
|
113
|
+
const _ = () => {
|
|
114
|
+
y.current = !1, f.current = null, p.removeEventListener("scrollend", _);
|
|
115
|
+
};
|
|
116
|
+
p.addEventListener("scrollend", _, { once: !0 }), setTimeout(() => {
|
|
117
|
+
y.current && _();
|
|
118
|
+
}, 1e3);
|
|
119
|
+
}, []), K = x(() => {
|
|
120
|
+
const o = n.current, p = m.current;
|
|
121
|
+
if (!o || !p || window.matchMedia("(min-width: 768px)").matches) return;
|
|
122
|
+
const g = [
|
|
123
|
+
{ panel: "drawer", offset: 0 },
|
|
124
|
+
{ panel: "outlet", offset: p.offsetLeft }
|
|
125
|
+
], O = d.current;
|
|
126
|
+
O && g.push({ panel: "sidebar", offset: O.offsetLeft });
|
|
127
|
+
const B = o.scrollLeft;
|
|
128
|
+
let _ = g[0], Q = Math.abs(B - _.offset);
|
|
129
|
+
for (let $ = 1; $ < g.length; $++) {
|
|
130
|
+
const le = Math.abs(B - g[$].offset);
|
|
131
|
+
le < Q && (_ = g[$], Q = le);
|
|
132
|
+
}
|
|
133
|
+
k(_.panel);
|
|
134
|
+
}, [k]);
|
|
135
|
+
X(() => {
|
|
136
|
+
const o = n.current;
|
|
137
|
+
o && (i?.drawer && o.classList.add("disabled-dragopen"), i?.sidebar && o.classList.add("disabled-dragopen-sidebar"));
|
|
138
|
+
}, [i, n]), X(() => {
|
|
139
|
+
const o = n.current, p = m.current;
|
|
140
|
+
if (!o || !p) return;
|
|
141
|
+
if (window.matchMedia("(min-width: 768px)").matches) {
|
|
142
|
+
const O = He();
|
|
143
|
+
P(O, { notify: !1 }), R(!0, { notify: !1 });
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
requestAnimationFrame(() => {
|
|
147
|
+
o.scrollLeft = p.offsetLeft, k("outlet");
|
|
148
|
+
});
|
|
149
|
+
}, [k, P, R]), X(() => {
|
|
150
|
+
const o = n.current;
|
|
151
|
+
if (!o || !m.current) return;
|
|
152
|
+
let g = !1, O = 0, B = 0;
|
|
153
|
+
const _ = (S) => {
|
|
154
|
+
O = S.touches[0].clientX, B = S.touches[0].clientY;
|
|
155
|
+
}, Q = (S, U) => {
|
|
156
|
+
const a = window.getComputedStyle(S), w = U === "x" ? a.overflowX : a.overflowY;
|
|
157
|
+
return /(auto|scroll|overlay)/.test(w) ? U === "x" ? S.scrollWidth > S.clientWidth : S.scrollHeight > S.clientHeight : !1;
|
|
158
|
+
}, $ = (S, U) => {
|
|
159
|
+
let a = S;
|
|
160
|
+
for (; a && a !== o; ) {
|
|
161
|
+
if (Q(a, U))
|
|
162
|
+
return a;
|
|
163
|
+
a = a.parentElement;
|
|
164
|
+
}
|
|
165
|
+
return null;
|
|
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
|
+
if (!(S.target instanceof HTMLElement)) return;
|
|
168
|
+
const U = S.touches[0].clientX - O, a = S.touches[0].clientY - B, w = Math.abs(U) > Math.abs(a) ? "x" : "y", L = w === "x" ? U : a, C = $(S.target, w);
|
|
169
|
+
if (C && le(C, w, L))
|
|
170
|
+
return;
|
|
171
|
+
const z = o.classList.contains("disabled-dragopen"), de = o.classList.contains("disabled-dragopen-sidebar"), Fe = () => S.cancelable ? (S.preventDefault(), !0) : !1;
|
|
172
|
+
if (w === "x") {
|
|
173
|
+
if (U > 0) {
|
|
174
|
+
if (v.current === "sidebar" && !de) {
|
|
175
|
+
g = !0;
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
if (z) {
|
|
179
|
+
Fe();
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
} else if (U < 0) {
|
|
183
|
+
if (v.current === "drawer" && !z) {
|
|
184
|
+
g = !0;
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
if (de) {
|
|
188
|
+
Fe();
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
g = !0;
|
|
193
|
+
}
|
|
194
|
+
}, be = () => {
|
|
195
|
+
setTimeout(() => {
|
|
196
|
+
g && (K(), g = !1);
|
|
197
|
+
}, 100);
|
|
198
|
+
};
|
|
199
|
+
return o.addEventListener("touchstart", _, { passive: !0 }), o.addEventListener("touchmove", he, { passive: !1 }), o.addEventListener("touchend", be), () => {
|
|
200
|
+
o.removeEventListener("touchstart", _), o.removeEventListener("touchmove", he), o.removeEventListener("touchend", be);
|
|
201
|
+
};
|
|
202
|
+
}, [K]);
|
|
203
|
+
const Y = x(() => {
|
|
204
|
+
const o = window.matchMedia("(min-width: 768px)").matches, p = !h.current;
|
|
205
|
+
if (o) {
|
|
206
|
+
P(p);
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
const g = p ? "outlet" : "drawer";
|
|
210
|
+
k(g), j(g);
|
|
211
|
+
}, [j, k, P]), J = I(null);
|
|
212
|
+
J.current || (J.current = {
|
|
213
|
+
toggleCollapse: () => Y(),
|
|
214
|
+
getIsCollapsed: () => h.current,
|
|
215
|
+
subscribeToCollapse: (o) => (u.current.add(o), () => {
|
|
216
|
+
u.current.delete(o);
|
|
217
|
+
}),
|
|
218
|
+
openSidebar: () => {
|
|
219
|
+
if (d.current) {
|
|
220
|
+
if (window.matchMedia("(min-width: 768px)").matches) {
|
|
221
|
+
R(!1);
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
k("sidebar"), j("sidebar");
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
closeSidebar: () => {
|
|
228
|
+
if (window.matchMedia("(min-width: 768px)").matches) {
|
|
229
|
+
R(!0);
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
k("outlet"), j("outlet");
|
|
233
|
+
},
|
|
234
|
+
toggleSidebar: () => {
|
|
235
|
+
if (!d.current) return;
|
|
236
|
+
if (window.matchMedia("(min-width: 768px)").matches) {
|
|
237
|
+
R(!b.current);
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
const o = v.current === "sidebar" ? "outlet" : "sidebar";
|
|
241
|
+
k(o), j(o);
|
|
242
|
+
},
|
|
243
|
+
getIsSidebarOpen: () => d.current ? window.matchMedia("(min-width: 768px)").matches ? !b.current : v.current === "sidebar" : !1,
|
|
244
|
+
subscribeToSidebarOpen: (o) => (N.current.add(o), () => {
|
|
245
|
+
N.current.delete(o);
|
|
246
|
+
}),
|
|
247
|
+
setDrawerDragEnabled: (o) => {
|
|
248
|
+
const p = n.current;
|
|
249
|
+
if (!p) return;
|
|
250
|
+
const g = p.scrollLeft;
|
|
251
|
+
if (o) {
|
|
252
|
+
const O = p.style.scrollBehavior;
|
|
253
|
+
p.style.scrollBehavior = "auto", p.classList.remove("disabled-dragopen"), requestAnimationFrame(() => {
|
|
254
|
+
p.scrollLeft = g, requestAnimationFrame(() => {
|
|
255
|
+
p.style.scrollBehavior = O;
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
} else
|
|
259
|
+
p.classList.add("disabled-dragopen");
|
|
260
|
+
},
|
|
261
|
+
setSidebarDragEnabled: (o) => {
|
|
262
|
+
const p = n.current;
|
|
263
|
+
if (p)
|
|
264
|
+
if (o) {
|
|
265
|
+
const g = p.scrollLeft, O = p.style.scrollBehavior;
|
|
266
|
+
p.style.scrollBehavior = "auto", p.classList.remove("disabled-dragopen-sidebar"), requestAnimationFrame(() => {
|
|
267
|
+
p.scrollLeft = g, requestAnimationFrame(() => {
|
|
268
|
+
p.style.scrollBehavior = O;
|
|
269
|
+
});
|
|
270
|
+
});
|
|
271
|
+
} else
|
|
272
|
+
p.classList.add("disabled-dragopen-sidebar");
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
const te = J.current, H = typeof r == "function" ? r(te) : r, M = mt.toArray(H);
|
|
276
|
+
let E = null, V = null, W = null;
|
|
277
|
+
const re = [];
|
|
278
|
+
let ne = null, se = null;
|
|
279
|
+
M.forEach((o) => {
|
|
280
|
+
if (!ge(o)) {
|
|
281
|
+
re.push(o);
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
if (o.type === Ee && !E) {
|
|
285
|
+
E = o;
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
if (o.type === we && !V) {
|
|
289
|
+
V = o;
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
if (o.type === ve && !W) {
|
|
293
|
+
W = o;
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
if (o.type === ke && !ne) {
|
|
297
|
+
ne = o;
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
if (o.type === Ye && !se) {
|
|
301
|
+
se = o;
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
re.push(o);
|
|
305
|
+
});
|
|
306
|
+
const ce = !!V, Re = V ?? (re.length ? /* @__PURE__ */ e.jsx(we, { children: re }) : null), pe = ce ? re : [], ae = ne ?? (!!ne ? /* @__PURE__ */ e.jsx(ke, { children: H }) : null), Ce = W ?? (!!W ? /* @__PURE__ */ e.jsx(ve, { children: W }) : null), je = !!se, G = se, oe = ue(() => ({
|
|
307
|
+
isCollapsed: h.current,
|
|
308
|
+
isSidebarOpen: !b.current
|
|
309
|
+
}), [h.current, b.current]);
|
|
310
|
+
return /* @__PURE__ */ e.jsx(Xe.Provider, { value: oe, children: /* @__PURE__ */ e.jsx(Je.Provider, { value: te, children: /* @__PURE__ */ e.jsxs("div", { id: "navigation-drawer-container", ref: n, className: A(
|
|
311
|
+
"w-full h-full max-h-dvh overflow-y-hidden",
|
|
312
|
+
je ? "navigation-drawer-with-sidebar" : "navigation-drawer",
|
|
313
|
+
i?.drawer ? "disabled-dragopen" : "",
|
|
314
|
+
i?.sidebar ? "disabled-dragopen-sidebar" : ""
|
|
315
|
+
), children: [
|
|
316
|
+
/* @__PURE__ */ e.jsxs(
|
|
317
|
+
"div",
|
|
318
|
+
{
|
|
319
|
+
ref: c,
|
|
320
|
+
className: A(
|
|
321
|
+
"bg-neutral-default-default border-r border-neutral-strong-default h-dvh md:h-screen p-4 overflow-hidden drawer flex flex-col gap-4",
|
|
322
|
+
h.current ? "collapsed" : "expanded w-min",
|
|
323
|
+
s
|
|
324
|
+
),
|
|
325
|
+
children: [
|
|
326
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col flex-1 gap-4 overflow-hidden", children: [
|
|
327
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
328
|
+
/* @__PURE__ */ e.jsx(Qe, { onToggleCollapse: Y }),
|
|
329
|
+
E
|
|
330
|
+
] }),
|
|
331
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-1 overflow-hidden relative flex-col", children: [
|
|
332
|
+
pe,
|
|
333
|
+
Re
|
|
334
|
+
] })
|
|
335
|
+
] }),
|
|
336
|
+
Ce
|
|
337
|
+
]
|
|
338
|
+
}
|
|
339
|
+
),
|
|
340
|
+
ae && ge(ae) ? Ue.cloneElement(ae, { ref: m }) : ae,
|
|
341
|
+
G && ge(G) ? Ue.cloneElement(G, {
|
|
342
|
+
ref: d,
|
|
343
|
+
className: A("sidebar", G.props?.className, l)
|
|
344
|
+
}) : G
|
|
345
|
+
] }) }) });
|
|
346
|
+
}, Ve = T(At), Qe = T(({ onToggleCollapse: t }) => /* @__PURE__ */ e.jsx(
|
|
347
|
+
"button",
|
|
348
|
+
{
|
|
349
|
+
type: "button",
|
|
350
|
+
onClick: t,
|
|
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(wt, { size: 32, className: "transition-transform duration-300 p-1" })
|
|
353
|
+
}
|
|
354
|
+
), (t, r) => t.onToggleCollapse === r.onToggleCollapse);
|
|
355
|
+
Qe.displayName = "NavigationDrawerCollapseButton";
|
|
356
|
+
const Ee = T(({ children: t, className: r, context: s }) => {
|
|
357
|
+
const l = me(t, s);
|
|
358
|
+
return /* @__PURE__ */ e.jsx("div", { className: A("flex items-center justify-between", r), children: l });
|
|
359
|
+
});
|
|
360
|
+
Ee.displayName = "NavigationDrawerHeader";
|
|
361
|
+
const we = T(({ children: t, className: r, context: s, ...l }) => {
|
|
362
|
+
const i = me(t, s);
|
|
363
|
+
return /* @__PURE__ */ e.jsx("div", { ...l, className: A("w-full flex-1 drawer-content", r), children: i });
|
|
364
|
+
});
|
|
365
|
+
we.displayName = "NavigationDrawerContent";
|
|
366
|
+
const ve = T(({ children: t, className: r, context: s }) => {
|
|
367
|
+
const l = me(t, s);
|
|
368
|
+
return /* @__PURE__ */ e.jsx("div", { className: A("flex items-center justify-between", r), children: l });
|
|
369
|
+
});
|
|
370
|
+
ve.displayName = "NavigationDrawerFooter";
|
|
371
|
+
const Ze = T(({ className: t }) => /* @__PURE__ */ e.jsx("div", { className: A("w-full border-t border-neutral-strong-default ", t) }));
|
|
372
|
+
Ze.displayName = "NavigationDrawerSpacer";
|
|
373
|
+
const ke = T(Ne(({ children: t, className: r, context: s }, l) => {
|
|
374
|
+
const i = me(t, s);
|
|
375
|
+
return /* @__PURE__ */ e.jsx("div", { id: "navigation-drawer-outlet", ref: l, className: A("flex-1 overflow-auto ", r), children: i });
|
|
376
|
+
}), (t, r) => t.children === r.children && t.className === r.className), q = Object.assign(Ve, {
|
|
377
|
+
Root: Ve,
|
|
378
|
+
Header: Ee,
|
|
379
|
+
Content: we,
|
|
380
|
+
Footer: ve,
|
|
381
|
+
Spacer: Ze,
|
|
382
|
+
Outlet: ke,
|
|
383
|
+
Sidebar: Ye
|
|
384
|
+
});
|
|
385
|
+
q.displayName = "NavigationDrawer";
|
|
386
|
+
const Ot = "hover:bg-neutral-medium-hover", Lt = Te("", {
|
|
387
|
+
variants: {
|
|
388
|
+
isSelected: {
|
|
389
|
+
true: "bg-neutral-medium-selected ",
|
|
390
|
+
false: ""
|
|
391
|
+
},
|
|
392
|
+
disabled: {
|
|
393
|
+
true: "bg-transparent hover:bg-transparent active:bg-transparent focus:bg-transparent",
|
|
394
|
+
false: "cursor-pointer"
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}), Tt = Te(
|
|
398
|
+
A(
|
|
399
|
+
"select-none line-clamp-1 min-w-max",
|
|
400
|
+
"prometeo-fonts-label-large transition-colors duration-300 ease-out"
|
|
401
|
+
),
|
|
402
|
+
{
|
|
403
|
+
variants: {
|
|
404
|
+
isSelected: {
|
|
405
|
+
true: "text-primary-default-default",
|
|
406
|
+
false: "text-neutral-default-default"
|
|
407
|
+
},
|
|
408
|
+
disabled: {
|
|
409
|
+
true: "text-primary-default-disabled",
|
|
410
|
+
false: "cursor-pointer"
|
|
411
|
+
}
|
|
412
|
+
},
|
|
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" }
|
|
418
|
+
]
|
|
419
|
+
}
|
|
420
|
+
), Se = Te(
|
|
421
|
+
A(
|
|
422
|
+
"transition-colors duration-300 ease-out min-w-max"
|
|
423
|
+
),
|
|
424
|
+
{
|
|
425
|
+
variants: {
|
|
426
|
+
isSelected: {
|
|
427
|
+
true: "",
|
|
428
|
+
false: ""
|
|
429
|
+
},
|
|
430
|
+
disabled: {
|
|
431
|
+
true: "",
|
|
432
|
+
false: "cursor-pointer"
|
|
433
|
+
}
|
|
434
|
+
},
|
|
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" }
|
|
440
|
+
]
|
|
441
|
+
}
|
|
442
|
+
), It = (t) => {
|
|
443
|
+
const {
|
|
444
|
+
title: r,
|
|
445
|
+
icon: s,
|
|
446
|
+
count: l,
|
|
447
|
+
className: i,
|
|
448
|
+
isSelected: n = !1,
|
|
449
|
+
hasSublinks: c,
|
|
450
|
+
subLinksCollapsed: m,
|
|
451
|
+
onToggleSublinks: d,
|
|
452
|
+
as: h = "div",
|
|
453
|
+
onClick: b,
|
|
454
|
+
onAuxClick: v,
|
|
455
|
+
disabled: u = !1,
|
|
456
|
+
tooltipText: N
|
|
457
|
+
} = t, y = (P) => {
|
|
458
|
+
u || b?.(P);
|
|
459
|
+
}, f = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
460
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center flex-nowrap", children: [
|
|
461
|
+
s && (N ? /* @__PURE__ */ e.jsx(vt, { 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
|
+
/* @__PURE__ */ e.jsx("label", { className: Tt({ disabled: u, isSelected: n }), children: r })
|
|
463
|
+
] }),
|
|
464
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-1 items-center", children: [
|
|
465
|
+
l && l ? /* @__PURE__ */ e.jsx(xt, { count: l, maxCount: 9, className: "badge", disabled: u }) : "",
|
|
466
|
+
c && /* @__PURE__ */ e.jsx(
|
|
467
|
+
"div",
|
|
468
|
+
{
|
|
469
|
+
className: A(
|
|
470
|
+
"sublinks-toggle",
|
|
471
|
+
"transition-all duration-200",
|
|
472
|
+
"rounded-full relative grid place-items-center size-6",
|
|
473
|
+
n && "text-primary-default-default",
|
|
474
|
+
`${m ? "-rotate-90" : "rotate-90"}`
|
|
475
|
+
),
|
|
476
|
+
children: /* @__PURE__ */ e.jsx(
|
|
477
|
+
"button",
|
|
478
|
+
{
|
|
479
|
+
disabled: u,
|
|
480
|
+
type: "button",
|
|
481
|
+
onClick: d,
|
|
482
|
+
className: A("absolute cursor-pointer hover:text-primary-default-hover top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 p-2 z-100 select-none", Se({ disabled: u, isSelected: n }), u && "pointer-events-none"),
|
|
483
|
+
children: /* @__PURE__ */ e.jsx(Nt, {})
|
|
484
|
+
}
|
|
485
|
+
)
|
|
486
|
+
}
|
|
487
|
+
)
|
|
488
|
+
] })
|
|
489
|
+
] }), F = A(
|
|
490
|
+
"group navitem",
|
|
491
|
+
"h-12 flex-1 flex items-center p-3 rounded-lg justify-between w-full",
|
|
492
|
+
"transition-all duration-300",
|
|
493
|
+
Ot,
|
|
494
|
+
Lt({ isSelected: n, disabled: u }),
|
|
495
|
+
i
|
|
496
|
+
);
|
|
497
|
+
if (h === "a") {
|
|
498
|
+
const P = {
|
|
499
|
+
onClick: y,
|
|
500
|
+
onAuxClick: v,
|
|
501
|
+
className: F
|
|
502
|
+
};
|
|
503
|
+
return /* @__PURE__ */ e.jsx("a", { ...P, children: f });
|
|
504
|
+
}
|
|
505
|
+
if (h === "button") {
|
|
506
|
+
const P = {
|
|
507
|
+
onClick: y,
|
|
508
|
+
type: "button",
|
|
509
|
+
className: F
|
|
510
|
+
};
|
|
511
|
+
return /* @__PURE__ */ e.jsx("button", { ...P, children: f });
|
|
512
|
+
}
|
|
513
|
+
const D = {
|
|
514
|
+
onClick: y,
|
|
515
|
+
className: F
|
|
516
|
+
};
|
|
517
|
+
return /* @__PURE__ */ e.jsx("div", { ...D, children: f });
|
|
518
|
+
}, Pe = T(It);
|
|
519
|
+
Pe.displayName = "NavigationDrawerItemBase";
|
|
520
|
+
const Et = (t) => {
|
|
521
|
+
const { title: r, icon: s, count: l, className: i, isActive: n, onClick: c, isView: m = !0, disabled: d, tooltipText: h } = t;
|
|
522
|
+
return m ? /* @__PURE__ */ e.jsx(
|
|
523
|
+
Pe,
|
|
524
|
+
{
|
|
525
|
+
as: "button",
|
|
526
|
+
title: r,
|
|
527
|
+
icon: s,
|
|
528
|
+
count: l,
|
|
529
|
+
className: i,
|
|
530
|
+
isSelected: n,
|
|
531
|
+
onClick: c,
|
|
532
|
+
disabled: d,
|
|
533
|
+
tooltipText: h
|
|
534
|
+
}
|
|
535
|
+
) : null;
|
|
536
|
+
}, et = T(Et);
|
|
537
|
+
et.displayName = "NavigationDrawerActionItem";
|
|
538
|
+
const Pt = ({ actions: t, activeActionId: r, onActionClick: s, className: l }) => /* @__PURE__ */ e.jsx(ye, { className: A("flex flex-col gap-2 w-full ", l), scrollbarProps: { hide: !0 }, persistScroll: "navigation-actions", indicators: {
|
|
539
|
+
top: { type: "shadow", behavior: "scroll-on-hover", show: !0 },
|
|
540
|
+
bottom: { type: "shadow", behavior: "scroll-on-hover", show: !0 }
|
|
541
|
+
}, children: t?.map((i) => {
|
|
542
|
+
const { id: n, onClick: c, isView: m = !0, payload: d, ...h } = i, b = n === r, v = () => {
|
|
543
|
+
s?.(n, d), c?.();
|
|
544
|
+
};
|
|
545
|
+
return m ? /* @__PURE__ */ e.jsx(
|
|
546
|
+
et,
|
|
547
|
+
{
|
|
548
|
+
...h,
|
|
549
|
+
id: n,
|
|
550
|
+
isActive: b,
|
|
551
|
+
onClick: v
|
|
552
|
+
},
|
|
553
|
+
n
|
|
554
|
+
) : null;
|
|
555
|
+
}) }), tt = T(Pt);
|
|
556
|
+
tt.displayName = "NavigationDrawerActions";
|
|
557
|
+
const _t = (t) => {
|
|
558
|
+
const { className: r, title: s, path: l, onClick: i, isSelected: n, parentPath: c } = t, m = x(() => {
|
|
559
|
+
i?.(l);
|
|
560
|
+
}, [l]), d = x(() => {
|
|
561
|
+
if (l.startsWith("./")) {
|
|
562
|
+
if (!c) return;
|
|
563
|
+
const h = c + l.slice(2);
|
|
564
|
+
window.open(h, "_blank");
|
|
565
|
+
} else
|
|
566
|
+
window.open(l, "_blank");
|
|
567
|
+
}, [l]);
|
|
568
|
+
return /* @__PURE__ */ e.jsx(
|
|
569
|
+
"a",
|
|
570
|
+
{
|
|
571
|
+
onClick: m,
|
|
572
|
+
onAuxClick: d,
|
|
573
|
+
className: A(
|
|
574
|
+
"group",
|
|
575
|
+
"transition-all duration-300 ease-in-out cursor-pointer",
|
|
576
|
+
"h-10 w-full rounded-lg py-[11px] px-3",
|
|
577
|
+
"hover:bg-neutral-medium-hover",
|
|
578
|
+
n && "bg-neutral-medium-selected hover:bg-neutral-medium-hover active:bg-transparent focus:bg-transparent",
|
|
579
|
+
r
|
|
580
|
+
),
|
|
581
|
+
children: /* @__PURE__ */ e.jsx("p", { className: A(
|
|
582
|
+
"prometeo-fonts-label-large text-neutral-medium-default",
|
|
583
|
+
"group-active:text-neutral-default-focused group-focus:text-neutral-default-focused",
|
|
584
|
+
n && "text-primary-default-default group-hover:text-primary-default-hover group-focus:text-primary-default-focused group-active:text-primary-default-focused"
|
|
585
|
+
), children: s })
|
|
586
|
+
}
|
|
587
|
+
);
|
|
588
|
+
}, rt = T(_t);
|
|
589
|
+
rt.displayName = "NavItemSecondary";
|
|
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: v, sublinks: u, toggleCollapse: N, getIsCollapsed: y, subscribeToCollapse: f, isView: F = !0, disabled: D, tooltipText: P } = t;
|
|
592
|
+
X(() => f ? f((E) => {
|
|
593
|
+
E && l(!0);
|
|
594
|
+
}) : void 0, [f]);
|
|
595
|
+
const R = x(() => {
|
|
596
|
+
l((M) => !M);
|
|
597
|
+
}, []), k = x((M) => {
|
|
598
|
+
l(M);
|
|
599
|
+
}, []), j = {
|
|
600
|
+
toggle: R,
|
|
601
|
+
setIsCollapsed: k,
|
|
602
|
+
get isCollapsed() {
|
|
603
|
+
return s;
|
|
604
|
+
},
|
|
605
|
+
get isDrawerCollapsed() {
|
|
606
|
+
return y?.() ?? !1;
|
|
607
|
+
},
|
|
608
|
+
toggleDrawerCollapse: N,
|
|
609
|
+
subscribeToCollapse: f
|
|
610
|
+
};
|
|
611
|
+
Le(r, () => j, [j, s, y, N]);
|
|
612
|
+
const K = m, Y = x(() => {
|
|
613
|
+
const M = y?.() ?? !1;
|
|
614
|
+
if (u && u.length > 0 && M) {
|
|
615
|
+
k(!1), N?.();
|
|
616
|
+
return;
|
|
617
|
+
}
|
|
618
|
+
v?.(n);
|
|
619
|
+
}, [n, v, u, N, k, y]), J = x(() => {
|
|
620
|
+
window.open(n, "_blank");
|
|
621
|
+
}, [n]), te = () => {
|
|
622
|
+
if (!u || D) return null;
|
|
623
|
+
if (t.subLinksRender && u)
|
|
624
|
+
return t.subLinksRender(u, j);
|
|
625
|
+
const M = x((E) => {
|
|
626
|
+
if (E.startsWith("./")) {
|
|
627
|
+
const V = n + E.slice(2);
|
|
628
|
+
v?.(V);
|
|
629
|
+
} else
|
|
630
|
+
v?.(E);
|
|
631
|
+
}, [n]);
|
|
632
|
+
return X(() => {
|
|
633
|
+
const E = i.current;
|
|
634
|
+
if (!E) return;
|
|
635
|
+
const V = E.scrollHeight;
|
|
636
|
+
E.style.setProperty("--sublinks-max-height", `${V}px`);
|
|
637
|
+
}, []), /* @__PURE__ */ e.jsx("div", { ref: i, className: `sublinks flex flex-col gap-1 ml-8 ${s ? "collapsed" : "expanded"}`, children: u.map((E) => /* @__PURE__ */ e.jsx(rt, { ...E, onClick: M, parentPath: n }, `${E.title}-${E.path}`)) });
|
|
638
|
+
}, H = (M) => {
|
|
639
|
+
M.stopPropagation(), M.preventDefault(), R();
|
|
640
|
+
};
|
|
641
|
+
return F ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
642
|
+
/* @__PURE__ */ e.jsx(
|
|
643
|
+
Pe,
|
|
644
|
+
{
|
|
645
|
+
as: "a",
|
|
646
|
+
title: c,
|
|
647
|
+
icon: K,
|
|
648
|
+
count: d,
|
|
649
|
+
className: h,
|
|
650
|
+
isSelected: b,
|
|
651
|
+
hasSublinks: !!u,
|
|
652
|
+
subLinksCollapsed: s,
|
|
653
|
+
onToggleSublinks: H,
|
|
654
|
+
onClick: Y,
|
|
655
|
+
onAuxClick: J,
|
|
656
|
+
disabled: D,
|
|
657
|
+
tooltipText: P
|
|
658
|
+
}
|
|
659
|
+
),
|
|
660
|
+
te()
|
|
661
|
+
] }) : null;
|
|
662
|
+
}), st = T(Rt);
|
|
663
|
+
st.displayName = "NavigationDrawerLinkItem";
|
|
664
|
+
const Mt = ({ navlinks: t, handleNavigation: r, className: s, getIsCollapsed: l, toggleCollapse: i, subscribeToCollapse: n }) => {
|
|
665
|
+
const { pathname: c } = ht();
|
|
666
|
+
return /* @__PURE__ */ e.jsx(ye, { className: A("flex flex-col gap-2 w-full ", s), scrollbarProps: { hide: !0 }, persistScroll: "navigation-links", indicators: {
|
|
667
|
+
top: { type: "shadow", behavior: "scroll-on-hover", show: !0 },
|
|
668
|
+
bottom: { type: "shadow", behavior: "scroll-on-hover", show: !0 }
|
|
669
|
+
}, children: t?.map((m, d) => {
|
|
670
|
+
const h = m.isSelected || m.path === c || (m.relatedPaths?.some((b) => c.startsWith(b)) ?? !1);
|
|
671
|
+
return /* @__PURE__ */ e.jsx(
|
|
672
|
+
st,
|
|
673
|
+
{
|
|
674
|
+
className: "",
|
|
675
|
+
...m,
|
|
676
|
+
isSelected: h,
|
|
677
|
+
onClick: r,
|
|
678
|
+
toggleCollapse: i,
|
|
679
|
+
getIsCollapsed: l,
|
|
680
|
+
subscribeToCollapse: n,
|
|
681
|
+
disabled: m.disabled,
|
|
682
|
+
isView: m.isView
|
|
683
|
+
},
|
|
684
|
+
d
|
|
685
|
+
);
|
|
686
|
+
}) });
|
|
687
|
+
}, nt = T(Mt);
|
|
688
|
+
nt.displayName = "NavigationDrawerNavlinks";
|
|
689
|
+
const at = T(({ navlinks: t, handleNavigation: r, allActions: s, activeActionId: l, onActionClick: i }) => {
|
|
690
|
+
const { getIsCollapsed: n, toggleCollapse: c, subscribeToCollapse: m } = ie();
|
|
691
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
692
|
+
/* @__PURE__ */ e.jsx(q.Spacer, { className: "pb-3" }),
|
|
693
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col overflow-hidden h-full gap-4", children: [
|
|
694
|
+
/* @__PURE__ */ e.jsx(
|
|
695
|
+
nt,
|
|
696
|
+
{
|
|
697
|
+
getIsCollapsed: n,
|
|
698
|
+
toggleCollapse: c,
|
|
699
|
+
subscribeToCollapse: m,
|
|
700
|
+
navlinks: t,
|
|
701
|
+
handleNavigation: r,
|
|
702
|
+
className: "flex flex-1 min-h-[30vh]"
|
|
703
|
+
}
|
|
704
|
+
),
|
|
705
|
+
/* @__PURE__ */ e.jsx(
|
|
706
|
+
tt,
|
|
707
|
+
{
|
|
708
|
+
actions: s,
|
|
709
|
+
activeActionId: l,
|
|
710
|
+
onActionClick: i,
|
|
711
|
+
className: "max-h-[35vh]"
|
|
712
|
+
}
|
|
713
|
+
)
|
|
714
|
+
] })
|
|
715
|
+
] });
|
|
716
|
+
}, (t, r) => t.navlinks === r.navlinks && t.handleNavigation === r.handleNavigation && t.allActions === r.allActions && t.activeActionId === r.activeActionId && t.onActionClick === r.onActionClick);
|
|
717
|
+
at.displayName = "PyrionNavigationDrawer.Content";
|
|
718
|
+
const Bt = ({ name: t, imageUrl: r, avatarSize: s = "xxs", subImageUrl: l, className: i, mainSlot: n = t, secondarySlot: c }) => {
|
|
719
|
+
const m = x(() => n ? typeof n == "string" ? /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-label-large text-neutral-default-default line-clamp-1 select-text", children: n }) : typeof n == "function" ? n() : n : null, [n]), d = x(() => c ? typeof c == "string" ? /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-body-small text-neutral-default-default line-clamp-1 whitespace-pre text-ellipsis select-text", children: c }) : typeof c == "function" ? c() : c : null, [c]);
|
|
720
|
+
return /* @__PURE__ */ e.jsxs("div", { className: A("flex items-center gap-2 p-3 rounded-lg max-w-full max-h-full select-none ", i), children: [
|
|
721
|
+
/* @__PURE__ */ e.jsx(
|
|
722
|
+
yt,
|
|
723
|
+
{
|
|
724
|
+
fallbackText: t,
|
|
725
|
+
sizeImage: s,
|
|
726
|
+
sizeFallback: s,
|
|
727
|
+
imageUrl: r,
|
|
728
|
+
subImageUrl: l
|
|
729
|
+
}
|
|
730
|
+
),
|
|
731
|
+
/* @__PURE__ */ e.jsxs("div", { className: A("usercard-content flex flex-col gap-0 flex-1 overflow-hidden w-full transition-all duration-300 ease-in-out ", c && "gap-1"), children: [
|
|
732
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full", children: m() }),
|
|
733
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex gap-1 justify-between overflow-hidden relative w-full", children: d() })
|
|
734
|
+
] })
|
|
735
|
+
] });
|
|
736
|
+
}, _e = T(Bt);
|
|
737
|
+
_e.displayName = "UserCard";
|
|
738
|
+
const Ft = (t) => {
|
|
739
|
+
const { sessions: r, onSessionClick: s, secondarySlot: l, subImageUrlAccessor: i } = t;
|
|
740
|
+
if (!r || r.length === 0)
|
|
741
|
+
return null;
|
|
742
|
+
const n = (d) => {
|
|
743
|
+
s && s(d);
|
|
744
|
+
}, c = (d) => {
|
|
745
|
+
if (!i)
|
|
746
|
+
return;
|
|
747
|
+
const h = d.metadata;
|
|
748
|
+
if (!h)
|
|
749
|
+
return;
|
|
750
|
+
const b = xe({ metadata: h }, i);
|
|
751
|
+
if (b != null)
|
|
752
|
+
return typeof b == "string" ? b : String(b);
|
|
753
|
+
}, m = x((d) => typeof l == "function" ? l(d) : l, [l]);
|
|
754
|
+
return /* @__PURE__ */ e.jsx("div", { className: "w-full h-full flex flex-col gap-2", children: r?.map((d) => {
|
|
755
|
+
const { auth_id: h } = d;
|
|
756
|
+
return /* @__PURE__ */ e.jsx(ee, { className: " shrink-0 h-max", children: /* @__PURE__ */ e.jsx(ee.Content, { onClick: () => n(d), className: "p-0 group-data-[expanded=true]/ticketcard:border-none", children: /* @__PURE__ */ e.jsx(
|
|
757
|
+
_e,
|
|
758
|
+
{
|
|
759
|
+
name: h.name,
|
|
760
|
+
avatarSize: "xxs",
|
|
761
|
+
secondarySlot: m(d),
|
|
762
|
+
subImageUrl: c(d),
|
|
763
|
+
imageUrl: h.profile_picture,
|
|
764
|
+
className: "pyrion-navigation-drawer-user-card"
|
|
765
|
+
},
|
|
766
|
+
d.token
|
|
767
|
+
) }) }, d.token);
|
|
768
|
+
}) });
|
|
769
|
+
}, Ut = ({
|
|
770
|
+
state: t,
|
|
771
|
+
currentAppSessions: r,
|
|
772
|
+
resolveUserSecondarySlot: s,
|
|
773
|
+
resolveSessionSecondarySlot: l,
|
|
774
|
+
onSessionClick: i,
|
|
775
|
+
onLogoutClick: n,
|
|
776
|
+
onProfileClick: c,
|
|
777
|
+
options: m,
|
|
778
|
+
currentSystemId: d,
|
|
779
|
+
userOptionsControls: h,
|
|
780
|
+
mobileAppSwitcherControls: b
|
|
781
|
+
}) => {
|
|
782
|
+
const { getIsCollapsed: v, toggleCollapse: u, subscribeToCollapse: N } = ie(), y = x(() => {
|
|
783
|
+
const f = v();
|
|
784
|
+
f ? (u(), h.current?.open()) : c?.(f);
|
|
785
|
+
}, [v, u, h, c]);
|
|
786
|
+
return X(() => N((f) => {
|
|
787
|
+
f && (h.current?.close(), b.current?.close());
|
|
788
|
+
}), [N, h, b]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
789
|
+
/* @__PURE__ */ e.jsx(q.Spacer, { className: "mb-3" }),
|
|
790
|
+
/* @__PURE__ */ e.jsxs(ee, { className: "", controls: h, children: [
|
|
791
|
+
/* @__PURE__ */ e.jsx(ee.Content, { onClick: y, children: /* @__PURE__ */ e.jsx(
|
|
792
|
+
_e,
|
|
793
|
+
{
|
|
794
|
+
className: "pyrion-navigation-drawer-user-card p-0",
|
|
795
|
+
name: t.user.name,
|
|
796
|
+
secondarySlot: s(t.metadata),
|
|
797
|
+
imageUrl: t.user.profile_picture,
|
|
798
|
+
subImageUrl: t.company.icon,
|
|
799
|
+
avatarSize: "xxs"
|
|
800
|
+
}
|
|
801
|
+
) }),
|
|
802
|
+
/* @__PURE__ */ e.jsxs(ee.Options, { className: "min-h-max flex flex-col gap-3 pl-3 mt-3 pt-2", children: [
|
|
803
|
+
r && r.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
804
|
+
/* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-label-medium text-neutral-medium-default select-none", children: "Cambiar cuenta" }),
|
|
805
|
+
/* @__PURE__ */ e.jsx(ye, { className: "flex flex-col gap-2 max-h-[165px] flex-1", scrollbarProps: { hide: !0 }, children: /* @__PURE__ */ e.jsx(
|
|
806
|
+
Ft,
|
|
807
|
+
{
|
|
808
|
+
sessions: r,
|
|
809
|
+
onSessionClick: i,
|
|
810
|
+
secondarySlot: l,
|
|
811
|
+
subImageUrlAccessor: m?.sessionCardOptions?.subImageUrlAccessor,
|
|
812
|
+
currentSystemId: d
|
|
813
|
+
}
|
|
814
|
+
) })
|
|
815
|
+
] }),
|
|
816
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2", children: n && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
817
|
+
/* @__PURE__ */ e.jsx("span", { className: "border-t border-neutral-strong-default w-full bg-neutral-strong-default" }),
|
|
818
|
+
/* @__PURE__ */ e.jsx(
|
|
819
|
+
fe,
|
|
820
|
+
{
|
|
821
|
+
onClick: n,
|
|
822
|
+
animate: !1,
|
|
823
|
+
animateIcon: !1,
|
|
824
|
+
variant: "text",
|
|
825
|
+
label: "Cerrar sesión",
|
|
826
|
+
icon: /* @__PURE__ */ e.jsx(Ct, {}),
|
|
827
|
+
size: "small",
|
|
828
|
+
color: "secondary"
|
|
829
|
+
}
|
|
830
|
+
)
|
|
831
|
+
] }) })
|
|
832
|
+
] })
|
|
833
|
+
] })
|
|
834
|
+
] });
|
|
835
|
+
}, ot = T(Ut, (t, r) => {
|
|
836
|
+
const s = Object.keys(t), l = Object.keys(r);
|
|
837
|
+
if (s.length !== l.length)
|
|
838
|
+
return !1;
|
|
839
|
+
for (const i of s) {
|
|
840
|
+
if (!Object.prototype.hasOwnProperty.call(r, i))
|
|
841
|
+
return !1;
|
|
842
|
+
const n = t[i], c = r[i];
|
|
843
|
+
if (n !== c)
|
|
844
|
+
return !1;
|
|
845
|
+
}
|
|
846
|
+
return t.currentAppSessions !== r.currentAppSessions || t.options !== r.options || t.currentSystemId !== r.currentSystemId || t.userOptionsControls !== r.userOptionsControls || t.mobileAppSwitcherControls !== r.mobileAppSwitcherControls;
|
|
847
|
+
});
|
|
848
|
+
ot.displayName = "PyrionNavigationDrawer.Footer";
|
|
849
|
+
const zt = ({ tabs: t, content: r, controls: s }) => /* @__PURE__ */ e.jsxs(ee, { controls: s, children: [
|
|
850
|
+
/* @__PURE__ */ e.jsx(ee.Content, { children: typeof r == "function" ? r() : r }),
|
|
851
|
+
/* @__PURE__ */ e.jsxs(ee.Options, { children: [
|
|
852
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col p-2 pl-4 gap-2", children: [
|
|
853
|
+
/* @__PURE__ */ e.jsx("p", { className: " prometeo-fonts-label-medium text-neutral-medium-default", children: "Cambiar módulo" }),
|
|
854
|
+
/* @__PURE__ */ e.jsx(ye, { className: "max-h-52", scrollbarProps: { hide: !0 }, children: t?.map((l) => {
|
|
855
|
+
const i = typeof l.thumbnail == "string" ? /* @__PURE__ */ e.jsx(
|
|
856
|
+
"img",
|
|
857
|
+
{
|
|
858
|
+
src: l.thumbnail,
|
|
859
|
+
alt: l.description,
|
|
860
|
+
className: "size-8 aspect-square rounded",
|
|
861
|
+
draggable: !1
|
|
862
|
+
}
|
|
863
|
+
) : l.thumbnail, n = () => {
|
|
864
|
+
l.disabled || l.onClick && l.onClick(l.name);
|
|
865
|
+
};
|
|
866
|
+
return /* @__PURE__ */ e.jsxs("div", { onClick: n, className: "flex gap-2 p-2 rounded-lg h-12", children: [
|
|
867
|
+
i,
|
|
868
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center h-full justify-center ", children: [
|
|
869
|
+
/* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-label-large text-neutral-default-default line-clamp-1", children: l.name }),
|
|
870
|
+
l.description && /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-body-small text-neutral-medium-default line-clamp-1", children: l.description })
|
|
871
|
+
] })
|
|
872
|
+
] });
|
|
873
|
+
}) })
|
|
874
|
+
] }),
|
|
875
|
+
/* @__PURE__ */ e.jsx("div", {})
|
|
876
|
+
] })
|
|
877
|
+
] }), De = T(({ enabled_systems: t, onClick: r, currentSystemId: s }) => {
|
|
878
|
+
const l = x(() => {
|
|
879
|
+
if (t) {
|
|
880
|
+
if (s) {
|
|
881
|
+
const m = t.find((d) => d._id === s);
|
|
882
|
+
if (m) return { coverImage: m.coverImage, thumbnail: m.thumbnail };
|
|
883
|
+
}
|
|
884
|
+
const n = window.location.origin, c = t.find((m) => m.url === n);
|
|
885
|
+
if (c) return { coverImage: c.coverImage, thumbnail: c.thumbnail };
|
|
886
|
+
}
|
|
887
|
+
return { coverImage: "", thumbnail: "" };
|
|
888
|
+
}, [t]), i = !!r;
|
|
889
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
890
|
+
/* @__PURE__ */ e.jsx(
|
|
891
|
+
"img",
|
|
892
|
+
{
|
|
893
|
+
src: l().coverImage,
|
|
894
|
+
alt: "System Logo",
|
|
895
|
+
className: A("w-full h-12 rounded object-contain system-cover-image ", i && "cursor-pointer"),
|
|
896
|
+
draggable: !1,
|
|
897
|
+
onClick: r
|
|
898
|
+
}
|
|
899
|
+
),
|
|
900
|
+
/* @__PURE__ */ e.jsx(
|
|
901
|
+
"img",
|
|
902
|
+
{
|
|
903
|
+
src: l().thumbnail,
|
|
904
|
+
alt: "System Logo",
|
|
905
|
+
className: A("w-12 h-12 rounded object-cover system-thumbnail ", i && "cursor-pointer"),
|
|
906
|
+
draggable: !1,
|
|
907
|
+
onClick: r
|
|
908
|
+
}
|
|
909
|
+
)
|
|
910
|
+
] });
|
|
911
|
+
}, (t, r) => t.enabled_systems === r.enabled_systems && t.onClick === r.onClick && t.currentSystemId === r.currentSystemId);
|
|
912
|
+
De.displayName = "PyrionNavigationDrawer.SystemLogo";
|
|
913
|
+
const lt = T(({ onSystemLogoClick: t, state: r, currentSystemId: s, tabs: l, mobileAppSwitcherControls: i }) => {
|
|
914
|
+
const { getIsCollapsed: n } = ie(), c = We(), m = x(() => {
|
|
915
|
+
if (t) {
|
|
916
|
+
const d = n();
|
|
917
|
+
t(d);
|
|
918
|
+
}
|
|
919
|
+
}, [t, n]);
|
|
920
|
+
return c ? /* @__PURE__ */ e.jsx(
|
|
921
|
+
zt,
|
|
922
|
+
{
|
|
923
|
+
controls: i,
|
|
924
|
+
tabs: l,
|
|
925
|
+
content: /* @__PURE__ */ e.jsx(
|
|
926
|
+
De,
|
|
927
|
+
{
|
|
928
|
+
enabled_systems: r.enabled_systems,
|
|
929
|
+
onClick: m,
|
|
930
|
+
currentSystemId: s
|
|
931
|
+
}
|
|
932
|
+
)
|
|
933
|
+
}
|
|
934
|
+
) : /* @__PURE__ */ e.jsx(
|
|
935
|
+
De,
|
|
936
|
+
{
|
|
937
|
+
enabled_systems: r.enabled_systems,
|
|
938
|
+
onClick: m,
|
|
939
|
+
currentSystemId: s
|
|
940
|
+
}
|
|
941
|
+
);
|
|
942
|
+
});
|
|
943
|
+
lt.displayName = "PyrionNavigationDrawer.Header";
|
|
944
|
+
const Ht = ({ onCloseClick: t, onMarkAllAsRead: r, notificationsListControls: s }) => {
|
|
945
|
+
const [l, i] = Z([]), n = I(/* @__PURE__ */ new Set()), c = x((u, N = "top") => {
|
|
946
|
+
i((y) => {
|
|
947
|
+
const f = Array.isArray(u) ? N === "bottom" ? [...y, ...u] : [...u, ...y] : N === "bottom" ? [...y, u] : [u, ...y];
|
|
948
|
+
return n.current.forEach((F) => F(f, f.length)), f;
|
|
949
|
+
});
|
|
950
|
+
}, []), m = x((u) => (n.current.add(u), () => {
|
|
951
|
+
n.current.delete(u);
|
|
952
|
+
}), []), d = x((u) => {
|
|
953
|
+
i((N) => {
|
|
954
|
+
const y = Array.isArray(u) ? N.filter((f) => !u.includes(f._id)) : N.filter((f) => f._id !== u);
|
|
955
|
+
return n.current.forEach((f) => f(y, y.length)), y;
|
|
956
|
+
});
|
|
957
|
+
}, []), h = x(() => {
|
|
958
|
+
i([]), n.current.forEach((u) => u([], 0));
|
|
959
|
+
}, []), b = x((u) => {
|
|
960
|
+
i(u), n.current.forEach((N) => N(u, u.length));
|
|
961
|
+
}, []);
|
|
962
|
+
Le(s, () => ({
|
|
963
|
+
addNewNotification: c,
|
|
964
|
+
subscribeToUpdates: m,
|
|
965
|
+
setNotifications: b,
|
|
966
|
+
removeNotification: d,
|
|
967
|
+
removeAllNotifications: h
|
|
968
|
+
}), [c, m, b, d, h]);
|
|
969
|
+
const v = l.length > 0;
|
|
970
|
+
return /* @__PURE__ */ e.jsxs(
|
|
971
|
+
"section",
|
|
972
|
+
{
|
|
973
|
+
className: "w-full md:w-[479px] bg-neutral-default-default border-l-0 md:border-l border-neutral-strong-default min-h-full",
|
|
974
|
+
children: [
|
|
975
|
+
/* @__PURE__ */ e.jsxs("div", { className: "w-full h-max flex gap-2 items-center justify-between pt-8 pb-2 pr-2 pl-4 border-b border-neutral-strong-default sticky top-0 z-50 bg-neutral-default-default", children: [
|
|
976
|
+
/* @__PURE__ */ e.jsxs("span", { className: "flex gap-2 items-center", children: [
|
|
977
|
+
/* @__PURE__ */ e.jsx(qe, { className: "text-neutral-strong-default", size: 24 }),
|
|
978
|
+
/* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-headline-small text-neutral-strong-default", children: "Notificaciones" })
|
|
979
|
+
] }),
|
|
980
|
+
/* @__PURE__ */ e.jsx(fe, { onClick: () => t?.(), icon: /* @__PURE__ */ e.jsx(Ie, {}), variant: "text", animate: !1, animateIcon: !1, color: "secondary", className: "size-12" })
|
|
981
|
+
] }),
|
|
982
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-3 pb-8 pt-4 px-4", children: [
|
|
983
|
+
r && v && /* @__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
|
+
v ? 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
|
+
] })
|
|
986
|
+
]
|
|
987
|
+
}
|
|
988
|
+
);
|
|
989
|
+
}, Vt = ({ onCloseClick: t, children: r, title: s = "Ayuda" }) => /* @__PURE__ */ e.jsxs(
|
|
990
|
+
"section",
|
|
991
|
+
{
|
|
992
|
+
className: "w-full md:w-[479px] bg-neutral-default-default border-l-0 md:border-l border-neutral-strong-default h-full",
|
|
993
|
+
children: [
|
|
994
|
+
/* @__PURE__ */ e.jsxs("div", { className: "w-full h-max flex gap-2 items-center justify-between pt-8 pb-2 pr-2 pl-4 border-b border-neutral-strong-default sticky top-0 z-50 bg-neutral-default-default", children: [
|
|
995
|
+
/* @__PURE__ */ e.jsxs("span", { className: "flex gap-2 items-center", children: [
|
|
996
|
+
/* @__PURE__ */ e.jsx(Ke, { className: "text-neutral-strong-default", size: 24 }),
|
|
997
|
+
/* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-headline-small text-neutral-strong-default", children: s })
|
|
998
|
+
] }),
|
|
999
|
+
/* @__PURE__ */ e.jsx(fe, { onClick: () => t?.(), icon: /* @__PURE__ */ e.jsx(Ie, {}), variant: "text", animate: !1, animateIcon: !1, color: "secondary", className: "size-12" })
|
|
1000
|
+
] }),
|
|
1001
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-3 pb-8 pt-4 px-4", children: r })
|
|
1002
|
+
]
|
|
1003
|
+
}
|
|
1004
|
+
), Wt = ({ closeSidebar: t, options: r, helpSection: s, initialSection: l, notificationsListControls: i }, n) => {
|
|
1005
|
+
const [c, m] = Z(l ?? "notifications");
|
|
1006
|
+
Le(n, () => ({
|
|
1007
|
+
setActiveSection: m
|
|
1008
|
+
}));
|
|
1009
|
+
const d = () => {
|
|
1010
|
+
t();
|
|
1011
|
+
};
|
|
1012
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1013
|
+
c === "notifications" && !r?.notificationsDrawerOptions?.hide && /* @__PURE__ */ e.jsx(
|
|
1014
|
+
Ht,
|
|
1015
|
+
{
|
|
1016
|
+
onCloseClick: d,
|
|
1017
|
+
onMarkAllAsRead: r?.notificationsDrawerOptions?.onMarkAllAsRead,
|
|
1018
|
+
notificationsListControls: i
|
|
1019
|
+
}
|
|
1020
|
+
),
|
|
1021
|
+
c === "help" && s && !r?.helpSectionDrawerOptions?.hide && /* @__PURE__ */ e.jsx(Vt, { onCloseClick: d, children: typeof s == "function" ? s() : s })
|
|
1022
|
+
] });
|
|
1023
|
+
}, it = Ne(Wt);
|
|
1024
|
+
it.displayName = "SidebarContent";
|
|
1025
|
+
const $t = ({
|
|
1026
|
+
options: t,
|
|
1027
|
+
helpSection: r,
|
|
1028
|
+
sidebarContentRef: s,
|
|
1029
|
+
initialSectionRef: l,
|
|
1030
|
+
notificationsListControls: i
|
|
1031
|
+
}) => {
|
|
1032
|
+
const { closeSidebar: n } = ie();
|
|
1033
|
+
return /* @__PURE__ */ e.jsx(
|
|
1034
|
+
it,
|
|
1035
|
+
{
|
|
1036
|
+
ref: s,
|
|
1037
|
+
closeSidebar: n,
|
|
1038
|
+
options: t,
|
|
1039
|
+
helpSection: r,
|
|
1040
|
+
initialSection: l.current,
|
|
1041
|
+
notificationsListControls: i
|
|
1042
|
+
}
|
|
1043
|
+
);
|
|
1044
|
+
}, ct = T($t);
|
|
1045
|
+
ct.displayName = "PyrionNavigationDrawer.Sidebar";
|
|
1046
|
+
const qt = ({ navigationControlsRef: t }) => {
|
|
1047
|
+
const r = ie();
|
|
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
|
+
}, 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: v, mobileAppSwitcherControls: u, notificationsListControls: N, outletRef: y, ...f } = t;
|
|
1051
|
+
return /* @__PURE__ */ e.jsxs(q, { disableDragOpen: f.options?.disableDragOpen, outletRef: y, children: [
|
|
1052
|
+
/* @__PURE__ */ e.jsx(qt, { navigationControlsRef: d }),
|
|
1053
|
+
/* @__PURE__ */ e.jsx(q.Header, { className: "flex flex-col relative w-full select-none", children: /* @__PURE__ */ e.jsx(
|
|
1054
|
+
lt,
|
|
1055
|
+
{
|
|
1056
|
+
onSystemLogoClick: f.onSystemLogoClick,
|
|
1057
|
+
state: f.state,
|
|
1058
|
+
currentSystemId: f.currentSystemId,
|
|
1059
|
+
tabs: m,
|
|
1060
|
+
mobileAppSwitcherControls: u
|
|
1061
|
+
}
|
|
1062
|
+
) }, "PL-Header"),
|
|
1063
|
+
/* @__PURE__ */ e.jsx(q.Content, { className: "overflow-hidden flex flex-col relative flex-1 w-[285px] md:w-auto", children: /* @__PURE__ */ e.jsx(
|
|
1064
|
+
at,
|
|
1065
|
+
{
|
|
1066
|
+
navlinks: f.links,
|
|
1067
|
+
handleNavigation: n,
|
|
1068
|
+
allActions: c,
|
|
1069
|
+
activeActionId: f.activeActionId,
|
|
1070
|
+
onActionClick: f.onActionClick
|
|
1071
|
+
}
|
|
1072
|
+
) }, "PL-Content"),
|
|
1073
|
+
/* @__PURE__ */ e.jsx(q.Footer, { className: "md:min-h-max flex flex-col w-full overflow-hidden max-w-full", children: /* @__PURE__ */ e.jsx(
|
|
1074
|
+
ot,
|
|
1075
|
+
{
|
|
1076
|
+
state: f.state,
|
|
1077
|
+
currentAppSessions: s,
|
|
1078
|
+
resolveUserSecondarySlot: l,
|
|
1079
|
+
resolveSessionSecondarySlot: i,
|
|
1080
|
+
onSessionClick: f.onSessionClick,
|
|
1081
|
+
onLogoutClick: f.onLogoutClick,
|
|
1082
|
+
options: f.options,
|
|
1083
|
+
currentSystemId: f.currentSystemId,
|
|
1084
|
+
userOptionsControls: v,
|
|
1085
|
+
mobileAppSwitcherControls: u,
|
|
1086
|
+
onProfileClick: f.onProfileClick
|
|
1087
|
+
}
|
|
1088
|
+
) }, "PL-Footer"),
|
|
1089
|
+
/* @__PURE__ */ e.jsx(q.Outlet, { children: /* @__PURE__ */ e.jsx(dt, { children: r }) }),
|
|
1090
|
+
/* @__PURE__ */ e.jsx(
|
|
1091
|
+
q.Sidebar,
|
|
1092
|
+
{
|
|
1093
|
+
className: "bg-neutral-default-default",
|
|
1094
|
+
modal: f.options?.sidebarOptions?.modal,
|
|
1095
|
+
closeOnOverlayClick: f.options?.sidebarOptions?.closeOnOverlayClick,
|
|
1096
|
+
children: /* @__PURE__ */ e.jsx(
|
|
1097
|
+
ct,
|
|
1098
|
+
{
|
|
1099
|
+
options: f.options,
|
|
1100
|
+
helpSection: f.helpSection,
|
|
1101
|
+
sidebarContentRef: h,
|
|
1102
|
+
initialSectionRef: b,
|
|
1103
|
+
notificationsListControls: N
|
|
1104
|
+
}
|
|
1105
|
+
)
|
|
1106
|
+
}
|
|
1107
|
+
)
|
|
1108
|
+
] });
|
|
1109
|
+
}, Ae = T(Kt, (t, r) => {
|
|
1110
|
+
const { children: s, ...l } = t, { children: i, ...n } = r, c = Object.keys(l), m = Object.keys(n);
|
|
1111
|
+
if (c.length !== m.length)
|
|
1112
|
+
return !1;
|
|
1113
|
+
for (const d of c) {
|
|
1114
|
+
if (!Object.prototype.hasOwnProperty.call(n, d))
|
|
1115
|
+
return !1;
|
|
1116
|
+
const h = l[d], b = n[d];
|
|
1117
|
+
if (h !== b)
|
|
1118
|
+
return !1;
|
|
1119
|
+
}
|
|
1120
|
+
return !0;
|
|
1121
|
+
});
|
|
1122
|
+
Ae.displayName = "PyrionNavigationDrawer.LayoutBase";
|
|
1123
|
+
const dt = T(({ children: t }) => /* @__PURE__ */ e.jsx(q.Outlet, { children: t }));
|
|
1124
|
+
dt.displayName = "PyrionNavigationDrawer.IsolatedOutlet";
|
|
1125
|
+
const ut = Oe(null), br = () => {
|
|
1126
|
+
const t = pt(ut);
|
|
1127
|
+
if (!t)
|
|
1128
|
+
throw new Error("usePyrionNavigation debe usarse dentro de PyrionNavigationDrawer");
|
|
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: v, onSessionClick: u, onSystemLogoClick: N, onProfileClick: y, ...f }) => {
|
|
1131
|
+
const D = Object.assign({
|
|
1132
|
+
closeDrawerOnNavigate: !0,
|
|
1133
|
+
disableDragOpen: {
|
|
1134
|
+
sidebar: !0,
|
|
1135
|
+
drawer: !1
|
|
1136
|
+
}
|
|
1137
|
+
}, f.options), P = bt(), R = We(), k = I(null), j = I({}), K = I(null), Y = I("notifications"), J = I(null), te = I(null), H = I(null), [M, E] = Z(0), [V, W] = Z(!1), [re, ne] = Z(null), se = x((a) => {
|
|
1138
|
+
if (W(!1), i) {
|
|
1139
|
+
i(a);
|
|
1140
|
+
return;
|
|
1141
|
+
}
|
|
1142
|
+
const w = window.location.pathname;
|
|
1143
|
+
P(a), D.closeDrawerOnNavigate && ft() && !j.current?.getIsCollapsed?.() && j.current?.toggleCollapse?.(), n && n(w, a);
|
|
1144
|
+
}, [i, n, P]), ce = (a) => {
|
|
1145
|
+
a && window.open(a, "_blank");
|
|
1146
|
+
}, pe = {
|
|
1147
|
+
system: {
|
|
1148
|
+
mobile: ce,
|
|
1149
|
+
desktop: (a) => {
|
|
1150
|
+
typeof window < "u" && a && (window.location.href = a);
|
|
1151
|
+
}
|
|
1152
|
+
},
|
|
1153
|
+
product: {
|
|
1154
|
+
mobile: ce,
|
|
1155
|
+
desktop: ce
|
|
1156
|
+
}
|
|
1157
|
+
}, Me = x((a) => {
|
|
1158
|
+
const w = R ? "mobile" : "desktop", L = s.enabled_systems.find((C) => C.name === a)?.url;
|
|
1159
|
+
pe.system[w](L), b?.onTabClick?.(a);
|
|
1160
|
+
}, [R, s.enabled_systems, b?.onTabClick]), ae = x((a) => {
|
|
1161
|
+
const w = R ? "mobile" : "desktop", L = s.company.products?.find((C) => C.name === a)?.domain;
|
|
1162
|
+
pe.product[w](L), b?.onTabClick?.(a);
|
|
1163
|
+
}, [R, s.company.products, b?.onTabClick]), Be = x((a, w) => {
|
|
1164
|
+
if (w) {
|
|
1165
|
+
w(a), b?.onTabClick?.(a);
|
|
1166
|
+
return;
|
|
1167
|
+
} else
|
|
1168
|
+
b?.onTabClick?.(a);
|
|
1169
|
+
}, [b?.onTabClick]), Ce = x(() => {
|
|
1170
|
+
const a = {};
|
|
1171
|
+
s.enabled_systems.forEach((L) => {
|
|
1172
|
+
a[L.url] = L.name;
|
|
1173
|
+
});
|
|
1174
|
+
const w = window.location.origin;
|
|
1175
|
+
for (const [L, C] of Object.entries(a))
|
|
1176
|
+
if (w === L)
|
|
1177
|
+
return C;
|
|
1178
|
+
return "";
|
|
1179
|
+
}, [s.enabled_systems]), je = b?.currentTabName || Ce(), G = ue(
|
|
1180
|
+
() => s.sessions || [],
|
|
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, w) => {
|
|
1183
|
+
if (!a) return null;
|
|
1184
|
+
if (Array.isArray(a)) {
|
|
1185
|
+
const L = a?.[0] ? xe(w, a[0]) : null, C = a?.[1] ? xe(w, a[1]) : null, z = oe(L), de = oe(C);
|
|
1186
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
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
|
+
de && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1 flex-1 grow shrink-0 min-w-[40%] overflow-hidden", children: [
|
|
1189
|
+
/* @__PURE__ */ e.jsx("span", { className: "size-0.5 bg-[--neutral-300] rounded-full" }),
|
|
1190
|
+
/* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-body-small text-neutral-default-default line-clamp-1 whitespace-pre text-ellipsis", children: de })
|
|
1191
|
+
] })
|
|
1192
|
+
] });
|
|
1193
|
+
}
|
|
1194
|
+
if (typeof a == "string") {
|
|
1195
|
+
const L = xe(w, a);
|
|
1196
|
+
return oe(L);
|
|
1197
|
+
}
|
|
1198
|
+
return typeof a == "function" ? oe(a(w)) : null;
|
|
1199
|
+
}, []), p = x(
|
|
1200
|
+
(a) => {
|
|
1201
|
+
const w = D?.userCardOptions?.secondarySlot;
|
|
1202
|
+
if (!w) return null;
|
|
1203
|
+
const L = s.enabled_systems?.find((z) => z._id === v), C = { company: s.company, user: s.user, system: L, metadata: a };
|
|
1204
|
+
return o(w, C);
|
|
1205
|
+
},
|
|
1206
|
+
[v, D?.userCardOptions?.secondarySlot, o, s.company, s.enabled_systems, s.user]
|
|
1207
|
+
), g = x(
|
|
1208
|
+
(a) => {
|
|
1209
|
+
const w = D?.sessionCardOptions?.secondarySlot || D?.userCardOptions?.secondarySlot;
|
|
1210
|
+
if (!w) return null;
|
|
1211
|
+
const L = s.enabled_systems?.find((z) => z._id === v), C = { company: s.company, user: a.auth_id, metadata: a?.metadata, system: L };
|
|
1212
|
+
return o(w, C);
|
|
1213
|
+
},
|
|
1214
|
+
[v, D?.sessionCardOptions?.secondarySlot, D?.userCardOptions?.secondarySlot, o, s.company]
|
|
1215
|
+
), O = ue(() => {
|
|
1216
|
+
const a = [];
|
|
1217
|
+
return j.current.openNotifications = () => {
|
|
1218
|
+
Y.current = "notifications", j.current.openSidebar?.(), K.current?.setActiveSection("notifications");
|
|
1219
|
+
}, j.current.openHelp = () => {
|
|
1220
|
+
Y.current = "help", j.current.openSidebar?.(), K.current?.setActiveSection("help");
|
|
1221
|
+
}, !D?.notificationsDrawerOptions?.hideActionButton && !D?.notificationsDrawerOptions?.hide && a.push({
|
|
1222
|
+
id: "notifications",
|
|
1223
|
+
title: "Notificaciones",
|
|
1224
|
+
icon: qe,
|
|
1225
|
+
onClick: j.current.openNotifications,
|
|
1226
|
+
count: M
|
|
1227
|
+
}), !D?.helpSectionDrawerOptions?.hideActionButton && r && !D?.helpSectionDrawerOptions?.hide && a.push({
|
|
1228
|
+
id: "help",
|
|
1229
|
+
title: "Ayuda",
|
|
1230
|
+
icon: Ke,
|
|
1231
|
+
onClick: j.current.openHelp
|
|
1232
|
+
}), D?.configurationActionOptions?.onClick && !D?.configurationActionOptions?.hideActionButton && a.push({
|
|
1233
|
+
id: "configuration",
|
|
1234
|
+
title: "Configuracion",
|
|
1235
|
+
icon: St,
|
|
1236
|
+
onClick: D.configurationActionOptions?.onClick
|
|
1237
|
+
}), a;
|
|
1238
|
+
}, [D, r, h, M]), B = ue(
|
|
1239
|
+
() => [...O, ...m || []],
|
|
1240
|
+
[O, m]
|
|
1241
|
+
), _ = ue(() => {
|
|
1242
|
+
const a = s.enabled_systems.map((C) => ({
|
|
1243
|
+
name: C.name,
|
|
1244
|
+
thumbnail: C.thumbnail,
|
|
1245
|
+
onClick: Me,
|
|
1246
|
+
id: C._id
|
|
1247
|
+
})) || [], w = b?.customTabs?.map((C) => ({
|
|
1248
|
+
...C,
|
|
1249
|
+
onClick: () => Be(C.name, C?.onClick)
|
|
1250
|
+
})) || [], L = s.company.products?.map((C) => ({
|
|
1251
|
+
name: C.name,
|
|
1252
|
+
thumbnail: C.thumbnail,
|
|
1253
|
+
onClick: ae
|
|
1254
|
+
})) || [];
|
|
1255
|
+
return [...a, ...w, ...L];
|
|
1256
|
+
}, [s.enabled_systems, s.company.products, b?.customTabs]), Q = x((a) => {
|
|
1257
|
+
k.current?.addNewNotification ? k.current.addNewNotification(a) : console.warn("Notifications controls not ready yet");
|
|
1258
|
+
}, []), $ = x((a) => k.current?.subscribeToUpdates ? k.current.subscribeToUpdates(a) : (console.warn("Notifications controls not ready yet"), () => {
|
|
1259
|
+
}), []), le = x((a) => {
|
|
1260
|
+
k.current?.removeNotification ? k.current.removeNotification(a) : console.warn("Notifications controls not ready yet");
|
|
1261
|
+
}, []), he = x(() => {
|
|
1262
|
+
k.current?.removeAllNotifications ? k.current.removeAllNotifications() : console.warn("Notifications controls not ready yet");
|
|
1263
|
+
}, []), be = x((a) => {
|
|
1264
|
+
k.current?.setNotifications ? k.current.setNotifications(a) : console.warn("Notifications controls not ready yet");
|
|
1265
|
+
}, []), S = x((a, w, 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", w ? "fixed" : "sticky"), children: [
|
|
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
|
+
typeof a == "function" ? a() : a
|
|
1269
|
+
] });
|
|
1270
|
+
let z;
|
|
1271
|
+
return w ? 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
|
+
}, [H]), U = x(() => {
|
|
1273
|
+
W(!1);
|
|
1274
|
+
}, []);
|
|
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, w) => {
|
|
1277
|
+
E(w);
|
|
1278
|
+
});
|
|
1279
|
+
}, [$]), /* @__PURE__ */ e.jsxs(ut.Provider, { value: j.current, children: [
|
|
1280
|
+
V && re,
|
|
1281
|
+
R ? /* @__PURE__ */ e.jsx("div", { className: "flex h-screen", children: /* @__PURE__ */ e.jsx(
|
|
1282
|
+
Ae,
|
|
1283
|
+
{
|
|
1284
|
+
links: l,
|
|
1285
|
+
handleNavigation: se,
|
|
1286
|
+
allActions: B,
|
|
1287
|
+
activeActionId: d,
|
|
1288
|
+
onActionClick: h,
|
|
1289
|
+
state: s,
|
|
1290
|
+
currentAppSessions: G,
|
|
1291
|
+
resolveUserSecondarySlot: p,
|
|
1292
|
+
resolveSessionSecondarySlot: g,
|
|
1293
|
+
onSessionClick: u,
|
|
1294
|
+
onLogoutClick: c,
|
|
1295
|
+
options: D,
|
|
1296
|
+
currentSystemId: v,
|
|
1297
|
+
userOptionsControls: J,
|
|
1298
|
+
mobileAppSwitcherControls: te,
|
|
1299
|
+
onSystemLogoClick: N,
|
|
1300
|
+
tabs: _,
|
|
1301
|
+
helpSection: r,
|
|
1302
|
+
sidebarContentRef: K,
|
|
1303
|
+
initialSectionRef: Y,
|
|
1304
|
+
navigationControlsRef: j,
|
|
1305
|
+
notificationsListControls: k,
|
|
1306
|
+
outletRef: H,
|
|
1307
|
+
onProfileClick: y,
|
|
1308
|
+
children: t
|
|
1309
|
+
}
|
|
1310
|
+
) }) : /* @__PURE__ */ e.jsxs("div", { className: "flex h-screen", children: [
|
|
1311
|
+
_.length > 0 && /* @__PURE__ */ e.jsx(
|
|
1312
|
+
gt,
|
|
1313
|
+
{
|
|
1314
|
+
className: "hidden md:flex",
|
|
1315
|
+
tabs: _,
|
|
1316
|
+
activeColor: "var(--neutral-900)",
|
|
1317
|
+
currentTabName: je,
|
|
1318
|
+
currentSystemId: v
|
|
1319
|
+
}
|
|
1320
|
+
),
|
|
1321
|
+
/* @__PURE__ */ e.jsx(
|
|
1322
|
+
Ae,
|
|
1323
|
+
{
|
|
1324
|
+
links: l,
|
|
1325
|
+
handleNavigation: se,
|
|
1326
|
+
allActions: B,
|
|
1327
|
+
activeActionId: d,
|
|
1328
|
+
onActionClick: h,
|
|
1329
|
+
state: s,
|
|
1330
|
+
currentAppSessions: G,
|
|
1331
|
+
resolveUserSecondarySlot: p,
|
|
1332
|
+
resolveSessionSecondarySlot: g,
|
|
1333
|
+
onSessionClick: u,
|
|
1334
|
+
onLogoutClick: c,
|
|
1335
|
+
options: D,
|
|
1336
|
+
currentSystemId: v,
|
|
1337
|
+
userOptionsControls: J,
|
|
1338
|
+
mobileAppSwitcherControls: te,
|
|
1339
|
+
onSystemLogoClick: N,
|
|
1340
|
+
tabs: _,
|
|
1341
|
+
helpSection: r,
|
|
1342
|
+
sidebarContentRef: K,
|
|
1343
|
+
initialSectionRef: Y,
|
|
1344
|
+
navigationControlsRef: j,
|
|
1345
|
+
notificationsListControls: k,
|
|
1346
|
+
outletRef: H,
|
|
1347
|
+
onProfileClick: y,
|
|
1348
|
+
children: t
|
|
1349
|
+
}
|
|
1350
|
+
)
|
|
1351
|
+
] })
|
|
1352
|
+
] });
|
|
1353
|
+
};
|
|
1354
|
+
export {
|
|
1355
|
+
xr as default,
|
|
1356
|
+
br as u
|
|
1357
|
+
};
|