prometeo-design-system 4.3.1 → 4.3.3
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/Avatar.es.js +40 -41
- package/dist/CardProfile.es.js +291 -3
- package/dist/CheckBox.es.js +24 -21
- package/dist/DialogModal.es.js +52 -46
- package/dist/Icons/ArrowDownward.d.ts +2 -0
- package/dist/Icons/ArrowDownward.es.js +9 -0
- package/dist/Icons/ArrowUpward.d.ts +2 -0
- package/dist/Icons/ArrowUpward.es.js +9 -0
- package/dist/Icons/UserAvatar.es.js +4 -4
- package/dist/Icons/components/ArrowDownward.d.ts +3 -0
- package/dist/Icons/components/ArrowUpward.d.ts +3 -0
- package/dist/Icons/index.d.ts +2 -0
- package/dist/Icons/types.d.ts +4 -0
- package/dist/Icons.es.js +124 -120
- package/dist/Input.es.js +73 -72
- package/dist/NotificationCard.es.js +28 -21
- package/dist/PlainTooltip.es.js +19 -19
- package/dist/PyrionLayout.es.js +916 -810
- package/dist/Scrollable.es.js +322 -177
- package/dist/Select.es.js +47 -47
- package/dist/SelectSearch.es.js +107 -103
- package/dist/TabLinks-DxqprStp.js +147 -0
- package/dist/TabLinks.es.js +2 -121
- package/dist/TicketCard.es.js +2 -2
- package/dist/Toast.es.js +95 -51
- package/dist/UserCard.d.ts +6 -0
- package/dist/UserCard.es.js +28 -0
- package/dist/badge-BEx-0Q-K.js +35 -0
- package/dist/components/Avatar/Avatar.d.ts +2 -4
- package/dist/components/CardProfile/CardProfile.d.ts +7 -4
- package/dist/components/DropZone/useFileDropzone.d.ts +9 -1
- package/dist/components/NotificationCard/NotificationCard.d.ts +3 -2
- package/dist/components/PyrionNavigationDrawer/PLNotificationsList.d.ts +5 -2
- package/dist/components/PyrionNavigationDrawer/PLSidebar.d.ts +3 -1
- package/dist/components/PyrionNavigationDrawer/PLSidebarContent.d.ts +2 -0
- package/dist/components/PyrionNavigationDrawer/PLayoutBase.d.ts +2 -0
- package/dist/components/PyrionNavigationDrawer/PyrionLayout.d.ts +4 -1
- package/dist/components/Scrollable/Scrollable.d.ts +29 -0
- package/dist/components/TabLinks/TabLinks.d.ts +19 -0
- package/dist/components/Toaster/Toaster.d.ts +13 -1
- package/dist/components/UserCard/UserCard.d.ts +3 -2
- package/dist/exports/UserCard.d.ts +2 -0
- package/dist/hooks/useLabelBackground.d.ts +1 -0
- package/dist/index.d.ts +0 -16
- package/dist/prometeo-design-system.es.js +119 -2906
- package/dist/styles.css +1 -1
- package/dist/useLabelBackground-D5SzHhl_.js +32 -0
- package/package.json +1 -2
- package/dist/CardProfile-C1F83KJV.js +0 -280
- package/dist/badge-CbqYNrl4.js +0 -87
- package/dist/components/Layout/LayoutGeneric.d.ts +0 -6
- package/dist/components/Sidebar/SecondaryBar/SecondaryBar.d.ts +0 -32
- package/dist/components/Sidebar/SecondaryBar/hooks/useSecondaryBarAnimation.d.ts +0 -2
- package/dist/components/Sidebar/SecondaryBar/index.d.ts +0 -1
- package/dist/components/Sidebar/SidebarComposable.d.ts +0 -43
- package/dist/components/Sidebar/components/NavigationLink.d.ts +0 -11
- package/dist/components/Sidebar/components/company-logo.d.ts +0 -5
- package/dist/components/Sidebar/components/nav-actions.d.ts +0 -7
- package/dist/components/Sidebar/components/nav-links.d.ts +0 -7
- package/dist/components/Sidebar/context/SidebarContext.d.ts +0 -13
- package/dist/components/Sidebar/hooks/SidebarProvider.d.ts +0 -3
- package/dist/components/Sidebar/hooks/useNavBarActions.d.ts +0 -9
- package/dist/components/Sidebar/hooks/useNavBarCollapse.d.ts +0 -4
- package/dist/components/Sidebar/hooks/useNavLinks.d.ts +0 -32
- package/dist/components/Sidebar/hooks/useSidebarHook.d.ts +0 -13
- package/dist/components/Sidebar/index.d.ts +0 -12
- package/dist/components/Sidebar/ui/useNavbarAnimation.d.ts +0 -2
- package/dist/useLabelBackground-BDIHUdND.js +0 -26
package/dist/SelectSearch.es.js
CHANGED
|
@@ -1,117 +1,117 @@
|
|
|
1
1
|
import { j as Y } from "./jsx-runtime-GkKLlHH4.js";
|
|
2
2
|
import { g as i } from "./utils-X4-h3cum.js";
|
|
3
|
-
import { useState as A, useRef as E, useEffect as b, useMemo as ee, useCallback as
|
|
3
|
+
import { useState as A, useRef as E, useEffect as b, useMemo as ee, useCallback as ne } from "react";
|
|
4
4
|
import Z from "./Select.es.js";
|
|
5
5
|
function re(e) {
|
|
6
6
|
const {
|
|
7
|
-
options:
|
|
7
|
+
options: C,
|
|
8
8
|
fetcher: d,
|
|
9
9
|
asyncMode: _ = "fetch_in_open",
|
|
10
10
|
disabled: w = !1,
|
|
11
11
|
debounceDelay: P = 500,
|
|
12
12
|
minCharacters: T = 3,
|
|
13
13
|
optionLabel: h,
|
|
14
|
-
optionValue:
|
|
14
|
+
optionValue: c,
|
|
15
15
|
controlledValue: f,
|
|
16
16
|
isOpen: F,
|
|
17
|
-
inputRef:
|
|
17
|
+
inputRef: p,
|
|
18
18
|
name: I
|
|
19
|
-
} = e || {}, M =
|
|
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(() => {
|
|
23
|
-
if (
|
|
24
|
-
const
|
|
25
|
-
|
|
23
|
+
if (L) {
|
|
24
|
+
const n = z(f, "value");
|
|
25
|
+
y(n);
|
|
26
26
|
} else
|
|
27
|
-
f != null ?
|
|
27
|
+
f != null ? y(f) : y(void 0);
|
|
28
28
|
}, [f]), b(() => {
|
|
29
29
|
j.current = f !== void 0 ? f : a;
|
|
30
30
|
}, [f, a]), b(() => {
|
|
31
31
|
if (e?.options) {
|
|
32
|
-
const
|
|
33
|
-
g(
|
|
32
|
+
const n = e.options.filter((t) => t != null);
|
|
33
|
+
g(n), k(n);
|
|
34
34
|
}
|
|
35
35
|
}, [e?.options]);
|
|
36
|
-
const B = ee(() => (
|
|
37
|
-
|
|
38
|
-
}), [
|
|
39
|
-
const
|
|
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
|
+
}), [s]), te = (n) => {
|
|
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
|
-
|
|
46
|
-
}, q = (
|
|
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((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
|
-
const
|
|
49
|
-
if (!
|
|
50
|
-
const
|
|
51
|
-
U(
|
|
48
|
+
const n = e?.subscribeOpenChange;
|
|
49
|
+
if (!n) return;
|
|
50
|
+
const t = n((l) => {
|
|
51
|
+
U(l);
|
|
52
52
|
});
|
|
53
53
|
return () => {
|
|
54
|
-
|
|
54
|
+
t && t();
|
|
55
55
|
};
|
|
56
56
|
}, [e?.subscribeOpenChange]);
|
|
57
57
|
const G = F !== void 0 ? F : J;
|
|
58
58
|
b(() => {
|
|
59
|
-
if (!w &&
|
|
60
|
-
if (!
|
|
61
|
-
|
|
59
|
+
if (!w && S.current && _ === "fetch_on_type") {
|
|
60
|
+
if (!s || s === "" || s.length < T) {
|
|
61
|
+
o.current && clearTimeout(o.current), v(!1);
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
g(
|
|
64
|
+
const n = B(q, P);
|
|
65
|
+
v(!0), n.then((t) => {
|
|
66
|
+
const l = z(t);
|
|
67
|
+
g(l);
|
|
68
68
|
}).finally(() => {
|
|
69
|
-
|
|
69
|
+
v(!1), e?.onFetchingEnd?.();
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
}, [_,
|
|
72
|
+
}, [_, s, w, P, B, T]), b(() => {
|
|
73
73
|
if (!w)
|
|
74
74
|
if (G) {
|
|
75
75
|
if (e?.onOpen?.(), _ === "fetch_in_open") {
|
|
76
|
-
if (!
|
|
76
|
+
if (!S.current)
|
|
77
77
|
return;
|
|
78
|
-
|
|
79
|
-
const
|
|
78
|
+
v(!0), q().then((n) => {
|
|
79
|
+
const t = z(n);
|
|
80
80
|
g(() => {
|
|
81
|
-
const
|
|
82
|
-
if (
|
|
83
|
-
return i(r,
|
|
81
|
+
const l = t.filter((r) => {
|
|
82
|
+
if (c)
|
|
83
|
+
return i(r, c) !== void 0;
|
|
84
84
|
});
|
|
85
|
-
return
|
|
85
|
+
return L && a.length > 0 ? [...$(a, l), ...a] : l;
|
|
86
86
|
});
|
|
87
87
|
}).finally(() => {
|
|
88
|
-
|
|
88
|
+
v(!1), e?.onFetchingEnd?.();
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
} else
|
|
92
92
|
e?.onClose?.();
|
|
93
93
|
}, [G, _, w]);
|
|
94
|
-
const H = (
|
|
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
|
-
return r?.toLowerCase().includes(
|
|
101
|
+
return r?.toLowerCase().includes(t.toLowerCase());
|
|
102
102
|
case "number":
|
|
103
|
-
return r.toString().includes(
|
|
103
|
+
return r.toString().includes(t);
|
|
104
104
|
case "object":
|
|
105
|
-
return Object.values(r).some((R) => R.toString()?.toLowerCase().includes(
|
|
105
|
+
return Object.values(r).some((R) => R.toString()?.toLowerCase().includes(t.toLowerCase()));
|
|
106
106
|
default:
|
|
107
107
|
return !1;
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
}) || [],
|
|
110
|
+
}) || [], le = (n) => n?.sort((t, l) => {
|
|
111
111
|
if (h)
|
|
112
|
-
return i(
|
|
112
|
+
return i(t, h) < i(l, h) ? -1 : 1;
|
|
113
113
|
{
|
|
114
|
-
const u = ["label", "name", "value"].find((K) => typeof
|
|
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,29 +119,29 @@ function re(e) {
|
|
|
119
119
|
return R < x ? -1 : 1;
|
|
120
120
|
case "object":
|
|
121
121
|
if (u) {
|
|
122
|
-
const K = i(
|
|
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:
|
|
127
127
|
return 1;
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
}) || [], Q = (
|
|
131
|
-
const
|
|
132
|
-
|
|
130
|
+
}) || [], Q = (n) => {
|
|
131
|
+
const t = typeof p == "function" ? p() : p;
|
|
132
|
+
n.target === t?.current && (O.current && clearTimeout(O.current), m.current || (m.current = !0, e?.onTypeStart?.()), O.current = setTimeout(() => {
|
|
133
133
|
m.current = !1;
|
|
134
134
|
}, P));
|
|
135
135
|
};
|
|
136
136
|
b(() => {
|
|
137
|
-
if (
|
|
138
|
-
k(
|
|
139
|
-
else if (
|
|
140
|
-
const
|
|
141
|
-
k([...H(
|
|
137
|
+
if (s === "")
|
|
138
|
+
k(le(V));
|
|
139
|
+
else if (L) {
|
|
140
|
+
const n = $(a, V);
|
|
141
|
+
k([...H(n, s), ...a]);
|
|
142
142
|
} else {
|
|
143
|
-
const
|
|
144
|
-
k([...H(
|
|
143
|
+
const n = $([a], V);
|
|
144
|
+
k([...H(n, s), a]);
|
|
145
145
|
}
|
|
146
146
|
}, [V]), b(() => (document.addEventListener("keydown", Q), () => {
|
|
147
147
|
document.removeEventListener("keydown", Q);
|
|
@@ -150,80 +150,80 @@ function re(e) {
|
|
|
150
150
|
N("");
|
|
151
151
|
};
|
|
152
152
|
return {
|
|
153
|
-
inputValue:
|
|
153
|
+
inputValue: s,
|
|
154
154
|
setInputValue: N,
|
|
155
155
|
cleanInputValue: X,
|
|
156
156
|
cleanOptions: () => {
|
|
157
|
-
if (
|
|
157
|
+
if (L)
|
|
158
158
|
g(a);
|
|
159
159
|
else {
|
|
160
|
-
const
|
|
161
|
-
g(
|
|
160
|
+
const n = a;
|
|
161
|
+
g(n ? [n] : []);
|
|
162
162
|
}
|
|
163
163
|
X();
|
|
164
164
|
},
|
|
165
165
|
clearValue: () => {
|
|
166
|
-
|
|
166
|
+
y(L ? [] : void 0);
|
|
167
167
|
},
|
|
168
168
|
filteredOptions: D,
|
|
169
169
|
isLoading: W,
|
|
170
170
|
value: a,
|
|
171
|
-
setValue:
|
|
172
|
-
onOptionClick:
|
|
171
|
+
setValue: y,
|
|
172
|
+
onOptionClick: te
|
|
173
173
|
};
|
|
174
174
|
}
|
|
175
175
|
const he = (e) => {
|
|
176
|
-
const
|
|
177
|
-
const
|
|
178
|
-
options:
|
|
179
|
-
fetcher:
|
|
176
|
+
const C = E(null), { asyncMode: d = "fetch_in_open" } = e, _ = (o, O, m) => {
|
|
177
|
+
const S = {
|
|
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
|
|
197
|
-
...
|
|
196
|
+
return o.multiple ? {
|
|
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
|
-
}, { inputValue: w, setInputValue: P, filteredOptions: T, isLoading: h, value:
|
|
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(() => {
|
|
209
|
-
!e.controls || !
|
|
210
|
-
...
|
|
209
|
+
!e.controls || !C.current || (e.controls.current = {
|
|
210
|
+
...C.current,
|
|
211
211
|
cleanOptions: () => {
|
|
212
|
-
|
|
212
|
+
p();
|
|
213
213
|
}
|
|
214
214
|
});
|
|
215
|
-
}, [e.controls,
|
|
216
|
-
const M =
|
|
215
|
+
}, [e.controls, p]);
|
|
216
|
+
const M = ne(
|
|
217
217
|
() => d === "fetch_on_type" ? h : !1,
|
|
218
218
|
[d, h]
|
|
219
|
-
), V = ee(() => e.multiple ?
|
|
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
|
-
}, { displayMode: D = e.multiple ? "chips" : "compact", dropdownOptions: k, overflow:
|
|
222
|
+
}, { displayMode: D = e.multiple ? "chips" : "compact", dropdownOptions: k, overflow: s = "scroll", onChange: N, onClear: W, ...v } = e.selectComponentProps || {}, J = {
|
|
223
223
|
controledSearchValue: w,
|
|
224
224
|
onSearchValueChange: d === "fetch_on_type" ? P : void 0,
|
|
225
225
|
onSearchClear: d === "fetch_on_type" ? () => {
|
|
226
|
-
F(),
|
|
226
|
+
F(), p();
|
|
227
227
|
} : void 0,
|
|
228
228
|
inputSearchPlaceholder: e.inputSearchPlaceholder,
|
|
229
229
|
isLoading: M(),
|
|
@@ -238,8 +238,9 @@ const he = (e) => {
|
|
|
238
238
|
disabled: e.disabled,
|
|
239
239
|
className: e.className,
|
|
240
240
|
name: e.name,
|
|
241
|
-
overflow:
|
|
242
|
-
|
|
241
|
+
overflow: s,
|
|
242
|
+
placeholder: e.placeholder,
|
|
243
|
+
...v,
|
|
243
244
|
onClear: e?.selectComponentProps?.onClear && U,
|
|
244
245
|
multiple: !0,
|
|
245
246
|
value: V,
|
|
@@ -248,9 +249,10 @@ const he = (e) => {
|
|
|
248
249
|
optionValue: e.optionValue,
|
|
249
250
|
optionLabel: e.optionLabel,
|
|
250
251
|
renderOption: e.renderOption,
|
|
252
|
+
renderSelection: e.renderSelection,
|
|
251
253
|
onOptionClick: g,
|
|
252
254
|
displayMode: D,
|
|
253
|
-
controls:
|
|
255
|
+
controls: C,
|
|
254
256
|
emptyMessage: "Use el buscador para obtener las opciones disponibles",
|
|
255
257
|
dropdownOptions: J,
|
|
256
258
|
isLoading: d === "fetch_in_open" ? h : !1
|
|
@@ -259,10 +261,11 @@ const he = (e) => {
|
|
|
259
261
|
Z,
|
|
260
262
|
{
|
|
261
263
|
disabled: e.disabled,
|
|
262
|
-
...
|
|
264
|
+
...v,
|
|
265
|
+
placeholder: e.placeholder,
|
|
263
266
|
onClear: U,
|
|
264
267
|
className: e.className,
|
|
265
|
-
overflow:
|
|
268
|
+
overflow: s,
|
|
266
269
|
name: e.name,
|
|
267
270
|
multiple: !1,
|
|
268
271
|
value: V,
|
|
@@ -271,9 +274,10 @@ const he = (e) => {
|
|
|
271
274
|
optionValue: e.optionValue,
|
|
272
275
|
optionLabel: e.optionLabel,
|
|
273
276
|
renderOption: e.renderOption,
|
|
277
|
+
renderSelection: e.renderSelection,
|
|
274
278
|
onOptionClick: g,
|
|
275
279
|
displayMode: "compact",
|
|
276
|
-
controls:
|
|
280
|
+
controls: C,
|
|
277
281
|
emptyMessage: "Use el buscador para obtener las opciones disponibles",
|
|
278
282
|
dropdownOptions: J,
|
|
279
283
|
isLoading: d === "fetch_in_open" ? h : !1
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { j as o } from "./jsx-runtime-GkKLlHH4.js";
|
|
2
|
+
import { motion as v } from "framer-motion";
|
|
3
|
+
import { memo as I, isValidElement as z } from "react";
|
|
4
|
+
import { c as d } from "./cn-B6yFEsav.js";
|
|
5
|
+
import $ from "./PlainTooltip.es.js";
|
|
6
|
+
const w = /* @__PURE__ */ Symbol.for("react.memo"), E = (e, a, l) => {
|
|
7
|
+
if (!e)
|
|
8
|
+
return null;
|
|
9
|
+
if (typeof e == "function") {
|
|
10
|
+
const i = e;
|
|
11
|
+
return /* @__PURE__ */ o.jsx(i, { size: l, className: a });
|
|
12
|
+
}
|
|
13
|
+
if (typeof e == "object") {
|
|
14
|
+
if (z(e))
|
|
15
|
+
return e;
|
|
16
|
+
if ("$$typeof" in e && e.$$typeof === w) {
|
|
17
|
+
const i = e;
|
|
18
|
+
return /* @__PURE__ */ o.jsx(i, { size: l, className: a });
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return e;
|
|
22
|
+
};
|
|
23
|
+
function j({
|
|
24
|
+
items: e,
|
|
25
|
+
activeTab: a,
|
|
26
|
+
onTabChange: l,
|
|
27
|
+
className: i,
|
|
28
|
+
tabClassName: n,
|
|
29
|
+
activeTabClassName: s,
|
|
30
|
+
indicatorClassName: f,
|
|
31
|
+
animated: r = !0,
|
|
32
|
+
renderTab: u
|
|
33
|
+
}) {
|
|
34
|
+
const b = (t) => {
|
|
35
|
+
t.disabled || l?.(t.id, t);
|
|
36
|
+
};
|
|
37
|
+
return /* @__PURE__ */ o.jsx(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
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",
|
|
42
|
+
i
|
|
43
|
+
),
|
|
44
|
+
role: "tablist",
|
|
45
|
+
children: e?.map((t) => {
|
|
46
|
+
const c = a === t.id, m = () => b(t), { iconPosition: p = "top", iconSize: x = 24 } = t;
|
|
47
|
+
return u ? /* @__PURE__ */ o.jsx("div", { children: u(t, c, m, t.onIconClick, t.onIconHover, t.iconTooltipTitle, t.iconTooltipProps, t.iconSize) }, t.id) : /* @__PURE__ */ o.jsx(
|
|
48
|
+
L,
|
|
49
|
+
{
|
|
50
|
+
id: t.id,
|
|
51
|
+
title: t.title,
|
|
52
|
+
icon: t.icon,
|
|
53
|
+
iconPosition: p,
|
|
54
|
+
onClick: m,
|
|
55
|
+
disabled: t.disabled,
|
|
56
|
+
className: n,
|
|
57
|
+
isActive: c,
|
|
58
|
+
activeClassName: s,
|
|
59
|
+
animated: r,
|
|
60
|
+
onIconHover: t.onIconHover,
|
|
61
|
+
onIconClick: t.onIconClick,
|
|
62
|
+
iconTooltipTitle: t.iconTooltipTitle,
|
|
63
|
+
iconTooltipProps: t.iconTooltipProps,
|
|
64
|
+
iconSize: x,
|
|
65
|
+
indicatorClassName: f
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
})
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
j.displayName = "TabLinks";
|
|
73
|
+
const W = I(j, (e, a) => {
|
|
74
|
+
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
|
+
return !1;
|
|
76
|
+
for (let l = 0; l < e.items.length; l++) {
|
|
77
|
+
const i = e.items[l], n = a.items[l];
|
|
78
|
+
if (i.id !== n.id || i.title !== n.title || i.disabled !== n.disabled || i.description !== n.description)
|
|
79
|
+
return !1;
|
|
80
|
+
}
|
|
81
|
+
return !0;
|
|
82
|
+
}), L = ({ id: e, title: a, icon: l, iconPosition: i = "top", onClick: n, disabled: s = !1, className: f, isActive: r = !1, activeClassName: u, animated: b = !0, onIconHover: t, onIconClick: c, iconTooltipTitle: m, iconTooltipProps: p, iconSize: x = 20, indicatorClassName: k }) => {
|
|
83
|
+
const C = (h, y, T, N, g) => T ? /* @__PURE__ */ o.jsx($, { title: T, ...N, children: /* @__PURE__ */ o.jsx("div", { onMouseEnter: y, onClick: g, children: h }) }) : /* @__PURE__ */ o.jsx("div", { onMouseEnter: y, onClick: g, children: h });
|
|
84
|
+
return /* @__PURE__ */ o.jsxs(
|
|
85
|
+
"button",
|
|
86
|
+
{
|
|
87
|
+
onClick: n,
|
|
88
|
+
disabled: s,
|
|
89
|
+
className: d(
|
|
90
|
+
"group/tablink-item",
|
|
91
|
+
"relative flex flex-col pb-[14px] justify-center items-center h-max px-4 font-medium focus:outline-none transition-colors pt-[14px]",
|
|
92
|
+
s && "hover:text-primary-default-default cursor-pointer",
|
|
93
|
+
s && "opacity-50 cursor-default",
|
|
94
|
+
f,
|
|
95
|
+
r && u
|
|
96
|
+
),
|
|
97
|
+
tabIndex: s ? -1 : 0,
|
|
98
|
+
"aria-label": a,
|
|
99
|
+
role: "tab",
|
|
100
|
+
"aria-selected": r,
|
|
101
|
+
children: [
|
|
102
|
+
/* @__PURE__ */ o.jsxs("div", { className: d(
|
|
103
|
+
"flex items-center gap-0.5",
|
|
104
|
+
i === "left" && "flex-row-reverse",
|
|
105
|
+
i === "top" ? "flex-col-reverse" : "gap-1"
|
|
106
|
+
), children: [
|
|
107
|
+
/* @__PURE__ */ o.jsx(
|
|
108
|
+
"label",
|
|
109
|
+
{
|
|
110
|
+
className: d(
|
|
111
|
+
"transition-all duration-300 ease-in-out relative z-10 group-hover/tablink-item:text-neutral-medium-hover ",
|
|
112
|
+
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 cursor-pointer",
|
|
113
|
+
"leading-6! line-clamp-1"
|
|
114
|
+
),
|
|
115
|
+
children: a
|
|
116
|
+
}
|
|
117
|
+
),
|
|
118
|
+
C(E(l, d(
|
|
119
|
+
"transition-all duration-300 ease-in-out group-hover/tablink-item:text-neutral-medium-hover ",
|
|
120
|
+
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
|
+
), x), t, m, p, c)
|
|
122
|
+
] }),
|
|
123
|
+
r && b && /* @__PURE__ */ o.jsx(
|
|
124
|
+
v.div,
|
|
125
|
+
{
|
|
126
|
+
layoutId: "tab-indicator",
|
|
127
|
+
className: d(
|
|
128
|
+
"absolute -bottom-px left-1/2 -translate-x-1/2 h-[4px] rounded-t-xl bg-primary-default-default z-0 w-[calc(100%-32px)]",
|
|
129
|
+
k
|
|
130
|
+
),
|
|
131
|
+
transition: {
|
|
132
|
+
type: "spring",
|
|
133
|
+
stiffness: 250,
|
|
134
|
+
damping: 17
|
|
135
|
+
},
|
|
136
|
+
"aria-hidden": "true"
|
|
137
|
+
}
|
|
138
|
+
)
|
|
139
|
+
]
|
|
140
|
+
},
|
|
141
|
+
e
|
|
142
|
+
);
|
|
143
|
+
};
|
|
144
|
+
export {
|
|
145
|
+
W as T,
|
|
146
|
+
L as a
|
|
147
|
+
};
|
package/dist/TabLinks.es.js
CHANGED
|
@@ -1,123 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { motion as C } from "framer-motion";
|
|
3
|
-
import { memo as N, isValidElement as I } from "react";
|
|
4
|
-
import { c as s } from "./cn-B6yFEsav.js";
|
|
5
|
-
import z from "./PlainTooltip.es.js";
|
|
6
|
-
const E = /* @__PURE__ */ Symbol.for("react.memo"), $ = (t, a, r) => {
|
|
7
|
-
if (!t)
|
|
8
|
-
return null;
|
|
9
|
-
if (typeof t == "function") {
|
|
10
|
-
const l = t;
|
|
11
|
-
return /* @__PURE__ */ i.jsx(l, { size: r, className: a });
|
|
12
|
-
}
|
|
13
|
-
if (typeof t == "object") {
|
|
14
|
-
if (I(t))
|
|
15
|
-
return t;
|
|
16
|
-
if ("$$typeof" in t && t.$$typeof === E) {
|
|
17
|
-
const l = t;
|
|
18
|
-
return /* @__PURE__ */ i.jsx(l, { size: r, className: a });
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
function p({
|
|
24
|
-
items: t,
|
|
25
|
-
activeTab: a,
|
|
26
|
-
onTabChange: r,
|
|
27
|
-
className: l,
|
|
28
|
-
tabClassName: o,
|
|
29
|
-
activeTabClassName: h,
|
|
30
|
-
indicatorClassName: g,
|
|
31
|
-
animated: y = !0,
|
|
32
|
-
renderTab: d
|
|
33
|
-
}) {
|
|
34
|
-
const j = (e) => {
|
|
35
|
-
e.disabled || r?.(e.id, e);
|
|
36
|
-
};
|
|
37
|
-
return /* @__PURE__ */ i.jsx(
|
|
38
|
-
"div",
|
|
39
|
-
{
|
|
40
|
-
className: s(
|
|
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",
|
|
42
|
-
l
|
|
43
|
-
),
|
|
44
|
-
role: "tablist",
|
|
45
|
-
children: t?.map((e) => {
|
|
46
|
-
const n = a === e.id, u = () => j(e), { iconPosition: f = "top", iconSize: T = 24 } = e, v = (c, m, b, k, x) => b ? /* @__PURE__ */ i.jsx(z, { title: b, ...k, children: /* @__PURE__ */ i.jsx("div", { onMouseEnter: m, onClick: x, children: c }) }) : /* @__PURE__ */ i.jsx("div", { onMouseEnter: m, onClick: x, children: c });
|
|
47
|
-
return d ? /* @__PURE__ */ i.jsx("div", { children: d(e, n, u, e.onIconClick, e.onIconHover, e.iconTooltipTitle, e.iconTooltipProps, e.iconSize) }, e.id) : /* @__PURE__ */ i.jsxs(
|
|
48
|
-
"button",
|
|
49
|
-
{
|
|
50
|
-
onClick: u,
|
|
51
|
-
disabled: e.disabled,
|
|
52
|
-
className: s(
|
|
53
|
-
"group/tablink-item",
|
|
54
|
-
"relative flex flex-col pb-3 justify-center items-center h-max px-4 font-medium focus:outline-none transition-colors",
|
|
55
|
-
!e.disabled && "hover:text-primary-default-default cursor-pointer",
|
|
56
|
-
e.disabled && "opacity-50 cursor-default",
|
|
57
|
-
o,
|
|
58
|
-
n && h
|
|
59
|
-
),
|
|
60
|
-
tabIndex: e.disabled ? -1 : 0,
|
|
61
|
-
"aria-label": e.title,
|
|
62
|
-
role: "tab",
|
|
63
|
-
"aria-selected": n,
|
|
64
|
-
children: [
|
|
65
|
-
/* @__PURE__ */ i.jsxs("div", { className: s(
|
|
66
|
-
"flex items-center gap-0.5",
|
|
67
|
-
f === "left" && "flex-row-reverse",
|
|
68
|
-
f === "top" ? "flex-col-reverse" : "gap-1"
|
|
69
|
-
), children: [
|
|
70
|
-
/* @__PURE__ */ i.jsx(
|
|
71
|
-
"label",
|
|
72
|
-
{
|
|
73
|
-
className: s(
|
|
74
|
-
"transition-all duration-300 ease-in-out relative z-10 group-hover/tablink-item:text-neutral-medium-hover ",
|
|
75
|
-
n ? "text-primary-default-default prometeo-fonts-title-medium group-hover/tablink-item:text-primary-default-default" : "text-neutral-medium-default prometeo-fonts-body-large cursor-pointer",
|
|
76
|
-
"leading-6! line-clamp-1"
|
|
77
|
-
),
|
|
78
|
-
children: e.title
|
|
79
|
-
}
|
|
80
|
-
),
|
|
81
|
-
v($(e.icon, s(
|
|
82
|
-
"transition-all duration-300 ease-in-out group-hover/tablink-item:text-neutral-medium-hover ",
|
|
83
|
-
n ? "text-primary-default-default prometeo-fonts-title-medium group-hover/tablink-item:text-primary-default-default" : "text-neutral-medium-default prometeo-fonts-body-large"
|
|
84
|
-
), T), e.onIconHover, e.iconTooltipTitle, e.iconTooltipProps, e.onIconClick)
|
|
85
|
-
] }),
|
|
86
|
-
n && y && /* @__PURE__ */ i.jsx(
|
|
87
|
-
C.div,
|
|
88
|
-
{
|
|
89
|
-
layoutId: "tab-indicator",
|
|
90
|
-
className: s(
|
|
91
|
-
"absolute -bottom-px left-0 right-0 h-[5px] rounded-t-xl bg-primary-default-default z-0",
|
|
92
|
-
g
|
|
93
|
-
),
|
|
94
|
-
transition: {
|
|
95
|
-
type: "spring",
|
|
96
|
-
stiffness: 250,
|
|
97
|
-
damping: 17
|
|
98
|
-
},
|
|
99
|
-
"aria-hidden": "true"
|
|
100
|
-
}
|
|
101
|
-
)
|
|
102
|
-
]
|
|
103
|
-
},
|
|
104
|
-
e.id
|
|
105
|
-
);
|
|
106
|
-
})
|
|
107
|
-
}
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
|
-
p.displayName = "TabLinks";
|
|
111
|
-
const H = N(p, (t, a) => {
|
|
112
|
-
if (t.activeTab !== a.activeTab || t.className !== a.className || t.tabClassName !== a.tabClassName || t.activeTabClassName !== a.activeTabClassName || t.indicatorClassName !== a.indicatorClassName || t.animated !== a.animated || t.onTabChange !== a.onTabChange || t.renderTab !== a.renderTab || t.items.length !== a.items.length)
|
|
113
|
-
return !1;
|
|
114
|
-
for (let r = 0; r < t.items.length; r++) {
|
|
115
|
-
const l = t.items[r], o = a.items[r];
|
|
116
|
-
if (l.id !== o.id || l.title !== o.title || l.disabled !== o.disabled || l.description !== o.description)
|
|
117
|
-
return !1;
|
|
118
|
-
}
|
|
119
|
-
return !0;
|
|
120
|
-
});
|
|
1
|
+
import { T as f } from "./TabLinks-DxqprStp.js";
|
|
121
2
|
export {
|
|
122
|
-
|
|
3
|
+
f as default
|
|
123
4
|
};
|
package/dist/TicketCard.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as l } from "./jsx-runtime-GkKLlHH4.js";
|
|
2
|
-
import { g as L } from "./useLabelBackground-
|
|
2
|
+
import { g as L } from "./useLabelBackground-D5SzHhl_.js";
|
|
3
3
|
import { c as d } from "./cn-B6yFEsav.js";
|
|
4
4
|
import { memo as O, useState as y, useCallback as x, useImperativeHandle as S, Children as A, isValidElement as B, cloneElement as k, useRef as w, useLayoutEffect as N, useEffect as z } from "react";
|
|
5
5
|
import { CrevronLeft as I } from "./Icons/CrevronLeft.es.js";
|
|
@@ -79,7 +79,7 @@ const C = (n, t) => typeof n == "function" ? t ? n(t) : null : n, q = (n) => {
|
|
|
79
79
|
type: "button",
|
|
80
80
|
onClick: t,
|
|
81
81
|
className: d(
|
|
82
|
-
"ticketcard-toggle-button",
|
|
82
|
+
"ticketcard-toggle-button text-neutral-default-default",
|
|
83
83
|
"grid place-items-center cursor-pointer transition-transform rounded-lg w-8 max-w-8 min-w-8",
|
|
84
84
|
"bg-neutral-default-default ",
|
|
85
85
|
"transition-all duration-300 ease-in-out",
|