prometeo-design-system 3.1.4 → 3.1.6
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/{DatePicker-CehTiXGa.js → DatePicker-6eb-0Ns5.js} +1339 -1237
- package/dist/DatePicker.es.js +1 -1
- package/dist/Icons/Reassignment.d.ts +6 -0
- package/dist/Icons/Reassignment.es.js +22 -0
- package/dist/Icons/ReassignmentFill.d.ts +6 -0
- package/dist/Icons/ReassignmentFill.es.js +52 -0
- package/dist/Icons/Send.d.ts +6 -0
- package/dist/Icons/Send.es.js +24 -0
- package/dist/Icons/components/Reassignment.d.ts +4 -0
- package/dist/Icons/components/ReassignmentFill.d.ts +4 -0
- package/dist/Icons/components/Send.d.ts +4 -0
- package/dist/Icons/index.d.ts +3 -0
- package/dist/Icons/types.d.ts +6 -0
- package/dist/Icons.es.js +56 -50
- package/dist/NotificationCard.d.ts +6 -0
- package/dist/NotificationCard.es.js +50 -0
- package/dist/PyrionNavigationDrawer.d.ts +6 -0
- package/dist/PyrionNavigationDrawer.es.js +962 -0
- package/dist/RecurrentDatePicker.es.js +2 -2
- package/dist/RecurrentDatePickerRRule.es.js +1 -1
- package/dist/Select.es.js +1059 -2
- package/dist/SelectSearch.es.js +67 -66
- package/dist/TicketCard.d.ts +6 -0
- package/dist/TicketCard.es.js +130 -0
- package/dist/badge-B1IK_-i5.js +87 -0
- package/dist/components/NotificationCard/index.d.ts +3 -0
- package/dist/components/PyrionNavigationDrawer/index.d.ts +3 -0
- package/dist/components/TicketCard/index.d.ts +3 -0
- package/dist/exports/NotificationCard.d.ts +2 -0
- package/dist/exports/PyrionNavigationDrawer.d.ts +2 -0
- package/dist/exports/TicketCard.d.ts +2 -0
- package/dist/exports/usePyrionNavigation.d.ts +1 -0
- package/dist/prometeo-design-system.es.js +287 -365
- package/dist/usePyrionNavigation.d.ts +4 -0
- package/dist/usePyrionNavigation.es.js +4 -0
- package/dist/utils-X4-h3cum.js +54 -0
- package/package.json +17 -1
- package/dist/Select-BdxmkrjB.js +0 -1111
|
@@ -0,0 +1,962 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-GkKLlHH4.js";
|
|
2
|
+
import { useIsMobile as Me } from "./useDevice.es.js";
|
|
3
|
+
import { g as te } from "./utils-X4-h3cum.js";
|
|
4
|
+
import q, { memo as A, forwardRef as ae, useState as se, useEffect as W, useRef as O, useCallback as N, useMemo as Fe, Children as ze, isValidElement as ue, useImperativeHandle as we, useContext as Be, createContext as Ue } from "react";
|
|
5
|
+
import { useNavigate as Ve } from "react-router";
|
|
6
|
+
import { c as j } from "./cn-B6yFEsav.js";
|
|
7
|
+
import { CloseNavBarDesktop as He } from "./Icons/CloseNavBarDesktop.es.js";
|
|
8
|
+
import { c as pe } from "./index-BOQuZ0gG.js";
|
|
9
|
+
import { B as $e, T as qe } from "./badge-B1IK_-i5.js";
|
|
10
|
+
import { CrevronLeft as We } from "./Icons/CrevronLeft.es.js";
|
|
11
|
+
import { Scrollable as le } from "./Scrollable.es.js";
|
|
12
|
+
import H from "./TicketCard.es.js";
|
|
13
|
+
import Ge from "./Avatar.es.js";
|
|
14
|
+
import Je from "./NotificationCard.es.js";
|
|
15
|
+
import { Notifications as Ne } from "./Icons/Notifications.es.js";
|
|
16
|
+
import ne from "./Button.es.js";
|
|
17
|
+
import { Close as je } from "./Icons/Close.es.js";
|
|
18
|
+
import { Help as ye } from "./Icons/Help.es.js";
|
|
19
|
+
import { Logout as Ke } from "./Icons/Logout.es.js";
|
|
20
|
+
import { Settings as Qe } from "./Icons/Settings.es.js";
|
|
21
|
+
const Q = (a, l) => typeof a == "function" ? l ? a(l) : null : a, Xe = (a) => {
|
|
22
|
+
const { children: l, classNameDrawer: s, classNameSidebar: n } = a, d = O(null), o = O(null), i = O(null), f = O(null), b = O(!1), x = O(!1), v = O("drawer"), y = O(/* @__PURE__ */ new Set()), g = O(/* @__PURE__ */ new Set()), u = N((r) => {
|
|
23
|
+
const p = o.current;
|
|
24
|
+
p && (p.classList.toggle("collapsed", r), p.classList.toggle("expanded", !r));
|
|
25
|
+
}, []), S = N((r) => {
|
|
26
|
+
const p = f.current;
|
|
27
|
+
p && (p.classList.toggle("collapsed", r), p.classList.toggle("expanded", !r));
|
|
28
|
+
}, []), D = N(
|
|
29
|
+
(r, { notify: p = !0 } = {}) => {
|
|
30
|
+
const t = b.current !== r;
|
|
31
|
+
b.current = r, u(r), p && t && y.current.forEach((c) => c(r));
|
|
32
|
+
},
|
|
33
|
+
[u]
|
|
34
|
+
), T = N(
|
|
35
|
+
(r, { notify: p = !0 } = {}) => {
|
|
36
|
+
const t = x.current !== r;
|
|
37
|
+
if (x.current = r, S(r), p && t) {
|
|
38
|
+
const c = !r;
|
|
39
|
+
g.current.forEach((h) => h(c));
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
[S]
|
|
43
|
+
), m = N(
|
|
44
|
+
(r, { notify: p = !0 } = {}) => {
|
|
45
|
+
const t = v.current, c = t !== r;
|
|
46
|
+
v.current = r, window.matchMedia("(min-width: 768px)").matches || D(r !== "drawer", { notify: p });
|
|
47
|
+
const h = t === "sidebar", w = r === "sidebar";
|
|
48
|
+
p && c && h !== w && g.current.forEach((_) => _(w));
|
|
49
|
+
},
|
|
50
|
+
[D]
|
|
51
|
+
), I = N((r) => {
|
|
52
|
+
const p = d.current;
|
|
53
|
+
if (!p || window.matchMedia("(min-width: 768px)").matches) return;
|
|
54
|
+
const t = i.current?.offsetLeft ?? 0, c = f.current?.offsetLeft ?? t, h = r === "drawer" ? 0 : r === "sidebar" ? c : t;
|
|
55
|
+
p.scrollTo({ left: h, behavior: "smooth" });
|
|
56
|
+
}, []), E = N(() => {
|
|
57
|
+
const r = d.current, p = i.current;
|
|
58
|
+
if (!r || !p || window.matchMedia("(min-width: 768px)").matches) return;
|
|
59
|
+
const t = [
|
|
60
|
+
{ panel: "drawer", offset: 0 },
|
|
61
|
+
{ panel: "outlet", offset: p.offsetLeft }
|
|
62
|
+
], c = f.current;
|
|
63
|
+
c && t.push({ panel: "sidebar", offset: c.offsetLeft });
|
|
64
|
+
const h = r.scrollLeft;
|
|
65
|
+
let w = t[0], _ = Math.abs(h - w.offset);
|
|
66
|
+
for (let P = 1; P < t.length; P++) {
|
|
67
|
+
const Z = Math.abs(h - t[P].offset);
|
|
68
|
+
Z < _ && (w = t[P], _ = Z);
|
|
69
|
+
}
|
|
70
|
+
m(w.panel);
|
|
71
|
+
}, [m]);
|
|
72
|
+
W(() => {
|
|
73
|
+
const r = d.current, p = i.current;
|
|
74
|
+
if (!r || !p) return;
|
|
75
|
+
if (window.matchMedia("(min-width: 768px)").matches) {
|
|
76
|
+
D(!1, { notify: !1 }), T(!0, { notify: !1 });
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
requestAnimationFrame(() => {
|
|
80
|
+
r.scrollLeft = p.offsetLeft, m("outlet");
|
|
81
|
+
});
|
|
82
|
+
}, [m, D]), W(() => {
|
|
83
|
+
const r = d.current;
|
|
84
|
+
if (!r) return;
|
|
85
|
+
let p = !1;
|
|
86
|
+
const t = () => {
|
|
87
|
+
window.matchMedia("(min-width: 768px)").matches || p || (p = !0, requestAnimationFrame(() => {
|
|
88
|
+
E(), p = !1;
|
|
89
|
+
}));
|
|
90
|
+
};
|
|
91
|
+
return r.addEventListener("scroll", t, { passive: !0 }), () => r.removeEventListener("scroll", t);
|
|
92
|
+
}, [E]);
|
|
93
|
+
const F = N(() => {
|
|
94
|
+
const r = window.matchMedia("(min-width: 768px)").matches, p = !b.current;
|
|
95
|
+
if (r) {
|
|
96
|
+
D(p);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const t = p ? "outlet" : "drawer";
|
|
100
|
+
m(t), I(t);
|
|
101
|
+
}, [I, m, D]), R = Fe(
|
|
102
|
+
() => ({
|
|
103
|
+
toggleCollapse: F,
|
|
104
|
+
getIsCollapsed: () => b.current,
|
|
105
|
+
subscribeToCollapse: (r) => (y.current.add(r), () => {
|
|
106
|
+
y.current.delete(r);
|
|
107
|
+
}),
|
|
108
|
+
openSidebar: () => {
|
|
109
|
+
if (f.current) {
|
|
110
|
+
if (window.matchMedia("(min-width: 768px)").matches) {
|
|
111
|
+
T(!1);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
m("sidebar"), I("sidebar");
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
closeSidebar: () => {
|
|
118
|
+
if (window.matchMedia("(min-width: 768px)").matches) {
|
|
119
|
+
T(!0);
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
m("outlet"), I("outlet");
|
|
123
|
+
},
|
|
124
|
+
toggleSidebar: () => {
|
|
125
|
+
if (!f.current) return;
|
|
126
|
+
if (window.matchMedia("(min-width: 768px)").matches) {
|
|
127
|
+
T(!x.current);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
const r = v.current === "sidebar" ? "outlet" : "sidebar";
|
|
131
|
+
m(r), I(r);
|
|
132
|
+
},
|
|
133
|
+
getIsSidebarOpen: () => f.current ? window.matchMedia("(min-width: 768px)").matches ? !x.current : v.current === "sidebar" : !1,
|
|
134
|
+
subscribeToSidebarOpen: (r) => (g.current.add(r), () => {
|
|
135
|
+
g.current.delete(r);
|
|
136
|
+
})
|
|
137
|
+
}),
|
|
138
|
+
[F, I, m, T]
|
|
139
|
+
), z = typeof l == "function" ? l(R) : l, X = ze.toArray(z);
|
|
140
|
+
let B = null, U = null, k = null;
|
|
141
|
+
const C = [];
|
|
142
|
+
let L = null, G = null;
|
|
143
|
+
X.forEach((r) => {
|
|
144
|
+
if (!ue(r)) {
|
|
145
|
+
C.push(r);
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
if (r.type === ke && !B) {
|
|
149
|
+
B = q.cloneElement(r, { context: R });
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
if (r.type === re && !U) {
|
|
153
|
+
U = q.cloneElement(r, { context: R });
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
if (r.type === fe && !k) {
|
|
157
|
+
k = q.cloneElement(r, { context: R });
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
if (r.type === me && !L) {
|
|
161
|
+
L = q.cloneElement(r, { context: R });
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
if (r.type === Se && !G) {
|
|
165
|
+
G = q.cloneElement(r, { context: R });
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
C.push(r);
|
|
169
|
+
});
|
|
170
|
+
const oe = !!U, ie = U ?? (C.length ? /* @__PURE__ */ e.jsx(re, { context: R, children: C }) : null), ce = oe ? C : [], V = L ?? (!!L ? /* @__PURE__ */ e.jsx(me, { context: R, children: z }) : null), K = k ?? (!!k ? /* @__PURE__ */ e.jsx(fe, { context: R, children: k }) : null), J = !!G, $ = G;
|
|
171
|
+
return /* @__PURE__ */ e.jsxs("div", { ref: d, className: j("w-full h-full overflow-y-hidden", J ? "navigation-drawer-with-sidebar" : "navigation-drawer"), children: [
|
|
172
|
+
/* @__PURE__ */ e.jsxs(
|
|
173
|
+
"div",
|
|
174
|
+
{
|
|
175
|
+
ref: o,
|
|
176
|
+
className: j(
|
|
177
|
+
"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",
|
|
178
|
+
"expanded w-min",
|
|
179
|
+
s
|
|
180
|
+
),
|
|
181
|
+
children: [
|
|
182
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col flex-1 gap-4 overflow-hidden", children: [
|
|
183
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
184
|
+
/* @__PURE__ */ e.jsx(Ce, { onToggleCollapse: F }),
|
|
185
|
+
B
|
|
186
|
+
] }),
|
|
187
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-1 overflow-hidden relative flex-col", children: [
|
|
188
|
+
ce,
|
|
189
|
+
ie
|
|
190
|
+
] })
|
|
191
|
+
] }),
|
|
192
|
+
K
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
),
|
|
196
|
+
V && ue(V) ? q.cloneElement(V, { ref: i }) : V,
|
|
197
|
+
$ && ue($) ? q.cloneElement($, {
|
|
198
|
+
ref: f,
|
|
199
|
+
className: j("sidebar", "collapsed", $.props?.className, n)
|
|
200
|
+
}) : $
|
|
201
|
+
] });
|
|
202
|
+
}, be = A(Xe), Ce = A(({ onToggleCollapse: a }) => /* @__PURE__ */ e.jsx(
|
|
203
|
+
"button",
|
|
204
|
+
{
|
|
205
|
+
type: "button",
|
|
206
|
+
onClick: a,
|
|
207
|
+
className: "collapse-button cursor-pointer text-neutral-default-default hover:text-primary-default transition-colors duration-300 w-max",
|
|
208
|
+
children: /* @__PURE__ */ e.jsx(He, { size: 32, className: "transition-transform duration-300 p-1" })
|
|
209
|
+
}
|
|
210
|
+
));
|
|
211
|
+
Ce.displayName = "NavigationDrawerCollapseButton";
|
|
212
|
+
const ke = A(({ children: a, className: l, context: s }) => {
|
|
213
|
+
const n = Q(a, s);
|
|
214
|
+
return /* @__PURE__ */ e.jsx("div", { className: j("flex items-center justify-between", l), children: n });
|
|
215
|
+
}), re = A(({ children: a, className: l, context: s, ...n }) => {
|
|
216
|
+
const d = Q(a, s);
|
|
217
|
+
return /* @__PURE__ */ e.jsx("div", { ...n, className: j("w-full flex-1 drawer-content", l), children: d });
|
|
218
|
+
});
|
|
219
|
+
re.displayName = "NavigationDrawerContent";
|
|
220
|
+
const fe = A(({ children: a, className: l, context: s }) => {
|
|
221
|
+
const n = Q(a, s);
|
|
222
|
+
return /* @__PURE__ */ e.jsx("div", { className: j("flex items-center justify-between", l), children: n });
|
|
223
|
+
}), Ye = A(({ className: a }) => /* @__PURE__ */ e.jsx("div", { className: j("w-full border-t border-neutral-strong-default ", a) })), me = A(ae(({ children: a, className: l, context: s }, n) => {
|
|
224
|
+
const d = Q(a, s);
|
|
225
|
+
return /* @__PURE__ */ e.jsx("div", { ref: n, className: j("flex-1 overflow-auto ", l), children: d });
|
|
226
|
+
})), Se = A(ae(({ children: a, className: l, context: s, modal: n = !1, closeOnOverlayClick: d = !1, unmountChildrenOnClose: o = !0 }, i) => {
|
|
227
|
+
const f = Q(a, s), b = typeof window < "u" && window.matchMedia("(min-width: 768px)").matches, [x, v] = se(() => !o), [y, g] = se(!1);
|
|
228
|
+
return W(() => {
|
|
229
|
+
o && s?.subscribeToSidebarOpen((u) => {
|
|
230
|
+
u ? (g(!1), v(!0)) : g(!0);
|
|
231
|
+
});
|
|
232
|
+
}, [o]), W(() => {
|
|
233
|
+
const u = i && typeof i == "object" && "current" in i ? i.current : null;
|
|
234
|
+
if (!u) return;
|
|
235
|
+
const S = () => {
|
|
236
|
+
y && (v(!1), g(!1));
|
|
237
|
+
};
|
|
238
|
+
return u.addEventListener("transitionend", S), () => u.removeEventListener("transitionend", S);
|
|
239
|
+
}, [y]), /* @__PURE__ */ e.jsxs("div", { ref: i, className: j("sidebar", b ? "collapsed" : "expanded", "h-full overflow-auto", l), "aria-modal": n || void 0, children: [
|
|
240
|
+
n && b && /* @__PURE__ */ e.jsx(
|
|
241
|
+
"div",
|
|
242
|
+
{
|
|
243
|
+
className: j("navigation-drawer-sidebar-overlay"),
|
|
244
|
+
onClick: (u) => {
|
|
245
|
+
u.preventDefault(), u.stopPropagation(), d && s?.closeSidebar?.();
|
|
246
|
+
},
|
|
247
|
+
"aria-hidden": "true"
|
|
248
|
+
}
|
|
249
|
+
),
|
|
250
|
+
/* @__PURE__ */ e.jsxs("div", { className: j("navigation-drawer-sidebar-inner"), children: [
|
|
251
|
+
/* @__PURE__ */ e.jsx("div", { className: "secure-click-margin" }),
|
|
252
|
+
x && f
|
|
253
|
+
] })
|
|
254
|
+
] });
|
|
255
|
+
})), M = Object.assign(be, {
|
|
256
|
+
Root: be,
|
|
257
|
+
Header: ke,
|
|
258
|
+
Content: re,
|
|
259
|
+
Footer: fe,
|
|
260
|
+
Spacer: Ye,
|
|
261
|
+
Outlet: me,
|
|
262
|
+
Sidebar: Se
|
|
263
|
+
});
|
|
264
|
+
M.displayName = "NavigationDrawer";
|
|
265
|
+
const Ze = "hover:bg-neutral-medium-hover", et = pe("", {
|
|
266
|
+
variants: {
|
|
267
|
+
isSelected: {
|
|
268
|
+
true: "bg-neutral-medium-selected ",
|
|
269
|
+
false: ""
|
|
270
|
+
},
|
|
271
|
+
disabled: {
|
|
272
|
+
true: "bg-transparent hover:bg-transparent active:bg-transparent focus:bg-transparent",
|
|
273
|
+
false: "cursor-pointer"
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}), tt = pe(
|
|
277
|
+
j(
|
|
278
|
+
"select-none",
|
|
279
|
+
"prometeo-fonts-label-large transition-colors duration-300 ease-out"
|
|
280
|
+
),
|
|
281
|
+
{
|
|
282
|
+
variants: {
|
|
283
|
+
isSelected: {
|
|
284
|
+
true: "text-primary-default-default",
|
|
285
|
+
false: "text-neutral-default-default"
|
|
286
|
+
},
|
|
287
|
+
disabled: {
|
|
288
|
+
true: "text-primary-default-disabled",
|
|
289
|
+
false: "cursor-pointer"
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
compoundVariants: [
|
|
293
|
+
{ isSelected: !0, disabled: !0, className: "text-neutral-strong-disabled hover:text-neutral-strong-disabled focus:text-neutral-strong-disabled active:text-neutral-strong-disabled" },
|
|
294
|
+
{ isSelected: !1, disabled: !0, className: "text-neutral-strong-disabled hover:text-neutral-strong-disabled focus:text-neutral-strong-disabled active:text-neutral-strong-disabled" },
|
|
295
|
+
{ isSelected: !0, disabled: !1, className: " text-primary-default-default group-active:text-neutral-default-pressed group-focus:text-neutral-default-pressed" },
|
|
296
|
+
{ isSelected: !1, disabled: !1, className: " text-neutral-default-default group-active:text-neutral-default-pressed group-focus:text-neutral-default-pressed" }
|
|
297
|
+
]
|
|
298
|
+
}
|
|
299
|
+
), ge = pe(
|
|
300
|
+
j(
|
|
301
|
+
"transition-colors duration-300 ease-out"
|
|
302
|
+
),
|
|
303
|
+
{
|
|
304
|
+
variants: {
|
|
305
|
+
isSelected: {
|
|
306
|
+
true: "",
|
|
307
|
+
false: ""
|
|
308
|
+
},
|
|
309
|
+
disabled: {
|
|
310
|
+
true: "",
|
|
311
|
+
false: "cursor-pointer"
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
compoundVariants: [
|
|
315
|
+
{ isSelected: !0, disabled: !0, className: "text-neutral-strong-disabled hover:text-neutral-strong-disabled focus:text-neutral-strong-disabled active:text-neutral-strong-disabled" },
|
|
316
|
+
{ isSelected: !1, disabled: !0, className: "text-neutral-strong-disabled hover:text-neutral-strong-disabled focus:text-neutral-strong-disabled active:text-neutral-strong-disabled" },
|
|
317
|
+
{ isSelected: !0, disabled: !1, className: "text-primary-default-default group-active:text-neutral-default-pressed group-focus:text-neutral-default-pressed" },
|
|
318
|
+
{ isSelected: !1, disabled: !1, className: "text-neutral-default-default group-active:text-neutral-default-pressed group-focus:text-neutral-default-pressed" }
|
|
319
|
+
]
|
|
320
|
+
}
|
|
321
|
+
), st = (a) => {
|
|
322
|
+
const {
|
|
323
|
+
title: l,
|
|
324
|
+
icon: s,
|
|
325
|
+
count: n,
|
|
326
|
+
className: d,
|
|
327
|
+
isSelected: o = !1,
|
|
328
|
+
hasSublinks: i,
|
|
329
|
+
subLinksCollapsed: f,
|
|
330
|
+
onToggleSublinks: b,
|
|
331
|
+
as: x = "div",
|
|
332
|
+
onClick: v,
|
|
333
|
+
onAuxClick: y,
|
|
334
|
+
disabled: g = !1
|
|
335
|
+
} = a, u = (m) => {
|
|
336
|
+
g || v?.(m);
|
|
337
|
+
}, S = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
338
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center", children: [
|
|
339
|
+
s && /* @__PURE__ */ e.jsx(s, { size: 24, className: ge({ disabled: g, isSelected: o }) }),
|
|
340
|
+
/* @__PURE__ */ e.jsx("label", { className: tt({ disabled: g, isSelected: o }), children: l })
|
|
341
|
+
] }),
|
|
342
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-1 items-center", children: [
|
|
343
|
+
n && n ? /* @__PURE__ */ e.jsx($e, { count: n, maxCount: 9, className: "badge", disabled: g }) : "",
|
|
344
|
+
i && /* @__PURE__ */ e.jsx(
|
|
345
|
+
"div",
|
|
346
|
+
{
|
|
347
|
+
className: j(
|
|
348
|
+
"sublinks-toggle",
|
|
349
|
+
"transition-all duration-200",
|
|
350
|
+
"rounded-full relative grid place-items-center size-6",
|
|
351
|
+
o && "text-primary-default-default",
|
|
352
|
+
`${f ? "-rotate-90" : "rotate-90"}`
|
|
353
|
+
),
|
|
354
|
+
children: /* @__PURE__ */ e.jsx(
|
|
355
|
+
"button",
|
|
356
|
+
{
|
|
357
|
+
disabled: g,
|
|
358
|
+
type: "button",
|
|
359
|
+
onClick: b,
|
|
360
|
+
className: j("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", ge({ disabled: g, isSelected: o }), g && "pointer-events-none"),
|
|
361
|
+
children: /* @__PURE__ */ e.jsx(We, {})
|
|
362
|
+
}
|
|
363
|
+
)
|
|
364
|
+
}
|
|
365
|
+
)
|
|
366
|
+
] })
|
|
367
|
+
] }), D = j(
|
|
368
|
+
"group navitem",
|
|
369
|
+
"h-12 flex-1 flex items-center p-3 rounded-lg justify-between w-full",
|
|
370
|
+
"transition-all duration-300",
|
|
371
|
+
Ze,
|
|
372
|
+
et({ isSelected: o, disabled: g }),
|
|
373
|
+
d
|
|
374
|
+
);
|
|
375
|
+
if (x === "a") {
|
|
376
|
+
const m = {
|
|
377
|
+
onClick: u,
|
|
378
|
+
onAuxClick: y,
|
|
379
|
+
className: D
|
|
380
|
+
};
|
|
381
|
+
return /* @__PURE__ */ e.jsx("a", { ...m, children: S });
|
|
382
|
+
}
|
|
383
|
+
if (x === "button") {
|
|
384
|
+
const m = {
|
|
385
|
+
onClick: u,
|
|
386
|
+
type: "button",
|
|
387
|
+
className: D
|
|
388
|
+
};
|
|
389
|
+
return /* @__PURE__ */ e.jsx("button", { ...m, children: S });
|
|
390
|
+
}
|
|
391
|
+
const T = {
|
|
392
|
+
onClick: u,
|
|
393
|
+
className: D
|
|
394
|
+
};
|
|
395
|
+
return /* @__PURE__ */ e.jsx("div", { ...T, children: S });
|
|
396
|
+
}, xe = A(st);
|
|
397
|
+
xe.displayName = "NavigationDrawerItemBase";
|
|
398
|
+
const nt = (a) => {
|
|
399
|
+
const { title: l, icon: s, count: n, className: d, isActive: o, onClick: i, isView: f = !0, disabled: b } = a;
|
|
400
|
+
return f ? /* @__PURE__ */ e.jsx(
|
|
401
|
+
xe,
|
|
402
|
+
{
|
|
403
|
+
as: "button",
|
|
404
|
+
title: l,
|
|
405
|
+
icon: s,
|
|
406
|
+
count: n,
|
|
407
|
+
className: d,
|
|
408
|
+
isSelected: o,
|
|
409
|
+
onClick: i,
|
|
410
|
+
disabled: b
|
|
411
|
+
}
|
|
412
|
+
) : null;
|
|
413
|
+
}, De = A(nt);
|
|
414
|
+
De.displayName = "NavigationDrawerActionItem";
|
|
415
|
+
const rt = ({ actions: a, activeActionId: l, onActionClick: s, className: n }) => /* @__PURE__ */ e.jsx(le, { className: j("flex flex-col gap-2 w-full ", n), scrollbarProps: { hide: !0 }, indicators: {
|
|
416
|
+
top: { type: "shadow", behavior: "scroll-on-hover", show: !0 },
|
|
417
|
+
bottom: { type: "shadow", behavior: "scroll-on-hover", show: !0 }
|
|
418
|
+
}, children: a?.map((d) => {
|
|
419
|
+
const { id: o, onClick: i, isView: f = !0, ...b } = d, x = o === l, v = () => {
|
|
420
|
+
s?.(o), i?.();
|
|
421
|
+
};
|
|
422
|
+
return f ? /* @__PURE__ */ e.jsx(
|
|
423
|
+
De,
|
|
424
|
+
{
|
|
425
|
+
...b,
|
|
426
|
+
id: o,
|
|
427
|
+
isActive: x,
|
|
428
|
+
onClick: v
|
|
429
|
+
},
|
|
430
|
+
o
|
|
431
|
+
) : null;
|
|
432
|
+
}) }), Ae = A(rt);
|
|
433
|
+
Ae.displayName = "NavigationDrawerActions";
|
|
434
|
+
const at = (a) => {
|
|
435
|
+
const { className: l, title: s, path: n, onClick: d, isSelected: o, parentPath: i } = a, f = N(() => {
|
|
436
|
+
d?.(n);
|
|
437
|
+
}, [n]), b = N(() => {
|
|
438
|
+
if (n.startsWith("./")) {
|
|
439
|
+
if (!i) return;
|
|
440
|
+
const x = i + n.slice(2);
|
|
441
|
+
window.open(x, "_blank");
|
|
442
|
+
} else
|
|
443
|
+
window.open(n, "_blank");
|
|
444
|
+
}, [n]);
|
|
445
|
+
return /* @__PURE__ */ e.jsx(
|
|
446
|
+
"a",
|
|
447
|
+
{
|
|
448
|
+
onClick: f,
|
|
449
|
+
onAuxClick: b,
|
|
450
|
+
className: j(
|
|
451
|
+
"group",
|
|
452
|
+
"transition-all duration-300 ease-in-out cursor-pointer",
|
|
453
|
+
"h-10 w-full rounded-lg py-[11px] px-3",
|
|
454
|
+
"hover:bg-neutral-medium-hover",
|
|
455
|
+
o && "bg-neutral-medium-selected hover:bg-neutral-medium-hover active:bg-transparent focus:bg-transparent",
|
|
456
|
+
l
|
|
457
|
+
),
|
|
458
|
+
children: /* @__PURE__ */ e.jsx("p", { className: j(
|
|
459
|
+
"prometeo-fonts-label-large text-neutral-medium-default",
|
|
460
|
+
"group-active:text-neutral-default-focused group-focus:text-neutral-default-focused",
|
|
461
|
+
o && "text-primary-default-default group-hover:text-primary-default-hover group-focus:text-primary-default-focused group-active:text-primary-default-focused"
|
|
462
|
+
), children: s })
|
|
463
|
+
}
|
|
464
|
+
);
|
|
465
|
+
}, Oe = A(at);
|
|
466
|
+
Oe.displayName = "NavItemSecondary";
|
|
467
|
+
const lt = ae((a, l) => {
|
|
468
|
+
const [s, n] = se(!0), d = O(null), { path: o, title: i, icon: f, count: b, className: x, isSelected: v = !1, onClick: y, sublinks: g, toggleCollapse: u, getIsCollapsed: S, subscribeToCollapse: D, isView: T = !0, disabled: m } = a;
|
|
469
|
+
W(() => D ? D((C) => {
|
|
470
|
+
C && n(!0);
|
|
471
|
+
}) : void 0, [D]);
|
|
472
|
+
const I = N(() => {
|
|
473
|
+
n((k) => !k);
|
|
474
|
+
}, []), E = N((k) => {
|
|
475
|
+
n(k);
|
|
476
|
+
}, []), F = {
|
|
477
|
+
toggle: I,
|
|
478
|
+
setIsCollapsed: E,
|
|
479
|
+
get isCollapsed() {
|
|
480
|
+
return s;
|
|
481
|
+
},
|
|
482
|
+
get isDrawerCollapsed() {
|
|
483
|
+
return S?.() ?? !1;
|
|
484
|
+
},
|
|
485
|
+
toggleDrawerCollapse: u,
|
|
486
|
+
subscribeToCollapse: D
|
|
487
|
+
};
|
|
488
|
+
we(l, () => F, [F, s, S, u]);
|
|
489
|
+
const R = f, z = N(() => {
|
|
490
|
+
const k = S?.() ?? !1;
|
|
491
|
+
if (g && g.length > 0 && k) {
|
|
492
|
+
E(!1), u?.();
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
y?.(o);
|
|
496
|
+
}, [o, y, g, u, E, S]), X = N(() => {
|
|
497
|
+
window.open(o, "_blank");
|
|
498
|
+
}, [o]), B = () => {
|
|
499
|
+
if (!g || m) return null;
|
|
500
|
+
if (a.subLinksRender && g)
|
|
501
|
+
return a.subLinksRender(g, F);
|
|
502
|
+
const k = N((C) => {
|
|
503
|
+
if (C.startsWith("./")) {
|
|
504
|
+
const L = o + C.slice(2);
|
|
505
|
+
y?.(L);
|
|
506
|
+
} else
|
|
507
|
+
y?.(C);
|
|
508
|
+
}, [o]);
|
|
509
|
+
return W(() => {
|
|
510
|
+
const C = d.current;
|
|
511
|
+
if (!C) return;
|
|
512
|
+
const L = C.scrollHeight;
|
|
513
|
+
C.style.setProperty("--sublinks-max-height", `${L}px`);
|
|
514
|
+
}, []), /* @__PURE__ */ e.jsx("div", { ref: d, className: `sublinks flex flex-col gap-1 ml-8 ${s ? "collapsed" : "expanded"}`, children: g.map((C) => /* @__PURE__ */ e.jsx(Oe, { ...C, onClick: k, parentPath: o }, `${C.title}-${C.path}`)) });
|
|
515
|
+
}, U = (k) => {
|
|
516
|
+
k.stopPropagation(), k.preventDefault(), I();
|
|
517
|
+
};
|
|
518
|
+
return T ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
519
|
+
/* @__PURE__ */ e.jsx(
|
|
520
|
+
xe,
|
|
521
|
+
{
|
|
522
|
+
as: "a",
|
|
523
|
+
title: i,
|
|
524
|
+
icon: R,
|
|
525
|
+
count: b,
|
|
526
|
+
className: x,
|
|
527
|
+
isSelected: v,
|
|
528
|
+
hasSublinks: !!g,
|
|
529
|
+
subLinksCollapsed: s,
|
|
530
|
+
onToggleSublinks: U,
|
|
531
|
+
onClick: z,
|
|
532
|
+
onAuxClick: X,
|
|
533
|
+
disabled: m
|
|
534
|
+
}
|
|
535
|
+
),
|
|
536
|
+
B()
|
|
537
|
+
] }) : null;
|
|
538
|
+
}), Te = A(lt);
|
|
539
|
+
Te.displayName = "NavigationDrawerLinkItem";
|
|
540
|
+
const ot = ({ navlinks: a, handleNavigation: l, className: s, getIsCollapsed: n, toggleCollapse: d, subscribeToCollapse: o }) => (
|
|
541
|
+
// <div className={cn("flex flex-col gap-2 h-full",className)}>
|
|
542
|
+
/* @__PURE__ */ e.jsx(le, { className: j("flex flex-col gap-2 w-full ", s), scrollbarProps: { hide: !0 }, indicators: {
|
|
543
|
+
top: { type: "shadow", behavior: "scroll-on-hover", show: !0 },
|
|
544
|
+
bottom: { type: "shadow", behavior: "scroll-on-hover", show: !0 }
|
|
545
|
+
}, children: a?.map((i, f) => {
|
|
546
|
+
const b = i.isSelected || i.path === window.location.pathname || (i.relatedPaths?.some((x) => window.location.pathname.startsWith(x)) ?? !1);
|
|
547
|
+
return /* @__PURE__ */ e.jsx(
|
|
548
|
+
Te,
|
|
549
|
+
{
|
|
550
|
+
className: "",
|
|
551
|
+
...i,
|
|
552
|
+
isSelected: b,
|
|
553
|
+
onClick: l,
|
|
554
|
+
toggleCollapse: d,
|
|
555
|
+
getIsCollapsed: n,
|
|
556
|
+
subscribeToCollapse: o,
|
|
557
|
+
disabled: i.disabled,
|
|
558
|
+
isView: i.isView
|
|
559
|
+
},
|
|
560
|
+
f
|
|
561
|
+
);
|
|
562
|
+
}) })
|
|
563
|
+
), Ie = A(ot);
|
|
564
|
+
Ie.displayName = "NavigationDrawerNavlinks";
|
|
565
|
+
const it = ({ name: a, imageUrl: l, avatarSize: s = "xxs", subImageUrl: n, className: d, mainSlot: o = a, secondarySlot: i }) => {
|
|
566
|
+
const f = N(() => o ? typeof o == "string" ? /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-label-large text-neutral-default-default line-clamp-1 select-text", children: o }) : typeof o == "function" ? o() : o : null, [o]), b = N(() => i ? typeof i == "string" ? /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-body-small text-neutral-default-default line-clamp-1 whitespace-pre text-ellipsis select-text", children: i }) : typeof i == "function" ? i() : i : null, [i]);
|
|
567
|
+
return /* @__PURE__ */ e.jsxs("div", { className: j("flex items-center gap-2 p-3 rounded-lg max-w-full max-h-full select-none ", d), children: [
|
|
568
|
+
/* @__PURE__ */ e.jsx(
|
|
569
|
+
Ge,
|
|
570
|
+
{
|
|
571
|
+
fallbackText: a,
|
|
572
|
+
sizeImage: s,
|
|
573
|
+
sizeFallback: s,
|
|
574
|
+
imageUrl: l,
|
|
575
|
+
subImageUrl: n
|
|
576
|
+
}
|
|
577
|
+
),
|
|
578
|
+
/* @__PURE__ */ e.jsxs("div", { className: j("usercard-content flex flex-col gap-0 flex-1 overflow-hidden w-full transition-all duration-300 ease-in-out ", i && "gap-1"), children: [
|
|
579
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full", children: f() }),
|
|
580
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex gap-1 justify-between overflow-hidden relative w-full", children: b() })
|
|
581
|
+
] })
|
|
582
|
+
] });
|
|
583
|
+
}, he = A(it);
|
|
584
|
+
he.displayName = "UserCard";
|
|
585
|
+
const ct = ({ tabs: a, content: l, controls: s }) => /* @__PURE__ */ e.jsxs(H, { controls: s, children: [
|
|
586
|
+
/* @__PURE__ */ e.jsx(H.Content, { children: typeof l == "function" ? l() : l }),
|
|
587
|
+
/* @__PURE__ */ e.jsxs(H.Options, { children: [
|
|
588
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col p-2 pl-4 gap-2", children: [
|
|
589
|
+
/* @__PURE__ */ e.jsx("p", { className: " prometeo-fonts-label-medium text-neutral-medium-default", children: "Cambiar módulo" }),
|
|
590
|
+
/* @__PURE__ */ e.jsx(le, { className: "max-h-52", scrollbarProps: { hide: !0 }, children: a?.map((n) => {
|
|
591
|
+
const d = typeof n.thumbnail == "string" ? /* @__PURE__ */ e.jsx(
|
|
592
|
+
"img",
|
|
593
|
+
{
|
|
594
|
+
src: n.thumbnail,
|
|
595
|
+
alt: n.description,
|
|
596
|
+
className: "size-8 aspect-square rounded",
|
|
597
|
+
draggable: !1
|
|
598
|
+
}
|
|
599
|
+
) : n.thumbnail, o = () => {
|
|
600
|
+
n.disabled || n.onClick && n.onClick(n.name);
|
|
601
|
+
};
|
|
602
|
+
return /* @__PURE__ */ e.jsxs("div", { onClick: o, className: "flex gap-2 p-2 rounded-lg h-12", children: [
|
|
603
|
+
d,
|
|
604
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center h-full justify-center ", children: [
|
|
605
|
+
/* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-label-large text-neutral-default-default line-clamp-1", children: n.name }),
|
|
606
|
+
n.description && /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-body-small text-neutral-medium-default line-clamp-1", children: n.description })
|
|
607
|
+
] })
|
|
608
|
+
] });
|
|
609
|
+
}) })
|
|
610
|
+
] }),
|
|
611
|
+
/* @__PURE__ */ e.jsx("div", {})
|
|
612
|
+
] })
|
|
613
|
+
] }), ve = A(({ enabled_systems: a, onClick: l, currentSystemId: s }) => {
|
|
614
|
+
const n = N(() => {
|
|
615
|
+
if (a) {
|
|
616
|
+
if (s) {
|
|
617
|
+
const f = a.find((b) => b.system_id === s);
|
|
618
|
+
if (f) return { coverImage: f.coverImage, thumbnail: f.thumbnail };
|
|
619
|
+
}
|
|
620
|
+
const o = window.location.origin, i = a.find((f) => f.url === o);
|
|
621
|
+
if (i) return { coverImage: i.coverImage, thumbnail: i.thumbnail };
|
|
622
|
+
}
|
|
623
|
+
return { coverImage: "", thumbnail: "" };
|
|
624
|
+
}, [a]), d = !!l;
|
|
625
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
626
|
+
/* @__PURE__ */ e.jsx(
|
|
627
|
+
"img",
|
|
628
|
+
{
|
|
629
|
+
src: n().coverImage,
|
|
630
|
+
alt: "System Logo",
|
|
631
|
+
className: j("w-full h-12 rounded object-contain system-cover-image ", d && "cursor-pointer"),
|
|
632
|
+
draggable: !1,
|
|
633
|
+
onClick: l
|
|
634
|
+
}
|
|
635
|
+
),
|
|
636
|
+
/* @__PURE__ */ e.jsx(
|
|
637
|
+
"img",
|
|
638
|
+
{
|
|
639
|
+
src: n().thumbnail,
|
|
640
|
+
alt: "System Logo",
|
|
641
|
+
className: j("w-12 h-12 rounded object-cover system-thumbnail ", d && "cursor-pointer"),
|
|
642
|
+
draggable: !1,
|
|
643
|
+
onClick: l
|
|
644
|
+
}
|
|
645
|
+
)
|
|
646
|
+
] });
|
|
647
|
+
}), dt = ({ onCloseClick: a, onMarkAllAsRead: l, notifications: s }) => /* @__PURE__ */ e.jsxs(
|
|
648
|
+
"section",
|
|
649
|
+
{
|
|
650
|
+
className: "w-full md:w-[479px] bg-neutral-default-default border-l-0 md:border-l border-neutral-strong-default",
|
|
651
|
+
children: [
|
|
652
|
+
/* @__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: [
|
|
653
|
+
/* @__PURE__ */ e.jsxs("span", { className: "flex gap-2 items-center", children: [
|
|
654
|
+
/* @__PURE__ */ e.jsx(Ne, { className: "text-neutral-strong-default", size: 24 }),
|
|
655
|
+
/* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-headline-small text-neutral-strong-default", children: "Notificaciones" })
|
|
656
|
+
] }),
|
|
657
|
+
/* @__PURE__ */ e.jsx(ne, { onClick: () => a?.(), icon: /* @__PURE__ */ e.jsx(je, {}), variant: "text", animate: !1, animateIcon: !1, color: "secondary", className: "size-12" })
|
|
658
|
+
] }),
|
|
659
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-3 pb-8 pt-4 px-4", children: [
|
|
660
|
+
l && /* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ e.jsx(ne, { onClick: l, label: "Marcar todas como leidas", variant: "text", animate: !1, animateIcon: !1, size: "small" }) }),
|
|
661
|
+
s?.map((n, d) => /* @__PURE__ */ e.jsx(Je, { ...n, className: " border-b border-neutral-strong-default rounded-b-none last:border-b-0" }, d))
|
|
662
|
+
] })
|
|
663
|
+
]
|
|
664
|
+
}
|
|
665
|
+
), ut = ({ onCloseClick: a, children: l, title: s = "Ayuda" }) => /* @__PURE__ */ e.jsxs(
|
|
666
|
+
"section",
|
|
667
|
+
{
|
|
668
|
+
className: "w-full md:w-[479px] bg-neutral-default-default border-l-0 md:border-l border-neutral-strong-default h-full",
|
|
669
|
+
children: [
|
|
670
|
+
/* @__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: [
|
|
671
|
+
/* @__PURE__ */ e.jsxs("span", { className: "flex gap-2 items-center", children: [
|
|
672
|
+
/* @__PURE__ */ e.jsx(ye, { className: "text-neutral-strong-default", size: 24 }),
|
|
673
|
+
/* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-headline-small text-neutral-strong-default", children: s })
|
|
674
|
+
] }),
|
|
675
|
+
/* @__PURE__ */ e.jsx(ne, { onClick: () => a?.(), icon: /* @__PURE__ */ e.jsx(je, {}), variant: "text", animate: !1, animateIcon: !1, color: "secondary", className: "size-12" })
|
|
676
|
+
] }),
|
|
677
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-3 pb-8 pt-4 px-4", children: l })
|
|
678
|
+
]
|
|
679
|
+
}
|
|
680
|
+
), Re = ae(({ closeSidebar: a, options: l, state: s, helpSection: n, initialSection: d }, o) => {
|
|
681
|
+
const [i, f] = se(d ?? "notifications");
|
|
682
|
+
we(o, () => ({
|
|
683
|
+
setActiveSection: f
|
|
684
|
+
}));
|
|
685
|
+
const b = () => {
|
|
686
|
+
a();
|
|
687
|
+
};
|
|
688
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
689
|
+
i === "notifications" && !l?.notificationsDrawerOptions?.hide && /* @__PURE__ */ e.jsx(
|
|
690
|
+
dt,
|
|
691
|
+
{
|
|
692
|
+
onCloseClick: b,
|
|
693
|
+
onMarkAllAsRead: l?.notificationsDrawerOptions?.onMarkAllAsRead,
|
|
694
|
+
notifications: s.notifications
|
|
695
|
+
}
|
|
696
|
+
),
|
|
697
|
+
i === "help" && n && !l?.helpSectionDrawerOptions?.hide && /* @__PURE__ */ e.jsx(ut, { onCloseClick: b, children: typeof n == "function" ? n() : n })
|
|
698
|
+
] });
|
|
699
|
+
});
|
|
700
|
+
Re.displayName = "SidebarContent";
|
|
701
|
+
const ft = (a) => {
|
|
702
|
+
const { sessions: l, onSessionClick: s, secondarySlot: n, currentSystemId: d, subImageUrlAccessor: o } = a;
|
|
703
|
+
if (!l || l.length === 0)
|
|
704
|
+
return null;
|
|
705
|
+
const i = (x) => {
|
|
706
|
+
s && s(x);
|
|
707
|
+
}, f = (x) => {
|
|
708
|
+
if (!o)
|
|
709
|
+
return;
|
|
710
|
+
const v = x.systems?.find((g) => g.system_id === d)?.metadata;
|
|
711
|
+
return v ? te(v, o) : void 0;
|
|
712
|
+
}, b = N((x) => typeof n == "function" ? n(x) : n, [n]);
|
|
713
|
+
return /* @__PURE__ */ e.jsx("div", { className: "w-full h-full flex flex-col gap-2", children: l?.map((x) => {
|
|
714
|
+
const { userHub: v } = x;
|
|
715
|
+
return /* @__PURE__ */ e.jsx(H, { className: " shrink-0 h-max", children: /* @__PURE__ */ e.jsx(H.Content, { onClick: () => i(x), className: "p-0 group-data-[expanded=true]/ticketcard:border-none", children: /* @__PURE__ */ e.jsx(
|
|
716
|
+
he,
|
|
717
|
+
{
|
|
718
|
+
name: v.name,
|
|
719
|
+
avatarSize: "xxs",
|
|
720
|
+
secondarySlot: b(x),
|
|
721
|
+
subImageUrl: f(x),
|
|
722
|
+
imageUrl: v.profile_picture,
|
|
723
|
+
className: "pyrion-navigation-drawer-user-card"
|
|
724
|
+
},
|
|
725
|
+
x.token
|
|
726
|
+
) }) });
|
|
727
|
+
}) });
|
|
728
|
+
}, _e = Ue(null), _t = () => {
|
|
729
|
+
const a = Be(_e);
|
|
730
|
+
if (!a)
|
|
731
|
+
throw new Error("usePyrionNavigation debe usarse dentro de PyrionNavigationDrawer");
|
|
732
|
+
return a;
|
|
733
|
+
}, Et = ({ children: a, helpSection: l, state: s, links: n, onLinkClick: d, onNavigate: o, onLogoutClick: i, actions: f, activeActionId: b, onActionClick: x, tabsProps: v, currentSystemId: y, onSessionClick: g, options: u, onSystemLogoClick: S }) => {
|
|
734
|
+
const D = Ve(), T = Me(), m = O({}), I = O(null), E = O("notifications"), R = N((t) => {
|
|
735
|
+
if (d) {
|
|
736
|
+
d(t);
|
|
737
|
+
return;
|
|
738
|
+
}
|
|
739
|
+
const c = window.location.pathname;
|
|
740
|
+
D(t), o && o(c, t);
|
|
741
|
+
}, [d, o, window.location.pathname]), z = (t) => {
|
|
742
|
+
t && window.open(t, "_blank");
|
|
743
|
+
}, B = {
|
|
744
|
+
system: {
|
|
745
|
+
mobile: z,
|
|
746
|
+
desktop: (t) => {
|
|
747
|
+
typeof window < "u" && t && (window.location.href = t);
|
|
748
|
+
}
|
|
749
|
+
},
|
|
750
|
+
product: {
|
|
751
|
+
mobile: z,
|
|
752
|
+
desktop: z
|
|
753
|
+
}
|
|
754
|
+
}, U = (t) => {
|
|
755
|
+
const c = T ? "mobile" : "desktop", h = s.enabled_systems.find((w) => w.name === t)?.url;
|
|
756
|
+
B.system[c](h), v?.onTabClick?.(t);
|
|
757
|
+
}, k = (t) => {
|
|
758
|
+
const c = T ? "mobile" : "desktop", h = s.company.products?.find((w) => w.name === t)?.domain;
|
|
759
|
+
B.product[c](h), v?.onTabClick?.(t);
|
|
760
|
+
}, C = (t, c) => {
|
|
761
|
+
if (c) {
|
|
762
|
+
c(t), v?.onTabClick?.(t);
|
|
763
|
+
return;
|
|
764
|
+
} else
|
|
765
|
+
v?.onTabClick?.(t);
|
|
766
|
+
}, L = s.enabled_systems.map((t) => ({ name: t.name, thumbnail: t.thumbnail, onClick: U })) || [], G = v?.customTabs?.map((t) => ({ ...t, onClick: () => C(t.name, t?.onClick) })) || [], oe = s.company.products?.map((t) => ({ name: t.name, thumbnail: t.thumbnail, onClick: k })) || [], ie = () => {
|
|
767
|
+
const t = {};
|
|
768
|
+
s.enabled_systems.forEach((h) => {
|
|
769
|
+
t[h.url] = h.name;
|
|
770
|
+
});
|
|
771
|
+
const c = window.location.origin;
|
|
772
|
+
for (const [h, w] of Object.entries(t))
|
|
773
|
+
if (c === h)
|
|
774
|
+
return w;
|
|
775
|
+
return "";
|
|
776
|
+
}, ce = v?.currentTabName || ie(), Y = [
|
|
777
|
+
...L,
|
|
778
|
+
...G,
|
|
779
|
+
...oe
|
|
780
|
+
], V = O(null), de = O(null), K = s.sessions?.filter((t) => t.systems?.some((c) => c.system_id === y)), J = N((t, c) => {
|
|
781
|
+
if (!t) return null;
|
|
782
|
+
if (Array.isArray(t)) {
|
|
783
|
+
const h = t?.[0] ? te(c, t[0]) : null, w = t?.[1] ? te(c, t[1]) : null;
|
|
784
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
785
|
+
/* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-body-small text-neutral-default-default line-clamp-1 whitespace-break-spaces min-w-1/2", children: h }),
|
|
786
|
+
w && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1 flex-1 grow shrink-0 min-w-[40%] overflow-hidden", children: [
|
|
787
|
+
/* @__PURE__ */ e.jsx("span", { className: "size-0.5 bg-[--neutral-300] rounded-full" }),
|
|
788
|
+
/* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-body-small text-neutral-default-default line-clamp-1 whitespace-pre text-ellipsis", children: w })
|
|
789
|
+
] })
|
|
790
|
+
] });
|
|
791
|
+
}
|
|
792
|
+
return typeof t == "string" ? te(c, t) : typeof t == "function" ? t(c) : null;
|
|
793
|
+
}, []), $ = N(
|
|
794
|
+
(t) => {
|
|
795
|
+
const c = u?.userCardOptions?.secondarySlot;
|
|
796
|
+
if (!c) return null;
|
|
797
|
+
const h = s.enabled_systems?.find((_) => _.system_id === y), w = { company: s.company, user: s.user, system: h, metadata: t };
|
|
798
|
+
return J(c, w);
|
|
799
|
+
},
|
|
800
|
+
[y, u?.userCardOptions?.secondarySlot, J, s.company, s.enabled_systems, s.user]
|
|
801
|
+
), r = N(
|
|
802
|
+
(t) => {
|
|
803
|
+
const c = u?.sessionCardOptions?.secondarySlot || u?.userCardOptions?.secondarySlot;
|
|
804
|
+
if (!c) return null;
|
|
805
|
+
const h = t.systems?.find((_) => _.system_id === y), w = { company: s.company, user: t.userHub, system: h, metadata: h?.metadata };
|
|
806
|
+
return J(c, w);
|
|
807
|
+
},
|
|
808
|
+
[y, u?.sessionCardOptions?.secondarySlot, u?.userCardOptions?.secondarySlot, J, s.company]
|
|
809
|
+
), p = ({ children: t }) => /* @__PURE__ */ e.jsx(_e.Provider, { value: m.current, children: /* @__PURE__ */ e.jsxs(M, { children: [
|
|
810
|
+
/* @__PURE__ */ e.jsx(M.Header, { className: "flex flex-col relative select-none", children: ({ getIsCollapsed: c }) => {
|
|
811
|
+
const h = N(() => {
|
|
812
|
+
if (S) {
|
|
813
|
+
const w = c();
|
|
814
|
+
S(w);
|
|
815
|
+
}
|
|
816
|
+
}, [S, c]);
|
|
817
|
+
return T ? /* @__PURE__ */ e.jsx(
|
|
818
|
+
ct,
|
|
819
|
+
{
|
|
820
|
+
controls: de,
|
|
821
|
+
tabs: Y,
|
|
822
|
+
content: /* @__PURE__ */ e.jsx(ve, { enabled_systems: s.enabled_systems, onClick: h, currentSystemId: y })
|
|
823
|
+
}
|
|
824
|
+
) : /* @__PURE__ */ e.jsx(ve, { enabled_systems: s.enabled_systems, onClick: h, currentSystemId: y });
|
|
825
|
+
} }),
|
|
826
|
+
/* @__PURE__ */ e.jsx(M.Content, { className: "overflow-hidden flex flex-col relative flex-1 w-[285px] md:w-auto", children: ({ toggleCollapse: c, getIsCollapsed: h, subscribeToCollapse: w, openSidebar: _, closeSidebar: P, toggleSidebar: Z, getIsSidebarOpen: Ee, subscribeToSidebarOpen: Le }) => {
|
|
827
|
+
m.current.toggleCollapse = c, m.current.getIsCollapsed = h, m.current.subscribeToCollapse = w, m.current.openSidebar = _, m.current.closeSidebar = P, m.current.toggleSidebar = Z, m.current.getIsSidebarOpen = Ee, m.current.subscribeToSidebarOpen = Le, m.current.openNotifications = () => {
|
|
828
|
+
E.current = "notifications", m.current.openSidebar?.(), I.current?.setActiveSection("notifications");
|
|
829
|
+
}, m.current.openHelp = () => {
|
|
830
|
+
E.current = "help", m.current.openSidebar?.(), I.current?.setActiveSection("help");
|
|
831
|
+
};
|
|
832
|
+
const ee = [];
|
|
833
|
+
!u?.notificationsDrawerOptions?.hideActionButton && !u?.notificationsDrawerOptions?.hideActionButton && ee.push({
|
|
834
|
+
id: "notifications",
|
|
835
|
+
title: "Notificaciones",
|
|
836
|
+
icon: Ne,
|
|
837
|
+
onClick: m.current.openNotifications
|
|
838
|
+
}), !u?.helpSectionDrawerOptions?.hideActionButton && l && !u?.helpSectionDrawerOptions?.hide && ee.push({
|
|
839
|
+
id: "help",
|
|
840
|
+
title: "Ayuda",
|
|
841
|
+
icon: ye,
|
|
842
|
+
onClick: m.current.openHelp
|
|
843
|
+
}), u?.configurationActionOptions?.onClick && !u?.configurationActionOptions?.hideActionButton && ee.push({
|
|
844
|
+
id: "configuration",
|
|
845
|
+
title: "Configuracion",
|
|
846
|
+
icon: Qe,
|
|
847
|
+
onClick: () => {
|
|
848
|
+
u.configurationActionOptions?.onClick?.(), x?.("configuration");
|
|
849
|
+
}
|
|
850
|
+
});
|
|
851
|
+
const Pe = [...ee, ...f || []];
|
|
852
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
853
|
+
/* @__PURE__ */ e.jsx(M.Spacer, { className: "pb-3" }),
|
|
854
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col overflow-hidden h-full gap-4", children: [
|
|
855
|
+
/* @__PURE__ */ e.jsx(
|
|
856
|
+
Ie,
|
|
857
|
+
{
|
|
858
|
+
getIsCollapsed: h,
|
|
859
|
+
toggleCollapse: c,
|
|
860
|
+
subscribeToCollapse: w,
|
|
861
|
+
navlinks: n,
|
|
862
|
+
handleNavigation: R,
|
|
863
|
+
className: "flex flex-1 "
|
|
864
|
+
}
|
|
865
|
+
),
|
|
866
|
+
/* @__PURE__ */ e.jsx(
|
|
867
|
+
Ae,
|
|
868
|
+
{
|
|
869
|
+
actions: Pe,
|
|
870
|
+
activeActionId: b,
|
|
871
|
+
onActionClick: x,
|
|
872
|
+
className: " max-h-[35vh] min-h-max"
|
|
873
|
+
}
|
|
874
|
+
)
|
|
875
|
+
] })
|
|
876
|
+
] });
|
|
877
|
+
} }),
|
|
878
|
+
/* @__PURE__ */ e.jsx(M.Footer, { className: "md:min-h-max flex flex-col w-full overflow-hidden max-w-full", children: ({ getIsCollapsed: c, subscribeToCollapse: h, toggleCollapse: w }) => {
|
|
879
|
+
const _ = N(
|
|
880
|
+
() => {
|
|
881
|
+
c() && (w(), V.current?.open());
|
|
882
|
+
},
|
|
883
|
+
[c]
|
|
884
|
+
);
|
|
885
|
+
return W(() => {
|
|
886
|
+
h((P) => {
|
|
887
|
+
P && (V.current?.close(), de.current?.close());
|
|
888
|
+
});
|
|
889
|
+
}, []), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
890
|
+
/* @__PURE__ */ e.jsx(M.Spacer, { className: "mb-3" }),
|
|
891
|
+
/* @__PURE__ */ e.jsxs(H, { className: "", controls: V, children: [
|
|
892
|
+
/* @__PURE__ */ e.jsx(H.Content, { onClick: _, children: /* @__PURE__ */ e.jsx(
|
|
893
|
+
he,
|
|
894
|
+
{
|
|
895
|
+
className: "pyrion-navigation-drawer-user-card p-0 ",
|
|
896
|
+
name: s.user.name,
|
|
897
|
+
secondarySlot: $(s.metadata),
|
|
898
|
+
imageUrl: s.user.profile_picture,
|
|
899
|
+
subImageUrl: s.company.icon,
|
|
900
|
+
avatarSize: "xxs"
|
|
901
|
+
}
|
|
902
|
+
) }),
|
|
903
|
+
/* @__PURE__ */ e.jsxs(H.Options, { className: "min-h-max flex flex-col gap-3 pl-3 mt-3 pt-2", children: [
|
|
904
|
+
K && K.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
905
|
+
/* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-label-medium text-neutral-medium-default select-none", children: "Cambiar cuenta" }),
|
|
906
|
+
/* @__PURE__ */ e.jsx(le, { className: "flex flex-col gap-2 max-h-[165px] flex-1", scrollbarProps: { hide: !0 }, children: /* @__PURE__ */ e.jsx(
|
|
907
|
+
ft,
|
|
908
|
+
{
|
|
909
|
+
sessions: K,
|
|
910
|
+
onSessionClick: g,
|
|
911
|
+
secondarySlot: r,
|
|
912
|
+
subImageUrlAccessor: u?.sessionCardOptions?.subImageUrlAccessor,
|
|
913
|
+
currentSystemId: y
|
|
914
|
+
}
|
|
915
|
+
) })
|
|
916
|
+
] }),
|
|
917
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2", children: i && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
918
|
+
/* @__PURE__ */ e.jsx("span", { className: " border-t border-neutral-strong-default w-full bg-neutral-strong-default " }),
|
|
919
|
+
/* @__PURE__ */ e.jsx(ne, { onClick: i, animate: !1, animateIcon: !1, variant: "text", label: "Cerrar sesión", icon: /* @__PURE__ */ e.jsx(Ke, {}), size: "small", color: "secondary" })
|
|
920
|
+
] }) })
|
|
921
|
+
] })
|
|
922
|
+
] })
|
|
923
|
+
] });
|
|
924
|
+
} }),
|
|
925
|
+
/* @__PURE__ */ e.jsx(M.Outlet, { children: t }),
|
|
926
|
+
/* @__PURE__ */ e.jsx(
|
|
927
|
+
M.Sidebar,
|
|
928
|
+
{
|
|
929
|
+
className: "bg-neutral-default-default",
|
|
930
|
+
modal: u?.sidebarOptions?.modal,
|
|
931
|
+
closeOnOverlayClick: u?.sidebarOptions?.closeOnOverlayClick,
|
|
932
|
+
children: ({ closeSidebar: c }) => /* @__PURE__ */ e.jsx(
|
|
933
|
+
Re,
|
|
934
|
+
{
|
|
935
|
+
ref: I,
|
|
936
|
+
closeSidebar: c,
|
|
937
|
+
options: u,
|
|
938
|
+
state: s,
|
|
939
|
+
helpSection: l,
|
|
940
|
+
initialSection: E.current
|
|
941
|
+
}
|
|
942
|
+
)
|
|
943
|
+
}
|
|
944
|
+
)
|
|
945
|
+
] }) });
|
|
946
|
+
return T ? /* @__PURE__ */ e.jsx(p, { children: /* @__PURE__ */ e.jsx(e.Fragment, { children: a }) }) : /* @__PURE__ */ e.jsxs("div", { className: "flex h-screen", children: [
|
|
947
|
+
Y.length > 0 && /* @__PURE__ */ e.jsx(
|
|
948
|
+
qe,
|
|
949
|
+
{
|
|
950
|
+
className: "hidden md:flex",
|
|
951
|
+
tabs: Y,
|
|
952
|
+
activeColor: "var(--neutral-900)",
|
|
953
|
+
currentTabName: ce
|
|
954
|
+
}
|
|
955
|
+
),
|
|
956
|
+
/* @__PURE__ */ e.jsx(p, { children: a })
|
|
957
|
+
] });
|
|
958
|
+
};
|
|
959
|
+
export {
|
|
960
|
+
Et as default,
|
|
961
|
+
_t as u
|
|
962
|
+
};
|