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