@pixpilot/shadcn-ui 1.4.0 → 1.6.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/AbsoluteFill.d.ts +2 -2
  2. package/dist/Button.d.ts +2 -2
  3. package/dist/ButtonExtended.d.ts +2 -2
  4. package/dist/ColorSelect.d.ts +2 -2
  5. package/dist/ContentCard.d.ts +2 -2
  6. package/dist/DatePicker.d.ts +2 -2
  7. package/dist/Rating.d.cts +1 -1
  8. package/dist/Rating.d.ts +1 -1
  9. package/dist/avatar-upload/AvatarUpload.cjs +3 -2
  10. package/dist/avatar-upload/AvatarUpload.js +3 -2
  11. package/dist/avatar-upload/AvatarUploadItem.cjs +5 -2
  12. package/dist/avatar-upload/AvatarUploadItem.js +5 -2
  13. package/dist/file-upload/FileUpload.cjs +6 -1
  14. package/dist/file-upload/FileUpload.d.cts +2 -2
  15. package/dist/file-upload/FileUpload.d.ts +2 -2
  16. package/dist/file-upload/FileUpload.js +6 -1
  17. package/dist/file-upload/hooks/use-file-upload-progress-callbacks.cjs +17 -1
  18. package/dist/file-upload/hooks/use-file-upload-progress-callbacks.js +17 -1
  19. package/dist/file-upload/types/index.d.cts +2 -1
  20. package/dist/file-upload/types/index.d.ts +2 -1
  21. package/dist/file-upload-inline/FileUploadInline.d.cts +2 -2
  22. package/dist/file-upload-inline/FileUploadInline.d.ts +2 -2
  23. package/dist/file-upload-root/FileUploadRoot.cjs +2 -1
  24. package/dist/file-upload-root/FileUploadRoot.d.cts +2 -2
  25. package/dist/file-upload-root/FileUploadRoot.d.ts +2 -2
  26. package/dist/file-upload-root/FileUploadRoot.js +2 -1
  27. package/dist/file-upload-root/FileUploadRootItem.cjs +5 -2
  28. package/dist/file-upload-root/FileUploadRootItem.d.cts +1 -0
  29. package/dist/file-upload-root/FileUploadRootItem.d.ts +1 -0
  30. package/dist/file-upload-root/FileUploadRootItem.js +5 -2
  31. package/dist/input/Input.d.cts +2 -2
  32. package/dist/tags-input/TagsInput.d.cts +2 -2
  33. package/dist/tags-input/TagsInput.d.ts +2 -2
  34. package/dist/tags-input/TagsInputInline.d.cts +2 -2
  35. package/dist/tags-input/TagsInputInline.d.ts +2 -2
  36. package/dist/theme-toggle/ThemeModeDropdown.d.cts +2 -2
  37. package/dist/theme-toggle/ThemeModeDropdown.d.ts +2 -2
  38. package/dist/theme-toggle/ThemeModeSwitchInside.d.cts +2 -2
  39. package/dist/theme-toggle/ThemeModeSwitchInside.d.ts +2 -2
  40. package/dist/theme-toggle/ThemeModeSwitchOutside.d.cts +2 -2
  41. package/dist/theme-toggle/ThemeModeSwitchOutside.d.ts +2 -2
  42. package/dist/theme-toggle/ThemeModeToggleButton.d.cts +2 -2
  43. package/dist/theme-toggle/ThemeModeToggleButton.d.ts +2 -2
  44. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import * as react_jsx_runtime1 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/AbsoluteFill.d.ts
5
5
 
@@ -10,7 +10,7 @@ import * as react_jsx_runtime1 from "react/jsx-runtime";
10
10
  */
11
11
  declare function AbsoluteFill(props: React.HTMLAttributes<HTMLDivElement> & {
12
12
  ref?: React.Ref<HTMLDivElement>;
13
- }): react_jsx_runtime1.JSX.Element;
13
+ }): react_jsx_runtime0.JSX.Element;
14
14
  declare namespace AbsoluteFill {
15
15
  var displayName: string;
16
16
  }
package/dist/Button.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Button, Tooltip, TooltipContent, TooltipTrigger, buttonVariants } from "@pixpilot/shadcn";
2
2
  import React from "react";
3
- import * as react_jsx_runtime2 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
4
4
  import { VariantProps } from "class-variance-authority";
5
5
 
6
6
  //#region src/Button.d.ts
@@ -27,7 +27,7 @@ interface ButtonProps extends React.ComponentProps<typeof Button>, VariantProps<
27
27
  }
28
28
  declare function Button$1(props: ButtonProps & {
29
29
  ref?: React.Ref<HTMLButtonElement>;
30
- }): react_jsx_runtime2.JSX.Element;
30
+ }): react_jsx_runtime0.JSX.Element;
31
31
  declare namespace Button$1 {
32
32
  var displayName: string;
33
33
  }
@@ -1,6 +1,6 @@
1
1
  import { Button, Tooltip, TooltipContent, TooltipTrigger, buttonVariants } from "@pixpilot/shadcn";
2
2
  import React from "react";
3
- import * as react_jsx_runtime3 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
4
4
  import { VariantProps } from "class-variance-authority";
5
5
 
6
6
  //#region src/ButtonExtended.d.ts
@@ -50,7 +50,7 @@ interface ButtonExtendedProps extends React.ComponentProps<typeof Button>, Varia
50
50
  }
51
51
  declare function ButtonExtended(props: ButtonExtendedProps & {
52
52
  ref?: React.Ref<HTMLButtonElement>;
53
- }): react_jsx_runtime3.JSX.Element;
53
+ }): react_jsx_runtime1.JSX.Element;
54
54
  declare namespace ButtonExtended {
55
55
  var displayName: string;
56
56
  }
@@ -1,6 +1,6 @@
1
1
  import { Select, SelectContent } from "@pixpilot/shadcn";
2
2
  import React, { ComponentProps } from "react";
3
- import * as react_jsx_runtime4 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime2 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/ColorSelect.d.ts
6
6
  interface ColorSelectOption {
@@ -15,6 +15,6 @@ type BaseColorSelectProps = {
15
15
  placeholder?: string;
16
16
  keyboardMode?: 'cycle' | 'dropdown';
17
17
  } & Omit<ComponentProps<typeof Select>, 'value' | 'onValueChange' | 'children'>;
18
- declare function ColorSelect(props: BaseColorSelectProps): react_jsx_runtime4.JSX.Element;
18
+ declare function ColorSelect(props: BaseColorSelectProps): react_jsx_runtime2.JSX.Element;
19
19
  //#endregion
20
20
  export { BaseColorSelectProps, ColorSelect, ColorSelectOption };
@@ -1,6 +1,6 @@
1
1
  import { Card } from "@pixpilot/shadcn";
2
2
  import React, { ReactNode } from "react";
3
- import * as react_jsx_runtime0 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime3 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/ContentCard.d.ts
6
6
  interface SectionCardProps extends React.ComponentProps<typeof Card> {
@@ -8,7 +8,7 @@ interface SectionCardProps extends React.ComponentProps<typeof Card> {
8
8
  children: ReactNode;
9
9
  marginBottom?: boolean;
10
10
  }
11
- declare function ContentCard(props: SectionCardProps): react_jsx_runtime0.JSX.Element;
11
+ declare function ContentCard(props: SectionCardProps): react_jsx_runtime3.JSX.Element;
12
12
  declare namespace ContentCard {
13
13
  var displayName: string;
14
14
  }
@@ -1,6 +1,6 @@
1
1
  import { Calendar } from "@pixpilot/shadcn";
2
2
  import { ComponentProps } from "react";
3
- import * as react_jsx_runtime0 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime4 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/DatePicker.d.ts
6
6
  type DatePickerProps = {
@@ -8,7 +8,7 @@ type DatePickerProps = {
8
8
  onChange?: (date: Date | undefined) => void;
9
9
  placeholder?: string;
10
10
  } & Omit<ComponentProps<typeof Calendar>, 'selected' | 'onSelect' | 'mode'>;
11
- declare function DatePicker(props: DatePickerProps): react_jsx_runtime0.JSX.Element;
11
+ declare function DatePicker(props: DatePickerProps): react_jsx_runtime4.JSX.Element;
12
12
  declare namespace DatePicker {
13
13
  var displayName: string;
14
14
  }
package/dist/Rating.d.cts CHANGED
@@ -10,7 +10,7 @@ interface RatingOption {
10
10
  value: number;
11
11
  }
12
12
  declare const ratingVariants: (props?: ({
13
- size?: "default" | "sm" | "lg" | "xl" | null | undefined;
13
+ size?: "sm" | "default" | "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/Rating.d.ts CHANGED
@@ -10,7 +10,7 @@ interface RatingOption {
10
10
  value: number;
11
11
  }
12
12
  declare const ratingVariants: (props?: ({
13
- size?: "default" | "sm" | "lg" | "xl" | null | undefined;
13
+ size?: "sm" | "default" | "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';
@@ -33,7 +33,7 @@ const sizeClasses = {
33
33
  }
34
34
  };
35
35
  const AvatarUpload = (props) => {
36
- const { className, messages, value, onAccept, onChange, size = "md",...rest } = props;
36
+ const { className, messages, value, onAccept, onChange, 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,8 @@ const AvatarUpload = (props) => {
60
60
  index: i,
61
61
  currentSize,
62
62
  change,
63
- onChange
63
+ onChange,
64
+ onError
64
65
  }, id)) }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_AvatarUploadComponents.MainWrapper, {
65
66
  currentSize,
66
67
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_AvatarUploadComponents.AvatarWrap, {
@@ -28,7 +28,7 @@ const sizeClasses = {
28
28
  }
29
29
  };
30
30
  const AvatarUpload = (props) => {
31
- const { className, messages, value, onAccept, onChange, size = "md",...rest } = props;
31
+ const { className, messages, value, onAccept, onChange, 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,8 @@ const AvatarUpload = (props) => {
55
55
  index: i,
56
56
  currentSize,
57
57
  change,
58
- onChange
58
+ onChange,
59
+ onError
59
60
  }, id)) }) : /* @__PURE__ */ jsxs(MainWrapper, {
60
61
  currentSize,
61
62
  children: [/* @__PURE__ */ jsx(AvatarWrap, {
@@ -12,8 +12,11 @@ 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 } = props;
16
- require_use_file_upload_progress_callbacks.useFileUploadProgressCallbacks(file, props);
15
+ const { file, currentSize, change, onChange, onError } = props;
16
+ require_use_file_upload_progress_callbacks.useFileUploadProgressCallbacks(file, {
17
+ onChange,
18
+ onError
19
+ });
17
20
  const fileError = require_use_file_error.useFileError(file);
18
21
  const isUploading = (0, __pixpilot_shadcn.useFileUpload)((store) => {
19
22
  if (fileError != null) return false;
@@ -8,8 +8,11 @@ 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 } = props;
12
- useFileUploadProgressCallbacks(file, props);
11
+ const { file, currentSize, change, onChange, onError } = props;
12
+ useFileUploadProgressCallbacks(file, {
13
+ onChange,
14
+ onError
15
+ });
13
16
  const fileError = useFileError(file);
14
17
  const isUploading = useFileUpload((store) => {
15
18
  if (fileError != null) return false;
@@ -15,7 +15,7 @@ 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,...rest } = props;
18
+ const { value, onChange, className, multiple = true, onAccept, maxFiles, preventDuplicates, onError, onFileReject,...rest } = props;
19
19
  const { handleAccept, displayFiles, deleteFile, getFile, orgValue } = require_use_file_upload_store.useFileUploadStore({
20
20
  value,
21
21
  onChange,
@@ -28,10 +28,15 @@ function FileUpload(props) {
28
28
  }, [handleAccept, onAccept]);
29
29
  const itemSize = "size-22";
30
30
  const containerClasses = (0, __pixpilot_shadcn.cn)("p-1.5");
31
+ const handleError = react.useCallback((file, message) => {
32
+ if (onFileReject) onFileReject(file, message);
33
+ if (onError) onError(file, message);
34
+ }, []);
31
35
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.FileUpload, {
32
36
  ...rest,
33
37
  value: orgValue,
34
38
  onAccept: handleFileAccept,
39
+ onFileReject: handleError,
35
40
  multiple,
36
41
  className: (0, __pixpilot_shadcn.cn)("w-full", className),
37
42
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.FileUploadDropzone, {
@@ -1,7 +1,7 @@
1
1
  import { FileUploadProps } from "./types/index.cjs";
2
- import * as react_jsx_runtime8 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime14 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/file-upload/FileUpload.d.ts
5
- declare function FileUpload(props: FileUploadProps): react_jsx_runtime8.JSX.Element;
5
+ declare function FileUpload(props: FileUploadProps): react_jsx_runtime14.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_runtime13 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime11 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/file-upload/FileUpload.d.ts
5
- declare function FileUpload(props: FileUploadProps): react_jsx_runtime13.JSX.Element;
5
+ declare function FileUpload(props: FileUploadProps): react_jsx_runtime11.JSX.Element;
6
6
  //#endregion
7
7
  export { FileUpload };
@@ -10,7 +10,7 @@ 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,...rest } = props;
13
+ const { value, onChange, className, multiple = true, onAccept, maxFiles, preventDuplicates, onError, onFileReject,...rest } = props;
14
14
  const { handleAccept, displayFiles, deleteFile, getFile, orgValue } = useFileUploadStore({
15
15
  value,
16
16
  onChange,
@@ -23,10 +23,15 @@ function FileUpload$1(props) {
23
23
  }, [handleAccept, onAccept]);
24
24
  const itemSize = "size-22";
25
25
  const containerClasses = cn("p-1.5");
26
+ const handleError = React$1.useCallback((file, message) => {
27
+ if (onFileReject) onFileReject(file, message);
28
+ if (onError) onError(file, message);
29
+ }, []);
26
30
  return /* @__PURE__ */ jsx(FileUpload, {
27
31
  ...rest,
28
32
  value: orgValue,
29
33
  onAccept: handleFileAccept,
34
+ onFileReject: handleError,
30
35
  multiple,
31
36
  className: cn("w-full", className),
32
37
  children: /* @__PURE__ */ jsx(FileUploadDropzone, {
@@ -7,9 +7,10 @@ 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 } = callBacks;
10
+ const { onChange, 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
+ const isErrorTriggered = (0, react.useRef)(false);
13
14
  const isUploadSuccess = (0, __pixpilot_shadcn.useFileUpload)((store) => {
14
15
  const storeFile = store.files.get(file);
15
16
  if (storeFile?.status === "success") {
@@ -18,6 +19,11 @@ function useFileUploadProgressCallbacks(file, callBacks) {
18
19
  }
19
20
  return false;
20
21
  });
22
+ const uploadError = (0, __pixpilot_shadcn.useFileUpload)((store) => {
23
+ const storeFile = store.files.get(file);
24
+ if (storeFile?.status === "error") return storeFile.error ?? "Upload failed";
25
+ return null;
26
+ });
21
27
  (0, react.useEffect)(() => {
22
28
  if (isUploadSuccess && !isChangeTrigged.current) {
23
29
  isChangeTrigged.current = true;
@@ -28,6 +34,16 @@ function useFileUploadProgressCallbacks(file, callBacks) {
28
34
  onChange,
29
35
  fileMeta
30
36
  ]);
37
+ (0, react.useEffect)(() => {
38
+ if (uploadError != null && !isErrorTriggered.current) {
39
+ isErrorTriggered.current = true;
40
+ onError?.(file, uploadError);
41
+ }
42
+ }, [
43
+ uploadError,
44
+ onError,
45
+ file
46
+ ]);
31
47
  }
32
48
 
33
49
  //#endregion
@@ -4,9 +4,10 @@ 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 } = callBacks;
7
+ const { onChange, onError } = callBacks;
8
8
  const fileMeta = useMemo(() => getFileMeta(file), [file]);
9
9
  const isChangeTrigged = useRef(false);
10
+ const isErrorTriggered = useRef(false);
10
11
  const isUploadSuccess = useFileUpload((store) => {
11
12
  const storeFile = store.files.get(file);
12
13
  if (storeFile?.status === "success") {
@@ -15,6 +16,11 @@ function useFileUploadProgressCallbacks(file, callBacks) {
15
16
  }
16
17
  return false;
17
18
  });
19
+ const uploadError = useFileUpload((store) => {
20
+ const storeFile = store.files.get(file);
21
+ if (storeFile?.status === "error") return storeFile.error ?? "Upload failed";
22
+ return null;
23
+ });
18
24
  useEffect(() => {
19
25
  if (isUploadSuccess && !isChangeTrigged.current) {
20
26
  isChangeTrigged.current = true;
@@ -25,6 +31,16 @@ function useFileUploadProgressCallbacks(file, callBacks) {
25
31
  onChange,
26
32
  fileMeta
27
33
  ]);
34
+ useEffect(() => {
35
+ if (uploadError != null && !isErrorTriggered.current) {
36
+ isErrorTriggered.current = true;
37
+ onError?.(file, uploadError);
38
+ }
39
+ }, [
40
+ uploadError,
41
+ onError,
42
+ file
43
+ ]);
28
44
  }
29
45
 
30
46
  //#endregion
@@ -10,9 +10,10 @@ interface FileMetadata {
10
10
  }
11
11
  type OnChangeSingleFile = (file: FileMetadata | null) => void;
12
12
  type OnChangeMultipleFiles = (files: FileMetadata[]) => void;
13
- type MainFileUploadProps = Omit<FileUploadProps, 'value'>;
13
+ type MainFileUploadProps = Omit<FileUploadProps, 'value' | 'onError'>;
14
14
  interface FileUploadBaseProps extends MainFileUploadProps {
15
15
  preventDuplicates?: boolean;
16
+ onError?: (file: File, error: string) => void;
16
17
  }
17
18
  type FileUploadProps$1 = ({
18
19
  multiple: true;
@@ -10,9 +10,10 @@ interface FileMetadata {
10
10
  }
11
11
  type OnChangeSingleFile = (file: FileMetadata | null) => void;
12
12
  type OnChangeMultipleFiles = (files: FileMetadata[]) => void;
13
- type MainFileUploadProps = Omit<FileUploadProps, 'value'>;
13
+ type MainFileUploadProps = Omit<FileUploadProps, 'value' | 'onError'>;
14
14
  interface FileUploadBaseProps extends MainFileUploadProps {
15
15
  preventDuplicates?: boolean;
16
+ onError?: (file: File, error: string) => void;
16
17
  }
17
18
  type FileUploadProps$1 = ({
18
19
  multiple: true;
@@ -1,10 +1,10 @@
1
1
  import { FileUploadInlineProps } from "./types.cjs";
2
- import * as react_jsx_runtime16 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime15 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_runtime16.JSX.Element;
8
+ declare function FileUploadInline(props: FileUploadInlineProps): react_jsx_runtime15.JSX.Element;
9
9
  //#endregion
10
10
  export { FileUploadInline };
@@ -1,10 +1,10 @@
1
1
  import { FileUploadInlineProps } from "./types.js";
2
- import * as react_jsx_runtime11 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_runtime11.JSX.Element;
8
+ declare function FileUploadInline(props: FileUploadInlineProps): react_jsx_runtime12.JSX.Element;
9
9
  //#endregion
10
10
  export { FileUploadInline };
@@ -17,7 +17,7 @@ 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, multiple = false, children, onAccept, preventDuplicates, slots,...rest } = props;
20
+ const { value, onChange, onError, className, disabled, multiple = false, children, onAccept, preventDuplicates, slots,...rest } = props;
21
21
  const { handleAccept, displayFiles, deleteFile, getFile, orgValue } = require_use_file_upload_store.useFileUploadStore({
22
22
  value,
23
23
  onChange,
@@ -57,6 +57,7 @@ function FileUploadRoot(props) {
57
57
  file: getFile(data),
58
58
  disabled,
59
59
  onDelete: deleteFile,
60
+ onError,
60
61
  ...slots?.fileItem || {}
61
62
  }, key);
62
63
  })
@@ -1,11 +1,11 @@
1
1
  import { FileUploadRootProps } from "./types.cjs";
2
- import * as react_jsx_runtime20 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime16 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_runtime20.JSX.Element;
8
+ declare function FileUploadRoot(props: FileUploadRootProps): react_jsx_runtime16.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_runtime12 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_runtime12.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,7 +13,7 @@ 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, multiple = false, children, onAccept, preventDuplicates, slots,...rest } = props;
16
+ const { value, onChange, onError, className, disabled, multiple = false, children, onAccept, preventDuplicates, slots,...rest } = props;
17
17
  const { handleAccept, displayFiles, deleteFile, getFile, orgValue } = useFileUploadStore({
18
18
  value,
19
19
  onChange,
@@ -51,6 +51,7 @@ function FileUploadRoot(props) {
51
51
  file: getFile(data),
52
52
  disabled,
53
53
  onDelete: deleteFile,
54
+ onError,
54
55
  ...slots?.fileItem || {}
55
56
  }, key);
56
57
  })
@@ -55,8 +55,11 @@ 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 }) => {
59
- require_use_file_upload_progress_callbacks.useFileUploadProgressCallbacks(file, { onChange: () => {} });
58
+ const FileUploadRootItem = react.default.memo(({ file, name = "", size = 0, type = "", lastModified = 0, disabled = false, onDelete, onError }) => {
59
+ require_use_file_upload_progress_callbacks.useFileUploadProgressCallbacks(file, {
60
+ onChange: () => {},
61
+ onError
62
+ });
60
63
  const fileError = require_use_file_error.useFileError(file);
61
64
  const isUploading = (0, __pixpilot_shadcn.useFileUpload)((store) => {
62
65
  return store.files.get(file)?.status === "uploading";
@@ -7,6 +7,7 @@ interface FileUploadRootItemProps extends Partial<FileMetadata> {
7
7
  file: File;
8
8
  disabled?: boolean;
9
9
  onDelete: (file: FileWithMetadata) => void;
10
+ onError?: (file: File, error: string) => void;
10
11
  }
11
12
  declare const FileUploadRootItem: React.FC<FileUploadRootItemProps>;
12
13
  //#endregion
@@ -8,6 +8,7 @@ interface FileUploadRootItemProps extends Partial<FileMetadata> {
8
8
  file: File;
9
9
  disabled?: boolean;
10
10
  onDelete: (file: FileWithMetadata) => void;
11
+ onError?: (file: File, error: string) => void;
11
12
  }
12
13
  declare const FileUploadRootItem: React.FC<FileUploadRootItemProps>;
13
14
  //#endregion
@@ -49,8 +49,11 @@ 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 }) => {
53
- useFileUploadProgressCallbacks(file, { onChange: () => {} });
52
+ const FileUploadRootItem = React.memo(({ file, name = "", size = 0, type = "", lastModified = 0, disabled = false, onDelete, onError }) => {
53
+ useFileUploadProgressCallbacks(file, {
54
+ onChange: () => {},
55
+ onError
56
+ });
54
57
  const fileError = useFileError(file);
55
58
  const isUploading = useFileUpload((store) => {
56
59
  return store.files.get(file)?.status === "uploading";
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime9 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime20 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_runtime9.JSX.Element;
13
+ declare function Input(props: InputProps$1): react_jsx_runtime20.JSX.Element;
14
14
  //#endregion
15
15
  export { Input, InputProps$1 as InputProps };
@@ -1,5 +1,5 @@
1
1
  import { CommandOptionListItem } from "../CommandOptionList.cjs";
2
- import * as react_jsx_runtime11 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime10 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_runtime11.JSX.Element;
60
+ }: TagsInputProps): react_jsx_runtime10.JSX.Element;
61
61
  //#endregion
62
62
  export { TagsInput, TagsInputProps };
@@ -1,5 +1,5 @@
1
1
  import { CommandOptionListItem } from "../CommandOptionList.js";
2
- import * as react_jsx_runtime15 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime16 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_runtime15.JSX.Element;
60
+ }: TagsInputProps): react_jsx_runtime16.JSX.Element;
61
61
  //#endregion
62
62
  export { TagsInput, TagsInputProps };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime10 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime8 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_runtime10.JSX.Element;
78
+ }: TagsInputInlineProps): react_jsx_runtime8.JSX.Element;
79
79
  //#endregion
80
80
  export { TagsInputInline, TagsInputInlineItem, TagsInputInlineProps };
@@ -1,5 +1,5 @@
1
1
  import { ChangeEventHandler, FocusEventHandler, KeyboardEventHandler, MouseEventHandler, Ref } from "react";
2
- import * as react_jsx_runtime16 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime15 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/tags-input/TagsInputInline.d.ts
5
5
  interface TagsInputInlineItem {
@@ -75,6 +75,6 @@ declare function TagsInputInline({
75
75
  canAddCurrentValue,
76
76
  onAddCurrentInput,
77
77
  showClear
78
- }: TagsInputInlineProps): react_jsx_runtime16.JSX.Element;
78
+ }: TagsInputInlineProps): react_jsx_runtime15.JSX.Element;
79
79
  //#endregion
80
80
  export { TagsInputInline, TagsInputInlineItem, TagsInputInlineProps };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime13 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime11 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_runtime13.JSX.Element;
20
+ declare function ThemeModeDropdown(props: ThemeModeDropdownProps): react_jsx_runtime11.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_runtime18 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_runtime17.JSX.Element;
20
+ declare function ThemeModeDropdown(props: ThemeModeDropdownProps): react_jsx_runtime18.JSX.Element;
21
21
  declare namespace ThemeModeDropdown {
22
22
  var displayName: string;
23
23
  }
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime14 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime12 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_runtime14.JSX.Element;
28
+ declare function ThemeModeSwitchInside(props: ThemeModeSwitchInsideProps): react_jsx_runtime12.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_runtime19 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_runtime18.JSX.Element;
28
+ declare function ThemeModeSwitchInside(props: ThemeModeSwitchInsideProps): react_jsx_runtime19.JSX.Element;
29
29
  declare namespace ThemeModeSwitchInside {
30
30
  var displayName: string;
31
31
  }
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime15 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime13 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_runtime15.JSX.Element;
25
+ declare function ThemeModeSwitchOutside(props: ThemeModeSwitchOutsideProps): react_jsx_runtime13.JSX.Element;
26
26
  declare namespace ThemeModeSwitchOutside {
27
27
  var displayName: string;
28
28
  }
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime19 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime20 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_runtime19.JSX.Element;
25
+ declare function ThemeModeSwitchOutside(props: ThemeModeSwitchOutsideProps): react_jsx_runtime20.JSX.Element;
26
26
  declare namespace ThemeModeSwitchOutside {
27
27
  var displayName: string;
28
28
  }
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime12 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime9 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_runtime12.JSX.Element;
16
+ declare function ThemeModeToggleButton(props: ThemeModeToggleButtonProps): react_jsx_runtime9.JSX.Element;
17
17
  declare namespace ThemeModeToggleButton {
18
18
  var displayName: string;
19
19
  }
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime20 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime17 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_runtime20.JSX.Element;
16
+ declare function ThemeModeToggleButton(props: ThemeModeToggleButtonProps): react_jsx_runtime17.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.4.0",
4
+ "version": "1.6.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",
64
63
  "@internal/hooks": "0.0.0",
65
64
  "@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"