@ultraviolet/ui 3.16.0 → 3.17.0
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/dist/_virtual/_@oxc-project_runtime@0.130.0/helpers/asyncToGenerator.js +34 -0
- package/dist/components/Avatar/styles.css.js +2 -0
- package/dist/components/Checkbox/styles.css.js +4 -0
- package/dist/components/Description/index.d.ts +2 -3
- package/dist/components/Description/index.d.ts.map +1 -1
- package/dist/components/Description/index.js +1 -0
- package/dist/components/FileInput/components/List.js +5 -2
- package/dist/components/FileInput/helpers.d.ts +5 -1
- package/dist/components/FileInput/helpers.d.ts.map +1 -1
- package/dist/components/FileInput/helpers.js +65 -3
- package/dist/components/FileInput/index.d.ts +1 -1
- package/dist/components/FileInput/index.d.ts.map +1 -1
- package/dist/components/FileInput/index.js +26 -15
- package/dist/components/FileInput/styles.css.d.ts +1 -0
- package/dist/components/FileInput/styles.css.d.ts.map +1 -1
- package/dist/components/FileInput/styles.css.js +8 -7
- package/dist/components/FileInput/types.d.ts +11 -0
- package/dist/components/FileInput/types.d.ts.map +1 -1
- package/dist/components/Key/constants.d.ts +6 -6
- package/dist/components/Key/constants.d.ts.map +1 -1
- package/dist/components/PhoneInput/PhoneInput.d.ts +36 -0
- package/dist/components/PhoneInput/PhoneInput.d.ts.map +1 -0
- package/dist/components/PhoneInput/PhoneInput.js +152 -0
- package/dist/components/PhoneInput/constants.d.ts +6 -0
- package/dist/components/PhoneInput/constants.d.ts.map +1 -0
- package/dist/components/PhoneInput/index.d.ts +2 -0
- package/dist/components/PhoneInput/index.d.ts.map +1 -0
- package/dist/components/PhoneInput/index.js +9 -0
- package/dist/components/PhoneInput/styles.css.d.ts +7 -0
- package/dist/components/PhoneInput/styles.css.d.ts.map +1 -0
- package/dist/components/PhoneInput/styles.css.js +22 -0
- package/dist/components/PhoneInput/styles.css.ts.vanilla.js +8 -0
- package/dist/components/Popup/styles.css.js +4 -0
- package/dist/components/ProgressBar/styles.css.js +2 -0
- package/dist/components/SelectInput/components/Dropdown/AddOption.d.ts +1 -1
- package/dist/components/SelectInput/components/Dropdown/AddOption.d.ts.map +1 -1
- package/dist/components/SelectInput/components/Dropdown/Content.d.ts.map +1 -1
- package/dist/components/SelectInput/components/Dropdown/Content.js +3 -8
- package/dist/components/SelectInput/components/Dropdown/Item.d.ts +1 -1
- package/dist/components/SelectInput/components/Dropdown/Item.d.ts.map +1 -1
- package/dist/components/SelectInput/components/Dropdown/Option.d.ts +1 -1
- package/dist/components/SelectInput/components/Dropdown/Option.d.ts.map +1 -1
- package/dist/components/SelectInput/components/Dropdown/Option.js +1 -5
- package/dist/components/SelectInput/components/Dropdown/SelectAll.d.ts +1 -1
- package/dist/components/SelectInput/components/Dropdown/SelectAll.d.ts.map +1 -1
- package/dist/components/SelectInput/components/Dropdown/SelectAll.js +1 -1
- package/dist/components/SelectInput/components/SelectBar/SelectBar.d.ts.map +1 -1
- package/dist/components/SelectInput/components/SelectBar/SelectBar.js +1 -5
- package/dist/components/SelectInput/components/SelectBar/Values.d.ts +1 -1
- package/dist/components/SelectInput/components/SelectBar/Values.d.ts.map +1 -1
- package/dist/components/Table/styles.css.js +2 -0
- package/dist/components/Text/index.d.ts +3 -2
- package/dist/components/Text/index.d.ts.map +1 -1
- package/dist/components/Text/index.js +2 -1
- package/dist/components/TextInput/styles.css.d.ts.map +1 -1
- package/dist/components/Toaster/Toaster.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +3 -0
- package/dist/composition.js +2 -1
- package/dist/compositions/Navigation/styles.css.js +4 -0
- package/dist/compositions/Navigation/variables.css.js +0 -2
- package/dist/compositions/OptionSelector/styles.css.js +0 -14
- package/dist/compositions/SteppedListCard/styles.css.js +0 -2
- package/dist/index.js +2 -1
- package/dist/ui.css +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { __esmMin, __name } from "../../_rolldown/runtime.js";
|
|
2
|
+
|
|
3
|
+
//#region \0@oxc-project+runtime@0.130.0/helpers/asyncToGenerator.js
|
|
4
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
5
|
+
try {
|
|
6
|
+
var i = n[a](c);
|
|
7
|
+
var u = i.value;
|
|
8
|
+
} catch (n) {
|
|
9
|
+
e(n);
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
13
|
+
}
|
|
14
|
+
function _asyncToGenerator(n) {
|
|
15
|
+
return function() {
|
|
16
|
+
var t = this;
|
|
17
|
+
var e = arguments;
|
|
18
|
+
return new Promise(function(r, o) {
|
|
19
|
+
var a = n.apply(t, e);
|
|
20
|
+
function _next(n) {
|
|
21
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
22
|
+
}
|
|
23
|
+
function _throw(n) {
|
|
24
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
25
|
+
}
|
|
26
|
+
_next(void 0);
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
var init_asyncToGenerator = __esmMin(() => {});
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
init_asyncToGenerator();
|
|
34
|
+
export { _asyncToGenerator, init_asyncToGenerator };
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { init_styles_css_ts_vanilla } from "./styles.css.ts.vanilla.js";
|
|
3
|
+
import { init_variables_css_ts_vanilla } from "./variables.css.ts.vanilla.js";
|
|
3
4
|
import { createRuntimeFn } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
4
5
|
|
|
5
6
|
//#region src/components/Avatar/styles.css.ts
|
|
6
7
|
var avatarStyle;
|
|
7
8
|
var init_styles_css = __esmMin(() => {
|
|
9
|
+
init_variables_css_ts_vanilla();
|
|
8
10
|
init_styles_css_ts_vanilla();
|
|
9
11
|
avatarStyle = {
|
|
10
12
|
container: createRuntimeFn({
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { init_styles_css_ts_vanilla } from "../CheckboxGroup/styles.css.ts.vanilla.js";
|
|
3
|
+
import { init_variables_css_ts_vanilla } from "../List/variables.css.ts.vanilla.js";
|
|
3
4
|
import { init_styles_css_ts_vanilla as init_styles_css_ts_vanilla$1 } from "../List/styles.css.ts.vanilla.js";
|
|
5
|
+
import { init_variables_css_ts_vanilla as init_variables_css_ts_vanilla$1 } from "../SelectableCard/variables.css.ts.vanilla.js";
|
|
4
6
|
import { init_styles_css_ts_vanilla as init_styles_css_ts_vanilla$2 } from "../SelectableCard/styles.css.ts.vanilla.js";
|
|
5
7
|
import { init_styles_css_ts_vanilla as init_styles_css_ts_vanilla$3 } from "./styles.css.ts.vanilla.js";
|
|
6
8
|
|
|
@@ -8,7 +10,9 @@ import { init_styles_css_ts_vanilla as init_styles_css_ts_vanilla$3 } from "./st
|
|
|
8
10
|
var checkboxStyle;
|
|
9
11
|
var init_styles_css = __esmMin(() => {
|
|
10
12
|
init_styles_css_ts_vanilla();
|
|
13
|
+
init_variables_css_ts_vanilla();
|
|
11
14
|
init_styles_css_ts_vanilla$1();
|
|
15
|
+
init_variables_css_ts_vanilla$1();
|
|
12
16
|
init_styles_css_ts_vanilla$2();
|
|
13
17
|
init_styles_css_ts_vanilla$3();
|
|
14
18
|
checkboxStyle = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
type
|
|
2
|
+
export type DescriptionProps = {
|
|
3
3
|
helper?: ReactNode;
|
|
4
4
|
success?: string | boolean;
|
|
5
5
|
error?: ReactNode;
|
|
@@ -10,6 +10,5 @@ type HelperProps = {
|
|
|
10
10
|
/**
|
|
11
11
|
* Description is used inside all of our input components, but it can be used outside for design purposes
|
|
12
12
|
*/
|
|
13
|
-
export declare const Description: ({ size, id, disabled, helper, success, error, style, className, }:
|
|
14
|
-
export {};
|
|
13
|
+
export declare const Description: ({ size, id, disabled, helper, success, error, style, className, }: DescriptionProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
15
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Description/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItD,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Description/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAA;IACnC,EAAE,EAAE,MAAM,CAAA;CACX,GAAG,IAAI,CAAC,cAAc,CAAC,oBAAoB,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,CAAA;AACrE;;GAEG;AACH,eAAO,MAAM,WAAW,sEASrB,gBAAgB,mDA2ClB,CAAA"}
|
|
@@ -30,6 +30,7 @@ var init_Description = __esmMin(() => {
|
|
|
30
30
|
hasTextSuccess
|
|
31
31
|
]);
|
|
32
32
|
return helper || hasTextError || hasTextSuccess ? /* @__PURE__ */ jsx(Text, {
|
|
33
|
+
role: "status",
|
|
33
34
|
as: "span",
|
|
34
35
|
variant: size === "small" ? "captionSmall" : "caption",
|
|
35
36
|
sentiment: computedSentiment,
|
|
@@ -81,6 +81,8 @@ var init_List = __esmMin(() => {
|
|
|
81
81
|
direction: "row",
|
|
82
82
|
gap: 1,
|
|
83
83
|
wrap: "wrap",
|
|
84
|
+
as: "ul",
|
|
85
|
+
className: fileInputStyle.fileListContainer,
|
|
84
86
|
children: [files.map((file, index) => {
|
|
85
87
|
if (!computedLimit || index < computedLimit) {
|
|
86
88
|
const illustration = getIllustration(getMimeTypeType(file.type), file.file, !!file.error || error, file.loading);
|
|
@@ -88,6 +90,7 @@ var init_List = __esmMin(() => {
|
|
|
88
90
|
return /* @__PURE__ */ jsxs(Stack, {
|
|
89
91
|
"data-testid": file.fileName,
|
|
90
92
|
gap: .5,
|
|
93
|
+
as: "li",
|
|
91
94
|
children: [/* @__PURE__ */ jsxs(Stack, {
|
|
92
95
|
alignItems: "center",
|
|
93
96
|
className: fileInputStyle.fileViewerContainer[file.error || error ? "error" : prominence],
|
|
@@ -133,7 +136,7 @@ var init_List = __esmMin(() => {
|
|
|
133
136
|
variant: "caption",
|
|
134
137
|
children: file.error
|
|
135
138
|
}) : null]
|
|
136
|
-
}, file.fileName);
|
|
139
|
+
}, `${file.fileName}-${file.size}`);
|
|
137
140
|
}
|
|
138
141
|
return null;
|
|
139
142
|
}), computedLimit && files.length > computedLimit ? /* @__PURE__ */ jsxs(Button, {
|
|
@@ -145,7 +148,7 @@ var init_List = __esmMin(() => {
|
|
|
145
148
|
children: [
|
|
146
149
|
textLimit,
|
|
147
150
|
" (",
|
|
148
|
-
files.length,
|
|
151
|
+
files.length - (limit !== null && limit !== void 0 ? limit : 0),
|
|
149
152
|
")"
|
|
150
153
|
]
|
|
151
154
|
}) : null]
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { MimeType } from './types';
|
|
2
2
|
export declare const getMimeTypeType: (mimeType: string) => MimeType;
|
|
3
3
|
export declare const formatFileSize: (bytes: number) => string;
|
|
4
|
-
export declare const fileIsAccepted: (
|
|
4
|
+
export declare const fileIsAccepted: (file: File, accept?: string) => boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Read the entries of a DataTransfer object, including the content of directories
|
|
7
|
+
*/
|
|
8
|
+
export declare const readTransferredFiles: (dataTransfer: DataTransfer) => Promise<FileList>;
|
|
5
9
|
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/components/FileInput/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEvC,eAAO,MAAM,eAAe,aAAc,MAAM,KAAG,QAEiB,CAAA;AAEpE,eAAO,MAAM,cAAc,UAAW,MAAM,KAAG,MAmB9C,CAAA;AAED,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/components/FileInput/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEvC,eAAO,MAAM,eAAe,aAAc,MAAM,KAAG,QAEiB,CAAA;AAEpE,eAAO,MAAM,cAAc,UAAW,MAAM,KAAG,MAmB9C,CAAA;AAED,eAAO,MAAM,cAAc,SAAU,IAAI,WAAW,MAAM,YA6BzD,CAAA;AA+CD;;GAEG;AACH,eAAO,MAAM,oBAAoB,iBAAwB,YAAY,sBAUpE,CAAA"}
|
|
@@ -1,8 +1,52 @@
|
|
|
1
1
|
import { __esmMin, __name } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { _asyncToGenerator, init_asyncToGenerator } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/asyncToGenerator.js";
|
|
2
3
|
|
|
3
4
|
//#region src/components/FileInput/helpers.ts
|
|
4
|
-
|
|
5
|
+
function readEntriesInDirectory(_x) {
|
|
6
|
+
return _readEntriesInDirectory.apply(this, arguments);
|
|
7
|
+
}
|
|
8
|
+
function _readEntriesInDirectory() {
|
|
9
|
+
_readEntriesInDirectory = _asyncToGenerator(function* (directory) {
|
|
10
|
+
const reader = directory.createReader();
|
|
11
|
+
const nestedEntries = [];
|
|
12
|
+
let results = [];
|
|
13
|
+
do {
|
|
14
|
+
results = yield new Promise((resolve, reject) => {
|
|
15
|
+
reader.readEntries(resolve, reject);
|
|
16
|
+
});
|
|
17
|
+
nestedEntries.push(...results);
|
|
18
|
+
} while ((results === null || results === void 0 ? void 0 : results.length) > 0);
|
|
19
|
+
return nestedEntries;
|
|
20
|
+
});
|
|
21
|
+
return _readEntriesInDirectory.apply(this, arguments);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Recursive function to read all the files in a list of FileSystemEntry objects (files or directories)
|
|
25
|
+
*/
|
|
26
|
+
function readEntries(_x3) {
|
|
27
|
+
return _readEntries.apply(this, arguments);
|
|
28
|
+
}
|
|
29
|
+
function _readEntries() {
|
|
30
|
+
_readEntries = _asyncToGenerator(function* (entries) {
|
|
31
|
+
const readFilesPromises = entries.filter((entry) => isFileEntry(entry)).map((entry) => convertEntryToFile(entry));
|
|
32
|
+
const files = yield Promise.all(readFilesPromises);
|
|
33
|
+
const readFoldersPromises = entries.filter((entry) => isDirectoryEntry(entry)).map(function() {
|
|
34
|
+
var _ref = _asyncToGenerator(function* (directory) {
|
|
35
|
+
const nestedEntries = yield readEntriesInDirectory(directory);
|
|
36
|
+
if (nestedEntries.length > 0) files.push(...yield readEntries(nestedEntries));
|
|
37
|
+
});
|
|
38
|
+
return function(_x2) {
|
|
39
|
+
return _ref.apply(this, arguments);
|
|
40
|
+
};
|
|
41
|
+
}());
|
|
42
|
+
yield Promise.all(readFoldersPromises);
|
|
43
|
+
return files;
|
|
44
|
+
});
|
|
45
|
+
return _readEntries.apply(this, arguments);
|
|
46
|
+
}
|
|
47
|
+
var getMimeTypeType, formatFileSize, fileIsAccepted, isFileEntry, isDirectoryEntry, convertEntryToFile, readTransferredFiles;
|
|
5
48
|
var init_helpers = __esmMin(() => {
|
|
49
|
+
init_asyncToGenerator();
|
|
6
50
|
getMimeTypeType = (mimeType) => {
|
|
7
51
|
var _mimeType$split;
|
|
8
52
|
return ((_mimeType$split = mimeType.split("/")) === null || _mimeType$split === void 0 || (_mimeType$split = _mimeType$split[0]) === null || _mimeType$split === void 0 ? void 0 : _mimeType$split.toLowerCase()) || "example";
|
|
@@ -24,18 +68,36 @@ var init_helpers = __esmMin(() => {
|
|
|
24
68
|
}
|
|
25
69
|
return `${size % 1 === 0 ? size : Number.parseFloat(size.toFixed(2))} ${units[unitIndex]}`;
|
|
26
70
|
};
|
|
27
|
-
fileIsAccepted = (
|
|
71
|
+
fileIsAccepted = (file, accept) => {
|
|
28
72
|
if (!accept) return true;
|
|
29
73
|
const acceptItems = accept.split(",").map((a) => a.trim()).filter(Boolean);
|
|
30
74
|
if (acceptItems.length === 0) return true;
|
|
75
|
+
const { name: fileName, type: fileType } = file;
|
|
31
76
|
for (const item of acceptItems) if (item.endsWith("/*")) {
|
|
32
77
|
const prefix = item.slice(0, item.indexOf("/"));
|
|
33
78
|
if (fileType.startsWith(`${prefix}/`)) return true;
|
|
34
79
|
} else if (fileType === item) return true;
|
|
80
|
+
else if (item.startsWith(".")) return fileName.toLocaleLowerCase().endsWith(item);
|
|
35
81
|
return false;
|
|
36
82
|
};
|
|
83
|
+
isFileEntry = (entry) => !!entry.isFile;
|
|
84
|
+
isDirectoryEntry = (entry) => !!entry.isDirectory;
|
|
85
|
+
convertEntryToFile = (entry) => new Promise((resolve, reject) => {
|
|
86
|
+
entry.file(resolve, reject);
|
|
87
|
+
});
|
|
88
|
+
readTransferredFiles = function() {
|
|
89
|
+
var _ref2 = _asyncToGenerator(function* (dataTransfer) {
|
|
90
|
+
const files = yield readEntries([...dataTransfer.items].map((entry) => entry.webkitGetAsEntry()).filter((item) => !!item));
|
|
91
|
+
const outputDataTransfer = new DataTransfer();
|
|
92
|
+
for (const file of files) outputDataTransfer.items.add(file);
|
|
93
|
+
return outputDataTransfer.files;
|
|
94
|
+
});
|
|
95
|
+
return function readTransferredFiles(_x4) {
|
|
96
|
+
return _ref2.apply(this, arguments);
|
|
97
|
+
};
|
|
98
|
+
}();
|
|
37
99
|
});
|
|
38
100
|
|
|
39
101
|
//#endregion
|
|
40
102
|
init_helpers();
|
|
41
|
-
export { fileIsAccepted, formatFileSize, getMimeTypeType, init_helpers };
|
|
103
|
+
export { fileIsAccepted, formatFileSize, getMimeTypeType, init_helpers, readTransferredFiles };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FileInputProps } from './types';
|
|
2
|
-
export declare const FileInput: (({ style, className, variant, size, title, children, onDrop, label, labelDescription, disabled, accept, 'aria-label': ariaLabel, defaultFiles, onChangeFiles, helper, multiple, bottom, required, error, onChange, onFocus, onBlur, name, onKeyDown, onKeyUp, disabledDragndrop, validator, 'data-testid': dataTestid, 'aria-describedby': ariaDescribedBy, }: FileInputProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
2
|
+
export declare const FileInput: (({ style, className, variant, size, title, children, onDrop, label, labelDescription, disabled, accept, 'aria-label': ariaLabel, defaultFiles, onChangeFiles, helper, multiple, bottom, required, error, onChange, onFocus, onBlur, name, onKeyDown, onKeyUp, disabledDragndrop, validator, onDropError, 'data-testid': dataTestid, 'aria-describedby': ariaDescribedBy, allowDirectories, }: FileInputProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
3
3
|
Button: ({ children, disabled, ...props }: import("react").ComponentProps<typeof import("..").Button>) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
List: ({ limit, textLimit, prominence, onDelete }: import("./types").ListProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FileInput/index.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAa,cAAc,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FileInput/index.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAa,cAAc,EAAE,MAAM,SAAS,CAAA;AA2SxD,eAAO,MAAM,SAAS,iYAjQnB,cAAc;;;CAoQf,CAAA"}
|
|
@@ -8,7 +8,8 @@ import { Description, init_Description } from "../Description/index.js";
|
|
|
8
8
|
import { Label, init_Label } from "../Label/index.js";
|
|
9
9
|
import { FileInputContext, init_FileInputProvider } from "./FileInputProvider.js";
|
|
10
10
|
import { FileInputButton, init_Button } from "./components/Button.js";
|
|
11
|
-
import {
|
|
11
|
+
import { _asyncToGenerator, init_asyncToGenerator } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/asyncToGenerator.js";
|
|
12
|
+
import { fileIsAccepted, init_helpers, readTransferredFiles } from "./helpers.js";
|
|
12
13
|
import { fileInputStyle, init_styles_css } from "./styles.css.js";
|
|
13
14
|
import { ListFiles, init_List } from "./components/List.js";
|
|
14
15
|
import { DropzoneContent, init_DropzoneContent } from "./DropzoneContent.js";
|
|
@@ -29,14 +30,18 @@ var init_FileInput = __esmMin(() => {
|
|
|
29
30
|
init_FileInputProvider();
|
|
30
31
|
init_helpers();
|
|
31
32
|
init_styles_css();
|
|
33
|
+
init_asyncToGenerator();
|
|
32
34
|
init_objectSpread2();
|
|
33
|
-
FileInputBase = ({ style, className, variant = "dropzone", size = "medium", title, children, onDrop, label, labelDescription, disabled, accept, "aria-label": ariaLabel, defaultFiles, onChangeFiles, helper, multiple = false, bottom, required, error, onChange, onFocus, onBlur, name, onKeyDown, onKeyUp, disabledDragndrop = false, validator,
|
|
34
|
-
|
|
35
|
+
FileInputBase = ({ style, className, variant = "dropzone", size = "medium", title, children, onDrop, label, labelDescription, disabled, accept, "aria-label": ariaLabel, defaultFiles, onChangeFiles, helper, multiple = false, bottom, required, error, onChange, onFocus, onBlur, name, onKeyDown, onKeyUp, disabledDragndrop = false, validator, onDropError = (e) => {
|
|
36
|
+
if (e instanceof Error) throw e;
|
|
37
|
+
}, "data-testid": dataTestid, "aria-describedby": ariaDescribedBy, allowDirectories }) => {
|
|
38
|
+
var _ref2;
|
|
35
39
|
const [dragState, setDragState] = useState("default");
|
|
36
40
|
const [files, setFiles] = useState(defaultFiles !== null && defaultFiles !== void 0 ? defaultFiles : []);
|
|
37
41
|
const inputId = useId();
|
|
38
42
|
const helperId = useId();
|
|
39
43
|
const inputRef = useRef(null);
|
|
44
|
+
const computedMultiple = allowDirectories || multiple;
|
|
40
45
|
const onDragOver = (event) => {
|
|
41
46
|
event.preventDefault();
|
|
42
47
|
event.stopPropagation();
|
|
@@ -72,7 +77,7 @@ var init_FileInput = __esmMin(() => {
|
|
|
72
77
|
const newFiles = [];
|
|
73
78
|
const errorFiles = [];
|
|
74
79
|
for (const file of droppedFiles) {
|
|
75
|
-
const isAccepted = fileIsAccepted(file
|
|
80
|
+
const isAccepted = fileIsAccepted(file, accept);
|
|
76
81
|
const customError = validator === null || validator === void 0 ? void 0 : validator(file);
|
|
77
82
|
if (isAccepted && !customError) newFiles.push(file);
|
|
78
83
|
else {
|
|
@@ -91,7 +96,7 @@ var init_FileInput = __esmMin(() => {
|
|
|
91
96
|
size: file.size,
|
|
92
97
|
type: file.type
|
|
93
98
|
}));
|
|
94
|
-
const formattedFiles =
|
|
99
|
+
const formattedFiles = computedMultiple ? [...files, ...formattedNewFiles] : [formattedNewFiles[0]];
|
|
95
100
|
setFiles(formattedFiles);
|
|
96
101
|
onChangeFiles === null || onChangeFiles === void 0 || onChangeFiles(formattedFiles);
|
|
97
102
|
if (addedFiles) onChange === null || onChange === void 0 || onChange(addedFiles);
|
|
@@ -102,14 +107,18 @@ var init_FileInput = __esmMin(() => {
|
|
|
102
107
|
event.preventDefault();
|
|
103
108
|
if (!disabled) addFiles(event.target.files);
|
|
104
109
|
};
|
|
105
|
-
const onDropComputed = (
|
|
106
|
-
event
|
|
107
|
-
if (!disabled) {
|
|
110
|
+
const onDropComputed = function() {
|
|
111
|
+
var _ref = _asyncToGenerator(function* (event) {
|
|
108
112
|
var _event$dataTransfer;
|
|
109
|
-
|
|
113
|
+
event.preventDefault();
|
|
114
|
+
if (disabled || disabledDragndrop) return;
|
|
115
|
+
const [acceptedFiles, errorFiles] = addFiles(allowDirectories ? yield readTransferredFiles(event.dataTransfer) : (_event$dataTransfer = event.dataTransfer) === null || _event$dataTransfer === void 0 ? void 0 : _event$dataTransfer.files);
|
|
110
116
|
onDrop === null || onDrop === void 0 || onDrop(event, acceptedFiles, errorFiles);
|
|
111
|
-
}
|
|
112
|
-
|
|
117
|
+
});
|
|
118
|
+
return function onDropComputed(_x) {
|
|
119
|
+
return _ref.apply(this, arguments);
|
|
120
|
+
};
|
|
121
|
+
}();
|
|
113
122
|
const computedChildren = typeof children === "function" ? children(inputId, inputRef) : children;
|
|
114
123
|
const computedHelper = /* @__PURE__ */ jsx(Description, {
|
|
115
124
|
error,
|
|
@@ -126,8 +135,8 @@ var init_FileInput = __esmMin(() => {
|
|
|
126
135
|
"data-testid": dataTestid,
|
|
127
136
|
disabled,
|
|
128
137
|
id: inputId,
|
|
129
|
-
multiple,
|
|
130
|
-
name: (
|
|
138
|
+
multiple: computedMultiple,
|
|
139
|
+
name: (_ref2 = name !== null && name !== void 0 ? name : label) !== null && _ref2 !== void 0 ? _ref2 : ariaLabel,
|
|
131
140
|
onChange: onChangeLocal,
|
|
132
141
|
ref: inputRef,
|
|
133
142
|
required,
|
|
@@ -176,7 +185,7 @@ var init_FileInput = __esmMin(() => {
|
|
|
176
185
|
className: disabled ? fileInputStyle.dropzoneOverlayDisabled[dragState] : fileInputStyle.dropzoneOverlay[dragState],
|
|
177
186
|
onDragOver: (event) => event.preventDefault(),
|
|
178
187
|
onDrop: (event) => {
|
|
179
|
-
|
|
188
|
+
onDropComputed(event).catch(onDropError);
|
|
180
189
|
},
|
|
181
190
|
style,
|
|
182
191
|
children: title && typeof title !== "function" && dragState !== "default" ? /* @__PURE__ */ jsx(Text, {
|
|
@@ -231,7 +240,9 @@ var init_FileInput = __esmMin(() => {
|
|
|
231
240
|
}, isSmall ? { type: "button" } : void 0), {}, {
|
|
232
241
|
"data-testid": "drag-container",
|
|
233
242
|
onDragOver,
|
|
234
|
-
onDrop:
|
|
243
|
+
onDrop: (event) => {
|
|
244
|
+
onDropComputed(event).catch(onDropError);
|
|
245
|
+
},
|
|
235
246
|
children: [/* @__PURE__ */ jsx(DropzoneContent, {
|
|
236
247
|
disabled,
|
|
237
248
|
inputId,
|
|
@@ -33,6 +33,7 @@ export declare const fileInputStyle: {
|
|
|
33
33
|
fileViewerContainer: Record<"default" | "error" | "strong", string>;
|
|
34
34
|
fileViewerImageBase: string;
|
|
35
35
|
fileInfo: string;
|
|
36
|
+
fileListContainer: string;
|
|
36
37
|
fileViewerImage: Record<"default" | "error", string>;
|
|
37
38
|
};
|
|
38
39
|
//# sourceMappingURL=styles.css.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../../../src/components/FileInput/styles.css.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../../../src/components/FileInput/styles.css.ts"],"names":[],"mappings":"AAuMA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;YAtIrB,OAAO;YACP,IAAI;YACJ,IAAI;;;;;;;;;;;;;CAgJT,CAAA"}
|
|
@@ -51,15 +51,16 @@ var init_styles_css = __esmMin(() => {
|
|
|
51
51
|
page: "uv_12cubgsk uv_12cubgsh"
|
|
52
52
|
},
|
|
53
53
|
fileViewerContainer: {
|
|
54
|
-
"default": "uv_12cubgsm
|
|
55
|
-
error: "
|
|
56
|
-
strong: "
|
|
54
|
+
"default": "uv_12cubgsn uv_12cubgsm",
|
|
55
|
+
error: "uv_12cubgso uv_12cubgsm",
|
|
56
|
+
strong: "uv_12cubgsp uv_12cubgsm"
|
|
57
57
|
},
|
|
58
|
-
fileViewerImageBase: "
|
|
59
|
-
fileInfo: "
|
|
58
|
+
fileViewerImageBase: "uv_12cubgsq",
|
|
59
|
+
fileInfo: "uv_12cubgst",
|
|
60
|
+
fileListContainer: "uv_12cubgsl",
|
|
60
61
|
fileViewerImage: {
|
|
61
|
-
"default": "uv_12cubgsq
|
|
62
|
-
error: "
|
|
62
|
+
"default": "uv_12cubgsr uv_12cubgsq",
|
|
63
|
+
error: "uv_12cubgss uv_12cubgsq"
|
|
63
64
|
}
|
|
64
65
|
};
|
|
65
66
|
});
|
|
@@ -60,7 +60,18 @@ export type FileInputProps = {
|
|
|
60
60
|
error?: boolean | string;
|
|
61
61
|
disabledDragndrop?: boolean;
|
|
62
62
|
onChange?: (files: FileList) => void;
|
|
63
|
+
/**
|
|
64
|
+
* Catch error when reading drag and dropped files
|
|
65
|
+
*/
|
|
66
|
+
onDropError?: (error?: unknown) => void;
|
|
63
67
|
validator?: (file: File) => string | null | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* Allow to drag and drop folders in the dropzone. When set to true:
|
|
70
|
+
* - `multiple` will automatically be set to `true`
|
|
71
|
+
* - The files are all flattened and returned as a list. It is possible to use a path to reconstruct the folder
|
|
72
|
+
* (`file.webkitpath`)
|
|
73
|
+
*/
|
|
74
|
+
allowDirectories?: boolean;
|
|
64
75
|
} & (OverlayVariantProps | DropzoneVariantProps) & LabelType & Pick<InputHTMLAttributes<HTMLInputElement>, 'onFocus' | 'onBlur' | 'name' | 'disabled' | 'required' | 'onKeyDown' | 'onKeyUp' | 'style' | 'aria-describedby'>;
|
|
65
76
|
type LimitType = {
|
|
66
77
|
limit: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/FileInput/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,mBAAmB,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjF,KAAK,YAAY,GAAG,SAAS,GAAG,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,CA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K,CAAC,EAAE,KAAK,CAAC;IAAC,SAAS,CAAC,EAAE,KAAK,CAAA;CAAE,CAAA;AAE5F,MAAM,MAAM,SAAS,GAAG;IACtB,UAAU,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAA;IACjC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAClC,GAAG,SAAS,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export declare const KEYS_MATCH: {
|
|
2
|
-
readonly backspace: '
|
|
3
|
-
readonly command: '
|
|
4
|
-
readonly control: '
|
|
5
|
-
readonly enter: '
|
|
6
|
-
readonly option: '
|
|
7
|
-
readonly shift: '
|
|
2
|
+
readonly backspace: '⌫';
|
|
3
|
+
readonly command: '⌘';
|
|
4
|
+
readonly control: '⌃';
|
|
5
|
+
readonly enter: '↵';
|
|
6
|
+
readonly option: '⌥';
|
|
7
|
+
readonly shift: '⇧';
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/components/Key/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;aACrB,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/components/Key/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;aACrB,SAAS,EAAE,GAAG;aACd,OAAO,EAAE,GAAG;aACZ,OAAO,EAAE,GAAG;aACZ,KAAK,EAAE,GAAG;aACV,MAAM,EAAE,GAAG;aACX,KAAK,EAAE,GAAG;CACF,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ChangeEvent, ComponentType, InputHTMLAttributes, Ref } from 'react';
|
|
2
|
+
import type { DescriptionProps } from '../Description';
|
|
3
|
+
type PhoneInputLabelProps = {
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
error?: string;
|
|
6
|
+
ref?: Ref<HTMLInputElement>;
|
|
7
|
+
};
|
|
8
|
+
type InputProps = Partial<Pick<InputHTMLAttributes<HTMLInputElement>, 'aria-label' | 'aria-labelledby' | 'aria-live' | 'aria-describedby' | 'disabled' | 'id' | 'name' | 'onBlur' | 'onFocus' | 'placeholder' | 'readOnly'>> & Partial<DescriptionProps>;
|
|
9
|
+
type PhoneInputProps = PhoneInputLabelProps & {
|
|
10
|
+
'data-testid'?: string | null;
|
|
11
|
+
value?: string;
|
|
12
|
+
label?: string;
|
|
13
|
+
required?: boolean;
|
|
14
|
+
tooltip?: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
defaultCountry?: string;
|
|
17
|
+
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
18
|
+
error?: string;
|
|
19
|
+
onParsingError?: ({ error, inputValue }: {
|
|
20
|
+
error: Error;
|
|
21
|
+
inputValue: string;
|
|
22
|
+
}) => void;
|
|
23
|
+
disableAutoFormat?: boolean;
|
|
24
|
+
onValueChange?: (value: {
|
|
25
|
+
inputValue: string;
|
|
26
|
+
formatted: string;
|
|
27
|
+
country: string | null;
|
|
28
|
+
valid: boolean;
|
|
29
|
+
e164: string | null;
|
|
30
|
+
international: string | null;
|
|
31
|
+
}) => void;
|
|
32
|
+
} & InputProps;
|
|
33
|
+
type PhoneInputType = ComponentType<PhoneInputProps>;
|
|
34
|
+
export declare const PhoneInput: PhoneInputType;
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=PhoneInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PhoneInput.d.ts","sourceRoot":"","sources":["../../../src/components/PhoneInput/PhoneInput.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,mBAAmB,EAAgB,GAAG,EAAE,MAAM,OAAO,CAAA;AAG/F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAA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