prometeo-design-system 4.2.4 → 4.2.5

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.
@@ -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 te } from "react";
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: p,
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: s,
14
+ optionValue: c,
15
15
  controlledValue: f,
16
16
  isOpen: F,
17
- inputRef: y,
17
+ inputRef: p,
18
18
  name: I
19
- } = e || {}, M = p ? p.filter((t) => t != null) : [], [V, g] = A(M || []), [D, k] = A(M || []), [c, N] = A(""), [W, C] = A(!1), [J, U] = A(!1), l = E(null), O = E(null), m = E(!1), L = E(d), S = e?.multiple === !0 || !1, j = E(S ? [] : void 0), [a, v] = A(S ? [] : void 0);
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), l = 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
- L.current = d;
21
+ S.current = d;
22
22
  }, [d]), b(() => {
23
- if (S) {
24
- const t = z(f, "value");
25
- v(t);
23
+ if (L) {
24
+ const n = z(f, "value");
25
+ y(n);
26
26
  } else
27
- f != null ? v(f) : v(void 0);
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 t = e.options.filter((n) => n != null);
33
- g(t), k(t);
32
+ const n = e.options.filter((t) => t != null);
33
+ g(n), k(n);
34
34
  }
35
35
  }, [e?.options]);
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);
38
- }), [c]), ne = (t) => {
39
- const n = f !== void 0, o = (r) => s ? i(r, s) : i(r, "id");
36
+ const B = ee(() => (n, t) => new Promise((o, r) => {
37
+ l.current && clearTimeout(l.current), l.current = setTimeout(() => n(s).then(o).catch(r), t);
38
+ }), [s]), te = (n) => {
39
+ const t = f !== void 0, o = (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) => o(x) === o(t)) ? u = r.filter((x) => o(x) !== o(t)) : u = [...r, t], n ? (j.current = u, e?.onChange?.(u, I)) : (j.current = u, v(u), e?.onChange?.(u, I));
43
+ r.some((x) => o(x) === o(n)) ? u = r.filter((x) => o(x) !== o(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
- n ? (j.current = t, e?.onChange?.(t, I)) : (j.current = t, v(t), e?.onChange?.(t, I));
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]);
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((o) => typeof o != "object" || o === null) && console.debug(`El valor del ${t || "resultado del fetcher"} contiene elementos no válidos (null,undefined, no-object)`, n), n?.filter((o) => o != 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((o) => !n.some((r) => i(r, c) === i(o, c))) : t.filter((o) => !n.some((r) => i(r, "id") === i(o, "id"))), [c]);
47
47
  b(() => {
48
- const t = e?.subscribeOpenChange;
49
- if (!t) return;
50
- const n = t((o) => {
48
+ const n = e?.subscribeOpenChange;
49
+ if (!n) return;
50
+ const t = n((o) => {
51
51
  U(o);
52
52
  });
53
53
  return () => {
54
- n && n();
54
+ t && t();
55
55
  };
56
56
  }, [e?.subscribeOpenChange]);
57
57
  const G = F !== void 0 ? F : J;
58
58
  b(() => {
59
- if (!w && L.current && _ === "fetch_on_type") {
60
- if (!c || c === "" || c.length < T) {
61
- l.current && clearTimeout(l.current), C(!1);
59
+ if (!w && S.current && _ === "fetch_on_type") {
60
+ if (!s || s === "" || s.length < T) {
61
+ l.current && clearTimeout(l.current), v(!1);
62
62
  return;
63
63
  }
64
- const t = B(q, P);
65
- C(!0), t.then((n) => {
66
- const o = z(n);
64
+ const n = B(q, P);
65
+ v(!0), n.then((t) => {
66
+ const o = z(t);
67
67
  g(o);
68
68
  }).finally(() => {
69
- C(!1), e?.onFetchingEnd?.();
69
+ v(!1), e?.onFetchingEnd?.();
70
70
  });
71
71
  }
72
- }, [_, c, w, P, B, T]), b(() => {
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 (!L.current)
76
+ if (!S.current)
77
77
  return;
78
- C(!0), q().then((t) => {
79
- const n = z(t);
78
+ v(!0), q().then((n) => {
79
+ const t = z(n);
80
80
  g(() => {
81
- const o = n.filter((r) => {
82
- if (s)
83
- return i(r, s) !== void 0;
81
+ const o = t.filter((r) => {
82
+ if (c)
83
+ return i(r, c) !== void 0;
84
84
  });
85
- return S && a.length > 0 ? [...$(a, o), ...a] : o;
85
+ return L && a.length > 0 ? [...$(a, o), ...a] : o;
86
86
  });
87
87
  }).finally(() => {
88
- C(!1), e?.onFetchingEnd?.();
88
+ v(!1), e?.onFetchingEnd?.();
89
89
  });
90
90
  }
91
91
  } else
92
92
  e?.onClose?.();
93
93
  }, [G, _, w]);
94
- const H = (t, n) => t?.filter((o) => {
94
+ const H = (n, t) => n?.filter((o) => {
95
95
  if (h)
96
- return i(o, h)?.toLowerCase().includes(n.toLowerCase());
96
+ return i(o, h)?.toLowerCase().includes(t.toLowerCase());
97
97
  {
98
98
  const r = o;
99
99
  switch (typeof r) {
100
100
  case "string":
101
- return r?.toLowerCase().includes(n.toLowerCase());
101
+ return r?.toLowerCase().includes(t.toLowerCase());
102
102
  case "number":
103
- return r.toString().includes(n);
103
+ return r.toString().includes(t);
104
104
  case "object":
105
- return Object.values(r).some((R) => R.toString()?.toLowerCase().includes(n.toLowerCase()));
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
- }) || [], oe = (t) => t?.sort((n, o) => {
110
+ }) || [], oe = (n) => n?.sort((t, o) => {
111
111
  if (h)
112
- return i(n, h) < i(o, h) ? -1 : 1;
112
+ return i(t, h) < i(o, h) ? -1 : 1;
113
113
  {
114
- const u = ["label", "name", "value"].find((K) => typeof n == "object" && Object.keys(n).includes(K)), R = n, x = o;
114
+ const u = ["label", "name", "value"].find((K) => typeof t == "object" && Object.keys(t).includes(K)), R = t, x = o;
115
115
  switch (typeof R) {
116
116
  case "string":
117
117
  return R < x ? -1 : 1;
@@ -119,7 +119,7 @@ function re(e) {
119
119
  return R < x ? -1 : 1;
120
120
  case "object":
121
121
  if (u) {
122
- const K = i(n, u), le = i(o, u);
122
+ const K = i(t, u), le = i(o, u);
123
123
  return K < le ? -1 : 1;
124
124
  } else
125
125
  return 1;
@@ -127,21 +127,21 @@ function re(e) {
127
127
  return 1;
128
128
  }
129
129
  }
130
- }) || [], Q = (t) => {
131
- const n = typeof y == "function" ? y() : y;
132
- t.target === n?.current && (O.current && clearTimeout(O.current), m.current || (m.current = !0, e?.onTypeStart?.()), O.current = setTimeout(() => {
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 (c === "")
137
+ if (s === "")
138
138
  k(oe(V));
139
- else if (S) {
140
- const t = $(a, V);
141
- k([...H(t, c), ...a]);
139
+ else if (L) {
140
+ const n = $(a, V);
141
+ k([...H(n, s), ...a]);
142
142
  } else {
143
- const t = $([a], V);
144
- k([...H(t, c), a]);
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,31 +150,31 @@ function re(e) {
150
150
  N("");
151
151
  };
152
152
  return {
153
- inputValue: c,
153
+ inputValue: s,
154
154
  setInputValue: N,
155
155
  cleanInputValue: X,
156
156
  cleanOptions: () => {
157
- if (S)
157
+ if (L)
158
158
  g(a);
159
159
  else {
160
- const t = a;
161
- g(t ? [t] : []);
160
+ const n = a;
161
+ g(n ? [n] : []);
162
162
  }
163
163
  X();
164
164
  },
165
165
  clearValue: () => {
166
- v(S ? [] : void 0);
166
+ y(L ? [] : void 0);
167
167
  },
168
168
  filteredOptions: D,
169
169
  isLoading: W,
170
170
  value: a,
171
- setValue: v,
172
- onOptionClick: ne
171
+ setValue: y,
172
+ onOptionClick: te
173
173
  };
174
174
  }
175
175
  const he = (e) => {
176
- const p = E(null), { asyncMode: d = "fetch_in_open" } = e, _ = (l, O, m) => {
177
- const L = {
176
+ const C = E(null), { asyncMode: d = "fetch_in_open" } = e, _ = (l, O, m) => {
177
+ const S = {
178
178
  options: l.options,
179
179
  fetcher: l.fetcher,
180
180
  asyncMode: O,
@@ -194,36 +194,36 @@ const he = (e) => {
194
194
  name: l.name
195
195
  };
196
196
  return l.multiple ? {
197
- ...L,
197
+ ...S,
198
198
  multiple: !0,
199
199
  controlledValue: l.value,
200
200
  onChange: l.onChange
201
201
  } : {
202
- ...L,
202
+ ...S,
203
203
  multiple: !1,
204
204
  controlledValue: l.value,
205
205
  onChange: l.onChange
206
206
  };
207
- }, { inputValue: w, setInputValue: P, filteredOptions: T, isLoading: h, value: s, onOptionClick: f, cleanInputValue: F, cleanOptions: y, clearValue: I } = re(_(e, d, p));
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 || !p.current || (e.controls.current = {
210
- ...p.current,
209
+ !e.controls || !C.current || (e.controls.current = {
210
+ ...C.current,
211
211
  cleanOptions: () => {
212
- y();
212
+ p();
213
213
  }
214
214
  });
215
- }, [e.controls, y]);
216
- const M = te(
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 ? s.map((l) => i(l, e.optionValue)) : s ? i(s, e.optionValue) : void 0, [s, e.optionValue, e.multiple]), g = (l) => {
219
+ ), V = ee(() => e.multiple ? c.map((l) => i(l, e.optionValue)) : c ? i(c, e.optionValue) : void 0, [c, e.optionValue, e.multiple]), g = (l) => {
220
220
  const O = T.find((m) => i(m, e.optionValue) === l.id);
221
221
  O && f(O);
222
- }, { displayMode: D = e.multiple ? "chips" : "compact", dropdownOptions: k, overflow: c = "scroll", onChange: N, onClear: W, ...C } = e.selectComponentProps || {}, J = {
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(), y();
226
+ F(), p();
227
227
  } : void 0,
228
228
  inputSearchPlaceholder: e.inputSearchPlaceholder,
229
229
  isLoading: M(),
@@ -238,8 +238,8 @@ const he = (e) => {
238
238
  disabled: e.disabled,
239
239
  className: e.className,
240
240
  name: e.name,
241
- overflow: c,
242
- ...C,
241
+ overflow: s,
242
+ ...v,
243
243
  onClear: e?.selectComponentProps?.onClear && U,
244
244
  multiple: !0,
245
245
  value: V,
@@ -248,9 +248,10 @@ const he = (e) => {
248
248
  optionValue: e.optionValue,
249
249
  optionLabel: e.optionLabel,
250
250
  renderOption: e.renderOption,
251
+ renderSelection: e.renderSelection,
251
252
  onOptionClick: g,
252
253
  displayMode: D,
253
- controls: p,
254
+ controls: C,
254
255
  emptyMessage: "Use el buscador para obtener las opciones disponibles",
255
256
  dropdownOptions: J,
256
257
  isLoading: d === "fetch_in_open" ? h : !1
@@ -259,10 +260,10 @@ const he = (e) => {
259
260
  Z,
260
261
  {
261
262
  disabled: e.disabled,
262
- ...C,
263
+ ...v,
263
264
  onClear: U,
264
265
  className: e.className,
265
- overflow: c,
266
+ overflow: s,
266
267
  name: e.name,
267
268
  multiple: !1,
268
269
  value: V,
@@ -271,9 +272,10 @@ const he = (e) => {
271
272
  optionValue: e.optionValue,
272
273
  optionLabel: e.optionLabel,
273
274
  renderOption: e.renderOption,
275
+ renderSelection: e.renderSelection,
274
276
  onOptionClick: g,
275
277
  displayMode: "compact",
276
- controls: p,
278
+ controls: C,
277
279
  emptyMessage: "Use el buscador para obtener las opciones disponibles",
278
280
  dropdownOptions: J,
279
281
  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
+ };
@@ -1,123 +1,4 @@
1
- import { j as i } from "./jsx-runtime-GkKLlHH4.js";
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 w = /* @__PURE__ */ Symbol.for("react.memo"), E = (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 === w) {
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: n,
29
- activeTabClassName: h,
30
- indicatorClassName: y,
31
- animated: g = !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 o = 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, o, 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
- n,
58
- o && h
59
- ),
60
- tabIndex: e.disabled ? -1 : 0,
61
- "aria-label": e.title,
62
- role: "tab",
63
- "aria-selected": o,
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
- o ? "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(e.icon, s(
82
- "transition-all duration-300 ease-in-out group-hover/tablink-item:text-neutral-medium-hover ",
83
- o ? "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
- o && g && /* @__PURE__ */ i.jsx(
87
- C.div,
88
- {
89
- layoutId: "tab-indicator",
90
- className: s(
91
- "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)]",
92
- y
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], n = a.items[r];
116
- if (l.id !== n.id || l.title !== n.title || l.disabled !== n.disabled || l.description !== n.description)
117
- return !1;
118
- }
119
- return !0;
120
- });
1
+ import { T as f } from "./TabLinks-DxqprStp.js";
121
2
  export {
122
- H as default
3
+ f as default
123
4
  };
@@ -1,5 +1,5 @@
1
1
  import { j as l } from "./jsx-runtime-GkKLlHH4.js";
2
- import { g as L } from "./useLabelBackground-BDIHUdND.js";
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";
@@ -17,10 +17,11 @@ export interface NotificationCardProps<NotificationMetadata = any> {
17
17
  body: string | React.ReactNode | ((metadata?: NotificationMetadata) => React.ReactNode);
18
18
  date: string | Date;
19
19
  actions?: [NotificationAction<NotificationMetadata>, NotificationAction<NotificationMetadata>] | [NotificationAction<NotificationMetadata>];
20
- isNew?: boolean;
20
+ read?: boolean;
21
21
  className?: string;
22
22
  metadata?: NotificationMetadata;
23
+ onClick?: (metadata?: NotificationMetadata) => void;
23
24
  }
24
- declare const NotificationCard: <NotificationMetadata = unknown>({ user, body, date, actions, isNew, className, metadata }: NotificationCardProps<NotificationMetadata>) => import("react/jsx-runtime").JSX.Element;
25
+ declare const NotificationCard: <NotificationMetadata = unknown>({ user, body, date, actions, read, className, metadata, onClick }: NotificationCardProps<NotificationMetadata>) => import("react/jsx-runtime").JSX.Element;
25
26
  export default NotificationCard;
26
27
  export type NotificationCardComponent = typeof NotificationCard;
@@ -1,15 +1,18 @@
1
1
  import { NotificationCardProps } from '../NotificationCard/NotificationCard';
2
+ import { ScrollableControlsHandler } from '../Scrollable/Scrollable';
2
3
  interface PLNotificationsDrawerProps<NotificationMetadata> {
3
4
  onCloseClick?: VoidFunction;
4
5
  onMarkAllAsRead?: () => void;
5
6
  notificationsListControls?: React.RefObject<NotificationsListControlsHandler<NotificationMetadata> | null>;
7
+ scrollableControls?: React.RefObject<ScrollableControlsHandler | null>;
6
8
  }
7
9
  export interface NotificationsListControlsHandler<NotificationMetadata> {
8
- addNewNotification: (notification: NotificationCardProps<NotificationMetadata> | NotificationCardProps<NotificationMetadata>[]) => void;
10
+ addNewNotification: (notification: NotificationCardProps<NotificationMetadata> | NotificationCardProps<NotificationMetadata>[], position?: 'top' | 'bottom') => void;
9
11
  subscribeToUpdates: (callback: (notifications: NotificationCardProps<NotificationMetadata>[], count: number) => void) => () => void;
10
12
  removeNotification: (id: string | string[]) => void;
11
13
  removeAllNotifications: () => void;
12
14
  setNotifications: (notifications: NotificationCardProps<NotificationMetadata>[]) => void;
15
+ setLoading: (loading: boolean) => void;
13
16
  }
14
- declare const PLNotificationsList: <NotificationMetadata = unknown>({ onCloseClick, onMarkAllAsRead, notificationsListControls }: PLNotificationsDrawerProps<NotificationMetadata>) => import("react/jsx-runtime").JSX.Element;
17
+ declare const PLNotificationsList: <NotificationMetadata = unknown>({ onCloseClick, onMarkAllAsRead, notificationsListControls, scrollableControls }: PLNotificationsDrawerProps<NotificationMetadata>) => import("react/jsx-runtime").JSX.Element;
15
18
  export default PLNotificationsList;