quirk-ui 0.0.332 → 0.0.334

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.
@@ -1,13 +1,13 @@
1
1
  import { jsx as a, jsxs as r, Fragment as ee } from "react/jsx-runtime";
2
- import { useState as h, useEffect as z, useRef as T, useCallback as R } from "react";
2
+ import { useState as h, useEffect as T, useRef as R, useCallback as A } from "react";
3
3
  import { s as e, N as Ce } from "../../../NavLink-BE_Z3sd3.js";
4
4
  import { Modal as ne } from "../Modal/index.js";
5
5
  import { e as xe, C as ae } from "../../../index-C4o-N_--.js";
6
6
  import { ButtonGroup as le } from "../ButtonGroup/index.js";
7
- import { E as A } from "../../../external-link-BOPobeQJ.js";
8
- import { X as Me } from "../../../x-CnsEH4Ox.js";
9
- import { c as F } from "../../../createLucideIcon-C8GTh_Qx.js";
10
- import { C as Le } from "../../../chevron-down-DSUzBz9F.js";
7
+ import { E as F } from "../../../external-link-BOPobeQJ.js";
8
+ import { X as Le } from "../../../x-CnsEH4Ox.js";
9
+ import { c as W } from "../../../createLucideIcon-C8GTh_Qx.js";
10
+ import { C as Me } from "../../../chevron-down-DSUzBz9F.js";
11
11
  /**
12
12
  * @license lucide-react v0.488.0 - ISC
13
13
  *
@@ -25,7 +25,7 @@ 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
- ], _e = F("earth", Ee);
28
+ ], _e = W("earth", Ee);
29
29
  /**
30
30
  * @license lucide-react v0.488.0 - ISC
31
31
  *
@@ -36,7 +36,7 @@ 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", Se);
39
+ ], ze = W("menu", Se);
40
40
  /**
41
41
  * @license lucide-react v0.488.0 - ISC
42
42
  *
@@ -46,7 +46,7 @@ const Se = [
46
46
  const Te = [
47
47
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
48
48
  ["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }]
49
- ], Re = F("search", Te), Ae = {
49
+ ], Re = W("search", Te), Ae = {
50
50
  standard: e.standard,
51
51
  transparent: e.transparent
52
52
  }, Fe = {
@@ -56,14 +56,14 @@ const Te = [
56
56
  };
57
57
  function Ue({
58
58
  title: se,
59
- logo: W,
60
- items: B,
59
+ logo: B,
60
+ items: C,
61
61
  groups: f,
62
62
  utilityItems: s,
63
63
  isSticky: ie = !1,
64
- showSearch: C = !0,
64
+ showSearch: x = !0,
65
65
  showLocaleSelect: j = !0,
66
- alignment: x = "right",
66
+ alignment: L = "right",
67
67
  variant: re = "standard",
68
68
  navigationType: k = "default",
69
69
  searchComponent: te,
@@ -72,9 +72,9 @@ function Ue({
72
72
  }) {
73
73
  const [b, D] = h(!1), [O, m] = h(null), [de, he] = h(0), [be, fe] = h(!1), [me, ue] = h(null), [c, N] = h([]), [g, M] = h(
74
74
  0
75
- ), [pe, G] = h(null), [p, ve] = h(!1), [$, L] = h("forward");
75
+ ), [pe, G] = h(null), [p, ve] = h(!1), [$, E] = h("forward");
76
76
  console.log("QUI", f);
77
- const E = () => /* @__PURE__ */ a(
77
+ const _ = () => /* @__PURE__ */ a(
78
78
  "div",
79
79
  {
80
80
  className: `${e.linkWrapper} ${e.parent} ${e.searchWrapper}`,
@@ -96,7 +96,7 @@ function Ue({
96
96
  }
97
97
  ) })
98
98
  }
