@molecule/app-file-dropzone-react 1.0.2 → 1.0.3

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.
@@ -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;AAM3C,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,EACR,QAAQ,EACR,SAAS,GACV,EAAE,iBAAiB,GAAG,GAAG,CAAC,OAAO,CA0HjC"}
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;AAM3C,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,EACR,QAAQ,EACR,SAAS,GACV,EAAE,iBAAiB,GAAG,GAAG,CAAC,OAAO,CAmIjC"}
@@ -76,10 +76,20 @@ export function FileDropzone({ onFiles, accept, multiple = false, maxSize, onRej
76
76
  e.preventDefault();
77
77
  inputRef.current?.click();
78
78
  }
79
- }, "data-mol-id": "file-dropzone", role: "button", tabIndex: 0, "aria-disabled": disabled, className: cm.cn(cm.flex({ direction: 'col', align: 'center', justify: 'center' }), cm.sp('p', 6), cm.textCenter, !disabled ? cm.cursorPointer : undefined, className), style: {
80
- border: `2px dashed rgba(0,0,0,${dragging ? 0.4 : 0.15})`,
79
+ }, "data-mol-id": "file-dropzone", role: "button", tabIndex: 0, "aria-disabled": disabled, className: cm.cn(cm.flex({ direction: 'col', align: 'center', justify: 'center' }), cm.sp('p', 6), cm.textCenter, !disabled ? cm.cursorPointer : undefined, className),
80
+ /* mol-bespoke-button: a drop SURFACE, not a CTA — a 140px dashed target
81
+ that the user drops files onto and whose border thickens on drag-over.
82
+ No `cm.button()` tier is a dashed drop region. The colours are theme
83
+ tokens now; the old `rgba(0,0,0,…)` dashes were invisible on a dark
84
+ background. */
85
+ style: {
86
+ border: dragging
87
+ ? '2px dashed var(--mol-color-primary, #3366ff)'
88
+ : '2px dashed var(--mol-color-border, rgba(128,128,128,0.35))',
81
89
  borderRadius: 12,
82
90
  minHeight: 140,
83
- background: dragging ? 'rgba(0,0,0,0.02)' : undefined,
91
+ background: dragging
92
+ ? 'color-mix(in srgb, var(--mol-color-primary, #3366ff) 6%, transparent)'
93
+ : undefined,
84
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: `Accepts: ${accept}` }) }))] }))] }));
85
95
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/app-file-dropzone-react",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Drag-drop file upload area with click fallback and preview slot",
5
5
  "homepage": "https://www.molecule.dev/packages/app-file-dropzone-react",
6
6
  "type": "module",
@@ -39,7 +39,7 @@
39
39
  "react": "^18.0.0 || ^19.0.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@molecule/app-react": "1.5.1",
42
+ "@molecule/app-react": "1.6.0",
43
43
  "@molecule/app-ui": "1.1.1",
44
44
  "@molecule/app-ui-react": "1.0.2",
45
45
  "@testing-library/react": "16.3.2",