@dimasbaguspm/versaur 0.0.26 → 0.0.28
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-input-1C3Up2xF.js → bottom-sheet-input-BIbHW5ME.js} +255 -244
- package/dist/js/{bottom-sheet-CQw_O-4W.js → bottom-sheet-tOKkkgJA.js} +169 -153
- package/dist/js/forms/index.js +1 -1
- package/dist/js/{image-rectangle--Sy82Ff9.js → image-rectangle-C1zMt0DR.js} +319 -199
- package/dist/js/index.js +68 -64
- package/dist/js/layouts/index.js +8 -6
- package/dist/js/navigation/index.js +1 -1
- package/dist/js/overlays/index.js +2 -2
- package/dist/js/primitive/index.js +17 -15
- package/dist/js/{tabs-CoNG51E1.js → tabs-CtPlBMP4.js} +1 -1
- package/dist/js/{tooltip-BbTHXz6h.js → tooltip-C_riAXZP.js} +16 -16
- package/dist/js/top-bar-BqLv8_hy.js +731 -0
- package/dist/types/forms/drawer-input/types.d.ts +1 -1
- package/dist/types/layouts/badge-group/badge-group.d.ts +27 -0
- package/dist/types/layouts/badge-group/index.d.ts +2 -0
- package/dist/types/layouts/badge-group/types.d.ts +32 -0
- package/dist/types/layouts/filter-chip-group/filter-chip-group.d.ts +27 -0
- package/dist/types/layouts/filter-chip-group/index.d.ts +2 -0
- package/dist/types/layouts/filter-chip-group/types.d.ts +32 -0
- package/dist/types/layouts/index.d.ts +2 -0
- package/dist/types/overlays/bottom-sheet/types.d.ts +4 -0
- package/dist/types/overlays/drawer/types.d.ts +5 -13
- package/dist/types/overlays/modal/types.d.ts +14 -4
- package/dist/types/primitive/card/card.d.ts +24 -0
- package/dist/types/primitive/card/index.d.ts +2 -0
- package/dist/types/primitive/card/types.d.ts +39 -0
- package/dist/types/primitive/filter-chip/filter-chip.d.ts +3 -0
- package/dist/types/primitive/filter-chip/index.d.ts +2 -0
- package/dist/types/primitive/filter-chip/types.d.ts +35 -0
- package/dist/types/primitive/index.d.ts +2 -0
- package/dist/utils/enforce-subpath-import.js +4 -0
- package/package.json +1 -1
- package/dist/js/top-bar-BjE0FiE8.js +0 -607
|
@@ -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, { forwardRef, useState, useEffect, useCallback, useRef, createContext, useContext } from "react";
|
|
4
|
-
import { X, ChevronLeft, ChevronRight, ImageOff } from "lucide-react";
|
|
4
|
+
import { X, ChevronLeft, ChevronRight, 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",
|
|
@@ -146,18 +146,18 @@ const alertVariants = cva(
|
|
|
146
146
|
color: t = "neutral",
|
|
147
147
|
icon: r,
|
|
148
148
|
className: s,
|
|
149
|
-
children:
|
|
150
|
-
...
|
|
151
|
-
},
|
|
149
|
+
children: i,
|
|
150
|
+
...n
|
|
151
|
+
}, o) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
152
152
|
"div",
|
|
153
153
|
{
|
|
154
|
-
ref:
|
|
154
|
+
ref: o,
|
|
155
155
|
role: "alert",
|
|
156
156
|
className: cn(alertVariants({ variant: e, color: t }), s),
|
|
157
|
-
...
|
|
157
|
+
...n,
|
|
158
158
|
children: [
|
|
159
159
|
r && /* @__PURE__ */ jsxRuntimeExports.jsx(AlertIcon, { children: r }),
|
|
160
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1", children:
|
|
160
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1", children: i })
|
|
161
161
|
]
|
|
162
162
|
}
|
|
163
163
|
)
|
|
@@ -226,18 +226,18 @@ const alertVariants = cva(
|
|
|
226
226
|
className: t,
|
|
227
227
|
color: r = "primary",
|
|
228
228
|
fontSize: s = "base",
|
|
229
|
-
fontWeight:
|
|
230
|
-
quiet:
|
|
231
|
-
...
|
|
229
|
+
fontWeight: i = "medium",
|
|
230
|
+
quiet: n = !1,
|
|
231
|
+
...o
|
|
232
232
|
}, a) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
233
233
|
"a",
|
|
234
234
|
{
|
|
235
235
|
ref: a,
|
|
236
236
|
className: cn(
|
|
237
|
-
anchorVariants({ color: r, fontSize: s, fontWeight:
|
|
237
|
+
anchorVariants({ color: r, fontSize: s, fontWeight: i, quiet: n }),
|
|
238
238
|
t
|
|
239
239
|
),
|
|
240
|
-
...
|
|
240
|
+
...o,
|
|
241
241
|
children: e
|
|
242
242
|
}
|
|
243
243
|
)
|
|
@@ -285,20 +285,20 @@ const alertVariants = cva(
|
|
|
285
285
|
size: t = "md",
|
|
286
286
|
shape: r = "circle",
|
|
287
287
|
className: s,
|
|
288
|
-
children:
|
|
289
|
-
...
|
|
290
|
-
},
|
|
288
|
+
children: i,
|
|
289
|
+
...n
|
|
290
|
+
}, o) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
291
291
|
"div",
|
|
292
292
|
{
|
|
293
|
-
ref:
|
|
293
|
+
ref: o,
|
|
294
294
|
className: cn(avatarVariants({ variant: e, size: t, shape: r }), s),
|
|
295
|
-
...
|
|
296
|
-
children:
|
|
295
|
+
...n,
|
|
296
|
+
children: i
|
|
297
297
|
}
|
|
298
298
|
)
|
|
299
299
|
), AvatarImage = forwardRef(
|
|
300
|
-
({ src: e, alt: t, className: r, onError: s, ...
|
|
301
|
-
const [
|
|
300
|
+
({ src: e, alt: t, className: r, onError: s, ...i }, n) => {
|
|
301
|
+
const [o, a] = useState(!1);
|
|
302
302
|
useEffect(() => {
|
|
303
303
|
a(!1);
|
|
304
304
|
}, [e]);
|
|
@@ -308,15 +308,15 @@ const alertVariants = cva(
|
|
|
308
308
|
},
|
|
309
309
|
[s]
|
|
310
310
|
);
|
|
311
|
-
return
|
|
311
|
+
return o ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
312
312
|
"img",
|
|
313
313
|
{
|
|
314
|
-
ref:
|
|
314
|
+
ref: n,
|
|
315
315
|
src: e,
|
|
316
316
|
alt: t,
|
|
317
317
|
className: cn(avatarImageVariants(), r),
|
|
318
318
|
onError: l,
|
|
319
|
-
...
|
|
319
|
+
...i
|
|
320
320
|
}
|
|
321
321
|
);
|
|
322
322
|
}
|
|
@@ -484,13 +484,13 @@ const alertVariants = cva(
|
|
|
484
484
|
shape: t = "square",
|
|
485
485
|
color: r = "primary",
|
|
486
486
|
size: s = "md",
|
|
487
|
-
iconLeft:
|
|
488
|
-
iconRight:
|
|
489
|
-
className:
|
|
487
|
+
iconLeft: i,
|
|
488
|
+
iconRight: n,
|
|
489
|
+
className: o,
|
|
490
490
|
children: a,
|
|
491
491
|
...l
|
|
492
492
|
}, c) => {
|
|
493
|
-
const d = !(a != null && a !== "") && !!(
|
|
493
|
+
const d = !(a != null && a !== "") && !!(i || n);
|
|
494
494
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
495
495
|
"span",
|
|
496
496
|
{
|
|
@@ -503,18 +503,18 @@ const alertVariants = cva(
|
|
|
503
503
|
size: s,
|
|
504
504
|
iconOnly: d
|
|
505
505
|
}),
|
|
506
|
-
|
|
506
|
+
o
|
|
507
507
|
),
|
|
508
508
|
...l,
|
|
509
509
|
children: d ? (
|
|
510
510
|
// Icon-only mode: display only the icon
|
|
511
|
-
|
|
511
|
+
i || n
|
|
512
512
|
) : (
|
|
513
513
|
// Normal mode: display icon(s) and text
|
|
514
514
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
515
|
-
|
|
515
|
+
i,
|
|
516
516
|
a,
|
|
517
|
-
|
|
517
|
+
n
|
|
518
518
|
] })
|
|
519
519
|
)
|
|
520
520
|
}
|
|
@@ -537,13 +537,13 @@ const SvgSpenicleSquare = (e) => /* @__PURE__ */ React.createElement("svg", { wi
|
|
|
537
537
|
}
|
|
538
538
|
}), BrandLogo = forwardRef(
|
|
539
539
|
({ shape: e = "square", size: t, ...r }, s) => {
|
|
540
|
-
const
|
|
540
|
+
const n = {
|
|
541
541
|
square: SvgSpenicleSquare,
|
|
542
542
|
rounded: SvgSpenicleRounded,
|
|
543
543
|
circle: SvgSpenicleCircle
|
|
544
544
|
}[e] || SvgSpenicleSquare;
|
|
545
545
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
546
|
-
|
|
546
|
+
n,
|
|
547
547
|
{
|
|
548
548
|
ref: s,
|
|
549
549
|
...r,
|
|
@@ -552,10 +552,10 @@ const SvgSpenicleSquare = (e) => /* @__PURE__ */ React.createElement("svg", { wi
|
|
|
552
552
|
);
|
|
553
553
|
}
|
|
554
554
|
), Brand = forwardRef(
|
|
555
|
-
({ name: e = "spenicle", size: t = "md", shape: r, ...s },
|
|
555
|
+
({ name: e = "spenicle", size: t = "md", shape: r, ...s }, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
556
556
|
"span",
|
|
557
557
|
{
|
|
558
|
-
ref:
|
|
558
|
+
ref: i,
|
|
559
559
|
className: cn("inline-flex items-center gap-2"),
|
|
560
560
|
...s,
|
|
561
561
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(BrandLogo, { shape: r, size: t, "aria-hidden": "true" })
|
|
@@ -616,22 +616,22 @@ const SvgSpenicleSquare = (e) => /* @__PURE__ */ React.createElement("svg", { wi
|
|
|
616
616
|
className: t,
|
|
617
617
|
variant: r = "primary",
|
|
618
618
|
size: s = "md",
|
|
619
|
-
disabled:
|
|
620
|
-
type:
|
|
621
|
-
children:
|
|
619
|
+
disabled: i = !1,
|
|
620
|
+
type: n = "button",
|
|
621
|
+
children: o,
|
|
622
622
|
...a
|
|
623
623
|
}, l) {
|
|
624
624
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
625
625
|
"button",
|
|
626
626
|
{
|
|
627
627
|
ref: l,
|
|
628
|
-
type:
|
|
628
|
+
type: n,
|
|
629
629
|
className: cn(buttonVariants({ variant: r, size: s }), t),
|
|
630
|
-
disabled:
|
|
631
|
-
"aria-disabled":
|
|
632
|
-
inert:
|
|
630
|
+
disabled: i,
|
|
631
|
+
"aria-disabled": i,
|
|
632
|
+
inert: i ? !0 : void 0,
|
|
633
633
|
...a,
|
|
634
|
-
children:
|
|
634
|
+
children: o
|
|
635
635
|
}
|
|
636
636
|
);
|
|
637
637
|
}
|
|
@@ -703,7 +703,7 @@ const SvgSpenicleSquare = (e) => /* @__PURE__ */ React.createElement("svg", { wi
|
|
|
703
703
|
}
|
|
704
704
|
);
|
|
705
705
|
function useFloatingPosition(e, t = "1rem") {
|
|
706
|
-
const r = useRef(null), [s,
|
|
706
|
+
const r = useRef(null), [s, i] = useState({}), [n, o] = useState("fixed bottom-4 right-4"), a = useCallback(() => {
|
|
707
707
|
const c = r.current;
|
|
708
708
|
if (!c) return;
|
|
709
709
|
const h = c.getBoundingClientRect().height > window.innerHeight;
|
|
@@ -717,7 +717,7 @@ function useFloatingPosition(e, t = "1rem") {
|
|
|
717
717
|
position: "fixed",
|
|
718
718
|
bottom: t,
|
|
719
719
|
zIndex: 50
|
|
720
|
-
}, p = `fixed bottom-4 ${e}-4`),
|
|
720
|
+
}, p = `fixed bottom-4 ${e}-4`), i(d), o(p);
|
|
721
721
|
}, [e, t]);
|
|
722
722
|
return useEffect(() => {
|
|
723
723
|
a();
|
|
@@ -732,20 +732,20 @@ function useFloatingPosition(e, t = "1rem") {
|
|
|
732
732
|
r.current = c, c && a();
|
|
733
733
|
},
|
|
734
734
|
[a]
|
|
735
|
-
), s,
|
|
735
|
+
), s, n];
|
|
736
736
|
}
|
|
737
737
|
const ButtonFloat = forwardRef(
|
|
738
738
|
function({
|
|
739
739
|
className: t,
|
|
740
740
|
variant: r = "primary",
|
|
741
741
|
size: s = "md",
|
|
742
|
-
side:
|
|
743
|
-
offset:
|
|
744
|
-
...
|
|
742
|
+
side: i = "right",
|
|
743
|
+
offset: n = "1rem",
|
|
744
|
+
...o
|
|
745
745
|
}, a) {
|
|
746
746
|
const [l, c, x] = useFloatingPosition(
|
|
747
|
-
|
|
748
|
-
|
|
747
|
+
i,
|
|
748
|
+
n
|
|
749
749
|
), [h, d] = useState(!1);
|
|
750
750
|
return useEffect(() => {
|
|
751
751
|
d(!0);
|
|
@@ -753,7 +753,7 @@ const ButtonFloat = forwardRef(
|
|
|
753
753
|
"button",
|
|
754
754
|
{
|
|
755
755
|
ref: a,
|
|
756
|
-
type:
|
|
756
|
+
type: o.type || "button",
|
|
757
757
|
className: cn(
|
|
758
758
|
buttonFloatVariants({ variant: r, size: s }),
|
|
759
759
|
x,
|
|
@@ -761,7 +761,7 @@ const ButtonFloat = forwardRef(
|
|
|
761
761
|
t
|
|
762
762
|
),
|
|
763
763
|
style: c,
|
|
764
|
-
...
|
|
764
|
+
...o
|
|
765
765
|
}
|
|
766
766
|
) });
|
|
767
767
|
}
|
|
@@ -883,13 +883,13 @@ const buttonIconVariants = cva(
|
|
|
883
883
|
size: "md",
|
|
884
884
|
color: "primary"
|
|
885
885
|
}
|
|
886
|
-
}), Icon = React__default.forwardRef(function({ as: t, color: r = "primary", size: s = "md", className:
|
|
886
|
+
}), Icon = React__default.forwardRef(function({ as: t, color: r = "primary", size: s = "md", className: i, ...n }, o) {
|
|
887
887
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
888
888
|
t,
|
|
889
889
|
{
|
|
890
|
-
ref:
|
|
891
|
-
className: iconVariants({ color: r, size: s, className:
|
|
892
|
-
...
|
|
890
|
+
ref: o,
|
|
891
|
+
className: iconVariants({ color: r, size: s, className: i }),
|
|
892
|
+
...n
|
|
893
893
|
}
|
|
894
894
|
);
|
|
895
895
|
}), ButtonIcon = React__default.forwardRef(
|
|
@@ -897,9 +897,9 @@ const buttonIconVariants = cva(
|
|
|
897
897
|
className: t,
|
|
898
898
|
variant: r = "primary",
|
|
899
899
|
size: s = "md",
|
|
900
|
-
shape:
|
|
901
|
-
disabled:
|
|
902
|
-
as:
|
|
900
|
+
shape: i = "rounded",
|
|
901
|
+
disabled: n = !1,
|
|
902
|
+
as: o,
|
|
903
903
|
"aria-label": a,
|
|
904
904
|
...l
|
|
905
905
|
}, c) {
|
|
@@ -912,19 +912,19 @@ const buttonIconVariants = cva(
|
|
|
912
912
|
buttonIconVariants({
|
|
913
913
|
variant: r,
|
|
914
914
|
size: s,
|
|
915
|
-
shape:
|
|
915
|
+
shape: i
|
|
916
916
|
}),
|
|
917
917
|
t
|
|
918
918
|
),
|
|
919
|
-
disabled:
|
|
920
|
-
"aria-disabled":
|
|
919
|
+
disabled: n,
|
|
920
|
+
"aria-disabled": n,
|
|
921
921
|
"aria-label": a,
|
|
922
|
-
inert:
|
|
922
|
+
inert: n ? !0 : void 0,
|
|
923
923
|
...l,
|
|
924
924
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
925
925
|
Icon,
|
|
926
926
|
{
|
|
927
|
-
as:
|
|
927
|
+
as: o,
|
|
928
928
|
size: s,
|
|
929
929
|
color: getIconColorFromVariant(r)
|
|
930
930
|
}
|
|
@@ -1048,9 +1048,9 @@ const BUTTONS = [
|
|
|
1048
1048
|
onChange: t,
|
|
1049
1049
|
disabled: r,
|
|
1050
1050
|
className: s,
|
|
1051
|
-
"aria-label":
|
|
1052
|
-
},
|
|
1053
|
-
const { input:
|
|
1051
|
+
"aria-label": i
|
|
1052
|
+
}, n) => {
|
|
1053
|
+
const { input: o, inputRef: a, handleButton: l, handleInput: c } = useCalculator({
|
|
1054
1054
|
initialValue: e,
|
|
1055
1055
|
disabled: r,
|
|
1056
1056
|
onChange: t
|
|
@@ -1058,9 +1058,9 @@ const BUTTONS = [
|
|
|
1058
1058
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1059
1059
|
"div",
|
|
1060
1060
|
{
|
|
1061
|
-
ref:
|
|
1061
|
+
ref: n,
|
|
1062
1062
|
className: cn(calculatorRootVariants({ disabled: r }), s),
|
|
1063
|
-
"aria-label":
|
|
1063
|
+
"aria-label": i || "Calculator",
|
|
1064
1064
|
role: "region",
|
|
1065
1065
|
children: [
|
|
1066
1066
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -1068,7 +1068,7 @@ const BUTTONS = [
|
|
|
1068
1068
|
{
|
|
1069
1069
|
ref: a,
|
|
1070
1070
|
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)]",
|
|
1071
|
-
value:
|
|
1071
|
+
value: o,
|
|
1072
1072
|
onChange: c,
|
|
1073
1073
|
disabled: r,
|
|
1074
1074
|
inputMode: "decimal",
|
|
@@ -1178,9 +1178,9 @@ const textVariants = cva("", {
|
|
|
1178
1178
|
color: t = "ghost",
|
|
1179
1179
|
hasUnderline: r = !1,
|
|
1180
1180
|
isCapitalize: s = !1,
|
|
1181
|
-
align:
|
|
1182
|
-
italic:
|
|
1183
|
-
clamp:
|
|
1181
|
+
align: i = "left",
|
|
1182
|
+
italic: n = !1,
|
|
1183
|
+
clamp: o = "none",
|
|
1184
1184
|
ellipsis: a = !1,
|
|
1185
1185
|
fontSize: l,
|
|
1186
1186
|
fontWeight: c,
|
|
@@ -1208,9 +1208,9 @@ const textVariants = cva("", {
|
|
|
1208
1208
|
color: t,
|
|
1209
1209
|
hasUnderline: r,
|
|
1210
1210
|
isCapitalize: s,
|
|
1211
|
-
align:
|
|
1212
|
-
italic:
|
|
1213
|
-
clamp:
|
|
1211
|
+
align: i,
|
|
1212
|
+
italic: n,
|
|
1213
|
+
clamp: o,
|
|
1214
1214
|
ellipsis: a,
|
|
1215
1215
|
// @ts-expect-error - `as` is not a valid variant
|
|
1216
1216
|
as: f
|
|
@@ -1267,7 +1267,7 @@ const CalendarHeader = () => {
|
|
|
1267
1267
|
] })
|
|
1268
1268
|
] });
|
|
1269
1269
|
}, CalendarWeekdays = () => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-7 px-4 text-ghost-500 mb-3", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((e) => /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { fontSize: "xs", color: "ghost", align: "center", children: e }, e)) }), CalendarDaysSingle = () => {
|
|
1270
|
-
const e = useCalendarContext(), { year: t, month: r, value: s, onChange:
|
|
1270
|
+
const e = useCalendarContext(), { year: t, month: r, value: s, onChange: i, setMonth: n, setYear: o } = e, a = (g, m) => new Date(g, m + 1, 0).getDate(), c = ((g, m) => new Date(g, m, 1).getDay())(t, r), x = a(t, r), h = r - 1 < 0 ? 11 : r - 1, d = r === 0 ? t - 1 : t, p = a(t, h), y = r === 11 ? 0 : r + 1, f = r === 11 ? t + 1 : t, v = [];
|
|
1271
1271
|
for (let g = 0; g < c; g++) {
|
|
1272
1272
|
const m = p - c + g + 1;
|
|
1273
1273
|
v.push(
|
|
@@ -1279,7 +1279,7 @@ const CalendarHeader = () => {
|
|
|
1279
1279
|
"aria-label": "Previous month day",
|
|
1280
1280
|
variant: "ghost",
|
|
1281
1281
|
onClick: () => {
|
|
1282
|
-
|
|
1282
|
+
i?.(new Date(d, h, m)), n(h), o(d);
|
|
1283
1283
|
}
|
|
1284
1284
|
},
|
|
1285
1285
|
"prev-" + g
|
|
@@ -1307,7 +1307,7 @@ const CalendarHeader = () => {
|
|
|
1307
1307
|
"aria-label": `Select ${t}-${r + 1}-${g}`,
|
|
1308
1308
|
"aria-current": m ? "date" : void 0,
|
|
1309
1309
|
onClick: () => {
|
|
1310
|
-
|
|
1310
|
+
i?.(new Date(t, r, g));
|
|
1311
1311
|
}
|
|
1312
1312
|
},
|
|
1313
1313
|
g
|
|
@@ -1325,7 +1325,7 @@ const CalendarHeader = () => {
|
|
|
1325
1325
|
"aria-label": "Next month day",
|
|
1326
1326
|
variant: "ghost",
|
|
1327
1327
|
onClick: () => {
|
|
1328
|
-
|
|
1328
|
+
i?.(new Date(f, y, g + 1)), n(y), o(f);
|
|
1329
1329
|
}
|
|
1330
1330
|
},
|
|
1331
1331
|
"next-" + g
|
|
@@ -1333,7 +1333,7 @@ const CalendarHeader = () => {
|
|
|
1333
1333
|
);
|
|
1334
1334
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-7 gap-2 px-4 pb-4", children: v });
|
|
1335
1335
|
}, CalendarDaysRange = () => {
|
|
1336
|
-
const { year: e, month: t, value: r, onChange: s, setMonth:
|
|
1336
|
+
const { year: e, month: t, value: r, onChange: s, setMonth: i, setYear: n } = useCalendarContext(), o = (u, b) => new Date(u, b + 1, 0).getDate(), l = ((u, b) => new Date(u, b, 1).getDay())(e, t), c = o(e, t), x = t - 1 < 0 ? 11 : t - 1, h = t === 0 ? e - 1 : e, d = o(e, x), p = t === 11 ? 0 : t + 1, y = t === 11 ? e + 1 : e, f = [], v = () => {
|
|
1337
1337
|
if (!Array.isArray(r)) return [null, null];
|
|
1338
1338
|
const [u, b] = r;
|
|
1339
1339
|
return !u && !b ? [null, null] : u && b ? u <= b ? [u, b] : [b, u] : [u, b];
|
|
@@ -1341,7 +1341,7 @@ const CalendarHeader = () => {
|
|
|
1341
1341
|
if (!w || !g) return !1;
|
|
1342
1342
|
const b = new Date(e, t, u);
|
|
1343
1343
|
return b >= w && b <= g;
|
|
1344
|
-
},
|
|
1344
|
+
}, S = (u) => w ? w.getFullYear() === e && w.getMonth() === t && w.getDate() === u : !1, I = (u) => g ? g.getFullYear() === e && g.getMonth() === t && g.getDate() === u : !1;
|
|
1345
1345
|
for (let u = 0; u < l; u++) {
|
|
1346
1346
|
const b = d - l + u + 1;
|
|
1347
1347
|
f.push(
|
|
@@ -1353,7 +1353,7 @@ const CalendarHeader = () => {
|
|
|
1353
1353
|
"aria-label": "Previous month day",
|
|
1354
1354
|
variant: "ghost",
|
|
1355
1355
|
onClick: () => {
|
|
1356
|
-
s?.([null, null]),
|
|
1356
|
+
s?.([null, null]), i(x), n(h);
|
|
1357
1357
|
}
|
|
1358
1358
|
},
|
|
1359
1359
|
"prev-" + u
|
|
@@ -1361,7 +1361,7 @@ const CalendarHeader = () => {
|
|
|
1361
1361
|
);
|
|
1362
1362
|
}
|
|
1363
1363
|
for (let u = 1; u <= c; u++) {
|
|
1364
|
-
const b = m(u), E =
|
|
1364
|
+
const b = m(u), E = S(u), C = I(u);
|
|
1365
1365
|
f.push(
|
|
1366
1366
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1367
1367
|
ButtonIcon,
|
|
@@ -1408,7 +1408,7 @@ const CalendarHeader = () => {
|
|
|
1408
1408
|
"aria-label": "Next month day",
|
|
1409
1409
|
variant: "ghost",
|
|
1410
1410
|
onClick: () => {
|
|
1411
|
-
s?.([null, null]),
|
|
1411
|
+
s?.([null, null]), i(p), n(y);
|
|
1412
1412
|
}
|
|
1413
1413
|
},
|
|
1414
1414
|
"next-" + u
|
|
@@ -1424,21 +1424,21 @@ function useCalendar({
|
|
|
1424
1424
|
type: t,
|
|
1425
1425
|
onChange: r,
|
|
1426
1426
|
initialYear: s,
|
|
1427
|
-
initialMonth:
|
|
1427
|
+
initialMonth: i
|
|
1428
1428
|
}) {
|
|
1429
|
-
const [
|
|
1429
|
+
const [n, o] = useState(i), [a, l] = useState(s), [c, x] = useState([
|
|
1430
1430
|
null,
|
|
1431
1431
|
null
|
|
1432
1432
|
]);
|
|
1433
1433
|
let h = e;
|
|
1434
1434
|
t === "range" && !e && (h = c);
|
|
1435
1435
|
const d = useCallback(() => {
|
|
1436
|
-
const f =
|
|
1437
|
-
|
|
1438
|
-
}, [
|
|
1439
|
-
const f =
|
|
1440
|
-
|
|
1441
|
-
}, [
|
|
1436
|
+
const f = n === 0 ? 11 : n - 1, v = n === 0 ? a - 1 : a;
|
|
1437
|
+
o(f), l(v), t === "single" && r?.(new Date(v, f, 1));
|
|
1438
|
+
}, [n, a, t, r]), p = useCallback(() => {
|
|
1439
|
+
const f = n === 11 ? 0 : n + 1, v = n === 11 ? a + 1 : a;
|
|
1440
|
+
o(f), l(v), t === "single" && r?.(new Date(v, f, 1));
|
|
1441
|
+
}, [n, a, t, r]), y = useCallback(
|
|
1442
1442
|
(f) => {
|
|
1443
1443
|
t === "single" ? r?.(f) : t === "range" && (x(f), r?.(f));
|
|
1444
1444
|
},
|
|
@@ -1446,9 +1446,9 @@ function useCalendar({
|
|
|
1446
1446
|
);
|
|
1447
1447
|
return {
|
|
1448
1448
|
year: a,
|
|
1449
|
-
month:
|
|
1449
|
+
month: n,
|
|
1450
1450
|
value: h,
|
|
1451
|
-
setMonth:
|
|
1451
|
+
setMonth: o,
|
|
1452
1452
|
setYear: l,
|
|
1453
1453
|
onChange: y,
|
|
1454
1454
|
handlePrevMonth: d,
|
|
@@ -1460,35 +1460,197 @@ const CalendarRoot = ({
|
|
|
1460
1460
|
onChange: t,
|
|
1461
1461
|
className: r,
|
|
1462
1462
|
type: s = "single",
|
|
1463
|
-
...
|
|
1463
|
+
...i
|
|
1464
1464
|
}) => {
|
|
1465
|
-
const
|
|
1465
|
+
const n = /* @__PURE__ */ new Date(), o = useCalendar({
|
|
1466
1466
|
value: e,
|
|
1467
1467
|
onChange: t,
|
|
1468
1468
|
type: s,
|
|
1469
|
-
initialYear:
|
|
1470
|
-
initialMonth:
|
|
1469
|
+
initialYear: n.getFullYear(),
|
|
1470
|
+
initialMonth: n.getMonth()
|
|
1471
1471
|
});
|
|
1472
1472
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1473
1473
|
CalendarContext.Provider,
|
|
1474
1474
|
{
|
|
1475
1475
|
value: {
|
|
1476
|
-
year:
|
|
1477
|
-
month:
|
|
1478
|
-
value:
|
|
1476
|
+
year: o.year,
|
|
1477
|
+
month: o.month,
|
|
1478
|
+
value: o.value,
|
|
1479
1479
|
type: s,
|
|
1480
|
-
setMonth:
|
|
1481
|
-
setYear:
|
|
1482
|
-
onChange:
|
|
1480
|
+
setMonth: o.setMonth,
|
|
1481
|
+
setYear: o.setYear,
|
|
1482
|
+
onChange: o.onChange
|
|
1483
1483
|
},
|
|
1484
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("select-none", r), ...
|
|
1484
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("select-none", r), ...i, children: [
|
|
1485
1485
|
/* @__PURE__ */ jsxRuntimeExports.jsx(CalendarHeader, {}),
|
|
1486
1486
|
/* @__PURE__ */ jsxRuntimeExports.jsx(CalendarWeekdays, {}),
|
|
1487
1487
|
/* @__PURE__ */ jsxRuntimeExports.jsx(CalendarDays, {})
|
|
1488
1488
|
] })
|
|
1489
1489
|
}
|
|
1490
1490
|
);
|
|
1491
|
-
}, Calendar = Object.assign(CalendarRoot, {}),
|
|
1491
|
+
}, Calendar = Object.assign(CalendarRoot, {}), cardVariants = cva(
|
|
1492
|
+
"block transition-colors duration-200 cursor-pointer",
|
|
1493
|
+
{
|
|
1494
|
+
variants: {
|
|
1495
|
+
size: {
|
|
1496
|
+
xs: "p-2",
|
|
1497
|
+
sm: "p-3",
|
|
1498
|
+
md: "p-4",
|
|
1499
|
+
lg: "p-6",
|
|
1500
|
+
xl: "p-8"
|
|
1501
|
+
},
|
|
1502
|
+
shape: {
|
|
1503
|
+
rounded: "rounded-lg",
|
|
1504
|
+
square: "rounded-none"
|
|
1505
|
+
}
|
|
1506
|
+
},
|
|
1507
|
+
defaultVariants: {
|
|
1508
|
+
size: "md",
|
|
1509
|
+
shape: "rounded"
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
), tileVariants = cva(
|
|
1513
|
+
// Base classes
|
|
1514
|
+
"block transition-colors duration-200",
|
|
1515
|
+
{
|
|
1516
|
+
variants: {
|
|
1517
|
+
variant: {
|
|
1518
|
+
white: "bg-white border border-border",
|
|
1519
|
+
neutral: "bg-neutral border border-gray-200",
|
|
1520
|
+
primary: "bg-primary-soft border border-primary",
|
|
1521
|
+
secondary: "bg-secondary-soft border border-secondary",
|
|
1522
|
+
tertiary: "bg-tertiary-soft border border-tertiary",
|
|
1523
|
+
ghost: "bg-transparent border border-ghost",
|
|
1524
|
+
success: "bg-success-soft border border-success",
|
|
1525
|
+
info: "bg-info-soft border border-info",
|
|
1526
|
+
warning: "bg-warning-soft border border-warning",
|
|
1527
|
+
danger: "bg-danger-soft border border-danger"
|
|
1528
|
+
},
|
|
1529
|
+
size: {
|
|
1530
|
+
xs: "p-2",
|
|
1531
|
+
sm: "p-3",
|
|
1532
|
+
md: "p-4",
|
|
1533
|
+
lg: "p-6",
|
|
1534
|
+
xl: "p-8"
|
|
1535
|
+
},
|
|
1536
|
+
shape: {
|
|
1537
|
+
rounded: "rounded-lg",
|
|
1538
|
+
square: "rounded-none"
|
|
1539
|
+
}
|
|
1540
|
+
},
|
|
1541
|
+
defaultVariants: {
|
|
1542
|
+
variant: "white",
|
|
1543
|
+
size: "md",
|
|
1544
|
+
shape: "rounded"
|
|
1545
|
+
}
|
|
1546
|
+
}
|
|
1547
|
+
), Tile = forwardRef(
|
|
1548
|
+
({ variant: e = "white", size: t = "md", shape: r = "rounded", className: s, ...i }, n) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1549
|
+
"div",
|
|
1550
|
+
{
|
|
1551
|
+
ref: n,
|
|
1552
|
+
className: cn(tileVariants({ variant: e, size: t, shape: r }), s),
|
|
1553
|
+
...i
|
|
1554
|
+
}
|
|
1555
|
+
)
|
|
1556
|
+
), Card = forwardRef(
|
|
1557
|
+
({
|
|
1558
|
+
size: e = "md",
|
|
1559
|
+
shape: t = "rounded",
|
|
1560
|
+
avatar: r,
|
|
1561
|
+
title: s,
|
|
1562
|
+
subtitle: i,
|
|
1563
|
+
badge: n,
|
|
1564
|
+
supplementaryInfo: o,
|
|
1565
|
+
className: a,
|
|
1566
|
+
...l
|
|
1567
|
+
}, c) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1568
|
+
Tile,
|
|
1569
|
+
{
|
|
1570
|
+
ref: c,
|
|
1571
|
+
className: cn(cardVariants({ size: e, shape: t }), a),
|
|
1572
|
+
...l,
|
|
1573
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-4", children: [
|
|
1574
|
+
r && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-shrink-0", children: r }),
|
|
1575
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full", children: [
|
|
1576
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("mb-4", !n && !o && "mb-0"), children: [
|
|
1577
|
+
s && /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "h3", fontSize: "base", fontWeight: "semibold", children: s }),
|
|
1578
|
+
i && /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "p", fontSize: "xs", color: "gray", children: i })
|
|
1579
|
+
] }),
|
|
1580
|
+
(n || o) && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
|
|
1581
|
+
n,
|
|
1582
|
+
o && o
|
|
1583
|
+
] })
|
|
1584
|
+
] })
|
|
1585
|
+
] })
|
|
1586
|
+
}
|
|
1587
|
+
)
|
|
1588
|
+
), filterChipVariants = cva(
|
|
1589
|
+
"inline-flex items-center gap-1.5 rounded-full font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none select-none cursor-pointer text-sm leading-none",
|
|
1590
|
+
{
|
|
1591
|
+
variants: {
|
|
1592
|
+
variant: {
|
|
1593
|
+
// Core variants using Versaur color system
|
|
1594
|
+
primary: "bg-primary text-white hover:bg-primary/90 focus-visible:ring-primary-light focus-visible:ring-offset-white shadow-sm",
|
|
1595
|
+
secondary: "bg-secondary text-white hover:bg-secondary/90 focus-visible:ring-secondary-light focus-visible:ring-offset-white shadow-sm",
|
|
1596
|
+
tertiary: "bg-tertiary text-white hover:bg-tertiary/90 focus-visible:ring-tertiary-light focus-visible:ring-offset-white shadow-sm",
|
|
1597
|
+
ghost: "bg-ghost-soft text-foreground hover:bg-ghost-light focus-visible:ring-ghost-light focus-visible:ring-offset-white",
|
|
1598
|
+
neutral: "bg-neutral text-foreground hover:bg-neutral/80 focus-visible:ring-foreground-light focus-visible:ring-offset-white",
|
|
1599
|
+
// Outline variants
|
|
1600
|
+
"primary-outline": "border border-primary text-primary bg-white hover:bg-primary-soft focus-visible:ring-primary-light focus-visible:ring-offset-white",
|
|
1601
|
+
"secondary-outline": "border border-secondary text-secondary bg-white hover:bg-secondary-soft focus-visible:ring-secondary-light focus-visible:ring-offset-white",
|
|
1602
|
+
"tertiary-outline": "border border-tertiary text-tertiary bg-white hover:bg-tertiary-soft focus-visible:ring-tertiary-light focus-visible:ring-offset-white",
|
|
1603
|
+
"ghost-outline": "border border-ghost text-ghost bg-white hover:bg-ghost-soft focus-visible:ring-ghost-light focus-visible:ring-offset-white",
|
|
1604
|
+
"neutral-outline": "border border-neutral text-foreground bg-white hover:bg-neutral/20 focus-visible:ring-foreground-light focus-visible:ring-offset-white",
|
|
1605
|
+
// Semantic variants
|
|
1606
|
+
success: "bg-success text-white hover:bg-success/90 focus-visible:ring-success-light focus-visible:ring-offset-white shadow-sm",
|
|
1607
|
+
"success-outline": "border border-success text-success bg-white hover:bg-success-soft focus-visible:ring-success-light focus-visible:ring-offset-white",
|
|
1608
|
+
info: "bg-info text-white hover:bg-info/90 focus-visible:ring-info-light focus-visible:ring-offset-white shadow-sm",
|
|
1609
|
+
"info-outline": "border border-info text-info bg-white hover:bg-info-soft focus-visible:ring-info-light focus-visible:ring-offset-white",
|
|
1610
|
+
warning: "bg-warning text-white hover:bg-warning/90 focus-visible:ring-warning-light focus-visible:ring-offset-white shadow-sm",
|
|
1611
|
+
"warning-outline": "border border-warning text-warning bg-white hover:bg-warning-soft focus-visible:ring-warning-light focus-visible:ring-offset-white",
|
|
1612
|
+
danger: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-light focus-visible:ring-offset-white shadow-sm",
|
|
1613
|
+
"danger-outline": "border border-danger text-danger bg-white hover:bg-danger-soft focus-visible:ring-danger-light focus-visible:ring-offset-white"
|
|
1614
|
+
},
|
|
1615
|
+
size: {
|
|
1616
|
+
sm: "h-7 px-3 text-xs",
|
|
1617
|
+
md: "h-8 px-4 text-sm",
|
|
1618
|
+
lg: "h-9 px-5 text-sm"
|
|
1619
|
+
}
|
|
1620
|
+
},
|
|
1621
|
+
defaultVariants: {
|
|
1622
|
+
variant: "neutral-outline",
|
|
1623
|
+
size: "md"
|
|
1624
|
+
}
|
|
1625
|
+
}
|
|
1626
|
+
), FilterChip = React__default.forwardRef(
|
|
1627
|
+
function e({
|
|
1628
|
+
className: t,
|
|
1629
|
+
variant: r = "neutral-outline",
|
|
1630
|
+
size: s = "md",
|
|
1631
|
+
disabled: i = !1,
|
|
1632
|
+
children: n,
|
|
1633
|
+
...o
|
|
1634
|
+
}, a) {
|
|
1635
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1636
|
+
"button",
|
|
1637
|
+
{
|
|
1638
|
+
ref: a,
|
|
1639
|
+
type: "button",
|
|
1640
|
+
className: cn(filterChipVariants({ variant: r, size: s }), t),
|
|
1641
|
+
disabled: i,
|
|
1642
|
+
"aria-disabled": i,
|
|
1643
|
+
"aria-label": `${n}, removable`,
|
|
1644
|
+
inert: i ? !0 : void 0,
|
|
1645
|
+
...o,
|
|
1646
|
+
children: [
|
|
1647
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex-shrink-0", children: n }),
|
|
1648
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { as: XIcon, color: "inherit", size: s === "lg" ? "md" : "sm" })
|
|
1649
|
+
]
|
|
1650
|
+
}
|
|
1651
|
+
);
|
|
1652
|
+
}
|
|
1653
|
+
), noResultsVariants = cva(
|
|
1492
1654
|
"flex flex-col items-center justify-center text-center border border-border rounded-lg bg-background",
|
|
1493
1655
|
{
|
|
1494
1656
|
variants: {
|
|
@@ -1514,12 +1676,12 @@ const CalendarRoot = ({
|
|
|
1514
1676
|
), noResultsSubtitleVariants = cva(
|
|
1515
1677
|
"text-foreground-light mb-6 max-w-md"
|
|
1516
1678
|
), NoResults = React__default.forwardRef(
|
|
1517
|
-
function e({ icon: t, title: r, subtitle: s, action:
|
|
1679
|
+
function e({ icon: t, title: r, subtitle: s, action: i, className: n, hasGrayBackground: o, ...a }, l) {
|
|
1518
1680
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1519
1681
|
"section",
|
|
1520
1682
|
{
|
|
1521
1683
|
ref: l,
|
|
1522
|
-
className: cn(noResultsVariants({ hasGrayBackground:
|
|
1684
|
+
className: cn(noResultsVariants({ hasGrayBackground: o }), n),
|
|
1523
1685
|
role: "status",
|
|
1524
1686
|
"aria-label": "No results found",
|
|
1525
1687
|
...a,
|
|
@@ -1529,7 +1691,7 @@ const CalendarRoot = ({
|
|
|
1529
1691
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "h2", className: noResultsTitleVariants(), children: r })
|
|
1530
1692
|
] }),
|
|
1531
1693
|
s && /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "p", className: noResultsSubtitleVariants(), children: s }),
|
|
1532
|
-
|
|
1694
|
+
i && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { role: "group", "aria-label": "Available actions", children: i })
|
|
1533
1695
|
]
|
|
1534
1696
|
}
|
|
1535
1697
|
);
|
|
@@ -1605,7 +1767,7 @@ const getTableColumnClass = (e) => {
|
|
|
1605
1767
|
}
|
|
1606
1768
|
}, TableHeader = forwardRef(
|
|
1607
1769
|
({ children: e, className: t, ...r }, s) => {
|
|
1608
|
-
const { columns:
|
|
1770
|
+
const { columns: i } = useTableContext();
|
|
1609
1771
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1610
1772
|
"div",
|
|
1611
1773
|
{
|
|
@@ -1617,7 +1779,7 @@ const getTableColumnClass = (e) => {
|
|
|
1617
1779
|
"div",
|
|
1618
1780
|
{
|
|
1619
1781
|
role: "row",
|
|
1620
|
-
className: cn("grid gap-4", getTableColumnClass(
|
|
1782
|
+
className: cn("grid gap-4", getTableColumnClass(i)),
|
|
1621
1783
|
children: e
|
|
1622
1784
|
}
|
|
1623
1785
|
)
|
|
@@ -1628,7 +1790,7 @@ const getTableColumnClass = (e) => {
|
|
|
1628
1790
|
({ children: e, className: t, ...r }, s) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { role: "rowgroup", ref: s, className: cn(t), ...r, children: e })
|
|
1629
1791
|
), TableFooter = forwardRef(
|
|
1630
1792
|
({ children: e, className: t, ...r }, s) => {
|
|
1631
|
-
const { columns:
|
|
1793
|
+
const { columns: i } = useTableContext();
|
|
1632
1794
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1633
1795
|
"div",
|
|
1634
1796
|
{
|
|
@@ -1640,7 +1802,7 @@ const getTableColumnClass = (e) => {
|
|
|
1640
1802
|
"div",
|
|
1641
1803
|
{
|
|
1642
1804
|
role: "row",
|
|
1643
|
-
className: cn("grid gap-4", getTableColumnClass(
|
|
1805
|
+
className: cn("grid gap-4", getTableColumnClass(i)),
|
|
1644
1806
|
children: e
|
|
1645
1807
|
}
|
|
1646
1808
|
)
|
|
@@ -1649,14 +1811,14 @@ const getTableColumnClass = (e) => {
|
|
|
1649
1811
|
}
|
|
1650
1812
|
), TableRow = forwardRef(
|
|
1651
1813
|
({ children: e, className: t, ...r }, s) => {
|
|
1652
|
-
const { columns:
|
|
1814
|
+
const { columns: i } = useTableContext();
|
|
1653
1815
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1654
1816
|
"div",
|
|
1655
1817
|
{
|
|
1656
1818
|
role: "row",
|
|
1657
1819
|
className: cn(
|
|
1658
1820
|
"grid gap-4",
|
|
1659
|
-
getTableColumnClass(
|
|
1821
|
+
getTableColumnClass(i),
|
|
1660
1822
|
"border-b border-border last:border-0",
|
|
1661
1823
|
t
|
|
1662
1824
|
),
|
|
@@ -1667,13 +1829,13 @@ const getTableColumnClass = (e) => {
|
|
|
1667
1829
|
);
|
|
1668
1830
|
}
|
|
1669
1831
|
), TableColumn = forwardRef(
|
|
1670
|
-
({ as: e = "td", span: t, align: r = "left", children: s, className:
|
|
1832
|
+
({ as: e = "td", span: t, align: r = "left", children: s, className: i, ...n }, o) => {
|
|
1671
1833
|
const a = e === "th" ? "columnheader" : "cell";
|
|
1672
1834
|
let l = "text-left";
|
|
1673
1835
|
return r === "center" ? l = "text-center" : r === "right" && (l = "text-right"), /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1674
1836
|
"div",
|
|
1675
1837
|
{
|
|
1676
|
-
ref:
|
|
1838
|
+
ref: o,
|
|
1677
1839
|
role: a,
|
|
1678
1840
|
className: cn(
|
|
1679
1841
|
"px-4 py-2",
|
|
@@ -1681,9 +1843,9 @@ const getTableColumnClass = (e) => {
|
|
|
1681
1843
|
getRowSpanClass(t),
|
|
1682
1844
|
l,
|
|
1683
1845
|
"truncate overflow-hidden whitespace-nowrap",
|
|
1684
|
-
|
|
1846
|
+
i
|
|
1685
1847
|
),
|
|
1686
|
-
...
|
|
1848
|
+
...n,
|
|
1687
1849
|
children: s
|
|
1688
1850
|
}
|
|
1689
1851
|
);
|
|
@@ -1715,10 +1877,10 @@ const getTableColumnClass = (e) => {
|
|
|
1715
1877
|
}
|
|
1716
1878
|
)
|
|
1717
1879
|
), TableRoot = forwardRef(
|
|
1718
|
-
({ children: e, className: t, columns: r = 12, ...s },
|
|
1880
|
+
({ children: e, className: t, columns: r = 12, ...s }, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(TableProvider, { value: { columns: r }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1719
1881
|
"div",
|
|
1720
1882
|
{
|
|
1721
|
-
ref:
|
|
1883
|
+
ref: i,
|
|
1722
1884
|
role: "table",
|
|
1723
1885
|
className: cn(
|
|
1724
1886
|
// Versaur design system: border, background, shadow, rounded, spacing
|
|
@@ -1739,51 +1901,7 @@ const getTableColumnClass = (e) => {
|
|
|
1739
1901
|
Footer: TableFooter,
|
|
1740
1902
|
Row: TableRow,
|
|
1741
1903
|
RowItem: TableRowItem
|
|
1742
|
-
})
|
|
1743
|
-
// Base classes
|
|
1744
|
-
"block transition-colors duration-200",
|
|
1745
|
-
{
|
|
1746
|
-
variants: {
|
|
1747
|
-
variant: {
|
|
1748
|
-
white: "bg-white border border-border",
|
|
1749
|
-
neutral: "bg-neutral border border-gray-200",
|
|
1750
|
-
primary: "bg-primary-soft border border-primary",
|
|
1751
|
-
secondary: "bg-secondary-soft border border-secondary",
|
|
1752
|
-
tertiary: "bg-tertiary-soft border border-tertiary",
|
|
1753
|
-
ghost: "bg-transparent border border-ghost",
|
|
1754
|
-
success: "bg-success-soft border border-success",
|
|
1755
|
-
info: "bg-info-soft border border-info",
|
|
1756
|
-
warning: "bg-warning-soft border border-warning",
|
|
1757
|
-
danger: "bg-danger-soft border border-danger"
|
|
1758
|
-
},
|
|
1759
|
-
size: {
|
|
1760
|
-
xs: "p-2",
|
|
1761
|
-
sm: "p-3",
|
|
1762
|
-
md: "p-4",
|
|
1763
|
-
lg: "p-6",
|
|
1764
|
-
xl: "p-8"
|
|
1765
|
-
},
|
|
1766
|
-
shape: {
|
|
1767
|
-
rounded: "rounded-lg",
|
|
1768
|
-
square: "rounded-none"
|
|
1769
|
-
}
|
|
1770
|
-
},
|
|
1771
|
-
defaultVariants: {
|
|
1772
|
-
variant: "white",
|
|
1773
|
-
size: "md",
|
|
1774
|
-
shape: "rounded"
|
|
1775
|
-
}
|
|
1776
|
-
}
|
|
1777
|
-
), Tile = forwardRef(
|
|
1778
|
-
({ variant: e = "white", size: t = "md", shape: r = "rounded", className: s, ...n }, o) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1779
|
-
"div",
|
|
1780
|
-
{
|
|
1781
|
-
ref: o,
|
|
1782
|
-
className: cn(tileVariants({ variant: e, size: t, shape: r }), s),
|
|
1783
|
-
...n
|
|
1784
|
-
}
|
|
1785
|
-
)
|
|
1786
|
-
);
|
|
1904
|
+
});
|
|
1787
1905
|
function getColSpan(e = 4) {
|
|
1788
1906
|
switch (e) {
|
|
1789
1907
|
case 1:
|
|
@@ -1814,19 +1932,19 @@ function getColSpan(e = 4) {
|
|
|
1814
1932
|
return "col-span-4";
|
|
1815
1933
|
}
|
|
1816
1934
|
}
|
|
1817
|
-
const DescriptionListItem = forwardRef(function e({ children: t, className: r, span: s = 4, ...
|
|
1818
|
-
const
|
|
1819
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref:
|
|
1935
|
+
const DescriptionListItem = forwardRef(function e({ children: t, className: r, span: s = 4, ...i }, n) {
|
|
1936
|
+
const o = getColSpan(s);
|
|
1937
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: n, className: cn(o, r), ...i, children: t });
|
|
1820
1938
|
}), DescriptionListTerm = forwardRef(function e({ children: t, ...r }, s) {
|
|
1821
1939
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("dt", { ref: s, ...r, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "span", fontSize: "sm", fontWeight: "medium", color: "gray", children: t }) });
|
|
1822
|
-
}), DescriptionListDetails = forwardRef(function e({ children: t, color: r = "black", ...s },
|
|
1823
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("dd", { ref:
|
|
1940
|
+
}), DescriptionListDetails = forwardRef(function e({ children: t, color: r = "black", ...s }, i) {
|
|
1941
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("dd", { ref: i, ...s, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "span", fontSize: "base", fontWeight: "medium", color: r, children: t }) });
|
|
1824
1942
|
}), DescriptionListRoot = forwardRef(
|
|
1825
|
-
function e({ children: t, className: r, ...s },
|
|
1943
|
+
function e({ children: t, className: r, ...s }, i) {
|
|
1826
1944
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1827
1945
|
"dl",
|
|
1828
1946
|
{
|
|
1829
|
-
ref:
|
|
1947
|
+
ref: i,
|
|
1830
1948
|
className: cn("grid grid-cols-12 gap-y-4", r),
|
|
1831
1949
|
...s,
|
|
1832
1950
|
children: t
|
|
@@ -1839,25 +1957,25 @@ const DescriptionListItem = forwardRef(function e({ children: t, className: r, s
|
|
|
1839
1957
|
Details: DescriptionListDetails
|
|
1840
1958
|
});
|
|
1841
1959
|
function useImage({ src: e }) {
|
|
1842
|
-
const [t, r] = useState(!1), [s,
|
|
1960
|
+
const [t, r] = useState(!1), [s, i] = useState(!1), n = useRef(!1), o = () => {
|
|
1843
1961
|
r(!0);
|
|
1844
1962
|
}, a = () => {
|
|
1845
|
-
|
|
1963
|
+
i(!0);
|
|
1846
1964
|
};
|
|
1847
1965
|
return useEffect(() => {
|
|
1848
1966
|
if (!e) return;
|
|
1849
1967
|
const l = new Image();
|
|
1850
1968
|
return l.src = e, l.onload = () => {
|
|
1851
|
-
|
|
1969
|
+
n.current || r(!0);
|
|
1852
1970
|
}, l.onerror = () => {
|
|
1853
|
-
|
|
1971
|
+
n.current || i(!0);
|
|
1854
1972
|
}, () => {
|
|
1855
|
-
|
|
1973
|
+
n.current = !0;
|
|
1856
1974
|
};
|
|
1857
1975
|
}, [e]), {
|
|
1858
1976
|
loaded: t,
|
|
1859
1977
|
errored: s,
|
|
1860
|
-
handleLoad:
|
|
1978
|
+
handleLoad: o,
|
|
1861
1979
|
handleError: a
|
|
1862
1980
|
};
|
|
1863
1981
|
}
|
|
@@ -1919,13 +2037,13 @@ function BaseImageSkeleton({
|
|
|
1919
2037
|
shape: t,
|
|
1920
2038
|
size: r,
|
|
1921
2039
|
height: s,
|
|
1922
|
-
width:
|
|
2040
|
+
width: i
|
|
1923
2041
|
}) {
|
|
1924
2042
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1925
2043
|
Skeleton,
|
|
1926
2044
|
{
|
|
1927
2045
|
className: cn(imageAtomVariants({ shape: t, size: r }), e),
|
|
1928
|
-
style: { height: s, width:
|
|
2046
|
+
style: { height: s, width: i }
|
|
1929
2047
|
}
|
|
1930
2048
|
);
|
|
1931
2049
|
}
|
|
@@ -1934,15 +2052,15 @@ function BaseImageFallback({
|
|
|
1934
2052
|
width: t,
|
|
1935
2053
|
height: r,
|
|
1936
2054
|
className: s,
|
|
1937
|
-
style:
|
|
1938
|
-
shape:
|
|
1939
|
-
size:
|
|
2055
|
+
style: i,
|
|
2056
|
+
shape: n,
|
|
2057
|
+
size: o
|
|
1940
2058
|
}) {
|
|
1941
2059
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1942
2060
|
"div",
|
|
1943
2061
|
{
|
|
1944
|
-
className: imageAtomVariants({ shape:
|
|
1945
|
-
style: { width: t, height: r, ...
|
|
2062
|
+
className: imageAtomVariants({ shape: n, size: o, className: s }),
|
|
2063
|
+
style: { width: t, height: r, ...i },
|
|
1946
2064
|
"aria-label": e,
|
|
1947
2065
|
role: "img",
|
|
1948
2066
|
children: [
|
|
@@ -1965,9 +2083,9 @@ const BaseImage = forwardRef(
|
|
|
1965
2083
|
alt: t,
|
|
1966
2084
|
onLoad: r,
|
|
1967
2085
|
onError: s,
|
|
1968
|
-
width:
|
|
1969
|
-
height:
|
|
1970
|
-
loading:
|
|
2086
|
+
width: i,
|
|
2087
|
+
height: n,
|
|
2088
|
+
loading: o = "lazy",
|
|
1971
2089
|
position: a = "cover",
|
|
1972
2090
|
size: l = "auto",
|
|
1973
2091
|
shape: c,
|
|
@@ -1976,7 +2094,7 @@ const BaseImage = forwardRef(
|
|
|
1976
2094
|
}, d) => {
|
|
1977
2095
|
const { loaded: p, errored: y, handleLoad: f, handleError: v } = useImage({
|
|
1978
2096
|
src: e
|
|
1979
|
-
}), w = typeof
|
|
2097
|
+
}), w = typeof i == "number" ? i : Number(i), g = typeof n == "number" ? n : Number(n);
|
|
1980
2098
|
return !p && !y ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1981
2099
|
BaseImageSkeleton,
|
|
1982
2100
|
{
|
|
@@ -2000,7 +2118,7 @@ const BaseImage = forwardRef(
|
|
|
2000
2118
|
alt: t,
|
|
2001
2119
|
width: w,
|
|
2002
2120
|
height: g,
|
|
2003
|
-
loading:
|
|
2121
|
+
loading: o,
|
|
2004
2122
|
className: cn(
|
|
2005
2123
|
imageVariants({
|
|
2006
2124
|
position: a,
|
|
@@ -2025,6 +2143,7 @@ export {
|
|
|
2025
2143
|
Badge as B,
|
|
2026
2144
|
Calculator as C,
|
|
2027
2145
|
DescriptionList as D,
|
|
2146
|
+
FilterChip as F,
|
|
2028
2147
|
Icon as I,
|
|
2029
2148
|
NoResults as N,
|
|
2030
2149
|
Table as T,
|
|
@@ -2035,10 +2154,11 @@ export {
|
|
|
2035
2154
|
ButtonFloat as e,
|
|
2036
2155
|
ButtonIcon as f,
|
|
2037
2156
|
Calendar as g,
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2157
|
+
Card as h,
|
|
2158
|
+
Text as i,
|
|
2159
|
+
Tile as j,
|
|
2160
|
+
ImageCircle as k,
|
|
2161
|
+
ImageSquare as l,
|
|
2162
|
+
ImageRectangle as m,
|
|
2163
|
+
BaseImage as n
|
|
2044
2164
|
};
|