prometeo-design-system 3.1.4 → 3.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{DatePicker-CehTiXGa.js → DatePicker-6eb-0Ns5.js} +1339 -1237
- package/dist/DatePicker.es.js +1 -1
- package/dist/Icons/Reassignment.d.ts +6 -0
- package/dist/Icons/Reassignment.es.js +22 -0
- package/dist/Icons/ReassignmentFill.d.ts +6 -0
- package/dist/Icons/ReassignmentFill.es.js +52 -0
- package/dist/Icons/Send.d.ts +6 -0
- package/dist/Icons/Send.es.js +24 -0
- package/dist/Icons/components/Reassignment.d.ts +4 -0
- package/dist/Icons/components/ReassignmentFill.d.ts +4 -0
- package/dist/Icons/components/Send.d.ts +4 -0
- package/dist/Icons/index.d.ts +3 -0
- package/dist/Icons/types.d.ts +6 -0
- package/dist/Icons.es.js +56 -50
- package/dist/NotificationCard.d.ts +6 -0
- package/dist/NotificationCard.es.js +50 -0
- package/dist/PyrionNavigationDrawer.d.ts +6 -0
- package/dist/PyrionNavigationDrawer.es.js +962 -0
- package/dist/RecurrentDatePicker.es.js +2 -2
- package/dist/RecurrentDatePickerRRule.es.js +1 -1
- package/dist/Select.es.js +1059 -2
- package/dist/SelectSearch.es.js +67 -66
- package/dist/TicketCard.d.ts +6 -0
- package/dist/TicketCard.es.js +130 -0
- package/dist/badge-B1IK_-i5.js +87 -0
- package/dist/components/NotificationCard/index.d.ts +3 -0
- package/dist/components/PyrionNavigationDrawer/index.d.ts +3 -0
- package/dist/components/TicketCard/index.d.ts +3 -0
- package/dist/exports/NotificationCard.d.ts +2 -0
- package/dist/exports/PyrionNavigationDrawer.d.ts +2 -0
- package/dist/exports/TicketCard.d.ts +2 -0
- package/dist/exports/usePyrionNavigation.d.ts +1 -0
- package/dist/prometeo-design-system.es.js +287 -365
- package/dist/usePyrionNavigation.d.ts +4 -0
- package/dist/usePyrionNavigation.es.js +4 -0
- package/dist/utils-X4-h3cum.js +54 -0
- package/package.json +17 -1
- package/dist/Select-BdxmkrjB.js +0 -1111
package/dist/SelectSearch.es.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { j as Y } from "./jsx-runtime-GkKLlHH4.js";
|
|
2
|
-
import { g as i
|
|
2
|
+
import { g as i } from "./utils-X4-h3cum.js";
|
|
3
3
|
import { useState as A, useRef as E, useEffect as b, useMemo as ee, useCallback as te } from "react";
|
|
4
|
+
import Z from "./Select.es.js";
|
|
4
5
|
function re(e) {
|
|
5
6
|
const {
|
|
6
7
|
options: O,
|
|
7
8
|
fetcher: d,
|
|
8
|
-
asyncMode:
|
|
9
|
-
disabled:
|
|
9
|
+
asyncMode: w = "fetch_in_open",
|
|
10
|
+
disabled: S = !1,
|
|
10
11
|
debounceDelay: P = 500,
|
|
11
12
|
minCharacters: T = 3,
|
|
12
13
|
optionLabel: h,
|
|
@@ -15,15 +16,15 @@ function re(e) {
|
|
|
15
16
|
isOpen: F,
|
|
16
17
|
inputRef: y,
|
|
17
18
|
name: k
|
|
18
|
-
} = e || {}, M = O ? O.filter((t) => t != null) : [], [V, g] = A(M || []), [D, I] = A(M || []), [c, N] = A(""), [W,
|
|
19
|
+
} = e || {}, M = O ? O.filter((t) => t != null) : [], [V, g] = A(M || []), [D, I] = A(M || []), [c, N] = A(""), [W, p] = A(!1), [J, U] = A(!1), l = E(null), C = E(null), m = E(!1), L = E(d), _ = e?.multiple === !0 || !1, j = E(_ ? [] : void 0), [a, v] = A(_ ? [] : void 0);
|
|
19
20
|
b(() => {
|
|
20
21
|
L.current = d;
|
|
21
22
|
}, [d]), b(() => {
|
|
22
|
-
if (
|
|
23
|
+
if (_) {
|
|
23
24
|
const t = z(f, "value");
|
|
24
|
-
|
|
25
|
+
v(t);
|
|
25
26
|
} else
|
|
26
|
-
f != null ?
|
|
27
|
+
f != null ? v(f) : v(void 0);
|
|
27
28
|
}, [f]), b(() => {
|
|
28
29
|
j.current = f !== void 0 ? f : a;
|
|
29
30
|
}, [f, a]), b(() => {
|
|
@@ -32,22 +33,22 @@ function re(e) {
|
|
|
32
33
|
g(t), I(t);
|
|
33
34
|
}
|
|
34
35
|
}, [e?.options]);
|
|
35
|
-
const B = ee(() => (t, n) => new Promise((
|
|
36
|
-
|
|
36
|
+
const B = ee(() => (t, n) => new Promise((o, r) => {
|
|
37
|
+
l.current && clearTimeout(l.current), l.current = setTimeout(() => t(c).then(o).catch(r), n);
|
|
37
38
|
}), [c]), ne = (t) => {
|
|
38
|
-
const n = f !== void 0,
|
|
39
|
+
const n = f !== void 0, o = (r) => s ? i(r, s) : i(r, "id");
|
|
39
40
|
if (e?.multiple === !0) {
|
|
40
41
|
const r = j.current || [];
|
|
41
42
|
let u;
|
|
42
|
-
r.some((x) =>
|
|
43
|
+
r.some((x) => o(x) === o(t)) ? u = r.filter((x) => o(x) !== o(t)) : u = [...r, t], n ? (j.current = u, e?.onChange?.(u, k)) : (j.current = u, v(u), e?.onChange?.(u, k));
|
|
43
44
|
} else
|
|
44
|
-
n ? (j.current = t, e?.onChange?.(t, k)) : (j.current = t,
|
|
45
|
-
}, q = (t) => (e?.onFetchingStart?.(), L.current?.(t) || Promise.resolve([])), z = (t, n) => Array.isArray(t) ? (t.some((
|
|
45
|
+
n ? (j.current = t, e?.onChange?.(t, k)) : (j.current = t, v(t), e?.onChange?.(t, k));
|
|
46
|
+
}, q = (t) => (e?.onFetchingStart?.(), L.current?.(t) || Promise.resolve([])), z = (t, n) => Array.isArray(t) ? (t.some((o) => typeof o != "object" || o === null) && console.debug(`El valor del ${n || "resultado del fetcher"} contiene elementos no válidos (null,undefined, no-object)`, t), t?.filter((o) => o != null) || []) : (console.debug(`El valor del ${n || "resultado del fetcher"} no es un Array (tipo de dato obtenido: ${typeof t})`), []), $ = te((t, n) => t.length === 0 ? n : s ? n.filter((o) => !t.some((r) => i(r, s) === i(o, s))) : n.filter((o) => !t.some((r) => i(r, "id") === i(o, "id"))), [s]);
|
|
46
47
|
b(() => {
|
|
47
48
|
const t = e?.subscribeOpenChange;
|
|
48
49
|
if (!t) return;
|
|
49
|
-
const n = t((
|
|
50
|
-
U(
|
|
50
|
+
const n = t((o) => {
|
|
51
|
+
U(o);
|
|
51
52
|
});
|
|
52
53
|
return () => {
|
|
53
54
|
n && n();
|
|
@@ -55,46 +56,46 @@ function re(e) {
|
|
|
55
56
|
}, [e?.subscribeOpenChange]);
|
|
56
57
|
const G = F !== void 0 ? F : J;
|
|
57
58
|
b(() => {
|
|
58
|
-
if (!
|
|
59
|
+
if (!S && L.current && w === "fetch_on_type") {
|
|
59
60
|
if (!c || c === "" || c.length < T) {
|
|
60
|
-
|
|
61
|
+
l.current && clearTimeout(l.current), p(!1);
|
|
61
62
|
return;
|
|
62
63
|
}
|
|
63
64
|
const t = B(q, P);
|
|
64
|
-
|
|
65
|
-
const
|
|
66
|
-
g(
|
|
65
|
+
p(!0), t.then((n) => {
|
|
66
|
+
const o = z(n);
|
|
67
|
+
g(o);
|
|
67
68
|
}).finally(() => {
|
|
68
|
-
|
|
69
|
+
p(!1), e?.onFetchingEnd?.();
|
|
69
70
|
});
|
|
70
71
|
}
|
|
71
|
-
}, [
|
|
72
|
-
if (!
|
|
72
|
+
}, [w, c, S, P, B, T]), b(() => {
|
|
73
|
+
if (!S)
|
|
73
74
|
if (G) {
|
|
74
|
-
if (e?.onOpen?.(),
|
|
75
|
+
if (e?.onOpen?.(), w === "fetch_in_open") {
|
|
75
76
|
if (!L.current)
|
|
76
77
|
return;
|
|
77
|
-
|
|
78
|
+
p(!0), q().then((t) => {
|
|
78
79
|
const n = z(t);
|
|
79
80
|
g(() => {
|
|
80
|
-
const
|
|
81
|
+
const o = n.filter((r) => {
|
|
81
82
|
if (s)
|
|
82
83
|
return i(r, s) !== void 0;
|
|
83
84
|
});
|
|
84
|
-
return
|
|
85
|
+
return _ && a.length > 0 ? [...$(a, o), ...a] : o;
|
|
85
86
|
});
|
|
86
87
|
}).finally(() => {
|
|
87
|
-
|
|
88
|
+
p(!1), e?.onFetchingEnd?.();
|
|
88
89
|
});
|
|
89
90
|
}
|
|
90
91
|
} else
|
|
91
92
|
e?.onClose?.();
|
|
92
|
-
}, [G,
|
|
93
|
-
const H = (t, n) => t?.filter((
|
|
93
|
+
}, [G, w, S]);
|
|
94
|
+
const H = (t, n) => t?.filter((o) => {
|
|
94
95
|
if (h)
|
|
95
|
-
return i(
|
|
96
|
+
return i(o, h)?.toLowerCase().includes(n.toLowerCase());
|
|
96
97
|
{
|
|
97
|
-
const r =
|
|
98
|
+
const r = o;
|
|
98
99
|
switch (typeof r) {
|
|
99
100
|
case "string":
|
|
100
101
|
return r?.toLowerCase().includes(n.toLowerCase());
|
|
@@ -106,11 +107,11 @@ function re(e) {
|
|
|
106
107
|
return !1;
|
|
107
108
|
}
|
|
108
109
|
}
|
|
109
|
-
}) || [],
|
|
110
|
+
}) || [], oe = (t) => t?.sort((n, o) => {
|
|
110
111
|
if (h)
|
|
111
|
-
return i(n, h) < i(
|
|
112
|
+
return i(n, h) < i(o, h) ? -1 : 1;
|
|
112
113
|
{
|
|
113
|
-
const u = ["label", "name", "value"].find((K) => typeof n == "object" && Object.keys(n).includes(K)), R = n, x =
|
|
114
|
+
const u = ["label", "name", "value"].find((K) => typeof n == "object" && Object.keys(n).includes(K)), R = n, x = o;
|
|
114
115
|
switch (typeof R) {
|
|
115
116
|
case "string":
|
|
116
117
|
return R < x ? -1 : 1;
|
|
@@ -118,8 +119,8 @@ function re(e) {
|
|
|
118
119
|
return R < x ? -1 : 1;
|
|
119
120
|
case "object":
|
|
120
121
|
if (u) {
|
|
121
|
-
const K = i(n, u),
|
|
122
|
-
return K <
|
|
122
|
+
const K = i(n, u), le = i(o, u);
|
|
123
|
+
return K < le ? -1 : 1;
|
|
123
124
|
} else
|
|
124
125
|
return 1;
|
|
125
126
|
default:
|
|
@@ -134,8 +135,8 @@ function re(e) {
|
|
|
134
135
|
};
|
|
135
136
|
b(() => {
|
|
136
137
|
if (c === "")
|
|
137
|
-
I(
|
|
138
|
-
else if (
|
|
138
|
+
I(oe(V));
|
|
139
|
+
else if (_) {
|
|
139
140
|
const t = $(a, V);
|
|
140
141
|
I([...H(t, c), ...a]);
|
|
141
142
|
} else {
|
|
@@ -153,7 +154,7 @@ function re(e) {
|
|
|
153
154
|
setInputValue: N,
|
|
154
155
|
cleanInputValue: X,
|
|
155
156
|
cleanOptions: () => {
|
|
156
|
-
if (
|
|
157
|
+
if (_)
|
|
157
158
|
g(a);
|
|
158
159
|
else {
|
|
159
160
|
const t = a;
|
|
@@ -162,48 +163,48 @@ function re(e) {
|
|
|
162
163
|
X();
|
|
163
164
|
},
|
|
164
165
|
clearValue: () => {
|
|
165
|
-
|
|
166
|
+
v(_ ? [] : void 0);
|
|
166
167
|
},
|
|
167
168
|
filteredOptions: D,
|
|
168
169
|
isLoading: W,
|
|
169
170
|
value: a,
|
|
170
|
-
setValue:
|
|
171
|
+
setValue: v,
|
|
171
172
|
onOptionClick: ne
|
|
172
173
|
};
|
|
173
174
|
}
|
|
174
|
-
const
|
|
175
|
-
const O = E(null), { asyncMode: d = "fetch_in_open" } = e,
|
|
175
|
+
const he = (e) => {
|
|
176
|
+
const O = E(null), { asyncMode: d = "fetch_in_open" } = e, w = (l, C, m) => {
|
|
176
177
|
const L = {
|
|
177
|
-
options:
|
|
178
|
-
fetcher:
|
|
178
|
+
options: l.options,
|
|
179
|
+
fetcher: l.fetcher,
|
|
179
180
|
asyncMode: C,
|
|
180
|
-
debounceDelay:
|
|
181
|
-
minCharacters:
|
|
182
|
-
disabled:
|
|
183
|
-
optionValue:
|
|
184
|
-
optionLabel:
|
|
181
|
+
debounceDelay: l.debounceDelay,
|
|
182
|
+
minCharacters: l.minCharacters,
|
|
183
|
+
disabled: l.disabled,
|
|
184
|
+
optionValue: l.optionValue,
|
|
185
|
+
optionLabel: l.optionLabel,
|
|
185
186
|
onFetchingStart: () => {
|
|
186
187
|
C === "fetch_on_type" && m.current?.open();
|
|
187
188
|
},
|
|
188
189
|
onTypeStart: () => {
|
|
189
|
-
!
|
|
190
|
+
!l?.fetcher && m.current?.open();
|
|
190
191
|
},
|
|
191
192
|
inputRef: () => m.current?.searchInputRef,
|
|
192
193
|
subscribeOpenChange: m.current?.subscribeOpenChange,
|
|
193
|
-
name:
|
|
194
|
+
name: l.name
|
|
194
195
|
};
|
|
195
|
-
return
|
|
196
|
+
return l.multiple ? {
|
|
196
197
|
...L,
|
|
197
198
|
multiple: !0,
|
|
198
|
-
controlledValue:
|
|
199
|
-
onChange:
|
|
199
|
+
controlledValue: l.value,
|
|
200
|
+
onChange: l.onChange
|
|
200
201
|
} : {
|
|
201
202
|
...L,
|
|
202
203
|
multiple: !1,
|
|
203
|
-
controlledValue:
|
|
204
|
-
onChange:
|
|
204
|
+
controlledValue: l.value,
|
|
205
|
+
onChange: l.onChange
|
|
205
206
|
};
|
|
206
|
-
}, { inputValue:
|
|
207
|
+
}, { inputValue: S, setInputValue: P, filteredOptions: T, isLoading: h, value: s, onOptionClick: f, cleanInputValue: F, cleanOptions: y, clearValue: k } = re(w(e, d, O));
|
|
207
208
|
b(() => {
|
|
208
209
|
!e.controls || !O.current || (e.controls.current = {
|
|
209
210
|
...O.current,
|
|
@@ -215,11 +216,11 @@ const fe = (e) => {
|
|
|
215
216
|
const M = te(
|
|
216
217
|
() => d === "fetch_on_type" ? h : !1,
|
|
217
218
|
[d, h]
|
|
218
|
-
), V = ee(() => e.multiple ? s.map((
|
|
219
|
-
const C = T.find((m) => i(m, e.optionValue) ===
|
|
219
|
+
), V = ee(() => e.multiple ? s.map((l) => i(l, e.optionValue)) : s ? i(s, e.optionValue) : void 0, [s, e.optionValue, e.multiple]), g = (l) => {
|
|
220
|
+
const C = T.find((m) => i(m, e.optionValue) === l.id);
|
|
220
221
|
C && f(C);
|
|
221
|
-
}, { displayMode: D = e.multiple ? "chips" : "compact", dropdownOptions: I, overflow: c = "scroll", onChange: N, onClear: W, ...
|
|
222
|
-
controledSearchValue:
|
|
222
|
+
}, { displayMode: D = e.multiple ? "chips" : "compact", dropdownOptions: I, overflow: c = "scroll", onChange: N, onClear: W, ...p } = e.selectComponentProps || {}, J = {
|
|
223
|
+
controledSearchValue: S,
|
|
223
224
|
onSearchValueChange: d === "fetch_on_type" ? P : void 0,
|
|
224
225
|
onSearchClear: d === "fetch_on_type" ? () => {
|
|
225
226
|
F(), y();
|
|
@@ -237,7 +238,7 @@ const fe = (e) => {
|
|
|
237
238
|
className: e.className,
|
|
238
239
|
name: e.name,
|
|
239
240
|
overflow: c,
|
|
240
|
-
...
|
|
241
|
+
...p,
|
|
241
242
|
onClear: e?.selectComponentProps?.onClear && U,
|
|
242
243
|
multiple: !0,
|
|
243
244
|
value: V,
|
|
@@ -257,7 +258,7 @@ const fe = (e) => {
|
|
|
257
258
|
Z,
|
|
258
259
|
{
|
|
259
260
|
disabled: e.disabled,
|
|
260
|
-
...
|
|
261
|
+
...p,
|
|
261
262
|
onClear: U,
|
|
262
263
|
className: e.className,
|
|
263
264
|
overflow: c,
|
|
@@ -279,5 +280,5 @@ const fe = (e) => {
|
|
|
279
280
|
);
|
|
280
281
|
};
|
|
281
282
|
export {
|
|
282
|
-
|
|
283
|
+
he as default
|
|
283
284
|
};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { j as l } from "./jsx-runtime-GkKLlHH4.js";
|
|
2
|
+
import { g as L } from "./useLabelBackground-BDIHUdND.js";
|
|
3
|
+
import { c as d } from "./cn-B6yFEsav.js";
|
|
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
|
+
import { CrevronLeft as I } from "./Icons/CrevronLeft.es.js";
|
|
6
|
+
const C = (n, t) => typeof n == "function" ? t ? n(t) : null : n, q = (n) => {
|
|
7
|
+
const { children: t, className: r, controls: s } = n, [e, c] = y(!0), i = x(() => {
|
|
8
|
+
c((a) => !a);
|
|
9
|
+
}, []), f = x(() => {
|
|
10
|
+
c(!1);
|
|
11
|
+
}, []), p = x(() => {
|
|
12
|
+
c(!0);
|
|
13
|
+
}, []);
|
|
14
|
+
S(
|
|
15
|
+
s,
|
|
16
|
+
() => ({ open: f, close: p, toggle: i }),
|
|
17
|
+
[f, p, i]
|
|
18
|
+
);
|
|
19
|
+
const o = {
|
|
20
|
+
isCollapsed: e,
|
|
21
|
+
toggle: i
|
|
22
|
+
}, v = typeof t == "function" ? t(o) : t, m = A.toArray(v);
|
|
23
|
+
let u = null, g = null;
|
|
24
|
+
const h = [];
|
|
25
|
+
m.forEach((a) => {
|
|
26
|
+
if (!B(a)) {
|
|
27
|
+
h.push(a);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (a.type === b && !u) {
|
|
31
|
+
u = k(a, { context: o });
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (a.type === E && !g) {
|
|
35
|
+
g = k(a, { context: o });
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
h.push(a);
|
|
39
|
+
});
|
|
40
|
+
const H = u ?? (h.length ? /* @__PURE__ */ l.jsx(b, { context: o, children: h }) : null), R = !!g, T = g ?? null;
|
|
41
|
+
return /* @__PURE__ */ l.jsxs("div", { className: d("group/ticketcard w-full h-full flex flex-col overflow-hidden", r), "data-expanded": !e, children: [
|
|
42
|
+
/* @__PURE__ */ l.jsxs("div", { className: "ticketcard-container flex gap-0.5 h-min flex-nowrap", children: [
|
|
43
|
+
H,
|
|
44
|
+
R && /* @__PURE__ */ l.jsx(M, { isCollapsed: e, toggle: i })
|
|
45
|
+
] }),
|
|
46
|
+
/* @__PURE__ */ l.jsx(V, { context: o, children: T })
|
|
47
|
+
] });
|
|
48
|
+
}, j = O(q), b = (n) => {
|
|
49
|
+
const { children: t, context: r, className: s, onClick: e } = n, c = C(t, r);
|
|
50
|
+
return /* @__PURE__ */ l.jsx(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
className: d(
|
|
54
|
+
"ticketcard-content rounded-lg p-3 flex-1 overflow-hidden",
|
|
55
|
+
"bg-neutral-default-default border border-transparent",
|
|
56
|
+
"transition-all duration-300 ease-in-out",
|
|
57
|
+
e && "hover:bg-neutral-default-hover",
|
|
58
|
+
e && "active:bg-neutral-default-pressed focus-visible:bg-neutral-default-pressed",
|
|
59
|
+
"group-data-[expanded=true]/ticketcard:border-neutral-strong-default",
|
|
60
|
+
e ? "cursor-pointer clickable" : "",
|
|
61
|
+
s
|
|
62
|
+
),
|
|
63
|
+
onClick: e,
|
|
64
|
+
children: c
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}, M = ({ isCollapsed: n, toggle: t }) => {
|
|
68
|
+
const r = w(null);
|
|
69
|
+
return N(() => {
|
|
70
|
+
if (!r.current) return;
|
|
71
|
+
const s = r.current.previousElementSibling?.querySelector(".ticket-card-content");
|
|
72
|
+
if (!s) return;
|
|
73
|
+
const e = L(s);
|
|
74
|
+
r.current.style.backgroundColor = e;
|
|
75
|
+
}, []), /* @__PURE__ */ l.jsx(
|
|
76
|
+
"button",
|
|
77
|
+
{
|
|
78
|
+
ref: r,
|
|
79
|
+
type: "button",
|
|
80
|
+
onClick: t,
|
|
81
|
+
className: d(
|
|
82
|
+
"ticketcard-toggle-button",
|
|
83
|
+
"grid place-items-center cursor-pointer transition-transform rounded-lg w-8 max-w-8 min-w-8",
|
|
84
|
+
"bg-neutral-default-default ",
|
|
85
|
+
"transition-all duration-300 ease-in-out",
|
|
86
|
+
"hover:bg-neutral-default-hover",
|
|
87
|
+
"active:bg-neutral-default-pressed focus-visible:bg-neutral-default-pressed",
|
|
88
|
+
"group-data-[expanded=true]/ticketcard:bg-neutral-default-hover",
|
|
89
|
+
"group-data-[expanded=true]/ticketcard:text-primary-default-default"
|
|
90
|
+
),
|
|
91
|
+
children: /* @__PURE__ */ l.jsx(I, { className: d("-rotate-90 transition-transform duration-300", !n && "rotate-90") })
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
}, V = (n) => {
|
|
95
|
+
const { children: t, context: r, className: s } = n, e = C(t, r), c = r?.isCollapsed ?? !0, i = w(null), [f, p] = y(0), o = x(() => {
|
|
96
|
+
const m = i.current;
|
|
97
|
+
if (!m) return;
|
|
98
|
+
const u = m.scrollHeight;
|
|
99
|
+
p(u);
|
|
100
|
+
}, []);
|
|
101
|
+
N(() => {
|
|
102
|
+
o();
|
|
103
|
+
}, [o, e]), z(() => (window.addEventListener("resize", o), () => window.removeEventListener("resize", o)), [o]);
|
|
104
|
+
const v = c ? 0 : f || i.current?.scrollHeight || 0;
|
|
105
|
+
return /* @__PURE__ */ l.jsx(
|
|
106
|
+
"div",
|
|
107
|
+
{
|
|
108
|
+
className: d(
|
|
109
|
+
"ticket-card-collapsable overflow-hidden transition-all duration-300 ease-in-out flex-1 flex flex-col",
|
|
110
|
+
s
|
|
111
|
+
),
|
|
112
|
+
style: {
|
|
113
|
+
maxHeight: v,
|
|
114
|
+
opacity: c ? 0 : 1
|
|
115
|
+
},
|
|
116
|
+
children: /* @__PURE__ */ l.jsx("div", { ref: i, className: "flex flex-col", children: e })
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
}, E = (n) => {
|
|
120
|
+
const { children: t, context: r, className: s } = n, e = C(t, r);
|
|
121
|
+
return /* @__PURE__ */ l.jsx("div", { className: d("ticket-card-options flex-1 overflow-hidden min-h-0", s), children: e });
|
|
122
|
+
}, _ = Object.assign(j, {
|
|
123
|
+
Root: j,
|
|
124
|
+
Content: b,
|
|
125
|
+
Options: E
|
|
126
|
+
});
|
|
127
|
+
_.displayName = "TicketCard";
|
|
128
|
+
export {
|
|
129
|
+
_ as default
|
|
130
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { j as n } from "./jsx-runtime-GkKLlHH4.js";
|
|
2
|
+
import { c as i } from "./cn-B6yFEsav.js";
|
|
3
|
+
import { forwardRef as b, useState as g, useRef as p, useEffect as h } from "react";
|
|
4
|
+
const j = b((t, s) => {
|
|
5
|
+
const [c, u] = g(t?.currentTabName || t.tabs[0].name), l = p(null), { tabs: r = [], className: d, activeColor: a = "var(--neutral-900)" } = t;
|
|
6
|
+
h(() => {
|
|
7
|
+
l.current?.style.setProperty("--tab-bg", a);
|
|
8
|
+
}, [a]);
|
|
9
|
+
const m = r.find((e) => e.name === (t?.currentTabName || c));
|
|
10
|
+
return /* @__PURE__ */ n.jsx(
|
|
11
|
+
"div",
|
|
12
|
+
{
|
|
13
|
+
ref: s,
|
|
14
|
+
className: i(
|
|
15
|
+
"select-none",
|
|
16
|
+
"flex flex-col gap-2",
|
|
17
|
+
"bg-neutral-strong-default",
|
|
18
|
+
"h-full w-14 max-w-14 pl-[6px] py-6",
|
|
19
|
+
" border-r border-neutral-default-default",
|
|
20
|
+
d
|
|
21
|
+
),
|
|
22
|
+
children: r.map(
|
|
23
|
+
(e) => {
|
|
24
|
+
const o = e.name === m?.name, f = typeof e.thumbnail == "string" ? /* @__PURE__ */ n.jsx("img", { src: e.thumbnail, alt: e.description, className: "aspect-square object-contain rounded", draggable: !1 }) : e.thumbnail, x = () => {
|
|
25
|
+
e.disabled || (u(e.name), e.onClick && e.onClick(e.name));
|
|
26
|
+
};
|
|
27
|
+
return /* @__PURE__ */ n.jsx(
|
|
28
|
+
"div",
|
|
29
|
+
{
|
|
30
|
+
className: i(
|
|
31
|
+
"bg-[(--tab-bg)]",
|
|
32
|
+
"h-12 w-[50px] z-20",
|
|
33
|
+
"flex items-center pl-[6px] ",
|
|
34
|
+
"rounded-l-[8px]",
|
|
35
|
+
"tabswitch-element relative",
|
|
36
|
+
o && "active"
|
|
37
|
+
),
|
|
38
|
+
onClick: x,
|
|
39
|
+
ref: l,
|
|
40
|
+
children: /* @__PURE__ */ n.jsx("div", { className: i(
|
|
41
|
+
"size-8 rounded-[4px]",
|
|
42
|
+
"grid place-items-center",
|
|
43
|
+
"tab-thumbnail-icon",
|
|
44
|
+
"bg-transparent text-neutral-default-default",
|
|
45
|
+
e?.className
|
|
46
|
+
), children: f })
|
|
47
|
+
},
|
|
48
|
+
e.name
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}), N = ({
|
|
55
|
+
count: t,
|
|
56
|
+
maxCount: s = 9,
|
|
57
|
+
className: c = "",
|
|
58
|
+
size: u = "medium",
|
|
59
|
+
variant: l = "primary",
|
|
60
|
+
showZero: r = !1,
|
|
61
|
+
disabled: d = !1
|
|
62
|
+
}) => {
|
|
63
|
+
const a = t, m = a > s ? `+${s}` : a;
|
|
64
|
+
if (a === 0 && !r) return null;
|
|
65
|
+
const e = {
|
|
66
|
+
small: "w-4.5 h-4.5 text-xs ",
|
|
67
|
+
medium: "w-5 h-5 text-xs",
|
|
68
|
+
large: "w-6 h-6 text-sm"
|
|
69
|
+
}, o = {
|
|
70
|
+
primary: "bg-primary-default-default text-neutral-strong-default",
|
|
71
|
+
secondary: "bg-neutral-medium-default text-neutral-strong-default",
|
|
72
|
+
success: "bg-green-500 text-white",
|
|
73
|
+
warning: "bg-yellow-500 text-black",
|
|
74
|
+
danger: "bg-red-500 text-white"
|
|
75
|
+
};
|
|
76
|
+
return /* @__PURE__ */ n.jsx("div", { className: i(
|
|
77
|
+
"rounded-full flex items-center justify-center font-medium select-none",
|
|
78
|
+
e[u],
|
|
79
|
+
o[l],
|
|
80
|
+
c,
|
|
81
|
+
d && "text-neutral-strong-disabled bg-primary-medium-disabled"
|
|
82
|
+
), children: /* @__PURE__ */ n.jsx("span", { children: m }) });
|
|
83
|
+
};
|
|
84
|
+
export {
|
|
85
|
+
N as B,
|
|
86
|
+
j as T
|
|
87
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { default as PyrionNavigationDrawer, PyrionNavigationDrawerProps, PyrionNavigationDrawerOptions, NavigationDrawerTabsProps, AuthSession } from './PyrionNavigationDrawer';
|
|
2
|
+
export { type PyrionNavigationDrawerProps, type PyrionNavigationDrawerOptions, type NavigationDrawerTabsProps, type AuthSession };
|
|
3
|
+
export default PyrionNavigationDrawer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { usePyrionNavigation as default } from '../components/PyrionNavigationDrawer/PyrionNavigationDrawer';
|