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