@dimasbaguspm/versaur 0.0.19 → 0.0.21
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/README.md +22 -6
- package/dist/js/bottom-sheet-Eqduh3eY.js +495 -0
- package/dist/js/{selectable-multiple-input-CJXfqy1Z.js → bottom-sheet-input-DFGibm1I.js} +591 -476
- package/dist/js/forms/index.js +20 -17
- package/dist/js/{image-rectangle-CLU-GVtw.js → image-rectangle-C6cgL8R9.js} +354 -404
- package/dist/js/index.js +61 -53
- package/dist/js/layouts/index.js +5 -4
- package/dist/js/overlays/index.js +6 -4
- package/dist/js/primitive/index.js +15 -13
- package/dist/js/side-bar-BUACYQUo.js +397 -0
- package/dist/js/text-CRsIInRA.js +127 -0
- package/dist/js/tooltip-CDdl1U3A.js +148 -0
- package/dist/types/forms/bottom-sheet-input/bottom-sheet-input.d.ts +7 -0
- package/dist/types/forms/bottom-sheet-input/index.d.ts +2 -0
- package/dist/types/forms/bottom-sheet-input/types.d.ts +17 -0
- package/dist/types/forms/drawer-input/drawer-input.d.ts +6 -0
- package/dist/types/forms/drawer-input/index.d.ts +2 -0
- package/dist/types/forms/drawer-input/types.d.ts +18 -0
- package/dist/types/forms/index.d.ts +3 -0
- package/dist/types/forms/modal-input/index.d.ts +2 -0
- package/dist/types/forms/modal-input/modal-input.d.ts +6 -0
- package/dist/types/forms/modal-input/types.d.ts +18 -0
- package/dist/types/layouts/index.d.ts +1 -0
- package/dist/types/layouts/side-bar/index.d.ts +2 -0
- package/dist/types/layouts/side-bar/side-bar.atoms.d.ts +3 -0
- package/dist/types/layouts/side-bar/side-bar.d.ts +5 -0
- package/dist/types/layouts/side-bar/types.d.ts +42 -0
- package/dist/types/overlays/bottom-sheet/types.d.ts +2 -1
- package/dist/types/overlays/drawer/types.d.ts +2 -1
- package/dist/types/overlays/index.d.ts +1 -0
- package/dist/types/overlays/menu/menu.atoms.d.ts +5 -10
- package/dist/types/overlays/menu/menu.d.ts +2 -6
- package/dist/types/overlays/menu/types.d.ts +9 -14
- package/dist/types/overlays/menu/use-menu.d.ts +0 -1
- package/dist/types/overlays/modal/modal.d.ts +14 -5
- package/dist/types/overlays/modal/types.d.ts +7 -20
- package/dist/types/overlays/tooltip/index.d.ts +2 -0
- package/dist/types/overlays/tooltip/tooltip.d.ts +5 -0
- package/dist/types/overlays/tooltip/types.d.ts +33 -0
- package/dist/types/overlays/tooltip/use-tooltip-position.d.ts +8 -0
- package/dist/types/primitive/icon/types.d.ts +1 -1
- package/dist/types/primitive/index.d.ts +1 -0
- package/dist/types/primitive/no-results/index.d.ts +2 -0
- package/dist/types/primitive/no-results/no-results.d.ts +15 -0
- package/dist/types/primitive/no-results/types.d.ts +30 -0
- package/dist/types/primitive/table/table.atoms.d.ts +4 -6
- package/dist/types/primitive/table/table.d.ts +2 -1
- package/dist/types/primitive/table/types.d.ts +7 -4
- package/dist/utils/enforce-subpath-import.js +6 -0
- package/package.json +1 -1
- package/dist/js/bottom-sheet-BRv-oJL-.js +0 -646
- package/dist/js/form-layout-4ASWdXn8.js +0 -302
- package/dist/types/overlays/modal/use-escape-close.d.ts +0 -6
- package/dist/types/overlays/modal/use-focus-trap.d.ts +0 -6
|
@@ -1,44 +1,10 @@
|
|
|
1
1
|
import { c as cva, j as jsxRuntimeExports, a as cn } from "./index-DOdDlCoL.js";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import React__default, { forwardRef, useState, useEffect, useCallback, useRef, createContext, useContext
|
|
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";
|
|
5
6
|
import { S as Skeleton } from "./skeleton-BNZyaRjo.js";
|
|
6
|
-
const
|
|
7
|
-
variants: {
|
|
8
|
-
size: {
|
|
9
|
-
xs: "w-3 h-3",
|
|
10
|
-
sm: "w-4 h-4",
|
|
11
|
-
md: "w-5 h-5",
|
|
12
|
-
lg: "w-6 h-6",
|
|
13
|
-
xl: "w-8 h-8"
|
|
14
|
-
},
|
|
15
|
-
color: {
|
|
16
|
-
primary: "text-primary",
|
|
17
|
-
secondary: "text-secondary",
|
|
18
|
-
tertiary: "text-tertiary",
|
|
19
|
-
ghost: "text-ghost",
|
|
20
|
-
neutral: "text-neutral",
|
|
21
|
-
success: "text-success",
|
|
22
|
-
info: "text-info",
|
|
23
|
-
warning: "text-warning",
|
|
24
|
-
danger: "text-danger",
|
|
25
|
-
inherit: ""
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
defaultVariants: {
|
|
29
|
-
size: "md",
|
|
30
|
-
color: "primary"
|
|
31
|
-
}
|
|
32
|
-
}), Icon = React__default.forwardRef(function({ as: t, color: r = "primary", size: s = "md", className: n, ...o }, i) {
|
|
33
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
34
|
-
t,
|
|
35
|
-
{
|
|
36
|
-
ref: i,
|
|
37
|
-
className: iconVariants({ color: r, size: s, className: n }),
|
|
38
|
-
...o
|
|
39
|
-
}
|
|
40
|
-
);
|
|
41
|
-
}), alertVariants = cva(
|
|
7
|
+
const alertVariants = cva(
|
|
42
8
|
"relative flex items-center gap-2 rounded-md p-2 text-sm transition-all duration-200",
|
|
43
9
|
{
|
|
44
10
|
variants: {
|
|
@@ -337,9 +303,9 @@ const iconVariants = cva("inline-flex items-center justify-center", {
|
|
|
337
303
|
useEffect(() => {
|
|
338
304
|
a(!1);
|
|
339
305
|
}, [e]);
|
|
340
|
-
const
|
|
341
|
-
(
|
|
342
|
-
a(!0), s?.(
|
|
306
|
+
const c = useCallback(
|
|
307
|
+
(u) => {
|
|
308
|
+
a(!0), s?.(u);
|
|
343
309
|
},
|
|
344
310
|
[s]
|
|
345
311
|
);
|
|
@@ -350,7 +316,7 @@ const iconVariants = cva("inline-flex items-center justify-center", {
|
|
|
350
316
|
src: e,
|
|
351
317
|
alt: t,
|
|
352
318
|
className: cn(avatarImageVariants(), r),
|
|
353
|
-
onError:
|
|
319
|
+
onError: c,
|
|
354
320
|
...n
|
|
355
321
|
}
|
|
356
322
|
);
|
|
@@ -523,25 +489,25 @@ const iconVariants = cva("inline-flex items-center justify-center", {
|
|
|
523
489
|
iconRight: o,
|
|
524
490
|
className: i,
|
|
525
491
|
children: a,
|
|
526
|
-
...
|
|
527
|
-
},
|
|
528
|
-
const
|
|
492
|
+
...c
|
|
493
|
+
}, u) => {
|
|
494
|
+
const d = !(a != null && a !== "") && !!(n || o);
|
|
529
495
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
530
496
|
"span",
|
|
531
497
|
{
|
|
532
|
-
ref:
|
|
498
|
+
ref: u,
|
|
533
499
|
className: cn(
|
|
534
500
|
badgeVariants({
|
|
535
501
|
variant: e,
|
|
536
502
|
color: r,
|
|
537
503
|
shape: t,
|
|
538
504
|
size: s,
|
|
539
|
-
iconOnly:
|
|
505
|
+
iconOnly: d
|
|
540
506
|
}),
|
|
541
507
|
i
|
|
542
508
|
),
|
|
543
|
-
...
|
|
544
|
-
children:
|
|
509
|
+
...c,
|
|
510
|
+
children: d ? (
|
|
545
511
|
// Icon-only mode: display only the icon
|
|
546
512
|
n || o
|
|
547
513
|
) : (
|
|
@@ -602,35 +568,35 @@ const SvgSpenicleSquare = (e) => /* @__PURE__ */ React.createElement("svg", { wi
|
|
|
602
568
|
variants: {
|
|
603
569
|
variant: {
|
|
604
570
|
// Core variants using Versaur color system
|
|
605
|
-
primary: "bg-primary text-white hover:bg-primary/90 focus-visible:ring-primary-
|
|
606
|
-
secondary: "bg-secondary text-white hover:bg-secondary/90 focus-visible:ring-secondary-
|
|
607
|
-
tertiary: "bg-tertiary text-white hover:bg-tertiary/90 focus-visible:ring-tertiary-
|
|
608
|
-
ghost: "bg-white text-foreground hover:bg-ghost-soft focus-visible:ring-ghost-
|
|
609
|
-
neutral: "bg-neutral text-foreground border border-border hover:bg-neutral/80 focus-visible:ring-foreground-
|
|
571
|
+
primary: "bg-primary text-white hover:bg-primary/90 focus-visible:ring-primary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
572
|
+
secondary: "bg-secondary text-white hover:bg-secondary/90 focus-visible:ring-secondary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
573
|
+
tertiary: "bg-tertiary text-white hover:bg-tertiary/90 focus-visible:ring-tertiary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
574
|
+
ghost: "bg-white text-foreground hover:bg-ghost-soft focus-visible:ring-ghost-light focus-visible:ring-offset-white",
|
|
575
|
+
neutral: "bg-neutral text-foreground border border-border hover:bg-neutral/80 focus-visible:ring-foreground-light focus-visible:ring-offset-white shadow-sm",
|
|
610
576
|
// Outline variants
|
|
611
|
-
"primary-outline": "border border-primary text-primary bg-white hover:bg-primary hover:text-white focus-visible:ring-primary-
|
|
612
|
-
"secondary-outline": "border border-secondary text-secondary bg-white hover:bg-secondary hover:text-white focus-visible:ring-secondary-
|
|
613
|
-
"tertiary-outline": "border border-tertiary text-tertiary bg-white hover:bg-tertiary hover:text-white focus-visible:ring-tertiary-
|
|
614
|
-
"ghost-outline": "border border-ghost text-ghost bg-white hover:bg-ghost hover:text-white focus-visible:ring-ghost-
|
|
615
|
-
"neutral-outline": "border border-neutral text-foreground bg-white hover:bg-neutral hover:text-foreground focus-visible:ring-foreground-
|
|
577
|
+
"primary-outline": "border border-primary text-primary bg-white hover:bg-primary hover:text-white focus-visible:ring-primary-light focus-visible:ring-offset-white transition-all",
|
|
578
|
+
"secondary-outline": "border border-secondary text-secondary bg-white hover:bg-secondary hover:text-white focus-visible:ring-secondary-light focus-visible:ring-offset-white transition-all",
|
|
579
|
+
"tertiary-outline": "border border-tertiary text-tertiary bg-white hover:bg-tertiary hover:text-white focus-visible:ring-tertiary-light focus-visible:ring-offset-white transition-all",
|
|
580
|
+
"ghost-outline": "border border-ghost text-ghost bg-white hover:bg-ghost hover:text-white focus-visible:ring-ghost-light focus-visible:ring-offset-white transition-all",
|
|
581
|
+
"neutral-outline": "border border-neutral text-foreground bg-white hover:bg-neutral hover:text-foreground focus-visible:ring-foreground-light focus-visible:ring-offset-white transition-all",
|
|
616
582
|
// Ghost variants (subtle)
|
|
617
|
-
"primary-ghost": "text-primary bg-white hover:bg-primary
|
|
618
|
-
"secondary-ghost": "text-secondary bg-white hover:bg-secondary
|
|
619
|
-
"tertiary-ghost": "text-tertiary bg-white hover:bg-tertiary
|
|
620
|
-
"neutral-ghost": "text-foreground bg-white hover:bg-neutral/
|
|
583
|
+
"primary-ghost": "text-primary bg-white hover:bg-primary/20 focus-visible:ring-primary focus-visible:ring-offset-white",
|
|
584
|
+
"secondary-ghost": "text-secondary bg-white hover:bg-secondary/20 focus-visible:ring-secondary focus-visible:ring-offset-white",
|
|
585
|
+
"tertiary-ghost": "text-tertiary bg-white hover:bg-tertiary/20 focus-visible:ring-tertiary focus-visible:ring-offset-white",
|
|
586
|
+
"neutral-ghost": "text-foreground bg-white hover:bg-neutral/50 focus-visible:ring-foreground focus-visible:ring-offset-white",
|
|
621
587
|
// Semantic variants
|
|
622
|
-
success: "bg-success text-white hover:bg-success/90 focus-visible:ring-success-
|
|
623
|
-
"success-outline": "border border-success text-success bg-white hover:bg-success hover:text-white focus-visible:ring-success-
|
|
624
|
-
"success-ghost": "text-success bg-white hover:bg-success
|
|
625
|
-
info: "bg-info text-white hover:bg-info/90 focus-visible:ring-info-
|
|
626
|
-
"info-outline": "border border-info text-info bg-white hover:bg-info hover:text-white focus-visible:ring-info-
|
|
627
|
-
"info-ghost": "text-info bg-white hover:bg-info
|
|
628
|
-
warning: "bg-warning text-white hover:bg-warning/90 focus-visible:ring-warning-
|
|
629
|
-
"warning-outline": "border border-warning text-warning bg-white hover:bg-warning hover:text-white focus-visible:ring-warning-
|
|
630
|
-
"warning-ghost": "text-warning bg-white hover:bg-warning
|
|
631
|
-
danger: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-
|
|
632
|
-
"danger-outline": "border border-danger text-danger bg-white hover:bg-danger hover:text-white focus-visible:ring-danger-
|
|
633
|
-
"danger-ghost": "text-danger bg-white hover:bg-danger
|
|
588
|
+
success: "bg-success text-white hover:bg-success/90 focus-visible:ring-success-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
589
|
+
"success-outline": "border border-success text-success bg-white hover:bg-success hover:text-white focus-visible:ring-success-light focus-visible:ring-offset-white transition-all",
|
|
590
|
+
"success-ghost": "text-success bg-white hover:bg-success/20 focus-visible:ring-success-light focus-visible:ring-offset-white",
|
|
591
|
+
info: "bg-info text-white hover:bg-info/90 focus-visible:ring-info-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
592
|
+
"info-outline": "border border-info text-info bg-white hover:bg-info hover:text-white focus-visible:ring-info-light focus-visible:ring-offset-white transition-all",
|
|
593
|
+
"info-ghost": "text-info bg-white hover:bg-info/20 focus-visible:ring-info-light focus-visible:ring-offset-white",
|
|
594
|
+
warning: "bg-warning text-white hover:bg-warning/90 focus-visible:ring-warning-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
595
|
+
"warning-outline": "border border-warning text-warning bg-white hover:bg-warning hover:text-white focus-visible:ring-warning-light focus-visible:ring-offset-white transition-all",
|
|
596
|
+
"warning-ghost": "text-warning bg-white hover:bg-warning/20 focus-visible:ring-warning-light focus-visible:ring-offset-white",
|
|
597
|
+
danger: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
598
|
+
"danger-outline": "border border-danger text-danger bg-white hover:bg-danger hover:text-white focus-visible:ring-danger-light focus-visible:ring-offset-white transition-all",
|
|
599
|
+
"danger-ghost": "text-danger bg-white hover:bg-danger/20 focus-visible:ring-danger-light focus-visible:ring-offset-white",
|
|
634
600
|
// Utility variants
|
|
635
601
|
outline: "border border-border text-foreground bg-white hover:bg-accent-soft focus-visible:ring-accent-soft focus-visible:ring-offset-white transition-all",
|
|
636
602
|
destructive: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md"
|
|
@@ -655,11 +621,11 @@ const SvgSpenicleSquare = (e) => /* @__PURE__ */ React.createElement("svg", { wi
|
|
|
655
621
|
type: o = "button",
|
|
656
622
|
children: i,
|
|
657
623
|
...a
|
|
658
|
-
},
|
|
624
|
+
}, c) {
|
|
659
625
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
660
626
|
"button",
|
|
661
627
|
{
|
|
662
|
-
ref:
|
|
628
|
+
ref: c,
|
|
663
629
|
type: o,
|
|
664
630
|
className: cn(buttonVariants({ variant: r, size: s }), t),
|
|
665
631
|
disabled: n,
|
|
@@ -696,34 +662,34 @@ const SvgSpenicleSquare = (e) => /* @__PURE__ */ React.createElement("svg", { wi
|
|
|
696
662
|
{
|
|
697
663
|
variants: {
|
|
698
664
|
variant: {
|
|
699
|
-
primary: "bg-primary text-white hover:bg-primary/90 focus-visible:ring-primary-
|
|
700
|
-
secondary: "bg-secondary text-white hover:bg-secondary/90 focus-visible:ring-secondary-
|
|
701
|
-
tertiary: "bg-tertiary text-white hover:bg-tertiary/90 focus-visible:ring-tertiary-
|
|
702
|
-
ghost: "bg-white text-foreground hover:bg-ghost-soft focus-visible:ring-ghost-
|
|
703
|
-
neutral: "bg-neutral text-foreground border border-border hover:bg-neutral/80 focus-visible:ring-foreground-
|
|
704
|
-
"primary-outline": "border border-primary text-primary bg-white hover:bg-primary hover:text-white focus-visible:ring-primary-
|
|
705
|
-
"secondary-outline": "border border-secondary text-secondary bg-white hover:bg-secondary hover:text-white focus-visible:ring-secondary-
|
|
706
|
-
"tertiary-outline": "border border-tertiary text-tertiary bg-white hover:bg-tertiary hover:text-white focus-visible:ring-tertiary-
|
|
707
|
-
"ghost-outline": "border border-ghost text-ghost bg-white hover:bg-ghost hover:text-white focus-visible:ring-ghost-
|
|
708
|
-
"neutral-outline": "border border-neutral text-foreground bg-white hover:bg-neutral hover:text-foreground focus-visible:ring-foreground-
|
|
709
|
-
"primary-ghost": "text-primary bg-white hover:bg-primary
|
|
710
|
-
"secondary-ghost": "text-secondary bg-white hover:bg-secondary
|
|
711
|
-
"tertiary-ghost": "text-tertiary bg-white hover:bg-tertiary
|
|
712
|
-
"neutral-ghost": "text-foreground bg-white hover:bg-neutral/
|
|
713
|
-
success: "bg-success text-white hover:bg-success/90 focus-visible:ring-success-
|
|
714
|
-
"success-outline": "border border-success text-success bg-white hover:bg-success hover:text-white focus-visible:ring-success-
|
|
715
|
-
"success-ghost": "text-success bg-white hover:bg-success
|
|
716
|
-
info: "bg-info text-white hover:bg-info/90 focus-visible:ring-info-
|
|
717
|
-
"info-outline": "border border-info text-info bg-white hover:bg-info hover:text-white focus-visible:ring-info-
|
|
718
|
-
"info-ghost": "text-info bg-white hover:bg-info
|
|
719
|
-
warning: "bg-warning text-white hover:bg-warning/90 focus-visible:ring-warning-
|
|
720
|
-
"warning-outline": "border border-warning text-warning bg-white hover:bg-warning hover:text-white focus-visible:ring-warning-
|
|
721
|
-
"warning-ghost": "text-warning bg-white hover:bg-warning
|
|
722
|
-
danger: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-
|
|
723
|
-
"danger-outline": "border border-danger text-danger bg-white hover:bg-danger hover:text-white focus-visible:ring-danger-
|
|
724
|
-
"danger-ghost": "text-danger bg-white hover:bg-danger
|
|
725
|
-
outline: "border border-border text-foreground bg-white hover:bg-accent-soft focus-visible:ring-accent-soft focus-visible:ring-offset-white",
|
|
726
|
-
destructive: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-soft focus-visible:ring-offset-white"
|
|
665
|
+
primary: "bg-primary text-white hover:bg-primary/90 focus-visible:ring-primary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
666
|
+
secondary: "bg-secondary text-white hover:bg-secondary/90 focus-visible:ring-secondary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
667
|
+
tertiary: "bg-tertiary text-white hover:bg-tertiary/90 focus-visible:ring-tertiary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
668
|
+
ghost: "bg-white text-foreground hover:bg-ghost-soft focus-visible:ring-ghost-light focus-visible:ring-offset-white",
|
|
669
|
+
neutral: "bg-neutral text-foreground border border-border hover:bg-neutral/80 focus-visible:ring-foreground-light focus-visible:ring-offset-white shadow-sm",
|
|
670
|
+
"primary-outline": "border border-primary text-primary bg-white hover:bg-primary hover:text-white focus-visible:ring-primary-light focus-visible:ring-offset-white transition-all",
|
|
671
|
+
"secondary-outline": "border border-secondary text-secondary bg-white hover:bg-secondary hover:text-white focus-visible:ring-secondary-light focus-visible:ring-offset-white transition-all",
|
|
672
|
+
"tertiary-outline": "border border-tertiary text-tertiary bg-white hover:bg-tertiary hover:text-white focus-visible:ring-tertiary-light focus-visible:ring-offset-white transition-all",
|
|
673
|
+
"ghost-outline": "border border-ghost text-ghost bg-white hover:bg-ghost hover:text-white focus-visible:ring-ghost-light focus-visible:ring-offset-white transition-all",
|
|
674
|
+
"neutral-outline": "border border-neutral text-foreground bg-white hover:bg-neutral hover:text-foreground focus-visible:ring-foreground-light focus-visible:ring-offset-white transition-all",
|
|
675
|
+
"primary-ghost": "text-primary bg-white hover:bg-primary/20 focus-visible:ring-primary focus-visible:ring-offset-white",
|
|
676
|
+
"secondary-ghost": "text-secondary bg-white hover:bg-secondary/20 focus-visible:ring-secondary focus-visible:ring-offset-white",
|
|
677
|
+
"tertiary-ghost": "text-tertiary bg-white hover:bg-tertiary/20 focus-visible:ring-tertiary focus-visible:ring-offset-white",
|
|
678
|
+
"neutral-ghost": "text-foreground bg-white hover:bg-neutral/50 focus-visible:ring-foreground focus-visible:ring-offset-white",
|
|
679
|
+
success: "bg-success text-white hover:bg-success/90 focus-visible:ring-success-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
680
|
+
"success-outline": "border border-success text-success bg-white hover:bg-success hover:text-white focus-visible:ring-success-light focus-visible:ring-offset-white transition-all",
|
|
681
|
+
"success-ghost": "text-success bg-white hover:bg-success/20 focus-visible:ring-success-light focus-visible:ring-offset-white",
|
|
682
|
+
info: "bg-info text-white hover:bg-info/90 focus-visible:ring-info-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
683
|
+
"info-outline": "border border-info text-info bg-white hover:bg-info hover:text-white focus-visible:ring-info-light focus-visible:ring-offset-white transition-all",
|
|
684
|
+
"info-ghost": "text-info bg-white hover:bg-info/20 focus-visible:ring-info-light focus-visible:ring-offset-white",
|
|
685
|
+
warning: "bg-warning text-white hover:bg-warning/90 focus-visible:ring-warning-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
686
|
+
"warning-outline": "border border-warning text-warning bg-white hover:bg-warning hover:text-white focus-visible:ring-warning-light focus-visible:ring-offset-white transition-all",
|
|
687
|
+
"warning-ghost": "text-warning bg-white hover:bg-warning/20 focus-visible:ring-warning-light focus-visible:ring-offset-white",
|
|
688
|
+
danger: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
689
|
+
"danger-outline": "border border-danger text-danger bg-white hover:bg-danger hover:text-white focus-visible:ring-danger-light focus-visible:ring-offset-white transition-all",
|
|
690
|
+
"danger-ghost": "text-danger bg-white hover:bg-danger/20 focus-visible:ring-danger-light focus-visible:ring-offset-white",
|
|
691
|
+
outline: "border border-border text-foreground bg-white hover:bg-accent-soft focus-visible:ring-accent-soft focus-visible:ring-offset-white transition-all",
|
|
692
|
+
destructive: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md"
|
|
727
693
|
},
|
|
728
694
|
size: {
|
|
729
695
|
sm: "h-12 w-12 min-w-12 min-h-12 text-base",
|
|
@@ -739,32 +705,32 @@ const SvgSpenicleSquare = (e) => /* @__PURE__ */ React.createElement("svg", { wi
|
|
|
739
705
|
);
|
|
740
706
|
function useFloatingPosition(e, t = "1rem") {
|
|
741
707
|
const r = useRef(null), [s, n] = useState({}), [o, i] = useState("fixed bottom-4 right-4"), a = useCallback(() => {
|
|
742
|
-
const
|
|
743
|
-
if (!
|
|
744
|
-
const
|
|
745
|
-
let
|
|
746
|
-
|
|
708
|
+
const u = r.current;
|
|
709
|
+
if (!u) return;
|
|
710
|
+
const b = u.getBoundingClientRect().height > window.innerHeight;
|
|
711
|
+
let d = {}, p = "";
|
|
712
|
+
b ? (d = {
|
|
747
713
|
position: "fixed",
|
|
748
714
|
bottom: t,
|
|
749
715
|
zIndex: 50,
|
|
750
|
-
transform: `translateY(${
|
|
751
|
-
}, p = `fixed bottom-4 ${e}-4`) : (
|
|
716
|
+
transform: `translateY(${u.scrollTop}px)`
|
|
717
|
+
}, p = `fixed bottom-4 ${e}-4`) : (d = {
|
|
752
718
|
position: "fixed",
|
|
753
719
|
bottom: t,
|
|
754
720
|
zIndex: 50
|
|
755
|
-
}, p = `fixed bottom-4 ${e}-4`), n(
|
|
721
|
+
}, p = `fixed bottom-4 ${e}-4`), n(d), i(p);
|
|
756
722
|
}, [e, t]);
|
|
757
723
|
return useEffect(() => {
|
|
758
724
|
a();
|
|
759
|
-
const
|
|
760
|
-
return
|
|
761
|
-
|
|
725
|
+
const u = r.current;
|
|
726
|
+
return u && u.addEventListener("scroll", a), window.addEventListener("resize", a), () => {
|
|
727
|
+
u && u.removeEventListener("scroll", a), window.removeEventListener("resize", a);
|
|
762
728
|
};
|
|
763
729
|
}, [a]), useEffect(() => {
|
|
764
730
|
r.current && a();
|
|
765
731
|
}, [e, t, a]), [useCallback(
|
|
766
|
-
(
|
|
767
|
-
r.current =
|
|
732
|
+
(u) => {
|
|
733
|
+
r.current = u, u && a();
|
|
768
734
|
},
|
|
769
735
|
[a]
|
|
770
736
|
), s, o];
|
|
@@ -778,24 +744,24 @@ const ButtonFloat = forwardRef(
|
|
|
778
744
|
offset: o = "1rem",
|
|
779
745
|
...i
|
|
780
746
|
}, a) {
|
|
781
|
-
const [
|
|
747
|
+
const [c, u, m] = useFloatingPosition(
|
|
782
748
|
n,
|
|
783
749
|
o
|
|
784
|
-
), [
|
|
750
|
+
), [b, d] = useState(!1);
|
|
785
751
|
return useEffect(() => {
|
|
786
|
-
|
|
787
|
-
}, []), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref:
|
|
752
|
+
d(!0);
|
|
753
|
+
}, []), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: c, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
788
754
|
"button",
|
|
789
755
|
{
|
|
790
756
|
ref: a,
|
|
791
757
|
type: i.type || "button",
|
|
792
758
|
className: cn(
|
|
793
759
|
buttonFloatVariants({ variant: r, size: s }),
|
|
794
|
-
|
|
795
|
-
|
|
760
|
+
m,
|
|
761
|
+
b && "animate-fab-in",
|
|
796
762
|
t
|
|
797
763
|
),
|
|
798
|
-
style:
|
|
764
|
+
style: u,
|
|
799
765
|
...i
|
|
800
766
|
}
|
|
801
767
|
) });
|
|
@@ -841,37 +807,32 @@ const buttonIconVariants = cva(
|
|
|
841
807
|
{
|
|
842
808
|
variants: {
|
|
843
809
|
variant: {
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
"
|
|
852
|
-
"
|
|
853
|
-
"
|
|
854
|
-
"ghost
|
|
855
|
-
"
|
|
856
|
-
|
|
857
|
-
"
|
|
858
|
-
|
|
859
|
-
"
|
|
860
|
-
"
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
"
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
"
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
"
|
|
870
|
-
"warning-ghost": "text-warning bg-white hover:bg-warning-light focus-visible:ring-warning-light focus-visible:ring-offset-white",
|
|
871
|
-
danger: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
872
|
-
"danger-outline": "border border-danger text-danger bg-white hover:bg-danger hover:text-white focus-visible:ring-danger-soft focus-visible:ring-offset-white transition-all",
|
|
873
|
-
"danger-ghost": "text-danger bg-white hover:bg-danger-light focus-visible:ring-danger-light focus-visible:ring-offset-white",
|
|
874
|
-
// Utility variants
|
|
810
|
+
primary: "bg-primary text-white hover:bg-primary/90 focus-visible:ring-primary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
811
|
+
secondary: "bg-secondary text-white hover:bg-secondary/90 focus-visible:ring-secondary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
812
|
+
tertiary: "bg-tertiary text-white hover:bg-tertiary/90 focus-visible:ring-tertiary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
813
|
+
ghost: "bg-white text-foreground hover:bg-ghost-soft focus-visible:ring-ghost-light focus-visible:ring-offset-white",
|
|
814
|
+
neutral: "bg-neutral text-foreground border border-border hover:bg-neutral/80 focus-visible:ring-foreground-light focus-visible:ring-offset-white shadow-sm",
|
|
815
|
+
"primary-outline": "border border-primary text-primary bg-white hover:bg-primary hover:text-white focus-visible:ring-primary-light focus-visible:ring-offset-white transition-all",
|
|
816
|
+
"secondary-outline": "border border-secondary text-secondary bg-white hover:bg-secondary hover:text-white focus-visible:ring-secondary-light focus-visible:ring-offset-white transition-all",
|
|
817
|
+
"tertiary-outline": "border border-tertiary text-tertiary bg-white hover:bg-tertiary hover:text-white focus-visible:ring-tertiary-light focus-visible:ring-offset-white transition-all",
|
|
818
|
+
"ghost-outline": "border border-ghost text-ghost bg-white hover:bg-ghost hover:text-white focus-visible:ring-ghost-light focus-visible:ring-offset-white transition-all",
|
|
819
|
+
"neutral-outline": "border border-neutral text-foreground bg-white hover:bg-neutral hover:text-foreground focus-visible:ring-foreground-light focus-visible:ring-offset-white transition-all",
|
|
820
|
+
"primary-ghost": "text-primary bg-white hover:bg-primary/20 focus-visible:ring-primary focus-visible:ring-offset-white",
|
|
821
|
+
"secondary-ghost": "text-secondary bg-white hover:bg-secondary/20 focus-visible:ring-secondary focus-visible:ring-offset-white",
|
|
822
|
+
"tertiary-ghost": "text-tertiary bg-white hover:bg-tertiary/20 focus-visible:ring-tertiary focus-visible:ring-offset-white",
|
|
823
|
+
"neutral-ghost": "text-foreground bg-white hover:bg-neutral/50 focus-visible:ring-foreground focus-visible:ring-offset-white",
|
|
824
|
+
success: "bg-success text-white hover:bg-success/90 focus-visible:ring-success-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
825
|
+
"success-outline": "border border-success text-success bg-white hover:bg-success hover:text-white focus-visible:ring-success-light focus-visible:ring-offset-white transition-all",
|
|
826
|
+
"success-ghost": "text-success bg-white hover:bg-success/20 focus-visible:ring-success-light focus-visible:ring-offset-white",
|
|
827
|
+
info: "bg-info text-white hover:bg-info/90 focus-visible:ring-info-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
828
|
+
"info-outline": "border border-info text-info bg-white hover:bg-info hover:text-white focus-visible:ring-info-light focus-visible:ring-offset-white transition-all",
|
|
829
|
+
"info-ghost": "text-info bg-white hover:bg-info/20 focus-visible:ring-info-light focus-visible:ring-offset-white",
|
|
830
|
+
warning: "bg-warning text-white hover:bg-warning/90 focus-visible:ring-warning-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
831
|
+
"warning-outline": "border border-warning text-warning bg-white hover:bg-warning hover:text-white focus-visible:ring-warning-light focus-visible:ring-offset-white transition-all",
|
|
832
|
+
"warning-ghost": "text-warning bg-white hover:bg-warning/20 focus-visible:ring-warning-light focus-visible:ring-offset-white",
|
|
833
|
+
danger: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
834
|
+
"danger-outline": "border border-danger text-danger bg-white hover:bg-danger hover:text-white focus-visible:ring-danger-light focus-visible:ring-offset-white transition-all",
|
|
835
|
+
"danger-ghost": "text-danger bg-white hover:bg-danger/20 focus-visible:ring-danger-light focus-visible:ring-offset-white",
|
|
875
836
|
outline: "border border-border text-foreground bg-white hover:bg-accent-soft focus-visible:ring-accent-soft focus-visible:ring-offset-white transition-all",
|
|
876
837
|
destructive: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md"
|
|
877
838
|
},
|
|
@@ -894,7 +855,45 @@ const buttonIconVariants = cva(
|
|
|
894
855
|
shape: "rounded"
|
|
895
856
|
}
|
|
896
857
|
}
|
|
897
|
-
),
|
|
858
|
+
), iconVariants = cva("inline-flex items-center justify-center", {
|
|
859
|
+
variants: {
|
|
860
|
+
size: {
|
|
861
|
+
xs: "w-3 h-3",
|
|
862
|
+
sm: "w-4 h-4",
|
|
863
|
+
md: "w-5 h-5",
|
|
864
|
+
lg: "w-6 h-6",
|
|
865
|
+
xl: "w-8 h-8"
|
|
866
|
+
},
|
|
867
|
+
color: {
|
|
868
|
+
primary: "text-primary",
|
|
869
|
+
secondary: "text-secondary",
|
|
870
|
+
tertiary: "text-tertiary",
|
|
871
|
+
ghost: "text-ghost",
|
|
872
|
+
neutral: "text-neutral",
|
|
873
|
+
success: "text-success",
|
|
874
|
+
info: "text-info",
|
|
875
|
+
warning: "text-warning",
|
|
876
|
+
danger: "text-danger",
|
|
877
|
+
gray: "text-gray-500",
|
|
878
|
+
black: "text-black",
|
|
879
|
+
white: "text-white",
|
|
880
|
+
inherit: ""
|
|
881
|
+
}
|
|
882
|
+
},
|
|
883
|
+
defaultVariants: {
|
|
884
|
+
size: "md",
|
|
885
|
+
color: "primary"
|
|
886
|
+
}
|
|
887
|
+
}), Icon = React__default.forwardRef(function({ as: t, color: r = "primary", size: s = "md", className: n, ...o }, i) {
|
|
888
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
889
|
+
t,
|
|
890
|
+
{
|
|
891
|
+
ref: i,
|
|
892
|
+
className: iconVariants({ color: r, size: s, className: n }),
|
|
893
|
+
...o
|
|
894
|
+
}
|
|
895
|
+
);
|
|
896
|
+
}), ButtonIcon = React__default.forwardRef(
|
|
898
897
|
function({
|
|
899
898
|
className: t,
|
|
900
899
|
variant: r = "primary",
|
|
@@ -903,12 +902,12 @@ const buttonIconVariants = cva(
|
|
|
903
902
|
disabled: o = !1,
|
|
904
903
|
as: i,
|
|
905
904
|
"aria-label": a,
|
|
906
|
-
...
|
|
907
|
-
},
|
|
905
|
+
...c
|
|
906
|
+
}, u) {
|
|
908
907
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
909
908
|
"button",
|
|
910
909
|
{
|
|
911
|
-
ref:
|
|
910
|
+
ref: u,
|
|
912
911
|
type: "button",
|
|
913
912
|
className: cn(
|
|
914
913
|
buttonIconVariants({
|
|
@@ -922,7 +921,7 @@ const buttonIconVariants = cva(
|
|
|
922
921
|
"aria-disabled": o,
|
|
923
922
|
"aria-label": a,
|
|
924
923
|
inert: o ? !0 : void 0,
|
|
925
|
-
...
|
|
924
|
+
...c,
|
|
926
925
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
927
926
|
Icon,
|
|
928
927
|
{
|
|
@@ -1052,7 +1051,7 @@ const BUTTONS = [
|
|
|
1052
1051
|
className: s,
|
|
1053
1052
|
"aria-label": n
|
|
1054
1053
|
}, o) => {
|
|
1055
|
-
const { input: i, inputRef: a, handleButton:
|
|
1054
|
+
const { input: i, inputRef: a, handleButton: c, handleInput: u } = useCalculator({
|
|
1056
1055
|
initialValue: e,
|
|
1057
1056
|
disabled: r,
|
|
1058
1057
|
onChange: t
|
|
@@ -1071,162 +1070,41 @@ const BUTTONS = [
|
|
|
1071
1070
|
ref: a,
|
|
1072
1071
|
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)]",
|
|
1073
1072
|
value: i,
|
|
1074
|
-
onChange:
|
|
1073
|
+
onChange: u,
|
|
1075
1074
|
disabled: r,
|
|
1076
1075
|
inputMode: "decimal",
|
|
1077
1076
|
"aria-label": "Calculator input"
|
|
1078
1077
|
}
|
|
1079
1078
|
),
|
|
1080
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1 mb-3", children: BUTTONS.map((
|
|
1079
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1 mb-3", children: BUTTONS.map((m, b) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex w-full", children: m.map((d) => d === "⌫" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1081
1080
|
ButtonIcon,
|
|
1082
1081
|
{
|
|
1083
1082
|
as: X,
|
|
1084
1083
|
variant: "danger-ghost",
|
|
1085
1084
|
"aria-label": "Backspace",
|
|
1086
1085
|
size: "md",
|
|
1087
|
-
onClick: () =>
|
|
1086
|
+
onClick: () => c("⌫"),
|
|
1088
1087
|
disabled: r
|
|
1089
1088
|
},
|
|
1090
1089
|
"backspace"
|
|
1091
1090
|
) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1092
1091
|
CalculatorButton,
|
|
1093
1092
|
{
|
|
1094
|
-
variant:
|
|
1095
|
-
onClick: () =>
|
|
1093
|
+
variant: d === "=" ? "action" : d === "C" ? "danger" : ["/", "*", "-", "+", "/"].includes(d) ? "operator" : "default",
|
|
1094
|
+
onClick: () => c(d),
|
|
1096
1095
|
disabled: r,
|
|
1097
|
-
"aria-label":
|
|
1098
|
-
children:
|
|
1096
|
+
"aria-label": d,
|
|
1097
|
+
children: d
|
|
1099
1098
|
},
|
|
1100
|
-
|
|
1101
|
-
)) },
|
|
1099
|
+
d
|
|
1100
|
+
)) }, b)) })
|
|
1102
1101
|
]
|
|
1103
1102
|
}
|
|
1104
1103
|
);
|
|
1105
1104
|
}
|
|
1106
1105
|
);
|
|
1107
1106
|
Calculator.displayName = "Calculator";
|
|
1108
|
-
const
|
|
1109
|
-
variants: {
|
|
1110
|
-
color: {
|
|
1111
|
-
primary: "text-primary",
|
|
1112
|
-
secondary: "text-secondary",
|
|
1113
|
-
tertiary: "text-tertiary",
|
|
1114
|
-
ghost: "text-ghost",
|
|
1115
|
-
neutral: "text-ghost",
|
|
1116
|
-
success: "text-success",
|
|
1117
|
-
info: "text-info",
|
|
1118
|
-
warning: "text-warning",
|
|
1119
|
-
danger: "text-danger",
|
|
1120
|
-
inherit: "",
|
|
1121
|
-
gray: "text-gray-500",
|
|
1122
|
-
black: "text-black",
|
|
1123
|
-
white: "text-white"
|
|
1124
|
-
},
|
|
1125
|
-
hasUnderline: {
|
|
1126
|
-
true: "underline",
|
|
1127
|
-
false: ""
|
|
1128
|
-
},
|
|
1129
|
-
isCapitalize: {
|
|
1130
|
-
true: "capitalize",
|
|
1131
|
-
false: ""
|
|
1132
|
-
},
|
|
1133
|
-
align: {
|
|
1134
|
-
left: "text-left",
|
|
1135
|
-
center: "text-center",
|
|
1136
|
-
right: "text-right",
|
|
1137
|
-
justify: "text-justify"
|
|
1138
|
-
},
|
|
1139
|
-
italic: {
|
|
1140
|
-
true: "italic",
|
|
1141
|
-
false: ""
|
|
1142
|
-
},
|
|
1143
|
-
clamp: {
|
|
1144
|
-
1: "line-clamp-1",
|
|
1145
|
-
2: "line-clamp-2",
|
|
1146
|
-
3: "line-clamp-3",
|
|
1147
|
-
4: "line-clamp-4",
|
|
1148
|
-
5: "line-clamp-5",
|
|
1149
|
-
none: ""
|
|
1150
|
-
},
|
|
1151
|
-
ellipsis: {
|
|
1152
|
-
true: "truncate",
|
|
1153
|
-
false: ""
|
|
1154
|
-
},
|
|
1155
|
-
as: {
|
|
1156
|
-
h1: "font-bold text-4xl leading-loose",
|
|
1157
|
-
h2: "font-semibold text-3xl leading-relaxed",
|
|
1158
|
-
h3: "font-medium text-2xl leading-relaxed",
|
|
1159
|
-
h4: "font-bold text-xl leading-normal",
|
|
1160
|
-
h5: "font-semibold text-lg leading-normal",
|
|
1161
|
-
h6: "font-medium text-base leading-normal",
|
|
1162
|
-
p: "font-normal text-base leading-normal",
|
|
1163
|
-
span: "font-normal text-base leading-normal",
|
|
1164
|
-
label: "font-normal text-xs leading-normal"
|
|
1165
|
-
}
|
|
1166
|
-
},
|
|
1167
|
-
defaultVariants: {
|
|
1168
|
-
color: "neutral",
|
|
1169
|
-
hasUnderline: !1,
|
|
1170
|
-
isCapitalize: !1,
|
|
1171
|
-
align: "left",
|
|
1172
|
-
italic: !1,
|
|
1173
|
-
clamp: "none",
|
|
1174
|
-
ellipsis: !1,
|
|
1175
|
-
as: "span"
|
|
1176
|
-
}
|
|
1177
|
-
}), Text = forwardRef(
|
|
1178
|
-
({
|
|
1179
|
-
as: e = "span",
|
|
1180
|
-
color: t = "ghost",
|
|
1181
|
-
hasUnderline: r = !1,
|
|
1182
|
-
isCapitalize: s = !1,
|
|
1183
|
-
align: n = "left",
|
|
1184
|
-
italic: o = !1,
|
|
1185
|
-
clamp: i = "none",
|
|
1186
|
-
ellipsis: a = !1,
|
|
1187
|
-
fontSize: u,
|
|
1188
|
-
fontWeight: l,
|
|
1189
|
-
className: x,
|
|
1190
|
-
children: h,
|
|
1191
|
-
...f
|
|
1192
|
-
}, p) => {
|
|
1193
|
-
const d = [
|
|
1194
|
-
"h1",
|
|
1195
|
-
"h2",
|
|
1196
|
-
"h3",
|
|
1197
|
-
"h4",
|
|
1198
|
-
"h5",
|
|
1199
|
-
"h6",
|
|
1200
|
-
"p",
|
|
1201
|
-
"span",
|
|
1202
|
-
"label"
|
|
1203
|
-
].includes(e) ? e : "span", v = u ? `text-${u}` : "", w = l ? `font-${l}` : "";
|
|
1204
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1205
|
-
e,
|
|
1206
|
-
{
|
|
1207
|
-
ref: p,
|
|
1208
|
-
className: cn(
|
|
1209
|
-
textVariants({
|
|
1210
|
-
color: t,
|
|
1211
|
-
hasUnderline: r,
|
|
1212
|
-
isCapitalize: s,
|
|
1213
|
-
align: n,
|
|
1214
|
-
italic: o,
|
|
1215
|
-
clamp: i,
|
|
1216
|
-
ellipsis: a,
|
|
1217
|
-
// @ts-expect-error - `as` is not a valid variant
|
|
1218
|
-
as: d
|
|
1219
|
-
}),
|
|
1220
|
-
v,
|
|
1221
|
-
w,
|
|
1222
|
-
x
|
|
1223
|
-
),
|
|
1224
|
-
...f,
|
|
1225
|
-
children: h
|
|
1226
|
-
}
|
|
1227
|
-
);
|
|
1228
|
-
}
|
|
1229
|
-
), CalendarContext = createContext(null);
|
|
1107
|
+
const CalendarContext = createContext(null);
|
|
1230
1108
|
function useCalendarContext() {
|
|
1231
1109
|
const e = useContext(CalendarContext);
|
|
1232
1110
|
if (!e)
|
|
@@ -1269,27 +1147,27 @@ const CalendarHeader = () => {
|
|
|
1269
1147
|
] })
|
|
1270
1148
|
] });
|
|
1271
1149
|
}, 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 = () => {
|
|
1272
|
-
const e = useCalendarContext(), { year: t, month: r, value: s, onChange: n, setMonth: o, setYear: i } = e, a = (g,
|
|
1273
|
-
for (let g = 0; g <
|
|
1274
|
-
const
|
|
1150
|
+
const e = useCalendarContext(), { year: t, month: r, value: s, onChange: n, setMonth: o, setYear: i } = e, a = (g, x) => new Date(g, x + 1, 0).getDate(), u = ((g, x) => new Date(g, x, 1).getDay())(t, r), m = a(t, r), b = r - 1 < 0 ? 11 : r - 1, d = r === 0 ? t - 1 : t, p = a(t, b), y = r === 11 ? 0 : r + 1, f = r === 11 ? t + 1 : t, v = [];
|
|
1151
|
+
for (let g = 0; g < u; g++) {
|
|
1152
|
+
const x = p - u + g + 1;
|
|
1275
1153
|
v.push(
|
|
1276
1154
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1277
1155
|
ButtonIcon,
|
|
1278
1156
|
{
|
|
1279
|
-
as: () => /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "span", fontSize: "sm", color: "tertiary", children:
|
|
1157
|
+
as: () => /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "span", fontSize: "sm", color: "tertiary", children: x }),
|
|
1280
1158
|
size: "sm",
|
|
1281
1159
|
"aria-label": "Previous month day",
|
|
1282
1160
|
variant: "ghost",
|
|
1283
1161
|
onClick: () => {
|
|
1284
|
-
n?.(new Date(
|
|
1162
|
+
n?.(new Date(d, b, x)), o(b), i(d);
|
|
1285
1163
|
}
|
|
1286
1164
|
},
|
|
1287
1165
|
"prev-" + g
|
|
1288
1166
|
)
|
|
1289
1167
|
);
|
|
1290
1168
|
}
|
|
1291
|
-
for (let g = 1; g <=
|
|
1292
|
-
const
|
|
1169
|
+
for (let g = 1; g <= m; g++) {
|
|
1170
|
+
const x = s instanceof Date && s.getFullYear() === t && s.getMonth() === r && s.getDate() === g;
|
|
1293
1171
|
v.push(
|
|
1294
1172
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1295
1173
|
ButtonIcon,
|
|
@@ -1299,15 +1177,15 @@ const CalendarHeader = () => {
|
|
|
1299
1177
|
{
|
|
1300
1178
|
as: "span",
|
|
1301
1179
|
fontSize: "sm",
|
|
1302
|
-
color:
|
|
1303
|
-
className:
|
|
1180
|
+
color: x ? "inherit" : "ghost",
|
|
1181
|
+
className: x ? "bg-primary text-white rounded-full" : "",
|
|
1304
1182
|
children: g
|
|
1305
1183
|
}
|
|
1306
1184
|
),
|
|
1307
|
-
variant:
|
|
1185
|
+
variant: x ? "primary" : "ghost",
|
|
1308
1186
|
size: "sm",
|
|
1309
1187
|
"aria-label": `Select ${t}-${r + 1}-${g}`,
|
|
1310
|
-
"aria-current":
|
|
1188
|
+
"aria-current": x ? "date" : void 0,
|
|
1311
1189
|
onClick: () => {
|
|
1312
1190
|
n?.(new Date(t, r, g));
|
|
1313
1191
|
}
|
|
@@ -1316,7 +1194,7 @@ const CalendarHeader = () => {
|
|
|
1316
1194
|
)
|
|
1317
1195
|
);
|
|
1318
1196
|
}
|
|
1319
|
-
const w =
|
|
1197
|
+
const w = u + m;
|
|
1320
1198
|
for (let g = 0; g < (w % 7 === 0 ? 0 : 7 - w % 7); g++)
|
|
1321
1199
|
v.push(
|
|
1322
1200
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -1327,7 +1205,7 @@ const CalendarHeader = () => {
|
|
|
1327
1205
|
"aria-label": "Next month day",
|
|
1328
1206
|
variant: "ghost",
|
|
1329
1207
|
onClick: () => {
|
|
1330
|
-
n?.(new Date(
|
|
1208
|
+
n?.(new Date(f, y, g + 1)), o(y), i(f);
|
|
1331
1209
|
}
|
|
1332
1210
|
},
|
|
1333
1211
|
"next-" + g
|
|
@@ -1335,36 +1213,36 @@ const CalendarHeader = () => {
|
|
|
1335
1213
|
);
|
|
1336
1214
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-7 gap-2 px-4 pb-4", children: v });
|
|
1337
1215
|
}, CalendarDaysRange = () => {
|
|
1338
|
-
const { year: e, month: t, value: r, onChange: s, setMonth: n, setYear: o } = useCalendarContext(), i = (
|
|
1216
|
+
const { year: e, month: t, value: r, onChange: s, setMonth: n, setYear: o } = useCalendarContext(), i = (l, h) => new Date(l, h + 1, 0).getDate(), c = ((l, h) => new Date(l, h, 1).getDay())(e, t), u = i(e, t), m = t - 1 < 0 ? 11 : t - 1, b = t === 0 ? e - 1 : e, d = i(e, m), p = t === 11 ? 0 : t + 1, y = t === 11 ? e + 1 : e, f = [], v = () => {
|
|
1339
1217
|
if (!Array.isArray(r)) return [null, null];
|
|
1340
|
-
const [
|
|
1341
|
-
return !
|
|
1342
|
-
}, [w, g] = v(),
|
|
1218
|
+
const [l, h] = r;
|
|
1219
|
+
return !l && !h ? [null, null] : l && h ? l <= h ? [l, h] : [h, l] : [l, h];
|
|
1220
|
+
}, [w, g] = v(), x = (l) => {
|
|
1343
1221
|
if (!w || !g) return !1;
|
|
1344
|
-
const
|
|
1345
|
-
return
|
|
1346
|
-
}, I = (
|
|
1347
|
-
for (let
|
|
1348
|
-
const
|
|
1349
|
-
|
|
1222
|
+
const h = new Date(e, t, l);
|
|
1223
|
+
return h >= w && h <= g;
|
|
1224
|
+
}, I = (l) => w ? w.getFullYear() === e && w.getMonth() === t && w.getDate() === l : !1, S = (l) => g ? g.getFullYear() === e && g.getMonth() === t && g.getDate() === l : !1;
|
|
1225
|
+
for (let l = 0; l < c; l++) {
|
|
1226
|
+
const h = d - c + l + 1;
|
|
1227
|
+
f.push(
|
|
1350
1228
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1351
1229
|
ButtonIcon,
|
|
1352
1230
|
{
|
|
1353
|
-
as: () => /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "span", fontSize: "sm", color: "tertiary", children:
|
|
1231
|
+
as: () => /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "span", fontSize: "sm", color: "tertiary", children: h }),
|
|
1354
1232
|
size: "sm",
|
|
1355
1233
|
"aria-label": "Previous month day",
|
|
1356
1234
|
variant: "ghost",
|
|
1357
1235
|
onClick: () => {
|
|
1358
|
-
s?.([null, null]), n(
|
|
1236
|
+
s?.([null, null]), n(m), o(b);
|
|
1359
1237
|
}
|
|
1360
1238
|
},
|
|
1361
|
-
"prev-" +
|
|
1239
|
+
"prev-" + l
|
|
1362
1240
|
)
|
|
1363
1241
|
);
|
|
1364
1242
|
}
|
|
1365
|
-
for (let
|
|
1366
|
-
const
|
|
1367
|
-
|
|
1243
|
+
for (let l = 1; l <= u; l++) {
|
|
1244
|
+
const h = x(l), E = I(l), C = S(l);
|
|
1245
|
+
f.push(
|
|
1368
1246
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1369
1247
|
ButtonIcon,
|
|
1370
1248
|
{
|
|
@@ -1373,39 +1251,39 @@ const CalendarHeader = () => {
|
|
|
1373
1251
|
{
|
|
1374
1252
|
as: "span",
|
|
1375
1253
|
fontSize: "sm",
|
|
1376
|
-
color:
|
|
1254
|
+
color: h || E || C ? "inherit" : "ghost",
|
|
1377
1255
|
className: cn(
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1256
|
+
h && " bg-primary text-white",
|
|
1257
|
+
E && "rounded-l-full bg-primary text-white",
|
|
1258
|
+
C && "rounded-r-full bg-primary text-white"
|
|
1381
1259
|
),
|
|
1382
|
-
children:
|
|
1260
|
+
children: l
|
|
1383
1261
|
}
|
|
1384
1262
|
),
|
|
1385
|
-
variant:
|
|
1263
|
+
variant: E || C || h ? "primary" : "ghost",
|
|
1386
1264
|
size: "sm",
|
|
1387
|
-
"aria-label": `Select ${e}-${t + 1}-${
|
|
1388
|
-
"aria-current":
|
|
1265
|
+
"aria-label": `Select ${e}-${t + 1}-${l}`,
|
|
1266
|
+
"aria-current": E || C ? "date" : void 0,
|
|
1389
1267
|
onClick: () => {
|
|
1390
1268
|
if (!Array.isArray(r) || !r[0] || r[0] && r[1])
|
|
1391
|
-
s?.([new Date(e, t,
|
|
1269
|
+
s?.([new Date(e, t, l), null]);
|
|
1392
1270
|
else if (r[0] && !r[1]) {
|
|
1393
|
-
const j = r[0], R = new Date(e, t,
|
|
1271
|
+
const j = r[0], R = new Date(e, t, l);
|
|
1394
1272
|
j.getTime() === R.getTime() ? s?.([j, R]) : s?.(j < R ? [j, R] : [R, j]);
|
|
1395
1273
|
}
|
|
1396
1274
|
}
|
|
1397
1275
|
},
|
|
1398
|
-
|
|
1276
|
+
l
|
|
1399
1277
|
)
|
|
1400
1278
|
);
|
|
1401
1279
|
}
|
|
1402
|
-
const
|
|
1403
|
-
for (let
|
|
1404
|
-
|
|
1280
|
+
const N = c + u;
|
|
1281
|
+
for (let l = 0; l < (N % 7 === 0 ? 0 : 7 - N % 7); l++)
|
|
1282
|
+
f.push(
|
|
1405
1283
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1406
1284
|
ButtonIcon,
|
|
1407
1285
|
{
|
|
1408
|
-
as: () => /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "span", fontSize: "sm", color: "tertiary", children:
|
|
1286
|
+
as: () => /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "span", fontSize: "sm", color: "tertiary", children: l + 1 }),
|
|
1409
1287
|
size: "sm",
|
|
1410
1288
|
"aria-label": "Next month day",
|
|
1411
1289
|
variant: "ghost",
|
|
@@ -1413,10 +1291,10 @@ const CalendarHeader = () => {
|
|
|
1413
1291
|
s?.([null, null]), n(p), o(y);
|
|
1414
1292
|
}
|
|
1415
1293
|
},
|
|
1416
|
-
"next-" +
|
|
1294
|
+
"next-" + l
|
|
1417
1295
|
)
|
|
1418
1296
|
);
|
|
1419
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-7 gap-2 px-4 pb-4", children:
|
|
1297
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-7 gap-2 px-4 pb-4", children: f });
|
|
1420
1298
|
}, CalendarDays = () => {
|
|
1421
1299
|
const { type: e } = useCalendarContext();
|
|
1422
1300
|
return e === "range" ? /* @__PURE__ */ jsxRuntimeExports.jsx(CalendarDaysRange, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(CalendarDaysSingle, {});
|
|
@@ -1428,32 +1306,32 @@ function useCalendar({
|
|
|
1428
1306
|
initialYear: s,
|
|
1429
1307
|
initialMonth: n
|
|
1430
1308
|
}) {
|
|
1431
|
-
const [o, i] = useState(n), [a,
|
|
1309
|
+
const [o, i] = useState(n), [a, c] = useState(s), [u, m] = useState([
|
|
1432
1310
|
null,
|
|
1433
1311
|
null
|
|
1434
1312
|
]);
|
|
1435
|
-
let
|
|
1436
|
-
t === "range" && !e && (
|
|
1437
|
-
const
|
|
1438
|
-
const
|
|
1439
|
-
i(
|
|
1313
|
+
let b = e;
|
|
1314
|
+
t === "range" && !e && (b = u);
|
|
1315
|
+
const d = useCallback(() => {
|
|
1316
|
+
const f = o === 0 ? 11 : o - 1, v = o === 0 ? a - 1 : a;
|
|
1317
|
+
i(f), c(v), t === "single" && r?.(new Date(v, f, 1));
|
|
1440
1318
|
}, [o, a, t, r]), p = useCallback(() => {
|
|
1441
|
-
const
|
|
1442
|
-
i(
|
|
1319
|
+
const f = o === 11 ? 0 : o + 1, v = o === 11 ? a + 1 : a;
|
|
1320
|
+
i(f), c(v), t === "single" && r?.(new Date(v, f, 1));
|
|
1443
1321
|
}, [o, a, t, r]), y = useCallback(
|
|
1444
|
-
(
|
|
1445
|
-
t === "single" ? r?.(
|
|
1322
|
+
(f) => {
|
|
1323
|
+
t === "single" ? r?.(f) : t === "range" && (m(f), r?.(f));
|
|
1446
1324
|
},
|
|
1447
1325
|
[t, r]
|
|
1448
1326
|
);
|
|
1449
1327
|
return {
|
|
1450
1328
|
year: a,
|
|
1451
1329
|
month: o,
|
|
1452
|
-
value:
|
|
1330
|
+
value: b,
|
|
1453
1331
|
setMonth: i,
|
|
1454
|
-
setYear:
|
|
1332
|
+
setYear: c,
|
|
1455
1333
|
onChange: y,
|
|
1456
|
-
handlePrevMonth:
|
|
1334
|
+
handlePrevMonth: d,
|
|
1457
1335
|
handleNextMonth: p
|
|
1458
1336
|
};
|
|
1459
1337
|
}
|
|
@@ -1490,7 +1368,53 @@ const CalendarRoot = ({
|
|
|
1490
1368
|
] })
|
|
1491
1369
|
}
|
|
1492
1370
|
);
|
|
1493
|
-
}, Calendar = Object.assign(CalendarRoot, {}),
|
|
1371
|
+
}, Calendar = Object.assign(CalendarRoot, {}), noResultsVariants = cva(
|
|
1372
|
+
"flex flex-col items-center justify-center text-center border border-border rounded-lg bg-background",
|
|
1373
|
+
{
|
|
1374
|
+
variants: {
|
|
1375
|
+
spacing: {
|
|
1376
|
+
sm: "py-8",
|
|
1377
|
+
md: "py-12",
|
|
1378
|
+
lg: "py-16"
|
|
1379
|
+
},
|
|
1380
|
+
hasGrayBackground: {
|
|
1381
|
+
true: "bg-neutral-soft",
|
|
1382
|
+
false: ""
|
|
1383
|
+
}
|
|
1384
|
+
},
|
|
1385
|
+
defaultVariants: {
|
|
1386
|
+
spacing: "md",
|
|
1387
|
+
hasGrayBackground: !1
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
), noResultsHeaderVariants = cva(
|
|
1391
|
+
"flex flex-row items-center gap-3 mb-2"
|
|
1392
|
+
), noResultsTitleVariants = cva(
|
|
1393
|
+
"text-lg font-semibold text-foreground"
|
|
1394
|
+
), noResultsSubtitleVariants = cva(
|
|
1395
|
+
"text-foreground-light mb-6 max-w-md"
|
|
1396
|
+
), NoResults = React__default.forwardRef(
|
|
1397
|
+
function e({ icon: t, title: r, subtitle: s, action: n, className: o, hasGrayBackground: i, ...a }, c) {
|
|
1398
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1399
|
+
"section",
|
|
1400
|
+
{
|
|
1401
|
+
ref: c,
|
|
1402
|
+
className: cn(noResultsVariants({ hasGrayBackground: i }), o),
|
|
1403
|
+
role: "status",
|
|
1404
|
+
"aria-label": "No results found",
|
|
1405
|
+
...a,
|
|
1406
|
+
children: [
|
|
1407
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("header", { className: noResultsHeaderVariants(), children: [
|
|
1408
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { as: t, size: "lg", color: "ghost", "aria-hidden": "true" }),
|
|
1409
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "h2", className: noResultsTitleVariants(), children: r })
|
|
1410
|
+
] }),
|
|
1411
|
+
s && /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "p", className: noResultsSubtitleVariants(), children: s }),
|
|
1412
|
+
n && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { role: "group", "aria-label": "Available actions", children: n })
|
|
1413
|
+
]
|
|
1414
|
+
}
|
|
1415
|
+
);
|
|
1416
|
+
}
|
|
1417
|
+
), TableContext = createContext(null), TableProvider = TableContext.Provider;
|
|
1494
1418
|
function useTableContext() {
|
|
1495
1419
|
const e = useContext(TableContext);
|
|
1496
1420
|
if (!e)
|
|
@@ -1561,7 +1485,7 @@ const getTableColumnClass = (e) => {
|
|
|
1561
1485
|
}
|
|
1562
1486
|
}, TableHeader = forwardRef(
|
|
1563
1487
|
({ children: e, className: t, ...r }, s) => {
|
|
1564
|
-
const {
|
|
1488
|
+
const { columns: n } = useTableContext();
|
|
1565
1489
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1566
1490
|
"div",
|
|
1567
1491
|
{
|
|
@@ -1584,7 +1508,7 @@ const getTableColumnClass = (e) => {
|
|
|
1584
1508
|
({ children: e, className: t, ...r }, s) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { role: "rowgroup", ref: s, className: cn(t), ...r, children: e })
|
|
1585
1509
|
), TableFooter = forwardRef(
|
|
1586
1510
|
({ children: e, className: t, ...r }, s) => {
|
|
1587
|
-
const {
|
|
1511
|
+
const { columns: n } = useTableContext();
|
|
1588
1512
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1589
1513
|
"div",
|
|
1590
1514
|
{
|
|
@@ -1605,7 +1529,7 @@ const getTableColumnClass = (e) => {
|
|
|
1605
1529
|
}
|
|
1606
1530
|
), TableRow = forwardRef(
|
|
1607
1531
|
({ children: e, className: t, ...r }, s) => {
|
|
1608
|
-
const {
|
|
1532
|
+
const { columns: n } = useTableContext();
|
|
1609
1533
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1610
1534
|
"div",
|
|
1611
1535
|
{
|
|
@@ -1625,8 +1549,8 @@ const getTableColumnClass = (e) => {
|
|
|
1625
1549
|
), TableColumn = forwardRef(
|
|
1626
1550
|
({ as: e = "td", span: t, align: r = "left", children: s, className: n, ...o }, i) => {
|
|
1627
1551
|
const a = e === "th" ? "columnheader" : "cell";
|
|
1628
|
-
let
|
|
1629
|
-
return r === "center" ?
|
|
1552
|
+
let c = "text-left";
|
|
1553
|
+
return r === "center" ? c = "text-center" : r === "right" && (c = "text-right"), /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1630
1554
|
"div",
|
|
1631
1555
|
{
|
|
1632
1556
|
ref: i,
|
|
@@ -1635,7 +1559,8 @@ const getTableColumnClass = (e) => {
|
|
|
1635
1559
|
"px-4 py-2",
|
|
1636
1560
|
"[&:not(:last-child)]:border-r [&:not(:last-child)]:border-border",
|
|
1637
1561
|
getRowSpanClass(t),
|
|
1638
|
-
|
|
1562
|
+
c,
|
|
1563
|
+
"truncate overflow-hidden whitespace-nowrap",
|
|
1639
1564
|
n
|
|
1640
1565
|
),
|
|
1641
1566
|
...o,
|
|
@@ -1643,32 +1568,57 @@ const getTableColumnClass = (e) => {
|
|
|
1643
1568
|
}
|
|
1644
1569
|
);
|
|
1645
1570
|
}
|
|
1571
|
+
), TableRowItem = forwardRef(
|
|
1572
|
+
(e, t) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1573
|
+
TableColumn,
|
|
1574
|
+
{
|
|
1575
|
+
...e,
|
|
1576
|
+
as: "td",
|
|
1577
|
+
ref: t,
|
|
1578
|
+
className: cn(
|
|
1579
|
+
"truncate overflow-hidden whitespace-nowrap",
|
|
1580
|
+
e.className
|
|
1581
|
+
)
|
|
1582
|
+
}
|
|
1583
|
+
)
|
|
1584
|
+
), TableHeaderItem = forwardRef(
|
|
1585
|
+
(e, t) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1586
|
+
TableColumn,
|
|
1587
|
+
{
|
|
1588
|
+
...e,
|
|
1589
|
+
as: "th",
|
|
1590
|
+
ref: t,
|
|
1591
|
+
className: cn(
|
|
1592
|
+
"truncate overflow-hidden whitespace-nowrap",
|
|
1593
|
+
e.className
|
|
1594
|
+
)
|
|
1595
|
+
}
|
|
1596
|
+
)
|
|
1646
1597
|
), TableRoot = forwardRef(
|
|
1647
|
-
({ children: e, className: t,
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
) });
|
|
1665
|
-
}
|
|
1598
|
+
({ children: e, className: t, columns: r = 12, ...s }, n) => /* @__PURE__ */ jsxRuntimeExports.jsx(TableProvider, { value: { columns: r }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1599
|
+
"div",
|
|
1600
|
+
{
|
|
1601
|
+
ref: n,
|
|
1602
|
+
role: "table",
|
|
1603
|
+
className: cn(
|
|
1604
|
+
// Versaur design system: border, background, shadow, rounded, spacing
|
|
1605
|
+
"w-full overflow-x-auto border border-border bg-background rounded-lg ",
|
|
1606
|
+
"text-foreground",
|
|
1607
|
+
"sm:rounded-xl",
|
|
1608
|
+
"transition-colors",
|
|
1609
|
+
t
|
|
1610
|
+
),
|
|
1611
|
+
...s,
|
|
1612
|
+
children: e
|
|
1613
|
+
}
|
|
1614
|
+
) })
|
|
1666
1615
|
), Table = Object.assign(TableRoot, {
|
|
1667
1616
|
Header: TableHeader,
|
|
1617
|
+
HeaderItem: TableHeaderItem,
|
|
1668
1618
|
Body: TableBody,
|
|
1669
1619
|
Footer: TableFooter,
|
|
1670
1620
|
Row: TableRow,
|
|
1671
|
-
|
|
1621
|
+
RowItem: TableRowItem
|
|
1672
1622
|
}), tileVariants = cva(
|
|
1673
1623
|
// Base classes
|
|
1674
1624
|
"block transition-colors duration-200",
|
|
@@ -1776,10 +1726,10 @@ function useImage({ src: e }) {
|
|
|
1776
1726
|
};
|
|
1777
1727
|
return useEffect(() => {
|
|
1778
1728
|
if (!e) return;
|
|
1779
|
-
const
|
|
1780
|
-
return
|
|
1729
|
+
const c = new Image();
|
|
1730
|
+
return c.src = e, c.onload = () => {
|
|
1781
1731
|
o.current || r(!0);
|
|
1782
|
-
},
|
|
1732
|
+
}, c.onerror = () => {
|
|
1783
1733
|
o.current || n(!0);
|
|
1784
1734
|
}, () => {
|
|
1785
1735
|
o.current = !0;
|
|
@@ -1899,25 +1849,25 @@ const BaseImage = forwardRef(
|
|
|
1899
1849
|
height: o,
|
|
1900
1850
|
loading: i = "lazy",
|
|
1901
1851
|
position: a = "cover",
|
|
1902
|
-
size:
|
|
1903
|
-
shape:
|
|
1904
|
-
className:
|
|
1905
|
-
...
|
|
1906
|
-
},
|
|
1907
|
-
const { loaded: p, errored: y, handleLoad:
|
|
1852
|
+
size: c = "auto",
|
|
1853
|
+
shape: u,
|
|
1854
|
+
className: m,
|
|
1855
|
+
...b
|
|
1856
|
+
}, d) => {
|
|
1857
|
+
const { loaded: p, errored: y, handleLoad: f, handleError: v } = useImage({
|
|
1908
1858
|
src: e
|
|
1909
1859
|
}), w = typeof n == "number" ? n : Number(n), g = typeof o == "number" ? o : Number(o);
|
|
1910
1860
|
return !p && !y ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1911
1861
|
BaseImageSkeleton,
|
|
1912
1862
|
{
|
|
1913
|
-
shape:
|
|
1863
|
+
shape: u,
|
|
1914
1864
|
width: w,
|
|
1915
1865
|
height: g
|
|
1916
1866
|
}
|
|
1917
1867
|
) : y ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1918
1868
|
BaseImageFallback,
|
|
1919
1869
|
{
|
|
1920
|
-
shape:
|
|
1870
|
+
shape: u,
|
|
1921
1871
|
alt: t,
|
|
1922
1872
|
width: w,
|
|
1923
1873
|
height: g
|
|
@@ -1925,7 +1875,7 @@ const BaseImage = forwardRef(
|
|
|
1925
1875
|
) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1926
1876
|
"img",
|
|
1927
1877
|
{
|
|
1928
|
-
ref:
|
|
1878
|
+
ref: d,
|
|
1929
1879
|
src: e,
|
|
1930
1880
|
alt: t,
|
|
1931
1881
|
width: w,
|
|
@@ -1934,18 +1884,18 @@ const BaseImage = forwardRef(
|
|
|
1934
1884
|
className: cn(
|
|
1935
1885
|
imageVariants({
|
|
1936
1886
|
position: a,
|
|
1937
|
-
size:
|
|
1938
|
-
shape:
|
|
1887
|
+
size: c,
|
|
1888
|
+
shape: u
|
|
1939
1889
|
}),
|
|
1940
|
-
|
|
1890
|
+
m
|
|
1941
1891
|
),
|
|
1942
|
-
onLoad: (
|
|
1943
|
-
|
|
1892
|
+
onLoad: (x) => {
|
|
1893
|
+
f(), r?.(x);
|
|
1944
1894
|
},
|
|
1945
|
-
onError: (
|
|
1946
|
-
v(), s?.(
|
|
1895
|
+
onError: (x) => {
|
|
1896
|
+
v(), s?.(x);
|
|
1947
1897
|
},
|
|
1948
|
-
...
|
|
1898
|
+
...b
|
|
1949
1899
|
}
|
|
1950
1900
|
);
|
|
1951
1901
|
}
|
|
@@ -1956,6 +1906,7 @@ export {
|
|
|
1956
1906
|
Calculator as C,
|
|
1957
1907
|
DescriptionList as D,
|
|
1958
1908
|
Icon as I,
|
|
1909
|
+
NoResults as N,
|
|
1959
1910
|
Table as T,
|
|
1960
1911
|
Anchor as a,
|
|
1961
1912
|
Avatar as b,
|
|
@@ -1964,10 +1915,9 @@ export {
|
|
|
1964
1915
|
ButtonFloat as e,
|
|
1965
1916
|
ButtonIcon as f,
|
|
1966
1917
|
Calendar as g,
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
BaseImage as m
|
|
1918
|
+
Tile as h,
|
|
1919
|
+
ImageCircle as i,
|
|
1920
|
+
ImageSquare as j,
|
|
1921
|
+
ImageRectangle as k,
|
|
1922
|
+
BaseImage as l
|
|
1973
1923
|
};
|