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.
- package/dist/DialogModal.es.js +43 -27
- package/dist/TabLinks.es.js +28 -28
- package/dist/components/Dialog/Dialog.d.ts +4 -4
- package/package.json +4 -2
package/dist/DialogModal.es.js
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
import { j as o } from "./jsx-runtime-DKDX3adD.js";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { c as
|
|
4
|
-
const
|
|
5
|
-
({ children: e, onClose: t, className: a },
|
|
6
|
-
const [
|
|
7
|
-
|
|
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
|
-
|
|
10
|
-
}, [
|
|
11
|
-
return
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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:
|
|
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: (
|
|
29
|
-
children: typeof e == "function" ? 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
|
-
)
|
|
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:
|
|
39
|
-
Title:
|
|
54
|
+
Footer: y,
|
|
55
|
+
Title: N
|
|
40
56
|
});
|
|
41
57
|
k.displayName = "DialogModal";
|
|
42
|
-
const
|
|
43
|
-
const e =
|
|
44
|
-
e.current?.open(
|
|
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
|
-
}, []),
|
|
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:
|
|
53
|
-
getContext:
|
|
68
|
+
isOpen: i,
|
|
69
|
+
getContext: l
|
|
54
70
|
};
|
|
55
71
|
};
|
|
56
72
|
export {
|
|
57
73
|
k as default,
|
|
58
|
-
|
|
74
|
+
H as useDialogControl
|
|
59
75
|
};
|
package/dist/TabLinks.es.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { j as n } from "./jsx-runtime-DKDX3adD.js";
|
|
2
|
-
import { motion as
|
|
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:
|
|
6
|
+
items: a,
|
|
7
7
|
activeTab: e,
|
|
8
8
|
onTabChange: i,
|
|
9
9
|
className: l,
|
|
10
|
-
tabClassName:
|
|
10
|
+
tabClassName: s,
|
|
11
11
|
activeTabClassName: u,
|
|
12
12
|
indicatorClassName: f,
|
|
13
13
|
animated: b = !0,
|
|
14
14
|
renderTab: o
|
|
15
15
|
}) {
|
|
16
|
-
const
|
|
17
|
-
|
|
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:
|
|
28
|
-
const
|
|
29
|
-
return o ? /* @__PURE__ */ n.jsx("div", { children: o(
|
|
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:
|
|
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
|
-
!
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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:
|
|
42
|
-
"aria-label":
|
|
41
|
+
tabIndex: t.disabled ? -1 : 0,
|
|
42
|
+
"aria-label": t.title,
|
|
43
43
|
role: "tab",
|
|
44
|
-
"aria-selected":
|
|
45
|
-
title:
|
|
44
|
+
"aria-selected": d,
|
|
45
|
+
title: t.description,
|
|
46
46
|
children: [
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
|
|
68
|
+
d ? "text-primary-default-default font-semibold text-md" : "text-neutral-medium-default font-medium text-md"
|
|
69
69
|
),
|
|
70
|
-
children:
|
|
70
|
+
children: t.title
|
|
71
71
|
}
|
|
72
72
|
)
|
|
73
73
|
]
|
|
74
74
|
},
|
|
75
|
-
|
|
75
|
+
t.id
|
|
76
76
|
);
|
|
77
77
|
})
|
|
78
78
|
}
|
|
79
79
|
);
|
|
80
80
|
}
|
|
81
81
|
c.displayName = "TabLinks";
|
|
82
|
-
const
|
|
83
|
-
if (
|
|
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 <
|
|
86
|
-
const l =
|
|
87
|
-
if (l.id !==
|
|
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
|
-
|
|
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.
|
|
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",
|