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 g } from "../../../core/components/Modal/index.js";
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: r,
11
+ items: n,
11
12
  alignment: u,
12
- className: f,
13
- resolveLinkURL: a
13
+ className: m
14
14
  }) {
15
- const [m, s] = c([]);
15
+ const [s, f] = c([]);
16
16
  return b(() => {
17
- if (!(r != null && r.length) || !a) return;
18
- async function n() {
17
+ if (!(n != null && n.length) || !g) return;
18
+ async function r() {
19
19
  const e = await Promise.all(
20
- r.map((i) => a(i))
20
+ n.map((i) => g(i))
21
21
  );
22
- s(e);
22
+ f(e);
23
23
  }
24
- n();
25
- }, [r]), r != null && r.length ? /* @__PURE__ */ o(h, { className: f, alignment: u, children: r.slice(0, 3).map((n, e) => {
26
- var t, p;
27
- const i = m[e] ?? "#";
28
- switch (n.type) {
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: n.variant ?? "primary",
34
+ variant: r.variant ?? "primary",
35
35
  href: i,
36
- target: ((t = n.linkOptions) == null ? void 0 : t.linkType) === "external" ? "_blank" : "_self",
37
- rel: ((p = n.linkOptions) == null ? void 0 : p.linkType) === "external" ? "noopener noreferrer" : "",
38
- "aria-label": n.ariaLabel || n.label,
39
- icon: n.icon,
40
- iconAlignment: n.iconAlignment ?? "right",
41
- children: n.label
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
- g,
47
+ p,
48
48
  {
49
49
  trigger: /* @__PURE__ */ o(
50
50
  l,
51
51
  {
52
52
  as: "button",
53
- variant: n.variant ?? "primary",
54
- icon: n.icon,
55
- iconAlignment: n.iconAlignment ?? "right",
56
- children: n.label
53
+ variant: r.variant ?? "primary",
54
+ icon: r.icon,
55
+ iconAlignment: r.iconAlignment ?? "right",
56
+ children: r.label
57
57
  }
58
58
  ),
59
- content: n.modalContent
59
+ content: r.modalContent
60
60
  },
61
61
  e
62
62
  );
63
63
  case "video":
64
64
  return /* @__PURE__ */ o(
65
- g,
65
+ p,
66
66
  {
67
67
  trigger: /* @__PURE__ */ o(
68
68
  l,
69
69
  {
70
70
  as: "button",
71
- variant: n.variant ?? "primary",
72
- icon: n.icon,
73
- iconAlignment: n.iconAlignment ?? "right",
74
- children: n.label
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: n.videoUrl, controls: !0, autoPlay: !0 })
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: n.variant ?? "primary",
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": n.ariaLabel || n.label,
92
- icon: n.icon,
93
- iconAlignment: n.iconAlignment ?? "right",
94
- children: n.label
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
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "quirk-ui",
3
3
  "private": false,
4
- "version": "0.0.328",
4
+ "version": "0.0.329",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {