@prodivix/ui 0.1.0
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/LICENSE +21 -0
- package/dist/button/PdxButton.js +70 -0
- package/dist/button/PdxButtonLink.js +11 -0
- package/dist/container/PdxCard.js +32 -0
- package/dist/container/PdxDiv.js +80 -0
- package/dist/container/PdxPanel.js +71 -0
- package/dist/container/PdxSection.js +30 -0
- package/dist/data/PdxBadge.js +40 -0
- package/dist/data/PdxCheckList.js +58 -0
- package/dist/data/PdxDataGrid.js +70 -0
- package/dist/data/PdxList.js +35 -0
- package/dist/data/PdxProgress.js +38 -0
- package/dist/data/PdxSpinner.js +36 -0
- package/dist/data/PdxStatistic.js +40 -0
- package/dist/data/PdxSteps.js +37 -0
- package/dist/data/PdxTable.js +61 -0
- package/dist/data/PdxTag.js +36 -0
- package/dist/data/PdxTimeline.js +32 -0
- package/dist/data/PdxTree.js +71 -0
- package/dist/data/PdxTreeSelect.js +69 -0
- package/dist/embed/PdxEmbed.js +109 -0
- package/dist/embed/PdxIframe.js +76 -0
- package/dist/feedback/PdxDrawer.js +45 -0
- package/dist/feedback/PdxEmpty.js +33 -0
- package/dist/feedback/PdxMessage.js +32 -0
- package/dist/feedback/PdxModal.js +49 -0
- package/dist/feedback/PdxNotification.js +46 -0
- package/dist/feedback/PdxPopover.js +59 -0
- package/dist/feedback/PdxSkeleton.js +23 -0
- package/dist/feedback/PdxTooltip.js +30 -0
- package/dist/form/PdxColorPicker.js +75 -0
- package/dist/form/PdxDatePicker.js +89 -0
- package/dist/form/PdxDateRangePicker.js +90 -0
- package/dist/form/PdxFileUpload.js +108 -0
- package/dist/form/PdxImageUpload.js +87 -0
- package/dist/form/PdxPasswordStrength.js +73 -0
- package/dist/form/PdxRadioGroup.js +71 -0
- package/dist/form/PdxRange.js +95 -0
- package/dist/form/PdxRating.js +62 -0
- package/dist/form/PdxRegexInput.js +76 -0
- package/dist/form/PdxRegionPicker.js +121 -0
- package/dist/form/PdxRichTextEditor.js +177 -0
- package/dist/form/PdxSelect.js +69 -0
- package/dist/form/PdxSlider.js +64 -0
- package/dist/form/PdxTimePicker.js +89 -0
- package/dist/form/PdxVerificationCode.js +90 -0
- package/dist/icon/PdxIcon.js +73 -0
- package/dist/icon/PdxIconLink.js +13 -0
- package/dist/image/PdxAvatar.js +38 -0
- package/dist/image/PdxImage.js +39 -0
- package/dist/image/PdxImageGallery.js +77 -0
- package/dist/index.js +142 -0
- package/dist/input/PdxInput.js +75 -0
- package/dist/input/PdxSearch.js +89 -0
- package/dist/input/PdxTextarea.js +72 -0
- package/dist/link/PdxLink.js +34 -0
- package/dist/nav/PdxAnchorNavigation.js +37 -0
- package/dist/nav/PdxBreadcrumb.js +30 -0
- package/dist/nav/PdxCollapse.js +64 -0
- package/dist/nav/PdxNav.js +48 -0
- package/dist/nav/PdxNavbar.js +43 -0
- package/dist/nav/PdxOutlet.js +26 -0
- package/dist/nav/PdxPagination.js +66 -0
- package/dist/nav/PdxRoute.js +119 -0
- package/dist/nav/PdxSidebar.js +45 -0
- package/dist/nav/PdxTabs.js +49 -0
- package/dist/style.css +1 -0
- package/dist/text/PdxHeading.js +21 -0
- package/dist/text/PdxKbd.js +42 -0
- package/dist/text/PdxParagraph.js +21 -0
- package/dist/text/PdxText.js +22 -0
- package/dist/video/PdxAudio.js +57 -0
- package/dist/video/PdxVideo.js +84 -0
- package/package.json +67 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsxs as n, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import "@prodivix/shared";
|
|
4
|
+
import { useState as O, useEffect as j } from "react";
|
|
5
|
+
function H({
|
|
6
|
+
title: r,
|
|
7
|
+
content: c,
|
|
8
|
+
trigger: d = "Click",
|
|
9
|
+
open: e,
|
|
10
|
+
defaultOpen: P = !1,
|
|
11
|
+
onOpenChange: o,
|
|
12
|
+
panelClassName: m,
|
|
13
|
+
panelStyle: p,
|
|
14
|
+
children: f,
|
|
15
|
+
className: v,
|
|
16
|
+
style: u,
|
|
17
|
+
id: x,
|
|
18
|
+
dataAttributes: N = {}
|
|
19
|
+
}) {
|
|
20
|
+
const [g, t] = O(P);
|
|
21
|
+
j(() => {
|
|
22
|
+
e !== void 0 && t(e);
|
|
23
|
+
}, [e]);
|
|
24
|
+
const i = e !== void 0 ? e : g, s = (a) => {
|
|
25
|
+
e === void 0 && t(a), o && o(a);
|
|
26
|
+
}, h = `PdxPopover ${v || ""}`.trim(), C = { ...N };
|
|
27
|
+
return /* @__PURE__ */ n(
|
|
28
|
+
"span",
|
|
29
|
+
{
|
|
30
|
+
className: h,
|
|
31
|
+
style: u,
|
|
32
|
+
id: x,
|
|
33
|
+
...C,
|
|
34
|
+
...d === "Hover" ? {
|
|
35
|
+
onMouseEnter: () => s(!0),
|
|
36
|
+
onMouseLeave: () => s(!1)
|
|
37
|
+
} : {
|
|
38
|
+
onClick: () => s(!i)
|
|
39
|
+
},
|
|
40
|
+
children: [
|
|
41
|
+
f,
|
|
42
|
+
i && /* @__PURE__ */ n(
|
|
43
|
+
"span",
|
|
44
|
+
{
|
|
45
|
+
className: `PdxPopoverPanel ${m || ""}`.trim(),
|
|
46
|
+
style: p,
|
|
47
|
+
children: [
|
|
48
|
+
r && /* @__PURE__ */ l("div", { className: "PdxPopoverTitle", children: r }),
|
|
49
|
+
/* @__PURE__ */ l("div", { className: "PdxPopoverContent", children: c })
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
H as default
|
|
59
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import "@prodivix/shared";
|
|
4
|
+
function N({
|
|
5
|
+
variant: t = "Text",
|
|
6
|
+
width: m,
|
|
7
|
+
height: n,
|
|
8
|
+
lines: s = 1,
|
|
9
|
+
className: c,
|
|
10
|
+
style: d,
|
|
11
|
+
id: o,
|
|
12
|
+
dataAttributes: i = {}
|
|
13
|
+
}) {
|
|
14
|
+
const r = `PdxSkeleton ${t} ${c || ""}`.trim(), l = { ...i }, a = {
|
|
15
|
+
width: m,
|
|
16
|
+
height: n,
|
|
17
|
+
...d
|
|
18
|
+
};
|
|
19
|
+
return t === "Text" && s > 1 ? /* @__PURE__ */ e("div", { className: "PdxSkeletonGroup", id: o, ...l, children: Array.from({ length: s }).map((x, p) => /* @__PURE__ */ e("div", { className: r, style: a }, p)) }) : /* @__PURE__ */ e("div", { className: r, style: a, id: o, ...l });
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
N as default
|
|
23
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsxs as e, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import "@prodivix/shared";
|
|
4
|
+
function f({
|
|
5
|
+
content: o,
|
|
6
|
+
placement: t = "Top",
|
|
7
|
+
children: s,
|
|
8
|
+
className: a,
|
|
9
|
+
style: l,
|
|
10
|
+
id: n,
|
|
11
|
+
dataAttributes: p = {}
|
|
12
|
+
}) {
|
|
13
|
+
const r = `PdxTooltip ${a || ""}`.trim(), i = { ...p };
|
|
14
|
+
return /* @__PURE__ */ e(
|
|
15
|
+
"span",
|
|
16
|
+
{
|
|
17
|
+
className: r,
|
|
18
|
+
style: l,
|
|
19
|
+
id: n,
|
|
20
|
+
...i,
|
|
21
|
+
children: [
|
|
22
|
+
s,
|
|
23
|
+
/* @__PURE__ */ m("span", { className: `PdxTooltipContent ${t}`, children: o })
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
f as default
|
|
30
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsxs as x, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import "@prodivix/shared";
|
|
4
|
+
import { useState as v, useEffect as y } from "react";
|
|
5
|
+
const i = (e) => e ? e.startsWith("#") ? e : `#${e}` : "#000000";
|
|
6
|
+
function I({
|
|
7
|
+
label: e,
|
|
8
|
+
description: a,
|
|
9
|
+
message: n,
|
|
10
|
+
value: t,
|
|
11
|
+
defaultValue: f = "#3f3f3f",
|
|
12
|
+
size: u = "Medium",
|
|
13
|
+
disabled: l = !1,
|
|
14
|
+
showTextInput: p = !0,
|
|
15
|
+
onChange: c,
|
|
16
|
+
className: C,
|
|
17
|
+
style: h,
|
|
18
|
+
id: N,
|
|
19
|
+
dataAttributes: k = {}
|
|
20
|
+
}) {
|
|
21
|
+
const [g, d] = v(f);
|
|
22
|
+
y(() => {
|
|
23
|
+
t !== void 0 && d(t);
|
|
24
|
+
}, [t]);
|
|
25
|
+
const s = t !== void 0 ? t : g, m = (o) => {
|
|
26
|
+
const P = i(o);
|
|
27
|
+
t === void 0 && d(P), c && c(P);
|
|
28
|
+
}, F = `PdxColorPicker ${u} ${l ? "Disabled" : ""} ${C || ""}`.trim(), $ = { ...k };
|
|
29
|
+
return /* @__PURE__ */ x(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
className: `PdxField ${F}`,
|
|
33
|
+
style: h,
|
|
34
|
+
id: N,
|
|
35
|
+
...$,
|
|
36
|
+
children: [
|
|
37
|
+
e && /* @__PURE__ */ r("div", { className: "PdxFieldHeader", children: /* @__PURE__ */ r("label", { className: "PdxFieldLabel", children: e }) }),
|
|
38
|
+
a && /* @__PURE__ */ r("div", { className: "PdxFieldDescription", children: a }),
|
|
39
|
+
/* @__PURE__ */ x("div", { className: "PdxColorPickerControls", children: [
|
|
40
|
+
/* @__PURE__ */ r(
|
|
41
|
+
"input",
|
|
42
|
+
{
|
|
43
|
+
className: "PdxColorPickerInput",
|
|
44
|
+
type: "color",
|
|
45
|
+
value: i(s),
|
|
46
|
+
disabled: l,
|
|
47
|
+
onChange: (o) => m(o.target.value)
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
p && /* @__PURE__ */ r(
|
|
51
|
+
"input",
|
|
52
|
+
{
|
|
53
|
+
className: "PdxColorPickerText",
|
|
54
|
+
type: "text",
|
|
55
|
+
value: i(s),
|
|
56
|
+
disabled: l,
|
|
57
|
+
onChange: (o) => m(o.target.value)
|
|
58
|
+
}
|
|
59
|
+
),
|
|
60
|
+
/* @__PURE__ */ r(
|
|
61
|
+
"span",
|
|
62
|
+
{
|
|
63
|
+
className: "PdxColorPickerSwatch",
|
|
64
|
+
style: { backgroundColor: i(s) }
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
] }),
|
|
68
|
+
n && /* @__PURE__ */ r("div", { className: "PdxFieldMessage", children: n })
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
export {
|
|
74
|
+
I as default
|
|
75
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import "@prodivix/shared";
|
|
4
|
+
function b({
|
|
5
|
+
label: l,
|
|
6
|
+
description: i,
|
|
7
|
+
message: d,
|
|
8
|
+
value: o,
|
|
9
|
+
placeholder: x,
|
|
10
|
+
size: P = "Medium",
|
|
11
|
+
state: s = "Default",
|
|
12
|
+
disabled: t = !1,
|
|
13
|
+
readOnly: r = !1,
|
|
14
|
+
required: c = !1,
|
|
15
|
+
min: m,
|
|
16
|
+
max: f,
|
|
17
|
+
name: p,
|
|
18
|
+
autoFocus: u = !1,
|
|
19
|
+
showIcon: v = !0,
|
|
20
|
+
onChange: n,
|
|
21
|
+
onFocus: N,
|
|
22
|
+
onBlur: D,
|
|
23
|
+
className: k,
|
|
24
|
+
style: F,
|
|
25
|
+
id: h,
|
|
26
|
+
dataAttributes: $ = {},
|
|
27
|
+
onClick: g
|
|
28
|
+
}) {
|
|
29
|
+
const M = `PdxDatePicker ${P} ${s} ${t ? "Disabled" : ""} ${r ? "ReadOnly" : ""} ${k || ""}`.trim(), C = { ...$ }, w = (j) => {
|
|
30
|
+
n && n(j.target.value);
|
|
31
|
+
};
|
|
32
|
+
return /* @__PURE__ */ a(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
className: `PdxField ${M}`,
|
|
36
|
+
style: F,
|
|
37
|
+
...C,
|
|
38
|
+
children: [
|
|
39
|
+
l && /* @__PURE__ */ a("div", { className: "PdxFieldHeader", children: [
|
|
40
|
+
/* @__PURE__ */ e("label", { className: "PdxFieldLabel", htmlFor: h, children: l }),
|
|
41
|
+
c && /* @__PURE__ */ e("span", { className: "PdxFieldRequired", children: "*" })
|
|
42
|
+
] }),
|
|
43
|
+
i && /* @__PURE__ */ e("div", { className: "PdxFieldDescription", children: i }),
|
|
44
|
+
/* @__PURE__ */ a("div", { className: "PdxDatePickerControl", children: [
|
|
45
|
+
/* @__PURE__ */ e(
|
|
46
|
+
"input",
|
|
47
|
+
{
|
|
48
|
+
className: "PdxDatePickerInput",
|
|
49
|
+
id: h,
|
|
50
|
+
type: "date",
|
|
51
|
+
placeholder: x,
|
|
52
|
+
value: o,
|
|
53
|
+
disabled: t,
|
|
54
|
+
readOnly: r,
|
|
55
|
+
required: c,
|
|
56
|
+
min: m,
|
|
57
|
+
max: f,
|
|
58
|
+
name: p,
|
|
59
|
+
autoFocus: u,
|
|
60
|
+
onChange: w,
|
|
61
|
+
onFocus: N,
|
|
62
|
+
onBlur: D,
|
|
63
|
+
onClick: g
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
v && /* @__PURE__ */ e("span", { className: "PdxDatePickerIcon", children: /* @__PURE__ */ a(
|
|
67
|
+
"svg",
|
|
68
|
+
{
|
|
69
|
+
width: "16",
|
|
70
|
+
height: "16",
|
|
71
|
+
viewBox: "0 0 24 24",
|
|
72
|
+
fill: "none",
|
|
73
|
+
stroke: "currentColor",
|
|
74
|
+
strokeWidth: "2",
|
|
75
|
+
children: [
|
|
76
|
+
/* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2" }),
|
|
77
|
+
/* @__PURE__ */ e("path", { d: "M16 2v4M8 2v4M3 10h18" })
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
) })
|
|
81
|
+
] }),
|
|
82
|
+
d && /* @__PURE__ */ e("div", { className: `PdxFieldMessage ${s}`, children: d })
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
export {
|
|
88
|
+
b as default
|
|
89
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import "@prodivix/shared";
|
|
4
|
+
function S({
|
|
5
|
+
label: n,
|
|
6
|
+
description: r,
|
|
7
|
+
message: P,
|
|
8
|
+
startValue: o,
|
|
9
|
+
endValue: p,
|
|
10
|
+
startPlaceholder: D,
|
|
11
|
+
endPlaceholder: R,
|
|
12
|
+
size: g = "Medium",
|
|
13
|
+
state: x = "Default",
|
|
14
|
+
disabled: t = !1,
|
|
15
|
+
readOnly: s = !1,
|
|
16
|
+
required: d = !1,
|
|
17
|
+
min: m,
|
|
18
|
+
max: f,
|
|
19
|
+
name: h,
|
|
20
|
+
onChange: l,
|
|
21
|
+
onStartChange: u,
|
|
22
|
+
onEndChange: N,
|
|
23
|
+
className: F,
|
|
24
|
+
style: $,
|
|
25
|
+
id: v,
|
|
26
|
+
dataAttributes: k = {}
|
|
27
|
+
}) {
|
|
28
|
+
const j = `PdxDateRangePicker ${g} ${x} ${t ? "Disabled" : ""} ${s ? "ReadOnly" : ""} ${F || ""}`.trim(), I = { ...k }, M = (c) => {
|
|
29
|
+
const a = c.target.value;
|
|
30
|
+
u && u(a), l && l({ start: a, end: p || "" });
|
|
31
|
+
}, y = (c) => {
|
|
32
|
+
const a = c.target.value;
|
|
33
|
+
N && N(a), l && l({ start: o || "", end: a });
|
|
34
|
+
};
|
|
35
|
+
return /* @__PURE__ */ i(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
className: `PdxField ${j}`,
|
|
39
|
+
style: $,
|
|
40
|
+
...I,
|
|
41
|
+
children: [
|
|
42
|
+
n && /* @__PURE__ */ i("div", { className: "PdxFieldHeader", children: [
|
|
43
|
+
/* @__PURE__ */ e("label", { className: "PdxFieldLabel", htmlFor: v, children: n }),
|
|
44
|
+
d && /* @__PURE__ */ e("span", { className: "PdxFieldRequired", children: "*" })
|
|
45
|
+
] }),
|
|
46
|
+
r && /* @__PURE__ */ e("div", { className: "PdxFieldDescription", children: r }),
|
|
47
|
+
/* @__PURE__ */ i("div", { className: "PdxDateRangePickerControls", children: [
|
|
48
|
+
/* @__PURE__ */ e(
|
|
49
|
+
"input",
|
|
50
|
+
{
|
|
51
|
+
className: "PdxDateRangePickerInput",
|
|
52
|
+
id: v,
|
|
53
|
+
type: "date",
|
|
54
|
+
placeholder: D,
|
|
55
|
+
value: o,
|
|
56
|
+
disabled: t,
|
|
57
|
+
readOnly: s,
|
|
58
|
+
required: d,
|
|
59
|
+
min: m,
|
|
60
|
+
max: f,
|
|
61
|
+
name: h,
|
|
62
|
+
onChange: M
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
/* @__PURE__ */ e("span", { className: "PdxDateRangePickerSeparator", children: "to" }),
|
|
66
|
+
/* @__PURE__ */ e(
|
|
67
|
+
"input",
|
|
68
|
+
{
|
|
69
|
+
className: "PdxDateRangePickerInput",
|
|
70
|
+
type: "date",
|
|
71
|
+
placeholder: R,
|
|
72
|
+
value: p,
|
|
73
|
+
disabled: t,
|
|
74
|
+
readOnly: s,
|
|
75
|
+
required: d,
|
|
76
|
+
min: m,
|
|
77
|
+
max: f,
|
|
78
|
+
name: h,
|
|
79
|
+
onChange: y
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
] }),
|
|
83
|
+
P && /* @__PURE__ */ e("div", { className: `PdxFieldMessage ${x}`, children: P })
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
export {
|
|
89
|
+
S as default
|
|
90
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { jsxs as a, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import "@prodivix/shared";
|
|
4
|
+
import { useState as z, useRef as I, useEffect as S } from "react";
|
|
5
|
+
function B({
|
|
6
|
+
label: n,
|
|
7
|
+
description: r,
|
|
8
|
+
message: t,
|
|
9
|
+
accept: x,
|
|
10
|
+
multiple: o = !1,
|
|
11
|
+
disabled: i = !1,
|
|
12
|
+
required: u = !1,
|
|
13
|
+
showList: F = !0,
|
|
14
|
+
value: s,
|
|
15
|
+
defaultValue: P,
|
|
16
|
+
onChange: c,
|
|
17
|
+
className: N,
|
|
18
|
+
style: v,
|
|
19
|
+
id: U,
|
|
20
|
+
dataAttributes: g = {}
|
|
21
|
+
}) {
|
|
22
|
+
const [p, h] = z(P || []), m = I(null);
|
|
23
|
+
S(() => {
|
|
24
|
+
s && h(s);
|
|
25
|
+
}, [s]);
|
|
26
|
+
const f = (e) => {
|
|
27
|
+
s || h(e), c && c(e);
|
|
28
|
+
}, D = (e) => {
|
|
29
|
+
const d = Array.from(e.target.files || []);
|
|
30
|
+
f(d);
|
|
31
|
+
}, k = (e) => {
|
|
32
|
+
if (e.preventDefault(), i) return;
|
|
33
|
+
const d = Array.from(e.dataTransfer.files || []);
|
|
34
|
+
f(d);
|
|
35
|
+
}, C = (e) => {
|
|
36
|
+
e.preventDefault();
|
|
37
|
+
}, M = () => {
|
|
38
|
+
i || m.current?.click();
|
|
39
|
+
}, $ = `PdxFileUpload ${i ? "Disabled" : ""} ${N || ""}`.trim(), y = { ...g };
|
|
40
|
+
return /* @__PURE__ */ a(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
className: `PdxField ${$}`,
|
|
44
|
+
style: v,
|
|
45
|
+
id: U,
|
|
46
|
+
...y,
|
|
47
|
+
children: [
|
|
48
|
+
n && /* @__PURE__ */ a("div", { className: "PdxFieldHeader", children: [
|
|
49
|
+
/* @__PURE__ */ l("label", { className: "PdxFieldLabel", children: n }),
|
|
50
|
+
u && /* @__PURE__ */ l("span", { className: "PdxFieldRequired", children: "*" })
|
|
51
|
+
] }),
|
|
52
|
+
r && /* @__PURE__ */ l("div", { className: "PdxFieldDescription", children: r }),
|
|
53
|
+
/* @__PURE__ */ a(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
className: "PdxFileUploadDropzone",
|
|
57
|
+
onClick: M,
|
|
58
|
+
onDrop: k,
|
|
59
|
+
onDragOver: C,
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ l("div", { className: "PdxFileUploadIcon", children: /* @__PURE__ */ a(
|
|
62
|
+
"svg",
|
|
63
|
+
{
|
|
64
|
+
width: "20",
|
|
65
|
+
height: "20",
|
|
66
|
+
viewBox: "0 0 24 24",
|
|
67
|
+
fill: "none",
|
|
68
|
+
stroke: "currentColor",
|
|
69
|
+
strokeWidth: "2",
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ l("path", { d: "M12 3v12" }),
|
|
72
|
+
/* @__PURE__ */ l("path", { d: "m7 8 5-5 5 5" }),
|
|
73
|
+
/* @__PURE__ */ l("path", { d: "M5 21h14" })
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
) }),
|
|
77
|
+
/* @__PURE__ */ l("div", { className: "PdxFileUploadText", children: "Click or drag files to upload" }),
|
|
78
|
+
/* @__PURE__ */ l("div", { className: "PdxFileUploadHint", children: o ? "Multiple files allowed" : "Single file only" })
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
/* @__PURE__ */ l(
|
|
83
|
+
"input",
|
|
84
|
+
{
|
|
85
|
+
ref: m,
|
|
86
|
+
className: "PdxFileUploadInput",
|
|
87
|
+
type: "file",
|
|
88
|
+
accept: x,
|
|
89
|
+
multiple: o,
|
|
90
|
+
disabled: i,
|
|
91
|
+
onChange: D
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
F && p.length > 0 && /* @__PURE__ */ l("ul", { className: "PdxFileUploadList", children: p.map((e) => /* @__PURE__ */ a("li", { className: "PdxFileUploadItem", children: [
|
|
95
|
+
/* @__PURE__ */ l("span", { className: "PdxFileUploadName", children: e.name }),
|
|
96
|
+
/* @__PURE__ */ a("span", { className: "PdxFileUploadSize", children: [
|
|
97
|
+
Math.round(e.size / 1024),
|
|
98
|
+
" KB"
|
|
99
|
+
] })
|
|
100
|
+
] }, `${e.name}-${e.size}`)) }),
|
|
101
|
+
t && /* @__PURE__ */ l("div", { className: "PdxFieldMessage", children: t })
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
export {
|
|
107
|
+
B as default
|
|
108
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { jsxs as u, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import "@prodivix/shared";
|
|
4
|
+
import { useState as h, useRef as w, useEffect as x } from "react";
|
|
5
|
+
function T({
|
|
6
|
+
label: i,
|
|
7
|
+
description: t,
|
|
8
|
+
message: d,
|
|
9
|
+
accept: g = "image/*",
|
|
10
|
+
multiple: P = !1,
|
|
11
|
+
disabled: s = !1,
|
|
12
|
+
required: v = !1,
|
|
13
|
+
value: r,
|
|
14
|
+
defaultValue: N,
|
|
15
|
+
onChange: n,
|
|
16
|
+
className: U,
|
|
17
|
+
style: I,
|
|
18
|
+
id: D,
|
|
19
|
+
dataAttributes: F = {}
|
|
20
|
+
}) {
|
|
21
|
+
const [c, o] = h(N || []), [m, R] = h([]), p = w(null);
|
|
22
|
+
x(() => {
|
|
23
|
+
r && o(r);
|
|
24
|
+
}, [r]), x(() => {
|
|
25
|
+
const e = c.map((a) => URL.createObjectURL(a));
|
|
26
|
+
return R(e), () => {
|
|
27
|
+
e.forEach((a) => URL.revokeObjectURL(a));
|
|
28
|
+
};
|
|
29
|
+
}, [c]);
|
|
30
|
+
const f = (e) => {
|
|
31
|
+
r || o(e), n && n(e);
|
|
32
|
+
}, $ = (e) => {
|
|
33
|
+
const a = Array.from(e.target.files || []);
|
|
34
|
+
f(a);
|
|
35
|
+
}, k = (e) => {
|
|
36
|
+
if (e.preventDefault(), s) return;
|
|
37
|
+
const a = Array.from(e.dataTransfer.files || []);
|
|
38
|
+
f(a);
|
|
39
|
+
}, C = (e) => {
|
|
40
|
+
e.preventDefault();
|
|
41
|
+
}, L = () => {
|
|
42
|
+
s || p.current?.click();
|
|
43
|
+
}, j = `PdxImageUpload ${s ? "Disabled" : ""} ${U || ""}`.trim(), O = { ...F };
|
|
44
|
+
return /* @__PURE__ */ u(
|
|
45
|
+
"div",
|
|
46
|
+
{
|
|
47
|
+
className: `PdxField ${j}`,
|
|
48
|
+
style: I,
|
|
49
|
+
id: D,
|
|
50
|
+
...O,
|
|
51
|
+
children: [
|
|
52
|
+
i && /* @__PURE__ */ u("div", { className: "PdxFieldHeader", children: [
|
|
53
|
+
/* @__PURE__ */ l("label", { className: "PdxFieldLabel", children: i }),
|
|
54
|
+
v && /* @__PURE__ */ l("span", { className: "PdxFieldRequired", children: "*" })
|
|
55
|
+
] }),
|
|
56
|
+
t && /* @__PURE__ */ l("div", { className: "PdxFieldDescription", children: t }),
|
|
57
|
+
/* @__PURE__ */ l(
|
|
58
|
+
"div",
|
|
59
|
+
{
|
|
60
|
+
className: "PdxImageUploadDropzone",
|
|
61
|
+
onClick: L,
|
|
62
|
+
onDrop: k,
|
|
63
|
+
onDragOver: C,
|
|
64
|
+
children: /* @__PURE__ */ l("div", { className: "PdxImageUploadText", children: "Click or drag images to upload" })
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
/* @__PURE__ */ l(
|
|
68
|
+
"input",
|
|
69
|
+
{
|
|
70
|
+
ref: p,
|
|
71
|
+
className: "PdxImageUploadInput",
|
|
72
|
+
type: "file",
|
|
73
|
+
accept: g,
|
|
74
|
+
multiple: P,
|
|
75
|
+
disabled: s,
|
|
76
|
+
onChange: $
|
|
77
|
+
}
|
|
78
|
+
),
|
|
79
|
+
m.length > 0 && /* @__PURE__ */ l("div", { className: "PdxImageUploadGrid", children: m.map((e, a) => /* @__PURE__ */ l("div", { className: "PdxImageUploadItem", children: /* @__PURE__ */ l("img", { src: e, alt: `Preview ${a + 1}` }) }, `${e}-${a}`)) }),
|
|
80
|
+
d && /* @__PURE__ */ l("div", { className: "PdxFieldMessage", children: d })
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
export {
|
|
86
|
+
T as default
|
|
87
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { jsxs as h, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import "@prodivix/shared";
|
|
4
|
+
import { useState as y, useEffect as A } from "react";
|
|
5
|
+
const j = (t, d) => {
|
|
6
|
+
let e = 0;
|
|
7
|
+
return t.length >= d && (e += 1), /[A-Z]/.test(t) && (e += 1), /[a-z]/.test(t) && (e += 1), /\d/.test(t) && (e += 1), /[^A-Za-z0-9]/.test(t) && (e += 1), Math.min(e, 4);
|
|
8
|
+
};
|
|
9
|
+
function I({
|
|
10
|
+
label: t,
|
|
11
|
+
description: d,
|
|
12
|
+
message: e,
|
|
13
|
+
value: r,
|
|
14
|
+
defaultValue: P,
|
|
15
|
+
size: f = "Medium",
|
|
16
|
+
disabled: n = !1,
|
|
17
|
+
required: x = !1,
|
|
18
|
+
minLength: p = 8,
|
|
19
|
+
showText: u = !0,
|
|
20
|
+
strengthLabels: g = ["Very weak", "Weak", "Medium", "Strong", "Very strong"],
|
|
21
|
+
onChange: l,
|
|
22
|
+
className: N,
|
|
23
|
+
style: S,
|
|
24
|
+
id: w,
|
|
25
|
+
dataAttributes: F = {}
|
|
26
|
+
}) {
|
|
27
|
+
const [V, c] = y(P || "");
|
|
28
|
+
A(() => {
|
|
29
|
+
r !== void 0 && c(r);
|
|
30
|
+
}, [r]);
|
|
31
|
+
const o = r !== void 0 ? r : V, i = j(o, p), $ = (m) => {
|
|
32
|
+
const a = m.target.value;
|
|
33
|
+
r === void 0 && c(a), l && l(a);
|
|
34
|
+
}, M = `PdxPasswordStrength ${f} ${n ? "Disabled" : ""} ${N || ""}`.trim(), v = { ...F };
|
|
35
|
+
return /* @__PURE__ */ h(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
className: `PdxField ${M}`,
|
|
39
|
+
style: S,
|
|
40
|
+
id: w,
|
|
41
|
+
...v,
|
|
42
|
+
children: [
|
|
43
|
+
t && /* @__PURE__ */ h("div", { className: "PdxFieldHeader", children: [
|
|
44
|
+
/* @__PURE__ */ s("label", { className: "PdxFieldLabel", children: t }),
|
|
45
|
+
x && /* @__PURE__ */ s("span", { className: "PdxFieldRequired", children: "*" })
|
|
46
|
+
] }),
|
|
47
|
+
d && /* @__PURE__ */ s("div", { className: "PdxFieldDescription", children: d }),
|
|
48
|
+
/* @__PURE__ */ s(
|
|
49
|
+
"input",
|
|
50
|
+
{
|
|
51
|
+
className: "PdxPasswordStrengthInput",
|
|
52
|
+
type: "password",
|
|
53
|
+
value: o,
|
|
54
|
+
disabled: n,
|
|
55
|
+
onChange: $
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
/* @__PURE__ */ s("div", { className: "PdxPasswordStrengthMeter", "aria-hidden": !0, children: Array.from({ length: 4 }).map((m, a) => /* @__PURE__ */ s(
|
|
59
|
+
"span",
|
|
60
|
+
{
|
|
61
|
+
className: `PdxPasswordStrengthBar ${i > a ? "Active" : ""} Level${i}`
|
|
62
|
+
},
|
|
63
|
+
a
|
|
64
|
+
)) }),
|
|
65
|
+
u && /* @__PURE__ */ s("div", { className: "PdxPasswordStrengthText", children: g[i] || "" }),
|
|
66
|
+
e && /* @__PURE__ */ s("div", { className: "PdxFieldMessage", children: e })
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
export {
|
|
72
|
+
I as default
|
|
73
|
+
};
|