prometeo-design-system 4.2.5 → 4.3.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/NotificationCard.es.js +12 -11
- package/dist/PyrionLayout.es.js +463 -450
- package/dist/Scrollable.es.js +298 -227
- package/dist/SelectSearch.es.js +41 -39
- package/dist/Toast.es.js +95 -51
- package/dist/components/PyrionNavigationDrawer/PyrionLayout.d.ts +3 -2
- package/dist/components/Scrollable/Scrollable.d.ts +10 -0
- package/dist/components/Toaster/Toaster.d.ts +13 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/styles/base.css +46 -0
package/dist/SelectSearch.es.js
CHANGED
|
@@ -16,7 +16,7 @@ function re(e) {
|
|
|
16
16
|
isOpen: F,
|
|
17
17
|
inputRef: p,
|
|
18
18
|
name: I
|
|
19
|
-
} = e || {}, M = C ? C.filter((n) => n != null) : [], [V, g] = A(M || []), [D, k] = A(M || []), [s, N] = A(""), [W, v] = A(!1), [J, U] = A(!1),
|
|
19
|
+
} = e || {}, M = C ? C.filter((n) => n != null) : [], [V, g] = A(M || []), [D, k] = A(M || []), [s, N] = A(""), [W, v] = A(!1), [J, U] = A(!1), o = E(null), O = E(null), m = E(!1), S = E(d), L = e?.multiple === !0 || !1, j = E(L ? [] : void 0), [a, y] = A(L ? [] : void 0);
|
|
20
20
|
b(() => {
|
|
21
21
|
S.current = d;
|
|
22
22
|
}, [d]), b(() => {
|
|
@@ -33,22 +33,22 @@ function re(e) {
|
|
|
33
33
|
g(n), k(n);
|
|
34
34
|
}
|
|
35
35
|
}, [e?.options]);
|
|
36
|
-
const B = ee(() => (n, t) => new Promise((
|
|
37
|
-
|
|
36
|
+
const B = ee(() => (n, t) => new Promise((l, r) => {
|
|
37
|
+
o.current && clearTimeout(o.current), o.current = setTimeout(() => n(s).then(l).catch(r), t);
|
|
38
38
|
}), [s]), te = (n) => {
|
|
39
|
-
const t = f !== void 0,
|
|
39
|
+
const t = f !== void 0, l = (r) => c ? i(r, c) : i(r, "id");
|
|
40
40
|
if (e?.multiple === !0) {
|
|
41
41
|
const r = j.current || [];
|
|
42
42
|
let u;
|
|
43
|
-
r.some((x) =>
|
|
43
|
+
r.some((x) => l(x) === l(n)) ? u = r.filter((x) => l(x) !== l(n)) : u = [...r, n], t ? (j.current = u, e?.onChange?.(u, I)) : (j.current = u, y(u), e?.onChange?.(u, I));
|
|
44
44
|
} else
|
|
45
45
|
t ? (j.current = n, e?.onChange?.(n, I)) : (j.current = n, y(n), e?.onChange?.(n, I));
|
|
46
|
-
}, q = (n) => (e?.onFetchingStart?.(), S.current?.(n) || Promise.resolve([])), z = (n, t) => Array.isArray(n) ? (n.some((
|
|
46
|
+
}, q = (n) => (e?.onFetchingStart?.(), S.current?.(n) || Promise.resolve([])), z = (n, t) => Array.isArray(n) ? (n.some((l) => typeof l != "object" || l === null) && console.debug(`El valor del ${t || "resultado del fetcher"} contiene elementos no válidos (null,undefined, no-object)`, n), n?.filter((l) => l != null) || []) : (console.debug(`El valor del ${t || "resultado del fetcher"} no es un Array (tipo de dato obtenido: ${typeof n})`), []), $ = ne((n, t) => n.length === 0 ? t : c ? t.filter((l) => !n.some((r) => i(r, c) === i(l, c))) : t.filter((l) => !n.some((r) => i(r, "id") === i(l, "id"))), [c]);
|
|
47
47
|
b(() => {
|
|
48
48
|
const n = e?.subscribeOpenChange;
|
|
49
49
|
if (!n) return;
|
|
50
|
-
const t = n((
|
|
51
|
-
U(
|
|
50
|
+
const t = n((l) => {
|
|
51
|
+
U(l);
|
|
52
52
|
});
|
|
53
53
|
return () => {
|
|
54
54
|
t && t();
|
|
@@ -58,13 +58,13 @@ function re(e) {
|
|
|
58
58
|
b(() => {
|
|
59
59
|
if (!w && S.current && _ === "fetch_on_type") {
|
|
60
60
|
if (!s || s === "" || s.length < T) {
|
|
61
|
-
|
|
61
|
+
o.current && clearTimeout(o.current), v(!1);
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
64
|
const n = B(q, P);
|
|
65
65
|
v(!0), n.then((t) => {
|
|
66
|
-
const
|
|
67
|
-
g(
|
|
66
|
+
const l = z(t);
|
|
67
|
+
g(l);
|
|
68
68
|
}).finally(() => {
|
|
69
69
|
v(!1), e?.onFetchingEnd?.();
|
|
70
70
|
});
|
|
@@ -78,11 +78,11 @@ function re(e) {
|
|
|
78
78
|
v(!0), q().then((n) => {
|
|
79
79
|
const t = z(n);
|
|
80
80
|
g(() => {
|
|
81
|
-
const
|
|
81
|
+
const l = t.filter((r) => {
|
|
82
82
|
if (c)
|
|
83
83
|
return i(r, c) !== void 0;
|
|
84
84
|
});
|
|
85
|
-
return L && a.length > 0 ? [...$(a,
|
|
85
|
+
return L && a.length > 0 ? [...$(a, l), ...a] : l;
|
|
86
86
|
});
|
|
87
87
|
}).finally(() => {
|
|
88
88
|
v(!1), e?.onFetchingEnd?.();
|
|
@@ -91,11 +91,11 @@ function re(e) {
|
|
|
91
91
|
} else
|
|
92
92
|
e?.onClose?.();
|
|
93
93
|
}, [G, _, w]);
|
|
94
|
-
const H = (n, t) => n?.filter((
|
|
94
|
+
const H = (n, t) => n?.filter((l) => {
|
|
95
95
|
if (h)
|
|
96
|
-
return i(
|
|
96
|
+
return i(l, h)?.toLowerCase().includes(t.toLowerCase());
|
|
97
97
|
{
|
|
98
|
-
const r =
|
|
98
|
+
const r = l;
|
|
99
99
|
switch (typeof r) {
|
|
100
100
|
case "string":
|
|
101
101
|
return r?.toLowerCase().includes(t.toLowerCase());
|
|
@@ -107,11 +107,11 @@ function re(e) {
|
|
|
107
107
|
return !1;
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
}) || [],
|
|
110
|
+
}) || [], le = (n) => n?.sort((t, l) => {
|
|
111
111
|
if (h)
|
|
112
|
-
return i(t, h) < i(
|
|
112
|
+
return i(t, h) < i(l, h) ? -1 : 1;
|
|
113
113
|
{
|
|
114
|
-
const u = ["label", "name", "value"].find((K) => typeof t == "object" && Object.keys(t).includes(K)), R = t, x =
|
|
114
|
+
const u = ["label", "name", "value"].find((K) => typeof t == "object" && Object.keys(t).includes(K)), R = t, x = l;
|
|
115
115
|
switch (typeof R) {
|
|
116
116
|
case "string":
|
|
117
117
|
return R < x ? -1 : 1;
|
|
@@ -119,8 +119,8 @@ function re(e) {
|
|
|
119
119
|
return R < x ? -1 : 1;
|
|
120
120
|
case "object":
|
|
121
121
|
if (u) {
|
|
122
|
-
const K = i(t, u),
|
|
123
|
-
return K <
|
|
122
|
+
const K = i(t, u), oe = i(l, u);
|
|
123
|
+
return K < oe ? -1 : 1;
|
|
124
124
|
} else
|
|
125
125
|
return 1;
|
|
126
126
|
default:
|
|
@@ -135,7 +135,7 @@ function re(e) {
|
|
|
135
135
|
};
|
|
136
136
|
b(() => {
|
|
137
137
|
if (s === "")
|
|
138
|
-
k(
|
|
138
|
+
k(le(V));
|
|
139
139
|
else if (L) {
|
|
140
140
|
const n = $(a, V);
|
|
141
141
|
k([...H(n, s), ...a]);
|
|
@@ -173,36 +173,36 @@ function re(e) {
|
|
|
173
173
|
};
|
|
174
174
|
}
|
|
175
175
|
const he = (e) => {
|
|
176
|
-
const C = E(null), { asyncMode: d = "fetch_in_open" } = e, _ = (
|
|
176
|
+
const C = E(null), { asyncMode: d = "fetch_in_open" } = e, _ = (o, O, m) => {
|
|
177
177
|
const S = {
|
|
178
|
-
options:
|
|
179
|
-
fetcher:
|
|
178
|
+
options: o.options,
|
|
179
|
+
fetcher: o.fetcher,
|
|
180
180
|
asyncMode: O,
|
|
181
|
-
debounceDelay:
|
|
182
|
-
minCharacters:
|
|
183
|
-
disabled:
|
|
184
|
-
optionValue:
|
|
185
|
-
optionLabel:
|
|
181
|
+
debounceDelay: o.debounceDelay,
|
|
182
|
+
minCharacters: o.minCharacters,
|
|
183
|
+
disabled: o.disabled,
|
|
184
|
+
optionValue: o.optionValue,
|
|
185
|
+
optionLabel: o.optionLabel,
|
|
186
186
|
onFetchingStart: () => {
|
|
187
187
|
O === "fetch_on_type" && m.current?.open();
|
|
188
188
|
},
|
|
189
189
|
onTypeStart: () => {
|
|
190
|
-
!
|
|
190
|
+
!o?.fetcher && m.current?.open();
|
|
191
191
|
},
|
|
192
192
|
inputRef: () => m.current?.searchInputRef,
|
|
193
193
|
subscribeOpenChange: m.current?.subscribeOpenChange,
|
|
194
|
-
name:
|
|
194
|
+
name: o.name
|
|
195
195
|
};
|
|
196
|
-
return
|
|
196
|
+
return o.multiple ? {
|
|
197
197
|
...S,
|
|
198
198
|
multiple: !0,
|
|
199
|
-
controlledValue:
|
|
200
|
-
onChange:
|
|
199
|
+
controlledValue: o.value,
|
|
200
|
+
onChange: o.onChange
|
|
201
201
|
} : {
|
|
202
202
|
...S,
|
|
203
203
|
multiple: !1,
|
|
204
|
-
controlledValue:
|
|
205
|
-
onChange:
|
|
204
|
+
controlledValue: o.value,
|
|
205
|
+
onChange: o.onChange
|
|
206
206
|
};
|
|
207
207
|
}, { inputValue: w, setInputValue: P, filteredOptions: T, isLoading: h, value: c, onOptionClick: f, cleanInputValue: F, cleanOptions: p, clearValue: I } = re(_(e, d, C));
|
|
208
208
|
b(() => {
|
|
@@ -216,8 +216,8 @@ const he = (e) => {
|
|
|
216
216
|
const M = ne(
|
|
217
217
|
() => d === "fetch_on_type" ? h : !1,
|
|
218
218
|
[d, h]
|
|
219
|
-
), V = ee(() => e.multiple ? c.map((
|
|
220
|
-
const O = T.find((m) => i(m, e.optionValue) ===
|
|
219
|
+
), V = ee(() => e.multiple ? c.map((o) => i(o, e.optionValue)) : c ? i(c, e.optionValue) : void 0, [c, e.optionValue, e.multiple]), g = (o) => {
|
|
220
|
+
const O = T.find((m) => i(m, e.optionValue) === o.id);
|
|
221
221
|
O && f(O);
|
|
222
222
|
}, { displayMode: D = e.multiple ? "chips" : "compact", dropdownOptions: k, overflow: s = "scroll", onChange: N, onClear: W, ...v } = e.selectComponentProps || {}, J = {
|
|
223
223
|
controledSearchValue: w,
|
|
@@ -239,6 +239,7 @@ const he = (e) => {
|
|
|
239
239
|
className: e.className,
|
|
240
240
|
name: e.name,
|
|
241
241
|
overflow: s,
|
|
242
|
+
placeholder: e.placeholder,
|
|
242
243
|
...v,
|
|
243
244
|
onClear: e?.selectComponentProps?.onClear && U,
|
|
244
245
|
multiple: !0,
|
|
@@ -261,6 +262,7 @@ const he = (e) => {
|
|
|
261
262
|
{
|
|
262
263
|
disabled: e.disabled,
|
|
263
264
|
...v,
|
|
265
|
+
placeholder: e.placeholder,
|
|
264
266
|
onClear: U,
|
|
265
267
|
className: e.className,
|
|
266
268
|
overflow: s,
|
package/dist/Toast.es.js
CHANGED
|
@@ -1,59 +1,67 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { Info as
|
|
6
|
-
import { Error as
|
|
7
|
-
import { Cancel as
|
|
8
|
-
import { CheckCircle as
|
|
9
|
-
import
|
|
10
|
-
import { Close as
|
|
11
|
-
const
|
|
1
|
+
import { j as t } from "./jsx-runtime-GkKLlHH4.js";
|
|
2
|
+
import { c as l } from "./cn-B6yFEsav.js";
|
|
3
|
+
import P, { useRef as b, useEffect as I } from "react";
|
|
4
|
+
import { toast as h } from "sonner";
|
|
5
|
+
import { Info as w } from "./Icons/Info.es.js";
|
|
6
|
+
import { Error as v } from "./Icons/Error.es.js";
|
|
7
|
+
import { Cancel as y } from "./Icons/Cancel.es.js";
|
|
8
|
+
import { CheckCircle as j } from "./Icons/CheckCircle.es.js";
|
|
9
|
+
import C from "./Button.es.js";
|
|
10
|
+
import { Close as E } from "./Icons/Close.es.js";
|
|
11
|
+
const p = {
|
|
12
12
|
dark: {
|
|
13
13
|
success: {
|
|
14
14
|
container: "border-b-[2px] border-success-default-default",
|
|
15
15
|
iconClass: "text-success-medium-default",
|
|
16
|
-
icon:
|
|
16
|
+
icon: j,
|
|
17
|
+
loading: "bg-success-default-default"
|
|
17
18
|
},
|
|
18
19
|
error: {
|
|
19
20
|
container: "border-b-[2px] border-error-default-default",
|
|
20
21
|
iconClass: "text-error-medium-default",
|
|
21
|
-
icon:
|
|
22
|
+
icon: y,
|
|
23
|
+
loading: "bg-error-default-default"
|
|
22
24
|
},
|
|
23
25
|
warning: {
|
|
24
26
|
container: "border-b-[2px] border-warning-default-default",
|
|
25
27
|
iconClass: "text-warning-medium-default",
|
|
26
|
-
icon:
|
|
28
|
+
icon: v,
|
|
29
|
+
loading: "bg-warning-default-default"
|
|
27
30
|
},
|
|
28
31
|
info: {
|
|
29
32
|
container: " border-b-[2px] border-primary-default-default",
|
|
30
33
|
iconClass: "text-primary-default-default",
|
|
31
|
-
icon:
|
|
34
|
+
icon: w,
|
|
35
|
+
loading: "bg-primary-default-default"
|
|
32
36
|
}
|
|
33
37
|
},
|
|
34
38
|
light: {
|
|
35
39
|
success: {
|
|
36
40
|
container: "",
|
|
37
41
|
iconClass: "text-success-default-pressed",
|
|
38
|
-
icon:
|
|
42
|
+
icon: j,
|
|
43
|
+
loading: "bg-success-default-pressed"
|
|
39
44
|
},
|
|
40
45
|
error: {
|
|
41
46
|
container: "",
|
|
42
47
|
iconClass: "text-error-medium-pressed",
|
|
43
|
-
icon:
|
|
48
|
+
icon: y,
|
|
49
|
+
loading: "bg-error-medium-pressed"
|
|
44
50
|
},
|
|
45
51
|
warning: {
|
|
46
52
|
container: "",
|
|
47
53
|
iconClass: "text-warning-medium-pressed",
|
|
48
|
-
icon:
|
|
54
|
+
icon: v,
|
|
55
|
+
loading: "bg-warning-medium-pressed"
|
|
49
56
|
},
|
|
50
57
|
info: {
|
|
51
58
|
container: "",
|
|
52
59
|
iconClass: "text-primary-default-pressed",
|
|
53
|
-
icon:
|
|
60
|
+
icon: w,
|
|
61
|
+
loading: "bg-primary-default-pressed"
|
|
54
62
|
}
|
|
55
63
|
}
|
|
56
|
-
},
|
|
64
|
+
}, x = {
|
|
57
65
|
dark: {
|
|
58
66
|
container: "bg-neutral-default-default",
|
|
59
67
|
title: "text-neutral-strong-default",
|
|
@@ -66,85 +74,121 @@ const x = {
|
|
|
66
74
|
description: "text-neutral-medium-focused",
|
|
67
75
|
shadow: "0px 0px 2px 0px rgba(0, 0, 0, 0.35),8px 8px 20px 0px rgba(0, 0, 0, 0.3),0px 0px 15px 0px rgba(0, 0, 0, 0.2),0px 0px 20px 0px rgba(21, 21, 21, 0.3) inset,6px 0px 100px 0px rgba(0, 0, 0, 0.05) inset"
|
|
68
76
|
}
|
|
69
|
-
},
|
|
70
|
-
const { title: r, description:
|
|
71
|
-
return /* @__PURE__ */
|
|
77
|
+
}, T = (d) => {
|
|
78
|
+
const { title: r, description: n, button: a, id: i, icon: s, variant: o = "info", colorMode: e = "dark", showClose: m = !1, loading: c = !1, loadingTimeout: g = 2500, finishLoader: u = !1 } = d;
|
|
79
|
+
return /* @__PURE__ */ t.jsxs(
|
|
72
80
|
"div",
|
|
73
81
|
{
|
|
74
82
|
style: {
|
|
75
|
-
boxShadow:
|
|
83
|
+
boxShadow: x[e].shadow
|
|
76
84
|
},
|
|
77
|
-
className:
|
|
85
|
+
className: l(
|
|
78
86
|
"flex p-3 pb-4 md:w-[485px] md:max-w-[485px] md:min-w-[485px] md:h-[68px] md:max-h-[68px] rounded-lg gap-2",
|
|
79
|
-
"w-[345px] max-w-[345px] min-w-[345px] h-[68px] max-h-[68px]",
|
|
80
|
-
|
|
81
|
-
|
|
87
|
+
"w-[345px] max-w-[345px] min-w-[345px] h-[68px] max-h-[68px] relative",
|
|
88
|
+
x[e].container,
|
|
89
|
+
p[e][o].container,
|
|
90
|
+
c && "border-b-0"
|
|
82
91
|
),
|
|
83
92
|
children: [
|
|
84
|
-
/* @__PURE__ */
|
|
93
|
+
/* @__PURE__ */ t.jsxs(
|
|
85
94
|
"div",
|
|
86
95
|
{
|
|
87
96
|
className: "flex items-center justify-start gap-2 max-h-[38px] h-[38px] overflow-hidden flex-1 ",
|
|
88
97
|
children: [
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
|
|
98
|
+
/* @__PURE__ */ t.jsx("div", { className: "f", style: { color: "inherit" }, children: P.createElement(s || p[e][o].icon, { size: 24, className: p[e][o].iconClass }) }),
|
|
99
|
+
/* @__PURE__ */ t.jsxs("div", { className: "flex-1 flex flex-col gap-1", children: [
|
|
100
|
+
/* @__PURE__ */ t.jsx("p", { className: l("select-none prometeo-fonts-label-medium md:prometeo-fonts-label-xlarge", x[e].title), children: r }),
|
|
101
|
+
n && /* @__PURE__ */ t.jsx("p", { className: l("select-none prometeo-fonts-body-xsmall md:prometeo-fonts-body-small text-nowrap overflow-ellipsis ", x[e].description), children: n })
|
|
93
102
|
] })
|
|
94
103
|
]
|
|
95
104
|
}
|
|
96
105
|
),
|
|
97
|
-
|
|
98
|
-
|
|
106
|
+
c && /* @__PURE__ */ t.jsx(z, { color: o, timeOut: g, finished: u, colorMode: e }),
|
|
107
|
+
a?.label && /* @__PURE__ */ t.jsx("div", { className: "shrink-0", children: /* @__PURE__ */ t.jsx(
|
|
108
|
+
C,
|
|
99
109
|
{
|
|
100
110
|
label: a?.label,
|
|
101
111
|
onClick: () => {
|
|
102
|
-
a?.onClick(),
|
|
112
|
+
a?.onClick(), h.dismiss(i);
|
|
103
113
|
},
|
|
104
114
|
size: "small",
|
|
105
115
|
color: "secondary"
|
|
106
116
|
}
|
|
107
117
|
) }),
|
|
108
|
-
|
|
109
|
-
|
|
118
|
+
m && /* @__PURE__ */ t.jsx("div", { className: "shrink-0", children: /* @__PURE__ */ t.jsx(
|
|
119
|
+
C,
|
|
110
120
|
{
|
|
111
121
|
onClick: () => {
|
|
112
|
-
|
|
122
|
+
h.dismiss(i);
|
|
113
123
|
},
|
|
114
124
|
label: "",
|
|
115
125
|
size: "small",
|
|
116
126
|
color: "secondary",
|
|
117
|
-
icon: /* @__PURE__ */
|
|
127
|
+
icon: /* @__PURE__ */ t.jsx(E, { className: l(e === "light" ? "text-neutral-medium-focused " : "") }),
|
|
118
128
|
variant: "text",
|
|
119
129
|
animate: !1,
|
|
120
|
-
className:
|
|
130
|
+
className: l(e === "light" ? "hover:bg-neutral-default-hover-light focus:bg-inherit active:bg-neutral-weak-hover " : "")
|
|
121
131
|
}
|
|
122
132
|
) })
|
|
123
133
|
]
|
|
124
134
|
}
|
|
125
135
|
);
|
|
136
|
+
}, z = ({ className: d, color: r, timeOut: n, finished: a, colorMode: i }) => {
|
|
137
|
+
const s = b(0), o = b(Date.now()), e = b(null);
|
|
138
|
+
I(() => {
|
|
139
|
+
if (a) {
|
|
140
|
+
s.current = 1, e.current && (e.current.style.width = "100%");
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
o.current = Date.now(), s.current = 0;
|
|
144
|
+
const c = setInterval(() => {
|
|
145
|
+
const g = Date.now() - o.current, u = Math.min(g / n, 1), N = u * 0.95, k = Math.sin(u * Math.PI * 2) * 0.15 + 0.05, M = Math.random() < k;
|
|
146
|
+
let f;
|
|
147
|
+
if (M)
|
|
148
|
+
f = s.current;
|
|
149
|
+
else {
|
|
150
|
+
const R = (Math.random() - 0.5) * 0.25;
|
|
151
|
+
f = Math.max(s.current, Math.min(0.95, N + R));
|
|
152
|
+
}
|
|
153
|
+
s.current = f, e.current && (e.current.style.width = `${f * 100}%`), (u >= 1 || a) && clearInterval(c);
|
|
154
|
+
}, 50);
|
|
155
|
+
return () => clearInterval(c);
|
|
156
|
+
}, [n, a]);
|
|
157
|
+
const m = p[i][r].loading;
|
|
158
|
+
return /* @__PURE__ */ t.jsx("div", { className: l(
|
|
159
|
+
"absolute bottom-0 translate-y-0 left-0 w-full h-2 overflow-hidden rounded-b-xl",
|
|
160
|
+
'after:content-[""] after:w-[calc(100%-0px)] after:absolute after:bottom-0 after:left-1/2 after:bg-neutral-default-default after:h-2 after:-translate-x-1/2 after:-translate-y-[2px] after:rounded-b-full after:overflow-hidden',
|
|
161
|
+
d
|
|
162
|
+
), children: /* @__PURE__ */ t.jsx(
|
|
163
|
+
"div",
|
|
164
|
+
{
|
|
165
|
+
ref: e,
|
|
166
|
+
className: l("h-full transition-all duration-300 ease-out", m),
|
|
167
|
+
style: { width: "0%" }
|
|
168
|
+
}
|
|
169
|
+
) });
|
|
126
170
|
};
|
|
127
|
-
function
|
|
128
|
-
const { duration:
|
|
129
|
-
return
|
|
130
|
-
|
|
171
|
+
function G(d, r) {
|
|
172
|
+
const { duration: n = 2500, showClose: a = !1, colorMode: i = "dark", position: s } = r || {};
|
|
173
|
+
return h.custom((o) => /* @__PURE__ */ t.jsx(
|
|
174
|
+
T,
|
|
131
175
|
{
|
|
132
176
|
id: o,
|
|
133
177
|
variant: r?.variant || "success",
|
|
134
|
-
title:
|
|
178
|
+
title: d,
|
|
135
179
|
description: r?.description,
|
|
136
180
|
icon: r?.icon,
|
|
137
181
|
button: r?.button,
|
|
138
182
|
showClose: a,
|
|
139
|
-
colorMode:
|
|
183
|
+
colorMode: i
|
|
140
184
|
}
|
|
141
185
|
), {
|
|
142
|
-
duration:
|
|
143
|
-
position:
|
|
186
|
+
duration: n,
|
|
187
|
+
position: s,
|
|
144
188
|
unstyled: !0
|
|
145
189
|
});
|
|
146
190
|
}
|
|
147
191
|
export {
|
|
148
|
-
|
|
149
|
-
|
|
192
|
+
T as default,
|
|
193
|
+
G as toastpyrion
|
|
150
194
|
};
|
|
@@ -3,7 +3,7 @@ import { PyrionLayoutActionItemProps } from '../NavigationDrawer/NavigationDrawe
|
|
|
3
3
|
import { PyrionLayoutLinkItemProps } from '../NavigationDrawer/NavigationDrawerLinkItem';
|
|
4
4
|
import { NavigationDrawerSidebarProps } from '../NavigationDrawer/NavigationDrawerSidebar';
|
|
5
5
|
import { NotificationCardProps } from '../NotificationCard/NotificationCard';
|
|
6
|
-
import { ScrollTargetData } from '../Scrollable/Scrollable';
|
|
6
|
+
import { ScrollTargetData, ScrollTargetConfig } from '../Scrollable/Scrollable';
|
|
7
7
|
import { AllOptionAccessor } from '../Shared/types';
|
|
8
8
|
import { TabSwitchElement } from '../TabSwitch/TabSwitch';
|
|
9
9
|
import { subImageUrlAccessor } from './PLSystemSessions';
|
|
@@ -141,7 +141,8 @@ export type PyrionNavigationControls<TNotificationMetadata = unknown> = {
|
|
|
141
141
|
setNotifications?: (notifications: NotificationCardProps<TNotificationMetadata>[]) => void;
|
|
142
142
|
removeAllNotifications?: () => void;
|
|
143
143
|
removeNotification?: (id: string | string[]) => void;
|
|
144
|
-
|
|
144
|
+
setNotificationsLoading?: (loading: boolean) => void;
|
|
145
|
+
subscribeToNotificationsScroll?: (callback: (data: ScrollTargetData) => void, config?: ScrollTargetConfig) => () => void;
|
|
145
146
|
};
|
|
146
147
|
export declare const usePyrionLayout: <TNotificationMetadata = unknown>() => PyrionNavigationControls<TNotificationMetadata>;
|
|
147
148
|
declare const PyrionLayout: <TAppMetadata = unknown, TNotificationMetadata = unknown>({ children, helpSection, state, links: navlinks, onLinkClick, onNavigate, onLogoutClick, actions, activeActionId, onActionClick, tabsProps, currentSystemId, onSessionClick, onSystemLogoClick, onProfileClick, ...props }: PyrionLayoutProps<TAppMetadata, TNotificationMetadata>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -35,6 +35,15 @@ export interface ScrollTargetConfig {
|
|
|
35
35
|
export interface ScrollableControlsHandler {
|
|
36
36
|
subscribeToScrollTarget: (callback: (data: ScrollTargetData) => void, config?: ScrollTargetConfig) => () => void;
|
|
37
37
|
}
|
|
38
|
+
type ScrollTopButtonTarget = string;
|
|
39
|
+
type ScrollTopButtonProps = {
|
|
40
|
+
target?: ScrollTopButtonTarget;
|
|
41
|
+
icon?: React.ComponentType<{
|
|
42
|
+
size?: number;
|
|
43
|
+
className?: string;
|
|
44
|
+
}>;
|
|
45
|
+
className?: string;
|
|
46
|
+
};
|
|
38
47
|
export interface ScrollableProps {
|
|
39
48
|
debugMode?: boolean;
|
|
40
49
|
className?: string;
|
|
@@ -46,6 +55,7 @@ export interface ScrollableProps {
|
|
|
46
55
|
defaultBehavior?: 'scroll-on-click' | 'scroll-on-hover' | 'none';
|
|
47
56
|
persistScroll?: boolean | string;
|
|
48
57
|
controls?: React.RefObject<ScrollableControlsHandler | null>;
|
|
58
|
+
scrollTopButton?: ScrollTopButtonProps;
|
|
49
59
|
}
|
|
50
60
|
declare const Scrollable: (props: ScrollableProps) => import("react/jsx-runtime").JSX.Element;
|
|
51
61
|
export default Scrollable;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { ColorMode } from '../Shared/types';
|
|
2
1
|
import { IconComponent } from '../../Icons/types';
|
|
2
|
+
import { ColorMode } from '../Shared/types';
|
|
3
3
|
type ToastElementsProps = {
|
|
4
4
|
container: string;
|
|
5
5
|
iconClass: string;
|
|
6
6
|
icon: IconComponent;
|
|
7
|
+
loading: string;
|
|
7
8
|
};
|
|
8
9
|
type ToastVarians = 'success' | 'error' | 'warning' | 'info';
|
|
9
10
|
type ToastVariantClassnames = {
|
|
@@ -30,7 +31,18 @@ export interface PyrionToastProps {
|
|
|
30
31
|
colorMode?: ColorMode;
|
|
31
32
|
showClose?: boolean;
|
|
32
33
|
position?: ToastPosition;
|
|
34
|
+
loading?: boolean;
|
|
35
|
+
loadingTimeout?: number;
|
|
36
|
+
finishLoader?: boolean;
|
|
33
37
|
}
|
|
34
38
|
declare const PyrionToast: (props: PyrionToastProps) => import("react/jsx-runtime").JSX.Element;
|
|
35
39
|
export default PyrionToast;
|
|
36
40
|
export declare function toastpyrion(title: string, options?: Omit<PyrionToastProps, 'id'>): string | number;
|
|
41
|
+
export declare const toastPyrionPromise: (promise: Promise<any>, options?: {
|
|
42
|
+
loading?: Omit<PyrionToastProps, "id">;
|
|
43
|
+
success?: Omit<PyrionToastProps, "id">;
|
|
44
|
+
error?: Omit<PyrionToastProps, "id">;
|
|
45
|
+
colorMode?: ColorMode;
|
|
46
|
+
position?: ToastPosition;
|
|
47
|
+
timeOut?: number;
|
|
48
|
+
}) => Promise<any>;
|