quirk-ui 0.0.328 → 0.0.329
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.
|
@@ -3,78 +3,78 @@ import { useState as c, useEffect as b } from "react";
|
|
|
3
3
|
import '../../../assets/colors.css';import '../../../assets/index.css';/* empty css */
|
|
4
4
|
import { ButtonGroup as h } from "../../../core/components/ButtonGroup/index.js";
|
|
5
5
|
import { C as l } from "../../../index-C4o-N_--.js";
|
|
6
|
-
import { Modal as
|
|
6
|
+
import { Modal as p } from "../../../core/components/Modal/index.js";
|
|
7
7
|
import "../../../core/components/Tabs/index.js";
|
|
8
8
|
/* empty css */
|
|
9
|
+
import { resolveLinkURL as g } from "../../utils/resolveLinkUrl.js";
|
|
9
10
|
function _({
|
|
10
|
-
items:
|
|
11
|
+
items: n,
|
|
11
12
|
alignment: u,
|
|
12
|
-
className:
|
|
13
|
-
resolveLinkURL: a
|
|
13
|
+
className: m
|
|
14
14
|
}) {
|
|
15
|
-
const [
|
|
15
|
+
const [s, f] = c([]);
|
|
16
16
|
return b(() => {
|
|
17
|
-
if (!(
|
|
18
|
-
async function
|
|
17
|
+
if (!(n != null && n.length) || !g) return;
|
|
18
|
+
async function r() {
|
|
19
19
|
const e = await Promise.all(
|
|
20
|
-
|
|
20
|
+
n.map((i) => g(i))
|
|
21
21
|
);
|
|
22
|
-
|
|
22
|
+
f(e);
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
}, [
|
|
26
|
-
var
|
|
27
|
-
const i =
|
|
28
|
-
switch (
|
|
24
|
+
r();
|
|
25
|
+
}, [n]), n != null && n.length ? /* @__PURE__ */ o(h, { className: m, alignment: u, children: n.slice(0, 3).map((r, e) => {
|
|
26
|
+
var a, t;
|
|
27
|
+
const i = s[e] ?? "#";
|
|
28
|
+
switch (r.type) {
|
|
29
29
|
case "link":
|
|
30
30
|
return /* @__PURE__ */ o(
|
|
31
31
|
l,
|
|
32
32
|
{
|
|
33
33
|
as: "a",
|
|
34
|
-
variant:
|
|
34
|
+
variant: r.variant ?? "primary",
|
|
35
35
|
href: i,
|
|
36
|
-
target: ((
|
|
37
|
-
rel: ((
|
|
38
|
-
"aria-label":
|
|
39
|
-
icon:
|
|
40
|
-
iconAlignment:
|
|
41
|
-
children:
|
|
36
|
+
target: ((a = r.linkOptions) == null ? void 0 : a.linkType) === "external" ? "_blank" : "_self",
|
|
37
|
+
rel: ((t = r.linkOptions) == null ? void 0 : t.linkType) === "external" ? "noopener noreferrer" : "",
|
|
38
|
+
"aria-label": r.ariaLabel || r.label,
|
|
39
|
+
icon: r.icon,
|
|
40
|
+
iconAlignment: r.iconAlignment ?? "right",
|
|
41
|
+
children: r.label
|
|
42
42
|
},
|
|
43
43
|
e
|
|
44
44
|
);
|
|
45
45
|
case "modal":
|
|
46
46
|
return /* @__PURE__ */ o(
|
|
47
|
-
|
|
47
|
+
p,
|
|
48
48
|
{
|
|
49
49
|
trigger: /* @__PURE__ */ o(
|
|
50
50
|
l,
|
|
51
51
|
{
|
|
52
52
|
as: "button",
|
|
53
|
-
variant:
|
|
54
|
-
icon:
|
|
55
|
-
iconAlignment:
|
|
56
|
-
children:
|
|
53
|
+
variant: r.variant ?? "primary",
|
|
54
|
+
icon: r.icon,
|
|
55
|
+
iconAlignment: r.iconAlignment ?? "right",
|
|
56
|
+
children: r.label
|
|
57
57
|
}
|
|
58
58
|
),
|
|
59
|
-
content:
|
|
59
|
+
content: r.modalContent
|
|
60
60
|
},
|
|
61
61
|
e
|
|
62
62
|
);
|
|
63
63
|
case "video":
|
|
64
64
|
return /* @__PURE__ */ o(
|
|
65
|
-
|
|
65
|
+
p,
|
|
66
66
|
{
|
|
67
67
|
trigger: /* @__PURE__ */ o(
|
|
68
68
|
l,
|
|
69
69
|
{
|
|
70
70
|
as: "button",
|
|
71
|
-
variant:
|
|
72
|
-
icon:
|
|
73
|
-
iconAlignment:
|
|
74
|
-
children:
|
|
71
|
+
variant: r.variant ?? "primary",
|
|
72
|
+
icon: r.icon,
|
|
73
|
+
iconAlignment: r.iconAlignment ?? "right",
|
|
74
|
+
children: r.label
|
|
75
75
|
}
|
|
76
76
|
),
|
|
77
|
-
content: /* @__PURE__ */ o("video", { src:
|
|
77
|
+
content: /* @__PURE__ */ o("video", { src: r.videoUrl, controls: !0, autoPlay: !0 })
|
|
78
78
|
},
|
|
79
79
|
e
|
|
80
80
|
);
|
|
@@ -83,15 +83,15 @@ function _({
|
|
|
83
83
|
l,
|
|
84
84
|
{
|
|
85
85
|
as: "a",
|
|
86
|
-
variant:
|
|
86
|
+
variant: r.variant ?? "primary",
|
|
87
87
|
href: i,
|
|
88
88
|
download: !0,
|
|
89
89
|
target: "_blank",
|
|
90
90
|
rel: "noopener noreferrer",
|
|
91
|
-
"aria-label":
|
|
92
|
-
icon:
|
|
93
|
-
iconAlignment:
|
|
94
|
-
children:
|
|
91
|
+
"aria-label": r.ariaLabel || r.label,
|
|
92
|
+
icon: r.icon,
|
|
93
|
+
iconAlignment: r.iconAlignment ?? "right",
|
|
94
|
+
children: r.label
|
|
95
95
|
},
|
|
96
96
|
e
|
|
97
97
|
);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
async function t(n) {
|
|
2
|
+
var e, l;
|
|
3
|
+
if (n.type !== "link") return;
|
|
4
|
+
const r = n.linkOptions;
|
|
5
|
+
return (r == null ? void 0 : r.linkType) === "external" && r.externalUrl ? r.externalUrl : (r == null ? void 0 : r.linkType) === "internal" && ((e = r.internalUrl) != null && e.slug) ? `/${(l = r.internalUrl) == null ? void 0 : l.slug.current}` : "#";
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
t as resolveLinkURL
|
|
9
|
+
};
|