@oneplatformdev/ui 0.0.1-beta.146 → 0.0.1-beta.147
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 +38 -38
- package/package.json +1 -1
package/Dialog/Dialog.mjs
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import { jsx as o, jsxs as d } from "react/jsx-runtime";
|
|
2
2
|
import i, { useState as y, useRef as N } from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as a from "@radix-ui/react-dialog";
|
|
4
4
|
import { XIcon as D } from "lucide-react";
|
|
5
|
-
import { cn as
|
|
5
|
+
import { cn as l, composeRefs as b } from "@oneplatformdev/utils";
|
|
6
6
|
import { DialogOverlayScope as h } from "./DialogOverlayScope.mjs";
|
|
7
7
|
const F = (e) => {
|
|
8
|
-
const { modal:
|
|
8
|
+
const { modal: t, ...s } = e;
|
|
9
9
|
return /* @__PURE__ */ o(
|
|
10
|
-
|
|
10
|
+
a.Root,
|
|
11
11
|
{
|
|
12
|
-
modal:
|
|
12
|
+
modal: t,
|
|
13
13
|
...s
|
|
14
14
|
}
|
|
15
15
|
);
|
|
16
|
-
}, H =
|
|
17
|
-
|
|
16
|
+
}, H = a.Trigger, v = a.Portal, _ = a.Close, c = i.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ o(
|
|
17
|
+
a.Overlay,
|
|
18
18
|
{
|
|
19
19
|
ref: s,
|
|
20
|
-
className:
|
|
20
|
+
className: l(
|
|
21
21
|
"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",
|
|
22
22
|
e
|
|
23
23
|
),
|
|
24
|
-
...
|
|
24
|
+
...t
|
|
25
25
|
}
|
|
26
26
|
));
|
|
27
|
-
c.displayName =
|
|
27
|
+
c.displayName = a.Overlay.displayName;
|
|
28
28
|
const w = i.forwardRef(
|
|
29
29
|
({
|
|
30
30
|
className: e,
|
|
31
|
-
children:
|
|
31
|
+
children: t,
|
|
32
32
|
showCloseButton: s = !0,
|
|
33
33
|
onOpenAutoFocus: n,
|
|
34
34
|
preventAutoFocus: f,
|
|
@@ -38,27 +38,27 @@ const w = i.forwardRef(
|
|
|
38
38
|
return /* @__PURE__ */ d(v, { children: [
|
|
39
39
|
/* @__PURE__ */ o(c, {}),
|
|
40
40
|
/* @__PURE__ */ o(h, { value: g, children: /* @__PURE__ */ d(
|
|
41
|
-
|
|
41
|
+
a.Content,
|
|
42
42
|
{
|
|
43
|
-
ref: (
|
|
44
|
-
|
|
43
|
+
ref: (r) => {
|
|
44
|
+
r && b(p, x)(r);
|
|
45
45
|
},
|
|
46
|
-
className:
|
|
46
|
+
className: l(
|
|
47
47
|
"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",
|
|
48
48
|
"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",
|
|
49
49
|
"max-w-[90%] max-h-[90%] overflow-hidden",
|
|
50
50
|
"bg-[#FCFCFC] border border-[#E8E9EB] rounded-[16px]",
|
|
51
51
|
e
|
|
52
52
|
),
|
|
53
|
-
onOpenAutoFocus: (
|
|
53
|
+
onOpenAutoFocus: (r) => (f && r.preventDefault(), n == null ? void 0 : n(r)),
|
|
54
54
|
...m,
|
|
55
55
|
children: [
|
|
56
|
-
|
|
56
|
+
t,
|
|
57
57
|
s && /* @__PURE__ */ d(
|
|
58
|
-
|
|
58
|
+
a.Close,
|
|
59
59
|
{
|
|
60
60
|
"aria-label": "Close",
|
|
61
|
-
className:
|
|
61
|
+
className: l(
|
|
62
62
|
"absolute right-4 top-4 rounded-sm ring-offset-background w-10 aspect-square",
|
|
63
63
|
"flex items-center justify-center",
|
|
64
64
|
"data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",
|
|
@@ -81,64 +81,64 @@ const w = i.forwardRef(
|
|
|
81
81
|
/* @__PURE__ */ o(
|
|
82
82
|
"div",
|
|
83
83
|
{
|
|
84
|
-
ref: (
|
|
85
|
-
|
|
84
|
+
ref: (r) => {
|
|
85
|
+
r && u(r);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
)
|
|
89
89
|
] });
|
|
90
90
|
}
|
|
91
91
|
);
|
|
92
|
-
w.displayName =
|
|
92
|
+
w.displayName = a.Content.displayName;
|
|
93
93
|
const C = ({
|
|
94
94
|
className: e,
|
|
95
|
-
...
|
|
95
|
+
...t
|
|
96
96
|
}) => /* @__PURE__ */ o(
|
|
97
97
|
"div",
|
|
98
98
|
{
|
|
99
|
-
className:
|
|
99
|
+
className: l(
|
|
100
100
|
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
101
101
|
e
|
|
102
102
|
),
|
|
103
|
-
...
|
|
103
|
+
...t
|
|
104
104
|
}
|
|
105
105
|
);
|
|
106
106
|
C.displayName = "DialogHeader";
|
|
107
107
|
const R = ({
|
|
108
108
|
className: e,
|
|
109
|
-
...
|
|
109
|
+
...t
|
|
110
110
|
}) => /* @__PURE__ */ o(
|
|
111
111
|
"div",
|
|
112
112
|
{
|
|
113
|
-
className:
|
|
113
|
+
className: l(
|
|
114
114
|
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
115
115
|
e
|
|
116
116
|
),
|
|
117
|
-
...
|
|
117
|
+
...t
|
|
118
118
|
}
|
|
119
119
|
);
|
|
120
120
|
R.displayName = "DialogFooter";
|
|
121
|
-
const T = i.forwardRef(({ className: e, ...
|
|
122
|
-
|
|
121
|
+
const T = i.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ o(
|
|
122
|
+
a.Title,
|
|
123
123
|
{
|
|
124
124
|
ref: s,
|
|
125
|
-
className:
|
|
125
|
+
className: l(
|
|
126
126
|
"text-lg font-semibold leading-none tracking-tight",
|
|
127
127
|
e
|
|
128
128
|
),
|
|
129
|
-
...
|
|
129
|
+
...t
|
|
130
130
|
}
|
|
131
131
|
));
|
|
132
|
-
T.displayName =
|
|
133
|
-
const j = i.forwardRef(({ className: e, ...
|
|
134
|
-
|
|
132
|
+
T.displayName = a.Title.displayName;
|
|
133
|
+
const j = i.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ o(
|
|
134
|
+
a.Description,
|
|
135
135
|
{
|
|
136
136
|
ref: s,
|
|
137
|
-
className:
|
|
138
|
-
...
|
|
137
|
+
className: l("text-sm text-muted-foreground", e),
|
|
138
|
+
...t
|
|
139
139
|
}
|
|
140
140
|
));
|
|
141
|
-
j.displayName =
|
|
141
|
+
j.displayName = a.Description.displayName;
|
|
142
142
|
export {
|
|
143
143
|
F as Dialog,
|
|
144
144
|
_ as DialogClose,
|