prometeo-design-system 4.2.4 → 4.3.0

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 CHANGED
@@ -1,5 +1,5 @@
1
1
  import { j as t } from "./jsx-runtime-GkKLlHH4.js";
2
- import { g as v } from "./useLabelBackground-BDIHUdND.js";
2
+ import { g as v } from "./useLabelBackground-D5SzHhl_.js";
3
3
  import { c as x } from "./cn-B6yFEsav.js";
4
4
  import { useState as C, useRef as u, useLayoutEffect as N } from "react";
5
5
  import { UserAvatar as y } from "./Icons/UserAvatar.es.js";
@@ -1,78 +1,84 @@
1
1
  import { j as o } from "./jsx-runtime-GkKLlHH4.js";
2
- import { forwardRef as h, memo as r, useState as D, useRef as p, useCallback as n, useImperativeHandle as R } from "react";
2
+ import { forwardRef as y, memo as r, useState as D, useRef as x, useCallback as l, useImperativeHandle as k } from "react";
3
3
  import { c as j } from "./cn-B6yFEsav.js";
4
- const b = h(
5
- ({ children: e, onClose: t, className: a }, i) => {
6
- const [s, l] = D(!1), [c, f] = D(null), x = p(t), u = p(c);
7
- x.current = t, u.current = c;
8
- const m = n((g) => {
9
- f(g ?? null), l(!0);
10
- }, []), d = n(() => {
11
- l(!1), x.current?.(u.current), setTimeout(() => f(null), 300);
4
+ const C = y(
5
+ ({ children: e, onClose: t, className: c }, i) => {
6
+ const [n, s] = D(!1), [u, g] = D(null), f = x(t), p = x(u);
7
+ f.current = t, p.current = u;
8
+ const m = l((a) => {
9
+ g(a ?? null), s(!0);
10
+ }, []), d = l(() => {
11
+ s(!1), f.current?.(p.current), setTimeout(() => g(null), 300);
12
12
  }, []);
13
- return R(
13
+ return k(
14
14
  i,
15
15
  () => ({
16
16
  open: m,
17
17
  close: d,
18
- isOpen: s,
19
- getContext: () => u.current
18
+ isOpen: n,
19
+ getContext: () => p.current
20
20
  }),
21
- [m, d, s]
22
- ), /* @__PURE__ */ o.jsx(o.Fragment, { children: s && /* @__PURE__ */ o.jsx(
21
+ [m, d, n]
22
+ ), /* @__PURE__ */ o.jsx(o.Fragment, { children: n && /* @__PURE__ */ o.jsxs(
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.jsxs(
28
- "div",
29
- {
30
- className: j(
31
- "bg-neutral-default-default w-3/4 h-3/4 xl:w-3/4 xl:h-10/12 rounded-lg shadow-lg border-neutral-strong-default border relative p-6",
32
- a
33
- ),
34
- onClick: (g) => g.stopPropagation(),
35
- children: [
36
- /* @__PURE__ */ o.jsx("div", { className: "absolute bg-transparent -inset-4 z-[-1]" }),
37
- typeof e == "function" ? e(c) : e
38
- ]
39
- }
40
- )
27
+ children: [
28
+ /* @__PURE__ */ o.jsx(
29
+ "div",
30
+ {
31
+ onClick: (a) => a.stopPropagation(),
32
+ className: "absolute bg-transparent z-[-1] w-[calc(75%+10px)] h-[calc(75%+10px)] xl:w-[calc(75%+30px)] xl:h-[calc(83.33%+30px)] top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 "
33
+ }
34
+ ),
35
+ /* @__PURE__ */ o.jsx(
36
+ "div",
37
+ {
38
+ onClick: (a) => a.stopPropagation(),
39
+ className: j(
40
+ "bg-neutral-default-default w-3/4 h-3/4 xl:w-3/4 xl:h-10/12 rounded-lg shadow-lg border-neutral-strong-default border relative p-6",
41
+ c
42
+ ),
43
+ children: typeof e == "function" ? e(u) : e
44
+ }
45
+ )
46
+ ]
41
47
  }
42
48
  ) });
43
49
  }
44
50
  );
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";
51
+ C.displayName = "Dialog";
52
+ const b = 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 }) }));
53
+ b.displayName = "DialogContent";
48
54
  const N = r(({ children: e, className: t }) => /* @__PURE__ */ o.jsx("h1", { className: t, children: e }));
49
55
  N.displayName = "DialogTitle";
56
+ const h = r(({ children: e, className: t }) => /* @__PURE__ */ o.jsx("div", { className: t, children: e }));
57
+ h.displayName = "DialogHeader";
50
58
  const v = r(({ children: e, className: t }) => /* @__PURE__ */ o.jsx("div", { className: t, children: e }));
51
- v.displayName = "DialogHeader";
52
- const y = r(({ children: e, className: t }) => /* @__PURE__ */ o.jsx("div", { className: t, children: e }));
53
- y.displayName = "DialogFooter";
54
- const k = Object.assign(b, {
55
- Content: C,
56
- Header: v,
57
- Footer: y,
59
+ v.displayName = "DialogFooter";
60
+ const w = Object.assign(C, {
61
+ Content: b,
62
+ Header: h,
63
+ Footer: v,
58
64
  Title: N
59
65
  });
60
- k.displayName = "DialogModal";
66
+ w.displayName = "DialogModal";
61
67
  const H = () => {
62
- const e = p(null), t = n((l) => {
63
- e.current?.open(l);
64
- }, []), a = n(() => {
68
+ const e = x(null), t = l((s) => {
69
+ e.current?.open(s);
70
+ }, []), c = l(() => {
65
71
  e.current?.close();
66
- }, []), i = n(() => e.current?.isOpen ?? !1, []), s = n(() => e.current?.getContext() ?? null, []);
72
+ }, []), i = l(() => e.current?.isOpen ?? !1, []), n = l(() => e.current?.getContext() ?? null, []);
67
73
  return {
68
74
  ref: e,
69
75
  open: t,
70
- close: a,
76
+ close: c,
71
77
  isOpen: i,
72
- getContext: s
78
+ getContext: n
73
79
  };
74
80
  };
75
81
  export {
76
- k as default,
82
+ w as default,
77
83
  H as useDialogControl
78
84
  };
package/dist/Input.es.js CHANGED
@@ -2,7 +2,7 @@ import { j as t } from "./jsx-runtime-GkKLlHH4.js";
2
2
  import { c as e } from "./cn-B6yFEsav.js";
3
3
  import { memo as q, forwardRef as V, useState as F } from "react";
4
4
  import ee from "./Spinner.es.js";
5
- import { u as te } from "./useLabelBackground-BDIHUdND.js";
5
+ import { u as te } from "./useLabelBackground-D5SzHhl_.js";
6
6
  import { H as re } from "./HelperComponent-ljsn0xD6.js";
7
7
  import { EyeVisibility as oe } from "./Icons/EyeVisibility.es.js";
8
8
  import { EyeVisibilityOff as se } from "./Icons/EyeVisibilityOff.es.js";
@@ -1,50 +1,57 @@
1
1
  import { j as e } from "./jsx-runtime-GkKLlHH4.js";
2
+ import { useCallback as h } from "react";
2
3
  import { c as o } from "./cn-B6yFEsav.js";
3
- import x from "./Avatar.es.js";
4
- import p from "./Button.es.js";
5
- const v = ({ user: i, body: t, date: a, actions: s, isNew: d, className: m, metadata: r }) => {
6
- const f = typeof t == "function" ? t(r) : t, c = a instanceof Date ? `${a.toLocaleDateString("es-AR", { day: "2-digit", month: "2-digit", year: "numeric" })} a las ${a.toLocaleTimeString("es-AR", { hour: "2-digit", minute: "2-digit", hour12: !1 })}` : a;
7
- return /* @__PURE__ */ e.jsxs("article", { className: o("flex flex-col gap-3 p-3 rounded-md bg-neutral-default-default ", m), children: [
8
- /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
4
+ import b from "./Avatar.es.js";
5
+ import j from "./Button.es.js";
6
+ const z = ({ user: m, body: s, date: a, actions: r, read: d, className: f, metadata: t, onClick: i }) => {
7
+ const c = typeof s == "function" ? s(t) : s, u = a instanceof Date ? `${a.toLocaleDateString("es-AR", { day: "2-digit", month: "2-digit", year: "numeric" })} a las ${a.toLocaleTimeString("es-AR", { hour: "2-digit", minute: "2-digit", hour12: !1 })}` : a, x = h(
8
+ () => {
9
+ i?.(t);
10
+ },
11
+ [i, t]
12
+ );
13
+ return /* @__PURE__ */ e.jsxs("article", { className: o("flex flex-col gap-3 p-3 rounded-md bg-neutral-default-default ", f), onClick: x, children: [
14
+ /* @__PURE__ */ e.jsxs("div", { className: o("flex flex-col gap-2", i && "cursor-pointer"), children: [
9
15
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-start w-full", children: [
10
16
  /* @__PURE__ */ e.jsxs("div", { className: " relative min-w-max", children: [
11
- d && /* @__PURE__ */ e.jsx("div", { className: "size-3 border border-neutral-default bg-(--pyrion-orange-500) rounded-full absolute top-0 left-0 z-20" }),
17
+ !d && /* @__PURE__ */ e.jsx("div", { className: "size-3 border border-neutral-default bg-(--pyrion-orange-500) rounded-full absolute top-0 left-0 -translate-x-1/2 -translate-y-1/2 z-10" }),
12
18
  /* @__PURE__ */ e.jsx(
13
- x,
19
+ b,
14
20
  {
15
- imageUrl: i.profile_picture,
16
- fallbackText: i.name,
21
+ imageUrl: m.profile_picture,
22
+ fallbackText: m.name,
17
23
  sizeFallback: "xs",
18
24
  sizeImage: "xs"
19
25
  }
20
26
  )
21
27
  ] }),
22
- /* @__PURE__ */ e.jsx("div", { className: "text-neutral-default-default prometeo-fonts-body-medium", children: f })
28
+ /* @__PURE__ */ e.jsx("div", { className: "text-neutral-default-default prometeo-fonts-body-medium", children: c })
23
29
  ] }),
24
- /* @__PURE__ */ e.jsx("p", { className: "text-neutral-medium-default prometeo-fonts-body-xsmall text-right", children: c })
30
+ /* @__PURE__ */ e.jsx("p", { className: "text-neutral-medium-default prometeo-fonts-body-xsmall text-right", children: u })
25
31
  ] }),
26
- /* @__PURE__ */ e.jsx("div", { className: "flex gap-2 w-full", children: s?.map((l, n) => {
32
+ /* @__PURE__ */ e.jsx("div", { className: "flex gap-2 w-full", children: r?.map((l, n) => {
27
33
  if (l.hidden)
28
34
  return null;
29
- const u = () => {
30
- l.onClick(r);
35
+ const p = (g) => {
36
+ g.stopPropagation(), l.onClick?.(t);
31
37
  };
32
38
  return /* @__PURE__ */ e.jsx(
33
- p,
39
+ j,
34
40
  {
35
- className: o("flex-1 h-8", n === 0 && s.length > 1 && "order-2"),
41
+ className: o("flex-1 h-8", n === 0 && r.length > 1 && "order-2"),
36
42
  animate: !1,
37
43
  animateIcon: !1,
38
44
  label: l.label,
39
- onClick: u,
40
- variant: l.variant || s.length > 1 ? n === 0 ? "fill" : "text" : "fill",
45
+ onClick: p,
46
+ variant: l.variant || r.length > 1 ? n === 0 ? "fill" : "text" : "fill",
41
47
  disabled: l.disabled,
42
48
  size: "small"
43
- }
49
+ },
50
+ l.label + n
44
51
  );
45
52
  }) })
46
53
  ] });
47
54
  };
48
55
  export {
49
- v as default
56
+ z as default
50
57
  };