@pixpilot/shadcn-ui 1.6.0 → 1.7.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 (47) hide show
  1. package/dist/Rating.d.cts +4 -4
  2. package/dist/Rating.d.ts +1 -1
  3. package/dist/Select.d.cts +2 -2
  4. package/dist/avatar-upload/AvatarUpload.cjs +2 -2
  5. package/dist/avatar-upload/AvatarUpload.js +2 -2
  6. package/dist/avatar-upload/AvatarUploadItem.cjs +2 -2
  7. package/dist/avatar-upload/AvatarUploadItem.js +2 -2
  8. package/dist/dialog/Dialog.d.cts +4 -4
  9. package/dist/dialog/Dialog.d.ts +4 -4
  10. package/dist/file-upload/FileUpload.cjs +8 -3
  11. package/dist/file-upload/FileUpload.d.cts +2 -2
  12. package/dist/file-upload/FileUpload.d.ts +2 -2
  13. package/dist/file-upload/FileUpload.js +8 -3
  14. package/dist/file-upload/FileUploadItems.cjs +4 -2
  15. package/dist/file-upload/FileUploadItems.js +4 -2
  16. package/dist/file-upload/FileUploadListItem.cjs +7 -1
  17. package/dist/file-upload/FileUploadListItem.js +7 -1
  18. package/dist/file-upload/hooks/index.cjs +1 -1
  19. package/dist/file-upload/hooks/index.js +1 -1
  20. package/dist/file-upload/hooks/use-file-upload-progress-callbacks.cjs +3 -3
  21. package/dist/file-upload/hooks/use-file-upload-progress-callbacks.js +3 -3
  22. package/dist/file-upload/index.cjs +2 -2
  23. package/dist/file-upload/index.d.cts +1 -1
  24. package/dist/file-upload/index.d.ts +1 -1
  25. package/dist/file-upload/index.js +2 -2
  26. package/dist/file-upload/types/index.d.cts +14 -7
  27. package/dist/file-upload/types/index.d.ts +14 -7
  28. package/dist/file-upload-inline/FileUploadInline.d.cts +2 -2
  29. package/dist/file-upload-root/FileUploadRoot.cjs +5 -1
  30. package/dist/file-upload-root/FileUploadRoot.d.cts +2 -2
  31. package/dist/file-upload-root/FileUploadRoot.d.ts +2 -2
  32. package/dist/file-upload-root/FileUploadRoot.js +5 -1
  33. package/dist/file-upload-root/FileUploadRootItem.cjs +2 -2
  34. package/dist/file-upload-root/FileUploadRootItem.d.cts +2 -3
  35. package/dist/file-upload-root/FileUploadRootItem.d.ts +2 -3
  36. package/dist/file-upload-root/FileUploadRootItem.js +2 -2
  37. package/dist/index.d.cts +2 -2
  38. package/dist/index.d.ts +2 -2
  39. package/dist/input/Input.d.cts +2 -2
  40. package/dist/input/Input.d.ts +2 -2
  41. package/dist/tags-input/TagsInput.d.cts +2 -2
  42. package/dist/tags-input/TagsInputInline.d.cts +2 -2
  43. package/dist/theme-toggle/ThemeModeDropdown.d.cts +2 -2
  44. package/dist/theme-toggle/ThemeModeSwitchInside.d.cts +2 -2
  45. package/dist/theme-toggle/ThemeModeSwitchOutside.d.cts +2 -2
  46. package/dist/theme-toggle/ThemeModeToggleButton.d.cts +2 -2
  47. package/package.json +2 -2
package/dist/Rating.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime5 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime6 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";
@@ -10,7 +10,7 @@ interface RatingOption {
10
10
  value: number;
11
11
  }
12
12
  declare const ratingVariants: (props?: ({
13
- size?: "sm" | "default" | "lg" | "xl" | null | undefined;
13
+ size?: "default" | "sm" | "lg" | "xl" | null | undefined;
14
14
  } & class_variance_authority_types0.ClassProp) | undefined) => string;
15
15
  type RatingSize = VariantProps<typeof ratingVariants>['size'];
16
16
  type IconType = 'star' | 'circle';
@@ -35,7 +35,7 @@ declare function RatingButton({
35
35
  index,
36
36
  className,
37
37
  ...props
38
- }: RatingButtonProps): react_jsx_runtime5.JSX.Element;
38
+ }: RatingButtonProps): react_jsx_runtime6.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_runtime5.JSX.Element;
55
+ }: React$1.PropsWithChildren<RatingProps>): react_jsx_runtime6.JSX.Element;
56
56
  //#endregion
57
57
  export { Rating, RatingButton, RatingButtonProps, RatingColor, RatingOption, RatingProps };
package/dist/Rating.d.ts CHANGED
@@ -10,7 +10,7 @@ interface RatingOption {
10
10
  value: number;
11
11
  }
12
12
  declare const ratingVariants: (props?: ({
13
- size?: "sm" | "default" | "lg" | "xl" | null | undefined;
13
+ size?: "default" | "sm" | "lg" | "xl" | null | undefined;
14
14
  } & class_variance_authority_types0.ClassProp) | undefined) => string;
15
15
  type RatingSize = VariantProps<typeof ratingVariants>['size'];
16
16
  type IconType = 'star' | 'circle';
package/dist/Select.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime7 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime5 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_runtime7.JSX.Element;
49
+ declare function Select$1(props: BaseSelectProps): react_jsx_runtime5.JSX.Element;
50
50
  //#endregion
51
51
  export { Select$1 as Select, SelectContentProps, SelectOption };
@@ -33,7 +33,7 @@ const sizeClasses = {
33
33
  }
34
34
  };
35
35
  const AvatarUpload = (props) => {
36
- const { className, messages, value, onAccept, onChange, onError, size = "md",...rest } = props;
36
+ const { className, messages, value, onAccept, onSuccess, onError, size = "md",...rest } = props;
37
37
  const { upload = "Upload", change = "Change" } = messages || {};
38
38
  const currentSize = sizeClasses[size];
39
39
  const [files, setFiles] = react.default.useState([]);
@@ -60,7 +60,7 @@ const AvatarUpload = (props) => {
60
60
  index: i,
61
61
  currentSize,
62
62
  change,
63
- onChange,
63
+ onSuccess,
64
64
  onError
65
65
  }, id)) }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_AvatarUploadComponents.MainWrapper, {
66
66
  currentSize,
@@ -28,7 +28,7 @@ const sizeClasses = {
28
28
  }
29
29
  };
30
30
  const AvatarUpload = (props) => {
31
- const { className, messages, value, onAccept, onChange, onError, size = "md",...rest } = props;
31
+ const { className, messages, value, onAccept, onSuccess, onError, size = "md",...rest } = props;
32
32
  const { upload = "Upload", change = "Change" } = messages || {};
33
33
  const currentSize = sizeClasses[size];
34
34
  const [files, setFiles] = React.useState([]);
@@ -55,7 +55,7 @@ const AvatarUpload = (props) => {
55
55
  index: i,
56
56
  currentSize,
57
57
  change,
58
- onChange,
58
+ onSuccess,
59
59
  onError
60
60
  }, id)) }) : /* @__PURE__ */ jsxs(MainWrapper, {
61
61
  currentSize,
@@ -12,9 +12,9 @@ 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, onChange, onError } = props;
15
+ const { file, currentSize, change, onSuccess, onError } = props;
16
16
  require_use_file_upload_progress_callbacks.useFileUploadProgressCallbacks(file, {
17
- onChange,
17
+ onSuccess,
18
18
  onError
19
19
  });
20
20
  const fileError = require_use_file_error.useFileError(file);
@@ -8,9 +8,9 @@ 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, onChange, onError } = props;
11
+ const { file, currentSize, change, onSuccess, onError } = props;
12
12
  useFileUploadProgressCallbacks(file, {
13
- onChange,
13
+ onSuccess,
14
14
  onError
15
15
  });
16
16
  const fileError = useFileError(file);
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime17 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime9 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_runtime17.JSX.Element;
16
+ }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime9.JSX.Element;
17
17
  declare function DialogBody({
18
18
  className,
19
19
  ...props
20
- }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime17.JSX.Element;
20
+ }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime9.JSX.Element;
21
21
  declare function DialogFooter({
22
22
  className,
23
23
  ...props
24
- }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime17.JSX.Element;
24
+ }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime9.JSX.Element;
25
25
  //#endregion
26
26
  export { DialogBody, DialogContent$1 as DialogContent, DialogContentProps, DialogFooter, DialogHeader };
@@ -1,6 +1,6 @@
1
1
  import { DialogContent } from "@pixpilot/shadcn";
2
2
  import * as React$1 from "react";
3
- import * as react_jsx_runtime8 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime9 from "react/jsx-runtime";
4
4
  import * as _radix_ui_react_dialog0 from "@radix-ui/react-dialog";
5
5
 
6
6
  //#region src/dialog/Dialog.d.ts
@@ -13,14 +13,14 @@ declare const DialogContent$1: React$1.ForwardRefExoticComponent<Omit<_radix_ui_
13
13
  declare function DialogHeader$1({
14
14
  className,
15
15
  ...props
16
- }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime8.JSX.Element;
16
+ }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime9.JSX.Element;
17
17
  declare function DialogBody({
18
18
  className,
19
19
  ...props
20
- }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime8.JSX.Element;
20
+ }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime9.JSX.Element;
21
21
  declare function DialogFooter$1({
22
22
  className,
23
23
  ...props
24
- }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime8.JSX.Element;
24
+ }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime9.JSX.Element;
25
25
  //#endregion
26
26
  export { DialogBody, DialogContent$1 as DialogContent, DialogContentProps, DialogFooter$1 as DialogFooter, DialogHeader$1 as DialogHeader };
@@ -2,8 +2,8 @@
2
2
 
3
3
 
4
4
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
5
- const require_FileUploadItems = require('./FileUploadItems.cjs');
6
5
  const require_use_file_upload_store = require('./hooks/use-file-upload-store.cjs');
6
+ const require_FileUploadItems = require('./FileUploadItems.cjs');
7
7
  let __pixpilot_shadcn = require("@pixpilot/shadcn");
8
8
  __pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
9
9
  let lucide_react = require("lucide-react");
@@ -15,7 +15,10 @@ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
15
15
 
16
16
  //#region src/file-upload/FileUpload.tsx
17
17
  function FileUpload(props) {
18
- const { value, onChange, className, multiple = true, onAccept, maxFiles, preventDuplicates, onError, onFileReject,...rest } = props;
18
+ const { value, onChange, className, onAccept, maxFiles, preventDuplicates, onFileReject, onSuccess: singleOnSuccess, onError: singleOnError, onFileSuccess, onFileError,...rest } = props;
19
+ const multiple = props.multiple ?? true;
20
+ const onSuccess = multiple ? onFileSuccess : singleOnSuccess;
21
+ const onError = multiple ? onFileError : singleOnError;
19
22
  const { handleAccept, displayFiles, deleteFile, getFile, orgValue } = require_use_file_upload_store.useFileUploadStore({
20
23
  value,
21
24
  onChange,
@@ -31,7 +34,7 @@ function FileUpload(props) {
31
34
  const handleError = react.useCallback((file, message) => {
32
35
  if (onFileReject) onFileReject(file, message);
33
36
  if (onError) onError(file, message);
34
- }, []);
37
+ }, [onError, onFileReject]);
35
38
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.FileUpload, {
36
39
  ...rest,
37
40
  value: orgValue,
@@ -63,6 +66,8 @@ function FileUpload(props) {
63
66
  getFile,
64
67
  maxFiles,
65
68
  itemSize,
69
+ onSuccess,
70
+ onError,
66
71
  className: containerClasses
67
72
  })
68
73
  })
@@ -1,7 +1,7 @@
1
1
  import { FileUploadProps } from "./types/index.cjs";
2
- import * as react_jsx_runtime14 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime8 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/file-upload/FileUpload.d.ts
5
- declare function FileUpload(props: FileUploadProps): react_jsx_runtime14.JSX.Element;
5
+ declare function FileUpload(props: FileUploadProps): react_jsx_runtime8.JSX.Element;
6
6
  //#endregion
7
7
  export { FileUpload };
@@ -1,7 +1,7 @@
1
1
  import { FileUploadProps } from "./types/index.js";
2
- import * as react_jsx_runtime11 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime8 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/file-upload/FileUpload.d.ts
5
- declare function FileUpload(props: FileUploadProps): react_jsx_runtime11.JSX.Element;
5
+ declare function FileUpload(props: FileUploadProps): react_jsx_runtime8.JSX.Element;
6
6
  //#endregion
7
7
  export { FileUpload };
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
 
3
3
 
4
- import { FileUploadItems } from "./FileUploadItems.js";
5
4
  import { useFileUploadStore } from "./hooks/use-file-upload-store.js";
5
+ import { FileUploadItems } from "./FileUploadItems.js";
6
6
  import { FileUpload, FileUploadDropzone, cn } from "@pixpilot/shadcn";
7
7
  import { Upload } from "lucide-react";
8
8
  import * as React$1 from "react";
@@ -10,7 +10,10 @@ import { jsx, jsxs } from "react/jsx-runtime";
10
10
 
11
11
  //#region src/file-upload/FileUpload.tsx
12
12
  function FileUpload$1(props) {
13
- const { value, onChange, className, multiple = true, onAccept, maxFiles, preventDuplicates, onError, onFileReject,...rest } = props;
13
+ const { value, onChange, className, onAccept, maxFiles, preventDuplicates, onFileReject, onSuccess: singleOnSuccess, onError: singleOnError, onFileSuccess, onFileError,...rest } = props;
14
+ const multiple = props.multiple ?? true;
15
+ const onSuccess = multiple ? onFileSuccess : singleOnSuccess;
16
+ const onError = multiple ? onFileError : singleOnError;
14
17
  const { handleAccept, displayFiles, deleteFile, getFile, orgValue } = useFileUploadStore({
15
18
  value,
16
19
  onChange,
@@ -26,7 +29,7 @@ function FileUpload$1(props) {
26
29
  const handleError = React$1.useCallback((file, message) => {
27
30
  if (onFileReject) onFileReject(file, message);
28
31
  if (onError) onError(file, message);
29
- }, []);
32
+ }, [onError, onFileReject]);
30
33
  return /* @__PURE__ */ jsx(FileUpload, {
31
34
  ...rest,
32
35
  value: orgValue,
@@ -58,6 +61,8 @@ function FileUpload$1(props) {
58
61
  getFile,
59
62
  maxFiles,
60
63
  itemSize,
64
+ onSuccess,
65
+ onError,
61
66
  className: containerClasses
62
67
  })
63
68
  })
@@ -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, className }) {
14
+ function FileUploadItems({ displayFiles, deleteFile, getFile, maxFiles, itemSize, onSuccess, onError, className }) {
15
15
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.FileUploadList, {
16
16
  orientation: "horizontal",
17
17
  forceMount: true,
@@ -23,7 +23,9 @@ function FileUploadItems({ displayFiles, deleteFile, getFile, maxFiles, itemSize
23
23
  fileMeta,
24
24
  deleteFile,
25
25
  getFile,
26
- itemSize
26
+ itemSize,
27
+ onSuccess,
28
+ onError
27
29
  }, key);
28
30
  }), maxFiles === void 0 || displayFiles.length < maxFiles ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
29
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, className }) {
10
+ function FileUploadItems({ displayFiles, deleteFile, getFile, maxFiles, itemSize, onSuccess, onError, className }) {
11
11
  return /* @__PURE__ */ jsxs(FileUploadList, {
12
12
  orientation: "horizontal",
13
13
  forceMount: true,
@@ -19,7 +19,9 @@ function FileUploadItems({ displayFiles, deleteFile, getFile, maxFiles, itemSize
19
19
  fileMeta,
20
20
  deleteFile,
21
21
  getFile,
22
- itemSize
22
+ itemSize,
23
+ onSuccess,
24
+ onError
23
25
  }, key);
24
26
  }), maxFiles === void 0 || displayFiles.length < maxFiles ? /* @__PURE__ */ jsx("div", {
25
27
  className: cn(itemSize, "flex items-center justify-center border-2 border-dashed rounded-md"),
@@ -2,6 +2,8 @@
2
2
 
3
3
 
4
4
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
5
+ const require_use_file_upload_progress_callbacks = require('./hooks/use-file-upload-progress-callbacks.cjs');
6
+ require('./hooks/index.cjs');
5
7
  let __pixpilot_shadcn = require("@pixpilot/shadcn");
6
8
  __pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
7
9
  let lucide_react = require("lucide-react");
@@ -20,8 +22,12 @@ const Backdrop = ({ className, children }) => {
20
22
  children
21
23
  });
22
24
  };
23
- const FileUploadListItem = react.default.memo(({ fileMeta, deleteFile, getFile, itemSize }) => {
25
+ const FileUploadListItem = react.default.memo(({ fileMeta, deleteFile, getFile, itemSize, onSuccess, onError }) => {
24
26
  const file = getFile(fileMeta);
27
+ require_use_file_upload_progress_callbacks.useFileUploadProgressCallbacks(file, {
28
+ onSuccess,
29
+ onError
30
+ });
25
31
  const storeFile = (0, __pixpilot_shadcn.useFileUpload)((store) => store.files.get(file));
26
32
  const hasError = storeFile?.error != null;
27
33
  const url = typeof fileMeta.url === "string" ? fileMeta.url : "";
@@ -1,6 +1,8 @@
1
1
  'use client';
2
2
 
3
3
 
4
+ import { useFileUploadProgressCallbacks } from "./hooks/use-file-upload-progress-callbacks.js";
5
+ import "./hooks/index.js";
4
6
  import { Button, FileUploadItem, FileUploadItemMetadata, FileUploadItemPreview, FileUploadItemProgress, Tooltip, TooltipContent, TooltipTrigger, cn, useFileUpload } from "@pixpilot/shadcn";
5
7
  import { AlertTriangle, X } from "lucide-react";
6
8
  import React from "react";
@@ -14,8 +16,12 @@ const Backdrop = ({ className, children }) => {
14
16
  children
15
17
  });
16
18
  };
17
- const FileUploadListItem = React.memo(({ fileMeta, deleteFile, getFile, itemSize }) => {
19
+ const FileUploadListItem = React.memo(({ fileMeta, deleteFile, getFile, itemSize, onSuccess, onError }) => {
18
20
  const file = getFile(fileMeta);
21
+ useFileUploadProgressCallbacks(file, {
22
+ onSuccess,
23
+ onError
24
+ });
19
25
  const storeFile = useFileUpload((store) => store.files.get(file));
20
26
  const hasError = storeFile?.error != null;
21
27
  const url = typeof fileMeta.url === "string" ? fileMeta.url : "";
@@ -1,3 +1,3 @@
1
- const require_use_file_upload_store = require('./use-file-upload-store.cjs');
2
1
  const require_use_file_error = require('./use-file-error.cjs');
3
2
  const require_use_file_upload_progress_callbacks = require('./use-file-upload-progress-callbacks.cjs');
3
+ const require_use_file_upload_store = require('./use-file-upload-store.cjs');
@@ -1,3 +1,3 @@
1
- import { useFileUploadStore } from "./use-file-upload-store.js";
2
1
  import { useFileError } from "./use-file-error.js";
3
2
  import { useFileUploadProgressCallbacks } from "./use-file-upload-progress-callbacks.js";
3
+ import { useFileUploadStore } from "./use-file-upload-store.js";
@@ -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 { onChange, onError } = callBacks;
10
+ const { onSuccess, onError } = 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,11 +27,11 @@ function useFileUploadProgressCallbacks(file, callBacks) {
27
27
  (0, react.useEffect)(() => {
28
28
  if (isUploadSuccess && !isChangeTrigged.current) {
29
29
  isChangeTrigged.current = true;
30
- onChange?.(fileMeta);
30
+ onSuccess?.(fileMeta);
31
31
  }
32
32
  }, [
33
33
  isUploadSuccess,
34
- onChange,
34
+ onSuccess,
35
35
  fileMeta
36
36
  ]);
37
37
  (0, react.useEffect)(() => {
@@ -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 { onChange, onError } = callBacks;
7
+ const { onSuccess, onError } = callBacks;
8
8
  const fileMeta = useMemo(() => getFileMeta(file), [file]);
9
9
  const isChangeTrigged = useRef(false);
10
10
  const isErrorTriggered = useRef(false);
@@ -24,11 +24,11 @@ function useFileUploadProgressCallbacks(file, callBacks) {
24
24
  useEffect(() => {
25
25
  if (isUploadSuccess && !isChangeTrigged.current) {
26
26
  isChangeTrigged.current = true;
27
- onChange?.(fileMeta);
27
+ onSuccess?.(fileMeta);
28
28
  }
29
29
  }, [
30
30
  isUploadSuccess,
31
- onChange,
31
+ onSuccess,
32
32
  fileMeta
33
33
  ]);
34
34
  useEffect(() => {
@@ -1,5 +1,5 @@
1
- const require_use_file_upload_store = require('./hooks/use-file-upload-store.cjs');
2
- const require_FileUpload = require('./FileUpload.cjs');
3
1
  const require_use_file_error = require('./hooks/use-file-error.cjs');
4
2
  const require_use_file_upload_progress_callbacks = require('./hooks/use-file-upload-progress-callbacks.cjs');
3
+ const require_use_file_upload_store = require('./hooks/use-file-upload-store.cjs');
5
4
  require('./hooks/index.cjs');
5
+ const require_FileUpload = require('./FileUpload.cjs');
@@ -1,2 +1,2 @@
1
- import { FileMetadata, FileUploadBaseProps, FileUploadProgressCallBacks, FileUploadProps, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, SingleFileUploadProps } from "./types/index.cjs";
1
+ import { FileMetadata, FileUploadBaseProps, FileUploadProgressCallBacks, FileUploadProps, MultiFileCallbacks, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, SingleFileUploadProps, UseFileCallbacks } from "./types/index.cjs";
2
2
  import { FileUpload } from "./FileUpload.cjs";
@@ -1,3 +1,3 @@
1
- import { FileMetadata, FileUploadBaseProps, FileUploadProgressCallBacks, FileUploadProps, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, SingleFileUploadProps } from "./types/index.js";
1
+ import { FileMetadata, FileUploadBaseProps, FileUploadProgressCallBacks, FileUploadProps, MultiFileCallbacks, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, SingleFileUploadProps, UseFileCallbacks } from "./types/index.js";
2
2
  import { FileUpload } from "./FileUpload.js";
3
3
  import "./hooks/index.js";
@@ -1,5 +1,5 @@
1
- import { useFileUploadStore } from "./hooks/use-file-upload-store.js";
2
- import { FileUpload } from "./FileUpload.js";
3
1
  import { useFileError } from "./hooks/use-file-error.js";
4
2
  import { useFileUploadProgressCallbacks } from "./hooks/use-file-upload-progress-callbacks.js";
3
+ import { useFileUploadStore } from "./hooks/use-file-upload-store.js";
5
4
  import "./hooks/index.js";
5
+ import { FileUpload } from "./FileUpload.js";
@@ -8,29 +8,36 @@ 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 {
16
+ onFileSuccess?: (fileMeta: FileMetadata) => void;
17
+ onFileError?: (file: File, error: string) => void;
18
+ }
11
19
  type OnChangeSingleFile = (file: FileMetadata | null) => void;
12
20
  type OnChangeMultipleFiles = (files: FileMetadata[]) => void;
13
21
  type MainFileUploadProps = Omit<FileUploadProps, 'value' | 'onError'>;
14
22
  interface FileUploadBaseProps extends MainFileUploadProps {
15
23
  preventDuplicates?: boolean;
16
- onError?: (file: File, error: string) => void;
17
24
  }
18
25
  type FileUploadProps$1 = ({
19
26
  multiple: true;
20
27
  value?: FileMetadata[];
21
28
  onChange?: OnChangeMultipleFiles;
22
- } & FileUploadBaseProps) | ({
29
+ } & FileUploadBaseProps & MultiFileCallbacks) | ({
23
30
  multiple?: false;
24
31
  value?: FileMetadata | null;
25
32
  onChange?: OnChangeSingleFile;
26
- } & FileUploadBaseProps);
27
- interface MultiFileUploadProps extends FileUploadBaseProps {
33
+ } & FileUploadBaseProps & UseFileCallbacks);
34
+ interface MultiFileUploadProps extends FileUploadBaseProps, MultiFileCallbacks {
28
35
  value?: FileMetadata[];
29
36
  onChange?: OnChangeMultipleFiles;
30
37
  }
31
- interface SingleFileUploadProps extends Omit<FileUploadBaseProps, 'multiple'> {
38
+ interface SingleFileUploadProps extends Omit<FileUploadBaseProps, 'multiple'>, UseFileCallbacks {
32
39
  value?: FileMetadata | null;
33
- onChange?: (files: FileMetadata) => void;
40
+ onChange?: OnChangeSingleFile;
34
41
  }
35
42
  interface FileUploadProgressCallBacks {
36
43
  onProgress: (file: File, progress: number) => void;
@@ -38,4 +45,4 @@ interface FileUploadProgressCallBacks {
38
45
  onError: (file: File, error: Error) => void;
39
46
  }
40
47
  //#endregion
41
- export { FileMetadata, FileUploadBaseProps, FileUploadProgressCallBacks, FileUploadProps$1 as FileUploadProps, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, SingleFileUploadProps };
48
+ export { FileMetadata, FileUploadBaseProps, FileUploadProgressCallBacks, FileUploadProps$1 as FileUploadProps, MultiFileCallbacks, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, SingleFileUploadProps, UseFileCallbacks };
@@ -8,29 +8,36 @@ 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 {
16
+ onFileSuccess?: (fileMeta: FileMetadata) => void;
17
+ onFileError?: (file: File, error: string) => void;
18
+ }
11
19
  type OnChangeSingleFile = (file: FileMetadata | null) => void;
12
20
  type OnChangeMultipleFiles = (files: FileMetadata[]) => void;
13
21
  type MainFileUploadProps = Omit<FileUploadProps, 'value' | 'onError'>;
14
22
  interface FileUploadBaseProps extends MainFileUploadProps {
15
23
  preventDuplicates?: boolean;
16
- onError?: (file: File, error: string) => void;
17
24
  }
18
25
  type FileUploadProps$1 = ({
19
26
  multiple: true;
20
27
  value?: FileMetadata[];
21
28
  onChange?: OnChangeMultipleFiles;
22
- } & FileUploadBaseProps) | ({
29
+ } & FileUploadBaseProps & MultiFileCallbacks) | ({
23
30
  multiple?: false;
24
31
  value?: FileMetadata | null;
25
32
  onChange?: OnChangeSingleFile;
26
- } & FileUploadBaseProps);
27
- interface MultiFileUploadProps extends FileUploadBaseProps {
33
+ } & FileUploadBaseProps & UseFileCallbacks);
34
+ interface MultiFileUploadProps extends FileUploadBaseProps, MultiFileCallbacks {
28
35
  value?: FileMetadata[];
29
36
  onChange?: OnChangeMultipleFiles;
30
37
  }
31
- interface SingleFileUploadProps extends Omit<FileUploadBaseProps, 'multiple'> {
38
+ interface SingleFileUploadProps extends Omit<FileUploadBaseProps, 'multiple'>, UseFileCallbacks {
32
39
  value?: FileMetadata | null;
33
- onChange?: (files: FileMetadata) => void;
40
+ onChange?: OnChangeSingleFile;
34
41
  }
35
42
  interface FileUploadProgressCallBacks {
36
43
  onProgress: (file: File, progress: number) => void;
@@ -38,4 +45,4 @@ interface FileUploadProgressCallBacks {
38
45
  onError: (file: File, error: Error) => void;
39
46
  }
40
47
  //#endregion
41
- export { FileMetadata, FileUploadBaseProps, FileUploadProgressCallBacks, FileUploadProps$1 as FileUploadProps, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, SingleFileUploadProps };
48
+ export { FileMetadata, FileUploadBaseProps, FileUploadProgressCallBacks, FileUploadProps$1 as FileUploadProps, MultiFileCallbacks, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, SingleFileUploadProps, UseFileCallbacks };
@@ -1,10 +1,10 @@
1
1
  import { FileUploadInlineProps } from "./types.cjs";
2
- import * as react_jsx_runtime15 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime12 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_runtime15.JSX.Element;
8
+ declare function FileUploadInline(props: FileUploadInlineProps): react_jsx_runtime12.JSX.Element;
9
9
  //#endregion
10
10
  export { FileUploadInline };
@@ -17,7 +17,10 @@ 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, onError, className, disabled, multiple = false, children, onAccept, preventDuplicates, slots,...rest } = props;
20
+ const { value, onChange, className, disabled, children, onAccept, preventDuplicates, slots, onSuccess: singleOnSuccess, onError: singleOnError, onFileSuccess, onFileError,...rest } = props;
21
+ const multiple = props.multiple ?? false;
22
+ const onSuccess = multiple ? onFileSuccess : singleOnSuccess;
23
+ const onError = multiple ? onFileError : singleOnError;
21
24
  const { handleAccept, displayFiles, deleteFile, getFile, orgValue } = require_use_file_upload_store.useFileUploadStore({
22
25
  value,
23
26
  onChange,
@@ -57,6 +60,7 @@ function FileUploadRoot(props) {
57
60
  file: getFile(data),
58
61
  disabled,
59
62
  onDelete: deleteFile,
63
+ onSuccess,
60
64
  onError,
61
65
  ...slots?.fileItem || {}
62
66
  }, key);
@@ -1,11 +1,11 @@
1
1
  import { FileUploadRootProps } from "./types.cjs";
2
- import * as react_jsx_runtime16 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_runtime16.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
  }
@@ -1,11 +1,11 @@
1
1
  import { FileUploadRootProps } from "./types.js";
2
- import * as react_jsx_runtime13 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime14 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_runtime14.JSX.Element;
9
9
  declare namespace FileUploadRoot {
10
10
  var displayName: string;
11
11
  }
@@ -13,7 +13,10 @@ 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, onError, className, disabled, multiple = false, children, onAccept, preventDuplicates, slots,...rest } = props;
16
+ const { value, onChange, className, disabled, children, onAccept, preventDuplicates, slots, onSuccess: singleOnSuccess, onError: singleOnError, onFileSuccess, onFileError,...rest } = props;
17
+ const multiple = props.multiple ?? false;
18
+ const onSuccess = multiple ? onFileSuccess : singleOnSuccess;
19
+ const onError = multiple ? onFileError : singleOnError;
17
20
  const { handleAccept, displayFiles, deleteFile, getFile, orgValue } = useFileUploadStore({
18
21
  value,
19
22
  onChange,
@@ -51,6 +54,7 @@ function FileUploadRoot(props) {
51
54
  file: getFile(data),
52
55
  disabled,
53
56
  onDelete: deleteFile,
57
+ onSuccess,
54
58
  onError,
55
59
  ...slots?.fileItem || {}
56
60
  }, key);
@@ -55,9 +55,9 @@ 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 }) => {
58
+ const FileUploadRootItem = react.default.memo(({ file, name = "", size = 0, type = "", lastModified = 0, disabled = false, onDelete, onError, onSuccess }) => {
59
59
  require_use_file_upload_progress_callbacks.useFileUploadProgressCallbacks(file, {
60
- onChange: () => {},
60
+ onSuccess,
61
61
  onError
62
62
  });
63
63
  const fileError = require_use_file_error.useFileError(file);
@@ -1,13 +1,12 @@
1
- import { FileMetadata } from "../file-upload/types/index.cjs";
1
+ import { FileMetadata, UseFileCallbacks } 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> {
6
+ interface FileUploadRootItemProps extends Partial<FileMetadata>, UseFileCallbacks {
7
7
  file: File;
8
8
  disabled?: boolean;
9
9
  onDelete: (file: FileWithMetadata) => void;
10
- onError?: (file: File, error: string) => void;
11
10
  }
12
11
  declare const FileUploadRootItem: React.FC<FileUploadRootItemProps>;
13
12
  //#endregion
@@ -1,14 +1,13 @@
1
- import { FileMetadata } from "../file-upload/types/index.js";
1
+ import { FileMetadata, UseFileCallbacks } 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> {
7
+ interface FileUploadRootItemProps extends Partial<FileMetadata>, UseFileCallbacks {
8
8
  file: File;
9
9
  disabled?: boolean;
10
10
  onDelete: (file: FileWithMetadata) => void;
11
- onError?: (file: File, error: string) => void;
12
11
  }
13
12
  declare const FileUploadRootItem: React.FC<FileUploadRootItemProps>;
14
13
  //#endregion
@@ -49,9 +49,9 @@ 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 }) => {
52
+ const FileUploadRootItem = React.memo(({ file, name = "", size = 0, type = "", lastModified = 0, disabled = false, onDelete, onError, onSuccess }) => {
53
53
  useFileUploadProgressCallbacks(file, {
54
- onChange: () => {},
54
+ onSuccess,
55
55
  onError
56
56
  });
57
57
  const fileError = useFileError(file);
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { FileMetadata, FileUploadBaseProps, FileUploadProgressCallBacks, FileUploadProps, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, SingleFileUploadProps } from "./file-upload/types/index.cjs";
1
+ import { FileMetadata, FileUploadBaseProps, FileUploadProgressCallBacks, FileUploadProps, MultiFileCallbacks, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, SingleFileUploadProps, UseFileCallbacks } 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, 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 };
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 };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { FileMetadata, FileUploadBaseProps, FileUploadProgressCallBacks, FileUploadProps, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, SingleFileUploadProps } from "./file-upload/types/index.js";
1
+ import { FileMetadata, FileUploadBaseProps, FileUploadProgressCallBacks, FileUploadProps, MultiFileCallbacks, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, SingleFileUploadProps, UseFileCallbacks } 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, 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 };
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 };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime20 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime14 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_runtime20.JSX.Element;
13
+ declare function Input(props: InputProps$1): react_jsx_runtime14.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_runtime14 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime13 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_runtime14.JSX.Element;
13
+ declare function Input$1(props: InputProps$1): react_jsx_runtime13.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_runtime10 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime19 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_runtime10.JSX.Element;
60
+ }: TagsInputProps): react_jsx_runtime19.JSX.Element;
61
61
  //#endregion
62
62
  export { TagsInput, TagsInputProps };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime8 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime20 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_runtime8.JSX.Element;
78
+ }: TagsInputInlineProps): react_jsx_runtime20.JSX.Element;
79
79
  //#endregion
80
80
  export { TagsInputInline, TagsInputInlineItem, TagsInputInlineProps };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime11 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime15 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_runtime11.JSX.Element;
20
+ declare function ThemeModeDropdown(props: ThemeModeDropdownProps): react_jsx_runtime15.JSX.Element;
21
21
  declare namespace ThemeModeDropdown {
22
22
  var displayName: string;
23
23
  }
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime12 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime17 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_runtime12.JSX.Element;
28
+ declare function ThemeModeSwitchInside(props: ThemeModeSwitchInsideProps): react_jsx_runtime17.JSX.Element;
29
29
  declare namespace ThemeModeSwitchInside {
30
30
  var displayName: string;
31
31
  }
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime13 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime18 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_runtime13.JSX.Element;
25
+ declare function ThemeModeSwitchOutside(props: ThemeModeSwitchOutsideProps): react_jsx_runtime18.JSX.Element;
26
26
  declare namespace ThemeModeSwitchOutside {
27
27
  var displayName: string;
28
28
  }
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime9 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime16 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/theme-toggle/ThemeModeToggleButton.d.ts
4
4
  interface ThemeModeToggleButtonProps {
@@ -13,7 +13,7 @@ interface ThemeModeToggleButtonProps {
13
13
  * Light/Dark toggle button.
14
14
  * Pure component - toggles between light and dark.
15
15
  */
16
- declare function ThemeModeToggleButton(props: ThemeModeToggleButtonProps): react_jsx_runtime9.JSX.Element;
16
+ declare function ThemeModeToggleButton(props: ThemeModeToggleButtonProps): react_jsx_runtime16.JSX.Element;
17
17
  declare namespace ThemeModeToggleButton {
18
18
  var displayName: string;
19
19
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pixpilot/shadcn-ui",
3
3
  "type": "module",
4
- "version": "1.6.0",
4
+ "version": "1.7.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",
@@ -60,9 +60,9 @@
60
60
  "react-dom": "19.2.0",
61
61
  "tsdown": "^0.15.12",
62
62
  "typescript": "^5.9.3",
63
+ "@internal/eslint-config": "0.3.0",
63
64
  "@internal/hooks": "0.0.0",
64
65
  "@internal/prettier-config": "0.0.1",
65
- "@internal/eslint-config": "0.3.0",
66
66
  "@internal/tsconfig": "0.1.0",
67
67
  "@internal/tsdown-config": "0.1.0",
68
68
  "@internal/vitest-config": "0.1.0"