@pixpilot/shadcn 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ui/alert-dialog.d.ts +12 -12
- package/dist/components/ui/alert.d.ts +4 -4
- package/dist/components/ui/avatar.d.ts +4 -4
- package/dist/components/ui/file-upload.d.ts +8 -0
- package/dist/components/ui/file-upload.js +9 -7
- package/dist/components/ui/tooltip.d.ts +5 -5
- package/package.json +3 -3
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime8 from "react/jsx-runtime";
|
|
3
3
|
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
4
4
|
|
|
5
5
|
//#region src/components/ui/alert-dialog.d.ts
|
|
6
6
|
declare function AlertDialog({
|
|
7
7
|
...props
|
|
8
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Root>):
|
|
8
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Root>): react_jsx_runtime8.JSX.Element;
|
|
9
9
|
declare function AlertDialogTrigger({
|
|
10
10
|
...props
|
|
11
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>):
|
|
11
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>): react_jsx_runtime8.JSX.Element;
|
|
12
12
|
declare function AlertDialogPortal({
|
|
13
13
|
...props
|
|
14
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Portal>):
|
|
14
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Portal>): react_jsx_runtime8.JSX.Element;
|
|
15
15
|
declare function AlertDialogOverlay({
|
|
16
16
|
className,
|
|
17
17
|
...props
|
|
18
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>):
|
|
18
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>): react_jsx_runtime8.JSX.Element;
|
|
19
19
|
declare function AlertDialogContent({
|
|
20
20
|
className,
|
|
21
21
|
...props
|
|
22
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Content>):
|
|
22
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Content>): react_jsx_runtime8.JSX.Element;
|
|
23
23
|
declare function AlertDialogHeader({
|
|
24
24
|
className,
|
|
25
25
|
...props
|
|
26
|
-
}: React.ComponentProps<'div'>):
|
|
26
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime8.JSX.Element;
|
|
27
27
|
declare function AlertDialogFooter({
|
|
28
28
|
className,
|
|
29
29
|
...props
|
|
30
|
-
}: React.ComponentProps<'div'>):
|
|
30
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime8.JSX.Element;
|
|
31
31
|
declare function AlertDialogTitle({
|
|
32
32
|
className,
|
|
33
33
|
...props
|
|
34
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Title>):
|
|
34
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Title>): react_jsx_runtime8.JSX.Element;
|
|
35
35
|
declare function AlertDialogDescription({
|
|
36
36
|
className,
|
|
37
37
|
...props
|
|
38
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Description>):
|
|
38
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Description>): react_jsx_runtime8.JSX.Element;
|
|
39
39
|
declare function AlertDialogAction({
|
|
40
40
|
className,
|
|
41
41
|
...props
|
|
42
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Action>):
|
|
42
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Action>): react_jsx_runtime8.JSX.Element;
|
|
43
43
|
declare function AlertDialogCancel({
|
|
44
44
|
className,
|
|
45
45
|
...props
|
|
46
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>):
|
|
46
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>): react_jsx_runtime8.JSX.Element;
|
|
47
47
|
//#endregion
|
|
48
48
|
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VariantProps } from "class-variance-authority";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime5 from "react/jsx-runtime";
|
|
4
4
|
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
5
5
|
|
|
6
6
|
//#region src/components/ui/alert.d.ts
|
|
@@ -11,14 +11,14 @@ declare function Alert({
|
|
|
11
11
|
className,
|
|
12
12
|
variant,
|
|
13
13
|
...props
|
|
14
|
-
}: React.ComponentProps<'div'> & VariantProps<typeof alertVariants>):
|
|
14
|
+
}: React.ComponentProps<'div'> & VariantProps<typeof alertVariants>): react_jsx_runtime5.JSX.Element;
|
|
15
15
|
declare function AlertTitle({
|
|
16
16
|
className,
|
|
17
17
|
...props
|
|
18
|
-
}: React.ComponentProps<'div'>):
|
|
18
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime5.JSX.Element;
|
|
19
19
|
declare function AlertDescription({
|
|
20
20
|
className,
|
|
21
21
|
...props
|
|
22
|
-
}: React.ComponentProps<'div'>):
|
|
22
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime5.JSX.Element;
|
|
23
23
|
//#endregion
|
|
24
24
|
export { Alert, AlertDescription, AlertTitle };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime19 from "react/jsx-runtime";
|
|
3
3
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
4
4
|
|
|
5
5
|
//#region src/components/ui/avatar.d.ts
|
|
6
6
|
declare function Avatar({
|
|
7
7
|
className,
|
|
8
8
|
...props
|
|
9
|
-
}: React.ComponentProps<typeof AvatarPrimitive.Root>):
|
|
9
|
+
}: React.ComponentProps<typeof AvatarPrimitive.Root>): react_jsx_runtime19.JSX.Element;
|
|
10
10
|
declare function AvatarImage({
|
|
11
11
|
className,
|
|
12
12
|
...props
|
|
13
|
-
}: React.ComponentProps<typeof AvatarPrimitive.Image>):
|
|
13
|
+
}: React.ComponentProps<typeof AvatarPrimitive.Image>): react_jsx_runtime19.JSX.Element;
|
|
14
14
|
declare function AvatarFallback({
|
|
15
15
|
className,
|
|
16
16
|
...props
|
|
17
|
-
}: React.ComponentProps<typeof AvatarPrimitive.Fallback>):
|
|
17
|
+
}: React.ComponentProps<typeof AvatarPrimitive.Fallback>): react_jsx_runtime19.JSX.Element;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { Avatar, AvatarFallback, AvatarImage };
|
|
@@ -27,6 +27,14 @@ interface FileUploadRootProps extends Omit<React.ComponentProps<'div'>, 'default
|
|
|
27
27
|
message: string;
|
|
28
28
|
}>) => void;
|
|
29
29
|
onFileValidate?: (file: File) => string | null | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Optional async transform applied to each accepted file before it enters
|
|
32
|
+
* the store. Return the same file to leave it unchanged, or return a new
|
|
33
|
+
* `File` (e.g. after EXIF stripping) to replace it. All subsequent
|
|
34
|
+
* callbacks — `onProgress`, `onSuccess`, `onError` — will reference the
|
|
35
|
+
* returned file.
|
|
36
|
+
*/
|
|
37
|
+
transformFile?: (file: File) => Promise<File> | File;
|
|
30
38
|
onUpload?: (files: File[], options: {
|
|
31
39
|
onProgress: (file: File, progress: number) => void;
|
|
32
40
|
onSuccess: (file: File) => void;
|
|
@@ -182,7 +182,7 @@ function useFileUploadContext(consumerName) {
|
|
|
182
182
|
return context;
|
|
183
183
|
}
|
|
184
184
|
function FileUploadRoot(props) {
|
|
185
|
-
const { value, defaultValue, onValueChange, onAccept, onFileAccept, onFileReject, onFilesReject, onFileValidate, onUpload, accept, maxFiles, maxSize, dir: dirProp, label, name, asChild, disabled = false, invalid = false, multiple = false, required = false, children, className,...rootProps } = props;
|
|
185
|
+
const { value, defaultValue, onValueChange, onAccept, onFileAccept, onFileReject, onFilesReject, onFileValidate, transformFile, onUpload, accept, maxFiles, maxSize, dir: dirProp, label, name, asChild, disabled = false, invalid = false, multiple = false, required = false, children, className,...rootProps } = props;
|
|
186
186
|
const inputId = React.useId();
|
|
187
187
|
const dropzoneId = React.useId();
|
|
188
188
|
const listId = React.useId();
|
|
@@ -377,18 +377,19 @@ function FileUploadRoot(props) {
|
|
|
377
377
|
}, 2e3);
|
|
378
378
|
}
|
|
379
379
|
if (allRejectedFiles.length > 0) onFilesReject?.(allRejectedFiles);
|
|
380
|
-
if (acceptedFiles.length > 0) {
|
|
380
|
+
if (acceptedFiles.length > 0) (async () => {
|
|
381
|
+
const finalFiles = transformFile ? await Promise.all(acceptedFiles.map(async (file) => transformFile(file))) : acceptedFiles;
|
|
381
382
|
store.dispatch({
|
|
382
383
|
type: "ADD_FILES",
|
|
383
|
-
files:
|
|
384
|
+
files: finalFiles
|
|
384
385
|
});
|
|
385
386
|
if (isControlled && onValueChange) onValueChange([...Array.from(store.getState().files.values()).map((f) => f.file)]);
|
|
386
|
-
if (onAccept) onAccept(
|
|
387
|
-
for (const file of
|
|
387
|
+
if (onAccept) onAccept(finalFiles);
|
|
388
|
+
for (const file of finalFiles) onFileAccept?.(file);
|
|
388
389
|
if (onUpload) requestAnimationFrame(() => {
|
|
389
|
-
onFilesUpload(
|
|
390
|
+
onFilesUpload(finalFiles);
|
|
390
391
|
});
|
|
391
|
-
}
|
|
392
|
+
})();
|
|
392
393
|
}, [
|
|
393
394
|
store,
|
|
394
395
|
isControlled,
|
|
@@ -397,6 +398,7 @@ function FileUploadRoot(props) {
|
|
|
397
398
|
onFileAccept,
|
|
398
399
|
onUpload,
|
|
399
400
|
onFilesUpload,
|
|
401
|
+
transformFile,
|
|
400
402
|
maxFiles,
|
|
401
403
|
onFileValidate,
|
|
402
404
|
onFileReject,
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime22 from "react/jsx-runtime";
|
|
3
3
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
4
4
|
|
|
5
5
|
//#region src/components/ui/tooltip.d.ts
|
|
6
6
|
declare function TooltipProvider({
|
|
7
7
|
delayDuration,
|
|
8
8
|
...props
|
|
9
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Provider>):
|
|
9
|
+
}: React.ComponentProps<typeof TooltipPrimitive.Provider>): react_jsx_runtime22.JSX.Element;
|
|
10
10
|
declare function Tooltip({
|
|
11
11
|
...props
|
|
12
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Root>):
|
|
12
|
+
}: React.ComponentProps<typeof TooltipPrimitive.Root>): react_jsx_runtime22.JSX.Element;
|
|
13
13
|
declare function TooltipTrigger({
|
|
14
14
|
...props
|
|
15
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Trigger>):
|
|
15
|
+
}: React.ComponentProps<typeof TooltipPrimitive.Trigger>): react_jsx_runtime22.JSX.Element;
|
|
16
16
|
declare function TooltipContent({
|
|
17
17
|
className,
|
|
18
18
|
sideOffset,
|
|
19
19
|
children,
|
|
20
20
|
...props
|
|
21
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Content>):
|
|
21
|
+
}: React.ComponentProps<typeof TooltipPrimitive.Content>): react_jsx_runtime22.JSX.Element;
|
|
22
22
|
//#endregion
|
|
23
23
|
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixpilot/shadcn",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.2",
|
|
5
5
|
"description": "A collection of reusable UI components built with shadcn/ui and Radix UI primitives.",
|
|
6
6
|
"author": "m.doaie <m.doaie@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -84,10 +84,10 @@
|
|
|
84
84
|
"tsdown": "^0.15.12",
|
|
85
85
|
"typescript": "^5.9.3",
|
|
86
86
|
"typescript-eslint": "^8.49.0",
|
|
87
|
-
"@internal/tsdown-config": "0.1.0",
|
|
88
|
-
"@internal/prettier-config": "0.0.1",
|
|
89
87
|
"@internal/eslint-config": "0.3.0",
|
|
88
|
+
"@internal/prettier-config": "0.0.1",
|
|
90
89
|
"@internal/tsconfig": "0.1.0",
|
|
90
|
+
"@internal/tsdown-config": "0.1.0",
|
|
91
91
|
"@internal/vitest-config": "0.1.0"
|
|
92
92
|
},
|
|
93
93
|
"prettier": "@internal/prettier-config",
|