@tracktor/design-system 4.8.1 → 4.8.2

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/main.js CHANGED
@@ -97,7 +97,7 @@ function L1() {
97
97
  return "StrictMode";
98
98
  case l:
99
99
  return "Suspense";
100
- case k:
100
+ case S:
101
101
  return "SuspenseList";
102
102
  case L:
103
103
  return "Activity";
@@ -158,7 +158,7 @@ function L1() {
158
158
  }
159
159
  }
160
160
  function o() {
161
- var g = S.A;
161
+ var g = k.A;
162
162
  return g === null ? null : g.getOwner();
163
163
  }
164
164
  function i() {
@@ -274,7 +274,7 @@ React keys must be passed directly to JSX without using spread:
274
274
  function f(g) {
275
275
  typeof g == "object" && g !== null && g.$$typeof === y && g._store && (g._store.validated = 1);
276
276
  }
277
- var v = k1, y = Symbol.for("react.transitional.element"), C = Symbol.for("react.portal"), u = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), I = Symbol.for("react.profiler"), B = Symbol.for("react.consumer"), h = Symbol.for("react.context"), w = Symbol.for("react.forward_ref"), l = Symbol.for("react.suspense"), k = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), H = Symbol.for("react.lazy"), L = Symbol.for("react.activity"), $ = Symbol.for("react.client.reference"), S = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, P = Object.prototype.hasOwnProperty, U = Array.isArray, Y = console.createTask ? console.createTask : function() {
277
+ var v = k1, y = Symbol.for("react.transitional.element"), C = Symbol.for("react.portal"), u = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), I = Symbol.for("react.profiler"), B = Symbol.for("react.consumer"), h = Symbol.for("react.context"), w = Symbol.for("react.forward_ref"), l = Symbol.for("react.suspense"), S = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), H = Symbol.for("react.lazy"), L = Symbol.for("react.activity"), $ = Symbol.for("react.client.reference"), k = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, P = Object.prototype.hasOwnProperty, U = Array.isArray, Y = console.createTask ? console.createTask : function() {
278
278
  return null;
279
279
  };
280
280
  v = {
@@ -287,7 +287,7 @@ React keys must be passed directly to JSX without using spread:
287
287
  i
288
288
  )(), G = Y(n(i)), Ae = {};
