@xsolla/xui-drag-drop-uploader 0.154.2-pr295.1779148328

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.
@@ -0,0 +1,49 @@
1
+ import React from 'react';
2
+ import { ThemeOverrideProps } from '@xsolla/xui-core';
3
+
4
+ type DragDropUploaderSize = "xl" | "lg" | "md" | "sm" | "xs";
5
+ type DragDropUploaderVisualState = "default" | "hover" | "drag" | "disabled" | "error";
6
+ type DragDropUploaderFile = {
7
+ name: string;
8
+ size: number;
9
+ mimeType?: string;
10
+ uri?: string;
11
+ /** The original DOM File (web only). */
12
+ file?: File;
13
+ };
14
+ interface DragDropUploaderProps extends ThemeOverrideProps {
15
+ /** Size of the drop area. Figma default is `sm`. */
16
+ size?: DragDropUploaderSize;
17
+ /** Main prompt in the drop area. Set to `null` to hide it. */
18
+ title?: React.ReactNode;
19
+ /** Supporting text in the drop area. Set to `null` to hide it. */
20
+ description?: React.ReactNode;
21
+ /** Error message shown below the drop area; also switches to error styling. */
22
+ errorMessage?: string;
23
+ /** Controlled file list. */
24
+ files?: DragDropUploaderFile[];
25
+ /** Initial uncontrolled file list. */
26
+ defaultFiles?: DragDropUploaderFile[];
27
+ /** Accepted file types, passed to the hidden web file input. */
28
+ accept?: string;
29
+ /** Whether multiple files can be selected. */
30
+ multiple?: boolean;
31
+ /** Disabled state. */
32
+ disabled?: boolean;
33
+ /** Loading state disables user interaction. */
34
+ loading?: boolean;
35
+ /** Optional fixed width for the root. Defaults follow Figma. */
36
+ width?: number | string;
37
+ /** Test/story-only visual override for documenting non-persistent states. */
38
+ visualState?: DragDropUploaderVisualState;
39
+ /** Fires whenever the selected file list changes. */
40
+ onFilesChange?: (files: DragDropUploaderFile[]) => void;
41
+ /** Fires with only the files from a user pick/drop action. */
42
+ onDropFiles?: (files: DragDropUploaderFile[]) => void;
43
+ /** Fires when a file is removed from the rendered list. */
44
+ onRemoveFile?: (file: DragDropUploaderFile, index: number) => void;
45
+ }
46
+
47
+ declare const DragDropUploader: React.ForwardRefExoticComponent<DragDropUploaderProps & React.RefAttributes<HTMLInputElement>>;
48
+
49
+ export { DragDropUploader, type DragDropUploaderFile, type DragDropUploaderProps, type DragDropUploaderSize, type DragDropUploaderVisualState };
@@ -0,0 +1,49 @@
1
+ import React from 'react';
2
+ import { ThemeOverrideProps } from '@xsolla/xui-core';
3
+
4
+ type DragDropUploaderSize = "xl" | "lg" | "md" | "sm" | "xs";
5
+ type DragDropUploaderVisualState = "default" | "hover" | "drag" | "disabled" | "error";
6
+ type DragDropUploaderFile = {
7
+ name: string;
8
+ size: number;
9
+ mimeType?: string;
10
+ uri?: string;
11
+ /** The original DOM File (web only). */
12
+ file?: File;
13
+ };
14
+ interface DragDropUploaderProps extends ThemeOverrideProps {
15
+ /** Size of the drop area. Figma default is `sm`. */
16
+ size?: DragDropUploaderSize;
17
+ /** Main prompt in the drop area. Set to `null` to hide it. */
18
+ title?: React.ReactNode;
19
+ /** Supporting text in the drop area. Set to `null` to hide it. */
20
+ description?: React.ReactNode;
21
+ /** Error message shown below the drop area; also switches to error styling. */
22
+ errorMessage?: string;
23
+ /** Controlled file list. */
24
+ files?: DragDropUploaderFile[];
25
+ /** Initial uncontrolled file list. */
26
+ defaultFiles?: DragDropUploaderFile[];
27
+ /** Accepted file types, passed to the hidden web file input. */
28
+ accept?: string;
29
+ /** Whether multiple files can be selected. */
30
+ multiple?: boolean;
31
+ /** Disabled state. */
32
+ disabled?: boolean;
33
+ /** Loading state disables user interaction. */
34
+ loading?: boolean;
35
+ /** Optional fixed width for the root. Defaults follow Figma. */
36
+ width?: number | string;
37
+ /** Test/story-only visual override for documenting non-persistent states. */
38
+ visualState?: DragDropUploaderVisualState;
39
+ /** Fires whenever the selected file list changes. */
40
+ onFilesChange?: (files: DragDropUploaderFile[]) => void;
41
+ /** Fires with only the files from a user pick/drop action. */
42
+ onDropFiles?: (files: DragDropUploaderFile[]) => void;
43
+ /** Fires when a file is removed from the rendered list. */
44
+ onRemoveFile?: (file: DragDropUploaderFile, index: number) => void;
45
+ }
46
+
47
+ declare const DragDropUploader: React.ForwardRefExoticComponent<DragDropUploaderProps & React.RefAttributes<HTMLInputElement>>;
48
+
49
+ export { DragDropUploader, type DragDropUploaderFile, type DragDropUploaderProps, type DragDropUploaderSize, type DragDropUploaderVisualState };
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.tsx
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ DragDropUploader: () => DragDropUploader
24
+ });
25
+ module.exports = __toCommonJS(index_exports);
26
+
27
+ // src/DragDropUploader.native.tsx
28
+ var import_react = require("react");
29
+ var DragDropUploader = (0, import_react.forwardRef)(
30
+ () => null
31
+ );
32
+ DragDropUploader.displayName = "DragDropUploader";
33
+ // Annotate the CommonJS export names for ESM import in node:
34
+ 0 && (module.exports = {
35
+ DragDropUploader
36
+ });
37
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/index.tsx","../../src/DragDropUploader.native.tsx"],"sourcesContent":["export * from \"./DragDropUploader\";\n","import React, { forwardRef } from \"react\";\nimport type {\n DragDropUploaderFile,\n DragDropUploaderProps,\n DragDropUploaderSize,\n DragDropUploaderVisualState,\n} from \"./types\";\n\nexport type {\n DragDropUploaderFile,\n DragDropUploaderProps,\n DragDropUploaderSize,\n DragDropUploaderVisualState,\n};\n\nexport const DragDropUploader = forwardRef<never, DragDropUploaderProps>(\n () => null\n);\n\nDragDropUploader.displayName = \"DragDropUploader\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAkC;AAe3B,IAAM,uBAAmB;AAAA,EAC9B,MAAM;AACR;AAEA,iBAAiB,cAAc;","names":[]}
@@ -0,0 +1,10 @@
1
+ // src/DragDropUploader.native.tsx
2
+ import { forwardRef } from "react";
3
+ var DragDropUploader = forwardRef(
4
+ () => null
5
+ );
6
+ DragDropUploader.displayName = "DragDropUploader";
7
+ export {
8
+ DragDropUploader
9
+ };
10
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/DragDropUploader.native.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\nimport type {\n DragDropUploaderFile,\n DragDropUploaderProps,\n DragDropUploaderSize,\n DragDropUploaderVisualState,\n} from \"./types\";\n\nexport type {\n DragDropUploaderFile,\n DragDropUploaderProps,\n DragDropUploaderSize,\n DragDropUploaderVisualState,\n};\n\nexport const DragDropUploader = forwardRef<never, DragDropUploaderProps>(\n () => null\n);\n\nDragDropUploader.displayName = \"DragDropUploader\";\n"],"mappings":";AAAA,SAAgB,kBAAkB;AAe3B,IAAM,mBAAmB;AAAA,EAC9B,MAAM;AACR;AAEA,iBAAiB,cAAc;","names":[]}
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@xsolla/xui-drag-drop-uploader",
3
+ "version": "0.154.2-pr295.1779148328",
4
+ "main": "./web/index.js",
5
+ "module": "./web/index.mjs",
6
+ "types": "./web/index.d.ts",
7
+ "scripts": {
8
+ "build": "yarn build:web && yarn build:native",
9
+ "build:web": "PLATFORM=web tsup",
10
+ "build:native": "PLATFORM=native tsup",
11
+ "test": "vitest",
12
+ "test:run": "vitest run",
13
+ "test:coverage": "vitest run --coverage"
14
+ },
15
+ "dependencies": {
16
+ "@xsolla/xui-core": "0.154.2-pr295.1779148328",
17
+ "@xsolla/xui-icons-base": "0.154.2-pr295.1779148328",
18
+ "@xsolla/xui-primitives-core": "0.154.2-pr295.1779148328"
19
+ },
20
+ "peerDependencies": {
21
+ "react": ">=16.8.0"
22
+ },
23
+ "devDependencies": {
24
+ "@testing-library/jest-dom": "^6.6.3",
25
+ "@testing-library/react": "^14.1.2",
26
+ "@vitest/coverage-v8": "^4.0.18",
27
+ "jsdom": "^24.0.0",
28
+ "react": "^18.0.0",
29
+ "react-dom": "^18.0.0",
30
+ "tsup": "^8.0.0",
31
+ "vitest": "^4.0.18"
32
+ },
33
+ "license": "MIT",
34
+ "sideEffects": false,
35
+ "react-native": "./native/index.js",
36
+ "exports": {
37
+ ".": {
38
+ "react-native": {
39
+ "types": "./native/index.d.ts",
40
+ "import": "./native/index.mjs",
41
+ "require": "./native/index.js"
42
+ },
43
+ "import": {
44
+ "types": "./web/index.d.ts",
45
+ "default": "./web/index.mjs"
46
+ },
47
+ "require": {
48
+ "types": "./web/index.d.ts",
49
+ "default": "./web/index.js"
50
+ },
51
+ "default": {
52
+ "types": "./web/index.d.ts",
53
+ "default": "./web/index.js"
54
+ }
55
+ }
56
+ }
57
+ }
@@ -0,0 +1,49 @@
1
+ import React from 'react';
2
+ import { ThemeOverrideProps } from '@xsolla/xui-core';
3
+
4
+ type DragDropUploaderSize = "xl" | "lg" | "md" | "sm" | "xs";
5
+ type DragDropUploaderVisualState = "default" | "hover" | "drag" | "disabled" | "error";
6
+ type DragDropUploaderFile = {
7
+ name: string;
8
+ size: number;
9
+ mimeType?: string;
10
+ uri?: string;
11
+ /** The original DOM File (web only). */
12
+ file?: File;
13
+ };
14
+ interface DragDropUploaderProps extends ThemeOverrideProps {
15
+ /** Size of the drop area. Figma default is `sm`. */
16
+ size?: DragDropUploaderSize;
17
+ /** Main prompt in the drop area. Set to `null` to hide it. */
18
+ title?: React.ReactNode;
19
+ /** Supporting text in the drop area. Set to `null` to hide it. */
20
+ description?: React.ReactNode;
21
+ /** Error message shown below the drop area; also switches to error styling. */
22
+ errorMessage?: string;
23
+ /** Controlled file list. */
24
+ files?: DragDropUploaderFile[];
25
+ /** Initial uncontrolled file list. */
26
+ defaultFiles?: DragDropUploaderFile[];
27
+ /** Accepted file types, passed to the hidden web file input. */
28
+ accept?: string;
29
+ /** Whether multiple files can be selected. */
30
+ multiple?: boolean;
31
+ /** Disabled state. */
32
+ disabled?: boolean;
33
+ /** Loading state disables user interaction. */
34
+ loading?: boolean;
35
+ /** Optional fixed width for the root. Defaults follow Figma. */
36
+ width?: number | string;
37
+ /** Test/story-only visual override for documenting non-persistent states. */
38
+ visualState?: DragDropUploaderVisualState;
39
+ /** Fires whenever the selected file list changes. */
40
+ onFilesChange?: (files: DragDropUploaderFile[]) => void;
41
+ /** Fires with only the files from a user pick/drop action. */
42
+ onDropFiles?: (files: DragDropUploaderFile[]) => void;
43
+ /** Fires when a file is removed from the rendered list. */
44
+ onRemoveFile?: (file: DragDropUploaderFile, index: number) => void;
45
+ }
46
+
47
+ declare const DragDropUploader: React.ForwardRefExoticComponent<DragDropUploaderProps & React.RefAttributes<HTMLInputElement>>;
48
+
49
+ export { DragDropUploader, type DragDropUploaderFile, type DragDropUploaderProps, type DragDropUploaderSize, type DragDropUploaderVisualState };
package/web/index.d.ts ADDED
@@ -0,0 +1,49 @@
1
+ import React from 'react';
2
+ import { ThemeOverrideProps } from '@xsolla/xui-core';
3
+
4
+ type DragDropUploaderSize = "xl" | "lg" | "md" | "sm" | "xs";
5
+ type DragDropUploaderVisualState = "default" | "hover" | "drag" | "disabled" | "error";
6
+ type DragDropUploaderFile = {
7
+ name: string;
8
+ size: number;
9
+ mimeType?: string;
10
+ uri?: string;
11
+ /** The original DOM File (web only). */
12
+ file?: File;
13
+ };
14
+ interface DragDropUploaderProps extends ThemeOverrideProps {
15
+ /** Size of the drop area. Figma default is `sm`. */
16
+ size?: DragDropUploaderSize;
17
+ /** Main prompt in the drop area. Set to `null` to hide it. */
18
+ title?: React.ReactNode;
19
+ /** Supporting text in the drop area. Set to `null` to hide it. */
20
+ description?: React.ReactNode;
21
+ /** Error message shown below the drop area; also switches to error styling. */
22
+ errorMessage?: string;
23
+ /** Controlled file list. */
24
+ files?: DragDropUploaderFile[];
25
+ /** Initial uncontrolled file list. */
26
+ defaultFiles?: DragDropUploaderFile[];
27
+ /** Accepted file types, passed to the hidden web file input. */
28
+ accept?: string;
29
+ /** Whether multiple files can be selected. */
30
+ multiple?: boolean;
31
+ /** Disabled state. */
32
+ disabled?: boolean;
33
+ /** Loading state disables user interaction. */
34
+ loading?: boolean;
35
+ /** Optional fixed width for the root. Defaults follow Figma. */
36
+ width?: number | string;
37
+ /** Test/story-only visual override for documenting non-persistent states. */
38
+ visualState?: DragDropUploaderVisualState;
39
+ /** Fires whenever the selected file list changes. */
40
+ onFilesChange?: (files: DragDropUploaderFile[]) => void;
41
+ /** Fires with only the files from a user pick/drop action. */
42
+ onDropFiles?: (files: DragDropUploaderFile[]) => void;
43
+ /** Fires when a file is removed from the rendered list. */
44
+ onRemoveFile?: (file: DragDropUploaderFile, index: number) => void;
45
+ }
46
+
47
+ declare const DragDropUploader: React.ForwardRefExoticComponent<DragDropUploaderProps & React.RefAttributes<HTMLInputElement>>;
48
+
49
+ export { DragDropUploader, type DragDropUploaderFile, type DragDropUploaderProps, type DragDropUploaderSize, type DragDropUploaderVisualState };