@dimasbaguspm/versaur 0.0.36 → 0.0.38
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-CoR7hCZO.js → bottom-sheet-B9Knzg2N.js} +1 -1
- package/dist/js/{bottom-sheet-input-DzZ1xoOR.js → bottom-sheet-input-DnDTMRzo.js} +517 -476
- package/dist/js/forms/index.js +1 -1
- package/dist/js/{image-rectangle-B48Z5AzG.js → image-rectangle-C1ydvFGL.js} +311 -235
- 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-Cs-qKwI3.js → tabs-38zAflsT.js} +1 -1
- package/dist/js/{tooltip-D5V0M0cy.js → tooltip-CvOzRRkS.js} +1 -1
- package/dist/js/{top-bar-o8F7AMVL.js → top-bar-CKFu3xrL.js} +1 -1
- package/dist/types/forms/price-input/price-input.d.ts +4 -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:
|
|
150
|
-
clamp:
|
|
149
|
+
italic: l = !1,
|
|
150
|
+
clamp: a = "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:
|
|
169
|
-
clamp:
|
|
168
|
+
italic: l,
|
|
169
|
+
clamp: a,
|
|
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 }, l) {
|
|
213
213
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
214
214
|
t,
|
|
215
215
|
{
|
|
216
|
-
ref:
|
|
216
|
+
ref: l,
|
|
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:
|
|
265
|
-
children:
|
|
264
|
+
className: l,
|
|
265
|
+
children: a,
|
|
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
|
+
l,
|
|
282
282
|
o && "mb-4"
|
|
283
283
|
),
|
|
284
284
|
...u,
|
|
@@ -307,7 +307,7 @@ const iconVariants = cva("inline-flex items-center justify-center", {
|
|
|
307
307
|
"overflow-hidden transition-all duration-300",
|
|
308
308
|
f ? "max-h-screen opacity-100" : "max-h-0 opacity-0"
|
|
309
309
|
),
|
|
310
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 pt-2", children:
|
|
310
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 pt-2", children: a })
|
|
311
311
|
}
|
|
312
312
|
)
|
|
313
313
|
]
|
|
@@ -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
|
+
}, l) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
467
467
|
"div",
|
|
468
468
|
{
|
|
469
|
-
ref:
|
|
469
|
+
ref: l,
|
|
470
470
|
role: "alert",
|
|
471
471
|
className: cn(alertVariants({ variant: e, color: t }), i),
|
|
472
472
|
...o,
|
|
@@ -543,16 +543,16 @@ 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
|
-
...
|
|
547
|
-
},
|
|
546
|
+
...l
|
|
547
|
+
}, a) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
548
548
|
"a",
|
|
549
549
|
{
|
|
550
|
-
ref:
|
|
550
|
+
ref: a,
|
|
551
551
|
className: cn(
|
|
552
552
|
anchorVariants({ color: r, fontSize: i, fontWeight: s, quiet: o }),
|
|
553
553
|
t
|
|
554
554
|
),
|
|
555
|
-
...
|
|
555
|
+
...l,
|
|
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:
|
|
637
|
-
ellipsis:
|
|
636
|
+
clamp: l = "none",
|
|
637
|
+
ellipsis: a = !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:
|
|
667
|
-
ellipsis:
|
|
666
|
+
clamp: l,
|
|
667
|
+
ellipsis: a,
|
|
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 }, l) {
|
|
682
682
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
683
683
|
"div",
|
|
684
684
|
{
|
|
685
|
-
ref:
|
|
685
|
+
ref: l,
|
|
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 },
|
|
767
|
-
const
|
|
768
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("li", { ref:
|
|
766
|
+
const AttributeListItem = forwardRef(function({ children: t, className: r, span: i = 1, title: s, ...o }, l) {
|
|
767
|
+
const a = getColSpan(i);
|
|
768
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("li", { ref: l, className: cn(a, 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 l = 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", l, 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
|
+
}, l) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
831
831
|
"div",
|
|
832
832
|
{
|
|
833
|
-
ref:
|
|
833
|
+
ref: l,
|
|
834
834
|
className: cn(avatarVariants({ variant: e, size: t, shape: r }), i),
|
|
835
835
|
...o,
|
|
836
836
|
children: s
|
|
@@ -838,17 +838,17 @@ 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 [l, a] = useState(!1);
|
|
842
842
|
useEffect(() => {
|
|
843
|
-
|
|
843
|
+
a(!1);
|
|
844
844
|
}, [e]);
|
|
845
845
|
const u = useCallback(
|
|
846
846
|
(c) => {
|
|
847
|
-
|
|
847
|
+
a(!0), i?.(c);
|
|
848
848
|
},
|
|
849
849
|
[i]
|
|
850
850
|
);
|
|
851
|
-
return
|
|
851
|
+
return l ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
852
852
|
"img",
|
|
853
853
|
{
|
|
854
854
|
ref: o,
|
|
@@ -1026,11 +1026,11 @@ const AttributeListItem = forwardRef(function({ children: t, className: r, span:
|
|
|
1026
1026
|
size: i = "md",
|
|
1027
1027
|
iconLeft: s,
|
|
1028
1028
|
iconRight: o,
|
|
1029
|
-
className:
|
|
1030
|
-
children:
|
|
1029
|
+
className: l,
|
|
1030
|
+
children: a,
|
|
1031
1031
|
...u
|
|
1032
1032
|
}, c) => {
|
|
1033
|
-
const d = !(
|
|
1033
|
+
const d = !(a != null && a !== "") && !!(s || o);
|
|
1034
1034
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1035
1035
|
"span",
|
|
1036
1036
|
{
|
|
@@ -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
|
+
l
|
|
1047
1047
|
),
|
|
1048
1048
|
...u,
|
|
1049
1049
|
children: d ? (
|
|
@@ -1053,7 +1053,7 @@ const AttributeListItem = forwardRef(function({ children: t, className: r, span:
|
|
|
1053
1053
|
// Normal mode: display icon(s) and text
|
|
1054
1054
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
1055
1055
|
s,
|
|
1056
|
-
|
|
1056
|
+
a,
|
|
1057
1057
|
o
|
|
1058
1058
|
] })
|
|
1059
1059
|
)
|
|
@@ -1156,8 +1156,8 @@ 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:
|
|
1160
|
-
...
|
|
1159
|
+
children: l,
|
|
1160
|
+
...a
|
|
1161
1161
|
}, u) {
|
|
1162
1162
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1163
1163
|
"button",
|
|
@@ -1168,8 +1168,8 @@ const AttributeListItem = forwardRef(function({ children: t, className: r, span:
|
|
|
1168
1168
|
disabled: s,
|
|
1169
1169
|
"aria-disabled": s,
|
|
1170
1170
|
inert: s ? !0 : void 0,
|
|
1171
|
-
...
|
|
1172
|
-
children:
|
|
1171
|
+
...a,
|
|
1172
|
+
children: l
|
|
1173
1173
|
}
|
|
1174
1174
|
);
|
|
1175
1175
|
}
|
|
@@ -1231,33 +1231,33 @@ 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, l] = useState({ isReady: !1 }), a = useCallback(() => {
|
|
1235
1235
|
if (!e || !t.current) {
|
|
1236
|
-
|
|
1236
|
+
l({ isReady: !1 });
|
|
1237
1237
|
return;
|
|
1238
1238
|
}
|
|
1239
1239
|
if (!r.current) {
|
|
1240
|
-
const
|
|
1241
|
-
|
|
1240
|
+
const v = setTimeout(() => {
|
|
1241
|
+
l({ 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
|
+
l({ 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 N = w.bottom -
|
|
1257
|
+
const N = w.bottom - n.bottom - 8, I = 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
1263
|
fits: N >= x.height && V >= x.width,
|
|
@@ -1267,7 +1267,7 @@ function useMenuPosition(e, t, r, i = "bottom-start", s) {
|
|
|
1267
1267
|
},
|
|
1268
1268
|
{
|
|
1269
1269
|
name: "bottom-end",
|
|
1270
|
-
fits: N >= x.height &&
|
|
1270
|
+
fits: N >= x.height && B >= x.width,
|
|
1271
1271
|
spaceUsed: N,
|
|
1272
1272
|
priority: 2
|
|
1273
1273
|
},
|
|
@@ -1279,114 +1279,114 @@ function useMenuPosition(e, t, r, i = "bottom-start", s) {
|
|
|
1279
1279
|
},
|
|
1280
1280
|
{
|
|
1281
1281
|
name: "top-end",
|
|
1282
|
-
fits: I >= x.height &&
|
|
1282
|
+
fits: I >= x.height && B >= x.width,
|
|
1283
1283
|
spaceUsed: I,
|
|
1284
1284
|
priority: 4
|
|
1285
1285
|
}
|
|
1286
|
-
].filter((
|
|
1287
|
-
|
|
1288
|
-
(
|
|
1289
|
-
)[0].name : N >= I ? p = V >=
|
|
1286
|
+
].filter((j) => j.fits);
|
|
1287
|
+
b.length > 0 ? p = b.sort(
|
|
1288
|
+
(j, k) => j.priority - k.priority
|
|
1289
|
+
)[0].name : N >= I ? 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, l(g);
|
|
1370
1370
|
}, [e, i, t, r, s]);
|
|
1371
1371
|
return useEffect(() => {
|
|
1372
|
-
|
|
1373
|
-
}, [
|
|
1372
|
+
a();
|
|
1373
|
+
}, [a]), useEffect(() => {
|
|
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
|
+
a(), 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
|
-
}, [e,
|
|
1389
|
+
}, [e, a, t]), o;
|
|
1390
1390
|
}
|
|
1391
1391
|
const MenuContext = createContext(void 0), MenuProvider = MenuContext.Provider, useMenuProvider = () => {
|
|
1392
1392
|
const e = useContext(MenuContext);
|
|
@@ -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: l, onClose: a } = useMenuProvider(), u = (c) => {
|
|
1401
|
+
r?.(c), l || a();
|
|
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
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,38 +1429,38 @@ const MenuContext = createContext(void 0), MenuProvider = MenuContext.Provider,
|
|
|
1418
1429
|
content: i,
|
|
1419
1430
|
children: s,
|
|
1420
1431
|
placement: o = "auto",
|
|
1421
|
-
container:
|
|
1422
|
-
preserve:
|
|
1432
|
+
container: l,
|
|
1433
|
+
preserve: a
|
|
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
|
+
l || 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
|
);
|
|
1449
1460
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1450
1461
|
MenuProvider,
|
|
1451
1462
|
{
|
|
1452
|
-
value: { onClose: t, preserve: !!
|
|
1463
|
+
value: { onClose: t, preserve: !!a },
|
|
1453
1464
|
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative w-fit", children: [
|
|
1454
1465
|
cloneElement(s, {
|
|
1455
1466
|
// @ts-expect-error: ref is valid for button or forwardRef components
|
|
@@ -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: l,
|
|
1505
|
+
preserve: a,
|
|
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: l,
|
|
1524
|
+
preserve: a,
|
|
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,8 +1625,8 @@ const buttonIconVariants = cva(
|
|
|
1579
1625
|
size: i = "md",
|
|
1580
1626
|
shape: s = "rounded",
|
|
1581
1627
|
disabled: o = !1,
|
|
1582
|
-
as:
|
|
1583
|
-
"aria-label":
|
|
1628
|
+
as: l,
|
|
1629
|
+
"aria-label": a,
|
|
1584
1630
|
...u
|
|
1585
1631
|
}, c) {
|
|
1586
1632
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -1598,13 +1644,13 @@ const buttonIconVariants = cva(
|
|
|
1598
1644
|
),
|
|
1599
1645
|
disabled: o,
|
|
1600
1646
|
"aria-disabled": o,
|
|
1601
|
-
"aria-label":
|
|
1647
|
+
"aria-label": a,
|
|
1602
1648
|
inert: o ? !0 : void 0,
|
|
1603
1649
|
...u,
|
|
1604
1650
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1605
1651
|
Icon,
|
|
1606
1652
|
{
|
|
1607
|
-
as:
|
|
1653
|
+
as: l,
|
|
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:
|
|
1623
|
-
container:
|
|
1668
|
+
placement: l,
|
|
1669
|
+
container: a,
|
|
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:
|
|
1641
|
-
container:
|
|
1686
|
+
placement: l,
|
|
1687
|
+
container: a,
|
|
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,35 +1761,35 @@ 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, l] = useState("fixed bottom-4 right-4"), a = 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), l(h);
|
|
1733
1779
|
}, [e, t]);
|
|
1734
1780
|
return useEffect(() => {
|
|
1735
|
-
|
|
1781
|
+
a();
|
|
1736
1782
|
const c = r.current;
|
|
1737
|
-
return c && c.addEventListener("scroll",
|
|
1738
|
-
c && c.removeEventListener("scroll",
|
|
1783
|
+
return c && c.addEventListener("scroll", a), window.addEventListener("resize", a), () => {
|
|
1784
|
+
c && c.removeEventListener("scroll", a), window.removeEventListener("resize", a);
|
|
1739
1785
|
};
|
|
1740
|
-
}, [
|
|
1741
|
-
r.current &&
|
|
1742
|
-
}, [e, t,
|
|
1786
|
+
}, [a]), useEffect(() => {
|
|
1787
|
+
r.current && a();
|
|
1788
|
+
}, [e, t, a]), [useCallback(
|
|
1743
1789
|
(c) => {
|
|
1744
|
-
r.current = c, c &&
|
|
1790
|
+
r.current = c, c && a();
|
|
1745
1791
|
},
|
|
1746
|
-
[
|
|
1792
|
+
[a]
|
|
1747
1793
|
), i, o];
|
|
1748
1794
|
}
|
|
1749
1795
|
const ButtonFloat = forwardRef(
|
|
@@ -1753,27 +1799,27 @@ const ButtonFloat = forwardRef(
|
|
|
1753
1799
|
size: i = "md",
|
|
1754
1800
|
side: s = "right",
|
|
1755
1801
|
offset: o = "1rem",
|
|
1756
|
-
...
|
|
1757
|
-
},
|
|
1802
|
+
...l
|
|
1803
|
+
}, a) {
|
|
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
|
-
ref:
|
|
1768
|
-
type:
|
|
1813
|
+
ref: a,
|
|
1814
|
+
type: l.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
|
+
...l
|
|
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: l, inputRef: a, handleButton: u, handleInput: c } = useCalculator({
|
|
1899
1945
|
initialValue: e,
|
|
1900
1946
|
disabled: r,
|
|
1901
1947
|
onChange: t
|
|
@@ -1911,16 +1957,16 @@ const BUTTONS = [
|
|
|
1911
1957
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1912
1958
|
"input",
|
|
1913
1959
|
{
|
|
1914
|
-
ref:
|
|
1960
|
+
ref: a,
|
|
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: l,
|
|
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: {
|
|
@@ -1975,14 +2021,21 @@ const cardVariants = cva(
|
|
|
1975
2021
|
}
|
|
1976
2022
|
}
|
|
1977
2023
|
), CardList = forwardRef(
|
|
1978
|
-
({ children: e }, t) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2024
|
+
({ children: e }, t) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2025
|
+
"ul",
|
|
2026
|
+
{
|
|
2027
|
+
ref: t,
|
|
2028
|
+
className: "flex items-center min-w-0 overflow-hidden w-full",
|
|
2029
|
+
children: e
|
|
2030
|
+
}
|
|
2031
|
+
)
|
|
1979
2032
|
), CardListItem = forwardRef(
|
|
1980
2033
|
({ children: e }, t) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1981
2034
|
"li",
|
|
1982
2035
|
{
|
|
1983
2036
|
ref: t,
|
|
1984
|
-
className: "flex items-center after:content-[''] after:inline-block after:mx-2 after:w-1 after:h-1 after:rounded-full after:bg-ghost last:after:hidden",
|
|
1985
|
-
children: e
|
|
2037
|
+
className: "flex items-center min-w-0 flex-shrink after:content-[''] after:inline-block after:mx-2 after:w-1 after:h-1 after:rounded-full after:bg-ghost last:after:hidden after:flex-shrink-0",
|
|
2038
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate min-w-0", children: e })
|
|
1986
2039
|
}
|
|
1987
2040
|
)
|
|
1988
2041
|
), CardRoot = forwardRef(
|
|
@@ -1993,26 +2046,48 @@ const cardVariants = cva(
|
|
|
1993
2046
|
title: i,
|
|
1994
2047
|
subtitle: s,
|
|
1995
2048
|
badge: o,
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2049
|
+
actions: l,
|
|
2050
|
+
supplementaryInfo: a,
|
|
2051
|
+
bordered: u = !1,
|
|
2052
|
+
className: c,
|
|
2053
|
+
...f
|
|
2054
|
+
}, n) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2001
2055
|
"button",
|
|
2002
2056
|
{
|
|
2003
|
-
ref:
|
|
2004
|
-
className: cn(cardVariants({ size: e, shape: t, bordered:
|
|
2005
|
-
...
|
|
2006
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-4", children: [
|
|
2057
|
+
ref: n,
|
|
2058
|
+
className: cn(cardVariants({ size: e, shape: t, bordered: u }), c),
|
|
2059
|
+
...f,
|
|
2060
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-4 w-full", children: [
|
|
2007
2061
|
r && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-shrink-0", children: r }),
|
|
2008
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full", children: [
|
|
2062
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full min-w-0", children: [
|
|
2009
2063
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-2", children: [
|
|
2010
|
-
|
|
2011
|
-
|
|
2064
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between", children: [
|
|
2065
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2066
|
+
Text,
|
|
2067
|
+
{
|
|
2068
|
+
as: "h3",
|
|
2069
|
+
fontSize: "base",
|
|
2070
|
+
fontWeight: "semibold",
|
|
2071
|
+
className: "truncate",
|
|
2072
|
+
children: i
|
|
2073
|
+
}
|
|
2074
|
+
),
|
|
2075
|
+
l && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: l })
|
|
2076
|
+
] }),
|
|
2077
|
+
s && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: cn(l && "-mt-3"), children: typeof s == "string" ? /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "p", fontSize: "sm", color: "gray", children: s }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-w-0 overflow-hidden", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2078
|
+
Text,
|
|
2079
|
+
{
|
|
2080
|
+
as: "p",
|
|
2081
|
+
fontSize: "sm",
|
|
2082
|
+
color: "gray",
|
|
2083
|
+
className: "min-w-0",
|
|
2084
|
+
children: s
|
|
2085
|
+
}
|
|
2086
|
+
) }) })
|
|
2012
2087
|
] }),
|
|
2013
|
-
|
|
2014
|
-
o,
|
|
2015
|
-
typeof
|
|
2088
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center gap-2", children: [
|
|
2089
|
+
o && o,
|
|
2090
|
+
a && typeof a == "string" ? /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "p", fontSize: "sm", color: "gray", children: a }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: a })
|
|
2016
2091
|
] })
|
|
2017
2092
|
] })
|
|
2018
2093
|
] })
|
|
@@ -2066,19 +2141,19 @@ const cardVariants = cva(
|
|
|
2066
2141
|
size: i = "md",
|
|
2067
2142
|
disabled: s = !1,
|
|
2068
2143
|
children: o,
|
|
2069
|
-
...
|
|
2070
|
-
},
|
|
2144
|
+
...l
|
|
2145
|
+
}, a) {
|
|
2071
2146
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
2072
2147
|
"button",
|
|
2073
2148
|
{
|
|
2074
|
-
ref:
|
|
2149
|
+
ref: a,
|
|
2075
2150
|
type: "button",
|
|
2076
2151
|
className: cn(filterChipVariants({ variant: r, size: i }), t),
|
|
2077
2152
|
disabled: s,
|
|
2078
2153
|
"aria-disabled": s,
|
|
2079
2154
|
"aria-label": `${o}, removable`,
|
|
2080
2155
|
inert: s ? !0 : void 0,
|
|
2081
|
-
...
|
|
2156
|
+
...l,
|
|
2082
2157
|
children: [
|
|
2083
2158
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex-shrink-0", children: o }),
|
|
2084
2159
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { as: XIcon, color: "inherit", size: i === "lg" ? "md" : "sm" })
|
|
@@ -2127,15 +2202,15 @@ const cardVariants = cva(
|
|
|
2127
2202
|
), noResultsHeaderVariants = cva(
|
|
2128
2203
|
"flex flex-row items-center gap-3 mb-2"
|
|
2129
2204
|
), NoResults = React__default.forwardRef(
|
|
2130
|
-
function e({ icon: t, title: r, subtitle: i, action: s, className: o, hasGrayBackground:
|
|
2205
|
+
function e({ icon: t, title: r, subtitle: i, action: s, className: o, hasGrayBackground: l, ...a }, u) {
|
|
2131
2206
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
2132
2207
|
"section",
|
|
2133
2208
|
{
|
|
2134
2209
|
ref: u,
|
|
2135
|
-
className: cn(noResultsVariants({ hasGrayBackground:
|
|
2210
|
+
className: cn(noResultsVariants({ hasGrayBackground: l }), o),
|
|
2136
2211
|
role: "status",
|
|
2137
2212
|
"aria-label": "No results found",
|
|
2138
|
-
...
|
|
2213
|
+
...a,
|
|
2139
2214
|
children: [
|
|
2140
2215
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("header", { className: noResultsHeaderVariants(), children: [
|
|
2141
2216
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { as: t, size: "lg", color: "ghost", "aria-hidden": "true" }),
|
|
@@ -2280,14 +2355,14 @@ const getTableColumnClass = (e) => {
|
|
|
2280
2355
|
);
|
|
2281
2356
|
}
|
|
2282
2357
|
), TableColumn = forwardRef(
|
|
2283
|
-
({ as: e = "td", span: t, align: r = "left", children: i, className: s, ...o },
|
|
2284
|
-
const
|
|
2358
|
+
({ as: e = "td", span: t, align: r = "left", children: i, className: s, ...o }, l) => {
|
|
2359
|
+
const a = e === "th" ? "columnheader" : "cell";
|
|
2285
2360
|
let u = "text-left";
|
|
2286
2361
|
return r === "center" ? u = "text-center" : r === "right" && (u = "text-right"), /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2287
2362
|
"div",
|
|
2288
2363
|
{
|
|
2289
|
-
ref:
|
|
2290
|
-
role:
|
|
2364
|
+
ref: l,
|
|
2365
|
+
role: a,
|
|
2291
2366
|
className: cn(
|
|
2292
2367
|
"px-4 py-2",
|
|
2293
2368
|
"[&:not(:last-child)]:border-r [&:not(:last-child)]:border-border",
|
|
@@ -2398,9 +2473,9 @@ const getTableColumnClass = (e) => {
|
|
|
2398
2473
|
)
|
|
2399
2474
|
);
|
|
2400
2475
|
function useImage({ src: e }) {
|
|
2401
|
-
const [t, r] = useState(!1), [i, s] = useState(!1), o = useRef(!1),
|
|
2476
|
+
const [t, r] = useState(!1), [i, s] = useState(!1), o = useRef(!1), l = () => {
|
|
2402
2477
|
r(!0);
|
|
2403
|
-
},
|
|
2478
|
+
}, a = () => {
|
|
2404
2479
|
s(!0);
|
|
2405
2480
|
};
|
|
2406
2481
|
return useEffect(() => {
|
|
@@ -2416,8 +2491,8 @@ function useImage({ src: e }) {
|
|
|
2416
2491
|
}, [e]), {
|
|
2417
2492
|
loaded: t,
|
|
2418
2493
|
errored: i,
|
|
2419
|
-
handleLoad:
|
|
2420
|
-
handleError:
|
|
2494
|
+
handleLoad: l,
|
|
2495
|
+
handleError: a
|
|
2421
2496
|
};
|
|
2422
2497
|
}
|
|
2423
2498
|
const imageVariants = cva("block object-cover", {
|
|
@@ -2495,12 +2570,12 @@ function BaseImageFallback({
|
|
|
2495
2570
|
className: i,
|
|
2496
2571
|
style: s,
|
|
2497
2572
|
shape: o,
|
|
2498
|
-
size:
|
|
2573
|
+
size: l
|
|
2499
2574
|
}) {
|
|
2500
2575
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
2501
2576
|
"div",
|
|
2502
2577
|
{
|
|
2503
|
-
className: imageAtomVariants({ shape: o, size:
|
|
2578
|
+
className: imageAtomVariants({ shape: o, size: l, className: i }),
|
|
2504
2579
|
style: { width: t, height: r, ...s },
|
|
2505
2580
|
"aria-label": e,
|
|
2506
2581
|
role: "img",
|
|
@@ -2526,24 +2601,24 @@ const BaseImage = forwardRef(
|
|
|
2526
2601
|
onError: i,
|
|
2527
2602
|
width: s,
|
|
2528
2603
|
height: o,
|
|
2529
|
-
loading:
|
|
2530
|
-
position:
|
|
2604
|
+
loading: l = "lazy",
|
|
2605
|
+
position: a = "cover",
|
|
2531
2606
|
size: u = "auto",
|
|
2532
2607
|
shape: c,
|
|
2533
2608
|
className: f,
|
|
2534
|
-
...
|
|
2609
|
+
...n
|
|
2535
2610
|
}, d) => {
|
|
2536
|
-
const { loaded:
|
|
2611
|
+
const { loaded: h, errored: m, handleLoad: y, handleError: w } = useImage({
|
|
2537
2612
|
src: e
|
|
2538
2613
|
}), R = typeof s == "number" ? s : Number(s), E = typeof o == "number" ? o : Number(o);
|
|
2539
|
-
return !
|
|
2614
|
+
return !h && !m ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2540
2615
|
BaseImageSkeleton,
|
|
2541
2616
|
{
|
|
2542
2617
|
shape: c,
|
|
2543
2618
|
width: R,
|
|
2544
2619
|
height: E
|
|
2545
2620
|
}
|
|
2546
|
-
) :
|
|
2621
|
+
) : m ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2547
2622
|
BaseImageFallback,
|
|
2548
2623
|
{
|
|
2549
2624
|
shape: c,
|
|
@@ -2559,22 +2634,22 @@ const BaseImage = forwardRef(
|
|
|
2559
2634
|
alt: t,
|
|
2560
2635
|
width: R,
|
|
2561
2636
|
height: E,
|
|
2562
|
-
loading:
|
|
2637
|
+
loading: l,
|
|
2563
2638
|
className: cn(
|
|
2564
2639
|
imageVariants({
|
|
2565
|
-
position:
|
|
2640
|
+
position: a,
|
|
2566
2641
|
size: u,
|
|
2567
2642
|
shape: c
|
|
2568
2643
|
}),
|
|
2569
2644
|
f
|
|
2570
2645
|
),
|
|
2571
2646
|
onLoad: (C) => {
|
|
2572
|
-
|
|
2647
|
+
y(), r?.(C);
|
|
2573
2648
|
},
|
|
2574
2649
|
onError: (C) => {
|
|
2575
2650
|
w(), i?.(C);
|
|
2576
2651
|
},
|
|
2577
|
-
...
|
|
2652
|
+
...n
|
|
2578
2653
|
}
|
|
2579
2654
|
);
|
|
2580
2655
|
}
|
|
@@ -2597,15 +2672,16 @@ export {
|
|
|
2597
2672
|
Avatar as e,
|
|
2598
2673
|
Brand as f,
|
|
2599
2674
|
Button as g,
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2675
|
+
ButtonMenu as h,
|
|
2676
|
+
ButtonMenuIcon as i,
|
|
2677
|
+
ButtonFloat as j,
|
|
2678
|
+
ButtonIcon as k,
|
|
2679
|
+
Card as l,
|
|
2680
|
+
Hr as m,
|
|
2681
|
+
Text as n,
|
|
2682
|
+
Tile as o,
|
|
2683
|
+
ImageCircle as p,
|
|
2684
|
+
ImageSquare as q,
|
|
2685
|
+
ImageRectangle as r,
|
|
2686
|
+
BaseImage as s
|
|
2611
2687
|
};
|