289
289
  Ve.Fragment = u, Ve.jsx = function(g, b, M, O, D) {
290
- var te = 1e4 > S.recentlyCreatedOwnerStacks++;
290
+ var te = 1e4 > k.recentlyCreatedOwnerStacks++;
291
291
  return p(
292
292
  g,
293
293
  b,
@@ -299,7 +299,7 @@ React keys must be passed directly to JSX without using spread:
299
299
  te ? Y(n(g)) : G
300
300
  );
301
301
  }, Ve.jsxs = function(g, b, M, O, D) {
302
- var te = 1e4 > S.recentlyCreatedOwnerStacks++;
302
+ var te = 1e4 > k.recentlyCreatedOwnerStacks++;
303
303
  return p(
304
304
  g,
305
305
  b,
@@ -511,7 +511,7 @@ function $1(e) {
511
511
  return Jr(iA("", null, null, null, [""], e = zr(e), 0, [0], e));
512
512
  }
513
513
  function iA(e, A, r, n, o, i, s, a, d) {
514
- for (var c = 0, p = 0, f = s, v = 0, y = 0, C = 0, u = 1, m = 1, I = 1, B = 0, h = "", w = o, l = i, k = n, E = h; m; )
514
+ for (var c = 0, p = 0, f = s, v = 0, y = 0, C = 0, u = 1, m = 1, I = 1, B = 0, h = "", w = o, l = i, S = n, E = h; m; )
515
515
  switch (C = B, B = de()) {
516
516
  // (
517
517
  case 40:
@@ -568,9 +568,9 @@ function iA(e, A, r, n, o, i, s, a, d) {
568
568
  E += ";";
569
569
  // { rule/at-rule
570
570
  default:
571
- if (rA(k = lr(E, A, r, c, p, o, a, h, w = [], l = [], f), i), B === 123)
571
+ if (rA(S = lr(E, A, r, c, p, o, a, h, w = [], l = [], f), i), B === 123)
572
572
  if (p === 0)
573
- iA(E, A, k, k, w, i, f, a, l);
573
+ iA(E, A, S, S, w, i, f, a, l);
574
574
  else
575
575
  switch (v === 99 && re(E, 3) === 110 ? 100 : v) {
576
576
  // d l m s
@@ -578,10 +578,10 @@ function iA(e, A, r, n, o, i, s, a, d) {
578
578
  case 108:
579
579
  case 109:
580
580
  case 115:
581
- iA(e, k, k, n && rA(lr(e, k, k, 0, 0, o, a, h, o, w = [], f), l), o, l, f, a, n ? w : l);
581
+ iA(e, S, S, n && rA(lr(e, S, S, 0, 0, o, a, h, o, w = [], f), l), o, l, f, a, n ? w : l);
582
582
  break;
583
583
  default:
584
- iA(E, k, k, k, [""], l, 0, a, l);
584
+ iA(E, S, S, S, [""], l, 0, a, l);
585
585
  }
586
586
  }
587
587
  c = p = y = 0, u = I = 1, h = E = "", f = s;
@@ -952,8 +952,8 @@ function dt() {
952
952
  var e = typeof Symbol == "function" && Symbol.for, A = e ? Symbol.for("react.element") : 60103, r = e ? Symbol.for("react.portal") : 60106, n = e ? Symbol.for("react.fragment") : 60107, o = e ? Symbol.for("react.strict_mode") : 60108, i = e ? Symbol.for("react.profiler") : 60114, s = e ? Symbol.for("react.provider") : 60109, a = e ? Symbol.for("react.context") : 60110, d = e ? Symbol.for("react.async_mode") : 60111, c = e ? Symbol.for("react.concurrent_mode") : 60111, p = e ? Symbol.for("react.forward_ref") : 60112, f = e ? Symbol.for("react.suspense") : 60113, v = e ? Symbol.for("react.suspense_list") : 60120, y = e ? Symbol.for("react.memo") : 60115, C = e ? Symbol.for("react.lazy") : 60116, u = e ? Symbol.for("react.block") : 60121, m = e ? Symbol.for("react.fundamental") : 60117, I = e ? Symbol.for("react.responder") : 60118, B = e ? Symbol.for("react.scope") : 60119;
953
953
  function h(l) {
954
954
  if (typeof l == "object" && l !== null) {
955
- var k = l.$$typeof;
956
- switch (k) {
955
+ var S = l.$$typeof;
956
+ switch (S) {
957
957
  case A:
958
958
  switch (l = l.type, l) {
959
959
  case d:
@@ -972,11 +972,11 @@ function dt() {
972
972
  case s:
973
973
  return l;
974
974
  default:
975
- return k;
975
+ return S;
976
976
  }
977
977
  }
978
978
  case r:
979
- return k;
979
+ return S;
980
980
  }
981
981
  }
982
982
  }
@@ -1060,7 +1060,7 @@ function pt() {
1060
1060
  }
1061
1061
  }
1062
1062
  }
1063
- var l = d, k = c, E = a, H = s, L = A, $ = p, S = n, P = C, U = y, Y = r, K = i, N = o, _ = f, G = !1;
1063
+ var l = d, S = c, E = a, H = s, L = A, $ = p, k = n, P = C, U = y, Y = r, K = i, N = o, _ = f, G = !1;
1064
1064
  function Ae(R) {
1065
1065
  return G || (G = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), g(R) || w(R) === d;
1066
1066
  }
@@ -1100,7 +1100,7 @@ function pt() {
1100
1100
  function yA(R) {
1101
1101
  return w(R) === f;
1102
1102
  }
1103
- j.AsyncMode = l, j.ConcurrentMode = k, j.ContextConsumer = E, j.ContextProvider = H, j.Element = L, j.ForwardRef = $, j.Fragment = S, j.Lazy = P, j.Memo = U, j.Portal = Y, j.Profiler = K, j.StrictMode = N, j.Suspense = _, j.isAsyncMode = Ae, j.isConcurrentMode = g, j.isContextConsumer = b, j.isContextProvider = M, j.isElement = O, j.isForwardRef = D, j.isFragment = te, j.isLazy = ae, j.isMemo = be, j.isPortal = q, j.isProfiler = ve, j.isStrictMode = Oe, j.isSuspense = yA, j.isValidElementType = h, j.typeOf = w;
1103
+ j.AsyncMode = l, j.ConcurrentMode = S, j.ContextConsumer = E, j.ContextProvider = H, j.Element = L, j.ForwardRef = $, j.Fragment = k, j.Lazy = P, j.Memo = U, j.Portal = Y, j.Profiler = K, j.StrictMode = N, j.Suspense = _, j.isAsyncMode = Ae, j.isConcurrentMode = g, j.isContextConsumer = b, j.isContextProvider = M, j.isElement = O, j.isForwardRef = D, j.isFragment = te, j.isLazy = ae, j.isMemo = be, j.isPortal = q, j.isProfiler = ve, j.isStrictMode = Oe, j.isSuspense = yA, j.isValidElementType = h, j.typeOf = w;
1104
1104
  }()), j;
1105
1105
  }
1106
1106
  var fr;
@@ -1159,11 +1159,11 @@ function ft() {
1159
1159
  var B = d(u);
1160
1160
  c && (B = B.concat(c(u)));
1161
1161
  for (var h = s(C), w = s(u), l = 0; l < B.length; ++l) {
1162
- var k = B[l];
1163
- if (!r[k] && !(m && m[k]) && !(w && w[k]) && !(h && h[k])) {
1164
- var E = p(u, k);
1162
+ var S = B[l];
1163
+ if (!r[S] && !(m && m[S]) && !(w && w[S]) && !(h && h[S])) {
1164
+ var E = p(u, S);
1165
1165
  try {
1166
- a(C, k, E);
1166
+ a(C, S, E);
1167
1167
  } catch {
1168
1168
  }
1169
1169
  }
@@ -1491,7 +1491,7 @@ const mr = 32, Pt = 24, Tt = 105, Lt = 24, Dt = 195, Ht = 44, Ot = 147, Qt = ()
1491
1491
  getTextColor: A
1492
1492
  };
1493
1493
  }, Vt = ({ colorShape: e, shapeBackgroundColor: A, color: r, height: n, width: o, withoutText: i, mode: s, sx: a, variant: d = "default", component: c = "img" }, p) => {
1494
- const [f, v] = W(""), { palette: y } = fe(), { getTextColor: C, getImageModule: u, getSize: m, getShapeColor: I, getShapeBackgroundColor: B } = Qt(), { height: h, width: w } = m({ height: n, variant: d, width: o, withoutText: i }), l = C(r), k = I(e), E = B(A);
1494
+ const [f, v] = W(""), { palette: y } = fe(), { getTextColor: C, getImageModule: u, getSize: m, getShapeColor: I, getShapeBackgroundColor: B } = Qt(), { height: h, width: w } = m({ height: n, variant: d, width: o, withoutText: i }), l = C(r), S = I(e), E = B(A);
1495
1495
  if (qA(() => {
1496
1496
  c !== "svg" && (async () => {
1497
1497
  const H = await u(d, s || y.mode, i);
@@ -1651,20 +1651,20 @@ const mr = 32, Pt = 24, Tt = 105, Lt = 24, Dt = 195, Ht = 44, Ot = 147, Qt = ()
1651
1651
  }
1652
1652
  ),
1653
1653
  /* @__PURE__ */ x("g", { clipPath: "url(#clip0_14141_226706)", children: [
1654
- /* @__PURE__ */ t("path", { d: "M12.3637 4C12.3629 4 12.3622 4 12.3615 4V11.6381H20C19.9993 7.41966 16.5811 4 12.3637 4Z", fill: k }),
1655
- /* @__PURE__ */ t("path", { d: "M4.0022 4C4.00147 4 4.00073 4 4 4V11.6381H11.6386C11.6378 7.41966 8.2196 4 4.0022 4Z", fill: k }),
1654
+ /* @__PURE__ */ t("path", { d: "M12.3637 4C12.3629 4 12.3622 4 12.3615 4V11.6381H20C19.9993 7.41966 16.5811 4 12.3637 4Z", fill: S }),
1655
+ /* @__PURE__ */ t("path", { d: "M4.0022 4C4.00147 4 4.00073 4 4 4V11.6381H11.6386C11.6378 7.41966 8.2196 4 4.0022 4Z", fill: S }),
1656
1656
  /* @__PURE__ */ t(
1657
1657
  "path",
1658
1658
  {
1659
1659
  d: "M11.6364 12.3619C11.6371 12.3619 11.6378 12.3619 11.6386 12.3619V20H4C4.00073 15.7816 7.41898 12.3619 11.6364 12.3619Z",
1660
- fill: k
1660
+ fill: S
1661
1661
  }
1662
1662
  ),
1663
1663
  /* @__PURE__ */ t(
1664
1664
  "path",
1665
1665
  {
1666
1666
  d: "M19.9978 12.3619C19.9986 12.3619 19.9993 12.3619 20 12.3619V20H12.3615C12.3622 15.7816 15.7804 12.3619 19.9978 12.3619Z",
1667
- fill: k
1667
+ fill: S
1668
1668
  }
1669
1669
  )
1670
1670
  ] }),
@@ -1765,20 +1765,20 @@ const mr = 32, Pt = 24, Tt = 105, Lt = 24, Dt = 195, Ht = 44, Ot = 147, Qt = ()
1765
1765
  }
1766
1766
  ),
1767
1767
  /* @__PURE__ */ x("g", { clipPath: "url(#clip0_14141_226601)", children: [
1768
- /* @__PURE__ */ t("path", { d: "M12.3637 4C12.3629 4 12.3622 4 12.3615 4V11.6381H20C19.9993 7.41966 16.5811 4 12.3637 4Z", fill: k }),
1769
- /* @__PURE__ */ t("path", { d: "M4.0022 4C4.00147 4 4.00073 4 4 4V11.6381H11.6386C11.6378 7.41966 8.2196 4 4.0022 4Z", fill: k }),
1768
+ /* @__PURE__ */ t("path", { d: "M12.3637 4C12.3629 4 12.3622 4 12.3615 4V11.6381H20C19.9993 7.41966 16.5811 4 12.3637 4Z", fill: S }),
1769
+ /* @__PURE__ */ t("path", { d: "M4.0022 4C4.00147 4 4.00073 4 4 4V11.6381H11.6386C11.6378 7.41966 8.2196 4 4.0022 4Z", fill: S }),
1770
1770
  /* @__PURE__ */ t(
1771
1771
  "path",
1772
1772
  {
1773
1773
  d: "M11.6364 12.3619C11.6371 12.3619 11.6378 12.3619 11.6386 12.3619V20H4C4.00073 15.7816 7.41898 12.3619 11.6364 12.3619Z",
1774
- fill: k
1774
+ fill: S
1775
1775
  }
1776
1776
  ),
1777
1777
  /* @__PURE__ */ t(
1778
1778
  "path",
1779
1779
  {
1780
1780
  d: "M19.9978 12.3619C19.9986 12.3619 19.9993 12.3619 20 12.3619V20H12.3615C12.3622 15.7816 15.7804 12.3619 19.9978 12.3619Z",
1781
- fill: k
1781
+ fill: S
1782
1782
  }
1783
1783
  )
1784
1784
  ] }),
@@ -2142,8 +2142,8 @@ const mr = 32, Pt = 24, Tt = 105, Lt = 24, Dt = 195, Ht = 44, Ot = 147, Qt = ()
2142
2142
  y && h && /* @__PURE__ */ t(T, { p: 2, children: y }),
2143
2143
  /* @__PURE__ */ t(T, { flex: 1, children: e }),
2144
2144
  p && /* @__PURE__ */ t(Q, { sx: ke.bottomLinkWrapper, spacing: 1, whiteSpace: "nowrap", children: Array.isArray(p) ? p.map((w, l) => {
2145
- const k = typeof w == "object" && "url" in w ? `$${w.url}-${l}` : l;
2146
- return /* @__PURE__ */ t(br, { link: w, NavLink: f, isCollapsed: a, sx: ke }, k);
2145
+ const S = typeof w == "object" && "url" in w ? `$${w.url}-${l}` : l;
2146
+ return /* @__PURE__ */ t(br, { link: w, NavLink: f, isCollapsed: a, sx: ke }, S);
2147
2147
  }) : /* @__PURE__ */ t(br, { link: p, NavLink: f, isCollapsed: a, sx: ke }) }),
2148
2148
  /* @__PURE__ */ t(JA, {}),
2149
2149
  /* @__PURE__ */ t(T, { display: "flex", justifyContent: "flex-end", children: /* @__PURE__ */ t(
@@ -2278,7 +2278,7 @@ const mr = 32, Pt = 24, Tt = 105, Lt = 24, Dt = 195, Ht = 44, Ot = 147, Qt = ()
2278
2278
  }, []), h = oe(() => {
2279
2279
  u(!0);
2280
2280
  }, []), w = oe(() => {
2281
- I((k) => !k);
2281
+ I((S) => !S);
2282
2282
  }, []), l = We(
2283
2283
  () => ({
2284
2284
  AppBar: e,
@@ -2802,7 +2802,7 @@ const an = (e, A) => {
2802
2802
  height: C = 152,
2803
2803
  width: u = 220
2804
2804
  }) => {
2805
- const [m, I] = W(!1), [B, h] = W(!1), [w, l] = W(!0), k = e?.toLowerCase(), E = !k?.endsWith(".pdf") && !k?.startsWith("blob:") && !k?.endsWith(".eml"), H = k?.endsWith(".pdf"), L = d ? 1 : 0.8, $ = c ? !0 : !w, S = NA(e) || NA(A), P = (E || H) && !S && $ && !B && !d && e, U = e?.split(".").pop()?.toLowerCase(), Y = r || e?.split("/").pop()?.split("?")[0] || "", K = () => S ? e1 : B ? ln : A || e || void 0, N = () => {
2805
+ const [m, I] = W(!1), [B, h] = W(!1), [w, l] = W(!0), S = e?.toLowerCase(), E = !S?.endsWith(".pdf") && !S?.startsWith("blob:") && !S?.endsWith(".eml"), H = S?.endsWith(".pdf"), L = d ? 1 : 0.8, $ = c ? !0 : !w, k = NA(e) || NA(A), P = (E || H) && !k && $ && !B && !d && e, U = e?.split(".").pop()?.toLowerCase(), Y = r || e?.split("/").pop()?.split("?")[0] || "", K = () => k ? e1 : B ? ln : A || e || void 0, N = () => {
2806
2806
  I((b) => !b);
2807
2807
  }, _ = () => {
2808
2808
  I(!1), f?.();
@@ -2812,14 +2812,14 @@ const an = (e, A) => {
2812
2812
  l(!1);
2813
2813
  };
2814
2814
  return /* @__PURE__ */ x(he, { children: [
2815
- !c && !n && /* @__PURE__ */ t(MA, { title: S ? Y : "", children: /* @__PURE__ */ x(
2815
+ !c && !n && /* @__PURE__ */ t(MA, { title: k ? Y : "", children: /* @__PURE__ */ x(
2816
2816
  T,
2817
2817
  {
2818
2818
  "data-test": "fileViewer",
2819
2819
  width: u,
2820
2820
  height: C,
2821
2821
  onClick: async () => {
2822
- if (S && e) {
2822
+ if (k && e) {
2823
2823
  const M = await (await fetch(e)).blob(), O = window.URL.createObjectURL(M), D = document.createElement("a");
2824
2824
  D.href = O, D.download = Y, D.target = "_blank", document.body.appendChild(D), D.click(), setTimeout(() => {
2825
2825
  document.body.removeChild(D), window.URL.revokeObjectURL(O);
@@ -2848,13 +2848,13 @@ const an = (e, A) => {
2848
2848
  onLoad: Ae,
2849
2849
  sx: {
2850
2850
  ...Ne.thumb,
2851
- objectFit: S ? "contain" : "cover",
2852
- padding: S ? "15%" : 0
2851
+ objectFit: k ? "contain" : "cover",
2852
+ padding: k ? "15%" : 0
2853
2853
  }
2854
2854
  },
2855
2855
  K()
2856
2856
  ),
2857
- S && /* @__PURE__ */ t(J, { sx: Ne.extension, variant: "body3", color: "black", children: U })
2857
+ k && /* @__PURE__ */ t(J, { sx: Ne.extension, variant: "body3", color: "black", children: U })
2858
2858
  ]
2859
2859
  }
2860
2860
  ) }),
@@ -3132,7 +3132,7 @@ const an = (e, A) => {
3132
3132
  ] }) }) : !e?.length && !A ? /* @__PURE__ */ t(SA, { sx: n, children: /* @__PURE__ */ t(YA, { severity: "info", children: r }) }) : /* @__PURE__ */ x(he, { children: [
3133
3133
  /* @__PURE__ */ t(SA, { sx: n, "data-test": i, "data-testid": s, children: e?.map(
3134
3134
  ({ Action: c, Collapse: p, collapseItems: f, collapseDefaultOpen: v, subtitle: y, key: C, active: u, Footer: m, Icon: I, onClick: B, tag: h, title: w }, l) => {
3135
- const k = `${C}-${l}-${w}`, E = l === e.length - 1;
3135
+ const S = `${C}-${l}-${w}`, E = l === e.length - 1;
3136
3136
  return /* @__PURE__ */ t(
3137
3137
  dn,
3138
3138
  {
@@ -3150,7 +3150,7 @@ const an = (e, A) => {
3150
3150
  tag: h,
3151
3151
  variant: o
3152
3152
  },
3153
- k
3153
+ S
3154
3154
  );
3155
3155
  }
3156
3156
  ) }),
@@ -3547,7 +3547,7 @@ const an = (e, A) => {
3547
3547
  position: v = "static",
3548
3548
  elevation: y = 0
3549
3549
  }) => {
3550
- const { breakpoints: C } = fe(), { closeMenu: u, isMenuOpen: m, anchorMenu: I, openMenu: B } = A1(), { menuItems: h, ...w } = i || {}, l = Je(C.down("sm")), k = Je(C.between("sm", "md")), E = l || k, H = {
3550
+ const { breakpoints: C } = fe(), { closeMenu: u, isMenuOpen: m, anchorMenu: I, openMenu: B } = A1(), { menuItems: h, ...w } = i || {}, l = Je(C.down("sm")), S = Je(C.between("sm", "md")), E = l || S, H = {
3551
3551
  logoContainer: {
3552
3552
  a: {
3553
3553
  display: "flex"
@@ -3624,12 +3624,12 @@ const an = (e, A) => {
3624
3624
  if (Ye(L)) {
3625
3625
  if (L.key)
3626
3626
  return L;
3627
- const S = `${h}-${$}`;
3628
- return XA(L, { key: S });
3627
+ const k = `${h}-${$}`;
3628
+ return XA(L, { key: k });
3629
3629
  }
3630
3630
  if (L && typeof L == "object" && "url" in L) {
3631
- const { url: S, label: P, icon: U, active: Y, end: K, state: N } = L, _ = `${S}-${P}-${$}`;
3632
- return /* @__PURE__ */ t(Dr, { sx: H.menuItem, onClick: u, children: /* @__PURE__ */ x(er, { url: S, component: o, active: Y, end: K, state: N, children: [
3631
+ const { url: k, label: P, icon: U, active: Y, end: K, state: N } = L, _ = `${k}-${P}-${$}`;
3632
+ return /* @__PURE__ */ t(Dr, { sx: H.menuItem, onClick: u, children: /* @__PURE__ */ x(er, { url: k, component: o, active: Y, end: K, state: N, children: [
3633
3633
  U && /* @__PURE__ */ t(Hr, { children: U }),
3634
3634
  P && /* @__PURE__ */ t(Ee, { children: P })
3635
3635
  ] }, _) }, _);
@@ -4791,7 +4791,7 @@ const an = (e, A) => {
4791
4791
  value: m,
4792
4792
  variant: I = "vertical"
4793
4793
  }, B) => {
4794
- const [h, w] = W(null), { t: l } = tr(), { palette: k } = fe(), E = I === "vertical", H = a || A, L = LA(null), $ = LA(null), S = m !== void 0 ? m : h, P = Rn(S);
4794
+ const [h, w] = W(null), { t: l } = tr(), { palette: S } = fe(), E = I === "vertical", H = a || A, L = LA(null), $ = LA(null), k = m !== void 0 ? m : h, P = Rn(k);
4795
4795
  B1(B, () => {
4796
4796
  const N = $.current;
4797
4797
  return N.reset = () => {
@@ -4819,9 +4819,9 @@ const an = (e, A) => {
4819
4819
  },
4820
4820
  sx: {
4821
4821
  "&:hover, &:focus": {
4822
- borderColor: k.primary.main
4822
+ borderColor: S.primary.main
4823
4823
  },
4824
- border: `1px dashed ${o ? k.error.main : k.divider}`,
4824
+ border: `1px dashed ${o ? S.error.main : S.divider}`,
4825
4825
  borderRadius: 1,
4826
4826
  cursor: "pointer",
4827
4827
  height: Bn(d, I),
@@ -4845,7 +4845,7 @@ const an = (e, A) => {
4845
4845
  f || /* @__PURE__ */ t(mn, { sx: { height: 40, width: 40 } }),
4846
4846
  P ? /* @__PURE__ */ x(he, { children: [
4847
4847
  /* @__PURE__ */ x(J, { variant: "body2", color: "textSecondary", children: [
4848
- S?.length,
4848
+ k?.length,
4849
4849
  " ",
4850
4850
  i?.files || l("files")
4851
4851
  ] }),
@@ -4958,8 +4958,8 @@ const an = (e, A) => {
4958
4958
  },
4959
4959
  children: [
4960
4960
  r?.map(
4961
- ({ id: f, title: v, subtitle: y, image: C, thumbnail: u, secondaryAction: m, chipLabel: I, chipColor: B, onClick: h, icon: w, Avatar: l }, k) => {
4962
- const E = `key-${k}-${v}-${f}`, H = !!C?.toLowerCase()?.endsWith(".pdf"), L = Mr(C), $ = Mr(u), S = NA(C), P = h ? "none" : void 0, U = a || !!w || !L || S, Y = !!h || !!(!h && !a && (u || C)), K = c === E, G = ($ ? u : "") || (L ? C : "") || "";
4961
+ ({ id: f, title: v, subtitle: y, image: C, thumbnail: u, secondaryAction: m, chipLabel: I, chipColor: B, onClick: h, icon: w, Avatar: l }, S) => {
4962
+ const E = `key-${S}-${v}-${f}`, H = !!C?.toLowerCase()?.endsWith(".pdf"), L = Mr(C), $ = Mr(u), k = NA(C), P = h ? "none" : void 0, U = a || !!w || !L || k, Y = !!h || !!(!h && !a && (u || C)), K = c === E, G = ($ ? u : "") || (L ? C : "") || "";
4963
4963
  return /* @__PURE__ */ x(
4964
4964
  Ie,
4965
4965
  {
@@ -4972,7 +4972,7 @@ const an = (e, A) => {
4972
4972
  ...y && { subtitle: y },
4973
4973
  ...u && { thumbnail: u },
4974
4974
  ...v && { thumbnail: u },
4975
- isFile: S,
4975
+ isFile: k,
4976
4976
  isPdf: H
4977
4977
  }), Y && !K && !h && p(E);
4978
4978
  },
@@ -5022,17 +5022,17 @@ const an = (e, A) => {
5022
5022
  children: /* @__PURE__ */ t(
5023
5023
  Se,
5024
5024
  {
5025
- src: S ? e1 : G,
5025
+ src: k ? e1 : G,
5026
5026
  variant: "rounded",
5027
5027
  sx: { marginRight: Ze },
5028
5028
  slotProps: {
5029
5029
  img: {
5030
5030
  sx: {
5031
- ...S && { padding: "15%" }
5031
+ ...k && { padding: "15%" }
5032
5032
  }
5033
5033
  }
5034
5034
  },
5035
- children: !S && (w || typeof v == "string" && (v || "")?.charAt(0).toUpperCase())
5035
+ children: !k && (w || typeof v == "string" && (v || "")?.charAt(0).toUpperCase())
5036
5036
  }
5037
5037
  )
5038
5038
  }
@@ -5226,12 +5226,12 @@ const an = (e, A) => {
5226
5226
  width: h,
5227
5227
  sx: w,
5228
5228
  size: l = "small",
5229
- disableCloseOnSelect: k = !0,
5229
+ disableCloseOnSelect: S = !0,
5230
5230
  multiple: E = !0,
5231
5231
  options: H = [],
5232
5232
  slotProps: L,
5233
5233
  ...$
5234
- }, S) => {
5234
+ }, k) => {
5235
5235
  const [P, U] = W(!1), [Y, K] = W(""), N = y || Y, _ = e === "chip", G = Array.isArray(a) ? !!a.length : a != null, Ae = Pn(a, E);
5236
5236
  return /* @__PURE__ */ t(
5237
5237
  h1,
@@ -5242,15 +5242,15 @@ const an = (e, A) => {
5242
5242
  value: Ae,
5243
5243
  options: H,
5244
5244
  loading: u,
5245
- ref: S,
5245
+ ref: k,
5246
5246
  size: l,
5247
- disableCloseOnSelect: k,
5247
+ disableCloseOnSelect: S,
5248
5248
  onChange: (b, M, O, D) => {
5249
5249
  if (M === null) {
5250
5250
  A?.(b, E ? [] : null, O, D);
5251
5251
  return;
5252
5252
  }
5253
- A?.(b, M, O, D), (!k || !E) && U(!1);
5253
+ A?.(b, M, O, D), (!S || !E) && U(!1);
5254
5254
  },
5255
5255
  getLimitTagsText: Tn(e),
5256
5256
  inputValue: N,
@@ -5666,7 +5666,8 @@ const an = (e, A) => {
5666
5666
  ] })
5667
5667
  ]
5668
5668
  }
5669
- ), uo = ({
5669
+ );
5670
+ function uo({
5670
5671
  label: e,
5671
5672
  value: A,
5672
5673
  onChange: r,
@@ -5678,32 +5679,32 @@ const an = (e, A) => {
5678
5679
  separatorBetweenLabelAndOptionSelected: d = ":",
5679
5680
  multiple: c = !1,
5680
5681
  size: p = "medium"
5681
- }) => {
5682
- const [f, v] = W(() => c ? A || [] : A), y = c ? A?.length > 0 : !!A, { anchorMenu: C, openMenu: u, isMenuOpen: m, closeMenu: I } = A1(), { t: B } = tr(), h = Array.isArray(n), w = () => {
5682
+ }) {
5683
+ const [f, v] = W(() => c ? A || [] : A), y = c ? A?.length > 0 : A != null, { anchorMenu: C, openMenu: u, isMenuOpen: m, closeMenu: I } = A1(), { t: B } = tr(), h = Array.isArray(n), w = () => {
5683
5684
  (c || f !== void 0) && r?.(f), I();
5684
5685
  }, l = () => {
5685
5686
  if (c) {
5686
- const S = [];
5687
- v(S), r?.(S);
5687
+ const k = [];
5688
+ v(k), r?.(k);
5688
5689
  } else
5689
5690
  v(void 0), r?.(void 0);
5690
5691
  I();
5691
- }, k = (S) => {
5692
+ }, S = (k) => {
5692
5693
  if (h) {
5693
- u(S);
5694
+ u(k);
5694
5695
  return;
5695
5696
  }
5696
5697
  if (!h) {
5697
- const P = A ? void 0 : n?.value;
5698
- r?.(c ? P ? [P] : [] : P);
5698
+ const P = A != null ? void 0 : n?.value;
5699
+ r?.(c ? P !== void 0 ? [P] : [] : P);
5699
5700
  }
5700
- }, E = (S) => {
5701
+ }, E = (k) => {
5701
5702
  if (c) {
5702
- const P = f || [], U = P.includes(S) ? P.filter((Y) => Y !== S) : [...P, S];
5703
+ const P = f || [], U = P.includes(k) ? P.filter((Y) => Y !== k) : [...P, k];
5703
5704
  v(U);
5704
5705
  } else
5705
- v(S);
5706
- }, H = (S) => c ? f?.includes(S) || !1 : f === S, L = (S) => h ? `${s ? `${s} ${d} ` : ""}${n.find((P) => P.value === S)?.label || ""}` : n?.label;
5706
+ v(k);
5707
+ }, H = (k) => c ? f?.includes(k) || !1 : f === k, L = (k) => h ? `${s ? `${s} ${d} ` : ""}${n.find((P) => P.value === k)?.label || ""}` : n?.label;
5707
5708
  return /* @__PURE__ */ x(he, { children: [
5708
5709
  /* @__PURE__ */ t(
5709
5710
  Te,
@@ -5712,19 +5713,19 @@ const an = (e, A) => {
5712
5713
  size: p,
5713
5714
  label: (() => {
5714
5715
  if (a && y) {
5715
- const P = (A || []).length;
5716
+ const k = A || [], P = Array.isArray(k) ? k.length : 1;
5716
5717
  return `${e || s}${c && P > 1 ? ` (${P})` : ""}`;
5717
5718
  }
5718
5719
  if (c && y) {
5719
- const S = A || [], P = S.length;
5720
+ const k = A || [], P = k.length;
5720
5721
  if (P === 1)
5721
- return L(S[0]) || e;
5722
+ return L(k[0]) || e;
5722
5723
  if (P > 1) {
5723
- const U = L(S[0]), Y = P - 1;
5724
- return `${U || S[0]}... (+${Y})`;
5724
+ const U = L(k[0]), Y = P - 1;
5725
+ return `${U || String(k[0])}... (+${Y})`;
5725
5726
  }
5726
5727
  }
5727
- return !c && A && h && L(A) || e;
5728
+ return !c && A !== void 0 && A !== null && h && L(A) || e;
5728
5729
  })(),
5729
5730
  variant: o,
5730
5731
  deleteIcon: h ? /* @__PURE__ */ t(
@@ -5738,7 +5739,7 @@ const an = (e, A) => {
5738
5739
  }
5739
5740
  }
5740
5741
  ) : void 0,
5741
- onClick: k,
5742
+ onClick: S,
5742
5743
  onDelete: h ? () => {
5743
5744
  } : void 0,
5744
5745
  color: y ? "active" : "default"
@@ -5762,11 +5763,11 @@ const an = (e, A) => {
5762
5763
  /* @__PURE__ */ t(Ee, { children: s }),
5763
5764
  /* @__PURE__ */ t(ue, { onClick: I, children: /* @__PURE__ */ t(_e, { fontSize: "small" }) })
5764
5765
  ] }),
5765
- n.map((S, P) => {
5766
- const U = `${S.id || S.value}-${P}`, Y = H(S.value);
5767
- return /* @__PURE__ */ x(Dr, { onClick: () => E(S.value), children: [
5766
+ n.map((k, P) => {
5767
+ const U = `${k.id || k.value}-${P}`, Y = H(k.value);
5768
+ return /* @__PURE__ */ x(Dr, { onClick: () => E(k.value), children: [
5768
5769
  /* @__PURE__ */ t(Hr, { children: c ? /* @__PURE__ */ t(cA, { disableRipple: !0, checked: Y, sx: { padding: 0 } }) : /* @__PURE__ */ t(E1, { disableRipple: !0, checked: Y, sx: { padding: 0 } }) }),
5769
- /* @__PURE__ */ t(Ee, { sx: { color: "text.secondary" }, children: S.label })
5770
+ /* @__PURE__ */ t(Ee, { sx: { color: "text.secondary" }, children: k.label })
5770
5771
  ] }, U);
5771
5772
  }),
5772
5773
  /* @__PURE__ */ x(Q, { component: "li", direction: "row", justifyContent: "flex-end", spacing: 1, marginTop: 1, children: [
@@ -5777,7 +5778,8 @@ const an = (e, A) => {
5777
5778
  }
5778
5779
  )
5779
5780
  ] });
5780
- }, fo = ({ children: e, permissions: A, disabledPermissions: r }) => {
5781
+ }
5782
+ const fo = ({ children: e, permissions: A, disabledPermissions: r }) => {
5781
5783
  const [n, o] = W(), i = We(
5782
5784
  () => ({
5783
5785
  disabledPermissions: r,
@@ -1,10 +1,12 @@
1
1
  import { ChipProps } from '@mui/material';
2
- type Option = {
2
+ import { ReactNode } from 'react';
3
+ export type OptionValue = string | number;
4
+ type Option<T = OptionValue> = {
3
5
  id?: string | number;
4
6
  label: string;
5
- value: string;
7
+ value: T;
6
8
  };
7
- interface ChipFilterBaseProps {
9
+ interface ChipFilterBaseProps<T = OptionValue> {
8
10
  /**
9
11
  * The label of the chip filter.
10
12
  */
@@ -29,7 +31,7 @@ interface ChipFilterBaseProps {
29
31
  * The options available for selection in the chip filter.
30
32
  * If "options" is not an array, it is considered a single option (toggle behavior).
31
33
  */
32
- options?: Option | Option[];
34
+ options?: Option<T> | Option<T>[];
33
35
  /**
34
36
  * Indicates if there should be a separator between the label menu and the options selected in the menu.
35
37
  * Defaults to ":"
@@ -40,7 +42,7 @@ interface ChipFilterBaseProps {
40
42
  */
41
43
  labelOnlyAfterSelection?: boolean;
42
44
  }
43
- export interface ChipFilterSingleProps extends ChipFilterBaseProps {
45
+ export interface ChipFilterSingleProps<T = OptionValue> extends ChipFilterBaseProps<T> {
44
46
  /**
45
47
  * Indicates if the chip filter allows multiple selections.
46
48
  */
@@ -48,14 +50,14 @@ export interface ChipFilterSingleProps extends ChipFilterBaseProps {
48
50
  /**
49
51
  * The value of the chip filter.
50
52
  */
51
- value?: string;
53
+ value?: T;
52
54
  /**
53
55
  * Callback function triggered when the value of the chip filter changes.
54
56
  * @param value
55
57
  */
56
- onChange?: (value?: string) => void;
58
+ onChange?: (value?: T) => void;
57
59
  }
58
- export interface ChipFilterMultipleProps extends ChipFilterBaseProps {
60
+ export interface ChipFilterMultipleProps<T = OptionValue> extends ChipFilterBaseProps<T> {
59
61
  /**
60
62
  * Indicates if the chip filter allows multiple selections.
61
63
  */
@@ -63,13 +65,14 @@ export interface ChipFilterMultipleProps extends ChipFilterBaseProps {
63
65
  /**
64
66
  * The value of the chip filter.
65
67
  */
66
- value?: string[];
68
+ value?: T[];
67
69
  /**
68
70
  * Callback function triggered when the value of the chip filter changes.
69
71
  * @param value
70
72
  */
71
- onChange?: (value: string[]) => void;
73
+ onChange?: (value: T[]) => void;
72
74
  }
73
- export type ChipFilterProps = ChipFilterSingleProps | ChipFilterMultipleProps;
74
- declare const ChipFilter: ({ label, value, onChange, options, variant, disabled, labelMenu, labelOnlyAfterSelection, separatorBetweenLabelAndOptionSelected, multiple, size, }: ChipFilterProps) => import("@emotion/react/jsx-runtime").JSX.Element;
75
+ export type ChipFilterProps<T = OptionValue> = ChipFilterSingleProps<T> | ChipFilterMultipleProps<T>;
76
+ declare function ChipFilter<T = OptionValue>(props: ChipFilterSingleProps<T>): ReactNode;
77
+ declare function ChipFilter<T = OptionValue>(props: ChipFilterMultipleProps<T>): ReactNode;
75
78
  export default ChipFilter;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@tracktor/design-system",
3
3
  "description": "Tracktor Design System",
4
4
  "sideEffects": false,
5
- "version": "4.8.1",
5
+ "version": "4.8.2",
6
6
  "license": "ISC",
7
7
  "type": "module",
8
8
  "types": "./dist/src/main.d.ts",