@kidecms/core 0.19.0 → 0.19.1
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/admin/components/AssetsGrid.tsx +57 -58
- package/package.json +1 -1
|
@@ -803,7 +803,7 @@ export default function AssetsGrid({
|
|
|
803
803
|
|
|
804
804
|
{/* ── Main: search, grid, pagination ── */}
|
|
805
805
|
<div className="min-w-0 space-y-4 lg:border-l lg:pl-8">
|
|
806
|
-
<div className="top-0 z-20 flex items-center justify-between gap-3
|
|
806
|
+
<div className="bg-background sticky top-0 z-20 -mx-0.5 flex items-center justify-between gap-3 border-b px-0.5 py-3">
|
|
807
807
|
<div className="relative w-full sm:max-w-xs">
|
|
808
808
|
<Search className="text-muted-foreground pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2" />
|
|
809
809
|
<Input
|
|
@@ -813,39 +813,62 @@ export default function AssetsGrid({
|
|
|
813
813
|
className="pl-9 text-sm"
|
|
814
814
|
/>
|
|
815
815
|
</div>
|
|
816
|
-
|
|
817
|
-
className=
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
816
|
+
{selectedIds.size > 0 ? (
|
|
817
|
+
<div className="flex shrink-0 items-center gap-2">
|
|
818
|
+
<span className="text-sm font-medium">
|
|
819
|
+
{selectedIds.size}
|
|
820
|
+
<span className="hidden sm:inline"> selected</span>
|
|
821
|
+
</span>
|
|
822
|
+
<Button
|
|
823
|
+
variant="destructive"
|
|
824
|
+
onClick={() => {
|
|
825
|
+
resetDialogState();
|
|
826
|
+
setBulkDeleteOpen(true);
|
|
827
|
+
void loadBulkUsage(Array.from(selectedIds));
|
|
828
|
+
}}
|
|
829
|
+
>
|
|
830
|
+
<Trash2 className="size-4" />
|
|
831
|
+
Delete
|
|
832
|
+
</Button>
|
|
833
|
+
<Button variant="outline" onClick={clearSelection}>
|
|
834
|
+
Cancel
|
|
835
|
+
</Button>
|
|
836
|
+
</div>
|
|
837
|
+
) : (
|
|
838
|
+
<label
|
|
839
|
+
className={cn(
|
|
840
|
+
buttonVariants(),
|
|
841
|
+
"shrink-0",
|
|
842
|
+
uploading ? "pointer-events-none opacity-70" : "cursor-pointer",
|
|
843
|
+
)}
|
|
844
|
+
>
|
|
845
|
+
{uploading ? (
|
|
846
|
+
<>
|
|
847
|
+
<Loader2 className="size-4 animate-spin" />
|
|
848
|
+
{uploadProgress < 100
|
|
849
|
+
? `Uploading ${uploadCount > 1 ? `${uploadCount} files` : "file"}… ${uploadProgress}%`
|
|
850
|
+
: "Processing…"}
|
|
851
|
+
</>
|
|
852
|
+
) : (
|
|
853
|
+
<>
|
|
854
|
+
<Upload className="size-4" />
|
|
855
|
+
Upload
|
|
856
|
+
</>
|
|
857
|
+
)}
|
|
858
|
+
<input
|
|
859
|
+
type="file"
|
|
860
|
+
name="file"
|
|
861
|
+
accept="image/*,video/*,audio/*,.pdf,.doc,.docx"
|
|
862
|
+
multiple
|
|
863
|
+
disabled={uploading}
|
|
864
|
+
className="hidden"
|
|
865
|
+
onChange={(e) => {
|
|
866
|
+
if (e.target.files?.length) handleFilesSelected(e.target.files);
|
|
867
|
+
e.target.value = "";
|
|
868
|
+
}}
|
|
869
|
+
/>
|
|
870
|
+
</label>
|
|
871
|
+
)}
|
|
849
872
|
</div>
|
|
850
873
|
{uploading && (
|
|
851
874
|
<div
|
|
@@ -877,30 +900,6 @@ export default function AssetsGrid({
|
|
|
877
900
|
</div>
|
|
878
901
|
)}
|
|
879
902
|
|
|
880
|
-
{/* Selection toolbar */}
|
|
881
|
-
{selectedIds.size > 0 && (
|
|
882
|
-
<div className="bg-background sticky top-4 z-20 flex items-center justify-between gap-3 rounded-lg border px-3 py-2 shadow-sm">
|
|
883
|
-
<span className="text-sm font-medium">{selectedIds.size} selected</span>
|
|
884
|
-
<div className="flex items-center gap-2">
|
|
885
|
-
<Button
|
|
886
|
-
variant="destructive"
|
|
887
|
-
size="sm"
|
|
888
|
-
onClick={() => {
|
|
889
|
-
resetDialogState();
|
|
890
|
-
setBulkDeleteOpen(true);
|
|
891
|
-
void loadBulkUsage(Array.from(selectedIds));
|
|
892
|
-
}}
|
|
893
|
-
>
|
|
894
|
-
<Trash2 className="size-3.5" />
|
|
895
|
-
Delete
|
|
896
|
-
</Button>
|
|
897
|
-
<Button variant="outline" size="sm" onClick={clearSelection}>
|
|
898
|
-
Cancel
|
|
899
|
-
</Button>
|
|
900
|
-
</div>
|
|
901
|
-
</div>
|
|
902
|
-
)}
|
|
903
|
-
|
|
904
903
|
{/* Grid or empty state. Keep the current grid visible while a new
|
|
905
904
|
filter/page loads (dimmed) to avoid an empty-then-fill flash. */}
|
|
906
905
|
{items.length > 0 ? (
|