@webdevarif/dashui 0.2.3 → 0.2.4

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.d.mts CHANGED
@@ -367,7 +367,6 @@ interface MediaPickerDialogProps {
367
367
  folders?: MediaPickerDialogFolder[];
368
368
  loading?: boolean;
369
369
  total: number;
370
- uploads?: UploadItem[];
371
370
  typeFilter?: string;
372
371
  onTypeChange?: (type: string) => void;
373
372
  search?: string;
@@ -378,11 +377,12 @@ interface MediaPickerDialogProps {
378
377
  onLoadMore?: () => void;
379
378
  hasMore?: boolean;
380
379
  multiple?: boolean;
380
+ initialSelected?: string[];
381
381
  /** "images" = only show image type tabs; "all" = show all type tabs */
382
382
  accept?: "images" | "all";
383
383
  onSelect: (files: MediaCardFile[]) => void;
384
384
  }
385
- declare function MediaPickerDialog({ open, onOpenChange, title, files, folders, loading, total, uploads, typeFilter, onTypeChange, search, onSearch, activeFolderId, onFolderChange, onUpload, onLoadMore, hasMore, multiple, accept, onSelect, }: MediaPickerDialogProps): react_jsx_runtime.JSX.Element;
385
+ declare function MediaPickerDialog({ open, onOpenChange, title, files, folders, loading, total, typeFilter, onTypeChange, search, onSearch, activeFolderId, onFolderChange, onUpload, onLoadMore, hasMore, multiple, initialSelected, accept, onSelect, }: MediaPickerDialogProps): react_jsx_runtime.JSX.Element;
386
386
 
387
387
  interface ImagePickerFieldProps {
388
388
  value?: string;
package/dist/index.d.ts CHANGED
@@ -367,7 +367,6 @@ interface MediaPickerDialogProps {
367
367
  folders?: MediaPickerDialogFolder[];
368
368
  loading?: boolean;
369
369
  total: number;
370
- uploads?: UploadItem[];
371
370
  typeFilter?: string;
372
371
  onTypeChange?: (type: string) => void;
373
372
  search?: string;
@@ -378,11 +377,12 @@ interface MediaPickerDialogProps {
378
377
  onLoadMore?: () => void;
379
378
  hasMore?: boolean;
380
379
  multiple?: boolean;
380
+ initialSelected?: string[];
381
381
  /** "images" = only show image type tabs; "all" = show all type tabs */
382
382
  accept?: "images" | "all";
383
383
  onSelect: (files: MediaCardFile[]) => void;
384
384
  }
385
- declare function MediaPickerDialog({ open, onOpenChange, title, files, folders, loading, total, uploads, typeFilter, onTypeChange, search, onSearch, activeFolderId, onFolderChange, onUpload, onLoadMore, hasMore, multiple, accept, onSelect, }: MediaPickerDialogProps): react_jsx_runtime.JSX.Element;
385
+ declare function MediaPickerDialog({ open, onOpenChange, title, files, folders, loading, total, typeFilter, onTypeChange, search, onSearch, activeFolderId, onFolderChange, onUpload, onLoadMore, hasMore, multiple, initialSelected, accept, onSelect, }: MediaPickerDialogProps): react_jsx_runtime.JSX.Element;
386
386
 
387
387
  interface ImagePickerFieldProps {
388
388
  value?: string;
package/dist/index.js CHANGED
@@ -2030,7 +2030,6 @@ function MediaPickerDialog({
2030
2030
  folders = [],
2031
2031
  loading = false,
2032
2032
  total,
2033
- uploads = [],
2034
2033
  typeFilter = "all",
2035
2034
  onTypeChange,
2036
2035
  search = "",
@@ -2041,15 +2040,18 @@ function MediaPickerDialog({
2041
2040
  onLoadMore,
2042
2041
  hasMore = false,
2043
2042
  multiple = false,
2043
+ initialSelected = [],
2044
2044
  accept = "all",
2045
2045
  onSelect
2046
2046
  }) {
2047
- const [localSelected, setLocalSelected] = React20.useState(/* @__PURE__ */ new Set());
2047
+ const [localSelected, setLocalSelected] = React20.useState(new Set(initialSelected));
2048
2048
  const [isDragging, setIsDragging] = React20.useState(false);
2049
2049
  const fileInputRef = React20.useRef(null);
2050
2050
  const dragCounterRef = React20.useRef(0);
2051
2051
  React20.useEffect(() => {
2052
- if (!open) {
2052
+ if (open) {
2053
+ setLocalSelected(new Set(initialSelected));
2054
+ } else {
2053
2055
  setLocalSelected(/* @__PURE__ */ new Set());
2054
2056
  setIsDragging(false);
2055
2057
  dragCounterRef.current = 0;
@@ -2111,7 +2113,6 @@ function MediaPickerDialog({
2111
2113
  onUpload(e.target.files);
2112
2114
  }
2113
2115
  };
2114
- const activeUploads = uploads.filter((u) => u.status === "uploading");
2115
2116
  const firstSelected = files.find((f) => localSelected.has(f.id));
2116
2117
  return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Dialog, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
2117
2118
  DialogContent,
@@ -2217,20 +2218,6 @@ function MediaPickerDialog({
2217
2218
  )
2218
2219
  ] })
2219
2220
  ] }),
2220
- activeUploads.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "border-b px-4 py-2 space-y-1.5 shrink-0", children: activeUploads.map((u, i) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center gap-2", children: [
2221
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "flex-1 truncate text-xs text-muted-foreground", children: u.name }),
2222
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "h-1.5 w-24 overflow-hidden rounded-full bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2223
- "div",
2224
- {
2225
- className: "h-full rounded-full bg-primary transition-all duration-200",
2226
- style: { width: `${u.progress}%` }
2227
- }
2228
- ) }),
2229
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "text-[10px] text-muted-foreground w-6 text-right", children: [
2230
- u.progress,
2231
- "%"
2232
- ] })
2233
- ] }, i)) }),
2234
2221
  /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
2235
2222
  "div",
2236
2223
  {