@mantine/dropzone 5.0.0-alpha.1 → 5.0.0-alpha.12

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 (72) hide show
  1. package/cjs/Dropzone.context.js +11 -0
  2. package/cjs/Dropzone.context.js.map +1 -0
  3. package/cjs/{Dropzone/Dropzone.js → Dropzone.js} +77 -18
  4. package/cjs/Dropzone.js.map +1 -0
  5. package/cjs/{Dropzone/Dropzone.styles.js → Dropzone.styles.js} +26 -22
  6. package/cjs/Dropzone.styles.js.map +1 -0
  7. package/cjs/DropzoneFullScreen.js +126 -0
  8. package/cjs/DropzoneFullScreen.js.map +1 -0
  9. package/cjs/DropzoneFullScreen.styles.js +25 -0
  10. package/cjs/DropzoneFullScreen.styles.js.map +1 -0
  11. package/cjs/DropzoneStatus.js +43 -0
  12. package/cjs/DropzoneStatus.js.map +1 -0
  13. package/cjs/index.js +3 -4
  14. package/cjs/index.js.map +1 -1
  15. package/cjs/mime-types.js +4 -1
  16. package/cjs/mime-types.js.map +1 -1
  17. package/esm/Dropzone.context.js +6 -0
  18. package/esm/Dropzone.context.js.map +1 -0
  19. package/esm/{Dropzone/Dropzone.js → Dropzone.js} +77 -20
  20. package/esm/Dropzone.js.map +1 -0
  21. package/esm/{Dropzone/Dropzone.styles.js → Dropzone.styles.js} +26 -22
  22. package/esm/Dropzone.styles.js.map +1 -0
  23. package/esm/DropzoneFullScreen.js +118 -0
  24. package/esm/DropzoneFullScreen.js.map +1 -0
  25. package/esm/DropzoneFullScreen.styles.js +21 -0
  26. package/esm/DropzoneFullScreen.styles.js.map +1 -0
  27. package/esm/DropzoneStatus.js +37 -0
  28. package/esm/DropzoneStatus.js.map +1 -0
  29. package/esm/index.js +2 -3
  30. package/esm/index.js.map +1 -1
  31. package/esm/mime-types.js +4 -2
  32. package/esm/mime-types.js.map +1 -1
  33. package/lib/Dropzone.context.d.ts +10 -0
  34. package/lib/Dropzone.context.d.ts.map +1 -0
  35. package/lib/Dropzone.d.ts +74 -0
  36. package/lib/Dropzone.d.ts.map +1 -0
  37. package/lib/{Dropzone/Dropzone.styles.d.ts → Dropzone.styles.d.ts} +2 -2
  38. package/lib/Dropzone.styles.d.ts.map +1 -0
  39. package/lib/DropzoneFullScreen.d.ts +15 -0
  40. package/lib/DropzoneFullScreen.d.ts.map +1 -0
  41. package/lib/DropzoneFullScreen.styles.d.ts +7 -0
  42. package/lib/DropzoneFullScreen.styles.d.ts.map +1 -0
  43. package/lib/DropzoneStatus.d.ts +20 -0
  44. package/lib/DropzoneStatus.d.ts.map +1 -0
  45. package/lib/index.d.ts +4 -2
  46. package/lib/index.d.ts.map +1 -1
  47. package/lib/mime-types.d.ts +2 -0
  48. package/lib/mime-types.d.ts.map +1 -1
  49. package/package.json +4 -3
  50. package/cjs/Dropzone/Dropzone.js.map +0 -1
  51. package/cjs/Dropzone/Dropzone.styles.js.map +0 -1
  52. package/cjs/FullScreenDropzone/FullScreenDropzone.js +0 -150
  53. package/cjs/FullScreenDropzone/FullScreenDropzone.js.map +0 -1
  54. package/cjs/FullScreenDropzone/FullscreenDropzone.styles.js +0 -70
  55. package/cjs/FullScreenDropzone/FullscreenDropzone.styles.js.map +0 -1
  56. package/esm/Dropzone/Dropzone.js.map +0 -1
  57. package/esm/Dropzone/Dropzone.styles.js.map +0 -1
  58. package/esm/FullScreenDropzone/FullScreenDropzone.js +0 -142
  59. package/esm/FullScreenDropzone/FullScreenDropzone.js.map +0 -1
  60. package/esm/FullScreenDropzone/FullscreenDropzone.styles.js +0 -66
  61. package/esm/FullScreenDropzone/FullscreenDropzone.styles.js.map +0 -1
  62. package/lib/Dropzone/Dropzone.d.ts +0 -39
  63. package/lib/Dropzone/Dropzone.d.ts.map +0 -1
  64. package/lib/Dropzone/Dropzone.styles.d.ts.map +0 -1
  65. package/lib/Dropzone/index.d.ts +0 -4
  66. package/lib/Dropzone/index.d.ts.map +0 -1
  67. package/lib/FullScreenDropzone/FullScreenDropzone.d.ts +0 -28
  68. package/lib/FullScreenDropzone/FullScreenDropzone.d.ts.map +0 -1
  69. package/lib/FullScreenDropzone/FullscreenDropzone.styles.d.ts +0 -13
  70. package/lib/FullScreenDropzone/FullscreenDropzone.styles.d.ts.map +0 -1
  71. package/lib/FullScreenDropzone/index.d.ts +0 -4
  72. package/lib/FullScreenDropzone/index.d.ts.map +0 -1
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var utils = require('@mantine/utils');
6
+
7
+ const [DropzoneProvider, useDropzoneContext] = utils.createSafeContext("Dropzone component was not found in tree");
8
+
9
+ exports.DropzoneProvider = DropzoneProvider;
10
+ exports.useDropzoneContext = useDropzoneContext;
11
+ //# sourceMappingURL=Dropzone.context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dropzone.context.js","sources":["../src/Dropzone.context.ts"],"sourcesContent":["import { createSafeContext } from '@mantine/utils';\n\nexport interface DropzoneContextValue {\n idle: boolean;\n accept: boolean;\n reject: boolean;\n}\n\nexport const [DropzoneProvider, useDropzoneContext] = createSafeContext<DropzoneContextValue>(\n 'Dropzone component was not found in tree'\n);\n"],"names":["createSafeContext"],"mappings":";;;;;;AACY,MAAC,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,GAAGA,uBAAiB,CAAC,0CAA0C;;;;;"}
@@ -6,7 +6,10 @@ var React = require('react');
6
6
  var reactDropzone = require('react-dropzone');
