prometeo-design-system 3.1.6 → 4.0.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/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/PyrionLayout.d.ts +6 -0
- package/dist/PyrionLayout.es.js +1308 -0
- package/dist/RecurrentDatePicker.es.js +1 -1
- package/dist/Scrollable.es.js +118 -86
- package/dist/components/Input/Input.d.ts +1 -0
- package/dist/components/NavigationDrawer/NavigationDrawer.d.ts +18 -11
- package/dist/components/NavigationDrawer/NavigationDrawerActionItem.d.ts +1 -0
- package/dist/components/NavigationDrawer/NavigationDrawerActions.d.ts +3 -2
- package/dist/components/NavigationDrawer/NavigationDrawerSidebar.d.ts +11 -0
- package/dist/components/NotificationCard/NotificationCard.d.ts +3 -2
- package/dist/components/PyrionNavigationDrawer/PLContent.d.ts +10 -0
- package/dist/components/PyrionNavigationDrawer/PLFooter.d.ts +20 -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 +41 -0
- package/dist/components/PyrionNavigationDrawer/PyrionLayout.d.ts +143 -0
- package/dist/components/PyrionNavigationDrawer/index.d.ts +3 -2
- package/dist/components/Scrollable/Scrollable.d.ts +1 -0
- package/dist/exports/PyrionLayout.d.ts +2 -0
- package/dist/exports/usePyrionNavigation.d.ts +1 -1
- package/dist/prometeo-design-system.es.js +2423 -402
- package/dist/styles.css +1 -1
- package/dist/usePyrionNavigation.es.js +1 -1
- package/package.json +5 -13
- 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/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/exports/LayoutGeneric.d.ts +0 -2
- package/dist/exports/PyrionNavigationDrawer.d.ts +0 -2
package/dist/Scrollable.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { j as h } from "./jsx-runtime-GkKLlHH4.js";
|
|
2
|
-
import { useIsMobile as
|
|
3
|
-
import { g as
|
|
2
|
+
import { useIsMobile as st } from "./useDevice.es.js";
|
|
3
|
+
import { g as nt } from "./useLabelBackground-BDIHUdND.js";
|
|
4
4
|
import { c as m } from "./cn-B6yFEsav.js";
|
|
5
|
-
import { c as
|
|
6
|
-
import
|
|
7
|
-
import { CrevronLeft as
|
|
8
|
-
const
|
|
5
|
+
import { c as j } from "./index-BOQuZ0gG.js";
|
|
6
|
+
import F, { useRef as a, useLayoutEffect as lt, useEffect as ct } from "react";
|
|
7
|
+
import { CrevronLeft as at } from "./Icons/CrevronLeft.es.js";
|
|
8
|
+
const P = j(
|
|
9
9
|
"",
|
|
10
10
|
{
|
|
11
11
|
variants: {
|
|
@@ -16,7 +16,7 @@ const _ = C(
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
),
|
|
19
|
+
), J = j("", {
|
|
20
20
|
variants: {
|
|
21
21
|
position: {
|
|
22
22
|
top: "",
|
|
@@ -39,7 +39,7 @@ const _ = C(
|
|
|
39
39
|
{ type: "shadow", position: "left", className: "left-0 top-0 h-full w-5" },
|
|
40
40
|
{ type: "shadow", position: "right", className: "right-0 top-0 h-full w-5 rotate-180" }
|
|
41
41
|
]
|
|
42
|
-
}),
|
|
42
|
+
}), it = j("", {
|
|
43
43
|
variants: {
|
|
44
44
|
hide: {
|
|
45
45
|
true: " prometeo-scrollbar-none",
|
|
@@ -50,26 +50,27 @@ const _ = C(
|
|
|
50
50
|
medium: ""
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
}),
|
|
54
|
-
const { defaultBehavior:
|
|
55
|
-
top: { show: !0, type: "shadow", behavior:
|
|
56
|
-
bottom: { show: !0, type: "shadow", behavior:
|
|
57
|
-
left: { show: !0, type: "icon", behavior:
|
|
58
|
-
right: { show: !0, type: "icon", behavior:
|
|
59
|
-
},
|
|
53
|
+
}), bt = (R) => {
|
|
54
|
+
const { defaultBehavior: w = "scroll-on-click" } = R, K = st(), G = {
|
|
55
|
+
top: { show: !0, type: "shadow", behavior: w },
|
|
56
|
+
bottom: { show: !0, type: "shadow", behavior: w },
|
|
57
|
+
left: { show: !0, type: "icon", behavior: w },
|
|
58
|
+
right: { show: !0, type: "icon", behavior: w }
|
|
59
|
+
}, Q = {
|
|
60
60
|
hide: !1,
|
|
61
61
|
size: "medium"
|
|
62
62
|
}, {
|
|
63
|
-
debugMode:
|
|
64
|
-
className:
|
|
65
|
-
axis:
|
|
66
|
-
children:
|
|
67
|
-
indicators: v =
|
|
68
|
-
scrollbarProps:
|
|
69
|
-
disableMouseScroll:
|
|
70
|
-
|
|
63
|
+
debugMode: X = !1,
|
|
64
|
+
className: k,
|
|
65
|
+
axis: z = "both",
|
|
66
|
+
children: Y,
|
|
67
|
+
indicators: v = G,
|
|
68
|
+
scrollbarProps: A = Q,
|
|
69
|
+
disableMouseScroll: D = !1,
|
|
70
|
+
persistScroll: L = !1
|
|
71
|
+
} = R, s = a({}), l = a(null), d = a(null), b = a(null), i = a(null), u = a(5), f = a({}), x = a(null), p = a(!1), O = a(!1), T = a(null), g = a(null), Z = (e) => {
|
|
71
72
|
if (!l.current) return 0;
|
|
72
|
-
const { scrollTop: t, scrollLeft: r, scrollHeight: o, clientHeight: n, scrollWidth: c, clientWidth:
|
|
73
|
+
const { scrollTop: t, scrollLeft: r, scrollHeight: o, clientHeight: n, scrollWidth: c, clientWidth: y } = l.current;
|
|
73
74
|
switch (e) {
|
|
74
75
|
case "top":
|
|
75
76
|
return Math.max(0, t);
|
|
@@ -78,22 +79,22 @@ const _ = C(
|
|
|
78
79
|
case "left":
|
|
79
80
|
return Math.max(0, r);
|
|
80
81
|
case "right":
|
|
81
|
-
return Math.max(0, c - (r +
|
|
82
|
+
return Math.max(0, c - (r + y));
|
|
82
83
|
default:
|
|
83
84
|
return 0;
|
|
84
85
|
}
|
|
85
|
-
},
|
|
86
|
+
}, E = (e, t = 100, r = !0) => {
|
|
86
87
|
if (!l.current) return;
|
|
87
|
-
const o =
|
|
88
|
+
const o = Z(e), n = Math.min(Math.abs(t), o);
|
|
88
89
|
if (n === 0) return;
|
|
89
|
-
const c = e === "top" || e === "left" ? -n : n,
|
|
90
|
+
const c = e === "top" || e === "left" ? -n : n, y = {
|
|
90
91
|
top: { top: c, left: 0 },
|
|
91
92
|
bottom: { top: c, left: 0 },
|
|
92
93
|
left: { top: 0, left: c },
|
|
93
94
|
right: { top: 0, left: c }
|
|
94
95
|
};
|
|
95
|
-
l.current.scrollBy({ ...
|
|
96
|
-
},
|
|
96
|
+
l.current.scrollBy({ ...y[e], behavior: r ? "smooth" : "auto" });
|
|
97
|
+
}, tt = (e) => {
|
|
97
98
|
if (!l.current) return;
|
|
98
99
|
const t = l.current, r = {
|
|
99
100
|
top: { top: 0, left: t.scrollLeft },
|
|
@@ -102,7 +103,7 @@ const _ = C(
|
|
|
102
103
|
right: { top: t.scrollTop, left: t.scrollWidth }
|
|
103
104
|
};
|
|
104
105
|
t.scrollTo({ ...r[e], behavior: "smooth" });
|
|
105
|
-
},
|
|
106
|
+
}, et = (e, t) => {
|
|
106
107
|
const r = s.current[e];
|
|
107
108
|
if (r) {
|
|
108
109
|
if (r.style.cursor = "pointer", t === "icon") {
|
|
@@ -113,7 +114,7 @@ const _ = C(
|
|
|
113
114
|
o && (e === "top" || e === "bottom" ? o.style.height = "90px" : o.style.width = "40px");
|
|
114
115
|
}
|
|
115
116
|
}
|
|
116
|
-
},
|
|
117
|
+
}, M = (e) => {
|
|
117
118
|
const t = s.current[e];
|
|
118
119
|
if (!t) return;
|
|
119
120
|
t.style.cursor = "";
|
|
@@ -121,70 +122,98 @@ const _ = C(
|
|
|
121
122
|
r && (r.style.transform = "", r.style.backgroundColor = "", r.style.borderRadius = "");
|
|
122
123
|
const o = t.querySelector("span");
|
|
123
124
|
o && (o.style.height = "", o.style.width = "");
|
|
124
|
-
},
|
|
125
|
+
}, B = (e, t) => {
|
|
125
126
|
if (t === "scroll-on-click" && p.current) {
|
|
126
127
|
p.current = !1;
|
|
127
128
|
return;
|
|
128
129
|
}
|
|
129
130
|
if (f.current[e]) {
|
|
130
|
-
|
|
131
|
+
i.current && (clearTimeout(i.current), i.current = null), d.current && (clearInterval(d.current), d.current = null), M(e), f.current[e] = !1, tt(e);
|
|
131
132
|
return;
|
|
132
133
|
}
|
|
133
134
|
if (t === "scroll-on-click") {
|
|
134
135
|
if (!l.current) return;
|
|
135
136
|
const { clientHeight: r, clientWidth: o } = l.current, n = e === "top" || e === "bottom" ? r * 0.8 : o * 0.8;
|
|
136
|
-
|
|
137
|
+
E(e, n);
|
|
137
138
|
}
|
|
138
|
-
},
|
|
139
|
-
|
|
139
|
+
}, W = (e, t) => {
|
|
140
|
+
i.current && (clearTimeout(i.current), i.current = null), p.current = !0, u.current = 3;
|
|
140
141
|
let r = 0;
|
|
141
|
-
|
|
142
|
+
x.current = e, f.current[e] = !1, E(e, u.current, !1), d.current = setInterval(() => {
|
|
142
143
|
r += 16;
|
|
143
144
|
const o = r / 1e3;
|
|
144
|
-
if (o >= 2 && !f.current[e] && (f.current[e] = !0,
|
|
145
|
+
if (o >= 2 && !f.current[e] && (f.current[e] = !0, et(e, t)), o <= 2)
|
|
145
146
|
u.current = 5 + o * 0.4;
|
|
146
147
|
else {
|
|
147
148
|
const n = o - 2;
|
|
148
149
|
u.current += Math.pow(n, 1.1) * 2;
|
|
149
150
|
}
|
|
150
|
-
u.current = Math.min(u.current, 100),
|
|
151
|
+
u.current = Math.min(u.current, 100), E(e, u.current, !1);
|
|
151
152
|
}, 16);
|
|
152
|
-
},
|
|
153
|
+
}, q = (e) => {
|
|
153
154
|
b.current && (clearTimeout(b.current), b.current = null), d.current && (clearInterval(d.current), d.current = null), u.current = 5;
|
|
154
|
-
const t = e ||
|
|
155
|
-
t ? f.current[t] ? (
|
|
156
|
-
|
|
157
|
-
}, 1e3)) : (
|
|
158
|
-
},
|
|
159
|
-
|
|
160
|
-
|
|
155
|
+
const t = e || x.current;
|
|
156
|
+
t ? f.current[t] ? (i.current && clearTimeout(i.current), i.current = setTimeout(() => {
|
|
157
|
+
M(t), f.current[t] = !1, p.current = !1;
|
|
158
|
+
}, 1e3)) : (M(t), f.current[t] = !1, p.current = !1) : p.current = !1, x.current = null;
|
|
159
|
+
}, H = (e, t, r) => {
|
|
160
|
+
K || t === "scroll-on-hover" && (b.current = setTimeout(() => {
|
|
161
|
+
W(e, r);
|
|
161
162
|
}, 200));
|
|
162
|
-
},
|
|
163
|
-
t === "scroll-on-hover" &&
|
|
164
|
-
},
|
|
163
|
+
}, $ = (e, t) => {
|
|
164
|
+
t === "scroll-on-hover" && q(e);
|
|
165
|
+
}, U = (e, t, r) => {
|
|
165
166
|
t === "scroll-on-click" && (p.current = !1, b.current = setTimeout(() => {
|
|
166
|
-
|
|
167
|
+
W(e, r);
|
|
167
168
|
}, 200));
|
|
168
|
-
},
|
|
169
|
-
t === "scroll-on-click" &&
|
|
170
|
-
},
|
|
169
|
+
}, V = (e, t) => {
|
|
170
|
+
t === "scroll-on-click" && q(e);
|
|
171
|
+
}, _ = () => {
|
|
171
172
|
if (!l.current) return;
|
|
172
|
-
const e = l.current, { scrollTop: t, scrollLeft: r, scrollHeight: o, scrollWidth: n, clientHeight: c, clientWidth:
|
|
173
|
-
s.current.top?.classList.toggle("opacity-0",
|
|
173
|
+
const e = l.current, { scrollTop: t, scrollLeft: r, scrollHeight: o, scrollWidth: n, clientHeight: c, clientWidth: y } = e, S = t <= 10, N = t + c >= o - 10, I = r <= 10, C = r + y >= n - 10;
|
|
174
|
+
s.current.top?.classList.toggle("opacity-0", S), s.current.top?.classList.toggle("pointer-events-none", S), s.current.top?.classList.toggle("pointer-events-auto", !S), s.current.bottom?.classList.toggle("opacity-0", N), s.current.bottom?.classList.toggle("pointer-events-none", N), s.current.bottom?.classList.toggle("pointer-events-auto", !N), s.current.left?.classList.toggle("opacity-0", I), s.current.left?.classList.toggle("pointer-events-none", I), s.current.left?.classList.toggle("pointer-events-auto", !I), s.current.right?.classList.toggle("opacity-0", C), s.current.right?.classList.toggle("pointer-events-none", C), s.current.right?.classList.toggle("pointer-events-auto", !C);
|
|
174
175
|
};
|
|
175
|
-
|
|
176
|
+
lt(() => {
|
|
176
177
|
if (!l.current) return;
|
|
177
178
|
const e = l.current;
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
179
|
+
if (L) {
|
|
180
|
+
T.current = typeof L == "string" ? `scrollable-${L}` : `scrollable-${Math.random().toString(36).substr(2, 9)}`;
|
|
181
|
+
try {
|
|
182
|
+
const o = sessionStorage.getItem(T.current);
|
|
183
|
+
if (o) {
|
|
184
|
+
const { scrollTop: n, scrollLeft: c } = JSON.parse(o);
|
|
185
|
+
e.scrollTop = n, e.scrollLeft = c;
|
|
186
|
+
}
|
|
187
|
+
} catch {
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
_(), O.current || (O.current = !0, requestAnimationFrame(() => {
|
|
191
|
+
Object.values(s.current).forEach((o) => {
|
|
192
|
+
o?.classList.add("transition-all", "duration-500");
|
|
193
|
+
});
|
|
194
|
+
}));
|
|
195
|
+
const t = () => {
|
|
196
|
+
_(), L && T.current && (g.current && clearTimeout(g.current), g.current = setTimeout(() => {
|
|
197
|
+
try {
|
|
198
|
+
const o = {
|
|
199
|
+
scrollTop: e.scrollTop,
|
|
200
|
+
scrollLeft: e.scrollLeft
|
|
201
|
+
};
|
|
202
|
+
sessionStorage.setItem(T.current, JSON.stringify(o));
|
|
203
|
+
} catch {
|
|
204
|
+
}
|
|
205
|
+
}, 150));
|
|
206
|
+
};
|
|
207
|
+
e.addEventListener("scroll", t);
|
|
208
|
+
const r = (o) => {
|
|
209
|
+
D && o.preventDefault();
|
|
181
210
|
};
|
|
182
|
-
return e.addEventListener("wheel",
|
|
183
|
-
e.removeEventListener("scroll",
|
|
211
|
+
return e.addEventListener("wheel", r, { passive: !1 }), () => {
|
|
212
|
+
e.removeEventListener("scroll", t), e.removeEventListener("wheel", r), g.current && clearTimeout(g.current);
|
|
184
213
|
};
|
|
185
|
-
}, [
|
|
214
|
+
}, [D]), ct(() => {
|
|
186
215
|
if (!l.current) return;
|
|
187
|
-
const e =
|
|
216
|
+
const e = nt(l.current);
|
|
188
217
|
Object.entries(v).forEach(([t, r]) => {
|
|
189
218
|
if (r?.show && r.type === "shadow") {
|
|
190
219
|
const n = s.current[t]?.querySelector("span");
|
|
@@ -196,21 +225,21 @@ const _ = C(
|
|
|
196
225
|
}
|
|
197
226
|
});
|
|
198
227
|
}, [v]);
|
|
199
|
-
const
|
|
200
|
-
return /* @__PURE__ */ h.jsxs("div", { className: m("relative p-0",
|
|
228
|
+
const rt = F.Children.toArray(Y), ot = Object.values(v).some((e) => e?.show && e?.type === "icon");
|
|
229
|
+
return /* @__PURE__ */ h.jsxs("div", { className: m("relative p-0", k, P({ axis: z }), "scrolleable", ot ? "overflow-visible" : "overflow-hidden!"), children: [
|
|
201
230
|
/* @__PURE__ */ h.jsx(
|
|
202
231
|
"div",
|
|
203
232
|
{
|
|
204
233
|
ref: l,
|
|
205
234
|
className: m(
|
|
206
|
-
|
|
207
|
-
|
|
235
|
+
X && "border border-red-900 border-dashed",
|
|
236
|
+
k,
|
|
208
237
|
"py-2 relative w-full h-full min-h-full",
|
|
209
|
-
|
|
210
|
-
|
|
238
|
+
P({ axis: z }),
|
|
239
|
+
it({ hide: A?.hide, size: A?.size }),
|
|
211
240
|
""
|
|
212
241
|
),
|
|
213
|
-
children:
|
|
242
|
+
children: rt?.map((e) => F.cloneElement(e, { className: m(e?.props?.className, "shrink-0! pointer-events-auto") }))
|
|
214
243
|
}
|
|
215
244
|
),
|
|
216
245
|
/* @__PURE__ */ h.jsx("div", { className: "h-full w-full z-10 absolute inset-0 pointer-events-none overflow-hidden rounded-[inherit]", children: Object.entries(v).map(([e, t]) => {
|
|
@@ -222,13 +251,16 @@ const _ = C(
|
|
|
222
251
|
ref: (o) => {
|
|
223
252
|
s.current[e] = o;
|
|
224
253
|
},
|
|
225
|
-
className: m(
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
254
|
+
className: m(
|
|
255
|
+
"cursor-default ease-in-out z-100",
|
|
256
|
+
"opacity-0 pointer-events-none"
|
|
257
|
+
),
|
|
258
|
+
onClick: () => B(r, t.behavior),
|
|
259
|
+
onMouseEnter: () => H(r, t.behavior, t.type),
|
|
260
|
+
onMouseLeave: () => $(r, t.behavior),
|
|
261
|
+
onMouseDown: () => U(r, t.behavior, t.type),
|
|
262
|
+
onMouseUp: () => V(r, t.behavior),
|
|
263
|
+
children: /* @__PURE__ */ h.jsx("span", { className: m(J({ position: r, type: "shadow" }), t.className) })
|
|
232
264
|
},
|
|
233
265
|
e
|
|
234
266
|
);
|
|
@@ -243,12 +275,12 @@ const _ = C(
|
|
|
243
275
|
s.current[e] = o;
|
|
244
276
|
},
|
|
245
277
|
className: "pointer-events-auto cursor-default transition-all duration-300 opacity-0",
|
|
246
|
-
onClick: () =>
|
|
247
|
-
onMouseEnter: () =>
|
|
248
|
-
onMouseLeave: () =>
|
|
249
|
-
onMouseDown: () =>
|
|
250
|
-
onMouseUp: () =>
|
|
251
|
-
children: /* @__PURE__ */ h.jsx(
|
|
278
|
+
onClick: () => B(r, t.behavior),
|
|
279
|
+
onMouseEnter: () => H(r, t.behavior, t.type),
|
|
280
|
+
onMouseLeave: () => $(r, t.behavior),
|
|
281
|
+
onMouseDown: () => U(r, t.behavior, t.type),
|
|
282
|
+
onMouseUp: () => V(r, t.behavior),
|
|
283
|
+
children: /* @__PURE__ */ h.jsx(at, { size: 20, className: m(J({ position: r, type: "icon" }), t.className) })
|
|
252
284
|
},
|
|
253
285
|
e
|
|
254
286
|
);
|
|
@@ -256,5 +288,5 @@ const _ = C(
|
|
|
256
288
|
] });
|
|
257
289
|
};
|
|
258
290
|
export {
|
|
259
|
-
|
|
291
|
+
bt as Scrollable
|
|
260
292
|
};
|
|
@@ -29,6 +29,7 @@ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElem
|
|
|
29
29
|
onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
30
30
|
onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
31
31
|
onKeyUp?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
32
|
+
onClickIcon?: (event: React.MouseEvent) => void;
|
|
32
33
|
}
|
|
33
34
|
declare const _default: import('react').NamedExoticComponent<InputProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
34
35
|
export default _default;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { default as React, ReactNode } from 'react';
|
|
2
|
-
type
|
|
2
|
+
type NavigationDrawerState = {
|
|
3
|
+
isCollapsed: boolean;
|
|
4
|
+
isSidebarOpen: boolean;
|
|
5
|
+
};
|
|
6
|
+
type NavigationDrawerActions = {
|
|
3
7
|
toggleCollapse: () => void;
|
|
4
8
|
getIsCollapsed: () => boolean;
|
|
5
9
|
subscribeToCollapse: (listener: (collapsed: boolean) => void) => () => void;
|
|
@@ -8,12 +12,22 @@ type NavigationDrawerRenderContext = {
|
|
|
8
12
|
toggleSidebar: () => void;
|
|
9
13
|
getIsSidebarOpen: () => boolean;
|
|
10
14
|
subscribeToSidebarOpen: (listener: (open: boolean) => void) => () => void;
|
|
15
|
+
setDrawerDragEnabled: (enabled: boolean) => void;
|
|
16
|
+
setSidebarDragEnabled: (enabled: boolean) => void;
|
|
11
17
|
};
|
|
12
|
-
type
|
|
18
|
+
export type NavigationDrawerRenderContext = NavigationDrawerActions;
|
|
19
|
+
declare const useDrawerState: () => NavigationDrawerState;
|
|
20
|
+
declare const useDrawerActions: () => NavigationDrawerActions;
|
|
21
|
+
export type NavigationDrawerSlotChildren = ReactNode | ((context: NavigationDrawerRenderContext) => ReactNode);
|
|
22
|
+
export declare const resolveSlotChildren: (children: NavigationDrawerSlotChildren | undefined, context?: NavigationDrawerRenderContext) => React.ReactNode;
|
|
13
23
|
export interface NavigationDrawerProps {
|
|
14
24
|
children?: NavigationDrawerSlotChildren;
|
|
15
25
|
classNameDrawer?: string;
|
|
16
26
|
classNameSidebar?: string;
|
|
27
|
+
disableDragOpen?: {
|
|
28
|
+
drawer?: boolean;
|
|
29
|
+
sidebar?: boolean;
|
|
30
|
+
};
|
|
17
31
|
}
|
|
18
32
|
type SlotBaseProps = {
|
|
19
33
|
children?: NavigationDrawerSlotChildren;
|
|
@@ -21,14 +35,6 @@ type SlotBaseProps = {
|
|
|
21
35
|
context?: NavigationDrawerRenderContext;
|
|
22
36
|
};
|
|
23
37
|
type ContentProps = SlotBaseProps & Omit<React.AllHTMLAttributes<HTMLDivElement>, "children">;
|
|
24
|
-
export type NavigationDrawerSidebarProps = {
|
|
25
|
-
children?: NavigationDrawerSlotChildren;
|
|
26
|
-
className?: string;
|
|
27
|
-
context?: NavigationDrawerRenderContext;
|
|
28
|
-
modal?: boolean;
|
|
29
|
-
closeOnOverlayClick?: boolean;
|
|
30
|
-
unmountChildrenOnClose?: boolean;
|
|
31
|
-
};
|
|
32
38
|
declare const NavigationDrawer: React.NamedExoticComponent<NavigationDrawerProps> & {
|
|
33
39
|
readonly type: (props: NavigationDrawerProps) => import("react/jsx-runtime").JSX.Element;
|
|
34
40
|
} & {
|
|
@@ -44,6 +50,7 @@ declare const NavigationDrawer: React.NamedExoticComponent<NavigationDrawerProps
|
|
|
44
50
|
className?: string;
|
|
45
51
|
context?: NavigationDrawerRenderContext;
|
|
46
52
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
47
|
-
Sidebar: React.NamedExoticComponent<NavigationDrawerSidebarProps & React.RefAttributes<HTMLDivElement>>;
|
|
53
|
+
Sidebar: React.NamedExoticComponent<import('./NavigationDrawerSidebar').NavigationDrawerSidebarProps & React.RefAttributes<HTMLDivElement>>;
|
|
48
54
|
};
|
|
49
55
|
export default NavigationDrawer;
|
|
56
|
+
export { useDrawerState, useDrawerActions };
|
|
@@ -2,8 +2,9 @@ import { NavigationDrawerActionItemProps } from './NavigationDrawerActionItem';
|
|
|
2
2
|
export interface NavigationDrawerActionsProps {
|
|
3
3
|
actions?: NavigationDrawerActionItemProps[];
|
|
4
4
|
activeActionId?: string;
|
|
5
|
-
onActionClick?: (id: string) => void;
|
|
5
|
+
onActionClick?: (id: string, payload?: any) => void;
|
|
6
6
|
className?: string;
|
|
7
|
+
payload?: any;
|
|
7
8
|
}
|
|
8
|
-
declare const NavigationDrawerActions: import('react').MemoExoticComponent<({ actions, activeActionId, onActionClick, className }: NavigationDrawerActionsProps) => import("react/jsx-runtime").JSX.Element>;
|
|
9
|
+
declare const NavigationDrawerActions: import('react').MemoExoticComponent<({ actions, activeActionId, onActionClick, className, payload }: NavigationDrawerActionsProps) => import("react/jsx-runtime").JSX.Element>;
|
|
9
10
|
export default NavigationDrawerActions;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NavigationDrawerRenderContext, NavigationDrawerSlotChildren } from './NavigationDrawer';
|
|
2
|
+
export type NavigationDrawerSidebarProps = {
|
|
3
|
+
children?: NavigationDrawerSlotChildren;
|
|
4
|
+
className?: string;
|
|
5
|
+
context?: NavigationDrawerRenderContext;
|
|
6
|
+
modal?: boolean;
|
|
7
|
+
closeOnOverlayClick?: boolean;
|
|
8
|
+
unmountChildrenOnClose?: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare const Sidebar: import('react').NamedExoticComponent<NavigationDrawerSidebarProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
11
|
+
export default Sidebar;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { ButtonVariant } from '../Shared/types';
|
|
3
|
-
export interface NotificationAction<NotificationMetadata =
|
|
3
|
+
export interface NotificationAction<NotificationMetadata = any> {
|
|
4
4
|
label: string;
|
|
5
5
|
onClick: (metadata?: NotificationMetadata) => void;
|
|
6
6
|
variant?: ButtonVariant;
|
|
@@ -11,7 +11,8 @@ export interface NoitificationUser {
|
|
|
11
11
|
name: string;
|
|
12
12
|
profile_picture?: string;
|
|
13
13
|
}
|
|
14
|
-
export interface NotificationCardProps<NotificationMetadata =
|
|
14
|
+
export interface NotificationCardProps<NotificationMetadata = any> {
|
|
15
|
+
_id: string;
|
|
15
16
|
user: NoitificationUser;
|
|
16
17
|
body: string | React.ReactNode | ((metadata?: NotificationMetadata) => React.ReactNode);
|
|
17
18
|
date: string | Date;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NavigationDrawerActionItemProps } from '../NavigationDrawer/NavigationDrawerActionItem';
|
|
2
|
+
import { NavigationDrawerLinkItemProps } from '../NavigationDrawer/NavigationDrawerLinkItem';
|
|
3
|
+
declare const DrawerContent: import('react').MemoExoticComponent<({ navlinks, handleNavigation, allActions, activeActionId, onActionClick }: {
|
|
4
|
+
navlinks?: NavigationDrawerLinkItemProps[];
|
|
5
|
+
handleNavigation: (path: string) => void;
|
|
6
|
+
allActions: NavigationDrawerActionItemProps[];
|
|
7
|
+
activeActionId?: string;
|
|
8
|
+
onActionClick?: (id: string, payload?: any) => void;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element>;
|
|
10
|
+
export default DrawerContent;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TicketCardHandlerProps } from '../TicketCard';
|
|
3
|
+
import { AuthSession, PyrionNavigationDrawerOptions, PyrionNavigationDrawerProps } from './PyrionLayout';
|
|
4
|
+
export interface DrawerFooterProps<TAppMetadata> {
|
|
5
|
+
state: PyrionNavigationDrawerProps<TAppMetadata>['state'];
|
|
6
|
+
currentAppSessions: AuthSession<TAppMetadata>[];
|
|
7
|
+
resolveUserSecondarySlot: (metadata?: TAppMetadata) => ReactNode | string | null;
|
|
8
|
+
resolveSessionSecondarySlot: (session: AuthSession<TAppMetadata>) => ReactNode | string | null;
|
|
9
|
+
onSessionClick?: (session: AuthSession<TAppMetadata>) => void;
|
|
10
|
+
onLogoutClick?: () => void;
|
|
11
|
+
options?: PyrionNavigationDrawerOptions<TAppMetadata>;
|
|
12
|
+
currentSystemId: string;
|
|
13
|
+
userOptionsControls: React.RefObject<TicketCardHandlerProps | null>;
|
|
14
|
+
mobileAppSwitcherControls: React.RefObject<TicketCardHandlerProps | null>;
|
|
15
|
+
}
|
|
16
|
+
type DrawerFooterComponent = <TAppMetadata = unknown>(props: DrawerFooterProps<TAppMetadata>) => React.ReactElement;
|
|
17
|
+
declare const DrawerFooter: DrawerFooterComponent & {
|
|
18
|
+
displayName?: string;
|
|
19
|
+
};
|
|
20
|
+
export default DrawerFooter;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TabSwitchElement } from '../TabSwitch/TabSwitch';
|
|
2
|
+
import { TicketCardHandlerProps } from '../TicketCard';
|
|
3
|
+
declare const DrawerHeader: import('react').MemoExoticComponent<({ onSystemLogoClick, state, currentSystemId, tabs, mobileAppSwitcherControls }: {
|
|
4
|
+
onSystemLogoClick?: (collapsed?: boolean) => void;
|
|
5
|
+
state: any;
|
|
6
|
+
currentSystemId: string;
|
|
7
|
+
tabs: TabSwitchElement[];
|
|
8
|
+
mobileAppSwitcherControls: React.RefObject<TicketCardHandlerProps | null>;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element>;
|
|
10
|
+
export default DrawerHeader;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface PLHelpSectionProps {
|
|
3
|
+
onCloseClick?: VoidFunction;
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
title?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const PLHelpSection: ({ onCloseClick, children, title }: PLHelpSectionProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default PLHelpSection;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { TabSwitchElement } from '../TabSwitch/TabSwitch';
|
|
3
3
|
import { TicketCardHandlerProps } from '../TicketCard/TicketCard';
|
|
4
|
-
export interface
|
|
4
|
+
export interface PLMobileAppSwitcherProps {
|
|
5
5
|
tabs: TabSwitchElement[];
|
|
6
6
|
content: React.ReactNode | (() => React.ReactNode);
|
|
7
7
|
controls?: React.RefObject<TicketCardHandlerProps | null>;
|
|
8
8
|
}
|
|
9
|
-
declare const
|
|
10
|
-
export default
|
|
9
|
+
declare const PLMobileAppSwitcher: ({ tabs, content, controls }: PLMobileAppSwitcherProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default PLMobileAppSwitcher;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NotificationCardProps } from '../NotificationCard/NotificationCard';
|
|
2
|
+
interface PLNotificationsDrawerProps<NotificationMetadata> {
|
|
3
|
+
onCloseClick?: VoidFunction;
|
|
4
|
+
onMarkAllAsRead?: () => void;
|
|
5
|
+
notificationsListControls?: React.RefObject<NotificationsListControlsHandler<NotificationMetadata> | null>;
|
|
6
|
+
}
|
|
7
|
+
export interface NotificationsListControlsHandler<NotificationMetadata> {
|
|
8
|
+
addNewNotification: (notification: NotificationCardProps<NotificationMetadata> | NotificationCardProps<NotificationMetadata>[]) => void;
|
|
9
|
+
subscribeToUpdates: (callback: (notifications: NotificationCardProps<NotificationMetadata>[], count: number) => void) => () => void;
|
|
10
|
+
removeNotification: (id: string | string[]) => void;
|
|
11
|
+
removeAllNotifications: () => void;
|
|
12
|
+
setNotifications: (notifications: NotificationCardProps<NotificationMetadata>[]) => void;
|
|
13
|
+
}
|
|
14
|
+
declare const PLNotificationsList: <NotificationMetadata = unknown>({ onCloseClick, onMarkAllAsRead, notificationsListControls }: PLNotificationsDrawerProps<NotificationMetadata>) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export default PLNotificationsList;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { PLSidebarContentHandle } from './PLSidebarContent';
|
|
3
|
+
import { NotificationsListControlsHandler } from './PLNotificationsList';
|
|
4
|
+
declare const _DrawerSidebarWrapper: <TNotificationMetadata = unknown>({ options, helpSection, sidebarContentRef, initialSectionRef, notificationsListControls, }: {
|
|
5
|
+
options?: any;
|
|
6
|
+
helpSection?: ReactNode | (() => ReactNode);
|
|
7
|
+
sidebarContentRef: React.RefObject<PLSidebarContentHandle | null>;
|
|
8
|
+
initialSectionRef: React.RefObject<"notifications" | "help">;
|
|
9
|
+
notificationsListControls?: React.RefObject<NotificationsListControlsHandler<TNotificationMetadata> | null>;
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare const DrawerSidebarWrapper: typeof _DrawerSidebarWrapper;
|
|
12
|
+
export default DrawerSidebarWrapper;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactElement, ReactNode, ForwardedRef } from 'react';
|
|
2
|
+
import { PyrionNavigationDrawerOptions } from './PyrionLayout';
|
|
3
|
+
import { NotificationsListControlsHandler } from './PLNotificationsList';
|
|
4
|
+
export type PLSidebarContentHandle = {
|
|
5
|
+
setActiveSection: (section: 'notifications' | 'help') => void;
|
|
6
|
+
};
|
|
7
|
+
export type PLSidebarContentProps<TNotificationMetadata = unknown> = {
|
|
8
|
+
closeSidebar: () => void;
|
|
9
|
+
options?: PyrionNavigationDrawerOptions<any>;
|
|
10
|
+
helpSection?: ReactNode | (() => ReactNode);
|
|
11
|
+
initialSection?: 'notifications' | 'help';
|
|
12
|
+
notificationsListControls?: React.RefObject<NotificationsListControlsHandler<TNotificationMetadata> | null>;
|
|
13
|
+
};
|
|
14
|
+
declare const PLSidebarContent: <TNotificationMetadata = unknown>(props: PLSidebarContentProps<TNotificationMetadata> & {
|
|
15
|
+
ref?: ForwardedRef<PLSidebarContentHandle>;
|
|
16
|
+
}) => ReactElement | null;
|
|
17
|
+
export default PLSidebarContent;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AllOptionAccessor } from '../Shared/types';
|
|
2
|
+
import { AuthSession } from './PyrionLayout';
|
|
3
|
+
export interface PLSystemSessionsProps<TAppMetadata> {
|
|
4
|
+
sessions?: AuthSession<TAppMetadata>[];
|
|
5
|
+
onSessionClick?: (session: AuthSession<TAppMetadata>) => void;
|
|
6
|
+
secondarySlot?: React.ReactNode | string | ((session: AuthSession<TAppMetadata>) => React.ReactNode | string | null) | null;
|
|
7
|
+
subImageUrlAccessor?: subImageUrlAccessor<TAppMetadata>;
|
|
8
|
+
currentSystemId: string;
|
|
9
|
+
}
|
|
10
|
+
export type subImageUrlAccessor<TAppMetadata> = AllOptionAccessor<{
|
|
11
|
+
metadata: TAppMetadata;
|
|
12
|
+
}, string>;
|
|
13
|
+
declare const PLSystemSessions: <TAppMetadata = unknown>(props: PLSystemSessionsProps<TAppMetadata>) => import("react/jsx-runtime").JSX.Element | null;
|
|
14
|
+
export default PLSystemSessions;
|