@dimasbaguspm/versaur 0.0.25 → 0.0.27
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-CCDa5VGo.js → bottom-sheet-DCwLmjiX.js} +189 -170
- package/dist/js/{bottom-sheet-input-DsgPp5zI.js → bottom-sheet-input-D14wjCoC.js} +34 -35
- package/dist/js/forms/index.js +1 -1
- package/dist/js/{image-rectangle-GA3oWX7A.js → image-rectangle-BGLYH2Gl.js} +416 -241
- package/dist/js/index.js +68 -67
- package/dist/js/layouts/index.js +9 -8
- package/dist/js/navigation/index.js +1 -1
- package/dist/js/overlays/index.js +2 -2
- package/dist/js/primitive/index.js +17 -17
- package/dist/js/{tabs-p6g9kN0N.js → tabs-C0hcpxNk.js} +5 -6
- package/dist/js/{tooltip-CDdl1U3A.js → tooltip-DlbAOUeP.js} +16 -16
- package/dist/js/{top-bar-PpiWsgeR.js → top-bar-BA88ij4M.js} +232 -171
- 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/index.d.ts +1 -0
- package/dist/types/overlays/drawer/drawer.atoms.d.ts +5 -2
- package/dist/types/overlays/drawer/drawer.d.ts +2 -0
- package/dist/types/overlays/drawer/types.d.ts +1 -16
- 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/index.d.ts +1 -0
- package/dist/utils/enforce-subpath-import.js +2 -0
- package/package.json +1 -1
- package/dist/js/text-CRsIInRA.js +0 -127
|
@@ -2,7 +2,6 @@ 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
4
|
import { X, ChevronLeft, ChevronRight, ImageOff } from "lucide-react";
|
|
5
|
-
import { T as Text } from "./text-CRsIInRA.js";
|
|
6
5
|
import { S as Skeleton } from "./skeleton-BNZyaRjo.js";
|
|
7
6
|
const alertVariants = cva(
|
|
8
7
|
"relative flex items-center gap-2 rounded-md p-2 text-sm transition-all duration-200",
|
|
@@ -148,14 +147,14 @@ const alertVariants = cva(
|
|
|
148
147
|
icon: r,
|
|
149
148
|
className: s,
|
|
150
149
|
children: n,
|
|
151
|
-
...
|
|
152
|
-
},
|
|
150
|
+
...i
|
|
151
|
+
}, o) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
153
152
|
"div",
|
|
154
153
|
{
|
|
155
|
-
ref:
|
|
154
|
+
ref: o,
|
|
156
155
|
role: "alert",
|
|
157
156
|
className: cn(alertVariants({ variant: e, color: t }), s),
|
|
158
|
-
...
|
|
157
|
+
...i,
|
|
159
158
|
children: [
|
|
160
159
|
r && /* @__PURE__ */ jsxRuntimeExports.jsx(AlertIcon, { children: r }),
|
|
161
160
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1", children: n })
|
|
@@ -228,17 +227,17 @@ const alertVariants = cva(
|
|
|
228
227
|
color: r = "primary",
|
|
229
228
|
fontSize: s = "base",
|
|
230
229
|
fontWeight: n = "medium",
|
|
231
|
-
quiet:
|
|
232
|
-
...
|
|
230
|
+
quiet: i = !1,
|
|
231
|
+
...o
|
|
233
232
|
}, a) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
234
233
|
"a",
|
|
235
234
|
{
|
|
236
235
|
ref: a,
|
|
237
236
|
className: cn(
|
|
238
|
-
anchorVariants({ color: r, fontSize: s, fontWeight: n, quiet:
|
|
237
|
+
anchorVariants({ color: r, fontSize: s, fontWeight: n, quiet: i }),
|
|
239
238
|
t
|
|
240
239
|
),
|
|
241
|
-
...
|
|
240
|
+
...o,
|
|
242
241
|
children: e
|
|
243
242
|
}
|
|
244
243
|
)
|
|
@@ -287,36 +286,36 @@ const alertVariants = cva(
|
|
|
287
286
|
shape: r = "circle",
|
|
288
287
|
className: s,
|
|
289
288
|
children: n,
|
|
290
|
-
...
|
|
291
|
-
},
|
|
289
|
+
...i
|
|
290
|
+
}, o) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
292
291
|
"div",
|
|
293
292
|
{
|
|
294
|
-
ref:
|
|
293
|
+
ref: o,
|
|
295
294
|
className: cn(avatarVariants({ variant: e, size: t, shape: r }), s),
|
|
296
|
-
...
|
|
295
|
+
...i,
|
|
297
296
|
children: n
|
|
298
297
|
}
|
|
299
298
|
)
|
|
300
299
|
), AvatarImage = forwardRef(
|
|
301
|
-
({ src: e, alt: t, className: r, onError: s, ...n },
|
|
302
|
-
const [
|
|
300
|
+
({ src: e, alt: t, className: r, onError: s, ...n }, i) => {
|
|
301
|
+
const [o, a] = useState(!1);
|
|
303
302
|
useEffect(() => {
|
|
304
303
|
a(!1);
|
|
305
304
|
}, [e]);
|
|
306
|
-
const
|
|
307
|
-
(
|
|
308
|
-
a(!0), s?.(
|
|
305
|
+
const l = useCallback(
|
|
306
|
+
(c) => {
|
|
307
|
+
a(!0), s?.(c);
|
|
309
308
|
},
|
|
310
309
|
[s]
|
|
311
310
|
);
|
|
312
|
-
return
|
|
311
|
+
return o ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
313
312
|
"img",
|
|
314
313
|
{
|
|
315
|
-
ref:
|
|
314
|
+
ref: i,
|
|
316
315
|
src: e,
|
|
317
316
|
alt: t,
|
|
318
317
|
className: cn(avatarImageVariants(), r),
|
|
319
|
-
onError:
|
|
318
|
+
onError: l,
|
|
320
319
|
...n
|
|
321
320
|
}
|
|
322
321
|
);
|
|
@@ -486,16 +485,16 @@ const alertVariants = cva(
|
|
|
486
485
|
color: r = "primary",
|
|
487
486
|
size: s = "md",
|
|
488
487
|
iconLeft: n,
|
|
489
|
-
iconRight:
|
|
490
|
-
className:
|
|
488
|
+
iconRight: i,
|
|
489
|
+
className: o,
|
|
491
490
|
children: a,
|
|
492
|
-
...
|
|
493
|
-
},
|
|
494
|
-
const d = !(a != null && a !== "") && !!(n ||
|
|
491
|
+
...l
|
|
492
|
+
}, c) => {
|
|
493
|
+
const d = !(a != null && a !== "") && !!(n || i);
|
|
495
494
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
496
495
|
"span",
|
|
497
496
|
{
|
|
498
|
-
ref:
|
|
497
|
+
ref: c,
|
|
499
498
|
className: cn(
|
|
500
499
|
badgeVariants({
|
|
501
500
|
variant: e,
|
|
@@ -504,18 +503,18 @@ const alertVariants = cva(
|
|
|
504
503
|
size: s,
|
|
505
504
|
iconOnly: d
|
|
506
505
|
}),
|
|
507
|
-
|
|
506
|
+
o
|
|
508
507
|
),
|
|
509
|
-
...
|
|
508
|
+
...l,
|
|
510
509
|
children: d ? (
|
|
511
510
|
// Icon-only mode: display only the icon
|
|
512
|
-
n ||
|
|
511
|
+
n || i
|
|
513
512
|
) : (
|
|
514
513
|
// Normal mode: display icon(s) and text
|
|
515
514
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
516
515
|
n,
|
|
517
516
|
a,
|
|
518
|
-
|
|
517
|
+
i
|
|
519
518
|
] })
|
|
520
519
|
)
|
|
521
520
|
}
|
|
@@ -538,13 +537,13 @@ const SvgSpenicleSquare = (e) => /* @__PURE__ */ React.createElement("svg", { wi
|
|
|
538
537
|
}
|
|
539
538
|
}), BrandLogo = forwardRef(
|
|
540
539
|
({ shape: e = "square", size: t, ...r }, s) => {
|
|
541
|
-
const
|
|
540
|
+
const i = {
|
|
542
541
|
square: SvgSpenicleSquare,
|
|
543
542
|
rounded: SvgSpenicleRounded,
|
|
544
543
|
circle: SvgSpenicleCircle
|
|
545
544
|
}[e] || SvgSpenicleSquare;
|
|
546
545
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
547
|
-
|
|
546
|
+
i,
|
|
548
547
|
{
|
|
549
548
|
ref: s,
|
|
550
549
|
...r,
|
|
@@ -618,21 +617,21 @@ const SvgSpenicleSquare = (e) => /* @__PURE__ */ React.createElement("svg", { wi
|
|
|
618
617
|
variant: r = "primary",
|
|
619
618
|
size: s = "md",
|
|
620
619
|
disabled: n = !1,
|
|
621
|
-
type:
|
|
622
|
-
children:
|
|
620
|
+
type: i = "button",
|
|
621
|
+
children: o,
|
|
623
622
|
...a
|
|
624
|
-
},
|
|
623
|
+
}, l) {
|
|
625
624
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
626
625
|
"button",
|
|
627
626
|
{
|
|
628
|
-
ref:
|
|
629
|
-
type:
|
|
627
|
+
ref: l,
|
|
628
|
+
type: i,
|
|
630
629
|
className: cn(buttonVariants({ variant: r, size: s }), t),
|
|
631
630
|
disabled: n,
|
|
632
631
|
"aria-disabled": n,
|
|
633
632
|
inert: n ? !0 : void 0,
|
|
634
633
|
...a,
|
|
635
|
-
children:
|
|
634
|
+
children: o
|
|
636
635
|
}
|
|
637
636
|
);
|
|
638
637
|
}
|
|
@@ -704,36 +703,36 @@ const SvgSpenicleSquare = (e) => /* @__PURE__ */ React.createElement("svg", { wi
|
|
|
704
703
|
}
|
|
705
704
|
);
|
|
706
705
|
function useFloatingPosition(e, t = "1rem") {
|
|
707
|
-
const r = useRef(null), [s, n] = useState({}), [
|
|
708
|
-
const
|
|
709
|
-
if (!
|
|
710
|
-
const
|
|
706
|
+
const r = useRef(null), [s, n] = useState({}), [i, o] = useState("fixed bottom-4 right-4"), a = useCallback(() => {
|
|
707
|
+
const c = r.current;
|
|
708
|
+
if (!c) return;
|
|
709
|
+
const h = c.getBoundingClientRect().height > window.innerHeight;
|
|
711
710
|
let d = {}, p = "";
|
|
712
|
-
|
|
711
|
+
h ? (d = {
|
|
713
712
|
position: "fixed",
|
|
714
713
|
bottom: t,
|
|
715
714
|
zIndex: 50,
|
|
716
|
-
transform: `translateY(${
|
|
715
|
+
transform: `translateY(${c.scrollTop}px)`
|
|
717
716
|
}, p = `fixed bottom-4 ${e}-4`) : (d = {
|
|
718
717
|
position: "fixed",
|
|
719
718
|
bottom: t,
|
|
720
719
|
zIndex: 50
|
|
721
|
-
}, p = `fixed bottom-4 ${e}-4`), n(d),
|
|
720
|
+
}, p = `fixed bottom-4 ${e}-4`), n(d), o(p);
|
|
722
721
|
}, [e, t]);
|
|
723
722
|
return useEffect(() => {
|
|
724
723
|
a();
|
|
725
|
-
const
|
|
726
|
-
return
|
|
727
|
-
|
|
724
|
+
const c = r.current;
|
|
725
|
+
return c && c.addEventListener("scroll", a), window.addEventListener("resize", a), () => {
|
|
726
|
+
c && c.removeEventListener("scroll", a), window.removeEventListener("resize", a);
|
|
728
727
|
};
|
|
729
728
|
}, [a]), useEffect(() => {
|
|
730
729
|
r.current && a();
|
|
731
730
|
}, [e, t, a]), [useCallback(
|
|
732
|
-
(
|
|
733
|
-
r.current =
|
|
731
|
+
(c) => {
|
|
732
|
+
r.current = c, c && a();
|
|
734
733
|
},
|
|
735
734
|
[a]
|
|
736
|
-
), s,
|
|
735
|
+
), s, i];
|
|
737
736
|
}
|
|
738
737
|
const ButtonFloat = forwardRef(
|
|
739
738
|
function({
|
|
@@ -741,28 +740,28 @@ const ButtonFloat = forwardRef(
|
|
|
741
740
|
variant: r = "primary",
|
|
742
741
|
size: s = "md",
|
|
743
742
|
side: n = "right",
|
|
744
|
-
offset:
|
|
745
|
-
...
|
|
743
|
+
offset: i = "1rem",
|
|
744
|
+
...o
|
|
746
745
|
}, a) {
|
|
747
|
-
const [
|
|
746
|
+
const [l, c, x] = useFloatingPosition(
|
|
748
747
|
n,
|
|
749
|
-
|
|
750
|
-
), [
|
|
748
|
+
i
|
|
749
|
+
), [h, d] = useState(!1);
|
|
751
750
|
return useEffect(() => {
|
|
752
751
|
d(!0);
|
|
753
|
-
}, []), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref:
|
|
752
|
+
}, []), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: l, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
754
753
|
"button",
|
|
755
754
|
{
|
|
756
755
|
ref: a,
|
|
757
|
-
type:
|
|
756
|
+
type: o.type || "button",
|
|
758
757
|
className: cn(
|
|
759
758
|
buttonFloatVariants({ variant: r, size: s }),
|
|
760
|
-
|
|
761
|
-
|
|
759
|
+
x,
|
|
760
|
+
h && "animate-fab-in",
|
|
762
761
|
t
|
|
763
762
|
),
|
|
764
|
-
style:
|
|
765
|
-
...
|
|
763
|
+
style: c,
|
|
764
|
+
...o
|
|
766
765
|
}
|
|
767
766
|
) });
|
|
768
767
|
}
|
|
@@ -884,13 +883,13 @@ const buttonIconVariants = cva(
|
|
|
884
883
|
size: "md",
|
|
885
884
|
color: "primary"
|
|
886
885
|
}
|
|
887
|
-
}), Icon = React__default.forwardRef(function({ as: t, color: r = "primary", size: s = "md", className: n, ...
|
|
886
|
+
}), Icon = React__default.forwardRef(function({ as: t, color: r = "primary", size: s = "md", className: n, ...i }, o) {
|
|
888
887
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
889
888
|
t,
|
|
890
889
|
{
|
|
891
|
-
ref:
|
|
890
|
+
ref: o,
|
|
892
891
|
className: iconVariants({ color: r, size: s, className: n }),
|
|
893
|
-
...
|
|
892
|
+
...i
|
|
894
893
|
}
|
|
895
894
|
);
|
|
896
895
|
}), ButtonIcon = React__default.forwardRef(
|
|
@@ -899,15 +898,15 @@ const buttonIconVariants = cva(
|
|
|
899
898
|
variant: r = "primary",
|
|
900
899
|
size: s = "md",
|
|
901
900
|
shape: n = "rounded",
|
|
902
|
-
disabled:
|
|
903
|
-
as:
|
|
901
|
+
disabled: i = !1,
|
|
902
|
+
as: o,
|
|
904
903
|
"aria-label": a,
|
|
905
|
-
...
|
|
906
|
-
},
|
|
904
|
+
...l
|
|
905
|
+
}, c) {
|
|
907
906
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
908
907
|
"button",
|
|
909
908
|
{
|
|
910
|
-
ref:
|
|
909
|
+
ref: c,
|
|
911
910
|
type: "button",
|
|
912
911
|
className: cn(
|
|
913
912
|
buttonIconVariants({
|
|
@@ -917,15 +916,15 @@ const buttonIconVariants = cva(
|
|
|
917
916
|
}),
|
|
918
917
|
t
|
|
919
918
|
),
|
|
920
|
-
disabled:
|
|
921
|
-
"aria-disabled":
|
|
919
|
+
disabled: i,
|
|
920
|
+
"aria-disabled": i,
|
|
922
921
|
"aria-label": a,
|
|
923
|
-
inert:
|
|
924
|
-
...
|
|
922
|
+
inert: i ? !0 : void 0,
|
|
923
|
+
...l,
|
|
925
924
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
926
925
|
Icon,
|
|
927
926
|
{
|
|
928
|
-
as:
|
|
927
|
+
as: o,
|
|
929
928
|
size: s,
|
|
930
929
|
color: getIconColorFromVariant(r)
|
|
931
930
|
}
|
|
@@ -1050,8 +1049,8 @@ const BUTTONS = [
|
|
|
1050
1049
|
disabled: r,
|
|
1051
1050
|
className: s,
|
|
1052
1051
|
"aria-label": n
|
|
1053
|
-
},
|
|
1054
|
-
const { input:
|
|
1052
|
+
}, i) => {
|
|
1053
|
+
const { input: o, inputRef: a, handleButton: l, handleInput: c } = useCalculator({
|
|
1055
1054
|
initialValue: e,
|
|
1056
1055
|
disabled: r,
|
|
1057
1056
|
onChange: t
|
|
@@ -1059,7 +1058,7 @@ const BUTTONS = [
|
|
|
1059
1058
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1060
1059
|
"div",
|
|
1061
1060
|
{
|
|
1062
|
-
ref:
|
|
1061
|
+
ref: i,
|
|
1063
1062
|
className: cn(calculatorRootVariants({ disabled: r }), s),
|
|
1064
1063
|
"aria-label": n || "Calculator",
|
|
1065
1064
|
role: "region",
|
|
@@ -1069,21 +1068,21 @@ const BUTTONS = [
|
|
|
1069
1068
|
{
|
|
1070
1069
|
ref: a,
|
|
1071
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)]",
|
|
1072
|
-
value:
|
|
1073
|
-
onChange:
|
|
1071
|
+
value: o,
|
|
1072
|
+
onChange: c,
|
|
1074
1073
|
disabled: r,
|
|
1075
1074
|
inputMode: "decimal",
|
|
1076
1075
|
"aria-label": "Calculator input"
|
|
1077
1076
|
}
|
|
1078
1077
|
),
|
|
1079
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1 mb-3", children: BUTTONS.map((
|
|
1078
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1 mb-3", children: BUTTONS.map((x, h) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex w-full", children: x.map((d) => d === "⌫" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1080
1079
|
ButtonIcon,
|
|
1081
1080
|
{
|
|
1082
1081
|
as: X,
|
|
1083
1082
|
variant: "danger-ghost",
|
|
1084
1083
|
"aria-label": "Backspace",
|
|
1085
1084
|
size: "md",
|
|
1086
|
-
onClick: () =>
|
|
1085
|
+
onClick: () => l("⌫"),
|
|
1087
1086
|
disabled: r
|
|
1088
1087
|
},
|
|
1089
1088
|
"backspace"
|
|
@@ -1091,20 +1090,141 @@ const BUTTONS = [
|
|
|
1091
1090
|
CalculatorButton,
|
|
1092
1091
|
{
|
|
1093
1092
|
variant: d === "=" ? "action" : d === "C" ? "danger" : ["/", "*", "-", "+", "/"].includes(d) ? "operator" : "default",
|
|
1094
|
-
onClick: () =>
|
|
1093
|
+
onClick: () => l(d),
|
|
1095
1094
|
disabled: r,
|
|
1096
1095
|
"aria-label": d,
|
|
1097
1096
|
children: d
|
|
1098
1097
|
},
|
|
1099
1098
|
d
|
|
1100
|
-
)) },
|
|
1099
|
+
)) }, h)) })
|
|
1101
1100
|
]
|
|
1102
1101
|
}
|
|
1103
1102
|
);
|
|
1104
1103
|
}
|
|
1105
1104
|
);
|
|
1106
1105
|
Calculator.displayName = "Calculator";
|
|
1107
|
-
const
|
|
1106
|
+
const textVariants = cva("", {
|
|
1107
|
+
variants: {
|
|
1108
|
+
color: {
|
|
1109
|
+
primary: "text-primary",
|
|
1110
|
+
secondary: "text-secondary",
|
|
1111
|
+
tertiary: "text-tertiary",
|
|
1112
|
+
ghost: "text-ghost",
|
|
1113
|
+
neutral: "text-ghost",
|
|
1114
|
+
success: "text-success",
|
|
1115
|
+
info: "text-info",
|
|
1116
|
+
warning: "text-warning",
|
|
1117
|
+
danger: "text-danger",
|
|
1118
|
+
inherit: "",
|
|
1119
|
+
gray: "text-gray-500",
|
|
1120
|
+
black: "text-black",
|
|
1121
|
+
white: "text-white"
|
|
1122
|
+
},
|
|
1123
|
+
hasUnderline: {
|
|
1124
|
+
true: "underline",
|
|
1125
|
+
false: ""
|
|
1126
|
+
},
|
|
1127
|
+
isCapitalize: {
|
|
1128
|
+
true: "capitalize",
|
|
1129
|
+
false: ""
|
|
1130
|
+
},
|
|
1131
|
+
align: {
|
|
1132
|
+
left: "text-left",
|
|
1133
|
+
center: "text-center",
|
|
1134
|
+
right: "text-right",
|
|
1135
|
+
justify: "text-justify"
|
|
1136
|
+
},
|
|
1137
|
+
italic: {
|
|
1138
|
+
true: "italic",
|
|
1139
|
+
false: ""
|
|
1140
|
+
},
|
|
1141
|
+
clamp: {
|
|
1142
|
+
1: "line-clamp-1",
|
|
1143
|
+
2: "line-clamp-2",
|
|
1144
|
+
3: "line-clamp-3",
|
|
1145
|
+
4: "line-clamp-4",
|
|
1146
|
+
5: "line-clamp-5",
|
|
1147
|
+
none: ""
|
|
1148
|
+
},
|
|
1149
|
+
ellipsis: {
|
|
1150
|
+
true: "truncate",
|
|
1151
|
+
false: ""
|
|
1152
|
+
},
|
|
1153
|
+
as: {
|
|
1154
|
+
h1: "font-bold text-4xl leading-loose",
|
|
1155
|
+
h2: "font-semibold text-3xl leading-relaxed",
|
|
1156
|
+
h3: "font-medium text-2xl leading-relaxed",
|
|
1157
|
+
h4: "font-bold text-xl leading-normal",
|
|
1158
|
+
h5: "font-semibold text-lg leading-normal",
|
|
1159
|
+
h6: "font-medium text-base leading-normal",
|
|
1160
|
+
p: "font-normal text-base leading-normal",
|
|
1161
|
+
span: "font-normal text-base leading-normal",
|
|
1162
|
+
label: "font-normal text-xs leading-normal"
|
|
1163
|
+
}
|
|
1164
|
+
},
|
|
1165
|
+
defaultVariants: {
|
|
1166
|
+
color: "neutral",
|
|
1167
|
+
hasUnderline: !1,
|
|
1168
|
+
isCapitalize: !1,
|
|
1169
|
+
align: "left",
|
|
1170
|
+
italic: !1,
|
|
1171
|
+
clamp: "none",
|
|
1172
|
+
ellipsis: !1,
|
|
1173
|
+
as: "span"
|
|
1174
|
+
}
|
|
1175
|
+
}), Text = forwardRef(
|
|
1176
|
+
({
|
|
1177
|
+
as: e = "span",
|
|
1178
|
+
color: t = "ghost",
|
|
1179
|
+
hasUnderline: r = !1,
|
|
1180
|
+
isCapitalize: s = !1,
|
|
1181
|
+
align: n = "left",
|
|
1182
|
+
italic: i = !1,
|
|
1183
|
+
clamp: o = "none",
|
|
1184
|
+
ellipsis: a = !1,
|
|
1185
|
+
fontSize: l,
|
|
1186
|
+
fontWeight: c,
|
|
1187
|
+
className: x,
|
|
1188
|
+
children: h,
|
|
1189
|
+
...d
|
|
1190
|
+
}, p) => {
|
|
1191
|
+
const f = [
|
|
1192
|
+
"h1",
|
|
1193
|
+
"h2",
|
|
1194
|
+
"h3",
|
|
1195
|
+
"h4",
|
|
1196
|
+
"h5",
|
|
1197
|
+
"h6",
|
|
1198
|
+
"p",
|
|
1199
|
+
"span",
|
|
1200
|
+
"label"
|
|
1201
|
+
].includes(e) ? e : "span", v = l ? `text-${l}` : "", w = c ? `font-${c}` : "";
|
|
1202
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1203
|
+
e,
|
|
1204
|
+
{
|
|
1205
|
+
ref: p,
|
|
1206
|
+
className: cn(
|
|
1207
|
+
textVariants({
|
|
1208
|
+
color: t,
|
|
1209
|
+
hasUnderline: r,
|
|
1210
|
+
isCapitalize: s,
|
|
1211
|
+
align: n,
|
|
1212
|
+
italic: i,
|
|
1213
|
+
clamp: o,
|
|
1214
|
+
ellipsis: a,
|
|
1215
|
+
// @ts-expect-error - `as` is not a valid variant
|
|
1216
|
+
as: f
|
|
1217
|
+
}),
|
|
1218
|
+
v,
|
|
1219
|
+
w,
|
|
1220
|
+
x
|
|
1221
|
+
),
|
|
1222
|
+
...d,
|
|
1223
|
+
children: h
|
|
1224
|
+
}
|
|
1225
|
+
);
|
|
1226
|
+
}
|
|
1227
|
+
), CalendarContext = createContext(null);
|
|
1108
1228
|
function useCalendarContext() {
|
|
1109
1229
|
const e = useContext(CalendarContext);
|
|
1110
1230
|
if (!e)
|
|
@@ -1147,27 +1267,27 @@ const CalendarHeader = () => {
|
|
|
1147
1267
|
] })
|
|
1148
1268
|
] });
|
|
1149
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 = () => {
|
|
1150
|
-
const e = useCalendarContext(), { year: t, month: r, value: s, onChange: n, setMonth:
|
|
1151
|
-
for (let g = 0; g <
|
|
1152
|
-
const
|
|
1270
|
+
const e = useCalendarContext(), { year: t, month: r, value: s, onChange: n, setMonth: i, 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
|
+
for (let g = 0; g < c; g++) {
|
|
1272
|
+
const m = p - c + g + 1;
|
|
1153
1273
|
v.push(
|
|
1154
1274
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1155
1275
|
ButtonIcon,
|
|
1156
1276
|
{
|
|
1157
|
-
as: () => /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "span", fontSize: "sm", color: "tertiary", children:
|
|
1277
|
+
as: () => /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "span", fontSize: "sm", color: "tertiary", children: m }),
|
|
1158
1278
|
size: "sm",
|
|
1159
1279
|
"aria-label": "Previous month day",
|
|
1160
1280
|
variant: "ghost",
|
|
1161
1281
|
onClick: () => {
|
|
1162
|
-
n?.(new Date(d,
|
|
1282
|
+
n?.(new Date(d, h, m)), i(h), o(d);
|
|
1163
1283
|
}
|
|
1164
1284
|
},
|
|
1165
1285
|
"prev-" + g
|
|
1166
1286
|
)
|
|
1167
1287
|
);
|
|
1168
1288
|
}
|
|
1169
|
-
for (let g = 1; g <=
|
|
1170
|
-
const
|
|
1289
|
+
for (let g = 1; g <= x; g++) {
|
|
1290
|
+
const m = s instanceof Date && s.getFullYear() === t && s.getMonth() === r && s.getDate() === g;
|
|
1171
1291
|
v.push(
|
|
1172
1292
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1173
1293
|
ButtonIcon,
|
|
@@ -1177,15 +1297,15 @@ const CalendarHeader = () => {
|
|
|
1177
1297
|
{
|
|
1178
1298
|
as: "span",
|
|
1179
1299
|
fontSize: "sm",
|
|
1180
|
-
color:
|
|
1181
|
-
className:
|
|
1300
|
+
color: m ? "inherit" : "ghost",
|
|
1301
|
+
className: m ? "bg-primary text-white rounded-full" : "",
|
|
1182
1302
|
children: g
|
|
1183
1303
|
}
|
|
1184
1304
|
),
|
|
1185
|
-
variant:
|
|
1305
|
+
variant: m ? "primary" : "ghost",
|
|
1186
1306
|
size: "sm",
|
|
1187
1307
|
"aria-label": `Select ${t}-${r + 1}-${g}`,
|
|
1188
|
-
"aria-current":
|
|
1308
|
+
"aria-current": m ? "date" : void 0,
|
|
1189
1309
|
onClick: () => {
|
|
1190
1310
|
n?.(new Date(t, r, g));
|
|
1191
1311
|
}
|
|
@@ -1194,7 +1314,7 @@ const CalendarHeader = () => {
|
|
|
1194
1314
|
)
|
|
1195
1315
|
);
|
|
1196
1316
|
}
|
|
1197
|
-
const w =
|
|
1317
|
+
const w = c + x;
|
|
1198
1318
|
for (let g = 0; g < (w % 7 === 0 ? 0 : 7 - w % 7); g++)
|
|
1199
1319
|
v.push(
|
|
1200
1320
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -1205,7 +1325,7 @@ const CalendarHeader = () => {
|
|
|
1205
1325
|
"aria-label": "Next month day",
|
|
1206
1326
|
variant: "ghost",
|
|
1207
1327
|
onClick: () => {
|
|
1208
|
-
n?.(new Date(f, y, g + 1)),
|
|
1328
|
+
n?.(new Date(f, y, g + 1)), i(y), o(f);
|
|
1209
1329
|
}
|
|
1210
1330
|
},
|
|
1211
1331
|
"next-" + g
|
|
@@ -1213,35 +1333,35 @@ const CalendarHeader = () => {
|
|
|
1213
1333
|
);
|
|
1214
1334
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-7 gap-2 px-4 pb-4", children: v });
|
|
1215
1335
|
}, CalendarDaysRange = () => {
|
|
1216
|
-
const { year: e, month: t, value: r, onChange: s, setMonth: n, setYear:
|
|
1336
|
+
const { year: e, month: t, value: r, onChange: s, setMonth: n, setYear: i } = 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 = () => {
|
|
1217
1337
|
if (!Array.isArray(r)) return [null, null];
|
|
1218
|
-
const [
|
|
1219
|
-
return !
|
|
1220
|
-
}, [w, g] = v(),
|
|
1338
|
+
const [u, b] = r;
|
|
1339
|
+
return !u && !b ? [null, null] : u && b ? u <= b ? [u, b] : [b, u] : [u, b];
|
|
1340
|
+
}, [w, g] = v(), m = (u) => {
|
|
1221
1341
|
if (!w || !g) return !1;
|
|
1222
|
-
const
|
|
1223
|
-
return
|
|
1224
|
-
},
|
|
1225
|
-
for (let
|
|
1226
|
-
const
|
|
1342
|
+
const b = new Date(e, t, u);
|
|
1343
|
+
return b >= w && b <= g;
|
|
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
|
+
for (let u = 0; u < l; u++) {
|
|
1346
|
+
const b = d - l + u + 1;
|
|
1227
1347
|
f.push(
|
|
1228
1348
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1229
1349
|
ButtonIcon,
|
|
1230
1350
|
{
|
|
1231
|
-
as: () => /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "span", fontSize: "sm", color: "tertiary", children:
|
|
1351
|
+
as: () => /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "span", fontSize: "sm", color: "tertiary", children: b }),
|
|
1232
1352
|
size: "sm",
|
|
1233
1353
|
"aria-label": "Previous month day",
|
|
1234
1354
|
variant: "ghost",
|
|
1235
1355
|
onClick: () => {
|
|
1236
|
-
s?.([null, null]), n(
|
|
1356
|
+
s?.([null, null]), n(x), i(h);
|
|
1237
1357
|
}
|
|
1238
1358
|
},
|
|
1239
|
-
"prev-" +
|
|
1359
|
+
"prev-" + u
|
|
1240
1360
|
)
|
|
1241
1361
|
);
|
|
1242
1362
|
}
|
|
1243
|
-
for (let
|
|
1244
|
-
const
|
|
1363
|
+
for (let u = 1; u <= c; u++) {
|
|
1364
|
+
const b = m(u), E = S(u), C = I(u);
|
|
1245
1365
|
f.push(
|
|
1246
1366
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1247
1367
|
ButtonIcon,
|
|
@@ -1251,47 +1371,47 @@ const CalendarHeader = () => {
|
|
|
1251
1371
|
{
|
|
1252
1372
|
as: "span",
|
|
1253
1373
|
fontSize: "sm",
|
|
1254
|
-
color:
|
|
1374
|
+
color: b || E || C ? "inherit" : "ghost",
|
|
1255
1375
|
className: cn(
|
|
1256
|
-
|
|
1376
|
+
b && " bg-primary text-white",
|
|
1257
1377
|
E && "rounded-l-full bg-primary text-white",
|
|
1258
1378
|
C && "rounded-r-full bg-primary text-white"
|
|
1259
1379
|
),
|
|
1260
|
-
children:
|
|
1380
|
+
children: u
|
|
1261
1381
|
}
|
|
1262
1382
|
),
|
|
1263
|
-
variant: E || C ||
|
|
1383
|
+
variant: E || C || b ? "primary" : "ghost",
|
|
1264
1384
|
size: "sm",
|
|
1265
|
-
"aria-label": `Select ${e}-${t + 1}-${
|
|
1385
|
+
"aria-label": `Select ${e}-${t + 1}-${u}`,
|
|
1266
1386
|
"aria-current": E || C ? "date" : void 0,
|
|
1267
1387
|
onClick: () => {
|
|
1268
1388
|
if (!Array.isArray(r) || !r[0] || r[0] && r[1])
|
|
1269
|
-
s?.([new Date(e, t,
|
|
1389
|
+
s?.([new Date(e, t, u), null]);
|
|
1270
1390
|
else if (r[0] && !r[1]) {
|
|
1271
|
-
const j = r[0], R = new Date(e, t,
|
|
1391
|
+
const j = r[0], R = new Date(e, t, u);
|
|
1272
1392
|
j.getTime() === R.getTime() ? s?.([j, R]) : s?.(j < R ? [j, R] : [R, j]);
|
|
1273
1393
|
}
|
|
1274
1394
|
}
|
|
1275
1395
|
},
|
|
1276
|
-
|
|
1396
|
+
u
|
|
1277
1397
|
)
|
|
1278
1398
|
);
|
|
1279
1399
|
}
|
|
1280
|
-
const N =
|
|
1281
|
-
for (let
|
|
1400
|
+
const N = l + c;
|
|
1401
|
+
for (let u = 0; u < (N % 7 === 0 ? 0 : 7 - N % 7); u++)
|
|
1282
1402
|
f.push(
|
|
1283
1403
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1284
1404
|
ButtonIcon,
|
|
1285
1405
|
{
|
|
1286
|
-
as: () => /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "span", fontSize: "sm", color: "tertiary", children:
|
|
1406
|
+
as: () => /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "span", fontSize: "sm", color: "tertiary", children: u + 1 }),
|
|
1287
1407
|
size: "sm",
|
|
1288
1408
|
"aria-label": "Next month day",
|
|
1289
1409
|
variant: "ghost",
|
|
1290
1410
|
onClick: () => {
|
|
1291
|
-
s?.([null, null]), n(p),
|
|
1411
|
+
s?.([null, null]), n(p), i(y);
|
|
1292
1412
|
}
|
|
1293
1413
|
},
|
|
1294
|
-
"next-" +
|
|
1414
|
+
"next-" + u
|
|
1295
1415
|
)
|
|
1296
1416
|
);
|
|
1297
1417
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-7 gap-2 px-4 pb-4", children: f });
|
|
@@ -1306,30 +1426,30 @@ function useCalendar({
|
|
|
1306
1426
|
initialYear: s,
|
|
1307
1427
|
initialMonth: n
|
|
1308
1428
|
}) {
|
|
1309
|
-
const [
|
|
1429
|
+
const [i, o] = useState(n), [a, l] = useState(s), [c, x] = useState([
|
|
1310
1430
|
null,
|
|
1311
1431
|
null
|
|
1312
1432
|
]);
|
|
1313
|
-
let
|
|
1314
|
-
t === "range" && !e && (
|
|
1433
|
+
let h = e;
|
|
1434
|
+
t === "range" && !e && (h = c);
|
|
1315
1435
|
const d = useCallback(() => {
|
|
1316
|
-
const f =
|
|
1317
|
-
|
|
1318
|
-
}, [
|
|
1319
|
-
const f =
|
|
1320
|
-
|
|
1321
|
-
}, [
|
|
1436
|
+
const f = i === 0 ? 11 : i - 1, v = i === 0 ? a - 1 : a;
|
|
1437
|
+
o(f), l(v), t === "single" && r?.(new Date(v, f, 1));
|
|
1438
|
+
}, [i, a, t, r]), p = useCallback(() => {
|
|
1439
|
+
const f = i === 11 ? 0 : i + 1, v = i === 11 ? a + 1 : a;
|
|
1440
|
+
o(f), l(v), t === "single" && r?.(new Date(v, f, 1));
|
|
1441
|
+
}, [i, a, t, r]), y = useCallback(
|
|
1322
1442
|
(f) => {
|
|
1323
|
-
t === "single" ? r?.(f) : t === "range" && (
|
|
1443
|
+
t === "single" ? r?.(f) : t === "range" && (x(f), r?.(f));
|
|
1324
1444
|
},
|
|
1325
1445
|
[t, r]
|
|
1326
1446
|
);
|
|
1327
1447
|
return {
|
|
1328
1448
|
year: a,
|
|
1329
|
-
month:
|
|
1330
|
-
value:
|
|
1331
|
-
setMonth:
|
|
1332
|
-
setYear:
|
|
1449
|
+
month: i,
|
|
1450
|
+
value: h,
|
|
1451
|
+
setMonth: o,
|
|
1452
|
+
setYear: l,
|
|
1333
1453
|
onChange: y,
|
|
1334
1454
|
handlePrevMonth: d,
|
|
1335
1455
|
handleNextMonth: p
|
|
@@ -1342,24 +1462,24 @@ const CalendarRoot = ({
|
|
|
1342
1462
|
type: s = "single",
|
|
1343
1463
|
...n
|
|
1344
1464
|
}) => {
|
|
1345
|
-
const
|
|
1465
|
+
const i = /* @__PURE__ */ new Date(), o = useCalendar({
|
|
1346
1466
|
value: e,
|
|
1347
1467
|
onChange: t,
|
|
1348
1468
|
type: s,
|
|
1349
|
-
initialYear:
|
|
1350
|
-
initialMonth:
|
|
1469
|
+
initialYear: i.getFullYear(),
|
|
1470
|
+
initialMonth: i.getMonth()
|
|
1351
1471
|
});
|
|
1352
1472
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1353
1473
|
CalendarContext.Provider,
|
|
1354
1474
|
{
|
|
1355
1475
|
value: {
|
|
1356
|
-
year:
|
|
1357
|
-
month:
|
|
1358
|
-
value:
|
|
1476
|
+
year: o.year,
|
|
1477
|
+
month: o.month,
|
|
1478
|
+
value: o.value,
|
|
1359
1479
|
type: s,
|
|
1360
|
-
setMonth:
|
|
1361
|
-
setYear:
|
|
1362
|
-
onChange:
|
|
1480
|
+
setMonth: o.setMonth,
|
|
1481
|
+
setYear: o.setYear,
|
|
1482
|
+
onChange: o.onChange
|
|
1363
1483
|
},
|
|
1364
1484
|
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("select-none", r), ...n, children: [
|
|
1365
1485
|
/* @__PURE__ */ jsxRuntimeExports.jsx(CalendarHeader, {}),
|
|
@@ -1368,7 +1488,104 @@ const CalendarRoot = ({
|
|
|
1368
1488
|
] })
|
|
1369
1489
|
}
|
|
1370
1490
|
);
|
|
1371
|
-
}, 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, ...n }, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1549
|
+
"div",
|
|
1550
|
+
{
|
|
1551
|
+
ref: i,
|
|
1552
|
+
className: cn(tileVariants({ variant: e, size: t, shape: r }), s),
|
|
1553
|
+
...n
|
|
1554
|
+
}
|
|
1555
|
+
)
|
|
1556
|
+
), Card = forwardRef(
|
|
1557
|
+
({
|
|
1558
|
+
size: e = "md",
|
|
1559
|
+
shape: t = "rounded",
|
|
1560
|
+
avatar: r,
|
|
1561
|
+
title: s,
|
|
1562
|
+
subtitle: n,
|
|
1563
|
+
badge: i,
|
|
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", !i && !o && "mb-0"), children: [
|
|
1577
|
+
s && /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "h3", fontSize: "base", fontWeight: "semibold", children: s }),
|
|
1578
|
+
n && /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "p", fontSize: "xs", color: "gray", children: n })
|
|
1579
|
+
] }),
|
|
1580
|
+
(i || o) && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
|
|
1581
|
+
i,
|
|
1582
|
+
o && o
|
|
1583
|
+
] })
|
|
1584
|
+
] })
|
|
1585
|
+
] })
|
|
1586
|
+
}
|
|
1587
|
+
)
|
|
1588
|
+
), noResultsVariants = cva(
|
|
1372
1589
|
"flex flex-col items-center justify-center text-center border border-border rounded-lg bg-background",
|
|
1373
1590
|
{
|
|
1374
1591
|
variants: {
|
|
@@ -1394,12 +1611,12 @@ const CalendarRoot = ({
|
|
|
1394
1611
|
), noResultsSubtitleVariants = cva(
|
|
1395
1612
|
"text-foreground-light mb-6 max-w-md"
|
|
1396
1613
|
), NoResults = React__default.forwardRef(
|
|
1397
|
-
function e({ icon: t, title: r, subtitle: s, action: n, className:
|
|
1614
|
+
function e({ icon: t, title: r, subtitle: s, action: n, className: i, hasGrayBackground: o, ...a }, l) {
|
|
1398
1615
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1399
1616
|
"section",
|
|
1400
1617
|
{
|
|
1401
|
-
ref:
|
|
1402
|
-
className: cn(noResultsVariants({ hasGrayBackground:
|
|
1618
|
+
ref: l,
|
|
1619
|
+
className: cn(noResultsVariants({ hasGrayBackground: o }), i),
|
|
1403
1620
|
role: "status",
|
|
1404
1621
|
"aria-label": "No results found",
|
|
1405
1622
|
...a,
|
|
@@ -1547,23 +1764,23 @@ const getTableColumnClass = (e) => {
|
|
|
1547
1764
|
);
|
|
1548
1765
|
}
|
|
1549
1766
|
), TableColumn = forwardRef(
|
|
1550
|
-
({ as: e = "td", span: t, align: r = "left", children: s, className: n, ...
|
|
1767
|
+
({ as: e = "td", span: t, align: r = "left", children: s, className: n, ...i }, o) => {
|
|
1551
1768
|
const a = e === "th" ? "columnheader" : "cell";
|
|
1552
|
-
let
|
|
1553
|
-
return r === "center" ?
|
|
1769
|
+
let l = "text-left";
|
|
1770
|
+
return r === "center" ? l = "text-center" : r === "right" && (l = "text-right"), /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1554
1771
|
"div",
|
|
1555
1772
|
{
|
|
1556
|
-
ref:
|
|
1773
|
+
ref: o,
|
|
1557
1774
|
role: a,
|
|
1558
1775
|
className: cn(
|
|
1559
1776
|
"px-4 py-2",
|
|
1560
1777
|
"[&:not(:last-child)]:border-r [&:not(:last-child)]:border-border",
|
|
1561
1778
|
getRowSpanClass(t),
|
|
1562
|
-
|
|
1779
|
+
l,
|
|
1563
1780
|
"truncate overflow-hidden whitespace-nowrap",
|
|
1564
1781
|
n
|
|
1565
1782
|
),
|
|
1566
|
-
...
|
|
1783
|
+
...i,
|
|
1567
1784
|
children: s
|
|
1568
1785
|
}
|
|
1569
1786
|
);
|
|
@@ -1619,51 +1836,7 @@ const getTableColumnClass = (e) => {
|
|
|
1619
1836
|
Footer: TableFooter,
|
|
1620
1837
|
Row: TableRow,
|
|
1621
1838
|
RowItem: TableRowItem
|
|
1622
|
-
})
|
|
1623
|
-
// Base classes
|
|
1624
|
-
"block transition-colors duration-200",
|
|
1625
|
-
{
|
|
1626
|
-
variants: {
|
|
1627
|
-
variant: {
|
|
1628
|
-
white: "bg-white border border-border",
|
|
1629
|
-
neutral: "bg-neutral border border-gray-200",
|
|
1630
|
-
primary: "bg-primary-soft border border-primary",
|
|
1631
|
-
secondary: "bg-secondary-soft border border-secondary",
|
|
1632
|
-
tertiary: "bg-tertiary-soft border border-tertiary",
|
|
1633
|
-
ghost: "bg-transparent border border-ghost",
|
|
1634
|
-
success: "bg-success-soft border border-success",
|
|
1635
|
-
info: "bg-info-soft border border-info",
|
|
1636
|
-
warning: "bg-warning-soft border border-warning",
|
|
1637
|
-
danger: "bg-danger-soft border border-danger"
|
|
1638
|
-
},
|
|
1639
|
-
size: {
|
|
1640
|
-
xs: "p-2",
|
|
1641
|
-
sm: "p-3",
|
|
1642
|
-
md: "p-4",
|
|
1643
|
-
lg: "p-6",
|
|
1644
|
-
xl: "p-8"
|
|
1645
|
-
},
|
|
1646
|
-
shape: {
|
|
1647
|
-
rounded: "rounded-lg",
|
|
1648
|
-
square: "rounded-none"
|
|
1649
|
-
}
|
|
1650
|
-
},
|
|
1651
|
-
defaultVariants: {
|
|
1652
|
-
variant: "white",
|
|
1653
|
-
size: "md",
|
|
1654
|
-
shape: "rounded"
|
|
1655
|
-
}
|
|
1656
|
-
}
|
|
1657
|
-
), Tile = forwardRef(
|
|
1658
|
-
({ variant: e = "white", size: t = "md", shape: r = "rounded", className: s, ...n }, o) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1659
|
-
"div",
|
|
1660
|
-
{
|
|
1661
|
-
ref: o,
|
|
1662
|
-
className: cn(tileVariants({ variant: e, size: t, shape: r }), s),
|
|
1663
|
-
...n
|
|
1664
|
-
}
|
|
1665
|
-
)
|
|
1666
|
-
);
|
|
1839
|
+
});
|
|
1667
1840
|
function getColSpan(e = 4) {
|
|
1668
1841
|
switch (e) {
|
|
1669
1842
|
case 1:
|
|
@@ -1694,9 +1867,9 @@ function getColSpan(e = 4) {
|
|
|
1694
1867
|
return "col-span-4";
|
|
1695
1868
|
}
|
|
1696
1869
|
}
|
|
1697
|
-
const DescriptionListItem = forwardRef(function e({ children: t, className: r, span: s = 4, ...n },
|
|
1698
|
-
const
|
|
1699
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref:
|
|
1870
|
+
const DescriptionListItem = forwardRef(function e({ children: t, className: r, span: s = 4, ...n }, i) {
|
|
1871
|
+
const o = getColSpan(s);
|
|
1872
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: i, className: cn(o, r), ...n, children: t });
|
|
1700
1873
|
}), DescriptionListTerm = forwardRef(function e({ children: t, ...r }, s) {
|
|
1701
1874
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("dt", { ref: s, ...r, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "span", fontSize: "sm", fontWeight: "medium", color: "gray", children: t }) });
|
|
1702
1875
|
}), DescriptionListDetails = forwardRef(function e({ children: t, color: r = "black", ...s }, n) {
|
|
@@ -1719,25 +1892,25 @@ const DescriptionListItem = forwardRef(function e({ children: t, className: r, s
|
|
|
1719
1892
|
Details: DescriptionListDetails
|
|
1720
1893
|
});
|
|
1721
1894
|
function useImage({ src: e }) {
|
|
1722
|
-
const [t, r] = useState(!1), [s, n] = useState(!1),
|
|
1895
|
+
const [t, r] = useState(!1), [s, n] = useState(!1), i = useRef(!1), o = () => {
|
|
1723
1896
|
r(!0);
|
|
1724
1897
|
}, a = () => {
|
|
1725
1898
|
n(!0);
|
|
1726
1899
|
};
|
|
1727
1900
|
return useEffect(() => {
|
|
1728
1901
|
if (!e) return;
|
|
1729
|
-
const
|
|
1730
|
-
return
|
|
1731
|
-
|
|
1732
|
-
},
|
|
1733
|
-
|
|
1902
|
+
const l = new Image();
|
|
1903
|
+
return l.src = e, l.onload = () => {
|
|
1904
|
+
i.current || r(!0);
|
|
1905
|
+
}, l.onerror = () => {
|
|
1906
|
+
i.current || n(!0);
|
|
1734
1907
|
}, () => {
|
|
1735
|
-
|
|
1908
|
+
i.current = !0;
|
|
1736
1909
|
};
|
|
1737
1910
|
}, [e]), {
|
|
1738
1911
|
loaded: t,
|
|
1739
1912
|
errored: s,
|
|
1740
|
-
handleLoad:
|
|
1913
|
+
handleLoad: o,
|
|
1741
1914
|
handleError: a
|
|
1742
1915
|
};
|
|
1743
1916
|
}
|
|
@@ -1815,13 +1988,13 @@ function BaseImageFallback({
|
|
|
1815
1988
|
height: r,
|
|
1816
1989
|
className: s,
|
|
1817
1990
|
style: n,
|
|
1818
|
-
shape:
|
|
1819
|
-
size:
|
|
1991
|
+
shape: i,
|
|
1992
|
+
size: o
|
|
1820
1993
|
}) {
|
|
1821
1994
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1822
1995
|
"div",
|
|
1823
1996
|
{
|
|
1824
|
-
className: imageAtomVariants({ shape:
|
|
1997
|
+
className: imageAtomVariants({ shape: i, size: o, className: s }),
|
|
1825
1998
|
style: { width: t, height: r, ...n },
|
|
1826
1999
|
"aria-label": e,
|
|
1827
2000
|
role: "img",
|
|
@@ -1846,28 +2019,28 @@ const BaseImage = forwardRef(
|
|
|
1846
2019
|
onLoad: r,
|
|
1847
2020
|
onError: s,
|
|
1848
2021
|
width: n,
|
|
1849
|
-
height:
|
|
1850
|
-
loading:
|
|
2022
|
+
height: i,
|
|
2023
|
+
loading: o = "lazy",
|
|
1851
2024
|
position: a = "cover",
|
|
1852
|
-
size:
|
|
1853
|
-
shape:
|
|
1854
|
-
className:
|
|
1855
|
-
...
|
|
2025
|
+
size: l = "auto",
|
|
2026
|
+
shape: c,
|
|
2027
|
+
className: x,
|
|
2028
|
+
...h
|
|
1856
2029
|
}, d) => {
|
|
1857
2030
|
const { loaded: p, errored: y, handleLoad: f, handleError: v } = useImage({
|
|
1858
2031
|
src: e
|
|
1859
|
-
}), w = typeof n == "number" ? n : Number(n), g = typeof
|
|
2032
|
+
}), w = typeof n == "number" ? n : Number(n), g = typeof i == "number" ? i : Number(i);
|
|
1860
2033
|
return !p && !y ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1861
2034
|
BaseImageSkeleton,
|
|
1862
2035
|
{
|
|
1863
|
-
shape:
|
|
2036
|
+
shape: c,
|
|
1864
2037
|
width: w,
|
|
1865
2038
|
height: g
|
|
1866
2039
|
}
|
|
1867
2040
|
) : y ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1868
2041
|
BaseImageFallback,
|
|
1869
2042
|
{
|
|
1870
|
-
shape:
|
|
2043
|
+
shape: c,
|
|
1871
2044
|
alt: t,
|
|
1872
2045
|
width: w,
|
|
1873
2046
|
height: g
|
|
@@ -1880,22 +2053,22 @@ const BaseImage = forwardRef(
|
|
|
1880
2053
|
alt: t,
|
|
1881
2054
|
width: w,
|
|
1882
2055
|
height: g,
|
|
1883
|
-
loading:
|
|
2056
|
+
loading: o,
|
|
1884
2057
|
className: cn(
|
|
1885
2058
|
imageVariants({
|
|
1886
2059
|
position: a,
|
|
1887
|
-
size:
|
|
1888
|
-
shape:
|
|
2060
|
+
size: l,
|
|
2061
|
+
shape: c
|
|
1889
2062
|
}),
|
|
1890
|
-
|
|
2063
|
+
x
|
|
1891
2064
|
),
|
|
1892
|
-
onLoad: (
|
|
1893
|
-
f(), r?.(
|
|
2065
|
+
onLoad: (m) => {
|
|
2066
|
+
f(), r?.(m);
|
|
1894
2067
|
},
|
|
1895
|
-
onError: (
|
|
1896
|
-
v(), s?.(
|
|
2068
|
+
onError: (m) => {
|
|
2069
|
+
v(), s?.(m);
|
|
1897
2070
|
},
|
|
1898
|
-
...
|
|
2071
|
+
...h
|
|
1899
2072
|
}
|
|
1900
2073
|
);
|
|
1901
2074
|
}
|
|
@@ -1915,9 +2088,11 @@ export {
|
|
|
1915
2088
|
ButtonFloat as e,
|
|
1916
2089
|
ButtonIcon as f,
|
|
1917
2090
|
Calendar as g,
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
2091
|
+
Card as h,
|
|
2092
|
+
Text as i,
|
|
2093
|
+
Tile as j,
|
|
2094
|
+
ImageCircle as k,
|
|
2095
|
+
ImageSquare as l,
|
|
2096
|
+
ImageRectangle as m,
|
|
2097
|
+
BaseImage as n
|
|
1923
2098
|
};
|