@grupo-elo-editorial/shared-ui-react 1.2.10 → 1.2.12

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
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import { clsx as Z } from "clsx";
3
3
  import { twMerge as J } from "tailwind-merge";
4
- import { jsx as e, jsxs as i, Fragment as _ } from "react/jsx-runtime";
4
+ import { jsx as e, jsxs as i, Fragment as P } from "react/jsx-runtime";
5
5
  import { forwardRef as x, useState as k, useEffect as M } from "react";
6
- import { Loader2 as V, User as ee, Star as te, CheckIcon as U, ChevronDownIcon as A, ChevronUpIcon as ae, CircleIcon as re, ShoppingCart as R, Heart as oe, Search as Q, X as ie, Minus as ne, Plus as se, ChevronRight as W, FileX as le, Package as de, AlertCircle as ce, RefreshCw as ue, Home as me, XIcon as K, Accessibility as fe, ZoomOut as ge, ZoomIn as ve, Moon as pe, Sun as be, ChevronLeft as he, Menu as xe, ChevronDown as O, Instagram as Ne, Facebook as we, Youtube as ye, Linkedin as ke, Mail as ze } from "lucide-react";
6
+ import { Loader2 as V, User as ee, Star as te, CheckIcon as U, ChevronDownIcon as R, ChevronUpIcon as ae, CircleIcon as re, ShoppingCart as _, Heart as oe, Search as Q, X as ie, Minus as ne, Plus as se, ChevronRight as W, FileX as le, Package as de, AlertCircle as ce, RefreshCw as ue, Home as me, XIcon as K, Accessibility as fe, ZoomOut as ge, ZoomIn as ve, Moon as pe, Sun as be, ChevronLeft as he, Menu as xe, ChevronDown as O, Instagram as Ne, Facebook as we, Youtube as ye, Linkedin as ke, Mail as ze } from "lucide-react";
7
7
  import { cva as L } from "class-variance-authority";
8
8
  import * as z from "@radix-ui/react-select";
9
9
  import * as F from "@radix-ui/react-checkbox";
@@ -64,10 +64,10 @@ const Se = L(
64
64
  ref: v,
65
65
  disabled: f || s,
66
66
  ...u,
67
- children: s ? /* @__PURE__ */ i(_, { children: [
67
+ children: s ? /* @__PURE__ */ i(P, { children: [
68
68
  /* @__PURE__ */ e(V, { className: "h-4 w-4 animate-spin" }),
69
69
  m && /* @__PURE__ */ e("span", { children: m })
70
- ] }) : /* @__PURE__ */ i(_, { children: [
70
+ ] }) : /* @__PURE__ */ i(P, { children: [
71
71
  c && /* @__PURE__ */ e("span", { className: "inline-flex", children: c }),
72
72
  m,
73
73
  l && /* @__PURE__ */ e("span", { className: "inline-flex", children: l })
@@ -131,7 +131,7 @@ const je = L(
131
131
  size: "md"
132
132
  }
133
133
  }
134
- ), P = x(
134
+ ), A = x(
135
135
  ({ className: a, variant: t, size: r, icon: n, onRemove: s, children: c, ...l }, m) => /* @__PURE__ */ i(
136
136
  "div",
137
137
  {
@@ -154,7 +154,7 @@ const je = L(
154
154
  }
155
155
  )
156
156
  );
157
- P.displayName = "Badge";
157
+ A.displayName = "Badge";
158
158
  const Me = L(
159
159
  "relative inline-flex items-center justify-center overflow-hidden rounded-full bg-[var(--muted)] text-[var(--muted-foreground)] flex-shrink-0",
160
160
  {
@@ -221,7 +221,7 @@ const Le = L("animate-spin text-[var(--brand-primary)]", {
221
221
  defaultVariants: {
222
222
  size: "md"
223
223
  }
224
- }), _e = x(
224
+ }), Pe = x(
225
225
  ({ className: a, size: t, label: r, ...n }, s) => /* @__PURE__ */ i(
226
226
  "div",
227
227
  {
@@ -237,8 +237,8 @@ const Le = L("animate-spin text-[var(--brand-primary)]", {
237
237
  }
238
238
  )
239
239
  );
240
- _e.displayName = "Spinner";
241
- const Pe = x(
240
+ Pe.displayName = "Spinner";
241
+ const Ae = x(
242
242
  ({ className: a, orientation: t = "horizontal", variant: r = "solid", text: n, ...s }, c) => {
243
243
  const l = {
244
244
  solid: "border-solid",
@@ -284,8 +284,8 @@ const Pe = x(
284
284
  );
285
285
  }
286
286
  );
287
- Pe.displayName = "Divider";
288
- const T = x(
287
+ Ae.displayName = "Divider";
288
+ const $ = x(
289
289
  ({
290
290
  className: a,
291
291
  value: t = 0,
@@ -347,7 +347,7 @@ const T = x(
347
347
  );
348
348
  }
349
349
  );
350
- T.displayName = "Rating";
350
+ $.displayName = "Rating";
351
351
  function zt({ className: a, type: t, ...r }) {
352
352
  return /* @__PURE__ */ e(
353
353
  "input",
@@ -392,7 +392,7 @@ function It({
392
392
  ...n,
393
393
  children: [
394
394
  r,
395
- /* @__PURE__ */ e(z.Icon, { asChild: !0, children: /* @__PURE__ */ e(A, { className: "size-4 opacity-50" }) })
395
+ /* @__PURE__ */ e(z.Icon, { asChild: !0, children: /* @__PURE__ */ e(R, { className: "size-4 opacity-50" }) })
396
396
  ]
397
397
  }
398
398
  );
@@ -415,7 +415,7 @@ function jt({
415
415
  position: r,
416
416
  ...n,
417
417
  children: [
418
- /* @__PURE__ */ e(Ae, {}),
418
+ /* @__PURE__ */ e(Re, {}),
419
419
  /* @__PURE__ */ e(
420
420
  z.Viewport,
421
421
  {
@@ -426,7 +426,7 @@ function jt({
426
426
  children: t
427
427
  }
428
428
  ),
429
- /* @__PURE__ */ e(Re, {})
429
+ /* @__PURE__ */ e(_e, {})
430
430
  ]
431
431
  }
432
432
  ) });
@@ -452,7 +452,7 @@ function Mt({
452
452
  }
453
453
  );
454
454
  }
455
- function Ae({
455
+ function Re({
456
456
  className: a,
457
457
  ...t
458
458
  }) {
@@ -469,7 +469,7 @@ function Ae({
469
469
  }
470
470
  );
471
471
  }
472
- function Re({
472
+ function _e({
473
473
  className: a,
474
474
  ...t
475
475
  }) {
@@ -482,7 +482,7 @@ function Re({
482
482
  a
483
483
  ),
484
484
  ...t,
485
- children: /* @__PURE__ */ e(A, { className: "size-4" })
485
+ children: /* @__PURE__ */ e(R, { className: "size-4" })
486
486
  }
487
487
  );
488
488
  }
@@ -523,7 +523,7 @@ function Lt({
523
523
  }
524
524
  );
525
525
  }
526
- function _t({
526
+ function Pt({
527
527
  className: a,
528
528
  ...t
529
529
  }) {
@@ -547,7 +547,7 @@ function _t({
547
547
  }
548
548
  );
549
549
  }
550
- function Pt({
550
+ function At({
551
551
  className: a,
552
552
  ...t
553
553
  }) {
@@ -579,7 +579,7 @@ function H({
579
579
  }) {
580
580
  return a ? /* @__PURE__ */ e("a", { href: a, className: t, tabIndex: -1, "aria-hidden": "true", children: r }) : /* @__PURE__ */ e("div", { className: t, children: r });
581
581
  }
582
- const $ = x(
582
+ const T = x(
583
583
  ({
584
584
  className: a,
585
585
  image: t,
@@ -615,7 +615,7 @@ const $ = x(
615
615
  {
616
616
  className: o(
617
617
  "rounded-lg bg-[var(--muted)]",
618
- p === "horizontal" ? "h-24 w-20 shrink-0" : "h-55 sm:h-66.5 w-36.75 sm:w-44.25"
618
+ p === "horizontal" ? "h-24 w-20 shrink-0" : "h-55 lg:h-66.5 w-full"
619
619
  )
620
620
  }
621
621
  ),
@@ -663,7 +663,7 @@ const $ = x(
663
663
  ) : /* @__PURE__ */ e("h3", { className: "line-clamp-2 text-sm font-medium text-[var(--card-foreground)]", children: r }),
664
664
  n && /* @__PURE__ */ e("p", { className: "text-xs text-[var(--muted-foreground)]", children: n }),
665
665
  l !== void 0 && /* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
666
- /* @__PURE__ */ e(T, { value: l, size: "sm", readonly: !0 }),
666
+ /* @__PURE__ */ e($, { value: l, size: "sm", readonly: !0 }),
667
667
  m !== void 0 && /* @__PURE__ */ i("span", { className: "text-xs text-[var(--muted-foreground)]", children: [
668
668
  "(",
669
669
  m,
@@ -688,7 +688,7 @@ const $ = x(
688
688
  variant: "primary",
689
689
  size: "sm",
690
690
  fullWidth: !0,
691
- leftIcon: /* @__PURE__ */ e(R, { className: "h-3.5 w-3.5" }),
691
+ leftIcon: /* @__PURE__ */ e(_, { className: "h-3.5 w-3.5" }),
692
692
  className: "mt-auto",
693
693
  children: g ? "Indisponível" : "Adicionar"
694
694
  }
@@ -701,7 +701,7 @@ const $ = x(
701
701
  {
702
702
  ref: j,
703
703
  className: o(
704
- "group relative flex flex-col w-fit min-w-37.5 rounded-lg border-2 border-border bg-card transition-all hover:shadow-lg",
704
+ "group relative flex flex-col rounded-lg border-2 border-border bg-card transition-all hover:shadow-lg",
705
705
  g && "opacity-60",
706
706
  a
707
707
  ),
@@ -711,18 +711,30 @@ const $ = x(
711
711
  H,
712
712
  {
713
713
  href: d,
714
- className: "relative block h-55 sm:h-66.5 w-fit overflow-hidden rounded-t-lg",
714
+ className: "relative block h-55 lg:h-66.5 w-full overflow-hidden rounded-t-lg",
715
715
  children: [
716
+ /* @__PURE__ */ e(
717
+ "div",
718
+ {
719
+ "aria-hidden": "true",
720
+ className: "absolute inset-0 bg-cover bg-center",
721
+ style: {
722
+ backgroundImage: `url(${t})`,
723
+ filter: "blur(14px) brightness(0.85)",
724
+ transform: "scale(1.2)"
725
+ }
726
+ }
727
+ ),
716
728
  /* @__PURE__ */ e(
717
729
  "img",
718
730
  {
719
731
  src: t,
720
732
  alt: r,
721
- className: "h-full w-auto transition-transform group-hover:scale-105"
733
+ className: "relative z-10 h-full w-full object-contain transition-transform group-hover:scale-105"
722
734
  }
723
735
  ),
724
- f && /* @__PURE__ */ e("div", { className: "absolute left-3 top-3", children: /* @__PURE__ */ e(P, { variant: u, children: f }) }),
725
- g && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center bg-black/60", children: /* @__PURE__ */ e(P, { variant: "danger", size: "lg", children: "Esgotado" }) })
736
+ f && /* @__PURE__ */ e("div", { className: "absolute left-3 top-3 z-20", children: /* @__PURE__ */ e(A, { variant: u, children: f }) }),
737
+ g && /* @__PURE__ */ e("div", { className: "absolute inset-0 z-20 flex items-center justify-center bg-black/60", children: /* @__PURE__ */ e(A, { variant: "danger", size: "lg", children: "Esgotado" }) })
726
738
  ]
727
739
  }
728
740
  ),
@@ -748,13 +760,13 @@ const $ = x(
748
760
  "a",
749
761
  {
750
762
  href: d,
751
- className: "line-clamp-2 text-base font-medium text-[var(--card-foreground)] hover:text-[var(--brand-primary)] transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] rounded",
763
+ className: "wrap-break-word text-base font-medium text-card-foreground hover:text-brand-primary transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded",
752
764
  children: r
753
765
  }
754
- ) : /* @__PURE__ */ e("h3", { className: "line-clamp-2 text-base font-medium text-[var(--card-foreground)]", children: r }),
766
+ ) : /* @__PURE__ */ e("h3", { className: "wrap-break-word text-base font-medium text-card-foreground", children: r }),
755
767
  n && /* @__PURE__ */ e("p", { className: "mt-1 text-sm text-[var(--muted-foreground)]", children: n }),
756
768
  l !== void 0 && /* @__PURE__ */ i("div", { className: "mt-2 flex items-center gap-2", children: [
757
- /* @__PURE__ */ e(T, { value: l, size: "sm", readonly: !0 }),
769
+ /* @__PURE__ */ e($, { value: l, size: "sm", readonly: !0 }),
758
770
  m !== void 0 && /* @__PURE__ */ i("span", { className: "text-sm text-[var(--muted-foreground)]", children: [
759
771
  "(",
760
772
  m,
@@ -779,7 +791,7 @@ const $ = x(
779
791
  variant: "primary",
780
792
  size: "md",
781
793
  fullWidth: !0,
782
- leftIcon: /* @__PURE__ */ e(R, { className: "h-4 w-4" }),
794
+ leftIcon: /* @__PURE__ */ e(_, { className: "h-4 w-4" }),
783
795
  className: o(
784
796
  "mt-4 transition-all duration-200",
785
797
  "opacity-0 translate-y-2",
@@ -794,7 +806,7 @@ const $ = x(
794
806
  }
795
807
  )
796
808
  );
797
- $.displayName = "ProductCard";
809
+ T.displayName = "ProductCard";
798
810
  const Ee = x(
799
811
  ({
800
812
  className: a,
@@ -857,7 +869,7 @@ const Ee = x(
857
869
  }
858
870
  );
859
871
  Ee.displayName = "SearchBar";
860
- const Te = x(
872
+ const $e = x(
861
873
  ({
862
874
  className: a,
863
875
  price: t,
@@ -902,7 +914,7 @@ const Te = x(
902
914
  }
903
915
  )
904
916
  ] }),
905
- c && u > 0 && /* @__PURE__ */ i(P, { variant: "success", size: "sm", children: [
917
+ c && u > 0 && /* @__PURE__ */ i(A, { variant: "success", size: "sm", children: [
906
918
  "-",
907
919
  u,
908
920
  "%"
@@ -920,8 +932,8 @@ const Te = x(
920
932
  ] });
921
933
  }
922
934
  );
923
- Te.displayName = "PriceDisplay";
924
- const $e = x(
935
+ $e.displayName = "PriceDisplay";
936
+ const Te = x(
925
937
  ({
926
938
  className: a,
927
939
  value: t,
@@ -1001,7 +1013,7 @@ const $e = x(
1001
1013
  ] });
1002
1014
  }
1003
1015
  );
1004
- $e.displayName = "QuantitySelector";
1016
+ Te.displayName = "QuantitySelector";
1005
1017
  const Be = x(
1006
1018
  ({ className: a, label: t, htmlFor: r, required: n, error: s, helperText: c, children: l, ...m }, f) => /* @__PURE__ */ i("div", { ref: f, className: o("flex flex-col gap-1.5", a), ...m, children: [
1007
1019
  t && /* @__PURE__ */ i(
@@ -1029,10 +1041,10 @@ const Be = x(
1029
1041
  ] })
1030
1042
  );
1031
1043
  Be.displayName = "FormGroup";
1032
- function At({ ...a }) {
1044
+ function Rt({ ...a }) {
1033
1045
  return /* @__PURE__ */ e("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...a });
1034
1046
  }
1035
- function Rt({ className: a, ...t }) {
1047
+ function _t({ className: a, ...t }) {
1036
1048
  return /* @__PURE__ */ e(
1037
1049
  "ol",
1038
1050
  {
@@ -1055,7 +1067,7 @@ function Et({ className: a, ...t }) {
1055
1067
  }
1056
1068
  );
1057
1069
  }
1058
- function Tt({
1070
+ function $t({
1059
1071
  asChild: a,
1060
1072
  className: t,
1061
1073
  ...r
@@ -1069,7 +1081,7 @@ function Tt({
1069
1081
  }
1070
1082
  );
1071
1083
  }
1072
- function $t({ className: a, ...t }) {
1084
+ function Tt({ className: a, ...t }) {
1073
1085
  return /* @__PURE__ */ e(
1074
1086
  "span",
1075
1087
  {
@@ -1133,7 +1145,7 @@ function qt({
1133
1145
  ...r,
1134
1146
  children: [
1135
1147
  t,
1136
- /* @__PURE__ */ e(A, { className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" })
1148
+ /* @__PURE__ */ e(R, { className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" })
1137
1149
  ]
1138
1150
  }
1139
1151
  ) });
@@ -1227,7 +1239,7 @@ const Fe = x(
1227
1239
  ),
1228
1240
  ...v,
1229
1241
  children: [
1230
- m && /* @__PURE__ */ i(_, { children: [
1242
+ m && /* @__PURE__ */ i(P, { children: [
1231
1243
  /* @__PURE__ */ e(
1232
1244
  "div",
1233
1245
  {
@@ -1320,7 +1332,7 @@ const X = x(
1320
1332
  const u = r || {
1321
1333
  default: /* @__PURE__ */ e(de, { className: "h-16 w-16" }),
1322
1334
  search: /* @__PURE__ */ e(Q, { className: "h-16 w-16" }),
1323
- cart: /* @__PURE__ */ e(R, { className: "h-16 w-16" }),
1335
+ cart: /* @__PURE__ */ e(_, { className: "h-16 w-16" }),
1324
1336
  error: /* @__PURE__ */ e(le, { className: "h-16 w-16" })
1325
1337
  }[t];
1326
1338
  return /* @__PURE__ */ i(
@@ -1454,13 +1466,13 @@ const He = x(
1454
1466
  {
1455
1467
  ref: u,
1456
1468
  className: o(
1457
- "flex flex-wrap",
1469
+ "grid grid-cols-2 lg:grid-cols-4",
1458
1470
  v[n],
1459
1471
  a
1460
1472
  ),
1461
1473
  ...f,
1462
1474
  children: Array.from({ length: c }).map((g, b) => /* @__PURE__ */ e(
1463
- $,
1475
+ T,
1464
1476
  {
1465
1477
  image: "",
1466
1478
  title: "",
@@ -1486,12 +1498,12 @@ const He = x(
1486
1498
  {
1487
1499
  ref: u,
1488
1500
  className: o(
1489
- "flex flex-wrap",
1501
+ "grid grid-cols-2 lg:grid-cols-4",
1490
1502
  v[n],
1491
1503
  a
1492
1504
  ),
1493
1505
  ...f,
1494
- children: t.map((g, b) => /* @__PURE__ */ e($, { ...g }, b))
1506
+ children: t.map((g, b) => /* @__PURE__ */ e(T, { ...g }, b))
1495
1507
  }
1496
1508
  );
1497
1509
  }
@@ -1940,7 +1952,7 @@ const at = x(
1940
1952
  },
1941
1953
  d.id
1942
1954
  )) }),
1943
- t.length > 1 && /* @__PURE__ */ i(_, { children: [
1955
+ t.length > 1 && /* @__PURE__ */ i(P, { children: [
1944
1956
  /* @__PURE__ */ e(
1945
1957
  "button",
1946
1958
  {
@@ -2049,7 +2061,7 @@ function nt({
2049
2061
  t,
2050
2062
  " ",
2051
2063
  /* @__PURE__ */ e(
2052
- A,
2064
+ R,
2053
2065
  {
2054
2066
  className: "relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180",
2055
2067
  "aria-hidden": "true"
@@ -2396,7 +2408,7 @@ const vt = ({ brand: a = "elo-editora", onNewsletterSubmit: t, className: r, ...
2396
2408
  });
2397
2409
  return v.observe(u, { attributes: !0, attributeFilter: ["data-theme"] }), () => v.disconnect();
2398
2410
  }, []);
2399
- const l = a === "perabook" ? s === "dark" ? "/logos/logo_PeraBook_institucional_tarja_branca.png" : "/logos/PeraBook_instituicional.png" : s === "dark" ? "/logos/logo_elo_editora_texto_branco.png" : "/logos/logo_elo_editora_texto_azul.png", m = a === "perabook" ? "PeraBook" : "Elo Editora", f = a === "perabook" ? "Educação socioemocional e diversidade cultural" : "Literatura infantojuvenil que transforma vidas";
2411
+ const l = a === "perabook" ? s === "dark" ? "/logos/logo_PeraBook_institucional_tarja_branca.png" : "/logos/PeraBook_instituicional.png" : s === "dark" ? "/logos/logo_elo_editora_texto_branco.png" : "/logos/logo_elo_institucional.png", m = a === "perabook" ? "PeraBook" : "Elo Editora", f = a === "perabook" ? "Educação socioemocional e diversidade cultural" : "Literatura infantojuvenil que transforma vidas";
2400
2412
  return /* @__PURE__ */ i(
2401
2413
  "footer",
2402
2414
  {
@@ -2487,12 +2499,12 @@ export {
2487
2499
  Ft as AccordionItem,
2488
2500
  qt as AccordionTrigger,
2489
2501
  De as Avatar,
2490
- P as Badge,
2491
- At as Breadcrumb,
2502
+ A as Badge,
2503
+ Rt as Breadcrumb,
2492
2504
  Et as BreadcrumbItem,
2493
- Tt as BreadcrumbLink,
2494
- Rt as BreadcrumbList,
2495
- $t as BreadcrumbPage,
2505
+ $t as BreadcrumbLink,
2506
+ _t as BreadcrumbList,
2507
+ Tt as BreadcrumbPage,
2496
2508
  Bt as BreadcrumbSeparator,
2497
2509
  C as Button,
2498
2510
  Dt as Checkbox,
@@ -2504,7 +2516,7 @@ export {
2504
2516
  Xt as DialogHeader,
2505
2517
  Zt as DialogTitle,
2506
2518
  Kt as DialogTrigger,
2507
- Pe as Divider,
2519
+ Ae as Divider,
2508
2520
  Qe as Drawer,
2509
2521
  X as EmptyState,
2510
2522
  qe as ErrorState,
@@ -2516,14 +2528,14 @@ export {
2516
2528
  zt as Input,
2517
2529
  ct as MegaMenu,
2518
2530
  Wt as Modal,
2519
- Te as PriceDisplay,
2520
- $ as ProductCard,
2531
+ $e as PriceDisplay,
2532
+ T as ProductCard,
2521
2533
  He as ProductGrid,
2522
2534
  la as ProgressBar,
2523
- $e as QuantitySelector,
2535
+ Te as QuantitySelector,
2524
2536
  Lt as RadioGroup,
2525
- _t as RadioGroupItem,
2526
- T as Rating,
2537
+ Pt as RadioGroupItem,
2538
+ $ as Rating,
2527
2539
  Ee as SearchBar,
2528
2540
  Ct as Select,
2529
2541
  jt as SelectContent,
@@ -2536,9 +2548,9 @@ export {
2536
2548
  Ze as SheetHeader,
2537
2549
  Je as SheetTitle,
2538
2550
  We as SheetTrigger,
2539
- _e as Spinner,
2551
+ Pe as Spinner,
2540
2552
  Ie as Textarea,
2541
- Pt as Toggle,
2553
+ At as Toggle,
2542
2554
  Gt as Tooltip,
2543
2555
  Qt as TooltipContent,
2544
2556
  Ve as TooltipProvider,