7
7
  var core = require('@mantine/core');
8
8
  var hooks = require('@mantine/hooks');
9
+ var Dropzone_context = require('./Dropzone.context.js');
10
+ var DropzoneStatus = require('./DropzoneStatus.js');
9
11
  var Dropzone_styles = require('./Dropzone.styles.js');
12
+ var DropzoneFullScreen = require('./DropzoneFullScreen.js');
10
13
 
11
14
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e['default'] : e; }
12
15
 
@@ -47,10 +50,15 @@ const defaultProps = {
47
50
  padding: "md",
48
51
  loading: false,
49
52
  multiple: true,
50
- maxSize: Infinity
53
+ maxSize: Infinity,
54
+ autoFocus: false,
55
+ activateOnClick: true,
56
+ activateOnDrag: true,
57
+ dragEventsBubbling: true,
58
+ activateOnKeyboard: true
51
59
  };
52
- const Dropzone = React.forwardRef((props, ref) => {
53
- const _a = core.useMantineDefaultProps("Dropzone", defaultProps, props), {
60
+ const _Dropzone = React.forwardRef((props, ref) => {
61
+ const _a = core.useComponentDefaultProps("Dropzone", defaultProps, props), {
54
62
  className,
55
63
  padding,
56
64
  radius,
@@ -65,7 +73,20 @@ const Dropzone = React.forwardRef((props, ref) => {
65
73
  onDrop,
66
74
  onReject,
67
75
  openRef,
68
- name
76
+ name,
77
+ unstyled,
78
+ maxFiles,
79
+ autoFocus,
80
+ activateOnClick,
81
+ activateOnDrag,
82
+ dragEventsBubbling,
83
+ activateOnKeyboard,
84
+ onDragEnter,
85
+ onDragLeave,
86
+ onDragOver,
87
+ onFileDialogCancel,
88
+ onFileDialogOpen,
89
+ preventDropOnDocument
69
90
  } = _a, others = __objRest(_a, [
70
91
  "className",
71
92
  "padding",
@@ -81,32 +102,70 @@ const Dropzone = React.forwardRef((props, ref) => {
81
102
  "onDrop",
82
103
  "onReject",
83
104
  "openRef",
84
- "name"
105
+ "name",
106
+ "unstyled",
107
+ "maxFiles",
108
+ "autoFocus",
109
+ "activateOnClick",
110
+ "activateOnDrag",
111
+ "dragEventsBubbling",
112
+ "activateOnKeyboard",
113
+ "onDragEnter",
114
+ "onDragLeave",
115
+ "onDragOver",
116
+ "onFileDialogCancel",
117
+ "onFileDialogOpen",
118
+ "preventDropOnDocument"
85
119
  ]);
86
- const { classes, cx } = Dropzone_styles['default']({ radius, padding }, { classNames, styles, name: "Dropzone" });
120
+ const { classes, cx } = Dropzone_styles['default']({ radius, padding }, { classNames, styles, unstyled, name: "Dropzone" });
87
121
  const { getRootProps, getInputProps, isDragAccept, isDragReject, open } = reactDropzone.useDropzone({
88
- onDropAccepted: (files) => onDrop(files),
89
- onDropRejected: (fileRejections) => onReject(fileRejections),
122
+ onDropAccepted: onDrop,
123
+ onDropRejected: onReject,
90
124
  disabled: disabled || loading,
91
125
  accept: Array.isArray(accept) ? accept.reduce((r, key) => __spreadProps(__spreadValues({}, r), { [key]: [] }), {}) : accept,
92
126
  multiple,
93
- maxSize
127
+ maxSize,
128
+ maxFiles,
129
+ autoFocus,
130
+ noClick: !activateOnClick,
131
+ noDrag: !activateOnDrag,
132
+ noDragEventsBubbling: !dragEventsBubbling,
133
+ noKeyboard: !activateOnKeyboard,
134
+ onDragEnter,
135
+ onDragLeave,
136
+ onDragOver,
137
+ onFileDialogCancel,
138
+ onFileDialogOpen,
139
+ preventDropOnDocument
94
140
  });
95
141
  hooks.assignRef(openRef, open);
96
- return /* @__PURE__ */ React__default.createElement(core.Box, __spreadProps(__spreadValues(__spreadValues({}, others), getRootProps({ ref })), {
97
- className: cx(classes.root, {
98
- [classes.active]: isDragAccept,
99
- [classes.reject]: isDragReject,
100
- [classes.loading]: loading
101
- }, className)
142
+ const isIdle = !isDragAccept && !isDragReject;
143
+ return /* @__PURE__ */ React__default.createElement(Dropzone_context.DropzoneProvider, {
144
+ value: { accept: isDragAccept, reject: isDragReject, idle: isIdle }
145
+ }, /* @__PURE__ */ React__default.createElement(core.Box, __spreadProps(__spreadValues(__spreadValues({}, others), getRootProps({ ref })), {
146
+ "data-accept": isDragAccept || void 0,
147
+ "data-reject": isDragReject || void 0,
148
+ "data-idle": isIdle || void 0,
149
+ "data-loading": loading || void 0,
150
+ className: cx(classes.root, className)
102
151
  }), /* @__PURE__ */ React__default.createElement(core.LoadingOverlay, {
103
152
  visible: loading,
104
- radius
153
+ radius,
154
+ unstyled
105
155
  }), /* @__PURE__ */ React__default.createElement("input", __spreadProps(__spreadValues({}, getInputProps()), {
106
156
  name
107
- })), children({ accepted: isDragAccept, rejected: isDragReject }));
157
+ })), /* @__PURE__ */ React__default.createElement("div", {
158
+ className: classes.inner
159
+ }, children)));
108
160
  });
109
- Dropzone.displayName = "@mantine/dropzone/Dropzone";
161
+ _Dropzone.displayName = "@mantine/dropzone/Dropzone";
162
+ _Dropzone.Accept = DropzoneStatus.DropzoneAccept;
163
+ _Dropzone.Reject = DropzoneStatus.DropzoneReject;
164
+ _Dropzone.Idle = DropzoneStatus.DropzoneIdle;
165
+ _Dropzone.FullScreen = DropzoneFullScreen.DropzoneFullScreen;
166
+ const Dropzone = _Dropzone;
110
167
 
111
168
  exports.Dropzone = Dropzone;
169
+ exports._Dropzone = _Dropzone;
170
+ exports.defaultProps = defaultProps;
112
171
  //# sourceMappingURL=Dropzone.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dropzone.js","sources":["../src/Dropzone.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { useDropzone, FileRejection, Accept } from 'react-dropzone';\nimport {\n DefaultProps,\n Selectors,\n MantineNumberSize,\n LoadingOverlay,\n Box,\n useComponentDefaultProps,\n} from '@mantine/core';\nimport { assignRef } from '@mantine/hooks';\nimport { ForwardRefWithStaticComponents } from '@mantine/utils';\nimport { DropzoneProvider } from './Dropzone.context';\nimport { DropzoneAccept, DropzoneIdle, DropzoneReject } from './DropzoneStatus';\nimport useStyles from './Dropzone.styles';\nimport useFullScreenStyles from './DropzoneFullScreen.styles';\n// eslint-disable-next-line import/no-cycle\nimport { DropzoneFullScreen } from './DropzoneFullScreen';\n\nexport type DropzoneStylesNames = Selectors<typeof useStyles>;\nexport type DropzoneFullScreenStylesName =\n | DropzoneStylesNames\n | Exclude<Selectors<typeof useFullScreenStyles>, 'dropzone'>;\n\nexport interface DropzoneProps\n extends DefaultProps<DropzoneStylesNames>,\n Omit<React.ComponentPropsWithRef<'div'>, 'onDrop'> {\n /** Padding from theme.spacing, or number to set padding in px */\n padding?: MantineNumberSize;\n\n /** Border radius from theme.radius or number to set border-radius in px */\n radius?: MantineNumberSize;\n\n /** Dropzone statues */\n children: React.ReactNode;\n\n /** Disable files capturing */\n disabled?: boolean;\n\n /** Called when files are dropped into dropzone */\n onDrop(files: File[]): void;\n\n /** Called when selected files don't meet file restrictions */\n onReject?(fileRejections: FileRejection[]): void;\n\n /** Display loading overlay over dropzone */\n loading?: boolean;\n\n /** File types to accept */\n accept?: Accept | string[];\n\n /** Get open function as ref */\n openRef?: React.ForwardedRef<() => void | undefined>;\n\n /** Allow selection of multiple files */\n multiple?: boolean;\n\n /** Set maximum file size in bytes */\n maxSize?: number;\n\n /** Name of the form control. Submitted with the form as part of a name/value pair. */\n name?: string;\n\n /** Number of files that user can pick */\n maxFiles?: number;\n\n /** Set to true to autofocus the root element */\n autoFocus?: boolean;\n\n /** If false, disables click to open the native file selection dialog */\n activateOnClick?: boolean;\n\n /** If false, disables drag 'n' drop */\n activateOnDrag?: boolean;\n\n /** If false, disables Space/Enter to open the native file selection dialog. Note that it also stops tracking the focus state. */\n activateOnKeyboard?: boolean;\n\n /** If false, stops drag event propagation to parents */\n dragEventsBubbling?: boolean;\n\n /** Called when the `dragenter` event occurs */\n onDragEnter?(event: React.DragEvent<HTMLElement>): void;\n\n /** Called when the `dragleave` event occurs */\n onDragLeave?(event: React.DragEvent<HTMLElement>): void;\n\n /** Called when the `dragover` event occurs */\n onDragOver?(event: React.DragEvent<HTMLElement>): void;\n\n /** Called when user closes the file selection dialog with no selection */\n onFileDialogCancel?(): void;\n\n /** Called when user opens the file selection dialog */\n onFileDialogOpen?(): void;\n\n /** If false, allow dropped items to take over the current browser window */\n preventDropOnDocument?: boolean;\n}\n\nexport const defaultProps: Partial<DropzoneProps> = {\n padding: 'md',\n loading: false,\n multiple: true,\n maxSize: Infinity,\n autoFocus: false,\n activateOnClick: true,\n activateOnDrag: true,\n dragEventsBubbling: true,\n activateOnKeyboard: true,\n};\n\nexport const _Dropzone: any = forwardRef<HTMLDivElement, DropzoneProps>(\n (props: DropzoneProps, ref) => {\n const {\n className,\n padding,\n radius,\n disabled,\n classNames,\n styles,\n loading,\n multiple,\n maxSize,\n accept,\n children,\n onDrop,\n onReject,\n openRef,\n name,\n unstyled,\n maxFiles,\n autoFocus,\n activateOnClick,\n activateOnDrag,\n dragEventsBubbling,\n activateOnKeyboard,\n onDragEnter,\n onDragLeave,\n onDragOver,\n onFileDialogCancel,\n onFileDialogOpen,\n preventDropOnDocument,\n ...others\n } = useComponentDefaultProps('Dropzone', defaultProps, props);\n\n const { classes, cx } = useStyles(\n { radius, padding },\n { classNames, styles, unstyled, name: 'Dropzone' }\n );\n\n const { getRootProps, getInputProps, isDragAccept, isDragReject, open } = useDropzone({\n onDropAccepted: onDrop,\n onDropRejected: onReject,\n disabled: disabled || loading,\n accept: Array.isArray(accept) ? accept.reduce((r, key) => ({ ...r, [key]: [] }), {}) : accept,\n multiple,\n maxSize,\n maxFiles,\n autoFocus,\n noClick: !activateOnClick,\n noDrag: !activateOnDrag,\n noDragEventsBubbling: !dragEventsBubbling,\n noKeyboard: !activateOnKeyboard,\n onDragEnter,\n onDragLeave,\n onDragOver,\n onFileDialogCancel,\n onFileDialogOpen,\n preventDropOnDocument,\n });\n\n assignRef(openRef, open);\n\n const isIdle = !isDragAccept && !isDragReject;\n\n return (\n <DropzoneProvider value={{ accept: isDragAccept, reject: isDragReject, idle: isIdle }}>\n <Box\n {...others}\n {...getRootProps({ ref })}\n data-accept={isDragAccept || undefined}\n data-reject={isDragReject || undefined}\n data-idle={isIdle || undefined}\n data-loading={loading || undefined}\n className={cx(classes.root, className)}\n >\n <LoadingOverlay visible={loading} radius={radius} unstyled={unstyled} />\n <input {...getInputProps()} name={name} />\n <div className={classes.inner}>{children}</div>\n </Box>\n </DropzoneProvider>\n );\n }\n);\n\nexport interface DropzoneFullScreenProps\n extends Omit<DropzoneProps, 'styles' | 'classNames'>,\n DefaultProps<DropzoneFullScreenStylesName> {\n active?: boolean;\n zIndex?: React.CSSProperties['zIndex'];\n withinPortal?: boolean;\n}\n\n_Dropzone.displayName = '@mantine/dropzone/Dropzone';\n_Dropzone.Accept = DropzoneAccept;\n_Dropzone.Reject = DropzoneReject;\n_Dropzone.Idle = DropzoneIdle;\n_Dropzone.FullScreen = DropzoneFullScreen;\n\nexport const Dropzone: ForwardRefWithStaticComponents<\n DropzoneProps,\n {\n Accept: typeof DropzoneAccept;\n Reject: typeof DropzoneReject;\n Idle: typeof DropzoneIdle;\n FullScreen: typeof DropzoneFullScreen;\n }\n> = _Dropzone;\n"],"names":["forwardRef","useComponentDefaultProps","useStyles","useDropzone","assignRef","React","DropzoneProvider","Box","LoadingOverlay","DropzoneAccept","DropzoneReject","DropzoneIdle","DropzoneFullScreen"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAChC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AAClC,MAAM,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC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4B,CAAC;AACrD,SAAS,CAAC,MAAM,GAAGI,6BAAc,CAAC;AAClC,SAAS,CAAC,MAAM,GAAGC,6BAAc,CAAC;AAClC,SAAS,CAAC,IAAI,GAAGC,2BAAY,CAAC;AAC9B,SAAS,CAAC,UAAU,GAAGC,qCAAkB,CAAC;AAC9B,MAAC,QAAQ,GAAG;;;;;;"}
@@ -29,8 +29,8 @@ var useStyles = core.createStyles((theme, { padding, radius }) => {
29
29
  return {
30
30
  root: __spreadProps(__spreadValues(__spreadValues({}, theme.fn.fontStyles()), theme.fn.focusStyles()), {
31
31
  boxSizing: "border-box",
32
- backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[7] : theme.white,
33
- border: `2px dashed ${theme.colorScheme === "dark" ? theme.colors.dark[3] : theme.colors.gray[4]}`,
32
+ backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[6] : theme.white,
33
+ border: `2px dashed ${theme.colorScheme === "dark" ? theme.colors.dark[4] : theme.colors.gray[4]}`,
34
34
  padding: theme.fn.size({ size: padding, sizes: theme.spacing }),
35
35
  borderRadius: theme.fn.radius(radius),
36
36
  cursor: "pointer",
@@ -38,28 +38,32 @@ var useStyles = core.createStyles((theme, { padding, radius }) => {
38
38
  transition: "background-color 150ms ease",
39
39
  position: "relative",
40
40
  "&:hover": {
41
- backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[6] : theme.colors.gray[0]
41
+ backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[5] : theme.colors.gray[0]
42
+ },
43
+ "&[data-loading]": {
44
+ cursor: "default",
45
+ "&:hover": {
46
+ backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[6] : theme.white
47
+ }
48
+ },
49
+ "&[data-accept]": {
50
+ backgroundColor: theme.colorScheme === "dark" ? accepted.background : theme.colors[theme.primaryColor][0],
51
+ borderColor: theme.colorScheme === "dark" ? accepted.border : theme.colors[theme.primaryColor][4],
52
+ "&:hover": {
53
+ backgroundColor: theme.colorScheme === "dark" ? accepted.background : theme.colors[theme.primaryColor][0]
54
+ }
55
+ },
56
+ "&[data-reject]": {
57
+ backgroundColor: theme.colorScheme === "dark" ? rejected.background : theme.colors.red[0],
58
+ borderColor: theme.colorScheme === "dark" ? rejected.border : theme.colors.red[4],
59
+ "&:hover": {
60
+ backgroundColor: theme.colorScheme === "dark" ? rejected.background : theme.colors.red[0]
61
+ }
42
62
  }
43
63
  }),
44
- loading: {
45
- cursor: "default",
46
- "&:hover": {
47
- backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[7] : theme.white
48
- }
49
- },
50
- active: {
51
- backgroundColor: theme.colorScheme === "dark" ? accepted.background : theme.colors[theme.primaryColor][0],
52
- borderColor: theme.colorScheme === "dark" ? accepted.border : theme.colors[theme.primaryColor][4],
53
- "&:hover": {
54
- backgroundColor: theme.colorScheme === "dark" ? accepted.background : theme.colors[theme.primaryColor][0]
55
- }
56
- },
57
- reject: {
58
- backgroundColor: theme.colorScheme === "dark" ? rejected.background : theme.colors.red[0],
59
- borderColor: theme.colorScheme === "dark" ? rejected.border : theme.colors.red[4],
60
- "&:hover": {
61
- backgroundColor: theme.colorScheme === "dark" ? rejected.background : theme.colors.red[0]
62
- }
64
+ inner: {
65
+ pointerEvents: "none",
66
+ userSelect: "none"
63
67
  }
64
68
  };
65
69
  });
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dropzone.styles.js","sources":["../src/Dropzone.styles.ts"],"sourcesContent":["import { createStyles, MantineNumberSize } from '@mantine/core';\n\nexport interface DropzoneStylesParams {\n padding: MantineNumberSize;\n radius: MantineNumberSize;\n}\n\nexport default createStyles((theme, { padding, radius }: DropzoneStylesParams) => {\n const rejected = theme.fn.variant({ color: 'red', variant: 'light' });\n const accepted = theme.fn.variant({ color: theme.primaryColor, variant: 'light' });\n\n return {\n root: {\n ...theme.fn.fontStyles(),\n ...theme.fn.focusStyles(),\n boxSizing: 'border-box',\n backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[6] : theme.white,\n border: `2px dashed ${\n theme.colorScheme === 'dark' ? theme.colors.dark[4] : theme.colors.gray[4]\n }`,\n padding: theme.fn.size({ size: padding, sizes: theme.spacing }),\n borderRadius: theme.fn.radius(radius),\n cursor: 'pointer',\n userSelect: 'none',\n transition: 'background-color 150ms ease',\n position: 'relative',\n\n '&:hover': {\n backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[5] : theme.colors.gray[0],\n },\n\n '&[data-loading]': {\n cursor: 'default',\n\n '&:hover': {\n backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[6] : theme.white,\n },\n },\n\n '&[data-accept]': {\n backgroundColor:\n theme.colorScheme === 'dark' ? accepted.background : theme.colors[theme.primaryColor][0],\n borderColor:\n theme.colorScheme === 'dark' ? accepted.border : theme.colors[theme.primaryColor][4],\n\n '&:hover': {\n backgroundColor:\n theme.colorScheme === 'dark'\n ? accepted.background\n : theme.colors[theme.primaryColor][0],\n },\n },\n\n '&[data-reject]': {\n backgroundColor: theme.colorScheme === 'dark' ? rejected.background : theme.colors.red[0],\n borderColor: theme.colorScheme === 'dark' ? rejected.border : theme.colors.red[4],\n\n '&:hover': {\n backgroundColor: theme.colorScheme === 'dark' ? rejected.background : theme.colors.red[0],\n },\n },\n },\n\n inner: {\n pointerEvents: 'none',\n userSelect: 'none',\n },\n };\n});\n"],"names":["createStyles"],"mappings":";;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,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xB,KAAK;AACL,GAAG,CAAC;AACJ,CAAC,CAAC;;;;"}
@@ -0,0 +1,126 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var core = require('@mantine/core');
7
+ var hooks = require('@mantine/hooks');
8
+ var Dropzone = require('./Dropzone.js');
9
+ var DropzoneFullScreen_styles = require('./DropzoneFullScreen.styles.js');
10
+
11
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e['default'] : e; }
12
+
13
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
14
+
15
+ var __defProp = Object.defineProperty;
16
+ var __defProps = Object.defineProperties;
17
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
18
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
19
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
20
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
21
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
22
+ var __spreadValues = (a, b) => {
23
+ for (var prop in b || (b = {}))
24
+ if (__hasOwnProp.call(b, prop))
25
+ __defNormalProp(a, prop, b[prop]);
26
+ if (__getOwnPropSymbols)
27
+ for (var prop of __getOwnPropSymbols(b)) {
28
+ if (__propIsEnum.call(b, prop))
29
+ __defNormalProp(a, prop, b[prop]);
30
+ }
31
+ return a;
32
+ };
33
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
34
+ var __objRest = (source, exclude) => {
35
+ var target = {};
36
+ for (var prop in source)
37
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
38
+ target[prop] = source[prop];
39
+ if (source != null && __getOwnPropSymbols)
40
+ for (var prop of __getOwnPropSymbols(source)) {
41
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
42
+ target[prop] = source[prop];
43
+ }
44
+ return target;
45
+ };
46
+ const fullScreenDefaultProps = __spreadProps(__spreadValues({}, Dropzone.defaultProps), {
47
+ active: true,
48
+ zIndex: core.getDefaultZIndex("max"),
49
+ withinPortal: true
50
+ });
51
+ const DropzoneFullScreen = React.forwardRef((props, ref) => {
52
+ const _a = core.useComponentDefaultProps("DropzoneFullScreen", fullScreenDefaultProps, props), {
53
+ classNames,
54
+ styles,
55
+ sx,
56
+ className,
57
+ style,
58
+ unstyled,
59
+ active,
60
+ onDrop,
61
+ onReject,
62
+ onDragLeave,
63
+ zIndex,
64
+ withinPortal
65
+ } = _a, others = __objRest(_a, [
66
+ "classNames",
67
+ "styles",
68
+ "sx",
69
+ "className",
70
+ "style",
71
+ "unstyled",
72
+ "active",
73
+ "onDrop",
74
+ "onReject",
75
+ "onDragLeave",
76
+ "zIndex",
77
+ "withinPortal"
78
+ ]);
79
+ const [visible, { open, close }] = hooks.useDisclosure(false);
80
+ const { classes, cx } = DropzoneFullScreen_styles['default'](null, {
81
+ name: "DropzoneFullScreen",
82
+ classNames,
83
+ styles,
84
+ unstyled
85
+ });
86
+ React.useEffect(() => {
87
+ if (active) {
88
+ document.addEventListener("dragover", open, false);
89
+ return () => document.removeEventListener("dragover", open, false);
90
+ }
91
+ return void 0;
92
+ }, [active]);
93
+ return /* @__PURE__ */ React__default.createElement(core.OptionalPortal, {
94
+ withinPortal
95
+ }, /* @__PURE__ */ React__default.createElement(core.Box, {
96
+ className: cx(classes.wrapper, className),
97
+ sx,
98
+ style: __spreadProps(__spreadValues({}, style), {
99
+ opacity: visible ? 1 : 0,
100
+ pointerEvents: visible ? "all" : "none",
101
+ zIndex
102
+ })
103
+ }, /* @__PURE__ */ React__default.createElement(Dropzone._Dropzone, __spreadProps(__spreadValues({}, others), {
104
+ classNames,
105
+ styles,
106
+ unstyled,
107
+ ref,
108
+ className: classes.dropzone,
109
+ onDrop: (files) => {
110
+ onDrop == null ? void 0 : onDrop(files);
111
+ close();
112
+ },
113
+ onReject: (files) => {
114
+ onReject == null ? void 0 : onReject(files);
115
+ close();
116
+ },
117
+ onDragLeave: (event) => {
118
+ onDragLeave == null ? void 0 : onDragLeave(event);
119
+ close();
120
+ }
121
+ }))));
122
+ });
123
+ DropzoneFullScreen.displayName = "@mantine/dropzone/DropzoneFullScreen";
124
+
125
+ exports.DropzoneFullScreen = DropzoneFullScreen;
126
+ //# sourceMappingURL=DropzoneFullScreen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DropzoneFullScreen.js","sources":["../src/DropzoneFullScreen.tsx"],"sourcesContent":["import React, { forwardRef, useEffect } from 'react';\nimport {\n Box,\n useComponentDefaultProps,\n OptionalPortal,\n DefaultProps,\n Selectors,\n getDefaultZIndex,\n} from '@mantine/core';\nimport { useDisclosure } from '@mantine/hooks';\n// eslint-disable-next-line import/no-cycle\nimport { defaultProps, DropzoneStylesNames, DropzoneProps, _Dropzone } from './Dropzone';\nimport useFullScreenStyles from './DropzoneFullScreen.styles';\n\nexport type DropzoneFullScreenStylesName =\n | DropzoneStylesNames\n | Exclude<Selectors<typeof useFullScreenStyles>, 'dropzone'>;\n\nexport interface DropzoneFullScreenProps\n extends Omit<DropzoneProps, 'styles' | 'classNames'>,\n DefaultProps<DropzoneFullScreenStylesName> {\n /** Determines whether user can drop files to browser window, true by default */\n active?: boolean;\n\n /** z-index value, 9999 by default */\n zIndex?: React.CSSProperties['zIndex'];\n\n /** Determines whether component should be rendered within Portal, true by default */\n withinPortal?: boolean;\n}\n\nconst fullScreenDefaultProps: Partial<DropzoneFullScreenProps> = {\n ...defaultProps,\n active: true,\n zIndex: getDefaultZIndex('max'),\n withinPortal: true,\n};\n\nexport const DropzoneFullScreen = forwardRef<HTMLDivElement, DropzoneFullScreenProps>(\n (props, ref) => {\n const {\n classNames,\n styles,\n sx,\n className,\n style,\n unstyled,\n active,\n onDrop,\n onReject,\n onDragLeave,\n zIndex,\n withinPortal,\n ...others\n } = useComponentDefaultProps('DropzoneFullScreen', fullScreenDefaultProps, props);\n\n const [visible, { open, close }] = useDisclosure(false);\n const { classes, cx } = useFullScreenStyles(null, {\n name: 'DropzoneFullScreen',\n classNames,\n styles,\n unstyled,\n });\n\n useEffect(() => {\n if (active) {\n document.addEventListener('dragover', open, false);\n return () => document.removeEventListener('dragover', open, false);\n }\n\n return undefined;\n }, [active]);\n\n return (\n <OptionalPortal withinPortal={withinPortal}>\n <Box\n className={cx(classes.wrapper, className)}\n sx={sx}\n style={{\n ...style,\n opacity: visible ? 1 : 0,\n pointerEvents: visible ? 'all' : 'none',\n zIndex,\n }}\n >\n <_Dropzone\n {...others}\n classNames={classNames}\n styles={styles}\n unstyled={unstyled}\n ref={ref}\n className={classes.dropzone}\n onDrop={(files: any) => {\n onDrop?.(files);\n close();\n }}\n onReject={(files: any) => {\n onReject?.(files);\n close();\n }}\n onDragLeave={(event: any) => {\n onDragLeave?.(event);\n close();\n }}\n />\n </Box>\n </OptionalPortal>\n );\n }\n);\n\nDropzoneFullScreen.displayName = '@mantine/dropzone/DropzoneFullScreen';\n"],"names":["defaultProps","getDefaultZIndex","forwardRef","useComponentDefaultProps","useDisclosure","useFullScreenStyles","useEffect","React","OptionalPortal","Box","_Dropzone"],"mappings":";;;;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI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O,CAAC,QAAQ;AAC/B,IAAI,MAAM,EAAE,CAAC,KAAK,KAAK;AACvB,MAAM,MAAM,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9C,MAAM,KAAK,EAAE,CAAC;AACd,KAAK;AACL,IAAI,QAAQ,EAAE,CAAC,KAAK,KAAK;AACzB,MAAM,QAAQ,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;AAClD,MAAM,KAAK,EAAE,CAAC;AACd,KAAK;AACL,IAAI,WAAW,EAAE,CAAC,KAAK,KAAK;AAC5B,MAAM,WAAW,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;AACxD,MAAM,KAAK,EAAE,CAAC;AACd,KAAK;AACL,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACR,CAAC,EAAE;AACH,kBAAkB,CAAC,WAAW,GAAG,sCAAsC;;;;"}
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var core = require('@mantine/core');
6
+
7
+ var useFullScreenStyles = core.createStyles((theme) => ({
8
+ wrapper: {
9
+ position: "fixed",
10
+ top: 0,
11
+ bottom: 0,
12
+ left: 0,
13
+ right: 0,
14
+ backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[7] : theme.white,
15
+ display: "flex",
16
+ padding: theme.spacing.xs,
17
+ transition: "opacity 100ms ease"
18
+ },
19
+ dropzone: {
20
+ flex: 1
21
+ }
22
+ }));
23
+
24
+ exports.default = useFullScreenStyles;
25
+ //# sourceMappingURL=DropzoneFullScreen.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DropzoneFullScreen.styles.js","sources":["../src/DropzoneFullScreen.styles.ts"],"sourcesContent":["import { createStyles } from '@mantine/core';\n\nexport default createStyles((theme) => ({\n wrapper: {\n position: 'fixed',\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[7] : theme.white,\n display: 'flex',\n padding: theme.spacing.xs,\n transition: 'opacity 100ms ease',\n },\n\n dropzone: {\n flex: 1,\n },\n}));\n"],"names":["createStyles"],"mappings":";;;;;;AACA,0BAAeA,iBAAY,CAAC,CAAC,KAAK,MAAM;AACxC,EAAE,OAAO,EAAE;AACX,IAAI,QAAQ,EAAE,OAAO;AACrB,IAAI,GAAG,EAAE,CAAC;AACV,IAAI,MAAM,EAAE,CAAC;AACb,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,KAAK,EAAE,CAAC;AACZ,IAAI,eAAe,EAAE,KAAK,CAAC,WAAW,KAAK,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK;AACtF,IAAI,OAAO,EAAE,MAAM;AACnB,IAAI,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE;AAC7B,IAAI,UAAU,EAAE,oBAAoB;AACpC,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,CAAC;AACX,GAAG;AACH,CAAC,CAAC,CAAC;;;;"}
@@ -0,0 +1,43 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var hooks = require('@mantine/hooks');
6
+ var React = require('react');
7
+ var Dropzone_context = require('./Dropzone.context.js');
8
+
9
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
10
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
11
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
+ var __objRest = (source, exclude) => {
13
+ var target = {};
14
+ for (var prop in source)
15
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
16
+ target[prop] = source[prop];
17
+ if (source != null && __getOwnPropSymbols)
18
+ for (var prop of __getOwnPropSymbols(source)) {
19
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
20
+ target[prop] = source[prop];
21
+ }
22
+ return target;
23
+ };
24
+ function createDropzoneStatus(status) {
25
+ const Component = (_a) => {
26
+ var _b = _a, { children } = _b, others = __objRest(_b, ["children"]);
27
+ const ctx = Dropzone_context.useDropzoneContext();
28
+ if (ctx[status]) {
29
+ return React.cloneElement(React.Children.only(children), others);
30
+ }
31
+ return null;
32
+ };
33
+ Component.displayName = `@mantine/dropzone/${hooks.upperFirst(status)}`;
34
+ return Component;
35
+ }
36
+ const DropzoneAccept = createDropzoneStatus("accept");
37
+ const DropzoneReject = createDropzoneStatus("reject");
38
+ const DropzoneIdle = createDropzoneStatus("idle");
39
+
40
+ exports.DropzoneAccept = DropzoneAccept;
41
+ exports.DropzoneIdle = DropzoneIdle;
42
+ exports.DropzoneReject = DropzoneReject;
43
+ //# sourceMappingURL=DropzoneStatus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DropzoneStatus.js","sources":["../src/DropzoneStatus.tsx"],"sourcesContent":["import { upperFirst } from '@mantine/hooks';\nimport React, { cloneElement, Children } from 'react';\nimport { DropzoneContextValue, useDropzoneContext } from './Dropzone.context';\n\nexport interface DropzoneStatusProps {\n children: React.ReactNode;\n}\n\nfunction createDropzoneStatus(status: keyof DropzoneContextValue) {\n const Component = ({ children, ...others }: DropzoneStatusProps): JSX.Element => {\n const ctx = useDropzoneContext();\n if (ctx[status]) {\n return cloneElement(Children.only(children) as React.ReactElement, others);\n }\n\n return null;\n };\n\n Component.displayName = `@mantine/dropzone/${upperFirst(status)}`;\n\n return Component;\n}\n\nexport const DropzoneAccept = createDropzoneStatus('accept');\nexport const DropzoneReject = createDropzoneStatus('reject');\nexport const DropzoneIdle = createDropzoneStatus('idle');\n\nexport type DropzoneAcceptProps = DropzoneStatusProps;\nexport type DropzoneRejectProps = DropzoneStatusProps;\nexport type DropzoneIdleProps = DropzoneStatusProps;\n"],"names":["useDropzoneContext","cloneElement","Children","upperFirst"],"mappings":";;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OAAOC,kBAAY,CAACC,cAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;AAC3D,KAAK;AACL,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG,CAAC;AACJ,EAAE,SAAS,CAAC,WAAW,GAAG,CAAC,kBAAkB,EAAEC,gBAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACpE,EAAE,OAAO,SAAS,CAAC;AACnB,CAAC;AACW,MAAC,cAAc,GAAG,oBAAoB,CAAC,QAAQ,EAAE;AACjD,MAAC,cAAc,GAAG,oBAAoB,CAAC,QAAQ,EAAE;AACjD,MAAC,YAAY,GAAG,oBAAoB,CAAC,MAAM;;;;;;"}
package/cjs/index.js CHANGED
@@ -2,18 +2,17 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var Dropzone = require('./Dropzone.js');
5
6
  var mimeTypes = require('./mime-types.js');
6
- var Dropzone = require('./Dropzone/Dropzone.js');
7
- var FullScreenDropzone = require('./FullScreenDropzone/FullScreenDropzone.js');
8
7
 
9
8
 
10
9
 
10
+ exports.Dropzone = Dropzone.Dropzone;
11
+ exports.EXE_MIME_TYPE = mimeTypes.EXE_MIME_TYPE;
11
12
  exports.IMAGE_MIME_TYPE = mimeTypes.IMAGE_MIME_TYPE;
12
13
  exports.MIME_TYPES = mimeTypes.MIME_TYPES;
13
14
  exports.MS_EXCEL_MIME_TYPE = mimeTypes.MS_EXCEL_MIME_TYPE;
14
15
  exports.MS_POWERPOINT_MIME_TYPE = mimeTypes.MS_POWERPOINT_MIME_TYPE;
15
16
  exports.MS_WORD_MIME_TYPE = mimeTypes.MS_WORD_MIME_TYPE;
16
17
  exports.PDF_MIME_TYPE = mimeTypes.PDF_MIME_TYPE;
17
- exports.Dropzone = Dropzone.Dropzone;
18
- exports.FullScreenDropzone = FullScreenDropzone.FullScreenDropzone;
19
18
  //# sourceMappingURL=index.js.map
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
package/cjs/mime-types.js CHANGED
@@ -17,7 +17,8 @@ const MIME_TYPES = {
17
17
  xls: "application/vnd.ms-excel",
18
18
  xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
19
19
  ppt: "application/vnd.ms-powerpoint",
20
- pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
20
+ pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
21
+ exe: "application/vnd.microsoft.portable-executable"
21
22
  };
22
23
  const IMAGE_MIME_TYPE = [
23
24
  MIME_TYPES.png,
@@ -30,7 +31,9 @@ const PDF_MIME_TYPE = [MIME_TYPES.pdf];
30
31
  const MS_WORD_MIME_TYPE = [MIME_TYPES.doc, MIME_TYPES.docx];
31
32
  const MS_EXCEL_MIME_TYPE = [MIME_TYPES.xls, MIME_TYPES.xlsx];
32
33
  const MS_POWERPOINT_MIME_TYPE = [MIME_TYPES.ppt, MIME_TYPES.pptx];
34
+ const EXE_MIME_TYPE = [MIME_TYPES.exe];
33
35
 
36
+ exports.EXE_MIME_TYPE = EXE_MIME_TYPE;
34
37
  exports.IMAGE_MIME_TYPE = IMAGE_MIME_TYPE;
35
38
  exports.MIME_TYPES = MIME_TYPES;
36
39
  exports.MS_EXCEL_MIME_TYPE = MS_EXCEL_MIME_TYPE;
@@ -1 +1 @@
1
- {"version":3,"file":"mime-types.js","sources":["../src/mime-types.ts"],"sourcesContent":["export const MIME_TYPES = {\n // Images\n png: 'image/png',\n gif: 'image/gif',\n jpeg: 'image/jpeg',\n svg: 'image/svg+xml',\n webp: 'image/webp',\n\n // Documents\n mp4: 'video/mp4',\n zip: 'application/zip',\n csv: 'text/csv',\n pdf: 'application/pdf',\n doc: 'application/msword',\n docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n xls: 'application/vnd.ms-excel',\n xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n ppt: 'application/vnd.ms-powerpoint',\n pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n} as const;\n\nexport const IMAGE_MIME_TYPE = [\n MIME_TYPES.png,\n MIME_TYPES.gif,\n MIME_TYPES.jpeg,\n MIME_TYPES.svg,\n MIME_TYPES.webp,\n];\n\nexport const PDF_MIME_TYPE = [MIME_TYPES.pdf];\nexport const MS_WORD_MIME_TYPE = [MIME_TYPES.doc, MIME_TYPES.docx];\nexport const MS_EXCEL_MIME_TYPE = [MIME_TYPES.xls, MIME_TYPES.xlsx];\nexport const MS_POWERPOINT_MIME_TYPE = [MIME_TYPES.ppt, MIME_TYPES.pptx];\n"],"names":[],"mappings":";;;;AAAY,MAAC,UAAU,GAAG;AAC1B,EAAE,GAAG,EAAE,WAAW;AAClB,EAAE,GAAG,EAAE,WAAW;AAClB,EAAE,IAAI,EAAE,YAAY;AACpB,EAAE,GAAG,EAAE,eAAe;AACtB,EAAE,IAAI,EAAE,YAAY;AACpB,EAAE,GAAG,EAAE,WAAW;AAClB,EAAE,GAAG,EAAE,iBAAiB;AACxB,EAAE,GAAG,EAAE,UAAU;AACjB,EAAE,GAAG,EAAE,iBAAiB;AACxB,EAAE,GAAG,EAAE,oBAAoB;AAC3B,EAAE,IAAI,EAAE,yEAAyE;AACjF,EAAE,GAAG,EAAE,0BAA0B;AACjC,EAAE,IAAI,EAAE,mEAAmE;AAC3E,EAAE,GAAG,EAAE,+BAA+B;AACtC,EAAE,IAAI,EAAE,2EAA2E;AACnF,EAAE;AACU,MAAC,eAAe,GAAG;AAC/B,EAAE,UAAU,CAAC,GAAG;AAChB,EAAE,UAAU,CAAC,GAAG;AAChB,EAAE,UAAU,CAAC,IAAI;AACjB,EAAE,UAAU,CAAC,GAAG;AAChB,EAAE,UAAU,CAAC,IAAI;AACjB,EAAE;AACU,MAAC,aAAa,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE;AAClC,MAAC,iBAAiB,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,IAAI,EAAE;AACvD,MAAC,kBAAkB,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,IAAI,EAAE;AACxD,MAAC,uBAAuB,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,IAAI;;;;;;;;;"}
1
+ {"version":3,"file":"mime-types.js","sources":["../src/mime-types.ts"],"sourcesContent":["export const MIME_TYPES = {\n // Images\n png: 'image/png',\n gif: 'image/gif',\n jpeg: 'image/jpeg',\n svg: 'image/svg+xml',\n webp: 'image/webp',\n\n // Documents\n mp4: 'video/mp4',\n zip: 'application/zip',\n csv: 'text/csv',\n pdf: 'application/pdf',\n doc: 'application/msword',\n docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n xls: 'application/vnd.ms-excel',\n xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n ppt: 'application/vnd.ms-powerpoint',\n pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n exe: 'application/vnd.microsoft.portable-executable',\n} as const;\n\nexport const IMAGE_MIME_TYPE = [\n MIME_TYPES.png,\n MIME_TYPES.gif,\n MIME_TYPES.jpeg,\n MIME_TYPES.svg,\n MIME_TYPES.webp,\n];\n\nexport const PDF_MIME_TYPE = [MIME_TYPES.pdf];\nexport const MS_WORD_MIME_TYPE = [MIME_TYPES.doc, MIME_TYPES.docx];\nexport const MS_EXCEL_MIME_TYPE = [MIME_TYPES.xls, MIME_TYPES.xlsx];\nexport const MS_POWERPOINT_MIME_TYPE = [MIME_TYPES.ppt, MIME_TYPES.pptx];\nexport const EXE_MIME_TYPE = [MIME_TYPES.exe];\n"],"names":[],"mappings":";;;;AAAY,MAAC,UAAU,GAAG;AAC1B,EAAE,GAAG,EAAE,WAAW;AAClB,EAAE,GAAG,EAAE,WAAW;AAClB,EAAE,IAAI,EAAE,YAAY;AACpB,EAAE,GAAG,EAAE,eAAe;AACtB,EAAE,IAAI,EAAE,YAAY;AACpB,EAAE,GAAG,EAAE,WAAW;AAClB,EAAE,GAAG,EAAE,iBAAiB;AACxB,EAAE,GAAG,EAAE,UAAU;AACjB,EAAE,GAAG,EAAE,iBAAiB;AACxB,EAAE,GAAG,EAAE,oBAAoB;AAC3B,EAAE,IAAI,EAAE,yEAAyE;AACjF,EAAE,GAAG,EAAE,0BAA0B;AACjC,EAAE,IAAI,EAAE,mEAAmE;AAC3E,EAAE,GAAG,EAAE,+BAA+B;AACtC,EAAE,IAAI,EAAE,2EAA2E;AACnF,EAAE,GAAG,EAAE,+CAA+C;AACtD,EAAE;AACU,MAAC,eAAe,GAAG;AAC/B,EAAE,UAAU,CAAC,GAAG;AAChB,EAAE,UAAU,CAAC,GAAG;AAChB,EAAE,UAAU,CAAC,IAAI;AACjB,EAAE,UAAU,CAAC,GAAG;AAChB,EAAE,UAAU,CAAC,IAAI;AACjB,EAAE;AACU,MAAC,aAAa,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE;AAClC,MAAC,iBAAiB,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,IAAI,EAAE;AACvD,MAAC,kBAAkB,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,IAAI,EAAE;AACxD,MAAC,uBAAuB,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,IAAI,EAAE;AAC7D,MAAC,aAAa,GAAG,CAAC,UAAU,CAAC,GAAG;;;;;;;;;;"}
@@ -0,0 +1,6 @@
1
+ import { createSafeContext } from '@mantine/utils';
2
+
3
+ const [DropzoneProvider, useDropzoneContext] = createSafeContext("Dropzone component was not found in tree");
4
+
5
+ export { DropzoneProvider, useDropzoneContext };
6
+ //# sourceMappingURL=Dropzone.context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dropzone.context.js","sources":["../src/Dropzone.context.ts"],"sourcesContent":["import { createSafeContext } from '@mantine/utils';\n\nexport interface DropzoneContextValue {\n idle: boolean;\n accept: boolean;\n reject: boolean;\n}\n\nexport const [DropzoneProvider, useDropzoneContext] = createSafeContext<DropzoneContextValue>(\n 'Dropzone component was not found in tree'\n);\n"],"names":[],"mappings":";;AACY,MAAC,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,GAAG,iBAAiB,CAAC,0CAA0C;;;;"}