@molecule/app-file-dropzone-react 4.0.0 → 4.0.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/README.md +3 -3
- package/dist/FileDropzone.d.ts +1 -1
- package/dist/FileDropzone.d.ts.map +1 -1
- package/dist/FileDropzone.js +4 -2
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-11-
|
|
6
|
+
Generated: 2026-11-24T08:57:53.236Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-file-dropzone-react
|
|
@@ -93,7 +93,7 @@ function FileDropzone({
|
|
|
93
93
|
multiple = false,
|
|
94
94
|
maxSize,
|
|
95
95
|
onRejected,
|
|
96
|
-
children,
|
|
96
|
+
children: childrenProp,
|
|
97
97
|
disabled,
|
|
98
98
|
className,
|
|
99
99
|
}: FileDropzoneProps): JSX.Element
|
|
@@ -107,7 +107,7 @@ function FileDropzone({
|
|
|
107
107
|
|
|
108
108
|
Peer dependencies:
|
|
109
109
|
|
|
110
|
-
- `@molecule/app-react` ^4.
|
|
110
|
+
- `@molecule/app-react` ^4.13.0
|
|
111
111
|
- `@molecule/app-ui` ^1.0.1
|
|
112
112
|
- `@molecule/app-ui-react` ^4.0.0
|
|
113
113
|
- `react` ^18.0.0 || ^19.0.0
|
package/dist/FileDropzone.d.ts
CHANGED
|
@@ -26,5 +26,5 @@ export interface FileDropzoneProps {
|
|
|
26
26
|
* extension/MIME check) via `onRejected`.
|
|
27
27
|
* @param props - Component props (see {@link FileDropzoneProps}).
|
|
28
28
|
*/
|
|
29
|
-
export declare function FileDropzone({ onFiles, accept, multiple, maxSize, onRejected, children, disabled, className, }: FileDropzoneProps): JSX.Element;
|
|
29
|
+
export declare function FileDropzone({ onFiles, accept, multiple, maxSize, onRejected, children: childrenProp, disabled, className, }: FileDropzoneProps): JSX.Element;
|
|
30
30
|
//# sourceMappingURL=FileDropzone.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileDropzone.d.ts","sourceRoot":"","sources":["../src/FileDropzone.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"FileDropzone.d.ts","sourceRoot":"","sources":["../src/FileDropzone.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAO3C,sCAAsC;AACtC,MAAM,WAAW,iBAAiB;IAChC,2DAA2D;IAC3D,OAAO,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAA;IAChC,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,qDAAqD;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,4DAA4D;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,uDAAuD;IACvD,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAA;IACpC,wFAAwF;IACxF,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,EAC3B,OAAO,EACP,MAAM,EACN,QAAgB,EAChB,OAAO,EACP,UAAU,EACV,QAAQ,EAAE,YAAY,EACtB,QAAQ,EACR,SAAS,GACV,EAAE,iBAAiB,GAAG,GAAG,CAAC,OAAO,CAoIjC"}
|
package/dist/FileDropzone.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useRef, useState } from 'react';
|
|
3
3
|
import { useTranslation } from '@molecule/app-react';
|
|
4
|
+
import { slot } from '@molecule/app-react/render';
|
|
4
5
|
import { getClassMap } from '@molecule/app-ui';
|
|
5
6
|
/**
|
|
6
7
|
* Drag-drop + click-to-browse file upload zone. Pure UI — apps handle
|
|
@@ -10,7 +11,8 @@ import { getClassMap } from '@molecule/app-ui';
|
|
|
10
11
|
* extension/MIME check) via `onRejected`.
|
|
11
12
|
* @param props - Component props (see {@link FileDropzoneProps}).
|
|
12
13
|
*/
|
|
13
|
-
export function FileDropzone({ onFiles, accept, multiple = false, maxSize, onRejected, children, disabled, className, }) {
|
|
14
|
+
export function FileDropzone({ onFiles, accept, multiple = false, maxSize, onRejected, children: childrenProp, disabled, className, }) {
|
|
15
|
+
const children = slot(childrenProp);
|
|
14
16
|
const cm = getClassMap();
|
|
15
17
|
const { t } = useTranslation();
|
|
16
18
|
const [dragging, setDragging] = useState(false);
|
|
@@ -91,5 +93,5 @@ export function FileDropzone({ onFiles, accept, multiple = false, maxSize, onRej
|
|
|
91
93
|
background: dragging
|
|
92
94
|
? 'color-mix(in srgb, var(--mol-color-primary, #3366ff) 6%, transparent)'
|
|
93
95
|
: undefined,
|
|
94
|
-
}, children: [_jsx("input", { ref: inputRef, type: "file", accept: accept, multiple: multiple, disabled: disabled, onChange: (e) => e.target.files && dispatch(e.target.files), style: { display: 'none' } }), children ?? (_jsxs(_Fragment, { children: [_jsx("p", { className: cm.cn(cm.textSize('sm'), cm.fontWeight('semibold')), children: t('fileDropzone.dropHere', {}, { defaultValue: 'Drop files here or click to browse' }) }), accept && (_jsx("p", { className: cm.cn(cm.textSize('xs'), cm.sp('mt', 1)), children: t('fileDropzone.accepts', { accept }, { defaultValue:
|
|
96
|
+
}, children: [_jsx("input", { ref: inputRef, type: "file", accept: accept, multiple: multiple, disabled: disabled, onChange: (e) => e.target.files && dispatch(e.target.files), style: { display: 'none' } }), children ?? (_jsxs(_Fragment, { children: [_jsx("p", { className: cm.cn(cm.textSize('sm'), cm.fontWeight('semibold')), children: t('fileDropzone.dropHere', {}, { defaultValue: 'Drop files here or click to browse' }) }), accept && (_jsx("p", { className: cm.cn(cm.textSize('xs'), cm.sp('mt', 1)), children: t('fileDropzone.accepts', { accept }, { defaultValue: 'Accepts: {{accept}}' }) }))] }))] }));
|
|
95
97
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-file-dropzone-react",
|
|
3
|
-
"version": "4.0.
|
|
4
|
-
"description": "Drag-drop file upload area with click
|
|
3
|
+
"version": "4.0.2",
|
|
4
|
+
"description": "Drag-drop file upload area with click-to-browse, accept/size filtering, and a content slot",
|
|
5
5
|
"homepage": "https://www.molecule.dev/packages/app-file-dropzone-react",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
@@ -33,20 +33,20 @@
|
|
|
33
33
|
"directory": "packages/app/features/file-dropzone-react"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@molecule/app-react": "^4.
|
|
36
|
+
"@molecule/app-react": "^4.13.0",
|
|
37
37
|
"@molecule/app-ui": "^1.0.1",
|
|
38
38
|
"@molecule/app-ui-react": "^4.0.0",
|
|
39
39
|
"react": "^18.0.0 || ^19.0.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@molecule/app-react": "4.
|
|
43
|
-
"@molecule/app-ui": "1.
|
|
44
|
-
"@molecule/app-ui-react": "4.
|
|
42
|
+
"@molecule/app-react": "4.13.0",
|
|
43
|
+
"@molecule/app-ui": "1.5.0",
|
|
44
|
+
"@molecule/app-ui-react": "4.3.2",
|
|
45
45
|
"@testing-library/react": "16.3.3",
|
|
46
46
|
"@types/node": "26.6.5",
|
|
47
47
|
"@types/react": "19.3.0",
|
|
48
48
|
"@types/react-dom": "19.3.0",
|
|
49
|
-
"jsdom": "
|
|
49
|
+
"jsdom": "31.0.1",
|
|
50
50
|
"react": "19.3.1",
|
|
51
51
|
"react-dom": "19.3.1",
|
|
52
52
|
"typescript": "6.0.3",
|