diff --git a/apps/docs/package.json b/apps/docs/package.json index 214efc14..9a690eae 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -22,34 +22,34 @@ "@faker-js/faker": "^9.0.3", "@hookform/resolvers": "^3.9.0", "@radix-ui/react-accessible-icon": "^1.1.0", - "@radix-ui/react-accordion": "^1.2.0", - "@radix-ui/react-alert-dialog": "^1.1.1", + "@radix-ui/react-accordion": "^1.2.1", + "@radix-ui/react-alert-dialog": "^1.1.2", "@radix-ui/react-aspect-ratio": "^1.1.0", - "@radix-ui/react-avatar": "^1.1.0", - "@radix-ui/react-checkbox": "^1.1.1", - "@radix-ui/react-collapsible": "^1.1.0", - "@radix-ui/react-context-menu": "^2.2.1", - "@radix-ui/react-dialog": "^1.1.1", - "@radix-ui/react-dropdown-menu": "^2.1.1", - "@radix-ui/react-hover-card": "^1.1.1", + "@radix-ui/react-avatar": "^1.1.1", + "@radix-ui/react-checkbox": "^1.1.2", + "@radix-ui/react-collapsible": "^1.1.1", + "@radix-ui/react-context-menu": "^2.2.2", + "@radix-ui/react-dialog": "^1.1.2", + "@radix-ui/react-dropdown-menu": "^2.1.2", + "@radix-ui/react-hover-card": "^1.1.2", "@radix-ui/react-icons": "^1.3.0", "@radix-ui/react-label": "^2.1.0", - "@radix-ui/react-menubar": "^1.1.1", - "@radix-ui/react-navigation-menu": "^1.2.0", - "@radix-ui/react-popover": "^1.1.1", + "@radix-ui/react-menubar": "^1.1.2", + "@radix-ui/react-navigation-menu": "^1.2.1", + "@radix-ui/react-popover": "^1.1.2", "@radix-ui/react-progress": "^1.1.0", - "@radix-ui/react-radio-group": "^1.2.0", - "@radix-ui/react-scroll-area": "^1.1.0", - "@radix-ui/react-select": "^2.1.1", + "@radix-ui/react-radio-group": "^1.2.1", + "@radix-ui/react-scroll-area": "^1.2.0", + "@radix-ui/react-select": "^2.1.2", "@radix-ui/react-separator": "^1.1.0", - "@radix-ui/react-slider": "^1.2.0", + "@radix-ui/react-slider": "^1.2.1", "@radix-ui/react-slot": "^1.1.0", - "@radix-ui/react-switch": "^1.1.0", - "@radix-ui/react-tabs": "^1.1.0", - "@radix-ui/react-toast": "^1.2.1", + "@radix-ui/react-switch": "^1.1.1", + "@radix-ui/react-tabs": "^1.1.1", + "@radix-ui/react-toast": "^1.2.2", "@radix-ui/react-toggle": "^1.1.0", "@radix-ui/react-toggle-group": "^1.1.0", - "@radix-ui/react-tooltip": "^1.1.2", + "@radix-ui/react-tooltip": "^1.1.3", "@sikka/hawa": "workspace:^", "@tanstack/react-table": "^8.20.5", "class-variance-authority": "^0.7.0", @@ -62,9 +62,9 @@ "geist": "^1.3.1", "jotai": "^2.10.0", "lodash.template": "^4.5.0", - "lucide-react": "0.446.0", + "lucide-react": "0.447.0", "markdown-wasm": "^1.2.0", - "next": "14.2.13", + "next": "14.2.14", "next-contentlayer2": "^0.5.1", "next-themes": "^0.3.0", "nextjs-progressloader": "^1.2.0", @@ -77,18 +77,18 @@ "recharts": "^2.12.7", "sharp": "^0.33.5", "sonner": "^1.5.0", - "tailwind-merge": "^2.5.2", + "tailwind-merge": "^2.5.3", "vaul": "^1.0.0", "zod": "^3.23.8" }, "devDependencies": { "@types/lodash.template": "^4.5.3", "@types/node": "^22.7.4", - "@types/react": "^18.3.10", + "@types/react": "^18.3.11", "@types/react-color": "^3.0.12", "@types/react-dom": "^18.3.0", "esbuild": "^0.24.0", - "eslint": "^9.11.1", + "eslint": "^9.12.0", "mdast-util-toc": "^7.1.0", "postcss": "^8.4.47", "rehype": "^13.0.2", @@ -99,7 +99,7 @@ "remark-code-import": "^1.2.0", "remark-gfm": "^4.0.0", "rimraf": "^6.0.1", - "shiki": "^1.21.0", + "shiki": "^1.22.0", "tailwindcss": "^3.4.13", "typescript": "^5.6.2", "unist-builder": "4.0.0", diff --git a/packages/components/elements/fileDropzone/FileDropzone.tsx b/packages/components/elements/fileDropzone/FileDropzone.tsx index 6651bcb5..c638e857 100644 --- a/packages/components/elements/fileDropzone/FileDropzone.tsx +++ b/packages/components/elements/fileDropzone/FileDropzone.tsx @@ -59,13 +59,15 @@ export const FileDropzone: React.FunctionComponent = ({ }) => { const [cmp, setCmp] = useState(0); const [max, setMax] = useState(0); + const [filesAccepted, setFilesAccepted] = useState([]); const { getRootProps, getInputProps, fileRejections, acceptedFiles, isDragActive } = useDropzone({ multiple: true, accept: accept, maxSize: maxSize, maxFiles: maxFiles, - onDrop: (acceptedFiles: any) => { + useFsAccessApi: true, + onDrop: (acceptedFiles) => { setFiles( acceptedFiles.map((file: any, index: any) => Object.assign(file, { @@ -86,14 +88,15 @@ export const FileDropzone: React.FunctionComponent = ({ useEffect(() => { setFiles(acceptedFiles); }, [acceptedFiles, cmp, setFiles]); + onClearFiles = () => { - acceptedFiles.length = 0; - acceptedFiles.splice(0, acceptedFiles.length); + setFilesAccepted([]); + setFilesAccepted(filesAccepted.splice(0, filesAccepted.length)); setFiles([]); }; const clearAllFiles = () => { - acceptedFiles.length = 0; + setFilesAccepted([]); setFiles([]); }; @@ -126,7 +129,7 @@ export const FileDropzone: React.FunctionComponent = ({