prometeo-design-system 2.3.9 → 2.4.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.
@@ -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
  };
@@ -1,20 +1,20 @@
1
1
  import { j as n } from "./jsx-runtime-DKDX3adD.js";
2
- import { motion as x } from "framer-motion";
2
+ import { motion as h } from "framer-motion";
3
3
  import { memo as N } from "react";
4
4
  import { c as r } from "./cn-B6yFEsav.js";
5
5
  function c({
6
- items: t,
6
+ items: a,
7
7
  activeTab: e,
8
8
  onTabChange: i,
9
9
  className: l,
10
- tabClassName: d,
10
+ tabClassName: s,
11
11
  activeTabClassName: u,
12
12
  indicatorClassName: f,
13
13
  animated: b = !0,
14
14
  renderTab: o
15
15
  }) {
16
- const h = (a) => {
17
- a.disabled || i?.(a.id, a);
16
+ const x = (t) => {
17
+ t.disabled || i?.(t.id, t);
18
18
  };
19
19
  return /* @__PURE__ */ n.jsx(
20
20
  "div",
@@ -24,28 +24,28 @@ function c({
24
24
  l
25
25
  ),
26
26
  role: "tablist",
27
- children: t?.map((a) => {
28
- const s = e === a.id, m = () => h(a);
29
- return o ? /* @__PURE__ */ n.jsx("div", { children: o(a, s, m) }, a.id) : /* @__PURE__ */ n.jsxs(
27
+ children: a?.map((t) => {
28
+ const d = e === t.id, m = () => x(t);
29
+ return o ? /* @__PURE__ */ n.jsx("div", { children: o(t, d, m) }, t.id) : /* @__PURE__ */ n.jsxs(
30
30
  "button",
31
31
  {
32
32
  onClick: m,
33
- disabled: a.disabled,
33
+ disabled: t.disabled,
34
34
  className: r(
35
35
  "relative flex justify-center items-center h-10 px-4 font-medium focus:outline-none transition-colors",
36
- !a.disabled && "hover:text-primary-default-default cursor-pointer",
37
- a.disabled && "opacity-50 cursor-not-allowed",
38
- d,
39
- s && u
36
+ !t.disabled && "hover:text-primary-default-default cursor-pointer",
37
+ t.disabled && "opacity-50 cursor-not-allowed",
38
+ s,
39
+ d && u
40
40
  ),
41
- tabIndex: a.disabled ? -1 : 0,
42
- "aria-label": a.title,
41
+ tabIndex: t.disabled ? -1 : 0,
42
+ "aria-label": t.title,
43
43
  role: "tab",
44
- "aria-selected": s,
45
- title: a.description,
44
+ "aria-selected": d,
45
+ title: t.description,
46
46
  children: [
47
- s && b && /* @__PURE__ */ n.jsx(
48
- x.div,
47
+ d && b && /* @__PURE__ */ n.jsx(
48
+ h.div,
49
49
  {
50
50
  layoutId: "tab-indicator",
51
51
  className: r(
@@ -65,30 +65,30 @@ function c({
65
65
  {
66
66
  className: r(
67
67
  "relative z-10",
68
- s ? "text-primary-default-default font-semibold text-md" : "text-neutral-medium-default font-medium text-md"
68
+ d ? "text-primary-default-default font-semibold text-md" : "text-neutral-medium-default font-medium text-md"
69
69
  ),
70
- children: a.title
70
+ children: t.title
71
71
  }
72
72
  )
73
73
  ]
74
74
  },
75
- a.id
75
+ t.id
76
76
  );
77
77
  })
78
78
  }
79
79
  );
80
80
  }
81
81
  c.displayName = "TabLinks";
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)
82
+ const T = N(c, (a, e) => {
83
+ if (a.activeTab !== e.activeTab || a.className !== e.className || a.tabClassName !== e.tabClassName || a.activeTabClassName !== e.activeTabClassName || a.indicatorClassName !== e.indicatorClassName || a.animated !== e.animated || a.items.length !== e.items.length)
84
84
  return !1;
85
- for (let i = 0; i < t.items.length; i++) {
86
- const l = t.items[i], d = e.items[i];
87
- if (l.id !== d.id || l.title !== d.title || l.disabled !== d.disabled || l.description !== d.description)
85
+ for (let i = 0; i < a.items.length; i++) {
86
+ const l = a.items[i], s = e.items[i];
87
+ if (l.id !== s.id || l.title !== s.title || l.disabled !== s.disabled || l.description !== s.description)
88
88
  return !1;
89
89
  }
90
90
  return !0;
91
91
  });
92
92
  export {
93
- C as default
93
+ T as default
94
94
  };
@@ -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.0",
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",