@levo-so/react 0.1.50 → 0.1.52

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/dist/index.js CHANGED
@@ -9,27 +9,36 @@ import { twMerge as De } from "tailwind-merge";
9
9
  import { useInView as dt } from "react-intersection-observer";
10
10
  import { getLevoError as Me, LocalStorageLock as ft } from "@levo-so/core";
11
11
  import { usePageLifecycle as mt, LifecycleState as le } from "use-page-lifecycle";
12
- import { Slot as gt, Dialog as N, Tabs as B, Tooltip as Y } from "radix-ui";
12
+ import { Slot as gt, Dialog as j, Tabs as B, Tooltip as Y } from "radix-ui";
13
13
  import { cva as pt } from "class-variance-authority";
14
14
  import { X as bt } from "lucide-react";
15
15
  import { Toaster as vt, toast as Q } from "sonner";
16
16
  import { toast as Ur } from "sonner";
17
17
  const ht = [
18
18
  "pdf",
19
+ "txt",
20
+ "xml",
19
21
  "xls",
20
22
  "xlsx",
23
+ "ods",
24
+ "odt",
21
25
  "doc",
22
26
  "docx",
23
- "csv"
27
+ "csv",
28
+ "odp",
29
+ "ppt",
30
+ "pptx"
24
31
  ], wt = [
25
32
  "svg",
26
33
  "png",
27
34
  "jpg",
28
35
  "jpeg",
29
- "webp",
30
36
  "gif",
37
+ "webp",
31
38
  "avif"
32
- ], yt = ["mpeg", "mp4"], xt = ["mp3", "ogg", "oga"], Tt = {
39
+ ], yt = ["mp4", "ogv", "webm"], xt = ["mp3", "ogg", "opus"], Tt = {
40
+ "application/xml": [".xml"],
41
+ "text/plain": [".txt"],
33
42
  "application/pdf": [".pdf"],
34
43
  "application/msword": [".doc"],
35
44
  "application/vnd.ms-excel": [".xls"],
@@ -42,8 +51,10 @@ const ht = [
42
51
  "text/csv": [".csv"]
43
52
  }, Et = {
44
53
  "image/jpeg": [".jpeg", ".jpg"],
54
+ "image/jpg": [".jpg"],
45
55
  "image/png": [".png"],
46
56
  "image/gif": [".gif"],
57
+ "image/svg": [".svg"],
47
58
  "image/svg+xml": [".svg"],
48
59
  "image/webp": [".webp"],
49
60
  "image/avif": [".avif"]
@@ -53,7 +64,8 @@ const ht = [
53
64
  "video/webm": [".webm"]
54
65
  }, St = {
55
66
  "audio/mpeg": [".mp3"],
56
- "audio/ogg": [".oga"]
67
+ "audio/ogg": [".oga"],
68
+ "audio/opus": [".opus"]
57
69
  }, X = {
58
70
  audio: St,
59
71
  document: Tt,
@@ -130,7 +142,7 @@ function Ot() {
130
142
  return "Fragment";
131
143
  case C:
132
144
  return "Profiler";
133
- case j:
145
+ case N:
134
146
  return "StrictMode";
135
147
  case M:
136
148
  return "Suspense";
@@ -311,7 +323,7 @@ React keys must be passed directly to JSX without using spread:
311
323
  function d(a) {
312
324
  typeof a == "object" && a !== null && a.$$typeof === v && a._store && (a._store.validated = 1);
313
325
  }
314
- var f = I, v = Symbol.for("react.transitional.element"), S = Symbol.for("react.portal"), _ = Symbol.for("react.fragment"), j = Symbol.for("react.strict_mode"), C = Symbol.for("react.profiler"), T = Symbol.for("react.consumer"), y = Symbol.for("react.context"), O = Symbol.for("react.forward_ref"), M = Symbol.for("react.suspense"), w = Symbol.for("react.suspense_list"), P = Symbol.for("react.memo"), $ = Symbol.for("react.lazy"), V = Symbol.for("react.activity"), ot = Symbol.for("react.client.reference"), se = f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, ve = Object.prototype.hasOwnProperty, st = Array.isArray, ae = console.createTask ? console.createTask : function() {
326
+ var f = I, v = Symbol.for("react.transitional.element"), S = Symbol.for("react.portal"), _ = Symbol.for("react.fragment"), N = Symbol.for("react.strict_mode"), C = Symbol.for("react.profiler"), T = Symbol.for("react.consumer"), y = Symbol.for("react.context"), O = Symbol.for("react.forward_ref"), M = Symbol.for("react.suspense"), w = Symbol.for("react.suspense_list"), P = Symbol.for("react.memo"), $ = Symbol.for("react.lazy"), V = Symbol.for("react.activity"), ot = Symbol.for("react.client.reference"), se = f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, ve = Object.prototype.hasOwnProperty, st = Array.isArray, ae = console.createTask ? console.createTask : function() {
315
327
  return null;
316
328
  };
317
329
  f = {
@@ -351,16 +363,16 @@ React keys must be passed directly to JSX without using spread:
351
363
  }()), H;
352
364
  }
353
365
  var Se;
354
- function Nt() {
366
+ function jt() {
355
367
  return Se || (Se = 1, process.env.NODE_ENV === "production" ? K.exports = _t() : K.exports = Ot()), K.exports;
356
368
  }
357
- var m = Nt(), $e = {
369
+ var m = jt(), $e = {
358
370
  color: void 0,
359
371
  size: void 0,
360
372
  className: void 0,
361
373
  style: void 0,
362
374
  attr: void 0
363
- }, _e = I.createContext && /* @__PURE__ */ I.createContext($e), jt = ["attr", "size", "title"];
375
+ }, _e = I.createContext && /* @__PURE__ */ I.createContext($e), Nt = ["attr", "size", "title"];
364
376
  function Ct(e, t) {
365
377
  if (e == null) return {};
366
378
  var n = Rt(e, t), r, o;
@@ -423,7 +435,7 @@ function At(e, t) {
423
435
  if (typeof e != "object" || !e) return e;
424
436
  var n = e[Symbol.toPrimitive];
425
437
  if (n !== void 0) {
426
- var r = n.call(e, t || "default");
438
+ var r = n.call(e, t);
427
439
  if (typeof r != "object") return r;
428
440
  throw new TypeError("@@toPrimitive must return a primitive value.");
429
441
  }
@@ -445,7 +457,7 @@ function Dt(e) {
445
457
  attr: r,
446
458
  size: o,
447
459
  title: s
448
- } = e, c = Ct(e, jt), i = o || n.size || "1em", u;
460
+ } = e, c = Ct(e, Nt), i = o || n.size || "1em", u;
449
461
  return n.className && (u = n.className), e.className && (u = (u ? u + " " : "") + e.className), /* @__PURE__ */ I.createElement("svg", ee({
450
462
  stroke: "currentColor",
451
463
  fill: "currentColor",
@@ -463,7 +475,7 @@ function Dt(e) {
463
475
  return _e !== void 0 ? /* @__PURE__ */ I.createElement(_e.Consumer, null, (n) => t(n)) : t($e);
464
476
  }
465
477
  function We(e) {
466
- return It({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M12 22c5.421 0 10-4.579 10-10h-2c0 4.337-3.663 8-8 8s-8-3.663-8-8c0-4.336 3.663-8 8-8V2C6.579 2 2 6.58 2 12c0 5.421 4.579 10 10 10z" }, child: [] }] })(e);
478
+ return It({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M12 22c5.421 0 10-4.579 10-10h-2c0 4.337-3.663 8-8 8s-8-3.663-8-8c0-4.336 3.663-8 8-8V2C6.579 2 2 6.58 2 12c0 5.421 4.579 10 10 10z" }, child: [] }] })(e);
467
479
  }
468
480
  const R = (...e) => De(lt(e)), Mt = pt(
469
481
  "inline-flex items-center justify-center text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed",
@@ -538,8 +550,8 @@ const R = (...e) => De(lt(e)), Mt = pt(
538
550
  }
539
551
  );
540
552
  $t.displayName = "Button";
541
- const Ft = N.Root, kr = N.Trigger, Wt = N.Portal, Sr = N.Close, Be = D.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m.jsx(
542
- N.Overlay,
553
+ const Ft = j.Root, kr = j.Trigger, Wt = j.Portal, Sr = j.Close, Be = D.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m.jsx(
554
+ j.Overlay,
543
555
  {
544
556
  ref: n,
545
557
  className: R(
@@ -549,7 +561,7 @@ const Ft = N.Root, kr = N.Trigger, Wt = N.Portal, Sr = N.Close, Be = D.forwardRe
549
561
  ...t
550
562
  }
551
563
  ));
552
- Be.displayName = N.Overlay.displayName;
564
+ Be.displayName = j.Overlay.displayName;
553
565
  const Ue = D.forwardRef(
554
566
  ({
555
567
  className: e,
@@ -559,7 +571,7 @@ const Ue = D.forwardRef(
559
571
  overlayStyles: o,
560
572
  ...s
561
573
  }, c) => /* @__PURE__ */ m.jsx(Wt, { container: n, children: /* @__PURE__ */ m.jsx(Be, { className: o, children: /* @__PURE__ */ m.jsxs(
562
- N.Content,
574
+ j.Content,
563
575
  {
564
576
  ref: c,
565
577
  className: R(
@@ -570,7 +582,7 @@ const Ue = D.forwardRef(
570
582
  children: [
571
583
  t,
572
584
  !r && /* @__PURE__ */ m.jsxs(
573
- N.Close,
585
+ j.Close,
574
586
  {
575
587
  type: "button",
576
588
  className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-sm p-1 opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",
@@ -584,7 +596,7 @@ const Ue = D.forwardRef(
584
596
  }
585
597
  ) }) })
586
598
  );
587
- Ue.displayName = N.Content.displayName;
599
+ Ue.displayName = j.Content.displayName;
588
600
  const Ye = ({
589
601
  className: e,
590
602
  ...t
@@ -614,7 +626,7 @@ const Bt = ({
614
626
  );
615
627
  Bt.displayName = "DialogFooter";
616
628
  const ze = D.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m.jsx(
617
- N.Title,
629
+ j.Title,
618
630
  {
619
631
  ref: n,
620
632
  className: R(
@@ -624,16 +636,16 @@ const ze = D.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m.jsx(
624
636
  ...t
625
637
  }
626
638
  ));
627
- ze.displayName = N.Title.displayName;
639
+ ze.displayName = j.Title.displayName;
628
640
  const He = D.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m.jsx(
629
- N.Description,
641
+ j.Description,
630
642
  {
631
643
  ref: n,
632
644
  className: R("text-muted-foreground text-sm", e),
633
645
  ...t
634
646
  }
635
647
  ));
636
- He.displayName = N.Description.displayName;
648
+ He.displayName = j.Description.displayName;
637
649
  const _r = ({
638
650
  isOpen: e,
639
651
  onClose: t,
@@ -671,14 +683,14 @@ const _r = ({
671
683
  position: "bottom-right",
672
684
  ...n
673
685
  });
674
- }, Nr = (e, t = "Success", n = {}) => {
686
+ }, jr = (e, t = "Success", n = {}) => {
675
687
  n != null && n.id && Q.dismiss(n == null ? void 0 : n.id), Q.success(t, {
676
688
  description: e,
677
689
  duration: 4e3,
678
690
  position: "bottom-right",
679
691
  ...n
680
692
  });
681
- }, Yt = ({ className: e }) => /* @__PURE__ */ m.jsx(We, { className: R("h-8 w-8 animate-spin font-light", e) }), jr = B.Root, zt = D.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m.jsx(
693
+ }, Yt = ({ className: e }) => /* @__PURE__ */ m.jsx(We, { className: R("h-8 w-8 animate-spin font-light", e) }), Nr = B.Root, zt = D.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m.jsx(
682
694
  B.List,
683
695
  {
684
696
  ref: n,
@@ -811,9 +823,9 @@ var ln = Object.prototype, dn = ln.toString;
811
823
  function fn(e) {
812
824
  return dn.call(e);
813
825
  }
814
- var mn = "[object Null]", gn = "[object Undefined]", Ne = ne ? ne.toStringTag : void 0;
826
+ var mn = "[object Null]", gn = "[object Undefined]", je = ne ? ne.toStringTag : void 0;
815
827
  function pn(e) {
816
- return e == null ? e === void 0 ? gn : mn : Ne && Ne in Object(e) ? un(e) : fn(e);
828
+ return e == null ? e === void 0 ? gn : mn : je && je in Object(e) ? un(e) : fn(e);
817
829
  }
818
830
  function bn(e) {
819
831
  return e != null && typeof e == "object";
@@ -822,12 +834,12 @@ var vn = "[object Symbol]";
822
834
  function hn(e) {
823
835
  return typeof e == "symbol" || bn(e) && pn(e) == vn;
824
836
  }
825
- var je = NaN, wn = /^[-+]0x[0-9a-f]+$/i, yn = /^0b[01]+$/i, xn = /^0o[0-7]+$/i, Tn = parseInt;
837
+ var Ne = NaN, wn = /^[-+]0x[0-9a-f]+$/i, yn = /^0b[01]+$/i, xn = /^0o[0-7]+$/i, Tn = parseInt;
826
838
  function Ce(e) {
827
839
  if (typeof e == "number")
828
840
  return e;
829
841
  if (hn(e))
830
- return je;
842
+ return Ne;
831
843
  if (ge(e)) {
832
844
  var t = typeof e.valueOf == "function" ? e.valueOf() : e;
833
845
  e = ge(t) ? t + "" : t;
@@ -836,7 +848,7 @@ function Ce(e) {
836
848
  return e === 0 ? e : +e;
837
849
  e = sn(e);
838
850
  var n = yn.test(e);
839
- return n || xn.test(e) ? Tn(e.slice(2), n ? 2 : 8) : wn.test(e) ? je : +e;
851
+ return n || xn.test(e) ? Tn(e.slice(2), n ? 2 : 8) : wn.test(e) ? Ne : +e;
840
852
  }
841
853
  var En = "Expected a function", kn = Math.max, Sn = Math.min;
842
854
  function _n(e, t, n) {
@@ -855,13 +867,13 @@ function _n(e, t, n) {
855
867
  var P = w - u, $ = w - l, V = t - P;
856
868
  return d ? Sn(V, s - $) : V;
857
869
  }
858
- function j(w) {
870
+ function N(w) {
859
871
  var P = w - u, $ = w - l;
860
872
  return u === void 0 || P >= t || P < 0 || d && $ >= s;
861
873
  }
862
874
  function C() {
863
875
  var w = de();
864
- if (j(w))
876
+ if (N(w))
865
877
  return T(w);
866
878
  i = setTimeout(C, _(w));
867
879
  }
@@ -875,7 +887,7 @@ function _n(e, t, n) {
875
887
  return i === void 0 ? c : T(de());
876
888
  }
877
889
  function M() {
878
- var w = de(), P = j(w);
890
+ var w = de(), P = N(w);
879
891
  if (r = arguments, o = this, u = w, P) {
880
892
  if (i === void 0)
881
893
  return S(u);
@@ -893,11 +905,11 @@ const On = () => {
893
905
  ), _ = Math.floor(S / 5) * 5;
894
906
  if (_ <= n)
895
907
  return;
896
- const j = Date.now(), C = (j - c) / 1e3, y = Math.abs(d - o) / C;
897
- l(y > 300 ? "scan" : "read"), s(d), i(j), r(_), t(_);
908
+ const N = Date.now(), C = (N - c) / 1e3, y = Math.abs(d - o) / C;
909
+ l(y > 300 ? "scan" : "read"), s(d), i(N), r(_), t(_);
898
910
  }, 250);
899
911
  return b(() => (window.addEventListener("scroll", p), () => window.removeEventListener("scroll", p)), []), { depth: e, speedCategory: u };
900
- }, Nn = () => {
912
+ }, jn = () => {
901
913
  const e = L(), [t, n] = x(0);
902
914
  return b(() => {
903
915
  const r = Number(localStorage.getItem(e.audience.storage_keys.open_tabs)) || 0;
@@ -920,7 +932,7 @@ const On = () => {
920
932
  window.removeEventListener("storage", o), window.removeEventListener("beforeunload", s);
921
933
  };
922
934
  }, []), t;
923
- }, jn = () => {
935
+ }, Nn = () => {
924
936
  const e = L(), [t, n] = x(null);
925
937
  return b(() => {
926
938
  let r = sessionStorage.getItem(
@@ -1325,7 +1337,7 @@ const fe = new qn(), Kn = () => {
1325
1337
  r && typeof window < "u" && (window.levo_client = r);
1326
1338
  }, [r]), b(() => {
1327
1339
  r != null && r.audience && typeof window < "u" && (window.levo_audience = r == null ? void 0 : r.audience);
1328
- }, []), Nn(), jn(), Kn();
1340
+ }, []), jn(), Nn(), Kn();
1329
1341
  const o = tr();
1330
1342
  b(() => {
1331
1343
  var i;
@@ -1413,10 +1425,10 @@ const fe = new qn(), Kn = () => {
1413
1425
  try {
1414
1426
  const S = c[v];
1415
1427
  if (S) {
1416
- const _ = new URL(S), j = _.searchParams;
1417
- j.set("redirect_uri", s);
1428
+ const _ = new URL(S), N = _.searchParams;
1429
+ N.set("redirect_uri", s);
1418
1430
  const C = o.pageContext;
1419
- C && j.set("page_context", JSON.stringify(C)), d[v] = _.toString();
1431
+ C && N.set("page_context", JSON.stringify(C)), d[v] = _.toString();
1420
1432
  }
1421
1433
  } catch {
1422
1434
  }
@@ -1507,7 +1519,7 @@ const fe = new qn(), Kn = () => {
1507
1519
  url: i,
1508
1520
  onSuccess: s,
1509
1521
  onError: c,
1510
- children: o ? /* @__PURE__ */ m.jsx("div", { className: "w-full items-center justify-center", children: /* @__PURE__ */ m.jsx(Yt, { className: "h-5 w-5 bg-brand" }) }) : e
1522
+ children: o ? /* @__PURE__ */ m.jsx("div", { className: "w-full items-center justify-center", children: /* @__PURE__ */ m.jsx(Yt, { className: "bg-brand h-5 w-5" }) }) : e
1511
1523
  }
1512
1524
  ) : null;
1513
1525
  }, lr = ({ url: e, title: t, height: n, width: r }) => {
@@ -1537,7 +1549,7 @@ const fe = new qn(), Kn = () => {
1537
1549
  }).catch((y) => {
1538
1550
  var M;
1539
1551
  const O = Me(y);
1540
- (M = o.logger) == null || M.error("Failed to get OAuth URL", O), p({
1552
+ (M = o.logger) == null || M.error("Failed to get OAuth URL", O.message), p({
1541
1553
  code: (O == null ? void 0 : O.code) || "SOMETHING_WENT_WRONG",
1542
1554
  message: (O == null ? void 0 : O.message) || "We could not connect with our service for your sign-in."
1543
1555
  });
@@ -1557,7 +1569,7 @@ const fe = new qn(), Kn = () => {
1557
1569
  }, 700)), () => {
1558
1570
  d && d.close();
1559
1571
  }), [d]);
1560
- const j = me(
1572
+ const N = me(
1561
1573
  (T) => {
1562
1574
  if (T && i !== null) {
1563
1575
  const y = i == null ? void 0 : i[T];
@@ -1579,7 +1591,7 @@ const fe = new qn(), Kn = () => {
1579
1591
  ) : [], [i]),
1580
1592
  isLoading: s,
1581
1593
  error: l,
1582
- launchPopup: j
1594
+ launchPopup: N
1583
1595
  };
1584
1596
  };
1585
1597
  class Le {
@@ -1605,7 +1617,7 @@ export {
1605
1617
  Ir as LevoProvider,
1606
1618
  Rr as SimpleTooltipWrapper,
1607
1619
  Yt as Spinner,
1608
- jr as Tabs,
1620
+ Nr as Tabs,
1609
1621
  Gt as TabsContent,
1610
1622
  zt as TabsList,
1611
1623
  Ht as TabsTrigger,
@@ -1635,7 +1647,7 @@ export {
1635
1647
  Zt as isObjectType,
1636
1648
  q as mediaExtensionsByKind,
1637
1649
  X as mediaMimetypeByKind,
1638
- Nr as successToast,
1650
+ jr as successToast,
1639
1651
  Ur as toast,
1640
1652
  L as useLevo,
1641
1653
  Fr as useLevoOAuth,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@levo-so/react",
3
- "version": "0.1.50",
3
+ "version": "0.1.52",
4
4
  "author": "Levo Engineering <devs@theinternetfolks.com>",
5
5
  "description": "Levo suite for React based applications",
6
6
  "type": "module",
@@ -51,8 +51,8 @@
51
51
  "clsx": "2.1.1",
52
52
  "rollup-preserve-directives": "1.1.1",
53
53
  "tailwind-merge": "2.4.0",
54
- "typescript": "5.8.2",
55
- "vite": "6.0.5",
54
+ "typescript": "5.8.3",
55
+ "vite": "6.3.3",
56
56
  "vite-plugin-dts": "4.1.0"
57
57
  },
58
58
  "main": "./dist/index.js",