@dimasbaguspm/versaur 0.0.31 → 0.0.33
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/js/{bottom-sheet-3W_vCYl6.js → bottom-sheet-B3Rt2JC5.js} +2 -3
- package/dist/js/{bottom-sheet-input-CI-9wYa7.js → bottom-sheet-input-DRcyjeGh.js} +2 -2
- package/dist/js/forms/index.js +1 -1
- package/dist/js/{image-rectangle-BpMI_fTE.js → image-rectangle-oPc5hFMM.js} +419 -232
- package/dist/js/index.js +43 -42
- package/dist/js/layouts/index.js +1 -1
- package/dist/js/navigation/index.js +1 -1
- package/dist/js/overlays/index.js +7 -6
- package/dist/js/primitive/index.js +21 -20
- package/dist/js/{tabs-BOdkXJdy.js → tabs-CKLbsCWq.js} +1 -1
- package/dist/js/tooltip-DNKTNCQm.js +81 -0
- package/dist/js/{top-bar-sahvpzBv.js → top-bar-Bg-zMaFY.js} +4 -4
- package/dist/types/overlays/menu/types.d.ts +5 -0
- package/dist/types/overlays/menu/use-menu.d.ts +15 -0
- package/dist/types/primitive/button-menu-icon/button-menu-icon.d.ts +4 -0
- package/dist/types/primitive/button-menu-icon/index.d.ts +2 -0
- package/dist/types/primitive/{button-menu → button-menu-icon}/types.d.ts +2 -2
- package/dist/types/primitive/index.d.ts +1 -0
- package/dist/utils/enforce-subpath-import.js +1 -1
- package/package.json +1 -1
- package/dist/js/tooltip-C1P1eN0U.js +0 -156
- package/dist/types/primitive/button-menu/button-menu.d.ts +0 -4
- package/dist/types/primitive/button-menu/index.d.ts +0 -2
|
@@ -1,7 +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
|
-
import React__default, { forwardRef, useState, useEffect, useCallback, useRef, createContext, useContext } from "react";
|
|
4
|
-
import { X, XIcon, ImageOff } from "lucide-react";
|
|
3
|
+
import React__default, { forwardRef, useState, useEffect, useCallback, useRef, useId, cloneElement, createContext, useContext } from "react";
|
|
4
|
+
import { EllipsisVerticalIcon, X, XIcon, ImageOff } from "lucide-react";
|
|
5
5
|
import { S as Skeleton } from "./skeleton-BNZyaRjo.js";
|
|
6
6
|
const alertVariants = cva(
|
|
7
7
|
"relative flex items-center gap-2 rounded-md p-2 text-sm transition-all duration-200",
|
|
@@ -148,10 +148,10 @@ const alertVariants = cva(
|
|
|
148
148
|
className: s,
|
|
149
149
|
children: i,
|
|
150
150
|
...o
|
|
151
|
-
},
|
|
151
|
+
}, a) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
152
152
|
"div",
|
|
153
153
|
{
|
|
154
|
-
ref:
|
|
154
|
+
ref: a,
|
|
155
155
|
role: "alert",
|
|
156
156
|
className: cn(alertVariants({ variant: e, color: t }), s),
|
|
157
157
|
...o,
|
|
@@ -228,16 +228,16 @@ const alertVariants = cva(
|
|
|
228
228
|
fontSize: s = "base",
|
|
229
229
|
fontWeight: i = "medium",
|
|
230
230
|
quiet: o = !1,
|
|
231
|
-
...
|
|
232
|
-
},
|
|
231
|
+
...a
|
|
232
|
+
}, n) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
233
233
|
"a",
|
|
234
234
|
{
|
|
235
|
-
ref:
|
|
235
|
+
ref: n,
|
|
236
236
|
className: cn(
|
|
237
237
|
anchorVariants({ color: r, fontSize: s, fontWeight: i, quiet: o }),
|
|
238
238
|
t
|
|
239
239
|
),
|
|
240
|
-
...
|
|
240
|
+
...a,
|
|
241
241
|
children: e
|
|
242
242
|
}
|
|
243
243
|
)
|
|
@@ -318,15 +318,15 @@ const alertVariants = cva(
|
|
|
318
318
|
isCapitalize: s = !1,
|
|
319
319
|
align: i = "left",
|
|
320
320
|
italic: o = !1,
|
|
321
|
-
clamp:
|
|
322
|
-
ellipsis:
|
|
321
|
+
clamp: a = "none",
|
|
322
|
+
ellipsis: n = !1,
|
|
323
323
|
fontSize: l,
|
|
324
324
|
fontWeight: c,
|
|
325
325
|
className: u,
|
|
326
|
-
children:
|
|
327
|
-
...
|
|
328
|
-
},
|
|
329
|
-
const
|
|
326
|
+
children: g,
|
|
327
|
+
...d
|
|
328
|
+
}, m) => {
|
|
329
|
+
const w = [
|
|
330
330
|
"h1",
|
|
331
331
|
"h2",
|
|
332
332
|
"h3",
|
|
@@ -336,11 +336,11 @@ const alertVariants = cva(
|
|
|
336
336
|
"p",
|
|
337
337
|
"span",
|
|
338
338
|
"label"
|
|
339
|
-
].includes(e) ? e : "span",
|
|
339
|
+
].includes(e) ? e : "span", p = l ? `text-${l}` : "", v = c ? `font-${c}` : "";
|
|
340
340
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
341
341
|
e,
|
|
342
342
|
{
|
|
343
|
-
ref:
|
|
343
|
+
ref: m,
|
|
344
344
|
className: cn(
|
|
345
345
|
textVariants({
|
|
346
346
|
color: t,
|
|
@@ -348,17 +348,17 @@ const alertVariants = cva(
|
|
|
348
348
|
isCapitalize: s,
|
|
349
349
|
align: i,
|
|
350
350
|
italic: o,
|
|
351
|
-
clamp:
|
|
352
|
-
ellipsis:
|
|
351
|
+
clamp: a,
|
|
352
|
+
ellipsis: n,
|
|
353
353
|
// @ts-expect-error - `as` is not a valid variant
|
|
354
|
-
as:
|
|
354
|
+
as: w
|
|
355
355
|
}),
|
|
356
|
-
|
|
357
|
-
|
|
356
|
+
p,
|
|
357
|
+
v,
|
|
358
358
|
u
|
|
359
359
|
),
|
|
360
|
-
...
|
|
361
|
-
children:
|
|
360
|
+
...d,
|
|
361
|
+
children: g
|
|
362
362
|
}
|
|
363
363
|
);
|
|
364
364
|
}
|
|
@@ -440,17 +440,17 @@ function getGridCols(e = 4) {
|
|
|
440
440
|
return "grid-cols-4";
|
|
441
441
|
}
|
|
442
442
|
}
|
|
443
|
-
const AttributeListItem = forwardRef(function({ children: t, className: r, span: s = 1, title: i, ...o },
|
|
444
|
-
const
|
|
445
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("li", { ref:
|
|
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 }) });
|
|
446
446
|
}), AttributeListRoot = forwardRef(
|
|
447
447
|
function({ children: t, className: r, columns: s = 4, ...i }, o) {
|
|
448
|
-
const
|
|
448
|
+
const a = getGridCols(s);
|
|
449
449
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
450
450
|
"ul",
|
|
451
451
|
{
|
|
452
452
|
ref: o,
|
|
453
|
-
className: cn("grid gap-4",
|
|
453
|
+
className: cn("grid gap-4", a, r),
|
|
454
454
|
...i,
|
|
455
455
|
children: t
|
|
456
456
|
}
|
|
@@ -504,10 +504,10 @@ const AttributeListItem = forwardRef(function({ children: t, className: r, span:
|
|
|
504
504
|
className: s,
|
|
505
505
|
children: i,
|
|
506
506
|
...o
|
|
507
|
-
},
|
|
507
|
+
}, a) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
508
508
|
"div",
|
|
509
509
|
{
|
|
510
|
-
ref:
|
|
510
|
+
ref: a,
|
|
511
511
|
className: cn(avatarVariants({ variant: e, size: t, shape: r }), s),
|
|
512
512
|
...o,
|
|
513
513
|
children: i
|
|
@@ -515,17 +515,17 @@ const AttributeListItem = forwardRef(function({ children: t, className: r, span:
|
|
|
515
515
|
)
|
|
516
516
|
), AvatarImage = forwardRef(
|
|
517
517
|
({ src: e, alt: t, className: r, onError: s, ...i }, o) => {
|
|
518
|
-
const [
|
|
518
|
+
const [a, n] = useState(!1);
|
|
519
519
|
useEffect(() => {
|
|
520
|
-
|
|
520
|
+
n(!1);
|
|
521
521
|
}, [e]);
|
|
522
522
|
const l = useCallback(
|
|
523
523
|
(c) => {
|
|
524
|
-
|
|
524
|
+
n(!0), s?.(c);
|
|
525
525
|
},
|
|
526
526
|
[s]
|
|
527
527
|
);
|
|
528
|
-
return
|
|
528
|
+
return a ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
529
529
|
"img",
|
|
530
530
|
{
|
|
531
531
|
ref: o,
|
|
@@ -703,11 +703,11 @@ const AttributeListItem = forwardRef(function({ children: t, className: r, span:
|
|
|
703
703
|
size: s = "md",
|
|
704
704
|
iconLeft: i,
|
|
705
705
|
iconRight: o,
|
|
706
|
-
className:
|
|
707
|
-
children:
|
|
706
|
+
className: a,
|
|
707
|
+
children: n,
|
|
708
708
|
...l
|
|
709
709
|
}, c) => {
|
|
710
|
-
const
|
|
710
|
+
const d = !(n != null && n !== "") && !!(i || o);
|
|
711
711
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
712
712
|
"span",
|
|
713
713
|
{
|
|
@@ -718,19 +718,19 @@ const AttributeListItem = forwardRef(function({ children: t, className: r, span:
|
|
|
718
718
|
color: r,
|
|
719
719
|
shape: t,
|
|
720
720
|
size: s,
|
|
721
|
-
iconOnly:
|
|
721
|
+
iconOnly: d
|
|
722
722
|
}),
|
|
723
|
-
|
|
723
|
+
a
|
|
724
724
|
),
|
|
725
725
|
...l,
|
|
726
|
-
children:
|
|
726
|
+
children: d ? (
|
|
727
727
|
// Icon-only mode: display only the icon
|
|
728
728
|
i || o
|
|
729
729
|
) : (
|
|
730
730
|
// Normal mode: display icon(s) and text
|
|
731
731
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
732
732
|
i,
|
|
733
|
-
|
|
733
|
+
n,
|
|
734
734
|
o
|
|
735
735
|
] })
|
|
736
736
|
)
|
|
@@ -833,8 +833,8 @@ const AttributeListItem = forwardRef(function({ children: t, className: r, span:
|
|
|
833
833
|
size: s = "md",
|
|
834
834
|
disabled: i = !1,
|
|
835
835
|
type: o = "button",
|
|
836
|
-
children:
|
|
837
|
-
...
|
|
836
|
+
children: a,
|
|
837
|
+
...n
|
|
838
838
|
}, l) {
|
|
839
839
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
840
840
|
"button",
|
|
@@ -845,142 +845,167 @@ const AttributeListItem = forwardRef(function({ children: t, className: r, span:
|
|
|
845
845
|
disabled: i,
|
|
846
846
|
"aria-disabled": i,
|
|
847
847
|
inert: i ? !0 : void 0,
|
|
848
|
-
...
|
|
849
|
-
children:
|
|
848
|
+
...n,
|
|
849
|
+
children: a
|
|
850
850
|
}
|
|
851
851
|
);
|
|
852
852
|
}
|
|
853
|
-
),
|
|
854
|
-
|
|
855
|
-
"inline-flex items-center justify-center gap-2",
|
|
856
|
-
"rounded-lg",
|
|
857
|
-
"font-medium",
|
|
858
|
-
"transition-all",
|
|
859
|
-
"duration-200",
|
|
860
|
-
"focus-visible:outline-none",
|
|
861
|
-
"focus-visible:ring-2",
|
|
862
|
-
"focus-visible:ring-offset-2",
|
|
863
|
-
"disabled:opacity-50",
|
|
864
|
-
"disabled:pointer-events-none",
|
|
865
|
-
"select-none",
|
|
866
|
-
"shadow-lg",
|
|
867
|
-
"transition-transform",
|
|
868
|
-
"transition-shadow",
|
|
869
|
-
"will-change-transform,opacity,box-shadow",
|
|
870
|
-
"hover:scale-105",
|
|
871
|
-
"active:scale-95",
|
|
872
|
-
"focus-visible:shadow-xl",
|
|
873
|
-
"hover:shadow-xl",
|
|
874
|
-
"active:shadow-md"
|
|
875
|
-
].join(" "),
|
|
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 shadow-lg",
|
|
876
855
|
{
|
|
877
856
|
variants: {
|
|
878
|
-
variant: {
|
|
879
|
-
primary: "bg-primary text-white hover:bg-primary/90 focus-visible:ring-primary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
880
|
-
secondary: "bg-secondary text-white hover:bg-secondary/90 focus-visible:ring-secondary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
881
|
-
tertiary: "bg-tertiary text-white hover:bg-tertiary/90 focus-visible:ring-tertiary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
882
|
-
ghost: "bg-white text-foreground hover:bg-ghost-soft focus-visible:ring-ghost-light focus-visible:ring-offset-white",
|
|
883
|
-
neutral: "bg-neutral text-foreground border border-border hover:bg-neutral/80 focus-visible:ring-foreground-light focus-visible:ring-offset-white shadow-sm",
|
|
884
|
-
"primary-outline": "border border-primary text-primary bg-white hover:bg-primary hover:text-white focus-visible:ring-primary-light focus-visible:ring-offset-white transition-all",
|
|
885
|
-
"secondary-outline": "border border-secondary text-secondary bg-white hover:bg-secondary hover:text-white focus-visible:ring-secondary-light focus-visible:ring-offset-white transition-all",
|
|
886
|
-
"tertiary-outline": "border border-tertiary text-tertiary bg-white hover:bg-tertiary hover:text-white focus-visible:ring-tertiary-light focus-visible:ring-offset-white transition-all",
|
|
887
|
-
"ghost-outline": "border border-ghost text-ghost bg-white hover:bg-ghost hover:text-white focus-visible:ring-ghost-light focus-visible:ring-offset-white transition-all",
|
|
888
|
-
"neutral-outline": "border border-border text-foreground bg-white hover:bg-neutral hover:text-foreground focus-visible:ring-foreground-light focus-visible:ring-offset-white transition-all",
|
|
889
|
-
"primary-ghost": "text-primary bg-white hover:bg-primary/20 focus-visible:ring-primary focus-visible:ring-offset-white",
|
|
890
|
-
"secondary-ghost": "text-secondary bg-white hover:bg-secondary/20 focus-visible:ring-secondary focus-visible:ring-offset-white",
|
|
891
|
-
"tertiary-ghost": "text-tertiary bg-white hover:bg-tertiary/20 focus-visible:ring-tertiary focus-visible:ring-offset-white",
|
|
892
|
-
"neutral-ghost": "text-foreground bg-white hover:bg-neutral/50 focus-visible:ring-foreground focus-visible:ring-offset-white",
|
|
893
|
-
success: "bg-success text-white hover:bg-success/90 focus-visible:ring-success-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
894
|
-
"success-outline": "border border-success text-success bg-white hover:bg-success hover:text-white focus-visible:ring-success-light focus-visible:ring-offset-white transition-all",
|
|
895
|
-
"success-ghost": "text-success bg-white hover:bg-success/20 focus-visible:ring-success-light focus-visible:ring-offset-white",
|
|
896
|
-
info: "bg-info text-white hover:bg-info/90 focus-visible:ring-info-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
897
|
-
"info-outline": "border border-info text-info bg-white hover:bg-info hover:text-white focus-visible:ring-info-light focus-visible:ring-offset-white transition-all",
|
|
898
|
-
"info-ghost": "text-info bg-white hover:bg-info/20 focus-visible:ring-info-light focus-visible:ring-offset-white",
|
|
899
|
-
warning: "bg-warning text-white hover:bg-warning/90 focus-visible:ring-warning-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
900
|
-
"warning-outline": "border border-warning text-warning bg-white hover:bg-warning hover:text-white focus-visible:ring-warning-light focus-visible:ring-offset-white transition-all",
|
|
901
|
-
"warning-ghost": "text-warning bg-white hover:bg-warning/20 focus-visible:ring-warning-light focus-visible:ring-offset-white",
|
|
902
|
-
danger: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
903
|
-
"danger-outline": "border border-danger text-danger bg-white hover:bg-danger hover:text-white focus-visible:ring-danger-light focus-visible:ring-offset-white transition-all",
|
|
904
|
-
"danger-ghost": "text-danger bg-white hover:bg-danger/20 focus-visible:ring-danger-light focus-visible:ring-offset-white",
|
|
905
|
-
outline: "border border-border text-foreground bg-white hover:bg-accent-soft focus-visible:ring-accent-soft focus-visible:ring-offset-white transition-all",
|
|
906
|
-
destructive: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md"
|
|
907
|
-
},
|
|
908
857
|
size: {
|
|
909
|
-
sm: "
|
|
910
|
-
md: "
|
|
911
|
-
|
|
858
|
+
sm: "py-1.5 px-1",
|
|
859
|
+
md: "py-2 px-1"
|
|
860
|
+
},
|
|
861
|
+
open: {
|
|
862
|
+
true: "opacity-100 scale-100",
|
|
863
|
+
false: "opacity-0 pointer-events-none scale-95"
|
|
912
864
|
}
|
|
913
865
|
},
|
|
914
866
|
defaultVariants: {
|
|
915
|
-
|
|
916
|
-
|
|
867
|
+
size: "md",
|
|
868
|
+
open: !1
|
|
917
869
|
}
|
|
918
870
|
}
|
|
919
871
|
);
|
|
920
|
-
function
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
872
|
+
function useMenuOutsideClick(e, t, r, s) {
|
|
873
|
+
useEffect(() => {
|
|
874
|
+
if (!e) return;
|
|
875
|
+
function i(o) {
|
|
876
|
+
!t.current?.contains(o.target) && !r.current?.contains(o.target) && s();
|
|
877
|
+
}
|
|
878
|
+
return document.addEventListener("mousedown", i), () => document.removeEventListener("mousedown", i);
|
|
879
|
+
}, [e, s, t, r]);
|
|
880
|
+
}
|
|
881
|
+
function useMenuEscapeClose(e, t) {
|
|
882
|
+
useEffect(() => {
|
|
883
|
+
if (!e) return;
|
|
884
|
+
const r = (s) => {
|
|
885
|
+
s.key === "Escape" && t();
|
|
886
|
+
};
|
|
887
|
+
return document.addEventListener("keydown", r), () => document.removeEventListener("keydown", r);
|
|
936
888
|
}, [e, t]);
|
|
889
|
+
}
|
|
890
|
+
function useMenuPosition(e, t, r, s = "bottom-start", i) {
|
|
891
|
+
const [o, a] = useState({});
|
|
937
892
|
return useEffect(() => {
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
893
|
+
if (!e || !t.current || !r.current) {
|
|
894
|
+
a({});
|
|
895
|
+
return;
|
|
896
|
+
}
|
|
897
|
+
const n = t.current, l = r.current, c = i || document.documentElement, u = n.getBoundingClientRect(), g = c.getBoundingClientRect(), d = l.style.visibility, m = l.style.position;
|
|
898
|
+
l.style.visibility = "hidden", l.style.position = "absolute";
|
|
899
|
+
const h = l.getBoundingClientRect();
|
|
900
|
+
l.style.visibility = d, l.style.position = m;
|
|
901
|
+
const w = g.bottom - u.bottom - 8, p = u.top - g.top - 8, v = g.right - u.left - 8, y = u.right - g.left - 8;
|
|
902
|
+
let b = s;
|
|
903
|
+
s === "auto" && (w >= h.height && v >= h.width ? b = "bottom-start" : w >= h.height && y >= h.width ? b = "bottom-end" : p >= h.height && v >= h.width ? b = "top-start" : p >= h.height && y >= h.width ? b = "top-end" : b = w >= p ? "bottom-start" : "top-start");
|
|
904
|
+
const f = {};
|
|
905
|
+
switch (b) {
|
|
906
|
+
case "bottom-start":
|
|
907
|
+
f.top = u.height + 4, f.left = 0;
|
|
908
|
+
break;
|
|
909
|
+
case "bottom-end":
|
|
910
|
+
f.top = u.height + 4, f.right = 0;
|
|
911
|
+
break;
|
|
912
|
+
case "top-start":
|
|
913
|
+
f.bottom = u.height + 4, f.left = 0;
|
|
914
|
+
break;
|
|
915
|
+
case "top-end":
|
|
916
|
+
f.bottom = u.height + 4, f.right = 0;
|
|
917
|
+
break;
|
|
918
|
+
}
|
|
919
|
+
if (i) {
|
|
920
|
+
const R = {
|
|
921
|
+
top: b.startsWith("bottom") ? u.bottom + 4 : u.top - h.height - 4,
|
|
922
|
+
left: b.endsWith("start") ? u.left : u.right - h.width,
|
|
923
|
+
width: h.width,
|
|
924
|
+
height: h.height
|
|
925
|
+
};
|
|
926
|
+
if (R.left < g.left + 8) {
|
|
927
|
+
const x = g.left + 8 - R.left;
|
|
928
|
+
b.endsWith("start") ? f.left = (f.left || 0) + x : f.right = (f.right || 0) - x;
|
|
929
|
+
} else if (R.left + R.width > g.right - 8) {
|
|
930
|
+
const x = R.left + R.width - (g.right - 8);
|
|
931
|
+
b.endsWith("start") ? f.left = (f.left || 0) - x : f.right = (f.right || 0) + x;
|
|
932
|
+
}
|
|
933
|
+
if (b.startsWith("bottom")) {
|
|
934
|
+
const x = Math.max(
|
|
935
|
+
50,
|
|
936
|
+
g.bottom - u.bottom - 16
|
|
937
|
+
);
|
|
938
|
+
h.height > x && (f.maxHeight = x);
|
|
939
|
+
} else {
|
|
940
|
+
const x = Math.max(
|
|
941
|
+
50,
|
|
942
|
+
u.top - g.top - 16
|
|
943
|
+
);
|
|
944
|
+
h.height > x && (f.maxHeight = x);
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
a(f);
|
|
948
|
+
}, [e, s, i, t, r]), o;
|
|
951
949
|
}
|
|
952
|
-
const
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
950
|
+
const MenuContent = forwardRef(
|
|
951
|
+
({ children: e }, t) => /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { ref: t, className: "flex flex-col gap-1", children: e })
|
|
952
|
+
), MenuItem = forwardRef(
|
|
953
|
+
({ children: e, disabled: t, ...r }, s) => /* @__PURE__ */ jsxRuntimeExports.jsx("li", { ref: s, ...r, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
954
|
+
Button,
|
|
955
|
+
{
|
|
956
|
+
variant: "ghost",
|
|
957
|
+
className: cn("block text-left w-full"),
|
|
958
|
+
disabled: t,
|
|
959
|
+
children: e
|
|
960
|
+
}
|
|
961
|
+
) })
|
|
962
|
+
), MenuRoot = ({
|
|
963
|
+
isOpen: e,
|
|
964
|
+
onOutsideClick: t,
|
|
965
|
+
size: r = "md",
|
|
966
|
+
content: s,
|
|
967
|
+
children: i,
|
|
968
|
+
placement: o = "bottom-start",
|
|
969
|
+
container: a
|
|
970
|
+
}) => {
|
|
971
|
+
const n = useRef(null), l = useRef(null), c = useId();
|
|
972
|
+
useMenuOutsideClick(e, l, n, t), useMenuEscapeClose(e, t);
|
|
973
|
+
const u = useMenuPosition(
|
|
974
|
+
e,
|
|
975
|
+
n,
|
|
976
|
+
l,
|
|
977
|
+
o,
|
|
978
|
+
a
|
|
979
|
+
), g = {
|
|
980
|
+
...u,
|
|
981
|
+
overflowY: u.maxHeight ? "auto" : void 0,
|
|
982
|
+
overflowX: u.maxWidth ? "auto" : void 0
|
|
983
|
+
};
|
|
984
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative w-fit", children: [
|
|
985
|
+
cloneElement(i, {
|
|
986
|
+
// @ts-expect-error: ref is valid for button or forwardRef components
|
|
987
|
+
ref: n,
|
|
988
|
+
"aria-haspopup": "menu",
|
|
989
|
+
"aria-expanded": e,
|
|
990
|
+
"aria-controls": c
|
|
991
|
+
}),
|
|
992
|
+
e && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
993
|
+
"div",
|
|
969
994
|
{
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
className: cn(
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
),
|
|
978
|
-
style: c,
|
|
979
|
-
...n
|
|
995
|
+
id: c,
|
|
996
|
+
ref: l,
|
|
997
|
+
className: cn(menuVariants({ size: r, open: e })),
|
|
998
|
+
style: g,
|
|
999
|
+
role: "menu",
|
|
1000
|
+
"aria-hidden": !e,
|
|
1001
|
+
children: s
|
|
980
1002
|
}
|
|
981
|
-
)
|
|
982
|
-
}
|
|
983
|
-
|
|
1003
|
+
)
|
|
1004
|
+
] });
|
|
1005
|
+
}, Menu = Object.assign(MenuRoot, {
|
|
1006
|
+
Content: MenuContent,
|
|
1007
|
+
Item: MenuItem
|
|
1008
|
+
});
|
|
984
1009
|
function getIconColorFromVariant(e = "primary") {
|
|
985
1010
|
const t = e.split("-");
|
|
986
1011
|
if (t.length === 1)
|
|
@@ -1098,11 +1123,11 @@ const buttonIconVariants = cva(
|
|
|
1098
1123
|
size: "md",
|
|
1099
1124
|
color: "primary"
|
|
1100
1125
|
}
|
|
1101
|
-
}), Icon = React__default.forwardRef(function({ as: t, color: r = "primary", size: s = "md", className: i, ...o },
|
|
1126
|
+
}), Icon = React__default.forwardRef(function({ as: t, color: r = "primary", size: s = "md", className: i, ...o }, a) {
|
|
1102
1127
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1103
1128
|
t,
|
|
1104
1129
|
{
|
|
1105
|
-
ref:
|
|
1130
|
+
ref: a,
|
|
1106
1131
|
className: iconVariants({ color: r, size: s, className: i }),
|
|
1107
1132
|
...o
|
|
1108
1133
|
}
|
|
@@ -1114,8 +1139,8 @@ const buttonIconVariants = cva(
|
|
|
1114
1139
|
size: s = "md",
|
|
1115
1140
|
shape: i = "rounded",
|
|
1116
1141
|
disabled: o = !1,
|
|
1117
|
-
as:
|
|
1118
|
-
"aria-label":
|
|
1142
|
+
as: a,
|
|
1143
|
+
"aria-label": n,
|
|
1119
1144
|
...l
|
|
1120
1145
|
}, c) {
|
|
1121
1146
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -1133,13 +1158,13 @@ const buttonIconVariants = cva(
|
|
|
1133
1158
|
),
|
|
1134
1159
|
disabled: o,
|
|
1135
1160
|
"aria-disabled": o,
|
|
1136
|
-
"aria-label":
|
|
1161
|
+
"aria-label": n,
|
|
1137
1162
|
inert: o ? !0 : void 0,
|
|
1138
1163
|
...l,
|
|
1139
1164
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1140
1165
|
Icon,
|
|
1141
1166
|
{
|
|
1142
|
-
as:
|
|
1167
|
+
as: a,
|
|
1143
1168
|
size: "sm",
|
|
1144
1169
|
color: getIconColorFromVariant(r)
|
|
1145
1170
|
}
|
|
@@ -1147,6 +1172,166 @@ const buttonIconVariants = cva(
|
|
|
1147
1172
|
}
|
|
1148
1173
|
);
|
|
1149
1174
|
}
|
|
1175
|
+
), ButtonMenuIconRoot = forwardRef(
|
|
1176
|
+
(e, t) => {
|
|
1177
|
+
const {
|
|
1178
|
+
as: r = EllipsisVerticalIcon,
|
|
1179
|
+
children: s,
|
|
1180
|
+
onOpenChange: i,
|
|
1181
|
+
onClick: o,
|
|
1182
|
+
...a
|
|
1183
|
+
} = e ?? {}, [n, l] = useState(!1);
|
|
1184
|
+
useEffect(() => {
|
|
1185
|
+
i?.(n);
|
|
1186
|
+
}, [n, i]);
|
|
1187
|
+
const c = () => {
|
|
1188
|
+
l(!1);
|
|
1189
|
+
}, u = (g) => {
|
|
1190
|
+
l((d) => !d), o?.(g);
|
|
1191
|
+
};
|
|
1192
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1193
|
+
Menu,
|
|
1194
|
+
{
|
|
1195
|
+
isOpen: n,
|
|
1196
|
+
onOutsideClick: c,
|
|
1197
|
+
size: "md",
|
|
1198
|
+
content: /* @__PURE__ */ jsxRuntimeExports.jsx(Menu.Content, { children: s }),
|
|
1199
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonIcon, { ref: t, as: r, onClick: u, ...a })
|
|
1200
|
+
}
|
|
1201
|
+
);
|
|
1202
|
+
}
|
|
1203
|
+
), ButtonMenuIcon = Object.assign(ButtonMenuIconRoot, {
|
|
1204
|
+
Item: Menu.Item
|
|
1205
|
+
}), buttonFloatVariants = cva(
|
|
1206
|
+
[
|
|
1207
|
+
"inline-flex items-center justify-center gap-2",
|
|
1208
|
+
"rounded-lg",
|
|
1209
|
+
"font-medium",
|
|
1210
|
+
"transition-all",
|
|
1211
|
+
"duration-200",
|
|
1212
|
+
"focus-visible:outline-none",
|
|
1213
|
+
"focus-visible:ring-2",
|
|
1214
|
+
"focus-visible:ring-offset-2",
|
|
1215
|
+
"disabled:opacity-50",
|
|
1216
|
+
"disabled:pointer-events-none",
|
|
1217
|
+
"select-none",
|
|
1218
|
+
"shadow-lg",
|
|
1219
|
+
"transition-transform",
|
|
1220
|
+
"transition-shadow",
|
|
1221
|
+
"will-change-transform,opacity,box-shadow",
|
|
1222
|
+
"hover:scale-105",
|
|
1223
|
+
"active:scale-95",
|
|
1224
|
+
"focus-visible:shadow-xl",
|
|
1225
|
+
"hover:shadow-xl",
|
|
1226
|
+
"active:shadow-md"
|
|
1227
|
+
].join(" "),
|
|
1228
|
+
{
|
|
1229
|
+
variants: {
|
|
1230
|
+
variant: {
|
|
1231
|
+
primary: "bg-primary text-white hover:bg-primary/90 focus-visible:ring-primary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
1232
|
+
secondary: "bg-secondary text-white hover:bg-secondary/90 focus-visible:ring-secondary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
1233
|
+
tertiary: "bg-tertiary text-white hover:bg-tertiary/90 focus-visible:ring-tertiary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
1234
|
+
ghost: "bg-white text-foreground hover:bg-ghost-soft focus-visible:ring-ghost-light focus-visible:ring-offset-white",
|
|
1235
|
+
neutral: "bg-neutral text-foreground border border-border hover:bg-neutral/80 focus-visible:ring-foreground-light focus-visible:ring-offset-white shadow-sm",
|
|
1236
|
+
"primary-outline": "border border-primary text-primary bg-white hover:bg-primary hover:text-white focus-visible:ring-primary-light focus-visible:ring-offset-white transition-all",
|
|
1237
|
+
"secondary-outline": "border border-secondary text-secondary bg-white hover:bg-secondary hover:text-white focus-visible:ring-secondary-light focus-visible:ring-offset-white transition-all",
|
|
1238
|
+
"tertiary-outline": "border border-tertiary text-tertiary bg-white hover:bg-tertiary hover:text-white focus-visible:ring-tertiary-light focus-visible:ring-offset-white transition-all",
|
|
1239
|
+
"ghost-outline": "border border-ghost text-ghost bg-white hover:bg-ghost hover:text-white focus-visible:ring-ghost-light focus-visible:ring-offset-white transition-all",
|
|
1240
|
+
"neutral-outline": "border border-border text-foreground bg-white hover:bg-neutral hover:text-foreground focus-visible:ring-foreground-light focus-visible:ring-offset-white transition-all",
|
|
1241
|
+
"primary-ghost": "text-primary bg-white hover:bg-primary/20 focus-visible:ring-primary focus-visible:ring-offset-white",
|
|
1242
|
+
"secondary-ghost": "text-secondary bg-white hover:bg-secondary/20 focus-visible:ring-secondary focus-visible:ring-offset-white",
|
|
1243
|
+
"tertiary-ghost": "text-tertiary bg-white hover:bg-tertiary/20 focus-visible:ring-tertiary focus-visible:ring-offset-white",
|
|
1244
|
+
"neutral-ghost": "text-foreground bg-white hover:bg-neutral/50 focus-visible:ring-foreground focus-visible:ring-offset-white",
|
|
1245
|
+
success: "bg-success text-white hover:bg-success/90 focus-visible:ring-success-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
1246
|
+
"success-outline": "border border-success text-success bg-white hover:bg-success hover:text-white focus-visible:ring-success-light focus-visible:ring-offset-white transition-all",
|
|
1247
|
+
"success-ghost": "text-success bg-white hover:bg-success/20 focus-visible:ring-success-light focus-visible:ring-offset-white",
|
|
1248
|
+
info: "bg-info text-white hover:bg-info/90 focus-visible:ring-info-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
1249
|
+
"info-outline": "border border-info text-info bg-white hover:bg-info hover:text-white focus-visible:ring-info-light focus-visible:ring-offset-white transition-all",
|
|
1250
|
+
"info-ghost": "text-info bg-white hover:bg-info/20 focus-visible:ring-info-light focus-visible:ring-offset-white",
|
|
1251
|
+
warning: "bg-warning text-white hover:bg-warning/90 focus-visible:ring-warning-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
1252
|
+
"warning-outline": "border border-warning text-warning bg-white hover:bg-warning hover:text-white focus-visible:ring-warning-light focus-visible:ring-offset-white transition-all",
|
|
1253
|
+
"warning-ghost": "text-warning bg-white hover:bg-warning/20 focus-visible:ring-warning-light focus-visible:ring-offset-white",
|
|
1254
|
+
danger: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
1255
|
+
"danger-outline": "border border-danger text-danger bg-white hover:bg-danger hover:text-white focus-visible:ring-danger-light focus-visible:ring-offset-white transition-all",
|
|
1256
|
+
"danger-ghost": "text-danger bg-white hover:bg-danger/20 focus-visible:ring-danger-light focus-visible:ring-offset-white",
|
|
1257
|
+
outline: "border border-border text-foreground bg-white hover:bg-accent-soft focus-visible:ring-accent-soft focus-visible:ring-offset-white transition-all",
|
|
1258
|
+
destructive: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md"
|
|
1259
|
+
},
|
|
1260
|
+
size: {
|
|
1261
|
+
sm: "h-12 w-12 min-w-12 min-h-12 text-base",
|
|
1262
|
+
md: "h-14 w-14 min-w-14 min-h-14 text-lg",
|
|
1263
|
+
lg: "h-16 w-16 min-w-16 min-h-16 text-xl"
|
|
1264
|
+
}
|
|
1265
|
+
},
|
|
1266
|
+
defaultVariants: {
|
|
1267
|
+
variant: "primary",
|
|
1268
|
+
size: "md"
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
);
|
|
1272
|
+
function useFloatingPosition(e, t = "1rem") {
|
|
1273
|
+
const r = useRef(null), [s, i] = useState({}), [o, a] = useState("fixed bottom-4 right-4"), n = useCallback(() => {
|
|
1274
|
+
const c = r.current;
|
|
1275
|
+
if (!c) return;
|
|
1276
|
+
const g = c.getBoundingClientRect().height > window.innerHeight;
|
|
1277
|
+
let d = {}, m = "";
|
|
1278
|
+
g ? (d = {
|
|
1279
|
+
position: "fixed",
|
|
1280
|
+
bottom: t,
|
|
1281
|
+
zIndex: 50,
|
|
1282
|
+
transform: `translateY(${c.scrollTop}px)`
|
|
1283
|
+
}, m = `fixed bottom-4 ${e}-4`) : (d = {
|
|
1284
|
+
position: "fixed",
|
|
1285
|
+
bottom: t,
|
|
1286
|
+
zIndex: 50
|
|
1287
|
+
}, m = `fixed bottom-4 ${e}-4`), i(d), a(m);
|
|
1288
|
+
}, [e, t]);
|
|
1289
|
+
return useEffect(() => {
|
|
1290
|
+
n();
|
|
1291
|
+
const c = r.current;
|
|
1292
|
+
return c && c.addEventListener("scroll", n), window.addEventListener("resize", n), () => {
|
|
1293
|
+
c && c.removeEventListener("scroll", n), window.removeEventListener("resize", n);
|
|
1294
|
+
};
|
|
1295
|
+
}, [n]), useEffect(() => {
|
|
1296
|
+
r.current && n();
|
|
1297
|
+
}, [e, t, n]), [useCallback(
|
|
1298
|
+
(c) => {
|
|
1299
|
+
r.current = c, c && n();
|
|
1300
|
+
},
|
|
1301
|
+
[n]
|
|
1302
|
+
), s, o];
|
|
1303
|
+
}
|
|
1304
|
+
const ButtonFloat = forwardRef(
|
|
1305
|
+
function({
|
|
1306
|
+
className: t,
|
|
1307
|
+
variant: r = "primary",
|
|
1308
|
+
size: s = "md",
|
|
1309
|
+
side: i = "right",
|
|
1310
|
+
offset: o = "1rem",
|
|
1311
|
+
...a
|
|
1312
|
+
}, n) {
|
|
1313
|
+
const [l, c, u] = useFloatingPosition(
|
|
1314
|
+
i,
|
|
1315
|
+
o
|
|
1316
|
+
), [g, d] = useState(!1);
|
|
1317
|
+
return useEffect(() => {
|
|
1318
|
+
d(!0);
|
|
1319
|
+
}, []), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: l, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1320
|
+
"button",
|
|
1321
|
+
{
|
|
1322
|
+
ref: n,
|
|
1323
|
+
type: a.type || "button",
|
|
1324
|
+
className: cn(
|
|
1325
|
+
buttonFloatVariants({ variant: r, size: s }),
|
|
1326
|
+
u,
|
|
1327
|
+
g && "animate-fab-in",
|
|
1328
|
+
t
|
|
1329
|
+
),
|
|
1330
|
+
style: c,
|
|
1331
|
+
...a
|
|
1332
|
+
}
|
|
1333
|
+
) });
|
|
1334
|
+
}
|
|
1150
1335
|
), calculatorRootVariants = cva(
|
|
1151
1336
|
"flex flex-col w-full max-w-xs rounded-lg bg-background",
|
|
1152
1337
|
{
|
|
@@ -1265,7 +1450,7 @@ const BUTTONS = [
|
|
|
1265
1450
|
className: s,
|
|
1266
1451
|
"aria-label": i
|
|
1267
1452
|
}, o) => {
|
|
1268
|
-
const { input:
|
|
1453
|
+
const { input: a, inputRef: n, handleButton: l, handleInput: c } = useCalculator({
|
|
1269
1454
|
initialValue: e,
|
|
1270
1455
|
disabled: r,
|
|
1271
1456
|
onChange: t
|
|
@@ -1281,16 +1466,16 @@ const BUTTONS = [
|
|
|
1281
1466
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1282
1467
|
"input",
|
|
1283
1468
|
{
|
|
1284
|
-
ref:
|
|
1469
|
+
ref: n,
|
|
1285
1470
|
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)]",
|
|
1286
|
-
value:
|
|
1471
|
+
value: a,
|
|
1287
1472
|
onChange: c,
|
|
1288
1473
|
disabled: r,
|
|
1289
1474
|
inputMode: "decimal",
|
|
1290
1475
|
"aria-label": "Calculator input"
|
|
1291
1476
|
}
|
|
1292
1477
|
),
|
|
1293
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1 mb-3", children: BUTTONS.map((u,
|
|
1478
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1 mb-3", children: BUTTONS.map((u, g) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex w-full", children: u.map((d) => d === "⌫" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1294
1479
|
ButtonIcon,
|
|
1295
1480
|
{
|
|
1296
1481
|
as: X,
|
|
@@ -1304,14 +1489,14 @@ const BUTTONS = [
|
|
|
1304
1489
|
) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1305
1490
|
CalculatorButton,
|
|
1306
1491
|
{
|
|
1307
|
-
variant:
|
|
1308
|
-
onClick: () => l(
|
|
1492
|
+
variant: d === "=" ? "action" : d === "C" ? "danger" : ["/", "*", "-", "+", "/"].includes(d) ? "operator" : "default",
|
|
1493
|
+
onClick: () => l(d),
|
|
1309
1494
|
disabled: r,
|
|
1310
|
-
"aria-label":
|
|
1311
|
-
children:
|
|
1495
|
+
"aria-label": d,
|
|
1496
|
+
children: d
|
|
1312
1497
|
},
|
|
1313
|
-
|
|
1314
|
-
)) },
|
|
1498
|
+
d
|
|
1499
|
+
)) }, g)) })
|
|
1315
1500
|
]
|
|
1316
1501
|
}
|
|
1317
1502
|
);
|
|
@@ -1363,26 +1548,26 @@ const cardVariants = cva(
|
|
|
1363
1548
|
title: s,
|
|
1364
1549
|
subtitle: i,
|
|
1365
1550
|
badge: o,
|
|
1366
|
-
supplementaryInfo:
|
|
1367
|
-
bordered:
|
|
1551
|
+
supplementaryInfo: a,
|
|
1552
|
+
bordered: n = !1,
|
|
1368
1553
|
className: l,
|
|
1369
1554
|
...c
|
|
1370
1555
|
}, u) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1371
1556
|
"button",
|
|
1372
1557
|
{
|
|
1373
1558
|
ref: u,
|
|
1374
|
-
className: cn(cardVariants({ size: e, shape: t, bordered:
|
|
1559
|
+
className: cn(cardVariants({ size: e, shape: t, bordered: n }), l),
|
|
1375
1560
|
...c,
|
|
1376
1561
|
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-4", children: [
|
|
1377
1562
|
r && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-shrink-0", children: r }),
|
|
1378
1563
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full", children: [
|
|
1379
1564
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-2", children: [
|
|
1380
|
-
s && /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "h3", fontSize: "
|
|
1565
|
+
s && /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "h3", fontSize: "base", fontWeight: "semibold", children: s }),
|
|
1381
1566
|
i && /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "p", fontSize: "sm", color: "gray", children: i })
|
|
1382
1567
|
] }),
|
|
1383
|
-
(o ||
|
|
1568
|
+
(o || a) && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
|
|
1384
1569
|
o,
|
|
1385
|
-
typeof
|
|
1570
|
+
typeof a == "string" ? /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "p", fontSize: "sm", color: "gray", children: a }) : a
|
|
1386
1571
|
] })
|
|
1387
1572
|
] })
|
|
1388
1573
|
] })
|
|
@@ -1436,19 +1621,19 @@ const cardVariants = cva(
|
|
|
1436
1621
|
size: s = "md",
|
|
1437
1622
|
disabled: i = !1,
|
|
1438
1623
|
children: o,
|
|
1439
|
-
...
|
|
1440
|
-
},
|
|
1624
|
+
...a
|
|
1625
|
+
}, n) {
|
|
1441
1626
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1442
1627
|
"button",
|
|
1443
1628
|
{
|
|
1444
|
-
ref:
|
|
1629
|
+
ref: n,
|
|
1445
1630
|
type: "button",
|
|
1446
1631
|
className: cn(filterChipVariants({ variant: r, size: s }), t),
|
|
1447
1632
|
disabled: i,
|
|
1448
1633
|
"aria-disabled": i,
|
|
1449
1634
|
"aria-label": `${o}, removable`,
|
|
1450
1635
|
inert: i ? !0 : void 0,
|
|
1451
|
-
...
|
|
1636
|
+
...a,
|
|
1452
1637
|
children: [
|
|
1453
1638
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex-shrink-0", children: o }),
|
|
1454
1639
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { as: XIcon, color: "inherit", size: s === "lg" ? "md" : "sm" })
|
|
@@ -1478,15 +1663,15 @@ const cardVariants = cva(
|
|
|
1478
1663
|
), noResultsHeaderVariants = cva(
|
|
1479
1664
|
"flex flex-row items-center gap-3 mb-2"
|
|
1480
1665
|
), NoResults = React__default.forwardRef(
|
|
1481
|
-
function e({ icon: t, title: r, subtitle: s, action: i, className: o, hasGrayBackground:
|
|
1666
|
+
function e({ icon: t, title: r, subtitle: s, action: i, className: o, hasGrayBackground: a, ...n }, l) {
|
|
1482
1667
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1483
1668
|
"section",
|
|
1484
1669
|
{
|
|
1485
1670
|
ref: l,
|
|
1486
|
-
className: cn(noResultsVariants({ hasGrayBackground:
|
|
1671
|
+
className: cn(noResultsVariants({ hasGrayBackground: a }), o),
|
|
1487
1672
|
role: "status",
|
|
1488
1673
|
"aria-label": "No results found",
|
|
1489
|
-
...
|
|
1674
|
+
...n,
|
|
1490
1675
|
children: [
|
|
1491
1676
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("header", { className: noResultsHeaderVariants(), children: [
|
|
1492
1677
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { as: t, size: "lg", color: "ghost", "aria-hidden": "true" }),
|
|
@@ -1631,14 +1816,14 @@ const getTableColumnClass = (e) => {
|
|
|
1631
1816
|
);
|
|
1632
1817
|
}
|
|
1633
1818
|
), TableColumn = forwardRef(
|
|
1634
|
-
({ as: e = "td", span: t, align: r = "left", children: s, className: i, ...o },
|
|
1635
|
-
const
|
|
1819
|
+
({ as: e = "td", span: t, align: r = "left", children: s, className: i, ...o }, a) => {
|
|
1820
|
+
const n = e === "th" ? "columnheader" : "cell";
|
|
1636
1821
|
let l = "text-left";
|
|
1637
1822
|
return r === "center" ? l = "text-center" : r === "right" && (l = "text-right"), /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1638
1823
|
"div",
|
|
1639
1824
|
{
|
|
1640
|
-
ref:
|
|
1641
|
-
role:
|
|
1825
|
+
ref: a,
|
|
1826
|
+
role: n,
|
|
1642
1827
|
className: cn(
|
|
1643
1828
|
"px-4 py-2",
|
|
1644
1829
|
"[&:not(:last-child)]:border-r [&:not(:last-child)]:border-border",
|
|
@@ -1749,9 +1934,9 @@ const getTableColumnClass = (e) => {
|
|
|
1749
1934
|
)
|
|
1750
1935
|
);
|
|
1751
1936
|
function useImage({ src: e }) {
|
|
1752
|
-
const [t, r] = useState(!1), [s, i] = useState(!1), o = useRef(!1),
|
|
1937
|
+
const [t, r] = useState(!1), [s, i] = useState(!1), o = useRef(!1), a = () => {
|
|
1753
1938
|
r(!0);
|
|
1754
|
-
},
|
|
1939
|
+
}, n = () => {
|
|
1755
1940
|
i(!0);
|
|
1756
1941
|
};
|
|
1757
1942
|
return useEffect(() => {
|
|
@@ -1767,8 +1952,8 @@ function useImage({ src: e }) {
|
|
|
1767
1952
|
}, [e]), {
|
|
1768
1953
|
loaded: t,
|
|
1769
1954
|
errored: s,
|
|
1770
|
-
handleLoad:
|
|
1771
|
-
handleError:
|
|
1955
|
+
handleLoad: a,
|
|
1956
|
+
handleError: n
|
|
1772
1957
|
};
|
|
1773
1958
|
}
|
|
1774
1959
|
const imageVariants = cva("block object-cover", {
|
|
@@ -1846,12 +2031,12 @@ function BaseImageFallback({
|
|
|
1846
2031
|
className: s,
|
|
1847
2032
|
style: i,
|
|
1848
2033
|
shape: o,
|
|
1849
|
-
size:
|
|
2034
|
+
size: a
|
|
1850
2035
|
}) {
|
|
1851
2036
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1852
2037
|
"div",
|
|
1853
2038
|
{
|
|
1854
|
-
className: imageAtomVariants({ shape: o, size:
|
|
2039
|
+
className: imageAtomVariants({ shape: o, size: a, className: s }),
|
|
1855
2040
|
style: { width: t, height: r, ...i },
|
|
1856
2041
|
"aria-label": e,
|
|
1857
2042
|
role: "img",
|
|
@@ -1877,55 +2062,55 @@ const BaseImage = forwardRef(
|
|
|
1877
2062
|
onError: s,
|
|
1878
2063
|
width: i,
|
|
1879
2064
|
height: o,
|
|
1880
|
-
loading:
|
|
1881
|
-
position:
|
|
2065
|
+
loading: a = "lazy",
|
|
2066
|
+
position: n = "cover",
|
|
1882
2067
|
size: l = "auto",
|
|
1883
2068
|
shape: c,
|
|
1884
2069
|
className: u,
|
|
1885
|
-
...
|
|
1886
|
-
},
|
|
1887
|
-
const { loaded:
|
|
2070
|
+
...g
|
|
2071
|
+
}, d) => {
|
|
2072
|
+
const { loaded: m, errored: h, handleLoad: w, handleError: p } = useImage({
|
|
1888
2073
|
src: e
|
|
1889
|
-
}),
|
|
1890
|
-
return !
|
|
2074
|
+
}), v = typeof i == "number" ? i : Number(i), y = typeof o == "number" ? o : Number(o);
|
|
2075
|
+
return !m && !h ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1891
2076
|
BaseImageSkeleton,
|
|
1892
2077
|
{
|
|
1893
2078
|
shape: c,
|
|
1894
|
-
width:
|
|
1895
|
-
height:
|
|
2079
|
+
width: v,
|
|
2080
|
+
height: y
|
|
1896
2081
|
}
|
|
1897
|
-
) :
|
|
2082
|
+
) : h ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1898
2083
|
BaseImageFallback,
|
|
1899
2084
|
{
|
|
1900
2085
|
shape: c,
|
|
1901
2086
|
alt: t,
|
|
1902
|
-
width:
|
|
1903
|
-
height:
|
|
2087
|
+
width: v,
|
|
2088
|
+
height: y
|
|
1904
2089
|
}
|
|
1905
2090
|
) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1906
2091
|
"img",
|
|
1907
2092
|
{
|
|
1908
|
-
ref:
|
|
2093
|
+
ref: d,
|
|
1909
2094
|
src: e,
|
|
1910
2095
|
alt: t,
|
|
1911
|
-
width:
|
|
1912
|
-
height:
|
|
1913
|
-
loading:
|
|
2096
|
+
width: v,
|
|
2097
|
+
height: y,
|
|
2098
|
+
loading: a,
|
|
1914
2099
|
className: cn(
|
|
1915
2100
|
imageVariants({
|
|
1916
|
-
position:
|
|
2101
|
+
position: n,
|
|
1917
2102
|
size: l,
|
|
1918
2103
|
shape: c
|
|
1919
2104
|
}),
|
|
1920
2105
|
u
|
|
1921
2106
|
),
|
|
1922
|
-
onLoad: (
|
|
1923
|
-
|
|
2107
|
+
onLoad: (b) => {
|
|
2108
|
+
w(), r?.(b);
|
|
1924
2109
|
},
|
|
1925
|
-
onError: (
|
|
1926
|
-
|
|
2110
|
+
onError: (b) => {
|
|
2111
|
+
p(), s?.(b);
|
|
1927
2112
|
},
|
|
1928
|
-
...
|
|
2113
|
+
...g
|
|
1929
2114
|
}
|
|
1930
2115
|
);
|
|
1931
2116
|
}
|
|
@@ -1936,6 +2121,7 @@ export {
|
|
|
1936
2121
|
Calculator as C,
|
|
1937
2122
|
FilterChip as F,
|
|
1938
2123
|
Icon as I,
|
|
2124
|
+
Menu as M,
|
|
1939
2125
|
NoResults as N,
|
|
1940
2126
|
Table as T,
|
|
1941
2127
|
Anchor as a,
|
|
@@ -1944,13 +2130,14 @@ export {
|
|
|
1944
2130
|
Avatar as d,
|
|
1945
2131
|
Brand as e,
|
|
1946
2132
|
Button as f,
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
2133
|
+
ButtonMenuIcon as g,
|
|
2134
|
+
ButtonFloat as h,
|
|
2135
|
+
ButtonIcon as i,
|
|
2136
|
+
Card as j,
|
|
2137
|
+
Text as k,
|
|
2138
|
+
Tile as l,
|
|
2139
|
+
ImageCircle as m,
|
|
2140
|
+
ImageSquare as n,
|
|
2141
|
+
ImageRectangle as o,
|
|
2142
|
+
BaseImage as p
|
|
1956
2143
|
};
|