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