@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,64 @@
|
|
|
1
|
+
import { jsxs as m, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import "@prodivix/shared";
|
|
4
|
+
import { useState as j, useEffect as C } from "react";
|
|
5
|
+
function E({
|
|
6
|
+
label: a,
|
|
7
|
+
description: i,
|
|
8
|
+
message: l,
|
|
9
|
+
min: s = 0,
|
|
10
|
+
max: u = 100,
|
|
11
|
+
step: x = 1,
|
|
12
|
+
value: e,
|
|
13
|
+
defaultValue: f,
|
|
14
|
+
size: p = "Medium",
|
|
15
|
+
disabled: r = !1,
|
|
16
|
+
showValue: P = !0,
|
|
17
|
+
onChange: t,
|
|
18
|
+
className: N,
|
|
19
|
+
style: h,
|
|
20
|
+
id: F,
|
|
21
|
+
dataAttributes: S = {}
|
|
22
|
+
}) {
|
|
23
|
+
const [V, n] = j(f ?? s);
|
|
24
|
+
C(() => {
|
|
25
|
+
e !== void 0 && n(e);
|
|
26
|
+
}, [e]);
|
|
27
|
+
const c = e !== void 0 ? e : V, v = (b) => {
|
|
28
|
+
const o = Number(b.target.value);
|
|
29
|
+
e === void 0 && n(o), t && t(o);
|
|
30
|
+
}, $ = `PdxSlider ${p} ${r ? "Disabled" : ""} ${N || ""}`.trim(), g = { ...S };
|
|
31
|
+
return /* @__PURE__ */ m(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
className: `PdxField ${$}`,
|
|
35
|
+
style: h,
|
|
36
|
+
id: F,
|
|
37
|
+
...g,
|
|
38
|
+
children: [
|
|
39
|
+
a && /* @__PURE__ */ m("div", { className: "PdxFieldHeader", children: [
|
|
40
|
+
/* @__PURE__ */ d("label", { className: "PdxFieldLabel", children: a }),
|
|
41
|
+
P && /* @__PURE__ */ d("span", { className: "PdxSliderValue", children: c })
|
|
42
|
+
] }),
|
|
43
|
+
i && /* @__PURE__ */ d("div", { className: "PdxFieldDescription", children: i }),
|
|
44
|
+
/* @__PURE__ */ d(
|
|
45
|
+
"input",
|
|
46
|
+
{
|
|
47
|
+
className: "PdxSliderInput",
|
|
48
|
+
type: "range",
|
|
49
|
+
min: s,
|
|
50
|
+
max: u,
|
|
51
|
+
step: x,
|
|
52
|
+
value: c,
|
|
53
|
+
disabled: r,
|
|
54
|
+
onChange: v
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
l && /* @__PURE__ */ d("div", { className: "PdxFieldMessage", children: l })
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
export {
|
|
63
|
+
E as default
|
|
64
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import "@prodivix/shared";
|
|
4
|
+
function R({
|
|
5
|
+
label: l,
|
|
6
|
+
description: a,
|
|
7
|
+
message: d,
|
|
8
|
+
value: o,
|
|
9
|
+
placeholder: h,
|
|
10
|
+
size: P = "Medium",
|
|
11
|
+
state: s = "Default",
|
|
12
|
+
disabled: c = !1,
|
|
13
|
+
readOnly: r = !1,
|
|
14
|
+
required: t = !1,
|
|
15
|
+
min: x,
|
|
16
|
+
max: f,
|
|
17
|
+
name: p,
|
|
18
|
+
autoFocus: u = !1,
|
|
19
|
+
showIcon: N = !0,
|
|
20
|
+
onChange: n,
|
|
21
|
+
onFocus: v,
|
|
22
|
+
onBlur: k,
|
|
23
|
+
className: F,
|
|
24
|
+
style: $,
|
|
25
|
+
id: m,
|
|
26
|
+
dataAttributes: T = {},
|
|
27
|
+
onClick: g
|
|
28
|
+
}) {
|
|
29
|
+
const C = `PdxTimePicker ${P} ${s} ${c ? "Disabled" : ""} ${r ? "ReadOnly" : ""} ${F || ""}`.trim(), D = { ...T }, M = (j) => {
|
|
30
|
+
n && n(j.target.value);
|
|
31
|
+
};
|
|
32
|
+
return /* @__PURE__ */ i(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
className: `PdxField ${C}`,
|
|
36
|
+
style: $,
|
|
37
|
+
...D,
|
|
38
|
+
children: [
|
|
39
|
+
l && /* @__PURE__ */ i("div", { className: "PdxFieldHeader", children: [
|
|
40
|
+
/* @__PURE__ */ e("label", { className: "PdxFieldLabel", htmlFor: m, children: l }),
|
|
41
|
+
t && /* @__PURE__ */ e("span", { className: "PdxFieldRequired", children: "*" })
|
|
42
|
+
] }),
|
|
43
|
+
a && /* @__PURE__ */ e("div", { className: "PdxFieldDescription", children: a }),
|
|
44
|
+
/* @__PURE__ */ i("div", { className: "PdxTimePickerControl", children: [
|
|
45
|
+
/* @__PURE__ */ e(
|
|
46
|
+
"input",
|
|
47
|
+
{
|
|
48
|
+
className: "PdxTimePickerInput",
|
|
49
|
+
id: m,
|
|
50
|
+
type: "time",
|
|
51
|
+
placeholder: h,
|
|
52
|
+
value: o,
|
|
53
|
+
disabled: c,
|
|
54
|
+
readOnly: r,
|
|
55
|
+
required: t,
|
|
56
|
+
min: x,
|
|
57
|
+
max: f,
|
|
58
|
+
name: p,
|
|
59
|
+
autoFocus: u,
|
|
60
|
+
onChange: M,
|
|
61
|
+
onFocus: v,
|
|
62
|
+
onBlur: k,
|
|
63
|
+
onClick: g
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
N && /* @__PURE__ */ e("span", { className: "PdxTimePickerIcon", children: /* @__PURE__ */ i(
|
|
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("circle", { cx: "12", cy: "12", r: "9" }),
|
|
77
|
+
/* @__PURE__ */ e("path", { d: "M12 7v6l4 2" })
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
) })
|
|
81
|
+
] }),
|
|
82
|
+
d && /* @__PURE__ */ e("div", { className: `PdxFieldMessage ${s}`, children: d })
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
export {
|
|
88
|
+
R as default
|
|
89
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { jsxs as N, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import "@prodivix/shared";
|
|
4
|
+
import { useState as S, useRef as _, useEffect as B } from "react";
|
|
5
|
+
function G({
|
|
6
|
+
label: d,
|
|
7
|
+
description: l,
|
|
8
|
+
message: f,
|
|
9
|
+
length: c = 6,
|
|
10
|
+
value: i,
|
|
11
|
+
defaultValue: C,
|
|
12
|
+
size: D = "Medium",
|
|
13
|
+
state: u = "Default",
|
|
14
|
+
disabled: m = !1,
|
|
15
|
+
autoFocus: v = !1,
|
|
16
|
+
masked: y = !1,
|
|
17
|
+
separator: p,
|
|
18
|
+
onChange: P,
|
|
19
|
+
onComplete: V,
|
|
20
|
+
className: F,
|
|
21
|
+
style: $,
|
|
22
|
+
id: I,
|
|
23
|
+
dataAttributes: M = {}
|
|
24
|
+
}) {
|
|
25
|
+
const [j, h] = S(C || ""), r = _([]);
|
|
26
|
+
B(() => {
|
|
27
|
+
i !== void 0 && h(i);
|
|
28
|
+
}, [i]);
|
|
29
|
+
const w = i !== void 0 ? i : j, n = Array.from(
|
|
30
|
+
{ length: c },
|
|
31
|
+
(a, e) => w[e] || ""
|
|
32
|
+
), x = (a) => {
|
|
33
|
+
const e = a.join("");
|
|
34
|
+
i === void 0 && h(e), P && P(e), V && a.every((t) => t) && V(e);
|
|
35
|
+
}, b = (a) => (e) => {
|
|
36
|
+
const t = e.target.value.slice(-1), o = [...n];
|
|
37
|
+
o[a] = t, x(o), t && a < c - 1 && r.current[a + 1]?.focus();
|
|
38
|
+
}, k = (a) => (e) => {
|
|
39
|
+
e.key === "Backspace" && !n[a] && a > 0 && r.current[a - 1]?.focus();
|
|
40
|
+
}, A = (a) => {
|
|
41
|
+
const e = a.clipboardData.getData("text").slice(0, c);
|
|
42
|
+
if (!e)
|
|
43
|
+
return;
|
|
44
|
+
const t = Array.from(
|
|
45
|
+
{ length: c },
|
|
46
|
+
(E, R) => e[R] || ""
|
|
47
|
+
);
|
|
48
|
+
x(t);
|
|
49
|
+
const o = Math.min(e.length, c - 1);
|
|
50
|
+
r.current[o]?.focus(), a.preventDefault();
|
|
51
|
+
}, K = `PdxVerificationCode ${D} ${u} ${m ? "Disabled" : ""} ${F || ""}`.trim(), L = { ...M };
|
|
52
|
+
return /* @__PURE__ */ N(
|
|
53
|
+
"div",
|
|
54
|
+
{
|
|
55
|
+
className: `PdxField ${K}`,
|
|
56
|
+
style: $,
|
|
57
|
+
id: I,
|
|
58
|
+
...L,
|
|
59
|
+
children: [
|
|
60
|
+
d && /* @__PURE__ */ s("div", { className: "PdxFieldHeader", children: /* @__PURE__ */ s("label", { className: "PdxFieldLabel", children: d }) }),
|
|
61
|
+
l && /* @__PURE__ */ s("div", { className: "PdxFieldDescription", children: l }),
|
|
62
|
+
/* @__PURE__ */ s("div", { className: "PdxVerificationCodeInputs", children: n.map((a, e) => /* @__PURE__ */ N("div", { className: "PdxVerificationCodeItem", children: [
|
|
63
|
+
/* @__PURE__ */ s(
|
|
64
|
+
"input",
|
|
65
|
+
{
|
|
66
|
+
ref: (t) => {
|
|
67
|
+
r.current[e] = t;
|
|
68
|
+
},
|
|
69
|
+
className: "PdxVerificationCodeInput",
|
|
70
|
+
type: y ? "password" : "text",
|
|
71
|
+
inputMode: "numeric",
|
|
72
|
+
maxLength: 1,
|
|
73
|
+
value: a,
|
|
74
|
+
autoFocus: v && e === 0,
|
|
75
|
+
disabled: m,
|
|
76
|
+
onChange: b(e),
|
|
77
|
+
onKeyDown: k(e),
|
|
78
|
+
onPaste: A
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
p && e < c - 1 && /* @__PURE__ */ s("span", { className: "PdxVerificationCodeSeparator", children: p })
|
|
82
|
+
] }, e)) }),
|
|
83
|
+
f && /* @__PURE__ */ s("div", { className: `PdxFieldMessage ${u}`, children: f })
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
export {
|
|
89
|
+
G as default
|
|
90
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import p from "react";
|
|
3
|
+
import "@prodivix/shared";
|
|
4
|
+
/* empty css */
|
|
5
|
+
const g = (n) => typeof n == "function" || typeof n == "object" && n !== null && "$$typeof" in n, d = (n, t = "currentColor", e) => /* @__PURE__ */ a(
|
|
6
|
+
"svg",
|
|
7
|
+
{
|
|
8
|
+
width: n ?? 24,
|
|
9
|
+
height: n ?? 24,
|
|
10
|
+
viewBox: "0 0 24 24",
|
|
11
|
+
fill: "none",
|
|
12
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13
|
+
"aria-hidden": e ? void 0 : !0,
|
|
14
|
+
"aria-label": e,
|
|
15
|
+
children: /* @__PURE__ */ a("circle", { cx: "12", cy: "12", r: "8", stroke: t, strokeWidth: "2" })
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
function u(n, t, e, r) {
|
|
19
|
+
if (!n)
|
|
20
|
+
return d(t, e, r);
|
|
21
|
+
if (p.isValidElement(n)) {
|
|
22
|
+
const s = n, l = s.props || {}, o = {};
|
|
23
|
+
if (t !== void 0)
|
|
24
|
+
if ("size" in l)
|
|
25
|
+
o.size = t;
|
|
26
|
+
else if (typeof s.type == "string" && s.type === "svg")
|
|
27
|
+
o.width = t, o.height = t;
|
|
28
|
+
else {
|
|
29
|
+
const f = l.style ?? {};
|
|
30
|
+
o.style = {
|
|
31
|
+
...f,
|
|
32
|
+
width: t,
|
|
33
|
+
height: t
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return e !== void 0 && ("color" in l ? o.color = e : l.fill !== void 0 || s.type === "svg" ? o.fill = e : o.stroke = e), r && s.type === "svg" && !l["aria-label"] && (o["aria-label"] = r), p.cloneElement(s, o);
|
|
37
|
+
}
|
|
38
|
+
if (!g(n))
|
|
39
|
+
return d(t, e, r);
|
|
40
|
+
const c = n, i = {};
|
|
41
|
+
return t !== void 0 && (i.size = t, i.width = t, i.height = t), e !== void 0 && (i.color = e, i.style = { color: e }), r && (i.title = r), /* @__PURE__ */ a(c, { ...i });
|
|
42
|
+
}
|
|
43
|
+
function P({
|
|
44
|
+
icon: n,
|
|
45
|
+
size: t = 24,
|
|
46
|
+
color: e = "currentColor",
|
|
47
|
+
title: r,
|
|
48
|
+
className: c,
|
|
49
|
+
style: i,
|
|
50
|
+
id: s,
|
|
51
|
+
dataAttributes: l = {},
|
|
52
|
+
onClick: o
|
|
53
|
+
}) {
|
|
54
|
+
const f = `PdxIcon ${c || ""}`.trim(), h = { ...l }, m = t !== void 0 ? { fontSize: typeof t == "number" ? `${t}px` : t } : {}, y = r ? { role: "img", "aria-label": r } : { "aria-hidden": !0 };
|
|
55
|
+
return /* @__PURE__ */ a(
|
|
56
|
+
"span",
|
|
57
|
+
{
|
|
58
|
+
className: f,
|
|
59
|
+
style: {
|
|
60
|
+
...m,
|
|
61
|
+
...i
|
|
62
|
+
},
|
|
63
|
+
id: s,
|
|
64
|
+
onClick: o,
|
|
65
|
+
...y,
|
|
66
|
+
...h,
|
|
67
|
+
children: u(n, t, e, r)
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
export {
|
|
72
|
+
P as default
|
|
73
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import "react-router";
|
|
4
|
+
import m from "./PdxIcon.js";
|
|
5
|
+
import c from "../link/PdxLink.js";
|
|
6
|
+
/* empty css */
|
|
7
|
+
function P(t) {
|
|
8
|
+
const { to: i, title: o, ...n } = t;
|
|
9
|
+
return /* @__PURE__ */ r(c, { className: "PdxIconLink", to: i, title: o, children: /* @__PURE__ */ r(m, { ...n, title: o }) });
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
P as default
|
|
13
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsxs as P, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import C from "react";
|
|
3
|
+
import "@prodivix/shared";
|
|
4
|
+
function I({
|
|
5
|
+
src: t,
|
|
6
|
+
alt: e = "Avatar",
|
|
7
|
+
size: d = "Medium",
|
|
8
|
+
shape: c = "Circle",
|
|
9
|
+
fallback: n,
|
|
10
|
+
initials: s,
|
|
11
|
+
status: a,
|
|
12
|
+
className: m,
|
|
13
|
+
style: l,
|
|
14
|
+
id: p,
|
|
15
|
+
dataAttributes: u = {},
|
|
16
|
+
onError: o,
|
|
17
|
+
...i
|
|
18
|
+
}) {
|
|
19
|
+
const [f, x] = C.useState(!1), h = `PdxAvatar ${d} ${c} ${a ? `status-${a}` : ""} ${m || ""}`.trim(), v = { ...u };
|
|
20
|
+
return /* @__PURE__ */ P(
|
|
21
|
+
"div",
|
|
22
|
+
{
|
|
23
|
+
className: h,
|
|
24
|
+
style: l,
|
|
25
|
+
id: p,
|
|
26
|
+
...v,
|
|
27
|
+
children: [
|
|
28
|
+
t && !f ? /* @__PURE__ */ r("img", { src: t, alt: e, onError: (A) => {
|
|
29
|
+
x(!0), o && o(A);
|
|
30
|
+
}, ...i }) : s ? /* @__PURE__ */ r("span", { className: "PdxAvatar-initials", children: s }) : n ? /* @__PURE__ */ r("img", { src: n, alt: e, ...i }) : /* @__PURE__ */ r("span", { className: "PdxAvatar-placeholder", children: e.charAt(0).toUpperCase() }),
|
|
31
|
+
a && /* @__PURE__ */ r("span", { className: "PdxAvatar-status" })
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
I as default
|
|
38
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as g } from "react/jsx-runtime";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import "react";
|
|
4
|
+
import "@prodivix/shared";
|
|
5
|
+
function I({
|
|
6
|
+
src: o,
|
|
7
|
+
alt: a,
|
|
8
|
+
size: t = "Medium",
|
|
9
|
+
fit: e = "Cover",
|
|
10
|
+
shape: m = "Rounded",
|
|
11
|
+
loading: r = "Lazy",
|
|
12
|
+
className: s,
|
|
13
|
+
style: i,
|
|
14
|
+
id: d,
|
|
15
|
+
dataAttributes: n = {},
|
|
16
|
+
onLoad: l,
|
|
17
|
+
onError: p,
|
|
18
|
+
...u
|
|
19
|
+
}) {
|
|
20
|
+
const c = `PdxImage ${t} ${e} ${m} ${s || ""}`.trim(), f = { ...n };
|
|
21
|
+
return /* @__PURE__ */ g(
|
|
22
|
+
"img",
|
|
23
|
+
{
|
|
24
|
+
className: c,
|
|
25
|
+
style: i,
|
|
26
|
+
id: d,
|
|
27
|
+
src: o,
|
|
28
|
+
alt: a,
|
|
29
|
+
loading: r.toLowerCase(),
|
|
30
|
+
onLoad: l,
|
|
31
|
+
onError: p,
|
|
32
|
+
...f,
|
|
33
|
+
...u
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
I as default
|
|
39
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { jsx as r, jsxs as S } from "react/jsx-runtime";
|
|
2
|
+
import { useState as j } from "react";
|
|
3
|
+
import "@prodivix/shared";
|
|
4
|
+
function R({
|
|
5
|
+
images: o,
|
|
6
|
+
layout: t = "Grid",
|
|
7
|
+
columns: m = 3,
|
|
8
|
+
gap: f = "Medium",
|
|
9
|
+
size: u = "Medium",
|
|
10
|
+
shape: p = "Rounded",
|
|
11
|
+
fit: y = "Cover",
|
|
12
|
+
showCaptions: g = !1,
|
|
13
|
+
selectable: i = !1,
|
|
14
|
+
maxSelection: c,
|
|
15
|
+
onImageClick: d,
|
|
16
|
+
onSelectionChange: n,
|
|
17
|
+
className: G,
|
|
18
|
+
style: h,
|
|
19
|
+
id: I,
|
|
20
|
+
dataAttributes: $ = {},
|
|
21
|
+
...v
|
|
22
|
+
}) {
|
|
23
|
+
const [s, P] = j([]), N = `PdxImageGallery ${t} ${f} ${G || ""}`.trim(), k = { ...$ }, C = (l, e) => {
|
|
24
|
+
if (d && d(l, e), i) {
|
|
25
|
+
const a = s.includes(e) ? s.filter((M) => M !== e) : [...s, e];
|
|
26
|
+
if (c && a.length > c)
|
|
27
|
+
return;
|
|
28
|
+
P(a), n && n(a);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
return /* @__PURE__ */ r(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
className: N,
|
|
35
|
+
style: { ...t === "Grid" || t === "Masonry" ? {
|
|
36
|
+
display: "grid",
|
|
37
|
+
gridTemplateColumns: `repeat(${m}, 1fr)`
|
|
38
|
+
} : {}, ...h },
|
|
39
|
+
id: I,
|
|
40
|
+
...k,
|
|
41
|
+
...v,
|
|
42
|
+
children: o.map((l, e) => /* @__PURE__ */ S(
|
|
43
|
+
"div",
|
|
44
|
+
{
|
|
45
|
+
className: `PdxImageGallery-item ${u} ${p} ${s.includes(e) ? "selected" : ""}`,
|
|
46
|
+
onClick: () => C(l, e),
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ r(
|
|
49
|
+
"img",
|
|
50
|
+
{
|
|
51
|
+
src: l.thumbnail || l.src,
|
|
52
|
+
alt: l.alt || `Image ${e + 1}`,
|
|
53
|
+
className: `PdxImageGallery-image ${y}`,
|
|
54
|
+
loading: "lazy"
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
g && l.caption && /* @__PURE__ */ r("div", { className: "PdxImageGallery-caption", children: l.caption }),
|
|
58
|
+
i && s.includes(e) && /* @__PURE__ */ r("div", { className: "PdxImageGallery-check", children: /* @__PURE__ */ r(
|
|
59
|
+
"svg",
|
|
60
|
+
{
|
|
61
|
+
viewBox: "0 0 24 24",
|
|
62
|
+
fill: "none",
|
|
63
|
+
stroke: "currentColor",
|
|
64
|
+
strokeWidth: "2",
|
|
65
|
+
children: /* @__PURE__ */ r("polyline", { points: "20 6 9 17 4 12" })
|
|
66
|
+
}
|
|
67
|
+
) })
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
e
|
|
71
|
+
))
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
export {
|
|
76
|
+
R as default
|
|
77
|
+
};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { default as t } from "./button/PdxButton.js";
|
|
2
|
+
import { default as o } from "./button/PdxButtonLink.js";
|
|
3
|
+
import { default as x } from "./icon/PdxIconLink.js";
|
|
4
|
+
import { default as l } from "./link/PdxLink.js";
|
|
5
|
+
import { default as s } from "./nav/PdxNav.js";
|
|
6
|
+
import { default as m } from "./nav/PdxNavbar.js";
|
|
7
|
+
import { default as i } from "./nav/PdxSidebar.js";
|
|
8
|
+
import { default as c } from "./nav/PdxBreadcrumb.js";
|
|
9
|
+
import { default as S } from "./nav/PdxPagination.js";
|
|
10
|
+
import { default as k } from "./nav/PdxAnchorNavigation.js";
|
|
11
|
+
import { default as R } from "./nav/PdxTabs.js";
|
|
12
|
+
import { default as h } from "./nav/PdxCollapse.js";
|
|
13
|
+
import { default as C } from "./nav/PdxRoute.js";
|
|
14
|
+
import { default as L } from "./nav/PdxOutlet.js";
|
|
15
|
+
import { default as N } from "./icon/PdxIcon.js";
|
|
16
|
+
import { default as E } from "./text/PdxText.js";
|
|
17
|
+
import { default as w } from "./text/PdxHeading.js";
|
|
18
|
+
import { default as M } from "./text/PdxParagraph.js";
|
|
19
|
+
import { default as V } from "./text/PdxKbd.js";
|
|
20
|
+
import { default as H } from "./input/PdxInput.js";
|
|
21
|
+
import { default as O } from "./input/PdxTextarea.js";
|
|
22
|
+
import { default as q } from "./input/PdxSearch.js";
|
|
23
|
+
import { default as J } from "./form/PdxDatePicker.js";
|
|
24
|
+
import { default as W } from "./form/PdxDateRangePicker.js";
|
|
25
|
+
import { default as Y } from "./form/PdxTimePicker.js";
|
|
26
|
+
import { default as _ } from "./form/PdxRegionPicker.js";
|
|
27
|
+
import { default as ee } from "./form/PdxVerificationCode.js";
|
|
28
|
+
import { default as te } from "./form/PdxPasswordStrength.js";
|
|
29
|
+
import { default as oe } from "./form/PdxRegexInput.js";
|
|
30
|
+
import { default as xe } from "./form/PdxFileUpload.js";
|
|
31
|
+
import { default as le } from "./form/PdxImageUpload.js";
|
|
32
|
+
import { default as se } from "./form/PdxRichTextEditor.js";
|
|
33
|
+
import { default as me } from "./form/PdxRating.js";
|
|
34
|
+
import { default as ie } from "./form/PdxColorPicker.js";
|
|
35
|
+
import { default as ce } from "./form/PdxSlider.js";
|
|
36
|
+
import { default as Se } from "./form/PdxRange.js";
|
|
37
|
+
import { default as ke } from "./form/PdxSelect.js";
|
|
38
|
+
import { default as Re } from "./form/PdxRadioGroup.js";
|
|
39
|
+
import { default as he } from "./container/PdxDiv.js";
|
|
40
|
+
import { default as Ce } from "./container/PdxSection.js";
|
|
41
|
+
import { default as Le } from "./container/PdxCard.js";
|
|
42
|
+
import { default as Ne } from "./container/PdxPanel.js";
|
|
43
|
+
import { default as Ee } from "./image/PdxImage.js";
|
|
44
|
+
import { default as we } from "./image/PdxAvatar.js";
|
|
45
|
+
import { default as Me } from "./image/PdxImageGallery.js";
|
|
46
|
+
import { default as Ve } from "./video/PdxVideo.js";
|
|
47
|
+
import { default as He } from "./video/PdxAudio.js";
|
|
48
|
+
import { default as Oe } from "./embed/PdxIframe.js";
|
|
49
|
+
import { default as qe } from "./embed/PdxEmbed.js";
|
|
50
|
+
import { default as Je } from "./data/PdxTable.js";
|
|
51
|
+
import { default as We } from "./data/PdxDataGrid.js";
|
|
52
|
+
import { default as Ye } from "./data/PdxList.js";
|
|
53
|
+
import { default as _e } from "./data/PdxCheckList.js";
|
|
54
|
+
import { default as ea } from "./data/PdxTree.js";
|
|
55
|
+
import { default as ta } from "./data/PdxTreeSelect.js";
|
|
56
|
+
import { default as oa } from "./data/PdxTag.js";
|
|
57
|
+
import { default as xa } from "./data/PdxBadge.js";
|
|
58
|
+
import { default as la } from "./data/PdxProgress.js";
|
|
59
|
+
import { default as sa } from "./data/PdxSpinner.js";
|
|
60
|
+
import { default as ma } from "./data/PdxStatistic.js";
|
|
61
|
+
import { default as ia } from "./data/PdxTimeline.js";
|
|
62
|
+
import { default as ca } from "./data/PdxSteps.js";
|
|
63
|
+
import { default as Sa } from "./feedback/PdxModal.js";
|
|
64
|
+
import { default as ka } from "./feedback/PdxDrawer.js";
|
|
65
|
+
import { default as Ra } from "./feedback/PdxTooltip.js";
|
|
66
|
+
import { default as ha } from "./feedback/PdxPopover.js";
|
|
67
|
+
import { default as Ca } from "./feedback/PdxMessage.js";
|
|
68
|
+
import { default as La } from "./feedback/PdxNotification.js";
|
|
69
|
+
import { default as Na } from "./feedback/PdxEmpty.js";
|
|
70
|
+
import { default as Ea } from "./feedback/PdxSkeleton.js";
|
|
71
|
+
export {
|
|
72
|
+
k as PdxAnchorNavigation,
|
|
73
|
+
He as PdxAudio,
|
|
74
|
+
we as PdxAvatar,
|
|
75
|
+
xa as PdxBadge,
|
|
76
|
+
c as PdxBreadcrumb,
|
|
77
|
+
t as PdxButton,
|
|
78
|
+
o as PdxButtonLink,
|
|
79
|
+
Le as PdxCard,
|
|
80
|
+
_e as PdxCheckList,
|
|
81
|
+
h as PdxCollapse,
|
|
82
|
+
ie as PdxColorPicker,
|
|
83
|
+
We as PdxDataGrid,
|
|
84
|
+
J as PdxDatePicker,
|
|
85
|
+
W as PdxDateRangePicker,
|
|
86
|
+
he as PdxDiv,
|
|
87
|
+
ka as PdxDrawer,
|
|
88
|
+
qe as PdxEmbed,
|
|
89
|
+
Na as PdxEmpty,
|
|
90
|
+
xe as PdxFileUpload,
|
|
91
|
+
w as PdxHeading,
|
|
92
|
+
N as PdxIcon,
|
|
93
|
+
x as PdxIconLink,
|
|
94
|
+
Oe as PdxIframe,
|
|
95
|
+
Ee as PdxImage,
|
|
96
|
+
Me as PdxImageGallery,
|
|
97
|
+
le as PdxImageUpload,
|
|
98
|
+
H as PdxInput,
|
|
99
|
+
V as PdxKbd,
|
|
100
|
+
l as PdxLink,
|
|
101
|
+
Ye as PdxList,
|
|
102
|
+
Ca as PdxMessage,
|
|
103
|
+
Sa as PdxModal,
|
|
104
|
+
s as PdxNav,
|
|
105
|
+
m as PdxNavbar,
|
|
106
|
+
La as PdxNotification,
|
|
107
|
+
L as PdxOutlet,
|
|
108
|
+
S as PdxPagination,
|
|
109
|
+
Ne as PdxPanel,
|
|
110
|
+
M as PdxParagraph,
|
|
111
|
+
te as PdxPasswordStrength,
|
|
112
|
+
ha as PdxPopover,
|
|
113
|
+
la as PdxProgress,
|
|
114
|
+
Re as PdxRadioGroup,
|
|
115
|
+
Se as PdxRange,
|
|
116
|
+
me as PdxRating,
|
|
117
|
+
oe as PdxRegexInput,
|
|
118
|
+
_ as PdxRegionPicker,
|
|
119
|
+
se as PdxRichTextEditor,
|
|
120
|
+
C as PdxRoute,
|
|
121
|
+
q as PdxSearch,
|
|
122
|
+
Ce as PdxSection,
|
|
123
|
+
ke as PdxSelect,
|
|
124
|
+
i as PdxSidebar,
|
|
125
|
+
Ea as PdxSkeleton,
|
|
126
|
+
ce as PdxSlider,
|
|
127
|
+
sa as PdxSpinner,
|
|
128
|
+
ma as PdxStatistic,
|
|
129
|
+
ca as PdxSteps,
|
|
130
|
+
Je as PdxTable,
|
|
131
|
+
R as PdxTabs,
|
|
132
|
+
oa as PdxTag,
|
|
133
|
+
E as PdxText,
|
|
134
|
+
O as PdxTextarea,
|
|
135
|
+
Y as PdxTimePicker,
|
|
136
|
+
ia as PdxTimeline,
|
|
137
|
+
Ra as PdxTooltip,
|
|
138
|
+
ea as PdxTree,
|
|
139
|
+
ta as PdxTreeSelect,
|
|
140
|
+
ee as PdxVerificationCode,
|
|
141
|
+
Ve as PdxVideo
|
|
142
|
+
};
|