quirk-ui 0.0.328 → 0.0.330

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.
@@ -25,18 +25,18 @@ const Ee = [
25
25
  ],
26
26
  ["path", { d: "M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05", key: "14pb5j" }],
27
27
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]
28
- ], Se = F("earth", Ee);
28
+ ], _e = F("earth", Ee);
29
29
  /**
30
30
  * @license lucide-react v0.488.0 - ISC
31
31
  *
32
32
  * This source code is licensed under the ISC license.
33
33
  * See the LICENSE file in the root directory of this source tree.
34
34
  */
35
- const _e = [
35
+ const Se = [
36
36
  ["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }],
37
37
  ["line", { x1: "4", x2: "20", y1: "6", y2: "6", key: "1owob3" }],
38
38
  ["line", { x1: "4", x2: "20", y1: "18", y2: "18", key: "yk5zj1" }]
39
- ], ze = F("menu", _e);
39
+ ], ze = F("menu", Se);
40
40
  /**
41
41
  * @license lucide-react v0.488.0 - ISC
42
42
  *
@@ -105,7 +105,7 @@ function Ie({
105
105
  "aria-label": "Locale Select",
106
106
  role: "menuitem",
107
107
  className: e.locale,
108
- children: /* @__PURE__ */ a(Se, { size: 16 })
108
+ children: /* @__PURE__ */ a(_e, { size: 16 })
109
109
  }
110
110
  ),
111
111
  content: ce
@@ -143,10 +143,10 @@ function Ie({
143
143
  ]);
144
144
  }, ge = () => {
145
145
  L("backward"), N((n) => n.slice(0, -1));
146
- }, S = T(null), v = T(null), _ = T(/* @__PURE__ */ new Map()), $e = () => {
146
+ }, _ = T(null), v = T(null), S = T(/* @__PURE__ */ new Map()), $e = () => {
147
147
  D((n) => !n);
148
148
  }, H = (n) => {
149
- const l = _.current.get(n);
149
+ const l = S.current.get(n);
150
150
  if (l && v.current) {
151
151
  const o = l.getBoundingClientRect(), d = v.current.getBoundingClientRect(), i = o.left - d.left + o.width / 2;
152
152
  ue(i);
@@ -154,7 +154,7 @@ function Ie({
154
154
  }, we = (n) => {
155
155
  f((l) => l === n ? null : n);
156
156
  }, q = R((n) => {
157
- S.current && !S.current.contains(n.target) && f(null);
157
+ _.current && !_.current.contains(n.target) && f(null);
158
158
  }, []), I = R(() => {
159
159
  U(), typeof window < "u" && window.innerWidth > 768 && (D(!1), f(null), typeof document < "u" && (document.body.style.overflow = ""));
160
160
  }, []), U = R(() => {
@@ -192,7 +192,7 @@ function Ie({
192
192
  "button",
193
193
  {
194
194
  ref: (t) => {
195
- _.current.set(d, t);
195
+ S.current.set(d, t);
196
196
  },
197
197
  role: "menuitem",
198
198
  "aria-haspopup": "true",
@@ -303,7 +303,7 @@ function Ie({
303
303
  )
304
304
  ]
305
305
  },
306
- o
306
+ l._key ?? `group-${o}`
307
307
  );
308
308
  }), w = (n, l = "") => n.map((o) => {
309
309
  const d = `${l}/${o.label}`;
@@ -318,15 +318,15 @@ function Ie({
318
318
  updateTriangleIndicator: H,
319
319
  setOpenPath: f,
320
320
  renderLinks: w,
321
- buttonRefs: _
321
+ buttonRefs: S
322
322
  },
323
- d
323
+ o._key ?? d
324
324
  );
325
325
  });
326
326
  return /* @__PURE__ */ a(
327
327
  "header",
328
328
  {
329
- ref: S,
329
+ ref: _,
330
330
  className: `${oe ?? ""} ${Fe[x]} ${Ae[re]} ${e.navbar} ${ie ? e.sticky : ""} ${m && m.length ? e.advanced : e.default}`,
331
331
  role: "navigation",
332
332
  "aria-label": "Main navigation",
@@ -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.330",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {