@pixpilot/shadcn-ui 1.7.0 → 1.9.0

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.
Files changed (44) hide show
  1. package/dist/Rating.d.cts +3 -3
  2. package/dist/Select.d.cts +2 -2
  3. package/dist/avatar-upload/AvatarUpload.cjs +14 -5
  4. package/dist/avatar-upload/AvatarUpload.d.cts +6 -0
  5. package/dist/avatar-upload/AvatarUpload.d.ts +6 -0
  6. package/dist/avatar-upload/AvatarUpload.js +14 -5
  7. package/dist/avatar-upload/AvatarUploadComponents.cjs +20 -2
  8. package/dist/avatar-upload/AvatarUploadComponents.js +25 -8
  9. package/dist/avatar-upload/AvatarUploadItem.cjs +4 -3
  10. package/dist/avatar-upload/AvatarUploadItem.js +4 -3
  11. package/dist/dialog/Dialog.d.cts +4 -4
  12. package/dist/file-upload/FileUpload.cjs +5 -10
  13. package/dist/file-upload/FileUpload.js +5 -10
  14. package/dist/file-upload/FileUploadItems.cjs +3 -3
  15. package/dist/file-upload/FileUploadItems.js +3 -3
  16. package/dist/file-upload/FileUploadListItem.cjs +3 -3
  17. package/dist/file-upload/FileUploadListItem.js +3 -3
  18. package/dist/file-upload/hooks/use-file-upload-progress-callbacks.cjs +5 -5
  19. package/dist/file-upload/hooks/use-file-upload-progress-callbacks.js +5 -5
  20. package/dist/file-upload/index.d.cts +1 -1
  21. package/dist/file-upload/index.d.ts +1 -1
  22. package/dist/file-upload/types/index.d.cts +6 -10
  23. package/dist/file-upload/types/index.d.ts +6 -10
  24. package/dist/file-upload-inline/FileUploadInline.cjs +4 -2
  25. package/dist/file-upload-inline/FileUploadInline.d.cts +2 -2
  26. package/dist/file-upload-inline/FileUploadInline.js +4 -2
  27. package/dist/file-upload-root/FileUploadRoot.cjs +13 -8
  28. package/dist/file-upload-root/FileUploadRoot.d.cts +2 -2
  29. package/dist/file-upload-root/FileUploadRoot.d.ts +2 -2
  30. package/dist/file-upload-root/FileUploadRoot.js +13 -8
  31. package/dist/file-upload-root/FileUploadRootItem.cjs +3 -3
  32. package/dist/file-upload-root/FileUploadRootItem.d.cts +2 -2
  33. package/dist/file-upload-root/FileUploadRootItem.d.ts +2 -2
  34. package/dist/file-upload-root/FileUploadRootItem.js +3 -3
  35. package/dist/index.d.cts +2 -2
  36. package/dist/index.d.ts +2 -2
  37. package/dist/input/Input.d.cts +2 -2
  38. package/dist/input/Input.d.ts +2 -2
  39. package/dist/tags-input/TagsInput.d.cts +2 -2
  40. package/dist/tags-input/TagsInputInline.d.cts +2 -2
  41. package/dist/theme-toggle/ThemeModeDropdown.d.cts +2 -2
  42. package/dist/theme-toggle/ThemeModeSwitchInside.d.cts +2 -2
  43. package/dist/theme-toggle/ThemeModeSwitchOutside.d.cts +2 -2
  44. package/package.json +1 -1
package/dist/Rating.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime6 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime5 from "react/jsx-runtime";
2
2
  import * as React$1 from "react";
3
3
  import { VariantProps } from "class-variance-authority";
4
4
  import * as class_variance_authority_types0 from "class-variance-authority/types";
@@ -35,7 +35,7 @@ declare function RatingButton({
35
35
  index,
36
36
  className,
37
37
  ...props
38
- }: RatingButtonProps): react_jsx_runtime6.JSX.Element;
38
+ }: RatingButtonProps): react_jsx_runtime5.JSX.Element;
39
39
  declare function Rating({
40
40
  value: valueProp,
41
41
  defaultValue,
@@ -52,6 +52,6 @@ declare function Rating({
52
52
  className,
53
53
  children,
54
54
  ...props
55
- }: React$1.PropsWithChildren<RatingProps>): react_jsx_runtime6.JSX.Element;
55
+ }: React$1.PropsWithChildren<RatingProps>): react_jsx_runtime5.JSX.Element;
56
56
  //#endregion
57
57
  export { Rating, RatingButton, RatingButtonProps, RatingColor, RatingOption, RatingProps };
package/dist/Select.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime5 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime7 from "react/jsx-runtime";
2
2
  import { Select, SelectContent } from "@pixpilot/shadcn";
3
3
  import React, { ComponentProps } from "react";
4
4
 
@@ -46,6 +46,6 @@ type BaseSelectProps = {
46
46
  */
47
47
  clearable?: boolean;
48
48
  } & Omit<ComponentProps<typeof Select>, 'value' | 'onValueChange' | 'children'>;
49
- declare function Select$1(props: BaseSelectProps): react_jsx_runtime5.JSX.Element;
49
+ declare function Select$1(props: BaseSelectProps): react_jsx_runtime7.JSX.Element;
50
50
  //#endregion
51
51
  export { Select$1 as Select, SelectContentProps, SelectOption };
@@ -33,23 +33,30 @@ const sizeClasses = {
33
33
  }
34
34
  };
35
35
  const AvatarUpload = (props) => {
36
- const { className, messages, value, onAccept, onSuccess, onError, size = "md",...rest } = props;
36
+ const { className, messages, value, onAccept, onFileSuccess, onFileError, onChange, size = "md", clearable = true,...rest } = props;
37
37
  const { upload = "Upload", change = "Change" } = messages || {};
38
38
  const currentSize = sizeClasses[size];
39
39
  const [files, setFiles] = react.default.useState([]);
40
40
  const imageUrl = value?.url;
41
41
  const handleAccept = react.default.useCallback((acceptedFiles) => {
42
- setFiles(acceptedFiles.map((file) => {
42
+ const nextFiles = acceptedFiles.slice(0, 1);
43
+ setFiles(nextFiles.map((file) => {
43
44
  return {
44
45
  file,
45
46
  id: `${file.name}-${file.lastModified.toString()}`
46
47
  };
47
48
  }));
48
- onAccept?.(acceptedFiles);
49
+ onAccept?.(nextFiles);
49
50
  }, [onAccept]);
51
+ const handleClear = react.default.useCallback(() => {
52
+ setFiles([]);
53
+ onChange?.(null);
54
+ }, [onChange]);
50
55
  const hasImageUrl = imageUrl != null;
56
+ const showClearButton = clearable && (files.length > 0 || hasImageUrl);
51
57
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.FileUpload, {
52
58
  ...rest,
59
+ multiple: false,
53
60
  onAccept: handleAccept,
54
61
  className: require_utils.cn("w-fit", className),
55
62
  accept: "image/*",
@@ -60,14 +67,16 @@ const AvatarUpload = (props) => {
60
67
  index: i,
61
68
  currentSize,
62
69
  change,
63
- onSuccess,
64
- onError
70
+ onFileSuccess,
71
+ onFileError,
72
+ onClear: showClearButton ? handleClear : void 0
65
73
  }, id)) }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_AvatarUploadComponents.MainWrapper, {
66
74
  currentSize,
67
75
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_AvatarUploadComponents.AvatarWrap, {
68
76
  className: currentSize.avatar,
69
77
  iconClass: currentSize.icon,
70
78
  showChangeIcon: hasImageUrl,
79
+ onClear: showClearButton ? handleClear : void 0,
71
80
  children: hasImageUrl ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_AvatarUploadComponents.Image, { src: imageUrl }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.UserCircle2, {
72
81
  className: "text-muted-foreground w-full h-full",
73
82
  strokeWidth: 1
@@ -10,6 +10,12 @@ interface AvatarUploadProps extends SingleFileUploadProps {
10
10
  change?: string;
11
11
  };
12
12
  size?: keyof ComponentSizes;
13
+ /**
14
+ * When `true` (the default), a small × button is displayed on the avatar
15
+ * whenever there is an image loaded. Clicking it clears the current value.
16
+ * Set to `false` to hide the button.
17
+ */
18
+ clearable?: boolean;
13
19
  }
14
20
  declare const AvatarUpload: React.FC<AvatarUploadProps>;
15
21
  //#endregion
@@ -10,6 +10,12 @@ interface AvatarUploadProps extends SingleFileUploadProps {
10
10
  change?: string;
11
11
  };
12
12
  size?: keyof ComponentSizes;
13
+ /**
14
+ * When `true` (the default), a small × button is displayed on the avatar
15
+ * whenever there is an image loaded. Clicking it clears the current value.
16
+ * Set to `false` to hide the button.
17
+ */
18
+ clearable?: boolean;
13
19
  }
14
20
  declare const AvatarUpload: React.FC<AvatarUploadProps>;
15
21
  //#endregion
@@ -28,23 +28,30 @@ const sizeClasses = {
28
28
  }
29
29
  };
30
30
  const AvatarUpload = (props) => {
31
- const { className, messages, value, onAccept, onSuccess, onError, size = "md",...rest } = props;
31
+ const { className, messages, value, onAccept, onFileSuccess, onFileError, onChange, size = "md", clearable = true,...rest } = props;
32
32
  const { upload = "Upload", change = "Change" } = messages || {};
33
33
  const currentSize = sizeClasses[size];
34
34
  const [files, setFiles] = React.useState([]);
35
35
  const imageUrl = value?.url;
36
36
  const handleAccept = React.useCallback((acceptedFiles) => {
37
- setFiles(acceptedFiles.map((file) => {
37
+ const nextFiles = acceptedFiles.slice(0, 1);
38
+ setFiles(nextFiles.map((file) => {
38
39
  return {
39
40
  file,
40
41
  id: `${file.name}-${file.lastModified.toString()}`
41
42
  };
42
43
  }));
43
- onAccept?.(acceptedFiles);
44
+ onAccept?.(nextFiles);
44
45
  }, [onAccept]);
46
+ const handleClear = React.useCallback(() => {
47
+ setFiles([]);
48
+ onChange?.(null);
49
+ }, [onChange]);
45
50
  const hasImageUrl = imageUrl != null;
51
+ const showClearButton = clearable && (files.length > 0 || hasImageUrl);
46
52
  return /* @__PURE__ */ jsx(FileUpload, {
47
53
  ...rest,
54
+ multiple: false,
48
55
  onAccept: handleAccept,
49
56
  className: cn$1("w-fit", className),
50
57
  accept: "image/*",
@@ -55,14 +62,16 @@ const AvatarUpload = (props) => {
55
62
  index: i,
56
63
  currentSize,
57
64
  change,
58
- onSuccess,
59
- onError
65
+ onFileSuccess,
66
+ onFileError,
67
+ onClear: showClearButton ? handleClear : void 0
60
68
  }, id)) }) : /* @__PURE__ */ jsxs(MainWrapper, {
61
69
  currentSize,
62
70
  children: [/* @__PURE__ */ jsx(AvatarWrap, {
63
71
  className: currentSize.avatar,
64
72
  iconClass: currentSize.icon,
65
73
  showChangeIcon: hasImageUrl,
74
+ onClear: showClearButton ? handleClear : void 0,
66
75
  children: hasImageUrl ? /* @__PURE__ */ jsx(Image, { src: imageUrl }) : /* @__PURE__ */ jsx(UserCircle2, {
67
76
  className: "text-muted-foreground w-full h-full",
68
77
  strokeWidth: 1
@@ -1,5 +1,7 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
2
  const require_utils = require('../shadcn/src/lib/utils.cjs');
3
+ let __pixpilot_shadcn = require("@pixpilot/shadcn");
4
+ __pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
3
5
  let lucide_react = require("lucide-react");
4
6
  lucide_react = require_rolldown_runtime.__toESM(lucide_react);
5
7
  let react = require("react");
@@ -14,10 +16,26 @@ const MessageComponent = ({ message, className }) => {
14
16
  children: message
15
17
  });
16
18
  };
17
- const AvatarWrap = ({ children, className, iconClass, showChangeIcon }) => {
19
+ const AvatarWrap = ({ children, className, iconClass, showChangeIcon, onClear }) => {
18
20
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
19
21
  className: require_utils.cn("relative", className),
20
- children: [children, showChangeIcon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Pencil, { className: require_utils.cn(`absolute bottom-0 right-0 bg-secondary text-secondary-foreground rounded-full p-1.5 shadow-md`, iconClass) })]
22
+ children: [
23
+ children,
24
+ showChangeIcon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Pencil, { className: require_utils.cn(`absolute bottom-0 right-0 bg-secondary text-secondary-foreground rounded-full p-1.5 shadow-md`, iconClass) }),
25
+ onClear != null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.Button, {
26
+ type: "button",
27
+ variant: "secondary",
28
+ size: "icon",
29
+ className: "-top-1 -right-1 absolute size-5 rounded-full",
30
+ "aria-label": "Clear avatar",
31
+ onClick: (e) => {
32
+ e.stopPropagation();
33
+ e.preventDefault();
34
+ onClear();
35
+ },
36
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.X, { className: "size-3" })
37
+ })
38
+ ]
21
39
  });
22
40
  };
23
41
  const Image = ({ src, className }) => {
@@ -1,31 +1,48 @@
1
- import { cn } from "../shadcn/src/lib/utils.js";
2
- import { Pencil } from "lucide-react";
1
+ import { cn as cn$1 } from "../shadcn/src/lib/utils.js";
2
+ import { Button } from "@pixpilot/shadcn";
3
+ import { Pencil, X } from "lucide-react";
3
4
  import React from "react";
4
5
  import { jsx, jsxs } from "react/jsx-runtime";
5
6
 
6
7
  //#region src/avatar-upload/AvatarUploadComponents.tsx
7
8
  const MessageComponent = ({ message, className }) => {
8
9
  return /* @__PURE__ */ jsx("p", {
9
- className: cn("text-sm text-muted-foreground", className),
10
+ className: cn$1("text-sm text-muted-foreground", className),
10
11
  children: message
11
12
  });
12
13
  };
13
- const AvatarWrap = ({ children, className, iconClass, showChangeIcon }) => {
14
+ const AvatarWrap = ({ children, className, iconClass, showChangeIcon, onClear }) => {
14
15
  return /* @__PURE__ */ jsxs("div", {
15
- className: cn("relative", className),
16
- children: [children, showChangeIcon && /* @__PURE__ */ jsx(Pencil, { className: cn(`absolute bottom-0 right-0 bg-secondary text-secondary-foreground rounded-full p-1.5 shadow-md`, iconClass) })]
16
+ className: cn$1("relative", className),
17
+ children: [
18
+ children,
19
+ showChangeIcon && /* @__PURE__ */ jsx(Pencil, { className: cn$1(`absolute bottom-0 right-0 bg-secondary text-secondary-foreground rounded-full p-1.5 shadow-md`, iconClass) }),
20
+ onClear != null && /* @__PURE__ */ jsx(Button, {
21
+ type: "button",
22
+ variant: "secondary",
23
+ size: "icon",
24
+ className: "-top-1 -right-1 absolute size-5 rounded-full",
25
+ "aria-label": "Clear avatar",
26
+ onClick: (e) => {
27
+ e.stopPropagation();
28
+ e.preventDefault();
29
+ onClear();
30
+ },
31
+ children: /* @__PURE__ */ jsx(X, { className: "size-3" })
32
+ })
33
+ ]
17
34
  });
18
35
  };
19
36
  const Image = ({ src, className }) => {
20
37
  return /* @__PURE__ */ jsx("img", {
21
38
  src,
22
39
  alt: "Avatar preview",
23
- className: cn("rounded-full object-cover w-full h-full", className)
40
+ className: cn$1("rounded-full object-cover w-full h-full", className)
24
41
  });
25
42
  };
26
43
  const MainWrapper = ({ children, className, currentSize }) => {
27
44
  return /* @__PURE__ */ jsx("div", {
28
- className: cn("flex flex-col items-center relative", className, currentSize.main),
45
+ className: cn$1("flex flex-col items-center relative", className, currentSize.main),
29
46
  children
30
47
  });
31
48
  };
@@ -12,10 +12,10 @@ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
12
12
 
13
13
  //#region src/avatar-upload/AvatarUploadItem.tsx
14
14
  const AvatarUploadItem = (props) => {
15
- const { file, currentSize, change, onSuccess, onError } = props;
15
+ const { file, currentSize, change, onFileSuccess, onFileError, onClear } = props;
16
16
  require_use_file_upload_progress_callbacks.useFileUploadProgressCallbacks(file, {
17
- onSuccess,
18
- onError
17
+ onFileSuccess,
18
+ onFileError
19
19
  });
20
20
  const fileError = require_use_file_error.useFileError(file);
21
21
  const isUploading = (0, __pixpilot_shadcn.useFileUpload)((store) => {
@@ -34,6 +34,7 @@ const AvatarUploadItem = (props) => {
34
34
  className: currentSize.avatar,
35
35
  showChangeIcon: true,
36
36
  iconClass: currentSize.icon,
37
+ onClear,
37
38
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_AvatarUploadComponents.Image, { src: URL.createObjectURL(file) })
38
39
  }), fileError != null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.TooltipProvider, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.Tooltip, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.TooltipTrigger, {
39
40
  asChild: true,
@@ -8,10 +8,10 @@ import { jsx, jsxs } from "react/jsx-runtime";
8
8
 
9
9
  //#region src/avatar-upload/AvatarUploadItem.tsx
10
10
  const AvatarUploadItem = (props) => {
11
- const { file, currentSize, change, onSuccess, onError } = props;
11
+ const { file, currentSize, change, onFileSuccess, onFileError, onClear } = props;
12
12
  useFileUploadProgressCallbacks(file, {
13
- onSuccess,
14
- onError
13
+ onFileSuccess,
14
+ onFileError
15
15
  });
16
16
  const fileError = useFileError(file);
17
17
  const isUploading = useFileUpload((store) => {
@@ -30,6 +30,7 @@ const AvatarUploadItem = (props) => {
30
30
  className: currentSize.avatar,
31
31
  showChangeIcon: true,
32
32
  iconClass: currentSize.icon,
33
+ onClear,
33
34
  children: /* @__PURE__ */ jsx(Image, { src: URL.createObjectURL(file) })
34
35
  }), fileError != null && /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
35
36
  asChild: true,
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime9 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime18 from "react/jsx-runtime";
2
2
  import { DialogContent } from "@pixpilot/shadcn";
3
3
  import * as React$1 from "react";
4
4
  import * as _radix_ui_react_dialog0 from "@radix-ui/react-dialog";
@@ -13,14 +13,14 @@ declare const DialogContent$1: React$1.ForwardRefExoticComponent<Omit<_radix_ui_
13
13
  declare function DialogHeader({
14
14
  className,
15
15
  ...props
16
- }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime9.JSX.Element;
16
+ }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime18.JSX.Element;
17
17
  declare function DialogBody({
18
18
  className,
19
19
  ...props
20
- }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime9.JSX.Element;
20
+ }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime18.JSX.Element;
21
21
  declare function DialogFooter({
22
22
  className,
23
23
  ...props
24
- }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime9.JSX.Element;
24
+ }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime18.JSX.Element;
25
25
  //#endregion
26
26
  export { DialogBody, DialogContent$1 as DialogContent, DialogContentProps, DialogFooter, DialogHeader };
@@ -1,6 +1,3 @@
1
- 'use client';
2
-
3
-
4
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
5
2
  const require_use_file_upload_store = require('./hooks/use-file-upload-store.cjs');
6
3
  const require_FileUploadItems = require('./FileUploadItems.cjs');
@@ -15,10 +12,8 @@ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
15
12
 
16
13
  //#region src/file-upload/FileUpload.tsx
17
14
  function FileUpload(props) {
18
- const { value, onChange, className, onAccept, maxFiles, preventDuplicates, onFileReject, onSuccess: singleOnSuccess, onError: singleOnError, onFileSuccess, onFileError,...rest } = props;
15
+ const { value, onChange, className, onAccept, maxFiles, preventDuplicates, onFileReject, onFileSuccess, onFileError,...rest } = props;
19
16
  const multiple = props.multiple ?? true;
20
- const onSuccess = multiple ? onFileSuccess : singleOnSuccess;
21
- const onError = multiple ? onFileError : singleOnError;
22
17
  const { handleAccept, displayFiles, deleteFile, getFile, orgValue } = require_use_file_upload_store.useFileUploadStore({
23
18
  value,
24
19
  onChange,
@@ -33,8 +28,8 @@ function FileUpload(props) {
33
28
  const containerClasses = (0, __pixpilot_shadcn.cn)("p-1.5");
34
29
  const handleError = react.useCallback((file, message) => {
35
30
  if (onFileReject) onFileReject(file, message);
36
- if (onError) onError(file, message);
37
- }, [onError, onFileReject]);
31
+ if (onFileError) onFileError(file, message);
32
+ }, [onFileError, onFileReject]);
38
33
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.FileUpload, {
39
34
  ...rest,
40
35
  value: orgValue,
@@ -66,8 +61,8 @@ function FileUpload(props) {
66
61
  getFile,
67
62
  maxFiles,
68
63
  itemSize,
69
- onSuccess,
70
- onError,
64
+ onFileSuccess,
65
+ onFileError,
71
66
  className: containerClasses
72
67
  })
73
68
  })
@@ -1,6 +1,3 @@
1
- 'use client';
2
-
3
-
4
1
  import { useFileUploadStore } from "./hooks/use-file-upload-store.js";
5
2
  import { FileUploadItems } from "./FileUploadItems.js";
6
3
  import { FileUpload, FileUploadDropzone, cn } from "@pixpilot/shadcn";
@@ -10,10 +7,8 @@ import { jsx, jsxs } from "react/jsx-runtime";
10
7
 
11
8
  //#region src/file-upload/FileUpload.tsx
12
9
  function FileUpload$1(props) {
13
- const { value, onChange, className, onAccept, maxFiles, preventDuplicates, onFileReject, onSuccess: singleOnSuccess, onError: singleOnError, onFileSuccess, onFileError,...rest } = props;
10
+ const { value, onChange, className, onAccept, maxFiles, preventDuplicates, onFileReject, onFileSuccess, onFileError,...rest } = props;
14
11
  const multiple = props.multiple ?? true;
15
- const onSuccess = multiple ? onFileSuccess : singleOnSuccess;
16
- const onError = multiple ? onFileError : singleOnError;
17
12
  const { handleAccept, displayFiles, deleteFile, getFile, orgValue } = useFileUploadStore({
18
13
  value,
19
14
  onChange,
@@ -28,8 +23,8 @@ function FileUpload$1(props) {
28
23
  const containerClasses = cn("p-1.5");
29
24
  const handleError = React$1.useCallback((file, message) => {
30
25
  if (onFileReject) onFileReject(file, message);
31
- if (onError) onError(file, message);
32
- }, [onError, onFileReject]);
26
+ if (onFileError) onFileError(file, message);
27
+ }, [onFileError, onFileReject]);
33
28
  return /* @__PURE__ */ jsx(FileUpload, {
34
29
  ...rest,
35
30
  value: orgValue,
@@ -61,8 +56,8 @@ function FileUpload$1(props) {
61
56
  getFile,
62
57
  maxFiles,
63
58
  itemSize,
64
- onSuccess,
65
- onError,
59
+ onFileSuccess,
60
+ onFileError,
66
61
  className: containerClasses
67
62
  })
68
63
  })
@@ -11,7 +11,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
11
11
  react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
12
12
 
13
13
  //#region src/file-upload/FileUploadItems.tsx
14
- function FileUploadItems({ displayFiles, deleteFile, getFile, maxFiles, itemSize, onSuccess, onError, className }) {
14
+ function FileUploadItems({ displayFiles, deleteFile, getFile, maxFiles, itemSize, onFileSuccess, onFileError, className }) {
15
15
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.FileUploadList, {
16
16
  orientation: "horizontal",
17
17
  forceMount: true,
@@ -24,8 +24,8 @@ function FileUploadItems({ displayFiles, deleteFile, getFile, maxFiles, itemSize
24
24
  deleteFile,
25
25
  getFile,
26
26
  itemSize,
27
- onSuccess,
28
- onError
27
+ onFileSuccess,
28
+ onFileError
29
29
  }, key);
30
30
  }), maxFiles === void 0 || displayFiles.length < maxFiles ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
31
31
  className: (0, __pixpilot_shadcn.cn)(itemSize, "flex items-center justify-center border-2 border-dashed rounded-md"),
@@ -7,7 +7,7 @@ import { Plus } from "lucide-react";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
8
 
9
9
  //#region src/file-upload/FileUploadItems.tsx
10
- function FileUploadItems({ displayFiles, deleteFile, getFile, maxFiles, itemSize, onSuccess, onError, className }) {
10
+ function FileUploadItems({ displayFiles, deleteFile, getFile, maxFiles, itemSize, onFileSuccess, onFileError, className }) {
11
11
  return /* @__PURE__ */ jsxs(FileUploadList, {
12
12
  orientation: "horizontal",
13
13
  forceMount: true,
@@ -20,8 +20,8 @@ function FileUploadItems({ displayFiles, deleteFile, getFile, maxFiles, itemSize
20
20
  deleteFile,
21
21
  getFile,
22
22
  itemSize,
23
- onSuccess,
24
- onError
23
+ onFileSuccess,
24
+ onFileError
25
25
  }, key);
26
26
  }), maxFiles === void 0 || displayFiles.length < maxFiles ? /* @__PURE__ */ jsx("div", {
27
27
  className: cn(itemSize, "flex items-center justify-center border-2 border-dashed rounded-md"),
@@ -22,11 +22,11 @@ const Backdrop = ({ className, children }) => {
22
22
  children
23
23
  });
24
24
  };
25
- const FileUploadListItem = react.default.memo(({ fileMeta, deleteFile, getFile, itemSize, onSuccess, onError }) => {
25
+ const FileUploadListItem = react.default.memo(({ fileMeta, deleteFile, getFile, itemSize, onFileSuccess, onFileError }) => {
26
26
  const file = getFile(fileMeta);
27
27
  require_use_file_upload_progress_callbacks.useFileUploadProgressCallbacks(file, {
28
- onSuccess,
29
- onError
28
+ onFileSuccess,
29
+ onFileError
30
30
  });
31
31
  const storeFile = (0, __pixpilot_shadcn.useFileUpload)((store) => store.files.get(file));
32
32
  const hasError = storeFile?.error != null;
@@ -16,11 +16,11 @@ const Backdrop = ({ className, children }) => {
16
16
  children
17
17
  });
18
18
  };
19
- const FileUploadListItem = React.memo(({ fileMeta, deleteFile, getFile, itemSize, onSuccess, onError }) => {
19
+ const FileUploadListItem = React.memo(({ fileMeta, deleteFile, getFile, itemSize, onFileSuccess, onFileError }) => {
20
20
  const file = getFile(fileMeta);
21
21
  useFileUploadProgressCallbacks(file, {
22
- onSuccess,
23
- onError
22
+ onFileSuccess,
23
+ onFileError
24
24
  });
25
25
  const storeFile = useFileUpload((store) => store.files.get(file));
26
26
  const hasError = storeFile?.error != null;
@@ -7,7 +7,7 @@ react = require_rolldown_runtime.__toESM(react);
7
7
 
8
8
  //#region src/file-upload/hooks/use-file-upload-progress-callbacks.ts
9
9
  function useFileUploadProgressCallbacks(file, callBacks) {
10
- const { onSuccess, onError } = callBacks;
10
+ const { onFileSuccess, onFileError } = callBacks;
11
11
  const fileMeta = (0, react.useMemo)(() => require_get_file_meta.getFileMeta(file), [file]);
12
12
  const isChangeTrigged = (0, react.useRef)(false);
13
13
  const isErrorTriggered = (0, react.useRef)(false);
@@ -27,21 +27,21 @@ function useFileUploadProgressCallbacks(file, callBacks) {
27
27
  (0, react.useEffect)(() => {
28
28
  if (isUploadSuccess && !isChangeTrigged.current) {
29
29
  isChangeTrigged.current = true;
30
- onSuccess?.(fileMeta);
30
+ onFileSuccess?.(fileMeta);
31
31
  }
32
32
  }, [
33
33
  isUploadSuccess,
34
- onSuccess,
34
+ onFileSuccess,
35
35
  fileMeta
36
36
  ]);
37
37
  (0, react.useEffect)(() => {
38
38
  if (uploadError != null && !isErrorTriggered.current) {
39
39
  isErrorTriggered.current = true;
40
- onError?.(file, uploadError);
40
+ onFileError?.(file, uploadError);
41
41
  }
42
42
  }, [
43
43
  uploadError,
44
- onError,
44
+ onFileError,
45
45
  file
46
46
  ]);
47
47
  }
@@ -4,7 +4,7 @@ import { useEffect, useMemo, useRef } from "react";
4
4
 
5
5
  //#region src/file-upload/hooks/use-file-upload-progress-callbacks.ts
6
6
  function useFileUploadProgressCallbacks(file, callBacks) {
7
- const { onSuccess, onError } = callBacks;
7
+ const { onFileSuccess, onFileError } = callBacks;
8
8
  const fileMeta = useMemo(() => getFileMeta(file), [file]);
9
9
  const isChangeTrigged = useRef(false);
10
10
  const isErrorTriggered = useRef(false);
@@ -24,21 +24,21 @@ function useFileUploadProgressCallbacks(file, callBacks) {
24
24
  useEffect(() => {
25
25
  if (isUploadSuccess && !isChangeTrigged.current) {
26
26
  isChangeTrigged.current = true;
27
- onSuccess?.(fileMeta);
27
+ onFileSuccess?.(fileMeta);
28
28
  }
29
29
  }, [
30
30
  isUploadSuccess,
31
- onSuccess,
31
+ onFileSuccess,
32
32
  fileMeta
33
33
  ]);
34
34
  useEffect(() => {
35
35
  if (uploadError != null && !isErrorTriggered.current) {
36
36
  isErrorTriggered.current = true;
37
- onError?.(file, uploadError);
37
+ onFileError?.(file, uploadError);
38
38
  }
39
39
  }, [
40
40
  uploadError,
41
- onError,
41
+ onFileError,
42
42
  file
43
43
  ]);
44
44
  }
@@ -1,2 +1,2 @@
1
- import { FileMetadata, FileUploadBaseProps, FileUploadProgressCallBacks, FileUploadProps, MultiFileCallbacks, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, SingleFileUploadProps, UseFileCallbacks } from "./types/index.cjs";
1
+ import { FileMetadata, FileUploadBaseProps, FileUploadCallbacks, FileUploadProgressCallBacks, FileUploadProps, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, SingleFileUploadProps } from "./types/index.cjs";
2
2
  import { FileUpload } from "./FileUpload.cjs";
@@ -1,3 +1,3 @@
1
- import { FileMetadata, FileUploadBaseProps, FileUploadProgressCallBacks, FileUploadProps, MultiFileCallbacks, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, SingleFileUploadProps, UseFileCallbacks } from "./types/index.js";
1
+ import { FileMetadata, FileUploadBaseProps, FileUploadCallbacks, FileUploadProgressCallBacks, FileUploadProps, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, SingleFileUploadProps } from "./types/index.js";
2
2
  import { FileUpload } from "./FileUpload.js";
3
3
  import "./hooks/index.js";
@@ -8,11 +8,7 @@ interface FileMetadata {
8
8
  url?: string;
9
9
  lastModified: number;
10
10
  }
11
- interface UseFileCallbacks {
12
- onSuccess?: (fileMeta: FileMetadata) => void;
13
- onError?: (file: File, error: string) => void;
14
- }
15
- interface MultiFileCallbacks {
11
+ interface FileUploadCallbacks {
16
12
  onFileSuccess?: (fileMeta: FileMetadata) => void;
17
13
  onFileError?: (file: File, error: string) => void;
18
14
  }
@@ -26,16 +22,16 @@ type FileUploadProps$1 = ({
26
22
  multiple: true;
27
23
  value?: FileMetadata[];
28
24
  onChange?: OnChangeMultipleFiles;
29
- } & FileUploadBaseProps & MultiFileCallbacks) | ({
25
+ } & FileUploadBaseProps & FileUploadCallbacks) | ({
30
26
  multiple?: false;
31
27
  value?: FileMetadata | null;
32
28
  onChange?: OnChangeSingleFile;
33
- } & FileUploadBaseProps & UseFileCallbacks);
34
- interface MultiFileUploadProps extends FileUploadBaseProps, MultiFileCallbacks {
29
+ } & FileUploadBaseProps & FileUploadCallbacks);
30
+ interface MultiFileUploadProps extends FileUploadBaseProps, FileUploadCallbacks {
35
31
  value?: FileMetadata[];
36
32
  onChange?: OnChangeMultipleFiles;
37
33
  }
38
- interface SingleFileUploadProps extends Omit<FileUploadBaseProps, 'multiple'>, UseFileCallbacks {
34
+ interface SingleFileUploadProps extends Omit<FileUploadBaseProps, 'multiple'>, FileUploadCallbacks {
39
35
  value?: FileMetadata | null;
40
36
  onChange?: OnChangeSingleFile;
41
37
  }
@@ -45,4 +41,4 @@ interface FileUploadProgressCallBacks {
45
41
  onError: (file: File, error: Error) => void;
46
42
  }
47
43
  //#endregion
48
- export { FileMetadata, FileUploadBaseProps, FileUploadProgressCallBacks, FileUploadProps$1 as FileUploadProps, MultiFileCallbacks, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, SingleFileUploadProps, UseFileCallbacks };
44
+ export { FileMetadata, FileUploadBaseProps, FileUploadCallbacks, FileUploadProgressCallBacks, FileUploadProps$1 as FileUploadProps, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, SingleFileUploadProps };
@@ -8,11 +8,7 @@ interface FileMetadata {
8
8
  url?: string;
9
9
  lastModified: number;
10
10
  }
11
- interface UseFileCallbacks {
12
- onSuccess?: (fileMeta: FileMetadata) => void;
13
- onError?: (file: File, error: string) => void;
14
- }
15
- interface MultiFileCallbacks {
11
+ interface FileUploadCallbacks {
16
12
  onFileSuccess?: (fileMeta: FileMetadata) => void;
17
13
  onFileError?: (file: File, error: string) => void;
18
14
  }
@@ -26,16 +22,16 @@ type FileUploadProps$1 = ({
26
22
  multiple: true;
27
23
  value?: FileMetadata[];
28
24
  onChange?: OnChangeMultipleFiles;
29
- } & FileUploadBaseProps & MultiFileCallbacks) | ({
25
+ } & FileUploadBaseProps & FileUploadCallbacks) | ({
30
26
  multiple?: false;
31
27
  value?: FileMetadata | null;
32
28
  onChange?: OnChangeSingleFile;
33
- } & FileUploadBaseProps & UseFileCallbacks);
34
- interface MultiFileUploadProps extends FileUploadBaseProps, MultiFileCallbacks {
29
+ } & FileUploadBaseProps & FileUploadCallbacks);
30
+ interface MultiFileUploadProps extends FileUploadBaseProps, FileUploadCallbacks {
35
31
  value?: FileMetadata[];
36
32
  onChange?: OnChangeMultipleFiles;
37
33
  }
38
- interface SingleFileUploadProps extends Omit<FileUploadBaseProps, 'multiple'>, UseFileCallbacks {
34
+ interface SingleFileUploadProps extends Omit<FileUploadBaseProps, 'multiple'>, FileUploadCallbacks {
39
35
  value?: FileMetadata | null;
40
36
  onChange?: OnChangeSingleFile;
41
37
  }
@@ -45,4 +41,4 @@ interface FileUploadProgressCallBacks {
45
41
  onError: (file: File, error: Error) => void;
46
42
  }
47
43
  //#endregion
48
- export { FileMetadata, FileUploadBaseProps, FileUploadProgressCallBacks, FileUploadProps$1 as FileUploadProps, MultiFileCallbacks, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, SingleFileUploadProps, UseFileCallbacks };
44
+ export { FileMetadata, FileUploadBaseProps, FileUploadCallbacks, FileUploadProgressCallBacks, FileUploadProps$1 as FileUploadProps, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, SingleFileUploadProps };
@@ -17,16 +17,18 @@ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
17
17
  * FileUploadInline - An inline file upload component using FileUpload primitives
18
18
  */
19
19
  function FileUploadInline(props) {
20
- const { value, onChange, className, disabled = require_defaults.defaultOptions.disabled, buttonText: buttonTextProp, showIcon = require_defaults.defaultOptions.showIcon, onAccept, preventDuplicates,...rest } = props;
21
- const multiple = props.multiple ?? require_defaults.defaultOptions.multiple;
20
+ const { value, onChange, className, disabled = require_defaults.defaultOptions.disabled, buttonText: buttonTextProp, showIcon = require_defaults.defaultOptions.showIcon, onAccept, multiple: multipleProp = false, preventDuplicates,...rest } = props;
21
+ const multiple = multipleProp ?? require_defaults.defaultOptions.multiple;
22
22
  const buttonText = buttonTextProp ?? (multiple ? "Click to upload files" : "Click to upload a file");
23
23
  const dropzoneClassName = (0, __pixpilot_shadcn.cn)("rounded-md border border-input border-solid flex-row bg-background px-3 py-0 display-block w-full cursor-pointer", "hover:bg-accent/50 transition-colors m-0", disabled && "cursor-not-allowed opacity-50");
24
24
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FileUploadRoot.FileUploadRoot, {
25
25
  ...rest,
26
26
  value,
27
+ onChange,
27
28
  onAccept,
28
29
  disabled,
29
30
  multiple,
31
+ preventDuplicates,
30
32
  className: (0, __pixpilot_shadcn.cn)("space-y-2", className),
31
33
  slots: { trigger: { className: dropzoneClassName } },
32
34
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.Button, {
@@ -1,10 +1,10 @@
1
1
  import { FileUploadInlineProps } from "./types.cjs";
2
- import * as react_jsx_runtime12 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime10 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/file-upload-inline/FileUploadInline.d.ts
5
5
  /**
6
6
  * FileUploadInline - An inline file upload component using FileUpload primitives
7
7
  */
8
- declare function FileUploadInline(props: FileUploadInlineProps): react_jsx_runtime12.JSX.Element;
8
+ declare function FileUploadInline(props: FileUploadInlineProps): react_jsx_runtime10.JSX.Element;
9
9
  //#endregion
10
10
  export { FileUploadInline };
@@ -13,16 +13,18 @@ import { jsx, jsxs } from "react/jsx-runtime";
13
13
  * FileUploadInline - An inline file upload component using FileUpload primitives
14
14
  */
15
15
  function FileUploadInline(props) {
16
- const { value, onChange, className, disabled = defaultOptions.disabled, buttonText: buttonTextProp, showIcon = defaultOptions.showIcon, onAccept, preventDuplicates,...rest } = props;
17
- const multiple = props.multiple ?? defaultOptions.multiple;
16
+ const { value, onChange, className, disabled = defaultOptions.disabled, buttonText: buttonTextProp, showIcon = defaultOptions.showIcon, onAccept, multiple: multipleProp = false, preventDuplicates,...rest } = props;
17
+ const multiple = multipleProp ?? defaultOptions.multiple;
18
18
  const buttonText = buttonTextProp ?? (multiple ? "Click to upload files" : "Click to upload a file");
19
19
  const dropzoneClassName = cn("rounded-md border border-input border-solid flex-row bg-background px-3 py-0 display-block w-full cursor-pointer", "hover:bg-accent/50 transition-colors m-0", disabled && "cursor-not-allowed opacity-50");
20
20
  return /* @__PURE__ */ jsx(FileUploadRoot, {
21
21
  ...rest,
22
22
  value,
23
+ onChange,
23
24
  onAccept,
24
25
  disabled,
25
26
  multiple,
27
+ preventDuplicates,
26
28
  className: cn("space-y-2", className),
27
29
  slots: { trigger: { className: dropzoneClassName } },
28
30
  children: /* @__PURE__ */ jsxs(Button, {
@@ -17,10 +17,9 @@ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
17
17
  * FileUploadInline - An inline file upload component using FileUpload primitives
18
18
  */
19
19
  function FileUploadRoot(props) {
20
- const { value, onChange, className, disabled, children, onAccept, preventDuplicates, slots, onSuccess: singleOnSuccess, onError: singleOnError, onFileSuccess, onFileError,...rest } = props;
20
+ const { value, onChange, className, disabled, children, onAccept, maxFiles, preventDuplicates, slots, onFileSuccess, onFileError,...rest } = props;
21
21
  const multiple = props.multiple ?? false;
22
- const onSuccess = multiple ? onFileSuccess : singleOnSuccess;
23
- const onError = multiple ? onFileError : singleOnError;
22
+ const effectiveMaxFiles = multiple ? maxFiles : 1;
24
23
  const { handleAccept, displayFiles, deleteFile, getFile, orgValue } = require_use_file_upload_store.useFileUploadStore({
25
24
  value,
26
25
  onChange,
@@ -28,9 +27,14 @@ function FileUploadRoot(props) {
28
27
  preventDuplicates
29
28
  });
30
29
  const handleFileAccept = (0, react.useCallback)((files) => {
31
- onAccept?.(files);
32
- handleAccept(files);
33
- }, [handleAccept, onAccept]);
30
+ const acceptedFiles = multiple ? files : files.slice(0, 1);
31
+ onAccept?.(acceptedFiles);
32
+ handleAccept(acceptedFiles);
33
+ }, [
34
+ handleAccept,
35
+ multiple,
36
+ onAccept
37
+ ]);
34
38
  if (process.env.NODE_ENV !== "production") {
35
39
  if (!children && !(slots && slots.trigger)) throw new Error("FileUploadRoot requires children or slots.trigger to be passed in.");
36
40
  }
@@ -40,6 +44,7 @@ function FileUploadRoot(props) {
40
44
  onAccept: handleFileAccept,
41
45
  disabled,
42
46
  multiple,
47
+ maxFiles: effectiveMaxFiles,
43
48
  className: (0, __pixpilot_shadcn.cn)("space-y-2", className),
44
49
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(multiple || !multiple && displayFiles.length === 0) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.FileUploadDropzone, {
45
50
  ...slots?.dropzone || {},
@@ -60,8 +65,8 @@ function FileUploadRoot(props) {
60
65
  file: getFile(data),
61
66
  disabled,
62
67
  onDelete: deleteFile,
63
- onSuccess,
64
- onError,
68
+ onFileSuccess,
69
+ onFileError,
65
70
  ...slots?.fileItem || {}
66
71
  }, key);
67
72
  })
@@ -1,11 +1,11 @@
1
1
  import { FileUploadRootProps } from "./types.cjs";
2
- import * as react_jsx_runtime13 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime11 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/file-upload-root/FileUploadRoot.d.ts
5
5
  /**
6
6
  * FileUploadInline - An inline file upload component using FileUpload primitives
7
7
  */
8
- declare function FileUploadRoot(props: FileUploadRootProps): react_jsx_runtime13.JSX.Element;
8
+ declare function FileUploadRoot(props: FileUploadRootProps): react_jsx_runtime11.JSX.Element;
9
9
  declare namespace FileUploadRoot {
10
10
  var displayName: string;
11
11
  }
@@ -1,11 +1,11 @@
1
1
  import { FileUploadRootProps } from "./types.js";
2
- import * as react_jsx_runtime14 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime13 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/file-upload-root/FileUploadRoot.d.ts
5
5
  /**
6
6
  * FileUploadInline - An inline file upload component using FileUpload primitives
7
7
  */
8
- declare function FileUploadRoot(props: FileUploadRootProps): react_jsx_runtime14.JSX.Element;
8
+ declare function FileUploadRoot(props: FileUploadRootProps): react_jsx_runtime13.JSX.Element;
9
9
  declare namespace FileUploadRoot {
10
10
  var displayName: string;
11
11
  }
@@ -13,10 +13,9 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
13
13
  * FileUploadInline - An inline file upload component using FileUpload primitives
14
14
  */
15
15
  function FileUploadRoot(props) {
16
- const { value, onChange, className, disabled, children, onAccept, preventDuplicates, slots, onSuccess: singleOnSuccess, onError: singleOnError, onFileSuccess, onFileError,...rest } = props;
16
+ const { value, onChange, className, disabled, children, onAccept, maxFiles, preventDuplicates, slots, onFileSuccess, onFileError,...rest } = props;
17
17
  const multiple = props.multiple ?? false;
18
- const onSuccess = multiple ? onFileSuccess : singleOnSuccess;
19
- const onError = multiple ? onFileError : singleOnError;
18
+ const effectiveMaxFiles = multiple ? maxFiles : 1;
20
19
  const { handleAccept, displayFiles, deleteFile, getFile, orgValue } = useFileUploadStore({
21
20
  value,
22
21
  onChange,
@@ -24,9 +23,14 @@ function FileUploadRoot(props) {
24
23
  preventDuplicates
25
24
  });
26
25
  const handleFileAccept = useCallback((files) => {
27
- onAccept?.(files);
28
- handleAccept(files);
29
- }, [handleAccept, onAccept]);
26
+ const acceptedFiles = multiple ? files : files.slice(0, 1);
27
+ onAccept?.(acceptedFiles);
28
+ handleAccept(acceptedFiles);
29
+ }, [
30
+ handleAccept,
31
+ multiple,
32
+ onAccept
33
+ ]);
30
34
  if (!children && !(slots && slots.trigger)) throw new Error("FileUploadRoot requires children or slots.trigger to be passed in.");
31
35
  return /* @__PURE__ */ jsx(FileUpload, {
32
36
  ...rest,
@@ -34,6 +38,7 @@ function FileUploadRoot(props) {
34
38
  onAccept: handleFileAccept,
35
39
  disabled,
36
40
  multiple,
41
+ maxFiles: effectiveMaxFiles,
37
42
  className: cn("space-y-2", className),
38
43
  children: /* @__PURE__ */ jsxs(Fragment, { children: [(multiple || !multiple && displayFiles.length === 0) && /* @__PURE__ */ jsx(FileUploadDropzone, {
39
44
  ...slots?.dropzone || {},
@@ -54,8 +59,8 @@ function FileUploadRoot(props) {
54
59
  file: getFile(data),
55
60
  disabled,
56
61
  onDelete: deleteFile,
57
- onSuccess,
58
- onError,
62
+ onFileSuccess,
63
+ onFileError,
59
64
  ...slots?.fileItem || {}
60
65
  }, key);
61
66
  })
@@ -55,10 +55,10 @@ const FileItemInnerWrapper = ({ children }) => {
55
55
  children
56
56
  });
57
57
  };
58
- const FileUploadRootItem = react.default.memo(({ file, name = "", size = 0, type = "", lastModified = 0, disabled = false, onDelete, onError, onSuccess }) => {
58
+ const FileUploadRootItem = react.default.memo(({ file, name = "", size = 0, type = "", lastModified = 0, disabled = false, onDelete, onFileError, onFileSuccess }) => {
59
59
  require_use_file_upload_progress_callbacks.useFileUploadProgressCallbacks(file, {
60
- onSuccess,
61
- onError
60
+ onFileSuccess,
61
+ onFileError
62
62
  });
63
63
  const fileError = require_use_file_error.useFileError(file);
64
64
  const isUploading = (0, __pixpilot_shadcn.useFileUpload)((store) => {
@@ -1,9 +1,9 @@
1
- import { FileMetadata, UseFileCallbacks } from "../file-upload/types/index.cjs";
1
+ import { FileMetadata, FileUploadCallbacks } from "../file-upload/types/index.cjs";
2
2
  import { FileWithMetadata } from "../file-upload/utils/merge-file-metadata.cjs";
3
3
  import React from "react";
4
4
 
5
5
  //#region src/file-upload-root/FileUploadRootItem.d.ts
6
- interface FileUploadRootItemProps extends Partial<FileMetadata>, UseFileCallbacks {
6
+ interface FileUploadRootItemProps extends Partial<FileMetadata>, FileUploadCallbacks {
7
7
  file: File;
8
8
  disabled?: boolean;
9
9
  onDelete: (file: FileWithMetadata) => void;
@@ -1,10 +1,10 @@
1
- import { FileMetadata, UseFileCallbacks } from "../file-upload/types/index.js";
1
+ import { FileMetadata, FileUploadCallbacks } from "../file-upload/types/index.js";
2
2
  import { FileWithMetadata } from "../file-upload/utils/merge-file-metadata.js";
3
3
  import "../file-upload/utils/index.js";
4
4
  import React from "react";
5
5
 
6
6
  //#region src/file-upload-root/FileUploadRootItem.d.ts
7
- interface FileUploadRootItemProps extends Partial<FileMetadata>, UseFileCallbacks {
7
+ interface FileUploadRootItemProps extends Partial<FileMetadata>, FileUploadCallbacks {
8
8
  file: File;
9
9
  disabled?: boolean;
10
10
  onDelete: (file: FileWithMetadata) => void;
@@ -49,10 +49,10 @@ const FileItemInnerWrapper = ({ children }) => {
49
49
  children
50
50
  });
51
51
  };
52
- const FileUploadRootItem = React.memo(({ file, name = "", size = 0, type = "", lastModified = 0, disabled = false, onDelete, onError, onSuccess }) => {
52
+ const FileUploadRootItem = React.memo(({ file, name = "", size = 0, type = "", lastModified = 0, disabled = false, onDelete, onFileError, onFileSuccess }) => {
53
53
  useFileUploadProgressCallbacks(file, {
54
- onSuccess,
55
- onError
54
+ onFileSuccess,
55
+ onFileError
56
56
  });
57
57
  const fileError = useFileError(file);
58
58
  const isUploading = useFileUpload((store) => {
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { FileMetadata, FileUploadBaseProps, FileUploadProgressCallBacks, FileUploadProps, MultiFileCallbacks, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, SingleFileUploadProps, UseFileCallbacks } from "./file-upload/types/index.cjs";
1
+ import { FileMetadata, FileUploadBaseProps, FileUploadCallbacks, FileUploadProgressCallBacks, FileUploadProps, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, SingleFileUploadProps } from "./file-upload/types/index.cjs";
2
2
  import { FileUpload } from "./file-upload/FileUpload.cjs";
3
3
  import "./file-upload/index.cjs";
4
4
  import { AbsoluteFill } from "./AbsoluteFill.cjs";
@@ -100,4 +100,4 @@ import "./toast/index.cjs";
100
100
  import { ToggleGroup, ToggleGroupItem, ToggleGroupItemProps, ToggleGroupProps, ToggleGroupValue } from "./ToggleGroup.cjs";
101
101
  import { isSvgMarkupString, svgMarkupToMaskUrl } from "./utils/svg.cjs";
102
102
  import { cn } from "@pixpilot/shadcn";
103
- export { AbsoluteFill, Alert, AlertBaseProps, AlertProps, AlertToastProps, AlertVariant, AvatarUpload, AvatarUploadProps, BaseTabsTriggerProps, Button, ButtonExtended, ButtonExtendedLoaderProps, ButtonExtendedProps, ButtonGroup, ButtonGroupProps, ButtonGroupSeparator, ButtonGroupText, ButtonProps, COLOR_PICKER_PALETTE_BUTTON_CLASSES, COMMON_COLORS, CircleLoader, CircleLoaderProps, CloseButtonAbsolute, CloseButtonRounded, CloseButtonRoundedProps, ColorPicker, ColorPickerAlphaSlider, ColorPickerArea, ColorPickerBase, ColorPickerBaseProps, ColorPickerBaseSection, ColorPickerButton, ColorPickerButtonProps, ColorPickerColorPalette, ColorPickerColorPaletteProps, ColorPickerCompactControls, ColorPickerCompactControlsProps, ColorPickerContent, ColorPickerContext, Consumer as ColorPickerContextContextConsumer, Provider as ColorPickerContextContextProvider, ColorPickerContextStates, ColorPickerControls, ColorPickerControlsProps, ColorPickerEyeDropper, ColorPickerFormatControls, ColorPickerFormatControlsProps, ColorPickerFormatInput, ColorPickerFormatInputProps, ColorPickerFormatSelect, ColorPickerFullControls, ColorPickerFullControlsProps, ColorPickerHueSlider, ColorPickerInput, ColorPickerInputProps, ColorPickerPaletteButton, ColorPickerPaletteButtonProps, ColorPickerPaletteSwatch, ColorPickerProps, ColorPickerRoot, ColorPickerRootProps, ColorSelect, ColorSelectOption, BaseColorSelectProps as ColorSelectProps, Combobox, ConfirmationDialogProps, ContentCard, DEFAULT_ALERT_DURATION, DatePicker, DatePickerProps, Dialog, DialogBody, DialogClose, DialogContent, DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogProvider, DialogProviderProps, DialogTitle, DialogTrigger, type FileMetadata, FileUpload, FileUploadBaseProps, FileUploadInline, FileUploadInlineBaseProps, FileUploadInlineProps, type FileUploadProgressCallBacks, type FileUploadProps, FileUploadRoot, FileUploadRootItem, FileUploadRootItemProps, FileUploadRootProps, FileUploadRootPropsBaseProps, IconPicker, IconPickerProps, IconPickerVariant, IconProvider, IconProviderLoader, IconProviderProps, IconToggle, IconToggleProps, Input, InputProps, Layout, LayoutFooter, LayoutFooterProps, LayoutHeader, LayoutHeaderProps, LayoutMain, LayoutMainProps, LayoutProps, LoadingOverlay, LoadingOverlayProps, MultiFileCallbacks, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, Pagination, PaginationProps, Popover, PopoverAnchor, PopoverCloseButtonProps, PopoverContent, PopoverContentProps, PopoverContentUnstyled, PopoverTrigger, PresetColor, Rating, RatingButton, RatingButtonProps, RatingColor, RatingOption, RatingProps, RichTextEditor, RichTextEditorProps, RichTextEditorSlots, ScaledPreview, ScaledPreviewProps, ScaledPreviewSize, Select, SelectContentProps, SelectOption, SingleFileUploadProps, Slider, SliderInput, SliderInputProps, SliderProps, SliderSelect, SliderSelectOption, SliderSelectProps, SliderSelectValue, Tabs, TabsContent, TabsContext, TabsContextValue, TabsList, TabsListProps, TabsTrigger, TabsTriggerProps, TabsVariant, TagsInput, TagsInputInline, TagsInputInlineItem, TagsInputInlineProps, TagsInputProps, ThemeModeDropdown, ThemeModeDropdownProps, ThemeModeSwitchInside, ThemeModeSwitchInsideProps, ThemeModeSwitchInsideSize, ThemeModeSwitchOutside, ThemeModeSwitchOutsideProps, ThemeModeToggleButton, ThemeModeToggleButtonProps, ThemeProvider, ThemeProviderProps, ToastFunction, ToastMessage, Toaster, ToggleButton, ToggleButtonProps, ToggleGroup, ToggleGroupItem, ToggleGroupItemProps, ToggleGroupProps, ToggleGroupValue, ToolbarItems, UseFileCallbacks, cn, isSvgMarkupString, showConfirmDialog, svgMarkupToMaskUrl, toast, useColorPickerContext, useMediaQuery, useSelectKeyboard, useTabsContext, useTheme };
103
+ export { AbsoluteFill, Alert, AlertBaseProps, AlertProps, AlertToastProps, AlertVariant, AvatarUpload, AvatarUploadProps, BaseTabsTriggerProps, Button, ButtonExtended, ButtonExtendedLoaderProps, ButtonExtendedProps, ButtonGroup, ButtonGroupProps, ButtonGroupSeparator, ButtonGroupText, ButtonProps, COLOR_PICKER_PALETTE_BUTTON_CLASSES, COMMON_COLORS, CircleLoader, CircleLoaderProps, CloseButtonAbsolute, CloseButtonRounded, CloseButtonRoundedProps, ColorPicker, ColorPickerAlphaSlider, ColorPickerArea, ColorPickerBase, ColorPickerBaseProps, ColorPickerBaseSection, ColorPickerButton, ColorPickerButtonProps, ColorPickerColorPalette, ColorPickerColorPaletteProps, ColorPickerCompactControls, ColorPickerCompactControlsProps, ColorPickerContent, ColorPickerContext, Consumer as ColorPickerContextContextConsumer, Provider as ColorPickerContextContextProvider, ColorPickerContextStates, ColorPickerControls, ColorPickerControlsProps, ColorPickerEyeDropper, ColorPickerFormatControls, ColorPickerFormatControlsProps, ColorPickerFormatInput, ColorPickerFormatInputProps, ColorPickerFormatSelect, ColorPickerFullControls, ColorPickerFullControlsProps, ColorPickerHueSlider, ColorPickerInput, ColorPickerInputProps, ColorPickerPaletteButton, ColorPickerPaletteButtonProps, ColorPickerPaletteSwatch, ColorPickerProps, ColorPickerRoot, ColorPickerRootProps, ColorSelect, ColorSelectOption, BaseColorSelectProps as ColorSelectProps, Combobox, ConfirmationDialogProps, ContentCard, DEFAULT_ALERT_DURATION, DatePicker, DatePickerProps, Dialog, DialogBody, DialogClose, DialogContent, DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogProvider, DialogProviderProps, DialogTitle, DialogTrigger, type FileMetadata, FileUpload, FileUploadBaseProps, FileUploadCallbacks, FileUploadInline, FileUploadInlineBaseProps, FileUploadInlineProps, type FileUploadProgressCallBacks, type FileUploadProps, FileUploadRoot, FileUploadRootItem, FileUploadRootItemProps, FileUploadRootProps, FileUploadRootPropsBaseProps, IconPicker, IconPickerProps, IconPickerVariant, IconProvider, IconProviderLoader, IconProviderProps, IconToggle, IconToggleProps, Input, InputProps, Layout, LayoutFooter, LayoutFooterProps, LayoutHeader, LayoutHeaderProps, LayoutMain, LayoutMainProps, LayoutProps, LoadingOverlay, LoadingOverlayProps, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, Pagination, PaginationProps, Popover, PopoverAnchor, PopoverCloseButtonProps, PopoverContent, PopoverContentProps, PopoverContentUnstyled, PopoverTrigger, PresetColor, Rating, RatingButton, RatingButtonProps, RatingColor, RatingOption, RatingProps, RichTextEditor, RichTextEditorProps, RichTextEditorSlots, ScaledPreview, ScaledPreviewProps, ScaledPreviewSize, Select, SelectContentProps, SelectOption, SingleFileUploadProps, Slider, SliderInput, SliderInputProps, SliderProps, SliderSelect, SliderSelectOption, SliderSelectProps, SliderSelectValue, Tabs, TabsContent, TabsContext, TabsContextValue, TabsList, TabsListProps, TabsTrigger, TabsTriggerProps, TabsVariant, TagsInput, TagsInputInline, TagsInputInlineItem, TagsInputInlineProps, TagsInputProps, ThemeModeDropdown, ThemeModeDropdownProps, ThemeModeSwitchInside, ThemeModeSwitchInsideProps, ThemeModeSwitchInsideSize, ThemeModeSwitchOutside, ThemeModeSwitchOutsideProps, ThemeModeToggleButton, ThemeModeToggleButtonProps, ThemeProvider, ThemeProviderProps, ToastFunction, ToastMessage, Toaster, ToggleButton, ToggleButtonProps, ToggleGroup, ToggleGroupItem, ToggleGroupItemProps, ToggleGroupProps, ToggleGroupValue, ToolbarItems, cn, isSvgMarkupString, showConfirmDialog, svgMarkupToMaskUrl, toast, useColorPickerContext, useMediaQuery, useSelectKeyboard, useTabsContext, useTheme };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { FileMetadata, FileUploadBaseProps, FileUploadProgressCallBacks, FileUploadProps, MultiFileCallbacks, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, SingleFileUploadProps, UseFileCallbacks } from "./file-upload/types/index.js";
1
+ import { FileMetadata, FileUploadBaseProps, FileUploadCallbacks, FileUploadProgressCallBacks, FileUploadProps, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, SingleFileUploadProps } from "./file-upload/types/index.js";
2
2
  import { FileUpload } from "./file-upload/FileUpload.js";
3
3
  import "./file-upload/index.js";
4
4
  import { AbsoluteFill } from "./AbsoluteFill.js";
@@ -100,4 +100,4 @@ import "./toast/index.js";
100
100
  import { ToggleGroup, ToggleGroupItem, ToggleGroupItemProps, ToggleGroupProps, ToggleGroupValue } from "./ToggleGroup.js";
101
101
  import { isSvgMarkupString, svgMarkupToMaskUrl } from "./utils/svg.js";
102
102
  import { cn } from "@pixpilot/shadcn";
103
- export { AbsoluteFill, Alert, AlertBaseProps, AlertProps, AlertToastProps, AlertVariant, AvatarUpload, AvatarUploadProps, BaseTabsTriggerProps, Button, ButtonExtended, ButtonExtendedLoaderProps, ButtonExtendedProps, ButtonGroup, ButtonGroupProps, ButtonGroupSeparator, ButtonGroupText, ButtonProps, COLOR_PICKER_PALETTE_BUTTON_CLASSES, COMMON_COLORS, CircleLoader, CircleLoaderProps, CloseButtonAbsolute, CloseButtonRounded, CloseButtonRoundedProps, ColorPicker, ColorPickerAlphaSlider, ColorPickerArea, ColorPickerBase, ColorPickerBaseProps, ColorPickerBaseSection, ColorPickerButton, ColorPickerButtonProps, ColorPickerColorPalette, ColorPickerColorPaletteProps, ColorPickerCompactControls, ColorPickerCompactControlsProps, ColorPickerContent, ColorPickerContext, Consumer as ColorPickerContextContextConsumer, Provider as ColorPickerContextContextProvider, ColorPickerContextStates, ColorPickerControls, ColorPickerControlsProps, ColorPickerEyeDropper, ColorPickerFormatControls, ColorPickerFormatControlsProps, ColorPickerFormatInput, ColorPickerFormatInputProps, ColorPickerFormatSelect, ColorPickerFullControls, ColorPickerFullControlsProps, ColorPickerHueSlider, ColorPickerInput, ColorPickerInputProps, ColorPickerPaletteButton, ColorPickerPaletteButtonProps, ColorPickerPaletteSwatch, ColorPickerProps, ColorPickerRoot, ColorPickerRootProps, ColorSelect, ColorSelectOption, BaseColorSelectProps as ColorSelectProps, Combobox, ConfirmationDialogProps, ContentCard, DEFAULT_ALERT_DURATION, DatePicker, DatePickerProps, Dialog, DialogBody, DialogClose, DialogContent, DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogProvider, DialogProviderProps, DialogTitle, DialogTrigger, type FileMetadata, FileUpload, FileUploadBaseProps, FileUploadInline, FileUploadInlineBaseProps, FileUploadInlineProps, type FileUploadProgressCallBacks, type FileUploadProps, FileUploadRoot, FileUploadRootItem, FileUploadRootItemProps, FileUploadRootProps, FileUploadRootPropsBaseProps, IconPicker, IconPickerProps, IconPickerVariant, IconProvider, IconProviderLoader, IconProviderProps, IconToggle, IconToggleProps, Input, InputProps, Layout, LayoutFooter, LayoutFooterProps, LayoutHeader, LayoutHeaderProps, LayoutMain, LayoutMainProps, LayoutProps, LoadingOverlay, LoadingOverlayProps, MultiFileCallbacks, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, Pagination, PaginationProps, Popover, PopoverAnchor, PopoverCloseButtonProps, PopoverContent, PopoverContentProps, PopoverContentUnstyled, PopoverTrigger, PresetColor, Rating, RatingButton, RatingButtonProps, RatingColor, RatingOption, RatingProps, RichTextEditor, RichTextEditorProps, RichTextEditorSlots, ScaledPreview, ScaledPreviewProps, ScaledPreviewSize, Select, SelectContentProps, SelectOption, SingleFileUploadProps, Slider, SliderInput, SliderInputProps, SliderProps, SliderSelect, SliderSelectOption, SliderSelectProps, SliderSelectValue, Tabs, TabsContent, TabsContext, TabsContextValue, TabsList, TabsListProps, TabsTrigger, TabsTriggerProps, TabsVariant, TagsInput, TagsInputInline, TagsInputInlineItem, TagsInputInlineProps, TagsInputProps, ThemeModeDropdown, ThemeModeDropdownProps, ThemeModeSwitchInside, ThemeModeSwitchInsideProps, ThemeModeSwitchInsideSize, ThemeModeSwitchOutside, ThemeModeSwitchOutsideProps, ThemeModeToggleButton, ThemeModeToggleButtonProps, ThemeProvider, ThemeProviderProps, ToastFunction, ToastMessage, Toaster, ToggleButton, ToggleButtonProps, ToggleGroup, ToggleGroupItem, ToggleGroupItemProps, ToggleGroupProps, ToggleGroupValue, ToolbarItems, UseFileCallbacks, cn, isSvgMarkupString, showConfirmDialog, svgMarkupToMaskUrl, toast, useColorPickerContext, useMediaQuery, useSelectKeyboard, useTabsContext, useTheme };
103
+ export { AbsoluteFill, Alert, AlertBaseProps, AlertProps, AlertToastProps, AlertVariant, AvatarUpload, AvatarUploadProps, BaseTabsTriggerProps, Button, ButtonExtended, ButtonExtendedLoaderProps, ButtonExtendedProps, ButtonGroup, ButtonGroupProps, ButtonGroupSeparator, ButtonGroupText, ButtonProps, COLOR_PICKER_PALETTE_BUTTON_CLASSES, COMMON_COLORS, CircleLoader, CircleLoaderProps, CloseButtonAbsolute, CloseButtonRounded, CloseButtonRoundedProps, ColorPicker, ColorPickerAlphaSlider, ColorPickerArea, ColorPickerBase, ColorPickerBaseProps, ColorPickerBaseSection, ColorPickerButton, ColorPickerButtonProps, ColorPickerColorPalette, ColorPickerColorPaletteProps, ColorPickerCompactControls, ColorPickerCompactControlsProps, ColorPickerContent, ColorPickerContext, Consumer as ColorPickerContextContextConsumer, Provider as ColorPickerContextContextProvider, ColorPickerContextStates, ColorPickerControls, ColorPickerControlsProps, ColorPickerEyeDropper, ColorPickerFormatControls, ColorPickerFormatControlsProps, ColorPickerFormatInput, ColorPickerFormatInputProps, ColorPickerFormatSelect, ColorPickerFullControls, ColorPickerFullControlsProps, ColorPickerHueSlider, ColorPickerInput, ColorPickerInputProps, ColorPickerPaletteButton, ColorPickerPaletteButtonProps, ColorPickerPaletteSwatch, ColorPickerProps, ColorPickerRoot, ColorPickerRootProps, ColorSelect, ColorSelectOption, BaseColorSelectProps as ColorSelectProps, Combobox, ConfirmationDialogProps, ContentCard, DEFAULT_ALERT_DURATION, DatePicker, DatePickerProps, Dialog, DialogBody, DialogClose, DialogContent, DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogProvider, DialogProviderProps, DialogTitle, DialogTrigger, type FileMetadata, FileUpload, FileUploadBaseProps, FileUploadCallbacks, FileUploadInline, FileUploadInlineBaseProps, FileUploadInlineProps, type FileUploadProgressCallBacks, type FileUploadProps, FileUploadRoot, FileUploadRootItem, FileUploadRootItemProps, FileUploadRootProps, FileUploadRootPropsBaseProps, IconPicker, IconPickerProps, IconPickerVariant, IconProvider, IconProviderLoader, IconProviderProps, IconToggle, IconToggleProps, Input, InputProps, Layout, LayoutFooter, LayoutFooterProps, LayoutHeader, LayoutHeaderProps, LayoutMain, LayoutMainProps, LayoutProps, LoadingOverlay, LoadingOverlayProps, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, Pagination, PaginationProps, Popover, PopoverAnchor, PopoverCloseButtonProps, PopoverContent, PopoverContentProps, PopoverContentUnstyled, PopoverTrigger, PresetColor, Rating, RatingButton, RatingButtonProps, RatingColor, RatingOption, RatingProps, RichTextEditor, RichTextEditorProps, RichTextEditorSlots, ScaledPreview, ScaledPreviewProps, ScaledPreviewSize, Select, SelectContentProps, SelectOption, SingleFileUploadProps, Slider, SliderInput, SliderInputProps, SliderProps, SliderSelect, SliderSelectOption, SliderSelectProps, SliderSelectValue, Tabs, TabsContent, TabsContext, TabsContextValue, TabsList, TabsListProps, TabsTrigger, TabsTriggerProps, TabsVariant, TagsInput, TagsInputInline, TagsInputInlineItem, TagsInputInlineProps, TagsInputProps, ThemeModeDropdown, ThemeModeDropdownProps, ThemeModeSwitchInside, ThemeModeSwitchInsideProps, ThemeModeSwitchInsideSize, ThemeModeSwitchOutside, ThemeModeSwitchOutsideProps, ThemeModeToggleButton, ThemeModeToggleButtonProps, ThemeProvider, ThemeProviderProps, ToastFunction, ToastMessage, Toaster, ToggleButton, ToggleButtonProps, ToggleGroup, ToggleGroupItem, ToggleGroupItemProps, ToggleGroupProps, ToggleGroupValue, ToolbarItems, cn, isSvgMarkupString, showConfirmDialog, svgMarkupToMaskUrl, toast, useColorPickerContext, useMediaQuery, useSelectKeyboard, useTabsContext, useTheme };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime14 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime9 from "react/jsx-runtime";
2
2
  import { InputProps } from "@pixpilot/shadcn";
3
3
  import * as React$1 from "react";
4
4
 
@@ -10,6 +10,6 @@ type InputProps$1 = InputProps & {
10
10
  prefixClassName?: string;
11
11
  suffixClassName?: string;
12
12
  };
13
- declare function Input(props: InputProps$1): react_jsx_runtime14.JSX.Element;
13
+ declare function Input(props: InputProps$1): react_jsx_runtime9.JSX.Element;
14
14
  //#endregion
15
15
  export { Input, InputProps$1 as InputProps };
@@ -1,6 +1,6 @@
1
1
  import { InputProps } from "@pixpilot/shadcn";
2
2
  import * as React$1 from "react";
3
- import * as react_jsx_runtime13 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime14 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/input/Input.d.ts
6
6
  type InputProps$1 = InputProps & {
@@ -10,6 +10,6 @@ type InputProps$1 = InputProps & {
10
10
  prefixClassName?: string;
11
11
  suffixClassName?: string;
12
12
  };
13
- declare function Input$1(props: InputProps$1): react_jsx_runtime13.JSX.Element;
13
+ declare function Input$1(props: InputProps$1): react_jsx_runtime14.JSX.Element;
14
14
  //#endregion
15
15
  export { Input$1 as Input, InputProps$1 as InputProps };
@@ -1,5 +1,5 @@
1
1
  import { CommandOptionListItem } from "../CommandOptionList.cjs";
2
- import * as react_jsx_runtime19 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime13 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/tags-input/TagsInput.d.ts
5
5
  interface TagsInputProps {
@@ -57,6 +57,6 @@ declare function TagsInput({
57
57
  addOnTab,
58
58
  onValidate,
59
59
  addButtonVisibility
60
- }: TagsInputProps): react_jsx_runtime19.JSX.Element;
60
+ }: TagsInputProps): react_jsx_runtime13.JSX.Element;
61
61
  //#endregion
62
62
  export { TagsInput, TagsInputProps };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime20 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime12 from "react/jsx-runtime";
2
2
  import { ChangeEventHandler, FocusEventHandler, KeyboardEventHandler, MouseEventHandler, Ref } from "react";
3
3
 
4
4
  //#region src/tags-input/TagsInputInline.d.ts
@@ -75,6 +75,6 @@ declare function TagsInputInline({
75
75
  canAddCurrentValue,
76
76
  onAddCurrentInput,
77
77
  showClear
78
- }: TagsInputInlineProps): react_jsx_runtime20.JSX.Element;
78
+ }: TagsInputInlineProps): react_jsx_runtime12.JSX.Element;
79
79
  //#endregion
80
80
  export { TagsInputInline, TagsInputInlineItem, TagsInputInlineProps };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime15 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime14 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/theme-toggle/ThemeModeDropdown.d.ts
4
4
  interface ThemeModeDropdownProps {
@@ -17,7 +17,7 @@ interface ThemeModeDropdownProps {
17
17
  * Provides Light / Dark / System options.
18
18
  * Pure component - requires themeValue and onChange props.
19
19
  */
20
- declare function ThemeModeDropdown(props: ThemeModeDropdownProps): react_jsx_runtime15.JSX.Element;
20
+ declare function ThemeModeDropdown(props: ThemeModeDropdownProps): react_jsx_runtime14.JSX.Element;
21
21
  declare namespace ThemeModeDropdown {
22
22
  var displayName: string;
23
23
  }
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime17 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime15 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/theme-toggle/ThemeModeSwitchInside.d.ts
4
4
  type ThemeModeSwitchInsideSize = 'sm' | 'md' | 'lg';
@@ -25,7 +25,7 @@ interface ThemeModeSwitchInsideProps {
25
25
  * Icons are embedded within the switch control.
26
26
  * Pure component - requires value and onChange props.
27
27
  */
28
- declare function ThemeModeSwitchInside(props: ThemeModeSwitchInsideProps): react_jsx_runtime17.JSX.Element;
28
+ declare function ThemeModeSwitchInside(props: ThemeModeSwitchInsideProps): react_jsx_runtime15.JSX.Element;
29
29
  declare namespace ThemeModeSwitchInside {
30
30
  var displayName: string;
31
31
  }
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime18 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime17 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/theme-toggle/ThemeModeSwitchOutside.d.ts
4
4
  interface ThemeModeSwitchOutsideProps {
@@ -22,7 +22,7 @@ interface ThemeModeSwitchOutsideProps {
22
22
  * Icons flank the switch control on either side.
23
23
  * Pure component - requires value and onChange props.
24
24
  */
25
- declare function ThemeModeSwitchOutside(props: ThemeModeSwitchOutsideProps): react_jsx_runtime18.JSX.Element;
25
+ declare function ThemeModeSwitchOutside(props: ThemeModeSwitchOutsideProps): react_jsx_runtime17.JSX.Element;
26
26
  declare namespace ThemeModeSwitchOutside {
27
27
  var displayName: string;
28
28
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pixpilot/shadcn-ui",
3
3
  "type": "module",
4
- "version": "1.7.0",
4
+ "version": "1.9.0",
5
5
  "description": "Custom UI components and utilities built with shadcn/ui.",
6
6
  "author": "m.doaie <m.doaie@hotmail.com>",
7
7
  "license": "MIT",