@dimasbaguspm/versaur 0.0.26 → 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-CQw_O-4W.js → bottom-sheet-DCwLmjiX.js} +20 -20
- package/dist/js/{bottom-sheet-input-1C3Up2xF.js → bottom-sheet-input-D14wjCoC.js} +2 -2
- package/dist/js/forms/index.js +1 -1
- package/dist/js/{image-rectangle--Sy82Ff9.js → image-rectangle-BGLYH2Gl.js} +205 -151
- package/dist/js/index.js +65 -63
- 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 +16 -15
- package/dist/js/{tabs-CoNG51E1.js → tabs-C0hcpxNk.js} +1 -1
- package/dist/js/{tooltip-BbTHXz6h.js → tooltip-DlbAOUeP.js} +16 -16
- package/dist/js/top-bar-BA88ij4M.js +669 -0
- 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/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/top-bar-BjE0FiE8.js +0 -607
|
@@ -147,14 +147,14 @@ const alertVariants = cva(
|
|
|
147
147
|
icon: r,
|
|
148
148
|
className: s,
|
|
149
149
|
children: n,
|
|
150
|
-
...
|
|
151
|
-
},
|
|
150
|
+
...i
|
|
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
|
+
...i,
|
|
158
158
|
children: [
|
|
159
159
|
r && /* @__PURE__ */ jsxRuntimeExports.jsx(AlertIcon, { children: r }),
|
|
160
160
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1", children: n })
|
|
@@ -227,17 +227,17 @@ const alertVariants = cva(
|
|
|
227
227
|
color: r = "primary",
|
|
228
228
|
fontSize: s = "base",
|
|
229
229
|
fontWeight: n = "medium",
|
|
230
|
-
quiet:
|
|
231
|
-
...
|
|
230
|
+
quiet: i = !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: n, quiet:
|
|
237
|
+
anchorVariants({ color: r, fontSize: s, fontWeight: n, quiet: i }),
|
|
238
238
|
t
|
|
239
239
|
),
|
|
240
|
-
...
|
|
240
|
+
...o,
|
|
241
241
|
children: e
|
|
242
242
|
}
|
|
243
243
|
)
|
|
@@ -286,19 +286,19 @@ const alertVariants = cva(
|
|
|
286
286
|
shape: r = "circle",
|
|
287
287
|
className: s,
|
|
288
288
|
children: n,
|
|
289
|
-
...
|
|
290
|
-
},
|
|
289
|
+
...i
|
|
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
|
-
...
|
|
295
|
+
...i,
|
|
296
296
|
children: n
|
|
297
297
|
}
|
|
298
298
|
)
|
|
299
299
|
), AvatarImage = forwardRef(
|
|
300
|
-
({ src: e, alt: t, className: r, onError: s, ...n },
|
|
301
|
-
const [
|
|
300
|
+
({ src: e, alt: t, className: r, onError: s, ...n }, i) => {
|
|
301
|
+
const [o, a] = useState(!1);
|
|
302
302
|
useEffect(() => {
|
|
303
303
|
a(!1);
|
|
304
304
|
}, [e]);
|
|
@@ -308,10 +308,10 @@ 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: i,
|
|
315
315
|
src: e,
|
|
316
316
|
alt: t,
|
|
317
317
|
className: cn(avatarImageVariants(), r),
|
|
@@ -485,12 +485,12 @@ const alertVariants = cva(
|
|
|
485
485
|
color: r = "primary",
|
|
486
486
|
size: s = "md",
|
|
487
487
|
iconLeft: n,
|
|
488
|
-
iconRight:
|
|
489
|
-
className:
|
|
488
|
+
iconRight: i,
|
|
489
|
+
className: o,
|
|
490
490
|
children: a,
|
|
491
491
|
...l
|
|
492
492
|
}, c) => {
|
|
493
|
-
const d = !(a != null && a !== "") && !!(n ||
|
|
493
|
+
const d = !(a != null && a !== "") && !!(n || i);
|
|
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
|
-
n ||
|
|
511
|
+
n || i
|
|
512
512
|
) : (
|
|
513
513
|
// Normal mode: display icon(s) and text
|
|
514
514
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
515
515
|
n,
|
|
516
516
|
a,
|
|
517
|
-
|
|
517
|
+
i
|
|
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 i = {
|
|
541
541
|
square: SvgSpenicleSquare,
|
|
542
542
|
rounded: SvgSpenicleRounded,
|
|
543
543
|
circle: SvgSpenicleCircle
|
|
544
544
|
}[e] || SvgSpenicleSquare;
|
|
545
545
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
546
|
-
|
|
546
|
+
i,
|
|
547
547
|
{
|
|
548
548
|
ref: s,
|
|
549
549
|
...r,
|
|
@@ -617,21 +617,21 @@ const SvgSpenicleSquare = (e) => /* @__PURE__ */ React.createElement("svg", { wi
|
|
|
617
617
|
variant: r = "primary",
|
|
618
618
|
size: s = "md",
|
|
619
619
|
disabled: n = !1,
|
|
620
|
-
type:
|
|
621
|
-
children:
|
|
620
|
+
type: i = "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: i,
|
|
629
629
|
className: cn(buttonVariants({ variant: r, size: s }), t),
|
|
630
630
|
disabled: n,
|
|
631
631
|
"aria-disabled": n,
|
|
632
632
|
inert: n ? !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, n] = useState({}), [
|
|
706
|
+
const r = useRef(null), [s, n] = useState({}), [i, 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`), n(d),
|
|
720
|
+
}, p = `fixed bottom-4 ${e}-4`), n(d), o(p);
|
|
721
721
|
}, [e, t]);
|
|
722
722
|
return useEffect(() => {
|
|
723
723
|
a();
|
|
@@ -732,7 +732,7 @@ function useFloatingPosition(e, t = "1rem") {
|
|
|
732
732
|
r.current = c, c && a();
|
|
733
733
|
},
|
|
734
734
|
[a]
|
|
735
|
-
), s,
|
|
735
|
+
), s, i];
|
|
736
736
|
}
|
|
737
737
|
const ButtonFloat = forwardRef(
|
|
738
738
|
function({
|
|
@@ -740,12 +740,12 @@ const ButtonFloat = forwardRef(
|
|
|
740
740
|
variant: r = "primary",
|
|
741
741
|
size: s = "md",
|
|
742
742
|
side: n = "right",
|
|
743
|
-
offset:
|
|
744
|
-
...
|
|
743
|
+
offset: i = "1rem",
|
|
744
|
+
...o
|
|
745
745
|
}, a) {
|
|
746
746
|
const [l, c, x] = useFloatingPosition(
|
|
747
747
|
n,
|
|
748
|
-
|
|
748
|
+
i
|
|
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: n, ...
|
|
886
|
+
}), Icon = React__default.forwardRef(function({ as: t, color: r = "primary", size: s = "md", className: n, ...i }, o) {
|
|
887
887
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
888
888
|
t,
|
|
889
889
|
{
|
|
890
|
-
ref:
|
|
890
|
+
ref: o,
|
|
891
891
|
className: iconVariants({ color: r, size: s, className: n }),
|
|
892
|
-
...
|
|
892
|
+
...i
|
|
893
893
|
}
|
|
894
894
|
);
|
|
895
895
|
}), ButtonIcon = React__default.forwardRef(
|
|
@@ -898,8 +898,8 @@ const buttonIconVariants = cva(
|
|
|
898
898
|
variant: r = "primary",
|
|
899
899
|
size: s = "md",
|
|
900
900
|
shape: n = "rounded",
|
|
901
|
-
disabled:
|
|
902
|
-
as:
|
|
901
|
+
disabled: i = !1,
|
|
902
|
+
as: o,
|
|
903
903
|
"aria-label": a,
|
|
904
904
|
...l
|
|
905
905
|
}, c) {
|
|
@@ -916,15 +916,15 @@ const buttonIconVariants = cva(
|
|
|
916
916
|
}),
|
|
917
917
|
t
|
|
918
918
|
),
|
|
919
|
-
disabled:
|
|
920
|
-
"aria-disabled":
|
|
919
|
+
disabled: i,
|
|
920
|
+
"aria-disabled": i,
|
|
921
921
|
"aria-label": a,
|
|
922
|
-
inert:
|
|
922
|
+
inert: i ? !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
|
}
|
|
@@ -1049,8 +1049,8 @@ const BUTTONS = [
|
|
|
1049
1049
|
disabled: r,
|
|
1050
1050
|
className: s,
|
|
1051
1051
|
"aria-label": n
|
|
1052
|
-
},
|
|
1053
|
-
const { input:
|
|
1052
|
+
}, i) => {
|
|
1053
|
+
const { input: o, inputRef: a, handleButton: l, handleInput: c } = useCalculator({
|
|
1054
1054
|
initialValue: e,
|
|
1055
1055
|
disabled: r,
|
|
1056
1056
|
onChange: t
|
|
@@ -1058,7 +1058,7 @@ const BUTTONS = [
|
|
|
1058
1058
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1059
1059
|
"div",
|
|
1060
1060
|
{
|
|
1061
|
-
ref:
|
|
1061
|
+
ref: i,
|
|
1062
1062
|
className: cn(calculatorRootVariants({ disabled: r }), s),
|
|
1063
1063
|
"aria-label": n || "Calculator",
|
|
1064
1064
|
role: "region",
|
|
@@ -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",
|
|
@@ -1179,8 +1179,8 @@ const textVariants = cva("", {
|
|
|
1179
1179
|
hasUnderline: r = !1,
|
|
1180
1180
|
isCapitalize: s = !1,
|
|
1181
1181
|
align: n = "left",
|
|
1182
|
-
italic:
|
|
1183
|
-
clamp:
|
|
1182
|
+
italic: i = !1,
|
|
1183
|
+
clamp: o = "none",
|
|
1184
1184
|
ellipsis: a = !1,
|
|
1185
1185
|
fontSize: l,
|
|
1186
1186
|
fontWeight: c,
|
|
@@ -1209,8 +1209,8 @@ const textVariants = cva("", {
|
|
|
1209
1209
|
hasUnderline: r,
|
|
1210
1210
|
isCapitalize: s,
|
|
1211
1211
|
align: n,
|
|
1212
|
-
italic:
|
|
1213
|
-
clamp:
|
|
1212
|
+
italic: i,
|
|
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: n, setMonth:
|
|
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
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
|
-
n?.(new Date(d, h, m)),
|
|
1282
|
+
n?.(new Date(d, h, m)), i(h), o(d);
|
|
1283
1283
|
}
|
|
1284
1284
|
},
|
|
1285
1285
|
"prev-" + g
|
|
@@ -1325,7 +1325,7 @@ const CalendarHeader = () => {
|
|
|
1325
1325
|
"aria-label": "Next month day",
|
|
1326
1326
|
variant: "ghost",
|
|
1327
1327
|
onClick: () => {
|
|
1328
|
-
n?.(new Date(f, y, g + 1)),
|
|
1328
|
+
n?.(new Date(f, y, g + 1)), i(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: 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 = () => {
|
|
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]), n(x),
|
|
1356
|
+
s?.([null, null]), n(x), i(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]), n(p),
|
|
1411
|
+
s?.([null, null]), n(p), i(y);
|
|
1412
1412
|
}
|
|
1413
1413
|
},
|
|
1414
1414
|
"next-" + u
|
|
@@ -1426,19 +1426,19 @@ function useCalendar({
|
|
|
1426
1426
|
initialYear: s,
|
|
1427
1427
|
initialMonth: n
|
|
1428
1428
|
}) {
|
|
1429
|
-
const [
|
|
1429
|
+
const [i, o] = useState(n), [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 = 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(
|
|
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: i,
|
|
1450
1450
|
value: h,
|
|
1451
|
-
setMonth:
|
|
1451
|
+
setMonth: o,
|
|
1452
1452
|
setYear: l,
|
|
1453
1453
|
onChange: y,
|
|
1454
1454
|
handlePrevMonth: d,
|
|
@@ -1462,24 +1462,24 @@ const CalendarRoot = ({
|
|
|
1462
1462
|
type: s = "single",
|
|
1463
1463
|
...n
|
|
1464
1464
|
}) => {
|
|
1465
|
-
const
|
|
1465
|
+
const i = /* @__PURE__ */ new Date(), o = useCalendar({
|
|
1466
1466
|
value: e,
|
|
1467
1467
|
onChange: t,
|
|
1468
1468
|
type: s,
|
|
1469
|
-
initialYear:
|
|
1470
|
-
initialMonth:
|
|
1469
|
+
initialYear: i.getFullYear(),
|
|
1470
|
+
initialMonth: i.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
1484
|
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("select-none", r), ...n, children: [
|
|
1485
1485
|
/* @__PURE__ */ jsxRuntimeExports.jsx(CalendarHeader, {}),
|
|
@@ -1488,7 +1488,104 @@ const CalendarRoot = ({
|
|
|
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, ...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(
|
|
1492
1589
|
"flex flex-col items-center justify-center text-center border border-border rounded-lg bg-background",
|
|
1493
1590
|
{
|
|
1494
1591
|
variants: {
|
|
@@ -1514,12 +1611,12 @@ const CalendarRoot = ({
|
|
|
1514
1611
|
), noResultsSubtitleVariants = cva(
|
|
1515
1612
|
"text-foreground-light mb-6 max-w-md"
|
|
1516
1613
|
), NoResults = React__default.forwardRef(
|
|
1517
|
-
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) {
|
|
1518
1615
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1519
1616
|
"section",
|
|
1520
1617
|
{
|
|
1521
1618
|
ref: l,
|
|
1522
|
-
className: cn(noResultsVariants({ hasGrayBackground:
|
|
1619
|
+
className: cn(noResultsVariants({ hasGrayBackground: o }), i),
|
|
1523
1620
|
role: "status",
|
|
1524
1621
|
"aria-label": "No results found",
|
|
1525
1622
|
...a,
|
|
@@ -1667,13 +1764,13 @@ const getTableColumnClass = (e) => {
|
|
|
1667
1764
|
);
|
|
1668
1765
|
}
|
|
1669
1766
|
), TableColumn = forwardRef(
|
|
1670
|
-
({ 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) => {
|
|
1671
1768
|
const a = e === "th" ? "columnheader" : "cell";
|
|
1672
1769
|
let l = "text-left";
|
|
1673
1770
|
return r === "center" ? l = "text-center" : r === "right" && (l = "text-right"), /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1674
1771
|
"div",
|
|
1675
1772
|
{
|
|
1676
|
-
ref:
|
|
1773
|
+
ref: o,
|
|
1677
1774
|
role: a,
|
|
1678
1775
|
className: cn(
|
|
1679
1776
|
"px-4 py-2",
|
|
@@ -1683,7 +1780,7 @@ const getTableColumnClass = (e) => {
|
|
|
1683
1780
|
"truncate overflow-hidden whitespace-nowrap",
|
|
1684
1781
|
n
|
|
1685
1782
|
),
|
|
1686
|
-
...
|
|
1783
|
+
...i,
|
|
1687
1784
|
children: s
|
|
1688
1785
|
}
|
|
1689
1786
|
);
|
|
@@ -1739,51 +1836,7 @@ const getTableColumnClass = (e) => {
|
|
|
1739
1836
|
Footer: TableFooter,
|
|
1740
1837
|
Row: TableRow,
|
|
1741
1838
|
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
|
-
);
|
|
1839
|
+
});
|
|
1787
1840
|
function getColSpan(e = 4) {
|
|
1788
1841
|
switch (e) {
|
|
1789
1842
|
case 1:
|
|
@@ -1814,9 +1867,9 @@ function getColSpan(e = 4) {
|
|
|
1814
1867
|
return "col-span-4";
|
|
1815
1868
|
}
|
|
1816
1869
|
}
|
|
1817
|
-
const DescriptionListItem = forwardRef(function e({ children: t, className: r, span: s = 4, ...n },
|
|
1818
|
-
const
|
|
1819
|
-
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 });
|
|
1820
1873
|
}), DescriptionListTerm = forwardRef(function e({ children: t, ...r }, s) {
|
|
1821
1874
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("dt", { ref: s, ...r, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "span", fontSize: "sm", fontWeight: "medium", color: "gray", children: t }) });
|
|
1822
1875
|
}), DescriptionListDetails = forwardRef(function e({ children: t, color: r = "black", ...s }, n) {
|
|
@@ -1839,7 +1892,7 @@ const DescriptionListItem = forwardRef(function e({ children: t, className: r, s
|
|
|
1839
1892
|
Details: DescriptionListDetails
|
|
1840
1893
|
});
|
|
1841
1894
|
function useImage({ src: e }) {
|
|
1842
|
-
const [t, r] = useState(!1), [s, n] = useState(!1),
|
|
1895
|
+
const [t, r] = useState(!1), [s, n] = useState(!1), i = useRef(!1), o = () => {
|
|
1843
1896
|
r(!0);
|
|
1844
1897
|
}, a = () => {
|
|
1845
1898
|
n(!0);
|
|
@@ -1848,16 +1901,16 @@ function useImage({ src: e }) {
|
|
|
1848
1901
|
if (!e) return;
|
|
1849
1902
|
const l = new Image();
|
|
1850
1903
|
return l.src = e, l.onload = () => {
|
|
1851
|
-
|
|
1904
|
+
i.current || r(!0);
|
|
1852
1905
|
}, l.onerror = () => {
|
|
1853
|
-
|
|
1906
|
+
i.current || n(!0);
|
|
1854
1907
|
}, () => {
|
|
1855
|
-
|
|
1908
|
+
i.current = !0;
|
|
1856
1909
|
};
|
|
1857
1910
|
}, [e]), {
|
|
1858
1911
|
loaded: t,
|
|
1859
1912
|
errored: s,
|
|
1860
|
-
handleLoad:
|
|
1913
|
+
handleLoad: o,
|
|
1861
1914
|
handleError: a
|
|
1862
1915
|
};
|
|
1863
1916
|
}
|
|
@@ -1935,13 +1988,13 @@ function BaseImageFallback({
|
|
|
1935
1988
|
height: r,
|
|
1936
1989
|
className: s,
|
|
1937
1990
|
style: n,
|
|
1938
|
-
shape:
|
|
1939
|
-
size:
|
|
1991
|
+
shape: i,
|
|
1992
|
+
size: o
|
|
1940
1993
|
}) {
|
|
1941
1994
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1942
1995
|
"div",
|
|
1943
1996
|
{
|
|
1944
|
-
className: imageAtomVariants({ shape:
|
|
1997
|
+
className: imageAtomVariants({ shape: i, size: o, className: s }),
|
|
1945
1998
|
style: { width: t, height: r, ...n },
|
|
1946
1999
|
"aria-label": e,
|
|
1947
2000
|
role: "img",
|
|
@@ -1966,8 +2019,8 @@ const BaseImage = forwardRef(
|
|
|
1966
2019
|
onLoad: r,
|
|
1967
2020
|
onError: s,
|
|
1968
2021
|
width: n,
|
|
1969
|
-
height:
|
|
1970
|
-
loading:
|
|
2022
|
+
height: i,
|
|
2023
|
+
loading: o = "lazy",
|
|
1971
2024
|
position: a = "cover",
|
|
1972
2025
|
size: l = "auto",
|
|
1973
2026
|
shape: c,
|
|
@@ -1976,7 +2029,7 @@ const BaseImage = forwardRef(
|
|
|
1976
2029
|
}, d) => {
|
|
1977
2030
|
const { loaded: p, errored: y, handleLoad: f, handleError: v } = useImage({
|
|
1978
2031
|
src: e
|
|
1979
|
-
}), w = typeof n == "number" ? n : Number(n), g = typeof
|
|
2032
|
+
}), w = typeof n == "number" ? n : Number(n), g = typeof i == "number" ? i : Number(i);
|
|
1980
2033
|
return !p && !y ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1981
2034
|
BaseImageSkeleton,
|
|
1982
2035
|
{
|
|
@@ -2000,7 +2053,7 @@ const BaseImage = forwardRef(
|
|
|
2000
2053
|
alt: t,
|
|
2001
2054
|
width: w,
|
|
2002
2055
|
height: g,
|
|
2003
|
-
loading:
|
|
2056
|
+
loading: o,
|
|
2004
2057
|
className: cn(
|
|
2005
2058
|
imageVariants({
|
|
2006
2059
|
position: a,
|
|
@@ -2035,10 +2088,11 @@ export {
|
|
|
2035
2088
|
ButtonFloat as e,
|
|
2036
2089
|
ButtonIcon as f,
|
|
2037
2090
|
Calendar as g,
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
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
|
|
2044
2098
|
};
|