prometeo-design-system 4.0.0 → 4.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/{CardProfile-y9Knsg26.js → CardProfile-C1F83KJV.js} +1 -1
  2. package/dist/CardProfile.es.js +1 -1
  3. package/dist/{DatePicker-6eb-0Ns5.js → DatePicker-QuBgR5DQ.js} +799 -794
  4. package/dist/DatePicker.es.js +1 -1
  5. package/dist/DialogModal.es.js +25 -22
  6. package/dist/PlainTooltip.d.ts +6 -0
  7. package/dist/PlainTooltip.es.js +72 -0
  8. package/dist/PyrionLayout.es.js +791 -742
  9. package/dist/RecurrentDatePicker.es.js +1 -1
  10. package/dist/RecurrentDatePickerRRule.es.js +1 -1
  11. package/dist/Scrollable.es.js +1 -1
  12. package/dist/Select.es.js +524 -524
  13. package/dist/SelectSearch.es.js +44 -43
  14. package/dist/TabLinks.d.ts +2 -0
  15. package/dist/TabLinks.es.js +81 -52
  16. package/dist/{badge-B1IK_-i5.js → badge-CbqYNrl4.js} +28 -28
  17. package/dist/components/DatePicker/DatePicker.d.ts +1 -0
  18. package/dist/components/NavigationDrawer/NavigationDrawer.d.ts +2 -1
  19. package/dist/components/NavigationDrawer/NavigationDrawerActionItem.d.ts +4 -3
  20. package/dist/components/NavigationDrawer/NavigationDrawerActions.d.ts +3 -4
  21. package/dist/components/NavigationDrawer/NavigationDrawerItemBase.d.ts +1 -0
  22. package/dist/components/NavigationDrawer/NavigationDrawerLinkItem.d.ts +3 -2
  23. package/dist/components/NavigationDrawer/NavigationDrawerNavlinks.d.ts +2 -2
  24. package/dist/components/PlainTooltip/PlainTooltip.d.ts +11 -0
  25. package/dist/components/PyrionNavigationDrawer/PLContent.d.ts +4 -4
  26. package/dist/components/PyrionNavigationDrawer/PLFooter.d.ts +3 -2
  27. package/dist/components/PyrionNavigationDrawer/PLSidebarContent.d.ts +2 -2
  28. package/dist/components/PyrionNavigationDrawer/PLayoutBase.d.ts +7 -6
  29. package/dist/components/PyrionNavigationDrawer/PyrionLayout.d.ts +15 -12
  30. package/dist/components/PyrionNavigationDrawer/index.d.ts +2 -2
  31. package/dist/components/Select/Select.d.ts +1 -0
  32. package/dist/components/TabLinks/TabLinks.d.ts +10 -1
  33. package/dist/components/TabSwitch/TabSwitch.d.ts +2 -0
  34. package/dist/exports/PlainTooltip.d.ts +2 -0
  35. package/dist/exports/TabLinks.d.ts +1 -0
  36. package/dist/hooks/useDevice.d.ts +1 -0
  37. package/dist/index.d.ts +0 -1
  38. package/dist/prometeo-design-system.es.js +50 -52
  39. package/dist/styles.css +1 -1
  40. package/dist/useDevice-vwn4GLwK.js +16 -0
  41. package/dist/useDevice.es.js +2 -11
  42. package/package.json +6 -6
  43. package/src/styles/base.css +1 -0
  44. package/dist/SwipeContainer.d.ts +0 -4
  45. package/dist/SwipeContainer.es.js +0 -185
  46. package/dist/components/SwipeContainer/SwipeContainer.d.ts +0 -19
  47. package/dist/exports/SwipeContainer.d.ts +0 -1