99
- ), V = () => /* @__PURE__ */ a("div", { className: `${e.linkWrapper} ${e.parent} `, children: /* @__PURE__ */ a("div", { className: e.linkItem, children: /* @__PURE__ */ a(
99
+ ), I = () => /* @__PURE__ */ a("div", { className: `${e.linkWrapper} ${e.parent} `, children: /* @__PURE__ */ a("div", { className: e.linkItem, children: /* @__PURE__ */ a(
100
100
  ne,
101
101
  {
102
102
  className: e.localeModal,
@@ -113,7 +113,7 @@ function Ue({
113
113
  content: ce
114
114
  }
115
115
  ) }) });
116
- z(() => {
116
+ T(() => {
117
117
  if (typeof window < "u") {
118
118
  const n = () => {
119
119
  const l = window.innerWidth < 768;
@@ -125,7 +125,7 @@ function Ue({
125
125
  const ke = () => {
126
126
  N([]);
127
127
  }, Ne = (n) => {
128
- L("forward"), N([
128
+ E("forward"), N([
129
129
  {
130
130
  title: n.title,
131
131
  primary: n.primaryItems ?? [],
@@ -133,8 +133,8 @@ function Ue({
133
133
  description: ""
134
134
  }
135
135
  ]);
136
- }, X = (n) => {
137
- L("forward"), N((l) => [
136
+ }, V = (n) => {
137
+ E("forward"), N((l) => [
138
138
  ...l,
139
139
  {
140
140
  title: n.label,
@@ -144,47 +144,47 @@ function Ue({
144
144
  }
145
145
  ]);
146
146
  }, ge = () => {
147
- L("backward"), N((n) => n.slice(0, -1));
148
- }, _ = T(null), v = T(null), S = T(/* @__PURE__ */ new Map()), $e = () => {
147
+ E("backward"), N((n) => n.slice(0, -1));
148
+ }, S = R(null), v = R(null), z = R(/* @__PURE__ */ new Map()), $e = () => {
149
149
  D((n) => !n);
150
- }, H = (n) => {
151
- const l = S.current.get(n);
150
+ }, X = (n) => {
151
+ const l = z.current.get(n);
152
152
  if (l && v.current) {
153
153
  const o = l.getBoundingClientRect(), d = v.current.getBoundingClientRect(), i = o.left - d.left + o.width / 2;
154
154
  ue(i);
155
155
  }
156
156
  }, we = (n) => {
157
157
  m((l) => l === n ? null : n);
158
- }, I = R((n) => {
159
- _.current && !_.current.contains(n.target) && m(null);
160
- }, []), U = R(() => {
158
+ }, H = A((n) => {
159
+ S.current && !S.current.contains(n.target) && m(null);
160
+ }, []), U = A(() => {
161
161
  q(), typeof window < "u" && window.innerWidth > 768 && (D(!1), m(null), typeof document < "u" && (document.body.style.overflow = ""));
162
- }, []), q = R(() => {
162
+ }, []), q = A(() => {
163
163
  if (v.current) {
164
164
  const n = v.current.getBoundingClientRect().width;
165
165
  he(n), fe(!0);
166
166
  }
167
167
  }, []);
168
- z(() => {
168
+ T(() => {
169
169
  const n = typeof window < "u", l = typeof document < "u";
170
- return n && window.addEventListener("resize", U), l && document.addEventListener("click", I), q(), () => {
171
- n && window.removeEventListener("resize", U), l && document.removeEventListener("click", I);
170
+ return n && window.addEventListener("resize", U), l && document.addEventListener("click", H), q(), () => {
171
+ n && window.removeEventListener("resize", U), l && document.removeEventListener("click", H);
172
172
  };
173
- }, []), z(() => {
173
+ }, []), T(() => {
174
174
  if (typeof document < "u")
175
175
  return document.body.style.overflow = b ? "hidden" : "", () => {
176
176
  document.body.style.overflow = "";
177
177
  };
178
178
  }, [b]);
179
179
  const ye = (n) => n.map((l, o) => {
180
- var Q, J, K, Y, Z;
181
- const d = `group-${o}`, y = pe === o, i = (Q = l.primaryItems) == null ? void 0 : Q[g ?? 0];
180
+ var K, Q, J, Y, Z;
181
+ const d = `group-${o}`, y = pe === o, i = (K = l.primaryItems) == null ? void 0 : K[g ?? 0];
182
182
  return /* @__PURE__ */ r(
183
183
  "div",
184
184
  {
185
185
  className: `${e.linkWrapper} ${e.parent}`,
186
186
  onMouseEnter: () => {
187
- G(o), m(d), H(d);
187
+ G(o), m(d), X(d);
188
188
  },
189
189
  onMouseLeave: () => {
190
190
  G(null), M(0), m(null);
@@ -194,7 +194,7 @@ function Ue({
194
194
  "button",
195
195
  {
196
196
  ref: (t) => {
197
- S.current.set(d, t);
197
+ z.current.set(d, t);
198
198
  },
199
199
  role: "menuitem",
200
200
  "aria-haspopup": "true",
@@ -203,7 +203,7 @@ function Ue({
203
203
  className: `${e.sublinkToggle} ${y ? e.open : ""} `,
204
204
  children: [
205
205
  l.title,
206
- /* @__PURE__ */ a(Le, { size: 18, className: e.chevron })
206
+ /* @__PURE__ */ a(Me, { size: 18, className: e.chevron })
207
207
  ]
208
208
  }
209
209
  ) }),
@@ -225,7 +225,7 @@ function Ue({
225
225
  className: `${e.sublinksColumn} ${e.primaryColumn}`,
226
226
  children: [
227
227
  /* @__PURE__ */ a("div", { className: e.linkItem }),
228
- (J = l.primaryItems) == null ? void 0 : J.map(
228
+ (Q = l.primaryItems) == null ? void 0 : Q.map(
229
229
  (t, u) => t.href ? /* @__PURE__ */ r(
230
230
  "a",
231
231
  {
@@ -245,7 +245,7 @@ function Ue({
245
245
  t.subtitle && /* @__PURE__ */ a("span", { className: e.subtitle, children: t.subtitle })
246
246
  ] }),
247
247
  t.isExternal && /* @__PURE__ */ a(
248
- A,
248
+ F,
249
249
  {
250
250
  className: e.newTabIcon,
251
251
  size: 16
@@ -270,7 +270,7 @@ function Ue({
270
270
  ]
271
271
  }
272
272
  ),
273
- (i == null ? void 0 : i.sublinks) && ((K = i == null ? void 0 : i.sublinks) == null ? void 0 : K.length) > 0 && /* @__PURE__ */ r(
273
+ (i == null ? void 0 : i.sublinks) && ((J = i == null ? void 0 : i.sublinks) == null ? void 0 : J.length) > 0 && /* @__PURE__ */ r(
274
274
  "div",
275
275
  {
276
276
  className: `${e.sublinksColumn} ${e.fadeInFromLeft}`,
@@ -288,7 +288,7 @@ function Ue({
288
288
  "div",
289
289
  {
290
290
  className: `${e.sublinksColumn} ${e.secondaryColumn}`,
291
- children: w(l.secondaryItems, `${d}-secondary`)
291
+ children: l.secondaryItems.length && w(l.secondaryItems, `${d}-secondary`)
292
292
  }
293
293
  ),
294
294
  l.spotlight && /* @__PURE__ */ a(
@@ -308,6 +308,7 @@ function Ue({
308
308
  l._key ?? `group-${o}`
309
309
  );
310
310
  }), w = (n, l = "") => n.map((o) => {
311
+ console.log("LINK", o);
311
312
  const d = `${l}/${o.label}`;
312
313
  return /* @__PURE__ */ a(
313
314
  Ce,
@@ -317,10 +318,10 @@ function Ue({
317
318
  parentPath: l,
318
319
  openPath: O,
319
320
  togglePath: we,
320
- updateTriangleIndicator: H,
321
+ updateTriangleIndicator: X,
321
322
  setOpenPath: m,
322
323
  renderLinks: w,
323
- buttonRefs: S
324
+ buttonRefs: z
324
325
  },
325
326
  o._key ?? d
326
327
  );
@@ -328,22 +329,22 @@ function Ue({
328
329
  return /* @__PURE__ */ a(
329
330
  "header",
330
331
  {
331
- ref: _,
332
- className: `${oe ?? ""} ${Fe[x]} ${Ae[re]} ${e.navbar} ${ie ? e.sticky : ""} ${f && f.length ? e.advanced : e.default}`,
332
+ ref: S,
333
+ className: `${oe ?? ""} ${Fe[L]} ${Ae[re]} ${e.navbar} ${ie ? e.sticky : ""} ${f && f.length ? e.advanced : e.default}`,
333
334
  role: "navigation",
334
335
  "aria-label": "Main navigation",
335
336
  children: /* @__PURE__ */ r(
336
337
  "div",
337
338
  {
338
- className: `${e.container} ${(!s || s.length === 0) && x !== "center" ? e.twoColumn : ""}`,
339
+ className: `${e.container} ${(!s || s.length === 0) && L !== "center" ? e.twoColumn : ""}`,
339
340
  children: [
340
- W ? /* @__PURE__ */ a("div", { className: e.logo, children: W }) : /* @__PURE__ */ a("div", { className: e.title, children: se }),
341
+ B ? /* @__PURE__ */ a("div", { className: e.logo, children: B }) : /* @__PURE__ */ a("div", { className: e.title, children: se }),
341
342
  /* @__PURE__ */ a(
342
343
  "nav",
343
344
  {
344
345
  ref: v,
345
346
  style: {
346
- left: x === "center" ? `calc(50% - ${de / 2}px)` : "0"
347
+ left: L === "center" ? `calc(50% - ${de / 2}px)` : "0"
347
348
  },
348
349
  className: `${e.nav} ${b ? e.open : ""} ${be ? e.visible : e.hidden}`,
349
350
  id: "main-menu",
@@ -370,21 +371,21 @@ function Ue({
370
371
  )
371
372
  }
372
373
  ),
373
- k === "default" && B && /* @__PURE__ */ r("div", { className: e.grid, children: [
374
- w(B),
375
- C && !p && /* @__PURE__ */ r(ee, { children: [
374
+ k === "default" && C && /* @__PURE__ */ r("div", { className: e.grid, children: [
375
+ C.length && w(C),
376
+ x && !p && /* @__PURE__ */ r(ee, { children: [
376
377
  /* @__PURE__ */ a("span", { className: e.separator }),
377
- /* @__PURE__ */ a(E, {})
378
+ /* @__PURE__ */ a(_, {})
378
379
  ] }),
379
- j && /* @__PURE__ */ a(V, {})
380
+ j && /* @__PURE__ */ a(I, {})
380
381
  ] }),
381
382
  !p && k === "advanced" && f && /* @__PURE__ */ r("div", { className: e.grid, children: [
382
383
  f.length && ye(f),
383
- C && /* @__PURE__ */ r(ee, { children: [
384
+ x && /* @__PURE__ */ r(ee, { children: [
384
385
  /* @__PURE__ */ a("span", { className: e.separator }),
385
- /* @__PURE__ */ a(E, {})
386
+ /* @__PURE__ */ a(_, {})
386
387
  ] }),
387
- j && /* @__PURE__ */ a(V, {})
388
+ j && /* @__PURE__ */ a(I, {})
388
389
  ] }),
389
390
  p && k === "advanced" && b && c.length === 0 && f && /* @__PURE__ */ a("div", { className: `${e.mobileMenu}`, children: f.map((n, l) => /* @__PURE__ */ a(
390
391
  "div",
@@ -436,7 +437,7 @@ function Ue({
436
437
  "button",
437
438
  {
438
439
  className: e.sublinkToggle,
439
- onClick: () => X(n),
440
+ onClick: () => V(n),
440
441
  children: /* @__PURE__ */ r("span", { className: e.linkContent, children: [
441
442
  n.label,
442
443
  n.subtitle && /* @__PURE__ */ a("span", { className: e.subtitle, children: n.subtitle })
@@ -456,7 +457,7 @@ function Ue({
456
457
  n.subtitle && /* @__PURE__ */ a("span", { className: e.subtitle, children: n.subtitle })
457
458
  ] }),
458
459
  n.isExternal && /* @__PURE__ */ a(
459
- A,
460
+ F,
460
461
  {
461
462
  className: e.newTabIcon,
462
463
  size: 16
@@ -478,7 +479,7 @@ function Ue({
478
479
  "button",
479
480
  {
480
481
  className: e.sublinkToggle,
481
- onClick: () => X(n),
482
+ onClick: () => V(n),
482
483
  children: n.label
483
484
  }
484
485
  ) : /* @__PURE__ */ r(
@@ -492,7 +493,7 @@ function Ue({
492
493
  children: [
493
494
  n.label,
494
495
  n.isExternal && /* @__PURE__ */ a(
495
- A,
496
+ F,
496
497
  {
497
498
  className: e.newTabIcon,
498
499
  size: 16
@@ -563,7 +564,7 @@ function Ue({
563
564
  }
564
565
  ),
565
566
  /* @__PURE__ */ r("div", { className: e.mobileButtons, children: [
566
- p && C && /* @__PURE__ */ a(E, {}),
567
+ p && x && /* @__PURE__ */ a(_, {}),
567
568
  /* @__PURE__ */ a(
568
569
  "button",
569
570
  {
@@ -572,7 +573,7 @@ function Ue({
572
573
  "aria-label": b ? "Close menu" : "Open menu",
573
574
  "aria-expanded": b,
574
575
  "aria-controls": "main-menu",
575
- children: b ? /* @__PURE__ */ a(Me, { size: 24 }) : /* @__PURE__ */ a(ze, { size: 24 })
576
+ children: b ? /* @__PURE__ */ a(Le, { size: 24 }) : /* @__PURE__ */ a(ze, { size: 24 })
576
577
  }
577
578
  )
578
579
  ] })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "quirk-ui",
3
3
  "private": false,
4
- "version": "0.0.332",
4
+ "version": "0.0.334",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {