@dimasbaguspm/versaur 0.0.32 → 0.0.34

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,6 +1,7 @@
1
1
  import { c as cva, j as jsxRuntimeExports, a as cn } from "./index-DOdDlCoL.js";
2
2
  import * as React from "react";
3
3
  import React__default, { forwardRef, useState, useEffect, useCallback, useRef, useId, cloneElement, createContext, useContext } from "react";
4
+ import ReactDOM from "react-dom";
4
5
  import { EllipsisVerticalIcon, X, XIcon, ImageOff } from "lucide-react";
5
6
  import { S as Skeleton } from "./skeleton-BNZyaRjo.js";
6
7
  const alertVariants = cva(
@@ -148,10 +149,10 @@ const alertVariants = cva(
148
149
  className: s,
149
150
  children: i,
150
151
  ...o
151
- }, a) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
152
+ }, n) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
152
153
  "div",
153
154
  {
154
- ref: a,
155
+ ref: n,
155
156
  role: "alert",
156
157
  className: cn(alertVariants({ variant: e, color: t }), s),
157
158
  ...o,
@@ -228,16 +229,16 @@ const alertVariants = cva(
228
229
  fontSize: s = "base",
229
230
  fontWeight: i = "medium",
230
231
  quiet: o = !1,
231
- ...a
232
- }, n) => /* @__PURE__ */ jsxRuntimeExports.jsx(
232
+ ...n
233
+ }, a) => /* @__PURE__ */ jsxRuntimeExports.jsx(
233
234
  "a",
234
235
  {
235
- ref: n,
236
+ ref: a,
236
237
  className: cn(
237
238
  anchorVariants({ color: r, fontSize: s, fontWeight: i, quiet: o }),
238
239
  t
239
240
  ),
240
- ...a,
241
+ ...n,
241
242
  children: e
242
243
  }
243
244
  )
@@ -318,15 +319,15 @@ const alertVariants = cva(
318
319
  isCapitalize: s = !1,
319
320
  align: i = "left",
320
321
  italic: o = !1,
321
- clamp: a = "none",
322
- ellipsis: n = !1,
322
+ clamp: n = "none",
323
+ ellipsis: a = !1,
323
324
  fontSize: l,
324
- fontWeight: c,
325
- className: g,
326
- children: d,
327
- ...u
328
- }, f) => {
329
- const x = [
325
+ fontWeight: u,
326
+ className: c,
327
+ children: f,
328
+ ...d
329
+ }, b) => {
330
+ const h = [
330
331
  "h1",
331
332
  "h2",
332
333
  "h3",
@@ -336,11 +337,11 @@ const alertVariants = cva(
336
337
  "p",
337
338
  "span",
338
339
  "label"
339
- ].includes(e) ? e : "span", m = l ? `text-${l}` : "", h = c ? `font-${c}` : "";
340
+ ].includes(e) ? e : "span", y = l ? `text-${l}` : "", v = u ? `font-${u}` : "";
340
341
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
341
342
  e,
342
343
  {
343
- ref: f,
344
+ ref: b,
344
345
  className: cn(
345
346
  textVariants({
346
347
  color: t,
@@ -348,17 +349,17 @@ const alertVariants = cva(
348
349
  isCapitalize: s,
349
350
  align: i,
350
351
  italic: o,
351
- clamp: a,
352
- ellipsis: n,
352
+ clamp: n,
353
+ ellipsis: a,
353
354
  // @ts-expect-error - `as` is not a valid variant
354
- as: x
355
+ as: h
355
356
  }),
356
- m,
357
- h,
358
- g
357
+ y,
358
+ v,
359
+ c
359
360
  ),
360
- ...u,
361
- children: d
361
+ ...d,
362
+ children: f
362
363
  }
363
364
  );
364
365
  }
@@ -440,17 +441,17 @@ function getGridCols(e = 4) {
440
441
  return "grid-cols-4";
441
442
  }
442
443
  }
443
- const AttributeListItem = forwardRef(function({ children: t, className: r, span: s = 1, title: i, ...o }, a) {
444
- const n = getColSpan(s);
445
- return /* @__PURE__ */ jsxRuntimeExports.jsx("li", { ref: a, className: cn(n, r), ...o, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Attribute, { title: i, children: t }) });
444
+ const AttributeListItem = forwardRef(function({ children: t, className: r, span: s = 1, title: i, ...o }, n) {
445
+ const a = getColSpan(s);
446
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("li", { ref: n, className: cn(a, r), ...o, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Attribute, { title: i, children: t }) });
446
447
  }), AttributeListRoot = forwardRef(
447
448
  function({ children: t, className: r, columns: s = 4, ...i }, o) {
448
- const a = getGridCols(s);
449
+ const n = getGridCols(s);
449
450
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
450
451
  "ul",
451
452
  {
452
453
  ref: o,
453
- className: cn("grid gap-4", a, r),
454
+ className: cn("grid gap-4", n, r),
454
455
  ...i,
455
456
  children: t
456
457
  }
@@ -504,10 +505,10 @@ const AttributeListItem = forwardRef(function({ children: t, className: r, span:
504
505
  className: s,
505
506
  children: i,
506
507
  ...o
507
- }, a) => /* @__PURE__ */ jsxRuntimeExports.jsx(
508
+ }, n) => /* @__PURE__ */ jsxRuntimeExports.jsx(
508
509
  "div",
509
510
  {
510
- ref: a,
511
+ ref: n,
511
512
  className: cn(avatarVariants({ variant: e, size: t, shape: r }), s),
512
513
  ...o,
513
514
  children: i
@@ -515,17 +516,17 @@ const AttributeListItem = forwardRef(function({ children: t, className: r, span:
515
516
  )
516
517
  ), AvatarImage = forwardRef(
517
518
  ({ src: e, alt: t, className: r, onError: s, ...i }, o) => {
518
- const [a, n] = useState(!1);
519
+ const [n, a] = useState(!1);
519
520
  useEffect(() => {
520
- n(!1);
521
+ a(!1);
521
522
  }, [e]);
522
523
  const l = useCallback(
523
- (c) => {
524
- n(!0), s?.(c);
524
+ (u) => {
525
+ a(!0), s?.(u);
525
526
  },
526
527
  [s]
527
528
  );
528
- return a ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
529
+ return n ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
529
530
  "img",
530
531
  {
531
532
  ref: o,
@@ -703,34 +704,34 @@ const AttributeListItem = forwardRef(function({ children: t, className: r, span:
703
704
  size: s = "md",
704
705
  iconLeft: i,
705
706
  iconRight: o,
706
- className: a,
707
- children: n,
707
+ className: n,
708
+ children: a,
708
709
  ...l
709
- }, c) => {
710
- const u = !(n != null && n !== "") && !!(i || o);
710
+ }, u) => {
711
+ const d = !(a != null && a !== "") && !!(i || o);
711
712
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
712
713
  "span",
713
714
  {
714
- ref: c,
715
+ ref: u,
715
716
  className: cn(
716
717
  badgeVariants({
717
718
  variant: e,
718
719
  color: r,
719
720
  shape: t,
720
721
  size: s,
721
- iconOnly: u
722
+ iconOnly: d
722
723
  }),
723
- a
724
+ n
724
725
  ),
725
726
  ...l,
726
- children: u ? (
727
+ children: d ? (
727
728
  // Icon-only mode: display only the icon
728
729
  i || o
729
730
  ) : (
730
731
  // Normal mode: display icon(s) and text
731
732
  /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
732
733
  i,
733
- n,
734
+ a,
734
735
  o
735
736
  ] })
736
737
  )
@@ -833,8 +834,8 @@ const AttributeListItem = forwardRef(function({ children: t, className: r, span:
833
834
  size: s = "md",
834
835
  disabled: i = !1,
835
836
  type: o = "button",
836
- children: a,
837
- ...n
837
+ children: n,
838
+ ...a
838
839
  }, l) {
839
840
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
840
841
  "button",
@@ -845,13 +846,21 @@ const AttributeListItem = forwardRef(function({ children: t, className: r, span:
845
846
  disabled: i,
846
847
  "aria-disabled": i,
847
848
  inert: i ? !0 : void 0,
848
- ...n,
849
- children: a
849
+ ...a,
850
+ children: n
850
851
  }
851
852
  );
852
853
  }
853
- ), menuVariants = cva(
854
- "absolute z-70 min-w-40 bg-background rounded-lg border border-border transition-all duration-200 ease-out will-change-transform",
854
+ ), OverlayPortal = ({
855
+ container: e,
856
+ children: t
857
+ }) => {
858
+ if (typeof window > "u" || typeof document > "u")
859
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: t });
860
+ const r = e ?? document.body;
861
+ return r ? ReactDOM.createPortal(t, r) : /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: t });
862
+ }, menuVariants = cva(
863
+ "z-70 min-w-40 bg-background rounded-lg border border-border transition-all duration-200 ease-out will-change-transform shadow-lg",
855
864
  {
856
865
  variants: {
857
866
  size: {
@@ -859,8 +868,8 @@ const AttributeListItem = forwardRef(function({ children: t, className: r, span:
859
868
  md: "py-2 px-1"
860
869
  },
861
870
  open: {
862
- true: "opacity-100 translate-y-1",
863
- false: "opacity-0 pointer-events-none translate-y-3"
871
+ true: "opacity-100 scale-100",
872
+ false: "opacity-0 pointer-events-none scale-95"
864
873
  }
865
874
  },
866
875
  defaultVariants: {
@@ -878,18 +887,87 @@ function useMenuOutsideClick(e, t, r, s) {
878
887
  return document.addEventListener("mousedown", i), () => document.removeEventListener("mousedown", i);
879
888
  }, [e, s, t, r]);
880
889
  }
881
- function useEscapeClose(e, t, r) {
882
- const s = useRef(null);
890
+ function useMenuPosition(e, t, r, s = "bottom-start", i) {
891
+ const [o, n] = useState({ isReady: !1 });
883
892
  return useEffect(() => {
884
- s.current && s.current.focus();
885
- }, []), useEffect(() => {
886
- const i = (o) => {
887
- o.key === "Escape" && e && s.current && s.current.contains(document.activeElement) && !r && t();
888
- };
889
- return e && (document.addEventListener("keydown", i), document.body.style.overflow = "hidden"), () => {
890
- document.removeEventListener("keydown", i), document.body.style.overflow = "unset";
891
- };
892
- }, [e, t, r, s]), s;
893
+ if (!e || !t.current) {
894
+ n({ isReady: !1 });
895
+ return;
896
+ }
897
+ if (!r.current) {
898
+ const w = setTimeout(() => {
899
+ n({ isReady: !1 });
900
+ }, 0);
901
+ return () => clearTimeout(w);
902
+ }
903
+ const a = t.current, l = r.current, u = i || document.documentElement, c = a.getBoundingClientRect(), f = u.getBoundingClientRect(), d = l.style.visibility, b = l.style.position, p = l.style.opacity;
904
+ l.style.visibility = "hidden", l.style.position = "absolute", l.style.opacity = "0";
905
+ const h = l.getBoundingClientRect();
906
+ l.style.visibility = d, l.style.position = b, l.style.opacity = p;
907
+ const y = f.bottom - c.bottom - 8, v = c.top - f.top - 8, R = f.right - c.left - 8, j = c.right - f.left - 8;
908
+ let x = s;
909
+ s === "auto" && (y >= h.height && R >= h.width ? x = "bottom-start" : y >= h.height && j >= h.width ? x = "bottom-end" : v >= h.height && R >= h.width ? x = "top-start" : v >= h.height && j >= h.width ? x = "top-end" : x = y >= v ? "bottom-start" : "top-start");
910
+ const g = {};
911
+ if (i)
912
+ switch (g.position = "fixed", x) {
913
+ case "bottom-start":
914
+ g.top = c.bottom + 4, g.left = c.left;
915
+ break;
916
+ case "bottom-end":
917
+ g.top = c.bottom + 4, g.right = window.innerWidth - c.right;
918
+ break;
919
+ case "top-start":
920
+ g.bottom = window.innerHeight - c.top + 4, g.left = c.left;
921
+ break;
922
+ case "top-end":
923
+ g.bottom = window.innerHeight - c.top + 4, g.right = window.innerWidth - c.right;
924
+ break;
925
+ }
926
+ else
927
+ switch (g.position = "absolute", x) {
928
+ case "bottom-start":
929
+ g.top = c.height + 4, g.left = 0;
930
+ break;
931
+ case "bottom-end":
932
+ g.top = c.height + 4, g.right = 0;
933
+ break;
934
+ case "top-start":
935
+ g.bottom = c.height + 4, g.left = 0;
936
+ break;
937
+ case "top-end":
938
+ g.bottom = c.height + 4, g.right = 0;
939
+ break;
940
+ }
941
+ if (i) {
942
+ const w = {
943
+ top: x.startsWith("bottom") ? c.bottom + 4 : c.top - h.height - 4,
944
+ left: x.endsWith("start") ? c.left : c.right - h.width,
945
+ width: h.width,
946
+ height: h.height
947
+ };
948
+ if (w.left < f.left + 8) {
949
+ const m = f.left + 8 - w.left;
950
+ x.endsWith("start") ? g.left = (g.left || 0) + m : g.right = (g.right || 0) - m;
951
+ } else if (w.left + w.width > f.right - 8) {
952
+ const m = w.left + w.width - (f.right - 8);
953
+ x.endsWith("start") ? g.left = (g.left || 0) - m : g.right = (g.right || 0) + m;
954
+ }
955
+ if (x.startsWith("bottom")) {
956
+ const m = Math.max(
957
+ 50,
958
+ f.bottom - c.bottom - 16
959
+ );
960
+ h.height > m && (g.maxHeight = m);
961
+ } else {
962
+ const m = Math.max(
963
+ 50,
964
+ c.top - f.top - 16
965
+ );
966
+ h.height > m && (g.maxHeight = m);
967
+ }
968
+ }
969
+ g.isReady = !0, n(g);
970
+ }, [e, s, i, t, r]), o;
893
971
  }
894
972
  const MenuContent = forwardRef(
895
973
  ({ children: e }, t) => /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { ref: t, className: "flex flex-col gap-1", children: e })
@@ -903,33 +981,81 @@ const MenuContent = forwardRef(
903
981
  children: e
904
982
  }
905
983
  ) })
906
- ), MenuRoot = ({
984
+ );
985
+ function useEscapeClose(e, t, r) {
986
+ const s = useRef(null);
987
+ return useEffect(() => {
988
+ s.current && s.current.focus();
989
+ }, []), useEffect(() => {
990
+ const i = (o) => {
991
+ o.key === "Escape" && e && s.current && s.current.contains(document.activeElement) && !r && t();
992
+ };
993
+ return e && (document.addEventListener("keydown", i), document.body.style.overflow = "hidden"), () => {
994
+ document.removeEventListener("keydown", i), document.body.style.overflow = "unset";
995
+ };
996
+ }, [e, t, r, s]), s;
997
+ }
998
+ const MenuRoot = ({
907
999
  isOpen: e,
908
1000
  onOutsideClick: t,
909
1001
  size: r = "md",
910
1002
  content: s,
911
- children: i
1003
+ children: i,
1004
+ placement: o = "bottom-start",
1005
+ container: n
912
1006
  }) => {
913
- const o = useRef(null), a = useRef(null), n = useId();
914
- return useMenuOutsideClick(e, a, o, t), useEscapeClose(e, t), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative w-fit", children: [
1007
+ const a = useRef(null), l = useRef(null), u = useId();
1008
+ useMenuOutsideClick(e, l, a, t), useEscapeClose(e, t);
1009
+ const c = useMenuPosition(
1010
+ e,
1011
+ a,
1012
+ l,
1013
+ o,
1014
+ n
1015
+ ), f = {
1016
+ ...c,
1017
+ position: c.position || "absolute",
1018
+ overflowY: c.maxHeight ? "auto" : void 0,
1019
+ overflowX: c.maxWidth ? "auto" : void 0
1020
+ }, d = e && c.isReady, b = /* @__PURE__ */ jsxRuntimeExports.jsx(
1021
+ "div",
1022
+ {
1023
+ id: u,
1024
+ ref: l,
1025
+ className: cn(menuVariants({ size: r, open: d })),
1026
+ style: f,
1027
+ role: "menu",
1028
+ "aria-hidden": !d,
1029
+ children: s
1030
+ }
1031
+ );
1032
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative w-fit", children: [
915
1033
  cloneElement(i, {
916
1034
  // @ts-expect-error: ref is valid for button or forwardRef components
917
- ref: o,
1035
+ ref: a,
918
1036
  "aria-haspopup": "menu",
919
1037
  "aria-expanded": e,
920
- "aria-controls": n
1038
+ "aria-controls": u
921
1039
  }),
922
- e && /* @__PURE__ */ jsxRuntimeExports.jsx(
923
- "div",
924
- {
925
- id: n,
926
- ref: a,
927
- className: cn(menuVariants({ size: r, open: e })),
928
- role: "menu",
929
- "aria-hidden": !e,
930
- children: s
931
- }
932
- )
1040
+ e && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
1041
+ !c.isReady && /* @__PURE__ */ jsxRuntimeExports.jsx(
1042
+ "div",
1043
+ {
1044
+ ref: l,
1045
+ className: cn(menuVariants({ size: r, open: !1 })),
1046
+ style: {
1047
+ position: "absolute",
1048
+ visibility: "hidden",
1049
+ opacity: 0,
1050
+ pointerEvents: "none"
1051
+ },
1052
+ role: "menu",
1053
+ "aria-hidden": !0,
1054
+ children: s
1055
+ }
1056
+ ),
1057
+ c.isReady && /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: c.position === "fixed" ? /* @__PURE__ */ jsxRuntimeExports.jsx(OverlayPortal, { children: b }) : b })
1058
+ ] })
933
1059
  ] });
934
1060
  }, Menu = Object.assign(MenuRoot, {
935
1061
  Content: MenuContent,
@@ -1052,11 +1178,11 @@ const buttonIconVariants = cva(
1052
1178
  size: "md",
1053
1179
  color: "primary"
1054
1180
  }
1055
- }), Icon = React__default.forwardRef(function({ as: t, color: r = "primary", size: s = "md", className: i, ...o }, a) {
1181
+ }), Icon = React__default.forwardRef(function({ as: t, color: r = "primary", size: s = "md", className: i, ...o }, n) {
1056
1182
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
1057
1183
  t,
1058
1184
  {
1059
- ref: a,
1185
+ ref: n,
1060
1186
  className: iconVariants({ color: r, size: s, className: i }),
1061
1187
  ...o
1062
1188
  }
@@ -1068,14 +1194,14 @@ const buttonIconVariants = cva(
1068
1194
  size: s = "md",
1069
1195
  shape: i = "rounded",
1070
1196
  disabled: o = !1,
1071
- as: a,
1072
- "aria-label": n,
1197
+ as: n,
1198
+ "aria-label": a,
1073
1199
  ...l
1074
- }, c) {
1200
+ }, u) {
1075
1201
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
1076
1202
  "button",
1077
1203
  {
1078
- ref: c,
1204
+ ref: u,
1079
1205
  type: "button",
1080
1206
  className: cn(
1081
1207
  buttonIconVariants({
@@ -1087,13 +1213,13 @@ const buttonIconVariants = cva(
1087
1213
  ),
1088
1214
  disabled: o,
1089
1215
  "aria-disabled": o,
1090
- "aria-label": n,
1216
+ "aria-label": a,
1091
1217
  inert: o ? !0 : void 0,
1092
1218
  ...l,
1093
1219
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1094
1220
  Icon,
1095
1221
  {
1096
- as: a,
1222
+ as: n,
1097
1223
  size: "sm",
1098
1224
  color: getIconColorFromVariant(r)
1099
1225
  }
@@ -1105,27 +1231,31 @@ const buttonIconVariants = cva(
1105
1231
  (e, t) => {
1106
1232
  const {
1107
1233
  as: r = EllipsisVerticalIcon,
1108
- content: s,
1234
+ children: s,
1109
1235
  onOpenChange: i,
1110
1236
  onClick: o,
1111
- ...a
1112
- } = e ?? {}, [n, l] = useState(!1);
1237
+ placement: n = "bottom-start",
1238
+ container: a,
1239
+ ...l
1240
+ } = e ?? {}, [u, c] = useState(!1);
1113
1241
  useEffect(() => {
1114
- i?.(n);
1115
- }, [n, i]);
1116
- const c = () => {
1117
- l(!1);
1118
- }, g = (d) => {
1119
- l((u) => !u), o?.(d);
1242
+ i?.(u);
1243
+ }, [u, i]);
1244
+ const f = () => {
1245
+ c(!1);
1246
+ }, d = (b) => {
1247
+ c((p) => !p), o?.(b);
1120
1248
  };
1121
1249
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
1122
1250
  Menu,
1123
1251
  {
1124
- isOpen: n,
1125
- onOutsideClick: c,
1252
+ isOpen: u,
1253
+ onOutsideClick: f,
1126
1254
  size: "md",
1255
+ placement: n,
1256
+ container: a,
1127
1257
  content: /* @__PURE__ */ jsxRuntimeExports.jsx(Menu.Content, { children: s }),
1128
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonIcon, { ref: t, as: r, onClick: g, ...a })
1258
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonIcon, { ref: t, as: r, onClick: d, ...l })
1129
1259
  }
1130
1260
  );
1131
1261
  }
@@ -1199,35 +1329,35 @@ const buttonIconVariants = cva(
1199
1329
  }
1200
1330
  );
1201
1331
  function useFloatingPosition(e, t = "1rem") {
1202
- const r = useRef(null), [s, i] = useState({}), [o, a] = useState("fixed bottom-4 right-4"), n = useCallback(() => {
1203
- const c = r.current;
1204
- if (!c) return;
1205
- const d = c.getBoundingClientRect().height > window.innerHeight;
1206
- let u = {}, f = "";
1207
- d ? (u = {
1332
+ const r = useRef(null), [s, i] = useState({}), [o, n] = useState("fixed bottom-4 right-4"), a = useCallback(() => {
1333
+ const u = r.current;
1334
+ if (!u) return;
1335
+ const f = u.getBoundingClientRect().height > window.innerHeight;
1336
+ let d = {}, b = "";
1337
+ f ? (d = {
1208
1338
  position: "fixed",
1209
1339
  bottom: t,
1210
1340
  zIndex: 50,
1211
- transform: `translateY(${c.scrollTop}px)`
1212
- }, f = `fixed bottom-4 ${e}-4`) : (u = {
1341
+ transform: `translateY(${u.scrollTop}px)`
1342
+ }, b = `fixed bottom-4 ${e}-4`) : (d = {
1213
1343
  position: "fixed",
1214
1344
  bottom: t,
1215
1345
  zIndex: 50
1216
- }, f = `fixed bottom-4 ${e}-4`), i(u), a(f);
1346
+ }, b = `fixed bottom-4 ${e}-4`), i(d), n(b);
1217
1347
  }, [e, t]);
1218
1348
  return useEffect(() => {
1219
- n();
1220
- const c = r.current;
1221
- return c && c.addEventListener("scroll", n), window.addEventListener("resize", n), () => {
1222
- c && c.removeEventListener("scroll", n), window.removeEventListener("resize", n);
1349
+ a();
1350
+ const u = r.current;
1351
+ return u && u.addEventListener("scroll", a), window.addEventListener("resize", a), () => {
1352
+ u && u.removeEventListener("scroll", a), window.removeEventListener("resize", a);
1223
1353
  };
1224
- }, [n]), useEffect(() => {
1225
- r.current && n();
1226
- }, [e, t, n]), [useCallback(
1227
- (c) => {
1228
- r.current = c, c && n();
1354
+ }, [a]), useEffect(() => {
1355
+ r.current && a();
1356
+ }, [e, t, a]), [useCallback(
1357
+ (u) => {
1358
+ r.current = u, u && a();
1229
1359
  },
1230
- [n]
1360
+ [a]
1231
1361
  ), s, o];
1232
1362
  }
1233
1363
  const ButtonFloat = forwardRef(
@@ -1237,27 +1367,27 @@ const ButtonFloat = forwardRef(
1237
1367
  size: s = "md",
1238
1368
  side: i = "right",
1239
1369
  offset: o = "1rem",
1240
- ...a
1241
- }, n) {
1242
- const [l, c, g] = useFloatingPosition(
1370
+ ...n
1371
+ }, a) {
1372
+ const [l, u, c] = useFloatingPosition(
1243
1373
  i,
1244
1374
  o
1245
- ), [d, u] = useState(!1);
1375
+ ), [f, d] = useState(!1);
1246
1376
  return useEffect(() => {
1247
- u(!0);
1377
+ d(!0);
1248
1378
  }, []), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: l, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1249
1379
  "button",
1250
1380
  {
1251
- ref: n,
1252
- type: a.type || "button",
1381
+ ref: a,
1382
+ type: n.type || "button",
1253
1383
  className: cn(
1254
1384
  buttonFloatVariants({ variant: r, size: s }),
1255
- g,
1256
- d && "animate-fab-in",
1385
+ c,
1386
+ f && "animate-fab-in",
1257
1387
  t
1258
1388
  ),
1259
- style: c,
1260
- ...a
1389
+ style: u,
1390
+ ...n
1261
1391
  }
1262
1392
  ) });
1263
1393
  }
@@ -1379,7 +1509,7 @@ const BUTTONS = [
1379
1509
  className: s,
1380
1510
  "aria-label": i
1381
1511
  }, o) => {
1382
- const { input: a, inputRef: n, handleButton: l, handleInput: c } = useCalculator({
1512
+ const { input: n, inputRef: a, handleButton: l, handleInput: u } = useCalculator({
1383
1513
  initialValue: e,
1384
1514
  disabled: r,
1385
1515
  onChange: t
@@ -1395,16 +1525,16 @@ const BUTTONS = [
1395
1525
  /* @__PURE__ */ jsxRuntimeExports.jsx(
1396
1526
  "input",
1397
1527
  {
1398
- ref: n,
1528
+ ref: a,
1399
1529
  className: "w-full mb-3 px-3 py-2 rounded border border-[var(--color-neutral)] bg-[var(--color-neutral-soft)] text-right text-xl font-mono focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)]",
1400
- value: a,
1401
- onChange: c,
1530
+ value: n,
1531
+ onChange: u,
1402
1532
  disabled: r,
1403
1533
  inputMode: "decimal",
1404
1534
  "aria-label": "Calculator input"
1405
1535
  }
1406
1536
  ),
1407
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1 mb-3", children: BUTTONS.map((g, d) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex w-full", children: g.map((u) => u === "⌫" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
1537
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1 mb-3", children: BUTTONS.map((c, f) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex w-full", children: c.map((d) => d === "⌫" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
1408
1538
  ButtonIcon,
1409
1539
  {
1410
1540
  as: X,
@@ -1418,14 +1548,14 @@ const BUTTONS = [
1418
1548
  ) : /* @__PURE__ */ jsxRuntimeExports.jsx(
1419
1549
  CalculatorButton,
1420
1550
  {
1421
- variant: u === "=" ? "action" : u === "C" ? "danger" : ["/", "*", "-", "+", "/"].includes(u) ? "operator" : "default",
1422
- onClick: () => l(u),
1551
+ variant: d === "=" ? "action" : d === "C" ? "danger" : ["/", "*", "-", "+", "/"].includes(d) ? "operator" : "default",
1552
+ onClick: () => l(d),
1423
1553
  disabled: r,
1424
- "aria-label": u,
1425
- children: u
1554
+ "aria-label": d,
1555
+ children: d
1426
1556
  },
1427
- u
1428
- )) }, d)) })
1557
+ d
1558
+ )) }, f)) })
1429
1559
  ]
1430
1560
  }
1431
1561
  );
@@ -1477,26 +1607,26 @@ const cardVariants = cva(
1477
1607
  title: s,
1478
1608
  subtitle: i,
1479
1609
  badge: o,
1480
- supplementaryInfo: a,
1481
- bordered: n = !1,
1610
+ supplementaryInfo: n,
1611
+ bordered: a = !1,
1482
1612
  className: l,
1483
- ...c
1484
- }, g) => /* @__PURE__ */ jsxRuntimeExports.jsx(
1613
+ ...u
1614
+ }, c) => /* @__PURE__ */ jsxRuntimeExports.jsx(
1485
1615
  "button",
1486
1616
  {
1487
- ref: g,
1488
- className: cn(cardVariants({ size: e, shape: t, bordered: n }), l),
1489
- ...c,
1617
+ ref: c,
1618
+ className: cn(cardVariants({ size: e, shape: t, bordered: a }), l),
1619
+ ...u,
1490
1620
  children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-4", children: [
1491
1621
  r && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-shrink-0", children: r }),
1492
1622
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full", children: [
1493
1623
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-2", children: [
1494
- s && /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "h3", fontSize: "lg", fontWeight: "semibold", children: s }),
1624
+ s && /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "h3", fontSize: "base", fontWeight: "semibold", children: s }),
1495
1625
  i && /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "p", fontSize: "sm", color: "gray", children: i })
1496
1626
  ] }),
1497
- (o || a) && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
1627
+ (o || n) && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
1498
1628
  o,
1499
- typeof a == "string" ? /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "p", fontSize: "sm", color: "gray", children: a }) : a
1629
+ typeof n == "string" ? /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "p", fontSize: "sm", color: "gray", children: n }) : n
1500
1630
  ] })
1501
1631
  ] })
1502
1632
  ] })
@@ -1550,19 +1680,19 @@ const cardVariants = cva(
1550
1680
  size: s = "md",
1551
1681
  disabled: i = !1,
1552
1682
  children: o,
1553
- ...a
1554
- }, n) {
1683
+ ...n
1684
+ }, a) {
1555
1685
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
1556
1686
  "button",
1557
1687
  {
1558
- ref: n,
1688
+ ref: a,
1559
1689
  type: "button",
1560
1690
  className: cn(filterChipVariants({ variant: r, size: s }), t),
1561
1691
  disabled: i,
1562
1692
  "aria-disabled": i,
1563
1693
  "aria-label": `${o}, removable`,
1564
1694
  inert: i ? !0 : void 0,
1565
- ...a,
1695
+ ...n,
1566
1696
  children: [
1567
1697
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex-shrink-0", children: o }),
1568
1698
  /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { as: XIcon, color: "inherit", size: s === "lg" ? "md" : "sm" })
@@ -1592,15 +1722,15 @@ const cardVariants = cva(
1592
1722
  ), noResultsHeaderVariants = cva(
1593
1723
  "flex flex-row items-center gap-3 mb-2"
1594
1724
  ), NoResults = React__default.forwardRef(
1595
- function e({ icon: t, title: r, subtitle: s, action: i, className: o, hasGrayBackground: a, ...n }, l) {
1725
+ function e({ icon: t, title: r, subtitle: s, action: i, className: o, hasGrayBackground: n, ...a }, l) {
1596
1726
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
1597
1727
  "section",
1598
1728
  {
1599
1729
  ref: l,
1600
- className: cn(noResultsVariants({ hasGrayBackground: a }), o),
1730
+ className: cn(noResultsVariants({ hasGrayBackground: n }), o),
1601
1731
  role: "status",
1602
1732
  "aria-label": "No results found",
1603
- ...n,
1733
+ ...a,
1604
1734
  children: [
1605
1735
  /* @__PURE__ */ jsxRuntimeExports.jsxs("header", { className: noResultsHeaderVariants(), children: [
1606
1736
  /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { as: t, size: "lg", color: "ghost", "aria-hidden": "true" }),
@@ -1745,14 +1875,14 @@ const getTableColumnClass = (e) => {
1745
1875
  );
1746
1876
  }
1747
1877
  ), TableColumn = forwardRef(
1748
- ({ as: e = "td", span: t, align: r = "left", children: s, className: i, ...o }, a) => {
1749
- const n = e === "th" ? "columnheader" : "cell";
1878
+ ({ as: e = "td", span: t, align: r = "left", children: s, className: i, ...o }, n) => {
1879
+ const a = e === "th" ? "columnheader" : "cell";
1750
1880
  let l = "text-left";
1751
1881
  return r === "center" ? l = "text-center" : r === "right" && (l = "text-right"), /* @__PURE__ */ jsxRuntimeExports.jsx(
1752
1882
  "div",
1753
1883
  {
1754
- ref: a,
1755
- role: n,
1884
+ ref: n,
1885
+ role: a,
1756
1886
  className: cn(
1757
1887
  "px-4 py-2",
1758
1888
  "[&:not(:last-child)]:border-r [&:not(:last-child)]:border-border",
@@ -1863,9 +1993,9 @@ const getTableColumnClass = (e) => {
1863
1993
  )
1864
1994
  );
1865
1995
  function useImage({ src: e }) {
1866
- const [t, r] = useState(!1), [s, i] = useState(!1), o = useRef(!1), a = () => {
1996
+ const [t, r] = useState(!1), [s, i] = useState(!1), o = useRef(!1), n = () => {
1867
1997
  r(!0);
1868
- }, n = () => {
1998
+ }, a = () => {
1869
1999
  i(!0);
1870
2000
  };
1871
2001
  return useEffect(() => {
@@ -1881,8 +2011,8 @@ function useImage({ src: e }) {
1881
2011
  }, [e]), {
1882
2012
  loaded: t,
1883
2013
  errored: s,
1884
- handleLoad: a,
1885
- handleError: n
2014
+ handleLoad: n,
2015
+ handleError: a
1886
2016
  };
1887
2017
  }
1888
2018
  const imageVariants = cva("block object-cover", {
@@ -1960,12 +2090,12 @@ function BaseImageFallback({
1960
2090
  className: s,
1961
2091
  style: i,
1962
2092
  shape: o,
1963
- size: a
2093
+ size: n
1964
2094
  }) {
1965
2095
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
1966
2096
  "div",
1967
2097
  {
1968
- className: imageAtomVariants({ shape: o, size: a, className: s }),
2098
+ className: imageAtomVariants({ shape: o, size: n, className: s }),
1969
2099
  style: { width: t, height: r, ...i },
1970
2100
  "aria-label": e,
1971
2101
  role: "img",
@@ -1991,55 +2121,55 @@ const BaseImage = forwardRef(
1991
2121
  onError: s,
1992
2122
  width: i,
1993
2123
  height: o,
1994
- loading: a = "lazy",
1995
- position: n = "cover",
2124
+ loading: n = "lazy",
2125
+ position: a = "cover",
1996
2126
  size: l = "auto",
1997
- shape: c,
1998
- className: g,
1999
- ...d
2000
- }, u) => {
2001
- const { loaded: f, errored: b, handleLoad: x, handleError: m } = useImage({
2127
+ shape: u,
2128
+ className: c,
2129
+ ...f
2130
+ }, d) => {
2131
+ const { loaded: b, errored: p, handleLoad: h, handleError: y } = useImage({
2002
2132
  src: e
2003
- }), h = typeof i == "number" ? i : Number(i), v = typeof o == "number" ? o : Number(o);
2004
- return !f && !b ? /* @__PURE__ */ jsxRuntimeExports.jsx(
2133
+ }), v = typeof i == "number" ? i : Number(i), R = typeof o == "number" ? o : Number(o);
2134
+ return !b && !p ? /* @__PURE__ */ jsxRuntimeExports.jsx(
2005
2135
  BaseImageSkeleton,
2006
2136
  {
2007
- shape: c,
2008
- width: h,
2009
- height: v
2137
+ shape: u,
2138
+ width: v,
2139
+ height: R
2010
2140
  }
2011
- ) : b ? /* @__PURE__ */ jsxRuntimeExports.jsx(
2141
+ ) : p ? /* @__PURE__ */ jsxRuntimeExports.jsx(
2012
2142
  BaseImageFallback,
2013
2143
  {
2014
- shape: c,
2144
+ shape: u,
2015
2145
  alt: t,
2016
- width: h,
2017
- height: v
2146
+ width: v,
2147
+ height: R
2018
2148
  }
2019
2149
  ) : /* @__PURE__ */ jsxRuntimeExports.jsx(
2020
2150
  "img",
2021
2151
  {
2022
- ref: u,
2152
+ ref: d,
2023
2153
  src: e,
2024
2154
  alt: t,
2025
- width: h,
2026
- height: v,
2027
- loading: a,
2155
+ width: v,
2156
+ height: R,
2157
+ loading: n,
2028
2158
  className: cn(
2029
2159
  imageVariants({
2030
- position: n,
2160
+ position: a,
2031
2161
  size: l,
2032
- shape: c
2162
+ shape: u
2033
2163
  }),
2034
- g
2164
+ c
2035
2165
  ),
2036
- onLoad: (w) => {
2037
- x(), r?.(w);
2166
+ onLoad: (j) => {
2167
+ h(), r?.(j);
2038
2168
  },
2039
- onError: (w) => {
2040
- m(), s?.(w);
2169
+ onError: (j) => {
2170
+ y(), s?.(j);
2041
2171
  },
2042
- ...d
2172
+ ...f
2043
2173
  }
2044
2174
  );
2045
2175
  }
@@ -2052,6 +2182,7 @@ export {
2052
2182
  Icon as I,
2053
2183
  Menu as M,
2054
2184
  NoResults as N,
2185
+ OverlayPortal as O,
2055
2186
  Table as T,
2056
2187
  Anchor as a,
2057
2188
  Attribute as b,