@oneplatformdev/ui 0.0.1-beta.131 → 0.0.1-beta.132
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/Dialog/Dialog.mjs +78 -75
- package/package.json +1 -1
package/Dialog/Dialog.mjs
CHANGED
|
@@ -1,130 +1,133 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as o, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import i, { useRef as x, useMemo as y } from "react";
|
|
3
3
|
import * as e from "@radix-ui/react-dialog";
|
|
4
|
-
import { XIcon as
|
|
5
|
-
import { cn as
|
|
6
|
-
const
|
|
4
|
+
import { XIcon as N } from "lucide-react";
|
|
5
|
+
import { cn as l, composeRefs as D } from "@oneplatformdev/utils";
|
|
6
|
+
const E = e.Root, P = e.Trigger, b = e.Portal, F = e.Close, f = i.forwardRef(({ className: a, ...t }, s) => /* @__PURE__ */ o(
|
|
7
7
|
e.Overlay,
|
|
8
8
|
{
|
|
9
9
|
ref: s,
|
|
10
|
-
className:
|
|
10
|
+
className: l(
|
|
11
11
|
"fixed inset-0 z-40 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
12
12
|
a
|
|
13
13
|
),
|
|
14
14
|
...t
|
|
15
15
|
}
|
|
16
16
|
));
|
|
17
|
-
|
|
18
|
-
const
|
|
17
|
+
f.displayName = e.Overlay.displayName;
|
|
18
|
+
const h = i.forwardRef(
|
|
19
19
|
({
|
|
20
20
|
className: a,
|
|
21
21
|
children: t,
|
|
22
22
|
showCloseButton: s = !0,
|
|
23
23
|
onOpenAutoFocus: r,
|
|
24
|
-
preventAutoFocus:
|
|
25
|
-
...
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
24
|
+
preventAutoFocus: p,
|
|
25
|
+
...g
|
|
26
|
+
}, d) => {
|
|
27
|
+
const c = x(null), u = y(() => D(d, c), [d]);
|
|
28
|
+
return console.log("localRef", c), /* @__PURE__ */ n(b, { children: [
|
|
29
|
+
/* @__PURE__ */ o(f, {}),
|
|
30
|
+
/* @__PURE__ */ n(
|
|
31
|
+
e.Content,
|
|
32
|
+
{
|
|
33
|
+
ref: u,
|
|
34
|
+
className: l(
|
|
35
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg",
|
|
36
|
+
"duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
37
|
+
"max-w-[90%] max-h-[90%] overflow-hidden",
|
|
38
|
+
"bg-[#FCFCFC] border border-[#E8E9EB] rounded-[16px]",
|
|
39
|
+
a
|
|
40
|
+
),
|
|
41
|
+
onOpenAutoFocus: (m) => (p && m.preventDefault(), r == null ? void 0 : r(m)),
|
|
42
|
+
...g,
|
|
43
|
+
children: [
|
|
44
|
+
t,
|
|
45
|
+
s && /* @__PURE__ */ n(
|
|
46
|
+
e.Close,
|
|
47
|
+
{
|
|
48
|
+
"aria-label": "Close",
|
|
49
|
+
className: l(
|
|
50
|
+
"absolute right-4 top-4 rounded-sm ring-offset-background w-10 aspect-square",
|
|
51
|
+
"flex items-center justify-center",
|
|
52
|
+
"data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",
|
|
53
|
+
"opacity-70 hover:opacity-100",
|
|
54
|
+
// 'focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
|
|
55
|
+
"focus:outline-none focus:ring-0 focus:ring-ring focus:ring-offset-2",
|
|
56
|
+
"hover:bg-accent",
|
|
57
|
+
"disabled:pointer-events-none",
|
|
58
|
+
"transition-opacity"
|
|
59
|
+
),
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ o(N, { className: "h-4 w-4" }),
|
|
62
|
+
/* @__PURE__ */ o("span", { className: "sr-only", children: "Close" })
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
] });
|
|
70
|
+
}
|
|
68
71
|
);
|
|
69
|
-
|
|
70
|
-
const
|
|
72
|
+
h.displayName = e.Content.displayName;
|
|
73
|
+
const v = ({
|
|
71
74
|
className: a,
|
|
72
75
|
...t
|
|
73
76
|
}) => /* @__PURE__ */ o(
|
|
74
77
|
"div",
|
|
75
78
|
{
|
|
76
|
-
className:
|
|
79
|
+
className: l(
|
|
77
80
|
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
78
81
|
a
|
|
79
82
|
),
|
|
80
83
|
...t
|
|
81
84
|
}
|
|
82
85
|
);
|
|
83
|
-
|
|
84
|
-
const
|
|
86
|
+
v.displayName = "DialogHeader";
|
|
87
|
+
const w = ({
|
|
85
88
|
className: a,
|
|
86
89
|
...t
|
|
87
90
|
}) => /* @__PURE__ */ o(
|
|
88
91
|
"div",
|
|
89
92
|
{
|
|
90
|
-
className:
|
|
93
|
+
className: l(
|
|
91
94
|
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
92
95
|
a
|
|
93
96
|
),
|
|
94
97
|
...t
|
|
95
98
|
}
|
|
96
99
|
);
|
|
97
|
-
|
|
98
|
-
const
|
|
100
|
+
w.displayName = "DialogFooter";
|
|
101
|
+
const C = i.forwardRef(({ className: a, ...t }, s) => /* @__PURE__ */ o(
|
|
99
102
|
e.Title,
|
|
100
103
|
{
|
|
101
104
|
ref: s,
|
|
102
|
-
className:
|
|
105
|
+
className: l(
|
|
103
106
|
"text-lg font-semibold leading-none tracking-tight",
|
|
104
107
|
a
|
|
105
108
|
),
|
|
106
109
|
...t
|
|
107
110
|
}
|
|
108
111
|
));
|
|
109
|
-
|
|
110
|
-
const
|
|
112
|
+
C.displayName = e.Title.displayName;
|
|
113
|
+
const R = i.forwardRef(({ className: a, ...t }, s) => /* @__PURE__ */ o(
|
|
111
114
|
e.Description,
|
|
112
115
|
{
|
|
113
116
|
ref: s,
|
|
114
|
-
className:
|
|
117
|
+
className: l("text-sm text-muted-foreground", a),
|
|
115
118
|
...t
|
|
116
119
|
}
|
|
117
120
|
));
|
|
118
|
-
|
|
121
|
+
R.displayName = e.Description.displayName;
|
|
119
122
|
export {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
123
|
+
E as Dialog,
|
|
124
|
+
F as DialogClose,
|
|
125
|
+
h as DialogContent,
|
|
126
|
+
R as DialogDescription,
|
|
127
|
+
w as DialogFooter,
|
|
128
|
+
v as DialogHeader,
|
|
129
|
+
f as DialogOverlay,
|
|
130
|
+
b as DialogPortal,
|
|
131
|
+
C as DialogTitle,
|
|
132
|
+
P as DialogTrigger
|
|
130
133
|
};
|