@dimaan/ui 0.0.28 → 0.0.30
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/index.cjs +253 -136
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +89 -14
- package/dist/index.d.ts +89 -14
- package/dist/index.js +238 -137
- package/dist/index.js.map +1 -1
- package/dist/preset.css +73 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -92,21 +92,21 @@ var AlertDialogDescription = forwardRef(function AlertDialogDescription2({ class
|
|
|
92
92
|
|
|
93
93
|
// src/components/button/buttonVariants.ts
|
|
94
94
|
var buttonVariantClass = {
|
|
95
|
-
primary: "bg-primary text-primary-foreground shadow-
|
|
95
|
+
primary: "bg-primary text-primary-foreground shadow-[var(--shadow-btn)] hover:bg-primary/95 hover:-translate-y-px hover:shadow-[var(--shadow-btn-hover)] active:translate-y-0 active:shadow-[var(--shadow-btn-active)] focus-visible:ring-primary/40",
|
|
96
96
|
secondary: "bg-muted text-foreground hover:bg-muted/80 focus-visible:ring-muted-foreground/30",
|
|
97
97
|
outline: "border border-input bg-background text-foreground hover:bg-accent hover:text-accent-foreground focus-visible:ring-ring/40",
|
|
98
98
|
ghost: "bg-transparent text-foreground hover:bg-accent hover:text-accent-foreground focus-visible:ring-ring/40",
|
|
99
|
-
destructive: "bg-destructive text-destructive-foreground shadow-
|
|
100
|
-
success: "bg-success text-success-foreground shadow-
|
|
101
|
-
warning: "bg-warning text-warning-foreground shadow-
|
|
99
|
+
destructive: "bg-destructive text-destructive-foreground shadow-[var(--shadow-solid)] hover:bg-destructive/95 hover:-translate-y-px hover:shadow-[var(--shadow-solid-hover)] active:translate-y-0 active:shadow-[var(--shadow-solid-active)] focus-visible:ring-destructive/40",
|
|
100
|
+
success: "bg-success text-success-foreground shadow-[var(--shadow-solid)] hover:bg-success/95 hover:-translate-y-px hover:shadow-[var(--shadow-solid-hover)] active:translate-y-0 active:shadow-[var(--shadow-solid-active)] focus-visible:ring-success/40",
|
|
101
|
+
warning: "bg-warning text-warning-foreground shadow-[var(--shadow-solid)] hover:bg-warning/95 hover:-translate-y-px hover:shadow-[var(--shadow-solid-hover)] active:translate-y-0 active:shadow-[var(--shadow-solid-active)] focus-visible:ring-warning/40",
|
|
102
102
|
link: "text-primary underline-offset-4 hover:underline focus-visible:ring-primary/40 px-0 shadow-none"
|
|
103
103
|
};
|
|
104
104
|
var buttonSizeClass = {
|
|
105
|
-
sm: "h-8 gap-1.5 rounded-
|
|
106
|
-
md: "h-9 gap-2 rounded-
|
|
107
|
-
lg: "h-11 gap-2.5 rounded-
|
|
108
|
-
icon: "
|
|
109
|
-
"icon-sm": "
|
|
105
|
+
sm: "h-8 gap-1.5 rounded-[10px] px-3 text-sm",
|
|
106
|
+
md: "h-9 gap-2 rounded-[10px] px-4 text-sm",
|
|
107
|
+
lg: "h-11 gap-2.5 rounded-[10px] px-6 text-base",
|
|
108
|
+
icon: "size-9 shrink-0 rounded-[10px] p-0",
|
|
109
|
+
"icon-sm": "size-8 shrink-0 rounded-[10px] p-0"
|
|
110
110
|
};
|
|
111
111
|
var buttonBaseClass = "group/button relative inline-flex items-center justify-center font-medium select-none whitespace-nowrap outline-none transition-[background-color,color,box-shadow,opacity,transform] active:scale-[0.98] focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 motion-reduce:transition-none motion-reduce:active:scale-100 [&_svg]:pointer-events-none [&_svg]:shrink-0";
|
|
112
112
|
var Button = forwardRef(function Button2({
|
|
@@ -169,10 +169,10 @@ var Button = forwardRef(function Button2({
|
|
|
169
169
|
);
|
|
170
170
|
});
|
|
171
171
|
function Slot({ children }) {
|
|
172
|
-
return /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "inline-flex
|
|
172
|
+
return /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "inline-flex size-4 items-center justify-center", children });
|
|
173
173
|
}
|
|
174
174
|
function Spinner() {
|
|
175
|
-
return /* @__PURE__ */ jsx(Loader2, { "aria-hidden": "true", className: "
|
|
175
|
+
return /* @__PURE__ */ jsx(Loader2, { "aria-hidden": "true", className: "size-4 animate-spin", "data-testid": "button-spinner" });
|
|
176
176
|
}
|
|
177
177
|
var ConfirmDialogContext = createContext(null);
|
|
178
178
|
function ConfirmDialogProvider({ labels, children }) {
|
|
@@ -344,7 +344,7 @@ function DashboardMain({ className, children, ...props }) {
|
|
|
344
344
|
// stretching the whole layout past 100%.
|
|
345
345
|
"flex min-h-screen min-w-0 flex-1 flex-col transition-[margin] duration-200 ease-out",
|
|
346
346
|
// On desktop, push the main column past the fixed sidebar using logical margin.
|
|
347
|
-
collapsed ? "lg:ms-
|
|
347
|
+
collapsed ? "lg:ms-0" : "lg:ms-(--sidebar-width)",
|
|
348
348
|
className
|
|
349
349
|
),
|
|
350
350
|
...props,
|
|
@@ -447,7 +447,7 @@ var HeaderSearch = forwardRef(
|
|
|
447
447
|
"span",
|
|
448
448
|
{
|
|
449
449
|
"aria-hidden": "true",
|
|
450
|
-
className: "pointer-events-none absolute start-3 flex
|
|
450
|
+
className: "pointer-events-none absolute start-3 flex size-4 items-center justify-center text-muted-foreground",
|
|
451
451
|
children: icon
|
|
452
452
|
}
|
|
453
453
|
) : null,
|
|
@@ -513,14 +513,16 @@ function Sidebar({ className, children, ...props }) {
|
|
|
513
513
|
"fixed inset-y-0 start-0 z-40 flex flex-col",
|
|
514
514
|
// Surface
|
|
515
515
|
"bg-sidebar text-sidebar-foreground border-e border-sidebar-border",
|
|
516
|
-
// Sizing — width
|
|
517
|
-
|
|
516
|
+
// Sizing — always full width; collapse hides it off-canvas (below).
|
|
517
|
+
"w-[var(--sidebar-width)]",
|
|
518
518
|
// Motion
|
|
519
|
-
"transition-
|
|
520
|
-
// Mobile slide
|
|
521
|
-
//
|
|
522
|
-
|
|
523
|
-
|
|
519
|
+
"transition-transform duration-200 ease-out",
|
|
520
|
+
// Mobile: slide in/out via mobileOpen. Logical translate (rtl variant)
|
|
521
|
+
// so it slides off the inline-start edge in both LTR and RTL.
|
|
522
|
+
mobileOpen ? "translate-x-0" : "-translate-x-full rtl:translate-x-full",
|
|
523
|
+
// Desktop: collapse fully hides the sidebar off-canvas; the header
|
|
524
|
+
// trigger slides it back in and the main content reclaims the width.
|
|
525
|
+
collapsed ? "lg:-translate-x-full lg:rtl:translate-x-full" : "lg:translate-x-0 lg:rtl:translate-x-0",
|
|
524
526
|
className
|
|
525
527
|
),
|
|
526
528
|
...props,
|
|
@@ -543,18 +545,8 @@ function SidebarFooter({ className, children, ...props }) {
|
|
|
543
545
|
);
|
|
544
546
|
}
|
|
545
547
|
function SidebarGroup({ label, className, children, ...props }) {
|
|
546
|
-
const { collapsed } = useDashboardLayout();
|
|
547
548
|
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-1 py-2", className), ...props, children: [
|
|
548
|
-
label ? /* @__PURE__ */ jsx(
|
|
549
|
-
"div",
|
|
550
|
-
{
|
|
551
|
-
className: cn(
|
|
552
|
-
"px-3 pb-1 text-xs font-medium uppercase tracking-wider text-muted-foreground transition-opacity",
|
|
553
|
-
collapsed && "pointer-events-none h-0 overflow-hidden opacity-0"
|
|
554
|
-
),
|
|
555
|
-
children: label
|
|
556
|
-
}
|
|
557
|
-
) : null,
|
|
549
|
+
label ? /* @__PURE__ */ jsx("div", { className: "px-3 pb-1 text-xs font-medium uppercase tracking-wider text-muted-foreground", children: label }) : null,
|
|
558
550
|
/* @__PURE__ */ jsx("div", { className: "flex flex-col gap-0.5", children })
|
|
559
551
|
] });
|
|
560
552
|
}
|
|
@@ -588,7 +580,6 @@ function SidebarNavGroup({
|
|
|
588
580
|
onClick,
|
|
589
581
|
...props
|
|
590
582
|
}) {
|
|
591
|
-
const { collapsed } = useDashboardLayout();
|
|
592
583
|
const submenuId = useId();
|
|
593
584
|
const [internalOpen, setInternalOpen] = useState(defaultOpen);
|
|
594
585
|
const isControlled = openProp !== void 0;
|
|
@@ -615,27 +606,23 @@ function SidebarNavGroup({
|
|
|
615
606
|
const isActive = active || hasActiveChild;
|
|
616
607
|
const prevHasActiveChild = useRef(false);
|
|
617
608
|
useEffect(() => {
|
|
618
|
-
if (hasActiveChild && !prevHasActiveChild.current
|
|
609
|
+
if (hasActiveChild && !prevHasActiveChild.current) {
|
|
619
610
|
setOpen(true);
|
|
620
611
|
}
|
|
621
612
|
prevHasActiveChild.current = hasActiveChild;
|
|
622
|
-
}, [hasActiveChild,
|
|
623
|
-
|
|
624
|
-
if (collapsed && open) setOpen(false);
|
|
625
|
-
}, [collapsed, open, setOpen]);
|
|
626
|
-
const titleAttr = collapsed && typeof label === "string" ? label : props.title ?? void 0;
|
|
627
|
-
const showChildren = !collapsed;
|
|
613
|
+
}, [hasActiveChild, setOpen]);
|
|
614
|
+
const titleAttr = props.title ?? void 0;
|
|
628
615
|
return /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 flex-col", children: [
|
|
629
616
|
/* @__PURE__ */ jsxs(
|
|
630
617
|
"button",
|
|
631
618
|
{
|
|
632
619
|
type: "button",
|
|
633
|
-
"aria-expanded":
|
|
634
|
-
"aria-controls":
|
|
620
|
+
"aria-expanded": open,
|
|
621
|
+
"aria-controls": submenuId,
|
|
635
622
|
"data-active": isActive ? "true" : void 0,
|
|
636
623
|
title: titleAttr,
|
|
637
624
|
onClick: (e) => {
|
|
638
|
-
|
|
625
|
+
setOpen(!open);
|
|
639
626
|
onClick?.(e);
|
|
640
627
|
},
|
|
641
628
|
className: cn(
|
|
@@ -643,7 +630,6 @@ function SidebarNavGroup({
|
|
|
643
630
|
"text-sidebar-foreground/80 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
644
631
|
"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-sidebar",
|
|
645
632
|
isActive && "bg-sidebar-accent text-sidebar-accent-foreground",
|
|
646
|
-
collapsed && "justify-center px-0",
|
|
647
633
|
className
|
|
648
634
|
),
|
|
649
635
|
...props,
|
|
@@ -655,19 +641,10 @@ function SidebarNavGroup({
|
|
|
655
641
|
className: "absolute inset-y-1.5 start-0 w-1 rounded-full bg-primary"
|
|
656
642
|
}
|
|
657
643
|
) : null,
|
|
658
|
-
icon ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "flex
|
|
659
|
-
/* @__PURE__ */ jsx(
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
className: cn(
|
|
663
|
-
"flex-1 truncate text-start transition-[opacity,width]",
|
|
664
|
-
collapsed && "pointer-events-none w-0 opacity-0"
|
|
665
|
-
),
|
|
666
|
-
children: label
|
|
667
|
-
}
|
|
668
|
-
),
|
|
669
|
-
endSlot && !collapsed ? /* @__PURE__ */ jsx("span", { className: "flex shrink-0 items-center", children: endSlot }) : null,
|
|
670
|
-
showChildren ? /* @__PURE__ */ jsx(ChevronCaret, { open }) : null
|
|
644
|
+
icon ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "flex size-5 shrink-0 items-center justify-center", children: icon }) : null,
|
|
645
|
+
/* @__PURE__ */ jsx("span", { className: "flex-1 truncate text-start", children: label }),
|
|
646
|
+
endSlot ? /* @__PURE__ */ jsx("span", { className: "flex shrink-0 items-center", children: endSlot }) : null,
|
|
647
|
+
/* @__PURE__ */ jsx(ChevronCaret, { open })
|
|
671
648
|
]
|
|
672
649
|
}
|
|
673
650
|
),
|
|
@@ -675,10 +652,10 @@ function SidebarNavGroup({
|
|
|
675
652
|
"div",
|
|
676
653
|
{
|
|
677
654
|
id: submenuId,
|
|
678
|
-
hidden: !
|
|
655
|
+
hidden: !open,
|
|
679
656
|
className: cn(
|
|
680
657
|
"grid transition-[grid-template-rows] duration-200 ease-out",
|
|
681
|
-
|
|
658
|
+
open ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
|
|
682
659
|
),
|
|
683
660
|
children: /* @__PURE__ */ jsx("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-0.5 ps-7 pt-1", children: /* @__PURE__ */ jsx(SidebarNavGroupContext.Provider, { value: contextValue, children }) }) })
|
|
684
661
|
}
|
|
@@ -691,7 +668,7 @@ function ChevronCaret({ open }) {
|
|
|
691
668
|
{
|
|
692
669
|
"aria-hidden": "true",
|
|
693
670
|
className: cn(
|
|
694
|
-
"
|
|
671
|
+
"size-3.5 shrink-0 text-muted-foreground transition-transform duration-200",
|
|
695
672
|
open && "rotate-180"
|
|
696
673
|
)
|
|
697
674
|
}
|
|
@@ -709,7 +686,6 @@ function SidebarNavItem({
|
|
|
709
686
|
end,
|
|
710
687
|
...props
|
|
711
688
|
}) {
|
|
712
|
-
const { collapsed } = useDashboardLayout();
|
|
713
689
|
const resolved = useResolvedPath(to);
|
|
714
690
|
const group = useContext(SidebarNavGroupContext);
|
|
715
691
|
const itemId = useId();
|
|
@@ -721,13 +697,12 @@ function SidebarNavItem({
|
|
|
721
697
|
return () => group.reportActive(itemId, false);
|
|
722
698
|
}, [group, itemId, isActive]);
|
|
723
699
|
const labelContent = label ?? children;
|
|
724
|
-
const titleAttr =
|
|
700
|
+
const titleAttr = props.title;
|
|
725
701
|
const getClassName = (active) => cn(
|
|
726
702
|
"group relative flex h-9 shrink-0 items-center gap-3 rounded-md px-3 text-sm font-medium outline-none transition-colors",
|
|
727
703
|
"text-sidebar-foreground/80 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
728
704
|
"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-sidebar",
|
|
729
705
|
active && "bg-sidebar-accent text-sidebar-accent-foreground",
|
|
730
|
-
collapsed && "justify-center px-0",
|
|
731
706
|
className
|
|
732
707
|
);
|
|
733
708
|
const innerContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -738,18 +713,9 @@ function SidebarNavItem({
|
|
|
738
713
|
className: "absolute inset-y-1.5 start-0 w-1 rounded-full bg-primary"
|
|
739
714
|
}
|
|
740
715
|
) : null,
|
|
741
|
-
icon ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "flex
|
|
742
|
-
/* @__PURE__ */ jsx(
|
|
743
|
-
|
|
744
|
-
{
|
|
745
|
-
className: cn(
|
|
746
|
-
"flex-1 truncate text-start transition-[opacity,width]",
|
|
747
|
-
collapsed && "pointer-events-none w-0 opacity-0"
|
|
748
|
-
),
|
|
749
|
-
children: labelContent
|
|
750
|
-
}
|
|
751
|
-
),
|
|
752
|
-
endSlot && !collapsed ? /* @__PURE__ */ jsx("span", { className: "ms-auto flex shrink-0 items-center", children: endSlot }) : null
|
|
716
|
+
icon ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "flex size-5 shrink-0 items-center justify-center", children: icon }) : null,
|
|
717
|
+
/* @__PURE__ */ jsx("span", { className: "flex-1 truncate text-start", children: labelContent }),
|
|
718
|
+
endSlot ? /* @__PURE__ */ jsx("span", { className: "ms-auto flex shrink-0 items-center", children: endSlot }) : null
|
|
753
719
|
] });
|
|
754
720
|
if (render) {
|
|
755
721
|
return render({
|
|
@@ -856,9 +822,9 @@ function AppShell({
|
|
|
856
822
|
) });
|
|
857
823
|
}
|
|
858
824
|
var sizeClass = {
|
|
859
|
-
sm: "
|
|
860
|
-
md: "
|
|
861
|
-
lg: "
|
|
825
|
+
sm: "size-7 text-xs",
|
|
826
|
+
md: "size-9 text-sm",
|
|
827
|
+
lg: "size-11 text-base"
|
|
862
828
|
};
|
|
863
829
|
function Avatar({ src, alt = "", fallback, size = "md", className, ...props }) {
|
|
864
830
|
const [errored, setErrored] = useState(false);
|
|
@@ -894,6 +860,14 @@ var badgeVariantClass = {
|
|
|
894
860
|
destructive: "bg-destructive text-destructive-foreground border-transparent",
|
|
895
861
|
outline: "border-border bg-transparent text-foreground"
|
|
896
862
|
};
|
|
863
|
+
var badgeSoftVariantClass = {
|
|
864
|
+
default: "bg-muted text-muted-foreground border-transparent",
|
|
865
|
+
primary: "bg-primary/15 text-primary-soft-foreground border-transparent",
|
|
866
|
+
success: "bg-success/15 text-success-soft-foreground border-transparent",
|
|
867
|
+
warning: "bg-warning/15 text-warning-soft-foreground border-transparent",
|
|
868
|
+
destructive: "bg-destructive/15 text-destructive-soft-foreground border-transparent",
|
|
869
|
+
outline: "border-border bg-transparent text-foreground"
|
|
870
|
+
};
|
|
897
871
|
var badgeSizeClass = {
|
|
898
872
|
sm: "h-5 gap-1 px-2 text-[11px]",
|
|
899
873
|
md: "h-6 gap-1.5 px-2.5 text-xs"
|
|
@@ -903,14 +877,16 @@ var badgeDotSizeClass = {
|
|
|
903
877
|
md: "size-2"
|
|
904
878
|
};
|
|
905
879
|
var badgeBaseClass = "inline-flex shrink-0 items-center rounded-full border font-medium leading-none whitespace-nowrap select-none transition-colors";
|
|
906
|
-
var Badge = forwardRef(function Badge2({ variant = "default", size = "md", dot = false, className, children, ...props }, ref) {
|
|
880
|
+
var Badge = forwardRef(function Badge2({ variant = "default", size = "md", tone = "solid", dot = false, className, children, ...props }, ref) {
|
|
881
|
+
const variantClass = tone === "soft" ? badgeSoftVariantClass[variant] : badgeVariantClass[variant];
|
|
907
882
|
return /* @__PURE__ */ jsxs(
|
|
908
883
|
"span",
|
|
909
884
|
{
|
|
910
885
|
ref,
|
|
911
886
|
"data-slot": "badge",
|
|
912
887
|
"data-variant": variant,
|
|
913
|
-
|
|
888
|
+
"data-tone": tone,
|
|
889
|
+
className: cn(badgeBaseClass, variantClass, badgeSizeClass[size], className),
|
|
914
890
|
...props,
|
|
915
891
|
children: [
|
|
916
892
|
dot ? /* @__PURE__ */ jsx(
|
|
@@ -925,9 +901,75 @@ var Badge = forwardRef(function Badge2({ variant = "default", size = "md", dot =
|
|
|
925
901
|
}
|
|
926
902
|
);
|
|
927
903
|
});
|
|
904
|
+
|
|
905
|
+
// src/components/card/cardVariants.ts
|
|
906
|
+
var cardBaseClass = "rounded-xl border border-border bg-card text-card-foreground shadow-[var(--shadow-card)]";
|
|
907
|
+
var cardHeaderClass = "flex flex-col gap-1.5 p-6";
|
|
908
|
+
var cardTitleClass = "text-lg font-semibold leading-none tracking-tight text-foreground";
|
|
909
|
+
var cardDescriptionClass = "text-sm text-muted-foreground";
|
|
910
|
+
var cardContentClass = "p-6 pt-0";
|
|
911
|
+
var cardFooterClass = "flex items-center gap-2 p-6 pt-0";
|
|
912
|
+
var Card = forwardRef(function Card2({ className, ...props }, ref) {
|
|
913
|
+
return /* @__PURE__ */ jsx("div", { ref, "data-slot": "card", className: cn(cardBaseClass, className), ...props });
|
|
914
|
+
});
|
|
915
|
+
var CardHeader = forwardRef(
|
|
916
|
+
function CardHeader2({ className, ...props }, ref) {
|
|
917
|
+
return /* @__PURE__ */ jsx(
|
|
918
|
+
"div",
|
|
919
|
+
{
|
|
920
|
+
ref,
|
|
921
|
+
"data-slot": "card-header",
|
|
922
|
+
className: cn(cardHeaderClass, className),
|
|
923
|
+
...props
|
|
924
|
+
}
|
|
925
|
+
);
|
|
926
|
+
}
|
|
927
|
+
);
|
|
928
|
+
var CardTitle = forwardRef(
|
|
929
|
+
function CardTitle2({ className, ...props }, ref) {
|
|
930
|
+
return /* @__PURE__ */ jsx("h3", { ref, "data-slot": "card-title", className: cn(cardTitleClass, className), ...props });
|
|
931
|
+
}
|
|
932
|
+
);
|
|
933
|
+
var CardDescription = forwardRef(function CardDescription2({ className, ...props }, ref) {
|
|
934
|
+
return /* @__PURE__ */ jsx(
|
|
935
|
+
"p",
|
|
936
|
+
{
|
|
937
|
+
ref,
|
|
938
|
+
"data-slot": "card-description",
|
|
939
|
+
className: cn(cardDescriptionClass, className),
|
|
940
|
+
...props
|
|
941
|
+
}
|
|
942
|
+
);
|
|
943
|
+
});
|
|
944
|
+
var CardContent = forwardRef(
|
|
945
|
+
function CardContent2({ className, ...props }, ref) {
|
|
946
|
+
return /* @__PURE__ */ jsx(
|
|
947
|
+
"div",
|
|
948
|
+
{
|
|
949
|
+
ref,
|
|
950
|
+
"data-slot": "card-content",
|
|
951
|
+
className: cn(cardContentClass, className),
|
|
952
|
+
...props
|
|
953
|
+
}
|
|
954
|
+
);
|
|
955
|
+
}
|
|
956
|
+
);
|
|
957
|
+
var CardFooter = forwardRef(
|
|
958
|
+
function CardFooter2({ className, ...props }, ref) {
|
|
959
|
+
return /* @__PURE__ */ jsx(
|
|
960
|
+
"div",
|
|
961
|
+
{
|
|
962
|
+
ref,
|
|
963
|
+
"data-slot": "card-footer",
|
|
964
|
+
className: cn(cardFooterClass, className),
|
|
965
|
+
...props
|
|
966
|
+
}
|
|
967
|
+
);
|
|
968
|
+
}
|
|
969
|
+
);
|
|
928
970
|
var sizeClass2 = {
|
|
929
|
-
sm: "
|
|
930
|
-
md: "
|
|
971
|
+
sm: "size-3.5",
|
|
972
|
+
md: "size-4"
|
|
931
973
|
};
|
|
932
974
|
var Checkbox = forwardRef(function Checkbox2({
|
|
933
975
|
checked,
|
|
@@ -970,7 +1012,7 @@ var Checkbox = forwardRef(function Checkbox2({
|
|
|
970
1012
|
"indeterminate:border-primary indeterminate:bg-primary",
|
|
971
1013
|
"hover:border-ring",
|
|
972
1014
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
973
|
-
"focus-visible:outline-none focus-visible:ring-
|
|
1015
|
+
"focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-primary-glow"
|
|
974
1016
|
),
|
|
975
1017
|
...rest
|
|
976
1018
|
}
|
|
@@ -980,7 +1022,7 @@ var Checkbox = forwardRef(function Checkbox2({
|
|
|
980
1022
|
{
|
|
981
1023
|
"aria-hidden": "true",
|
|
982
1024
|
strokeWidth: 3,
|
|
983
|
-
className: "pointer-events-none absolute inset-0 m-auto
|
|
1025
|
+
className: "pointer-events-none absolute inset-0 m-auto size-3 text-primary-foreground opacity-0 peer-checked:opacity-100 peer-indeterminate:opacity-0"
|
|
984
1026
|
}
|
|
985
1027
|
),
|
|
986
1028
|
/* @__PURE__ */ jsx(
|
|
@@ -988,7 +1030,7 @@ var Checkbox = forwardRef(function Checkbox2({
|
|
|
988
1030
|
{
|
|
989
1031
|
"aria-hidden": "true",
|
|
990
1032
|
strokeWidth: 3,
|
|
991
|
-
className: "pointer-events-none absolute inset-0 m-auto
|
|
1033
|
+
className: "pointer-events-none absolute inset-0 m-auto size-3 text-primary-foreground opacity-0 peer-indeterminate:opacity-100"
|
|
992
1034
|
}
|
|
993
1035
|
)
|
|
994
1036
|
] });
|
|
@@ -1005,20 +1047,20 @@ var datePickerTriggerSizeClass = {
|
|
|
1005
1047
|
md: "h-9 rounded-md ps-3 pe-9 text-sm gap-2",
|
|
1006
1048
|
lg: "h-11 rounded-md ps-4 pe-10 text-base gap-2"
|
|
1007
1049
|
};
|
|
1008
|
-
var datePickerTriggerBaseClass = "group/datepicker relative inline-flex w-full items-center text-foreground outline-none transition-[background-color,border-color,box-shadow] focus-visible:ring-
|
|
1050
|
+
var datePickerTriggerBaseClass = "group/datepicker relative inline-flex w-full items-center text-foreground outline-none transition-[background-color,border-color,box-shadow] focus-visible:ring-[3px] focus-visible:ring-primary-glow aria-[invalid=true]:border-destructive aria-[invalid=true]:focus-visible:ring-destructive/40 disabled:pointer-events-none disabled:opacity-50 cursor-pointer";
|
|
1009
1051
|
var datePickerPlaceholderClass = "truncate text-muted-foreground";
|
|
1010
1052
|
var datePickerValueClass = "truncate text-foreground";
|
|
1011
1053
|
var datePickerContentClass = "z-50 overflow-hidden rounded-md border border-border bg-popover p-3 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95";
|
|
1012
1054
|
var datePickerCalendarClass = "text-sm";
|
|
1013
1055
|
var datePickerCaptionClass = "flex items-center justify-between gap-2 pb-2 text-sm font-semibold";
|
|
1014
|
-
var datePickerNavButtonClass = "inline-flex
|
|
1056
|
+
var datePickerNavButtonClass = "inline-flex size-7 items-center justify-center rounded-md border border-input bg-background text-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 disabled:pointer-events-none disabled:opacity-50";
|
|
1015
1057
|
var datePickerDayWrapperClass = "p-0 text-center";
|
|
1016
|
-
var datePickerDayBaseClass = "inline-flex
|
|
1058
|
+
var datePickerDayBaseClass = "inline-flex size-8 items-center justify-center rounded-md text-sm text-foreground font-normal transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40";
|
|
1017
1059
|
var datePickerSelectedClass = "[&_button]:bg-primary [&_button]:text-primary-foreground [&_button]:hover:bg-primary [&_button]:hover:text-primary-foreground";
|
|
1018
1060
|
var datePickerTodayClass = "[&_button]:font-semibold [&_button]:ring-1 [&_button]:ring-inset [&_button]:ring-ring/40";
|
|
1019
1061
|
var datePickerOutsideClass = "[&_button]:text-muted-foreground [&_button]:opacity-60";
|
|
1020
1062
|
var datePickerDisabledClass = "[&_button]:pointer-events-none [&_button]:opacity-40";
|
|
1021
|
-
var datePickerWeekdayClass = "
|
|
1063
|
+
var datePickerWeekdayClass = "size-8 text-center text-xs font-medium text-muted-foreground";
|
|
1022
1064
|
var datePickerWeekClass = "flex w-full";
|
|
1023
1065
|
var datePickerWeekdaysClass = "flex w-full";
|
|
1024
1066
|
var datePickerMonthGridClass = "w-full border-collapse";
|
|
@@ -1329,6 +1371,9 @@ var pageHeaderBorderedClass = "border-b border-border pb-4";
|
|
|
1329
1371
|
var pageHeaderTitleRowClass = "flex flex-wrap items-start justify-between gap-3 sm:gap-4";
|
|
1330
1372
|
var pageHeaderTitleBlockClass = "min-w-0 flex-1 space-y-1";
|
|
1331
1373
|
var pageHeaderTitleClass = "text-2xl font-semibold tracking-tight text-foreground";
|
|
1374
|
+
var pageHeaderEyebrowClass = "text-xs font-semibold uppercase tracking-wide text-primary";
|
|
1375
|
+
var pageHeaderTitleLineClass = "flex flex-wrap items-center gap-x-2.5 gap-y-1";
|
|
1376
|
+
var pageHeaderTitleMetaClass = "shrink-0";
|
|
1332
1377
|
var pageHeaderDescriptionClass = "text-sm text-muted-foreground";
|
|
1333
1378
|
var pageHeaderActionsClass = "flex shrink-0 flex-wrap items-center gap-2";
|
|
1334
1379
|
var pageHeaderBackClass = "inline-flex items-center gap-1.5 self-start text-sm text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 focus-visible:ring-offset-2 focus-visible:ring-offset-background rounded-md";
|
|
@@ -1337,6 +1382,8 @@ var pageHeaderBreadcrumbsClass = "text-xs text-muted-foreground";
|
|
|
1337
1382
|
var PageHeader = forwardRef(function PageHeader2({
|
|
1338
1383
|
title,
|
|
1339
1384
|
description,
|
|
1385
|
+
eyebrow,
|
|
1386
|
+
titleMeta,
|
|
1340
1387
|
breadcrumbs,
|
|
1341
1388
|
back,
|
|
1342
1389
|
actions,
|
|
@@ -1357,11 +1404,15 @@ var PageHeader = forwardRef(function PageHeader2({
|
|
|
1357
1404
|
back ? /* @__PURE__ */ jsx(PageHeaderBack, { ...back }) : null,
|
|
1358
1405
|
/* @__PURE__ */ jsxs("div", { "data-slot": "page-header-row", className: pageHeaderTitleRowClass, children: [
|
|
1359
1406
|
/* @__PURE__ */ jsxs("div", { className: pageHeaderTitleBlockClass, children: [
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1407
|
+
eyebrow ? /* @__PURE__ */ jsx("p", { "data-slot": "page-header-eyebrow", className: pageHeaderEyebrowClass, children: eyebrow }) : null,
|
|
1408
|
+
/* @__PURE__ */ jsxs("div", { className: pageHeaderTitleLineClass, children: [
|
|
1409
|
+
createElement(
|
|
1410
|
+
as,
|
|
1411
|
+
{ "data-slot": "page-header-title", className: pageHeaderTitleClass },
|
|
1412
|
+
title
|
|
1413
|
+
),
|
|
1414
|
+
titleMeta ? /* @__PURE__ */ jsx("span", { "data-slot": "page-header-title-meta", className: pageHeaderTitleMetaClass, children: titleMeta }) : null
|
|
1415
|
+
] }),
|
|
1365
1416
|
description ? /* @__PURE__ */ jsx("p", { "data-slot": "page-header-description", className: pageHeaderDescriptionClass, children: description }) : null
|
|
1366
1417
|
] }),
|
|
1367
1418
|
actions ? /* @__PURE__ */ jsx("div", { "data-slot": "page-header-actions", className: pageHeaderActionsClass, children: actions }) : null
|
|
@@ -1393,7 +1444,7 @@ function PageHeaderBack({ label = "Back", to, onClick, render }) {
|
|
|
1393
1444
|
var detailPageBaseClass = "flex w-full flex-col gap-6";
|
|
1394
1445
|
var detailPageBodyClass = "flex flex-col gap-6";
|
|
1395
1446
|
var detailPageSkeletonRowClass = "h-5 w-full animate-pulse rounded-md bg-muted";
|
|
1396
|
-
var detailPageEmptyClass = "rounded-
|
|
1447
|
+
var detailPageEmptyClass = "rounded-xl border border-border bg-card";
|
|
1397
1448
|
var DEFAULT_LABELS_LTR = {
|
|
1398
1449
|
back: "Back",
|
|
1399
1450
|
notFoundTitle: "Not found",
|
|
@@ -2060,7 +2111,7 @@ var inputSizeClass = {
|
|
|
2060
2111
|
md: "h-9 rounded-md px-3 text-sm gap-2",
|
|
2061
2112
|
lg: "h-11 rounded-md px-4 text-base gap-2.5"
|
|
2062
2113
|
};
|
|
2063
|
-
var inputBaseClass = "group/input relative inline-flex w-full items-center text-foreground outline-none transition-[background-color,border-color,box-shadow] focus-within:ring-
|
|
2114
|
+
var inputBaseClass = "group/input relative inline-flex w-full items-center text-foreground outline-none transition-[background-color,border-color,box-shadow] focus-within:ring-[3px] focus-within:ring-primary-glow aria-[invalid=true]:border-destructive aria-[invalid=true]:focus-within:ring-destructive/40 has-[input:disabled]:pointer-events-none has-[input:disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0";
|
|
2064
2115
|
var Input = forwardRef(function Input2({
|
|
2065
2116
|
variant = "default",
|
|
2066
2117
|
inputSize = "md",
|
|
@@ -2094,7 +2145,7 @@ var Input = forwardRef(function Input2({
|
|
|
2094
2145
|
"span",
|
|
2095
2146
|
{
|
|
2096
2147
|
"aria-hidden": "true",
|
|
2097
|
-
className: "inline-flex
|
|
2148
|
+
className: "inline-flex size-4 items-center justify-center text-muted-foreground",
|
|
2098
2149
|
children: leadingIcon
|
|
2099
2150
|
}
|
|
2100
2151
|
) : null,
|
|
@@ -2118,7 +2169,7 @@ var Input = forwardRef(function Input2({
|
|
|
2118
2169
|
"span",
|
|
2119
2170
|
{
|
|
2120
2171
|
"aria-hidden": "true",
|
|
2121
|
-
className: "inline-flex
|
|
2172
|
+
className: "inline-flex size-4 items-center justify-center text-muted-foreground",
|
|
2122
2173
|
children: trailingIcon
|
|
2123
2174
|
}
|
|
2124
2175
|
) : null
|
|
@@ -2239,7 +2290,7 @@ function Pagination({
|
|
|
2239
2290
|
disabled: isFirst,
|
|
2240
2291
|
onClick: goPrev,
|
|
2241
2292
|
"aria-label": labels.previousPage,
|
|
2242
|
-
children: isRtl ? /* @__PURE__ */ jsx(ChevronRight, { "aria-hidden": "true", className: "
|
|
2293
|
+
children: isRtl ? /* @__PURE__ */ jsx(ChevronRight, { "aria-hidden": "true", className: "size-3.5" }) : /* @__PURE__ */ jsx(ChevronLeft, { "aria-hidden": "true", className: "size-3.5" })
|
|
2243
2294
|
}
|
|
2244
2295
|
),
|
|
2245
2296
|
/* @__PURE__ */ jsxs("span", { className: "px-1 text-foreground", children: [
|
|
@@ -2256,7 +2307,7 @@ function Pagination({
|
|
|
2256
2307
|
disabled: isLast,
|
|
2257
2308
|
onClick: goNext,
|
|
2258
2309
|
"aria-label": labels.nextPage,
|
|
2259
|
-
children: isRtl ? /* @__PURE__ */ jsx(ChevronLeft, { "aria-hidden": "true", className: "
|
|
2310
|
+
children: isRtl ? /* @__PURE__ */ jsx(ChevronLeft, { "aria-hidden": "true", className: "size-3.5" }) : /* @__PURE__ */ jsx(ChevronRight, { "aria-hidden": "true", className: "size-3.5" })
|
|
2260
2311
|
}
|
|
2261
2312
|
)
|
|
2262
2313
|
] })
|
|
@@ -2285,23 +2336,23 @@ function Toolbar({ count, onClear, renderLabel, clearLabel, children }) {
|
|
|
2285
2336
|
var tableSizeClass = {
|
|
2286
2337
|
sm: {
|
|
2287
2338
|
row: "",
|
|
2288
|
-
cell: "px-3 py-1.5 text-xs",
|
|
2339
|
+
cell: "px-3 py-1.5 text-xs tabular-nums",
|
|
2289
2340
|
head: "whitespace-nowrap px-3 py-2 text-xs font-medium"
|
|
2290
2341
|
},
|
|
2291
2342
|
md: {
|
|
2292
2343
|
row: "",
|
|
2293
|
-
cell: "px-4 py-2.5 text-sm",
|
|
2344
|
+
cell: "px-4 py-2.5 text-sm tabular-nums",
|
|
2294
2345
|
head: "whitespace-nowrap px-4 py-2.5 text-xs font-medium uppercase tracking-wide"
|
|
2295
2346
|
},
|
|
2296
2347
|
lg: {
|
|
2297
2348
|
row: "",
|
|
2298
|
-
cell: "px-5 py-3.5 text-sm",
|
|
2349
|
+
cell: "px-5 py-3.5 text-sm tabular-nums",
|
|
2299
2350
|
head: "whitespace-nowrap px-5 py-3 text-sm font-medium"
|
|
2300
2351
|
}
|
|
2301
2352
|
};
|
|
2302
2353
|
var tableBaseClass = "w-full caption-bottom border-collapse";
|
|
2303
|
-
var selectedRowClass = "bg-
|
|
2304
|
-
var sortIconClass = "inline-flex
|
|
2354
|
+
var selectedRowClass = "bg-primary/10";
|
|
2355
|
+
var sortIconClass = "inline-flex size-3 shrink-0 items-center justify-center";
|
|
2305
2356
|
var alignClass = {
|
|
2306
2357
|
start: "text-start",
|
|
2307
2358
|
center: "text-center",
|
|
@@ -2428,7 +2479,7 @@ function Table(props) {
|
|
|
2428
2479
|
"div",
|
|
2429
2480
|
{
|
|
2430
2481
|
className: cn(
|
|
2431
|
-
"overflow-x-auto rounded-
|
|
2482
|
+
"overflow-x-auto rounded-xl border border-border bg-card shadow-[var(--shadow-card)]",
|
|
2432
2483
|
maxHeight !== void 0 && "overflow-y-auto"
|
|
2433
2484
|
),
|
|
2434
2485
|
style: maxHeight !== void 0 ? { maxHeight } : void 0,
|
|
@@ -2446,9 +2497,11 @@ function Table(props) {
|
|
|
2446
2497
|
"thead",
|
|
2447
2498
|
{
|
|
2448
2499
|
className: cn(
|
|
2449
|
-
//
|
|
2450
|
-
// scrolling underneath it
|
|
2451
|
-
|
|
2500
|
+
// Clean opaque header (so a sticky header fully hides the rows
|
|
2501
|
+
// scrolling underneath it) with a hairline bottom rule drawn via an
|
|
2502
|
+
// inset shadow — it stays attached to the sticky header instead of
|
|
2503
|
+
// collapsing into the first row's border.
|
|
2504
|
+
"bg-card text-muted-foreground shadow-[inset_0_-1px_0_var(--color-border)]",
|
|
2452
2505
|
maxHeight !== void 0 && "sticky top-0 z-10"
|
|
2453
2506
|
),
|
|
2454
2507
|
children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
@@ -2525,8 +2578,8 @@ function Table(props) {
|
|
|
2525
2578
|
"data-selected": isSelected ? "true" : void 0,
|
|
2526
2579
|
"aria-selected": enableRowSelection ? isSelected : void 0,
|
|
2527
2580
|
className: cn(
|
|
2528
|
-
"border-t border-border transition-colors",
|
|
2529
|
-
"hover:bg-
|
|
2581
|
+
"border-t border-border/60 first:border-t-0 transition-colors",
|
|
2582
|
+
"hover:bg-primary/5",
|
|
2530
2583
|
striped && rowIndex % 2 === 1 && "bg-muted/20",
|
|
2531
2584
|
isSelected && selectedRowClass,
|
|
2532
2585
|
onRowClick && "cursor-pointer"
|
|
@@ -2609,10 +2662,7 @@ function SkeletonRows({ rowCount, columnCount, cellClassName }) {
|
|
|
2609
2662
|
return /* @__PURE__ */ jsx(Fragment, { children: rowKeys.map((rowKey) => /* @__PURE__ */ jsx("tr", { className: "border-t border-border", "data-testid": "table-skeleton-row", children: colKeys.map((colKey) => /* @__PURE__ */ jsx("td", { className: cellClassName, children: /* @__PURE__ */ jsx("span", { className: "block h-3 w-full animate-pulse rounded bg-muted" }) }, `${rowKey}-${colKey}`)) }, rowKey)) });
|
|
2610
2663
|
}
|
|
2611
2664
|
function SortIndicator({ active, direction }) {
|
|
2612
|
-
const className = cn(
|
|
2613
|
-
"h-3.5 w-3.5 shrink-0",
|
|
2614
|
-
active ? "text-foreground" : "text-muted-foreground"
|
|
2615
|
-
);
|
|
2665
|
+
const className = cn("size-3.5 shrink-0", active ? "text-foreground" : "text-muted-foreground");
|
|
2616
2666
|
if (!active) return /* @__PURE__ */ jsx(ChevronsUpDown, { "aria-hidden": "true", className });
|
|
2617
2667
|
return direction === "asc" ? /* @__PURE__ */ jsx(ChevronUp, { "aria-hidden": "true", className }) : /* @__PURE__ */ jsx(ChevronDown, { "aria-hidden": "true", className });
|
|
2618
2668
|
}
|
|
@@ -2628,11 +2678,11 @@ var selectSizeClass = {
|
|
|
2628
2678
|
md: "h-9 rounded-md ps-3 pe-9 text-sm",
|
|
2629
2679
|
lg: "h-11 rounded-md ps-4 pe-10 text-base"
|
|
2630
2680
|
};
|
|
2631
|
-
var selectBaseClass = "group/select relative inline-flex w-full items-center text-foreground outline-none transition-[background-color,border-color,box-shadow] focus:ring-
|
|
2681
|
+
var selectBaseClass = "group/select relative inline-flex w-full items-center text-foreground outline-none transition-[background-color,border-color,box-shadow] focus:ring-[3px] focus:ring-primary-glow aria-[invalid=true]:border-destructive aria-[invalid=true]:focus:ring-destructive/40 disabled:pointer-events-none disabled:opacity-50 cursor-pointer data-[placeholder]:text-muted-foreground";
|
|
2632
2682
|
var selectContentClass = "z-50 max-h-(--radix-select-content-available-height) min-w-(--radix-select-trigger-width) overflow-hidden rounded-md border border-border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95";
|
|
2633
2683
|
var selectViewportClass = "p-1";
|
|
2634
2684
|
var selectItemClass = "relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 ps-8 pe-2 text-sm outline-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50";
|
|
2635
|
-
var selectItemIndicatorClass = "absolute start-2 inline-flex
|
|
2685
|
+
var selectItemIndicatorClass = "absolute start-2 inline-flex size-3.5 items-center justify-center [&_svg]:h-3.5 [&_svg]:w-3.5";
|
|
2636
2686
|
var selectGroupLabelClass = "px-2 py-1.5 text-xs font-semibold text-muted-foreground";
|
|
2637
2687
|
var selectSeparatorClass = "-mx-1 my-1 h-px bg-border";
|
|
2638
2688
|
var selectStatusClass = "flex items-center justify-center gap-2 px-2 py-6 text-center text-sm text-muted-foreground";
|
|
@@ -2995,6 +3045,16 @@ function hasActiveFilters(filters, values) {
|
|
|
2995
3045
|
}
|
|
2996
3046
|
return false;
|
|
2997
3047
|
}
|
|
3048
|
+
function countActiveFilters(filters, values) {
|
|
3049
|
+
let count = 0;
|
|
3050
|
+
for (const filter of filters ?? []) {
|
|
3051
|
+
const current = values?.[filter.key];
|
|
3052
|
+
if (current === void 0) continue;
|
|
3053
|
+
const value = filter.type === "text" ? current.trim() : current;
|
|
3054
|
+
if (value !== filterDefaultValue(filter)) count += 1;
|
|
3055
|
+
}
|
|
3056
|
+
return count;
|
|
3057
|
+
}
|
|
2998
3058
|
function DebouncedFilterInput({
|
|
2999
3059
|
value,
|
|
3000
3060
|
onChange,
|
|
@@ -3059,7 +3119,6 @@ function ListPageFilterBar({
|
|
|
3059
3119
|
labels
|
|
3060
3120
|
}) {
|
|
3061
3121
|
const manual = mode === "manual";
|
|
3062
|
-
const active = hasActiveFilters(filters, values);
|
|
3063
3122
|
const appliedKey = JSON.stringify(values ?? {});
|
|
3064
3123
|
const [draft, setDraft] = useState(values ?? {});
|
|
3065
3124
|
useEffect(() => {
|
|
@@ -3090,8 +3149,11 @@ function ListPageFilterBar({
|
|
|
3090
3149
|
for (const filter of filters ?? []) {
|
|
3091
3150
|
onChange?.(filter.key, filterDefaultValue(filter));
|
|
3092
3151
|
}
|
|
3152
|
+
if (manual) setDraft({});
|
|
3093
3153
|
};
|
|
3094
|
-
|
|
3154
|
+
if (!filters || filters.length === 0) return null;
|
|
3155
|
+
const activeCount = countActiveFilters(filters, effectiveValues);
|
|
3156
|
+
const controls = /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3", children: filters.map((filter) => /* @__PURE__ */ jsx(
|
|
3095
3157
|
FilterControl,
|
|
3096
3158
|
{
|
|
3097
3159
|
filter,
|
|
@@ -3102,22 +3164,41 @@ function ListPageFilterBar({
|
|
|
3102
3164
|
},
|
|
3103
3165
|
filter.key
|
|
3104
3166
|
)) });
|
|
3105
|
-
const
|
|
3106
|
-
/* @__PURE__ */ jsx(
|
|
3107
|
-
|
|
3108
|
-
|
|
3167
|
+
const header = /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 border-b border-border bg-primary/5 px-4 py-3", children: [
|
|
3168
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-foreground", children: labels.title ?? "Filters" }),
|
|
3169
|
+
activeCount > 0 ? /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center rounded-full bg-primary/10 px-2 py-0.5 text-xs font-semibold text-primary", children: [
|
|
3170
|
+
activeCount,
|
|
3171
|
+
" ",
|
|
3172
|
+
labels.activeLabel ?? "active"
|
|
3173
|
+
] }) : null,
|
|
3174
|
+
activeCount > 0 && !disabled ? /* @__PURE__ */ jsxs(Button, { type: "button", variant: "ghost", size: "sm", className: "ms-auto", onClick: reset, children: [
|
|
3175
|
+
/* @__PURE__ */ jsx(RefreshCw, { className: "size-4" }),
|
|
3176
|
+
labels.reset
|
|
3177
|
+
] }) : null
|
|
3178
|
+
] });
|
|
3179
|
+
const cardClass = "overflow-hidden rounded-xl border border-border bg-card";
|
|
3109
3180
|
if (manual) {
|
|
3110
|
-
return /* @__PURE__ */ jsxs("form", { "data-slot": "list-page-filter-bar", className:
|
|
3111
|
-
|
|
3112
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
3113
|
-
|
|
3114
|
-
/* @__PURE__ */ jsx(
|
|
3181
|
+
return /* @__PURE__ */ jsxs("form", { "data-slot": "list-page-filter-bar", className: cardClass, onSubmit: apply, children: [
|
|
3182
|
+
header,
|
|
3183
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-4 p-4", children: [
|
|
3184
|
+
controls,
|
|
3185
|
+
/* @__PURE__ */ jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx(
|
|
3186
|
+
Button,
|
|
3187
|
+
{
|
|
3188
|
+
type: "submit",
|
|
3189
|
+
size: "sm",
|
|
3190
|
+
leadingIcon: /* @__PURE__ */ jsx(Search, { className: "size-4" }),
|
|
3191
|
+
className: "min-w-32",
|
|
3192
|
+
disabled: disabled || !dirty,
|
|
3193
|
+
children: labels.apply ?? "Apply"
|
|
3194
|
+
}
|
|
3195
|
+
) })
|
|
3115
3196
|
] })
|
|
3116
3197
|
] });
|
|
3117
3198
|
}
|
|
3118
|
-
return /* @__PURE__ */ jsxs("div", { "data-slot": "list-page-filter-bar", className:
|
|
3119
|
-
|
|
3120
|
-
|
|
3199
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "list-page-filter-bar", className: cardClass, children: [
|
|
3200
|
+
header,
|
|
3201
|
+
/* @__PURE__ */ jsx("div", { className: "p-4", children: controls })
|
|
3121
3202
|
] });
|
|
3122
3203
|
}
|
|
3123
3204
|
function FilterControl({ filter, value, onChange, disabled, mode }) {
|
|
@@ -3185,6 +3266,8 @@ function renderFilterControl({
|
|
|
3185
3266
|
var EN_LABELS2 = {
|
|
3186
3267
|
reset: "Reset filters",
|
|
3187
3268
|
apply: "Apply",
|
|
3269
|
+
filtersTitle: "Filters",
|
|
3270
|
+
filtersActive: "active",
|
|
3188
3271
|
emptyTitle: "No results",
|
|
3189
3272
|
emptyDescription: "Try clearing the search or adjusting the filters.",
|
|
3190
3273
|
noDataTitle: "No data yet",
|
|
@@ -3192,7 +3275,9 @@ var EN_LABELS2 = {
|
|
|
3192
3275
|
};
|
|
3193
3276
|
var AR_LABELS2 = {
|
|
3194
3277
|
reset: "\u0625\u0639\u0627\u062F\u0629 \u062A\u0639\u064A\u064A\u0646 \u0627\u0644\u0641\u0644\u0627\u062A\u0631",
|
|
3195
|
-
apply: "\u062A\
|
|
3278
|
+
apply: "\u0639\u0631\u0636 \u0627\u0644\u0646\u062A\u0627\u0626\u062C",
|
|
3279
|
+
filtersTitle: "\u0627\u0644\u062A\u0635\u0641\u064A\u0629",
|
|
3280
|
+
filtersActive: "\u0645\u0641\u0639\u0651\u0644",
|
|
3196
3281
|
emptyTitle: "\u0644\u0627 \u062A\u0648\u062C\u062F \u0646\u062A\u0627\u0626\u062C",
|
|
3197
3282
|
emptyDescription: "\u062C\u0631\u0651\u0628 \u0645\u0633\u062D \u0627\u0644\u0628\u062D\u062B \u0623\u0648 \u062A\u0639\u062F\u064A\u0644 \u0627\u0644\u0641\u0644\u0627\u062A\u0631.",
|
|
3198
3283
|
noDataTitle: "\u0644\u0627 \u062A\u0648\u062C\u062F \u0628\u064A\u0627\u0646\u0627\u062A \u0628\u0639\u062F",
|
|
@@ -3217,6 +3302,7 @@ function ListPage({
|
|
|
3217
3302
|
pagination,
|
|
3218
3303
|
onPaginationChange,
|
|
3219
3304
|
totalCount,
|
|
3305
|
+
eyebrow,
|
|
3220
3306
|
pageSizeOptions,
|
|
3221
3307
|
emptyState,
|
|
3222
3308
|
noDataState,
|
|
@@ -3237,7 +3323,17 @@ function ListPage({
|
|
|
3237
3323
|
};
|
|
3238
3324
|
const tableMode = isLoading ? "loading" : data.length === 0 && !hasActiveQuery ? "no-data" : data.length === 0 && hasActiveQuery ? "no-results" : "rows";
|
|
3239
3325
|
return /* @__PURE__ */ jsxs("div", { "data-slot": "list-page", className: cn("space-y-6", className), children: [
|
|
3240
|
-
/* @__PURE__ */ jsx(
|
|
3326
|
+
/* @__PURE__ */ jsx(
|
|
3327
|
+
PageHeader,
|
|
3328
|
+
{
|
|
3329
|
+
title,
|
|
3330
|
+
description,
|
|
3331
|
+
eyebrow,
|
|
3332
|
+
titleMeta: typeof totalCount === "number" && totalCount > 0 ? /* @__PURE__ */ jsx(Badge, { variant: "primary", tone: "soft", size: "sm", children: totalCount }) : void 0,
|
|
3333
|
+
bordered,
|
|
3334
|
+
actions
|
|
3335
|
+
}
|
|
3336
|
+
),
|
|
3241
3337
|
showFilterBar ? /* @__PURE__ */ jsx(
|
|
3242
3338
|
ListPageFilterBar,
|
|
3243
3339
|
{
|
|
@@ -3245,7 +3341,12 @@ function ListPage({
|
|
|
3245
3341
|
values: filterValues,
|
|
3246
3342
|
onChange: onFilterChange,
|
|
3247
3343
|
mode: filterMode,
|
|
3248
|
-
labels: {
|
|
3344
|
+
labels: {
|
|
3345
|
+
reset: labels.reset,
|
|
3346
|
+
apply: labels.apply,
|
|
3347
|
+
title: labels.filtersTitle,
|
|
3348
|
+
activeLabel: labels.filtersActive
|
|
3349
|
+
}
|
|
3249
3350
|
}
|
|
3250
3351
|
) : null,
|
|
3251
3352
|
tableMode === "loading" || tableMode === "rows" ? /* @__PURE__ */ jsx(
|
|
@@ -3322,7 +3423,7 @@ var radioLabelSizeClass = {
|
|
|
3322
3423
|
md: "text-sm",
|
|
3323
3424
|
lg: "text-base"
|
|
3324
3425
|
};
|
|
3325
|
-
var radioItemBaseClass = "aspect-square shrink-0 rounded-full border border-input bg-background text-primary outline-none transition-colors focus-visible:ring-
|
|
3426
|
+
var radioItemBaseClass = "aspect-square shrink-0 rounded-full border border-input bg-background text-primary outline-none transition-colors focus-visible:ring-[3px] focus-visible:ring-primary-glow hover:border-ring disabled:cursor-not-allowed disabled:opacity-50 aria-[invalid=true]:border-destructive aria-[invalid=true]:focus-visible:ring-destructive/40 data-[state=checked]:border-primary";
|
|
3326
3427
|
var radioIndicatorBaseClass = "flex h-full w-full items-center justify-center";
|
|
3327
3428
|
var radioIndicatorDotClass = "rounded-full bg-primary";
|
|
3328
3429
|
var radioOptionRowClass = "flex cursor-pointer items-start gap-2 has-[button:disabled]:cursor-not-allowed";
|
|
@@ -3493,7 +3594,7 @@ var switchThumbClass = {
|
|
|
3493
3594
|
md: "size-4 data-[state=checked]:translate-x-4 data-[state=checked]:rtl:-translate-x-4",
|
|
3494
3595
|
lg: "size-5 data-[state=checked]:translate-x-5 data-[state=checked]:rtl:-translate-x-5"
|
|
3495
3596
|
};
|
|
3496
|
-
var switchTrackBaseClass = "relative inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent bg-input transition-colors focus-visible:outline-none focus-visible:ring-
|
|
3597
|
+
var switchTrackBaseClass = "relative inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent bg-input transition-colors focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-primary-glow disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary aria-[invalid=true]:ring-[3px] aria-[invalid=true]:ring-destructive/40";
|
|
3497
3598
|
var switchThumbBaseClass = "pointer-events-none block rounded-full bg-background shadow-sm ring-0 transition-transform";
|
|
3498
3599
|
var Switch = forwardRef(function Switch2({
|
|
3499
3600
|
switchSize = "md",
|
|
@@ -3574,7 +3675,7 @@ var textareaResizeClass = {
|
|
|
3574
3675
|
horizontal: "resize-x",
|
|
3575
3676
|
both: "resize"
|
|
3576
3677
|
};
|
|
3577
|
-
var textareaBaseClass = "group/textarea relative flex w-full text-foreground outline-none transition-[background-color,border-color,box-shadow] focus-within:ring-
|
|
3678
|
+
var textareaBaseClass = "group/textarea relative flex w-full text-foreground outline-none transition-[background-color,border-color,box-shadow] focus-within:ring-[3px] focus-within:ring-primary-glow aria-[invalid=true]:border-destructive aria-[invalid=true]:focus-within:ring-destructive/40 has-[textarea:disabled]:pointer-events-none has-[textarea:disabled]:opacity-50";
|
|
3578
3679
|
var Textarea = forwardRef(function Textarea2({
|
|
3579
3680
|
variant = "default",
|
|
3580
3681
|
textareaSize = "md",
|
|
@@ -3718,6 +3819,6 @@ function Tooltip({
|
|
|
3718
3819
|
);
|
|
3719
3820
|
}
|
|
3720
3821
|
|
|
3721
|
-
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AppShell, Avatar, Badge, Button, Checkbox, ConfirmDialogProvider, DashboardContent, DashboardHeader, DashboardLayout, DashboardMain, DatePicker, DetailPage, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, EmptyState, Field, FileUpload2 as FileUpload, FormPage, HeaderActions, HeaderCollapseTrigger, HeaderMobileTrigger, HeaderSearch, HeaderTitle, Input, LanguageSwitcher, ListPage, MultiSelect, PageHeader, RadioGroup, RadioGroupItem, RowActions, Select, Sidebar, SidebarFooter, SidebarGroup, SidebarHeader, SidebarNav, SidebarNavGroup, SidebarNavItem, Switch, Table, Textarea, Toaster, Tooltip, TooltipProvider, badgeBaseClass, badgeDotSizeClass, badgeSizeClass, badgeVariantClass, buttonBaseClass, buttonSizeClass, buttonVariantClass, cn, datePickerCalendarClass, datePickerCaptionClass, datePickerContentClass, datePickerDayBaseClass, datePickerDayWrapperClass, datePickerDisabledClass, datePickerMonthClass, datePickerMonthGridClass, datePickerMonthsClass, datePickerNavButtonClass, datePickerNavClass, datePickerOutsideClass, datePickerPlaceholderClass, datePickerSelectedClass, datePickerTodayClass, datePickerTriggerBaseClass, datePickerTriggerSizeClass, datePickerTriggerVariantClass, datePickerValueClass, datePickerWeekClass, datePickerWeekdayClass, datePickerWeekdaysClass, detailPageBaseClass, detailPageBodyClass, detailPageEmptyClass, detailPageSkeletonRowClass, dialogCloseButtonClass, dialogContentClass, dialogDescriptionClass, dialogFooterClass, dialogHeaderClass, dialogOverlayClass, dialogTitleClass, dropdownMenuContentClass, dropdownMenuItemBaseClass, dropdownMenuItemInsetClass, dropdownMenuItemVariantClass, dropdownMenuLabelClass, dropdownMenuSeparatorClass, dropdownMenuShortcutClass, emptyStateActionsSpacingClass, emptyStateBaseClass, emptyStateContainerSizeClass, emptyStateDescriptionSizeClass, emptyStateIconWrapperBaseClass, emptyStateIconWrapperSizeClass, emptyStateTitleSizeClass, fileUploadBaseClass, fileUploadDropzoneClass, fileUploadFileNameClass, fileUploadFileRowClass, fileUploadFileSizeClass, fileUploadHintClass, fileUploadIconClass, fileUploadPromptClass, fileUploadRemoveClass, formPageActionsBarClass, formPageBaseClass, formPageBodyClass, formPageSkeletonRowClass, inputBaseClass, inputSizeClass, inputVariantClass, multiSelectChipClass, multiSelectChipRemoveClass, multiSelectContentClass, multiSelectEmptyClass, multiSelectListClass, multiSelectOptionClass, multiSelectSearchRowClass, multiSelectTriggerSizeClass, multiSelectValueRowClass, pageHeaderActionsClass, pageHeaderBackClass, pageHeaderBackIconClass, pageHeaderBaseClass, pageHeaderBorderedClass, pageHeaderBreadcrumbsClass, pageHeaderDescriptionClass, pageHeaderTitleBlockClass, pageHeaderTitleClass, pageHeaderTitleRowClass, radioGroupBaseClass, radioGroupOrientationClass, radioIndicatorBaseClass, radioIndicatorDotClass, radioIndicatorSizeClass, radioItemBaseClass, radioItemSizeClass, radioLabelSizeClass, radioOptionRowClass, rowActionsBaseClass, rowActionsDestructiveClass, selectBaseClass, selectSizeClass, selectVariantClass, switchThumbBaseClass, switchThumbClass, switchTrackBaseClass, switchTrackClass, alignClass as tableAlignClass, tableBaseClass, selectedRowClass as tableSelectedRowClass, tableSizeClass, sortIconClass as tableSortIconClass, textareaBaseClass, textareaResizeClass, textareaSizeClass, textareaVariantClass, toastClassNames, tooltipArrowClass, tooltipContentClass, useConfirm, useDashboardLayout, useDirection };
|
|
3822
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AppShell, Avatar, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, ConfirmDialogProvider, DashboardContent, DashboardHeader, DashboardLayout, DashboardMain, DatePicker, DetailPage, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, EmptyState, Field, FileUpload2 as FileUpload, FormPage, HeaderActions, HeaderCollapseTrigger, HeaderMobileTrigger, HeaderSearch, HeaderTitle, Input, LanguageSwitcher, ListPage, MultiSelect, PageHeader, RadioGroup, RadioGroupItem, RowActions, Select, Sidebar, SidebarFooter, SidebarGroup, SidebarHeader, SidebarNav, SidebarNavGroup, SidebarNavItem, Switch, Table, Textarea, Toaster, Tooltip, TooltipProvider, badgeBaseClass, badgeDotSizeClass, badgeSizeClass, badgeSoftVariantClass, badgeVariantClass, buttonBaseClass, buttonSizeClass, buttonVariantClass, cardBaseClass, cardContentClass, cardDescriptionClass, cardFooterClass, cardHeaderClass, cardTitleClass, cn, datePickerCalendarClass, datePickerCaptionClass, datePickerContentClass, datePickerDayBaseClass, datePickerDayWrapperClass, datePickerDisabledClass, datePickerMonthClass, datePickerMonthGridClass, datePickerMonthsClass, datePickerNavButtonClass, datePickerNavClass, datePickerOutsideClass, datePickerPlaceholderClass, datePickerSelectedClass, datePickerTodayClass, datePickerTriggerBaseClass, datePickerTriggerSizeClass, datePickerTriggerVariantClass, datePickerValueClass, datePickerWeekClass, datePickerWeekdayClass, datePickerWeekdaysClass, detailPageBaseClass, detailPageBodyClass, detailPageEmptyClass, detailPageSkeletonRowClass, dialogCloseButtonClass, dialogContentClass, dialogDescriptionClass, dialogFooterClass, dialogHeaderClass, dialogOverlayClass, dialogTitleClass, dropdownMenuContentClass, dropdownMenuItemBaseClass, dropdownMenuItemInsetClass, dropdownMenuItemVariantClass, dropdownMenuLabelClass, dropdownMenuSeparatorClass, dropdownMenuShortcutClass, emptyStateActionsSpacingClass, emptyStateBaseClass, emptyStateContainerSizeClass, emptyStateDescriptionSizeClass, emptyStateIconWrapperBaseClass, emptyStateIconWrapperSizeClass, emptyStateTitleSizeClass, fileUploadBaseClass, fileUploadDropzoneClass, fileUploadFileNameClass, fileUploadFileRowClass, fileUploadFileSizeClass, fileUploadHintClass, fileUploadIconClass, fileUploadPromptClass, fileUploadRemoveClass, formPageActionsBarClass, formPageBaseClass, formPageBodyClass, formPageSkeletonRowClass, inputBaseClass, inputSizeClass, inputVariantClass, multiSelectChipClass, multiSelectChipRemoveClass, multiSelectContentClass, multiSelectEmptyClass, multiSelectListClass, multiSelectOptionClass, multiSelectSearchRowClass, multiSelectTriggerSizeClass, multiSelectValueRowClass, pageHeaderActionsClass, pageHeaderBackClass, pageHeaderBackIconClass, pageHeaderBaseClass, pageHeaderBorderedClass, pageHeaderBreadcrumbsClass, pageHeaderDescriptionClass, pageHeaderEyebrowClass, pageHeaderTitleBlockClass, pageHeaderTitleClass, pageHeaderTitleLineClass, pageHeaderTitleMetaClass, pageHeaderTitleRowClass, radioGroupBaseClass, radioGroupOrientationClass, radioIndicatorBaseClass, radioIndicatorDotClass, radioIndicatorSizeClass, radioItemBaseClass, radioItemSizeClass, radioLabelSizeClass, radioOptionRowClass, rowActionsBaseClass, rowActionsDestructiveClass, selectBaseClass, selectSizeClass, selectVariantClass, switchThumbBaseClass, switchThumbClass, switchTrackBaseClass, switchTrackClass, alignClass as tableAlignClass, tableBaseClass, selectedRowClass as tableSelectedRowClass, tableSizeClass, sortIconClass as tableSortIconClass, textareaBaseClass, textareaResizeClass, textareaSizeClass, textareaVariantClass, toastClassNames, tooltipArrowClass, tooltipContentClass, useConfirm, useDashboardLayout, useDirection };
|
|
3722
3823
|
//# sourceMappingURL=index.js.map
|
|
3723
3824
|
//# sourceMappingURL=index.js.map
|