@@ -1,4 +1,4 @@
1
- import { D as r, D as t } from "./DatePicker-6eb-0Ns5.js";
1
+ import { D as r, D as t } from "./DatePicker-QuBgR5DQ.js";
2
2
  export {
3
3
  r as DatePicker,
4
4
  t as default
@@ -1,30 +1,30 @@
1
1
  import { j as o } from "./jsx-runtime-GkKLlHH4.js";
2
- import { forwardRef as h, memo as s, useState as D, useRef as p, useCallback as n, useImperativeHandle as R } from "react";
2
+ import { forwardRef as h, memo as r, useState as D, useRef as p, useCallback as n, useImperativeHandle as R } from "react";
3
3
  import { c as j } from "./cn-B6yFEsav.js";
4
- const C = h(
4
+ const b = h(
5
5
  ({ children: e, onClose: t, className: a }, i) => {
6
- const [l, r] = D(!1), [c, f] = D(null), x = p(t), u = p(c);
6
+ const [s, l] = D(!1), [c, f] = D(null), x = p(t), u = p(c);
7
7
  x.current = t, u.current = c;
8
8
  const m = n((g) => {
9
- f(g ?? null), r(!0);
9
+ f(g ?? null), l(!0);
10
10
  }, []), d = n(() => {
11
- r(!1), x.current?.(u.current), setTimeout(() => f(null), 300);
11
+ l(!1), x.current?.(u.current), setTimeout(() => f(null), 300);
12
12
  }, []);
13
13
  return R(
14
14
  i,
15
15
  () => ({
16
16
  open: m,
17
17
  close: d,
18
- isOpen: l,
18
+ isOpen: s,
19
19
  getContext: () => u.current
20
20
  }),
21
- [m, d, l]
22
- ), /* @__PURE__ */ o.jsx(o.Fragment, { children: l && /* @__PURE__ */ o.jsx(
21
+ [m, d, s]
22
+ ), /* @__PURE__ */ o.jsx(o.Fragment, { children: s && /* @__PURE__ */ o.jsx(
23
23
  "div",
24
24
  {
25
25
  className: "fixed inset-0 z-50 flex items-center justify-center bg-black/30 backdrop-blur-[1.5px]",
26
26
  onClick: d,
27
- children: /* @__PURE__ */ o.jsx(
27
+ children: /* @__PURE__ */ o.jsxs(
28
28
  "div",
29
29
  {
30
30
  className: j(
@@ -32,41 +32,44 @@ const C = h(
32
32
  a
33
33
  ),
34
34
  onClick: (g) => g.stopPropagation(),
35
- children: typeof e == "function" ? e(c) : e
35
+ children: [
36
+ /* @__PURE__ */ o.jsx("div", { className: "absolute bg-transparent -inset-4 z-[-1]" }),
37
+ typeof e == "function" ? e(c) : e
38
+ ]
36
39
  }
37
40
  )
38
41
  }
39
42
  ) });
40
43
  }
41
44
  );
42
- C.displayName = "Dialog";
43
- const b = s(({ children: e, className: t }) => /* @__PURE__ */ o.jsx("div", { className: t, children: /* @__PURE__ */ o.jsx("div", { className: j("flex flex-col gap-4 h-full"), children: e }) }));
44
- b.displayName = "DialogContent";
45
- const N = s(({ children: e, className: t }) => /* @__PURE__ */ o.jsx("h1", { className: t, children: e }));
45
+ b.displayName = "Dialog";
46
+ const C = r(({ children: e, className: t }) => /* @__PURE__ */ o.jsx("div", { className: t, children: /* @__PURE__ */ o.jsx("div", { className: j("flex flex-col gap-4 h-full"), children: e }) }));
47
+ C.displayName = "DialogContent";
48
+ const N = r(({ children: e, className: t }) => /* @__PURE__ */ o.jsx("h1", { className: t, children: e }));
46
49
  N.displayName = "DialogTitle";
47
- const v = s(({ children: e, className: t }) => /* @__PURE__ */ o.jsx("div", { className: t, children: e }));
50
+ const v = r(({ children: e, className: t }) => /* @__PURE__ */ o.jsx("div", { className: t, children: e }));
48
51
  v.displayName = "DialogHeader";
49
- const y = s(({ children: e, className: t }) => /* @__PURE__ */ o.jsx("div", { className: t, children: e }));
52
+ const y = r(({ children: e, className: t }) => /* @__PURE__ */ o.jsx("div", { className: t, children: e }));
50
53
  y.displayName = "DialogFooter";
51
- const k = Object.assign(C, {
52
- Content: b,
54
+ const k = Object.assign(b, {
55
+ Content: C,
53
56
  Header: v,
54
57
  Footer: y,
55
58
  Title: N
56
59
  });
57
60
  k.displayName = "DialogModal";
58
61
  const H = () => {
59
- const e = p(null), t = n((r) => {
60
- e.current?.open(r);
62
+ const e = p(null), t = n((l) => {
63
+ e.current?.open(l);
61
64
  }, []), a = n(() => {
62
65
  e.current?.close();
63
- }, []), i = n(() => e.current?.isOpen ?? !1, []), l = n(() => e.current?.getContext() ?? null, []);
66
+ }, []), i = n(() => e.current?.isOpen ?? !1, []), s = n(() => e.current?.getContext() ?? null, []);
64
67
  return {
65
68
  ref: e,
66
69
  open: t,
67
70
  close: a,
68
71
  isOpen: i,
69
- getContext: l
72
+ getContext: s
70
73
  };
71
74
  };
72
75
  export {
@@ -0,0 +1,6 @@
1
+ export * from './exports/PlainTooltip'
2
+ export {}
3
+ import PrometeoDesignSystem from './exports/PlainTooltip'
4
+ export default PrometeoDesignSystem
5
+ export * from './exports/PlainTooltip'
6
+ export {}
@@ -0,0 +1,72 @@
1
+ import { j as y } from "./jsx-runtime-GkKLlHH4.js";
2
+ import { c as _ } from "./cn-B6yFEsav.js";
3
+ import { memo as j, useRef as v, useCallback as A, useEffect as a } from "react";
4
+ import { createPortal as C } from "react-dom";
5
+ const G = ({ title: w, children: p, delayToShow: x = 500, delayToClose: R = 1e3, className: B, attachToParent: d = !1, disabled: D = !1 }) => {
6
+ const s = v(null), r = v(null), n = v(null), o = A(() => {
7
+ if (typeof window > "u")
8
+ return;
9
+ const e = r.current, i = s.current;
10
+ if (!e || !i)
11
+ return;
12
+ const l = window.getComputedStyle(e).display, c = e.style.display, m = e.style.visibility, f = e.style.translate, h = l === "none";
13
+ h && (e.style.visibility = "hidden", e.style.display = "block"), f && e.style.removeProperty("translate");
14
+ const E = i.getBoundingClientRect();
15
+ d ? (e.style.removeProperty("position"), e.style.removeProperty("left"), e.style.removeProperty("top")) : (e.style.setProperty("position", "fixed"), e.style.setProperty("left", `${E.right}px`), e.style.setProperty("top", `${E.bottom}px`));
16
+ const u = e.getBoundingClientRect(), I = window.innerWidth, N = window.innerHeight, b = Math.max(0, 0 - u.left), M = Math.max(0, u.right - I), L = Math.max(0, 0 - u.top), P = Math.max(0, u.bottom - N), O = b > 0 ? b + 16 : M > 0 ? -(M + 16) : 0, T = L > 0 ? L + 16 : P > 0 ? -(P + 16) : 0;
17
+ O === 0 && T === 0 ? e.style.removeProperty("translate") : e.style.setProperty("translate", `${O}px ${T}px`), h && (e.style.display = c, e.style.visibility = m);
18
+ }, [d]);
19
+ if (a(() => {
20
+ const t = s.current, e = r.current;
21
+ if (!t || !e)
22
+ return;
23
+ const i = (m, f) => {
24
+ n.current = setTimeout(() => {
25
+ f();
26
+ }, m);
27
+ }, l = () => {
28
+ n.current && clearTimeout(n.current), o(), i(x, () => {
29
+ r.current?.classList.add("visible");
30
+ });
31
+ }, c = () => {
32
+ n.current && clearTimeout(n.current), i(R, () => {
33
+ r.current?.classList.remove("visible");
34
+ });
35
+ };
36
+ return t.addEventListener("mouseenter", l), t.addEventListener("mouseleave", c), () => {
37
+ t.removeEventListener("mouseenter", l), t.removeEventListener("mouseleave", c);
38
+ };
39
+ }, [x, R, o]), a(() => {
40
+ o();
41
+ }, [o, w]), a(() => {
42
+ if (typeof window > "u")
43
+ return;
44
+ const t = () => {
45
+ r.current && r.current.classList.contains("visible") && o();
46
+ };
47
+ return window.addEventListener("resize", t), window.addEventListener("scroll", t, !0), () => {
48
+ window.removeEventListener("resize", t), window.removeEventListener("scroll", t, !0);
49
+ };
50
+ }, [o]), a(() => () => {
51
+ n.current && clearTimeout(n.current);
52
+ }, []), D) return p;
53
+ const g = /* @__PURE__ */ y.jsx("span", { ref: r, className: _(
54
+ "plain-tooltip ",
55
+ "absolute z-999",
56
+ "bg-neutral-weak-default px-2 py-1 rounded-lg w-max",
57
+ "text-neutral-strong-default prometeo-fonts-body-small ",
58
+ B,
59
+ r.current?.innerText?.length && r.current?.innerText?.length > Math.floor(450 / 10) ? "w-max line-clamp-1" : "max-w-[200px] line-clamp-none"
60
+ ), children: w });
61
+ return !d && typeof document < "u" ? /* @__PURE__ */ y.jsxs("div", { ref: s, children: [
62
+ p,
63
+ C(g, document.body)
64
+ ] }) : /* @__PURE__ */ y.jsxs("div", { ref: s, children: [
65
+ p,
66
+ g
67
+ ] });
68
+ }, $ = j(G);
69
+ $.displayName = "PlainTooltip";
70
+ export {
71
+ $ as default
72
+ };