@oneplatformdev/ui 0.0.1-beta.127 → 0.0.1-beta.129
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 +2 -1
- package/Dialog/Dialog.mjs +58 -52
- package/Dialog/DialogOverlayScope.mjs +5 -5
- package/Popover/Popover.d.ts +1 -1
- package/Popover/Popover.mjs +16 -16
- package/package.json +4 -4
package/Dialog/Dialog.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
2
3
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
3
4
|
declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
|
|
4
5
|
declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
package/Dialog/Dialog.mjs
CHANGED
|
@@ -1,56 +1,63 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { useRef as y, useState as N, useLayoutEffect as h } from "react";
|
|
1
|
+
import { jsx as o, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import i, { useRef as h, useMemo as D, useState as v, useEffect as b } from "react";
|
|
4
3
|
import * as e from "@radix-ui/react-dialog";
|
|
5
|
-
import { XIcon as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { DialogOverlayScope as
|
|
8
|
-
const
|
|
4
|
+
import { XIcon as C } from "lucide-react";
|
|
5
|
+
import { cn as n, composeRefs as w } from "@oneplatformdev/utils";
|
|
6
|
+
import { DialogOverlayScope as E } from "./DialogOverlayScope.mjs";
|
|
7
|
+
const q = e.Root, B = e.Trigger, R = e.Portal, M = e.Close, g = i.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ o(
|
|
9
8
|
e.Overlay,
|
|
10
9
|
{
|
|
11
10
|
ref: s,
|
|
12
|
-
className:
|
|
11
|
+
className: n(
|
|
13
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",
|
|
14
13
|
t
|
|
15
14
|
),
|
|
16
15
|
...a
|
|
17
16
|
}
|
|
18
17
|
));
|
|
19
|
-
|
|
20
|
-
const
|
|
18
|
+
g.displayName = e.Overlay.displayName;
|
|
19
|
+
const z = i.forwardRef(
|
|
21
20
|
({
|
|
22
21
|
className: t,
|
|
23
22
|
children: a,
|
|
24
23
|
showCloseButton: s = !0,
|
|
25
|
-
onOpenAutoFocus:
|
|
26
|
-
preventAutoFocus:
|
|
27
|
-
...
|
|
28
|
-
},
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
24
|
+
onOpenAutoFocus: d,
|
|
25
|
+
preventAutoFocus: u,
|
|
26
|
+
...y
|
|
27
|
+
}, m) => {
|
|
28
|
+
const f = h(null), x = D(
|
|
29
|
+
() => w(m, f),
|
|
30
|
+
[m]
|
|
31
|
+
), [N, p] = v(null);
|
|
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__ */ o(E, { value: N, children: /* @__PURE__ */ c(
|
|
35
42
|
e.Content,
|
|
36
43
|
{
|
|
37
|
-
ref:
|
|
38
|
-
className:
|
|
44
|
+
ref: x,
|
|
45
|
+
className: n(
|
|
39
46
|
"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",
|
|
40
47
|
"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",
|
|
41
48
|
"max-w-[90%] max-h-[90%] overflow-hidden",
|
|
42
49
|
"bg-[#FCFCFC] border border-[#E8E9EB] rounded-[16px]",
|
|
43
50
|
t
|
|
44
51
|
),
|
|
45
|
-
onOpenAutoFocus: (
|
|
46
|
-
...
|
|
52
|
+
onOpenAutoFocus: (r) => (u && r.preventDefault(), d == null ? void 0 : d(r)),
|
|
53
|
+
...y,
|
|
47
54
|
children: [
|
|
48
55
|
a,
|
|
49
|
-
s && /* @__PURE__ */
|
|
56
|
+
s && /* @__PURE__ */ c(
|
|
50
57
|
e.Close,
|
|
51
58
|
{
|
|
52
59
|
"aria-label": "Close",
|
|
53
|
-
className:
|
|
60
|
+
className: n(
|
|
54
61
|
"absolute right-4 top-4 rounded-sm ring-offset-background w-10 aspect-square",
|
|
55
62
|
"flex items-center justify-center",
|
|
56
63
|
"data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",
|
|
@@ -62,77 +69,76 @@ const w = r.forwardRef(
|
|
|
62
69
|
"transition-opacity"
|
|
63
70
|
),
|
|
64
71
|
children: [
|
|
65
|
-
/* @__PURE__ */ o(
|
|
72
|
+
/* @__PURE__ */ o(C, { className: "h-4 w-4" }),
|
|
66
73
|
/* @__PURE__ */ o("span", { className: "sr-only", children: "Close" })
|
|
67
74
|
]
|
|
68
75
|
}
|
|
69
76
|
)
|
|
70
77
|
]
|
|
71
78
|
}
|
|
72
|
-
) })
|
|
73
|
-
/* @__PURE__ */ o("div", { ref: n, className: "fixed inset-0 z-80" })
|
|
79
|
+
) })
|
|
74
80
|
] });
|
|
75
81
|
}
|
|
76
82
|
);
|
|
77
|
-
|
|
78
|
-
const
|
|
83
|
+
z.displayName = e.Content.displayName;
|
|
84
|
+
const T = ({
|
|
79
85
|
className: t,
|
|
80
86
|
...a
|
|
81
87
|
}) => /* @__PURE__ */ o(
|
|
82
88
|
"div",
|
|
83
89
|
{
|
|
84
|
-
className:
|
|
90
|
+
className: n(
|
|
85
91
|
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
86
92
|
t
|
|
87
93
|
),
|
|
88
94
|
...a
|
|
89
95
|
}
|
|
90
96
|
);
|
|
91
|
-
|
|
92
|
-
const
|
|
97
|
+
T.displayName = "DialogHeader";
|
|
98
|
+
const j = ({
|
|
93
99
|
className: t,
|
|
94
100
|
...a
|
|
95
101
|
}) => /* @__PURE__ */ o(
|
|
96
102
|
"div",
|
|
97
103
|
{
|
|
98
|
-
className:
|
|
104
|
+
className: n(
|
|
99
105
|
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
100
106
|
t
|
|
101
107
|
),
|
|
102
108
|
...a
|
|
103
109
|
}
|
|
104
110
|
);
|
|
105
|
-
|
|
106
|
-
const
|
|
111
|
+
j.displayName = "DialogFooter";
|
|
112
|
+
const k = i.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ o(
|
|
107
113
|
e.Title,
|
|
108
114
|
{
|
|
109
115
|
ref: s,
|
|
110
|
-
className:
|
|
116
|
+
className: n(
|
|
111
117
|
"text-lg font-semibold leading-none tracking-tight",
|
|
112
118
|
t
|
|
113
119
|
),
|
|
114
120
|
...a
|
|
115
121
|
}
|
|
116
122
|
));
|
|
117
|
-
|
|
118
|
-
const
|
|
123
|
+
k.displayName = e.Title.displayName;
|
|
124
|
+
const H = i.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ o(
|
|
119
125
|
e.Description,
|
|
120
126
|
{
|
|
121
127
|
ref: s,
|
|
122
|
-
className:
|
|
128
|
+
className: n("text-sm text-muted-foreground", t),
|
|
123
129
|
...a
|
|
124
130
|
}
|
|
125
131
|
));
|
|
126
|
-
|
|
132
|
+
H.displayName = e.Description.displayName;
|
|
127
133
|
export {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
134
|
+
q as Dialog,
|
|
135
|
+
M as DialogClose,
|
|
136
|
+
z as DialogContent,
|
|
137
|
+
H as DialogDescription,
|
|
138
|
+
j as DialogFooter,
|
|
139
|
+
T as DialogHeader,
|
|
140
|
+
g as DialogOverlay,
|
|
141
|
+
R as DialogPortal,
|
|
142
|
+
k as DialogTitle,
|
|
143
|
+
B as DialogTrigger
|
|
138
144
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as t, useContext as i } from "react";
|
|
3
3
|
const o = Symbol.for("@oneplatformdev/ui.dialog-overlay-scope-context"), e = globalThis;
|
|
4
|
-
e[o] || (e[o] =
|
|
5
|
-
const
|
|
4
|
+
e[o] || (e[o] = t(null));
|
|
5
|
+
const r = t(null), g = () => i(r), m = ({ value: l, children: n }) => /* @__PURE__ */ a(r.Provider, { value: l, children: n });
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
r as DialogOverlayContainerCtx,
|
|
8
8
|
m as DialogOverlayScope,
|
|
9
9
|
g as useDialogOverlayContainer
|
|
10
10
|
};
|
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,19 +1,19 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import * as m from "react";
|
|
3
3
|
import * as o from "@radix-ui/react-popover";
|
|
4
|
-
import { cn as
|
|
5
|
-
import { useDialogOverlayContainer as
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
return console.log("container",
|
|
4
|
+
import { cn as l } from "@oneplatformdev/utils";
|
|
5
|
+
import { useDialogOverlayContainer as c } from "../Dialog/DialogOverlayScope.mjs";
|
|
6
|
+
const P = (t) => /* @__PURE__ */ a(o.Root, { ...t, modal: !1 }), h = o.Trigger, b = o.Anchor, f = m.forwardRef(({ className: t, align: n = "center", sideOffset: s = 4, style: i, ...d }, p) => {
|
|
7
|
+
const e = c(), r = e ? { container: e } : {};
|
|
8
|
+
return console.log("container", e), console.log("portalProps", r), /* @__PURE__ */ a(o.Portal, { ...r, children: /* @__PURE__ */ a(
|
|
9
9
|
o.Content,
|
|
10
10
|
{
|
|
11
|
-
ref:
|
|
12
|
-
align:
|
|
13
|
-
sideOffset:
|
|
14
|
-
className:
|
|
11
|
+
ref: p,
|
|
12
|
+
align: n,
|
|
13
|
+
sideOffset: s,
|
|
14
|
+
className: l(
|
|
15
15
|
"z-90 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",
|
|
@@ -23,10 +23,10 @@ const v = o.Root, P = o.Trigger, h = o.Anchor, c = m.forwardRef(({ className: a,
|
|
|
23
23
|
}
|
|
24
24
|
) });
|
|
25
25
|
});
|
|
26
|
-
|
|
26
|
+
f.displayName = o.Content.displayName;
|
|
27
27
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
P as Popover,
|
|
29
|
+
b as PopoverAnchor,
|
|
30
|
+
f as PopoverContent,
|
|
31
|
+
h as PopoverTrigger
|
|
32
32
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oneplatformdev/ui",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.129",
|
|
4
4
|
"description": "UI React Components.",
|
|
5
5
|
"author": "One Platform Development Team",
|
|
6
6
|
"keywords": [
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"registry": "https://registry.npmjs.org/",
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@oneplatformdev/hooks": "~0.0.1-beta.3",
|
|
39
|
-
"@oneplatformdev/utils": "~0.0.2-beta.
|
|
39
|
+
"@oneplatformdev/utils": "~0.0.2-beta.19"
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
"peerDependency": {
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
45
45
|
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
46
46
|
"@oneplatformdev/hooks": "~0.0.1-beta.7",
|
|
47
|
-
"@oneplatformdev/utils": "~0.0.2-beta.
|
|
47
|
+
"@oneplatformdev/utils": "~0.0.2-beta.19",
|
|
48
48
|
"lucide-react": "^0.469.0"
|
|
49
49
|
},
|
|
50
50
|
"peerDependenciesMeta": {
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@hookform/resolvers": "^3.9.1",
|
|
60
60
|
"@oneplatformdev/hooks": "~0.0.1-beta.7",
|
|
61
|
-
"@oneplatformdev/utils": "~0.0.2-beta.
|
|
61
|
+
"@oneplatformdev/utils": "~0.0.2-beta.19",
|
|
62
62
|
"@radix-ui/react-accordion": "^1.2.2",
|
|
63
63
|
"@radix-ui/react-alert-dialog": "^1.1.4",
|
|
64
64
|
"@radix-ui/react-aspect-ratio": "^1.1.1",
|