@popsure/dirty-swan 0.57.9 → 0.58.1
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/cjs/index.js +65 -29
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/lib/components/multiDropzone/utils/index.d.ts +9 -2
- package/dist/esm/{TableSection-a26ba0c5.js → TableSection-ebace923.js} +1 -1
- package/dist/esm/{TableSection-a26ba0c5.js.map → TableSection-ebace923.js.map} +1 -1
- package/dist/esm/components/comparisonTable/components/TableInfoButton/index.js +1 -1
- package/dist/esm/components/comparisonTable/components/TableInfoButton/index.js.map +1 -1
- package/dist/esm/components/input/checkbox/index.js +5 -2
- package/dist/esm/components/input/checkbox/index.js.map +1 -1
- package/dist/esm/components/input/index.js +4 -2
- package/dist/esm/components/input/index.js.map +1 -1
- package/dist/esm/components/multiDropzone/UploadFileCell/index.js +6 -7
- package/dist/esm/components/multiDropzone/UploadFileCell/index.js.map +1 -1
- package/dist/esm/components/multiDropzone/index.js +51 -17
- package/dist/esm/components/multiDropzone/index.js.map +1 -1
- package/dist/esm/components/multiDropzone/index.stories.js +1 -0
- package/dist/esm/components/multiDropzone/index.stories.js.map +1 -1
- package/dist/esm/components/multiDropzone/index.test.js +1 -0
- package/dist/esm/components/multiDropzone/index.test.js.map +1 -1
- package/dist/esm/components/table/Table.js +1 -1
- package/dist/esm/components/table/Table.stories.js +1 -1
- package/dist/esm/components/table/Table.test.js +1 -1
- package/dist/esm/components/table/components/TableContents/TableContents.js +1 -1
- package/dist/esm/components/table/components/TableContents/TableContents.test.js +1 -1
- package/dist/esm/components/table/components/TableSection/TableSection.js +1 -1
- package/dist/esm/components/table/components/TableSection/TableSection.test.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/lib/components/multiDropzone/utils/index.d.ts +9 -2
- package/package.json +1 -1
- package/src/lib/components/comparisonTable/components/TableInfoButton/index.tsx +2 -0
- package/src/lib/components/input/checkbox/index.tsx +8 -2
- package/src/lib/components/input/index.tsx +20 -13
- package/src/lib/components/multiDropzone/UploadFileCell/index.tsx +25 -19
- package/src/lib/components/multiDropzone/UploadFileCell/style.module.scss +11 -29
- package/src/lib/components/multiDropzone/index.tsx +17 -5
- package/src/lib/components/multiDropzone/style.module.scss +12 -9
- package/src/lib/components/multiDropzone/utils/index.test.ts +128 -45
- package/src/lib/components/multiDropzone/utils/index.ts +89 -36
package/dist/cjs/index.js
CHANGED
|
@@ -314,12 +314,14 @@ var Input = React__default['default'].forwardRef(function (_a, ref) {
|
|
|
314
314
|
return (jsxRuntime.jsxs("div", { className: "".concat(styles$H.container, " ").concat(className !== null && className !== void 0 ? className : ''), children: [label && !labelInsideInput && (jsxRuntime.jsx("label", { htmlFor: uniqueId, className: classNames$1('p-p', styles$H.label, (_b = {},
|
|
315
315
|
_b[styles$H['label--with-error']] = error,
|
|
316
316
|
_b['sr-only'] = hideLabel,
|
|
317
|
-
_b)), children: label })), jsxRuntime.jsxs("div", { style: { position: 'relative' }, children: [jsxRuntime.jsx("input", __assign({ id: uniqueId, "data-testid": "ds-input-input", type: "text", ref: ref, className: classNames$1(error ? 'p-input--error' : 'p-input', (!label || labelInsideInput) &&
|
|
317
|
+
_b)), children: label })), jsxRuntime.jsxs("div", { style: { position: 'relative' }, children: [jsxRuntime.jsx("input", __assign({ id: uniqueId, "data-testid": "ds-input-input", type: "text", ref: ref, className: classNames$1(error ? 'p-input--error' : 'p-input', (!label || labelInsideInput) &&
|
|
318
|
+
placeholder &&
|
|
319
|
+
placeholder.length > 0
|
|
318
320
|
? styles$H.input
|
|
319
321
|
: styles$H['input--no-placeholder'], (_c = {},
|
|
320
322
|
_c[styles$H['input--with-prefix']] = prefix,
|
|
321
323
|
_c[styles$H['input--with-inside-label']] = labelInsideInput,
|
|
322
|
-
_c)), placeholder: label || labelInsideInput ? placeholder : ' ', disabled: disabled }, props)), prefix && (jsxRuntime.jsx("span", { className: classNames$1(styles$H.prefix, (_d = {}, _d[styles$H['prefix--with-error']] = error, _d), (_e = {}, _e[styles$H['prefix--disabled']] = disabled, _e)), children: prefix })), (!label || labelInsideInput) && (jsxRuntime.jsx("label", { htmlFor: uniqueId, className: classNames$1(styles$H.placeholder, (_f = {}, _f[styles$H['placeholder--with-prefix']] = prefix, _f), (_g = {}, _g[styles$H['placeholder--with-error']] = error, _g)), children: labelInsideInput ? label : placeholder }))] }), error && (jsxRuntime.jsx("p", { className: "p-p--small tc-red-500 w100 ".concat(styles$H.error), children: error }))] }));
|
|
324
|
+
_c)), placeholder: label || labelInsideInput ? placeholder : ' ', disabled: disabled, "aria-invalid": !!error, "aria-errormessage": error ? "".concat(uniqueId, "-error") : undefined }, props)), prefix && (jsxRuntime.jsx("span", { className: classNames$1(styles$H.prefix, (_d = {}, _d[styles$H['prefix--with-error']] = error, _d), (_e = {}, _e[styles$H['prefix--disabled']] = disabled, _e)), children: prefix })), (!label || labelInsideInput) && (jsxRuntime.jsx("label", { htmlFor: uniqueId, className: classNames$1(styles$H.placeholder, (_f = {}, _f[styles$H['placeholder--with-prefix']] = prefix, _f), (_g = {}, _g[styles$H['placeholder--with-error']] = error, _g)), children: labelInsideInput ? label : placeholder }))] }), error && (jsxRuntime.jsx("p", { id: "".concat(uniqueId, "-error"), className: "p-p--small tc-red-500 w100 ".concat(styles$H.error), children: error }))] }));
|
|
323
325
|
});
|
|
324
326
|
|
|
325
327
|
var build = {};
|
|
@@ -8212,18 +8214,18 @@ const AnimateHeight = (_a) => {
|
|
|
8212
8214
|
React__default['default'].createElement("div", { className: contentClassName, style: contentStyle, ref: contentElement }, children)));
|
|
8213
8215
|
};
|
|
8214
8216
|
|
|
8215
|
-
var css_248z$D = ".style-module_container__Uyltc {\n background-color: transparent;\n}\n\n.style-module_dropzoneContainer__yZoGP {\n border: 1px dashed var(--ds-primary-500);\n padding: 32px 0;\n background-color: white;\n transition: all 0.6s ease-in-out;\n}\n
|
|
8217
|
+
var css_248z$D = ".style-module_container__Uyltc {\n background-color: transparent;\n}\n\n.style-module_dropzoneContainer__yZoGP {\n border: 1px dashed var(--ds-primary-500);\n padding: 32px 0;\n background-color: white;\n transition: all 0.6s ease-in-out;\n}\n.style-module_dropzoneContainer__yZoGP:focus-visible {\n outline: 2px solid #26262e;\n border-radius: 2px;\n outline-offset: 2px;\n}\n.style-module_dropzoneContainer__yZoGP:hover {\n background-color: var(--ds-primary-100);\n transition: 0.5s ease;\n}\n\n.style-module_img__11JI8 {\n vertical-align: middle;\n margin-right: 8px;\n height: 18px;\n}\n\n.style-module_textInline__2F21z {\n display: inline-flex;\n}\n\n.style-module_dropzoneContainerDisabled__1X3gP {\n pointer-events: none;\n opacity: 0.4;\n}";
|
|
8216
8218
|
var styles$C = {"container":"style-module_container__Uyltc","dropzoneContainer":"style-module_dropzoneContainer__yZoGP","img":"style-module_img__11JI8","textInline":"style-module_textInline__2F21z","dropzoneContainerDisabled":"style-module_dropzoneContainerDisabled__1X3gP"};
|
|
8217
8219
|
styleInject(css_248z$D);
|
|
8218
8220
|
|
|
8219
|
-
var css_248z$C = ".style-module_upload-file-cell__3nv5i {\n display: flex;\n align-items: center;\n justify-content: space-between;\n min-height: 64px;\n padding: 8px 16px;\n border: 1px solid #d2d2d8;\n border-radius: 8px;\n background-color: white;\n animation: style-module_appear-down__14rCV 0.6s;\n animation-fill-mode: both;\n animation-delay: 0s;\n}\n\n.style-module_upload-file-cell-error__3KcSe {\n border-color: #e55454;\n background-color: rgba(229, 84, 84, 0.2);\n}\n\n.style-module_cell-left-section__3Iv8c {\n display: flex;\n align-items: center;\n}\n\n.style-
|
|
8220
|
-
var styles$B = {"upload-file-cell":"style-module_upload-file-cell__3nv5i","appear-down":"style-module_appear-down__14rCV","upload-file-cell-error":"style-module_upload-file-cell-error__3KcSe","cell-left-section":"style-module_cell-left-section__3Iv8c","
|
|
8221
|
+
var css_248z$C = ".style-module_upload-file-cell__3nv5i {\n display: flex;\n align-items: center;\n justify-content: space-between;\n min-height: 64px;\n padding: 8px 16px;\n border: 1px solid #d2d2d8;\n border-radius: 8px;\n background-color: white;\n animation: style-module_appear-down__14rCV 0.6s;\n animation-fill-mode: both;\n animation-delay: 0s;\n}\n\n.style-module_upload-file-cell-error__3KcSe {\n border-color: #e55454;\n background-color: rgba(229, 84, 84, 0.2);\n}\n\n.style-module_cell-left-section__3Iv8c {\n display: flex;\n align-items: center;\n}\n\n.style-module_main-icon__335_Y {\n margin-right: 16px;\n}\n\n.style-module_upload-display-text__3Rd68 {\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n}\n\n.style-module_progress-bar-container__2JCBO {\n position: relative;\n}\n\n.style-module_progress-bar__1Rosf {\n background-color: #f5f6fb;\n border-radius: 10px;\n height: 4px;\n}\n\n.style-module_progress-bar-filler__131fA {\n background-color: #8e8cee;\n border-radius: 10px;\n height: 4px;\n position: absolute;\n bottom: 0;\n transition: 1s ease;\n}\n\n.style-module_cell-right-section__dVWqJ {\n display: flex;\n}\n\n.style-module_cell-right-section-complete__c0rHc {\n min-width: 64px;\n}\n\n.style-module_button__xo5tR {\n width: 32px;\n}\n.style-module_button__xo5tR div span span {\n min-width: 24px !important;\n height: 24px !important;\n}\n.style-module_button__xo5tR:focus-visible {\n outline: 2px solid #26262e;\n border-radius: 2px;\n outline-offset: 2px;\n}\n\n@keyframes style-module_appear-down__14rCV {\n from {\n transform: translateY(-10px);\n opacity: 0;\n }\n to {\n transform: translateY(0);\n opacity: 1;\n }\n}";
|
|
8222
|
+
var styles$B = {"upload-file-cell":"style-module_upload-file-cell__3nv5i","appear-down":"style-module_appear-down__14rCV","upload-file-cell-error":"style-module_upload-file-cell-error__3KcSe","cell-left-section":"style-module_cell-left-section__3Iv8c","main-icon":"style-module_main-icon__335_Y","upload-display-text":"style-module_upload-display-text__3Rd68","progress-bar-container":"style-module_progress-bar-container__2JCBO","progress-bar":"style-module_progress-bar__1Rosf","progress-bar-filler":"style-module_progress-bar-filler__131fA","cell-right-section":"style-module_cell-right-section__dVWqJ","cell-right-section-complete":"style-module_cell-right-section-complete__c0rHc","button":"style-module_button__xo5tR"};
|
|
8221
8223
|
styleInject(css_248z$C);
|
|
8222
8224
|
|
|
8223
8225
|
var UploadFileCell = function (_a) {
|
|
8224
|
-
var _b, _c
|
|
8226
|
+
var _b, _c;
|
|
8225
8227
|
var uploadStatus = _a.uploadStatus, file = _a.file, onRemoveFile = _a.onRemoveFile, uploading = _a.uploading;
|
|
8226
|
-
var id = file.id, error = file.error, name = file.name, progress = file.progress, previewUrl = file.previewUrl,
|
|
8228
|
+
var id = file.id, error = file.error, name = file.name, progress = file.progress, previewUrl = file.previewUrl, _d = file.showLoadingSpinner, showLoadingSpinner = _d === void 0 ? false : _d, _e = file.showProgressBar, showProgressBar = _e === void 0 ? true : _e;
|
|
8227
8229
|
var isComplete = uploadStatus === 'COMPLETE';
|
|
8228
8230
|
var isUploading = uploadStatus === 'UPLOADING';
|
|
8229
8231
|
var hasError = uploadStatus === 'ERROR';
|
|
@@ -8241,9 +8243,7 @@ var UploadFileCell = function (_a) {
|
|
|
8241
8243
|
_b[styles$B['upload-file-cell-error']] = hasError,
|
|
8242
8244
|
_b)), children: [jsxRuntime.jsxs("div", { className: "w100 ".concat(styles$B['cell-left-section']), children: [jsxRuntime.jsx(FileIcon, { className: classNames$1("".concat(styles$B['main-icon'], " ").concat(styles$B.icon)), color: mapFileIconColor[uploadStatus], size: 24 }), jsxRuntime.jsxs("div", { className: "w100", children: [jsxRuntime.jsx("div", { className: "p-p ".concat(styles$B['upload-display-text']), title: displayText, children: displayText }), isUploading && showProgressBar && (jsxRuntime.jsxs("div", { className: "mt8 w100 ".concat(styles$B['progress-bar-container']), children: [jsxRuntime.jsx("div", { className: "".concat(styles$B['progress-bar']) }), jsxRuntime.jsx("div", { "data-testid": "ds-filecell-progressbar", className: "".concat(styles$B['progress-bar-filler']), style: { width: "".concat(progress, "%") } })] }))] })] }), jsxRuntime.jsx("div", { className: classNames$1(styles$B['cell-right-section'], (_c = {},
|
|
8243
8245
|
_c[styles$B['cell-right-section-complete']] = isComplete,
|
|
8244
|
-
_c)), children: isUploading ? (jsxRuntime.jsx("div", { className: styles$B.spinner, children: showLoadingSpinner && (jsxRuntime.jsx("div", { className: "ds-spinner ds-spinner__m", "data-testid": "ds-filecell-spinner" })) })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [isComplete && (jsxRuntime.jsx(
|
|
8245
|
-
_d[styles$B.disabled] = uploading,
|
|
8246
|
-
_d)), "data-testid": "remove-button", children: jsxRuntime.jsx(Trash2Icon, { color: hasError ? 'red-500' : 'grey-500', size: 24, className: styles$B.icon }) }))] })) })] }));
|
|
8246
|
+
_c)), children: isUploading ? (jsxRuntime.jsx("div", { className: styles$B.spinner, children: showLoadingSpinner && (jsxRuntime.jsx("div", { className: "ds-spinner ds-spinner__m", "data-testid": "ds-filecell-spinner" })) })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [isComplete && (jsxRuntime.jsx(Button, { as: "a", href: previewUrl, target: "_blank", rel: "noopener noreferrer", hideLabel: true, variant: "filledWhite", className: classNames$1('mr16', styles$B.button), leftIcon: jsxRuntime.jsx(EyeVisionIcon, { noMargin: true, color: 'grey-500', size: 24 }), children: "Preview file" })), onRemoveFile && (jsxRuntime.jsx(Button, { onClick: function () { return onRemoveFile(id); }, disabled: uploading, "data-testid": "remove-button", className: styles$B.button, leftIcon: jsxRuntime.jsx(Trash2Icon, { color: hasError ? 'red-500' : 'grey-500', size: 24, noMargin: true }), hideLabel: true, variant: "filledWhite", children: "Delete file" }))] })) })] }));
|
|
8247
8247
|
};
|
|
8248
8248
|
|
|
8249
8249
|
var k$2 = 1024;
|
|
@@ -8310,13 +8310,13 @@ var IMAGE_FILES_ACCEPT = formatMimeType(IMAGE_FILES);
|
|
|
8310
8310
|
var VIDEO_FILES_ACCEPT = formatMimeType(VIDEO_FILES);
|
|
8311
8311
|
var getFormattedAcceptObject = function (accept) {
|
|
8312
8312
|
if (accept === void 0) { accept = {}; }
|
|
8313
|
-
if (accept ===
|
|
8313
|
+
if (accept === 'document') {
|
|
8314
8314
|
return DOCUMENT_FILES_ACCEPT;
|
|
8315
8315
|
}
|
|
8316
|
-
if (accept ===
|
|
8316
|
+
if (accept === 'image') {
|
|
8317
8317
|
return IMAGE_FILES_ACCEPT;
|
|
8318
8318
|
}
|
|
8319
|
-
if (accept ===
|
|
8319
|
+
if (accept === 'video') {
|
|
8320
8320
|
return VIDEO_FILES_ACCEPT;
|
|
8321
8321
|
}
|
|
8322
8322
|
if (accept) {
|
|
@@ -8324,11 +8324,13 @@ var getFormattedAcceptObject = function (accept) {
|
|
|
8324
8324
|
}
|
|
8325
8325
|
return __assign(__assign(__assign({}, DOCUMENT_FILES_ACCEPT), IMAGE_FILES_ACCEPT), VIDEO_FILES_ACCEPT);
|
|
8326
8326
|
};
|
|
8327
|
-
var formatAcceptFileList = function (accept) {
|
|
8328
|
-
|
|
8329
|
-
|
|
8330
|
-
|
|
8331
|
-
|
|
8327
|
+
var formatAcceptFileList = function (accept) {
|
|
8328
|
+
return Object.values(accept)
|
|
8329
|
+
.reduce(function (acc, value) { return __spreadArray$1(__spreadArray$1([], acc, true), value, true); }, [])
|
|
8330
|
+
.join(', ')
|
|
8331
|
+
.replace(/\./g, '')
|
|
8332
|
+
.toUpperCase();
|
|
8333
|
+
};
|
|
8332
8334
|
var getPlaceholder = function (textOverrides, accept, maxSize) {
|
|
8333
8335
|
var maxSizePlaceholder = maxSize && maxSize > 0
|
|
8334
8336
|
? "".concat((textOverrides === null || textOverrides === void 0 ? void 0 : textOverrides.sizeUpToText) || 'up to', " ").concat(formatBytes(maxSize))
|
|
@@ -8336,26 +8338,48 @@ var getPlaceholder = function (textOverrides, accept, maxSize) {
|
|
|
8336
8338
|
var isAcceptString = typeof accept === 'string' &&
|
|
8337
8339
|
['video', 'image', 'document'].includes(accept);
|
|
8338
8340
|
var defaultPlaceholder = "".concat((textOverrides === null || textOverrides === void 0 ? void 0 : textOverrides.supportsTextShort) || 'Supports images, videos and documents', " ").concat(maxSizePlaceholder);
|
|
8339
|
-
var acceptPlaceholder = "".concat((textOverrides === null || textOverrides === void 0 ? void 0 : textOverrides.supportsTextShort) ||
|
|
8341
|
+
var acceptPlaceholder = "".concat((textOverrides === null || textOverrides === void 0 ? void 0 : textOverrides.supportsTextShort) ||
|
|
8342
|
+
"Supports ".concat(accept, "s ").concat(maxSizePlaceholder));
|
|
8340
8343
|
return isAcceptString ? acceptPlaceholder : defaultPlaceholder;
|
|
8341
8344
|
};
|
|
8342
8345
|
var getErrorMessage = function (_a, _b, textOverrides) {
|
|
8343
8346
|
var code = _a.code, message = _a.message;
|
|
8344
|
-
var _c = _b.fileList, fileList = _c === void 0 ?
|
|
8347
|
+
var _c = _b.fileList, fileList = _c === void 0 ? '' : _c, maxSize = _b.maxSize;
|
|
8345
8348
|
switch (code) {
|
|
8346
8349
|
case ErrorCode.FileInvalidType:
|
|
8347
|
-
return "".concat((textOverrides === null || textOverrides === void 0 ? void 0 : textOverrides.fileTypeError) ||
|
|
8350
|
+
return "".concat((textOverrides === null || textOverrides === void 0 ? void 0 : textOverrides.fileTypeError) || 'File type must be', " ").concat(fileList);
|
|
8348
8351
|
case ErrorCode.FileTooLarge:
|
|
8349
|
-
return "".concat((textOverrides === null || textOverrides === void 0 ? void 0 : textOverrides.fileTooLargeError) ||
|
|
8352
|
+
return "".concat((textOverrides === null || textOverrides === void 0 ? void 0 : textOverrides.fileTooLargeError) ||
|
|
8353
|
+
'File is too large. It must be less than', " ").concat(formatBytes(maxSize || 0), ".");
|
|
8350
8354
|
default:
|
|
8351
8355
|
return message;
|
|
8352
8356
|
}
|
|
8353
8357
|
};
|
|
8358
|
+
var getStatusMessage = function (_a) {
|
|
8359
|
+
var acceptedFiles = _a.acceptedFiles, filesRejected = _a.filesRejected, fileList = _a.fileList, maxSize = _a.maxSize, textOverrides = _a.textOverrides;
|
|
8360
|
+
var message = '';
|
|
8361
|
+
if (acceptedFiles.length > 0) {
|
|
8362
|
+
var fileNames = acceptedFiles.map(function (file) { return file.name; }).join(', ');
|
|
8363
|
+
message += "File".concat(acceptedFiles.length > 1 ? 's' : '', " uploaded: ").concat(fileNames, ". ");
|
|
8364
|
+
}
|
|
8365
|
+
if (filesRejected.length > 0) {
|
|
8366
|
+
var rejectionMessages = filesRejected.map(function (rejection) {
|
|
8367
|
+
var firstError = rejection.errors[0];
|
|
8368
|
+
var rejectionMessage = getErrorMessage(firstError, { fileList: fileList, maxSize: maxSize }, textOverrides);
|
|
8369
|
+
return "Could not upload ".concat(rejection.file.name, ": ").concat(rejectionMessage.endsWith('.')
|
|
8370
|
+
? rejectionMessage
|
|
8371
|
+
: "".concat(rejectionMessage, "."));
|
|
8372
|
+
});
|
|
8373
|
+
message += rejectionMessages.join('');
|
|
8374
|
+
}
|
|
8375
|
+
return message.trim();
|
|
8376
|
+
};
|
|
8354
8377
|
|
|
8355
8378
|
var MultiDropzone = function (_a) {
|
|
8356
8379
|
var _b;
|
|
8357
8380
|
var uploadedFiles = _a.uploadedFiles, onFileSelect = _a.onFileSelect, onRemoveFile = _a.onRemoveFile, uploading = _a.uploading, _c = _a.isCondensed, isCondensed = _c === void 0 ? false : _c, accept = _a.accept, _d = _a.maxFiles, maxFiles = _d === void 0 ? 0 : _d, maxSize = _a.maxSize, textOverrides = _a.textOverrides;
|
|
8358
8381
|
var _e = React.useState([]), errors = _e[0], setErrors = _e[1];
|
|
8382
|
+
var _f = React.useState(''), statusMessage = _f[0], setStatusMessage = _f[1];
|
|
8359
8383
|
var formattedAccept = getFormattedAcceptObject(accept);
|
|
8360
8384
|
var fileList = formatAcceptFileList(formattedAccept);
|
|
8361
8385
|
var placeholder = getPlaceholder(textOverrides, accept, maxSize);
|
|
@@ -8368,6 +8392,14 @@ var MultiDropzone = function (_a) {
|
|
|
8368
8392
|
};
|
|
8369
8393
|
var onDrop = React.useCallback(function (acceptedFiles, filesRejected) {
|
|
8370
8394
|
onFileSelect(acceptedFiles);
|
|
8395
|
+
var messageForScreenReader = getStatusMessage({
|
|
8396
|
+
acceptedFiles: acceptedFiles,
|
|
8397
|
+
filesRejected: filesRejected,
|
|
8398
|
+
fileList: fileList,
|
|
8399
|
+
maxSize: maxSize,
|
|
8400
|
+
textOverrides: textOverrides,
|
|
8401
|
+
});
|
|
8402
|
+
setStatusMessage(messageForScreenReader);
|
|
8371
8403
|
setErrors(function (previousErrors) { return __spreadArray$1(__spreadArray$1([], previousErrors, true), filesRejected.map(function (_a) {
|
|
8372
8404
|
var errors = _a.errors;
|
|
8373
8405
|
return ({
|
|
@@ -8376,15 +8408,15 @@ var MultiDropzone = function (_a) {
|
|
|
8376
8408
|
});
|
|
8377
8409
|
}), true); });
|
|
8378
8410
|
}, [fileList, maxSize, onFileSelect, textOverrides]);
|
|
8379
|
-
var
|
|
8411
|
+
var _g = useDropzone({
|
|
8380
8412
|
accept: formattedAccept,
|
|
8381
8413
|
disabled: uploading,
|
|
8382
8414
|
maxSize: maxSize,
|
|
8383
8415
|
onDrop: onDrop,
|
|
8384
|
-
}), getRootProps =
|
|
8416
|
+
}), getRootProps = _g.getRootProps, getInputProps = _g.getInputProps;
|
|
8385
8417
|
return (jsxRuntime.jsxs("div", { className: styles$C.container, children: [jsxRuntime.jsxs("div", __assign({ className: classNames$1("w100 ta-center br8 c-pointer ".concat(styles$C.dropzoneContainer), (_b = {},
|
|
8386
8418
|
_b[styles$C['dropzoneContainerDisabled']] = uploading,
|
|
8387
|
-
_b)) }, getRootProps(), { children: [jsxRuntime.jsx("input", __assign({ "data-testid": "ds-drop-input" }, getInputProps())), jsxRuntime.jsx(UploadCloudIcon, { className: isCondensed ? styles$C.img : '', size: isCondensed ? 24 : 64, color: 'purple-500' }), jsxRuntime.jsx("div", { className: "p-h4 mt8 d-block c-pointer ".concat(isCondensed ? styles$C.textInline : ''), children: uploading
|
|
8419
|
+
_b)) }, getRootProps(), { children: [jsxRuntime.jsx("div", { className: "sr-only", "aria-live": "polite", "aria-atomic": "true", children: statusMessage }), jsxRuntime.jsx("input", __assign({ "data-testid": "ds-drop-input" }, getInputProps())), jsxRuntime.jsx(UploadCloudIcon, { className: isCondensed ? styles$C.img : '', size: isCondensed ? 24 : 64, color: 'purple-500' }), jsxRuntime.jsx("div", { className: "p-h4 mt8 d-block c-pointer ".concat(isCondensed ? styles$C.textInline : ''), children: uploading
|
|
8388
8420
|
? (textOverrides === null || textOverrides === void 0 ? void 0 : textOverrides.currentlyUploadingText) ||
|
|
8389
8421
|
'Please wait while uploading file...'
|
|
8390
8422
|
: (textOverrides === null || textOverrides === void 0 ? void 0 : textOverrides.instructionsText) || 'Choose file or drag & drop' }), jsxRuntime.jsx("div", { className: "p-p--small tc-grey-500", children: (textOverrides === null || textOverrides === void 0 ? void 0 : textOverrides.supportsText) || placeholder })] })), errors.map(function (_a) {
|
|
@@ -8395,7 +8427,8 @@ var MultiDropzone = function (_a) {
|
|
|
8395
8427
|
name: message,
|
|
8396
8428
|
progress: 0,
|
|
8397
8429
|
}, onRemoveFile: function () { return removeError(id); }, uploading: false }, id));
|
|
8398
|
-
}), uploadedFiles.length > 0 && (jsxRuntime.jsx("div", { className: "w100 mt16", children: uploadedFiles.map(function (file) { return (jsxRuntime.jsx(UploadFileCell, __assign({ uploadStatus: getUploadStatus(file.progress, file.error), file: file }, (!onRemoveFile ? {} : { onRemoveFile: onRemoveFile }), { uploading: uploading }), file.id)); }) })), jsxRuntime.jsx(AnimateHeight, { duration: 300, height: isOverMaxFiles ? 'auto' : 0, children: jsxRuntime.jsx("p", { className: "tc-red-500 mt16", children: (textOverrides === null || textOverrides === void 0 ? void 0 : textOverrides.tooManyFilesError) ||
|
|
8430
|
+
}), uploadedFiles.length > 0 && (jsxRuntime.jsx("div", { className: "w100 mt16", children: uploadedFiles.map(function (file) { return (jsxRuntime.jsx(UploadFileCell, __assign({ uploadStatus: getUploadStatus(file.progress, file.error), file: file }, (!onRemoveFile ? {} : { onRemoveFile: onRemoveFile }), { uploading: uploading }), file.id)); }) })), jsxRuntime.jsx(AnimateHeight, { duration: 300, height: isOverMaxFiles ? 'auto' : 0, children: jsxRuntime.jsx("p", { className: "tc-red-500 mt16", children: (textOverrides === null || textOverrides === void 0 ? void 0 : textOverrides.tooManyFilesError) ||
|
|
8431
|
+
"You can upload maximum ".concat(maxFiles, " files.") }) })] }));
|
|
8399
8432
|
};
|
|
8400
8433
|
|
|
8401
8434
|
var css_248z$B = ".style-module_button__mw9kQ {\n height: 48px;\n}\n\n.style-module_chip-complete__3YkB9 {\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: white;\n border-radius: 8px;\n padding: 8px 16px;\n height: 48px;\n}";
|
|
@@ -8543,7 +8576,7 @@ styleInject(css_248z$y);
|
|
|
8543
8576
|
|
|
8544
8577
|
var Checkbox = function (_a) {
|
|
8545
8578
|
var _b;
|
|
8546
|
-
var options = _a.options, _c = _a.value, value = _c === void 0 ? [] : _c, onChange = _a.onChange, _d = _a.wide, wide = _d === void 0 ? false : _d, _e = _a.inlineLayout, inlineLayout = _e === void 0 ? false : _e, _f = _a.bordered, bordered = _f === void 0 ? true : _f, classNamesObj = _a.classNames,
|
|
8579
|
+
var options = _a.options, _c = _a.value, value = _c === void 0 ? [] : _c, onChange = _a.onChange, _d = _a.wide, wide = _d === void 0 ? false : _d, _e = _a.inlineLayout, inlineLayout = _e === void 0 ? false : _e, _f = _a.bordered, bordered = _f === void 0 ? true : _f, classNamesObj = _a.classNames, fieldLegend = _a.fieldLegend;
|
|
8547
8580
|
var hasNoneValue = Object.keys(options).includes('NONE');
|
|
8548
8581
|
var handleOnChange = function (newValue) {
|
|
8549
8582
|
if (value === null || value === void 0 ? void 0 : value.includes(newValue)) {
|
|
@@ -8568,12 +8601,15 @@ var Checkbox = function (_a) {
|
|
|
8568
8601
|
var isCheckboxLabelObject = function (label) {
|
|
8569
8602
|
return label.title !== undefined;
|
|
8570
8603
|
};
|
|
8604
|
+
var legend = fieldLegend !== null && fieldLegend !== void 0 ? fieldLegend : (Object.keys(options).length > 1
|
|
8605
|
+
? 'Select one or more options'
|
|
8606
|
+
: 'You may select this option');
|
|
8571
8607
|
return (jsxRuntime.jsxs("fieldset", { className: classNames$1(classNamesObj === null || classNamesObj === void 0 ? void 0 : classNamesObj.container, styles$x.container, 'd-flex gap8', (_b = {},
|
|
8572
8608
|
_b[styles$x.narrow] = !wide,
|
|
8573
8609
|
_b['fd-row'] = inlineLayout,
|
|
8574
8610
|
_b['f-wrap'] = inlineLayout,
|
|
8575
8611
|
_b['fd-column'] = !inlineLayout,
|
|
8576
|
-
_b)), children: [jsxRuntime.jsx("legend", { className: "sr-only", children:
|
|
8612
|
+
_b)), children: [jsxRuntime.jsx("legend", { className: "sr-only", children: legend }), entries.map(function (_a) {
|
|
8577
8613
|
var currentValue = _a[0], label = _a[1];
|
|
8578
8614
|
var checked = value === null || value === void 0 ? void 0 : value.includes(currentValue);
|
|
8579
8615
|
var customIcon = label === null || label === void 0 ? void 0 : label.icon;
|
|
@@ -15404,7 +15440,7 @@ styleInject(css_248z$h);
|
|
|
15404
15440
|
|
|
15405
15441
|
var TableInfoButton = function (_a) {
|
|
15406
15442
|
var onClick = _a.onClick, _b = _a.className, className = _b === void 0 ? '' : _b;
|
|
15407
|
-
return (jsxRuntime.jsx("button", { className: "p-btn--secondary ".concat(styles$g.button, " ").concat(className), type: "button", "data-testid": "ds-table-info-button", onClick: onClick, children: jsxRuntime.jsx(Info, { size: 20 }) }));
|
|
15443
|
+
return (jsxRuntime.jsx("button", { className: "p-btn--secondary ".concat(styles$g.button, " ").concat(className), type: "button", "data-testid": "ds-table-info-button", onClick: onClick, "aria-label": "View more information", title: "View more information", children: jsxRuntime.jsx(Info, { size: 20 }) }));
|
|
15408
15444
|
};
|
|
15409
15445
|
|
|
15410
15446
|
var TableButton = function (_a) {
|