@oneplatformdev/ui 0.0.1-beta.130 → 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 +63 -74
- package/Popover/Popover.mjs +25 -30
- package/package.json +1 -1
package/Dialog/Dialog.mjs
CHANGED
|
@@ -1,63 +1,52 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import i, { useRef as
|
|
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
|
-
|
|
7
|
-
const q = e.Root, B = e.Trigger, R = e.Portal, M = e.Close, g = i.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ o(
|
|
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(
|
|
8
7
|
e.Overlay,
|
|
9
8
|
{
|
|
10
9
|
ref: s,
|
|
11
|
-
className:
|
|
10
|
+
className: l(
|
|
12
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",
|
|
13
|
-
|
|
12
|
+
a
|
|
14
13
|
),
|
|
15
|
-
...
|
|
14
|
+
...t
|
|
16
15
|
}
|
|
17
16
|
));
|
|
18
|
-
|
|
19
|
-
const
|
|
17
|
+
f.displayName = e.Overlay.displayName;
|
|
18
|
+
const h = i.forwardRef(
|
|
20
19
|
({
|
|
21
|
-
className:
|
|
22
|
-
children:
|
|
20
|
+
className: a,
|
|
21
|
+
children: t,
|
|
23
22
|
showCloseButton: s = !0,
|
|
24
|
-
onOpenAutoFocus:
|
|
25
|
-
preventAutoFocus:
|
|
26
|
-
...
|
|
27
|
-
},
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return b(() => {
|
|
33
|
-
const r = f.current;
|
|
34
|
-
if (!r || !r.parentElement) return;
|
|
35
|
-
const l = document.createElement("div");
|
|
36
|
-
return l.dataset.overlayHost = "", l.style.position = "fixed", l.style.inset = "0", l.style.zIndex = "80", r.parentElement.appendChild(l), p(l), () => {
|
|
37
|
-
l.remove(), p(null);
|
|
38
|
-
};
|
|
39
|
-
}, []), /* @__PURE__ */ c(R, { children: [
|
|
40
|
-
/* @__PURE__ */ o(g, {}),
|
|
41
|
-
/* @__PURE__ */ c(
|
|
23
|
+
onOpenAutoFocus: r,
|
|
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(
|
|
42
31
|
e.Content,
|
|
43
32
|
{
|
|
44
|
-
ref:
|
|
45
|
-
className:
|
|
33
|
+
ref: u,
|
|
34
|
+
className: l(
|
|
46
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",
|
|
47
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",
|
|
48
37
|
"max-w-[90%] max-h-[90%] overflow-hidden",
|
|
49
38
|
"bg-[#FCFCFC] border border-[#E8E9EB] rounded-[16px]",
|
|
50
|
-
|
|
39
|
+
a
|
|
51
40
|
),
|
|
52
|
-
onOpenAutoFocus: (
|
|
53
|
-
...
|
|
41
|
+
onOpenAutoFocus: (m) => (p && m.preventDefault(), r == null ? void 0 : r(m)),
|
|
42
|
+
...g,
|
|
54
43
|
children: [
|
|
55
|
-
|
|
56
|
-
s && /* @__PURE__ */
|
|
44
|
+
t,
|
|
45
|
+
s && /* @__PURE__ */ n(
|
|
57
46
|
e.Close,
|
|
58
47
|
{
|
|
59
48
|
"aria-label": "Close",
|
|
60
|
-
className:
|
|
49
|
+
className: l(
|
|
61
50
|
"absolute right-4 top-4 rounded-sm ring-offset-background w-10 aspect-square",
|
|
62
51
|
"flex items-center justify-center",
|
|
63
52
|
"data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",
|
|
@@ -69,7 +58,7 @@ const z = i.forwardRef(
|
|
|
69
58
|
"transition-opacity"
|
|
70
59
|
),
|
|
71
60
|
children: [
|
|
72
|
-
/* @__PURE__ */ o(
|
|
61
|
+
/* @__PURE__ */ o(N, { className: "h-4 w-4" }),
|
|
73
62
|
/* @__PURE__ */ o("span", { className: "sr-only", children: "Close" })
|
|
74
63
|
]
|
|
75
64
|
}
|
|
@@ -80,65 +69,65 @@ const z = i.forwardRef(
|
|
|
80
69
|
] });
|
|
81
70
|
}
|
|
82
71
|
);
|
|
83
|
-
|
|
84
|
-
const
|
|
85
|
-
className:
|
|
86
|
-
...
|
|
72
|
+
h.displayName = e.Content.displayName;
|
|
73
|
+
const v = ({
|
|
74
|
+
className: a,
|
|
75
|
+
...t
|
|
87
76
|
}) => /* @__PURE__ */ o(
|
|
88
77
|
"div",
|
|
89
78
|
{
|
|
90
|
-
className:
|
|
79
|
+
className: l(
|
|
91
80
|
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
92
|
-
|
|
81
|
+
a
|
|
93
82
|
),
|
|
94
|
-
...
|
|
83
|
+
...t
|
|
95
84
|
}
|
|
96
85
|
);
|
|
97
|
-
|
|
98
|
-
const
|
|
99
|
-
className:
|
|
100
|
-
...
|
|
86
|
+
v.displayName = "DialogHeader";
|
|
87
|
+
const w = ({
|
|
88
|
+
className: a,
|
|
89
|
+
...t
|
|
101
90
|
}) => /* @__PURE__ */ o(
|
|
102
91
|
"div",
|
|
103
92
|
{
|
|
104
|
-
className:
|
|
93
|
+
className: l(
|
|
105
94
|
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
106
|
-
|
|
95
|
+
a
|
|
107
96
|
),
|
|
108
|
-
...
|
|
97
|
+
...t
|
|
109
98
|
}
|
|
110
99
|
);
|
|
111
|
-
|
|
112
|
-
const
|
|
100
|
+
w.displayName = "DialogFooter";
|
|
101
|
+
const C = i.forwardRef(({ className: a, ...t }, s) => /* @__PURE__ */ o(
|
|
113
102
|
e.Title,
|
|
114
103
|
{
|
|
115
104
|
ref: s,
|
|
116
|
-
className:
|
|
105
|
+
className: l(
|
|
117
106
|
"text-lg font-semibold leading-none tracking-tight",
|
|
118
|
-
|
|
107
|
+
a
|
|
119
108
|
),
|
|
120
|
-
...
|
|
109
|
+
...t
|
|
121
110
|
}
|
|
122
111
|
));
|
|
123
|
-
|
|
124
|
-
const
|
|
112
|
+
C.displayName = e.Title.displayName;
|
|
113
|
+
const R = i.forwardRef(({ className: a, ...t }, s) => /* @__PURE__ */ o(
|
|
125
114
|
e.Description,
|
|
126
115
|
{
|
|
127
116
|
ref: s,
|
|
128
|
-
className:
|
|
129
|
-
...
|
|
117
|
+
className: l("text-sm text-muted-foreground", a),
|
|
118
|
+
...t
|
|
130
119
|
}
|
|
131
120
|
));
|
|
132
|
-
|
|
121
|
+
R.displayName = e.Description.displayName;
|
|
133
122
|
export {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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
|
|
144
133
|
};
|
package/Popover/Popover.mjs
CHANGED
|
@@ -1,33 +1,28 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import * as s from "react";
|
|
3
3
|
import * as o from "@radix-ui/react-popover";
|
|
4
|
-
import { cn as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
...d
|
|
24
|
-
}
|
|
25
|
-
) });
|
|
26
|
-
});
|
|
27
|
-
f.displayName = o.Content.displayName;
|
|
4
|
+
import { cn as m } from "@oneplatformdev/utils";
|
|
5
|
+
const c = o.Root, v = o.Trigger, g = o.Anchor, p = s.forwardRef(({ className: e, align: a = "center", sideOffset: r = 4, style: n, ...d }, i) => /* @__PURE__ */ t(o.Portal, { children: /* @__PURE__ */ t(
|
|
6
|
+
o.Content,
|
|
7
|
+
{
|
|
8
|
+
ref: i,
|
|
9
|
+
align: a,
|
|
10
|
+
sideOffset: r,
|
|
11
|
+
className: m(
|
|
12
|
+
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
13
|
+
e
|
|
14
|
+
),
|
|
15
|
+
style: {
|
|
16
|
+
pointerEvents: "auto",
|
|
17
|
+
...n
|
|
18
|
+
},
|
|
19
|
+
...d
|
|
20
|
+
}
|
|
21
|
+
) }));
|
|
22
|
+
p.displayName = o.Content.displayName;
|
|
28
23
|
export {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
c as Popover,
|
|
25
|
+
g as PopoverAnchor,
|
|
26
|
+
p as PopoverContent,
|
|
27
|
+
v as PopoverTrigger
|
|
33
28
|
};
|