@dimasbaguspm/versaur 0.0.35 → 0.0.37
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-BYq9Nf57.js → bottom-sheet-CJfhhYkA.js} +180 -164
- package/dist/js/{bottom-sheet-input-Bo5LLNVg.js → bottom-sheet-input-CpL1KbPE.js} +517 -476
- package/dist/js/forms/index.js +1 -1
- package/dist/js/{image-rectangle-BPmnlpnT.js → image-rectangle-DIGAUCV8.js} +258 -198
- package/dist/js/index.js +32 -31
- package/dist/js/layouts/index.js +1 -1
- package/dist/js/navigation/index.js +1 -1
- package/dist/js/overlays/index.js +3 -3
- package/dist/js/primitive/index.js +24 -23
- package/dist/js/{tabs-C3wTfqhW.js → tabs-Dt4NFIig.js} +1 -1
- package/dist/js/{tooltip-Dh1adQMb.js → tooltip-IIqgfodK.js} +1 -1
- package/dist/js/{top-bar-DNHnNH-S.js → top-bar-C2eCjlsH.js} +2 -2
- package/dist/types/forms/bottom-sheet-input/bottom-sheet-input.d.ts +1 -1
- package/dist/types/forms/price-input/price-input.d.ts +4 -1
- package/dist/types/overlays/bottom-sheet/bottom-sheet.atoms.d.ts +3 -2
- package/dist/types/overlays/bottom-sheet/bottom-sheet.d.ts +2 -1
- package/dist/types/overlays/bottom-sheet/types.d.ts +3 -1
- package/dist/types/overlays/menu/types.d.ts +3 -0
- package/dist/types/primitive/button-menu/button-menu.d.ts +4 -0
- package/dist/types/primitive/button-menu/index.d.ts +2 -0
- package/dist/types/primitive/button-menu/types.d.ts +17 -0
- package/dist/types/primitive/card/types.d.ts +5 -1
- package/dist/types/primitive/index.d.ts +1 -0
- package/dist/utils/enforce-subpath-import.js +1 -0
- package/package.json +1 -1
|
@@ -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
3
|
import React__default, { createContext, useContext, forwardRef, useState, useEffect, useCallback, useRef, useId, cloneElement } from "react";
|
|
4
|
-
import { ChevronDown, EllipsisVerticalIcon, X, XIcon, ImageOff } from "lucide-react";
|
|
4
|
+
import { ChevronDown, CheckIcon, EllipsisVerticalIcon, X, XIcon, ImageOff } from "lucide-react";
|
|
5
5
|
import ReactDOM from "react-dom";
|
|
6
6
|
import { S as Skeleton } from "./skeleton-BNZyaRjo.js";
|
|
7
7
|
const AccordionContext = createContext(
|
|
@@ -146,16 +146,16 @@ const AccordionContext = createContext(
|
|
|
146
146
|
isCapitalize: i = !1,
|
|
147
147
|
hasMargin: s = !1,
|
|
148
148
|
align: o = "left",
|
|
149
|
-
italic:
|
|
149
|
+
italic: a = !1,
|
|
150
150
|
clamp: l = "none",
|
|
151
151
|
ellipsis: u = !1,
|
|
152
152
|
className: c,
|
|
153
153
|
children: f,
|
|
154
|
-
...
|
|
154
|
+
...n
|
|
155
155
|
}, d) => {
|
|
156
|
-
const
|
|
156
|
+
const h = `h${e}`;
|
|
157
157
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
158
|
-
|
|
158
|
+
h,
|
|
159
159
|
{
|
|
160
160
|
ref: d,
|
|
161
161
|
className: cn(
|
|
@@ -165,14 +165,14 @@ const AccordionContext = createContext(
|
|
|
165
165
|
isCapitalize: i,
|
|
166
166
|
hasMargin: s,
|
|
167
167
|
align: o,
|
|
168
|
-
italic:
|
|
168
|
+
italic: a,
|
|
169
169
|
clamp: l,
|
|
170
170
|
ellipsis: u,
|
|
171
171
|
level: e
|
|
172
172
|
}),
|
|
173
173
|
c
|
|
174
174
|
),
|
|
175
|
-
...
|
|
175
|
+
...n,
|
|
176
176
|
children: f
|
|
177
177
|
}
|
|
178
178
|
);
|
|
@@ -209,11 +209,11 @@ const iconVariants = cva("inline-flex items-center justify-center", {
|
|
|
209
209
|
size: "md",
|
|
210
210
|
color: "primary"
|
|
211
211
|
}
|
|
212
|
-
}), Icon = React__default.forwardRef(function({ as: t, color: r = "primary", size: i = "md", className: s, ...o },
|
|
212
|
+
}), Icon = React__default.forwardRef(function({ as: t, color: r = "primary", size: i = "md", className: s, ...o }, a) {
|
|
213
213
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
214
214
|
t,
|
|
215
215
|
{
|
|
216
|
-
ref:
|
|
216
|
+
ref: a,
|
|
217
217
|
className: iconVariants({ color: r, size: i, className: s }),
|
|
218
218
|
...o
|
|
219
219
|
}
|
|
@@ -261,24 +261,24 @@ const iconVariants = cva("inline-flex items-center justify-center", {
|
|
|
261
261
|
isDefaultOpen: i = !1,
|
|
262
262
|
disabled: s = !1,
|
|
263
263
|
hasMargin: o,
|
|
264
|
-
className:
|
|
264
|
+
className: a,
|
|
265
265
|
children: l,
|
|
266
266
|
...u
|
|
267
267
|
}, c) {
|
|
268
|
-
const [f,
|
|
269
|
-
s ||
|
|
270
|
-
},
|
|
268
|
+
const [f, n] = useState(i), d = () => {
|
|
269
|
+
s || n((m) => !m);
|
|
270
|
+
}, h = {
|
|
271
271
|
isOpen: f,
|
|
272
272
|
toggle: d,
|
|
273
273
|
disabled: s
|
|
274
274
|
};
|
|
275
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionContext.Provider, { value:
|
|
275
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionContext.Provider, { value: h, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
276
276
|
"div",
|
|
277
277
|
{
|
|
278
278
|
ref: c,
|
|
279
279
|
className: cn(
|
|
280
280
|
accordionVariants({ disabled: s }),
|
|
281
|
-
|
|
281
|
+
a,
|
|
282
282
|
o && "mb-4"
|
|
283
283
|
),
|
|
284
284
|
...u,
|
|
@@ -463,10 +463,10 @@ const iconVariants = cva("inline-flex items-center justify-center", {
|
|
|
463
463
|
className: i,
|
|
464
464
|
children: s,
|
|
465
465
|
...o
|
|
466
|
-
},
|
|
466
|
+
}, a) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
467
467
|
"div",
|
|
468
468
|
{
|
|
469
|
-
ref:
|
|
469
|
+
ref: a,
|
|
470
470
|
role: "alert",
|
|
471
471
|
className: cn(alertVariants({ variant: e, color: t }), i),
|
|
472
472
|
...o,
|
|
@@ -543,7 +543,7 @@ const iconVariants = cva("inline-flex items-center justify-center", {
|
|
|
543
543
|
fontSize: i = "base",
|
|
544
544
|
fontWeight: s = "medium",
|
|
545
545
|
quiet: o = !1,
|
|
546
|
-
...
|
|
546
|
+
...a
|
|
547
547
|
}, l) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
548
548
|
"a",
|
|
549
549
|
{
|
|
@@ -552,7 +552,7 @@ const iconVariants = cva("inline-flex items-center justify-center", {
|
|
|
552
552
|
anchorVariants({ color: r, fontSize: i, fontWeight: s, quiet: o }),
|
|
553
553
|
t
|
|
554
554
|
),
|
|
555
|
-
...
|
|
555
|
+
...a,
|
|
556
556
|
children: e
|
|
557
557
|
}
|
|
558
558
|
)
|
|
@@ -633,15 +633,15 @@ const iconVariants = cva("inline-flex items-center justify-center", {
|
|
|
633
633
|
isCapitalize: i = !1,
|
|
634
634
|
align: s = "left",
|
|
635
635
|
italic: o = !1,
|
|
636
|
-
clamp:
|
|
636
|
+
clamp: a = "none",
|
|
637
637
|
ellipsis: l = !1,
|
|
638
638
|
fontSize: u,
|
|
639
639
|
fontWeight: c,
|
|
640
640
|
className: f,
|
|
641
|
-
children:
|
|
641
|
+
children: n,
|
|
642
642
|
...d
|
|
643
|
-
},
|
|
644
|
-
const
|
|
643
|
+
}, h) => {
|
|
644
|
+
const y = [
|
|
645
645
|
"h1",
|
|
646
646
|
"h2",
|
|
647
647
|
"h3",
|
|
@@ -655,7 +655,7 @@ const iconVariants = cva("inline-flex items-center justify-center", {
|
|
|
655
655
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
656
656
|
e,
|
|
657
657
|
{
|
|
658
|
-
ref:
|
|
658
|
+
ref: h,
|
|
659
659
|
className: cn(
|
|
660
660
|
textVariants({
|
|
661
661
|
color: t,
|
|
@@ -663,26 +663,26 @@ const iconVariants = cva("inline-flex items-center justify-center", {
|
|
|
663
663
|
isCapitalize: i,
|
|
664
664
|
align: s,
|
|
665
665
|
italic: o,
|
|
666
|
-
clamp:
|
|
666
|
+
clamp: a,
|
|
667
667
|
ellipsis: l,
|
|
668
668
|
// @ts-expect-error - `as` is not a valid variant
|
|
669
|
-
as:
|
|
669
|
+
as: y
|
|
670
670
|
}),
|
|
671
671
|
w,
|
|
672
672
|
R,
|
|
673
673
|
f
|
|
674
674
|
),
|
|
675
675
|
...d,
|
|
676
|
-
children:
|
|
676
|
+
children: n
|
|
677
677
|
}
|
|
678
678
|
);
|
|
679
679
|
}
|
|
680
680
|
), Attribute = forwardRef(
|
|
681
|
-
function({ title: t, children: r, className: i, hasMargin: s, ...o },
|
|
681
|
+
function({ title: t, children: r, className: i, hasMargin: s, ...o }, a) {
|
|
682
682
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
683
683
|
"div",
|
|
684
684
|
{
|
|
685
|
-
ref:
|
|
685
|
+
ref: a,
|
|
686
686
|
className: cn("space-y-1", i, s && "mb-4"),
|
|
687
687
|
...o,
|
|
688
688
|
children: [
|
|
@@ -763,17 +763,17 @@ function getGridCols(e = 4) {
|
|
|
763
763
|
return "grid-cols-4";
|
|
764
764
|
}
|
|
765
765
|
}
|
|
766
|
-
const AttributeListItem = forwardRef(function({ children: t, className: r, span: i = 1, title: s, ...o },
|
|
766
|
+
const AttributeListItem = forwardRef(function({ children: t, className: r, span: i = 1, title: s, ...o }, a) {
|
|
767
767
|
const l = getColSpan(i);
|
|
768
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("li", { ref:
|
|
768
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("li", { ref: a, className: cn(l, r), ...o, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Attribute, { title: s, children: t }) });
|
|
769
769
|
}), AttributeListRoot = forwardRef(
|
|
770
770
|
function({ children: t, className: r, columns: i = 4, ...s }, o) {
|
|
771
|
-
const
|
|
771
|
+
const a = getGridCols(i);
|
|
772
772
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
773
773
|
"ul",
|
|
774
774
|
{
|
|
775
775
|
ref: o,
|
|
776
|
-
className: cn("grid gap-4",
|
|
776
|
+
className: cn("grid gap-4", a, r),
|
|
777
777
|
...s,
|
|
778
778
|
children: t
|
|
779
779
|
}
|
|
@@ -827,10 +827,10 @@ const AttributeListItem = forwardRef(function({ children: t, className: r, span:
|
|
|
827
827
|
className: i,
|
|
828
828
|
children: s,
|
|
829
829
|
...o
|
|
830
|
-
},
|
|
830
|
+
}, a) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
831
831
|
"div",
|
|
832
832
|
{
|
|
833
|
-
ref:
|
|
833
|
+
ref: a,
|
|
834
834
|
className: cn(avatarVariants({ variant: e, size: t, shape: r }), i),
|
|
835
835
|
...o,
|
|
836
836
|
children: s
|
|
@@ -838,7 +838,7 @@ const AttributeListItem = forwardRef(function({ children: t, className: r, span:
|
|
|
838
838
|
)
|
|
839
839
|
), AvatarImage = forwardRef(
|
|
840
840
|
({ src: e, alt: t, className: r, onError: i, ...s }, o) => {
|
|
841
|
-
const [
|
|
841
|
+
const [a, l] = useState(!1);
|
|
842
842
|
useEffect(() => {
|
|
843
843
|
l(!1);
|
|
844
844
|
}, [e]);
|
|
@@ -848,7 +848,7 @@ const AttributeListItem = forwardRef(function({ children: t, className: r, span:
|
|
|
848
848
|
},
|
|
849
849
|
[i]
|
|
850
850
|
);
|
|
851
|
-
return
|
|
851
|
+
return a ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
852
852
|
"img",
|
|
853
853
|
{
|
|
854
854
|
ref: o,
|
|
@@ -1026,7 +1026,7 @@ const AttributeListItem = forwardRef(function({ children: t, className: r, span:
|
|
|
1026
1026
|
size: i = "md",
|
|
1027
1027
|
iconLeft: s,
|
|
1028
1028
|
iconRight: o,
|
|
1029
|
-
className:
|
|
1029
|
+
className: a,
|
|
1030
1030
|
children: l,
|
|
1031
1031
|
...u
|
|
1032
1032
|
}, c) => {
|
|
@@ -1043,7 +1043,7 @@ const AttributeListItem = forwardRef(function({ children: t, className: r, span:
|
|
|
1043
1043
|
size: i,
|
|
1044
1044
|
iconOnly: d
|
|
1045
1045
|
}),
|
|
1046
|
-
|
|
1046
|
+
a
|
|
1047
1047
|
),
|
|
1048
1048
|
...u,
|
|
1049
1049
|
children: d ? (
|
|
@@ -1156,7 +1156,7 @@ const AttributeListItem = forwardRef(function({ children: t, className: r, span:
|
|
|
1156
1156
|
size: i = "md",
|
|
1157
1157
|
disabled: s = !1,
|
|
1158
1158
|
type: o = "button",
|
|
1159
|
-
children:
|
|
1159
|
+
children: a,
|
|
1160
1160
|
...l
|
|
1161
1161
|
}, u) {
|
|
1162
1162
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -1169,7 +1169,7 @@ const AttributeListItem = forwardRef(function({ children: t, className: r, span:
|
|
|
1169
1169
|
"aria-disabled": s,
|
|
1170
1170
|
inert: s ? !0 : void 0,
|
|
1171
1171
|
...l,
|
|
1172
|
-
children:
|
|
1172
|
+
children: a
|
|
1173
1173
|
}
|
|
1174
1174
|
);
|
|
1175
1175
|
}
|
|
@@ -1231,142 +1231,142 @@ function isTriggerVisible(e, t) {
|
|
|
1231
1231
|
return !0;
|
|
1232
1232
|
}
|
|
1233
1233
|
function useMenuPosition(e, t, r, i = "bottom-start", s) {
|
|
1234
|
-
const [o,
|
|
1234
|
+
const [o, a] = useState({ isReady: !1 }), l = useCallback(() => {
|
|
1235
1235
|
if (!e || !t.current) {
|
|
1236
|
-
|
|
1236
|
+
a({ isReady: !1 });
|
|
1237
1237
|
return;
|
|
1238
1238
|
}
|
|
1239
1239
|
if (!r.current) {
|
|
1240
|
-
const
|
|
1241
|
-
|
|
1240
|
+
const v = setTimeout(() => {
|
|
1241
|
+
a({ isReady: !1 });
|
|
1242
1242
|
}, 0);
|
|
1243
|
-
return () => clearTimeout(
|
|
1243
|
+
return () => clearTimeout(v);
|
|
1244
1244
|
}
|
|
1245
1245
|
const u = t.current, c = r.current, f = getScrollableAncestors(u);
|
|
1246
1246
|
if (!isTriggerVisible(u, f)) {
|
|
1247
|
-
|
|
1247
|
+
a({ isReady: !1 });
|
|
1248
1248
|
return;
|
|
1249
1249
|
}
|
|
1250
|
-
const
|
|
1251
|
-
let
|
|
1252
|
-
s && ("getBoundingClientRect" in s ?
|
|
1253
|
-
const
|
|
1250
|
+
const n = u.getBoundingClientRect(), d = window.innerWidth, h = window.innerHeight;
|
|
1251
|
+
let m = null;
|
|
1252
|
+
s && ("getBoundingClientRect" in s ? m = s : "current" in s && (m = s.current));
|
|
1253
|
+
const y = m || document.documentElement, w = y === document.documentElement ? { top: 0, bottom: h, left: 0, right: d } : y.getBoundingClientRect(), R = c.style.visibility, E = c.style.position, C = c.style.opacity;
|
|
1254
1254
|
c.style.visibility = "hidden", c.style.position = "absolute", c.style.opacity = "0";
|
|
1255
1255
|
const x = c.getBoundingClientRect();
|
|
1256
1256
|
c.style.visibility = R, c.style.position = E, c.style.opacity = C;
|
|
1257
|
-
const
|
|
1257
|
+
const I = w.bottom - n.bottom - 8, N = n.top - w.top - 8, V = w.right - n.left - 8, B = n.right - w.left - 8;
|
|
1258
1258
|
let p = i;
|
|
1259
1259
|
if (i === "auto") {
|
|
1260
|
-
const
|
|
1260
|
+
const b = [
|
|
1261
1261
|
{
|
|
1262
1262
|
name: "bottom-start",
|
|
1263
|
-
fits:
|
|
1264
|
-
spaceUsed:
|
|
1263
|
+
fits: I >= x.height && V >= x.width,
|
|
1264
|
+
spaceUsed: I,
|
|
1265
1265
|
priority: 1
|
|
1266
1266
|
// Prefer bottom-start as default
|
|
1267
1267
|
},
|
|
1268
1268
|
{
|
|
1269
1269
|
name: "bottom-end",
|
|
1270
|
-
fits:
|
|
1271
|
-
spaceUsed:
|
|
1270
|
+
fits: I >= x.height && B >= x.width,
|
|
1271
|
+
spaceUsed: I,
|
|
1272
1272
|
priority: 2
|
|
1273
1273
|
},
|
|
1274
1274
|
{
|
|
1275
1275
|
name: "top-start",
|
|
1276
|
-
fits:
|
|
1277
|
-
spaceUsed:
|
|
1276
|
+
fits: N >= x.height && V >= x.width,
|
|
1277
|
+
spaceUsed: N,
|
|
1278
1278
|
priority: 3
|
|
1279
1279
|
},
|
|
1280
1280
|
{
|
|
1281
1281
|
name: "top-end",
|
|
1282
|
-
fits:
|
|
1283
|
-
spaceUsed:
|
|
1282
|
+
fits: N >= x.height && B >= x.width,
|
|
1283
|
+
spaceUsed: N,
|
|
1284
1284
|
priority: 4
|
|
1285
1285
|
}
|
|
1286
|
-
].filter((
|
|
1287
|
-
|
|
1288
|
-
(
|
|
1289
|
-
)[0].name :
|
|
1286
|
+
].filter((j) => j.fits);
|
|
1287
|
+
b.length > 0 ? p = b.sort(
|
|
1288
|
+
(j, k) => j.priority - k.priority
|
|
1289
|
+
)[0].name : I >= N ? p = V >= B ? "bottom-start" : "bottom-end" : p = V >= B ? "top-start" : "top-end";
|
|
1290
1290
|
}
|
|
1291
1291
|
const g = {};
|
|
1292
1292
|
if (s)
|
|
1293
1293
|
switch (g.position = "fixed", p) {
|
|
1294
1294
|
case "bottom-start":
|
|
1295
|
-
g.top =
|
|
1295
|
+
g.top = n.bottom + 4, g.left = n.left;
|
|
1296
1296
|
break;
|
|
1297
1297
|
case "bottom-end":
|
|
1298
|
-
g.top =
|
|
1298
|
+
g.top = n.bottom + 4, g.right = window.innerWidth - n.right;
|
|
1299
1299
|
break;
|
|
1300
1300
|
case "top-start":
|
|
1301
|
-
g.bottom = window.innerHeight -
|
|
1301
|
+
g.bottom = window.innerHeight - n.top + 4, g.left = n.left;
|
|
1302
1302
|
break;
|
|
1303
1303
|
case "top-end":
|
|
1304
|
-
g.bottom = window.innerHeight -
|
|
1304
|
+
g.bottom = window.innerHeight - n.top + 4, g.right = window.innerWidth - n.right;
|
|
1305
1305
|
break;
|
|
1306
1306
|
}
|
|
1307
1307
|
else
|
|
1308
1308
|
switch (g.position = "absolute", p) {
|
|
1309
1309
|
case "bottom-start":
|
|
1310
|
-
g.top =
|
|
1310
|
+
g.top = n.height + 4, g.left = 0;
|
|
1311
1311
|
break;
|
|
1312
1312
|
case "bottom-end":
|
|
1313
|
-
g.top =
|
|
1313
|
+
g.top = n.height + 4, g.right = 0;
|
|
1314
1314
|
break;
|
|
1315
1315
|
case "top-start":
|
|
1316
|
-
g.bottom =
|
|
1316
|
+
g.bottom = n.height + 4, g.left = 0;
|
|
1317
1317
|
break;
|
|
1318
1318
|
case "top-end":
|
|
1319
|
-
g.bottom =
|
|
1319
|
+
g.bottom = n.height + 4, g.right = 0;
|
|
1320
1320
|
break;
|
|
1321
1321
|
}
|
|
1322
1322
|
if (s) {
|
|
1323
|
-
const
|
|
1324
|
-
top: p.startsWith("bottom") ?
|
|
1325
|
-
left: p.endsWith("start") ?
|
|
1323
|
+
const v = {
|
|
1324
|
+
top: p.startsWith("bottom") ? n.bottom + 4 : n.top - x.height - 4,
|
|
1325
|
+
left: p.endsWith("start") ? n.left : n.right - x.width,
|
|
1326
1326
|
width: x.width,
|
|
1327
1327
|
height: x.height
|
|
1328
1328
|
};
|
|
1329
|
-
if (
|
|
1330
|
-
const
|
|
1331
|
-
p.endsWith("start") ? g.left = (g.left || 0) +
|
|
1332
|
-
} else if (
|
|
1333
|
-
const
|
|
1334
|
-
p.endsWith("start") ? g.left = (g.left || 0) -
|
|
1329
|
+
if (v.left < w.left + 8) {
|
|
1330
|
+
const b = w.left + 8 - v.left;
|
|
1331
|
+
p.endsWith("start") ? g.left = (g.left || 0) + b : g.right = (g.right || 0) - b;
|
|
1332
|
+
} else if (v.left + v.width > w.right - 8) {
|
|
1333
|
+
const b = v.left + v.width - (w.right - 8);
|
|
1334
|
+
p.endsWith("start") ? g.left = (g.left || 0) - b : g.right = (g.right || 0) + b;
|
|
1335
1335
|
}
|
|
1336
1336
|
if (p.startsWith("bottom")) {
|
|
1337
|
-
const
|
|
1337
|
+
const b = Math.max(
|
|
1338
1338
|
50,
|
|
1339
|
-
w.bottom -
|
|
1339
|
+
w.bottom - n.bottom - 16
|
|
1340
1340
|
);
|
|
1341
|
-
x.height >
|
|
1341
|
+
x.height > b && (g.maxHeight = b);
|
|
1342
1342
|
} else {
|
|
1343
|
-
const
|
|
1343
|
+
const b = Math.max(
|
|
1344
1344
|
50,
|
|
1345
|
-
|
|
1345
|
+
n.top - w.top - 16
|
|
1346
1346
|
);
|
|
1347
|
-
x.height >
|
|
1347
|
+
x.height > b && (g.maxHeight = b);
|
|
1348
1348
|
}
|
|
1349
1349
|
} else {
|
|
1350
|
-
const
|
|
1351
|
-
top: p.startsWith("bottom") ?
|
|
1350
|
+
const v = {
|
|
1351
|
+
top: p.startsWith("bottom") ? n.height + 4 : -x.height - 4,
|
|
1352
1352
|
left: p.endsWith("start") ? 0 : -x.width,
|
|
1353
1353
|
width: x.width,
|
|
1354
1354
|
height: x.height
|
|
1355
|
-
},
|
|
1356
|
-
left:
|
|
1357
|
-
right:
|
|
1358
|
-
top:
|
|
1359
|
-
bottom:
|
|
1355
|
+
}, b = {
|
|
1356
|
+
left: n.left,
|
|
1357
|
+
right: n.right,
|
|
1358
|
+
top: n.top,
|
|
1359
|
+
bottom: n.bottom
|
|
1360
1360
|
};
|
|
1361
|
-
if (
|
|
1362
|
-
const
|
|
1363
|
-
p.endsWith("start") ? g.left = (g.left || 0) +
|
|
1364
|
-
} else if (
|
|
1365
|
-
const
|
|
1366
|
-
p.endsWith("start") ? g.left = (g.left || 0) -
|
|
1361
|
+
if (b.left + v.left < 8) {
|
|
1362
|
+
const j = 8 - (b.left + v.left);
|
|
1363
|
+
p.endsWith("start") ? g.left = (g.left || 0) + j : g.right = (g.right || 0) - j;
|
|
1364
|
+
} else if (b.left + v.left + v.width > d - 8) {
|
|
1365
|
+
const j = b.left + v.left + v.width - (d - 8);
|
|
1366
|
+
p.endsWith("start") ? g.left = (g.left || 0) - j : g.right = (g.right || 0) + j;
|
|
1367
1367
|
}
|
|
1368
1368
|
}
|
|
1369
|
-
g.isReady = !0,
|
|
1369
|
+
g.isReady = !0, a(g);
|
|
1370
1370
|
}, [e, i, t, r, s]);
|
|
1371
1371
|
return useEffect(() => {
|
|
1372
1372
|
l();
|
|
@@ -1374,16 +1374,16 @@ function useMenuPosition(e, t, r, i = "bottom-start", s) {
|
|
|
1374
1374
|
if (!e || !t.current) return;
|
|
1375
1375
|
const u = t.current, c = getScrollableAncestors(u);
|
|
1376
1376
|
let f = !1;
|
|
1377
|
-
const
|
|
1377
|
+
const n = () => {
|
|
1378
1378
|
f || (requestAnimationFrame(() => {
|
|
1379
1379
|
l(), f = !1;
|
|
1380
1380
|
}), f = !0);
|
|
1381
1381
|
};
|
|
1382
1382
|
return c.forEach((d) => {
|
|
1383
|
-
d === document.documentElement ? (window.addEventListener("scroll",
|
|
1383
|
+
d === document.documentElement ? (window.addEventListener("scroll", n, { passive: !0 }), window.addEventListener("resize", n, { passive: !0 })) : d.addEventListener("scroll", n, { passive: !0 });
|
|
1384
1384
|
}), () => {
|
|
1385
1385
|
c.forEach((d) => {
|
|
1386
|
-
d === document.documentElement ? (window.removeEventListener("scroll",
|
|
1386
|
+
d === document.documentElement ? (window.removeEventListener("scroll", n), window.removeEventListener("resize", n)) : d.removeEventListener("scroll", n);
|
|
1387
1387
|
});
|
|
1388
1388
|
};
|
|
1389
1389
|
}, [e, l, t]), o;
|
|
@@ -1396,18 +1396,29 @@ const MenuContext = createContext(void 0), MenuProvider = MenuContext.Provider,
|
|
|
1396
1396
|
}, MenuContent = forwardRef(
|
|
1397
1397
|
({ children: e }, t) => /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { ref: t, className: "flex flex-col gap-1", children: e })
|
|
1398
1398
|
), MenuItem = forwardRef(
|
|
1399
|
-
({ children: e, disabled: t, onClick: r,
|
|
1400
|
-
const { preserve:
|
|
1401
|
-
r?.(
|
|
1399
|
+
({ children: e, disabled: t, onClick: r, active: i, ...s }, o) => {
|
|
1400
|
+
const { preserve: a, onClose: l } = useMenuProvider(), u = (c) => {
|
|
1401
|
+
r?.(c), a || l();
|
|
1402
1402
|
};
|
|
1403
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("li", { ref:
|
|
1403
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("li", { ref: o, ...s, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1404
1404
|
Button,
|
|
1405
1405
|
{
|
|
1406
1406
|
variant: "ghost",
|
|
1407
|
-
className: cn("
|
|
1407
|
+
className: cn("justify-start w-full gap-2"),
|
|
1408
1408
|
disabled: t,
|
|
1409
|
-
onClick:
|
|
1410
|
-
children:
|
|
1409
|
+
onClick: u,
|
|
1410
|
+
children: [
|
|
1411
|
+
e,
|
|
1412
|
+
i && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1413
|
+
Icon,
|
|
1414
|
+
{
|
|
1415
|
+
as: CheckIcon,
|
|
1416
|
+
color: "inherit",
|
|
1417
|
+
className: "ml-auto",
|
|
1418
|
+
size: "sm"
|
|
1419
|
+
}
|
|
1420
|
+
)
|
|
1421
|
+
]
|
|
1411
1422
|
}
|
|
1412
1423
|
) });
|
|
1413
1424
|
}
|
|
@@ -1418,31 +1429,31 @@ const MenuContext = createContext(void 0), MenuProvider = MenuContext.Provider,
|
|
|
1418
1429
|
content: i,
|
|
1419
1430
|
children: s,
|
|
1420
1431
|
placement: o = "auto",
|
|
1421
|
-
container:
|
|
1432
|
+
container: a,
|
|
1422
1433
|
preserve: l
|
|
1423
1434
|
}) => {
|
|
1424
1435
|
const u = useRef(null), c = useRef(null), f = useId();
|
|
1425
1436
|
useMenuOutsideClick(e, c, u, t);
|
|
1426
|
-
const
|
|
1437
|
+
const n = useMenuPosition(
|
|
1427
1438
|
e,
|
|
1428
1439
|
u,
|
|
1429
1440
|
c,
|
|
1430
1441
|
o,
|
|
1431
|
-
|
|
1442
|
+
a || null
|
|
1432
1443
|
), d = {
|
|
1433
|
-
...
|
|
1434
|
-
position:
|
|
1435
|
-
overflowY:
|
|
1436
|
-
overflowX:
|
|
1437
|
-
},
|
|
1444
|
+
...n,
|
|
1445
|
+
position: n.position || "absolute",
|
|
1446
|
+
overflowY: n.maxHeight ? "auto" : void 0,
|
|
1447
|
+
overflowX: n.maxWidth ? "auto" : void 0
|
|
1448
|
+
}, h = e && n.isReady, m = /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1438
1449
|
"div",
|
|
1439
1450
|
{
|
|
1440
1451
|
id: f,
|
|
1441
1452
|
ref: c,
|
|
1442
|
-
className: cn(menuVariants({ size: r, open:
|
|
1453
|
+
className: cn(menuVariants({ size: r, open: h })),
|
|
1443
1454
|
style: d,
|
|
1444
1455
|
role: "menu",
|
|
1445
|
-
"aria-hidden": !
|
|
1456
|
+
"aria-hidden": !h,
|
|
1446
1457
|
children: i
|
|
1447
1458
|
}
|
|
1448
1459
|
);
|
|
@@ -1459,7 +1470,7 @@ const MenuContext = createContext(void 0), MenuProvider = MenuContext.Provider,
|
|
|
1459
1470
|
"aria-controls": f
|
|
1460
1471
|
}),
|
|
1461
1472
|
e && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
1462
|
-
!
|
|
1473
|
+
!n.isReady && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1463
1474
|
"div",
|
|
1464
1475
|
{
|
|
1465
1476
|
ref: c,
|
|
@@ -1475,7 +1486,7 @@ const MenuContext = createContext(void 0), MenuProvider = MenuContext.Provider,
|
|
|
1475
1486
|
children: i
|
|
1476
1487
|
}
|
|
1477
1488
|
),
|
|
1478
|
-
|
|
1489
|
+
n.isReady && /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: n.position === "fixed" ? /* @__PURE__ */ jsxRuntimeExports.jsx(OverlayPortal, { children: m }) : m })
|
|
1479
1490
|
] })
|
|
1480
1491
|
] })
|
|
1481
1492
|
}
|
|
@@ -1483,6 +1494,41 @@ const MenuContext = createContext(void 0), MenuProvider = MenuContext.Provider,
|
|
|
1483
1494
|
}, Menu = Object.assign(MenuRoot, {
|
|
1484
1495
|
Content: MenuContent,
|
|
1485
1496
|
Item: MenuItem
|
|
1497
|
+
}), ButtonMenuRoot = forwardRef(
|
|
1498
|
+
(e, t) => {
|
|
1499
|
+
const {
|
|
1500
|
+
children: r,
|
|
1501
|
+
onOpenChange: i,
|
|
1502
|
+
onClick: s,
|
|
1503
|
+
placement: o,
|
|
1504
|
+
container: a,
|
|
1505
|
+
preserve: l,
|
|
1506
|
+
label: u,
|
|
1507
|
+
...c
|
|
1508
|
+
} = e ?? {}, [f, n] = useState(!1);
|
|
1509
|
+
useEffect(() => {
|
|
1510
|
+
i?.(f);
|
|
1511
|
+
}, [f, i]);
|
|
1512
|
+
const d = () => {
|
|
1513
|
+
n(!1);
|
|
1514
|
+
}, h = (m) => {
|
|
1515
|
+
n((y) => !y), s?.(m);
|
|
1516
|
+
};
|
|
1517
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1518
|
+
Menu,
|
|
1519
|
+
{
|
|
1520
|
+
isOpen: f,
|
|
1521
|
+
onOutsideClick: d,
|
|
1522
|
+
placement: o,
|
|
1523
|
+
container: a,
|
|
1524
|
+
preserve: l,
|
|
1525
|
+
content: /* @__PURE__ */ jsxRuntimeExports.jsx(Menu.Content, { children: r }),
|
|
1526
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { ref: t, onClick: h, ...c, children: u })
|
|
1527
|
+
}
|
|
1528
|
+
);
|
|
1529
|
+
}
|
|
1530
|
+
), ButtonMenu = Object.assign(ButtonMenuRoot, {
|
|
1531
|
+
Item: Menu.Item
|
|
1486
1532
|
});
|
|
1487
1533
|
function getIconColorFromVariant(e = "primary") {
|
|
1488
1534
|
const t = e.split("-");
|
|
@@ -1579,7 +1625,7 @@ const buttonIconVariants = cva(
|
|
|
1579
1625
|
size: i = "md",
|
|
1580
1626
|
shape: s = "rounded",
|
|
1581
1627
|
disabled: o = !1,
|
|
1582
|
-
as:
|
|
1628
|
+
as: a,
|
|
1583
1629
|
"aria-label": l,
|
|
1584
1630
|
...u
|
|
1585
1631
|
}, c) {
|
|
@@ -1604,7 +1650,7 @@ const buttonIconVariants = cva(
|
|
|
1604
1650
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1605
1651
|
Icon,
|
|
1606
1652
|
{
|
|
1607
|
-
as:
|
|
1653
|
+
as: a,
|
|
1608
1654
|
size: "sm",
|
|
1609
1655
|
color: getIconColorFromVariant(r)
|
|
1610
1656
|
}
|
|
@@ -1619,29 +1665,29 @@ const buttonIconVariants = cva(
|
|
|
1619
1665
|
children: i,
|
|
1620
1666
|
onOpenChange: s,
|
|
1621
1667
|
onClick: o,
|
|
1622
|
-
placement:
|
|
1668
|
+
placement: a,
|
|
1623
1669
|
container: l,
|
|
1624
1670
|
preserve: u,
|
|
1625
1671
|
...c
|
|
1626
|
-
} = e ?? {}, [f,
|
|
1672
|
+
} = e ?? {}, [f, n] = useState(!1);
|
|
1627
1673
|
useEffect(() => {
|
|
1628
1674
|
s?.(f);
|
|
1629
1675
|
}, [f, s]);
|
|
1630
1676
|
const d = () => {
|
|
1631
|
-
|
|
1632
|
-
},
|
|
1633
|
-
|
|
1677
|
+
n(!1);
|
|
1678
|
+
}, h = (m) => {
|
|
1679
|
+
n((y) => !y), o?.(m);
|
|
1634
1680
|
};
|
|
1635
1681
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1636
1682
|
Menu,
|
|
1637
1683
|
{
|
|
1638
1684
|
isOpen: f,
|
|
1639
1685
|
onOutsideClick: d,
|
|
1640
|
-
placement:
|
|
1686
|
+
placement: a,
|
|
1641
1687
|
container: l,
|
|
1642
1688
|
preserve: u,
|
|
1643
1689
|
content: /* @__PURE__ */ jsxRuntimeExports.jsx(Menu.Content, { children: i }),
|
|
1644
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonIcon, { ref: t, as: r, onClick:
|
|
1690
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonIcon, { ref: t, as: r, onClick: h, ...c })
|
|
1645
1691
|
}
|
|
1646
1692
|
);
|
|
1647
1693
|
}
|
|
@@ -1715,21 +1761,21 @@ const buttonIconVariants = cva(
|
|
|
1715
1761
|
}
|
|
1716
1762
|
);
|
|
1717
1763
|
function useFloatingPosition(e, t = "1rem") {
|
|
1718
|
-
const r = useRef(null), [i, s] = useState({}), [o,
|
|
1764
|
+
const r = useRef(null), [i, s] = useState({}), [o, a] = useState("fixed bottom-4 right-4"), l = useCallback(() => {
|
|
1719
1765
|
const c = r.current;
|
|
1720
1766
|
if (!c) return;
|
|
1721
|
-
const
|
|
1722
|
-
let d = {},
|
|
1723
|
-
|
|
1767
|
+
const n = c.getBoundingClientRect().height > window.innerHeight;
|
|
1768
|
+
let d = {}, h = "";
|
|
1769
|
+
n ? (d = {
|
|
1724
1770
|
position: "fixed",
|
|
1725
1771
|
bottom: t,
|
|
1726
1772
|
zIndex: 50,
|
|
1727
1773
|
transform: `translateY(${c.scrollTop}px)`
|
|
1728
|
-
},
|
|
1774
|
+
}, h = `fixed bottom-4 ${e}-4`) : (d = {
|
|
1729
1775
|
position: "fixed",
|
|
1730
1776
|
bottom: t,
|
|
1731
1777
|
zIndex: 50
|
|
1732
|
-
},
|
|
1778
|
+
}, h = `fixed bottom-4 ${e}-4`), s(d), a(h);
|
|
1733
1779
|
}, [e, t]);
|
|
1734
1780
|
return useEffect(() => {
|
|
1735
1781
|
l();
|
|
@@ -1753,27 +1799,27 @@ const ButtonFloat = forwardRef(
|
|
|
1753
1799
|
size: i = "md",
|
|
1754
1800
|
side: s = "right",
|
|
1755
1801
|
offset: o = "1rem",
|
|
1756
|
-
...
|
|
1802
|
+
...a
|
|
1757
1803
|
}, l) {
|
|
1758
1804
|
const [u, c, f] = useFloatingPosition(
|
|
1759
1805
|
s,
|
|
1760
1806
|
o
|
|
1761
|
-
), [
|
|
1807
|
+
), [n, d] = useState(!1);
|
|
1762
1808
|
return useEffect(() => {
|
|
1763
1809
|
d(!0);
|
|
1764
1810
|
}, []), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: u, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1765
1811
|
"button",
|
|
1766
1812
|
{
|
|
1767
1813
|
ref: l,
|
|
1768
|
-
type:
|
|
1814
|
+
type: a.type || "button",
|
|
1769
1815
|
className: cn(
|
|
1770
1816
|
buttonFloatVariants({ variant: r, size: i }),
|
|
1771
1817
|
f,
|
|
1772
|
-
|
|
1818
|
+
n && "animate-fab-in",
|
|
1773
1819
|
t
|
|
1774
1820
|
),
|
|
1775
1821
|
style: c,
|
|
1776
|
-
...
|
|
1822
|
+
...a
|
|
1777
1823
|
}
|
|
1778
1824
|
) });
|
|
1779
1825
|
}
|
|
@@ -1895,7 +1941,7 @@ const BUTTONS = [
|
|
|
1895
1941
|
className: i,
|
|
1896
1942
|
"aria-label": s
|
|
1897
1943
|
}, o) => {
|
|
1898
|
-
const { input:
|
|
1944
|
+
const { input: a, inputRef: l, handleButton: u, handleInput: c } = useCalculator({
|
|
1899
1945
|
initialValue: e,
|
|
1900
1946
|
disabled: r,
|
|
1901
1947
|
onChange: t
|
|
@@ -1913,14 +1959,14 @@ const BUTTONS = [
|
|
|
1913
1959
|
{
|
|
1914
1960
|
ref: l,
|
|
1915
1961
|
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)]",
|
|
1916
|
-
value:
|
|
1962
|
+
value: a,
|
|
1917
1963
|
onChange: c,
|
|
1918
1964
|
disabled: r,
|
|
1919
1965
|
inputMode: "decimal",
|
|
1920
1966
|
"aria-label": "Calculator input"
|
|
1921
1967
|
}
|
|
1922
1968
|
),
|
|
1923
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1 mb-3", children: BUTTONS.map((f,
|
|
1969
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1 mb-3", children: BUTTONS.map((f, n) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex w-full", children: f.map((d) => d === "⌫" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1924
1970
|
ButtonIcon,
|
|
1925
1971
|
{
|
|
1926
1972
|
as: X,
|
|
@@ -1941,7 +1987,7 @@ const BUTTONS = [
|
|
|
1941
1987
|
children: d
|
|
1942
1988
|
},
|
|
1943
1989
|
d
|
|
1944
|
-
)) },
|
|
1990
|
+
)) }, n)) })
|
|
1945
1991
|
]
|
|
1946
1992
|
}
|
|
1947
1993
|
);
|
|
@@ -1949,7 +1995,7 @@ const BUTTONS = [
|
|
|
1949
1995
|
);
|
|
1950
1996
|
Calculator.displayName = "Calculator";
|
|
1951
1997
|
const cardVariants = cva(
|
|
1952
|
-
"
|
|
1998
|
+
"flex justify-between transition-colors duration-200 cursor-pointer w-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-light hover:bg-gray-50",
|
|
1953
1999
|
{
|
|
1954
2000
|
variants: {
|
|
1955
2001
|
size: {
|
|
@@ -1993,29 +2039,42 @@ const cardVariants = cva(
|
|
|
1993
2039
|
title: i,
|
|
1994
2040
|
subtitle: s,
|
|
1995
2041
|
badge: o,
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2042
|
+
actions: a,
|
|
2043
|
+
supplementaryInfo: l,
|
|
2044
|
+
bordered: u = !1,
|
|
2045
|
+
className: c,
|
|
2046
|
+
...f
|
|
2047
|
+
}, n) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
2001
2048
|
"button",
|
|
2002
2049
|
{
|
|
2003
|
-
ref:
|
|
2004
|
-
className: cn(cardVariants({ size: e, shape: t, bordered:
|
|
2005
|
-
...
|
|
2006
|
-
children:
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
o,
|
|
2015
|
-
typeof n == "string" ? /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "p", fontSize: "sm", color: "gray", children: n }) : n
|
|
2050
|
+
ref: n,
|
|
2051
|
+
className: cn(cardVariants({ size: e, shape: t, bordered: u }), c),
|
|
2052
|
+
...f,
|
|
2053
|
+
children: [
|
|
2054
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-4", children: [
|
|
2055
|
+
r && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-shrink-0", children: r }),
|
|
2056
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full", children: [
|
|
2057
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-2", children: [
|
|
2058
|
+
i && /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "h3", fontSize: "base", fontWeight: "semibold", children: i }),
|
|
2059
|
+
s && /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "p", fontSize: "sm", color: "gray", children: s })
|
|
2060
|
+
] }),
|
|
2061
|
+
o && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-start items-center", children: o })
|
|
2016
2062
|
] })
|
|
2017
|
-
] })
|
|
2018
|
-
|
|
2063
|
+
] }),
|
|
2064
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
2065
|
+
"div",
|
|
2066
|
+
{
|
|
2067
|
+
className: cn(
|
|
2068
|
+
"flex flex-col items-end gap-2",
|
|
2069
|
+
a ? "justify-between" : "justify-end"
|
|
2070
|
+
),
|
|
2071
|
+
children: [
|
|
2072
|
+
a && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: a }),
|
|
2073
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: typeof l == "string" ? /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "p", fontSize: "sm", color: "gray", children: l }) : l })
|
|
2074
|
+
]
|
|
2075
|
+
}
|
|
2076
|
+
)
|
|
2077
|
+
]
|
|
2019
2078
|
}
|
|
2020
2079
|
)
|
|
2021
2080
|
), Card = Object.assign(CardRoot, {
|
|
@@ -2066,7 +2125,7 @@ const cardVariants = cva(
|
|
|
2066
2125
|
size: i = "md",
|
|
2067
2126
|
disabled: s = !1,
|
|
2068
2127
|
children: o,
|
|
2069
|
-
...
|
|
2128
|
+
...a
|
|
2070
2129
|
}, l) {
|
|
2071
2130
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
2072
2131
|
"button",
|
|
@@ -2078,7 +2137,7 @@ const cardVariants = cva(
|
|
|
2078
2137
|
"aria-disabled": s,
|
|
2079
2138
|
"aria-label": `${o}, removable`,
|
|
2080
2139
|
inert: s ? !0 : void 0,
|
|
2081
|
-
...
|
|
2140
|
+
...a,
|
|
2082
2141
|
children: [
|
|
2083
2142
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex-shrink-0", children: o }),
|
|
2084
2143
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { as: XIcon, color: "inherit", size: i === "lg" ? "md" : "sm" })
|
|
@@ -2127,12 +2186,12 @@ const cardVariants = cva(
|
|
|
2127
2186
|
), noResultsHeaderVariants = cva(
|
|
2128
2187
|
"flex flex-row items-center gap-3 mb-2"
|
|
2129
2188
|
), NoResults = React__default.forwardRef(
|
|
2130
|
-
function e({ icon: t, title: r, subtitle: i, action: s, className: o, hasGrayBackground:
|
|
2189
|
+
function e({ icon: t, title: r, subtitle: i, action: s, className: o, hasGrayBackground: a, ...l }, u) {
|
|
2131
2190
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
2132
2191
|
"section",
|
|
2133
2192
|
{
|
|
2134
2193
|
ref: u,
|
|
2135
|
-
className: cn(noResultsVariants({ hasGrayBackground:
|
|
2194
|
+
className: cn(noResultsVariants({ hasGrayBackground: a }), o),
|
|
2136
2195
|
role: "status",
|
|
2137
2196
|
"aria-label": "No results found",
|
|
2138
2197
|
...l,
|
|
@@ -2280,13 +2339,13 @@ const getTableColumnClass = (e) => {
|
|
|
2280
2339
|
);
|
|
2281
2340
|
}
|
|
2282
2341
|
), TableColumn = forwardRef(
|
|
2283
|
-
({ as: e = "td", span: t, align: r = "left", children: i, className: s, ...o },
|
|
2342
|
+
({ as: e = "td", span: t, align: r = "left", children: i, className: s, ...o }, a) => {
|
|
2284
2343
|
const l = e === "th" ? "columnheader" : "cell";
|
|
2285
2344
|
let u = "text-left";
|
|
2286
2345
|
return r === "center" ? u = "text-center" : r === "right" && (u = "text-right"), /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2287
2346
|
"div",
|
|
2288
2347
|
{
|
|
2289
|
-
ref:
|
|
2348
|
+
ref: a,
|
|
2290
2349
|
role: l,
|
|
2291
2350
|
className: cn(
|
|
2292
2351
|
"px-4 py-2",
|
|
@@ -2398,7 +2457,7 @@ const getTableColumnClass = (e) => {
|
|
|
2398
2457
|
)
|
|
2399
2458
|
);
|
|
2400
2459
|
function useImage({ src: e }) {
|
|
2401
|
-
const [t, r] = useState(!1), [i, s] = useState(!1), o = useRef(!1),
|
|
2460
|
+
const [t, r] = useState(!1), [i, s] = useState(!1), o = useRef(!1), a = () => {
|
|
2402
2461
|
r(!0);
|
|
2403
2462
|
}, l = () => {
|
|
2404
2463
|
s(!0);
|
|
@@ -2416,7 +2475,7 @@ function useImage({ src: e }) {
|
|
|
2416
2475
|
}, [e]), {
|
|
2417
2476
|
loaded: t,
|
|
2418
2477
|
errored: i,
|
|
2419
|
-
handleLoad:
|
|
2478
|
+
handleLoad: a,
|
|
2420
2479
|
handleError: l
|
|
2421
2480
|
};
|
|
2422
2481
|
}
|
|
@@ -2495,12 +2554,12 @@ function BaseImageFallback({
|
|
|
2495
2554
|
className: i,
|
|
2496
2555
|
style: s,
|
|
2497
2556
|
shape: o,
|
|
2498
|
-
size:
|
|
2557
|
+
size: a
|
|
2499
2558
|
}) {
|
|
2500
2559
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
2501
2560
|
"div",
|
|
2502
2561
|
{
|
|
2503
|
-
className: imageAtomVariants({ shape: o, size:
|
|
2562
|
+
className: imageAtomVariants({ shape: o, size: a, className: i }),
|
|
2504
2563
|
style: { width: t, height: r, ...s },
|
|
2505
2564
|
"aria-label": e,
|
|
2506
2565
|
role: "img",
|
|
@@ -2526,24 +2585,24 @@ const BaseImage = forwardRef(
|
|
|
2526
2585
|
onError: i,
|
|
2527
2586
|
width: s,
|
|
2528
2587
|
height: o,
|
|
2529
|
-
loading:
|
|
2588
|
+
loading: a = "lazy",
|
|
2530
2589
|
position: l = "cover",
|
|
2531
2590
|
size: u = "auto",
|
|
2532
2591
|
shape: c,
|
|
2533
2592
|
className: f,
|
|
2534
|
-
...
|
|
2593
|
+
...n
|
|
2535
2594
|
}, d) => {
|
|
2536
|
-
const { loaded:
|
|
2595
|
+
const { loaded: h, errored: m, handleLoad: y, handleError: w } = useImage({
|
|
2537
2596
|
src: e
|
|
2538
2597
|
}), R = typeof s == "number" ? s : Number(s), E = typeof o == "number" ? o : Number(o);
|
|
2539
|
-
return !
|
|
2598
|
+
return !h && !m ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2540
2599
|
BaseImageSkeleton,
|
|
2541
2600
|
{
|
|
2542
2601
|
shape: c,
|
|
2543
2602
|
width: R,
|
|
2544
2603
|
height: E
|
|
2545
2604
|
}
|
|
2546
|
-
) :
|
|
2605
|
+
) : m ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2547
2606
|
BaseImageFallback,
|
|
2548
2607
|
{
|
|
2549
2608
|
shape: c,
|
|
@@ -2559,7 +2618,7 @@ const BaseImage = forwardRef(
|
|
|
2559
2618
|
alt: t,
|
|
2560
2619
|
width: R,
|
|
2561
2620
|
height: E,
|
|
2562
|
-
loading:
|
|
2621
|
+
loading: a,
|
|
2563
2622
|
className: cn(
|
|
2564
2623
|
imageVariants({
|
|
2565
2624
|
position: l,
|
|
@@ -2569,12 +2628,12 @@ const BaseImage = forwardRef(
|
|
|
2569
2628
|
f
|
|
2570
2629
|
),
|
|
2571
2630
|
onLoad: (C) => {
|
|
2572
|
-
|
|
2631
|
+
y(), r?.(C);
|
|
2573
2632
|
},
|
|
2574
2633
|
onError: (C) => {
|
|
2575
2634
|
w(), i?.(C);
|
|
2576
2635
|
},
|
|
2577
|
-
...
|
|
2636
|
+
...n
|
|
2578
2637
|
}
|
|
2579
2638
|
);
|
|
2580
2639
|
}
|
|
@@ -2597,15 +2656,16 @@ export {
|
|
|
2597
2656
|
Avatar as e,
|
|
2598
2657
|
Brand as f,
|
|
2599
2658
|
Button as g,
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2659
|
+
ButtonMenu as h,
|
|
2660
|
+
ButtonMenuIcon as i,
|
|
2661
|
+
ButtonFloat as j,
|
|
2662
|
+
ButtonIcon as k,
|
|
2663
|
+
Card as l,
|
|
2664
|
+
Hr as m,
|
|
2665
|
+
Text as n,
|
|
2666
|
+
Tile as o,
|
|
2667
|
+
ImageCircle as p,
|
|
2668
|
+
ImageSquare as q,
|
|
2669
|
+
ImageRectangle as r,
|
|
2670
|
+
BaseImage as s
|
|
2611
2671
|
};
|