@oneplatformdev/ui 0.0.1-beta.85 → 0.0.1-beta.87
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.
@@ -1,38 +1,41 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import {
|
3
|
-
import { isFile as
|
4
|
-
import { X as
|
5
|
-
const
|
6
|
-
|
7
|
-
|
8
|
-
|
1
|
+
import { jsxs as s, jsx as r } from "react/jsx-runtime";
|
2
|
+
import { useMemo as c } from "react";
|
3
|
+
import { isFile as i } from "./DropzoneUtils.mjs";
|
4
|
+
import { X as a, FileIcon as u } from "lucide-react";
|
5
|
+
const d = (t) => {
|
6
|
+
if (!t) return "";
|
7
|
+
switch (!0) {
|
8
|
+
case (typeof t == "string" && !!t.trim() && t !== "null"):
|
9
|
+
return t;
|
10
|
+
case t instanceof File:
|
11
|
+
return URL.createObjectURL(t);
|
12
|
+
case t instanceof FileList:
|
13
|
+
return t[0] ? URL.createObjectURL(t[0]) : "";
|
14
|
+
default:
|
15
|
+
return "";
|
16
|
+
}
|
17
|
+
}, p = ({
|
18
|
+
item: t,
|
19
|
+
disabled: l,
|
20
|
+
onRemoveClick: n
|
9
21
|
}) => {
|
10
|
-
const
|
11
|
-
return
|
12
|
-
|
13
|
-
|
14
|
-
if (i.type.startsWith("image/")) {
|
15
|
-
const s = new FileReader();
|
16
|
-
s.onloadend = () => o(s.result), s.readAsDataURL(i);
|
17
|
-
} else
|
18
|
-
o(null);
|
19
|
-
} else
|
20
|
-
o(typeof e == "string" ? e : null);
|
21
|
-
}, [e, r]), /* @__PURE__ */ c("div", { className: "relative w-full h-64 sm:h-80 md:h-96 overflow-hidden outline-[#E4E4E7] outline-[2px] outline-dashed outline-offset-[-1px] rounded-lg", children: [
|
22
|
-
!a && /* @__PURE__ */ t("div", { className: "absolute top-2 right-2 cursor-pointer bg-white/70 rounded-[4px] p-1 shadow", onClick: d, children: /* @__PURE__ */ t(h, { size: 16, strokeWidth: 2, color: "black" }) }),
|
23
|
-
n ? /* @__PURE__ */ t(
|
22
|
+
const e = i(t) ? t.name : t, o = c(() => d(t), [t]);
|
23
|
+
return /* @__PURE__ */ s("div", { className: "relative w-full h-64 sm:h-80 md:h-96 overflow-hidden outline-[#E4E4E7] outline-[2px] outline-dashed outline-offset-[-1px] rounded-lg", children: [
|
24
|
+
!l && /* @__PURE__ */ r("div", { className: "absolute top-2 right-2 cursor-pointer bg-white/70 rounded-[4px] p-1 shadow", onClick: n, children: /* @__PURE__ */ r(a, { size: 16, strokeWidth: 2, color: "black" }) }),
|
25
|
+
o ? /* @__PURE__ */ r(
|
24
26
|
"img",
|
25
27
|
{
|
26
|
-
src:
|
27
|
-
alt:
|
28
|
+
src: o,
|
29
|
+
alt: e == null ? void 0 : e.toString(),
|
28
30
|
className: "w-full h-full object-cover rounded-lg "
|
29
31
|
}
|
30
|
-
) : /* @__PURE__ */
|
31
|
-
/* @__PURE__ */
|
32
|
-
/* @__PURE__ */
|
32
|
+
) : /* @__PURE__ */ s("div", { className: "w-full h-full flex flex-col items-center justify-center text-gray-600", children: [
|
33
|
+
/* @__PURE__ */ r(u, { size: 28 }),
|
34
|
+
/* @__PURE__ */ r("span", { className: "text-sm mt-2 break-all px-2 text-center", children: e == null ? void 0 : e.toString() })
|
33
35
|
] })
|
34
36
|
] });
|
35
37
|
};
|
36
38
|
export {
|
37
|
-
|
39
|
+
p as DropzoneSinglePickPreview,
|
40
|
+
d as transformImageToSrc
|
38
41
|
};
|
package/Select/SelectRoot.mjs
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
import { jsxs as n, jsx as t } from "react/jsx-runtime";
|
2
2
|
import * as l from "react";
|
3
3
|
import * as e from "@radix-ui/react-select";
|
4
|
-
import { ChevronDown as i, ChevronUp as
|
4
|
+
import { ChevronDown as i, ChevronUp as u, Check as h } from "lucide-react";
|
5
5
|
import { cn as s } from "@oneplatformdev/utils";
|
6
|
-
const
|
6
|
+
const R = e.Root, C = e.Group, I = e.Value, w = l.forwardRef(({ className: o, children: r, ...a }, d) => /* @__PURE__ */ n(
|
7
7
|
e.Trigger,
|
8
8
|
{
|
9
9
|
ref: d,
|
@@ -19,7 +19,7 @@ const v = e.Root, R = e.Group, C = e.Value, h = l.forwardRef(({ className: o, ch
|
|
19
19
|
]
|
20
20
|
}
|
21
21
|
));
|
22
|
-
|
22
|
+
w.displayName = e.Trigger.displayName;
|
23
23
|
const c = l.forwardRef(({ className: o, ...r }, a) => /* @__PURE__ */ t(
|
24
24
|
e.ScrollUpButton,
|
25
25
|
{
|
@@ -29,7 +29,7 @@ const c = l.forwardRef(({ className: o, ...r }, a) => /* @__PURE__ */ t(
|
|
29
29
|
o
|
30
30
|
),
|
31
31
|
...r,
|
32
|
-
children: /* @__PURE__ */ t(
|
32
|
+
children: /* @__PURE__ */ t(u, { className: "h-4 w-4" })
|
33
33
|
}
|
34
34
|
));
|
35
35
|
c.displayName = e.ScrollUpButton.displayName;
|
@@ -46,17 +46,21 @@ const m = l.forwardRef(({ className: o, ...r }, a) => /* @__PURE__ */ t(
|
|
46
46
|
}
|
47
47
|
));
|
48
48
|
m.displayName = e.ScrollDownButton.displayName;
|
49
|
-
const
|
49
|
+
const y = l.forwardRef(({ className: o, children: r, position: a = "popper", style: d, ...p }, f) => /* @__PURE__ */ t(e.Portal, { children: /* @__PURE__ */ n(
|
50
50
|
e.Content,
|
51
51
|
{
|
52
|
-
ref:
|
52
|
+
ref: f,
|
53
53
|
className: s(
|
54
54
|
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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",
|
55
55
|
a === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
56
56
|
o
|
57
57
|
),
|
58
58
|
position: a,
|
59
|
-
|
59
|
+
style: {
|
60
|
+
pointerEvents: "auto",
|
61
|
+
...d
|
62
|
+
},
|
63
|
+
...p,
|
60
64
|
children: [
|
61
65
|
/* @__PURE__ */ t(c, {}),
|
62
66
|
/* @__PURE__ */ t(
|
@@ -73,8 +77,8 @@ const w = l.forwardRef(({ className: o, children: r, position: a = "popper", ...
|
|
73
77
|
]
|
74
78
|
}
|
75
79
|
) }));
|
76
|
-
|
77
|
-
const
|
80
|
+
y.displayName = e.Content.displayName;
|
81
|
+
const g = l.forwardRef(({ className: o, ...r }, a) => /* @__PURE__ */ t(
|
78
82
|
e.Label,
|
79
83
|
{
|
80
84
|
ref: a,
|
@@ -82,8 +86,8 @@ const y = l.forwardRef(({ className: o, ...r }, a) => /* @__PURE__ */ t(
|
|
82
86
|
...r
|
83
87
|
}
|
84
88
|
));
|
85
|
-
|
86
|
-
const
|
89
|
+
g.displayName = e.Label.displayName;
|
90
|
+
const N = l.forwardRef(({ className: o, children: r, ...a }, d) => /* @__PURE__ */ n(
|
87
91
|
e.Item,
|
88
92
|
{
|
89
93
|
ref: d,
|
@@ -93,13 +97,13 @@ const g = l.forwardRef(({ className: o, children: r, ...a }, d) => /* @__PURE__
|
|
93
97
|
),
|
94
98
|
...a,
|
95
99
|
children: [
|
96
|
-
/* @__PURE__ */ t("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ t(e.ItemIndicator, { children: /* @__PURE__ */ t(
|
100
|
+
/* @__PURE__ */ t("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ t(e.ItemIndicator, { children: /* @__PURE__ */ t(h, { className: "h-4 w-4" }) }) }),
|
97
101
|
/* @__PURE__ */ t(e.ItemText, { children: r })
|
98
102
|
]
|
99
103
|
}
|
100
104
|
));
|
101
|
-
|
102
|
-
const
|
105
|
+
N.displayName = e.Item.displayName;
|
106
|
+
const x = l.forwardRef(({ className: o, ...r }, a) => /* @__PURE__ */ t(
|
103
107
|
e.Separator,
|
104
108
|
{
|
105
109
|
ref: a,
|
@@ -107,16 +111,16 @@ const N = l.forwardRef(({ className: o, ...r }, a) => /* @__PURE__ */ t(
|
|
107
111
|
...r
|
108
112
|
}
|
109
113
|
));
|
110
|
-
|
114
|
+
x.displayName = e.Separator.displayName;
|
111
115
|
export {
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
116
|
+
y as SelectContent,
|
117
|
+
C as SelectGroup,
|
118
|
+
N as SelectItem,
|
119
|
+
g as SelectLabel,
|
120
|
+
R as SelectRoot,
|
117
121
|
m as SelectScrollDownButton,
|
118
122
|
c as SelectScrollUpButton,
|
119
|
-
|
120
|
-
|
121
|
-
|
123
|
+
x as SelectSeparator,
|
124
|
+
w as SelectTrigger,
|
125
|
+
I as SelectValue
|
122
126
|
};
|