prometeo-design-system 4.3.6 → 4.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Chip.d.ts +6 -0
- package/dist/Chip.es.js +55 -0
- package/dist/Input.es.js +108 -95
- package/dist/PyrionLayout.es.js +6 -5
- package/dist/Select.es.js +382 -429
- package/dist/SelectSearch.es.js +38 -38
- package/dist/{TabLinks-DxqprStp.js → TabLinks-BjGwvqR9.js} +59 -52
- package/dist/TabLinks.es.js +1 -1
- package/dist/Toast.es.js +175 -134
- package/dist/components/Input/Input.d.ts +3 -3
- package/dist/components/Shared/Chip.d.ts +2 -2
- package/dist/components/TabLinks/TabLinks.d.ts +2 -1
- package/dist/components/Toaster/Toaster.d.ts +6 -4
- package/dist/exports/Chip.d.ts +2 -0
- package/dist/prometeo-design-system.es.js +1 -1
- package/package.json +8 -1
package/dist/SelectSearch.es.js
CHANGED
|
@@ -4,19 +4,19 @@ import { useState as A, useRef as E, useEffect as b, useMemo as ee, useCallback
|
|
|
4
4
|
import Z from "./Select.es.js";
|
|
5
5
|
function re(e) {
|
|
6
6
|
const {
|
|
7
|
-
options:
|
|
7
|
+
options: O,
|
|
8
8
|
fetcher: d,
|
|
9
|
-
asyncMode:
|
|
10
|
-
disabled:
|
|
11
|
-
debounceDelay:
|
|
9
|
+
asyncMode: w = "fetch_in_open",
|
|
10
|
+
disabled: _ = !1,
|
|
11
|
+
debounceDelay: M = 500,
|
|
12
12
|
minCharacters: T = 3,
|
|
13
13
|
optionLabel: h,
|
|
14
14
|
optionValue: c,
|
|
15
15
|
controlledValue: f,
|
|
16
|
-
isOpen:
|
|
16
|
+
isOpen: P,
|
|
17
17
|
inputRef: p,
|
|
18
18
|
name: I
|
|
19
|
-
} = e || {},
|
|
19
|
+
} = e || {}, F = O ? O.filter((n) => n != null) : [], [V, g] = A(F || []), [D, k] = A(F || []), [s, N] = A(""), [W, C] = A(!1), [J, U] = A(!1), o = E(null), v = 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(() => {
|
|
@@ -54,28 +54,28 @@ function re(e) {
|
|
|
54
54
|
t && t();
|
|
55
55
|
};
|
|
56
56
|
}, [e?.subscribeOpenChange]);
|
|
57
|
-
const G =
|
|
57
|
+
const G = P !== void 0 ? P : J;
|
|
58
58
|
b(() => {
|
|
59
|
-
if (!
|
|
59
|
+
if (!_ && S.current && w === "fetch_on_type") {
|
|
60
60
|
if (!s || s === "" || s.length < T) {
|
|
61
|
-
o.current && clearTimeout(o.current),
|
|
61
|
+
o.current && clearTimeout(o.current), C(!1);
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
|
-
const n = B(q,
|
|
65
|
-
|
|
64
|
+
const n = B(q, M);
|
|
65
|
+
C(!0), n.then((t) => {
|
|
66
66
|
const l = z(t);
|
|
67
67
|
g(l);
|
|
68
68
|
}).finally(() => {
|
|
69
|
-
|
|
69
|
+
C(!1), e?.onFetchingEnd?.();
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
}, [
|
|
73
|
-
if (!
|
|
72
|
+
}, [w, s, _, M, B, T]), b(() => {
|
|
73
|
+
if (!_)
|
|
74
74
|
if (G) {
|
|
75
|
-
if (e?.onOpen?.(),
|
|
75
|
+
if (e?.onOpen?.(), w === "fetch_in_open") {
|
|
76
76
|
if (!S.current)
|
|
77
77
|
return;
|
|
78
|
-
|
|
78
|
+
C(!0), q().then((n) => {
|
|
79
79
|
const t = z(n);
|
|
80
80
|
g(() => {
|
|
81
81
|
const l = t.filter((r) => {
|
|
@@ -85,12 +85,12 @@ function re(e) {
|
|
|
85
85
|
return L && a.length > 0 ? [...$(a, l), ...a] : l;
|
|
86
86
|
});
|
|
87
87
|
}).finally(() => {
|
|
88
|
-
|
|
88
|
+
C(!1), e?.onFetchingEnd?.();
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
} else
|
|
92
92
|
e?.onClose?.();
|
|
93
|
-
}, [G,
|
|
93
|
+
}, [G, w, _]);
|
|
94
94
|
const H = (n, t) => n?.filter((l) => {
|
|
95
95
|
if (h)
|
|
96
96
|
return i(l, h)?.toLowerCase().includes(t.toLowerCase());
|
|
@@ -129,9 +129,9 @@ function re(e) {
|
|
|
129
129
|
}
|
|
130
130
|
}) || [], Q = (n) => {
|
|
131
131
|
const t = typeof p == "function" ? p() : p;
|
|
132
|
-
n.target === t?.current && (
|
|
132
|
+
n.target === t?.current && (v.current && clearTimeout(v.current), m.current || (m.current = !0, e?.onTypeStart?.()), v.current = setTimeout(() => {
|
|
133
133
|
m.current = !1;
|
|
134
|
-
},
|
|
134
|
+
}, M));
|
|
135
135
|
};
|
|
136
136
|
b(() => {
|
|
137
137
|
if (s === "")
|
|
@@ -173,18 +173,18 @@ function re(e) {
|
|
|
173
173
|
};
|
|
174
174
|
}
|
|
175
175
|
const he = (e) => {
|
|
176
|
-
const
|
|
176
|
+
const O = E(null), { asyncMode: d = "fetch_in_open" } = e, w = (o, v, m) => {
|
|
177
177
|
const S = {
|
|
178
178
|
options: o.options,
|
|
179
179
|
fetcher: o.fetcher,
|
|
180
|
-
asyncMode:
|
|
180
|
+
asyncMode: v,
|
|
181
181
|
debounceDelay: o.debounceDelay,
|
|
182
182
|
minCharacters: o.minCharacters,
|
|
183
183
|
disabled: o.disabled,
|
|
184
184
|
optionValue: o.optionValue,
|
|
185
185
|
optionLabel: o.optionLabel,
|
|
186
186
|
onFetchingStart: () => {
|
|
187
|
-
|
|
187
|
+
m.current?.open();
|
|
188
188
|
},
|
|
189
189
|
onTypeStart: () => {
|
|
190
190
|
!o?.fetcher && m.current?.open();
|
|
@@ -204,29 +204,29 @@ const he = (e) => {
|
|
|
204
204
|
controlledValue: o.value,
|
|
205
205
|
onChange: o.onChange
|
|
206
206
|
};
|
|
207
|
-
}, { inputValue:
|
|
207
|
+
}, { inputValue: _, setInputValue: M, filteredOptions: T, isLoading: h, value: c, onOptionClick: f, cleanInputValue: P, cleanOptions: p, clearValue: I } = re(w(e, d, O));
|
|
208
208
|
b(() => {
|
|
209
|
-
!e.controls || !
|
|
210
|
-
...
|
|
209
|
+
!e.controls || !O.current || (e.controls.current = {
|
|
210
|
+
...O.current,
|
|
211
211
|
cleanOptions: () => {
|
|
212
212
|
p();
|
|
213
213
|
}
|
|
214
214
|
});
|
|
215
215
|
}, [e.controls, p]);
|
|
216
|
-
const
|
|
216
|
+
const F = ne(
|
|
217
217
|
() => d === "fetch_on_type" ? h : !1,
|
|
218
218
|
[d, h]
|
|
219
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
|
|
221
|
-
|
|
222
|
-
}, { displayMode: D = e.multiple ? "chips" : "compact", dropdownOptions: k, overflow: s = "scroll", onChange: N, onClear: W, ...
|
|
223
|
-
controledSearchValue:
|
|
224
|
-
onSearchValueChange: d === "fetch_on_type" ?
|
|
220
|
+
const v = T.find((m) => i(m, e.optionValue) === o.id);
|
|
221
|
+
v && f(v);
|
|
222
|
+
}, { displayMode: D = e.multiple ? "chips" : "compact", dropdownOptions: k, overflow: s = "scroll", onChange: N, onClear: W, ...C } = e.selectComponentProps || {}, J = {
|
|
223
|
+
controledSearchValue: _,
|
|
224
|
+
onSearchValueChange: d === "fetch_on_type" ? M : void 0,
|
|
225
225
|
onSearchClear: d === "fetch_on_type" ? () => {
|
|
226
|
-
|
|
226
|
+
P(), p();
|
|
227
227
|
} : void 0,
|
|
228
228
|
inputSearchPlaceholder: e.inputSearchPlaceholder,
|
|
229
|
-
isLoading:
|
|
229
|
+
isLoading: F(),
|
|
230
230
|
focusSearchInputOnOpen: !0,
|
|
231
231
|
...k || {}
|
|
232
232
|
}, U = () => {
|
|
@@ -240,7 +240,7 @@ const he = (e) => {
|
|
|
240
240
|
name: e.name,
|
|
241
241
|
overflow: s,
|
|
242
242
|
placeholder: e.placeholder,
|
|
243
|
-
...
|
|
243
|
+
...C,
|
|
244
244
|
onClear: e?.selectComponentProps?.onClear && U,
|
|
245
245
|
multiple: !0,
|
|
246
246
|
value: V,
|
|
@@ -252,7 +252,7 @@ const he = (e) => {
|
|
|
252
252
|
renderSelection: e.renderSelection,
|
|
253
253
|
onOptionClick: g,
|
|
254
254
|
displayMode: D,
|
|
255
|
-
controls:
|
|
255
|
+
controls: O,
|
|
256
256
|
emptyMessage: "Use el buscador para obtener las opciones disponibles",
|
|
257
257
|
dropdownOptions: J,
|
|
258
258
|
isLoading: d === "fetch_in_open" ? h : !1
|
|
@@ -261,7 +261,7 @@ const he = (e) => {
|
|
|
261
261
|
Z,
|
|
262
262
|
{
|
|
263
263
|
disabled: e.disabled,
|
|
264
|
-
...
|
|
264
|
+
...C,
|
|
265
265
|
placeholder: e.placeholder,
|
|
266
266
|
onClear: U,
|
|
267
267
|
className: e.className,
|
|
@@ -277,7 +277,7 @@ const he = (e) => {
|
|
|
277
277
|
renderSelection: e.renderSelection,
|
|
278
278
|
onOptionClick: g,
|
|
279
279
|
displayMode: "compact",
|
|
280
|
-
controls:
|
|
280
|
+
controls: O,
|
|
281
281
|
emptyMessage: "Use el buscador para obtener las opciones disponibles",
|
|
282
282
|
dropdownOptions: J,
|
|
283
283
|
isLoading: d === "fetch_in_open" ? h : !1
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { motion as
|
|
3
|
-
import { memo as
|
|
1
|
+
import { j as n } from "./jsx-runtime-GkKLlHH4.js";
|
|
2
|
+
import { motion as I } from "framer-motion";
|
|
3
|
+
import { memo as $, useId as w, useRef as z, useEffect as E, isValidElement as L } from "react";
|
|
4
4
|
import { c as d } from "./cn-B6yFEsav.js";
|
|
5
|
-
import
|
|
6
|
-
const
|
|
5
|
+
import M from "./PlainTooltip.es.js";
|
|
6
|
+
const R = /* @__PURE__ */ Symbol.for("react.memo"), S = (e, a, o) => {
|
|
7
7
|
if (!e)
|
|
8
8
|
return null;
|
|
9
9
|
if (typeof e == "function") {
|
|
10
10
|
const i = e;
|
|
11
|
-
return /* @__PURE__ */
|
|
11
|
+
return /* @__PURE__ */ n.jsx(i, { size: o, className: a });
|
|
12
12
|
}
|
|
13
13
|
if (typeof e == "object") {
|
|
14
|
-
if (
|
|
14
|
+
if (L(e))
|
|
15
15
|
return e;
|
|
16
|
-
if ("$$typeof" in e && e.$$typeof ===
|
|
16
|
+
if ("$$typeof" in e && e.$$typeof === R) {
|
|
17
17
|
const i = e;
|
|
18
|
-
return /* @__PURE__ */
|
|
18
|
+
return /* @__PURE__ */ n.jsx(i, { size: o, className: a });
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
return e;
|
|
22
22
|
};
|
|
23
|
-
function
|
|
23
|
+
function v({
|
|
24
24
|
items: e,
|
|
25
25
|
activeTab: a,
|
|
26
|
-
onTabChange:
|
|
26
|
+
onTabChange: o,
|
|
27
27
|
className: i,
|
|
28
|
-
tabClassName:
|
|
28
|
+
tabClassName: l,
|
|
29
29
|
activeTabClassName: s,
|
|
30
|
-
indicatorClassName:
|
|
30
|
+
indicatorClassName: b,
|
|
31
31
|
animated: r = !0,
|
|
32
32
|
renderTab: u
|
|
33
33
|
}) {
|
|
34
|
-
const
|
|
35
|
-
t.disabled ||
|
|
36
|
-
};
|
|
37
|
-
return /* @__PURE__ */
|
|
34
|
+
const p = (t) => {
|
|
35
|
+
t.disabled || o?.(t.id, t);
|
|
36
|
+
}, x = w();
|
|
37
|
+
return /* @__PURE__ */ n.jsx(
|
|
38
38
|
"div",
|
|
39
39
|
{
|
|
40
40
|
className: d(
|
|
41
|
-
"flex flex-row justify-around items-end relative border-b border-neutral-strong-default w-full md:justify-start md:px-10 md:gap-5",
|
|
41
|
+
"flex flex-row justify-around items-end relative border-b border-neutral-strong-default w-full md:justify-start md:px-10 md:gap-5 overflow-hidden",
|
|
42
42
|
i
|
|
43
43
|
),
|
|
44
44
|
role: "tablist",
|
|
45
45
|
children: e?.map((t) => {
|
|
46
|
-
const c = a === t.id,
|
|
47
|
-
return u ? /* @__PURE__ */
|
|
48
|
-
|
|
46
|
+
const c = a === t.id, f = () => p(t), { iconPosition: h = "top", iconSize: m = 24 } = t;
|
|
47
|
+
return u ? /* @__PURE__ */ n.jsx("div", { children: u(t, c, f, t.onIconClick, t.onIconHover, t.iconTooltipTitle, t.iconTooltipProps, t.iconSize) }, t.id) : /* @__PURE__ */ n.jsx(
|
|
48
|
+
H,
|
|
49
49
|
{
|
|
50
50
|
id: t.id,
|
|
51
51
|
title: t.title,
|
|
52
52
|
icon: t.icon,
|
|
53
|
-
iconPosition:
|
|
54
|
-
onClick:
|
|
53
|
+
iconPosition: h,
|
|
54
|
+
onClick: f,
|
|
55
55
|
disabled: t.disabled,
|
|
56
|
-
className:
|
|
56
|
+
className: l,
|
|
57
57
|
isActive: c,
|
|
58
58
|
activeClassName: s,
|
|
59
59
|
animated: r,
|
|
@@ -61,37 +61,43 @@ function j({
|
|
|
61
61
|
onIconClick: t.onIconClick,
|
|
62
62
|
iconTooltipTitle: t.iconTooltipTitle,
|
|
63
63
|
iconTooltipProps: t.iconTooltipProps,
|
|
64
|
-
iconSize:
|
|
65
|
-
indicatorClassName:
|
|
66
|
-
|
|
64
|
+
iconSize: m,
|
|
65
|
+
indicatorClassName: b,
|
|
66
|
+
layoutId: x
|
|
67
|
+
},
|
|
68
|
+
t.id
|
|
67
69
|
);
|
|
68
70
|
})
|
|
69
71
|
}
|
|
70
72
|
);
|
|
71
73
|
}
|
|
72
|
-
|
|
73
|
-
const
|
|
74
|
+
v.displayName = "TabLinks";
|
|
75
|
+
const D = $(v, (e, a) => {
|
|
74
76
|
if (e.activeTab !== a.activeTab || e.className !== a.className || e.tabClassName !== a.tabClassName || e.activeTabClassName !== a.activeTabClassName || e.indicatorClassName !== a.indicatorClassName || e.animated !== a.animated || e.onTabChange !== a.onTabChange || e.renderTab !== a.renderTab || e.items.length !== a.items.length)
|
|
75
77
|
return !1;
|
|
76
|
-
for (let
|
|
77
|
-
const i = e.items[
|
|
78
|
-
if (i.id !==
|
|
78
|
+
for (let o = 0; o < e.items.length; o++) {
|
|
79
|
+
const i = e.items[o], l = a.items[o];
|
|
80
|
+
if (i.id !== l.id || i.title !== l.title || i.disabled !== l.disabled || i.description !== l.description)
|
|
79
81
|
return !1;
|
|
80
82
|
}
|
|
81
83
|
return !0;
|
|
82
|
-
}),
|
|
83
|
-
const
|
|
84
|
-
|
|
84
|
+
}), H = ({ id: e, title: a, icon: o, iconPosition: i = "top", onClick: l, disabled: s = !1, className: b, isActive: r, activeClassName: u, onIconHover: p, onIconClick: x, iconTooltipTitle: t, iconTooltipProps: c, iconSize: f = 20, indicatorClassName: h, layoutId: m }) => {
|
|
85
|
+
const y = z(!0);
|
|
86
|
+
E(() => {
|
|
87
|
+
y.current && (y.current = !1);
|
|
88
|
+
}, []);
|
|
89
|
+
const C = (T, g, j, N, k) => j ? /* @__PURE__ */ n.jsx(M, { title: j, ...N, children: /* @__PURE__ */ n.jsx("div", { onMouseEnter: g, onClick: k, children: T }) }) : /* @__PURE__ */ n.jsx("div", { onMouseEnter: g, onClick: k, children: T });
|
|
90
|
+
return /* @__PURE__ */ n.jsxs(
|
|
85
91
|
"button",
|
|
86
92
|
{
|
|
87
|
-
onClick:
|
|
93
|
+
onClick: l,
|
|
88
94
|
disabled: s,
|
|
89
95
|
className: d(
|
|
90
96
|
"group/tablink-item",
|
|
91
97
|
"relative flex flex-col pb-[14px] justify-center items-center h-max px-4 font-medium focus:outline-none transition-colors pt-[14px]",
|
|
92
98
|
s && "hover:text-primary-default-default cursor-pointer",
|
|
93
99
|
s && "opacity-50 cursor-default",
|
|
94
|
-
|
|
100
|
+
b,
|
|
95
101
|
r && u
|
|
96
102
|
),
|
|
97
103
|
tabIndex: s ? -1 : 0,
|
|
@@ -99,12 +105,12 @@ const W = I(j, (e, a) => {
|
|
|
99
105
|
role: "tab",
|
|
100
106
|
"aria-selected": r,
|
|
101
107
|
children: [
|
|
102
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ n.jsxs("div", { className: d(
|
|
103
109
|
"flex items-center gap-0.5",
|
|
104
110
|
i === "left" && "flex-row-reverse",
|
|
105
111
|
i === "top" ? "flex-col-reverse" : "gap-1"
|
|
106
112
|
), children: [
|
|
107
|
-
/* @__PURE__ */
|
|
113
|
+
/* @__PURE__ */ n.jsx(
|
|
108
114
|
"label",
|
|
109
115
|
{
|
|
110
116
|
className: d(
|
|
@@ -115,33 +121,34 @@ const W = I(j, (e, a) => {
|
|
|
115
121
|
children: a
|
|
116
122
|
}
|
|
117
123
|
),
|
|
118
|
-
C(
|
|
124
|
+
C(S(o, d(
|
|
119
125
|
"transition-all duration-300 ease-in-out group-hover/tablink-item:text-neutral-medium-hover ",
|
|
120
126
|
r ? "text-primary-default-default prometeo-fonts-title-medium group-hover/tablink-item:text-primary-default-default" : "text-neutral-medium-default prometeo-fonts-body-large"
|
|
121
|
-
),
|
|
127
|
+
), f), p, t, c, x)
|
|
122
128
|
] }),
|
|
123
|
-
r
|
|
124
|
-
|
|
129
|
+
r ? /* @__PURE__ */ n.jsx(
|
|
130
|
+
I.div,
|
|
125
131
|
{
|
|
126
|
-
layoutId: "tab-indicator",
|
|
132
|
+
layoutId: m ? `tab-indicator-${m}` : "tab-indicator",
|
|
133
|
+
id: `tab-indicator-${e}`,
|
|
134
|
+
initial: y.current ? !1 : void 0,
|
|
127
135
|
className: d(
|
|
128
|
-
"absolute
|
|
129
|
-
|
|
136
|
+
"absolute bottom-0 left-1/2 -translate-x-1/2 h-[4px] rounded-t-xl bg-primary-default-default z-10 w-[calc(100%-32px)]",
|
|
137
|
+
h
|
|
130
138
|
),
|
|
131
139
|
transition: {
|
|
132
140
|
type: "spring",
|
|
133
141
|
stiffness: 250,
|
|
134
142
|
damping: 17
|
|
135
|
-
}
|
|
136
|
-
"aria-hidden": "true"
|
|
143
|
+
}
|
|
137
144
|
}
|
|
138
|
-
)
|
|
145
|
+
) : null
|
|
139
146
|
]
|
|
140
147
|
},
|
|
141
|
-
e
|
|
148
|
+
`tablink-${e}`
|
|
142
149
|
);
|
|
143
150
|
};
|
|
144
151
|
export {
|
|
145
|
-
|
|
146
|
-
|
|
152
|
+
D as T,
|
|
153
|
+
H as a
|
|
147
154
|
};
|
package/dist/TabLinks.es.js
CHANGED