@vention/machine-ui 5.0.4 → 5.0.7
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/index.esm.js
CHANGED
|
@@ -11866,6 +11866,16 @@ const getCheckboxColors = (variant, disabled) => {
|
|
|
11866
11866
|
}
|
|
11867
11867
|
};
|
|
11868
11868
|
|
|
11869
|
+
const VentionUploadFileIds = {
|
|
11870
|
+
container: "fileUploadContainer",
|
|
11871
|
+
fileName: "fileName",
|
|
11872
|
+
fileSize: "fileSize",
|
|
11873
|
+
errorMessage: "errorMessage",
|
|
11874
|
+
retryContainer: "retryButtonContainer",
|
|
11875
|
+
retryButton: "retryButton",
|
|
11876
|
+
cancelButton: "cancelButton",
|
|
11877
|
+
removeButton: "removeButton"
|
|
11878
|
+
};
|
|
11869
11879
|
const SIZE_CONFIG = {
|
|
11870
11880
|
large: {
|
|
11871
11881
|
gap: "12px",
|
|
@@ -11968,8 +11978,10 @@ function VentionUploadFile({
|
|
|
11968
11978
|
onRetry,
|
|
11969
11979
|
size,
|
|
11970
11980
|
style,
|
|
11971
|
-
state
|
|
11981
|
+
state,
|
|
11982
|
+
dataTestIds = VentionUploadFileIds
|
|
11972
11983
|
}) {
|
|
11984
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
11973
11985
|
const {
|
|
11974
11986
|
classes
|
|
11975
11987
|
} = useStyle$1({
|
|
@@ -11979,6 +11991,7 @@ function VentionUploadFile({
|
|
|
11979
11991
|
});
|
|
11980
11992
|
return jsxs(Grid, {
|
|
11981
11993
|
container: true,
|
|
11994
|
+
"data-testid": (_a = dataTestIds.container) !== null && _a !== void 0 ? _a : VentionUploadFileIds.container,
|
|
11982
11995
|
className: classes.container,
|
|
11983
11996
|
children: [jsx(Grid, {
|
|
11984
11997
|
item: true,
|
|
@@ -11995,28 +12008,29 @@ function VentionUploadFile({
|
|
|
11995
12008
|
children: [jsx(Typography, {
|
|
11996
12009
|
title: fileName,
|
|
11997
12010
|
className: classes.nameContainer,
|
|
11998
|
-
"data-testid":
|
|
12011
|
+
"data-testid": (_b = dataTestIds.fileName) !== null && _b !== void 0 ? _b : VentionUploadFileIds.fileName,
|
|
11999
12012
|
noWrap: true,
|
|
12000
12013
|
children: fileName
|
|
12001
12014
|
}), size === "large" && jsx(Typography, {
|
|
12002
12015
|
className: classes.sizeContainer,
|
|
12003
|
-
"data-testid":
|
|
12016
|
+
"data-testid": (_c = dataTestIds.fileSize) !== null && _c !== void 0 ? _c : VentionUploadFileIds.fileSize,
|
|
12004
12017
|
children: fileSize
|
|
12005
12018
|
}), state === "error" && errorMessage && jsx(Typography, {
|
|
12006
12019
|
className: classes.errorMessage,
|
|
12007
|
-
"data-testid":
|
|
12020
|
+
"data-testid": (_d = dataTestIds.errorMessage) !== null && _d !== void 0 ? _d : VentionUploadFileIds.errorMessage,
|
|
12008
12021
|
children: errorMessage
|
|
12009
12022
|
})]
|
|
12010
12023
|
})
|
|
12011
12024
|
}), state === "error" && jsx(Grid, {
|
|
12012
12025
|
item: true,
|
|
12013
12026
|
xs: "auto",
|
|
12014
|
-
"data-testid":
|
|
12027
|
+
"data-testid": (_e = dataTestIds.retryContainer) !== null && _e !== void 0 ? _e : VentionUploadFileIds.retryContainer,
|
|
12015
12028
|
children: jsx(VentionIconButton, {
|
|
12016
12029
|
onClick: onRetry,
|
|
12017
12030
|
variant: "outline",
|
|
12018
12031
|
size: size,
|
|
12019
12032
|
className: classes.actionButton,
|
|
12033
|
+
"data-testid": (_f = dataTestIds.retryButton) !== null && _f !== void 0 ? _f : VentionUploadFileIds.retryButton,
|
|
12020
12034
|
children: jsx(VentionIcon, {
|
|
12021
12035
|
type: "reload",
|
|
12022
12036
|
size: getActionIconSize(size)
|
|
@@ -12030,7 +12044,7 @@ function VentionUploadFile({
|
|
|
12030
12044
|
variant: "outline",
|
|
12031
12045
|
size: size,
|
|
12032
12046
|
className: classes.actionButton,
|
|
12033
|
-
"data-testid":
|
|
12047
|
+
"data-testid": (_g = dataTestIds.cancelButton) !== null && _g !== void 0 ? _g : VentionUploadFileIds.cancelButton,
|
|
12034
12048
|
children: jsx(VentionIcon, {
|
|
12035
12049
|
type: "close",
|
|
12036
12050
|
size: getActionIconSize(size)
|
|
@@ -12040,7 +12054,7 @@ function VentionUploadFile({
|
|
|
12040
12054
|
variant: "outline",
|
|
12041
12055
|
size: size,
|
|
12042
12056
|
className: classes.actionButton,
|
|
12043
|
-
"data-testid":
|
|
12057
|
+
"data-testid": (_h = dataTestIds.removeButton) !== null && _h !== void 0 ? _h : VentionUploadFileIds.removeButton,
|
|
12044
12058
|
children: jsx(VentionIcon, {
|
|
12045
12059
|
type: "trash",
|
|
12046
12060
|
size: getActionIconSize(size)
|
package/package.json
CHANGED
|
@@ -3,6 +3,16 @@ export type UploadedFileStyleProps = {
|
|
|
3
3
|
style: "outline" | "shaded";
|
|
4
4
|
state: "indeterminate" | "success" | "error";
|
|
5
5
|
};
|
|
6
|
+
export declare const VentionUploadFileIds: {
|
|
7
|
+
readonly container: "fileUploadContainer";
|
|
8
|
+
readonly fileName: "fileName";
|
|
9
|
+
readonly fileSize: "fileSize";
|
|
10
|
+
readonly errorMessage: "errorMessage";
|
|
11
|
+
readonly retryContainer: "retryButtonContainer";
|
|
12
|
+
readonly retryButton: "retryButton";
|
|
13
|
+
readonly cancelButton: "cancelButton";
|
|
14
|
+
readonly removeButton: "removeButton";
|
|
15
|
+
};
|
|
6
16
|
export type UploadedFileProps = {
|
|
7
17
|
fileName: string;
|
|
8
18
|
fileSize: string;
|
|
@@ -10,6 +20,7 @@ export type UploadedFileProps = {
|
|
|
10
20
|
onCancel?: () => void;
|
|
11
21
|
onRemove?: () => void;
|
|
12
22
|
onRetry?: () => void;
|
|
23
|
+
dataTestIds?: Partial<Record<keyof typeof VentionUploadFileIds, string>>;
|
|
13
24
|
} & UploadedFileStyleProps;
|
|
14
25
|
export declare const getContainerBackgroundColor: (style: UploadedFileStyleProps["style"]) => string;
|
|
15
26
|
export declare const getContainerBorder: (style: UploadedFileStyleProps["style"]) => {
|
|
@@ -3,4 +3,4 @@ import { type UploadedFileProps } from "./vention-uploadfile-utils";
|
|
|
3
3
|
/**
|
|
4
4
|
* A component that displays an uploaded file with its upload status, file name, file size, and a remove button.
|
|
5
5
|
*/
|
|
6
|
-
export declare function VentionUploadFile({ fileName, fileSize, errorMessage, onCancel, onRemove, onRetry, size, style, state, }: UploadedFileProps): JSX.Element;
|
|
6
|
+
export declare function VentionUploadFile({ fileName, fileSize, errorMessage, onCancel, onRemove, onRetry, size, style, state, dataTestIds, }: UploadedFileProps): JSX.Element;
|