prometeo-design-system 2.3.9 → 2.4.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.
@@ -1,19 +1,25 @@
1
1
  import { j as o } from "./jsx-runtime-DKDX3adD.js";
2
- import { forwardRef as p, useState as g, useCallback as n, useImperativeHandle as m, useRef as j } from "react";
3
- import { c as x } from "./cn-B6yFEsav.js";
4
- const D = p(
5
- ({ children: e, onClose: t, className: a }, c) => {
6
- const [s, l] = g(!1), [r, u] = g(null), f = n((i) => {
7
- u(i ?? null), l(!0);
2
+ import { forwardRef as h, memo as s, useState as D, useRef as p, useCallback as n, useImperativeHandle as R } from "react";
3
+ import { c as j } from "./cn-B6yFEsav.js";
4
+ const C = h(
5
+ ({ children: e, onClose: t, className: a }, i) => {
6
+ const [l, r] = 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), r(!0);
8
10
  }, []), d = n(() => {
9
- l(!1), t?.(r), setTimeout(() => u(null), 300);
10
- }, [r, t]);
11
- return m(c, () => ({
12
- open: f,
13
- close: d,
14
- isOpen: s,
15
- getContext: () => r
16
- })), /* @__PURE__ */ o.jsx(o.Fragment, { children: s && /* @__PURE__ */ o.jsx(
11
+ r(!1), x.current?.(u.current), setTimeout(() => f(null), 300);
12
+ }, []);
13
+ return R(
14
+ i,
15
+ () => ({
16
+ open: m,
17
+ close: d,
18
+ isOpen: l,
19
+ getContext: () => u.current
20
+ }),
21
+ [m, d, l]
22
+ ), /* @__PURE__ */ o.jsx(o.Fragment, { children: l && /* @__PURE__ */ o.jsx(
17
23
  "div",
18
24
  {
19
25
  className: "fixed inset-0 z-50 flex items-center justify-center bg-black/30 backdrop-blur-[1.5px]",
@@ -21,39 +27,49 @@ const D = p(
21
27
  children: /* @__PURE__ */ o.jsx(
22
28
  "div",
23
29
  {
24
- className: x(
30
+ className: j(
25
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",
26
32
  a
27
33
  ),
28
- onClick: (i) => i.stopPropagation(),
29
- children: typeof e == "function" ? e(r) : e
34
+ onClick: (g) => g.stopPropagation(),
35
+ children: typeof e == "function" ? e(c) : e
30
36
  }
31
37
  )
32
38
  }
33
39
  ) });
34
40
  }
35
- ), b = ({ children: e, className: t }) => /* @__PURE__ */ o.jsx("div", { className: t, children: /* @__PURE__ */ o.jsx("div", { className: x("flex flex-col gap-4"), children: e }) }), C = ({ children: e, className: t }) => /* @__PURE__ */ o.jsx("h1", { className: t, children: e }), v = ({ children: e, className: t }) => /* @__PURE__ */ o.jsx("div", { className: t, children: e }), h = ({ children: e, className: t }) => /* @__PURE__ */ o.jsx("div", { className: t, children: e }), k = Object.assign(D, {
41
+ );
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"), children: e }) }));
44
+ b.displayName = "DialogContent";
45
+ const N = s(({ children: e, className: t }) => /* @__PURE__ */ o.jsx("h1", { className: t, children: e }));
46
+ N.displayName = "DialogTitle";
47
+ const v = s(({ children: e, className: t }) => /* @__PURE__ */ o.jsx("div", { className: t, children: e }));
48
+ v.displayName = "DialogHeader";
49
+ const y = s(({ children: e, className: t }) => /* @__PURE__ */ o.jsx("div", { className: t, children: e }));
50
+ y.displayName = "DialogFooter";
51
+ const k = Object.assign(C, {
36
52
  Content: b,
37
53
  Header: v,
38
- Footer: h,
39
- Title: C
54
+ Footer: y,
55
+ Title: N
40
56
  });
41
57
  k.displayName = "DialogModal";
42
- const R = () => {
43
- const e = j(null), t = n((l) => {
44
- e.current?.open(l);
58
+ const H = () => {
59
+ const e = p(null), t = n((r) => {
60
+ e.current?.open(r);
45
61
  }, []), a = n(() => {
46
62
  e.current?.close();
47
- }, []), c = n(() => e.current?.isOpen ?? !1, []), s = n(() => e.current?.getContext() ?? null, []);
63
+ }, []), i = n(() => e.current?.isOpen ?? !1, []), l = n(() => e.current?.getContext() ?? null, []);
48
64
  return {
49
65
  ref: e,
50
66
  open: t,
51
67
  close: a,
52
- isOpen: c,
53
- getContext: s
68
+ isOpen: i,
69
+ getContext: l
54
70
  };
55
71
  };
56
72
  export {
57
73
  k as default,
58
- R as useDialogControl
74
+ H as useDialogControl
59
75
  };
@@ -80,7 +80,8 @@ function c({
80
80
  }
81
81
  c.displayName = "TabLinks";
82
82
  const C = N(c, (t, e) => {
83
- if (t.activeTab !== e.activeTab || t.className !== e.className || t.tabClassName !== e.tabClassName || t.activeTabClassName !== e.activeTabClassName || t.indicatorClassName !== e.indicatorClassName || t.animated !== e.animated || t.onTabChange !== e.onTabChange || t.renderTab !== e.renderTab || t.items.length !== e.items.length)
83
+ if (t.activeTab !== e.activeTab || t.className !== e.className || t.tabClassName !== e.tabClassName || t.activeTabClassName !== e.activeTabClassName || t.indicatorClassName !== e.indicatorClassName || t.animated !== e.animated || t.onTabChange !== e.onTabChange || // AGREGAR ESTO
84
+ t.renderTab !== e.renderTab || t.items.length !== e.items.length)
84
85
  return !1;
85
86
  for (let i = 0; i < t.items.length; i++) {
86
87
  const l = t.items[i], d = e.items[i];
@@ -27,9 +27,9 @@ interface DialogFooterProps {
27
27
  className?: string;
28
28
  }
29
29
  declare const DialogModal: import('react').ForwardRefExoticComponent<DialogProps<any> & import('react').RefAttributes<DialogHandle<any>>> & {
30
- Content: ({ children, className }: DialogContentProps) => import("react/jsx-runtime").JSX.Element;
31
- Header: ({ children, className }: DialogHeaderProps) => import("react/jsx-runtime").JSX.Element;
32
- Footer: ({ children, className }: DialogFooterProps) => import("react/jsx-runtime").JSX.Element;
33
- Title: ({ children, className }: DialogTitleProps) => import("react/jsx-runtime").JSX.Element;
30
+ Content: import('react').MemoExoticComponent<({ children, className }: DialogContentProps) => import("react/jsx-runtime").JSX.Element>;
31
+ Header: import('react').MemoExoticComponent<({ children, className }: DialogHeaderProps) => import("react/jsx-runtime").JSX.Element>;
32
+ Footer: import('react').MemoExoticComponent<({ children, className }: DialogFooterProps) => import("react/jsx-runtime").JSX.Element>;
33
+ Title: import('react').MemoExoticComponent<({ children, className }: DialogTitleProps) => import("react/jsx-runtime").JSX.Element>;
34
34
  };
35
35
  export default DialogModal;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "prometeo-design-system",
3
3
  "private": false,
4
- "version": "2.3.9",
4
+ "version": "2.4.1",
5
5
  "type": "module",
6
6
  "description": "design kit system",
7
7
  "main": "dist/prometeo-design-system.umd.js",
@@ -188,7 +188,9 @@
188
188
  "dev": "vite",
189
189
  "build": "node scripts/migrate-utilities.js && tsc -b && vite build",
190
190
  "lint": "eslint .",
191
- "preview": "vite preview",
191
+ "dev:preview": "vite --config vite.preview.config.ts",
192
+ "build:preview": "vite build --config vite.preview.config.ts",
193
+ "preview": "vite preview --config vite.preview.config.ts --port 4173",
192
194
  "clean": "rm -rf dist",
193
195
  "storybook": "storybook dev -p 6006",
194
196
  "build-storybook": "storybook build",